blob: 1b189887d23df5de627ba3ad0c9563e77b3961c4 [file] [log] [blame]
Enric Balletbo i Serra9b96f462013-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 Michl10bdc712017-04-01 17:17:16 +020014#ifndef __CONFIG_IGEP003X_H
15#define __CONFIG_IGEP003X_H
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000016
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020017#define CONFIG_NAND
18#include <configs/ti_am335x_common.h>
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000019
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000020/* Clock defines */
21#define V_OSCK 24000000 /* Clock output from T2 */
22#define V_SCLK (V_OSCK)
23
Ladislav Michlb6bd7f92017-04-01 17:17:57 +020024#define CONFIG_ENV_SIZE (96 << 10) /* 96 KiB */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000025
Enric Balletbo i Serrabace5162013-07-25 09:27:39 +020026/* Make the verbose messages from UBI stop printing */
27#define CONFIG_UBI_SILENCE_MSG
28#define CONFIG_UBIFS_SILENCE_MSG
29
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000030#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020031
32#ifndef CONFIG_SPL_BUILD
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000033#define CONFIG_EXTRA_ENV_SETTINGS \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020034 DEFAULT_LINUX_BOOT_ENV \
Enric Balletbò i Serra620b91d2013-07-25 09:27:37 +020035 "bootdir=/boot\0" \
36 "bootfile=zImage\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000037 "console=ttyO0,115200n8\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000038 "mmcdev=0\0" \
39 "mmcroot=/dev/mmcblk0p2 rw\0" \
40 "mmcrootfstype=ext4 rootwait\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000041 "mmcargs=setenv bootargs console=${console} " \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020042 "${optargs} " \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000043 "root=${mmcroot} " \
44 "rootfstype=${mmcrootfstype}\0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020045 "bootenv=uEnv.txt\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000046 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
47 "importbootenv=echo Importing environment from mmc ...; " \
Enric Balletbò i Serra620b91d2013-07-25 09:27:37 +020048 "env import -t ${loadaddr} ${filesize}\0" \
49 "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \
Pau Pajuelob2310f12017-04-01 17:18:40 +020050 "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020051 "mmcboot=mmc dev ${mmcdev}; " \
52 "if mmc rescan; then " \
53 "echo SD/MMC found on device ${mmcdev};" \
54 "if run loadbootenv; then " \
55 "echo Loaded environment from ${bootenv};" \
56 "run importbootenv;" \
57 "fi;" \
58 "if test -n $uenvcmd; then " \
59 "echo Running uenvcmd ...;" \
60 "run uenvcmd;" \
61 "fi;" \
62 "if run mmcload; then " \
63 "run mmcargs; " \
64 "bootz ${loadaddr} - ${fdtaddr};" \
65 "fi;" \
66 "fi;\0" \
67 "mtdids=" MTDIDS_DEFAULT "\0" \
68 "mtdparts=" MTDPARTS_DEFAULT "\0" \
Ladislav Michlb6bd7f92017-04-01 17:17:57 +020069 "nandroot=ubi0:rootfs rw ubi.mtd=1\0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020070 "nandrootfstype=ubifs rootwait\0" \
Ladislav Michlb6bd7f92017-04-01 17:17:57 +020071 "nandload=ubi part UBI; " \
72 "ubi read ${loadaddr} kernel; " \
73 "ubi read ${fdtaddr} dtb \0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020074 "nandargs=setenv bootargs console=${console} " \
75 "${optargs} " \
76 "root=${nandroot} " \
77 "rootfstype=${nandrootfstype} \0" \
78 "nandboot=echo Booting from nand ...; " \
79 "run nandargs; " \
80 "run nandload; " \
Pau Pajuelob2310f12017-04-01 17:18:40 +020081 "bootz ${loadaddr} - ${fdtaddr} \0" \
82 "findfdt="\
83 "if test ${board_name} = igep0033; then " \
84 "setenv fdtfile am335x-igep-base0033.dtb; fi; " \
85 "if test ${board_name} = igep0034; then " \
86 "setenv fdtfile am335x-igep-base0040.dtb; fi; " \
87 "if test ${board_name} = igep0034-lite; then " \
88 "setenv fdtfile am335x-igep-base0040-lite.dtb; fi; " \
89 "if test ${fdtfile} = ''; then " \
90 "echo WARNING: Could not determine device tree to use; fi; \0"
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020091#endif
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000092
93#define CONFIG_BOOTCOMMAND \
Pau Pajuelob2310f12017-04-01 17:18:40 +020094 "run findfdt;" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020095 "run mmcboot;" \
96 "run nandboot;"
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000097
98/* NS16550 Configuration */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000099#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000100#define CONFIG_CONS_INDEX 1
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000101
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000102/* Ethernet support */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000103#define CONFIG_PHYLIB
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000104#define CONFIG_PHY_SMSC
105
106/* NAND support */
pekon gupta89ad1dc2013-11-18 19:02:59 +0530107#define CONFIG_NAND_OMAP_ELM
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000108#define CONFIG_SYS_NAND_ONFI_DETECTION 1
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000109
110#define CONFIG_MTD_PARTITIONS
111#define CONFIG_MTD_DEVICE
112#define CONFIG_RBTREE
113#define CONFIG_LZO
114
Enric Balletbo i Serrabace5162013-07-25 09:27:39 +0200115#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
Ladislav Michlb6bd7f92017-04-01 17:17:57 +0200116#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(SPL),-(UBI)"
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000117
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +0200118/* SPL */
Tom Rini28eec372016-11-07 21:34:54 -0500119#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000120
Ladislav Michlb6bd7f92017-04-01 17:17:57 +0200121/* UBI configuration */
122#define CONFIG_SPL_UBI 1
123#define CONFIG_SPL_UBI_MAX_VOL_LEBS 256
124#define CONFIG_SPL_UBI_MAX_PEB_SIZE (256*1024)
125#define CONFIG_SPL_UBI_MAX_PEBS 4096
126#define CONFIG_SPL_UBI_VOL_IDS 8
127#define CONFIG_SPL_UBI_LOAD_MONITOR_ID 0
128#define CONFIG_SPL_UBI_LOAD_KERNEL_ID 3
129#define CONFIG_SPL_UBI_LOAD_ARGS_ID 4
130#define CONFIG_SPL_UBI_PEB_OFFSET 4
131#define CONFIG_SPL_UBI_VID_OFFSET 512
132#define CONFIG_SPL_UBI_LEB_START 2048
133#define CONFIG_SPL_UBI_INFO_ADDR 0x88080000
134
135/* environment organization */
136#define CONFIG_ENV_IS_IN_UBI 1
137#define CONFIG_ENV_UBI_PART "UBI"
138#define CONFIG_ENV_UBI_VOLUME "config"
139#define CONFIG_ENV_UBI_VOLUME_REDUND "config_r"
140
141/* NAND config */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000142#define CONFIG_SYS_NAND_5_ADDR_CYCLE
143#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
144 CONFIG_SYS_NAND_PAGE_SIZE)
145#define CONFIG_SYS_NAND_PAGE_SIZE 2048
146#define CONFIG_SYS_NAND_OOBSIZE 64
147#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
148#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
149#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
150 10, 11, 12, 13, 14, 15, 16, 17, \
151 18, 19, 20, 21, 22, 23, 24, 25, \
152 26, 27, 28, 29, 30, 31, 32, 33, \
153 34, 35, 36, 37, 38, 39, 40, 41, \
154 42, 43, 44, 45, 46, 47, 48, 49, \
155 50, 51, 52, 53, 54, 55, 56, 57, }
156
157#define CONFIG_SYS_NAND_ECCSIZE 512
158#define CONFIG_SYS_NAND_ECCBYTES 14
pekon gupta3ef49732013-11-18 19:03:01 +0530159#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000160
Ladislav Michl10bdc712017-04-01 17:17:16 +0200161#endif /* ! __CONFIG_IGEP003X_H */