Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2011 Freescale Semiconductor, Inc. |
| 4 | * Author: Fabio Estevam <fabio.estevam@freescale.com> |
| 5 | * |
| 6 | * Based on m28evk.h: |
| 7 | * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> |
| 8 | * on behalf of DENX Software Engineering GmbH |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 9 | */ |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 10 | #ifndef __CONFIGS_MX28EVK_H__ |
| 11 | #define __CONFIGS_MX28EVK_H__ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 12 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 13 | /* Memory configuration */ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 14 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ |
| 15 | #define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 16 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 17 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 18 | /* UBI and NAND partitioning */ |
Lauri Hintsala | 6f515f7 | 2012-04-17 00:35:46 +0000 | [diff] [blame] | 19 | |
Fabio Estevam | 49ac197 | 2013-01-27 05:52:05 +0000 | [diff] [blame] | 20 | /* RTC */ |
Matthias Fuchs | 5c4b343 | 2012-01-18 01:33:07 +0000 | [diff] [blame] | 21 | #ifdef CONFIG_CMD_DATE |
| 22 | #define CONFIG_RTC_MXS |
| 23 | #endif |
| 24 | |
Fabio Estevam | 49ac197 | 2013-01-27 05:52:05 +0000 | [diff] [blame] | 25 | /* USB */ |
Matthias Fuchs | ce575c4 | 2012-01-18 01:33:08 +0000 | [diff] [blame] | 26 | |
Fabio Estevam | 9f95ce2 | 2013-05-10 09:14:09 +0000 | [diff] [blame] | 27 | /* Framebuffer support */ |
Anatolij Gustschin | e22e08e | 2021-10-04 17:33:12 +0200 | [diff] [blame] | 28 | #ifdef CONFIG_DM_VIDEO |
Fabio Estevam | 9f95ce2 | 2013-05-10 09:14:09 +0000 | [diff] [blame] | 29 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) |
| 30 | #endif |
| 31 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 32 | /* Extra Environment */ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 33 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Otavio Salvador | c1f9a4d | 2013-12-16 20:44:03 -0200 | [diff] [blame] | 34 | "ubifs_file=filesystem.ubifs\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 35 | "update_nand_full_filename=u-boot.nand\0" \ |
| 36 | "update_nand_firmware_filename=u-boot.sb\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 37 | "update_nand_firmware_maxsz=0x100000\0" \ |
| 38 | "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \ |
| 39 | "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \ |
| 40 | "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \ |
| 41 | "nand device 0 ; " \ |
| 42 | "nand info ; " \ |
| 43 | "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \ |
| 44 | "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \ |
Otavio Salvador | c1f9a4d | 2013-12-16 20:44:03 -0200 | [diff] [blame] | 45 | "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 46 | "if tftp ${update_nand_full_filename} ; then " \ |
| 47 | "run update_nand_get_fcb_size ; " \ |
| 48 | "nand scrub -y 0x0 ${filesize} ; " \ |
Eric Benard | 1a06819 | 2012-12-11 11:36:21 +0000 | [diff] [blame] | 49 | "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 50 | "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \ |
| 51 | "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \ |
| 52 | "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \ |
| 53 | "fi\0" \ |
| 54 | "update_nand_firmware=" /* Update only firmware */ \ |
| 55 | "if tftp ${update_nand_firmware_filename} ; then " \ |
| 56 | "run update_nand_get_fcb_size ; " \ |
| 57 | "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \ |
| 58 | "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \ |
| 59 | "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \ |
| 60 | "nand erase ${fcb_sz} ${fw_sz} ; " \ |
| 61 | "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \ |
| 62 | "nand write ${loadaddr} ${fw_off} ${filesize} ; " \ |
| 63 | "fi\0" \ |
Otavio Salvador | c1f9a4d | 2013-12-16 20:44:03 -0200 | [diff] [blame] | 64 | "update_nand_kernel=" /* Update kernel */ \ |
| 65 | "mtdparts default; " \ |
| 66 | "nand erase.part kernel; " \ |
| 67 | "if test ${ip_dyn} = yes; then " \ |
| 68 | "setenv get_cmd dhcp; " \ |
| 69 | "else " \ |
| 70 | "setenv get_cmd tftp; " \ |
| 71 | "fi; " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 72 | "${get_cmd} ${image}; " \ |
Otavio Salvador | c1f9a4d | 2013-12-16 20:44:03 -0200 | [diff] [blame] | 73 | "nand write ${loadaddr} kernel ${filesize}\0" \ |
| 74 | "update_nand_fdt=" /* Update fdt */ \ |
| 75 | "mtdparts default; " \ |
| 76 | "nand erase.part fdt; " \ |
| 77 | "if test ${ip_dyn} = yes; then " \ |
| 78 | "setenv get_cmd dhcp; " \ |
| 79 | "else " \ |
| 80 | "setenv get_cmd tftp; " \ |
| 81 | "fi; " \ |
| 82 | "${get_cmd} ${fdt_file}; " \ |
| 83 | "nand write ${loadaddr} fdt ${filesize}\0" \ |
| 84 | "update_nand_filesystem=" /* Update filesystem */ \ |
| 85 | "mtdparts default; " \ |
| 86 | "nand erase.part filesystem; " \ |
| 87 | "if test ${ip_dyn} = yes; then " \ |
| 88 | "setenv get_cmd dhcp; " \ |
| 89 | "else " \ |
| 90 | "setenv get_cmd tftp; " \ |
| 91 | "fi; " \ |
| 92 | "${get_cmd} ${ubifs_file}; " \ |
| 93 | "ubi part filesystem; " \ |
| 94 | "ubi create filesystem; " \ |
| 95 | "ubi write ${loadaddr} filesystem ${filesize}\0" \ |
Otavio Salvador | a81ab70 | 2013-12-16 20:44:02 -0200 | [diff] [blame] | 96 | "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \ |
| 97 | "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \ |
| 98 | "nandboot=" /* Boot from NAND */ \ |
| 99 | "mtdparts default; " \ |
| 100 | "run nandargs; " \ |
| 101 | "nand read ${loadaddr} kernel 0x00400000; " \ |
| 102 | "if test ${boot_fdt} = yes; then " \ |
| 103 | "nand read ${fdt_addr} fdt 0x00080000; " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 104 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
Otavio Salvador | a81ab70 | 2013-12-16 20:44:02 -0200 | [diff] [blame] | 105 | "else " \ |
| 106 | "if test ${boot_fdt} = no; then " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 107 | "bootz; " \ |
Otavio Salvador | a81ab70 | 2013-12-16 20:44:02 -0200 | [diff] [blame] | 108 | "else " \ |
| 109 | "echo \"ERROR: Set boot_fdt to yes or no.\"; " \ |
| 110 | "fi; " \ |
| 111 | "fi\0" \ |
| 112 | "update_sd_firmware_filename=u-boot.sd\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 113 | "update_sd_firmware=" /* Update the SD firmware partition */ \ |
| 114 | "if mmc rescan ; then " \ |
| 115 | "if tftp ${update_sd_firmware_filename} ; then " \ |
| 116 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 117 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 118 | "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ |
| 119 | "fi ; " \ |
| 120 | "fi\0" \ |
| 121 | "script=boot.scr\0" \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 122 | "image=zImage\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 123 | "console_fsl=ttyAM0\0" \ |
| 124 | "console_mainline=ttyAMA0\0" \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 125 | "fdt_file=imx28-evk.dtb\0" \ |
| 126 | "fdt_addr=0x41000000\0" \ |
| 127 | "boot_fdt=try\0" \ |
| 128 | "ip_dyn=yes\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 129 | "mmcdev=0\0" \ |
| 130 | "mmcpart=2\0" \ |
Otavio Salvador | ac46d56 | 2013-01-10 09:45:05 +0000 | [diff] [blame] | 131 | "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 132 | "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \ |
Otavio Salvador | ac46d56 | 2013-01-10 09:45:05 +0000 | [diff] [blame] | 133 | "root=${mmcroot}\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 134 | "loadbootscript=" \ |
| 135 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 136 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 137 | "source\0" \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 138 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 139 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 140 | "mmcboot=echo Booting from mmc ...; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 141 | "run mmcargs; " \ |
| 142 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 143 | "if run loadfdt; then " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 144 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 145 | "else " \ |
| 146 | "if test ${boot_fdt} = try; then " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 147 | "bootz; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 148 | "else " \ |
| 149 | "echo WARN: Cannot load the DT; " \ |
| 150 | "fi; " \ |
| 151 | "fi; " \ |
| 152 | "else " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 153 | "bootz; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 154 | "fi;\0" \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 155 | "netargs=setenv bootargs console=${console_mainline},${baudrate} " \ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 156 | "root=/dev/nfs " \ |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 157 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 158 | "netboot=echo Booting from net ...; " \ |
| 159 | "run netargs; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 160 | "if test ${ip_dyn} = yes; then " \ |
| 161 | "setenv get_cmd dhcp; " \ |
| 162 | "else " \ |
| 163 | "setenv get_cmd tftp; " \ |
| 164 | "fi; " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 165 | "${get_cmd} ${image}; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 166 | "if test ${boot_fdt} = yes; then " \ |
| 167 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 168 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 169 | "else " \ |
| 170 | "if test ${boot_fdt} = try; then " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 171 | "bootz; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 172 | "else " \ |
| 173 | "echo WARN: Cannot load the DT; " \ |
| 174 | "fi;" \ |
| 175 | "fi; " \ |
| 176 | "else " \ |
Otavio Salvador | c0c94a2 | 2014-01-16 19:57:59 -0200 | [diff] [blame] | 177 | "bootz; " \ |
Otavio Salvador | 016bb5f | 2013-01-10 09:45:06 +0000 | [diff] [blame] | 178 | "fi;\0" |
Otavio Salvador | e8301fc | 2012-09-15 08:26:17 +0000 | [diff] [blame] | 179 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 180 | /* The rest of the configuration is shared */ |
| 181 | #include <configs/mxs.h> |
| 182 | |
| 183 | #endif /* __CONFIGS_MX28EVK_H__ */ |