nds32: Support eth DM.
PATCH 1/1 nds32: Support eth DM.
From: rick <[email protected]>
Add eth DM driver for ag101p board.
Enable random ethaddr.
Signed-off-by rick <[email protected]>
Cc Andes <[email protected]>
--- arch/nds32/dts/ag101p.dts | 1 + board/AndesTech/adp-ag101p/adp-ag101p.c | 5 +- configs/adp-ag101p_defconfig | 3 + drivers/net/Kconfig | 5 + drivers/net/ftmac100.c | 281 +++++++++++++++++++++++++------ include/configs/adp-ag101p.h | 6 - 6 files changed, 241 insertions(+), 60 deletions(-)
arch/nds32/dts/ag101p.dts +1 -0
@@ -7,6 +7,7 @@ aliases { uart0 = &serial0; + ethernet0 = &mac0; } ; chosen {
board/AndesTech/adp-ag101p/adp-ag101p.c +4 -1
@@ -7,9 +7,10 @@*/ #include <common.h> +#if defined(CONFIG_FTMAC100 ) && !defined(CONFIG_DM_ETH )#include <netdev.h> +#endif #include <asm/io.h> -#include <faraday/ftsdc010.h> #include <faraday/ftsmc020.h>
@@ -57,10 +58,12 @@ void dram_init_banksize(void) gd->bd->bi_dram[1 ].size =PHYS_SDRAM_1_SIZE ; } +#if defined(CONFIG_FTMAC100 ) && !defined(CONFIG_DM_ETH )int board_eth_init (bd_t *bd) {return ftmac100_initialize (bd); } +#endif ulong board_flash_get_legacy (ulong base,int banknum,flash_info_t *info) {
configs/adp-ag101p_defconfig +3 -0
@@ -11,11 +11,14 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y +CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_BLK=y CONFIG_DM_MMC=y CONFIG_DM_MMC_OPS=y CONFIG_NDS32_MMC=y +CONFIG_DM_ETH=y +CONFIG_FTMAC100=y CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_TIMER=y
drivers/net/Kconfig +5 -0
@@ -197,4 +197,9 @@ config PIC32_ETH This driver implements 10/100 Mbps Ethernet and MAC layer for Microchip PIC32 microcontrollers. +config FTMAC100 + bool "Ftmac100 Ethernet Support" + help + This MAC is present in Andestech AG101P SoCs. + endif # NETDEVICES
drivers/net/ftmac100.c +228 -53
411 lines not on this page · raw message
include/configs/adp-ag101p.h +0 -6
@@ -96,12 +96,6 @@#define CONFIG_SYS_NS16550_CLK ((18432000 * 20) / 25)/* AG101P */ /* -* Ethernet -*/ -#define CONFIG_FTMAC100 - - -/* * SD (MMC) controller */ #define CONFIG_MMC
Signature · 1 line
1.7.9.5