Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 1 | /* |
| 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 Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 17 | #define CONFIG_NAND |
| 18 | #include <configs/ti_am335x_common.h> |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 19 | |
| 20 | /* Mach type */ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 21 | #define CONFIG_MACH_TYPE MACH_TYPE_IGEP0033 |
| 22 | |
| 23 | /* Clock defines */ |
| 24 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 25 | #define V_SCLK (V_OSCK) |
| 26 | |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 27 | #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 28 | |
Enric Balletbo i Serra | cf8d005 | 2013-07-25 09:27:39 +0200 | [diff] [blame] | 29 | /* Make the verbose messages from UBI stop printing */ |
| 30 | #define CONFIG_UBI_SILENCE_MSG |
| 31 | #define CONFIG_UBIFS_SILENCE_MSG |
| 32 | |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 33 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 34 | |
| 35 | #ifndef CONFIG_SPL_BUILD |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 36 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 37 | DEFAULT_LINUX_BOOT_ENV \ |
Enric Balletbò i Serra | 2e6bc67 | 2013-07-25 09:27:37 +0200 | [diff] [blame] | 38 | "bootdir=/boot\0" \ |
| 39 | "bootfile=zImage\0" \ |
| 40 | "dtbfile=am335x-base0033.dtb\0" \ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 41 | "console=ttyO0,115200n8\0" \ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 42 | "mmcdev=0\0" \ |
| 43 | "mmcroot=/dev/mmcblk0p2 rw\0" \ |
| 44 | "mmcrootfstype=ext4 rootwait\0" \ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 45 | "mmcargs=setenv bootargs console=${console} " \ |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 46 | "${optargs} " \ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 47 | "root=${mmcroot} " \ |
| 48 | "rootfstype=${mmcrootfstype}\0" \ |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 49 | "bootenv=uEnv.txt\0" \ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 50 | "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ |
| 51 | "importbootenv=echo Importing environment from mmc ...; " \ |
Enric Balletbò i Serra | 2e6bc67 | 2013-07-25 09:27:37 +0200 | [diff] [blame] | 52 | "env import -t ${loadaddr} ${filesize}\0" \ |
| 53 | "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \ |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 54 | "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${dtbfile}\0" \ |
| 55 | "mmcboot=mmc dev ${mmcdev}; " \ |
| 56 | "if mmc rescan; then " \ |
| 57 | "echo SD/MMC found on device ${mmcdev};" \ |
| 58 | "if run loadbootenv; then " \ |
| 59 | "echo Loaded environment from ${bootenv};" \ |
| 60 | "run importbootenv;" \ |
| 61 | "fi;" \ |
| 62 | "if test -n $uenvcmd; then " \ |
| 63 | "echo Running uenvcmd ...;" \ |
| 64 | "run uenvcmd;" \ |
| 65 | "fi;" \ |
| 66 | "if run mmcload; then " \ |
| 67 | "run mmcargs; " \ |
| 68 | "bootz ${loadaddr} - ${fdtaddr};" \ |
| 69 | "fi;" \ |
| 70 | "fi;\0" \ |
| 71 | "mtdids=" MTDIDS_DEFAULT "\0" \ |
| 72 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
| 73 | "nandroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \ |
| 74 | "nandrootfstype=ubifs rootwait\0" \ |
| 75 | "nandload=ubi part filesystem 2048; ubifsmount ubi0; " \ |
Enric Balletbo i Serra | cf8d005 | 2013-07-25 09:27:39 +0200 | [diff] [blame] | 76 | "ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \ |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 77 | "ubifsload ${fdtaddr} ${bootdir}/${dtbfile} \0" \ |
| 78 | "nandargs=setenv bootargs console=${console} " \ |
| 79 | "${optargs} " \ |
| 80 | "root=${nandroot} " \ |
| 81 | "rootfstype=${nandrootfstype} \0" \ |
| 82 | "nandboot=echo Booting from nand ...; " \ |
| 83 | "run nandargs; " \ |
| 84 | "run nandload; " \ |
| 85 | "bootz ${loadaddr} - ${fdtaddr} \0" |
| 86 | #endif |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 87 | |
| 88 | #define CONFIG_BOOTCOMMAND \ |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 89 | "run mmcboot;" \ |
| 90 | "run nandboot;" |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 91 | |
| 92 | /* NS16550 Configuration */ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 93 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 94 | #define CONFIG_CONS_INDEX 1 |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 95 | |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 96 | /* Ethernet support */ |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 97 | #define CONFIG_PHYLIB |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 98 | #define CONFIG_PHY_SMSC |
| 99 | |
| 100 | /* NAND support */ |
pekon gupta | beba5f0 | 2013-11-18 19:02:59 +0530 | [diff] [blame] | 101 | #define CONFIG_NAND_OMAP_ELM |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 102 | #define CONFIG_SYS_NAND_ONFI_DETECTION 1 |
| 103 | #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ |
Enric Balletbo i Serra | cf8d005 | 2013-07-25 09:27:39 +0200 | [diff] [blame] | 104 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 105 | #define CONFIG_ENV_IS_IN_NAND |
Enric Balletbo i Serra | cf8d005 | 2013-07-25 09:27:39 +0200 | [diff] [blame] | 106 | #define CONFIG_ENV_OFFSET 0x180000 /* environment starts here */ |
| 107 | #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_OFFSET + CONFIG_SYS_ENV_SECT_SIZE) |
| 108 | #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE) |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 109 | |
| 110 | #define CONFIG_MTD_PARTITIONS |
| 111 | #define CONFIG_MTD_DEVICE |
| 112 | #define CONFIG_RBTREE |
| 113 | #define CONFIG_LZO |
| 114 | |
Enric Balletbo i Serra | cf8d005 | 2013-07-25 09:27:39 +0200 | [diff] [blame] | 115 | #define MTDIDS_DEFAULT "nand0=omap2-nand.0" |
| 116 | #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(spl),"\ |
| 117 | "1m(uboot),256k(environment),"\ |
| 118 | "-(filesystem)" |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 119 | |
| 120 | /* Unsupported features */ |
| 121 | #undef CONFIG_USE_IRQ |
| 122 | |
Enric Balletbo i Serra | bf88720 | 2014-09-03 17:59:57 +0200 | [diff] [blame] | 123 | /* SPL */ |
Tom Rini | 983e370 | 2016-11-07 21:34:54 -0500 | [diff] [blame] | 124 | #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/am33xx/u-boot-spl.lds" |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 125 | |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 126 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 127 | #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ |
| 128 | CONFIG_SYS_NAND_PAGE_SIZE) |
| 129 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 |
| 130 | #define CONFIG_SYS_NAND_OOBSIZE 64 |
| 131 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) |
| 132 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS |
| 133 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
| 134 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 135 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 136 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 137 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 138 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 139 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 140 | |
| 141 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 142 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
pekon gupta | 3f71906 | 2013-11-18 19:03:01 +0530 | [diff] [blame] | 143 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 144 | |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 145 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 146 | |
| 147 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 |
| 148 | |
Enric Balletbo i Serra | 5f5c1d1 | 2013-04-04 22:27:58 +0000 | [diff] [blame] | 149 | #endif /* ! __CONFIG_IGEP0033_H */ |