Merge git://www.denx.de/git/u-boot-cfi-flash
[platform/kernel/u-boot.git] / include / configs / chiliboard.h
1 /*
2  * Copyright (C) 2017 Grinn - http://grinn-global.com/
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #ifndef __CONFIG_CHILIBOARD_H
8 #define __CONFIG_CHILIBOARD_H
9
10 #define CONFIG_NAND
11
12 #include <configs/ti_am335x_common.h>
13
14 #define CONFIG_CONS_INDEX               1
15
16 #ifndef CONFIG_SPL_BUILD
17 # define CONFIG_TIMESTAMP
18 #endif
19
20 /* Clock Defines */
21 #define V_OSCK                          24000000  /* Clock output from T2 */
22 #define V_SCLK                          (V_OSCK)
23
24 #define NANDARGS \
25         "mtdids=" MTDIDS_DEFAULT "\0" \
26         "mtdparts=" MTDPARTS_DEFAULT "\0" \
27         "nandargs=setenv bootargs console=${console} ${optargs} " \
28                 "${mtdparts} " \
29                 "root=${nandroot} " \
30                 "rootfstype=${nandrootfstype}\0" \
31         "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system\0" \
32         "nandrootfstype=ubifs rootwait=1\0" \
33         "nandboot=echo Booting from nand ...; " \
34                 "run nandargs; " \
35                 "nand read ${fdt_addr} NAND.u-boot-spl-os; " \
36                 "nand read ${loadaddr} NAND.kernel; " \
37                 "bootz ${loadaddr} - ${fdt_addr}\0"
38
39 #define CONFIG_BOOTCOMMAND \
40         "run mmcboot; " \
41         "run nandboot; " \
42         "run netboot"
43
44 #define CONFIG_EXTRA_ENV_SETTINGS \
45         "loadaddr=0x82000000\0" \
46         "fdt_addr=0x87800000\0" \
47         "boot_fdt=try\0" \
48         "console=ttyO0,115200n8\0" \
49         "image=zImage\0" \
50         "fdt_file=am335x-chiliboard.dtb\0" \
51         "ip_dyn=yes\0" \
52         "optargs=\0" \
53         "loadbootscript=" \
54                 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
55         "bootscript=echo Running bootscript from mmc ...; " \
56                 "source\0" \
57         "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
58                 "${boot_dir}/${image}\0" \
59         "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} " \
60                 "${boot_dir}/${fdt_file}\0" \
61         "mmcdev=0\0" \
62         "mmcpart=1\0" \
63         "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
64         "mmcargs=setenv bootargs console=${console},${baudrate} ${optargs} " \
65                 "${mtdparts} " \
66                 "root=${mmcroot}\0" \
67         "mmcloados=run mmcargs; " \
68                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
69                         "if run loadfdt; then " \
70                                 "bootz ${loadaddr} - ${fdt_addr}; " \
71                         "else " \
72                                 "if test ${boot_fdt} = try; then " \
73                                         "bootz; " \
74                                 "else " \
75                                         "echo WARN: Cannot load the DT; " \
76                                 "fi; " \
77                         "fi; " \
78                 "else " \
79                         "bootz; " \
80                 "fi;\0" \
81         "mmcboot=mmc dev ${mmcdev}; " \
82                 "if mmc rescan; then " \
83                         "echo SD/MMC found on device ${mmcdev};" \
84                         "if run loadimage; then " \
85                                 "run mmcloados;" \
86                         "fi;" \
87                 "fi;\0" \
88         "netargs=setenv bootargs console=${console},${baudrate} ${optargs} " \
89                 "${mtdparts} " \
90                 "root=/dev/nfs " \
91                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
92         "netboot=echo Booting from net ...; " \
93                 "run netargs; " \
94                 "if test ${ip_dyn} = yes; then " \
95                         "setenv get_cmd dhcp; " \
96                 "else " \
97                         "setenv get_cmd tftp; " \
98                 "fi; " \
99                 "${get_cmd} ${image}; " \
100                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
101                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
102                                 "bootz ${loadaddr} - ${fdt_addr}; " \
103                         "else " \
104                                 "if test ${boot_fdt} = try; then " \
105                                         "bootz; " \
106                                 "else " \
107                                         "echo WARN: Cannot load the DT; " \
108                                 "fi; " \
109                         "fi; " \
110                 "else " \
111                         "bootz; " \
112                 "fi;\0" \
113         NANDARGS
114
115 /* NS16550 Configuration */
116 #define CONFIG_SYS_NS16550_COM1         0x44e09000      /* UART0 */
117 #define CONFIG_SYS_NS16550_COM2         0x48022000      /* UART1 */
118 #define CONFIG_SYS_NS16550_COM3         0x48024000      /* UART2 */
119 #define CONFIG_SYS_NS16550_COM4         0x481a6000      /* UART3 */
120 #define CONFIG_SYS_NS16550_COM5         0x481a8000      /* UART4 */
121 #define CONFIG_SYS_NS16550_COM6         0x481aa000      /* UART5 */
122
123 /* PMIC support */
124 #define CONFIG_POWER_TPS65217
125
126 /* SPL */
127 /* Bootcount using the RTC block */
128 #define CONFIG_BOOTCOUNT_LIMIT
129 #define CONFIG_BOOTCOUNT_AM33XX
130 #define CONFIG_SYS_BOOTCOUNT_BE
131
132 #define CONFIG_SPL_LDSCRIPT     "arch/arm/mach-omap2/u-boot-spl.lds"
133
134 /* NAND: device related configs */
135 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
136 #define CONFIG_SYS_NAND_PAGE_COUNT      (CONFIG_SYS_NAND_BLOCK_SIZE / \
137                                          CONFIG_SYS_NAND_PAGE_SIZE)
138 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
139 #define CONFIG_SYS_NAND_OOBSIZE         64
140 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128*1024)
141 /* NAND: driver related configs */
142 #define CONFIG_NAND_OMAP_GPMC
143 #define CONFIG_NAND_OMAP_GPMC_PREFETCH
144 #define CONFIG_NAND_OMAP_ELM
145 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
146 #define CONFIG_SYS_NAND_ECCPOS          { 2, 3, 4, 5, 6, 7, 8, 9, \
147                                          10, 11, 12, 13, 14, 15, 16, 17, \
148                                          18, 19, 20, 21, 22, 23, 24, 25, \
149                                          26, 27, 28, 29, 30, 31, 32, 33, \
150                                          34, 35, 36, 37, 38, 39, 40, 41, \
151                                          42, 43, 44, 45, 46, 47, 48, 49, \
152                                          50, 51, 52, 53, 54, 55, 56, 57, }
153
154 #define CONFIG_SYS_NAND_ECCSIZE         512
155 #define CONFIG_SYS_NAND_ECCBYTES        14
156 #define CONFIG_SYS_NAND_ONFI_DETECTION
157 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW
158 #define MTDIDS_DEFAULT                  "nand0=8000000.nand"
159 #define MTDPARTS_DEFAULT                "mtdparts=8000000.nand:" \
160                                         "128k(NAND.SPL)," \
161                                         "128k(NAND.SPL.backup1)," \
162                                         "128k(NAND.SPL.backup2)," \
163                                         "128k(NAND.SPL.backup3)," \
164                                         "256k(NAND.u-boot-spl-os)," \
165                                         "1m(NAND.u-boot)," \
166                                         "128k(NAND.u-boot-env)," \
167                                         "128k(NAND.u-boot-env.backup1)," \
168                                         "8m(NAND.kernel)," \
169                                         "-(NAND.file-system)"
170 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x000c0000
171 /* NAND: SPL related configs */
172 #ifdef CONFIG_SPL_NAND_SUPPORT
173 #define CONFIG_SPL_NAND_AM33XX_BCH
174 #endif
175
176 /* USB configuration */
177 #define CONFIG_USB_MUSB_DSPS
178 #define CONFIG_ARCH_MISC_INIT
179 #define CONFIG_USB_MUSB_PIO_ONLY
180 #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
181 #define CONFIG_AM335X_USB1
182 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
183
184 /*
185  * Disable MMC DM for SPL build and can be re-enabled after adding
186  * DM support in SPL
187  */
188 #ifdef CONFIG_SPL_BUILD
189 #undef CONFIG_DM_MMC
190 #undef CONFIG_DM_MMC_OPS
191 #undef CONFIG_TIMER
192 #undef CONFIG_DM_USB
193 #endif
194
195 #if defined(CONFIG_ENV_IS_IN_NAND)
196 #define CONFIG_ENV_OFFSET               0x001c0000
197 #define CONFIG_ENV_OFFSET_REDUND        0x001e0000
198 #define CONFIG_ENV_SIZE                 SZ_128K
199 #define CONFIG_SYS_ENV_SECT_SIZE        CONFIG_SYS_NAND_BLOCK_SIZE
200 #else
201 #define CONFIG_SYS_MMC_ENV_DEV          0
202 #define CONFIG_ENV_OFFSET               SZ_128K
203 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
204 #define CONFIG_ENV_SIZE                 SZ_8K
205 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
206 #endif
207
208 /* Network. */
209 #define CONFIG_PHY_SMSC
210
211 #endif  /* ! __CONFIG_CHILIBOARD_H */