1 /* 2 * (C) Copyright 2011 Logic Product Development <www.logicpd.com> 3 * Peter Barada <peter.barada@logicpd.com> 4 * 5 * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo 6 * reference boards. 7 * 8 * SPDX-License-Identifier: GPL-2.0+ 9 */ 10 11 #ifndef __CONFIG_H 12 #define __CONFIG_H 13 14 /* High Level Configuration Options */ 15 16 #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ 17 18 /* 19 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM 20 * 64 bytes before this address should be set aside for u-boot.img's 21 * header. That is 0x800FFFC0--0x80100000 should not be used for any 22 * other needs. We use this rather than the inherited defines from 23 * ti_armv7_common.h for backwards compatibility. 24 */ 25 #define CONFIG_SYS_TEXT_BASE 0x80100000 26 #define CONFIG_SPL_BSS_START_ADDR 0x80000000 27 #define CONFIG_SPL_BSS_MAX_SIZE (512 << 10) /* 512 KB */ 28 #define CONFIG_SYS_SPL_MALLOC_START 0x80208000 29 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 30 31 #include <configs/ti_omap3_common.h> 32 33 /* Override default SPL info to minimize empty space and allow BCH8 in SPL */ 34 #undef CONFIG_SPL_TEXT_BASE 35 #undef CONFIG_SPL_MAX_SIZE 36 #define CONFIG_SPL_TEXT_BASE 0x40200000 37 #define CONFIG_SPL_MAX_SIZE (64 * 1024) 38 39 /* Display CPU and Board information */ 40 41 #define CONFIG_DISPLAY_CPUINFO 42 #define CONFIG_DISPLAY_BOARDINFO 43 #define CONFIG_BOARD_LATE_INIT 44 #define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */ 45 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ 46 #define CONFIG_SETUP_MEMORY_TAGS 47 #define CONFIG_INITRD_TAG 48 #define CONFIG_REVISION_TAG 49 #define CONFIG_CMDLINE_EDITING /* cmd line edit/history */ 50 #define CONFIG_ZERO_BOOTDELAY_CHECK /* check keypress w/no delay */ 51 52 /* Hardware drivers */ 53 54 /* GPIO banks */ 55 #define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */ 56 57 #define CONFIG_USB_OMAP3 58 59 /* select serial console configuration */ 60 #undef CONFIG_CONS_INDEX 61 #define CONFIG_CONS_INDEX 1 62 #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1 63 #define CONFIG_SERIAL1 1 /* UART1 on OMAP Logic boards */ 64 65 /* commands to include */ 66 #define CONFIG_CMD_NAND 67 #define CONFIG_CMD_CACHE 68 #define CONFIG_CMD_EXT2 69 #define CONFIG_CMD_FAT 70 #define CONFIG_CMD_MTDPARTS 71 #define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */ 72 #define CONFIG_CMD_PING 73 #define CONFIG_CMD_DHCP 74 75 /* I2C */ 76 #define CONFIG_SYS_I2C_OMAP34XX 77 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */ 78 #define EXPANSION_EEPROM_I2C_BUS 2 /* I2C Bus for AT24C64 */ 79 #define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID 80 81 /* USB */ 82 #define CONFIG_USB_MUSB_GADGET 83 #define CONFIG_USB_MUSB_OMAP2PLUS 84 #define CONFIG_USB_MUSB_PIO_ONLY 85 #define CONFIG_USB_GADGET_DUALSPEED 86 #define CONFIG_USB_ETHER 87 #define CONFIG_USB_ETHER_RNDIS 88 #define CONFIG_USB_GADGET_DOWNLOAD 89 #define CONFIG_G_DNL_VENDOR_NUM 0x0451 90 #define CONFIG_G_DNL_PRODUCT_NUM 0xd022 91 #define CONFIG_G_DNL_MANUFACTURER "TI" 92 #define CONFIG_USB_FUNCTION_FASTBOOT 93 #define CONFIG_CMD_FASTBOOT 94 #define CONFIG_ANDROID_BOOT_IMAGE 95 #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR 96 #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 97 #define CONFIG_SYS_CACHELINE_SIZE 64 98 99 /* TWL4030 */ 100 #define CONFIG_TWL4030_PWM 101 #define CONFIG_TWL4030_USB 102 103 /* Board NAND Info. */ 104 #ifdef CONFIG_NAND 105 #define CONFIG_NAND_OMAP_GPMC 106 107 #define CONFIG_CMD_UBI /* UBI-formated MTD partition support */ 108 #define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */ 109 #define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */ 110 #define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */ 111 112 #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */ 113 /* to access nand */ 114 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */ 115 /* NAND devices */ 116 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT 117 #define CONFIG_SYS_NAND_5_ADDR_CYCLE 118 #define CONFIG_SYS_NAND_PAGE_COUNT 64 119 #define CONFIG_SYS_NAND_PAGE_SIZE 2048 120 #define CONFIG_SYS_NAND_OOBSIZE 64 121 #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) 122 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS 123 #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \ 124 13, 14, 16, 17, 18, 19, 20, 21, 22, \ 125 23, 24, 25, 26, 27, 28, 30, 31, 32, \ 126 33, 34, 35, 36, 37, 38, 39, 40, 41, \ 127 42, 44, 45, 46, 47, 48, 49, 50, 51, \ 128 52, 53, 54, 55, 56} 129 130 #define CONFIG_SYS_NAND_ECCSIZE 512 131 #define CONFIG_SYS_NAND_ECCBYTES 13 132 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW 133 #define CONFIG_BCH 134 #define CONFIG_SYS_NAND_MAX_OOBFREE 2 135 #define CONFIG_SYS_NAND_MAX_ECCPOS 56 136 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 137 #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ 138 #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */ 139 #define MTDIDS_DEFAULT "nand0=omap2-nand.0" 140 #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(MLO),"\ 141 "1920k(u-boot),128k(u-boot-env),"\ 142 "4m(kernel),-(fs)" 143 #endif 144 145 /* Environment information */ 146 147 /* 148 * PREBOOT assumes the 4.3" display is attached. User can interrupt 149 * and modify display variable to suit their needs. 150 */ 151 #define CONFIG_PREBOOT \ 152 "echo ======================NOTICE============================;"\ 153 "echo \"The u-boot environment is not set.\";" \ 154 "echo \"If using a display a valid display varible for your panel\";" \ 155 "echo \"needs to be set.\";" \ 156 "echo \"Valid display options are:\";" \ 157 "echo \" 2 == LQ121S1DG31 TFT SVGA (12.1) Sharp\";" \ 158 "echo \" 3 == LQ036Q1DA01 TFT QVGA (3.6) Sharp w/ASIC\";" \ 159 "echo \" 5 == LQ064D343 TFT VGA (6.4) Sharp\";" \ 160 "echo \" 7 == LQ10D368 TFT VGA (10.4) Sharp\";" \ 161 "echo \" 15 == LQ043T1DG01 TFT WQVGA (4.3) Sharp (DEFAULT)\";" \ 162 "echo \" vga[-dvi or -hdmi] LCD VGA 640x480\";" \ 163 "echo \" svga[-dvi or -hdmi] LCD SVGA 800x600\";" \ 164 "echo \" xga[-dvi or -hdmi] LCD XGA 1024x768\";" \ 165 "echo \" 720p[-dvi or -hdmi] LCD 720P 1280x720\";" \ 166 "echo \"Defaulting to 4.3 LCD panel (display=15).\";" \ 167 "setenv display 15;" \ 168 "setenv preboot;" \ 169 "nand unlock;" \ 170 "saveenv;" 171 172 #define CONFIG_EXTRA_ENV_SETTINGS \ 173 "loadaddr=0x81000000\0" \ 174 "uimage=uImage\0" \ 175 "zimage=zImage\0" \ 176 "mtdids=" MTDIDS_DEFAULT "\0" \ 177 "mtdparts=" MTDPARTS_DEFAULT "\0" \ 178 "mmcdev=0\0" \ 179 "mmcroot=/dev/mmcblk0p2 rw\0" \ 180 "mmcrootfstype=ext4 rootwait\0" \ 181 "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \ 182 "nandrootfstype=ubifs rootwait\0" \ 183 "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \ 184 "if run loadbootscript; then " \ 185 "run bootscript; " \ 186 "else " \ 187 "run defaultboot;" \ 188 "fi; " \ 189 "else run defaultboot; fi\0" \ 190 "defaultboot=run mmcramboot\0" \ 191 "consoledevice=ttyO0\0" \ 192 "display=15\0" \ 193 "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \ 194 "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \ 195 "rotation=0\0" \ 196 "vrfb_arg=if itest ${rotation} -ne 0; then " \ 197 "setenv bootargs ${bootargs} omapfb.vrfb=y " \ 198 "omapfb.rotate=${rotation}; " \ 199 "fi\0" \ 200 "optargs=ignore_loglevel early_printk no_console_suspend\0" \ 201 "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \ 202 "common_bootargs=setenv bootargs ${bootargs} display=${display} " \ 203 "${optargs};" \ 204 "run addmtdparts; " \ 205 "run vrfb_arg\0" \ 206 "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ 207 "bootscript=echo 'Running bootscript from mmc ...'; " \ 208 "source ${loadaddr}\0" \ 209 "loaduimage=mmc rescan; " \ 210 "fatload mmc ${mmcdev} ${loadaddr} ${uimage}\0" \ 211 "loadzimage=mmc rescan; " \ 212 "fatload mmc ${mmcdev} ${loadaddr} ${zimage}\0" \ 213 "ramdisksize=64000\0" \ 214 "ramdiskaddr=0x82000000\0" \ 215 "ramdiskimage=rootfs.ext2.gz.uboot\0" \ 216 "loadramdisk=mmc rescan; " \ 217 "fatload mmc ${mmcdev} ${ramdiskaddr} ${ramdiskimage}\0" \ 218 "ramargs=run setconsole; setenv bootargs console=${console} " \ 219 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \ 220 "mmcargs=run setconsole; setenv bootargs console=${console} " \ 221 "${optargs} " \ 222 "root=${mmcroot} " \ 223 "rootfstype=${mmcrootfstype}\0" \ 224 "nandargs=run setconsole; setenv bootargs console=${console} " \ 225 "${optargs} " \ 226 "root=${nandroot} " \ 227 "rootfstype=${nandrootfstype}\0" \ 228 "fdtaddr=0x86000000\0" \ 229 "loadfdtimage=mmc rescan; " \ 230 "fatload mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \ 231 "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \ 232 "run mmcargs; " \ 233 "run common_bootargs; " \ 234 "run dump_bootargs; " \ 235 "run loadzimage; " \ 236 "run loadfdtimage; " \ 237 "bootz ${loadaddr} - ${fdtaddr}\0" \ 238 "mmcramboot=echo 'Booting uImage kernel from mmc w/ramdisk...'; " \ 239 "run ramargs; " \ 240 "run common_bootargs; " \ 241 "run dump_bootargs; " \ 242 "run loaduimage; " \ 243 "run loadramdisk; " \ 244 "bootm ${loadaddr} ${ramdiskaddr}\0" \ 245 "mmcrambootz=echo 'Booting zImage kernel from mmc w/ramdisk...'; " \ 246 "run ramargs; " \ 247 "run common_bootargs; " \ 248 "run dump_bootargs; " \ 249 "run loadzimage; " \ 250 "run loadramdisk; " \ 251 "run loadfdtimage; " \ 252 "bootz ${loadaddr} ${ramdiskaddr} ${fdtaddr}\0; " \ 253 "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \ 254 "run ramargs; " \ 255 "run common_bootargs; " \ 256 "run dump_bootargs; " \ 257 "tftpboot ${loadaddr} ${uimage}; " \ 258 "tftpboot ${ramdiskaddr} ${ramdiskimage}; " \ 259 "bootm ${loadaddr} ${ramdiskaddr}\0" 260 261 #define CONFIG_BOOTCOMMAND \ 262 "run autoboot" 263 264 /* Miscellaneous configurable options */ 265 #define CONFIG_AUTO_COMPLETE 266 267 /* memtest works on */ 268 #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) 269 #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \ 270 0x01F00000) /* 31MB */ 271 272 /* FLASH and environment organization */ 273 274 /* **** PISMO SUPPORT *** */ 275 #if defined(CONFIG_CMD_NAND) 276 #define CONFIG_SYS_FLASH_BASE NAND_BASE 277 #elif defined(CONFIG_CMD_ONENAND) 278 #define CONFIG_SYS_FLASH_BASE ONENAND_MAP 279 #endif 280 281 /* Monitor at start of flash */ 282 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE 283 284 #define CONFIG_ENV_IS_IN_NAND 1 285 #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ 286 #define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */ 287 #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */ 288 289 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ 290 #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET 291 #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET 292 293 294 /* SMSC922x Ethernet */ 295 #if defined(CONFIG_CMD_NET) 296 #define CONFIG_SMC911X 297 #define CONFIG_SMC911X_32_BIT 298 #define CONFIG_SMC911X_BASE 0x08000000 299 #endif /* (CONFIG_CMD_NET) */ 300 301 /* Defines for SPL */ 302 303 #define CONFIG_SPL_OMAP3_ID_NAND 304 305 /* NAND: SPL falcon mode configs */ 306 #ifdef CONFIG_SPL_OS_BOOT 307 #define CONFIG_CMD_SPL_NAND_OFS 0x240000 308 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000 309 #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000 310 #endif 311 312 #endif /* __CONFIG_H */ 313