Commit 1cdd1b54 authored by Dmitry Konyshev's avatar Dmitry Konyshev

RT #82124 Ethernet in U-boot for SF2-DEV-KIT BSP

parent 154b81ef
...@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk ...@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a LIB = $(obj)lib$(BOARD).a
COBJS := board.o COBJS := board.o mss_spi/mss_spi.o zl30362_config.o
SRCS := $(COBJS:.o=.c) SRCS := $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS)) OBJS := $(addprefix $(obj),$(COBJS))
......
...@@ -36,8 +36,29 @@ void dummy_func(void) ...@@ -36,8 +36,29 @@ void dummy_func(void)
return; return;
} }
extern void configure_zl30362(void);
#define SERDES0_LANE3_REGS 0x40029c00
#define TX_PST_RATIO 0x28
int board_init(void) int board_init(void)
{ {
/* some magic from the Libero design generated source code
to get the PHY working in the SGMII mode */
*(volatile uint32_t*)(SERDES0_LANE3_REGS + TX_PST_RATIO) = 0x0;
/* configure the ZL30362 Clock Network Synchronizer
(required for Ethernet to function in U-boot and Linux) */
configure_zl30362();
CORE_SF2_CFG->config_done = 1u; /* Signal to CoreSF2Reset that peripheral
configuration registers have
been written.*/
#if 0 /* FIXME: init_done is never signalled after a soft reset
if the DDR has been initialized before the reset. */
while(!CORE_SF2_CFG->init_done)
{
; /* Wait for INIT_DONE from CoreSF2Reset. */
}
#endif
return 0; return 0;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -79,6 +79,15 @@ struct m2s_sysreg { ...@@ -79,6 +79,15 @@ struct m2s_sysreg {
#define M2S_SYSREG ((volatile struct m2s_sysreg *)\ #define M2S_SYSREG ((volatile struct m2s_sysreg *)\
(M2S_SYSREG_BASE)) (M2S_SYSREG_BASE))
struct m2s_coresf2config {
unsigned int config_done;
unsigned int init_done;
unsigned int clr_init_done;
};
#define CORE_SF2_CFG_BASE 0x40022000u
#define CORE_SF2_CFG \
((volatile struct m2s_coresf2config *)CORE_SF2_CFG_BASE)
/* /*
* Reference clocks enumeration * Reference clocks enumeration
......
...@@ -141,6 +141,21 @@ ...@@ -141,6 +141,21 @@
#define CONFIG_SYS_RAM_BASE 0xA0000000 #define CONFIG_SYS_RAM_BASE 0xA0000000
#define CONFIG_SYS_RAM_SIZE (256 * 1024 * 1024) #define CONFIG_SYS_RAM_SIZE (256 * 1024 * 1024)
/*
* Ethernet driver configuration
*/
#define CONFIG_NET_MULTI
#define CONFIG_M2S_ETH
#define CONFIG_M2S_ETH_MODE_SGMII
#define CONFIG_SYS_RX_ETH_BUFFER 2
/*
* Use standard MII PHY API
*/
#define CONFIG_MII
#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
/* /*
* Configuration of the external Flash * Configuration of the external Flash
* No NOR Flash * No NOR Flash
...@@ -241,8 +256,8 @@ ...@@ -241,8 +256,8 @@
#undef CONFIG_CMD_IMLS #undef CONFIG_CMD_IMLS
#define CONFIG_CMD_LOADS #define CONFIG_CMD_LOADS
#undef CONFIG_CMD_MISC #undef CONFIG_CMD_MISC
/* #define CONFIG_CMD_NET */ #define CONFIG_CMD_NET
#undef CONFIG_CMD_NET #define CONFIG_CMD_PING
#undef CONFIG_CMD_NETBOOT #undef CONFIG_CMD_NETBOOT
#undef CONFIG_CMD_NFS #undef CONFIG_CMD_NFS
#undef CONFIG_CMD_SOURCE #undef CONFIG_CMD_SOURCE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment