1 /* SPDX-License-Identifier: GPL-2.0+ */
5 * specific parts for B&R T-Series Motherboard
7 * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> -
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 /* ------------------------------------------------------------------------- */
21 #define V_OSCK 26000000 /* Clock output from T2 */
22 #define V_SCLK (V_OSCK)
25 * When we have NAND flash we expect to be making use of mtdparts,
26 * both for ease of use in U-Boot and for passing information on to
30 #ifdef CONFIG_SPL_OS_BOOT
31 /* RAW SD card / eMMC */
33 #endif /* CONFIG_SPL_OS_BOOT */
35 #ifdef CONFIG_MTD_RAW_NAND
36 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
37 #endif /* CONFIG_MTD_RAW_NAND */
39 #ifdef CONFIG_MTD_RAW_NAND
41 "cfgscr=mw ${dtbaddr} 0; nand read ${cfgaddr} cfgscr && source ${cfgaddr};" \
42 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \
43 "nandargs=setenv bootargs console=${console} ${optargs} ${optargs_rot} " \
44 "root=mtd6 rootfstype=jffs2 b_mode=${b_mode}\0" \
45 "b_nand=nand read ${loadaddr} kernel; nand read ${dtbaddr} dtb; " \
46 "run nandargs; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \
47 "b_tgts_std=usb0 nand net\0" \
48 "b_tgts_rcy=net usb0 nand\0" \
49 "b_tgts_pme=usb0 nand net\0"
52 #endif /* CONFIG_MTD_RAW_NAND */
55 "t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
56 "b_mode=${b_mode} root=/dev/mmcblk0p2 rootfstype=ext4\0" \
58 "load ${loaddev}:2 ${loadaddr} /boot/PPTImage.md5 && " \
59 "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \
60 "load ${loaddev}:2 ${dtbaddr} /boot/am335x-ppt30.dtb || " \
61 "load ${loaddev}:1 ${dtbaddr} am335x-ppt30-legacy.dtb; "\
62 "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \
63 "t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
64 "b_mode=${b_mode}\0" \
66 "load ${loaddev}:1 ${loadaddr} zImage && " \
67 "load ${loaddev}:1 ${dtbaddr} am335x-ppt30.dtb && " \
68 "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \
69 "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \
70 "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \
71 "b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \
72 "b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \
73 "b_tgts_rcy=t30lgcy#1 usb0 net\0" \
74 "b_tgts_pme=net usb0 mmc0 mmc1\0" \
77 #ifdef CONFIG_ENV_IS_IN_MMC
80 "cfgscr=mw ${dtbaddr} 0;" \
81 " mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr};" \
82 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0"
85 #endif /* CONFIG_MMC */
90 "cfgscr=mw ${dtbaddr} 0;" \
91 " sf probe; sf read ${cfgaddr} 0xC0000 10000; source ${cfgaddr};" \
92 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0"
95 #endif /* CONFIG_SPI */
97 #define LOAD_OFFSET(x) 0x8##x
99 #define CONFIG_EXTRA_ENV_SETTINGS \
102 "scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \
103 "cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \
104 "dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \
105 "loadaddr=" __stringify(LOAD_OFFSET(0100000)) "\0" \
106 "ramaddr=" __stringify(LOAD_OFFSET(2000000)) "\0" \
107 "console=ttyO0,115200n8\0" \
108 "optargs=consoleblank=0 quiet panic=2\0" \
110 "b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \
111 "b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \
115 "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \
116 " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \
117 " else setenv b_tgts ${b_tgts_std}; fi\0" \
118 "b_default=run b_deftgts; for target in ${b_tgts};"\
119 " do echo \"### booting ${target} ###\"; run b_${target};" \
120 " if test ${b_break} = 1; then; exit; fi; done\0"
122 #ifdef CONFIG_MTD_RAW_NAND
124 * GPMC block. We support 1 device and the physical address to
125 * access CS0 at is 0x8000000.
127 #define CONFIG_SYS_MAX_NAND_DEVICE 1
128 #define CONFIG_SYS_NAND_BASE 0x8000000
129 /* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */
130 #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \
131 10, 11, 12, 13, 14, 15, 16, 17, \
132 18, 19, 20, 21, 22, 23, 24, 25, \
133 26, 27, 28, 29, 30, 31, 32, 33, \
134 34, 35, 36, 37, 38, 39, 40, 41, \
135 42, 43, 44, 45, 46, 47, 48, 49, \
136 50, 51, 52, 53, 54, 55, 56, 57, }
138 #define CONFIG_SYS_NAND_ECCSIZE 512
139 #define CONFIG_SYS_NAND_ECCBYTES 14
141 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
143 #define CONFIG_NAND_OMAP_GPMC_WSCFG 1
144 #endif /* CONFIG_MTD_RAW_NAND */
146 #endif /* ! __CONFIG_BRPPT1_H__ */