blob: a14310a8edcbe1ea8715c44dd2f110d8f4b67ebe [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
14#ifndef __CONFIG_IGEP0033_H
15#define __CONFIG_IGEP0033_H
16
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020017#define CONFIG_NAND
18#include <configs/ti_am335x_common.h>
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000019
20/* Mach type */
21#define MACH_TYPE_IGEP0033 4521 /* Until the next sync */
22#define CONFIG_MACH_TYPE MACH_TYPE_IGEP0033
23
24/* Clock defines */
25#define V_OSCK 24000000 /* Clock output from T2 */
26#define V_SCLK (V_OSCK)
27
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000028#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000029
Enric Balletbo i Serracf8d0052013-07-25 09:27:39 +020030/* Make the verbose messages from UBI stop printing */
31#define CONFIG_UBI_SILENCE_MSG
32#define CONFIG_UBIFS_SILENCE_MSG
33
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000034#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020035
36#ifndef CONFIG_SPL_BUILD
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000037#define CONFIG_EXTRA_ENV_SETTINGS \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020038 DEFAULT_LINUX_BOOT_ENV \
Enric Balletbò i Serra2e6bc672013-07-25 09:27:37 +020039 "bootdir=/boot\0" \
40 "bootfile=zImage\0" \
41 "dtbfile=am335x-base0033.dtb\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000042 "console=ttyO0,115200n8\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000043 "mmcdev=0\0" \
44 "mmcroot=/dev/mmcblk0p2 rw\0" \
45 "mmcrootfstype=ext4 rootwait\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000046 "mmcargs=setenv bootargs console=${console} " \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020047 "${optargs} " \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000048 "root=${mmcroot} " \
49 "rootfstype=${mmcrootfstype}\0" \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020050 "bootenv=uEnv.txt\0" \
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000051 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
52 "importbootenv=echo Importing environment from mmc ...; " \
Enric Balletbò i Serra2e6bc672013-07-25 09:27:37 +020053 "env import -t ${loadaddr} ${filesize}\0" \
54 "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020055 "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${dtbfile}\0" \
56 "mmcboot=mmc dev ${mmcdev}; " \
57 "if mmc rescan; then " \
58 "echo SD/MMC found on device ${mmcdev};" \
59 "if run loadbootenv; then " \
60 "echo Loaded environment from ${bootenv};" \
61 "run importbootenv;" \
62 "fi;" \
63 "if test -n $uenvcmd; then " \
64 "echo Running uenvcmd ...;" \
65 "run uenvcmd;" \
66 "fi;" \
67 "if run mmcload; then " \
68 "run mmcargs; " \
69 "bootz ${loadaddr} - ${fdtaddr};" \
70 "fi;" \
71 "fi;\0" \
72 "mtdids=" MTDIDS_DEFAULT "\0" \
73 "mtdparts=" MTDPARTS_DEFAULT "\0" \
74 "nandroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \
75 "nandrootfstype=ubifs rootwait\0" \
76 "nandload=ubi part filesystem 2048; ubifsmount ubi0; " \
Enric Balletbo i Serracf8d0052013-07-25 09:27:39 +020077 "ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020078 "ubifsload ${fdtaddr} ${bootdir}/${dtbfile} \0" \
79 "nandargs=setenv bootargs console=${console} " \
80 "${optargs} " \
81 "root=${nandroot} " \
82 "rootfstype=${nandrootfstype} \0" \
83 "nandboot=echo Booting from nand ...; " \
84 "run nandargs; " \
85 "run nandload; " \
86 "bootz ${loadaddr} - ${fdtaddr} \0"
87#endif
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000088
89#define CONFIG_BOOTCOMMAND \
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +020090 "run mmcboot;" \
91 "run nandboot;"
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000092
93/* NS16550 Configuration */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000094#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000095#define CONFIG_CONS_INDEX 1
96#define CONFIG_BAUDRATE 115200
97
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000098/* Ethernet support */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +000099#define CONFIG_PHYLIB
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000100#define CONFIG_PHY_SMSC
101
102/* NAND support */
pekon guptabeba5f02013-11-18 19:02:59 +0530103#define CONFIG_NAND_OMAP_ELM
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000104#define CONFIG_SYS_NAND_ONFI_DETECTION 1
105#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
Enric Balletbo i Serracf8d0052013-07-25 09:27:39 +0200106#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000107#define CONFIG_ENV_IS_IN_NAND
Enric Balletbo i Serracf8d0052013-07-25 09:27:39 +0200108#define CONFIG_ENV_OFFSET 0x180000 /* environment starts here */
109#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_OFFSET + CONFIG_SYS_ENV_SECT_SIZE)
110#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000111
112#define CONFIG_MTD_PARTITIONS
113#define CONFIG_MTD_DEVICE
114#define CONFIG_RBTREE
115#define CONFIG_LZO
116
Enric Balletbo i Serracf8d0052013-07-25 09:27:39 +0200117#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
118#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(spl),"\
119 "1m(uboot),256k(environment),"\
120 "-(filesystem)"
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000121
122/* Unsupported features */
123#undef CONFIG_USE_IRQ
124
Enric Balletbo i Serrabf887202014-09-03 17:59:57 +0200125/* SPL */
126#undef CONFIG_SPL_OS_BOOT /* Not supported by existing map */
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000127#define CONFIG_SPL_YMODEM_SUPPORT
128#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
129
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000130#define CONFIG_SYS_NAND_5_ADDR_CYCLE
131#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
132 CONFIG_SYS_NAND_PAGE_SIZE)
133#define CONFIG_SYS_NAND_PAGE_SIZE 2048
134#define CONFIG_SYS_NAND_OOBSIZE 64
135#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
136#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
137#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
138 10, 11, 12, 13, 14, 15, 16, 17, \
139 18, 19, 20, 21, 22, 23, 24, 25, \
140 26, 27, 28, 29, 30, 31, 32, 33, \
141 34, 35, 36, 37, 38, 39, 40, 41, \
142 42, 43, 44, 45, 46, 47, 48, 49, \
143 50, 51, 52, 53, 54, 55, 56, 57, }
144
145#define CONFIG_SYS_NAND_ECCSIZE 512
146#define CONFIG_SYS_NAND_ECCBYTES 14
pekon gupta3f719062013-11-18 19:03:01 +0530147#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000148
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000149#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
150
151#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
152
Enric Balletbo i Serra5f5c1d12013-04-04 22:27:58 +0000153#endif /* ! __CONFIG_IGEP0033_H */