Skip to content

Commit c95c296

Browse files
committed
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
# Conflicts: # bsp/gd32/gd32107c-eval/rtconfig.h
2 parents f7ba146 + 32a5668 commit c95c296

File tree

774 files changed

+34271
-130641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

774 files changed

+34271
-130641
lines changed

.github/workflows/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ jobs:
3535
- {RTT_BSP: "asm9260t", RTT_TOOL_CHAIN: "sourcery-arm"}
3636
- {RTT_BSP: "at91sam9260", RTT_TOOL_CHAIN: "sourcery-arm"}
3737
- {RTT_BSP: "allwinner_tina", RTT_TOOL_CHAIN: "sourcery-arm"}
38+
- {RTT_BSP: "gd32/gd32103c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
39+
- {RTT_BSP: "gd32/gd32105c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
3840
- {RTT_BSP: "gd32/gd32105r-start", RTT_TOOL_CHAIN: "sourcery-arm"}
41+
- {RTT_BSP: "gd32/gd32107c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
3942
- {RTT_BSP: "gd32/gd32205r-start", RTT_TOOL_CHAIN: "sourcery-arm"}
43+
- {RTT_BSP: "gd32/gd32303e-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
4044
- {RTT_BSP: "gd32/gd32305r-start", RTT_TOOL_CHAIN: "sourcery-arm"}
4145
- {RTT_BSP: "gd32/gd32407v-start", RTT_TOOL_CHAIN: "sourcery-arm"}
46+
- {RTT_BSP: "gd32/gd32450z-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
4247
- {RTT_BSP: "gd32e230k-start", RTT_TOOL_CHAIN: "sourcery-arm"}
4348
- {RTT_BSP: "gd32vf103v-eval", RTT_TOOL_CHAIN: "sourcery-riscv-none-embed"}
4449
- {RTT_BSP: "gd32303e-eval", RTT_TOOL_CHAIN: "sourcery-arm"}

.github/workflows/action_tools.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: ToolsCI
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
# Runs at 16:00 UTC (BeiJing 00:00) on the 1st of every month
7+
schedule:
8+
- cron: '0 16 1 * *'
9+
push:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- documentation/**
14+
- '**/README.md'
15+
- '**/README_zh.md'
16+
- '**/*.c'
17+
- '**/*.h'
18+
- '**/*.cpp'
19+
pull_request:
20+
branches:
21+
- master
22+
paths-ignore:
23+
- documentation/**
24+
- '**/README.md'
25+
- '**/README_zh.md'
26+
- '**/*.c'
27+
- '**/*.h'
28+
- '**/*.cpp'
29+
30+
jobs:
31+
test:
32+
runs-on: ubuntu-latest
33+
name: Tools
34+
strategy:
35+
fail-fast: false
36+
env:
37+
TEST_BSP_ROOT: bsp/stm32/stm32f407-atk-explorer
38+
steps:
39+
- uses: actions/checkout@v1
40+
41+
- name: Install Tools
42+
shell: bash
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get -yqq install scons
46+
47+
- name: Install Arm ToolChains
48+
if: ${{ success() }}
49+
shell: bash
50+
run: |
51+
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
52+
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
53+
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
54+
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
55+
56+
- name: Build Tools
57+
run: |
58+
scons --pyconfig-silent -C $TEST_BSP_ROOT
59+
scons -j$(nproc) -C $TEST_BSP_ROOT
60+
61+
- name: Project generate Tools
62+
if: ${{ success() }}
63+
run: |
64+
echo "Test to generate mdk project"
65+
scons --target=mdk -s -C $TEST_BSP_ROOT
66+
scons --target=mdk4 -s -C $TEST_BSP_ROOT
67+
scons --target=mdk5 -s -C $TEST_BSP_ROOT
68+
echo "Test to generate iar project"
69+
scons --target=iar -s -C $TEST_BSP_ROOT
70+
echo "Test to generate eclipse project"
71+
scons --target=eclipse -s -C $TEST_BSP_ROOT
72+
echo "Test to generate cmake project"
73+
scons --target=cmake -s -C $TEST_BSP_ROOT
74+
echo "Test to generate makefile project"
75+
scons --target=makefile -s -C $TEST_BSP_ROOT
76+
77+
- name: Project dist Tools
78+
if: ${{ success() }}
79+
run: |
80+
echo "Test to dist project"
81+
scons --dist -C $TEST_BSP_ROOT
82+
scons --dist-ide -C $TEST_BSP_ROOT

.github/workflows/action_utest.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
name: AutoTestCI
22

33
# Controls when the action will run. Triggers the workflow on push or pull request
4-
on: [push, pull_request]
4+
# events but only for the master branch
5+
on:
6+
# Runs at 16:00 UTC (BeiJing 00:00) on the 1st of every month
7+
schedule:
8+
- cron: '0 16 1 * *'
9+
push:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- documentation/**
14+
- '**/README.md'
15+
- '**/README_zh.md'
16+
pull_request:
17+
branches:
18+
- master
19+
paths-ignore:
20+
- documentation/**
21+
- '**/README.md'
22+
- '**/README_zh.md'
523

624
jobs:
725
test:

bsp/CME_M7/drivers/app_phy.c

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#include <stdio.h>
22
#include "app_phy.h"
33

4-
#define PHY_BASE_ADDR 0x7
4+
#define PHY_BASE_ADDR 0x7
55

66
#define PHY_REG_CONTROL 0x0
77
#define PHY_REG_STATUS 0x1
88
#define PHY_REG_ANE 0x6
99
#define PHY_REG_SPEC_STATUS 0x11
10-
#define PHY_REG_EXTEND_STATUS 0x1B
10+
#define PHY_REG_EXTEND_STATUS 0x1B
1111

12-
#define PHY_BIT_CONTROL_RESET 0x8000 /*!< Control reg : reset */
13-
#define PHY_BIT_CONTROL_ANEN 0x1000 /*!< Control reg : auto-negotiation enable */
14-
#define PHY_BIT_CONTROL_RSAN 0x0200 /*!< Control reg : auto-negotiation restart */
12+
#define PHY_BIT_CONTROL_RESET 0x8000 /*!< Control reg : reset */
13+
#define PHY_BIT_CONTROL_ANEN 0x1000 /*!< Control reg : auto-negotiation enable */
14+
#define PHY_BIT_CONTROL_RSAN 0x0200 /*!< Control reg : auto-negotiation restart */
1515

16-
#define PHY_BIT_STATUS_ANC 0x0020 /*!< Status reg : auto-negotiation complete */
17-
#define PHY_BIT_STATUS_LINK 0x0004 /*!< Status reg : link is up */
16+
#define PHY_BIT_STATUS_ANC 0x0020 /*!< Status reg : auto-negotiation complete */
17+
#define PHY_BIT_STATUS_LINK 0x0004 /*!< Status reg : link is up */
1818

19-
#define PHY_BIT_ANE_LPAN 0x0001 /*!< ANE reg : link partner can auto-neg */
19+
#define PHY_BIT_ANE_LPAN 0x0001 /*!< ANE reg : link partner can auto-neg */
2020

2121
#define PHY_BIT_SPEED 0xC000 /*!< specific status reg : speed */
2222
#define PHY_BIT_DUPLEX 0x2000 /*!< specific status reg : duplex */
@@ -25,24 +25,24 @@
2525
#define PHY_BIT_AUTO_MEDIA_REG_DISABLE 0x0200 /*!< extended status reg : auto media register select disable */
2626

2727
void phy_Reset() {
28-
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_CONTROL, PHY_BIT_CONTROL_RESET);
29-
30-
while (1) {
31-
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_CONTROL);
32-
if ((ret & PHY_BIT_CONTROL_RESET) == 0) {
33-
break;
34-
}
35-
}
28+
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_CONTROL, PHY_BIT_CONTROL_RESET);
29+
30+
while (1) {
31+
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_CONTROL);
32+
if ((ret & PHY_BIT_CONTROL_RESET) == 0) {
33+
break;
34+
}
35+
}
3636
}
3737

3838
void phy_AutoMediaSelect() {
39-
uint32_t data;
39+
uint32_t data;
4040

41-
// auto media and auto media register selection
42-
data = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS);
43-
data &= ~PHY_BIT_AUTO_MEDIA_DISABLE;
44-
data &= ~PHY_BIT_AUTO_MEDIA_REG_DISABLE;
45-
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS, data);
41+
// auto media and auto media register selection
42+
data = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS);
43+
data &= ~PHY_BIT_AUTO_MEDIA_DISABLE;
44+
data &= ~PHY_BIT_AUTO_MEDIA_REG_DISABLE;
45+
ETH_PhyWrite(PHY_BASE_ADDR, PHY_REG_EXTEND_STATUS, data);
4646
}
4747

