Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2013 Siemens Schweiz AG |
| 3 | * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 4 | * |
| 5 | * Based on: |
| 6 | * U-Boot file:/include/configs/am335x_evm.h |
| 7 | * |
| 8 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
| 9 | * |
| 10 | * SPDX-License-Identifier: GPL-2.0+ |
| 11 | */ |
| 12 | |
| 13 | #ifndef __CONFIG_ETAMIN_H |
| 14 | #define __CONFIG_ETAMIN_H |
| 15 | |
| 16 | #include "siemens-am33x-common.h" |
| 17 | /* NAND specific changes for etamin due to different page size */ |
| 18 | #undef CONFIG_SYS_NAND_PAGE_SIZE |
| 19 | #undef CONFIG_SYS_NAND_OOBSIZE |
| 20 | #undef CONFIG_SYS_NAND_BLOCK_SIZE |
| 21 | #undef CONFIG_SYS_NAND_ECCPOS |
| 22 | #undef CONFIG_SYS_NAND_U_BOOT_OFFS |
| 23 | #undef CONFIG_SYS_ENV_SECT_SIZE |
| 24 | #undef CONFIG_ENV_OFFSET |
| 25 | #undef CONFIG_NAND_OMAP_ECCSCHEME |
| 26 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW |
| 27 | |
| 28 | #define CONFIG_ENV_OFFSET 0x980000 |
| 29 | #define CONFIG_SYS_ENV_SECT_SIZE (512 << 10) /* 512 KiB */ |
| 30 | #define CONFIG_SYS_NAND_PAGE_SIZE 4096 |
| 31 | #define CONFIG_SYS_NAND_OOBSIZE 224 |
| 32 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * CONFIG_SYS_NAND_PAGE_SIZE) |
| 33 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
| 34 | 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \ |
| 35 | 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \ |
| 36 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \ |
| 37 | 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 38 | 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \ |
| 39 | 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \ |
| 40 | 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \ |
| 41 | 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \ |
| 42 | 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \ |
| 43 | 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \ |
| 44 | 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \ |
| 45 | 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \ |
| 46 | 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \ |
| 47 | 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \ |
| 48 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \ |
| 49 | 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \ |
| 50 | 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \ |
| 51 | 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \ |
| 52 | 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \ |
| 53 | 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \ |
| 54 | } |
| 55 | |
| 56 | #undef CONFIG_SYS_NAND_ECCSIZE |
| 57 | #undef CONFIG_SYS_NAND_ECCBYTES |
| 58 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 59 | #define CONFIG_SYS_NAND_ECCBYTES 26 |
| 60 | |
| 61 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000 |
| 62 | |
| 63 | #define CONFIG_SYS_NAND_MAX_CHIPS 1 |
| 64 | |
| 65 | #undef CONFIG_SYS_MAX_NAND_DEVICE |
| 66 | #define CONFIG_SYS_MAX_NAND_DEVICE 3 |
| 67 | #define CONFIG_SYS_NAND_BASE2 (0x18000000) /* physical address */ |
| 68 | #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \ |
| 69 | CONFIG_SYS_NAND_BASE2} |
| 70 | |
| 71 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 72 | #define CONFIG_SYS_MPUCLK 300 |
| 73 | #define DDR_PLL_FREQ 303 |
| 74 | #undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC |
| 75 | |
| 76 | /* FWD Button = 27 |
| 77 | * SRV Button = 87 */ |
| 78 | #define BOARD_DFU_BUTTON_GPIO 27 |
| 79 | #define GPIO_LAN9303_NRST 88 /* GPIO2_24 = gpio88 */ |
| 80 | /* In dfu mode keep led1 on */ |
| 81 | #define CONFIG_ENV_SETTINGS_BUTTONS_AND_LEDS \ |
| 82 | "button_dfu0=27\0" \ |
| 83 | "button_dfu1=87\0" \ |
| 84 | "led0=3,0,1\0" \ |
| 85 | "led1=4,0,0\0" \ |
| 86 | "led2=5,0,1\0" \ |
| 87 | "led3=87,0,1\0" \ |
| 88 | "led4=60,0,1\0" \ |
| 89 | "led5=63,0,1\0" |
| 90 | |
| 91 | #undef CONFIG_DOS_PARTITION |
| 92 | #undef CONFIG_CMD_FAT |
| 93 | |
| 94 | #define CONFIG_BOARD_LATE_INIT |
| 95 | |
| 96 | /* Physical Memory Map */ |
| 97 | #define CONFIG_MAX_RAM_BANK_SIZE (1024 << 20) /* 1GB */ |
| 98 | |
| 99 | /* I2C Configuration */ |
| 100 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 101 | |
| 102 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 |
| 103 | #define EEPROM_ADDR_DDR3 0x90 |
| 104 | #define EEPROM_ADDR_CHIP 0x120 |
| 105 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 106 | #undef CONFIG_MII |
| 107 | #undef CONFIG_PHY_GIGE |
| 108 | #define CONFIG_PHY_SMSC |
| 109 | |
| 110 | #define CONFIG_FACTORYSET |
| 111 | |
| 112 | /* use both define to compile a SPL compliance test */ |
| 113 | /* |
| 114 | #define CONFIG_SPL_CMT |
| 115 | #define CONFIG_SPL_CMT_DEBUG |
| 116 | */ |
| 117 | |
| 118 | /* nedded by compliance test in read mode */ |
| 119 | #if defined(CONFIG_SPL_CMT) |
| 120 | #define CONFIG_SYS_DCACHE_OFF |
| 121 | #endif |
| 122 | |
| 123 | /* Watchdog */ |
| 124 | #define CONFIG_OMAP_WATCHDOG |
| 125 | |
| 126 | /* Define own nand partitions */ |
| 127 | #define CONFIG_ENV_OFFSET_REDUND 0xB80000 |
| 128 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
| 129 | #define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE) |
| 130 | |
| 131 | |
| 132 | |
| 133 | #define CONFIG_DFU_MTD |
| 134 | #undef COMMON_ENV_DFU_ARGS |
| 135 | #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \ |
| 136 | "setenv bootargs ${bootargs};" \ |
| 137 | "mtdparts default;" \ |
| 138 | "draco_led 1;" \ |
| 139 | "dfu 0 mtd 0;" \ |
| 140 | "draco_led 0;\0" \ |
| 141 | |
| 142 | #undef DFU_ALT_INFO_NAND_V2 |
| 143 | #define DFU_ALT_INFO_NAND_V2 \ |
| 144 | "spl mtddev;" \ |
| 145 | "spl.backup1 mtddev;" \ |
| 146 | "spl.backup2 mtddev;" \ |
| 147 | "spl.backup3 mtddev;" \ |
| 148 | "u-boot mtddev;" \ |
| 149 | "u-boot.env0 mtddev;" \ |
| 150 | "u-boot.env1 mtddev;" \ |
| 151 | "rootfs mtddevubi" \ |
| 152 | |
| 153 | #undef MTDIDS_NAME_STR |
| 154 | #define MTDIDS_NAME_STR "omap2-nand_concat" |
| 155 | #undef MTDIDS_DEFAULT |
| 156 | #define MTDIDS_DEFAULT "nand2=" MTDIDS_NAME_STR |
| 157 | |
| 158 | #undef MTDPARTS_DEFAULT_V2 |
| 159 | #define MTDPARTS_DEFAULT_V2 "mtdparts=" MTDIDS_NAME_STR ":" \ |
| 160 | "512k(spl)," \ |
| 161 | "512k(spl.backup1)," \ |
| 162 | "512k(spl.backup2)," \ |
| 163 | "512k(spl.backup3)," \ |
| 164 | "7680k(u-boot)," \ |
| 165 | "2048k(u-boot.env0)," \ |
| 166 | "2048k(u-boot.env1)," \ |
| 167 | "2048k(mtdoops)," \ |
| 168 | "-(rootfs)" |
| 169 | |
| 170 | #undef MTDPARTS_DEFAULT |
| 171 | #define MTDPARTS_DEFAULT MTDPARTS_DEFAULT_V2 |
| 172 | |
| 173 | #undef CONFIG_ENV_SETTINGS_NAND_V2 |
| 174 | #define CONFIG_ENV_SETTINGS_NAND_V2 \ |
| 175 | "nand_active_ubi_vol=rootfs_a\0" \ |
| 176 | "rootfs_name=rootfs\0" \ |
| 177 | "kernel_name=uImage\0"\ |
| 178 | "nand_root_fs_type=ubifs rootwait=1\0" \ |
| 179 | "nand_args=run bootargs_defaults;" \ |
| 180 | "mtdparts default;" \ |
| 181 | "setenv ${partitionset_active} true;" \ |
| 182 | "if test -n ${A}; then " \ |
| 183 | "setenv nand_active_ubi_vol ${rootfs_name}_a;" \ |
| 184 | "fi;" \ |
| 185 | "if test -n ${B}; then " \ |
| 186 | "setenv nand_active_ubi_vol ${rootfs_name}_b;" \ |
| 187 | "fi;" \ |
| 188 | "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ |
| 189 | "ubi.mtd=rootfs,${ubi_off};" \ |
| 190 | "setenv bootargs ${bootargs} " \ |
| 191 | "root=${nand_root} noinitrd ${mtdparts} " \ |
| 192 | "rootfstype=${nand_root_fs_type} ip=${ip_method} " \ |
| 193 | "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \ |
| 194 | "=mtdoops\0" \ |
| 195 | COMMON_ENV_DFU_ARGS \ |
| 196 | "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \ |
| 197 | COMMON_ENV_NAND_BOOT \ |
| 198 | "ubi part rootfs ${ubi_off};" \ |
| 199 | "ubifsmount ubi0:${nand_active_ubi_vol};" \ |
| 200 | "ubifsload ${kloadaddr} boot/${kernel_name};" \ |
| 201 | "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \ |
| 202 | "bootm ${kloadaddr} - ${loadaddr}\0" \ |
| 203 | "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \ |
| 204 | "bootm ${kloadaddr} - ${loadaddr}\0" \ |
| 205 | COMMON_ENV_NAND_CMDS |
| 206 | |
| 207 | #ifndef CONFIG_SPL_BUILD |
| 208 | |
| 209 | #define CONFIG_NAND_CS_INIT |
| 210 | #define ETAMIN_NAND_GPMC_CONFIG1 0x00000800 |
| 211 | #define ETAMIN_NAND_GPMC_CONFIG2 0x001e1e00 |
| 212 | #define ETAMIN_NAND_GPMC_CONFIG3 0x001e1e00 |
| 213 | #define ETAMIN_NAND_GPMC_CONFIG4 0x16051807 |
| 214 | #define ETAMIN_NAND_GPMC_CONFIG5 0x00151e1e |
| 215 | #define ETAMIN_NAND_GPMC_CONFIG6 0x16000f80 |
| 216 | #define CONFIG_MTD_CONCAT |
| 217 | |
| 218 | /* Default env settings */ |
| 219 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 220 | "hostname=etamin\0" \ |
| 221 | "ubi_off=4096\0"\ |
| 222 | "nand_img_size=0x400000\0" \ |
| 223 | "optargs=\0" \ |
| 224 | "preboot=draco_led 0\0" \ |
| 225 | CONFIG_ENV_SETTINGS_BUTTONS_AND_LEDS \ |
| 226 | CONFIG_ENV_SETTINGS_V2 \ |
| 227 | CONFIG_ENV_SETTINGS_NAND_V2 |
| 228 | |
| 229 | #ifndef CONFIG_RESTORE_FLASH |
| 230 | |
| 231 | #define CONFIG_BOOTCOMMAND \ |
| 232 | "if dfubutton; then " \ |
| 233 | "run dfu_start; " \ |
| 234 | "reset; " \ |
| 235 | "fi;" \ |
| 236 | "run nand_boot;" \ |
| 237 | "run nand_boot_backup;" \ |
| 238 | "reset;" |
| 239 | |
| 240 | |
| 241 | #else |
| 242 | #define CONFIG_BOOTCOMMAND \ |
| 243 | "setenv autoload no; " \ |
| 244 | "dhcp; " \ |
| 245 | "if tftp 80000000 debrick.scr; then " \ |
| 246 | "source 80000000; " \ |
| 247 | "fi" |
| 248 | #endif |
| 249 | #endif /* CONFIG_SPL_BUILD */ |
| 250 | #endif /* ! __CONFIG_ETAMIN_H */ |