Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
py_free-物联智能
rt-thread
提交
067315ff
R
rt-thread
项目概览
py_free-物联智能
/
rt-thread
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
067315ff
编写于
8月 03, 2022
作者:
mysterywolf
提交者:
mysterywolf
8月 03, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[phy] fix the PHY_FULL_DUPLEX conflicts
上级
1990af6c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
36 addition
and
58 deletion
+36
-58
bsp/stm32/libraries/HAL_Drivers/drv_eth.c
bsp/stm32/libraries/HAL_Drivers/drv_eth.c
+5
-6
bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c
bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c
+9
-0
bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.h
bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.h
+0
-10
bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c
bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c
+9
-0
bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.h
bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.h
+0
-9
components/drivers/include/drivers/phy.h
components/drivers/include/drivers/phy.h
+13
-31
components/drivers/phy/phy.c
components/drivers/phy/phy.c
+0
-2
未找到文件。
bsp/stm32/libraries/HAL_Drivers/drv_eth.c
浏览文件 @
067315ff
...
@@ -30,6 +30,11 @@
...
@@ -30,6 +30,11 @@
#define MAX_ADDR_LEN 6
#define MAX_ADDR_LEN 6
#undef PHY_FULL_DUPLEX
#define PHY_LINK (1 << 0)
#define PHY_100M (1 << 1)
#define PHY_FULL_DUPLEX (1 << 2)
struct
rt_stm32_eth
struct
rt_stm32_eth
{
{
/* inherit from ethernet device */
/* inherit from ethernet device */
...
@@ -401,12 +406,6 @@ void HAL_ETH_ErrorCallback(ETH_HandleTypeDef *heth)
...
@@ -401,12 +406,6 @@ void HAL_ETH_ErrorCallback(ETH_HandleTypeDef *heth)
LOG_E
(
"eth err"
);
LOG_E
(
"eth err"
);
}
}
enum
{
PHY_LINK
=
(
1
<<
0
),
PHY_100M
=
(
1
<<
1
),
PHY_FULL_DUPLEX
=
(
1
<<
2
),
};
static
void
phy_linkchange
()
static
void
phy_linkchange
()
{
{
static
rt_uint8_t
phy_speed
=
0
;
static
rt_uint8_t
phy_speed
=
0
;
...
...
bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c
浏览文件 @
067315ff
...
@@ -22,6 +22,15 @@
...
@@ -22,6 +22,15 @@
#define LOG_TAG "drv.emac"
#define LOG_TAG "drv.emac"
#include <drv_log.h>
#include <drv_log.h>
#undef PHY_FULL_DUPLEX
#undef PHY_HALF_DUPLEX
#define PHY_LINK (1 << 0)
#define PHY_10M (1 << 1)
#define PHY_100M (1 << 2)
#define PHY_1000M (1 << 3)
#define PHY_FULL_DUPLEX (1 << 4)
#define PHY_HALF_DUPLEX (1 << 5)
#define MAX_ADDR_LEN 6
#define MAX_ADDR_LEN 6
rt_base_t
level
;
rt_base_t
level
;
...
...
bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.h
浏览文件 @
067315ff
...
@@ -50,16 +50,6 @@ typedef struct
...
@@ -50,16 +50,6 @@ typedef struct
uint32_t
rdes3
;
uint32_t
rdes3
;
}
RxDmaDesc
;
}
RxDmaDesc
;
enum
{
PHY_LINK
=
(
1
<<
0
),
PHY_10M
=
(
1
<<
1
),
PHY_100M
=
(
1
<<
2
),
PHY_1000M
=
(
1
<<
3
),
PHY_FULL_DUPLEX
=
(
1
<<
4
),
PHY_HALF_DUPLEX
=
(
1
<<
5
)
};
#define RTL8211F_PHY_ADDR 1
/* PHY address */
#define RTL8211F_PHY_ADDR 1
/* PHY address */
#define ETH_TXBUFNB 4
/* 4 Tx buffers of size ETH_TX_BUF_SIZE */
#define ETH_TXBUFNB 4
/* 4 Tx buffers of size ETH_TX_BUF_SIZE */
...
...
bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c
浏览文件 @
067315ff
...
@@ -30,6 +30,15 @@ rt_base_t level;
...
@@ -30,6 +30,15 @@ rt_base_t level;
#define TX_DMA_ADD_BASE 0x2FFC7000
#define TX_DMA_ADD_BASE 0x2FFC7000
#define RX_DMA_ADD_BASE 0x2FFC7100
#define RX_DMA_ADD_BASE 0x2FFC7100
#undef PHY_FULL_DUPLEX
#undef PHY_HALF_DUPLEX
#define PHY_LINK (1 << 0)
#define PHY_10M (1 << 1)
#define PHY_100M (1 << 2)
#define PHY_1000M (1 << 3)
#define PHY_FULL_DUPLEX (1 << 4)
#define PHY_HALF_DUPLEX (1 << 5)
#if defined(__ICCARM__)
#if defined(__ICCARM__)
/* transmit buffer */
/* transmit buffer */
#pragma location = TX_ADD_BASE
#pragma location = TX_ADD_BASE
...
...
bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.h
浏览文件 @
067315ff
...
@@ -42,15 +42,6 @@ typedef struct
...
@@ -42,15 +42,6 @@ typedef struct
uint32_t
rdes3
;
uint32_t
rdes3
;
}
RxDmaDesc
;
}
RxDmaDesc
;
enum
{
PHY_LINK
=
(
1
<<
0
),
PHY_10M
=
(
1
<<
1
),
PHY_100M
=
(
1
<<
2
),
PHY_1000M
=
(
1
<<
3
),
PHY_FULL_DUPLEX
=
(
1
<<
4
),
PHY_HALF_DUPLEX
=
(
1
<<
5
)
};
#define RTL8211E_PHY_ADDR 7
/* PHY address */
#define RTL8211E_PHY_ADDR 7
/* PHY address */
#define ETH_TXBUFNB 4
/* 4 Tx buffers of size ETH_TX_BUF_SIZE */
#define ETH_TXBUFNB 4
/* 4 Tx buffers of size ETH_TX_BUF_SIZE */
...
...
components/drivers/include/drivers/phy.h
浏览文件 @
067315ff
...
@@ -19,52 +19,34 @@ extern "C"
...
@@ -19,52 +19,34 @@ extern "C"
#endif
#endif
/* Defines the PHY link speed. This is align with the speed for MAC. */
/* Defines the PHY link speed. This is align with the speed for MAC. */
enum
phy_speed
#define PHY_SPEED_10M 0U
/* PHY 10M speed. */
{
#define PHY_SPEED_100M 1U
/* PHY 100M speed. */
PHY_SPEED_10M
=
0U
,
/* PHY 10M speed. */
PHY_SPEED_100M
/* PHY 100M speed. */
};
/* Defines the PHY link duplex. */
/* Defines the PHY link duplex. */
enum
phy_duplex
#define PHY_HALF_DUPLEX 0U
/* PHY half duplex. */
{
#define PHY_FULL_DUPLEX 1U
/* PHY full duplex. */
PHY_HALF_DUPLEX
=
0U
,
/* PHY half duplex. */
PHY_FULL_DUPLEX
/* PHY full duplex. */
};
/*! @brief Defines the PHY loopback mode. */
/*! @brief Defines the PHY loopback mode. */
enum
phy_loop
#define PHY_LOCAL_LOOP 0U
/* PHY local loopback. */
{
#define PHY_REMOTE_LOOP 1U
/* PHY remote loopback. */
PHY_LOCAL_LOOP
=
0U
,
/* PHY local loopback. */
PHY_REMOTE_LOOP
/* PHY remote loopback. */
};
#define PHY_STATUS_OK 0U
#define PHY_STATUS_FAIL 1U
#define PHY_STATUS_TIMEOUT 2U
struct
rt_phy_msg
typedef
struct
rt_phy_msg
{
{
rt_uint32_t
reg
;
rt_uint32_t
reg
;
rt_uint32_t
value
;
rt_uint32_t
value
;
};
}
rt_phy_msg_t
;
typedef
struct
rt_phy_msg
rt_phy_msg_t
;
typedef
struct
rt_phy_device
struct
rt_phy_device
{
{
struct
rt_device
parent
;
struct
rt_device
parent
;
struct
rt_mdio_bus
*
bus
;
struct
rt_mdio_bus
*
bus
;
rt_uint32_t
addr
;
rt_uint32_t
addr
;
struct
rt_phy_ops
*
ops
;
struct
rt_phy_ops
*
ops
;
};
}
rt_phy_t
;
typedef
struct
rt_phy_device
rt_phy_t
;
enum
{
PHY_STATUS_OK
=
0
,
PHY_STATUS_FAIL
,
PHY_STATUS_TIMEOUT
,
};
typedef
rt_int32_t
rt_phy_status
;
typedef
rt_int32_t
rt_phy_status
;
...
...
components/drivers/phy/phy.c
浏览文件 @
067315ff
...
@@ -31,8 +31,6 @@ static rt_size_t phy_device_write(rt_device_t dev, rt_off_t pos, const void *buf
...
@@ -31,8 +31,6 @@ static rt_size_t phy_device_write(rt_device_t dev, rt_off_t pos, const void *buf
return
phy
->
bus
->
ops
->
write
(
phy
->
bus
,
phy
->
addr
,
msg
->
reg
,
&
(
msg
->
value
),
4
);
return
phy
->
bus
->
ops
->
write
(
phy
->
bus
,
phy
->
addr
,
msg
->
reg
,
&
(
msg
->
value
),
4
);
}
}
#ifdef RT_USING_DEVICE_OPS
#ifdef RT_USING_DEVICE_OPS
const
static
struct
rt_device_ops
phy_ops
=
const
static
struct
rt_device_ops
phy_ops
=
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录