diff options
| author | Tom Rini <[email protected]> | 2023-03-29 21:52:28 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-03-29 21:52:28 -0400 |
| commit | d2ced50c4a03ae8e2953dfbb18ac163187db9aae (patch) | |
| tree | f86fee80f3708d7fbbe2f8db8b4757c9049696e6 /board | |
| parent | 654483d251275d61eb5f93c18e320ad7d6bfcc5d (diff) | |
| parent | 10e5fe32f0f54cac1a62c8b964839318d7aa7f1d (diff) | |
Merge branch '2023-03-29-assorted-platform-updates' into next
- Assorted TI, Apple M1, and mpc83xx improvements / cleanups.
Diffstat (limited to 'board')
| -rw-r--r-- | board/siemens/iot2050/Kconfig | 35 | ||||
| -rw-r--r-- | board/siemens/iot2050/board.c | 270 | ||||
| -rw-r--r-- | board/siemens/iot2050/iot2050.env | 17 | ||||
| -rw-r--r-- | board/ti/am62ax/Kconfig | 2 | ||||
| -rw-r--r-- | board/ti/am62ax/am62ax.env | 33 | ||||
| -rw-r--r-- | board/ti/am62x/Kconfig | 2 | ||||
| -rw-r--r-- | board/ti/am62x/am62x.env | 74 | ||||
| -rw-r--r-- | board/ti/am64x/Kconfig | 2 | ||||
| -rw-r--r-- | board/ti/am65x/Kconfig | 2 | ||||
| -rw-r--r-- | board/ti/am65x/am65x.env | 47 | ||||
| -rw-r--r-- | board/ti/common/Kconfig | 1 | ||||
| -rw-r--r-- | board/ti/j721e/Kconfig | 16 | ||||
| -rw-r--r-- | board/ti/j721e/j721e.env | 82 | ||||
| -rw-r--r-- | board/ti/j721s2/Kconfig | 8 | ||||
| -rw-r--r-- | board/ti/j721s2/j721s2.env | 56 |
15 files changed, 548 insertions, 99 deletions
diff --git a/board/siemens/iot2050/Kconfig b/board/siemens/iot2050/Kconfig index 063142a43bf..e66b2427d95 100644 --- a/board/siemens/iot2050/Kconfig +++ b/board/siemens/iot2050/Kconfig @@ -1,20 +1,40 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Copyright (c) Siemens AG, 2018-2021 +# Copyright (c) Siemens AG, 2018-2022 # # Authors: # Le Jin <[email protected]> # Jan Kiszka <[email protected]> -config TARGET_IOT2050_A53 - bool "IOT2050 running on A53" +choice + prompt "Siemens SIMATIC IOT2050 boards" + optional + +config TARGET_IOT2050_A53_PG1 + bool "IOT2050 PG1 running on A53" + select IOT2050_A53_COMMON + help + This builds U-Boot for the Product Generation 1 (PG1) of the IOT2050 + devices. + +config TARGET_IOT2050_A53_PG2 + bool "IOT2050 PG2 running on A53" + select IOT2050_A53_COMMON + help + This builds U-Boot for the Product Generation 2 (PG2) of the IOT2050 + devices. + +endchoice + +config IOT2050_A53_COMMON + bool select ARM64 select SOC_K3_AM654 select BOARD_LATE_INIT select SYS_DISABLE_DCACHE_OPS select BINMAN -if TARGET_IOT2050_A53 +if IOT2050_A53_COMMON config SYS_BOARD default "iot2050" @@ -29,4 +49,11 @@ config IOT2050_BOOT_SWITCH bool "Disable eMMC boot via USER button (Advanced version only)" default y +config IOT2050_EMBED_OTPCMD + bool "Embed OTP programming data" + help + Embed signed OTP programming data 'otpcmd.bin' into the firmware + image. This data will be evaluated and executed on first boot of the + device. + endif diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c index 8f4b0eae495..df705b7c971 100644 --- a/board/siemens/iot2050/board.c +++ b/board/siemens/iot2050/board.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Board specific initialization for IOT2050 - * Copyright (c) Siemens AG, 2018-2021 + * Copyright (c) Siemens AG, 2018-2022 * * Authors: * Le Jin <[email protected]> @@ -11,9 +11,11 @@ #include <common.h> #include <bootstage.h> #include <dm.h> +#include <fdt_support.h> #include <i2c.h> #include <led.h> #include <malloc.h> +#include <mapmem.h> #include <net.h> #include <phy.h> #include <spl.h> @@ -47,20 +49,120 @@ struct iot2050_info { DECLARE_GLOBAL_DATA_PTR; -static bool board_is_advanced(void) +struct gpio_config { + const char *gpio_name; + const char *label; +}; + +enum m2_connector_mode { + BKEY_PCIEX2 = 0, + BKEY_PCIE_EKEY_PCIE, + BKEY_USB30_EKEY_PCIE, + CONNECTOR_MODE_INVALID +}; + +struct m2_config_pins { + int config[4]; +}; + +struct serdes_mux_control { + int ctrl_usb30_pcie0_lane0; + int ctrl_pcie1_pcie0; + int ctrl_usb30_pcie0_lane1; +}; + +struct m2_config_table { + struct m2_config_pins config_pins; + enum m2_connector_mode mode; +}; + +static const struct gpio_config serdes_mux_ctl_pin_info[] = { + {"gpio@600000_88", "CTRL_USB30_PCIE0_LANE0"}, + {"gpio@600000_82", "CTRL_PCIE1_PCIE0"}, + {"gpio@600000_89", "CTRL_USB30_PCIE0_LANE1"}, +}; + +static const struct gpio_config m2_bkey_cfg_pin_info[] = { + {"gpio@601000_18", "KEY_CONFIG_0"}, + {"gpio@601000_19", "KEY_CONFIG_1"}, + {"gpio@601000_88", "KEY_CONFIG_2"}, + {"gpio@601000_89", "KEY_CONFIG_3"}, +}; + +static const struct m2_config_table m2_config_table[] = { + {{{0, 1, 0, 0}}, BKEY_PCIEX2}, + {{{0, 0, 1, 0}}, BKEY_PCIE_EKEY_PCIE}, + {{{0, 1, 1, 0}}, BKEY_PCIE_EKEY_PCIE}, + {{{1, 0, 0, 1}}, BKEY_PCIE_EKEY_PCIE}, + {{{1, 1, 0, 1}}, BKEY_PCIE_EKEY_PCIE}, + {{{0, 0, 0, 1}}, BKEY_USB30_EKEY_PCIE}, + {{{0, 1, 0, 1}}, BKEY_USB30_EKEY_PCIE}, + {{{0, 0, 1, 1}}, BKEY_USB30_EKEY_PCIE}, + {{{0, 1, 1, 1}}, BKEY_USB30_EKEY_PCIE}, + {{{1, 0, 1, 1}}, BKEY_USB30_EKEY_PCIE}, +}; + +static const struct serdes_mux_control serdes_mux_ctrl[] = { + [BKEY_PCIEX2] = {0, 0, 1}, + [BKEY_PCIE_EKEY_PCIE] = {0, 1, 0}, + [BKEY_USB30_EKEY_PCIE] = {1, 1, 0}, +}; + +static const char *m2_connector_mode_name[] = { + [BKEY_PCIEX2] = "PCIe x2 (key B)", + [BKEY_PCIE_EKEY_PCIE] = "PCIe (key B) / PCIe (key E)", + [BKEY_USB30_EKEY_PCIE] = "USB 3.0 (key B) / PCIe (key E)", +}; + +static enum m2_connector_mode connector_mode; + +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +static void *connector_overlay; +static u32 connector_overlay_size; +#endif + +static int get_pinvalue(const char *gpio_name, const char *label) +{ + struct gpio_desc gpio; + + if (dm_gpio_lookup_name(gpio_name, &gpio) < 0 || + dm_gpio_request(&gpio, label) < 0 || + dm_gpio_set_dir_flags(&gpio, GPIOD_IS_IN) < 0) { + pr_err("Cannot get pin %s for M.2 configuration\n", gpio_name); + return 0; + } + + return dm_gpio_get_value(&gpio); +} + +static void set_pinvalue(const char *gpio_name, const char *label, int value) +{ + struct gpio_desc gpio; + + if (dm_gpio_lookup_name(gpio_name, &gpio) < 0 || + dm_gpio_request(&gpio, label) < 0 || + dm_gpio_set_dir_flags(&gpio, GPIOD_IS_OUT) < 0) { + pr_err("Cannot set pin %s for M.2 configuration\n", gpio_name); + return; + } + dm_gpio_set_value(&gpio, value); +} + +static bool board_is_m2(void) { struct iot2050_info *info = IOT2050_INFO_DATA; - return info->magic == IOT2050_INFO_MAGIC && - strstr((char *)info->name, "IOT2050-ADVANCED") != NULL; + return IS_ENABLED(CONFIG_TARGET_IOT2050_A53_PG2) && + info->magic == IOT2050_INFO_MAGIC && + strcmp((char *)info->name, "IOT2050-ADVANCED-M2") == 0; } -static bool board_is_sr1(void) +static bool board_is_advanced(void) { struct iot2050_info *info = IOT2050_INFO_DATA; return info->magic == IOT2050_INFO_MAGIC && - !strstr((char *)info->name, "-PG2"); + strstr((char *)info->name, "IOT2050-ADVANCED") != NULL; } static void remove_mmc1_target(void) @@ -109,12 +211,14 @@ void set_board_info_env(void) } if (board_is_advanced()) { - if (board_is_sr1()) + if (IS_ENABLED(CONFIG_TARGET_IOT2050_A53_PG1)) fdtfile = "ti/k3-am6548-iot2050-advanced.dtb"; + else if(board_is_m2()) + fdtfile = "ti/k3-am6548-iot2050-advanced-m2.dtb"; else fdtfile = "ti/k3-am6548-iot2050-advanced-pg2.dtb"; } else { - if (board_is_sr1()) + if (IS_ENABLED(CONFIG_TARGET_IOT2050_A53_PG1)) fdtfile = "ti/k3-am6528-iot2050-basic.dtb"; else fdtfile = "ti/k3-am6528-iot2050-basic-pg2.dtb"; @@ -126,6 +230,101 @@ void set_board_info_env(void) env_save(); } +static void m2_overlay_prepare(void) +{ +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) + const char *overlay_path; + void *overlay; + u64 loadaddr; + ofnode node; + int ret; + + if (connector_mode == BKEY_PCIEX2) + return; + + if (connector_mode == BKEY_PCIE_EKEY_PCIE) + overlay_path = "/fit-images/bkey-ekey-pcie-overlay"; + else + overlay_path = "/fit-images/bkey-usb3-overlay"; + + node = ofnode_path(overlay_path); + if (!ofnode_valid(node)) + goto fit_error; + + ret = ofnode_read_u64(node, "load", &loadaddr); + if (ret) + goto fit_error; + + ret = ofnode_read_u32(node, "size", &connector_overlay_size); + if (ret) + goto fit_error; + + overlay = map_sysmem(loadaddr, connector_overlay_size); + + connector_overlay = malloc(connector_overlay_size); + if (!connector_overlay) + goto fit_error; + + memcpy(connector_overlay, overlay, connector_overlay_size); + return; + +fit_error: + pr_err("M.2 device tree overlay %s not available,\n", overlay_path); +#endif +} + +static void m2_connector_setup(void) +{ + ulong m2_manual_config = env_get_ulong("m2_manual_config", 10, + CONNECTOR_MODE_INVALID); + const char *mode_info = ""; + struct m2_config_pins config_pins; + unsigned int n; + + /* enable M.2 connector power */ + set_pinvalue("gpio@601000_17", "P3V3_M2_EN", 1); + udelay(4 * 100); + + if (m2_manual_config < CONNECTOR_MODE_INVALID) { + mode_info = " [manual mode]"; + connector_mode = m2_manual_config; + } else { /* auto detection */ + for (n = 0; n < ARRAY_SIZE(config_pins.config); n++) + config_pins.config[n] = + get_pinvalue(m2_bkey_cfg_pin_info[n].gpio_name, + m2_bkey_cfg_pin_info[n].label); + connector_mode = CONNECTOR_MODE_INVALID; + for (n = 0; n < ARRAY_SIZE(m2_config_table); n++) { + if (!memcmp(config_pins.config, + m2_config_table[n].config_pins.config, + sizeof(config_pins.config))) { + connector_mode = m2_config_table[n].mode; + break; + } + } + if (connector_mode == CONNECTOR_MODE_INVALID) { + mode_info = " [fallback, card unknown/unsupported]"; + connector_mode = BKEY_USB30_EKEY_PCIE; + } + } + + printf("M.2: %s%s\n", m2_connector_mode_name[connector_mode], + mode_info); + + /* configure serdes mux */ + set_pinvalue(serdes_mux_ctl_pin_info[0].gpio_name, + serdes_mux_ctl_pin_info[0].label, + serdes_mux_ctrl[connector_mode].ctrl_usb30_pcie0_lane0); + set_pinvalue(serdes_mux_ctl_pin_info[1].gpio_name, + serdes_mux_ctl_pin_info[1].label, + serdes_mux_ctrl[connector_mode].ctrl_pcie1_pcie0); + set_pinvalue(serdes_mux_ctl_pin_info[2].gpio_name, + serdes_mux_ctl_pin_info[2].label, + serdes_mux_ctrl[connector_mode].ctrl_usb30_pcie0_lane1); + + m2_overlay_prepare(); +} + int board_init(void) { return 0; @@ -162,6 +361,9 @@ int board_fit_config_name_match(const char *name) struct iot2050_info *info = IOT2050_INFO_DATA; char upper_name[32]; + /* skip the prefix "k3-am65x8-" */ + name += 10; + if (info->magic != IOT2050_INFO_MAGIC || strlen(name) >= sizeof(upper_name)) return -1; @@ -188,7 +390,7 @@ static bool user_button_pressed(void) memset(&gpio, 0, sizeof(gpio)); - if (dm_gpio_lookup_name("25", &gpio) < 0 || + if (dm_gpio_lookup_name("gpio@42110000_25", &gpio) < 0 || dm_gpio_request(&gpio, "USER button") < 0 || dm_gpio_set_dir_flags(&gpio, GPIOD_IS_IN) < 0) return false; @@ -220,6 +422,9 @@ int board_late_init(void) /* change CTRL_MMR register to let serdes0 not output USB3.0 signals. */ writel(0x3, SERDES0_LANE_SELECT); + if (board_is_m2()) + m2_connector_setup(); + set_board_info_env(); /* remove the eMMC if requested via button */ @@ -231,6 +436,50 @@ int board_late_init(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +static void m2_fdt_fixup(void *blob) +{ + void *overlay_copy = NULL; + void *fdt_copy = NULL; + u32 fdt_size; + int err; + + if (!connector_overlay) + return; + + /* + * We need to work with temporary copies here because fdt_overlay_apply + * is destructive to the overlay and also to the target blob, even if + * application fails. + */ + fdt_size = fdt_totalsize(blob); + fdt_copy = malloc(fdt_size); + if (!fdt_copy) + goto fixup_error; + + memcpy(fdt_copy, blob, fdt_size); + + overlay_copy = malloc(connector_overlay_size); + if (!overlay_copy) + goto fixup_error; + + memcpy(overlay_copy, connector_overlay, connector_overlay_size); + + err = fdt_overlay_apply_verbose(fdt_copy, overlay_copy); + if (err) + goto fixup_error; + + memcpy(blob, fdt_copy, fdt_size); + +cleanup: + free(fdt_copy); + free(overlay_copy); + return; + +fixup_error: + pr_err("Could not apply M.2 device tree overlay\n"); + goto cleanup; +} + int ft_board_setup(void *blob, struct bd_info *bd) { int ret; @@ -242,6 +491,9 @@ int ft_board_setup(void *blob, struct bd_info *bd) if (ret) pr_err("%s: fixing up msmc ram failed %d\n", __func__, ret); + if (board_is_m2()) + m2_fdt_fixup(blob); + return ret; } #endif diff --git a/board/siemens/iot2050/iot2050.env b/board/siemens/iot2050/iot2050.env new file mode 100644 index 00000000000..02958798b49 --- /dev/null +++ b/board/siemens/iot2050/iot2050.env @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) Siemens AG, 2023 + * + * Authors: + * Jan Kiszka <[email protected]> + */ + +usb_pgood_delay=900 + +watchdog_timeout_ms=CONFIG_WATCHDOG_TIMEOUT_MSECS +start_watchdog= + if test ${watchdog_timeout_ms} -gt 0; then + wdt dev watchdog@40610000; + wdt start ${watchdog_timeout_ms}; + echo Watchdog started, timeout ${watchdog_timeout_ms} ms; + fi diff --git a/board/ti/am62ax/Kconfig b/board/ti/am62ax/Kconfig index 2c18cd49b5d..9b868e45530 100644 --- a/board/ti/am62ax/Kconfig +++ b/board/ti/am62ax/Kconfig @@ -10,7 +10,6 @@ choice config TARGET_AM62A7_A53_EVM bool "TI K3 based AM62A7 EVM running on A53" select ARM64 - select SOC_K3_AM62A7 imply BOARD imply SPL_BOARD imply TI_I2C_BOARD_DETECT @@ -20,7 +19,6 @@ config TARGET_AM62A7_R5_EVM select CPU_V7R select SYS_THUMB_BUILD select K3_LOAD_SYSFW - select SOC_K3_AM62A7 select RAM select SPL_RAM select K3_DDRSS diff --git a/board/ti/am62ax/am62ax.env b/board/ti/am62ax/am62ax.env new file mode 100644 index 00000000000..8c1c26e9a24 --- /dev/null +++ b/board/ti/am62ax/am62ax.env @@ -0,0 +1,33 @@ +#include <environment/ti/ti_armv7_common.env> +#include <environment/ti/mmc.env> + +default_device_tree=k3-am62a7-sk.dtb +findfdt= + setenv name_fdt ${default_device_tree}; + setenv fdtfile ${name_fdt} +name_kern=Image +console=ttyS2,115200n8 +args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 + ${mtdparts} +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} + +boot=mmc +mmcdev=1 +bootpart=1:2 +bootdir=/boot +rd_spec=- +init_mmc=run args_all args_mmc +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} +get_overlay_mmc= + fdt address ${fdtaddr}; + fdt resize 0x100000; + for overlay in $name_overlays; + do; + load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && + fdt apply ${dtboaddr}; + done; +get_kern_mmc=load mmc ${bootpart} ${loadaddr} + ${bootdir}/${name_kern} +get_fit_mmc=load mmc ${bootpart} ${addr_fit} + ${bootdir}/${name_fit} +partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} diff --git a/board/ti/am62x/Kconfig b/board/ti/am62x/Kconfig index 87fed44df17..5e8dfa3cc4b 100644 --- a/board/ti/am62x/Kconfig +++ b/board/ti/am62x/Kconfig @@ -10,14 +10,12 @@ choice config TARGET_AM625_A53_EVM bool "TI K3 based AM625 EVM running on A53" select ARM64 - select SOC_K3_AM625 config TARGET_AM625_R5_EVM bool "TI K3 based AM625 EVM running on R5" select CPU_V7R select SYS_THUMB_BUILD select K3_LOAD_SYSFW - select SOC_K3_AM625 select RAM select SPL_RAM select K3_DDRSS diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index c9a3b3dfae6..e4e64fa6371 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -1,75 +1,5 @@ -loadaddr=0x82000000 -kernel_addr_r=0x82000000 -fdtaddr=0x88000000 -dtboaddr=0x89000000 -fdt_addr_r=0x88000000 -fdtoverlay_addr_r=0x89000000 -rdaddr=0x88080000 -ramdisk_addr_r=0x88080000 -scriptaddr=0x80000000 -pxefile_addr_r=0x80100000 -bootm_size=0x10000000 -boot_fdt=try - -mmcrootfstype=ext4 rootwait -finduuid=part uuid ${boot} ${bootpart} uuid -args_mmc=run finduuid;setenv bootargs console=${console} - ${optargs} - root=PARTUUID=${uuid} rw - rootfstype=${mmcrootfstype} -loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr -bootscript=echo Running bootscript from mmc${mmcdev} ...; - source ${loadaddr} -bootenvfile=uEnv.txt -importbootenv=echo Importing environment from mmc${mmcdev} ...; - env import -t ${loadaddr} ${filesize} -loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile} -loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile} -loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile} -envboot=mmc dev ${mmcdev}; - if mmc rescan; then - echo SD/MMC found on device ${mmcdev}; - if run loadbootscript; then - run bootscript; - else - if run loadbootenv; then - echo Loaded env from ${bootenvfile}; - run importbootenv; - fi; - if test -n $uenvcmd; then - echo Running uenvcmd ...; - run uenvcmd; - fi; - fi; - fi; -mmcloados= - if test ${boot_fdt} = yes || test ${boot_fdt} = try; then - if run loadfdt; then - bootz ${loadaddr} - ${fdtaddr}; - else - if test ${boot_fdt} = try; then - bootz; - else - echo WARN: Cannot load the DT; - fi; - fi; - else - bootz; - fi; -mmcboot=mmc dev ${mmcdev}; - devnum=${mmcdev}; - devtype=mmc; - if mmc rescan; then - echo SD/MMC found on device ${mmcdev}; - if run loadimage; then - run args_mmc; - if test ${boot_fit} -eq 1; then - run run_fit; - else - run mmcloados; - fi; - fi; - fi; +#include <environment/ti/ti_armv7_common.env> +#include <environment/ti/mmc.env> default_device_tree=k3-am625-sk.dtb findfdt= diff --git a/board/ti/am64x/Kconfig b/board/ti/am64x/Kconfig index 8036947e345..afb54f8cdab 100644 --- a/board/ti/am64x/Kconfig +++ b/board/ti/am64x/Kconfig @@ -9,7 +9,6 @@ choice config TARGET_AM642_A53_EVM bool "TI K3 based AM642 EVM running on A53" select ARM64 - select SOC_K3_AM642 imply BOARD imply SPL_BOARD imply TI_I2C_BOARD_DETECT @@ -19,7 +18,6 @@ config TARGET_AM642_R5_EVM select CPU_V7R select SYS_THUMB_BUILD select K3_LOAD_SYSFW - select SOC_K3_AM642 select RAM select SPL_RAM select K3_DDRSS diff --git a/board/ti/am65x/Kconfig b/board/ti/am65x/Kconfig index 4765b13ba0c..220dd0234c5 100644 --- a/board/ti/am65x/Kconfig +++ b/board/ti/am65x/Kconfig @@ -10,7 +10,6 @@ choice config TARGET_AM654_A53_EVM bool "TI K3 based AM654 EVM running on A53" select ARM64 - select SOC_K3_AM654 select SYS_DISABLE_DCACHE_OPS select BOARD_LATE_INIT imply TI_I2C_BOARD_DETECT @@ -19,7 +18,6 @@ config TARGET_AM654_R5_EVM bool "TI K3 based AM654 EVM running on R5" select CPU_V7R select SYS_THUMB_BUILD - select SOC_K3_AM654 select K3_LOAD_SYSFW select K3_AM654_DDRSS imply SYS_K3_SPL_ATF diff --git a/board/ti/am65x/am65x.env b/board/ti/am65x/am65x.env new file mode 100644 index 00000000000..a048b47071f --- /dev/null +++ b/board/ti/am65x/am65x.env @@ -0,0 +1,47 @@ +#include <environment/ti/ti_armv7_common.env> +#include <environment/ti/mmc.env> +#include <environment/ti/k3_dfu.env> +#if CONFIG_CMD_REMOTEPROC +#include <environment/ti/k3_rproc.env> +#endif + +findfdt= + setenv name_fdt k3-am654-base-board.dtb; + setenv fdtfile ${name_fdt} +name_kern=Image +console=ttyS2,115200n8 +args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 + ${mtdparts} +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} + +boot=mmc +mmcdev=1 +bootpart=1:2 +bootdir=/boot +rd_spec=- +init_mmc=run args_all args_mmc +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} +get_overlay_mmc= + fdt address ${fdtaddr}; + fdt resize 0x100000; + for overlay in $name_overlays; + do; + load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && + fdt apply ${dtboaddr}; + done; +get_kern_mmc=load mmc ${bootpart} ${loadaddr} + ${bootdir}/${name_kern} +get_fit_mmc=load mmc ${bootpart} ${addr_fit} + ${bootdir}/${name_fit} +partitions=name=root,start=0,size=-,uuid=${uuid_gpt_rootfs} + +init_ubi= + run args_all args_ubi; + sf probe; + ubi part ospi.rootfs; + ubifsmount ubi:rootfs; +get_kern_ubi=ubifsload ${loadaddr} ${bootdir}/${name_kern} +get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt} +args_ubi=setenv bootargs console=${console} ${optargs} +rootfstype=ubifs root=ubi0:rootfs rw ubi.mtd=ospi.rootfs + diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index 49edd98014a..f03357cc751 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -1,5 +1,6 @@ config TI_I2C_BOARD_DETECT bool "Support for Board detection for TI platforms" + select K3_BOARD_DETECT if ARCH_K3 help Support for detection board information on Texas Instrument's Evaluation Boards which have I2C based EEPROM detection diff --git a/board/ti/j721e/Kconfig b/board/ti/j721e/Kconfig index d19d30d59ef..84bca327127 100644 --- a/board/ti/j721e/Kconfig +++ b/board/ti/j721e/Kconfig @@ -10,7 +10,6 @@ choice config TARGET_J721E_A72_EVM bool "TI K3 based J721E EVM running on A72" select ARM64 - select SOC_K3_J721E select BOARD_LATE_INIT imply TI_I2C_BOARD_DETECT select SYS_DISABLE_DCACHE_OPS @@ -19,7 +18,6 @@ config TARGET_J721E_R5_EVM bool "TI K3 based J721E EVM running on R5" select CPU_V7R select SYS_THUMB_BUILD - select SOC_K3_J721E select K3_LOAD_SYSFW select RAM select SPL_RAM @@ -30,7 +28,6 @@ config TARGET_J721E_R5_EVM config TARGET_J7200_A72_EVM bool "TI K3 based J7200 EVM running on A72" select ARM64 - select SOC_K3_J721E select BOARD_LATE_INIT imply TI_I2C_BOARD_DETECT select SYS_DISABLE_DCACHE_OPS @@ -39,7 +36,6 @@ config TARGET_J7200_R5_EVM bool "TI K3 based J7200 EVM running on R5" select CPU_V7R select SYS_THUMB_BUILD - select SOC_K3_J721E select K3_LOAD_SYSFW select RAM select SPL_RAM @@ -60,6 +56,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "j721e_evm" +config ENV_SOURCE_FILE + default "j721e" + source "board/ti/common/Kconfig" endif @@ -75,6 +74,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "j721e_evm" +config ENV_SOURCE_FILE + default "j721e" + source "board/ti/common/Kconfig" endif @@ -90,6 +92,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "j721e_evm" +config ENV_SOURCE_FILE + default "j721e" + source "board/ti/common/Kconfig" endif @@ -105,6 +110,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "j721e_evm" +config ENV_SOURCE_FILE + default "j721e" + source "board/ti/common/Kconfig" endif diff --git a/board/ti/j721e/j721e.env b/board/ti/j721e/j721e.env new file mode 100644 index 00000000000..446395adfa5 --- /dev/null +++ b/board/ti/j721e/j721e.env @@ -0,0 +1,82 @@ +#include <environment/ti/ti_armv7_common.env> +#include <environment/ti/mmc.env> +#include <environment/ti/ufs.env> +#include <environment/ti/k3_dfu.env> + +#if CONFIG_CMD_REMOTEPROC +#include <environment/ti/k3_rproc.env> +#endif + +default_device_tree=k3-j721e-common-proc-board.dtb +findfdt= + setenv name_fdt ${default_device_tree}; + if test $board_name = j721e; then + setenv name_fdt k3-j721e-common-proc-board.dtb; fi; + if test $board_name = j721e-eaik || test $board_name = j721e-sk; then + setenv name_fdt k3-j721e-sk.dtb; fi; + setenv fdtfile ${name_fdt} +name_kern=Image +console=ttyS2,115200n8 +args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 + ${mtdparts} +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} + +#if CONFIG_SYS_K3_SPL_ATF +#if CONFIG_TARGET_J721E_R5_EVM +addr_mcur5f0_0load=0x89000000 +name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw +#elif CONFIG_TARGET_J7200_R5_EVM +addr_mcur5f0_0load=0x89000000 +name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw +#endif +#endif + +boot=mmc +mmcdev=1 +bootpart=1:2 +bootdir=/boot +rd_spec=- +init_mmc=run args_all args_mmc +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} +get_overlay_mmc= + fdt address ${fdtaddr}; + fdt resize 0x100000; + for overlay in $name_overlays; + do; + load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && + fdt apply ${dtboaddr}; + done; +partitions=uuid_disk=${uuid_gpt_disk}; + name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} +get_kern_mmc=load mmc ${bootpart} ${loadaddr} + ${bootdir}/${name_kern} +get_fit_mmc=load mmc ${bootpart} ${addr_fit} + ${bootdir}/${name_fit} + +#if CONFIG_TARGET_J7200_A72_EVM +do_main_cpsw0_qsgmii_phyinit=1 +init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17; + gpio clear gpio@22_16 +main_cpsw0_qsgmii_phyinit= + if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && test ${boot} = mmc; then + run init_main_cpsw0_qsgmii_phy; + fi; +#elif CONFIG_TARGET_J721E_A72_EVM +init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17; + gpio clear gpio@22_16 +main_cpsw0_qsgmii_phyinit= + if test $board_name = J721EX-PM1-SOM || test $board_name = J721EX-PM2-SOM || test $board_name = j721e; then + do_main_cpsw0_qsgmii_phyinit=1; else + do_main_cpsw0_qsgmii_phyinit=0; fi; + if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && test ${boot} = mmc; then + run init_main_cpsw0_qsgmii_phy; \ + fi; +#endif + +#if CONFIG_TARGET_J721E_A72_EVM +rproc_fw_binaries=2 /lib/firmware/j7-main-r5f0_0-fw 3 /lib/firmware/j7-main-r5f0_1-fw 4 /lib/firmware/j7-main-r5f1_0-fw 5 /lib/firmware/j7-main-r5f1_1-fw 6 /lib/firmware/j7-c66_0-fw 7 /lib/firmware/j7-c66_1-fw 8 /lib/firmware/j7-c71_0-fw +#endif + +#if CONFIG_TARGET_J7200_A72_EVM +rproc_fw_binaries=2 /lib/firmware/j7200-main-r5f0_0-fw 3 /lib/firmware/j7200-main-r5f0_1-fw +#endif diff --git a/board/ti/j721s2/Kconfig b/board/ti/j721s2/Kconfig index 6141798333c..a24641f8cf3 100644 --- a/board/ti/j721s2/Kconfig +++ b/board/ti/j721s2/Kconfig @@ -10,7 +10,6 @@ choice config TARGET_J721S2_A72_EVM bool "TI K3 based J721S2 EVM running on A72" select ARM64 - select SOC_K3_J721S2 select BOARD_LATE_INIT imply TI_I2C_BOARD_DETECT select SYS_DISABLE_DCACHE_OPS @@ -19,7 +18,6 @@ config TARGET_J721S2_R5_EVM bool "TI K3 based J721S2 EVM running on R5" select CPU_V7R select SYS_THUMB_BUILD - select SOC_K3_J721S2 select K3_LOAD_SYSFW select RAM select SPL_RAM @@ -40,6 +38,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "j721s2_evm" +config ENV_SOURCE_FILE + default "j721s2" + source "board/ti/common/Kconfig" endif @@ -55,6 +56,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "j721s2_evm" +config ENV_SOURCE_FILE + default "j721s2" + source "board/ti/common/Kconfig" endif diff --git a/board/ti/j721s2/j721s2.env b/board/ti/j721s2/j721s2.env new file mode 100644 index 00000000000..2152f8849f9 --- /dev/null +++ b/board/ti/j721s2/j721s2.env @@ -0,0 +1,56 @@ +#include <environment/ti/ti_armv7_common.env> +#include <environment/ti/mmc.env> +#include <environment/ti/ufs.env> +#include <environment/ti/k3_dfu.env> + +#if CONFIG_CMD_REMOTEPROC +#include <environment/ti/k3_rproc.env> +#endif + +default_device_tree=k3-j721s2-common-proc-board.dtb +findfdt= + setenv name_fdt ${default_device_tree}; + if test $board_name = j721s2; then \ + setenv name_fdt k3-j721s2-common-proc-board.dtb; fi; + if test $board_name = am68-sk; then + setenv name_fdt k3-am68-sk-base-board.dtb; fi; + setenv fdtfile ${name_fdt} +name_kern=Image +console=ttyS2,115200n8 +args_all=setenv optargs earlycon=ns16550a,mmio32,0x02880000 + ${mtdparts} +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} + +boot=mmc +mmcdev=1 +bootpart=1:2 +bootdir=/boot +#if CONFIG_SYS_K3_SPL_ATF +#if CONFIG_TARGET_J721S2_R5_EVM +addr_mcur5f0_0load=0x89000000 +name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw +#endif +#endif +rd_spec=- +init_mmc=run args_all args_mmc +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} +get_overlay_mmc= + fdt address ${fdtaddr}; + fdt resize 0x100000; + for overlay in $name_overlays; + do; + load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && + fdt apply ${dtboaddr}; + done; +partitions=uuid_disk=${uuid_gpt_disk}; + name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} +get_kern_mmc=load mmc ${bootpart} ${loadaddr} + ${bootdir}/${name_kern} +get_fit_mmc=load mmc ${bootpart} ${addr_fit} + ${bootdir}/${name_fit} +partitions=uuid_disk=${uuid_gpt_disk}; + name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} + +rproc_fw_binaries= 2 /lib/firmware/j721s2-main-r5f0_0-fw 3 /lib/firmware/j721s2-main-r5f0_1-fw 4 /lib/firmware/j721s2-main-r5f1_0-fw 5 /lib/firmware/j721s2-main-r5f1_1-fw 6 /lib/firmware/j721s2-c71_0-fw 7 /lib/firmware/j721s2-c71_1-fw + + |
