Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 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 | */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 16 | #define CONFIG_CM_T3517 /* working with CM-T3517 */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 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 | */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 25 | |
| 26 | #define CONFIG_EMIF4 /* The chip has EMIF4 controller */ |
| 27 | |
| 28 | #include <asm/arch/cpu.h> /* get chip and board defs */ |
Nishanth Menon | 987ec58 | 2015-03-09 17:12:04 -0500 | [diff] [blame] | 29 | #include <asm/arch/omap.h> |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 30 | |
Dmitry Lifshitz | f3b44e8 | 2015-09-09 11:27:17 +0300 | [diff] [blame] | 31 | #define CONFIG_MACH_TYPE MACH_TYPE_CM_T3517 |
| 32 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 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 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 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 | */ |
Dmitry Lifshitz | 2f6e4bf | 2015-09-09 11:25:39 +0300 | [diff] [blame] | 56 | #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 57 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10)) |
| 58 | |
| 59 | /* |
| 60 | * Hardware drivers |
| 61 | */ |
| 62 | |
| 63 | /* |
| 64 | * NS16550 Configuration |
| 65 | */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 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 */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 76 | |
| 77 | /* allow to overwrite serial and ethaddr */ |
| 78 | #define CONFIG_ENV_OVERWRITE |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 79 | #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ |
| 80 | 115200} |
| 81 | |
Igor Grinberg | 011f5c1 | 2014-11-03 11:32:25 +0200 | [diff] [blame] | 82 | /* USB */ |
| 83 | #define CONFIG_USB_MUSB_AM35X |
| 84 | |
| 85 | #ifndef CONFIG_USB_MUSB_AM35X |
| 86 | #define CONFIG_USB_OMAP3 |
Igor Grinberg | 011f5c1 | 2014-11-03 11:32:25 +0200 | [diff] [blame] | 87 | #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 146 |
| 88 | #define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 147 |
| 89 | #else /* !CONFIG_USB_MUSB_AM35X */ |
Paul Kocialkowski | 95de1e2 | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 90 | #define CONFIG_USB_MUSB_PIO_ONLY |
Igor Grinberg | 011f5c1 | 2014-11-03 11:32:25 +0200 | [diff] [blame] | 91 | #endif /* CONFIG_USB_MUSB_AM35X */ |
| 92 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 93 | /* commands to include */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 94 | #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ |
| 95 | #define CONFIG_MTD_PARTITIONS |
| 96 | #define MTDIDS_DEFAULT "nand0=nand" |
| 97 | #define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\ |
| 98 | "1920k(u-boot),256k(u-boot-env),"\ |
| 99 | "4m(kernel),-(fs)" |
| 100 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 101 | #define CONFIG_SYS_I2C |
| 102 | #define CONFIG_SYS_OMAP24_I2C_SPEED 400000 |
| 103 | #define CONFIG_SYS_OMAP24_I2C_SLAVE 1 |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 104 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 |
| 105 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 |
| 106 | #define CONFIG_SYS_I2C_EEPROM_BUS 0 |
| 107 | #define CONFIG_I2C_MULTI_BUS |
| 108 | |
| 109 | /* |
| 110 | * Board NAND Info. |
| 111 | */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 112 | #define CONFIG_NAND_OMAP_GPMC |
| 113 | #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */ |
| 114 | /* to access nand */ |
| 115 | #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */ |
| 116 | /* to access nand at */ |
| 117 | /* CS0 */ |
| 118 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ |
| 119 | /* devices */ |
| 120 | |
| 121 | /* Environment information */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 122 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 123 | "loadaddr=0x82000000\0" \ |
| 124 | "baudrate=115200\0" \ |
| 125 | "console=ttyO2,115200n8\0" \ |
Dmitry Lifshitz | e093d0b | 2015-09-08 09:50:00 +0300 | [diff] [blame] | 126 | "netretry=yes\0" \ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 127 | "mpurate=auto\0" \ |
| 128 | "vram=12M\0" \ |
| 129 | "dvimode=1024x768MR-16@60\0" \ |
| 130 | "defaultdisplay=dvi\0" \ |
| 131 | "mmcdev=0\0" \ |
| 132 | "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \ |
| 133 | "mmcrootfstype=ext4\0" \ |
| 134 | "nandroot=/dev/mtdblock4 rw\0" \ |
| 135 | "nandrootfstype=ubifs\0" \ |
| 136 | "mmcargs=setenv bootargs console=${console} " \ |
| 137 | "mpurate=${mpurate} " \ |
| 138 | "vram=${vram} " \ |
| 139 | "omapfb.mode=dvi:${dvimode} " \ |
| 140 | "omapdss.def_disp=${defaultdisplay} " \ |
| 141 | "root=${mmcroot} " \ |
| 142 | "rootfstype=${mmcrootfstype}\0" \ |
| 143 | "nandargs=setenv bootargs console=${console} " \ |
| 144 | "mpurate=${mpurate} " \ |
| 145 | "vram=${vram} " \ |
| 146 | "omapfb.mode=dvi:${dvimode} " \ |
| 147 | "omapdss.def_disp=${defaultdisplay} " \ |
| 148 | "root=${nandroot} " \ |
| 149 | "rootfstype=${nandrootfstype}\0" \ |
| 150 | "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ |
| 151 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 152 | "source ${loadaddr}\0" \ |
| 153 | "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ |
| 154 | "mmcboot=echo Booting from mmc ...; " \ |
| 155 | "run mmcargs; " \ |
| 156 | "bootm ${loadaddr}\0" \ |
| 157 | "nandboot=echo Booting from nand ...; " \ |
| 158 | "run nandargs; " \ |
| 159 | "nand read ${loadaddr} 2a0000 400000; " \ |
| 160 | "bootm ${loadaddr}\0" \ |
| 161 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 162 | #define CONFIG_BOOTCOMMAND \ |
| 163 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 164 | "if run loadbootscript; then " \ |
| 165 | "run bootscript; " \ |
| 166 | "else " \ |
| 167 | "if run loaduimage; then " \ |
| 168 | "run mmcboot; " \ |
| 169 | "else run nandboot; " \ |
| 170 | "fi; " \ |
| 171 | "fi; " \ |
| 172 | "else run nandboot; fi" |
| 173 | |
| 174 | /* |
| 175 | * Miscellaneous configurable options |
| 176 | */ |
| 177 | #define CONFIG_AUTO_COMPLETE |
| 178 | #define CONFIG_CMDLINE_EDITING |
| 179 | #define CONFIG_TIMESTAMP |
| 180 | #define CONFIG_SYS_AUTOLOAD "no" |
| 181 | #define CONFIG_SYS_LONGHELP /* undef to save memory */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 182 | #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ |
| 183 | /* Print Buffer Size */ |
| 184 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 185 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 186 | #define CONFIG_SYS_MAXARGS 32 /* max number of command args */ |
| 187 | /* Boot Argument Buffer Size */ |
| 188 | #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) |
| 189 | |
| 190 | #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0 + 0x02000000) |
| 191 | |
| 192 | /* |
| 193 | * AM3517 has 12 GP timers, they can be driven by the system clock |
| 194 | * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK). |
| 195 | * This rate is divided by a local divisor. |
| 196 | */ |
| 197 | #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2) |
| 198 | #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ |
| 199 | #define CONFIG_SYS_HZ 1000 |
| 200 | |
| 201 | /*----------------------------------------------------------------------- |
| 202 | * Physical Memory Map |
| 203 | */ |
| 204 | #define CONFIG_NR_DRAM_BANKS 1 /* CM-T3517 DRAM is only on CS0 */ |
| 205 | #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 |
| 206 | #define CONFIG_SYS_CS0_SIZE (256 << 20) |
| 207 | |
| 208 | /*----------------------------------------------------------------------- |
| 209 | * FLASH and environment organization |
| 210 | */ |
| 211 | |
| 212 | /* **** PISMO SUPPORT *** */ |
| 213 | /* Monitor at start of flash */ |
| 214 | #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE |
| 215 | #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */ |
| 216 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 217 | #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */ |
| 218 | #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET |
| 219 | #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET |
| 220 | |
Igor Grinberg | a8a78c7 | 2014-11-03 11:32:26 +0200 | [diff] [blame] | 221 | #if defined(CONFIG_CMD_NET) |
| 222 | #define CONFIG_DRIVER_TI_EMAC |
| 223 | #define CONFIG_DRIVER_TI_EMAC_USE_RMII |
| 224 | #define CONFIG_MII |
| 225 | #define CONFIG_SMC911X |
| 226 | #define CONFIG_SMC911X_32_BIT |
| 227 | #define CONFIG_SMC911X_BASE (0x2C000000 + (16 << 20)) |
Dmitry Lifshitz | e093d0b | 2015-09-08 09:50:00 +0300 | [diff] [blame] | 228 | #define CONFIG_ARP_TIMEOUT 200UL |
| 229 | #define CONFIG_NET_RETRY_COUNT 5 |
Igor Grinberg | a8a78c7 | 2014-11-03 11:32:26 +0200 | [diff] [blame] | 230 | #endif /* CONFIG_CMD_NET */ |
| 231 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 232 | /* additions for new relocation code, must be added to all boards */ |
| 233 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
| 234 | #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 |
| 235 | #define CONFIG_SYS_INIT_RAM_SIZE 0x800 |
| 236 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ |
| 237 | CONFIG_SYS_INIT_RAM_SIZE - \ |
| 238 | GENERATED_GBL_DATA_SIZE) |
| 239 | |
| 240 | /* Status LED */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 241 | #define GREEN_LED_GPIO 186 /* CM-T3517 Green LED is GPIO186 */ |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 242 | |
Igor Grinberg | 40bbd52 | 2014-11-03 11:32:27 +0200 | [diff] [blame] | 243 | /* Display Configuration */ |
Igor Grinberg | 40bbd52 | 2014-11-03 11:32:27 +0200 | [diff] [blame] | 244 | #define CONFIG_VIDEO_OMAP3 |
| 245 | #define LCD_BPP LCD_COLOR16 |
| 246 | |
Igor Grinberg | 40bbd52 | 2014-11-03 11:32:27 +0200 | [diff] [blame] | 247 | #define CONFIG_SPLASH_SCREEN |
| 248 | #define CONFIG_SPLASHIMAGE_GUARD |
Igor Grinberg | 40bbd52 | 2014-11-03 11:32:27 +0200 | [diff] [blame] | 249 | #define CONFIG_BMP_16BPP |
| 250 | #define CONFIG_SCF0403_LCD |
| 251 | |
Nikita Kiryanov | 19a90ed | 2016-04-16 17:55:08 +0300 | [diff] [blame] | 252 | /* EEPROM */ |
Nikita Kiryanov | 19a90ed | 2016-04-16 17:55:08 +0300 | [diff] [blame] | 253 | #define CONFIG_ENV_EEPROM_IS_ON_I2C |
| 254 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 |
| 255 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 |
| 256 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 |
| 257 | #define CONFIG_SYS_EEPROM_SIZE 256 |
| 258 | |
Igor Grinberg | b09bf72 | 2014-11-05 14:25:35 +0200 | [diff] [blame] | 259 | #endif /* __CONFIG_H */ |