Merge branch '2021-08-31-kconfig-migrations-part2' into next
[platform/kernel/u-boot.git] / include / configs / omapl138_lcdk.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
4  *
5  * Based on davinci_dvevm.h. Original Copyrights follow:
6  *
7  * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
8  */
9
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12
13 /*
14  * Board
15  */
16
17 /*
18  * SoC Configuration
19  */
20 #define CONFIG_MACH_OMAPL138_LCDK
21 #define CONFIG_SYS_CLK_FREQ             clk_get(DAVINCI_ARM_CLKID)
22 #define CONFIG_SYS_OSCIN_FREQ           24000000
23 #define CONFIG_SYS_TIMERBASE            DAVINCI_TIMER0_BASE
24 #define CONFIG_SYS_HZ_CLOCK             clk_get(DAVINCI_AUXCLK_CLKID)
25 #define CONFIG_SYS_HZ                   1000
26
27 /*
28  * Memory Info
29  */
30 #define PHYS_SDRAM_1            DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
31 #define PHYS_SDRAM_1_SIZE       (128 << 20) /* SDRAM size 128MB */
32 #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
33
34 #define CONFIG_SPL_BSS_START_ADDR DAVINCI_DDR_EMIF_DATA_BASE
35 #define CONFIG_SPL_BSS_MAX_SIZE 0x1080000
36
37 /* memtest start addr */
38
39 /* memtest will be run on 16MB */
40
41 #define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (       \
42         DAVINCI_SYSCFG_SUSPSRC_TIMER0 |         \
43         DAVINCI_SYSCFG_SUSPSRC_SPI1 |           \
44         DAVINCI_SYSCFG_SUSPSRC_UART2 |          \
45         DAVINCI_SYSCFG_SUSPSRC_EMAC |           \
46         DAVINCI_SYSCFG_SUSPSRC_I2C)
47
48 /*
49  * PLL configuration
50  */
51
52 /* Requires CONFIG_SYS_DA850_PLL0_POSTDIV=0, set in Kconfig */
53 #define CONFIG_SYS_DA850_PLL0_PLLM     18
54 #define CONFIG_SYS_DA850_PLL1_PLLM     21
55
56 /*
57  * DDR2 memory configuration
58  */
59 #define CONFIG_SYS_DA850_DDR2_DDRPHYCR (DV_DDR_PHY_PWRDNEN | \
60                                         DV_DDR_PHY_EXT_STRBEN | \
61                                         (0x5 << DV_DDR_PHY_RD_LATENCY_SHIFT))
62
63 #define CONFIG_SYS_DA850_DDR2_SDBCR (             \
64         (1 << DV_DDR_SDCR_DDR2EN_SHIFT)         | \
65         (1 << DV_DDR_SDCR_DDREN_SHIFT)          | \
66         (1 << DV_DDR_SDCR_SDRAMEN_SHIFT)        | \
67         (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT)      | \
68         (4 << DV_DDR_SDCR_CL_SHIFT)             | \
69         (3 << DV_DDR_SDCR_IBANK_SHIFT)          | \
70         (2 << DV_DDR_SDCR_PAGESIZE_SHIFT))
71
72 /* SDBCR2 is only used if IBANK_POS bit in SDBCR is set */
73 #define CONFIG_SYS_DA850_DDR2_SDBCR2 0
74
75 #define CONFIG_SYS_DA850_DDR2_SDTIMR (            \
76         (19 << DV_DDR_SDTMR1_RFC_SHIFT)         | \
77         (1 << DV_DDR_SDTMR1_RP_SHIFT)           | \
78         (1 << DV_DDR_SDTMR1_RCD_SHIFT)          | \
79         (2 << DV_DDR_SDTMR1_WR_SHIFT)           | \
80         (6 << DV_DDR_SDTMR1_RAS_SHIFT)          | \
81         (8 << DV_DDR_SDTMR1_RC_SHIFT)           | \
82         (1 << DV_DDR_SDTMR1_RRD_SHIFT)          | \
83         (1 << DV_DDR_SDTMR1_WTR_SHIFT))
84
85 #define CONFIG_SYS_DA850_DDR2_SDTIMR2 (           \
86         (7 << DV_DDR_SDTMR2_RASMAX_SHIFT)       | \
87         (2 << DV_DDR_SDTMR2_XP_SHIFT)           | \
88         (0 << DV_DDR_SDTMR2_ODT_SHIFT)          | \
89         (20 << DV_DDR_SDTMR2_XSNR_SHIFT)        | \
90         (199 << DV_DDR_SDTMR2_XSRD_SHIFT)       | \
91         (1 << DV_DDR_SDTMR2_RTP_SHIFT)          | \
92         (2 << DV_DDR_SDTMR2_CKE_SHIFT))
93
94 #define CONFIG_SYS_DA850_DDR2_SDRCR    0x00000492
95 #define CONFIG_SYS_DA850_DDR2_PBBPR    0x30
96
97 /*
98  * Serial Driver info
99  */
100 #define CONFIG_SYS_NS16550_CLK  clk_get(DAVINCI_UART2_CLKID)
101
102 #define CONFIG_SYS_SPI_BASE             DAVINCI_SPI1_BASE
103 #define CONFIG_SYS_SPI_CLK              clk_get(DAVINCI_SPI1_CLKID)
104
105 /*
106  * I2C Configuration
107  */
108 #define CONFIG_SYS_DAVINCI_I2C_SPEED    25000
109 #define CONFIG_SYS_DAVINCI_I2C_SLAVE    10 /* Bogus, master-only in U-Boot */
110 #define CONFIG_SYS_I2C_EXPANDER_ADDR    0x20
111
112 /*
113  * Flash & Environment
114  */
115 #ifdef CONFIG_MTD_RAW_NAND
116 #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
117 #define CONFIG_SYS_NAND_PAGE_2K
118 #define CONFIG_SYS_NAND_CS              3
119 #define CONFIG_SYS_NAND_BASE            DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
120 #define CONFIG_SYS_NAND_MASK_CLE        0x10
121 #define CONFIG_SYS_NAND_MASK_ALE        0x8
122 #undef CONFIG_SYS_NAND_HW_ECC
123 #define CONFIG_SYS_MAX_NAND_DEVICE      1 /* Max number of NAND devices */
124 #define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
125 #define CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC
126 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
127 #define CONFIG_SYS_NAND_PAGE_SIZE       (2 << 10)
128 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128 << 10)
129 #define CONFIG_SYS_NAND_U_BOOT_SIZE     SZ_512K
130 #define CONFIG_SYS_NAND_U_BOOT_DST      0xc1080000
131 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_NAND_U_BOOT_DST
132 #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_DST - \
133                                         CONFIG_SYS_NAND_U_BOOT_SIZE - \
134                                         CONFIG_SYS_MALLOC_LEN -       \
135                                         GENERATED_GBL_DATA_SIZE)
136 #define CONFIG_SYS_NAND_ECCPOS          {                               \
137                                 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,     \
138                                 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, \
139                                 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \
140                                 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 }
141 #define CONFIG_SYS_NAND_PAGE_COUNT      64
142 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   0
143 #define CONFIG_SYS_NAND_ECCSIZE         512
144 #define CONFIG_SYS_NAND_ECCBYTES        10
145 #define CONFIG_SYS_NAND_OOBSIZE         64
146 #define CONFIG_SPL_NAND_LOAD
147 #endif
148
149 /*
150  * Network & Ethernet Configuration
151  */
152 #ifdef CONFIG_DRIVER_TI_EMAC
153 #define CONFIG_NET_RETRY_COUNT  10
154 #endif
155
156 /*
157  * U-Boot general configuration
158  */
159 #define CONFIG_BOOTFILE         "zImage" /* Boot file name */
160 #define CONFIG_SYS_CBSIZE       1024 /* Console I/O Buffer Size */
161 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */
162
163 /*
164  * USB Configs
165  */
166 #define CONFIG_USB_OHCI_NEW
167 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS      15
168
169 /*
170  * Linux Information
171  */
172 #define LINUX_BOOT_PARAM_ADDR   (PHYS_SDRAM_1 + 0x100)
173 #define CONFIG_CMDLINE_TAG
174 #define CONFIG_REVISION_TAG
175 #define CONFIG_SETUP_MEMORY_TAGS
176 #define CONFIG_BOOTCOMMAND \
177                 "run envboot; " \
178                 "run mmcboot; "
179
180 #define DEFAULT_LINUX_BOOT_ENV \
181         "loadaddr=0xc0700000\0" \
182         "fdtaddr=0xc0600000\0" \
183         "scriptaddr=0xc0600000\0"
184
185 #include <environment/ti/mmc.h>
186
187 #define CONFIG_EXTRA_ENV_SETTINGS \
188         DEFAULT_LINUX_BOOT_ENV \
189         DEFAULT_MMC_TI_ARGS \
190         "bootpart=0:2\0" \
191         "bootdir=/boot\0" \
192         "bootfile=zImage\0" \
193         "fdtfile=da850-lcdk.dtb\0" \
194         "boot_fdt=yes\0" \
195         "boot_fit=0\0" \
196         "console=ttyS2,115200n8\0"
197
198 #ifdef CONFIG_CMD_BDI
199 #define CONFIG_CLOCKS
200 #endif
201
202 /* SD/MMC */
203
204 /* defines for SPL */
205 #define CONFIG_SYS_SPL_MALLOC_START     (CONFIG_SYS_TEXT_BASE - \
206                                                 CONFIG_SYS_MALLOC_LEN)
207 #define CONFIG_SYS_SPL_MALLOC_SIZE      CONFIG_SYS_MALLOC_LEN
208 #define CONFIG_SPL_STACK        0x8001ff00
209 #define CONFIG_SPL_MAX_FOOTPRINT        32768
210 #define CONFIG_SPL_PAD_TO       32768
211
212 /* additions for new relocation code, must added to all boards */
213 #define CONFIG_SYS_SDRAM_BASE           0xc0000000
214 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
215                                         GENERATED_GBL_DATA_SIZE)
216
217 #include <asm/arch/hardware.h>
218
219 #endif /* __CONFIG_H */