Lukasz Majewski | 010e58d | 2019-12-08 22:06:56 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (C) 2019 DENX Software Engineering |
| 4 | * Lukasz Majewski, DENX Software Engineering, lukma@denx.de |
| 5 | * |
| 6 | * Copyright (C) 2018 DENX Software Engineering |
| 7 | * Måns Rullgård, DENX Software Engineering, mans@mansr.com |
| 8 | * |
| 9 | * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> |
| 10 | * on behalf of DENX Software Engineering GmbH |
| 11 | */ |
| 12 | #ifndef __CONFIGS_XEA_H__ |
| 13 | #define __CONFIGS_XEA_H__ |
| 14 | |
| 15 | #include <linux/sizes.h> |
| 16 | |
Lukasz Majewski | 010e58d | 2019-12-08 22:06:56 +0100 | [diff] [blame] | 17 | /* SPL */ |
| 18 | #define CONFIG_SPL_STACK 0x20000 |
| 19 | |
| 20 | #define CONFIG_SYS_SPL_ARGS_ADDR 0x44000000 |
| 21 | |
| 22 | #define CONFIG_SYS_SPI_KERNEL_OFFS SZ_1M |
| 23 | #define CONFIG_SYS_SPI_ARGS_OFFS SZ_512K |
| 24 | #define CONFIG_SYS_SPI_ARGS_SIZE SZ_32K |
| 25 | |
| 26 | #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (SZ_512K / 0x200) |
| 27 | #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (SZ_32K / 0x200) |
Lukasz Majewski | 010e58d | 2019-12-08 22:06:56 +0100 | [diff] [blame] | 28 | |
Lukasz Majewski | 010e58d | 2019-12-08 22:06:56 +0100 | [diff] [blame] | 29 | /* Memory configuration */ |
| 30 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ |
| 31 | #define PHYS_SDRAM_1_SIZE 0x10000000 /* Max 256 MB RAM */ |
| 32 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
| 33 | |
Lukasz Majewski | 010e58d | 2019-12-08 22:06:56 +0100 | [diff] [blame] | 34 | /* Extra Environment */ |
Lukasz Majewski | 010e58d | 2019-12-08 22:06:56 +0100 | [diff] [blame] | 35 | #define CONFIG_HOSTNAME "xea" |
| 36 | |
| 37 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 38 | "bootmode=update\0" \ |
| 39 | "bootpri=mmc_mmc\0" \ |
| 40 | "bootsec=sf_swu\0" \ |
| 41 | "consdev=ttyAMA0\0" \ |
| 42 | "baudrate=115200\0" \ |
| 43 | "dtbaddr=0x44000000\0" \ |
| 44 | "dtbfile=imx28-xea.dtb\0" \ |
| 45 | "rootdev=/dev/mmcblk0p2\0" \ |
| 46 | "netdev=eth0\0" \ |
| 47 | "rdaddr=0x43000000\0" \ |
| 48 | "swufile=swupdate.img\0" \ |
| 49 | "sf_kernel_offset=0x100000\0" \ |
| 50 | "sf_kernel_size=0x400000\0" \ |
| 51 | "sf_swu_offset=0x500000\0" \ |
| 52 | "sf_swu_size=0x800000\0" \ |
| 53 | "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \ |
| 54 | "do_update_mmc=" \ |
| 55 | "if mmc rescan ; then " \ |
| 56 | "mmc dev 0 ${update_mmc_part} ; " \ |
| 57 | "if dhcp ${hostname}/${update_filename} ; then " \ |
| 58 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 59 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 60 | "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \ |
| 61 | "fi ; " \ |
| 62 | "fi\0" \ |
| 63 | "do_update_sf=" \ |
| 64 | "if sf probe ; then " \ |
| 65 | "if dhcp ${hostname}/${update_filename} ; then " \ |
| 66 | "sf erase ${update_offset} +${filesize} ; " \ |
| 67 | "sf write ${loadaddr} ${update_offset} ${filesize} ; " \ |
| 68 | "fi ; " \ |
| 69 | "fi\0" \ |
| 70 | "update_spl_filename=u-boot.sb\0" \ |
| 71 | "update_spl=" \ |
| 72 | "setenv update_filename ${update_spl_filename} ; " \ |
| 73 | "setenv update_offset 0 ; " \ |
| 74 | "run do_update_sf\0" \ |
| 75 | "update_uboot_filename=u-boot.img\0" \ |
| 76 | "update_uboot=" \ |
| 77 | "setenv update_filename ${update_uboot_filename} ; " \ |
| 78 | "setenv update_offset 0x10000 ; " \ |
| 79 | "run do_update_sf ; " \ |
| 80 | "setenv update_mmc_part 1 ; " \ |
| 81 | "setenv update_offset 0 ; " \ |
| 82 | "run do_update_mmc\0" \ |
| 83 | "update_kernel_filename=uImage\0" \ |
| 84 | "update_kernel=" \ |
| 85 | "setenv update_mmc_part 1 ; " \ |
| 86 | "setenv update_filename ${update_kernel_filename} ; " \ |
| 87 | "setenv update_offset 0x800 ; " \ |
| 88 | "run do_update_mmc ; " \ |
| 89 | "setenv update_filename ${dtbfile} ; " \ |
| 90 | "setenv update_offset 0x400 ; " \ |
| 91 | "run do_update_mmc\0" \ |
| 92 | "update_sfkernel=" \ |
| 93 | "setenv update_filename fitImage ; " \ |
| 94 | "setenv update_offset ${sf_kernel_offset} ; " \ |
| 95 | "run do_update_sf\0" \ |
| 96 | "update_swu=" \ |
| 97 | "setenv update_filename ${swufile} ; " \ |
| 98 | "setenv update_offset ${sf_swu_offset} ; " \ |
| 99 | "run do_update_sf\0" \ |
| 100 | "addcons=" \ |
| 101 | "setenv bootargs ${bootargs} " \ |
| 102 | "console=${consdev},${baudrate}\0" \ |
| 103 | "addip=" \ |
| 104 | "setenv bootargs ${bootargs} " \ |
| 105 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
| 106 | "${netmask}:${hostname}:${netdev}:off\0" \ |
| 107 | "addmisc=" \ |
| 108 | "setenv bootargs ${bootargs} ${miscargs}\0" \ |
| 109 | "addargs=run addcons addmisc\0" \ |
| 110 | "mmcload=" \ |
| 111 | "mmc rescan ; " \ |
| 112 | "mmc dev 0 1 ; " \ |
| 113 | "mmc read ${loadaddr} 0x800 0x2000 ; " \ |
| 114 | "mmc read ${dtbaddr} 0x400 0x80\0" \ |
| 115 | "netload=" \ |
| 116 | "dhcp ${loadaddr} ${hostname}/${bootfile} ; " \ |
| 117 | "tftp ${dtbaddr} ${hostname}/${dtbfile}\0" \ |
| 118 | "sfload=" \ |
| 119 | "sf probe ; " \ |
| 120 | "sf read ${loadaddr} ${sf_kernel_offset} ${sf_kernel_size}\0" \ |
| 121 | "usbload=" \ |
| 122 | "usb start ; " \ |
| 123 | "load usb 0:1 ${loadaddr} ${bootfile}\0" \ |
| 124 | "miscargs=panic=1\0" \ |
| 125 | "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \ |
| 126 | "nfsargs=" \ |
| 127 | "setenv bootargs root=/dev/nfs rw " \ |
| 128 | "nfsroot=${serverip}:${rootpath},v3,tcp\0" \ |
| 129 | "mmc_mmc=" \ |
| 130 | "if run mmcload mmcargs addargs ; then " \ |
| 131 | "bootm ${loadaddr} - ${dtbaddr} ; " \ |
| 132 | "fi\0" \ |
| 133 | "mmc_nfs=" \ |
| 134 | "if run mmcload nfsargs addip addargs ; then " \ |
| 135 | "bootm ${loadaddr} - ${dtbaddr} ; " \ |
| 136 | "fi\0" \ |
| 137 | "sf_mmc=" \ |
| 138 | "if run sfload mmcargs addargs ; then " \ |
| 139 | "bootm ${loadaddr} - ${dtbaddr} ; " \ |
| 140 | "fi\0" \ |
| 141 | "sf_swu=" \ |
| 142 | "if run sfload ; then " \ |
| 143 | "sf read ${rdaddr} ${sf_swu_offset} ${sf_swu_size} ; " \ |
| 144 | "setenv bootargs root=/dev/ram0 rw ; " \ |
| 145 | "run addargs ; " \ |
| 146 | "bootm ${loadaddr} ${rdaddr} ; " \ |
| 147 | "fi\0" \ |
| 148 | "net_mmc=" \ |
| 149 | "if run netload mmcargs addargs ; then " \ |
| 150 | "bootm ${loadaddr} - ${dtbaddr} ; " \ |
| 151 | "fi\0" \ |
| 152 | "net_nfs=" \ |
| 153 | "if run netload nfsargs addip addargs ; then " \ |
| 154 | "bootm ${loadaddr} - ${dtbaddr} ; " \ |
| 155 | "fi\0" \ |
| 156 | "prebootcmd=" \ |
| 157 | "if test \"${envsaved}\" != y ; then ; " \ |
| 158 | "setenv envsaved y ; " \ |
| 159 | "saveenv ; " \ |
| 160 | "fi ; " \ |
| 161 | "if test \"${bootmode}\" = normal ; then " \ |
| 162 | "setenv bootdelay 0 ; " \ |
| 163 | "setenv bootpri mmc_mmc ; " \ |
| 164 | "elif test \"${bootmode}\" = devel ; then " \ |
| 165 | "setenv bootdelay 3 ; " \ |
| 166 | "setenv bootpri net_mmc ; " \ |
| 167 | "else " \ |
| 168 | "if test \"${bootmode}\" != update ; then " \ |
| 169 | "echo Warning: unknown bootmode \"${bootmode}\" ; " \ |
| 170 | "fi ; " \ |
| 171 | "setenv bootdelay 1 ; " \ |
| 172 | "setenv bootpri sf_swu ; " \ |
| 173 | "fi\0" |
| 174 | |
| 175 | /* The rest of the configuration is shared */ |
| 176 | #include <configs/mxs.h> |
| 177 | |
| 178 | #endif /* __CONFIGS_XEA_H__ */ |