4848
void phy_AutoNeg()
@@ -65,61 +65,61 @@ void phy_AutoNeg()
6565
}
6666

6767
BOOL phy_IsLink() {
68-
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_STATUS);
69-
return (ret & PHY_BIT_STATUS_LINK) ? TRUE : FALSE;
68+
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_STATUS);
69+
return (ret & PHY_BIT_STATUS_LINK) ? TRUE : FALSE;
7070
}
7171

7272
BOOL phy_PartnerCanAutoNeg() {
73-
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_ANE);
74-
return (ret & PHY_BIT_ANE_LPAN) ? TRUE : FALSE;
73+
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_ANE);
74+
return (ret & PHY_BIT_ANE_LPAN) ? TRUE : FALSE;
7575
}
7676

7777
uint32_t phy_GetSpeed() {
78-
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
79-
return ((ret & PHY_BIT_SPEED) >> 14);
78+
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
79+
return ((ret & PHY_BIT_SPEED) >> 14);
8080
}
8181

8282
uint32_t phy_GetDuplex() {
83-
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
84-
return ((ret & PHY_BIT_DUPLEX) >> 13);
83+
uint32_t ret = ETH_PhyRead(PHY_BASE_ADDR, PHY_REG_SPEC_STATUS);
84+
return ((ret & PHY_BIT_DUPLEX) >> 13);
8585
}
8686

