From a62d54248a8e4c0ef77668973f6d82049f72e9dc Mon Sep 17 00:00:00 2001 From: Jagan Date: Mon, 28 May 2012 17:54:06 +0530 Subject: [PATCH] Xilinx: ARM: Build the ethernet for respective boards only. Few of the DC varients on zc770 doesn't have net support, so we make the ethernet as conditional compilation for respective boards. Signed-off-by: Jagan --- board/xilinx/zynq_common/Makefile | 5 +++-- board/xilinx/zynq_common/board.c | 2 ++ board/xilinx/zynq_common/xilinx_nandpss.c | 17 +++++++++++++++++ include/configs/zynq_zc770.h | 18 +++++++++++++----- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/board/xilinx/zynq_common/Makefile b/board/xilinx/zynq_common/Makefile index a7a0bf54c30..8e912055bb4 100644 --- a/board/xilinx/zynq_common/Makefile +++ b/board/xilinx/zynq_common/Makefile @@ -29,10 +29,11 @@ endif LIB = $(obj)lib$(BOARD).o COBJS-y := board.o \ - xemacpss_g.o xemacpss_control.o xemacpss_sinit.o \ - xemacpss_bdring.o xemacpss.o xgmac.o \ ../common/xbasic_types.o +COBJS-$(CONFIG_CMD_NET) += xemacpss_g.o xemacpss_control.o \ + xemacpss_sinit.o xemacpss_bdring.o \ + xemacpss.o xgmac.o COBJS-$(CONFIG_CMD_SPI) += pele_qspi.o xilinx_qspipss.o COBJS-$(CONFIG_CMD_NAND) += xilinx_nandpss.o COBJS-$(CONFIG_CMD_MMC) += mmc.o diff --git a/board/xilinx/zynq_common/board.c b/board/xilinx/zynq_common/board.c index 26a75ad62b0..5a1da9f8940 100644 --- a/board/xilinx/zynq_common/board.c +++ b/board/xilinx/zynq_common/board.c @@ -637,6 +637,7 @@ int board_late_init (void) return 0; } +#ifdef CONFIG_CMD_NET extern int Xgmac_register(bd_t *bis); int board_eth_init(bd_t *bis) @@ -645,6 +646,7 @@ int board_eth_init(bd_t *bis) return 0; } +#endif int dram_init(void) { diff --git a/board/xilinx/zynq_common/xilinx_nandpss.c b/board/xilinx/zynq_common/xilinx_nandpss.c index 25017712396..f237e65399e 100644 --- a/board/xilinx/zynq_common/xilinx_nandpss.c +++ b/board/xilinx/zynq_common/xilinx_nandpss.c @@ -46,6 +46,23 @@ #include #include "xilinx_nand_smc.h" +/* Data Memory Barrier */ +#define dmb() __asm__ __volatile__ ("dmb" : : : "memory") +#define SYNCHRONIZE_IO dmb() + +void XIo_Out32(u32 OutAddress, u32 Value) +{ + *(volatile u32 *) OutAddress = Value; + SYNCHRONIZE_IO; +} + +u32 XIo_In32(u32 InAddress) +{ + volatile u32 * temp = *(volatile u32 *)InAddress; + SYNCHRONIZE_IO; + return temp; +} + /********** stubs - Make Linux code compile in this environment **************/ #define EIO 5 #define ENXIO 6 diff --git a/include/configs/zynq_zc770.h b/include/configs/zynq_zc770.h index 27d9319b552..280236bfc03 100644 --- a/include/configs/zynq_zc770.h +++ b/include/configs/zynq_zc770.h @@ -84,7 +84,6 @@ #include #define CONFIG_CMD_DATE /* RTC? */ -#define CONFIG_CMD_PING /* Might be useful for debugging */ #define CONFIG_CMD_SAVEENV /* Command to save ENV to Flash */ #define CONFIG_REGINFO /* Again, debugging */ #undef CONFIG_CMD_SETGETDCR /* README says 4xx only */ @@ -201,6 +200,19 @@ #define CONFIG_UART1 1 #else #define CONFIG_UART0 1 +#endif + + /* + * Ethernet Settings + */ +#if defined(CONFIG_ZC770_XM010) || defined(CONFIG_ZC770_XM013) +#define CONFIG_CMD_PING /* Might be useful for debugging */ +#define CONFIG_NET_MULTI +#define CONFIG_XGMAC_PHY_ADDR 0x7 +#else +#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS +#undef CONFIG_BOOTM_NETBSD #endif /* @@ -217,10 +229,6 @@ /* Address Xilinx boot rom should use to launch u-boot */ #define CONFIG_PELE_XIP_START XPSS_QSPI_LIN_BASEADDR #endif - -/* common net settings */ -#define CONFIG_NET_MULTI -#define CONFIG_XGMAC_PHY_ADDR 0x7 #endif #if defined(CONFIG_ZC770_XM013) -- 2.47.3