Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2013 Siemens Schweiz AG |
| 4 | * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 5 | * |
| 6 | * Based on: |
| 7 | * U-Boot file:/include/configs/am335x_evm.h |
| 8 | * |
| 9 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef __CONFIG_ETAMIN_H |
| 13 | #define __CONFIG_ETAMIN_H |
| 14 | |
| 15 | #include "siemens-am33x-common.h" |
| 16 | /* NAND specific changes for etamin due to different page size */ |
Tom Rini | 4e59094 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 17 | #undef CFG_SYS_NAND_ECCPOS |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 18 | |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 19 | #define CFG_SYS_ENV_SECT_SIZE (512 << 10) /* 512 KiB */ |
Tom Rini | 4e59094 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 20 | #define CFG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 21 | 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \ |
| 22 | 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \ |
| 23 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \ |
| 24 | 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 25 | 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \ |
| 26 | 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \ |
| 27 | 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \ |
| 28 | 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \ |
| 29 | 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \ |
| 30 | 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \ |
| 31 | 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \ |
| 32 | 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \ |
| 33 | 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \ |
| 34 | 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \ |
| 35 | 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \ |
| 36 | 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \ |
| 37 | 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \ |
| 38 | 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \ |
| 39 | 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \ |
| 40 | 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \ |
| 41 | } |
| 42 | |
Tom Rini | 4e59094 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 43 | #undef CFG_SYS_NAND_ECCSIZE |
| 44 | #undef CFG_SYS_NAND_ECCBYTES |
| 45 | #define CFG_SYS_NAND_ECCSIZE 512 |
| 46 | #define CFG_SYS_NAND_ECCBYTES 26 |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 47 | |
Tom Rini | 4e59094 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 48 | #define CFG_SYS_NAND_BASE2 (0x18000000) /* physical address */ |
| 49 | #define CFG_SYS_NAND_BASE_LIST {CFG_SYS_NAND_BASE, \ |
| 50 | CFG_SYS_NAND_BASE2} |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 51 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 52 | #define DDR_PLL_FREQ 303 |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 53 | |
| 54 | /* FWD Button = 27 |
| 55 | * SRV Button = 87 */ |
| 56 | #define BOARD_DFU_BUTTON_GPIO 27 |
| 57 | #define GPIO_LAN9303_NRST 88 /* GPIO2_24 = gpio88 */ |
| 58 | /* In dfu mode keep led1 on */ |
Tom Rini | 7c5b8c7 | 2022-12-04 10:03:41 -0500 | [diff] [blame] | 59 | #define CFG_ENV_SETTINGS_BUTTONS_AND_LEDS \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 60 | "button_dfu0=27\0" \ |
| 61 | "button_dfu1=87\0" \ |
| 62 | "led0=3,0,1\0" \ |
| 63 | "led1=4,0,0\0" \ |
| 64 | "led2=5,0,1\0" \ |
| 65 | "led3=87,0,1\0" \ |
| 66 | "led4=60,0,1\0" \ |
| 67 | "led5=63,0,1\0" |
| 68 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 69 | /* Physical Memory Map */ |
Tom Rini | 8a897c4 | 2022-12-04 10:04:51 -0500 | [diff] [blame] | 70 | #define CFG_MAX_RAM_BANK_SIZE (1024 << 20) /* 1GB */ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 71 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 72 | #define EEPROM_ADDR_DDR3 0x90 |
| 73 | #define EEPROM_ADDR_CHIP 0x120 |
| 74 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 75 | /* nedded by compliance test in read mode */ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 76 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 77 | #undef COMMON_ENV_DFU_ARGS |
| 78 | #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \ |
| 79 | "setenv bootargs ${bootargs};" \ |
| 80 | "mtdparts default;" \ |
| 81 | "draco_led 1;" \ |
| 82 | "dfu 0 mtd 0;" \ |
| 83 | "draco_led 0;\0" \ |
| 84 | |
| 85 | #undef DFU_ALT_INFO_NAND_V2 |
| 86 | #define DFU_ALT_INFO_NAND_V2 \ |
| 87 | "spl mtddev;" \ |
| 88 | "spl.backup1 mtddev;" \ |
| 89 | "spl.backup2 mtddev;" \ |
| 90 | "spl.backup3 mtddev;" \ |
| 91 | "u-boot mtddev;" \ |
| 92 | "u-boot.env0 mtddev;" \ |
| 93 | "u-boot.env1 mtddev;" \ |
| 94 | "rootfs mtddevubi" \ |
| 95 | |
Tom Rini | 4a60978 | 2022-12-04 10:03:43 -0500 | [diff] [blame] | 96 | #undef CFG_ENV_SETTINGS_NAND_V2 |
| 97 | #define CFG_ENV_SETTINGS_NAND_V2 \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 98 | "nand_active_ubi_vol=rootfs_a\0" \ |
| 99 | "rootfs_name=rootfs\0" \ |
| 100 | "kernel_name=uImage\0"\ |
Michael Trimarchi | 98303ce | 2022-05-22 15:22:08 +0200 | [diff] [blame] | 101 | "nand_root_fs_type=ubifs rootwait\0" \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 102 | "nand_args=run bootargs_defaults;" \ |
| 103 | "mtdparts default;" \ |
| 104 | "setenv ${partitionset_active} true;" \ |
| 105 | "if test -n ${A}; then " \ |
| 106 | "setenv nand_active_ubi_vol ${rootfs_name}_a;" \ |
| 107 | "fi;" \ |
| 108 | "if test -n ${B}; then " \ |
| 109 | "setenv nand_active_ubi_vol ${rootfs_name}_b;" \ |
| 110 | "fi;" \ |
| 111 | "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ |
| 112 | "ubi.mtd=rootfs,${ubi_off};" \ |
| 113 | "setenv bootargs ${bootargs} " \ |
| 114 | "root=${nand_root} noinitrd ${mtdparts} " \ |
| 115 | "rootfstype=${nand_root_fs_type} ip=${ip_method} " \ |
| 116 | "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \ |
| 117 | "=mtdoops\0" \ |
| 118 | COMMON_ENV_DFU_ARGS \ |
| 119 | "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \ |
| 120 | COMMON_ENV_NAND_BOOT \ |
| 121 | "ubi part rootfs ${ubi_off};" \ |
| 122 | "ubifsmount ubi0:${nand_active_ubi_vol};" \ |
| 123 | "ubifsload ${kloadaddr} boot/${kernel_name};" \ |
| 124 | "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \ |
| 125 | "bootm ${kloadaddr} - ${loadaddr}\0" \ |
| 126 | "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \ |
| 127 | "bootm ${kloadaddr} - ${loadaddr}\0" \ |
| 128 | COMMON_ENV_NAND_CMDS |
| 129 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 130 | /* Default env settings */ |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 131 | #define CFG_EXTRA_ENV_SETTINGS \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 132 | "hostname=etamin\0" \ |
| 133 | "ubi_off=4096\0"\ |
| 134 | "nand_img_size=0x400000\0" \ |
| 135 | "optargs=\0" \ |
| 136 | "preboot=draco_led 0\0" \ |
Tom Rini | 7c5b8c7 | 2022-12-04 10:03:41 -0500 | [diff] [blame] | 137 | CFG_ENV_SETTINGS_BUTTONS_AND_LEDS \ |
Tom Rini | d6ae6c7 | 2022-12-04 10:03:45 -0500 | [diff] [blame] | 138 | CFG_ENV_SETTINGS_V2 \ |
Tom Rini | 4a60978 | 2022-12-04 10:03:43 -0500 | [diff] [blame] | 139 | CFG_ENV_SETTINGS_NAND_V2 |
Tom Rini | 3348c6b | 2022-12-02 16:42:38 -0500 | [diff] [blame] | 140 | |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 141 | #endif /* ! __CONFIG_ETAMIN_H */ |