8787
BOOL phy_Init() {
88-
phy_AutoMediaSelect();
89-
phy_AutoNeg();
90-
91-
if (!phy_PartnerCanAutoNeg()) {
92-
printf("Warning:: PHY's partner can't do auto-negotiation\n");
93-
}
94-
95-
if (!phy_IsLink()) {
96-
printf("link is down\n");
97-
return FALSE;
98-
}
99-
100-
{
101-
uint32_t speed = phy_GetSpeed();
102-
if (speed == PHY_SPEED_10) {
103-
speed = 10;
104-
} else if (speed == PHY_SPEED_100) {
105-
speed = 100;
106-
} else if (speed == PHY_SPEED_1000) {
107-
speed = 1000;
108-
}
109-
110-
printf("PHY runs in %dM speed %s duplex\n",
111-
speed, (phy_GetDuplex() == PHY_DUPLEX_HALF) ? "half" : "full");
112-
}
113-
114-
// After auto-negcioation, Mawell PHY need some
115-
// time to initial itself.
116-
// So we have to delay some time since different
117-
// connection way, such as direct wire, hub, switch.
118-
// If not to delay, the first several sent frame
119-
// may be lost.
120-
// Please according to actual environment to tune
121-
// this delay.
122-
udelay(200000);
123-
124-
return TRUE;
88+
phy_AutoMediaSelect();
89+
phy_AutoNeg();
90+
91+
if (!phy_PartnerCanAutoNeg()) {
92+
printf("Warning:: PHY's partner can't do auto-negotiation\n");
93+
}
94+
95+
if (!phy_IsLink()) {
96+
printf("link is down\n");
97+
return FALSE;
98+
}
99+
100+
{
101+
uint32_t speed = phy_GetSpeed();
102+
if (speed == PHY_SPEED_10) {
103+
speed = 10;
104+
} else if (speed == PHY_SPEED_100) {
105+
speed = 100;
106+
} else if (speed == PHY_SPEED_1000) {
107+
speed = 1000;
108+
}
109+
110+
printf("PHY runs in %dM speed %s duplex\n",
111+
speed, (phy_GetDuplex() == PHY_DUPLEX_HALF) ? "half" : "full");
112+
}
113+
114+
// After auto-negcioation, Mawell PHY need some
115+
// time to initial itself.
116+
// So we have to delay some time since different
117+
// connection way, such as direct wire, hub, switch.
118+
// If not to delay, the first several sent frame
119+
// may be lost.
120+
// Please according to actual environment to tune
121+
// this delay.
122+
udelay(200000);
123+
124+
return TRUE;
125125
}

bsp/CME_M7/drivers/app_phy.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
#include "cmem7_includes.h"
99

10-
#define PHY_SPEED_10 0x0 /*!< SPEED : 10M */
11-
#define PHY_SPEED_100 0x1 /*!< SPEED : 100M */
12-
#define PHY_SPEED_1000 0x2 /*!< SPEED : 1000M */
13-
14-
#define PHY_DUPLEX_HALF 0x0 /*!< DUPLEX : half */
15-
#define PHY_DUPLEX_FULL 0x1 /*!< DUPLEX : full */
16-
10+
#define PHY_SPEED_10 0x0 /*!< SPEED : 10M */
11+
#define PHY_SPEED_100 0x1 /*!< SPEED : 100M */
12+
#define PHY_SPEED_1000 0x2 /*!< SPEED : 1000M */
13+
14+
#define PHY_DUPLEX_HALF 0x0 /*!< DUPLEX : half */
15+
#define PHY_DUPLEX_FULL 0x1 /*!< DUPLEX : full */
16+
1717
void phy_Reset(void);
1818
void phy_AutoNeg(void);
1919
BOOL phy_IsLink(void);
@@ -26,7 +26,7 @@ BOOL phy_Init(void);
2626
}
2727
#endif
2828

29-
#endif
29+
#endif
3030

3131

3232

bsp/CME_M7/drivers/emac.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* File : emac.c
33
* This file is part of RT-Thread RTOS
4-
* COPYRIGHT (C) 2006-2014, RT-Thread Develop Team
4+
* COPYRIGHT (C) 2006-2021, RT-Thread Develop Team
55
*
66
* The license and distribution terms for this file may be
77
* found in the file LICENSE in this distribution or at
@@ -38,7 +38,7 @@ struct rt_cme_eth
3838
struct eth_device parent;
3939

4040
/* interface address info. */
41-
rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* hw address */
41+
rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* hw address */
4242

4343
uint32_t ETH_Speed;
4444
uint32_t ETH_Mode;
@@ -95,8 +95,8 @@ uint32_t txTotalMemory = 0x2000;
9595
BOOL isRxNoBuf = FALSE;
9696

9797
#define ETH_MAX_PACKET_SIZE 1520 /* ETH_HEADER + ETH_EXTRA + MAX_ETH_PAYLOAD + ETH_CRC */
98-
#define ETH_RXBUFNB 4
99-
#define ETH_TXBUFNB 2
98+
#define ETH_RXBUFNB 4
99+
#define ETH_TXBUFNB 2
100100

101101
struct eth_rx_buffer
102102
{

0 commit comments

Comments
 (0)