*/
#include <common.h>
+#include <asm/io.h>
#include <asm/arch/mmc.h>
#include <asm/arch/nand.h>
#include <netdev.h>
#include <zynqpl.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch/sys_proto.h>
-#define BOOT_MODE_REG (XPSS_SYS_CTRL_BASEADDR + 0x25C)
#define BOOT_MODES_MASK 0x0000000F
#define QSPI_MODE (0x00000001) /**< QSPI */
#define NOR_FLASH_MODE (0x00000002) /**< NOR */
DECLARE_GLOBAL_DATA_PTR;
-#define dmbp() __asm__ __volatile__ ("dmb" : : : "memory")
-
-void XIo_Out32(u32 OutAddress, u32 Value)
-{
- *(volatile u32 *) OutAddress = Value;
- dmbp();
-}
-
-u32 XIo_In32(u32 InAddress)
-{
- volatile u32 temp = *(volatile u32 *)InAddress;
- dmbp();
- return temp;
-}
-
#ifdef CONFIG_FPGA
Xilinx_desc fpga = XILINX_XC7Z020_DESC(0);
#endif
/* temporary hack to clear pending irqs before Linux as it
will hang Linux */
- XIo_Out32(0xe0001014, 0x26d);
+ writel(0x26d, 0xe0001014);
/* 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);
- XIo_Out32(0xe000a040, 0x00);
- XIo_Out32(0xe000a040, 0x80);
+ writel(0x80, 0xe000a204);
+ writel(0x80, 0xe000a208);
+ writel(0x80, 0xe000a040);
+ writel(0x00, 0xe000a040);
+ writel(0x80, 0xe000a040);
icache_enable();
int board_late_init (void)
{
- u32 boot_mode;
-
- boot_mode = (XIo_In32(BOOT_MODE_REG) & BOOT_MODES_MASK);
- switch(boot_mode) {
+ switch ((zynq_slcr_get_boot_mode()) & BOOT_MODES_MASK) {
case QSPI_MODE:
setenv("modeboot", "qspiboot");
break;