]> git.sur5r.net Git - u-boot/commitdiff
ppc: xilinx-ppc440-generic: Wire LL_TEMAC driver
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Tue, 26 Jan 2016 12:47:45 +0000 (13:47 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jan 2016 14:57:20 +0000 (15:57 +0100)
If the xparameters file contains a LL_TEMAC definition compile its
driver and the net commands.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/ppc440-generic/xilinx_ppc440_generic.c
board/xilinx/ppc440-generic/xparameters.h
configs/xilinx-ppc440-generic_defconfig
include/configs/xilinx-ppc440-generic.h

index 0e3ab94e31ef34720963f6dd0799ffedbcf5f44f..d8233529304d018b1d720d31b67e299a1244135a 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <netdev.h>
 #include <asm/processor.h>
 
 int checkboard(void)
@@ -34,3 +35,24 @@ void get_sys_info(sys_info_t *sys_info)
 int get_serial_clock(void){
        return XPAR_UARTNS550_0_CLOCK_FREQ_HZ;
 }
+
+int board_eth_init(bd_t *bis)
+{
+       int ret = 0;
+
+       puts("Init xilinx temac\n");
+#ifdef XPAR_LLTEMAC_0_BASEADDR
+       ret |= xilinx_ll_temac_eth_init(bis, XPAR_LLTEMAC_0_BASEADDR,
+                       XILINX_LL_TEMAC_M_SDMA_DCR | XILINX_LL_TEMAC_M_SDMA_PLB,
+                       XPAR_LLTEMAC_0_LLINK_CONNECTED_BASEADDR);
+
+#endif
+
+#ifdef XPAR_LLTEMAC_1_BASEADDR
+       ret |= xilinx_ll_temac_eth_init(bis, XPAR_LLTEMAC_1_BASEADDR,
+                       XILINX_LL_TEMAC_M_SDMA_DCR | XILINX_LL_TEMAC_M_SDMA_PLB,
+                       XPAR_LLTEMAC_1_LLINK_CONNECTED_BASEADDR);
+#endif
+
+       return ret;
+}
index 9685560673abaa429b27501574ffec735fedede0..b45a6a1d7668176e2c595992740d325618dd43e2 100644 (file)
@@ -18,5 +18,9 @@
 #define XPAR_CORE_CLOCK_FREQ_HZ                400000000
 #define XPAR_INTC_MAX_NUM_INTR_INPUTS  32
 #define XPAR_UARTNS550_0_CLOCK_FREQ_HZ 100000000
+#define XPAR_LLTEMAC_0_LLINK_CONNECTED_BASEADDR 0x80
+#define XPAR_LLTEMAC_1_LLINK_CONNECTED_BASEADDR 0x98
+#define XPAR_LLTEMAC_0_BASEADDR                0x83000000
+#define XPAR_LLTEMAC_1_BASEADDR                0x83000040
 
 #endif
index c66357e08724cdff199d3b131349e71fa37d23be..3bf2c4f8b88467f724dbc92f826f155aaddfc1be 100644 (file)
@@ -11,3 +11,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_DEFAULT_DEVICE_TREE="xilinx-ppc440-generic"
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_NETCONSOLE=y
index 2af5f7fc1de5d34e95800421d213da47da690593..f2505a6cd2b288801959c78a4d072c5f048a6a5b 100644 (file)
@@ -8,32 +8,42 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/*CPU*/
+/* CPU */
 #define CONFIG_440                     1
 #define CONFIG_XILINX_440              1
 #define CONFIG_XILINX_PPC440_GENERIC   1
 #include "../board/xilinx/ppc440-generic/xparameters.h"
 
-/*Mem Map*/
+/* Mem Map */
 #define CONFIG_SYS_SDRAM_SIZE_MB       256
 
-/*Env*/
+/* Env */
 #define        CONFIG_ENV_IS_IN_FLASH  1
 #define        CONFIG_ENV_SIZE         0x20000
 #define        CONFIG_ENV_SECT_SIZE    0x20000
 #define CONFIG_ENV_OFFSET      0x340000
 #define CONFIG_ENV_ADDR                (XPAR_FLASH_MEM0_BASEADDR+CONFIG_ENV_OFFSET)
 
-/*Misc*/
+/* Misc */
 #define CONFIG_PREBOOT         "echo U-Boot is up and running;"
 
-/*Flash*/
+/* Flash */
 #define        CONFIG_SYS_FLASH_SIZE           (128*1024*1024)
 #define        CONFIG_SYS_MAX_FLASH_SECT       1024
 #define MTDIDS_DEFAULT                 "nor0=flash"
 #define MTDPARTS_DEFAULT               "mtdparts=flash:-(user)"
 
-/*Generic Configs*/
+/* Net */
+#ifdef XPAR_LLTEMAC_0_BASEADDR
+#define CONFIG_XILINX_LL_TEMAC
+#define CONFIG_MII
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_MARVELL
+#define CONFIG_NET_RANDOM_ETHADDR
+#define CONFIG_LIB_RAND
+#endif
+
+/* Generic Configs */
 #include <configs/xilinx-ppc.h>
 
 #endif                                         /* __CONFIG_H */