Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2011 Freescale Semiconductor, Inc. |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __CONFIG_H |
| 8 | #define __CONFIG_H |
| 9 | |
Fabio Estevam | 0208a53 | 2012-10-18 18:42:00 +0000 | [diff] [blame] | 10 | #include <asm/arch/imx-regs.h> |
| 11 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 12 | /* High Level Configuration Options */ |
| 13 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 14 | #define CONFIG_SYS_TEXT_BASE 0x81200000 |
Gong Qianyu | 18fb0e3 | 2015-10-26 19:47:42 +0800 | [diff] [blame] | 15 | #define CONFIG_SYS_FSL_CLK |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 16 | |
Rob Herring | 3dae5b5 | 2013-10-04 10:22:44 -0500 | [diff] [blame] | 17 | #define CONFIG_SYS_TIMER_RATE 32768 |
| 18 | #define CONFIG_SYS_TIMER_COUNTER \ |
| 19 | (&((struct gpt_regs *)IMX_GPT1_BASE)->counter) |
| 20 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 21 | #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ |
| 22 | #define CONFIG_SETUP_MEMORY_TAGS |
| 23 | #define CONFIG_INITRD_TAG |
| 24 | |
Fabio Estevam | f39c008 | 2011-09-22 08:07:15 +0000 | [diff] [blame] | 25 | #define CONFIG_MACH_TYPE MACH_TYPE_MX25_3DS |
| 26 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 27 | /* Size of malloc() pool */ |
| 28 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) |
| 29 | |
| 30 | /* Physical Memory Map */ |
| 31 | |
| 32 | #define CONFIG_NR_DRAM_BANKS 1 |
| 33 | #define PHYS_SDRAM_1 0x80000000 |
| 34 | #define PHYS_SDRAM_1_SIZE (64 * 1024 * 1024) |
| 35 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 36 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
Fabio Estevam | 0208a53 | 2012-10-18 18:42:00 +0000 | [diff] [blame] | 37 | #define CONFIG_SYS_INIT_RAM_ADDR IMX_RAM_BASE |
| 38 | #define CONFIG_SYS_INIT_RAM_SIZE IMX_RAM_SIZE |
| 39 | |
| 40 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 41 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 42 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 43 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 44 | |
| 45 | /* Memory Test */ |
| 46 | #define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE/2) |
| 47 | #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE) |
| 48 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 49 | /* Serial Info */ |
| 50 | #define CONFIG_MXC_UART |
Stefano Babic | 40f6fff | 2011-11-22 15:22:39 +0100 | [diff] [blame] | 51 | #define CONFIG_MXC_UART_BASE UART1_BASE |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 52 | |
| 53 | /* No NOR flash present */ |
| 54 | #define CONFIG_ENV_OFFSET (6 * 64 * 1024) |
| 55 | #define CONFIG_ENV_SIZE (8 * 1024) |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 56 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 57 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 58 | /* U-Boot general configuration */ |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 59 | #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 60 | /* Boot Argument Buffer Size */ |
| 61 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 62 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 63 | /* Ethernet */ |
| 64 | #define CONFIG_FEC_MXC |
| 65 | #define CONFIG_FEC_MXC_PHYADDR 0x1f |
| 66 | #define CONFIG_MII |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 67 | #define CONFIG_ENV_OVERWRITE |
| 68 | |
Fabio Estevam | af2a409 | 2012-10-23 06:34:49 +0000 | [diff] [blame] | 69 | /* ESDHC driver */ |
Fabio Estevam | 3098ef4 | 2014-09-16 11:13:12 -0300 | [diff] [blame] | 70 | #define CONFIG_SYS_FSL_ESDHC_ADDR IMX_MMC_SDHC1_BASE |
Fabio Estevam | af2a409 | 2012-10-23 06:34:49 +0000 | [diff] [blame] | 71 | #define CONFIG_SYS_FSL_ESDHC_NUM 1 |
| 72 | |
Fabio Estevam | e00c89d | 2012-10-23 06:34:53 +0000 | [diff] [blame] | 73 | /* PMIC Configs */ |
Fabio Estevam | cabe240 | 2012-12-11 04:58:02 +0000 | [diff] [blame] | 74 | #define CONFIG_POWER |
| 75 | #define CONFIG_POWER_I2C |
| 76 | #define CONFIG_POWER_FSL |
Simon Glass | 913702c | 2014-05-20 06:01:34 -0600 | [diff] [blame] | 77 | #define CONFIG_POWER_FSL_MC34704 |
Fabio Estevam | e00c89d | 2012-10-23 06:34:53 +0000 | [diff] [blame] | 78 | #define CONFIG_SYS_FSL_PMIC_I2C_ADDR 0x54 |
| 79 | |
Fabio Estevam | e00c89d | 2012-10-23 06:34:53 +0000 | [diff] [blame] | 80 | /* I2C Configs */ |
trem | b089d03 | 2013-09-21 18:13:36 +0200 | [diff] [blame] | 81 | #define CONFIG_SYS_I2C |
| 82 | #define CONFIG_SYS_I2C_MXC |
Albert ARIBAUD \\(3ADEV\\) | 03544c6 | 2015-09-21 22:43:38 +0200 | [diff] [blame] | 83 | #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ |
| 84 | #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ |
Fabio Estevam | e00c89d | 2012-10-23 06:34:53 +0000 | [diff] [blame] | 85 | |
Benoît Thébaudeau | d37b334 | 2013-03-22 09:30:29 +0000 | [diff] [blame] | 86 | /* RTC */ |
| 87 | #define CONFIG_RTC_IMXDI |
Benoît Thébaudeau | d37b334 | 2013-03-22 09:30:29 +0000 | [diff] [blame] | 88 | |
Fabio Estevam | 9e408a3 | 2017-04-17 19:29:05 -0300 | [diff] [blame] | 89 | /* Fuse API support */ |
| 90 | #define CONFIG_FSL_IIM |
| 91 | #define CONFIG_CMD_FUSE |
| 92 | |
Fabio Estevam | e00c89d | 2012-10-23 06:34:53 +0000 | [diff] [blame] | 93 | /* Ethernet Configs */ |
| 94 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 95 | |
| 96 | #define CONFIG_LOADADDR 0x81000000 /* loadaddr env var */ |
| 97 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 98 | |
| 99 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 100 | "script=boot.scr\0" \ |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 101 | "image=zImage\0" \ |
| 102 | "console=ttymxc0\0" \ |
| 103 | "splashpos=m,m\0" \ |
| 104 | "fdt_high=0xffffffff\0" \ |
| 105 | "initrd_high=0xffffffff\0" \ |
| 106 | "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
| 107 | "fdt_addr=0x82000000\0" \ |
| 108 | "boot_fdt=try\0" \ |
| 109 | "ip_dyn=yes\0" \ |
| 110 | "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ |
| 111 | "mmcpart=1\0" \ |
| 112 | "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ |
| 113 | "update_sd_firmware_filename=u-boot.imx\0" \ |
| 114 | "update_sd_firmware=" \ |
| 115 | "if test ${ip_dyn} = yes; then " \ |
| 116 | "setenv get_cmd dhcp; " \ |
| 117 | "else " \ |
| 118 | "setenv get_cmd tftp; " \ |
| 119 | "fi; " \ |
| 120 | "if mmc dev ${mmcdev}; then " \ |
| 121 | "if ${get_cmd} ${update_sd_firmware_filename}; then " \ |
| 122 | "setexpr fw_sz ${filesize} / 0x200; " \ |
| 123 | "setexpr fw_sz ${fw_sz} + 1; " \ |
| 124 | "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ |
| 125 | "fi; " \ |
| 126 | "fi\0" \ |
| 127 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 128 | "root=${mmcroot}\0" \ |
| 129 | "loadbootscript=" \ |
Otavio Salvador | f3652c1 | 2017-09-29 22:54:59 -0300 | [diff] [blame] | 130 | "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 131 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 132 | "source\0" \ |
Otavio Salvador | f3652c1 | 2017-09-29 22:54:59 -0300 | [diff] [blame] | 133 | "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
| 134 | "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 135 | "mmcboot=echo Booting from mmc ...; " \ |
| 136 | "run mmcargs; " \ |
| 137 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 138 | "if run loadfdt; then " \ |
| 139 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 140 | "else " \ |
| 141 | "if test ${boot_fdt} = try; then " \ |
| 142 | "bootz; " \ |
| 143 | "else " \ |
| 144 | "echo WARN: Cannot load the DT; " \ |
| 145 | "fi; " \ |
| 146 | "fi; " \ |
| 147 | "else " \ |
| 148 | "bootz; " \ |
| 149 | "fi;\0" \ |
| 150 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 151 | "root=/dev/nfs " \ |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 152 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 153 | "netboot=echo Booting from net ...; " \ |
| 154 | "run netargs; " \ |
| 155 | "if test ${ip_dyn} = yes; then " \ |
| 156 | "setenv get_cmd dhcp; " \ |
| 157 | "else " \ |
| 158 | "setenv get_cmd tftp; " \ |
| 159 | "fi; " \ |
| 160 | "${get_cmd} ${image}; " \ |
| 161 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 162 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 163 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 164 | "else " \ |
| 165 | "if test ${boot_fdt} = try; then " \ |
| 166 | "bootz; " \ |
| 167 | "else " \ |
| 168 | "echo WARN: Cannot load the DT; " \ |
| 169 | "fi; " \ |
| 170 | "fi; " \ |
| 171 | "else " \ |
| 172 | "bootz; " \ |
| 173 | "fi;\0" |
| 174 | |
| 175 | #define CONFIG_BOOTCOMMAND \ |
| 176 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 177 | "if run loadbootscript; then " \ |
| 178 | "run bootscript; " \ |
| 179 | "else " \ |
| 180 | "if run loadimage; then " \ |
| 181 | "run mmcboot; " \ |
| 182 | "else run netboot; " \ |
| 183 | "fi; " \ |
| 184 | "fi; " \ |
| 185 | "else run netboot; fi" |
| 186 | |
| 187 | /* Miscellaneous configurable options */ |
Fabio Estevam | 81a1d61 | 2014-03-05 15:51:00 -0300 | [diff] [blame] | 188 | |
Fabio Estevam | 419adbf | 2011-09-06 09:05:43 +0000 | [diff] [blame] | 189 | #endif /* __CONFIG_H */ |