blob: a429dd9910c57098f3b6bc067ee5bf46ff099291 [file] [log] [blame]
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +00001/*
2 * Copyright (C) 2013, ISEE 2007 SL - http://www.isee.biz/
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
Ladislav Michla96c08f2017-04-01 17:17:16 +020014#ifndef __CONFIG_IGEP003X_H
15#define __CONFIG_IGEP003X_H
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000016
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020017#include <configs/ti_am335x_common.h>
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000018
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000019/* Clock defines */
20#define V_OSCK 24000000 /* Clock output from T2 */
21#define V_SCLK (V_OSCK)
22
Ladislav Michl3607e0f2017-04-01 17:17:57 +020023#define CONFIG_ENV_SIZE (96 << 10) /* 96 KiB */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000024
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020025#ifndef CONFIG_SPL_BUILD
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000026#define CONFIG_EXTRA_ENV_SETTINGS \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020027 DEFAULT_LINUX_BOOT_ENV \
Enric Balletbò i Serra2e6bc672013-07-25 09:27:37 +020028 "bootdir=/boot\0" \
29 "bootfile=zImage\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000030 "console=ttyO0,115200n8\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000031 "mmcdev=0\0" \
32 "mmcroot=/dev/mmcblk0p2 rw\0" \
33 "mmcrootfstype=ext4 rootwait\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000034 "mmcargs=setenv bootargs console=${console} " \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020035 "${optargs} " \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000036 "root=${mmcroot} " \
37 "rootfstype=${mmcrootfstype}\0" \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020038 "bootenv=uEnv.txt\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000039 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
40 "importbootenv=echo Importing environment from mmc ...; " \
Enric Balletbò i Serra2e6bc672013-07-25 09:27:37 +020041 "env import -t ${loadaddr} ${filesize}\0" \
42 "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \
Pau Pajuelo09533e52017-04-01 17:18:40 +020043 "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020044 "mmcboot=mmc dev ${mmcdev}; " \
45 "if mmc rescan; then " \
46 "echo SD/MMC found on device ${mmcdev};" \
47 "if run loadbootenv; then " \
48 "echo Loaded environment from ${bootenv};" \
49 "run importbootenv;" \
50 "fi;" \
51 "if test -n $uenvcmd; then " \
52 "echo Running uenvcmd ...;" \
53 "run uenvcmd;" \
54 "fi;" \
55 "if run mmcload; then " \
56 "run mmcargs; " \
57 "bootz ${loadaddr} - ${fdtaddr};" \
58 "fi;" \
59 "fi;\0" \
Tom Rini43ede0b2017-10-22 17:55:07 -040060 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
61 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Ladislav Michl3607e0f2017-04-01 17:17:57 +020062 "nandroot=ubi0:rootfs rw ubi.mtd=1\0" \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020063 "nandrootfstype=ubifs rootwait\0" \
Ladislav Michl3607e0f2017-04-01 17:17:57 +020064 "nandload=ubi part UBI; " \
65 "ubi read ${loadaddr} kernel; " \
66 "ubi read ${fdtaddr} dtb \0" \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020067 "nandargs=setenv bootargs console=${console} " \
68 "${optargs} " \
69 "root=${nandroot} " \
70 "rootfstype=${nandrootfstype} \0" \
71 "nandboot=echo Booting from nand ...; " \
72 "run nandargs; " \
73 "run nandload; " \
Pau Pajuelo09533e52017-04-01 17:18:40 +020074 "bootz ${loadaddr} - ${fdtaddr} \0" \
Pau Pajuelo2e0c6f32017-04-01 17:19:43 +020075 "netload=tftpboot ${loadaddr} ${bootfile}; " \
76 "tftpboot ${fdtaddr} ${fdtfile} \0" \
77 "netargs=setenv bootargs console=${console} " \
78 "${optargs} " \
79 "root=/dev/nfs " \
80 "ip=${ipaddr} nfsroot=${serverip}:${rootnfs},v3,tcp \0" \
81 "netboot=echo Booting from net ...; " \
82 "run netargs; " \
83 "run netload; " \
84 "bootz ${loadaddr} - ${fdtaddr} \0" \
Pau Pajuelo09533e52017-04-01 17:18:40 +020085 "findfdt="\
86 "if test ${board_name} = igep0033; then " \
87 "setenv fdtfile am335x-igep-base0033.dtb; fi; " \
88 "if test ${board_name} = igep0034; then " \
89 "setenv fdtfile am335x-igep-base0040.dtb; fi; " \
90 "if test ${board_name} = igep0034-lite; then " \
91 "setenv fdtfile am335x-igep-base0040-lite.dtb; fi; " \
92 "if test ${fdtfile} = ''; then " \
93 "echo WARNING: Could not determine device tree to use; fi; \0"
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020094#endif
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000095
96#define CONFIG_BOOTCOMMAND \
Pau Pajuelo09533e52017-04-01 17:18:40 +020097 "run findfdt;" \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020098 "run mmcboot;" \
Pau Pajuelo2e0c6f32017-04-01 17:19:43 +020099 "run nandboot;" \
100 "run netboot;"
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000101
102/* NS16550 Configuration */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000103#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000104
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000105/* Ethernet support */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000106#define CONFIG_PHY_SMSC
107
108/* NAND support */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000109#define CONFIG_SYS_NAND_ONFI_DETECTION 1
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000110
111#define CONFIG_MTD_PARTITIONS
112#define CONFIG_MTD_DEVICE
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000113
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +0200114/* SPL */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000115
Ladislav Michl3607e0f2017-04-01 17:17:57 +0200116/* UBI configuration */
117#define CONFIG_SPL_UBI 1
118#define CONFIG_SPL_UBI_MAX_VOL_LEBS 256
119#define CONFIG_SPL_UBI_MAX_PEB_SIZE (256*1024)
120#define CONFIG_SPL_UBI_MAX_PEBS 4096
121#define CONFIG_SPL_UBI_VOL_IDS 8
122#define CONFIG_SPL_UBI_LOAD_MONITOR_ID 0
123#define CONFIG_SPL_UBI_LOAD_KERNEL_ID 3
124#define CONFIG_SPL_UBI_LOAD_ARGS_ID 4
125#define CONFIG_SPL_UBI_PEB_OFFSET 4
126#define CONFIG_SPL_UBI_VID_OFFSET 512
127#define CONFIG_SPL_UBI_LEB_START 2048
128#define CONFIG_SPL_UBI_INFO_ADDR 0x88080000
129
130/* environment organization */
Ladislav Michl3607e0f2017-04-01 17:17:57 +0200131#define CONFIG_ENV_UBI_PART "UBI"
132#define CONFIG_ENV_UBI_VOLUME "config"
133#define CONFIG_ENV_UBI_VOLUME_REDUND "config_r"
134
135/* NAND config */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000136#define CONFIG_SYS_NAND_5_ADDR_CYCLE
137#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
138 CONFIG_SYS_NAND_PAGE_SIZE)
139#define CONFIG_SYS_NAND_PAGE_SIZE 2048
140#define CONFIG_SYS_NAND_OOBSIZE 64
141#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
142#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
143#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
144 10, 11, 12, 13, 14, 15, 16, 17, \
145 18, 19, 20, 21, 22, 23, 24, 25, \
146 26, 27, 28, 29, 30, 31, 32, 33, \
147 34, 35, 36, 37, 38, 39, 40, 41, \
148 42, 43, 44, 45, 46, 47, 48, 49, \
149 50, 51, 52, 53, 54, 55, 56, 57, }
150
151#define CONFIG_SYS_NAND_ECCSIZE 512
152#define CONFIG_SYS_NAND_ECCBYTES 14
pekon gupta3f719062013-11-18 19:03:01 +0530153#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000154
Ladislav Michla96c08f2017-04-01 17:17:16 +0200155#endif /* ! __CONFIG_IGEP003X_H */