blob: 19117a0af41d628ef8f0b5a1dd019250738747fd [file] [log] [blame]
Igor Grinbergc3373ee2014-11-05 14:25:35 +02001/*
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 Grinbergc3373ee2014-11-05 14:25:35 +020016#define CONFIG_CM_T3517 /* working with CM-T3517 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020017
Igor Grinbergc3373ee2014-11-05 14:25:35 +020018/*
19 * This is needed for the DMA stuff.
20 * Although the default iss 64, we still define it
21 * to be on the safe side once the default is changed.
22 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020023
Igor Grinbergc3373ee2014-11-05 14:25:35 +020024#include <asm/arch/cpu.h> /* get chip and board defs */
Nishanth Menonfa96c962015-03-09 17:12:04 -050025#include <asm/arch/omap.h>
Igor Grinbergc3373ee2014-11-05 14:25:35 +020026
Dmitry Lifshitza65120c2015-09-09 11:27:17 +030027#define CONFIG_MACH_TYPE MACH_TYPE_CM_T3517
28
Igor Grinbergc3373ee2014-11-05 14:25:35 +020029/* Clock Defines */
30#define V_OSCK 26000000 /* Clock output from T2 */
31#define V_SCLK (V_OSCK >> 1)
32
33#define CONFIG_MISC_INIT_R
34
Igor Grinbergc3373ee2014-11-05 14:25:35 +020035/*
36 * The early kernel mapping on ARM currently only maps from the base of DRAM
37 * to the end of the kernel image. The kernel is loaded at DRAM base + 0x8000.
38 * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
39 * so that leaves DRAM base to DRAM base + 0x4000 available.
40 */
41#define CONFIG_SYS_BOOTMAPSZ 0x4000
42
43#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
44#define CONFIG_SETUP_MEMORY_TAGS
45#define CONFIG_INITRD_TAG
46#define CONFIG_REVISION_TAG
47#define CONFIG_SERIAL_TAG
48
49/*
50 * Size of malloc() pool
51 */
Dmitry Lifshitz4fb49e02015-09-09 11:25:39 +030052#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020053#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10))
54
55/*
56 * Hardware drivers
57 */
58
59/*
60 * NS16550 Configuration
61 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020062#define CONFIG_SYS_NS16550_SERIAL
63#define CONFIG_SYS_NS16550_REG_SIZE (-4)
64#define CONFIG_SYS_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
65
66/*
67 * select serial console configuration
68 */
69#define CONFIG_CONS_INDEX 3
70#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
71#define CONFIG_SERIAL3 3 /* UART3 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020072
73/* allow to overwrite serial and ethaddr */
74#define CONFIG_ENV_OVERWRITE
Igor Grinbergc3373ee2014-11-05 14:25:35 +020075#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
76 115200}
77
Igor Grinbergf7fd7e42014-11-03 11:32:25 +020078/* USB */
Igor Grinbergf7fd7e42014-11-03 11:32:25 +020079
80#ifndef CONFIG_USB_MUSB_AM35X
Igor Grinbergf7fd7e42014-11-03 11:32:25 +020081#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 146
82#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 147
Igor Grinbergf7fd7e42014-11-03 11:32:25 +020083#endif /* CONFIG_USB_MUSB_AM35X */
84
Igor Grinbergc3373ee2014-11-05 14:25:35 +020085/* commands to include */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020086#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
87#define CONFIG_MTD_PARTITIONS
Igor Grinbergc3373ee2014-11-05 14:25:35 +020088
Igor Grinbergc3373ee2014-11-05 14:25:35 +020089#define CONFIG_SYS_I2C
Igor Grinbergc3373ee2014-11-05 14:25:35 +020090#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
91#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
92#define CONFIG_SYS_I2C_EEPROM_BUS 0
93#define CONFIG_I2C_MULTI_BUS
94
95/*
96 * Board NAND Info.
97 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +020098#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
99 /* to access nand */
100#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
101 /* to access nand at */
102 /* CS0 */
103#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
104 /* devices */
105
106/* Environment information */
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200107#define CONFIG_EXTRA_ENV_SETTINGS \
108 "loadaddr=0x82000000\0" \
109 "baudrate=115200\0" \
110 "console=ttyO2,115200n8\0" \
Dmitry Lifshitz0233cbc2015-09-08 09:50:00 +0300111 "netretry=yes\0" \
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200112 "mpurate=auto\0" \
113 "vram=12M\0" \
114 "dvimode=1024x768MR-16@60\0" \
115 "defaultdisplay=dvi\0" \
116 "mmcdev=0\0" \
117 "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
118 "mmcrootfstype=ext4\0" \
119 "nandroot=/dev/mtdblock4 rw\0" \
120 "nandrootfstype=ubifs\0" \
121 "mmcargs=setenv bootargs console=${console} " \
122 "mpurate=${mpurate} " \
123 "vram=${vram} " \
124 "omapfb.mode=dvi:${dvimode} " \
125 "omapdss.def_disp=${defaultdisplay} " \
126 "root=${mmcroot} " \
127 "rootfstype=${mmcrootfstype}\0" \
128 "nandargs=setenv bootargs console=${console} " \
129 "mpurate=${mpurate} " \
130 "vram=${vram} " \
131 "omapfb.mode=dvi:${dvimode} " \
132 "omapdss.def_disp=${defaultdisplay} " \
133 "root=${nandroot} " \
134 "rootfstype=${nandrootfstype}\0" \
135 "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
136 "bootscript=echo Running bootscript from mmc ...; " \
137 "source ${loadaddr}\0" \
138 "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
139 "mmcboot=echo Booting from mmc ...; " \
140 "run mmcargs; " \
141 "bootm ${loadaddr}\0" \
142 "nandboot=echo Booting from nand ...; " \
143 "run nandargs; " \
144 "nand read ${loadaddr} 2a0000 400000; " \
145 "bootm ${loadaddr}\0" \
146
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200147#define CONFIG_BOOTCOMMAND \
148 "mmc dev ${mmcdev}; if mmc rescan; then " \
149 "if run loadbootscript; then " \
150 "run bootscript; " \
151 "else " \
152 "if run loaduimage; then " \
153 "run mmcboot; " \
154 "else run nandboot; " \
155 "fi; " \
156 "fi; " \
157 "else run nandboot; fi"
158
159/*
160 * Miscellaneous configurable options
161 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200162#define CONFIG_TIMESTAMP
163#define CONFIG_SYS_AUTOLOAD "no"
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200164#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200165#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200166
167#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0 + 0x02000000)
168
169/*
170 * AM3517 has 12 GP timers, they can be driven by the system clock
171 * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
172 * This rate is divided by a local divisor.
173 */
174#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
175#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
176#define CONFIG_SYS_HZ 1000
177
178/*-----------------------------------------------------------------------
179 * Physical Memory Map
180 */
181#define CONFIG_NR_DRAM_BANKS 1 /* CM-T3517 DRAM is only on CS0 */
182#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
183#define CONFIG_SYS_CS0_SIZE (256 << 20)
184
185/*-----------------------------------------------------------------------
186 * FLASH and environment organization
187 */
188
189/* **** PISMO SUPPORT *** */
190/* Monitor at start of flash */
191#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
192#define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
193
Adam Ford6b1c1652017-09-04 21:08:02 -0500194#define CONFIG_ENV_OFFSET 0x260000
195#define CONFIG_ENV_ADDR 0x260000
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200196
Igor Grinbergdfb92d02014-11-03 11:32:26 +0200197#if defined(CONFIG_CMD_NET)
198#define CONFIG_DRIVER_TI_EMAC
199#define CONFIG_DRIVER_TI_EMAC_USE_RMII
200#define CONFIG_MII
Dmitry Lifshitz0233cbc2015-09-08 09:50:00 +0300201#define CONFIG_ARP_TIMEOUT 200UL
202#define CONFIG_NET_RETRY_COUNT 5
Igor Grinbergdfb92d02014-11-03 11:32:26 +0200203#endif /* CONFIG_CMD_NET */
204
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200205/* additions for new relocation code, must be added to all boards */
206#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
207#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
208#define CONFIG_SYS_INIT_RAM_SIZE 0x800
209#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
210 CONFIG_SYS_INIT_RAM_SIZE - \
211 GENERATED_GBL_DATA_SIZE)
212
213/* Status LED */
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200214#define GREEN_LED_GPIO 186 /* CM-T3517 Green LED is GPIO186 */
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200215
Igor Grinberg62a95852014-11-03 11:32:27 +0200216/* Display Configuration */
Igor Grinberg62a95852014-11-03 11:32:27 +0200217#define CONFIG_VIDEO_OMAP3
218#define LCD_BPP LCD_COLOR16
219
Igor Grinberg62a95852014-11-03 11:32:27 +0200220#define CONFIG_SPLASH_SCREEN
221#define CONFIG_SPLASHIMAGE_GUARD
Igor Grinberg62a95852014-11-03 11:32:27 +0200222#define CONFIG_BMP_16BPP
223#define CONFIG_SCF0403_LCD
224
Nikita Kiryanov8e06caf2016-04-16 17:55:08 +0300225/* EEPROM */
Nikita Kiryanov8e06caf2016-04-16 17:55:08 +0300226#define CONFIG_ENV_EEPROM_IS_ON_I2C
227#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
228#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
229#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
230#define CONFIG_SYS_EEPROM_SIZE 256
231
Igor Grinbergc3373ee2014-11-05 14:25:35 +0200232#endif /* __CONFIG_H */