#ifdef CONFIG_SC59X_64
#define EARLY_PRINTK earlycon=adi_uart,0x31003000
#else
#define EARLY_PRINTK earlyprintk=serial,uart0,CONFIG_BAUDRATE
#endif

/* Config options */
ethaddr=02:80:ad:20:31:e8
eth1addr=02:80:ad:20:31:e9
httpdstp=8000
uart_console=CONFIG_UART_CONSOLE
#ifdef CONFIG_SC59X_64
initrd_high=0xffffffffffffffff
#else
initrd_high=0xffffffff
#endif
#if defined(CONFIG_SC59X) || defined(CONFIG_SC59X_64)
adi_image_offset=0x100000
#else
adi_image_offset=0xd0000
#endif

/* Args for each boot mode */
adi_bootargs=EARLY_PRINTK console=ttySC0,CONFIG_BAUDRATE vmalloc=512M
ramargs=setenv bootargs ${adi_bootargs}

addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off
rootpath=/romfs

/* Boot modes are selectable and should be defined in the board env before including */
#if defined(USE_NFS)
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath},tcp,nfsvers=3 ${adi_bootargs}
nfsboot=run nfsargs;
	run addip;
	wget ${loadaddr} ${serverip}:/fitImage;
	bootm
#endif

#if defined(USE_MMC)
mmcargs=setenv bootargs root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait ${adi_bootargs}
mmcboot=mmc rescan;
	ext4load mmc 0:1 ${loadaddr} /fitImage;
	run mmcargs;
	bootm
#endif

#if defined(USE_SPI)
spiargs=setenv bootargs rootfstype=ubifs root=ubi0:rootfs ubi.mtd=3 rw ${adi_bootargs}; setenv sfdev CONFIG_SC_BOOT_SPI_BUS:CONFIG_SC_BOOT_SPI_SSEL
spiboot=run spiargs;
	sf probe ${sfdev};
	sf read ${loadaddr} ${adi_image_offset} 0xf00000;
	bootm ${loadaddr}
#endif

#if defined(USE_OSPI)
ospiargs=setenv bootargs rootfstype=ubifs root=ubi0:rootfs ubi.mtd=3 rw ${adi_bootargs}; setenv sfdev CONFIG_SC_BOOT_OSPI_BUS:CONFIG_SC_BOOT_OSPI_SSEL
ospiboot=run ospiargs;
	sf probe ${sfdev};
	sf read ${loadaddr} ${adi_image_offset} 0xf00000;
	bootm ${loadaddr}
#endif

#if defined(USE_RAM)
ramboot=wget ${loadaddr} ${serverip}:/fitImage;
	run ramargs;
	bootm
#endif

#if defined(USE_USB)
usbargs=setenv bootargs root=/dev/sda2 rw rootfstype=ext4 rootwait ${adi_bootargs}
usbboot=usb start;
	run usbargs;
	ext4load usb 0:1 ${loadaddr} /fitImage;
	bootm ${loadaddr}
#endif
