1 /* 2 * Copyright 2013 Freescale Semiconductor, Inc. 3 * 4 * Configuration settings for the phytec PCM-052 SoM. 5 * 6 * SPDX-License-Identifier: GPL-2.0+ 7 */ 8 9 #ifndef __CONFIG_H 10 #define __CONFIG_H 11 12 #include <asm/arch/imx-regs.h> 13 14 #define CONFIG_SKIP_LOWLEVEL_INIT 15 16 /* Enable passing of ATAGs */ 17 #define CONFIG_CMDLINE_TAG 18 19 /* Size of malloc() pool */ 20 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) 21 22 /* Allow to overwrite serial and ethaddr */ 23 #define CONFIG_ENV_OVERWRITE 24 25 /* NAND support */ 26 #define CONFIG_SYS_NAND_ONFI_DETECTION 27 28 #ifdef CONFIG_CMD_NAND 29 #define CONFIG_SYS_MAX_NAND_DEVICE 1 30 #define CONFIG_SYS_NAND_BASE NFC_BASE_ADDR 31 32 #define CONFIG_JFFS2_NAND 33 34 /* Dynamic MTD partition support */ 35 36 #ifndef MTDIDS_DEFAULT 37 #define MTDIDS_DEFAULT "nand0=NAND" 38 #endif 39 40 #ifndef MTDPARTS_DEFAULT 41 #define MTDPARTS_DEFAULT "mtdparts=NAND:640k(bootloader)"\ 42 ",128k(env1)"\ 43 ",128k(env2)"\ 44 ",128k(dtb)"\ 45 ",6144k(kernel)"\ 46 ",-(root)" 47 #endif 48 49 #endif 50 51 #define CONFIG_FSL_ESDHC 52 #define CONFIG_SYS_FSL_ESDHC_ADDR 0 53 #define CONFIG_SYS_FSL_ESDHC_NUM 1 54 55 /*#define CONFIG_ESDHC_DETECT_USE_EXTERN_IRQ1*/ 56 57 #define CONFIG_FEC_MXC 58 #define CONFIG_MII 59 #define IMX_FEC_BASE ENET_BASE_ADDR 60 #define CONFIG_FEC_XCV_TYPE RMII 61 #define CONFIG_FEC_MXC_PHYADDR 0 62 63 /* QSPI Configs*/ 64 65 #ifdef CONFIG_FSL_QSPI 66 #define FSL_QSPI_FLASH_SIZE (1 << 24) 67 #define FSL_QSPI_FLASH_NUM 2 68 #define CONFIG_SYS_FSL_QSPI_LE 69 #endif 70 71 /* I2C Configs */ 72 #define CONFIG_SYS_I2C 73 #define CONFIG_SYS_I2C_MXC_I2C3 74 #define CONFIG_SYS_I2C_MXC 75 76 /* RTC (actually an RV-4162 but M41T62-compatible) */ 77 #define CONFIG_RTC_M41T62 78 #define CONFIG_SYS_I2C_RTC_ADDR 0x68 79 #define CONFIG_SYS_RTC_BUS_NUM 2 80 81 /* EEPROM (24FC256) */ 82 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 83 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 84 #define CONFIG_SYS_I2C_EEPROM_BUS 2 85 86 87 #define CONFIG_LOADADDR 0x82000000 88 89 /* We boot from the gfxRAM area of the OCRAM. */ 90 #define CONFIG_SYS_TEXT_BASE 0x3f408000 91 #define CONFIG_BOARD_SIZE_LIMIT 524288 92 93 /* if no target-specific extra environment settings were defined by the 94 target, define an empty one */ 95 #ifndef PCM052_EXTRA_ENV_SETTINGS 96 #define PCM052_EXTRA_ENV_SETTINGS 97 #endif 98 99 /* if no target-specific boot command was defined by the target, 100 define an empty one */ 101 #ifndef PCM052_BOOTCOMMAND 102 #define PCM052_BOOTCOMMAND 103 #endif 104 105 /* if no target-specific extra environment settings were defined by the 106 target, define an empty one */ 107 #ifndef PCM052_NET_INIT 108 #define PCM052_NET_INIT 109 #endif 110 111 /* boot command, including the target-defined one if any */ 112 #define CONFIG_BOOTCOMMAND PCM052_BOOTCOMMAND "run bootcmd_nand" 113 114 /* Extra env settings (including the target-defined ones if any) */ 115 #define CONFIG_EXTRA_ENV_SETTINGS \ 116 PCM052_EXTRA_ENV_SETTINGS \ 117 "autoload=no\0" \ 118 "fdt_high=0xffffffff\0" \ 119 "initrd_high=0xffffffff\0" \ 120 "blimg_file=u-boot.vyb\0" \ 121 "blimg_addr=0x81000000\0" \ 122 "kernel_file=zImage\0" \ 123 "kernel_addr=0x82000000\0" \ 124 "fdt_file=zImage.dtb\0" \ 125 "fdt_addr=0x81000000\0" \ 126 "ram_file=uRamdisk\0" \ 127 "ram_addr=0x83000000\0" \ 128 "filesys=rootfs.ubifs\0" \ 129 "sys_addr=0x81000000\0" \ 130 "tftploc=/path/to/tftp/directory/\0" \ 131 "nfs_root=/path/to/nfs/root\0" \ 132 "tftptimeout=1000\0" \ 133 "tftptimeoutcountmax=1000000\0" \ 134 "mtdparts=" MTDPARTS_DEFAULT "\0" \ 135 "bootargs_base=setenv bootargs rw " \ 136 " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \ 137 "console=ttyLP1,115200n8\0" \ 138 "bootargs_sd=setenv bootargs ${bootargs} " \ 139 "root=/dev/mmcblk0p2 rootwait\0" \ 140 "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \ 141 "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \ 142 "bootargs_nand=setenv bootargs ${bootargs} " \ 143 "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \ 144 "bootargs_ram=setenv bootargs ${bootargs} " \ 145 "root=/dev/ram rw initrd=${ram_addr}\0" \ 146 "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ 147 "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \ 148 "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \ 149 "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \ 150 "bootz ${kernel_addr} - ${fdt_addr}\0" \ 151 "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \ 152 "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \ 153 "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \ 154 "bootz ${kernel_addr} - ${fdt_addr}\0" \ 155 "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \ 156 "nand read ${fdt_addr} dtb; " \ 157 "nand read ${kernel_addr} kernel; " \ 158 "bootz ${kernel_addr} - ${fdt_addr}\0" \ 159 "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \ 160 "nand read ${fdt_addr} dtb; " \ 161 "nand read ${kernel_addr} kernel; " \ 162 "nand read ${ram_addr} root; " \ 163 "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \ 164 "update_bootloader_from_tftp=" PCM052_NET_INIT \ 165 "if tftp ${blimg_addr} "\ 166 "${tftpdir}${blimg_file}; then " \ 167 "mtdparts default; " \ 168 "nand erase.part bootloader; " \ 169 "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \ 170 "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \ 171 "${kernel_file}; " \ 172 "then mtdparts default; " \ 173 "nand erase.part kernel; " \ 174 "nand write ${kernel_addr} kernel ${filesize}; " \ 175 "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \ 176 "nand erase.part dtb; " \ 177 "nand write ${fdt_addr} dtb ${filesize}; fi\0" \ 178 "update_kernel_from_tftp=" PCM052_NET_INIT \ 179 "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \ 180 "then setenv fdtsize ${filesize}; " \ 181 "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \ 182 "mtdparts default; " \ 183 "nand erase.part dtb; " \ 184 "nand write ${fdt_addr} dtb ${fdtsize}; " \ 185 "nand erase.part kernel; " \ 186 "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \ 187 "update_rootfs_from_tftp=" PCM052_NET_INIT \ 188 "if tftp ${sys_addr} ${tftpdir}${filesys}; " \ 189 "then mtdparts default; " \ 190 "nand erase.part root; " \ 191 "ubi part root; " \ 192 "ubi create rootfs; " \ 193 "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \ 194 "update_ramdisk_from_tftp=" PCM052_NET_INIT \ 195 "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \ 196 "then mtdparts default; " \ 197 "nand erase.part root; " \ 198 "nand write ${ram_addr} root ${filesize}; fi\0" 199 200 /* Miscellaneous configurable options */ 201 #define CONFIG_SYS_LONGHELP /* undef to save memory */ 202 #define CONFIG_AUTO_COMPLETE 203 #define CONFIG_CMDLINE_EDITING 204 205 #define CONFIG_SYS_MEMTEST_START 0x80010000 206 #define CONFIG_SYS_MEMTEST_END 0x87C00000 207 208 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 209 210 /* Physical memory map */ 211 #define CONFIG_NR_DRAM_BANKS 1 212 #define PHYS_SDRAM (0x80000000) 213 #define PHYS_SDRAM_SIZE (CONFIG_PCM052_DDR_SIZE * 1024 * 1024) 214 215 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 216 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 217 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 218 219 #define CONFIG_SYS_INIT_SP_OFFSET \ 220 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 221 #define CONFIG_SYS_INIT_SP_ADDR \ 222 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 223 224 /* environment organization */ 225 #ifdef CONFIG_ENV_IS_IN_MMC 226 #define CONFIG_ENV_SIZE (8 * 1024) 227 228 #define CONFIG_ENV_OFFSET (12 * 64 * 1024) 229 #define CONFIG_SYS_MMC_ENV_DEV 0 230 #endif 231 232 #ifdef CONFIG_ENV_IS_IN_NAND 233 #define CONFIG_ENV_SECT_SIZE (128 * 1024) 234 #define CONFIG_ENV_SIZE (8 * 1024) 235 #define CONFIG_ENV_OFFSET 0xA0000 236 #define CONFIG_ENV_SIZE_REDUND (8 * 1024) 237 #define CONFIG_ENV_OFFSET_REDUND 0xC0000 238 #endif 239 240 #endif 241