1 /* SPDX-License-Identifier: GPL-2.0+ */
5 * specific parts for B&R T-Series Motherboard
8 * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
11 #ifndef __CONFIG_BRPPT1_H__
12 #define __CONFIG_BRPPT1_H__
14 #include <configs/bur_cfg_common.h>
15 #include <configs/bur_am335x_common.h>
16 #include <linux/stringify.h>
17 /* ------------------------------------------------------------------------- */
19 #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024)
20 #define CONFIG_SYS_BOOTM_LEN SZ_32M
23 #define V_OSCK 26000000 /* Clock output from T2 */
24 #define V_SCLK (V_OSCK)
26 #define CONFIG_POWER_TPS65217
28 /* Support both device trees and ATAGs. */
29 #define CONFIG_CMDLINE_TAG
30 #define CONFIG_SETUP_MEMORY_TAGS
31 #define CONFIG_INITRD_TAG
32 /*#define CONFIG_MACH_TYPE 3589*/
33 #define CONFIG_MACH_TYPE 0xFFFFFFFF /* TODO: check with kernel*/
36 * When we have NAND flash we expect to be making use of mtdparts,
37 * both for ease of use in U-Boot and for passing information on to
41 #ifdef CONFIG_SPL_OS_BOOT
42 #define CONFIG_SYS_SPL_ARGS_ADDR 0x80F80000
44 /* RAW SD card / eMMC */
45 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900 /* address 0x120000 */
46 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80 /* address 0x10000 */
47 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80 /* 64KiB */
50 #ifdef CONFIG_MTD_RAW_NAND
51 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x140000
52 #endif /* CONFIG_MTD_RAW_NAND */
53 #endif /* CONFIG_SPL_OS_BOOT */
55 #ifdef CONFIG_MTD_RAW_NAND
56 #define CONFIG_SPL_NAND_BASE
57 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
58 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
59 #endif /* CONFIG_MTD_RAW_NAND */
61 #ifdef CONFIG_MTD_RAW_NAND
63 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
64 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
65 "cfgscr=mw ${dtbaddr} 0; nand read ${cfgaddr} cfgscr && source ${cfgaddr};" \
66 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \
67 "nandargs=setenv bootargs console=${console} ${optargs} ${optargs_rot} " \
68 "root=mtd6 rootfstype=jffs2 b_mode=${b_mode}\0" \
69 "b_nand=nand read ${loadaddr} kernel; nand read ${dtbaddr} dtb; " \
70 "run nandargs; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \
71 "b_tgts_std=usb0 nand net\0" \
72 "b_tgts_rcy=net usb0 nand\0" \
73 "b_tgts_pme=usb0 nand net\0"
76 #endif /* CONFIG_MTD_RAW_NAND */
79 "t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
80 "b_mode=${b_mode} root=/dev/mmcblk0p2 rootfstype=ext4\0" \
82 "load ${loaddev}:2 ${loadaddr} /boot/PPTImage.md5 && " \
83 "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \
84 "load ${loaddev}:2 ${dtbaddr} /boot/am335x-ppt30.dtb || " \
85 "load ${loaddev}:1 ${dtbaddr} am335x-ppt30-legacy.dtb; "\
86 "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \
87 "t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
88 "b_mode=${b_mode}\0" \
90 "load ${loaddev}:1 ${loadaddr} zImage && " \
91 "load ${loaddev}:1 ${dtbaddr} am335x-ppt30.dtb && " \
92 "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \
93 "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \
94 "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \
95 "b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \
96 "b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \
97 "b_tgts_rcy=t30lgcy#1 usb0 net\0" \
98 "b_tgts_pme=net usb0 mmc0 mmc1\0" \
101 #ifdef CONFIG_ENV_IS_IN_MMC
104 "cfgscr=mw ${dtbaddr} 0;" \
105 " mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr};" \
106 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0"
109 #endif /* CONFIG_MMC */
114 "cfgscr=mw ${dtbaddr} 0;" \
115 " sf probe; sf read ${cfgaddr} 0xC0000 10000; source ${cfgaddr};" \
116 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0"
119 #endif /* CONFIG_SPI */
121 #define LOAD_OFFSET(x) 0x8##x
123 #ifndef CONFIG_SPL_BUILD
124 #define CONFIG_EXTRA_ENV_SETTINGS \
128 "scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \
129 "cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \
130 "dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \
131 "loadaddr=" __stringify(LOAD_OFFSET(0100000)) "\0" \
132 "ramaddr=" __stringify(LOAD_OFFSET(2000000)) "\0" \
133 "console=ttyO0,115200n8\0" \
134 "optargs=consoleblank=0 quiet panic=2\0" \
136 "b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \
137 "b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \
141 "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \
142 " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \
143 " else setenv b_tgts ${b_tgts_std}; fi\0" \
144 "b_default=run b_deftgts; for target in ${b_tgts};"\
145 " do echo \"### booting ${target} ###\"; run b_${target};" \
146 " if test ${b_break} = 1; then; exit; fi; done\0"
147 #endif /* !CONFIG_SPL_BUILD*/
149 #ifdef CONFIG_MTD_RAW_NAND
151 * GPMC block. We support 1 device and the physical address to
152 * access CS0 at is 0x8000000.
154 #define CONFIG_SYS_MAX_NAND_DEVICE 1
155 #define CONFIG_SYS_NAND_BASE 0x8000000
156 /* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */
157 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
158 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
159 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
160 #define CONFIG_SYS_NAND_PAGE_SIZE 2048
161 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
162 CONFIG_SYS_NAND_PAGE_SIZE)
163 #define CONFIG_SYS_NAND_OOBSIZE 64
164 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
165 #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \
166 10, 11, 12, 13, 14, 15, 16, 17, \
167 18, 19, 20, 21, 22, 23, 24, 25, \
168 26, 27, 28, 29, 30, 31, 32, 33, \
169 34, 35, 36, 37, 38, 39, 40, 41, \
170 42, 43, 44, 45, 46, 47, 48, 49, \
171 50, 51, 52, 53, 54, 55, 56, 57, }
173 #define CONFIG_SYS_NAND_ECCSIZE 512
174 #define CONFIG_SYS_NAND_ECCBYTES 14
176 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
178 #define CONFIG_NAND_OMAP_GPMC_WSCFG 1
179 #endif /* CONFIG_MTD_RAW_NAND */
181 #if defined(CONFIG_SPI)
184 #elif defined(CONFIG_ENV_IS_IN_MMC)
185 #define CONFIG_SYS_MMC_ENV_DEV 1
186 #define CONFIG_SYS_MMC_ENV_PART 2
188 #elif defined(CONFIG_ENV_IS_IN_NAND)
189 /* No NAND env support in SPL */
190 #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE
192 #error "no storage for Environment defined!"
195 #endif /* ! __CONFIG_BRPPT1_H__ */