[PATCH v2 1/1] efi_loader: use logging for bootefi command
Log messages of the bootefi command instead of simply printing them to the console. Do not show "## Application terminated" message when the UEFI binary completed successfully. Adjust the python tests testing for '## Application terminated'. Signed-off-by: Heinrich Schuchardt --- v2: adjust Python tests to reflect changed command line output --- cmd/bootefi.c| 42 ++-- test/py/tests/test_efi_fit.py| 9 +++ test/py/tests/test_efi_loader.py | 9 +++ 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 57552f99fc..8154efde52 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -5,6 +5,8 @@ * Copyright (c) 2016 Alexander Graf */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include @@ -14,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -62,7 +65,7 @@ static efi_status_t set_load_options(efi_handle_t handle, const char *env_var, size = utf8_utf16_strlen(env) + 1; loaded_image_info->load_options = calloc(size, sizeof(u16)); if (!loaded_image_info->load_options) { - printf("ERROR: Out of memory\n"); + log_err("ERROR: Out of memory\n"); EFI_CALL(systab.boottime->close_protocol(handle, &efi_guid_loaded_image, efi_root, NULL)); @@ -137,7 +140,7 @@ static efi_status_t copy_fdt(void **fdtp) EFI_ACPI_RECLAIM_MEMORY, fdt_pages, &new_fdt_addr); if (ret != EFI_SUCCESS) { - printf("ERROR: Failed to reserve space for FDT\n"); + log_err("ERROR: Failed to reserve space for FDT\n"); goto done; } } @@ -156,8 +159,8 @@ static void efi_reserve_memory(u64 addr, u64 size) addr = (uintptr_t)map_sysmem(addr, 0); if (efi_add_memory_map(addr, size, EFI_RESERVED_MEMORY_TYPE) != EFI_SUCCESS) - printf("Reserved memory mapping failed addr %llx size %llx\n", - addr, size); + log_err("Reserved memory mapping failed addr %llx size %llx\n", + addr, size); } /** @@ -252,7 +255,7 @@ efi_status_t efi_install_fdt(void *fdt) */ #if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) if (fdt) { - printf("ERROR: can't have ACPI table and device tree.\n"); + log_err("ERROR: can't have ACPI table and device tree.\n"); return EFI_LOAD_ERROR; } #else @@ -272,13 +275,13 @@ efi_status_t efi_install_fdt(void *fdt) if (!fdt_opt) { fdt_opt = env_get("fdtcontroladdr"); if (!fdt_opt) { - printf("ERROR: need device tree\n"); + log_err("ERROR: need device tree\n"); return EFI_NOT_FOUND; } } fdt_addr = simple_strtoul(fdt_opt, NULL, 16); if (!fdt_addr) { - printf("ERROR: invalid $fdt_addr or $fdtcontroladdr\n"); + log_err("ERROR: invalid $fdt_addr or $fdtcontroladdr\n"); return EFI_LOAD_ERROR; } fdt = map_sysmem(fdt_addr, 0); @@ -286,19 +289,19 @@ efi_status_t efi_install_fdt(void *fdt) /* Install device tree */ if (fdt_check_header(fdt)) { - printf("ERROR: invalid device tree\n"); + log_err("ERROR: invalid device tree\n"); return EFI_LOAD_ERROR; } /* Prepare device tree for payload */ ret = copy_fdt(&fdt); if (ret) { - printf("ERROR: out of memory\n"); + log_err("ERROR: out of memory\n"); return EFI_OUT_OF_RESOURCES; } if (image_setup_libfdt(&img, fdt, 0, NULL)) { - printf("ERROR: failed to process device tree\n"); + log_err("ERROR: failed to process device tree\n"); return EFI_LOAD_ERROR; } @@ -308,7 +311,7 @@ efi_status_t efi_install_fdt(void *fdt) /* Install device tree as UEFI table */ ret = efi_install_configuration_table(&efi_guid_fdt, fdt); if (ret != EFI_SUCCESS) { - printf("ERROR: failed to install device tree\n"); + log_err("ERROR: failed to install device tree\n"); return ret; } #endif /* GENERATE_ACPI_TABLE */ @@ -339,10 +342,13 @@ static efi_status_t do_bootefi_exec(efi_handle_t handle) /* Call our payload! */ ret = EFI_CALL(efi_start_image(handle, &exit_data_size, &exit_data)); - printf("## Application term
Re: [PATCH v4 1/7] lib: crypto: add public_key_verify_signature()
On 7/17/20 9:16 AM, AKASHI Takahiro wrote: > This function will be called from x509_check_for_self_signed() and > pkcs7_verify_one(), which will be imported from linux in a later patch. > > While it does exist in linux code and has a similar functionality of > rsa_verify(), it calls further linux-specific interfaces inside. > That could lead to more files being imported from linux. > > So simply re-implement it here instead of re-using the code. > > Signed-off-by: AKASHI Takahiro > --- > include/crypto/public_key.h | 2 +- > lib/crypto/public_key.c | 70 - > 2 files changed, 70 insertions(+), 2 deletions(-) > > diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h > index 436a1ee1ee64..3ba90fcc3483 100644 > --- a/include/crypto/public_key.h > +++ b/include/crypto/public_key.h > @@ -82,9 +82,9 @@ extern int decrypt_blob(struct kernel_pkey_params *, const > void *, void *); > extern int create_signature(struct kernel_pkey_params *, const void *, void > *); > extern int verify_signature(const struct key *, > const struct public_key_signature *); > +#endif /* __UBOOT__ */ > > int public_key_verify_signature(const struct public_key *pkey, > const struct public_key_signature *sig); > -#endif /* !__UBOOT__ */ > > #endif /* _LINUX_PUBLIC_KEY_H */ > diff --git a/lib/crypto/public_key.c b/lib/crypto/public_key.c > index e12ebbb3d0c5..71a0e0356beb 100644 > --- a/lib/crypto/public_key.c > +++ b/lib/crypto/public_key.c > @@ -25,7 +25,10 @@ > #include > #endif > #include > -#ifndef __UBOOT__ > +#ifdef __UBOOT__ > +#include > +#include > +#else > #include > #endif Shouldn't we describe in the header of the file that the code is taken (at least partially) from Linux' crypto/asymmetric_keys/public_key.c? Please, also state the Linux version number. > > @@ -80,6 +83,71 @@ void public_key_signature_free(struct public_key_signature > *sig) > } > EXPORT_SYMBOL_GPL(public_key_signature_free); > > +/** > + * public_key_verify_signature - Verify a signature using a public key. > + * > + * @pkey:Public key > + * @sig: Signature > + * > + * Verify a signature, @sig, using a RSA public key, @pkey. > + * > + * Return: 0 - verified, non-zero error code - otherwise > + */ > +int public_key_verify_signature(const struct public_key *pkey, > + const struct public_key_signature *sig) > +{ > + struct image_sign_info info; > + struct image_region region; > + int ret; > + > + pr_devel("==>%s()\n", __func__); > + > + if (!pkey || !sig) > + return -EINVAL; > + > + if (pkey->key_is_private) > + return -EINVAL; > + > + memset(&info, '\0', sizeof(info)); > + info.padding = image_get_padding_algo("pkcs-1.5"); > + /* > + * Note: image_get_[checksum|crypto]_algo takes a string > + * argument like "," > + * TODO: support other hash algorithms > + */ > + if (strcmp(sig->pkey_algo, "rsa") || (sig->s_size * 8) != 2048) { > + pr_warn("Encryption is not RSA2048: %s%d\n", > + sig->pkey_algo, sig->s_size * 8); > + return -ENOPKG; > + } > + if (!strcmp(sig->hash_algo, "sha1")) { > + info.checksum = image_get_checksum_algo("sha1,rsa2048"); > + info.name = "sha1,rsa2048"; > + } else if (!strcmp(sig->hash_algo, "sha256")) { > + info.checksum = image_get_checksum_algo("sha256,rsa2048"); > + info.name = "sha256,rsa2048"; > + } else { > + pr_warn("unknown msg digest algo: %s\n", sig->hash_algo); > + return -ENOPKG; > + } > + info.crypto = image_get_crypto_algo(info.name); > + if (unlikely(IS_ERR(info.checksum) || IS_ERR(info.crypto))) > + return -ENOPKG; scripts/checkpatch.pl complains: WARNING: nested (un)?likely() calls, IS_ERR already uses unlikely() internally #104: FILE: lib/crypto/public_key.c:134: + if (unlikely(IS_ERR(info.checksum) || IS_ERR(info.crypto))) I cannot find this unlikely in the Linux v5.8-rc4 crypto/asymmetric_keys/public_key.c file. From where did you copy this code? Best regards Heinrich > + > + info.key = pkey->key; > + info.keylen = pkey->keylen; > + > + region.data = sig->digest; > + region.size = sig->digest_size; > + > + if (rsa_verify_with_pkey(&info, sig->digest, sig->s, sig->s_size)) > + ret = -EKEYREJECTED; > + else > + ret = 0; > + > + pr_devel("<==%s() = %d\n", __func__, ret); > + return ret; > +} > #else > /* > * Destroy a public key algorithm key. >
Re: [PATCH v4 3/7] lib: crypto: import pkcs7_verify.c from linux
On 7/17/20 9:16 AM, AKASHI Takahiro wrote: > The file, pkcs7_verify.c, will now be imported from linux code > (crypto/asymmetric_keys/pkcs7_verify.c) > and modified to fit into U-Boot environment. > > In particular, pkcs7_verify_one() function will be used in a later patch > to rework signature verification logic aiming to support intermediate > certificates in "chain of trust." > > Signed-off-by: AKASHI Takahiro > --- > lib/crypto/Kconfig| 3 + > lib/crypto/Makefile | 1 + > lib/crypto/pkcs7_verify.c | 521 ++ > 3 files changed, 525 insertions(+) > create mode 100644 lib/crypto/pkcs7_verify.c > > diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig > index 2b221b915aa6..6369bafac07b 100644 > --- a/lib/crypto/Kconfig > +++ b/lib/crypto/Kconfig > @@ -49,4 +49,7 @@ config PKCS7_MESSAGE_PARSER > This option provides support for parsing PKCS#7 format messages for > signature data and provides the ability to verify the signature. > > +config PKCS7_VERIFY > + bool > + > endif # ASYMMETRIC_KEY_TYPE > diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile > index 8267fee0a7b8..f3a414525d2a 100644 > --- a/lib/crypto/Makefile > +++ b/lib/crypto/Makefile > @@ -44,6 +44,7 @@ obj-$(CONFIG_PKCS7_MESSAGE_PARSER) += pkcs7_message.o > pkcs7_message-y := \ > pkcs7.asn1.o \ > pkcs7_parser.o > +obj-$(CONFIG_PKCS7_VERIFY) += pkcs7_verify.o > > $(obj)/pkcs7_parser.o: $(obj)/pkcs7.asn1.h > $(obj)/pkcs7.asn1.o: $(obj)/pkcs7.asn1.c $(obj)/pkcs7.asn1.h > diff --git a/lib/crypto/pkcs7_verify.c b/lib/crypto/pkcs7_verify.c > new file mode 100644 > index ..a893fa3b586b > --- /dev/null > +++ b/lib/crypto/pkcs7_verify.c > @@ -0,0 +1,521 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* Verify the signature on a PKCS#7 message. > + * > + * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. > + * Written by David Howells (dhowe...@redhat.com) Please, state here from which Linux file and which version you have been copying, e.g. * Based on Linux v5.8-rc5 lib/crypto/pkcs7_verify.c Best regards Heinrich
[PATCH v3 0/2] use dt and UCLASS_IRQ/SYSCON to get gic details
Use device tree and driver class (UCLASS_IRQ and UCLASS_SYSCON) to get gic details like GICD, GICR base address, max number of redistributors and git lpi address. Changes from v2: -Address review comments from Tom Rini, Fix build errors messages. Changes from v1: -Address review comments from Tom Rini, Fix build warning messages. Rayagonda Kokatanur (2): arch: arm: use dt and UCLASS_IRQ to get gic details arch: arm: use dt and UCLASS_SYSCON to get gic lpi details arch/arm/Kconfig| 2 + arch/arm/cpu/armv8/fsl-layerscape/soc.c | 28 + arch/arm/include/asm/gic-v3.h | 4 +- arch/arm/lib/gic-v3-its.c | 136 +--- 4 files changed, 127 insertions(+), 43 deletions(-) -- 2.17.1
[PATCH v3 2/2] arch: arm: use dt and UCLASS_SYSCON to get gic lpi details
Use device tree and UCLASS_SYSCON driver to get Generic Interrupt Controller (GIC) lpi address and maximum GIC redistributors count. Also update Kconfig to select REGMAP and SYSCON when GIC_V3_ITS is enabled. Signed-off-by: Rayagonda Kokatanur --- Changes from v2: -Address review comments from Tom Rini, Fix build errors messages. arch/arm/Kconfig| 2 + arch/arm/cpu/armv8/fsl-layerscape/soc.c | 28 +-- arch/arm/include/asm/gic-v3.h | 4 +- arch/arm/lib/gic-v3-its.c | 63 ++--- 4 files changed, 61 insertions(+), 36 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e16fe03887..f88229d092 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -64,6 +64,8 @@ endif config GIC_V3_ITS bool "ARM GICV3 ITS" + select REGMAP + select SYSCON help ARM GICV3 Interrupt translation service (ITS). Basic support for programming locality specific peripheral diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c index ad7ea05935..135fe4a462 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c @@ -41,37 +41,11 @@ DECLARE_GLOBAL_DATA_PTR; #endif #ifdef CONFIG_GIC_V3_ITS -#define PENDTABLE_MAX_SZ ALIGN(BIT(ITS_MAX_LPI_NRBITS), SZ_64K) -#define PROPTABLE_MAX_SZ ALIGN(BIT(ITS_MAX_LPI_NRBITS) / 8, SZ_64K) -#define GIC_LPI_SIZE ALIGN(cpu_numcores() * PENDTABLE_MAX_SZ + \ - PROPTABLE_MAX_SZ, SZ_1M) -static int fdt_add_resv_mem_gic_rd_tables(void *blob, u64 base, size_t size) -{ - u32 phandle; - int err; - struct fdt_memory gic_rd_tables; - - gic_rd_tables.start = base; - gic_rd_tables.end = base + size - 1; - err = fdtdec_add_reserved_memory(blob, "gic-rd-tables", &gic_rd_tables, -&phandle); - if (err < 0) - debug("%s: failed to add reserved memory: %d\n", __func__, err); - - return err; -} - int ls_gic_rd_tables_init(void *blob) { - u64 gic_lpi_base; int ret; - gic_lpi_base = ALIGN(gd->arch.resv_ram - GIC_LPI_SIZE, SZ_64K); - ret = fdt_add_resv_mem_gic_rd_tables(blob, gic_lpi_base, GIC_LPI_SIZE); - if (ret) - return ret; - - ret = gic_lpi_tables_init(gic_lpi_base, cpu_numcores()); + ret = gic_lpi_tables_init(); if (ret) debug("%s: failed to init gic-lpi-tables\n", __func__); diff --git a/arch/arm/include/asm/gic-v3.h b/arch/arm/include/asm/gic-v3.h index 5131fabec4..35efec78c3 100644 --- a/arch/arm/include/asm/gic-v3.h +++ b/arch/arm/include/asm/gic-v3.h @@ -127,9 +127,9 @@ #define GIC_REDISTRIBUTOR_OFFSET 0x2 #ifdef CONFIG_GIC_V3_ITS -int gic_lpi_tables_init(u64 base, u32 max_redist); +int gic_lpi_tables_init(void); #else -int gic_lpi_tables_init(u64 base, u32 max_redist) +int gic_lpi_tables_init(void) { return 0; } diff --git a/arch/arm/lib/gic-v3-its.c b/arch/arm/lib/gic-v3-its.c index 5057cc5421..5e82bdf568 100644 --- a/arch/arm/lib/gic-v3-its.c +++ b/arch/arm/lib/gic-v3-its.c @@ -4,6 +4,8 @@ */ #include #include +#include +#include #include #include #include @@ -16,15 +18,22 @@ static u32 lpi_id_bits; #define LPI_PROPBASE_SZALIGN(BIT(LPI_NRBITS), SZ_64K) #define LPI_PENDBASE_SZALIGN(BIT(LPI_NRBITS) / 8, SZ_64K) +/* Number of GIC re-distributors */ +#define MAX_GIC_REDISTRIBUTORS 8 + /* * gic_v3_its_priv - gic details * * @gicd_base: gicd base address * @gicr_base: gicr base address + * @lpi_base: gic lpi base address + * @num_redist: number of gic re-distributors */ struct gic_v3_its_priv { u32 gicd_base; u32 gicr_base; + u32 lpi_base; + u32 num_redist; }; static int gic_v3_its_get_gic_addr(struct gic_v3_its_priv *priv) @@ -58,13 +67,39 @@ static int gic_v3_its_get_gic_addr(struct gic_v3_its_priv *priv) return 0; } +static int gic_v3_its_get_gic_lpi_addr(struct gic_v3_its_priv *priv) +{ + struct regmap *regmap; + struct udevice *dev; + int ret; + + ret = uclass_get_device_by_driver(UCLASS_SYSCON, + DM_GET_DRIVER(gic_lpi_syscon), &dev); + if (ret) { + pr_err("%s: failed to get %s syscon device\n", __func__, + DM_GET_DRIVER(gic_lpi_syscon)->name); + return ret; + } + + regmap = syscon_get_regmap(dev); + if (!regmap) { + pr_err("%s: failed to regmap for %s syscon device\n", __func__, + DM_GET_DRIVER(gic_lpi_syscon)->name); + return -ENODEV; + } + priv->lpi_base = regmap->ranges[0].start; + + priv->num_redist = dev_read_u32_default(dev, "max-gic-redistributors", + MAX_GIC_REDISTRIBUTO
[PATCH v3 1/2] arch: arm: use dt and UCLASS_IRQ to get gic details
Use device tree and UCLASS_IRQ driver to get following Generic Interrupt Controller (GIC) details, -GIC Distributor interface (GICD) base address and -GIC Redistributors (GICR) base address. Signed-off-by: Rayagonda Kokatanur --- Changes from v1: -Address review comments from Tom Rini, Fix build warning messages. arch/arm/lib/gic-v3-its.c | 73 +++ 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/arch/arm/lib/gic-v3-its.c b/arch/arm/lib/gic-v3-its.c index 90f37a123c..5057cc5421 100644 --- a/arch/arm/lib/gic-v3-its.c +++ b/arch/arm/lib/gic-v3-its.c @@ -3,6 +3,7 @@ * Copyright 2019 Broadcom. */ #include +#include #include #include #include @@ -15,6 +16,48 @@ static u32 lpi_id_bits; #define LPI_PROPBASE_SZALIGN(BIT(LPI_NRBITS), SZ_64K) #define LPI_PENDBASE_SZALIGN(BIT(LPI_NRBITS) / 8, SZ_64K) +/* + * gic_v3_its_priv - gic details + * + * @gicd_base: gicd base address + * @gicr_base: gicr base address + */ +struct gic_v3_its_priv { + u32 gicd_base; + u32 gicr_base; +}; + +static int gic_v3_its_get_gic_addr(struct gic_v3_its_priv *priv) +{ + struct udevice *dev; + fdt_addr_t addr; + int ret; + + ret = uclass_get_device_by_driver(UCLASS_IRQ, + DM_GET_DRIVER(arm_gic_v3_its), &dev); + if (ret) { + pr_err("%s: failed to get %s irq device\n", __func__, + DM_GET_DRIVER(arm_gic_v3_its)->name); + return ret; + } + + addr = dev_read_addr_index(dev, 0); + if (addr == FDT_ADDR_T_NONE) { + pr_err("%s: failed to get GICD address\n", __func__); + return -EINVAL; + } + priv->gicd_base = addr; + + addr = dev_read_addr_index(dev, 1); + if (addr == FDT_ADDR_T_NONE) { + pr_err("%s: failed to get GICR address\n", __func__); + return -EINVAL; + } + priv->gicr_base = addr; + + return 0; +} + /* * Program the GIC LPI configuration tables for all * the re-distributors and enable the LPI table @@ -23,15 +66,18 @@ static u32 lpi_id_bits; */ int gic_lpi_tables_init(u64 base, u32 num_redist) { + struct gic_v3_its_priv priv; u32 gicd_typer; u64 val; u64 tmp; int i; u64 redist_lpi_base; - u64 pend_base = GICR_BASE + GICR_PENDBASER; + u64 pend_base; - gicd_typer = readl(GICD_BASE + GICD_TYPER); + if (gic_v3_its_get_gic_addr(&priv)) + return -EINVAL; + gicd_typer = readl((uintptr_t)(priv.gicd_base + GICD_TYPER)); /* GIC support for Locality specific peripheral interrupts (LPI's) */ if (!(gicd_typer & GICD_TYPER_LPIS)) { pr_err("GIC implementation does not support LPI's\n"); @@ -46,7 +92,7 @@ int gic_lpi_tables_init(u64 base, u32 num_redist) for (i = 0; i < num_redist; i++) { u32 offset = i * GIC_REDISTRIBUTOR_OFFSET; - if ((readl((uintptr_t)(GICR_BASE + offset))) & + if ((readl((uintptr_t)(priv.gicr_base + offset))) & GICR_CTLR_ENABLE_LPIS) { pr_err("Re-Distributor %d LPI is already enabled\n", i); @@ -64,19 +110,21 @@ int gic_lpi_tables_init(u64 base, u32 num_redist) GICR_PROPBASER_RAWAWB | ((LPI_NRBITS - 1) & GICR_PROPBASER_IDBITS_MASK)); - writeq(val, (GICR_BASE + GICR_PROPBASER)); - tmp = readl(GICR_BASE + GICR_PROPBASER); + writeq(val, (uintptr_t)(priv.gicr_base + GICR_PROPBASER)); + tmp = readl((uintptr_t)(priv.gicr_base + GICR_PROPBASER)); if ((tmp ^ val) & GICR_PROPBASER_SHAREABILITY_MASK) { if (!(tmp & GICR_PROPBASER_SHAREABILITY_MASK)) { val &= ~(GICR_PROPBASER_SHAREABILITY_MASK | GICR_PROPBASER_CACHEABILITY_MASK); val |= GICR_PROPBASER_NC; - writeq(val, (GICR_BASE + GICR_PROPBASER)); + writeq(val, + (uintptr_t)(priv.gicr_base + GICR_PROPBASER)); } } redist_lpi_base = base + LPI_PROPBASE_SZ; + pend_base = priv.gicr_base + GICR_PENDBASER; for (i = 0; i < num_redist; i++) { u32 offset = i * GIC_REDISTRIBUTOR_OFFSET; @@ -94,9 +142,20 @@ int gic_lpi_tables_init(u64 base, u32 num_redist) } /* Enable LPI for the redistributor */ - writel(GICR_CTLR_ENABLE_LPIS, (uintptr_t)(GICR_BASE + offset)); + writel(GICR_CTLR_ENABLE_LPIS, + (uintptr_t)(priv.gicr_base + offset)); } return 0; } +static const struct udevice_id gic_v3_its_ids[] = { + { .compatible = "arm,gic-v3" }, + {} +}; + +U_BOOT_DRIVER(arm_gic_v3_its) = { + .name
Re: [PATCH v6 0/4] usb: xhci: Load Raspberry Pi 4 VL805's firmware
Hi Stefan, On Sun, 2020-07-19 at 02:37 +0200, Stefan Agner wrote: > Hi Nicolas, > > On 2020-06-29 18:37, Nicolas Saenz Julienne wrote: > > Newer revisions of the RPi4 need their xHCI chip, VL805, firmware to be > > loaded explicitly. Earlier versions didn't need that as they where using > > an EEPROM for that purpose. This series takes care of setting up the > > relevant infrastructure and run the firmware loading routine at the > > right moment. > > I tried using this patchset to boot from a USB mass storage device on > RPi 4 with 8GB RAM. I updated the EEPROM firmware as well as deployed > the latest GPU firmware (start4.elf/fixup4.dat) from the firmware master > branch. I think with that I have new enough/correct versions. > > The RPi 4 successfully boots U-Boot from a mass storage device. However, > U-Boot itself is then not able to access USB. The output always shows > -110 (timeout). It seems that the VL805 controller is not detected on > the PCIe bus. Do you happen to know what I might be missing? > > I tried current master (which has your patchset merged) as well as your > vl805 branch on Github. You're probably missing these two patches on your device-tree, they haven't made it upstream yet, but most likely will soon: https://patchwork.ozlabs.org/project/linux-pci/patch/20200629161845.6021-4-nsaenzjulie...@suse.de/ https://patchwork.ozlabs.org/project/linux-pci/patch/20200629161845.6021-5-nsaenzjulie...@suse.de/ Sorry for the hassle! Nicolas > > U-Boot 2020.07-rc4-00036-gdeb48986ee (Jul 19 2020 - 02:29:44 +0200) > > DRAM: 7.9 GiB > RPI 4 Model B (0xd03114) > MMC: mmcnr@7e30: 1, emmc2@7e34: 0 > Loading Environment from FAT... Card did not respond to voltage select! > In:serial > Out: vidconsole > Err: vidconsole > Net: eth0: genet@7d58 > PCIe BRCM: link up, 5.0 Gbps x1 (!SSC) > Device 'pci_0:0.0': seq 0 is in use by 'pcie@7d50' > starting USB... > Bus xhci_pci: probe failed, error -110 > No working controllers found > Hit any key to stop autoboot: 0 > U-Boot> pci enum > U-Boot> pci > Scanning PCI devices on bus 0 > BusDevFun VendorId DeviceId Device Class Sub-Class > _ > 00.00.00 0x14e4 0x2711 Bridge device 0x04 > > > -- > Stefan > > > Note that this builds on top of Sylwester Nawrocki's "USB host support > > for Raspberry Pi 4 board" series. > > > > This also depends on a DT/bindings patch available on the linux-mailing > > lists: > > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2205783.html > > > > Here is the relevant bit for reference/discussion: > > > > &pcie0 { > >pci@1,0 { > >#address-cells = <3>; > >#size-cells = <2>; > >ranges; > > > >reg = <0 0 0 0 0>; > > > >usb@1,0 { > >reg = <0x1 0 0 0 0>; > >resets = <&reset > > RASPBERRYPI_FIRMWARE_RESET_ID_USB>; > >}; > >}; > > }; > > > > --- > > > > Changes since v5: > > - Properly handle !CONFIG_IS_ENABLED(DM_RESET) in xchi code > > > > Changes since v4: > > - Correct DT PCI topology, I separated the root bridge and controller > >DT nodes > > - Get rid of PCI core patch as not needed with correct DT PCI topology > > - Move reset support to xchi core > > > > Changes since v3: > > - Use reset controller > > > > Changes since v2: > > - Correct comment on patch #1 > > - Address Matthias' comments > > > > Changes since v1: > > - Rename function > > - Use callback in xhci-pci.c > > > > Nicolas Saenz Julienne (4): > > arm: rpi: Add function to trigger VL805's firmware load > > reset: Add Raspberry Pi 4 firmware reset controller > > configs: Enable support for reset controllers on RPi4 > > usb: xhci: Add reset controller support > > > > arch/arm/mach-bcm283x/include/mach/mbox.h | 13 > > arch/arm/mach-bcm283x/include/mach/msg.h | 7 +++ > > arch/arm/mach-bcm283x/msg.c | 46 ++ > > configs/rpi_4_32b_defconfig | 1 + > > configs/rpi_4_defconfig | 1 + > > configs/rpi_arm64_defconfig | 1 + > > drivers/reset/Kconfig | 10 > > drivers/reset/Makefile| 1 + > > drivers/reset/reset-raspberrypi.c | 60 +++ > > drivers/usb/host/xhci-mem.c | 2 + > > drivers/usb/host/xhci.c | 33 ++ > > .../reset/raspberrypi,firmware-reset.h| 13 > > include/usb/xhci.h| 2 + > > 13 files changed, 190 insertions(+) > > create mode 100644 drivers/reset/reset-raspberrypi.c > > create mode 100644 include/dt-bindings/reset/raspberrypi,firmware-reset.h signature.asc Des
Re: [PATCH v6 0/4] usb: xhci: Load Raspberry Pi 4 VL805's firmware
Figured that the device tree deployed on the boot partition indeed still had the necessary nodes missing... With that fixed, current master without any further patches detects the USB controller just fine, and I was able to use at least two different USB mass storage device just fine! Sorry for the noise! And thanks for all your work! -- Stefan On 2020-07-19 02:37, Stefan Agner wrote: > Hi Nicolas, > > On 2020-06-29 18:37, Nicolas Saenz Julienne wrote: >> Newer revisions of the RPi4 need their xHCI chip, VL805, firmware to be >> loaded explicitly. Earlier versions didn't need that as they where using >> an EEPROM for that purpose. This series takes care of setting up the >> relevant infrastructure and run the firmware loading routine at the >> right moment. > > I tried using this patchset to boot from a USB mass storage device on > RPi 4 with 8GB RAM. I updated the EEPROM firmware as well as deployed > the latest GPU firmware (start4.elf/fixup4.dat) from the firmware master > branch. I think with that I have new enough/correct versions. > > The RPi 4 successfully boots U-Boot from a mass storage device. However, > U-Boot itself is then not able to access USB. The output always shows > -110 (timeout). It seems that the VL805 controller is not detected on > the PCIe bus. Do you happen to know what I might be missing? > > I tried current master (which has your patchset merged) as well as your > vl805 branch on Github. > > > U-Boot 2020.07-rc4-00036-gdeb48986ee (Jul 19 2020 - 02:29:44 +0200) > > DRAM: 7.9 GiB > RPI 4 Model B (0xd03114) > MMC: mmcnr@7e30: 1, emmc2@7e34: 0 > Loading Environment from FAT... Card did not respond to voltage select! > In:serial > Out: vidconsole > Err: vidconsole > Net: eth0: genet@7d58 > PCIe BRCM: link up, 5.0 Gbps x1 (!SSC) > Device 'pci_0:0.0': seq 0 is in use by 'pcie@7d50' > starting USB... > Bus xhci_pci: probe failed, error -110 > No working controllers found > Hit any key to stop autoboot: 0 > U-Boot> pci enum > U-Boot> pci > Scanning PCI devices on bus 0 > BusDevFun VendorId DeviceId Device Class Sub-Class > _ > 00.00.00 0x14e4 0x2711 Bridge device 0x04 > > > -- > Stefan > >> >> Note that this builds on top of Sylwester Nawrocki's "USB host support >> for Raspberry Pi 4 board" series. >> >> This also depends on a DT/bindings patch available on the linux-mailing >> lists: >> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2205783.html >> >> Here is the relevant bit for reference/discussion: >> >> &pcie0 { >>pci@1,0 { >>#address-cells = <3>; >>#size-cells = <2>; >>ranges; >> >>reg = <0 0 0 0 0>; >> >>usb@1,0 { >>reg = <0x1 0 0 0 0>; >>resets = <&reset >> RASPBERRYPI_FIRMWARE_RESET_ID_USB>; >>}; >>}; >> }; >> >> --- >> >> Changes since v5: >> - Properly handle !CONFIG_IS_ENABLED(DM_RESET) in xchi code >> >> Changes since v4: >> - Correct DT PCI topology, I separated the root bridge and controller >>DT nodes >> - Get rid of PCI core patch as not needed with correct DT PCI topology >> - Move reset support to xchi core >> >> Changes since v3: >> - Use reset controller >> >> Changes since v2: >> - Correct comment on patch #1 >> - Address Matthias' comments >> >> Changes since v1: >> - Rename function >> - Use callback in xhci-pci.c >> >> Nicolas Saenz Julienne (4): >> arm: rpi: Add function to trigger VL805's firmware load >> reset: Add Raspberry Pi 4 firmware reset controller >> configs: Enable support for reset controllers on RPi4 >> usb: xhci: Add reset controller support >> >> arch/arm/mach-bcm283x/include/mach/mbox.h | 13 >> arch/arm/mach-bcm283x/include/mach/msg.h | 7 +++ >> arch/arm/mach-bcm283x/msg.c | 46 ++ >> configs/rpi_4_32b_defconfig | 1 + >> configs/rpi_4_defconfig | 1 + >> configs/rpi_arm64_defconfig | 1 + >> drivers/reset/Kconfig | 10 >> drivers/reset/Makefile| 1 + >> drivers/reset/reset-raspberrypi.c | 60 +++ >> drivers/usb/host/xhci-mem.c | 2 + >> drivers/usb/host/xhci.c | 33 ++ >> .../reset/raspberrypi,firmware-reset.h| 13 >> include/usb/xhci.h| 2 + >> 13 files changed, 190 insertions(+) >> create mode 100644 drivers/reset/reset-raspberrypi.c >> create mode 100644 include/dt-bindings/reset/raspberrypi,firmware-reset.h
Re: rk3399: boot from compressed Image
Hi Kever, Thanks for your reply. I recommend leaving ramdisk_addr_r at the end, like this: https://github.com/amarula/u-boot-amarula/pull/3/files I tested gzip on ROCK Pi 4, and also tested lzma, lzo, bzip2, gzip on QEMU, and they all worked. Regards, Yuanhao On 2020/7/18 下午10:52, Kever Yang wrote: Hi Yuanhao, Thanks for your good suggestion, could you take a try for this: https://patchwork.ozlabs.org/project/uboot/patch/20200718144823.7997-1-kever.y...@rock-chips.com/ Thanks, - Kever On 2020/6/22 上午10:30, Tian Yuanhao wrote: Hello, booti now supports booting from compressed Image. See 414c34ed555b8ce5c260cf641261ecf45beca251. Would you please add kernel_comp_addr_r and kernel_comp_size to rk3399_common.h, so that people can use compressed Image (e.g. Image.gz) in extlinux.conf. Thanks, Yuanhao
Re: [PULL] u-boot-mips
On Sat, Jul 18, 2020 at 05:20:07PM +0200, Daniel Schwierzeck wrote: > Hi Tom, > > please pull MIPS updates for 2020.10. This contains initial but very basic > support for Marvell Octeon MIPS64 SoC's along with some small refactorings > in start.S to prepare for Octeon. > > Gitlab CI: > https://gitlab.denx.de/u-boot/custodians/u-boot-mips/pipelines/4105 > > > The following changes since commit 1c4b5038afcc7cdb1064713f65571da05aa0de0e: > > Merge branch '2020-07-17-misc-fixes' (2020-07-17 16:08:54 -0400) > > are available in the Git repository at: > > g...@gitlab.denx.de:u-boot/custodians/u-boot-mips.git > tags/mips-pull-2020-07-18 > > for you to fetch changes up to 5fef24c912a44a08ab644aa16ceb5a435491f9d9: > > mips: octeon: Add minimal Octeon 3 EBB7304 EVK support (2020-07-18 15:47:50 > +0200) > Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature
[PATCH v4 2/2] sun50i: a64: A64-Teres-I board detect builtin keyboard
A64-Teres-I board is a laptop which comes with a builtin keyboard. The keyboard+trackpad controller pauses for 2 seconds at a firmware prompt before loading its HID interface. U-Boot needs to wait equally long to reliably enable the keyboard. Signed-off-by: Jonas Smedegaard Series-Cc: Jagan Teki Series-Cc: Lukasz Majewski Series-Cc: Andre Przywara --- (no changes since v1) Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) --- configs/teres_i_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/teres_i_defconfig b/configs/teres_i_defconfig index 1eba20e5f5..036068e639 100644 --- a/configs/teres_i_defconfig +++ b/configs/teres_i_defconfig @@ -7,6 +7,7 @@ CONFIG_DRAM_ZQ=3881949 CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_USB1_VBUS_PIN="PL7" CONFIG_I2C0_ENABLE=y +CONFIG_PREBOOT="setenv usb_pgood_delay 2000; usb reset" CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-teres-i" CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y -- 2.28.0.rc1
[PATCH v4 1/2] arm: move CONFIG_PREBOOT="usb start" to KConfig
This commit moves CONFIG_PREBOOT="usb start" to common/KConfig for all boards also declaring USB_KEYBOARD. Besides simplifying defconfig files, this also enables support for board-specific CONFIG_PREBOOT for sunxi boards: commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT. Signed-off-by: Jonas Smedegaard Series-Cc: Jagan Teki Series-Cc: Lukasz Majewski Series-Cc: Andre Przywara --- (no changes since v1) Changes in v4: - generalize to cover all boards, thanks to Jagan Teki Changes in v3: - move default setting to KConfig, thanks to Andre Przywara and Lukasz Majewski Changes in v2: - Rephrase commit message to clarify relationship with KConfig entries --- common/Kconfig| 1 + configs/libretech-ac_defconfig| 1 - configs/libretech-s905d-pc_defconfig | 1 - configs/libretech-s912-pc_defconfig | 1 - configs/pinebook-pro-rk3399_defconfig | 1 - configs/rockpro64-rk3399_defconfig| 1 - configs/rpi_0_w_defconfig | 1 - configs/rpi_2_defconfig | 1 - configs/rpi_3_32b_defconfig | 1 - configs/rpi_3_b_plus_defconfig| 1 - configs/rpi_3_defconfig | 1 - configs/rpi_defconfig | 1 - configs/seaboard_defconfig| 1 - configs/ventana_defconfig | 1 - include/configs/sunxi-common.h| 1 - 15 files changed, 1 insertion(+), 14 deletions(-) diff --git a/common/Kconfig b/common/Kconfig index 67b3818fde..62d78c5bd7 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -403,6 +403,7 @@ config BOOTCOMMAND config USE_PREBOOT bool "Enable preboot" + default "usb start" if USB_KEYBOARD help When this option is enabled, the existence of the environment variable "preboot" will be checked immediately before starting the diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig index d3fc9cb25d..3fb7f36193 100644 --- a/configs/libretech-ac_defconfig +++ b/configs/libretech-ac_defconfig @@ -14,7 +14,6 @@ CONFIG_IDENT_STRING=" libretech-ac" CONFIG_DEBUG_UART=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="usb start" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/libretech-s905d-pc_defconfig b/configs/libretech-s905d-pc_defconfig index 67e52925db..18192ece34 100644 --- a/configs/libretech-s905d-pc_defconfig +++ b/configs/libretech-s905d-pc_defconfig @@ -14,7 +14,6 @@ CONFIG_IDENT_STRING=" libretech-s905d-pc" CONFIG_DEBUG_UART=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="usb start" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_CMD_BDI is not set diff --git a/configs/libretech-s912-pc_defconfig b/configs/libretech-s912-pc_defconfig index 50138aa3ac..6b2c949823 100644 --- a/configs/libretech-s912-pc_defconfig +++ b/configs/libretech-s912-pc_defconfig @@ -13,7 +13,6 @@ CONFIG_IDENT_STRING=" libretech-s912-pc" CONFIG_DEBUG_UART=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="usb start" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_CMD_BDI is not set diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig index e0839286f9..a97e055cbf 100644 --- a/configs/pinebook-pro-rk3399_defconfig +++ b/configs/pinebook-pro-rk3399_defconfig @@ -14,7 +14,6 @@ CONFIG_DEBUG_UART=y CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" CONFIG_BOOTDELAY=3 CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="usb start" CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_BOARDINFO_LATE=y diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig index 31b3ee2aa4..7abd3be3f8 100644 --- a/configs/rockpro64-rk3399_defconfig +++ b/configs/rockpro64-rk3399_defconfig @@ -13,7 +13,6 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEBUG_UART=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="usb start" CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_BOARDINFO_LATE=y diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig index 5053a38822..9bb0046ee0 100644 --- a/configs/rpi_0_w_defconfig +++ b/configs/rpi_0_w_defconfig @@ -8,7 +8,6 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="usb start" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig index a759f1..0ecf2d63e3 100644 --- a/configs/rpi_2_defconfig +++ b/configs/rpi_2_defconfig @@ -8,7 +8,6 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONF
[PATCH] buildman: Allow using older versions of genboardscfg.py
Older versions of this script don't support the -q flag. Since buildman runs this script from when it starts, we may get the old version. Fix this in two ways: 1. Use the version from the same tree as buildman is run from, if available 2. Failing that, allow the -q flag to be missing Signed-off-by: Simon Glass --- tools/buildman/control.py | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 969d866547..838d98a37b 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -203,10 +203,16 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, if not os.path.exists(options.output_dir): os.makedirs(options.output_dir) board_file = os.path.join(options.output_dir, 'boards.cfg') -genboardscfg = os.path.join(options.git, 'tools/genboardscfg.py') +our_path = os.path.dirname(os.path.realpath(__file__)) +genboardscfg = os.path.join(our_path, '../genboardscfg.py') +if not os.path.exists(genboardscfg): +genboardscfg = os.path.join(options.git, 'tools/genboardscfg.py') status = subprocess.call([genboardscfg, '-q', '-o', board_file]) if status != 0: -sys.exit("Failed to generate boards.cfg") +# Older versions don't support -q +status = subprocess.call([genboardscfg, '-o', board_file]) +if status != 0: +sys.exit("Failed to generate boards.cfg") boards = board.Boards() boards.ReadBoards(board_file) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 04/31] mtd: spi-mem: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- drivers/spi/spi-mem.c| 7 ++- drivers/spi/spi-sifive.c | 1 + drivers/spi/stm32_qspi.c | 2 ++ include/spi-mem.h| 5 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index d344701aeb..c095ae9505 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -13,9 +13,14 @@ #include #include "internals.h" #else -#include +#include +#include +#include +#include +#include #include #include +#include #endif #ifndef __UBOOT__ diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c index 0e0ce25abb..c7345d9042 100644 --- a/drivers/spi/spi-sifive.c +++ b/drivers/spi/spi-sifive.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/spi/stm32_qspi.c b/drivers/spi/stm32_qspi.c index 001f0703e3..a53b941410 100644 --- a/drivers/spi/stm32_qspi.c +++ b/drivers/spi/stm32_qspi.c @@ -9,8 +9,10 @@ #include #include +#include #include #include +#include #include #include #include diff --git a/include/spi-mem.h b/include/spi-mem.h index 893f7bd733..ca0f55c8fd 100644 --- a/include/spi-mem.h +++ b/include/spi-mem.h @@ -11,10 +11,7 @@ #ifndef __UBOOT_SPI_MEM_H #define __UBOOT_SPI_MEM_H -#include -#include -#include -#include +struct udevice; #define SPI_MEM_OP_CMD(__opcode, __buswidth) \ { \ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 01/31] spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL
In some cases SPL needs to be able to erase but TPL just needs to read. Allow these to have separate settings for SPI_FLASH_TINY. Signed-off-by: Simon Glass --- common/spl/Kconfig | 10 ++ drivers/mtd/spi/Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index d09e52e88b..c3f063e337 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1496,6 +1496,16 @@ config TPL_SPI_FLASH_SUPPORT Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT for details. +config TPL_SPI_FLASH_TINY + bool "Enable low footprint TPL SPI Flash support" + depends on TPL_SPI_FLASH_SUPPORT && !SPI_FLASH_BAR + default y if SPI_FLASH + help +Enable lightweight TPL SPI Flash support that supports just reading +data/images from flash. No support to write/erase flash. Enable +this if you have TPL size limitations and don't need full-fledged +SPI flash support. + config TPL_SPI_LOAD bool "Support loading from SPI flash" depends on TPL_SPI_FLASH_SUPPORT diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile index 952fd1e45a..99cc418552 100644 --- a/drivers/mtd/spi/Makefile +++ b/drivers/mtd/spi/Makefile @@ -8,7 +8,7 @@ spi-nor-y := sf_probe.o spi-nor-ids.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_SPI_BOOT) += fsl_espi_spl.o -ifeq ($(CONFIG_SPL_SPI_FLASH_TINY),y) +ifeq ($(CONFIG_$(SPL_TPL_)SPI_FLASH_TINY),y) spi-nor-y += spi-nor-tiny.o else spi-nor-y += spi-nor-core.o -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 03/31] wdt: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Also remove the other headers that are not needed, since the inline code was removed in a recent commit: b4d9452c4 ("watchdog: move initr_watchdog() to wdt-uclass.c") Signed-off-by: Simon Glass --- include/wdt.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/wdt.h b/include/wdt.h index d2ccfbc62e..bc242c2eb2 100644 --- a/include/wdt.h +++ b/include/wdt.h @@ -6,9 +6,7 @@ #ifndef _WDT_H_ #define _WDT_H_ -#include -#include -#include +struct udevice; /* * Implement a simple watchdog uclass. Watchdog is basically a timer that -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 05/31] mtd: spi: Drop SPI_XFER_MMAP*
These two defines are no-longer supported. Drop them. Signed-off-by: Simon Glass --- include/spi.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/spi.h b/include/spi.h index 98ba9e796d..ef8c1f6692 100644 --- a/include/spi.h +++ b/include/spi.h @@ -146,8 +146,6 @@ struct spi_slave { #define SPI_XFER_BEGIN BIT(0) /* Assert CS before transfer */ #define SPI_XFER_END BIT(1) /* Deassert CS after transfer */ #define SPI_XFER_ONCE (SPI_XFER_BEGIN | SPI_XFER_END) -#define SPI_XFER_MMAP BIT(2) /* Memory Mapped start */ -#define SPI_XFER_MMAP_END BIT(3) /* Memory Mapped End */ }; /** -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 02/31] mtd: spi-nor: Tidy up error handling / debug code
The -ENODEV error value in spi_nor_read_id() is incorrect since there clearly is a device - it just cannot be supported. Use -ENOMEDIUM instead which has the virtue of being less common. Fix the return value in spi_nor_scan(). Also there are a few printf() statements which should be debug() since they bloat the code with unused strings at present. Fix those while here. Signed-off-by: Simon Glass --- drivers/mtd/spi/sf_probe.c | 2 +- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-tiny.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index 475f6c31db..b959e3453a 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -119,7 +119,7 @@ static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len) struct erase_info instr; if (offset % mtd->erasesize || len % mtd->erasesize) { - printf("SF: Erase offset/length not multiple of erase size\n"); + debug("SF: Erase offset/length not multiple of erase size\n"); return -EINVAL; } diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index fdcd830ce4..0113e70037 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -2470,7 +2470,7 @@ static int spi_nor_init(struct spi_nor *nor) * designer) that this is bad. */ if (nor->flags & SNOR_F_BROKEN_RESET) - printf("enabling reset hack; may not recover from unexpected reboots\n"); + debug("enabling reset hack; may not recover from unexpected reboots\n"); set_4byte(nor, nor->info, 1); } diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index 9f676c649d..fa26ea33c8 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -377,7 +377,7 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) } dev_dbg(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); - return ERR_PTR(-ENODEV); + return ERR_PTR(-EMEDIUMTYPE); } static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len, @@ -733,7 +733,7 @@ int spi_nor_scan(struct spi_nor *nor) info = spi_nor_read_id(nor); if (IS_ERR_OR_NULL(info)) - return -ENOENT; + return PTR_ERR(info); /* Parse the Serial Flash Discoverable Parameters table. */ ret = spi_nor_init_params(nor, info, ¶ms); if (ret) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 08/31] fs: fs-loader: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- drivers/fpga/socfpga_arria10.c | 1 + include/fs_loader.h| 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c index dfd3cbb461..44e1ac54c3 100644 --- a/drivers/fpga/socfpga_arria10.c +++ b/drivers/fpga/socfpga_arria10.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/include/fs_loader.h b/include/fs_loader.h index b728c06fcf..1b3c58086f 100644 --- a/include/fs_loader.h +++ b/include/fs_loader.h @@ -6,7 +6,7 @@ #ifndef _FS_LOADER_H_ #define _FS_LOADER_H_ -#include +struct udevice; /** * struct phandle_part - A place for storing phandle of node and its partition -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 06/31] dm: core: Drop dm.h header file from dm-demo.h
This header file should not be included in other header files. Remove it and add it to the cmd file instead. Signed-off-by: Simon Glass --- cmd/demo.c| 1 + include/dm-demo.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/demo.c b/cmd/demo.c index 9da06f5e4d..f923533f79 100644 --- a/cmd/demo.c +++ b/cmd/demo.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/include/dm-demo.h b/include/dm-demo.h index c9a82c7e52..7b6d0d80ff 100644 --- a/include/dm-demo.h +++ b/include/dm-demo.h @@ -6,8 +6,6 @@ #ifndef __DM_DEMO_H #define __DM_DEMO_H -#include - /** * struct dm_demo_pdata - configuration data for demo instance * -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 09/31] net: Drop dm.h header file from phy.h
This header file should not be included in other header files. Remove it and use other headers and C inclusions instead. Signed-off-by: Simon Glass --- cmd/mdio.c | 1 + cmd/mii.c | 1 + include/dm/read.h | 1 + include/phy.h | 9 ++--- include/phy_interface.h | 2 ++ net/eth_legacy.c| 1 + 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/mdio.c b/cmd/mdio.c index c48bb51237..cfa45ad12a 100644 --- a/cmd/mdio.c +++ b/cmd/mdio.c @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/cmd/mii.c b/cmd/mii.c index b52a55dc33..fe8602eb7c 100644 --- a/cmd/mii.c +++ b/cmd/mii.c @@ -10,6 +10,7 @@ #include #include +#include #include typedef struct _MII_field_desc_t { diff --git a/include/dm/read.h b/include/dm/read.h index f02ec95954..5c34a0ffab 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -9,6 +9,7 @@ #ifndef _DM_READ_H #define _DM_READ_H +#include #include #include #include diff --git a/include/phy.h b/include/phy.h index fedd146091..1dbbf65111 100644 --- a/include/phy.h +++ b/include/phy.h @@ -9,14 +9,17 @@ #ifndef _PHY_H #define _PHY_H -#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include + +struct udevice; #define PHY_FIXED_ID 0xa5a55a5a #define PHY_NCSI_ID0xbeefcafe diff --git a/include/phy_interface.h b/include/phy_interface.h index 882e4af8ff..841ade311e 100644 --- a/include/phy_interface.h +++ b/include/phy_interface.h @@ -10,6 +10,8 @@ #ifndef _PHY_INTERFACE_H #define _PHY_INTERFACE_H +#include + typedef enum { PHY_INTERFACE_MODE_MII, PHY_INTERFACE_MODE_GMII, diff --git a/net/eth_legacy.c b/net/eth_legacy.c index 340469ba3a..992d1880bf 100644 --- a/net/eth_legacy.c +++ b/net/eth_legacy.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 10/31] sf: Drop dm.h header file from spi_flash.h
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- arch/arm/mach-k3/sysfw-loader.c| 1 + arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c | 1 + arch/x86/cpu/ivybridge/sdram.c | 1 + board/st/common/stm32mp_dfu.c | 1 + include/spi_flash.h| 3 ++- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c index 513be09c68..96be069ee8 100644 --- a/arch/arm/mach-k3/sysfw-loader.c +++ b/arch/arm/mach-k3/sysfw-loader.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c index 70940f01f3..8aad4be467 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/arch/x86/cpu/ivybridge/sdram.c b/arch/x86/cpu/ivybridge/sdram.c index 99bc48021e..dd6b8753de 100644 --- a/arch/x86/cpu/ivybridge/sdram.c +++ b/arch/x86/cpu/ivybridge/sdram.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index 0cda9196f9..38eb0f27c9 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/include/spi_flash.h b/include/spi_flash.h index b336619487..85cae32cc7 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -9,10 +9,11 @@ #ifndef _SPI_FLASH_H_ #define _SPI_FLASH_H_ -#include /* Because we dereference struct udevice here */ #include #include +struct udevice; + /* by default ENV use the same parameters than SF command */ #ifndef CONFIG_ENV_SPI_BUS # define CONFIG_ENV_SPI_BUSCONFIG_SF_DEFAULT_BUS -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 12/31] w1: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- board/atmel/common/board.c | 1 + cmd/w1.c | 1 + include/w1.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/board/atmel/common/board.c b/board/atmel/common/board.c index c41706c400..eee5c357bd 100644 --- a/board/atmel/common/board.c +++ b/board/atmel/common/board.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/cmd/w1.c b/cmd/w1.c index 92be1f2531..459094bf80 100644 --- a/cmd/w1.c +++ b/cmd/w1.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include #include diff --git a/include/w1.h b/include/w1.h index b958b1c92c..77f439e587 100644 --- a/include/w1.h +++ b/include/w1.h @@ -8,7 +8,7 @@ #ifndef __W1_H #define __W1_H -#include +struct udevice; #define W1_FAMILY_DS24B33 0x23 #define W1_FAMILY_DS2431 0x2d -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 11/31] thermal: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- arch/arm/mach-imx/cpu.c | 1 + include/thermal.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 694c26d35f..fe8d5947cc 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/include/thermal.h b/include/thermal.h index 11d75256e0..52a3317fd5 100644 --- a/include/thermal.h +++ b/include/thermal.h @@ -7,7 +7,7 @@ #ifndef _THERMAL_H_ #define _THERMAL_H_ -#include +struct udevice; int thermal_get_temp(struct udevice *dev, int *temp); -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 17/31] ti: am654: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate. Signed-off-by: Simon Glass --- drivers/ram/k3-am654-ddrss.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/ram/k3-am654-ddrss.c b/drivers/ram/k3-am654-ddrss.c index 8bbd8cfa83..21e5a65529 100644 --- a/drivers/ram/k3-am654-ddrss.c +++ b/drivers/ram/k3-am654-ddrss.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 07/31] dm: core: Drop header files from dm/test.h
These header file should not be included in other header files. Remove them and add to each individual file. Add test/test.h to test/ui.h since that is a reasonable place. Signed-off-by: Simon Glass --- include/dm/test.h | 3 --- include/test/ut.h | 1 + test/dm/adc.c | 1 + test/dm/audio.c| 1 + test/dm/axi.c | 3 ++- test/dm/blk.c | 1 + test/dm/board.c| 1 + test/dm/bootcount.c| 1 + test/dm/bus.c | 1 + test/dm/clk.c | 1 + test/dm/clk_ccf.c | 1 + test/dm/core.c | 1 + test/dm/cpu.c | 1 + test/dm/dma.c | 1 + test/dm/dsi_host.c | 1 + test/dm/eth.c | 3 ++- test/dm/firmware.c | 1 + test/dm/gpio.c | 3 ++- test/dm/hwspinlock.c | 1 + test/dm/i2c.c | 1 + test/dm/i2s.c | 3 ++- test/dm/led.c | 1 + test/dm/mailbox.c | 1 + test/dm/mdio.c | 5 +++-- test/dm/mdio_mux.c | 5 +++-- test/dm/misc.c | 1 + test/dm/mmc.c | 1 + test/dm/nop.c | 1 + test/dm/ofnode.c | 1 + test/dm/osd.c | 5 +++-- test/dm/panel.c| 3 ++- test/dm/pch.c | 1 + test/dm/pci.c | 1 + test/dm/pci_ep.c | 5 +++-- test/dm/phy.c | 1 + test/dm/pmic.c | 5 +++-- test/dm/power-domain.c | 1 + test/dm/pwm.c | 1 + test/dm/ram.c | 1 + test/dm/regmap.c | 1 + test/dm/regulator.c| 1 + test/dm/remoteproc.c | 2 ++ test/dm/reset.c| 1 + test/dm/rtc.c | 1 + test/dm/serial.c | 1 + test/dm/sf.c | 1 + test/dm/smem.c | 1 + test/dm/sound.c| 1 + test/dm/spi.c | 1 + test/dm/spmi.c | 1 + test/dm/syscon.c | 1 + test/dm/sysreset.c | 1 + test/dm/tee.c | 1 + test/dm/test-driver.c | 3 ++- test/dm/test-fdt.c | 1 + test/dm/test-main.c| 2 ++ test/dm/test-uclass.c | 1 + test/dm/timer.c| 1 + test/dm/usb.c | 1 + test/dm/video.c| 1 + test/dm/virtio.c | 3 ++- test/dm/wdt.c | 1 + test/lib/lmb.c | 2 ++ 63 files changed, 82 insertions(+), 20 deletions(-) diff --git a/include/dm/test.h b/include/dm/test.h index d39686cde2..2c92d41278 100644 --- a/include/dm/test.h +++ b/include/dm/test.h @@ -6,9 +6,6 @@ #ifndef __DM_TEST_H #define __DM_TEST_H -#include -#include - /** * struct dm_test_cdata - configuration data for test instance * diff --git a/include/test/ut.h b/include/test/ut.h index 99bbb1230c..6ab2f8830d 100644 --- a/include/test/ut.h +++ b/include/test/ut.h @@ -11,6 +11,7 @@ #include #include #include +#include struct unit_test_state; diff --git a/test/dm/adc.c b/test/dm/adc.c index da7bd4bf1f..7fa1d48dd9 100644 --- a/test/dm/adc.c +++ b/test/dm/adc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include static int dm_test_adc_bind(struct unit_test_state *uts) diff --git a/test/dm/audio.c b/test/dm/audio.c index 77c3a3625b..4bb86e3214 100644 --- a/test/dm/audio.c +++ b/test/dm/audio.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/test/dm/axi.c b/test/dm/axi.c index e1155a51dd..5b1bbab0b8 100644 --- a/test/dm/axi.c +++ b/test/dm/axi.c @@ -8,9 +8,10 @@ #include #include #include +#include #include +#include #include -#include /* Test that sandbox AXI works correctly */ static int dm_test_axi_base(struct unit_test_state *uts) diff --git a/test/dm/blk.c b/test/dm/blk.c index 94b2855b8e..80d671e561 100644 --- a/test/dm/blk.c +++ b/test/dm/blk.c @@ -9,6 +9,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/board.c b/test/dm/board.c index 5472c65fad..ff50d6c38b 100644 --- a/test/dm/board.c +++ b/test/dm/board.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "../../drivers/board/sandbox.h" diff --git a/test/dm/bootcount.c b/test/dm/bootcount.c index be0c278907..9fd3751ef7 100644 --- a/test/dm/bootcount.c +++ b/test/dm/bootcount.c @@ -9,6 +9,7 @@ #include #include #include +#include #include static int dm_test_bootcount(struct unit_test_state *uts) diff --git a/test/dm/bus.c b/test/dm/bus.c index 73eb3aede3..0707267361 100644 --- a/test/dm/bus.c +++ b/test/dm/bus.c @@ -14,6 +14,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/test/dm/clk.c b/test/dm/clk.c index 48fc3dd714..7a39760f25 100644 --- a/test/dm/clk.c +++ b/test/dm/clk.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* Base test of the clk uclass */ diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index ae3a4d8a76..da2292a51a 100644 --- a/test/dm/clk_ccf.c +++ b/test/dm/clk_ccf.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/test/dm/core.c b/test/dm/core.c index 6a930ae31a..7ca0355d8e 100644 --- a/test/dm/
[PATCH 15/31] mmc: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate. Signed-off-by: Simon Glass --- drivers/mmc/sdhci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index f4eb655f6e..ff871f8252 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 16/31] spi: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate. Signed-off-by: Simon Glass --- drivers/spi/mscc_bb_spi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/spi/mscc_bb_spi.c b/drivers/spi/mscc_bb_spi.c index 0454410ee9..e77447b655 100644 --- a/drivers/spi/mscc_bb_spi.c +++ b/drivers/spi/mscc_bb_spi.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 13/31] efi: Tidy up header includes
Two files relies on efi_driver.h to include common.h and dm.h which is incorrect. The former should always be included in a non-host C file and the latter should be included if driver model is used. Signed-off-by: Simon Glass --- include/efi_driver.h | 2 -- lib/efi_driver/efi_block_device.c | 1 + lib/efi_driver/efi_uclass.c | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/efi_driver.h b/include/efi_driver.h index 840483a416..2b62219c5b 100644 --- a/include/efi_driver.h +++ b/include/efi_driver.h @@ -8,8 +8,6 @@ #ifndef _EFI_DRIVER_H #define _EFI_DRIVER_H 1 -#include -#include #include /* diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index e7d8745ad8..0e72a68bce 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c index 04e4e45734..0cf74b0361 100644 --- a/lib/efi_driver/efi_uclass.c +++ b/lib/efi_driver/efi_uclass.c @@ -17,6 +17,8 @@ * controllers. */ +#include +#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 19/31] pci: Drop dm.h inclusion from header file
The layerscape header should not include dm.h so remove it. Signed-off-by: Simon Glass --- drivers/pci/pcie_layerscape.h| 1 - drivers/pci/pcie_layerscape_fixup.c | 1 + drivers/pci/pcie_layerscape_gen4.h | 1 - drivers/pci/pcie_layerscape_gen4_fixup.c | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie_layerscape.h b/drivers/pci/pcie_layerscape.h index 95454bc188..ffbafbba51 100644 --- a/drivers/pci/pcie_layerscape.h +++ b/drivers/pci/pcie_layerscape.h @@ -8,7 +8,6 @@ #ifndef _PCIE_LAYERSCAPE_H_ #define _PCIE_LAYERSCAPE_H_ #include -#include #ifndef CONFIG_SYS_PCI_MEMORY_BUS #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE diff --git a/drivers/pci/pcie_layerscape_fixup.c b/drivers/pci/pcie_layerscape_fixup.c index 76e680481a..5528df4db1 100644 --- a/drivers/pci/pcie_layerscape_fixup.c +++ b/drivers/pci/pcie_layerscape_fixup.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include diff --git a/drivers/pci/pcie_layerscape_gen4.h b/drivers/pci/pcie_layerscape_gen4.h index d298a2b810..483eb538b5 100644 --- a/drivers/pci/pcie_layerscape_gen4.h +++ b/drivers/pci/pcie_layerscape_gen4.h @@ -9,7 +9,6 @@ #ifndef _PCIE_LAYERSCAPE_GEN4_H_ #define _PCIE_LAYERSCAPE_GEN4_H_ #include -#include #include #ifndef CONFIG_SYS_PCI_MEMORY_SIZE diff --git a/drivers/pci/pcie_layerscape_gen4_fixup.c b/drivers/pci/pcie_layerscape_gen4_fixup.c index 375ce45839..148b5d17ed 100644 --- a/drivers/pci/pcie_layerscape_gen4_fixup.c +++ b/drivers/pci/pcie_layerscape_gen4_fixup.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 21/31] mscc: Drop dm.h header file
This header file should not be included in other header files. Remove it from each one and use a forward declaration instead. Signed-off-by: Simon Glass --- arch/mips/mach-mscc/include/mach/jr2/jr2.h | 3 --- arch/mips/mach-mscc/include/mach/luton/luton.h | 3 --- arch/mips/mach-mscc/include/mach/ocelot/ocelot.h | 3 --- arch/mips/mach-mscc/include/mach/serval/serval.h | 3 --- arch/mips/mach-mscc/include/mach/servalt/servalt.h | 3 --- board/mscc/servalt/servalt.c | 2 ++ 6 files changed, 2 insertions(+), 15 deletions(-) diff --git a/arch/mips/mach-mscc/include/mach/jr2/jr2.h b/arch/mips/mach-mscc/include/mach/jr2/jr2.h index 67244f63fa..3a779e7035 100644 --- a/arch/mips/mach-mscc/include/mach/jr2/jr2.h +++ b/arch/mips/mach-mscc/include/mach/jr2/jr2.h @@ -8,9 +8,6 @@ #ifndef _MSCC_JR2_H_ #define _MSCC_JR2_H_ -#include -#include - /* * Target offset base(s) */ diff --git a/arch/mips/mach-mscc/include/mach/luton/luton.h b/arch/mips/mach-mscc/include/mach/luton/luton.h index 19f02ede66..dda665fc15 100644 --- a/arch/mips/mach-mscc/include/mach/luton/luton.h +++ b/arch/mips/mach-mscc/include/mach/luton/luton.h @@ -8,9 +8,6 @@ #ifndef _MSCC_OCELOT_H_ #define _MSCC_OCELOT_H_ -#include -#include - /* * Target offset base(s) */ diff --git a/arch/mips/mach-mscc/include/mach/ocelot/ocelot.h b/arch/mips/mach-mscc/include/mach/ocelot/ocelot.h index 2cb2135d37..72b07c33cd 100644 --- a/arch/mips/mach-mscc/include/mach/ocelot/ocelot.h +++ b/arch/mips/mach-mscc/include/mach/ocelot/ocelot.h @@ -8,9 +8,6 @@ #ifndef _MSCC_OCELOT_H_ #define _MSCC_OCELOT_H_ -#include -#include - /* * Target offset base(s) */ diff --git a/arch/mips/mach-mscc/include/mach/serval/serval.h b/arch/mips/mach-mscc/include/mach/serval/serval.h index 763d18fe62..a78c6e59bb 100644 --- a/arch/mips/mach-mscc/include/mach/serval/serval.h +++ b/arch/mips/mach-mscc/include/mach/serval/serval.h @@ -8,9 +8,6 @@ #ifndef _MSCC_SERVAL_H_ #define _MSCC_SERVAL_H_ -#include -#include - /* * Target offset base(s) */ diff --git a/arch/mips/mach-mscc/include/mach/servalt/servalt.h b/arch/mips/mach-mscc/include/mach/servalt/servalt.h index 9015bc7dad..4d7d0886dd 100644 --- a/arch/mips/mach-mscc/include/mach/servalt/servalt.h +++ b/arch/mips/mach-mscc/include/mach/servalt/servalt.h @@ -8,9 +8,6 @@ #ifndef _MSCC_SERVALT_H_ #define _MSCC_SERVALT_H_ -#include -#include - /* * Target offset base(s) */ diff --git a/board/mscc/servalt/servalt.c b/board/mscc/servalt/servalt.c index d0e6016b9a..879f5de506 100644 --- a/board/mscc/servalt/servalt.c +++ b/board/mscc/servalt/servalt.c @@ -9,6 +9,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + enum { BOARD_TYPE_PCB116 = 0xAABBCE00, }; -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 14/31] power: Tidy up inclusion of regulator_common.h
This file should not include common.h and dm.h so remove them. Also move the inclusion of this file to after the normal includes. Signed-off-by: Simon Glass --- drivers/power/regulator/fixed.c| 3 ++- drivers/power/regulator/gpio-regulator.c | 3 ++- drivers/power/regulator/regulator_common.c | 4 +++- drivers/power/regulator/regulator_common.h | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c index b5f7aec353..2fa6c7e6b2 100644 --- a/drivers/power/regulator/fixed.c +++ b/drivers/power/regulator/fixed.c @@ -5,7 +5,6 @@ * Przemyslaw Marczak */ -#include "regulator_common.h" #include #include #include @@ -13,6 +12,8 @@ #include #include +#include "regulator_common.h" + static int fixed_regulator_ofdata_to_platdata(struct udevice *dev) { struct dm_regulator_uclass_platdata *uc_pdata; diff --git a/drivers/power/regulator/gpio-regulator.c b/drivers/power/regulator/gpio-regulator.c index cf3fbae79d..947f812d09 100644 --- a/drivers/power/regulator/gpio-regulator.c +++ b/drivers/power/regulator/gpio-regulator.c @@ -4,7 +4,6 @@ * Keerthy */ -#include "regulator_common.h" #include #include #include @@ -15,6 +14,8 @@ #include #include +#include "regulator_common.h" + #define GPIO_REGULATOR_MAX_STATES 2 DECLARE_GLOBAL_DATA_PTR; diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c index 4cfcc31298..13906b9c6e 100644 --- a/drivers/power/regulator/regulator_common.c +++ b/drivers/power/regulator/regulator_common.c @@ -4,12 +4,14 @@ * Sven Schwermer */ -#include "regulator_common.h" #include +#include #include #include #include +#include "regulator_common.h" + int regulator_common_ofdata_to_platdata(struct udevice *dev, struct regulator_common_platdata *dev_pdata, const char *enable_gpio_name) { diff --git a/drivers/power/regulator/regulator_common.h b/drivers/power/regulator/regulator_common.h index 18a525880a..bf80439c78 100644 --- a/drivers/power/regulator/regulator_common.h +++ b/drivers/power/regulator/regulator_common.h @@ -7,9 +7,7 @@ #ifndef _REGULATOR_COMMON_H #define _REGULATOR_COMMON_H -#include #include -#include struct regulator_common_platdata { struct gpio_desc gpio; /* GPIO for regulator enable control */ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 20/31] mediatek: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- arch/arm/include/asm/arch-mediatek/reset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-mediatek/reset.h b/arch/arm/include/asm/arch-mediatek/reset.h index 9704666d24..4ba0bad94e 100644 --- a/arch/arm/include/asm/arch-mediatek/reset.h +++ b/arch/arm/include/asm/arch-mediatek/reset.h @@ -6,7 +6,7 @@ #ifndef __MEDIATEK_RESET_H #define __MEDIATEK_RESET_H -#include +struct udevice; int mediatek_reset_bind(struct udevice *pdev, u32 regofs, u32 num_regs); -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 18/31] liebherr: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate. Signed-off-by: Simon Glass --- board/liebherr/display5/display5.c | 1 - 1 file changed, 1 deletion(-) diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c index ada7cf5eb7..5f44714301 100644 --- a/board/liebherr/display5/display5.c +++ b/board/liebherr/display5/display5.c @@ -27,7 +27,6 @@ #include #include -#include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 24/31] ufs: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Also drop asm/io.h Signed-off-by: Simon Glass --- drivers/ufs/cdns-platform.c | 1 + drivers/ufs/ufs.c | 3 ++- drivers/ufs/ufs.h | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/ufs/cdns-platform.c b/drivers/ufs/cdns-platform.c index 1a7bb7bed8..bad1bf7de5 100644 --- a/drivers/ufs/cdns-platform.c +++ b/drivers/ufs/cdns-platform.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index 87b4e5fc56..92b7e9fd7c 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -19,9 +19,10 @@ #include #include #include +#include +#include #include #include - #include #include "ufs.h" diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index e0bde93776..069888fdd9 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -2,11 +2,10 @@ #ifndef __UFS_H #define __UFS_H -#include -#include - #include "unipro.h" +struct udevice; + #define UFS_CDB_SIZE 16 #define UPIU_TRANSACTION_UIC_CMD 0x1F #define UIC_CMD_SIZE (sizeof(u32) * 4) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 23/31] nand: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c | 1 + drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c b/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c index c58679834e..a6acf556bc 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include +#include #include #include #include "brcmnand_compat.h" diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h b/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h index 6f9bec7085..52711d4978 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h @@ -3,8 +3,8 @@ #ifndef __BRCMNAND_COMPAT_H #define __BRCMNAND_COMPAT_H -#include -#include +struct clk; +struct udevice; char *devm_kasprintf(struct udevice *dev, gfp_t gfp, const char *fmt, ...); -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 26/31] clk: Drop dm.h header file in clk-provider.h
This header file should not be included in other header files. Remove it and use a forward declaration and un-inlining of dev_get_clk_ptr() instead. Fix up the kendryte header files to avoid build errors. Signed-off-by: Simon Glass --- drivers/clk/clk-uclass.c | 5 + drivers/clk/kendryte/bypass.c | 7 +-- drivers/clk/kendryte/pll.c| 10 ++ include/kendryte/bypass.h | 2 +- include/linux/clk-provider.h | 8 +++- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 15656f5973..934cd5787a 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -25,6 +25,11 @@ static inline const struct clk_ops *clk_dev_ops(struct udevice *dev) return (const struct clk_ops *)dev->driver->ops; } +struct clk *dev_get_clk_ptr(struct udevice *dev) +{ + return (struct clk *)dev_get_uclass_priv(dev); +} + #if CONFIG_IS_ENABLED(OF_CONTROL) # if CONFIG_IS_ENABLED(OF_PLATDATA) int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells, diff --git a/drivers/clk/kendryte/bypass.c b/drivers/clk/kendryte/bypass.c index d1fd28175b..5f1986f2cb 100644 --- a/drivers/clk/kendryte/bypass.c +++ b/drivers/clk/kendryte/bypass.c @@ -4,12 +4,15 @@ */ #define LOG_CATEGORY UCLASS_CLK -#include +#include +#include #include +#include +#include +#include #include #include -#include #define CLK_K210_BYPASS "k210_clk_bypass" diff --git a/drivers/clk/kendryte/pll.c b/drivers/clk/kendryte/pll.c index 19e358856a..ab6d75d585 100644 --- a/drivers/clk/kendryte/pll.c +++ b/drivers/clk/kendryte/pll.c @@ -3,18 +3,20 @@ * Copyright (C) 2019-20 Sean Anderson */ #define LOG_CATEGORY UCLASS_CLK -#include -#include +#include +#include /* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */ #include +#include +#include +#include #include +#include #include #include #include #include -#include -#include #define CLK_K210_PLL "k210_clk_pll" diff --git a/include/kendryte/bypass.h b/include/kendryte/bypass.h index a081cbd12f..ab85bbcbfc 100644 --- a/include/kendryte/bypass.h +++ b/include/kendryte/bypass.h @@ -5,7 +5,7 @@ #ifndef K210_BYPASS_H #define K210_BYPASS_H -#include +struct clk; struct k210_bypass { struct clk clk; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 8a20743ad8..79dce8f0ad 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -9,12 +9,13 @@ #ifndef __LINUX_CLK_PROVIDER_H #define __LINUX_CLK_PROVIDER_H -#include #include #include #include #include +struct udevice; + static inline void clk_dm(ulong id, struct clk *clk) { if (!IS_ERR(clk)) @@ -188,8 +189,5 @@ struct clk *clk_register_mux(struct device *dev, const char *name, const char *clk_hw_get_name(const struct clk *hw); ulong clk_generic_get_rate(struct clk *clk); -static inline struct clk *dev_get_clk_ptr(struct udevice *dev) -{ - return (struct clk *)dev_get_uclass_priv(dev); -} +struct clk *dev_get_clk_ptr(struct udevice *dev); #endif /* __LINUX_CLK_PROVIDER_H */ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 29/31] dm: core: Guard against including dm.h in header files
Header files generally should not include header files just for a struct, since forward declarations work just as well and reduce overhead. Add a warning for dm.h being included, since this has crept into U-Boot. Signed-off-by: Simon Glass --- include/dm.h | 4 1 file changed, 4 insertions(+) diff --git a/include/dm.h b/include/dm.h index 2e1afda440..a1b84169e6 100644 --- a/include/dm.h +++ b/include/dm.h @@ -3,6 +3,10 @@ * Copyright (c) 2013 Google, Inc */ +#ifdef _DM_H_ +#warning "Suspect dm.h is included from a header file - please fix" +#endif + #ifndef _DM_H_ #define _DM_H_ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 22/31] adc: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Drop the common.h inclusion also. Signed-off-by: Simon Glass --- drivers/adc/stm32-adc-core.c | 1 + drivers/adc/stm32-adc-core.h | 4 ++-- drivers/adc/stm32-adc.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/adc/stm32-adc-core.c b/drivers/adc/stm32-adc-core.c index 31bbb6f9d6..f20c46fb36 100644 --- a/drivers/adc/stm32-adc-core.c +++ b/drivers/adc/stm32-adc-core.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/drivers/adc/stm32-adc-core.h b/drivers/adc/stm32-adc-core.h index ba0e10e6cc..05968dbcc8 100644 --- a/drivers/adc/stm32-adc-core.h +++ b/drivers/adc/stm32-adc-core.h @@ -26,9 +26,9 @@ #define STM32_ADC_MAX_ADCS 3 #define STM32_ADCX_COMN_OFFSET 0x300 -#include #include -#include + +struct udevice; /** * struct stm32_adc_common - stm32 ADC driver common data (for all instances) diff --git a/drivers/adc/stm32-adc.c b/drivers/adc/stm32-adc.c index b12f894a9b..3f0ed48846 100644 --- a/drivers/adc/stm32-adc.c +++ b/drivers/adc/stm32-adc.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 31/31] checkpatch: Don't allow common.h and dm.h in headers
These headers should not be included in other header files. Add a checkpatch rule and test for this. Signed-off-by: Simon Glass --- scripts/checkpatch.pl | 10 -- tools/patman/test_checkpatch.py | 7 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 238f12cb46..3932362dba 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2322,7 +2322,7 @@ sub get_raw_comment { # Checks specific to U-Boot sub u_boot_line { - my ($realfile, $line, $herecurr) = @_; + my ($realfile, $line, $rawline, $herecurr) = @_; # ask for a test if a new uclass ID is added if ($realfile =~ /uclass-id.h/ && $line =~ /^\+/) { @@ -2353,6 +2353,12 @@ sub u_boot_line { ERROR("DEFINE_CONFIG_CMD", "All commands are managed by Kconfig\n" . $herecurr); } + + # Don't put common.h and dm.h in header files + if ($realfile =~ /\.h$/ && $rawline =~ /^\+#include\s*<(common|dm)\.h>*/) { + ERROR("BARRED_INCLUDE_IN_HDR", + "Avoid including common.h and dm.h in header files\n" . $herecurr); + } } sub process { @@ -3296,7 +3302,7 @@ sub process { } if ($u_boot) { - u_boot_line($realfile, $line, $herecurr); + u_boot_line($realfile, $line, $rawline, $herecurr); } # check we are in a valid source file C or perl if not then ignore this hunk diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py index 9d233f99ae..792196e689 100644 --- a/tools/patman/test_checkpatch.py +++ b/tools/patman/test_checkpatch.py @@ -398,6 +398,13 @@ index 000..2234c87 pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error') +def testBarredIncludeInHdr(self): +"""Test for using a barred include in a header file""" +pm = PatchMaker() +#pm.add_line('include/myfile.h', '#include ') +pm.add_line('include/myfile.h', '#include ') +self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error') + if __name__ == "__main__": unittest.main() -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 27/31] net: Drop dm.h header file in eth_phy.h
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass --- include/eth_phy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/eth_phy.h b/include/eth_phy.h index 19c496551b..be6c881527 100644 --- a/include/eth_phy.h +++ b/include/eth_phy.h @@ -6,9 +6,10 @@ #ifndef _eth_phy_h_ #define _eth_phy_h_ -#include #include +struct udevice; + int eth_phy_binds_nodes(struct udevice *eth_dev); int eth_phy_set_mdio_bus(struct udevice *eth_dev, struct mii_dev *mdio_bus); struct mii_dev *eth_phy_get_mdio_bus(struct udevice *eth_dev); -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 30/31] patman: Fix up the test comments
Many of the tests have the same comment and two have the same name. Fix this. Signed-off-by: Simon Glass --- tools/patman/test_checkpatch.py | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py index c9580adb54..9d233f99ae 100644 --- a/tools/patman/test_checkpatch.py +++ b/tools/patman/test_checkpatch.py @@ -373,19 +373,19 @@ index 000..2234c87 self.checkSingleMessage(pm, 'NEW_UCLASS') def testLivetree(self): -"""Test for Use the livetree API""" +"""Test for using the livetree API""" pm = PatchMaker() pm.add_line('common/main.c', 'fdtdec_do_something()') self.checkSingleMessage(pm, 'LIVETREE') def testNewCommand(self): -"""Test for Use the livetree API""" +"""Test for adding a new command""" pm = PatchMaker() pm.add_line('common/main.c', 'do_wibble(struct cmd_tbl *cmd_tbl)') self.checkSingleMessage(pm, 'CMD_TEST') -def testNewCommand(self): -"""Test for Use the livetree API""" +def testPreferIf(self): +"""Test for using #ifdef""" pm = PatchMaker() pm.add_line('common/main.c', '#ifdef CONFIG_YELLOW') pm.add_line('common/init.h', '#ifdef CONFIG_YELLOW') @@ -393,7 +393,7 @@ index 000..2234c87 self.checkSingleMessage(pm, "PREFER_IF") def testCommandUseDefconfig(self): -"""Test for Use the livetree API""" +"""Test for enabling/disabling commands using preprocesor""" pm = PatchMaker() pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error') -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 28/31] net: Drop duplicate include of dm.h in pcnet.c
This file includes the header twice. Drop the second one. Signed-off-by: Simon Glass --- drivers/net/pcnet.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c index 559560860b..ad5ac6618f 100644 --- a/drivers/net/pcnet.c +++ b/drivers/net/pcnet.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 25/31] usb: Drop dm.h header file
This header file should not be included in other header files. Remove it and use a forward declaration instead. Also move the inline function out into a C file. We should not include C code in headers. Signed-off-by: Simon Glass --- drivers/usb/musb-new/musb_uboot.c | 37 + drivers/usb/musb-new/pic32.c | 1 + drivers/usb/musb-new/usb-compat.h | 45 +++ 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c index 988071a61d..8ac2f0a78a 100644 --- a/drivers/usb/musb-new/musb_uboot.c +++ b/drivers/usb/musb-new/musb_uboot.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -452,3 +453,39 @@ struct musb *musb_register(struct musb_hdrc_platform_data *plat, void *bdata, return *musbp; } + +#if CONFIG_IS_ENABLED(DM_USB) +struct usb_device *usb_dev_get_parent(struct usb_device *udev) +{ + struct udevice *parent = udev->dev->parent; + + /* +* When called from usb-uclass.c: usb_scan_device() udev->dev points +* to the parent udevice, not the actual udevice belonging to the +* udev as the device is not instantiated yet. +* +* If dev is an usb-bus, then we are called from usb_scan_device() for +* an usb-device plugged directly into the root port, return NULL. +*/ + if (device_get_uclass_id(udev->dev) == UCLASS_USB) + return NULL; + + /* +* If these 2 are not the same we are being called from +* usb_scan_device() and udev itself is the parent. +*/ + if (dev_get_parent_priv(udev->dev) != udev) + return udev; + + /* We are being called normally, use the parent pointer */ + if (device_get_uclass_id(parent) == UCLASS_USB_HUB) + return dev_get_parent_priv(parent); + + return NULL; +} +#else +struct usb_device *usb_dev_get_parent(struct usb_device *udev) +{ + return udev->parent; +} +#endif diff --git a/drivers/usb/musb-new/pic32.c b/drivers/usb/musb-new/pic32.c index 74a841af46..2fbe9bebf1 100644 --- a/drivers/usb/musb-new/pic32.c +++ b/drivers/usb/musb-new/pic32.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/drivers/usb/musb-new/usb-compat.h b/drivers/usb/musb-new/usb-compat.h index f2c18ad3a2..1c66c4fe36 100644 --- a/drivers/usb/musb-new/usb-compat.h +++ b/drivers/usb/musb-new/usb-compat.h @@ -1,9 +1,10 @@ #ifndef __USB_COMPAT_H__ #define __USB_COMPAT_H__ -#include #include "usb.h" +struct udevice; + struct usb_hcd { void *hcd_priv; }; @@ -67,40 +68,12 @@ static inline int usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd, return 0; } -#if CONFIG_IS_ENABLED(DM_USB) -static inline struct usb_device *usb_dev_get_parent(struct usb_device *udev) -{ - struct udevice *parent = udev->dev->parent; - - /* -* When called from usb-uclass.c: usb_scan_device() udev->dev points -* to the parent udevice, not the actual udevice belonging to the -* udev as the device is not instantiated yet. -* -* If dev is an usb-bus, then we are called from usb_scan_device() for -* an usb-device plugged directly into the root port, return NULL. -*/ - if (device_get_uclass_id(udev->dev) == UCLASS_USB) - return NULL; - - /* -* If these 2 are not the same we are being called from -* usb_scan_device() and udev itself is the parent. -*/ - if (dev_get_parent_priv(udev->dev) != udev) - return udev; - - /* We are being called normally, use the parent pointer */ - if (device_get_uclass_id(parent) == UCLASS_USB_HUB) - return dev_get_parent_priv(parent); - - return NULL; -} -#else -static inline struct usb_device *usb_dev_get_parent(struct usb_device *dev) -{ - return dev->parent; -} -#endif +/** + * usb_dev_get_parent() - Get the parent of a USB device + * + * @udev: USB struct containing information about the device + * @return associated device for which udev == dev_get_parent_priv(dev) + */ +struct usb_device *usb_dev_get_parent(struct usb_device *udev); #endif /* __USB_COMPAT_H__ */ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH 00/31] dm: Avoid including dm.h in header files
At present a small number of header files include the dm.h header file. The intent with driver model is for C files that use it to define dm.h themselves. This helps indicate that driver model is supported and also reduces the amount of code pointlessly included and relying on header guards. Ultimately (combined with the reduction in size of common.h) this should speed up U-Boot compilation. This series removes all uses of dm.h in header files and adds a warning to avert more such activity. Simon Glass (31): spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL mtd: spi-nor: Tidy up error handling / debug code wdt: Drop dm.h header file mtd: spi-mem: Drop dm.h header file mtd: spi: Drop SPI_XFER_MMAP* dm: core: Drop dm.h header file from dm-demo.h dm: core: Drop header files from dm/test.h fs: fs-loader: Drop dm.h header file net: Drop dm.h header file from phy.h sf: Drop dm.h header file from spi_flash.h thermal: Drop dm.h header file w1: Drop dm.h header file efi: Tidy up header includes power: Tidy up inclusion of regulator_common.h mmc: Drop duplicate dm.h inclusion spi: Drop duplicate dm.h inclusion ti: am654: Drop duplicate dm.h inclusion liebherr: Drop duplicate dm.h inclusion pci: Drop dm.h inclusion from header file mediatek: Drop dm.h header file mscc: Drop dm.h header file adc: Drop dm.h header file nand: Drop dm.h header file ufs: Drop dm.h header file usb: Drop dm.h header file clk: Drop dm.h header file in clk-provider.h net: Drop dm.h header file in eth_phy.h net: Drop duplicate include of dm.h in pcnet.c dm: core: Guard against including dm.h in header files patman: Fix up the test comments checkpatch: Don't allow common.h and dm.h in headers arch/arm/include/asm/arch-mediatek/reset.h| 2 +- arch/arm/mach-imx/cpu.c | 1 + arch/arm/mach-k3/sysfw-loader.c | 1 + .../cmd_stm32prog/stm32prog_serial.c | 1 + arch/mips/mach-mscc/include/mach/jr2/jr2.h| 3 -- .../mips/mach-mscc/include/mach/luton/luton.h | 3 -- .../mach-mscc/include/mach/ocelot/ocelot.h| 3 -- .../mach-mscc/include/mach/serval/serval.h| 3 -- .../mach-mscc/include/mach/servalt/servalt.h | 3 -- arch/x86/cpu/ivybridge/sdram.c| 1 + board/atmel/common/board.c| 1 + board/liebherr/display5/display5.c| 1 - board/mscc/servalt/servalt.c | 2 + board/st/common/stm32mp_dfu.c | 1 + cmd/demo.c| 1 + cmd/mdio.c| 1 + cmd/mii.c | 1 + cmd/w1.c | 1 + common/spl/Kconfig| 10 + drivers/adc/stm32-adc-core.c | 1 + drivers/adc/stm32-adc-core.h | 4 +- drivers/adc/stm32-adc.c | 1 + drivers/clk/clk-uclass.c | 5 +++ drivers/clk/kendryte/bypass.c | 7 ++- drivers/clk/kendryte/pll.c| 10 +++-- drivers/fpga/socfpga_arria10.c| 1 + drivers/mmc/sdhci.c | 1 - .../mtd/nand/raw/brcmnand/brcmnand_compat.c | 1 + .../mtd/nand/raw/brcmnand/brcmnand_compat.h | 4 +- drivers/mtd/spi/Makefile | 2 +- drivers/mtd/spi/sf_probe.c| 2 +- drivers/mtd/spi/spi-nor-core.c| 2 +- drivers/mtd/spi/spi-nor-tiny.c| 4 +- drivers/net/pcnet.c | 1 - drivers/pci/pcie_layerscape.h | 1 - drivers/pci/pcie_layerscape_fixup.c | 1 + drivers/pci/pcie_layerscape_gen4.h| 1 - drivers/pci/pcie_layerscape_gen4_fixup.c | 1 + drivers/power/regulator/fixed.c | 3 +- drivers/power/regulator/gpio-regulator.c | 3 +- drivers/power/regulator/regulator_common.c| 4 +- drivers/power/regulator/regulator_common.h| 2 - drivers/ram/k3-am654-ddrss.c | 1 - drivers/spi/mscc_bb_spi.c | 1 - drivers/spi/spi-mem.c | 7 ++- drivers/spi/spi-sifive.c | 1 + drivers/spi/stm32_qspi.c | 2 + drivers/ufs/cdns-platform.c | 1 + drivers/ufs/ufs.c | 3 +- drivers/ufs/ufs.h | 5 +-- drivers/usb/musb-new/musb_uboot.c | 37 +++ drivers/usb/musb-new/pic32.c | 1 + drivers/usb/musb-new/usb-compat.h | 45 --- include/dm-demo.h | 2 - include/dm.h | 4 ++ include/dm/read.h | 1 + include/dm/test.h | 3 -- include/efi_driver.h | 2 - include/eth_phy.h
Re: [PATCH 26/31] clk: Drop dm.h header file in clk-provider.h
On 7/19/20 12:15 PM, Simon Glass wrote: > This header file should not be included in other header files. Remove it > and use a forward declaration and un-inlining of dev_get_clk_ptr() > instead. > > Fix up the kendryte header files to avoid build errors. > > Signed-off-by: Simon Glass > --- > > drivers/clk/clk-uclass.c | 5 + > drivers/clk/kendryte/bypass.c | 7 +-- > drivers/clk/kendryte/pll.c| 10 ++ > include/kendryte/bypass.h | 2 +- > include/linux/clk-provider.h | 8 +++- > 5 files changed, 20 insertions(+), 12 deletions(-) > > diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c > index 15656f5973..934cd5787a 100644 > --- a/drivers/clk/clk-uclass.c > +++ b/drivers/clk/clk-uclass.c > @@ -25,6 +25,11 @@ static inline const struct clk_ops *clk_dev_ops(struct > udevice *dev) > return (const struct clk_ops *)dev->driver->ops; > } > > +struct clk *dev_get_clk_ptr(struct udevice *dev) > +{ > + return (struct clk *)dev_get_uclass_priv(dev); > +} > + > #if CONFIG_IS_ENABLED(OF_CONTROL) > # if CONFIG_IS_ENABLED(OF_PLATDATA) > int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells, > diff --git a/drivers/clk/kendryte/bypass.c b/drivers/clk/kendryte/bypass.c > index d1fd28175b..5f1986f2cb 100644 > --- a/drivers/clk/kendryte/bypass.c > +++ b/drivers/clk/kendryte/bypass.c > @@ -4,12 +4,15 @@ > */ > > #define LOG_CATEGORY UCLASS_CLK > -#include > > +#include > +#include > #include > +#include > +#include > +#include > #include > #include > -#include > > #define CLK_K210_BYPASS "k210_clk_bypass" > > diff --git a/drivers/clk/kendryte/pll.c b/drivers/clk/kendryte/pll.c > index 19e358856a..ab6d75d585 100644 > --- a/drivers/clk/kendryte/pll.c > +++ b/drivers/clk/kendryte/pll.c > @@ -3,18 +3,20 @@ > * Copyright (C) 2019-20 Sean Anderson > */ > #define LOG_CATEGORY UCLASS_CLK > -#include > > -#include > +#include > +#include > /* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */ > #include > +#include > +#include > +#include > #include > +#include > #include > #include > #include > #include > -#include > -#include > > #define CLK_K210_PLL "k210_clk_pll" > > diff --git a/include/kendryte/bypass.h b/include/kendryte/bypass.h > index a081cbd12f..ab85bbcbfc 100644 > --- a/include/kendryte/bypass.h > +++ b/include/kendryte/bypass.h > @@ -5,7 +5,7 @@ > #ifndef K210_BYPASS_H > #define K210_BYPASS_H > > -#include > +struct clk; > > struct k210_bypass { > struct clk clk; > diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h > index 8a20743ad8..79dce8f0ad 100644 > --- a/include/linux/clk-provider.h > +++ b/include/linux/clk-provider.h > @@ -9,12 +9,13 @@ > #ifndef __LINUX_CLK_PROVIDER_H > #define __LINUX_CLK_PROVIDER_H > > -#include > #include > #include > #include > #include > > +struct udevice; > + > static inline void clk_dm(ulong id, struct clk *clk) > { > if (!IS_ERR(clk)) > @@ -188,8 +189,5 @@ struct clk *clk_register_mux(struct device *dev, const > char *name, > const char *clk_hw_get_name(const struct clk *hw); > ulong clk_generic_get_rate(struct clk *clk); > > -static inline struct clk *dev_get_clk_ptr(struct udevice *dev) > -{ > - return (struct clk *)dev_get_uclass_priv(dev); > -} > +struct clk *dev_get_clk_ptr(struct udevice *dev); > #endif /* __LINUX_CLK_PROVIDER_H */ > Reviewed-by: Sean Anderson
Reproducibility regression with mx6cuboxi
The mx6cuboxi target no longer builds reproducibility on Debian. I've bisected it down to: eb9124f5748c96ffd548e50fd6989c3b5395b353 mx6cuboxi: enable OF_CONTROL with DM_MMC and DM_USB Based on the diffoscope output, it *might* have something to do with the changes to how board detection uses gpios: --- /tmp/tmpj_t0iqs7/control +++ /tmp/tmpj_t0iqs7/experiment-time │ --- /tmp/tmpj_t0iqs7/control/source-root ├── +++ /tmp/tmpj_t0iqs7/experiment-time/source-root │ │ --- /tmp/tmpj_t0iqs7/control/source-root/u-boot-with-spl.imx │ ├── +++ /tmp/tmpj_t0iqs7/experiment-time/source-root/u-boot-with-spl.imx │ │ @@ -4346,16 +4346,16 @@ │ │ 00010f90: │ │ 00010fa0: │ │ 00010fb0: │ │ 00010fc0: │ │ 00010fd0: │ │ 00010fe0: │ │ 00010ff0: │ │ -00011000: 2705 1956 7088 eb01 5f14 7b49 0008 565c '..Vp..._.{I..V\ │ │ -00011010: 1780 1780 9463 4032 1102 0500 .c@2 │ │ +00011000: 2705 1956 36e7 7190 5f14 7b49 0008 565c '..V6.q._.{I..V\ │ │ +00011010: 1780 1780 de74 408a 1102 0500 .t@. │ │ 00011020: │ │ 00011030: │ │ 00011040: b800 00ea 14f0 9fe5 14f0 9fe5 14f0 9fe5 │ │ 00011050: 14f0 9fe5 14f0 9fe5 14f0 9fe5 14f0 9fe5 │ │ 00011060: 6000 8017 c000 8017 2001 8017 8001 8017 `... ... │ │ 00011070: e001 8017 4002 8017 a002 8017 efbe adde @... │ │ 00011080: 2000 9000 00f0 20e3 00f0 20e3 00f0 20e3 . ... ... . │ │ @@ -0,15 +0,15 @@ │ │ 00082310: 6c6f 636b 2d6d 6173 7465 7200 7369 6d70 lock-master.simp │ │ 00082320: 6c65 2d61 7564 696f 2d63 6172 642c 6672 le-audio-card,fr │ │ 00082330: 616d 652d 6d61 7374 6572 0073 696d 706c ame-master.simpl │ │ 00082340: 652d 6175 6469 6f2d 6361 7264 2c77 6964 e-audio-card,wid │ │ 00082350: 6765 7473 0073 696d 706c 652d 6175 6469 gets.simple-audi │ │ 00082360: 6f2d 6361 7264 2c72 6f75 7469 6e67 0073 o-card,routing.s │ │ 00082370: 6f75 6e64 2d64 6169 0064 6574 6563 742d ound-dai.detect- │ │ -00082380: 6770 696f 7300 6275 d00d feed 9e9e gpios.bu │ │ +00082380: 6770 696f 7300 0023 d00d feed 9e9e gpios..# │ │ 00082390: 0038 9600 0028 0011 ...8...( │ │ 000823a0: 0010 089e 95c8 │ │ 000823b0: │ │ 000823c0: 0001 0003 0004 │ │ 000823d0: 0001 0003 0004 │ │ 000823e0: 000f 0001 0003 0033 ...3 │ │ 000823f0: 001b 536f 6c69 6452 756e 2048 756d SolidRun Hum │ │ @@ -35868,15 +35868,15 @@ │ │ 0008c1b0: 6c6f 636b 2d6d 6173 7465 7200 7369 6d70 lock-master.simp │ │ 0008c1c0: 6c65 2d61 7564 696f 2d63 6172 642c 6672 le-audio-card,fr │ │ 0008c1d0: 616d 652d 6d61 7374 6572 0073 696d 706c ame-master.simpl │ │ 0008c1e0: 652d 6175 6469 6f2d 6361 7264 2c77 6964 e-audio-card,wid │ │ 0008c1f0: 6765 7473 0073 696d 706c 652d 6175 6469 gets.simple-audi │ │ 0008c200: 6f2d 6361 7264 2c72 6f75 7469 6e67 0073 o-card,routing.s │ │ 0008c210: 6f75 6e64 2d64 6169 0064 6574 6563 742d ound-dai.detect- │ │ -0008c220: 6770 696f 7300 0023 d00d feed a473 gpios..#...s │ │ +0008c220: 6770 696f 7300 3230 d00d feed a473 gpios.20...s │ │ 0008c230: 0038 9b6c 0028 0011 ...8...l...( │ │ 0008c240: 0010 0907 9b34 ...4 │ │ 0008c250: │ │ 0008c260: 0001 0003 0004 │ │ 0008c270: 0001 0003 0004 │ │ 0008c280: 000f 0001 0003 002f .../ │ │ 0008c290: 001b 536f 6c69 6452 756e 2048 756d SolidRun Hum │ │ @@ -38499,8 +38499,8 @@ │ │ 00096620: 2c62 6974 636c 6f63 6b2d 6d61 7374 6572 ,bitclock-master │ │ 00096630: 0073 696d 706c 652d 6175 6469 6f2d 6361 .simple-audio-ca │ │ 00096640: 7264 2c66 7261 6d65 2d6d 6173 7465 7200 rd,frame-master. │ │ 00096650: 7369 6d70 6c65 2d61 7564 696f 2d63 6172 simple-audio-car │ │ 00096660: 642c 7769 6467 6574 7300 7369 6d70 6c65 d,widgets.simple │ │ 00096670: 2d61 7564 696f 2d63 6172 642c 726f 7574 -audio-card,rout │ │ 00096680: 696e 6700 736f 756e 642d 6461 6900 6465 ing.sound-dai.de │ │ -00096690: 7465 6374 2d67 7069 6f73 tect-gpios.. │ │ +00096690: 7465 6374 2d67 7069 6f73
[PATCH] buildman: Correct the testOutputDir() unit test
This current fails with an error. Fix it. Signed-off-by: Simon Glass Fixes: 7664b03ffc5 ("buildman: Remove _of_#_ from results directory paths") --- tools/buildman/test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 82d25cfcaa..3eaba07559 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -541,8 +541,7 @@ class TestBuild(unittest.TestCase): build.commits = self.commits build.commit_count = len(self.commits) subject = self.commits[1].subject.translate(builder.trans_valid_chars) -dirname ='/%02d_g%s_%s' % (2, build.commit_count, commits[1][0], - subject[:20]) +dirname ='/%02d_g%s_%s' % (2, commits[1][0], subject[:20]) self.CheckDirs(build, dirname) def testOutputDirCurrent(self): -- 2.28.0.rc0.105.gf9edc3c819-goog
dtoc code-coverage tests
Hi Walter, I am seeing a test failure with code coverage - it is at 99%. It looks to be due to an exception that doesn't occur in the tests (UnicodeDecodeError). Could you please take a look? You should be able to test it by calling scan_driver with a known-bad unicode sequence. Regards, Simon
[PATCH] buildman: Show the build rate at the end
It is interesting to note the number of builds completed per second to track machine performance and build speed. Add a 'rate' value at the end of the build to show this. Signed-off-by: Simon Glass --- tools/buildman/README | 13 + tools/buildman/builder.py | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/buildman/README b/tools/buildman/README index b2f983c715..b7442a95e5 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -1129,6 +1129,19 @@ The -y option is provided (for use with -s) to ignore the bountiful device-tree warnings. Similarly, -Y tells buildman to ignore the migration warnings. +Build summary += + +When buildman finishes it shows a summary, something like this: + +Completed: 5 total built, duration 0:00:21, rate 0.24 + +This shows that a total of 5 builds were done across all selected boards, it +took 21 seconds and the builds happened at the rate of 0.24 per second. The +latter number depends on the speed of your machine and the efficiency of the +U-Boot build. + + How to change from MAKEALL == diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f2756ea666..dbb75b35c1 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1677,7 +1677,8 @@ class Builder: if duration.microseconds >= 50: duration = duration + timedelta(seconds=1) duration = duration - timedelta(microseconds=duration.microseconds) -msg += ', duration %s' % duration +rate = float(self.count) / duration.total_seconds() +msg += ', duration %s, rate %1.2f' % (duration, rate) Print(msg) return (self.fail, self.warned) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 00/27] rockchip: x86: Support building ROM files automatically with binman
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically. This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a BUILD_ROM environment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM. A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing. This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the fit_spl_optee.sh script. Other archs and the rest of rockchip could be migrated too. This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388). Changes in v4: - Add a new CONFIG_ROCKCHIP_SPI_IMAGE to control SPI-image generation - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image - Update for changes to arch/arm/mach-k3/config.mk - Move the .itb output to a separate rockchip-optee.dtsi file - Add a check for CONFIG_FIT before building the .its Changes in v3: - Add a comment about CONFIG_SPL_FRAMEWORK - Drop rockchip changes which should not be in this patch - Move in the rockchip changes mistakenly in the earlier x86 patch - Drop use of rk322x.dtsi - Add changes to rk3288-u-boot.dtsi instead - Drop leftover debugging Changes in v2: - Drop 'rockchip' tag since this commit no-longer affects rockchip yet - Drop ROM_NEEDS_BLOBS for baytrail since HAVE_FSP already selects it - Add patches to partially migrate rockchip to use binman Simon Glass (27): x86: Change how selection of ROMs works rockchip: Allow Bob to use SPI boot Makefile: Allow building .rom files for non-x86 boards rockchip: jerry: Add serial support rockchip: bob: Support SPI-flash booting rockchip: Enable building a SPI ROM image on jerry rockchip: Enable building a SPI ROM image on bob tegra: Drop the unused non-binman code tegra: Don't enable binman on ARMv8 SoCs Makefile: Rename ALL-y to INPUTS-y powerpc: mpc85xx: Only enable binman when it is needed x86: Makefile: Drop explicit targets built by binman x86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM sunxi: Makefile: Drop explicit targets built by binman tegra: Makefile: Drop explicit targets built by binman mediatek: Makefile: Drop explicit targets built by binman Makefile: Move CONFIG_TOOLS_DEBUG check to later Makefile: Fix a long line in cmd_mkfitimage Makefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR rockchip: Convert evb-rk3288 over to use binman rockchip: Convert evb-rk3229 over to use binman rockchip: Drop the fit_spl_optee.sh script x86: Move the fdtmap away from the binary blobs x86: chromebook_link64: Correct the image layout x86: chromebook_panther: Correct the image layout x86: chromebook_samus_tpl: Correct the image layout Kconfig | 29 +++- Makefile | 169 ++ arch/Kconfig | 1 + arch/arm/config.mk| 10 +- arch/arm/dts/rk3288-u-boot.dtsi | 25 arch/arm/dts/rk3399-gru-u-boot.dtsi | 4 + arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 arch/arm/dts/rockchip-optee.dtsi | 64 arch/arm/dts/rockchip-u-boot.dtsi | 10 +- arch/arm/mach-at91/config.mk | 2 +- arch/arm/mach-davinci/config.mk | 2 +- arch/arm/mach-k3/config.mk| 10 +- arch/arm/mach-keystone/config.mk | 4 +- arch/arm/mach-omap2/config.mk | 28 ++-- arch/arm/mach-rmobile/Makefile| 2 +- arch/arm/mach-rockchip/Kconfig| 9 ++ arch/arm/mach-rockchip/fit_spl_optee.sh | 84 --- arch/arm/mach-rockchip/rk3288/Kconfig | 3 + arch/arm/mach-rockchip/rk3399/Kconfig | 2 + arch/arm/mach-rockchip/spl.c | 3 +- arch/arm/mach-stm32mp/config.mk | 4 +- arch/arm/mach-tegra/Kconfig | 2 +- arch/powerpc/Kconfig | 2 +- arch/x86/Kconfig | 11 +- arch/x86/cpu/quark/Kconfig| 1 + arch/x86/dts/u-boot.dtsi | 10 +- board/BuR/brppt1/config.mk| 4 +- board/BuR/brppt2/config.mk| 4 +- board/BuR/brsmarc1/config.mk | 6 +- board/imgtec/boston/config.mk | 2 +- board/intel/edison/config.mk | 2 +- configs/am335x_evm_defconfig | 1 + configs/am335x_hs_evm_defconfig | 1 + configs/am335x_hs_evm_uart_defconfig | 1 + configs/am43xx_evm_defconfig | 1 + configs/am43xx_evm_r
[PATCH v4 01/27] x86: Change how selection of ROMs works
Most x86 boards build a u-boot.rom which is programmed into SPI flash. But this is not unique to x86. For example some rockchip boards can also boot from SPI flash. Also, at least on x86, binary blobs are sadly quite common. It is not possible to build a functional image without them, and U-Boot needs to know this at build time. Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary blobs are also needed. If they are not needed, it is safe to build the ROM always. Otherwise we still require the BUILD_ROM environment variable. For now this affects only x86, but future patches will enable this for rockchip too. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Drop 'rockchip' tag since this commit no-longer affects rockchip yet - Drop ROM_NEEDS_BLOBS for baytrail since HAVE_FSP already selects it Kconfig| 18 +- Makefile | 18 +- arch/Kconfig | 1 + arch/x86/Kconfig | 4 arch/x86/cpu/quark/Kconfig | 1 + 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Kconfig b/Kconfig index 566ca72c92..b3b8532d2c 100644 --- a/Kconfig +++ b/Kconfig @@ -276,9 +276,25 @@ config PHYS_64BIT This can be used not only for 64bit SoCs, but also for large physical address extension on 32bit SoCs. +config HAS_ROM + bool + select BINMAN + help + Enables building of a u-boot.rom target. This collects U-Boot and + any necessary binary blobs. + +config ROM_NEEDS_BLOBS + bool + depends on HAS_ROM + help + Enable this if building the u-boot.rom target needs binary blobs, and + so cannot be done normally. In this case, pass BUILD_ROM=1 to make + to tell U-Boot to build the ROM. + config BUILD_ROM bool "Build U-Boot as BIOS replacement" - depends on X86 + depends on HAS_ROM + default y if !ROM_NEEDS_BLOBS help This option allows to build a ROM version of U-Boot. The build process generally requires several binary blobs diff --git a/Makefile b/Makefile index f55e40c590..df4e3d6c6b 100644 --- a/Makefile +++ b/Makefile @@ -921,9 +921,12 @@ ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf ALL-$(CONFIG_EFI_APP) += u-boot-app.efi ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi +ifneq ($(CONFIG_HAS_ROM),) ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom +ALL-y += u-boot.rom endif +endif + ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin endif @@ -1585,7 +1588,7 @@ endif # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in # the middle. This is handled by binman based on an image description in the # board's device tree. -ifneq ($(CONFIG_X86_RESET_VECTOR),) +ifneq ($(CONFIG_HAS_ROM),) rom: u-boot.rom FORCE refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE @@ -1595,11 +1598,12 @@ quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -u-boot.rom: u-boot-x86-start16.bin u-boot-x86-reset16.bin u-boot.bin \ +rom-deps := u-boot.bin +ifdef CONFIG_X86 +rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \ - $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE - $(call if_changed,binman) + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 u-boot-x86-start16.bin: u-boot FORCE @@ -1610,6 +1614,10 @@ u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) endif +u-boot.rom: $(rom-deps) FORCE + $(call if_changed,binman) +endif + ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),) u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE diff --git a/arch/Kconfig b/arch/Kconfig index 9be02d1319..7f3cbe2ec8 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -160,6 +160,7 @@ config X86 select TIMER select USE_PRIVATE_LIBGCC select X86_TSC_TIMER + imply HAS_ROM if X86_RESET_VECTOR imply BLK imply CMD_DM imply CMD_FPGA_LOADMK diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 27295ef384..f51b7c9f41 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -360,6 +360,8 @@ config HAVE_FSP bool "Add an Firmware Support Package binary" depends on !EFI select USE_HOB + select HAS_ROM + select ROM_NEEDS_BLOBS help Select this option to add an Firmware Support Package binary to the resulting U-Boot image. It is a binary blob which U-Boot uses @@ -519,6 +521,8 @@ config ENABLE_MRC_CACHE config HAVE_MRC bool "Add a Syste
[PATCH v4 02/27] rockchip: Allow Bob to use SPI boot
Bob is a Chromebook and can boot from SPI flash. Add it to the condition check for this. Signed-off-by: Simon Glass --- (no changes since v1) arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c index cddf4fd3d5..f148d48b6a 100644 --- a/arch/arm/mach-rockchip/spl.c +++ b/arch/arm/mach-rockchip/spl.c @@ -54,7 +54,8 @@ u32 spl_boot_device(void) #if defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \ defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \ defined(CONFIG_TARGET_CHROMEBOOK_MINNIE) || \ - defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY) + defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY) || \ + defined(CONFIG_TARGET_CHROMEBOOK_BOB) return BOOT_DEVICE_SPI; #endif if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 04/27] rockchip: jerry: Add serial support
This option allows the serial console to work correctly. Add it. Signed-off-by: Simon Glass --- (no changes since v1) configs/chromebook_jerry_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/chromebook_jerry_defconfig b/configs/chromebook_jerry_defconfig index e32de90843..c410b844d5 100644 --- a/configs/chromebook_jerry_defconfig +++ b/configs/chromebook_jerry_defconfig @@ -85,6 +85,7 @@ CONFIG_PWM_ROCKCHIP=y CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_ROCKCHIP_SERIAL=y CONFIG_SOUND=y CONFIG_I2S=y CONFIG_I2S_ROCKCHIP=y -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 05/27] rockchip: bob: Support SPI-flash booting
Update the config for chromebook_bob to support booting from SPI flash. The existing SPL size is too small since ATF is needed, so double it. Signed-off-by: Simon Glass --- (no changes since v1) configs/chromebook_bob_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/chromebook_bob_defconfig b/configs/chromebook_bob_defconfig index dad96d2ad1..4ffc33398a 100644 --- a/configs/chromebook_bob_defconfig +++ b/configs/chromebook_bob_defconfig @@ -3,7 +3,7 @@ CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x0020 CONFIG_SPL_GPIO_SUPPORT=y CONFIG_ENV_OFFSET=0x3F8000 -CONFIG_SYS_SPI_U_BOOT_OFFS=0x2 +CONFIG_SYS_SPI_U_BOOT_OFFS=0x4 CONFIG_SPL_TEXT_BASE=0xff8c2000 CONFIG_ROCKCHIP_RK3399=y CONFIG_ROCKCHIP_BOOT_MODE_REG=0 @@ -40,6 +40,7 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_ROCKCHIP_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_SYS_I2C_ROCKCHIP=y @@ -53,6 +54,7 @@ CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_SF_DEFAULT_BUS=1 CONFIG_SF_DEFAULT_SPEED=2000 CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_DM_ETH=y -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them. Update the Makefile to have a separate, final step which runs binman, once all input dependencies are present. This avoid sprinkling the Makefile with arch-specific code. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Drop rockchip changes which should not be in this patch Makefile | 63 +--- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index 0147d9d49b..b4b5b10813 100644 --- a/Makefile +++ b/Makefile @@ -921,16 +921,6 @@ INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi -ifneq ($(CONFIG_HAS_ROM),) -ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -INPUTS-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom -endif -endif - -ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) -INPUTS-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin -endif - # Build a combined spl + u-boot image for sunxi ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) INPUTS-y += u-boot-sunxi-with-spl.bin @@ -961,6 +951,10 @@ ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) INPUTS-y += u-boot-rockchip.bin endif +INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ + $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ + $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) + LDFLAGS_u-boot += $(LDFLAGS_FINAL) # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards. @@ -1018,7 +1012,14 @@ cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ PHONY += inputs inputs: $(INPUTS-y) -all: inputs +all: .binman_stamp inputs +ifeq ($(CONFIG_BINMAN),y) + $(call if_changed,binman) +endif + +# Timestamp file to make sure that binman always runs +.binman_stamp: FORCE + @touch $@ ifeq ($(CONFIG_DEPRECATED),y) $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.") @@ -1311,7 +1312,7 @@ quiet_cmd_binman = BINMAN $@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ --toolpath $(objtree)/tools \ $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ - build -u -d u-boot.dtb -O . -m \ + build -u -d u-boot.dtb -O . -m --allow-missing \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ $(BINMAN_$(@F)) @@ -1588,27 +1589,11 @@ u-boot-br.bin: u-boot FORCE endif endif -# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including -# reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in -# the middle. This is handled by binman based on an image description in the -# board's device tree. -ifneq ($(CONFIG_HAS_ROM),) -rom: u-boot.rom FORCE - -refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE - $(call if_changed,copy) - quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -rom-deps := u-boot.bin ifdef CONFIG_X86 -rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ - $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ - $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \ - $(if $(CONFIG_HAVE_REFCODE),refcode.bin) - OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 u-boot-x86-start16.bin: u-boot FORCE $(call if_changed,objcopy) @@ -1617,24 +1602,7 @@ OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) -else # !CONFIG_X86 - -ifdef CONFIG_SPL -rom-deps += spl/u-boot-spl.bin - -# We can rely on CONFIG_SPL_FRAMEWORK being set for boards that use binman -rom-deps += u-boot.img -endif - -ifdef CONFIG_TPL -rom-deps += tpl/u-boot-tpl.bin -endif - -endif - -u-boot.rom: $(rom-deps) FORCE - $(call if_changed,binman) -endif +endif # CONFIG_X86 ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),) @@ -1646,9 +1614,6 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE endif endif -u-boot-x86-with-spl.bin: spl/u-boot-spl.bin u-boot.bin FORCE - $(call if_changed,binman) - ifneq ($(CONFIG_ARCH_TEGRA),) # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin %-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 07/27] rockchip: Enable building a SPI ROM image on bob
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for bob. Signed-off-by: Simon Glass --- Changes in v4: - Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image arch/arm/dts/rk3399-gru-u-boot.dtsi | 4 arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi index 7bddc3acdb..390ac2bb5a 100644 --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi @@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi index 7ac88392f2..f9c5bb607b 100644 --- a/arch/arm/dts/rk3399-gru.dtsi +++ b/arch/arm/dts/rk3399-gru.dtsi @@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash@0 { + spi_flash: spiflash@0 { compatible = "jedec,spi-nor"; reg = <0>; diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi index 8237782408..ecd230c720 100644 --- a/arch/arm/dts/rk3399-u-boot.dtsi +++ b/arch/arm/dts/rk3399-u-boot.dtsi @@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9 +#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1; }; cic: syscon@ff62 { @@ -57,6 +60,30 @@ }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x40>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x4>; + }; + u-boot { + offset = <0x30>; + }; + fdtmap { + }; + }; +}; +#endif + &cru { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index 254b9c5b4d..17628f9171 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -5,6 +5,8 @@ choice config TARGET_CHROMEBOOK_BOB bool "Asus Flip C101PA Chromebook (RK3399)" + select HAS_ROM + select ROCKCHIP_SPI_IMAGE help Bob is a small RK3299-based device similar in apperance to Minnie. It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1", -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 14/27] sunxi: Makefile: Drop explicit targets built by binman
On sunxi various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them. This avoid sprinkling the Makefile with arch-specific code. Reviewed-by: Bin Meng Signed-off-by: Simon Glass --- (no changes since v1) Makefile | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 03590de0ef..2c1d508a0b 100644 --- a/Makefile +++ b/Makefile @@ -922,7 +922,7 @@ INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi # Build a combined spl + u-boot image for sunxi -ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) +ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy) INPUTS-y += u-boot-sunxi-with-spl.bin endif @@ -1606,10 +1606,7 @@ u-boot-x86-reset16.bin: u-boot FORCE endif # CONFIG_X86 ifneq ($(CONFIG_ARCH_SUNXI),) -ifeq ($(CONFIG_ARM64),) -u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE - $(call if_changed,binman) -else +ifeq ($(CONFIG_ARM64),y) u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE $(call if_changed,cat) endif -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 15/27] tegra: Makefile: Drop explicit targets built by binman
On tegra various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them. This avoid sprinkling the Makefile with arch-specific code. Reviewed-by: Bin Meng Signed-off-by: Simon Glass --- (no changes since v1) Makefile | 12 1 file changed, 12 deletions(-) diff --git a/Makefile b/Makefile index 2c1d508a0b..f72e627fbe 100644 --- a/Makefile +++ b/Makefile @@ -926,12 +926,6 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy) INPUTS-y += u-boot-sunxi-with-spl.bin endif -# enable combined SPL/u-boot/dtb rules for tegra -ifeq ($(CONFIG_ARCH_TEGRA)$(CONFIG_SPL),yy) -INPUTS-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin -INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin -endif - INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin # Add optional build target if defined in board/cpu/soc headers @@ -1612,12 +1606,6 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE endif endif -ifneq ($(CONFIG_ARCH_TEGRA),) -# Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin -%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE - $(call if_changed,binman) -endif - OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI) u-boot-app.efi: u-boot FORCE $(call if_changed,zobjcopy) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 16/27] mediatek: Makefile: Drop explicit targets built by binman
On mediatek various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them. This avoid sprinkling the Makefile with arch-specific code. Also update the binman definition so that idbloader.img is only needed when SPL is actually being used. Reviewed-by: Bin Meng Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Move in the rockchip changes mistakenly in the earlier x86 patch Makefile | 24 arch/arm/dts/rockchip-u-boot.dtsi | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f72e627fbe..e4b1c01de1 100644 --- a/Makefile +++ b/Makefile @@ -926,7 +926,10 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy) INPUTS-y += u-boot-sunxi-with-spl.bin endif +# Generate this input file for binman +ifeq ($(CONFIG_SPL),) INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin +endif # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) @@ -941,9 +944,20 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) INPUTS-y += u-boot-with-dtb.bin endif -ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) +ifeq ($(CONFIG_ARCH_ROCKCHIP),y) +# On ARM64 this target is produced by binman so we don't need this dep +ifeq ($(CONFIG_ARM64),y) +ifeq ($(CONFIG_SPL),y) +# TODO: Get binman to generate this too INPUTS-y += u-boot-rockchip.bin endif +else +ifeq ($(CONFIG_SPL),y) +# Generate these inputs for binman which will create the output files +INPUTS-y += idbloader.img u-boot.img +endif +endif +endif INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ @@ -1459,10 +1473,7 @@ idbloader.img: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) endif -ifeq ($(CONFIG_ARM64),) -u-boot-rockchip.bin: idbloader.img u-boot.img FORCE - $(call if_changed,binman) -else +ifeq ($(CONFIG_ARM64),y) OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE @@ -1689,9 +1700,6 @@ u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE ifeq ($(CONFIG_SPL),y) spl/u-boot-spl-mtk.bin: spl/u-boot-spl - -u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE - $(call if_changed,binman) else MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \ diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index 0451db735e..eae3ee715d 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -11,6 +11,7 @@ }; }; +#ifdef CONFIG_SPL &binman { simple-bin { filename = "u-boot-rockchip.bin"; @@ -25,3 +26,4 @@ }; }; }; +#endif -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 03/27] Makefile: Allow building .rom files for non-x86 boards
Some non-x86 devices can use SPI flash to boot and need to produce images of a fixed size to program the flash. Add a way to handle this for non-x86 boards. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Add a comment about CONFIG_SPL_FRAMEWORK Makefile | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index df4e3d6c6b..eb2fa50464 100644 --- a/Makefile +++ b/Makefile @@ -1612,6 +1612,20 @@ u-boot-x86-start16.bin: u-boot FORCE OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) + +else # !CONFIG_X86 + +ifdef CONFIG_SPL +rom-deps += spl/u-boot-spl.bin + +# We can rely on CONFIG_SPL_FRAMEWORK being set for boards that use binman +rom-deps += u-boot.img +endif + +ifdef CONFIG_TPL +rom-deps += tpl/u-boot-tpl.bin +endif + endif u-boot.rom: $(rom-deps) FORCE -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 06/27] rockchip: Enable building a SPI ROM image on jerry
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for jerry. Change the binman image definition to support multiple images, since it may be used to build both u-boot-rockchip.bin and u-boot.rom Signed-off-by: Simon Glass --- Changes in v4: - Add a new CONFIG_ROCKCHIP_SPI_IMAGE to control SPI-image generation arch/arm/dts/rk3288-u-boot.dtsi | 24 arch/arm/dts/rockchip-u-boot.dtsi | 8 +++- arch/arm/mach-rockchip/Kconfig| 9 + arch/arm/mach-rockchip/rk3288/Kconfig | 2 ++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index 51b6e018bd..c87f00141f 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -12,6 +12,30 @@ }; }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x40>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3288 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x2>; + }; + u-boot { + offset = <0x30>; + }; + fdtmap { + }; + }; +}; +#endif + &dmc { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index a2559e2db0..0451db735e 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -6,7 +6,13 @@ #include / { - binman { + binman: binman { + multiple-images; + }; +}; + +&binman { + simple-bin { filename = "u-boot-rockchip.bin"; pad-byte = <0xff>; diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index e2b6326584..dd1eec9f18 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -366,6 +366,15 @@ config TPL_ROCKCHIP_EARLYRETURN_TO_BROM config SPL_MMC_SUPPORT default y if !SPL_ROCKCHIP_BACK_TO_BROM +config ROCKCHIP_SPI_IMAGE + bool "Build a SPI image for rockchip" + depends on HAS_ROM + help + Some Rockchip SoCs support booting from SPI flash. Enable this + option to produce a 4MB SPI-flash image (called u-boot.rom) + containing U-Boot. The image is built by binman. U-Boot sits near + the start of the image. + source "arch/arm/mach-rockchip/px30/Kconfig" source "arch/arm/mach-rockchip/rk3036/Kconfig" source "arch/arm/mach-rockchip/rk3128/Kconfig" diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index afb62fca78..bb715e9d0e 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -5,7 +5,9 @@ choice config TARGET_CHROMEBOOK_JERRY bool "Google/Rockchip Veyron-Jerry Chromebook" + select HAS_ROM select BOARD_LATE_INIT + select ROCKCHIP_SPI_IMAGE help Jerry is a RK3288-based clamshell device with 2 USB 3.0 ports, HDMI, an 11.9 inch EDP display, micro-SD card, touchpad and -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 10/27] Makefile: Rename ALL-y to INPUTS-y
When binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs. Rename the variable to indicate this, and add a new 'inputs' target. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v4: - Update for changes to arch/arm/mach-k3/config.mk Makefile | 60 +--- arch/arm/config.mk | 10 +++--- arch/arm/mach-at91/config.mk | 2 +- arch/arm/mach-davinci/config.mk | 2 +- arch/arm/mach-k3/config.mk | 10 +++--- arch/arm/mach-keystone/config.mk | 4 +-- arch/arm/mach-omap2/config.mk| 28 +++ arch/arm/mach-rmobile/Makefile | 2 +- arch/arm/mach-stm32mp/config.mk | 4 +-- board/BuR/brppt1/config.mk | 4 +-- board/BuR/brppt2/config.mk | 4 +-- board/BuR/brsmarc1/config.mk | 6 ++-- board/imgtec/boston/config.mk| 2 +- board/intel/edison/config.mk | 2 +- scripts/Makefile.spl | 24 ++--- tools/binman/README | 2 +- 16 files changed, 85 insertions(+), 81 deletions(-) diff --git a/Makefile b/Makefile index 5b07bec3be..0147d9d49b 100644 --- a/Makefile +++ b/Makefile @@ -885,80 +885,80 @@ quiet_cmd_static_rela = cmd_static_rela = endif -# Always append ALL so that arch config.mk's can add custom ones -ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check +# Always append INPUTS so that arch config.mk's can add custom ones +INPUTS-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check -ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin +INPUTS-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin ifeq ($(CONFIG_SPL_FSL_PBL),y) -ALL-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin +INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin else ifneq ($(CONFIG_NXP_ESBC), y) # For Secure Boot The Image needs to be signed and Header must also # be included. So The image has to be built explicitly -ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl +INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl endif endif -ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin +INPUTS-$(CONFIG_SPL) += spl/u-boot-spl.bin ifeq ($(CONFIG_MX6)$(CONFIG_IMX_HAB), yy) -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img else ifeq ($(CONFIG_MX7)$(CONFIG_IMX_HAB), yy) -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img else -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot.img endif endif -ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb +INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb ifeq ($(CONFIG_SPL_FRAMEWORK),y) -ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif -ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb +INPUTS-$(CONFIG_OF_HOSTFILE) += u-boot.dtb ifneq ($(CONFIG_SPL_TARGET),) -ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) +INPUTS-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) endif -ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf -ALL-$(CONFIG_EFI_APP) += u-boot-app.efi -ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi +INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf +INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi +INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi ifneq ($(CONFIG_HAS_ROM),) ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -ALL-y += u-boot.rom +INPUTS-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom endif endif ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) -ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin +INPUTS-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin endif # Build a combined spl + u-boot image for sunxi ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) -ALL-y += u-boot-sunxi-with-spl.bin +INPUTS-y += u-boot-sunxi-with-spl.bin endif # enable combined SPL/u-boot/dtb rules for tegra ifeq ($(CONFIG_ARCH_TEGRA)$(CONFIG_SPL),yy) -ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin +INPUTS-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin endif -ALL-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin +INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) -ALL-y += $(CONFIG_BUILD_TARGET:"%"=%) +INPUTS-y += $(CONFIG_BUILD_TARGET:"%"=%) endif ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy) -ALL-y += init_sp_bss_offset_check +INPUTS-y += init_sp_bss_offset_check endif ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) -ALL-y += u-boot-with-dtb.bin +INPUTS-y += u-boot-with-dtb.bin endif ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) -ALL-y += u-boot-rockchip.bin +INPUTS-y += u-boot-rockchip.bin endif LDFLAGS_u-boot += $(LDFLAGS_FINAL) @@ -1015,7 +1015,11 @@ quiet_cmd_cfgcheck = CFGCHK $2 cmd_cfgcheck = $(srctree)/scripts/check-config
[PATCH v4 20/27] Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests. So this option should be deprecated and not used. Existing uses should be migrated. Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse. So let's add a warning. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index f1b5be1882..d73c10a973 100644 --- a/Makefile +++ b/Makefile @@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "= WARNING ==" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG @@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 08/27] tegra: Drop the unused non-binman code
This has been in the Makefile long enough to ensure migration is complete. Drop it. Signed-off-by: Simon Glass --- (no changes since v1) Makefile | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Makefile b/Makefile index eb2fa50464..5b07bec3be 100644 --- a/Makefile +++ b/Makefile @@ -1646,23 +1646,9 @@ u-boot-x86-with-spl.bin: spl/u-boot-spl.bin u-boot.bin FORCE $(call if_changed,binman) ifneq ($(CONFIG_ARCH_TEGRA),) -ifneq ($(CONFIG_BINMAN),) # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin -%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: \ - spl/%-spl %.bin FORCE +%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE $(call if_changed,binman) -else -OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE - $(call if_changed,pad_cat) - -OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE - $(call if_changed,pad_cat) - -u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE - $(call if_changed,copy) -endif # binman endif OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI) -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 09/27] tegra: Don't enable binman on ARMv8 SoCs
At present only the ARMv7 tegra SoCs actually use binman to create an image. Change the config to reflect this, since otherwise running binman will produce an error. Signed-off-by: Simon Glass --- (no changes since v1) arch/arm/mach-tegra/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 15e7684028..a397748b72 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -41,7 +41,6 @@ config TEGRA_PMC_SECURE config TEGRA_COMMON bool "Tegra common options" - select BINMAN select BOARD_EARLY_INIT_F select CLK select DM @@ -69,6 +68,7 @@ config TEGRA_NO_BPMP config TEGRA_ARMV7_COMMON bool "Tegra 32-bit common options" + select BINMAN select CPU_V7A select SPL select SPL_BOARD_INIT if SPL -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 13/27] x86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM
This Kconfig is not needed anymore since U-Boot will build the ROM if the required binary blobs exist. The BUILD_ROM environment variable used to request that the ROM be built. Now this always happens if the required binary blobs are available. Update it to mean that U-Boot should fail if the ROM cannot be built. This behaviour should be compatible with how it used to work. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) Kconfig | 7 +-- Makefile | 3 ++- configs/qemu-x86_64_defconfig | 1 - configs/qemu-x86_defconfig| 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index b3b8532d2c..182f5d6f18 100644 --- a/Kconfig +++ b/Kconfig @@ -288,8 +288,11 @@ config ROM_NEEDS_BLOBS depends on HAS_ROM help Enable this if building the u-boot.rom target needs binary blobs, and - so cannot be done normally. In this case, pass BUILD_ROM=1 to make - to tell U-Boot to build the ROM. + so cannot be done normally. In this case, U-Boot will only build the + ROM if the required blobs exist. If not, you will see an warning like: + + Image 'main-section' is missing external blobs and is non-functional: + intel-descriptor intel-me intel-refcode intel-vga intel-mrc config BUILD_ROM bool "Build U-Boot as BIOS replacement" diff --git a/Makefile b/Makefile index b4b5b10813..03590de0ef 100644 --- a/Makefile +++ b/Makefile @@ -1312,7 +1312,8 @@ quiet_cmd_binman = BINMAN $@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ --toolpath $(objtree)/tools \ $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ - build -u -d u-boot.dtb -O . -m --allow-missing \ + build -u -d u-boot.dtb -O . \ + $(if $(BUILD_ROM),,-m --allow-missing) \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ $(BINMAN_$(@F)) diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig index dd4ae62a30..4d156bc7fc 100644 --- a/configs/qemu-x86_64_defconfig +++ b/configs/qemu-x86_64_defconfig @@ -18,7 +18,6 @@ CONFIG_GENERATE_ACPI_TABLE=y CONFIG_X86_OFFSET_U_BOOT=0xfff0 CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx" CONFIG_DISTRO_DEFAULTS=y -CONFIG_BUILD_ROM=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y CONFIG_BOOTSTAGE=y diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig index 4309c2352d..f0e8e7d967 100644 --- a/configs/qemu-x86_defconfig +++ b/configs/qemu-x86_defconfig @@ -8,7 +8,6 @@ CONFIG_GENERATE_PIRQ_TABLE=y CONFIG_GENERATE_MP_TABLE=y CONFIG_GENERATE_ACPI_TABLE=y CONFIG_DISTRO_DEFAULTS=y -CONFIG_BUILD_ROM=y CONFIG_FIT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 19/27] Makefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty
At present we use the empty string to indicate that there is no FIT generator, but this doesn't allow an individual board to undefine it. Create a separate bool instead. Update the config of the boards which currently have an empty string. Signed-off-by: Simon Glass --- (no changes since v1) Kconfig | 6 +- Makefile | 2 +- configs/am335x_evm_defconfig | 1 + configs/am335x_hs_evm_defconfig | 1 + configs/am335x_hs_evm_uart_defconfig | 1 + configs/am43xx_evm_defconfig | 1 + configs/am43xx_evm_rtconly_defconfig | 1 + configs/am43xx_evm_usbhost_boot_defconfig | 1 + configs/am43xx_hs_evm_defconfig | 1 + configs/am57xx_evm_defconfig | 1 + configs/am57xx_hs_evm_defconfig | 1 + configs/am57xx_hs_evm_usb_defconfig | 1 + configs/am65x_evm_a53_defconfig | 1 + configs/am65x_evm_r5_defconfig| 1 + configs/am65x_hs_evm_a53_defconfig| 1 + configs/am65x_hs_evm_r5_defconfig | 1 + configs/dh_imx6_defconfig | 1 + configs/display5_defconfig| 1 + configs/display5_factory_defconfig| 1 + configs/dra7xx_evm_defconfig | 1 + configs/dra7xx_hs_evm_defconfig | 1 + configs/dra7xx_hs_evm_usb_defconfig | 1 + configs/imx6qdl_icore_mipi_defconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 1 + configs/imx6qdl_icore_rqs_defconfig | 1 + configs/j721e_evm_a72_defconfig | 1 + configs/j721e_evm_r5_defconfig| 1 + configs/j721e_hs_evm_a72_defconfig| 1 + configs/j721e_hs_evm_r5_defconfig | 1 + configs/ls1046ardb_qspi_spl_defconfig | 1 + configs/mccmon6_nor_defconfig | 1 + configs/mccmon6_sd_defconfig | 1 + configs/mx6sabreauto_defconfig| 1 + configs/mx6sabresd_defconfig | 1 + configs/pico-imx6_defconfig | 1 + configs/qemu-x86_64_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + configs/socfpga_arria10_defconfig | 1 + configs/stm32mp15_dhcom_basic_defconfig | 1 + configs/stm32mp15_dhcor_basic_defconfig | 1 + configs/wandboard_defconfig | 1 + configs/xilinx_zynq_virt_defconfig| 1 + 42 files changed, 46 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 182f5d6f18..1dc5273c68 100644 --- a/Kconfig +++ b/Kconfig @@ -596,9 +596,13 @@ config SPL_FIT_SOURCE U-Boot FIT image. This could specify further image to load and/or execute. +config USE_SPL_FIT_GENERATOR + bool "Use a script to generate the .its script" + default y if SPL_FIT + config SPL_FIT_GENERATOR string ".its file generator script for U-Boot FIT image" - depends on SPL_FIT + depends on USE_SPL_FIT_GENERATOR default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI default "arch/arm/mach-rockchip/make_fit_atf.py" if SPL_LOAD_FIT && ARCH_ROCKCHIP default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if SPL_LOAD_FIT && ARCH_ZYNQMP diff --git a/Makefile b/Makefile index 163dc0b8b9..f1b5be1882 100644 --- a/Makefile +++ b/Makefile @@ -1350,7 +1350,7 @@ U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) $(call if_changed,copy) else -ifneq ($(CONFIG_SPL_FIT_GENERATOR),"") +ifneq ($(CONFIG_USE_SPL_FIT_GENERATOR),) U_BOOT_ITS := u-boot.its ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-imx/mkimage_fit_atf.sh") U_BOOT_ITS_DEPS += u-boot-nodtb.bin diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index b8333eb4b8..7c34fc5f81 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -6,6 +6,7 @@ CONFIG_AM33XX=y CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_LOGLEVEL=3 diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig index 4faab7fa5b..c4ebe54cf4 100644 --- a/configs/am335x_hs_evm_defconfig +++ b/configs/am335x_hs_evm_defconfig @@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_LOGLEVEL=3 diff --git a/configs/am335x_hs_evm_uart_defconfig b/configs/am335x_hs_evm_uart_defconfig index fb4e11d1c7..9e8eeefe36 100644 --- a/configs/am335x_hs_evm_uart_defconfig +++ b/configs/am335x_hs_evm_uart_defconfig @@ -13,6 +13,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL
[PATCH v4 11/27] powerpc: mpc85xx: Only enable binman when it is needed
Quite a few boards using this SoC family don't use binman, yet CONFIG_BINMAN is enabled for all of them. But the option should only be enabled if we expect binman to produce an image. Calling binman when the device tree is missing, etc. will cause failer. Add a condition so that CONFIG_BINMAN is only enabled as needed. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c2c577f60c..6a2e88fed2 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -20,7 +20,7 @@ config MPC85xx select CREATE_ARCH_SYMLINK select SYS_FSL_DDR select SYS_FSL_DDR_BE - select BINMAN + select BINMAN if OF_SEPARATE imply CMD_HASH imply CMD_IRQ imply USB_EHCI_HCD if USB -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 22/27] rockchip: Convert evb-rk3229 over to use binman
At present this board uses a custom script to produce the .its file. Update it to use binman instead. Binman can create all the images that are needed. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Drop leftover debugging configs/evb-rk3229_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/evb-rk3229_defconfig b/configs/evb-rk3229_defconfig index 1d0fe3332b..406437d1d9 100644 --- a/configs/evb-rk3229_defconfig +++ b/configs/evb-rk3229_defconfig @@ -15,7 +15,7 @@ CONFIG_DEBUG_UART=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/fit_spl_optee.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rk3229-evb.dtb" # CONFIG_DISPLAY_CPUINFO is not set -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 17/27] Makefile: Move CONFIG_TOOLS_DEBUG check to later
At present this is checked before the config has been loaded by the Makefile, so it doesn't work. Move the check to later. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e4b1c01de1..fced33e777 100644 --- a/Makefile +++ b/Makefile @@ -278,7 +278,7 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) HOSTCC = cc HOSTCXX = c++ KBUILD_HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ - $(if $(CONFIG_TOOLS_DEBUG),-g) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) + $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) @@ -735,6 +735,8 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS) KBUILD_AFLAGS += $(KAFLAGS) KBUILD_CFLAGS += $(KCFLAGS) +KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g) + # Use UBOOTINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option UBOOTINCLUDE:= \ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 27/27] x86: chromebook_samus_tpl: Correct the image layout
At present there is not enough space for U-Boot due to the EFI loader. Correct this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v2) Changes in v2: - Add patches to partially migrate rockchip to use binman configs/chromebook_samus_tpl_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/chromebook_samus_tpl_defconfig b/configs/chromebook_samus_tpl_defconfig index e54a4ff6a6..43622f4182 100644 --- a/configs/chromebook_samus_tpl_defconfig +++ b/configs/chromebook_samus_tpl_defconfig @@ -17,8 +17,8 @@ CONFIG_HAVE_MRC=y CONFIG_HAVE_REFCODE=y CONFIG_SMP=y CONFIG_HAVE_VGA_BIOS=y -CONFIG_X86_OFFSET_U_BOOT=0xfff0 CONFIG_DEFAULT_DEVICE_TREE="chromebook_samus" +CONFIG_X86_OFFSET_U_BOOT=0xffee CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_SHOW_BOOT_PROGRESS=y -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 23/27] rockchip: Drop the fit_spl_optee.sh script
Now that all board use binman instead of this script, drop it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/arm/mach-rockchip/fit_spl_optee.sh | 84 - 1 file changed, 84 deletions(-) delete mode 100755 arch/arm/mach-rockchip/fit_spl_optee.sh diff --git a/arch/arm/mach-rockchip/fit_spl_optee.sh b/arch/arm/mach-rockchip/fit_spl_optee.sh deleted file mode 100755 index 4118472d9f..00 --- a/arch/arm/mach-rockchip/fit_spl_optee.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0+ -# -# Copyright (C) 2019 Rockchip Electronic Co.,Ltd -# -# Script to generate FIT image source for 32-bit Rockchip SoCs with -# U-Boot proper, OPTEE, and devicetree. -# -# usage: $0 - -[ -z "$TEE" ] && TEE="tee.bin" - -if [ ! -f $TEE ]; then - echo "WARNING: TEE file $TEE NOT found, U-Boot.itb is non-functional" >&2 - echo "Please export path for TEE or copy tee.bin to U-Boot folder" >&2 - TEE=/dev/null -fi - -dtname=$1 -text_base=`sed -n "/SYS_TEXT_BASE=/s/CONFIG_SYS_TEXT_BASE=//p" .config \ - |tr -d '\r'` -dram_base=`sed -n "/SYS_SDRAM_BASE=/s/CONFIG_SYS_SDRAM_BASE=//p" \ - include/autoconf.mk|tr -d '\r'` -tee_base=`echo "obase=16;$(($dram_base+0x840))"|bc` -tee_base='0x'$tee_base - -cat << __HEADER_EOF -/* - * Copyright (C) 2017-2019 Rockchip Electronic Co.,Ltd - * - * Simple U-boot FIT source file containing U-Boot, dtb and optee - */ - -/dts-v1/; - -/ { - description = "FIT image with OP-TEE support"; - #address-cells = <1>; - - images { - uboot { - description = "U-Boot"; - data = /incbin/("u-boot-nodtb.bin"); - type = "standalone"; - os = "U-Boot"; - arch = "arm"; - compression = "none"; - load = <$text_base>; - }; - optee { - description = "OP-TEE"; - data = /incbin/("$TEE"); - type = "firmware"; - arch = "arm"; - os = "tee"; - compression = "none"; - load = <$tee_base>; - entry = <$tee_base>; - }; - fdt { - description = "$(basename $dtname .dtb)"; - data = /incbin/("$dtname"); - type = "flat_dt"; - compression = "none"; - }; -__HEADER_EOF - -cat << __CONF_HEADER_EOF - }; - - configurations { - default = "conf"; - conf { - description = "$(basename $dtname .dtb)"; - firmware = "optee"; - loadables = "uboot"; - fdt = "fdt"; - }; -__CONF_HEADER_EOF - -cat << __ITS_EOF - }; -}; -__ITS_EOF -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 18/27] Makefile: Fix a long line in cmd_mkfitimage
Fix this line which is over the limit. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fced33e777..163dc0b8b9 100644 --- a/Makefile +++ b/Makefile @@ -999,7 +999,8 @@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) quiet_cmd_mkfitimage = MKIMAGE $@ -cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@\ +cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) \ + -f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) quiet_cmd_cat = CAT $@ -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 26/27] x86: chromebook_panther: Correct the image layout
This board does not have microcode but at present that is not supported by Kconfig nor the binman image layout. Fix both of these. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/Kconfig| 7 ++- arch/x86/dts/u-boot.dtsi| 6 +- configs/chromebox_panther_defconfig | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f51b7c9f41..e3ba38cefd 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -594,8 +594,13 @@ config HAVE_REFCODE Various peripherals may fail to work. config HAVE_MICROCODE - bool + bool "Board requires a microcode binary" default y if !FSP_VERSION2 + help + Enable this if the board requires microcode to be loaded on boot. + Typically this is handed by the FSP for modern boards, but for + some older boards, it must be programmed by U-Boot, and that form + part of the image. config SMP bool "Enable Symmetric Multiprocessing" diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index 1e0a985b43..fa8106c8b8 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -75,11 +75,15 @@ u-boot { offset = ; }; -# else +# elif defined(CONFIG_HAVE_MICROCODE) /* If there is no SPL then we need to put microcode in U-Boot */ u-boot-with-ucode-ptr { offset = ; }; +# else + u-boot-nodtb { + offset = ; + }; # endif #endif #ifdef CONFIG_HAVE_MICROCODE diff --git a/configs/chromebox_panther_defconfig b/configs/chromebox_panther_defconfig index fd87ab262b..35ec3e912b 100644 --- a/configs/chromebox_panther_defconfig +++ b/configs/chromebox_panther_defconfig @@ -7,7 +7,9 @@ CONFIG_NR_DRAM_BANKS=8 CONFIG_VENDOR_GOOGLE=y CONFIG_TARGET_CHROMEBOX_PANTHER=y CONFIG_HAVE_MRC=y +# CONFIG_HAVE_MICROCODE is not set CONFIG_HAVE_VGA_BIOS=y +CONFIG_X86_OFFSET_U_BOOT=0xffa0 CONFIG_FIT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 21/27] rockchip: Convert evb-rk3288 over to use binman
At present this board uses a custom script to produce the .its file. Update it to use binman instead. Binman can create all the images that are needed. Signed-off-by: Simon Glass --- Changes in v4: - Move the .itb output to a separate rockchip-optee.dtsi file - Add a check for CONFIG_FIT before building the .its Changes in v3: - Drop use of rk322x.dtsi - Add changes to rk3288-u-boot.dtsi instead Kconfig | 2 +- arch/arm/dts/rk3288-u-boot.dtsi | 1 + arch/arm/dts/rockchip-optee.dtsi | 64 +++ arch/arm/mach-rockchip/rk3288/Kconfig | 1 + configs/evb-rk3288_defconfig | 2 +- 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/rockchip-optee.dtsi diff --git a/Kconfig b/Kconfig index 1dc5273c68..11c71141db 100644 --- a/Kconfig +++ b/Kconfig @@ -321,7 +321,7 @@ config BUILD_TARGET default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_GEN5 default "u-boot-spl.kwb" if ARCH_MVEBU && SPL default "u-boot-elf.srec" if RCAR_GEN3 - default "u-boot.itb" if SPL_LOAD_FIT && (ARCH_ROCKCHIP || \ + default "u-boot.itb" if !BINMAN && SPL_LOAD_FIT && (ARCH_ROCKCHIP || \ ARCH_SUNXI || RISCV || ARCH_ZYNQMP) default "u-boot.kwb" if ARCH_KIRKWOOD default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index c87f00141f..e3c6c10f13 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -4,6 +4,7 @@ */ #include "rockchip-u-boot.dtsi" +#include "rockchip-optee.dtsi" / { chosen { diff --git a/arch/arm/dts/rockchip-optee.dtsi b/arch/arm/dts/rockchip-optee.dtsi new file mode 100644 index 00..cde9b81b26 --- /dev/null +++ b/arch/arm/dts/rockchip-optee.dtsi @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2020 Google LLC + */ + +#include + +#if defined(CONFIG_HAS_ROM) && defined(CONFIG_FIT) +&binman { + itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = ; + description = "FIT image with OP-TEE support"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot"; + type = "standalone"; + os = "U-Boot"; + arch = "arm"; + compression = "none"; + load = ; + + u-boot-nodtb { + }; + }; + optee { + description = "OP-TEE"; + type = "firmware"; + arch = "arm"; + os = "tee"; + compression = "none"; + load = <(CONFIG_SYS_SDRAM_BASE + 0x840)>; + entry = <(CONFIG_SYS_SDRAM_BASE + 0x840)>; + + blob-ext { + filename = "tee.bin"; + }; + }; + fdt { + description = CONFIG_SYS_BOARD; + type = "flat_dt"; + compression = "none"; + + u-boot-dtb { + }; + }; + }; + + configurations { + default = "conf"; + conf { + description = CONFIG_SYS_BOARD; + firmware = "optee"; + loadables = "uboot"; + fdt = "fdt"; + }; + }; + }; + }; +}; +#endif diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index bb715e9d0e..20a00c5be7 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -48,6 +48,7 @@ config TARGET_CHROMEBOOK_SPEEDY config TARGET_EVB_RK3288 bool "Evb-RK3288" + select HAS_ROM select BOARD_LATE_INIT select TPL help diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig index 350189fc63..cd03767bd5 100644 --- a/configs/evb-rk3288_defconfig +++ b/configs/evb-
[PATCH v4 24/27] x86: Move the fdtmap away from the binary blobs
This causes conflicts on chromebook_link64. Move it to after U-Boot where there should be plenty of space. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/dts/u-boot.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index f0f8c71761..1e0a985b43 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -92,6 +92,8 @@ u-boot-dtb { }; #endif + fdtmap { + }; #ifdef CONFIG_HAVE_X86_FIT intel-fit { }; @@ -139,8 +141,6 @@ filename = CONFIG_FSP_FILE_S; }; #endif - fdtmap { - }; #ifdef CONFIG_HAVE_CMC intel-cmc { filename = CONFIG_CMC_FILE; -- 2.28.0.rc0.105.gf9edc3c819-goog
[PATCH v4 25/27] x86: chromebook_link64: Correct the image layout
At present the image layout is not correct, since it uses the SDRAM address of the 64-bit U-Boot as the ROM address. Fix this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) configs/chromebook_link64_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig index 7828e2dc34..772a75a8e7 100644 --- a/configs/chromebook_link64_defconfig +++ b/configs/chromebook_link64_defconfig @@ -17,8 +17,10 @@ CONFIG_HAVE_MRC=y CONFIG_SMP=y CONFIG_HAVE_VGA_BIOS=y CONFIG_DEFAULT_DEVICE_TREE="chromebook_link" +CONFIG_X86_OFFSET_U_BOOT=0xffa0 CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_SHOW_BOOT_PROGRESS=y -- 2.28.0.rc0.105.gf9edc3c819-goog
Re: [PATCH v3 21/49] dtoc: Allow adding variable-sized data to a dtb
Add a method for adding a property containing arbitrary bytes. Make sure that the tree can expand as needed in this case. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/fdt.py | 17 +++-- tools/dtoc/test_fdt.py | 4 2 files changed, 19 insertions(+), 2 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 13/49] binman: Add an etype for external binary blobs
It is useful to be able to distinguish between ordinary blobs such as u-boot.bin and external blobs that cannot be build by the U-Boot build system. If the external blobs are not available for some reason, then we know that a value image cannot be built. Introduce a new 'blob-ext' entry type for that. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) tools/binman/README.entries| 10 +++ tools/binman/etype/blob_ext.py | 31 ++ tools/binman/ftest.py | 12 + tools/binman/test/157_blob_ext.dts | 14 ++ tools/binman/test/158_blob_ext_missing.dts | 16 +++ 5 files changed, 83 insertions(+) create mode 100644 tools/binman/etype/blob_ext.py create mode 100644 tools/binman/test/157_blob_ext.dts create mode 100644 tools/binman/test/158_blob_ext_missing.dts Applied to u-boot-dm
Re: [PATCH v3 11/49] binman: Re-enable concurrent tests
With the change to absolute imports the concurrent tests feature unfortunately broke. Fix it. We cannot easy add a warning, since the output messes up tests which check the output. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/test_util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Applied to u-boot-dm
Re: [PATCH v3 12/49] binman: Use super() instead of specifying parent type
It is easier and less error-prone to use super() when the parent type is needed. Update binman to remove the type names. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) tools/binman/etype/_testing.py | 4 ++-- tools/binman/etype/blob.py | 2 +- tools/binman/etype/blob_dtb.py | 6 +++--- tools/binman/etype/blob_named_by_arg.py | 2 +- tools/binman/etype/cbfs.py | 14 +++--- tools/binman/etype/cros_ec_rw.py | 3 +-- tools/binman/etype/fdtmap.py | 2 +- tools/binman/etype/files.py | 2 +- tools/binman/etype/fill.py | 4 ++-- tools/binman/etype/fmap.py | 2 +- tools/binman/etype/gbb.py| 2 +- tools/binman/etype/image_header.py | 4 ++-- tools/binman/etype/intel_cmc.py | 2 +- tools/binman/etype/intel_descriptor.py | 4 ++-- tools/binman/etype/intel_fit.py | 4 ++-- tools/binman/etype/intel_fit_ptr.py | 4 ++-- tools/binman/etype/intel_fsp.py | 2 +- tools/binman/etype/intel_fsp_m.py| 2 +- tools/binman/etype/intel_fsp_s.py| 2 +- tools/binman/etype/intel_fsp_t.py| 2 +- tools/binman/etype/intel_ifwi.py | 4 ++-- tools/binman/etype/intel_me.py | 2 +- tools/binman/etype/intel_mrc.py | 2 +- tools/binman/etype/intel_refcode.py | 2 +- tools/binman/etype/intel_vbt.py | 2 +- tools/binman/etype/intel_vga.py | 2 +- tools/binman/etype/mkimage.py| 2 +- .../etype/powerpc_mpc85xx_bootpg_resetvec.py | 2 +- tools/binman/etype/section.py| 16 tools/binman/etype/text.py | 2 +- tools/binman/etype/u_boot.py | 2 +- tools/binman/etype/u_boot_dtb.py | 2 +- tools/binman/etype/u_boot_dtb_with_ucode.py | 4 ++-- tools/binman/etype/u_boot_elf.py | 4 ++-- tools/binman/etype/u_boot_img.py | 2 +- tools/binman/etype/u_boot_nodtb.py | 2 +- tools/binman/etype/u_boot_spl.py | 2 +- tools/binman/etype/u_boot_spl_bss_pad.py | 2 +- tools/binman/etype/u_boot_spl_dtb.py | 2 +- tools/binman/etype/u_boot_spl_elf.py | 2 +- tools/binman/etype/u_boot_spl_nodtb.py | 2 +- tools/binman/etype/u_boot_spl_with_ucode_ptr.py | 2 +- tools/binman/etype/u_boot_tpl.py | 2 +- tools/binman/etype/u_boot_tpl_dtb.py | 2 +- tools/binman/etype/u_boot_tpl_dtb_with_ucode.py | 2 +- tools/binman/etype/u_boot_tpl_elf.py | 2 +- tools/binman/etype/u_boot_tpl_with_ucode_ptr.py | 2 +- tools/binman/etype/u_boot_ucode.py | 2 +- tools/binman/etype/u_boot_with_ucode_ptr.py | 2 +- tools/binman/etype/vblock.py | 2 +- tools/binman/etype/x86_reset16.py| 2 +- tools/binman/etype/x86_reset16_spl.py| 2 +- tools/binman/etype/x86_reset16_tpl.py| 2 +- tools/binman/etype/x86_start16.py| 2 +- tools/binman/etype/x86_start16_spl.py| 2 +- tools/binman/etype/x86_start16_tpl.py| 2 +- tools/binman/image.py| 12 ++-- 57 files changed, 86 insertions(+), 87 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 10/49] binman: Adjust pylibfdt for incremental build
If the pylibfdt shared-object file is detected, then Python assumes that the libfdt.py file exists also. Sometimes when an incremental build aborts, the shared-object file is built but the libfdt.py is not. The only way out at this point is to use 'make mkproper', or similar. Fix this by removing the .so file before it is built. This seems to make Python rebuild everything. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) scripts/dtc/pylibfdt/Makefile | 3 +++ 1 file changed, 3 insertions(+) Applied to u-boot-dm
Re: [RFC PATCH 02/16] patman: Move main code out to a control module
To make testing easier, move the code out from main into a separate 'control' module and split it into four parts: setup, preparing patches, checking patches and emailing patches. Add comments and fix a few code-style issues while we are here. Signed-off-by: Simon Glass --- tools/patman/checkpatch.py | 6 ++ tools/patman/control.py| 170 + tools/patman/gitutil.py| 4 +- tools/patman/main.py | 57 + tools/patman/series.py | 2 +- 5 files changed, 182 insertions(+), 57 deletions(-) create mode 100644 tools/patman/control.py Applied to u-boot-dm
Re: [PATCH v3 16/49] patman: Update errors and warnings to use stderr
When warnings and errors are produced by tools they should be written to stderr. Update the tout implementation to handle this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) tools/binman/ftest.py | 2 +- tools/patman/tout.py | 5 - 2 files changed, 5 insertions(+), 2 deletions(-) Applied to u-boot-dm
Re: [RFC PATCH 01/16] patman: Use test_util to show test results
On Tue, 2020-07-07 at 11:09 +1000, Daniel Axtens wrote: > Simon Glass writes: > > > Hi Daniel, > > > > On Sun, 5 Jul 2020 at 22:50, Daniel Axtens wrote: > > > Daniel Axtens writes: > > > > > > > Hi Simon, > > > > > > > > I can't see a cover letter so apologies if I've misunderstood something > > > > basic, but this doesn't appear to apply to the patchwork tree - I'm > > > > guessing the patchwork relevance is with regards to the last few patches > > > > that (AFAICT) parse the patchwork web interface for information? > > > > > > Ah, nevermind, the cover letter got caught in moderation. I've released > > > it. > > > > > > pwclient speaks the old, less documented XML-RPC API. We have a new > > > REST API which is much better documented, and is explorable > > > (e.g. https://patchwork.ozlabs.org/api/ and > > > https://patchwork.readthedocs.io/en/latest/api/rest/ ) > > > > > > > I haven't fully digested the patches (and I lack a lot of context) but > > > > is there a reason the patchwork API isn't able to meet your needs here? > > > > (And if so, could we extend it rather than having you parse the > > > > frontend?) > > > > > > So these questions still stand but for the REST API. > > > > So use the REST API instead of the web page? That sounds fine to me. > > Is it generally enabled on patchwork servers? > > I mean patman is your code so it's ultimately not my call :P But yes, > I'd strongly prefer you used the REST API! It is enabled on ozlabs.org > and kernel.org and has been for a while (~a couple of years). > > > What is the status of pwclient? Is it dead? Is there a replacement? > > I'd love to use a Python library if one exists. > > Stephen F is the expert on the client stuff, so I'm not going to make a > call on the status of pwclient. All I am confident to say is that I have > migrated to using 'git-pw' and I recommend others do so to too. pwclient is alive and won't be going anywhere, but it's still using the now-deprecated XML-RPC API. Eventually this will move to the REST API, but I just haven't found the time to do so yet. > I'm not sure if a dedicated Python client library exists: the last time > I wanted to write a Python client app I found it simple enough to just > use the JSON that the API provides directly. But the place I'd start > with is git-pw. There's no patchwork SDK yet and git-pw is intended for use as a tool rather than a library (the internal API isn't stable). However, the Patchwork API itself is very trivial so requests should get you what you want very easily. Stephen > Regards, > Daniel > > > Regards, > > SImon Applied to u-boot-dm
Re: [RFC PATCH 05/16] patman: Allow skipping patches at the end
The -s option allows skipping patches at the top of the branch. Sometimes there are commits at the bottom that need to be skipped. At present it is necessary to count the number of commits and then use -c to tell patman how many to process. Add a -e option to easily skip a number of commits at the bottom of the branch. Signed-off-by: Simon Glass --- tools/patman/control.py | 8 +--- tools/patman/func_test.py | 13 +++-- tools/patman/main.py | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 19/49] binman: Allow zero-length entries to overlap
Some binary blobs unfortunately obtain their position in the image from other binary blobs, such as Intel's 'descriptor'. In this case we cannot rely on packing to work. It is not possible to produce a valid image in any case, due to the missing blobs. Allow zero-length overlaps so that this does not cause any problems. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) tools/binman/etype/section.py | 2 +- tools/binman/ftest.py | 4 tools/binman/test/160_pack_overlap_zero.dts | 18 ++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/160_pack_overlap_zero.dts Applied to u-boot-dm
Re: [PATCH v3 22/49] binman: Add support for generating a FIT
FIT (Flat Image Tree) is the main image format used by U-Boot. In some cases scripts are used to create FITs within the U-Boot build system. This is not ideal for various reasons: - Each architecture has its own slightly different script - There are no tests - Some are written in shell, some in Python To help address this, add support for FIT generation to binman. This works by putting the FIT source directly in the binman definition, with the ability to adjust parameters, etc. The contents of each FIT image come from sub-entries of the image, as is normal with binman. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/README.entries| 40 ++ tools/binman/etype/fit.py | 164 + tools/binman/ftest.py | 54 tools/binman/test/161_fit.dts | 62 ++ tools/binman/test/162_fit_external.dts | 64 ++ 5 files changed, 384 insertions(+) create mode 100644 tools/binman/etype/fit.py create mode 100644 tools/binman/test/161_fit.dts create mode 100644 tools/binman/test/162_fit_external.dts Applied to u-boot-dm
Re: [PATCH v3 20/49] mkimage: Allow updating the FIT timestamp
Normally the FIT timestamp is created the first time mkimage is run on a FIT, when converting the source .its to the binary .fit file. This corresponds to using the -f flag. But if the original input to mkimage is a binary file (already compiled) then the timestamp is assumed to have been set previously. Add a -t flag to allow setting the timestamp in this case. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) doc/mkimage.1 | 9 + tools/fit_image.c | 2 +- tools/imagetool.h | 1 + tools/mkimage.c | 5 - 4 files changed, 15 insertions(+), 2 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 09/49] binman: Fix a few typos in the entry docs
Some typos have been fixed in the generated entry docs but the code was not updated. Fix this. Signed-off-by: Simon Glass --- Changes in v3: - Fix the code rather than breaking the README tools/binman/etype/intel_me.py| 2 +- tools/binman/etype/powerpc_mpc85xx_bootpg_resetvec.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 07/49] binman: Set a default toolpath
When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass --- Changes in v3: - Set a default toolpath for ease of use tools/binman/main.py | 5 + 1 file changed, 5 insertions(+) Applied to u-boot-dm
Re: [PATCH v3 06/49] binman: Specify the toolpath when running test coverage
At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/main.py | 10 +++--- tools/patman/test_util.py | 9 ++--- 2 files changed, 13 insertions(+), 6 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 14/49] binman: Convert existing binary blobs to blob_ext
Many of the existing blobs rely on external binaries which may not be available. Move them over to use blob_ext to indicate this. Unfortunately cros-ec-rw cannot use this class because it inherits another. So set the 'external' value for that class. While we are here, drop the import of Entry since it is not used (and pylint3 complains). Signed-off-by: Simon Glass --- Changes in v3: - Update commit message to explain cros_ec_rw and mention dropping Entry tools/binman/etype/cros_ec_rw.py | 1 + tools/binman/etype/intel_cmc.py | 5 ++--- tools/binman/etype/intel_descriptor.py| 4 ++-- tools/binman/etype/intel_fit.py | 4 ++-- tools/binman/etype/intel_fit_ptr.py | 4 ++-- tools/binman/etype/intel_fsp.py | 5 ++--- tools/binman/etype/intel_fsp_m.py | 5 ++--- tools/binman/etype/intel_fsp_s.py | 5 ++--- tools/binman/etype/intel_fsp_t.py | 5 ++--- tools/binman/etype/intel_ifwi.py | 4 ++-- tools/binman/etype/intel_me.py| 5 ++--- tools/binman/etype/intel_mrc.py | 5 ++--- tools/binman/etype/intel_refcode.py | 5 ++--- tools/binman/etype/intel_vbt.py | 5 ++--- tools/binman/etype/intel_vga.py | 5 ++--- tools/binman/etype/powerpc_mpc85xx_bootpg_resetvec.py | 1 - 16 files changed, 29 insertions(+), 39 deletions(-) Applied to u-boot-dm
Re: [RFC PATCH 08/16] patman: Add a 'test' subcommand
At present we use --test to indicate that tests should be run. It is better to use a subcommand for list, like binman. Change it and adjust the existing code to fit under a 'send' subcommand, the default. Give this subcommand the same default arguments as the others. Signed-off-by: Simon Glass --- .azure-pipelines.yml | 2 +- .gitlab-ci.yml| 2 +- .travis.yml | 2 +- test/run | 2 +- tools/patman/main.py | 75 +-- tools/patman/test_util.py | 2 +- 6 files changed, 45 insertions(+), 40 deletions(-) Applied to u-boot-dm
Re: [RFC PATCH 07/16] patman: Allow different commands
At present patman only does one thing so does not have any comments. We want to add a few more command, so create a sub-parser for the default command ('send'). Signed-off-by: Simon Glass --- tools/patman/main.py | 77 +++- 1 file changed, 41 insertions(+), 36 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 18/49] binman: Allow missing Intel blobs
Update the Intel blob entries to support missing binaries. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) tools/binman/etype/intel_descriptor.py | 7 - tools/binman/etype/intel_ifwi.py | 17 --- tools/binman/etype/section.py | 4 +-- tools/binman/ftest.py | 41 +- 4 files changed, 55 insertions(+), 14 deletions(-) Applied to u-boot-dm
Re: [RFC PATCH 04/16] patman: Allow creating patches for another branch
Add a -b option to allow patches to be created from a branch other than the current one. Signed-off-by: Simon Glass --- tools/patman/control.py | 13 - tools/patman/func_test.py | 13 +++-- tools/patman/gitutil.py | 19 ++- tools/patman/main.py| 2 ++ tools/patman/patchstream.py | 8 +--- 5 files changed, 40 insertions(+), 15 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 15/49] binman: Allow external binaries to be missing
Sometimes it is useful to build an image even though external binaries are not present. This allows the build system to continue to function without these files, albeit not producing valid images. U-Boot does with with ATF (ARM Trusted Firmware) today. Add a new flag to binman to request this behaviour. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: - Move the SetAllowMissing() function into this patch - Keep the _allow_missing property to sections only tools/binman/README.entries| 3 +++ tools/binman/cmdline.py| 2 ++ tools/binman/control.py| 7 +-- tools/binman/entry.py | 9 + tools/binman/etype/blob_ext.py | 13 ++--- tools/binman/etype/section.py | 24 tools/binman/ftest.py | 8 +++- tools/patman/tools.py | 8 ++-- 8 files changed, 66 insertions(+), 8 deletions(-) Applied to u-boot-dm
Re: [PATCH v3 17/49] binman: Detect when valid images are not produced
When external blobs are missing, show a message indicating that the images are not functional. Signed-off-by: Simon Glass --- Changes in v3: - Move the SetAllowMissing() function into an earlier patch tools/binman/control.py | 16 +++-- tools/binman/entry.py | 12 ++ tools/binman/etype/blob_ext.py| 1 + tools/binman/etype/section.py | 12 ++ tools/binman/ftest.py | 14 ++- .../binman/test/159_blob_ext_missing_sect.dts | 23 +++ tools/patman/tout.py | 1 + 7 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 tools/binman/test/159_blob_ext_missing_sect.dts Applied to u-boot-dm