blob: e2beaf271859e34aa3bd37d17b14f94df2473fe8 [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#include <configs/ti_am335x_common.h>
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000018
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000019/* Clock defines */
20#define V_OSCK 24000000 /* Clock output from T2 */
21#define V_SCLK (V_OSCK)
22
Tom Rinic9edebe2022-12-04 10:03:50 -050023#define CFG_EXTRA_ENV_SETTINGS \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020024 DEFAULT_LINUX_BOOT_ENV \
Enric Balletbò i Serra620b91d2013-07-25 09:27:37 +020025 "bootdir=/boot\0" \
26 "bootfile=zImage\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000027 "console=ttyO0,115200n8\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000028 "mmcdev=0\0" \
29 "mmcroot=/dev/mmcblk0p2 rw\0" \
30 "mmcrootfstype=ext4 rootwait\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000031 "mmcargs=setenv bootargs console=${console} " \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020032 "${optargs} " \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000033 "root=${mmcroot} " \
34 "rootfstype=${mmcrootfstype}\0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020035 "bootenv=uEnv.txt\0" \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000036 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
37 "importbootenv=echo Importing environment from mmc ...; " \
Enric Balletbò i Serra620b91d2013-07-25 09:27:37 +020038 "env import -t ${loadaddr} ${filesize}\0" \
39 "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \
Pau Pajuelob2310f12017-04-01 17:18:40 +020040 "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020041 "mmcboot=mmc dev ${mmcdev}; " \
42 "if mmc rescan; then " \
43 "echo SD/MMC found on device ${mmcdev};" \
44 "if run loadbootenv; then " \
45 "echo Loaded environment from ${bootenv};" \
46 "run importbootenv;" \
47 "fi;" \
48 "if test -n $uenvcmd; then " \
49 "echo Running uenvcmd ...;" \
50 "run uenvcmd;" \
51 "fi;" \
52 "if run mmcload; then " \
53 "run mmcargs; " \
54 "bootz ${loadaddr} - ${fdtaddr};" \
55 "fi;" \
56 "fi;\0" \
Ladislav Michlb6bd7f92017-04-01 17:17:57 +020057 "nandroot=ubi0:rootfs rw ubi.mtd=1\0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020058 "nandrootfstype=ubifs rootwait\0" \
Ladislav Michlb6bd7f92017-04-01 17:17:57 +020059 "nandload=ubi part UBI; " \
60 "ubi read ${loadaddr} kernel; " \
61 "ubi read ${fdtaddr} dtb \0" \
Enric Balletbo i Serrab78093b2014-09-03 17:59:57 +020062 "nandargs=setenv bootargs console=${console} " \
63 "${optargs} " \
64 "root=${nandroot} " \
65 "rootfstype=${nandrootfstype} \0" \
66 "nandboot=echo Booting from nand ...; " \
67 "run nandargs; " \
68 "run nandload; " \
Pau Pajuelob2310f12017-04-01 17:18:40 +020069 "bootz ${loadaddr} - ${fdtaddr} \0" \
Pau Pajuelo305f1f22017-04-01 17:19:43 +020070 "netload=tftpboot ${loadaddr} ${bootfile}; " \
71 "tftpboot ${fdtaddr} ${fdtfile} \0" \
72 "netargs=setenv bootargs console=${console} " \
73 "${optargs} " \
74 "root=/dev/nfs " \
75 "ip=${ipaddr} nfsroot=${serverip}:${rootnfs},v3,tcp \0" \
76 "netboot=echo Booting from net ...; " \
77 "run netargs; " \
78 "run netload; " \
79 "bootz ${loadaddr} - ${fdtaddr} \0" \
Pau Pajuelob2310f12017-04-01 17:18:40 +020080 "findfdt="\
81 "if test ${board_name} = igep0033; then " \
82 "setenv fdtfile am335x-igep-base0033.dtb; fi; " \
83 "if test ${board_name} = igep0034; then " \
84 "setenv fdtfile am335x-igep-base0040.dtb; fi; " \
85 "if test ${board_name} = igep0034-lite; then " \
86 "setenv fdtfile am335x-igep-base0040-lite.dtb; fi; " \
87 "if test ${fdtfile} = ''; then " \
88 "echo WARNING: Could not determine device tree to use; fi; \0"
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000089
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000090/* NS16550 Configuration */
Tom Rinidf6a2152022-11-16 13:10:28 -050091#define CFG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000092
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000093/* Ethernet support */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000094
95/* NAND support */
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000096
Ladislav Michlb6bd7f92017-04-01 17:17:57 +020097/* NAND config */
Tom Rinib4213492022-11-12 17:36:51 -050098#define CFG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +000099 10, 11, 12, 13, 14, 15, 16, 17, \
100 18, 19, 20, 21, 22, 23, 24, 25, \
101 26, 27, 28, 29, 30, 31, 32, 33, \
102 34, 35, 36, 37, 38, 39, 40, 41, \
103 42, 43, 44, 45, 46, 47, 48, 49, \
104 50, 51, 52, 53, 54, 55, 56, 57, }
105
Tom Rinib4213492022-11-12 17:36:51 -0500106#define CFG_SYS_NAND_ECCSIZE 512
107#define CFG_SYS_NAND_ECCBYTES 14
Enric Balletbo i Serra9b96f462013-04-04 22:27:58 +0000108
Ladislav Michl10bdc712017-04-01 17:17:16 +0200109#endif /* ! __CONFIG_IGEP003X_H */