diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 11 | ||||
-rw-r--r-- | common/Kconfig.boot | 29 | ||||
-rw-r--r-- | common/Makefile | 6 | ||||
-rw-r--r-- | common/autoboot.c | 8 | ||||
-rw-r--r-- | common/board_f.c | 4 | ||||
-rw-r--r-- | common/board_r.c | 6 | ||||
-rw-r--r-- | common/cli.c | 7 | ||||
-rw-r--r-- | common/image-fdt.c | 2 | ||||
-rw-r--r-- | common/image-fit.c | 30 | ||||
-rw-r--r-- | common/image.c | 2 | ||||
-rw-r--r-- | common/main.c | 2 | ||||
-rw-r--r-- | common/spl/Kconfig | 92 | ||||
-rw-r--r-- | common/spl/Makefile | 6 | ||||
-rw-r--r-- | common/spl/spl.c | 9 | ||||
-rw-r--r-- | common/spl/spl_spi.c | 12 | ||||
-rw-r--r-- | common/stdio.c | 2 | ||||
-rw-r--r-- | common/xyzModem.c | 12 |
17 files changed, 145 insertions, 95 deletions
diff --git a/common/Kconfig b/common/Kconfig index ee14d3ad5bf..0543b839d18 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -548,6 +548,12 @@ config MISC_INIT_R help Enabling this option calls 'misc_init_r' function +config ID_EEPROM + bool "Enable I2C connected system identifier EEPROM" + help + A number of different systems and vendors enable a vendor-specified + EEPROM that contains various identifying features. + config PCI_INIT_R bool "Enumerate PCI buses during init" depends on PCI @@ -627,7 +633,6 @@ config TPL_HASH config STACKPROTECTOR bool "Stack Protector buffer overflow detection" - default n help Enable stack smash detection through compiler's stack-protector canary logic @@ -635,12 +640,10 @@ config STACKPROTECTOR config SPL_STACKPROTECTOR bool "Stack Protector buffer overflow detection for SPL" depends on STACKPROTECTOR && SPL - default n config TPL_STACKPROTECTOR bool "Stack Protector buffer overflow detection for TPL" depends on STACKPROTECTOR && TPL - default n endmenu @@ -648,7 +651,6 @@ menu "Update support" config UPDATE_COMMON bool - default n select DFU_WRITE_ALT config UPDATE_TFTP @@ -680,7 +682,6 @@ config UPDATE_FIT config ANDROID_AB bool "Android A/B updates" - default n help If enabled, adds support for the new Android A/B update model. This allows the bootloader to select which slot to boot from based on the diff --git a/common/Kconfig.boot b/common/Kconfig.boot index 902a5b8fbea..f23b9988521 100644 --- a/common/Kconfig.boot +++ b/common/Kconfig.boot @@ -80,7 +80,6 @@ config FIT_SIGNATURE_MAX_SIZE config FIT_RSASSA_PSS bool "Support rsassa-pss signature scheme of FIT image contents" depends on FIT_SIGNATURE - default n help Enable this to support the pss padding algorithm as described in the rfc8017 (https://tools.ietf.org/html/rfc8017). @@ -373,6 +372,26 @@ config CHROMEOS_VBOOT distinguishing between booting Chrome OS in a basic way (developer mode) and a full boot. +config RAMBOOT_PBL + bool "Freescale PBL(pre-boot loader) image format support" + help + Some SoCs use PBL to load RCW and/or pre-initialization instructions. + For more details refer to doc/README.pblimage + +config SYS_FSL_PBL_PBI + string "PBI(pre-boot instructions) commands for the PBL image" + depends on RAMBOOT_PBL + help + PBI commands can be used to configure SoC before it starts the execution. + Please refer doc/README.pblimage for more details. + +config SYS_FSL_PBL_RCW + string "Aadditional RCW (Power on reset configuration) for the PBL image" + depends on RAMBOOT_PBL + help + Enables addition of RCW (Power on reset configuration) in built image. + Please refer doc/README.pblimage for more details. + endmenu # Boot images menu "Boot timing" @@ -682,7 +701,6 @@ config NOR_BOOT config NAND_BOOT bool "Support for booting from NAND flash" - default n imply MTD_RAW_NAND help Enabling this will make a U-Boot binary that is capable of being @@ -691,7 +709,6 @@ config NAND_BOOT config ONENAND_BOOT bool "Support for booting from ONENAND" - default n imply MTD_RAW_NAND help Enabling this will make a U-Boot binary that is capable of being @@ -700,7 +717,6 @@ config ONENAND_BOOT config QSPI_BOOT bool "Support for booting from QSPI flash" - default n help Enabling this will make a U-Boot binary that is capable of being booted via QSPI flash. This is not a must, some SoCs need this, @@ -708,7 +724,6 @@ config QSPI_BOOT config SATA_BOOT bool "Support for booting from SATA" - default n help Enabling this will make a U-Boot binary that is capable of being booted via SATA. This is not a must, some SoCs need this, @@ -716,7 +731,6 @@ config SATA_BOOT config SD_BOOT bool "Support for booting from SD/EMMC" - default n help Enabling this will make a U-Boot binary that is capable of being booted via SD/EMMC. This is not a must, some SoCs need this, @@ -724,7 +738,6 @@ config SD_BOOT config SPI_BOOT bool "Support for booting from SPI flash" - default n help Enabling this will make a U-Boot binary that is capable of being booted via SPI flash. This is not a must, some SoCs need this, @@ -758,7 +771,6 @@ config BOOTDELAY config AUTOBOOT_KEYED bool "Stop autobooting via specific input key / string" - default n help This option enables stopping (aborting) of the automatic boot feature only by issuing a specific input key or @@ -845,7 +857,6 @@ config AUTOBOOT_STOP_STR config AUTOBOOT_KEYED_CTRLC bool "Enable Ctrl-C autoboot interruption" depends on AUTOBOOT_KEYED && !AUTOBOOT_ENCRYPTION - default n help This option allows for the boot sequence to be interrupted by ctrl-c, in addition to the "bootdelaykey" and "bootstopkey". diff --git a/common/Makefile b/common/Makefile index ae0430c35fe..fb8173a5b82 100644 --- a/common/Makefile +++ b/common/Makefile @@ -66,7 +66,7 @@ ifdef CONFIG_SPL_DFU obj-$(CONFIG_DFU_OVER_USB) += dfu.o endif obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o -obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o +obj-$(CONFIG_SPL_NET) += miiphyutil.o obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o ifdef CONFIG_SPL_USB_HOST @@ -85,9 +85,9 @@ obj-$(CONFIG_HWCONFIG) += hwconfig.o obj-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o ifdef CONFIG_SPL_BUILD ifdef CONFIG_TPL_BUILD -obj-$(CONFIG_TPL_SERIAL_SUPPORT) += console.o +obj-$(CONFIG_TPL_SERIAL) += console.o else -obj-$(CONFIG_SPL_SERIAL_SUPPORT) += console.o +obj-$(CONFIG_SPL_SERIAL) += console.o endif else obj-y += console.o diff --git a/common/autoboot.c b/common/autoboot.c index 5bb2e190895..6251c683108 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -24,6 +24,7 @@ #include <u-boot/sha256.h> #include <bootcount.h> #include <crypt.h> +#include <dm/ofnode.h> DECLARE_GLOBAL_DATA_PTR; @@ -424,12 +425,12 @@ static void process_fdt_options(const void *blob) ulong addr; /* Add an env variable to point to a kernel payload, if available */ - addr = fdtdec_get_config_int(gd->fdt_blob, "kernel-offset", 0); + addr = ofnode_conf_read_int("kernel-offset", 0); if (addr) env_set_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr)); /* Add an env variable to point to a root disk, if available */ - addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0); + addr = ofnode_conf_read_int("rootdisk-offset", 0); if (addr) env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr)); #endif /* CONFIG_SYS_TEXT_BASE */ @@ -446,8 +447,7 @@ const char *bootdelay_process(void) bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; if (IS_ENABLED(CONFIG_OF_CONTROL)) - bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay", - bootdelay); + bootdelay = ofnode_conf_read_int("bootdelay", bootdelay); debug("### main_loop entered: bootdelay=%d\n\n", bootdelay); diff --git a/common/board_f.c b/common/board_f.c index f2746537c96..3dc0eaa59c5 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -244,7 +244,7 @@ __weak int dram_init_banksize(void) return 0; } -#if defined(CONFIG_SYS_I2C_LEGACY) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) static int init_func_i2c(void) { puts("I2C: "); @@ -871,7 +871,7 @@ static const init_fnc_t init_sequence_f[] = { misc_init_f, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_SYS_I2C_LEGACY) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) init_func_i2c, #endif #if defined(CONFIG_VID) && !defined(CONFIG_SPL) diff --git a/common/board_r.c b/common/board_r.c index 630c2451a27..31a59c585a8 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -67,6 +67,7 @@ #endif #include <asm/sections.h> #include <dm/root.h> +#include <dm/ofnode.h> #include <linux/compiler.h> #include <linux/err.h> #include <efi_loader.h> @@ -448,8 +449,7 @@ static int initr_pvblock(void) static int should_load_env(void) { if (IS_ENABLED(CONFIG_OF_CONTROL)) - return fdtdec_get_config_int(gd->fdt_blob, - "load-environment", 1); + return ofnode_conf_read_int("load-environment", 1); if (IS_ENABLED(CONFIG_DELAY_ENVIRONMENT)) return 0; @@ -720,7 +720,7 @@ static init_fnc_t init_sequence_r[] = { #endif INIT_FUNC_WATCHDOG_RESET cpu_secondary_init_r, -#if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET) +#if defined(CONFIG_ID_EEPROM) mac_read_from_eeprom, #endif INIT_FUNC_WATCHDOG_RESET diff --git a/common/cli.c b/common/cli.c index 048eacb9ef9..d86046a728b 100644 --- a/common/cli.c +++ b/common/cli.c @@ -19,8 +19,7 @@ #include <hang.h> #include <malloc.h> #include <asm/global_data.h> - -DECLARE_GLOBAL_DATA_PTR; +#include <dm/ofnode.h> #ifdef CONFIG_CMDLINE /* @@ -157,7 +156,7 @@ int do_run(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) bool cli_process_fdt(const char **cmdp) { /* Allow the fdt to override the boot command */ - char *env = fdtdec_get_config_string(gd->fdt_blob, "bootcmd"); + const char *env = ofnode_conf_read_str("bootcmd"); if (env) *cmdp = env; /* @@ -165,7 +164,7 @@ bool cli_process_fdt(const char **cmdp) * Always use 'env' in this case, since bootsecure requres that the * bootcmd was specified in the FDT too. */ - return fdtdec_get_config_int(gd->fdt_blob, "bootsecure", 0) != 0; + return ofnode_conf_read_int("bootsecure", 0); } /* diff --git a/common/image-fdt.c b/common/image-fdt.c index 9441e63a3d4..b698e961fe7 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -628,7 +628,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, if (!ft_verify_fdt(blob)) goto err; -#if defined(CONFIG_SOC_KEYSTONE) +#if defined(CONFIG_ARCH_KEYSTONE) if (IMAGE_OF_BOARD_SETUP) ft_board_setup_ex(blob, gd->bd); #endif diff --git a/common/image-fit.c b/common/image-fit.c index f02d437539f..5a0a0cc2007 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -25,6 +25,10 @@ #include <asm/io.h> #include <malloc.h> #include <asm/global_data.h> +#ifdef CONFIG_DM_HASH +#include <dm.h> +#include <u-boot/hash.h> +#endif DECLARE_GLOBAL_DATA_PTR; #endif /* !USE_HOSTCC*/ @@ -1214,6 +1218,31 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp) int calculate_hash(const void *data, int data_len, const char *name, uint8_t *value, int *value_len) { +#if !defined(USE_HOSTCC) && defined(CONFIG_DM_HASH) + int rc; + enum HASH_ALGO hash_algo; + struct udevice *dev; + + rc = uclass_get_device(UCLASS_HASH, 0, &dev); + if (rc) { + debug("failed to get hash device, rc=%d\n", rc); + return -1; + } + + hash_algo = hash_algo_lookup_by_name(algo); + if (hash_algo == HASH_ALGO_INVALID) { + debug("Unsupported hash algorithm\n"); + return -1; + }; + + rc = hash_digest_wd(dev, hash_algo, data, data_len, value, CHUNKSZ); + if (rc) { + debug("failed to get hash value, rc=%d\n", rc); + return -1; + } + + *value_len = hash_algo_digest_size(hash_algo); +#else struct hash_algo *algo; int ret; @@ -1225,6 +1254,7 @@ int calculate_hash(const void *data, int data_len, const char *name, algo->hash_func_ws(data, data_len, value, algo->chunk_size); *value_len = algo->digest_size; +#endif return 0; } diff --git a/common/image.c b/common/image.c index 59c52a1f9ad..e199d61a4c3 100644 --- a/common/image.c +++ b/common/image.c @@ -216,6 +216,8 @@ static const struct comp_magic_map image_comp[] = { { IH_COMP_GZIP, "gzip", {0x1f, 0x8b},}, { IH_COMP_LZMA, "lzma", {0x5d, 0x00},}, { IH_COMP_LZO, "lzo", {0x89, 0x4c},}, + { IH_COMP_LZ4, "lz4", {0x04, 0x22},}, + { IH_COMP_ZSTD, "zstd", {0x28, 0xb5},}, { IH_COMP_NONE, "none", {}, }, }; diff --git a/common/main.c b/common/main.c index ae5bcdb32f8..3f5214fd44b 100644 --- a/common/main.c +++ b/common/main.c @@ -15,7 +15,7 @@ #include <env.h> #include <init.h> #include <net.h> -#include <version.h> +#include <version_string.h> #include <efi_loader.h> static void run_preboot_environment_command(void) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 29a46c47877..34f6fc2cfad 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -196,7 +196,7 @@ config SPL_BOOTCOUNT_LIMIT config SPL_RAW_IMAGE_SUPPORT bool "Support SPL loading and booting of RAW images" - default n if (ARCH_MX6 && (SPL_MMC_SUPPORT || SPL_SATA_SUPPORT)) + default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA)) default y if !TI_SECURE_DEVICE help SPL will support loading and booting a RAW image when this option @@ -453,7 +453,7 @@ config SPL_FIT_IMAGE_TINY ensure this information is available to the next image invoked). -config SPL_CACHE_SUPPORT +config SPL_CACHE bool "Support CACHE drivers" help Enable CACHE drivers in SPL. These drivers can keep data so that @@ -522,12 +522,13 @@ config SPL_SAVEENV config SPL_ETH bool "Support Ethernet" depends on SPL_ENV_SUPPORT + depends on SPL_NET help Enable access to the network subsystem and associated Ethernet drivers in SPL. This permits SPL to load U-Boot over an Ethernet link rather than from an on-board peripheral. Environment support is required since the network stack uses a number of environment - variables. See also SPL_NET_SUPPORT. + variables. See also SPL_NET. config SPL_FS_EXT4 bool "Support EXT filesystems" @@ -637,7 +638,7 @@ config SPL_DM_MAILBOX this option to build the drivers in drivers/mailbox as part of SPL build. -config SPL_MMC_SUPPORT +config SPL_MMC bool "Support MMC" depends on MMC select HAVE_BLOCK_DEVICE @@ -658,8 +659,7 @@ config SYS_MMCSD_FS_BOOT_PARTITION config SPL_MMC_TINY bool "Tiny MMC framework in SPL" - depends on SPL_MMC_SUPPORT - default n + depends on SPL_MMC help Enable MMC framework tinification support. This option is useful if if your SPL is extremely size constrained. Heed the warning, enable @@ -675,13 +675,12 @@ config SPL_MMC_TINY config SPL_MMC_WRITE bool "MMC/SD/SDIO card support for write operations in SPL" - depends on SPL_MMC_SUPPORT - default n + depends on SPL_MMC help Enable write access to MMC and SD Cards in SPL -config SPL_MPC8XXX_INIT_DDR_SUPPORT +config SPL_MPC8XXX_INIT_DDR bool "Support MPC8XXX DDR init" help Enable support for DDR-SDRAM (double-data-rate synchronous dynamic @@ -747,12 +746,6 @@ config SPL_UBI README.ubispl for more info. if SPL_DM -config SPL_CACHE - depends on CACHE - bool "Support cache drivers in SPL" - help - Enable support for cache drivers in SPL. - config SPL_DM_SPI bool "Support SPI DM drivers in SPL" help @@ -849,14 +842,13 @@ config SPL_UBI_LOAD_ARGS_ID config UBI_SPL_SILENCE_MSG bool "silence UBI SPL messages" - default n help Disable messages from UBI SPL. This leaves warnings and errors enabled. endif # if SPL_UBI -config SPL_NET_SUPPORT +config SPL_NET bool "Support networking" help Enable support for network devices (such as Ethernet) in SPL. @@ -865,7 +857,7 @@ config SPL_NET_SUPPORT the network stack uses a number of environment variables. See also SPL_ETH. -if SPL_NET_SUPPORT +if SPL_NET config SPL_NET_VCI_STRING string "BOOTP Vendor Class Identifier string sent by SPL" help @@ -874,7 +866,7 @@ config SPL_NET_VCI_STRING of a client. This is often used in practice to allow for the DHCP server to specify different files to load depending on if the ROM, SPL or U-Boot itself makes the request -endif # if SPL_NET_SUPPORT +endif # if SPL_NET config SPL_NO_CPU_SUPPORT bool "Drop CPU code in SPL" @@ -912,7 +904,6 @@ config SPL_ONENAND_SUPPORT config SPL_OS_BOOT bool "Activate Falcon Mode" depends on !TI_SECURE_DEVICE - default n help Enable booting directly to an OS from SPL. for more info read doc/README.falcon @@ -945,7 +936,7 @@ config SPL_PCI necessary driver support. This enables the drivers in drivers/pci as part of an SPL build. -config SPL_PCH_SUPPORT +config SPL_PCH bool "Support PCH drivers" help Enable support for PCH (Platform Controller Hub) devices in SPL. @@ -985,6 +976,7 @@ config SPL_POWER config SPL_POWER_DOMAIN bool "Support power domain drivers" + select SPL_POWER help Enable support for power domain control in SPL. Many SoCs allow power to be applied to or removed from portions of the SoC (power @@ -1014,7 +1006,7 @@ config SPL_REMOTEPROC Enable support for REMOTEPROCs in SPL. This permits to load a remote processor firmware in SPL. -config SPL_RTC_SUPPORT +config SPL_RTC bool "Support RTC drivers" help Enable RTC (Real-time Clock) support in SPL. This includes support @@ -1023,7 +1015,7 @@ config SPL_RTC_SUPPORT needed. This enables the drivers in drivers/rtc as part of an SPL build. -config SPL_SATA_SUPPORT +config SPL_SATA bool "Support loading from SATA" help Enable support for SATA (Serial AT attachment) in SPL. This allows @@ -1035,7 +1027,7 @@ config SPL_SATA_SUPPORT config SPL_SATA_RAW_U_BOOT_USE_SECTOR bool "SATA raw mode: by sector" - depends on SPL_SATA_SUPPORT + depends on SPL_SATA default y if ARCH_MVEBU help Use sector number for specifying U-Boot location on SATA disk in @@ -1049,7 +1041,7 @@ config SPL_SATA_RAW_U_BOOT_SECTOR Sector on the SATA disk to load U-Boot from, when the SATA disk is being used in raw mode. Units: SATA disk sectors (1 sector = 512 bytes). -config SPL_SERIAL_SUPPORT +config SPL_SERIAL bool "Support serial" select SPL_PRINTF select SPL_STRTO @@ -1060,7 +1052,7 @@ config SPL_SERIAL_SUPPORT unless there are space reasons not to. Even then, consider enabling SPL_USE_TINY_PRINTF which is a small printf() version. -config SPL_SPI_SUPPORT +config SPL_SPI bool "Support SPI drivers" help Enable support for using SPI in SPL. This is used for connecting @@ -1072,14 +1064,14 @@ config SPL_SPI_SUPPORT config SPL_SPI_FLASH_SUPPORT bool "Support SPI flash drivers" - depends on SPL_SPI_SUPPORT + depends on SPL_SPI help Enable support for using SPI flash in SPL, and loading U-Boot from SPI flash. SPI flash (Serial Peripheral Bus flash) is named after the SPI bus that is used to connect it to a system. It is a simple but fast bidirectional 4-wire bus (clock, chip select and two data lines). This enables the drivers in drivers/mtd/spi as part of an - SPL build. This normally requires SPL_SPI_SUPPORT. + SPL build. This normally requires SPL_SPI. if SPL_SPI_FLASH_SUPPORT @@ -1162,13 +1154,14 @@ if SPL_USB_GADGET config SPL_USB_ETHER bool "Support USB Ethernet drivers" + depends on SPL_NET help Enable access to the USB network subsystem and associated drivers in SPL. This permits SPL to load U-Boot over a USB-connected Ethernet link (such as a USB Ethernet dongle) rather than from an onboard peripheral. Environment support is required since the network stack uses a number of environment variables. - See also SPL_NET_SUPPORT and SPL_ETH. + See also SPL_NET and SPL_ETH. config SPL_DFU bool "Support DFU (Device Firmware Upgrade)" @@ -1199,7 +1192,7 @@ endchoice config SPL_USB_SDP_SUPPORT bool "Support SDP (Serial Download Protocol)" - depends on SPL_SERIAL_SUPPORT + depends on SPL_SERIAL help Enable Serial Download Protocol (SDP) device support in SPL. This allows to download images into memory and execute (jump to) them @@ -1225,7 +1218,7 @@ config SPL_WATCHDOG config SPL_YMODEM_SUPPORT bool "Support loading using Ymodem" - depends on SPL_SERIAL_SUPPORT + depends on SPL_SERIAL help While loading from serial is slow it can be a useful backup when there is no other option. The Ymodem protocol provides a reliable @@ -1359,7 +1352,6 @@ config TPL_LDSCRIPT config TPL_NEEDS_SEPARATE_TEXT_BASE bool "TPL needs a separate text-base" - default n depends on TPL help Enable, if the TPL stage should not inherit its text-base @@ -1368,12 +1360,23 @@ config TPL_NEEDS_SEPARATE_TEXT_BASE config TPL_NEEDS_SEPARATE_STACK bool "TPL needs a separate initial stack-pointer" - default n depends on TPL help Enable, if the TPL stage should not inherit its initial stack-pointer from the settings for the SPL stage. +config TPL_POWER + bool "Support power drivers" + help + Enable support for power control in TPL. This includes support + for PMICs (Power-management Integrated Circuits) and some of the + features provided by PMICs. In particular, voltage regulators can + be used to enable/disable power and vary its voltage. That can be + useful in TPL to turn on boot peripherals and adjust CPU voltage + so that the clock speed can be increased. This enables the drivers + in drivers/power, drivers/power/pmic and drivers/power/regulator + as part of an TPL build. + config TPL_TEXT_BASE hex "Base address for the .text section of the TPL stage" depends on TPL_NEEDS_SEPARATE_TEXT_BASE @@ -1458,17 +1461,17 @@ config TPL_LIBGENERIC_SUPPORT Enable support for generic U-Boot libraries within TPL. See SPL_LIBGENERIC_SUPPORT for details. -config TPL_MPC8XXX_INIT_DDR_SUPPORT +config TPL_MPC8XXX_INIT_DDR bool "Support MPC8XXX DDR init" help Enable support for DDR-SDRAM on the MPC8XXX family within TPL. See - SPL_MPC8XXX_INIT_DDR_SUPPORT for details. + SPL_MPC8XXX_INIT_DDR for details. -config TPL_MMC_SUPPORT +config TPL_MMC bool "Support MMC" depends on MMC help - Enable support for MMC within TPL. See SPL_MMC_SUPPORT for details. + Enable support for MMC within TPL. See SPL_MMC for details. config TPL_NAND_SUPPORT bool "Support NAND flash" @@ -1483,7 +1486,7 @@ config TPL_PCI necessary driver support. This enables the drivers in drivers/pci as part of a TPL build. -config TPL_PCH_SUPPORT +config TPL_PCH bool "Support PCH drivers" help Enable support for PCH (Platform Controller Hub) devices in TPL. @@ -1505,7 +1508,7 @@ config TPL_RAM_DEVICE be already in memory when TPL takes over, e.g. loaded by the boot ROM. -config TPL_RTC_SUPPORT +config TPL_RTC bool "Support RTC drivers" help Enable RTC (Real-time Clock) support in TPL. This includes support @@ -1514,12 +1517,12 @@ config TPL_RTC_SUPPORT needed. This enables the drivers in drivers/rtc as part of an TPL build. -config TPL_SERIAL_SUPPORT +config TPL_SERIAL bool "Support serial" select TPL_PRINTF select TPL_STRTO help - Enable support for serial in TPL. See SPL_SERIAL_SUPPORT for + Enable support for serial in TPL. See SPL_SERIAL for details. config TPL_SPI_FLASH_SUPPORT @@ -1545,10 +1548,10 @@ config TPL_SPI_LOAD Enable support for loading next stage, U-Boot or otherwise, from SPI NOR in U-Boot TPL. -config TPL_SPI_SUPPORT +config TPL_SPI bool "Support SPI drivers" help - Enable support for using SPI in TPL. See SPL_SPI_SUPPORT for + Enable support for using SPI in TPL. See SPL_SPI for details. config TPL_DM_SPI @@ -1563,7 +1566,7 @@ config TPL_DM_SPI_FLASH config TPL_YMODEM_SUPPORT bool "Support loading using Ymodem" - depends on TPL_SERIAL_SUPPORT + depends on TPL_SERIAL help While loading from serial is slow it can be a useful backup when there is no other option. The Ymodem protocol provides a reliable @@ -1575,7 +1578,6 @@ endif # TPL config SPL_AT91_MCK_BYPASS bool "Use external clock signal as a source of main clock for AT91 platforms" depends on ARCH_AT91 - default n help Use external 8 to 24 Mhz clock signal as source of main clock instead of an external crystal oscillator. diff --git a/common/spl/Makefile b/common/spl/Makefile index c576a781268..cb15c8e827c 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -19,15 +19,15 @@ obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += spl_nand.o obj-$(CONFIG_$(SPL_TPL_)ONENAND_SUPPORT) += spl_onenand.o endif obj-$(CONFIG_$(SPL_TPL_)UBI) += spl_ubi.o -obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o -obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o +obj-$(CONFIG_$(SPL_TPL_)NET) += spl_net.o +obj-$(CONFIG_$(SPL_TPL_)MMC) += spl_mmc.o obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o obj-$(CONFIG_$(SPL_TPL_)OPENSBI) += spl_opensbi.o obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o -obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o +obj-$(CONFIG_$(SPL_TPL_)SATA) += spl_sata.o obj-$(CONFIG_$(SPL_TPL_)DFU) += spl_dfu.o obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o obj-$(CONFIG_$(SPL_TPL_)RAM_SUPPORT) += spl_ram.o diff --git a/common/spl/spl.c b/common/spl/spl.c index d55d3c28485..ed94d5146cc 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -24,6 +24,9 @@ #include <nand.h> #include <fat.h> #include <u-boot/crc.h> +#if CONFIG_IS_ENABLED(BANNER_PRINT) +#include <timestamp.h> +#endif #include <version.h> #include <image.h> #include <malloc.h> @@ -486,7 +489,7 @@ static int spl_common_init(bool setup_malloc) return ret; } #endif - if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { + if (CONFIG_IS_ENABLED(OF_REAL)) { ret = fdtdec_setup(); if (ret) { debug("fdtdec_setup() returned error %d\n", ret); @@ -623,7 +626,7 @@ static int boot_from_devices(struct spl_image_info *spl_image, if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; loader = spl_ll_find_loader(bootdev); - if (CONFIG_IS_ENABLED(SERIAL_SUPPORT) && + if (CONFIG_IS_ENABLED(SERIAL) && CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && !IS_ENABLED(CONFIG_SILENT_CONSOLE)) { if (loader) @@ -821,7 +824,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) */ void preloader_console_init(void) { -#ifdef CONFIG_SPL_SERIAL_SUPPORT +#ifdef CONFIG_SPL_SERIAL gd->baudrate = CONFIG_BAUDRATE; serial_init(); /* serial communications setup */ diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 9884e7c1850..46ee4058e76 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -16,8 +16,7 @@ #include <errno.h> #include <spl.h> #include <asm/global_data.h> - -DECLARE_GLOBAL_DATA_PTR; +#include <dm/ofnode.h> #ifdef CONFIG_SPL_OS_BOOT /* @@ -103,11 +102,10 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, header = spl_get_load_buffer(-sizeof(*header), sizeof(*header)); -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) - payload_offs = fdtdec_get_config_int(gd->fdt_blob, - "u-boot,spl-payload-offset", - payload_offs); -#endif + if (CONFIG_IS_ENABLED(OF_REAL)) { + payload_offs = ofnode_conf_read_int("u-boot,spl-payload-offset", + payload_offs); + } #ifdef CONFIG_SPL_OS_BOOT if (spl_start_uboot() || spi_load_image_os(spl_image, flash, header)) diff --git a/common/stdio.c b/common/stdio.c index 4083e4edb8f..0f2eb6f0d61 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -336,7 +336,7 @@ int stdio_add_devices(void) dev->name); } } -#ifdef CONFIG_SYS_I2C_LEGACY +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) i2c_init_all(); #endif if (IS_ENABLED(CONFIG_DM_VIDEO)) { diff --git a/common/xyzModem.c b/common/xyzModem.c index fc3459ebbaf..ece25acb183 100644 --- a/common/xyzModem.c +++ b/common/xyzModem.c @@ -32,6 +32,7 @@ /* Values magic to the protocol */ #define SOH 0x01 #define STX 0x02 +#define ETX 0x03 /* ^C for interrupt */ #define EOT 0x04 #define ACK 0x06 #define BSP 0x08 @@ -283,6 +284,7 @@ xyzModem_get_hdr (void) hdr_found = true; break; case CAN: + case ETX: xyz.total_CAN++; ZM_DEBUG (zm_dump (__LINE__)); if (++can_total == xyzModem_CAN_COUNT) @@ -494,7 +496,7 @@ xyzModem_stream_read (char *buf, int size, int *err) total = 0; stat = xyzModem_cancel; /* Try and get 'size' bytes into the buffer */ - while (!xyz.at_eof && (size > 0)) + while (!xyz.at_eof && xyz.len >= 0 && (size > 0)) { if (xyz.len == 0) { @@ -572,6 +574,8 @@ xyzModem_stream_read (char *buf, int size, int *err) CYGACC_COMM_IF_PUTC (*xyz.__chan, ACK); ZM_DEBUG (zm_dprintf ("FINAL ACK (%d)\n", __LINE__)); } + else + stat = 0; xyz.at_eof = true; break; } @@ -587,7 +591,7 @@ xyzModem_stream_read (char *buf, int size, int *err) } } /* Don't "read" data from the EOF protocol package */ - if (!xyz.at_eof) + if (!xyz.at_eof && xyz.len > 0) { len = xyz.len; if (size < len) @@ -606,10 +610,10 @@ xyzModem_stream_read (char *buf, int size, int *err) void xyzModem_stream_close (int *err) { - diag_printf + ZM_DEBUG (zm_dprintf ("xyzModem - %s mode, %d(SOH)/%d(STX)/%d(CAN) packets, %d retries\n", xyz.crc_mode ? "CRC" : "Cksum", xyz.total_SOH, xyz.total_STX, - xyz.total_CAN, xyz.total_retries); + xyz.total_CAN, xyz.total_retries)); ZM_DEBUG (zm_flush ()); } |