diff --git a/include/configs/am335x_nrhw24.h b/include/configs/am335x_nrhw24.h index 551299494d..d21f318996 100644 --- a/include/configs/am335x_nrhw24.h +++ b/include/configs/am335x_nrhw24.h @@ -19,6 +19,11 @@ #include +/* TODO: Inject via build system */ +#define CONFIG_NRSW + + + /* Disable U-Boot load from filesystems, to save around 10 kB SPL image size */ #ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION # undef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION @@ -75,136 +80,111 @@ int eth_phy_timeout(void); * Memory map for booting Linux * * 0x80000000 63MB KERNEL_ADDR (kernel_addr), kernel execution address - * 0x83F00000 1MB FDT_ADDR (fdt_addr_r), device tree loading address if not included in kernel - * 0x84000000 126MB RD_ADDR (ramdisk_addr_r), ramdisc loading address - * 0x8BE00000 2MB PXE_ADDR (pxefile_addr_r), pxe configuration file (pxe get command) + * 0x83F00000 1MB FDT_ADDR_R (fdt_addr_r), device tree loading address if not included in kernel + * 126MB INIT_RD_HIGH (initrd_high), ramdisc top address for relocation + * 0x8BE00000 2MB PXE_ADDR (pxefile_addr_r), pxe configuration file (pxe get command) * 0x8C000000 1MB LOAD_ADDR (load_addr), loading address for generic files * 0x8C100000 31MB KERNEL_ADDR_R (kernel_addr_r), kernel loading address (will be relocated to kernel_addr) * 0x8E000000 4B NRSW reset reason * 0x90000000 256MB <>, Free space 512MB systems * 0xA0000000 512MB <>, Free space, 1GB systems only * 0xC0000000 End of RAM + * + * ((0x84000000 126MB RD_ADDR (ramdisk_addr_r), ramdisc loading address)) */ #define KERNEL_ADDR "0x80000000" -#define FDT_ADDR "0x83F00000" -#define RD_ADDR "0x84000000" +/*#define FDT_ADDR "0x82000000" /* /* NRSW, trying to use FDT_ADDR_R = 0x83F00000 instead */ +#define FDT_ADDR_R "0x83F00000" #define PXE_ADDR "0x8BE00000" #define LOAD_ADDR "0x8C000000" #define KERNEL_ADDR_R "0x8C100000" -#if 0 /* HW20 differences */ -#define LOAD_ADDR "0x83000000" 8c0000 -#define FDT_ADDR "0x82000000" 83f000 -#define PXE_ADDR "0x82800000" 8be000 -#define FDT_HIGH_ADDR "0x87000000" -#define INIT_RD_ADDR "0x88000000" -#endif - - +/* TODO: Check this with 1 GByte system */ +/* Most likely ramdisk and FDT will be loaded to too high adresses and boot will fail */ +#if 0 /* * Avoid copying ramdisc and dtb above 512MB, as it breaks Linux boot. * -1 means "do not copy" to high address, use in place. */ -#define INITRD_HIGH_ADDR "0x84000000" -#define FDT_HIGH_ADDR "0xffffffff" +#define INITRD_HIGH_ADDR "0x8BE0000" +#define RD_ADDR "0x84000000" +#define FDT_HIGH_ADDR "0x87000000" +#define FDT_HIGH_ADDR "0xffffffff" + + "fdt_high=" FDT_HIGH_ADDR "\0" /* Breaks NRSW, required by Yocto ! */ \ + "fdt_addr=" FDT_ADDR "\0" /* NRSW only, breaks yocto, can we move that to fdt_addr_r ? */ \ + "initrd_high=" INITRD_HIGH_ADDR "\0" /* (0x84000000) -> INIT_RD_ADDR (0x88000000) */ \ + "ramdisk_addr_r=" RD_ADDR "\0" \ + +#endif -/* TODO: Check big differences to NMHW20 */ #define CONFIG_EXTRA_ENV_SETTINGS \ - "fdt_image=am335x-nmhw24-prod1.dtb\0" \ - "fdt_addr_r=" FDT_ADDR "\0" \ - "fdt_high=" FDT_HIGH_ADDR "\0" \ - "initrd_high=" INITRD_HIGH_ADDR "\0" \ - "kernel_addr=" KERNEL_ADDR "\0" \ + /* Memory Adresses */ \ + "fdt_addr_r=" FDT_ADDR_R "\0" \ + "kernel_addr=" KERNEL_ADDR "\0" /* NRSW only */ \ "kernel_addr_r=" KERNEL_ADDR_R "\0" \ "load_addr=" LOAD_ADDR "\0" \ "pxefile_addr_r=" PXE_ADDR "\0" \ - "ramdisk_addr_r=" RD_ADDR "\0" \ + \ + /* Misc */ \ "defaultconsole=ttyS1\0" \ "fdt_skip_update=yes\0" \ + "bootdelay=0\0" \ + \ + /* Networking */ \ "ethprime=cpsw\0" \ "ethopts=ti_cpsw.rx_packet_max=1526\0" \ + "ipaddr=192.168.1.1\0" \ + "serverip=192.168.1.254\0" \ + "tftptimeout=2000\0" \ + "tftptimeoutcountmax=5\0" \ + "bootpretryperiod=10000\0" /* 2000 */ \ + "autoload=false\0" \ + \ + /* OSTree boot */ \ "bootcmd_otenv=ext4load mmc 1:1 $load_addr /boot/loader/uEnv.txt; " \ "env import -t $load_addr $filesize; " \ "setenv bootargs $bootargs root=/dev/ram0 console=$defaultconsole,115200 " \ "$ethopts rw ostree_root=/dev/mmcblk1p1\0" \ "bootcmd_rd_in_mmc=ext4load mmc 1:1 $kernel_addr_r /boot$kernel_image; " \ "bootm $kernel_addr_r\0" \ - "bootcmd=run bootcmd_otenv; run bootcmd_rd_in_mmc\0" \ - "bootdelay=0\0" \ - "ipaddr=192.168.1.1\0" \ - "serverip=192.168.1.254\0" \ - "tftptimeout=2000\0" \ - "tftptimeoutcountmax=5\0" \ - "bootpretryperiod=10000\0" \ - "autoload=false\0" \ - "tftp_recovery=tftpboot $kernel_addr recovery-image; tftpboot $fdt_addr_r recovery-dtb; " \ - "setenv bootargs rdinit=/etc/preinit console=$defaultconsole,115200 " \ - "debug ethopts; " \ - "bootz $kernel_addr - $fdt_addr_r\0" \ - "pxe_recovery=mdio up $ethprime && dhcp && pxe get && pxe boot\0" \ - "recovery=run pxe_recovery || setenv ipaddr $ipaddr; setenv serverip $serverip; run tftp_recovery\0" \ - /* setenv ipaddr and serverip is necessary, because dhclient can destroy the IPs internally */ - - -#if 0 -#define CONFIG_EXTRA_ENV_SETTINGS \ - "kernel_image=kernel.bin\0" \ - "fdt_image=openwrt-nrhw20-nb1601.dtb\0"\ - "modeboot=sdboot\0" \ - "fdt_addr=" FDT_ADDR "\0" \ - "kernel_addr=" KERNEL_ADDR "\0" \ - "load_addr=" LOAD_ADDR "\0" \ - "root_part=1\0" /* Default root partition, overwritten in board file */ \ - "defaultconsole=ttyS1\0" /* Default output console */ \ - "add_sd_bootargs=setenv bootargs $bootargs root=/dev/mmcblk1p$root_part rootfstype=ext4 " \ + "bootcmd=run shieldcmd; run bootcmd_otenv; run bootcmd_rd_in_mmc\0" \ + \ + /* NRSW boot */ \ + "root_part=1\0" /* from NRSW, required here? set from board.c */ \ + "kernel_image=kernel.bin\0" \ + "fdt_image=am335x-nmhw24-prod1.dtb\0" /* diff, openwrt-nrhw24-nb801.dtb, not relevant as it will be overwritten */ \ + "add_sd_bootargs=setenv bootargs $bootargs root=/dev/${mmc_dev}p$root_part rootfstype=ext4 " \ "console=$defaultconsole,115200 rootwait loglevel=4 ti_cpsw.rx_packet_max=1526\0" \ "add_version_bootargs=setenv bootargs $bootargs\0" \ - "fdt_skip_update=yes\0" \ - "ethprime=cpsw\0" \ "sdbringup=echo Try bringup boot && ext4load mmc 1:$root_part $kernel_addr /boot/zImage && " \ "ext4load mmc 1:$root_part $fdt_addr /boot/$fdt_image && setenv bootargs $bootargs rw;\0" \ "sdprod=ext4load mmc 1:$root_part $kernel_addr /boot/$kernel_image && " \ "ext4load mmc 1:$root_part $fdt_addr /boot/$fdt_image && setenv bootargs $bootargs ro;\0" \ - "sdboot=if mmc dev 1; then echo Copying Linux from SD to RAM...; "\ + "sdboot=env set fdt_addr " FDT_ADDR_R "; "\ + "if mmc dev 1; then echo Copying Linux from SD to RAM...; "\ "if test -e mmc 1:$root_part /boot/$kernel_image; then run sdprod; " \ "else run sdbringup; fi; " \ + /* For v4.19 kernel $mmc_dev should be "mmcblk1" (read from DT), for v3.18 kernel: "mmcblk0" */ \ + "fdt addr $fdt_addr;if fdt get value mmc_dev /nm_env nm,mmc-dev;then;else setenv mmc_dev mmcblk0;fi;" \ "run add_sd_bootargs; run add_version_bootargs; run shieldcmd; " \ "bootz $kernel_addr - $fdt_addr; fi\0" \ - "bootcmd_otenv=ext4load mmc 1:1 $load_addr /boot/loader/uEnv.txt; " \ - "env import -t $load_addr $filesize; " \ - "setenv bootargs $bootargs root=/dev/ram0 console=$defaultconsole,115200 " \ - "$ethopts rw ostree_root=/dev/mmcblk1p1\0" \ - "bootcmd_rd_in_mmc=ext4load mmc 1:1 $kernel_addr_r /boot$kernel_image; " \ - "bootm $kernel_addr_r\0" \ - "bootcmd=run bootcmd_otenv; run bootcmd_rd_in_mmc\0" \ - "ipaddr=192.168.1.1\0" \ - "serverip=192.168.1.254\0" \ - "pxefile_addr_r=" PXE_ADDR "\0" \ - "fdt_addr_r=" FDT_ADDR "\0" \ - "fdt_high=" FDT_HIGH_ADDR "\0" \ - "kernel_addr_r=" KERNEL_ADDR "\0" \ - "ramdisk_addr_r=" LOAD_ADDR "\0" \ - "initrd_high=" INIT_RD_ADDR "\0" \ - "bootpretryperiod=1000\0" \ - "tftptimeout=2000\0" \ - "tftptimeoutcountmax=5\0" \ - "bootpretryperiod=2000\0" \ - "autoload=false\0" \ - "shieldcmd=\0" \ - "tftp_recovery=tftpboot $kernel_addr recovery-image; tftpboot $fdt_addr recovery-dtb; " \ - "setenv bootargs rdinit=/etc/preinit console=$defaultconsole,115200 " \ - "debug ti_cpsw.rx_packet_max=1526; run shieldcmd; " \ - "bootz $kernel_addr - $fdt_addr\0" \ - "pxe_recovery=sleep 3 && dhcp && pxe get && pxe boot\0" \ + /* "bootcmd=run sdboot\0" */ \ + \ + /* Recovery boot */ \ "recovery=run pxe_recovery || setenv ipaddr $ipaddr; setenv serverip $serverip; run tftp_recovery\0" \ - /* setenv ipaddr and serverip is necessary, because dhclient can destroy the IPs inernally */ + /* setenv ipaddr and serverip is necessary, because dhclient can destroy the IPs internally */ \ + "pxe_recovery=mdio up $ethprime && dhcp && pxe get && pxe boot\0" \ + "tftp_recovery=tftpboot $kernel_addr_r recovery-image; tftpboot $fdt_addr_r recovery-dtb; " /* kernel_addr_r ? */ \ + "setenv bootargs rdinit=/etc/preinit console=$defaultconsole,115200 " \ + "debug $ethopts; " \ + "bootz $kernel_addr_r - $fdt_addr_r\0" /* kernel_addr_r */ #endif -#endif -/* TODO: Check if ok? */ +/* TODO: Check if ok for NRSW? */ #define CONFIG_ZERO_BOOTDELAY_CHECK /* UART Configuration */ @@ -299,10 +279,11 @@ int eth_phy_timeout(void); #define CONFIG_SYS_MEMTEST_START 0x84000000 #define CONFIG_SYS_MEMTEST_END 0x87900000 -/* TODO: Enable for NRSW support +/* NRSW password protected login */ +#ifdef CONFIG_NRSW #define CONFIG_NM_LOGIN #define CONFIG_CRYPT -*/ +#endif #define CONFIG_CMD_PXE @@ -311,9 +292,12 @@ int eth_phy_timeout(void); #define CONFIG_JTAG_MARKER_SPL 0x402FFF00 #define CONFIG_JTAG_MARKER_UBOOT 0x807FFF00 -/* TODO: NRSW PMIC Reset Reason */ +/* NRSW PMIC Reset Reason */ +#ifdef CONFIG_NRSW #define RESET_REASON_SHM_LOCATION 0x8e000000 #define EXTERNAL_WATCHDOG_PATTERN 0x781f9ce2 +#endif + /* SPL command is not needed */ #undef CONFIG_CMD_SPL