1 /* 2 * (C) Copyright 2013 CompuLab, Ltd. 3 * Author: Igor Grinberg <grinberg@compulab.co.il> 4 * 5 * Configuration settings for the CompuLab CM-T3517 board 6 * 7 * SPDX-License-Identifier: GPL-2.0+ 8 */ 9 10 #ifndef __CONFIG_H 11 #define __CONFIG_H 12 13 /* 14 * High Level Configuration Options 15 */ 16 #define CONFIG_CM_T3517 /* working with CM-T3517 */ 17 18 #define CONFIG_SYS_TEXT_BASE 0x80008000 19 20 /* 21 * This is needed for the DMA stuff. 22 * Although the default iss 64, we still define it 23 * to be on the safe side once the default is changed. 24 */ 25 26 #define CONFIG_EMIF4 /* The chip has EMIF4 controller */ 27 28 #include <asm/arch/cpu.h> /* get chip and board defs */ 29 #include <asm/arch/omap.h> 30 31 #define CONFIG_MACH_TYPE MACH_TYPE_CM_T3517 32 33 /* Clock Defines */ 34 #define V_OSCK 26000000 /* Clock output from T2 */ 35 #define V_SCLK (V_OSCK >> 1) 36 37 #define CONFIG_MISC_INIT_R 38 39 /* 40 * The early kernel mapping on ARM currently only maps from the base of DRAM 41 * to the end of the kernel image. The kernel is loaded at DRAM base + 0x8000. 42 * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000, 43 * so that leaves DRAM base to DRAM base + 0x4000 available. 44 */ 45 #define CONFIG_SYS_BOOTMAPSZ 0x4000 46 47 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ 48 #define CONFIG_SETUP_MEMORY_TAGS 49 #define CONFIG_INITRD_TAG 50 #define CONFIG_REVISION_TAG 51 #define CONFIG_SERIAL_TAG 52 53 /* 54 * Size of malloc() pool 55 */ 56 #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ 57 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10)) 58 59 /* 60 * Hardware drivers 61 */ 62 63 /* 64 * NS16550 Configuration 65 */ 66 #define CONFIG_SYS_NS16550_SERIAL 67 #define CONFIG_SYS_NS16550_REG_SIZE (-4) 68 #define CONFIG_SYS_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */ 69 70 /* 71 * select serial console configuration 72 */ 73 #define CONFIG_CONS_INDEX 3 74 #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3 75 #define CONFIG_SERIAL3 3 /* UART3 */ 76 77 /* allow to overwrite serial and ethaddr */ 78 #define CONFIG_ENV_OVERWRITE 79 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ 80 115200} 81 82 /* USB */ 83 #define CONFIG_USB_MUSB_AM35X 84 85 #ifndef CONFIG_USB_MUSB_AM35X 86 #define CONFIG_USB_OMAP3 87 #define CONFIG_USB_EHCI_OMAP 88 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 146 89 #define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 147 90 #else /* !CONFIG_USB_MUSB_AM35X */ 91 #define CONFIG_USB_MUSB_PIO_ONLY 92 #endif /* CONFIG_USB_MUSB_AM35X */ 93 94 /* commands to include */ 95 #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ 96 #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ 97 #define CONFIG_MTD_PARTITIONS 98 #define MTDIDS_DEFAULT "nand0=nand" 99 #define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\ 100 "1920k(u-boot),256k(u-boot-env),"\ 101 "4m(kernel),-(fs)" 102 103 #define CONFIG_CMD_NAND /* NAND support */ 104 105 #define CONFIG_SYS_I2C 106 #define CONFIG_SYS_OMAP24_I2C_SPEED 400000 107 #define CONFIG_SYS_OMAP24_I2C_SLAVE 1 108 #define CONFIG_SYS_I2C_OMAP34XX 109 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 110 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 111 #define CONFIG_SYS_I2C_EEPROM_BUS 0 112 #define CONFIG_I2C_MULTI_BUS 113 114 /* 115 * Board NAND Info. 116 */ 117 #define CONFIG_NAND_OMAP_GPMC 118 #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */ 119 /* to access nand */ 120 #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */ 121 /* to access nand at */ 122 /* CS0 */ 123 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ 124 /* devices */ 125 126 /* Environment information */ 127 #define CONFIG_EXTRA_ENV_SETTINGS \ 128 "loadaddr=0x82000000\0" \ 129 "baudrate=115200\0" \ 130 "console=ttyO2,115200n8\0" \ 131 "netretry=yes\0" \ 132 "mpurate=auto\0" \ 133 "vram=12M\0" \ 134 "dvimode=1024x768MR-16@60\0" \ 135 "defaultdisplay=dvi\0" \ 136 "mmcdev=0\0" \ 137 "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \ 138 "mmcrootfstype=ext4\0" \ 139 "nandroot=/dev/mtdblock4 rw\0" \ 140 "nandrootfstype=ubifs\0" \ 141 "mmcargs=setenv bootargs console=${console} " \ 142 "mpurate=${mpurate} " \ 143 "vram=${vram} " \ 144 "omapfb.mode=dvi:${dvimode} " \ 145 "omapdss.def_disp=${defaultdisplay} " \ 146 "root=${mmcroot} " \ 147 "rootfstype=${mmcrootfstype}\0" \ 148 "nandargs=setenv bootargs console=${console} " \ 149 "mpurate=${mpurate} " \ 150 "vram=${vram} " \ 151 "omapfb.mode=dvi:${dvimode} " \ 152 "omapdss.def_disp=${defaultdisplay} " \ 153 "root=${nandroot} " \ 154 "rootfstype=${nandrootfstype}\0" \ 155 "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ 156 "bootscript=echo Running bootscript from mmc ...; " \ 157 "source ${loadaddr}\0" \ 158 "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ 159 "mmcboot=echo Booting from mmc ...; " \ 160 "run mmcargs; " \ 161 "bootm ${loadaddr}\0" \ 162 "nandboot=echo Booting from nand ...; " \ 163 "run nandargs; " \ 164 "nand read ${loadaddr} 2a0000 400000; " \ 165 "bootm ${loadaddr}\0" \ 166 167 #define CONFIG_BOOTCOMMAND \ 168 "mmc dev ${mmcdev}; if mmc rescan; then " \ 169 "if run loadbootscript; then " \ 170 "run bootscript; " \ 171 "else " \ 172 "if run loaduimage; then " \ 173 "run mmcboot; " \ 174 "else run nandboot; " \ 175 "fi; " \ 176 "fi; " \ 177 "else run nandboot; fi" 178 179 /* 180 * Miscellaneous configurable options 181 */ 182 #define CONFIG_AUTO_COMPLETE 183 #define CONFIG_CMDLINE_EDITING 184 #define CONFIG_TIMESTAMP 185 #define CONFIG_SYS_AUTOLOAD "no" 186 #define CONFIG_SYS_LONGHELP /* undef to save memory */ 187 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ 188 /* Print Buffer Size */ 189 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 190 sizeof(CONFIG_SYS_PROMPT) + 16) 191 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */ 192 /* Boot Argument Buffer Size */ 193 #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) 194 195 #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0 + 0x02000000) 196 197 /* 198 * AM3517 has 12 GP timers, they can be driven by the system clock 199 * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK). 200 * This rate is divided by a local divisor. 201 */ 202 #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2) 203 #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ 204 #define CONFIG_SYS_HZ 1000 205 206 /*----------------------------------------------------------------------- 207 * Physical Memory Map 208 */ 209 #define CONFIG_NR_DRAM_BANKS 1 /* CM-T3517 DRAM is only on CS0 */ 210 #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 211 #define CONFIG_SYS_CS0_SIZE (256 << 20) 212 213 /*----------------------------------------------------------------------- 214 * FLASH and environment organization 215 */ 216 217 /* **** PISMO SUPPORT *** */ 218 /* Monitor at start of flash */ 219 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE 220 #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */ 221 222 #define CONFIG_ENV_IS_IN_NAND 223 #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */ 224 #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET 225 #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET 226 227 #if defined(CONFIG_CMD_NET) 228 #define CONFIG_DRIVER_TI_EMAC 229 #define CONFIG_DRIVER_TI_EMAC_USE_RMII 230 #define CONFIG_MII 231 #define CONFIG_SMC911X 232 #define CONFIG_SMC911X_32_BIT 233 #define CONFIG_SMC911X_BASE (0x2C000000 + (16 << 20)) 234 #define CONFIG_ARP_TIMEOUT 200UL 235 #define CONFIG_NET_RETRY_COUNT 5 236 #endif /* CONFIG_CMD_NET */ 237 238 /* additions for new relocation code, must be added to all boards */ 239 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 240 #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 241 #define CONFIG_SYS_INIT_RAM_SIZE 0x800 242 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ 243 CONFIG_SYS_INIT_RAM_SIZE - \ 244 GENERATED_GBL_DATA_SIZE) 245 246 /* Status LED */ 247 #define GREEN_LED_GPIO 186 /* CM-T3517 Green LED is GPIO186 */ 248 249 /* Display Configuration */ 250 #define CONFIG_VIDEO_OMAP3 251 #define LCD_BPP LCD_COLOR16 252 253 #define CONFIG_SPLASH_SCREEN 254 #define CONFIG_SPLASHIMAGE_GUARD 255 #define CONFIG_BMP_16BPP 256 #define CONFIG_SCF0403_LCD 257 258 #define CONFIG_OMAP3_SPI 259 260 /* EEPROM */ 261 #define CONFIG_CMD_EEPROM 262 #define CONFIG_ENV_EEPROM_IS_ON_I2C 263 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 264 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 265 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 266 #define CONFIG_SYS_EEPROM_SIZE 256 267 268 #define CONFIG_CMD_EEPROM_LAYOUT 269 #define CONFIG_EEPROM_LAYOUT_HELP_STRING "v1, v2, v3" 270 271 #endif /* __CONFIG_H */ 272