*/ #include <common.h> #include <netdev.h> #include <zynqpl.h> #include <asm/arch/hardware.h> #include <asm/arch/sys_proto.h> DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_FPGA Xilinx_desc fpga; /* It can be done differently */ Xilinx_desc fpga010 = XILINX_XC7Z010_DESC(0x10); Xilinx_desc fpga020 = XILINX_XC7Z020_DESC(0x20); Xilinx_desc fpga030 = XILINX_XC7Z030_DESC(0x30); Xilinx_desc fpga045 = XILINX_XC7Z045_DESC(0x45); #endif int board_init(void) { #ifdef CONFIG_FPGA u32 idcode; idcode = zynq_slcr_get_idcode(); switch (idcode) { case XILINX_ZYNQ_7010: fpga = fpga010; break;
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; } #ifdef CONFIG_FPGA Xilinx_desc fpga = XILINX_XC7Z020_DESC(0); #endif int board_init(void) { /* temporary hack to clear pending irqs before Linux as it will hang Linux */ XIo_Out32(0xe0001014, 0x26d); /* temporary hack to take USB out of reset til the is fixed in Linux */ XIo_Out32(0xe000a204, 0x80); XIo_Out32(0xe000a208, 0x80); XIo_Out32(0xe000a040, 0x80);