From f4b3c1cc33730a4e9ecccab275a513ec8e08a073 Mon Sep 17 00:00:00 2001 From: Vignesh Raghavendra Date: Mon, 18 Nov 2019 19:16:34 +0530 Subject: environment: ti: Add DFU environment variables k3_dfu.h Setup env variables for updating firmwares on eMMC/OSPI/MMC via DFU Signed-off-by: Vignesh Raghavendra Signed-off-by: Lokesh Vutla --- include/configs/j721e_evm.h | 10 +++++++++ include/environment/ti/k3_dfu.h | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 include/environment/ti/k3_dfu.h (limited to 'include') diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index 84518786c74..71cea3dd8a3 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -14,6 +14,7 @@ #include #include #include +#include /* DDR Configuration */ #define CONFIG_SYS_SDRAM_BASE1 0x880000000 @@ -100,12 +101,21 @@ "7 /lib/firmware/j7-c66_1-fw " \ "8 /lib/firmware/j7-c71_0-fw " +/* set default dfu_bufsiz to 128KB (sector size of OSPI) */ +#define EXTRA_ENV_DFUARGS \ + "dfu_bufsiz=0x20000\0" \ + DFU_ALT_INFO_MMC \ + DFU_ALT_INFO_EMMC \ + DFU_ALT_INFO_RAM \ + DFU_ALT_INFO_OSPI + /* Incorporate settings into the U-Boot environment */ #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_MMC_TI_ARGS \ EXTRA_ENV_J721E_BOARD_SETTINGS \ EXTRA_ENV_J721E_BOARD_SETTINGS_MMC \ EXTRA_ENV_RPROC_SETTINGS \ + EXTRA_ENV_DFUARGS \ DEFAULT_UFS_TI_ARGS /* Now for the remaining common defines */ diff --git a/include/environment/ti/k3_dfu.h b/include/environment/ti/k3_dfu.h new file mode 100644 index 00000000000..2f503b8de88 --- /dev/null +++ b/include/environment/ti/k3_dfu.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com + * + * Environment variable definitions for DFU on TI K3 SoCs. + * + */ + +#ifndef __TI_DFU_H +#define __TI_DFU_H + +#define DFU_ALT_INFO_MMC \ + "dfu_alt_info_mmc=" \ + "boot part 1 1;" \ + "rootfs part 1 2;" \ + "tiboot3.bin fat 1 1;" \ + "tispl.bin fat 1 1;" \ + "u-boot.img fat 1 1;" \ + "uEnv.txt fat 1 1;" \ + "sysfw.itb fat 1 1\0" + +#define DFU_ALT_INFO_EMMC \ + "dfu_alt_info_emmc=" \ + "rawemmc raw 0 0x800000 mmcpart 1;" \ + "rootfs part 0 1 mmcpart 0;" \ + "tiboot3.bin.raw raw 0x0 0x400 mmcpart 1;" \ + "tispl.bin.raw raw 0x400 0x1000 mmcpart 1;" \ + "u-boot.img.raw raw 0x1400 0x2000 mmcpart 1;" \ + "u-env.raw raw 0x3400 0x100 mmcpart 1;" \ + "sysfw.itb.raw raw 0x3600 0x800 mmcpart 1\0" + +#define DFU_ALT_INFO_OSPI \ + "dfu_alt_info_ospi=" \ + "tiboot3.bin raw 0x0 0x080000;" \ + "tispl.bin raw 0x080000 0x200000;" \ + "u-boot.img raw 0x280000 0x400000;" \ + "u-boot-env raw 0x680000 0x020000;" \ + "sysfw.itb raw 0x6c0000 0x100000;" \ + "rootfs raw 0x800000 0x3800000\0" + +#define DFU_ALT_INFO_RAM \ + "dfu_alt_info_ram=" \ + "tispl.bin ram 0x80080000 0x100000;" \ + "u-boot.img ram 0x81000000 0x100000\0" \ + +#endif /* __TI_DFU_H */ -- cgit v1.2.3 From 016e6d6a4f9b2b29d9b7f65cbb44874182e277b8 Mon Sep 17 00:00:00 2001 From: Vignesh Raghavendra Date: Mon, 9 Dec 2019 10:25:31 +0530 Subject: lib: Import few bitmap functions from Linux Import few basic bitmap functions (bitmap_{weight,fill,set,clear,or}()) and their dependencies from Linux. These are required for upcoming DMA resource allocation support for TI's K3 SoCs. Signed-off-by: Vignesh Raghavendra Reviewed-by: Grygorii Strashko Signed-off-by: Lokesh Vutla --- include/linux/bitmap.h | 133 +++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/bitops.h | 12 +++++ 2 files changed, 145 insertions(+) (limited to 'include') diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index fbbb67c8b24..dae4225be54 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -5,10 +5,88 @@ #include #include #include +#include +#ifdef __LITTLE_ENDIAN +#define BITMAP_MEM_ALIGNMENT 8 +#else +#define BITMAP_MEM_ALIGNMENT (8 * sizeof(unsigned long)) +#endif +#define BITMAP_MEM_MASK (BITMAP_MEM_ALIGNMENT - 1) + +#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1))) +#define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1))) #define small_const_nbits(nbits) \ (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) +static inline void +__bitmap_or(unsigned long *dst, const unsigned long *bitmap1, + const unsigned long *bitmap2, unsigned int bits) +{ + unsigned int k; + unsigned int nr = BITS_TO_LONGS(bits); + + for (k = 0; k < nr; k++) + dst[k] = bitmap1[k] | bitmap2[k]; +} + +static inline int +__bitmap_weight(const unsigned long *bitmap, unsigned int bits) +{ + unsigned int k, lim = bits / BITS_PER_LONG; + int w = 0; + + for (k = 0; k < lim; k++) + w += hweight_long(bitmap[k]); + + if (bits % BITS_PER_LONG) + w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits)); + + return w; +} + +static inline void +__bitmap_set(unsigned long *map, unsigned int start, int len) +{ + unsigned long *p = map + BIT_WORD(start); + const unsigned int size = start + len; + int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); + + while (len - bits_to_set >= 0) { + *p |= mask_to_set; + len -= bits_to_set; + bits_to_set = BITS_PER_LONG; + mask_to_set = ~0UL; + p++; + } + if (len) { + mask_to_set &= BITMAP_LAST_WORD_MASK(size); + *p |= mask_to_set; + } +} + +static inline void +__bitmap_clear(unsigned long *map, unsigned int start, int len) +{ + unsigned long *p = map + BIT_WORD(start); + const unsigned int size = start + len; + int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); + + while (len - bits_to_clear >= 0) { + *p &= ~mask_to_clear; + len -= bits_to_clear; + bits_to_clear = BITS_PER_LONG; + mask_to_clear = ~0UL; + p++; + } + if (len) { + mask_to_clear &= BITMAP_LAST_WORD_MASK(size); + *p &= ~mask_to_clear; + } +} + static inline void bitmap_zero(unsigned long *dst, int nbits) { if (small_const_nbits(nbits)) { @@ -81,4 +159,59 @@ static inline unsigned long find_first_bit(const unsigned long *addr, unsigned l (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) +static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) +{ + if (small_const_nbits(nbits)) { + *dst = ~0UL; + } else { + unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); + + memset(dst, 0xff, len); + } +} + +static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, + const unsigned long *src2, unsigned int nbits) +{ + if (small_const_nbits(nbits)) + *dst = *src1 | *src2; + else + __bitmap_or(dst, src1, src2, nbits); +} + +static inline int bitmap_weight(const unsigned long *src, unsigned int nbits) +{ + if (small_const_nbits(nbits)) + return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); + return __bitmap_weight(src, nbits); +} + +static inline void bitmap_set(unsigned long *map, unsigned int start, + unsigned int nbits) +{ + if (__builtin_constant_p(nbits) && nbits == 1) + __set_bit(start, map); + else if (__builtin_constant_p(start & BITMAP_MEM_MASK) && + IS_ALIGNED(start, BITMAP_MEM_ALIGNMENT) && + __builtin_constant_p(nbits & BITMAP_MEM_MASK) && + IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT)) + memset((char *)map + start / 8, 0xff, nbits / 8); + else + __bitmap_set(map, start, nbits); +} + +static inline void bitmap_clear(unsigned long *map, unsigned int start, + unsigned int nbits) +{ + if (__builtin_constant_p(nbits) && nbits == 1) + __clear_bit(start, map); + else if (__builtin_constant_p(start & BITMAP_MEM_MASK) && + IS_ALIGNED(start, BITMAP_MEM_ALIGNMENT) && + __builtin_constant_p(nbits & BITMAP_MEM_MASK) && + IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT)) + memset((char *)map + start / 8, 0, nbits / 8); + else + __bitmap_clear(map, start, nbits); +} + #endif /* __LINUX_BITMAP_H */ diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 259df43fb00..a07c70fd485 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef __KERNEL__ #define BIT(nr) (1UL << (nr)) @@ -133,6 +134,17 @@ static inline unsigned int generic_hweight8(unsigned int w) return (res & 0x0F) + ((res >> 4) & 0x0F); } +static inline unsigned long generic_hweight64(__u64 w) +{ + return generic_hweight32((unsigned int)(w >> 32)) + + generic_hweight32((unsigned int)w); +} + +static inline unsigned long hweight_long(unsigned long w) +{ + return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); +} + #include /* linux/include/asm-generic/bitops/non-atomic.h */ -- cgit v1.2.3 From 0ee02701bf833ced15248bc5f8176ed06a1b43bb Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Thu, 16 Jan 2020 19:42:23 +0530 Subject: configs: j721e_evm_a72: Add Support for GPT partitions Introduce a default GPT partition table for eMMC. Signed-off-by: Faiz Abbas Signed-off-by: Lokesh Vutla --- include/configs/j721e_evm.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index 71cea3dd8a3..bbbbe4296e6 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -71,6 +71,11 @@ "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000\0" \ "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" +#define PARTS_DEFAULT \ + /* Linux partitions */ \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" + /* U-Boot MMC-specific configuration */ #define EXTRA_ENV_J721E_BOARD_SETTINGS_MMC \ "boot=mmc\0" \ @@ -88,6 +93,7 @@ "load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay} && " \ "fdt apply ${overlayaddr};" \ "done;\0" \ + "partitions=" PARTS_DEFAULT \ "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ "${bootdir}/${name_kern}\0" -- cgit v1.2.3 From 4250bf8ed96b50cf78d04fb2564fed351f7daeb2 Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Thu, 16 Jan 2020 19:42:24 +0530 Subject: configs: j721e_evm: Add configs for environment in eMMC Add config to save and read back environment from eMMC. Signed-off-by: Faiz Abbas Signed-off-by: Lokesh Vutla --- configs/j721e_evm_a72_defconfig | 7 ++++++- configs/j721e_evm_r5_defconfig | 6 +++++- include/configs/j721e_evm.h | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index 7ec3a530221..fd7fec1c4eb 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -5,10 +5,11 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x8000 CONFIG_SOC_K3_J721E=y CONFIG_TARGET_J721E_A72_EVM=y +CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0x680000 CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_DRIVERS_MISC_SUPPORT=y -CONFIG_ENV_SIZE=0x20000 CONFIG_SPL_STACK_R_ADDR=0x82000000 CONFIG_NR_DRAM_BANKS=2 CONFIG_SPL_FS_FAT=y @@ -24,6 +25,7 @@ CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_DM_RESET=y @@ -54,6 +56,9 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-common-proc-board" CONFIG_SPL_MULTI_DTB_FIT=y CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y +CONFIG_ENV_OFFSET_REDUND=0x700000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y diff --git a/configs/j721e_evm_r5_defconfig b/configs/j721e_evm_r5_defconfig index 52dfe396410..cb6c74d7bf7 100644 --- a/configs/j721e_evm_r5_defconfig +++ b/configs/j721e_evm_r5_defconfig @@ -6,10 +6,11 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x55000 CONFIG_SOC_K3_J721E=y CONFIG_TARGET_J721E_R5_EVM=y +CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0x680000 CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_DRIVERS_MISC_SUPPORT=y -CONFIG_ENV_SIZE=0x20000 CONFIG_SPL_STACK_R_ADDR=0x82000000 CONFIG_SPL_FS_FAT=y CONFIG_SPL_LIBDISK_SUPPORT=y @@ -46,6 +47,9 @@ CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board" +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y +CONFIG_ENV_OFFSET_REDUND=0x700000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SPL_DM=y diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index bbbbe4296e6..48d81dfd617 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -127,4 +127,10 @@ /* Now for the remaining common defines */ #include +/* MMC ENV related defines */ +#ifdef CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_SYS_MMC_ENV_PART 1 +#endif + #endif /* __CONFIG_J721E_EVM_H */ -- cgit v1.2.3 From b4309846db14a100f4c5afe40e1f4aeb09785683 Mon Sep 17 00:00:00 2001 From: Caleb Robey Date: Thu, 2 Jan 2020 08:17:27 -0600 Subject: board: ti: beagleboneai: add initial support These are necessities for beaglebone ai boot. There is the addition of CONFIG_SUPPORT_EMMC_CONFIG to the Kconfig file. This is present upstream but not in 19.01 yet. Signed-off-by: Jason Kridner Signed-off-by: Caleb Robey Signed-off-by: Lokesh Vutla --- arch/arm/mach-omap2/omap5/hw_data.c | 1 + board/ti/am57xx/board.c | 24 +++++++++++++++++++++++- include/configs/am57xx_evm.h | 1 - 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/arch/arm/mach-omap2/omap5/hw_data.c b/arch/arm/mach-omap2/omap5/hw_data.c index c4a41db92a4..fa4e27063c5 100644 --- a/arch/arm/mach-omap2/omap5/hw_data.c +++ b/arch/arm/mach-omap2/omap5/hw_data.c @@ -418,6 +418,7 @@ void enable_basic_clocks(void) (*prcm)->cm_l3init_hsmmc2_clkctrl, (*prcm)->cm_l4per_gptimer2_clkctrl, (*prcm)->cm_wkup_wdtimer2_clkctrl, + (*prcm)->cm_l4per_uart1_clkctrl, (*prcm)->cm_l4per_uart3_clkctrl, (*prcm)->cm_l4per_i2c1_clkctrl, #ifdef CONFIG_DRIVER_TI_CPSW diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 52f5e954e69..04bc60c4072 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -54,6 +54,7 @@ static int board_bootmode_has_emmc(void); #define board_is_am574x_idk() board_ti_is("AM574IDK") #define board_is_am572x_idk() board_ti_is("AM572IDK") #define board_is_am571x_idk() board_ti_is("AM571IDK") +#define board_is_bbai() board_ti_is("BBONE-AI") #ifdef CONFIG_DRIVER_TI_CPSW #include @@ -103,12 +104,19 @@ static const struct dmm_lisa_map_regs am574x_idk_lisa_regs = { .is_ma_present = 0x1 }; +static const struct dmm_lisa_map_regs bbai_lisa_regs = { + .dmm_lisa_map_3 = 0x80640100, + .is_ma_present = 0x1 +}; + void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) { if (board_is_am571x_idk()) *dmm_lisa_regs = &am571x_idk_lisa_regs; else if (board_is_am574x_idk()) *dmm_lisa_regs = &am574x_idk_lisa_regs; + else if (board_is_bbai()) + *dmm_lisa_regs = &bbai_lisa_regs; else *dmm_lisa_regs = &beagle_x15_lisa_regs; } @@ -553,6 +561,8 @@ void do_board_detect(void) bname = "AM572x IDK"; else if (board_is_am571x_idk()) bname = "AM571x IDK"; + else if (board_is_bbai()) + bname = "BeagleBone AI"; if (bname) snprintf(sysinfo.board_string, SYSINFO_BOARD_NAME_MAX_LEN, @@ -587,6 +597,8 @@ static void setup_board_eeprom_env(void) name = "am572x_idk"; } else if (board_is_am571x_idk()) { name = "am571x_idk"; + } else if (board_is_bbai()) { + name = "am5729_beagleboneai"; } else { printf("Unidentified board claims %s in eeprom header\n", board_ti_get_name()); @@ -650,7 +662,7 @@ void am57x_idk_lcd_detect(void) struct udevice *dev; /* Only valid for IDKs */ - if (board_is_x15() || board_is_am572x_evm()) + if (board_is_x15() || board_is_am572x_evm() || board_is_bbai()) return; /* Only AM571x IDK has gpio control detect.. so check that */ @@ -748,6 +760,9 @@ int board_late_init(void) /* Just probe the potentially supported cdce913 device */ uclass_get_device(UCLASS_CLK, 0, &dev); + if (board_is_bbai()) + env_set("console", "ttyS0,115200n8"); + #if !defined(CONFIG_SPL_BUILD) board_ti_set_ethaddr(2); #endif @@ -795,6 +810,11 @@ void recalibrate_iodelay(void) pconf_sz = ARRAY_SIZE(core_padconf_array_essential_am571x_idk); iod = iodelay_cfg_array_am571x_idk; iod_sz = ARRAY_SIZE(iodelay_cfg_array_am571x_idk); + } else if (board_is_bbai()) { + pconf = core_padconf_array_essential_bbai; + pconf_sz = ARRAY_SIZE(core_padconf_array_essential_bbai); + iod = iodelay_cfg_array_bbai; + iod_sz = ARRAY_SIZE(iodelay_cfg_array_bbai); } else { /* Common for X15/GPEVM */ pconf = core_padconf_array_essential_x15; @@ -1123,6 +1143,8 @@ int board_fit_config_name_match(const char *name) return 0; } else if (board_is_am571x_idk() && !strcmp(name, "am571x-idk")) { return 0; + } else if (board_is_bbai() && !strcmp(name, "am5729-beagleboneai")) { + return 0; } return -1; diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h index cdab9246f2c..75e7292ef5b 100644 --- a/include/configs/am57xx_evm.h +++ b/include/configs/am57xx_evm.h @@ -22,7 +22,6 @@ #define CONFIG_SYS_BOOTM_LEN SZ_64M -#define CONSOLEDEV "ttyS2" #define CONFIG_SYS_NS16550_COM1 UART1_BASE /* Base EVM has UART0 */ #define CONFIG_SYS_NS16550_COM2 UART2_BASE /* UART2 */ #define CONFIG_SYS_NS16550_COM3 UART3_BASE /* UART3 */ -- cgit v1.2.3 From 019d123705eb2c813af79d138538637e83dfa1bf Mon Sep 17 00:00:00 2001 From: Caleb Robey Date: Thu, 2 Jan 2020 08:17:29 -0600 Subject: board: ti: beagleboneai: enable in am57xx_evm_defconfig Adding the configurations to the evm_defconfig file Signed-off-by: Jason Kridner Signed-off-by: Caleb Robey Signed-off-by: Lokesh Vutla --- configs/am57xx_evm_defconfig | 3 ++- include/environment/ti/boot.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/configs/am57xx_evm_defconfig b/configs/am57xx_evm_defconfig index 6386157b490..96025a911d8 100644 --- a/configs/am57xx_evm_defconfig +++ b/configs/am57xx_evm_defconfig @@ -16,6 +16,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board" +CONFIG_PREBOOT="if $board_name=am5729_beaglebonai; then setenv console ttyS0,115200; fi;" # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_MISC_INIT_R is not set @@ -38,7 +39,7 @@ CONFIG_CMD_BCB=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="am572x-idk" -CONFIG_OF_LIST="am57xx-beagle-x15 am57xx-beagle-x15-revb1 am57xx-beagle-x15-revc am572x-idk am571x-idk am574x-idk" +CONFIG_OF_LIST="am57xx-beagle-x15 am57xx-beagle-x15-revb1 am57xx-beagle-x15-revc am5729-beagleboneai am572x-idk am571x-idk am574x-idk" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_ENV_OFFSET_REDUND=0x280000 diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h index 684a744f312..6313f3e328a 100644 --- a/include/environment/ti/boot.h +++ b/include/environment/ti/boot.h @@ -185,6 +185,8 @@ "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \ "if test $board_name = beagle_x15_revc; then " \ "setenv fdtfile am57xx-beagle-x15-revc.dtb; fi;" \ + "if test $board_name = am5729_beagleboneai; then " \ + "setenv fdtfile am5729-beagleboneai.dtb; fi;" \ "if test $board_name = am572x_idk; then " \ "setenv fdtfile am572x-idk.dtb; fi;" \ "if test $board_name = am574x_idk; then " \ -- cgit v1.2.3 From a5396a87fd8288d94c83a1602f3a2ae1ff3fe03f Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Fri, 10 Jan 2020 15:11:30 +0200 Subject: arm: am57xx: env: Fix DFU variables Commit 8502fe84a4fc ("configs: am57xx_evm: define CONFIG_SPL_LOAD_FIT_ADDRESS for SPL-DFU") implements incorrect ifdef logic, which leads to DFU variables absence in non-SPL environment. Fix that in order to bring back DFU variables, by reflecting the logic in include/configs/dra7xx_evm.h. Fixes: 8502fe84a4fc ("configs: am57xx_evm: define CONFIG_SPL_LOAD_F...") Signed-off-by: Sam Protsenko Signed-off-by: Lokesh Vutla --- include/configs/am57xx_evm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h index 75e7292ef5b..fea9300a67d 100644 --- a/include/configs/am57xx_evm.h +++ b/include/configs/am57xx_evm.h @@ -32,7 +32,6 @@ #define CONFIG_SYS_OMAP_ABE_SYSCK -#ifdef CONFIG_SPL_DFU #ifndef CONFIG_SPL_BUILD #define DFUARGS \ "dfu_bufsiz=0x10000\0" \ @@ -42,6 +41,7 @@ DFU_ALT_INFO_QSPI #else #undef CONFIG_CMD_BOOTD +#ifdef CONFIG_SPL_DFU #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80200000 #define DFUARGS \ "dfu_bufsiz=0x10000\0" \ -- cgit v1.2.3 From fb03b77a469167d1287187a23bcb7f08dab2e624 Mon Sep 17 00:00:00 2001 From: Andrew F. Davis Date: Fri, 10 Jan 2020 14:35:18 -0500 Subject: configs: j721e_evm.h: Sync J721e environment configuration with AM65x Some of the environment configuration in AM65x is not available in J721e due to additions on one but not the other. These two platforms are similar enough these common definitions should be factored out to a common area, prepare for this by synchronizing them. Signed-off-by: Andrew F. Davis Reviewed-by: Lokesh Vutla Signed-off-by: Lokesh Vutla --- include/configs/j721e_evm.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index 48d81dfd617..eaed520e6be 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -62,7 +62,9 @@ /* U-Boot general configuration */ #define EXTRA_ENV_J721E_BOARD_SETTINGS \ "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ - "findfdt=setenv fdtfile ${default_device_tree}\0" \ + "findfdt=" \ + "setenv name_fdt ${default_device_tree};" \ + "setenv fdtfile ${name_fdt}\0" \ "loadaddr=0x80080000\0" \ "fdtaddr=0x82000000\0" \ "overlayaddr=0x83000000\0" \ @@ -84,7 +86,7 @@ "bootdir=/boot\0" \ "rd_spec=-\0" \ "init_mmc=run args_all args_mmc\0" \ - "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ + "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \ "get_overlay_mmc=" \ "fdt address ${fdtaddr};" \ "fdt resize 0x100000;" \ @@ -95,7 +97,10 @@ "done;\0" \ "partitions=" PARTS_DEFAULT \ "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ - "${bootdir}/${name_kern}\0" + "${bootdir}/${name_kern}\0" \ + "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ + "${bootdir}/${name_fit}\0" \ + "partitions=" PARTS_DEFAULT #ifdef DEFAULT_RPROCS #undef DEFAULT_RPROCS @@ -118,6 +123,7 @@ /* Incorporate settings into the U-Boot environment */ #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_MMC_TI_ARGS \ + DEFAULT_FIT_TI_ARGS \ EXTRA_ENV_J721E_BOARD_SETTINGS \ EXTRA_ENV_J721E_BOARD_SETTINGS_MMC \ EXTRA_ENV_RPROC_SETTINGS \ -- cgit v1.2.3 From e77777b2ffb0e189ae29e5f7c6004aa3c4bd7951 Mon Sep 17 00:00:00 2001 From: Andrew F. Davis Date: Fri, 10 Jan 2020 14:35:19 -0500 Subject: configs: ti: Factor out call to 'args_mmc' into MMC common environment Both 'loadfit' and 'mmcloados' start with a call to 'args_mmc' so this can be factored out to before eithers only call site. This also allows us to remove that call from 'loadfit', which should not have been calling it anyway as that command should not be MMC specific. Without the call to 'args_mmc' the command 'loadfit' becomes just a call to 'run_fit' so remove the indirection and call 'run_fit' directly, this removes the need for 'loadfit' command (which was misnamed anyway). Drop it. Signed-off-by: Andrew F. Davis Reviewed-by: Lokesh Vutla Signed-off-by: Lokesh Vutla --- include/configs/ti_armv7_common.h | 1 - include/environment/ti/mmc.h | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index adc7861539b..a1a053e6750 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -61,7 +61,6 @@ "setenv overlaystring ${overlaystring}'#'${overlay};" \ "done;\0" \ "run_fit=bootm ${addr_fit}#${fdtfile}${overlaystring}\0" \ - "loadfit=run args_mmc; run run_fit;\0" \ /* * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined, diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h index bb4af0a3d54..1c8e49a8b3d 100644 --- a/include/environment/ti/mmc.h +++ b/include/environment/ti/mmc.h @@ -41,7 +41,7 @@ "fi;" \ "fi;" \ "fi;\0" \ - "mmcloados=run args_mmc; " \ + "mmcloados=" \ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ "if run loadfdt; then " \ "bootz ${loadaddr} - ${fdtaddr}; " \ @@ -61,8 +61,9 @@ "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 loadfit; " \ + "run run_fit; " \ "else " \ "run mmcloados;" \ "fi;" \ -- cgit v1.2.3 From e3128b610d929670e650d68b57a507a0b0d5089d Mon Sep 17 00:00:00 2001 From: Vignesh Raghavendra Date: Mon, 9 Dec 2019 10:37:34 +0530 Subject: configs: am65x_evm: Add DFU related env variables Add env variables that set up dfu_alt_info for MMC/EMMC/OSPI. This is required to allow update of firmware on these media. Signed-off-by: Vignesh Raghavendra Signed-off-by: Lokesh Vutla --- include/configs/am65x_evm.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 06be7cc8a46..9a120cad89e 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -13,6 +13,7 @@ #include #include #include +#include /* DDR Configuration */ #define CONFIG_SYS_SDRAM_BASE1 0x880000000 @@ -104,13 +105,20 @@ "0 /lib/firmware/am65x-mcu-r5f0_0-fw " \ "1 /lib/firmware/am65x-mcu-r5f0_1-fw " +#define EXTRA_ENV_DFUARGS \ + "dfu_bufsiz=0x20000\0" \ + DFU_ALT_INFO_MMC \ + DFU_ALT_INFO_EMMC \ + DFU_ALT_INFO_OSPI + /* Incorporate settings into the U-Boot environment */ #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_MMC_TI_ARGS \ DEFAULT_FIT_TI_ARGS \ EXTRA_ENV_AM65X_BOARD_SETTINGS \ EXTRA_ENV_AM65X_BOARD_SETTINGS_MMC \ - EXTRA_ENV_RPROC_SETTINGS + EXTRA_ENV_RPROC_SETTINGS \ + EXTRA_ENV_DFUARGS /* MMC ENV related defines */ #ifdef CONFIG_ENV_IS_IN_MMC -- cgit v1.2.3 From bcfa917b07dbfaf03000e339b3b8bcdc041be74c Mon Sep 17 00:00:00 2001 From: Vignesh Raghavendra Date: Mon, 9 Dec 2019 10:37:36 +0530 Subject: configs: am65x_evm: Enable USB keyboard as second stdin Enable USB keyboard to be used as input device at U-Boot prompt. Both serial and USB keyboard will be active inputs simultaneously. Signed-off-by: Vignesh Raghavendra Signed-off-by: Lokesh Vutla --- configs/am65x_evm_a53_defconfig | 3 +++ include/configs/am65x_evm.h | 1 + 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig index 5dbc31523cc..30c10470242 100644 --- a/configs/am65x_evm_a53_defconfig +++ b/configs/am65x_evm_a53_defconfig @@ -21,6 +21,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" +CONFIG_CONSOLE_MUX=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_SEPARATE_BSS=y @@ -70,6 +71,7 @@ CONFIG_DM_PCA953X=y CONFIG_DM_I2C=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y CONFIG_SYS_I2C_OMAP24XX=y +CONFIG_DM_KEYBOARD=y CONFIG_DM_MAILBOX=y CONFIG_K3_SEC_PROXY=y CONFIG_DM_MMC=y @@ -112,6 +114,7 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments" CONFIG_USB_GADGET_VENDOR_NUM=0x0451 diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 9a120cad89e..7d7f86a0598 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -72,6 +72,7 @@ "overlayaddr=0x83000000\0" \ "name_kern=Image\0" \ "console=ttyS2,115200n8\0" \ + "stdin=serial,usbkbd\0" \ "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000\0" \ "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" \ -- cgit v1.2.3