[PATCH] drivers: clk: Adjust temp var data type to properly match that of struct clk_ops
In commit 5c5992cb90cf ("clk: Add debugging for return values"), a temporary storage variable was added around the ops->get_rate() call inside clk_get_rate(), so that the result could be passed through log_ret. This temporary variable was declared as an int, yet when we look in struct clk_ops, we can see this needs to be a ulong: ulong (*get_rate)(struct clk *clk); This was resulting in a signed to unsigned casting error on our builds, where a clock value of 0xABCDABCD was being incorrectly cast to 0xABCDABCD. Signed-off-by: Nathan Barrett-Morrison --- drivers/clk/clk-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index dc3e9d6a26..4e3e3b8537 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -471,7 +471,7 @@ void clk_free(struct clk *clk) ulong clk_get_rate(struct clk *clk) { const struct clk_ops *ops; - int ret; + ulong ret; debug("%s(clk=%p)\n", __func__, clk); if (!clk_valid(clk)) -- 2.34.1
Re: Raspberry Pi won’t boot from compressed subvolume (BTRFS)
Hi Matthias, thanks for your time and response. > Just a random guess, but bcn2837-rpi-3-b.dtb does look right, the DTB should > be > called bcm2837-rpi-3-b.dtb Sorry, that was an OCR error (wasn't sure how to screenshot or log to a file in this context, so pictures -> OCR seemed like my best option, pictures available here: https://discourse.nixos.org/t/btrfs-pi-wont-boot-from-compressed-subvolume/18462/2?u=n8henrie). It is indeed `bc*m*`... in the actual output. > Then you try to fixup that address which has no valid DTB and fails. > > Anyway to me that sounds like a nixOS problem rather then a U-Boot problem. > I'm > not even sure which version of U-Boot you are using and if it has any patches > on > top of the upstream version. Sorry, I included the link to the relevant code (https://github.com/NixOS/nixpkgs/blob/3d4e586313d292c9e764a8e88a1fdccb16ffb2d3/pkgs/misc/uboot/default.nix) but should have included those details: ``` defaultSrc = fetchurl { url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${defaultVersion}.tar.bz2";; hash = "sha256-gbRUMifbIowD+KG/XdvIE7C7j2VVzkYGTvchpvxoBBM="; defaultVersion = "2022.01"; ``` By default it will have two patches: - https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/uboot/0001-configs-rpi-allow-for-bigger-kernels.patch - https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/uboot/0001-rpi-Copy-properties-from-firmware-dtb-to-the-loaded-.patch The latter looks like it might be relevant. I was suspicious about it being a u-boot issue because everything works fine by default, it's only when I enable zstd compression that I get the above errors. However I'm pretty new to NixOS and obviously know little about u-boot, so you may well be correct! Nate On Wed, May 25, 2022 at 2:58 AM Matthias Brugger wrote: > > > > On 22/05/2022 17:36, Nathan Henrie wrote: > > Hello u-boot team, > > > > I’ve been experimenting for about a year with a NixOS-based Raspberry Pi > > image, with the end goal of a zstd-compressed image that uses BTRFS > > subvolumes, having the root filesystem at @ and boot at @boot (with several > > other subvolumes). The NixOS Raspberry Pi images use u-boot by default. > > I’ve started a few discussions in the NixOS community as I learn and > > iterate: > > https://discourse.nixos.org/t/raspberry-pi-nixos-on-btrfs-root/14081 and > > I’ve made my code available at: https://github.com/n8henrie/nixos-btrfs-pi > > . I’m sure it’s obvious (or will be soon) that I’m a hobbyist, a novice > > with NixOS, and that I understand very little about u-boot and bootloaders > > in general, so I hope you can be patient as I humbly ask for someone to > > point me in the right direction. > > > > For reference, the official NixOS code for generating u-boot images is > > here: > > https://github.com/NixOS/nixpkgs/blob/3d4e586313d292c9e764a8e88a1fdccb16ffb2d3/pkgs/misc/uboot/default.nix > > > > I’ve made a lot of progress, including an image that reliably boots from > > @boot to the @ root subvolume with the u-boot configuration: > > > > CONFIG_CMD_BTRFS=y > > CONFIG_ZSTD=y > > CONFIG_BOOTCOMMAND="setenv boot_prefixes / /boot/ /@/ /@boot/; run > > distro_bootcmd;" > > > > with kernel params: "root=LABEL=NIXOS_SD" "rootfstype=btrfs" > > "rootflags=subvol=@" > > > > Unfortunately, after the initial boot and going through the initial OS > > installation steps, if I have compression enabled, it reboots into a boot > > loop with the following error messages: > > > > Scanning mmc 0:2... > > Found /@boot/extlinux/extlinux.conf > > Retrieving file: /@boot/extlinux/extlinux.conf > > 2938 bytes read in 27 ms (105.5 KiB/s) > > > > 1 NixOS Default > > 2 NixOS Configuration 4 (2022-02-24 21:34 22.05pre356135.7f9b6c2babf) > > 3 NixOS Configuration 3 (2022-02-25 03:59 22.05pre356435.7/9b6eZbabf) > > 4: NixOS Configuration 2 (2022-02-24 21:34 22.05pre356435.7/9b6c2babr) > > 5: NixOS > > Enter choice: 1: NixOS - Default > > Retrieving file: > > /@boot/extlinux/..nixos/zhbharzhzqga617uc37uk0g6q1bx891u-initrd-linux-5.10.101-initrd > > 20588420 bytes read in 1910 ms (10.3 MiB/s) > > Retrieving file: > > /@boot/extlinux/..nixos/6c1m6j0k1gmjrmikOyyizariiry?Zlqr-linux-5.10.101-Image > > 50629120 bytes read in 6863 ms (7 MiB/s) > > append: > > init-mix/store/pikl8ju4077iaix36n8mifzu6l6rcajz-nixos-system-nixpi-22.05p > > re356435-7/9b6eZbabf/init console=tty1 console=ttyAMAO console=ttyS0, > > 1115200 root= LABEL=-NIXOS_SD rootfstype=btrfs rootflags=subvol=@ > > loglevel=4 > > Retrieving file: > > /@boot/ex
Raspberry Pi won’t boot from compressed subvolume (BTRFS)
Hello u-boot team, I’ve been experimenting for about a year with a NixOS-based Raspberry Pi image, with the end goal of a zstd-compressed image that uses BTRFS subvolumes, having the root filesystem at @ and boot at @boot (with several other subvolumes). The NixOS Raspberry Pi images use u-boot by default. I’ve started a few discussions in the NixOS community as I learn and iterate: https://discourse.nixos.org/t/raspberry-pi-nixos-on-btrfs-root/14081 and I’ve made my code available at: https://github.com/n8henrie/nixos-btrfs-pi . I’m sure it’s obvious (or will be soon) that I’m a hobbyist, a novice with NixOS, and that I understand very little about u-boot and bootloaders in general, so I hope you can be patient as I humbly ask for someone to point me in the right direction. For reference, the official NixOS code for generating u-boot images is here: https://github.com/NixOS/nixpkgs/blob/3d4e586313d292c9e764a8e88a1fdccb16ffb2d3/pkgs/misc/uboot/default.nix I’ve made a lot of progress, including an image that reliably boots from @boot to the @ root subvolume with the u-boot configuration: CONFIG_CMD_BTRFS=y CONFIG_ZSTD=y CONFIG_BOOTCOMMAND="setenv boot_prefixes / /boot/ /@/ /@boot/; run distro_bootcmd;" with kernel params: "root=LABEL=NIXOS_SD" "rootfstype=btrfs" "rootflags=subvol=@" Unfortunately, after the initial boot and going through the initial OS installation steps, if I have compression enabled, it reboots into a boot loop with the following error messages: Scanning mmc 0:2... Found /@boot/extlinux/extlinux.conf Retrieving file: /@boot/extlinux/extlinux.conf 2938 bytes read in 27 ms (105.5 KiB/s) 1 NixOS Default 2 NixOS Configuration 4 (2022-02-24 21:34 22.05pre356135.7f9b6c2babf) 3 NixOS Configuration 3 (2022-02-25 03:59 22.05pre356435.7/9b6eZbabf) 4: NixOS Configuration 2 (2022-02-24 21:34 22.05pre356435.7/9b6c2babr) 5: NixOS Enter choice: 1: NixOS - Default Retrieving file: /@boot/extlinux/..nixos/zhbharzhzqga617uc37uk0g6q1bx891u-initrd-linux-5.10.101-initrd 20588420 bytes read in 1910 ms (10.3 MiB/s) Retrieving file: /@boot/extlinux/..nixos/6c1m6j0k1gmjrmikOyyizariiry?Zlqr-linux-5.10.101-Image 50629120 bytes read in 6863 ms (7 MiB/s) append: init-mix/store/pikl8ju4077iaix36n8mifzu6l6rcajz-nixos-system-nixpi-22.05p re356435-7/9b6eZbabf/init console=tty1 console=ttyAMAO console=ttyS0, 1115200 root= LABEL=-NIXOS_SD rootfstype=btrfs rootflags=subvol=@ loglevel=4 Retrieving file: /@boot/extlinux/../nixos/6c16j0k1gmjrmikOyyizari1ry72lqr-linux-5.10.101-dtbs/broadcon/bcn2837-rpi-3-b.dtb 14310 bytes read in 66 ms (210.9 KiB/s) Moving Image from 0x8 to 0x20, end=32f ## Flattened Device Tree blob at 0370 Booting using the fdt blob at 0x370 Using Device Tree in place at 0370 end 037067e5 fdt_find_or_add_subnode: memory: FDT_ERR_BADSTRUCTURE ERROR: arch-specific fdt fixup failed - must RESET the board to recover. FDT creation failed! resetting ... This happens even though I have CONFIG_ZSTD=y. If I do *not* enable compression (in my BTRFS mount options), it reboots normally and everything works! I may have made some OCR / C&P errors above; I’ve posted some pictures of the error messages (and similar discussion to this email, with no responses) here: https://discourse.nixos.org/t/btrfs-pi-wont-boot-from-compressed-subvolume/18462/2 I’m not currently using BTRFS RAID, just a single device. One of my other (x86_64) machines uses a similar setup with @, @boot, and zstd-compression with grub and works well, so I’m hoping this is also possible with u-boot. Seeing that the errors mention the FDT and fixup, I tried CONFIG_ARCH_FIXUP_FDT_MEMORY with both =y and =n without interesting changes to the error messages. What I’m assuming, based on the above, is that re-writing the @boot subvolume with compression is moving the location of the device tree files and that u-boot is no longer able to find the necessary files (some of which I think may also be in the nix store in the @nix subvolume). Does that sound like a reasonable guess as to what is going on? If so, are there config options or settings that I might be able to use to help u-boot find the necessary files after things are re-written with compression? Many thanks in advance for your time and attention, and thanks for your hard work on u-boot!
Re: spl: spi: Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices
Hi Sean, Unfortunately, I was testing this stuff out a few months ago and our customer has moved on from using a raw kernel and is now using FIT. I've looked at your entire patchset more closely and agree that the last patch you sent would be necessary as well. It looks like that one *should *convert SPL+SPI+Falcon into using your more generic spi_load() interface as well. It's nice to see all of the SPL load interface being reworked. I noticed a ton of divergence between the various storage devices back when I was looking at it. If I get a chance, I will wrap back around and try your patchset, but it's going to be awhile before our customer is enabling Falcon again I believe. Sincerely, Nathan On Tue, Apr 19, 2022 at 6:03 PM Sean Anderson wrote: > Hi Nathan, > > On 4/19/22 5:49 PM, Nathan Barrett-Morrison wrote: > > [You don't often get email from nathan.morri...@timesys.com. Learn why > this is important at http://aka.ms/LearnAboutSenderIdentification.] > > > > Hi Sean, > > > > Thanks for the response. I don't have my embedded board I'm doing this > on quite up to this version of U-Boot, but it does appear your patchset > should resolve my issue in the future. So please disregard my patch, I > think we're good! > > Actually, I'm not sure it will resolve your issue, since you seem to be > having issues > with falcon boot, which I didn't modify. Can you try the following patch > in addition > to the ones I linked above? I haven't tested it at all, so ymmv. > > diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c > index 037db1a19f..0ab8a10300 100644 > --- a/common/spl/spl_spi.c > +++ b/common/spl/spl_spi.c > @@ -18,41 +18,6 @@ > #include > #include > > -#if CONFIG_IS_ENABLED(OS_BOOT) > -/* > - * Load the kernel, check for a valid header we can parse, and if found > load > - * the kernel and then device tree. > - */ > -static int spi_load_image_os(struct spl_image_info *spl_image, > -struct spl_boot_device *bootdev, > -struct spi_flash *flash, > -struct image_header *header) > -{ > - int err; > - > - /* Read for a header, parse or error out. */ > - spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), > - (void *)header); > - > - if (image_get_magic(header) != IH_MAGIC) > - return -1; > - > - err = spl_parse_image_header(spl_image, bootdev, header); > - if (err) > - return err; > - > - spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, > - spl_image->size, (void *)spl_image->load_addr); > - > - /* Read device tree. */ > - spi_flash_read(flash, CONFIG_SYS_SPI_ARGS_OFFS, > - CONFIG_SYS_SPI_ARGS_SIZE, > - (void *)CONFIG_SYS_SPL_ARGS_ADDR); > - > - return 0; > -} > -#endif > - > static ulong spl_spi_fit_read(struct spl_load_info *load, ulong sector, > ulong count, void *buf) > { > @@ -71,6 +36,29 @@ unsigned int __weak spl_spi_get_uboot_offs(struct > spi_flash *flash) > return CONFIG_SYS_SPI_U_BOOT_OFFS; > } > > +static int spi_do_load_image(struct spl_image_info *spl_image, > +struct spl_boot_device *bootdev, > +struct spl_load_info *load, > +unsigned int payload_offs) > +{ > + int ret; > + struct image_header *header; > + > + header = spl_get_load_buffer(-sizeof(*header), sizeof(*header)); > + > + /* mkimage header is 64 bytes. */ > + ret = spi_flash_read(flash, payload_offs, sizeof(*header), > +(void *)header); > + if (ret) { > + debug("%s: Failed to read from SPI flash (err=%d)\n", > + __func__, ret); > + return ret; > + } > + > + return spl_load(spl_image, bootdev, &load, header, 0, > + payload_offs); > +} > + > /* > * The main entry for SPI booting. It's necessary that SDRAM is already > * configured and available since this code loads the main U-Boot image > @@ -82,7 +70,6 @@ static int spl_spi_load_image(struct spl_image_info > *spl_image, > int err = 0; > unsigned int payload_offs; > struct spi_flash *flash; > - struct image_header *header; > struct spl_load_info load = { > .bl_len = 1, > .read = spl_spi_fit_read, > @@ -106,31 +93,24 @@ static int spl_spi_load_image(struct s
Re: spl: spi: Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices
Hi Sean, Thanks for the response. I don't have my embedded board I'm doing this on quite up to this version of U-Boot, but it does appear your patchset should resolve my issue in the future. So please disregard my patch, I think we're good! Sincerely, Nathan On 4/19/22 17:43, Sean Anderson wrote: > Hi Nathan, > > On 4/19/22 5:38 PM, Nathan Barrett-Morrison wrote: >> [You don't often get email from nathan.morri...@timesys.com. Learn why this >> is important at http://aka.ms/LearnAboutSenderIdentification.] >> >> Hi Tom, >> >> I believe this patch is still relevant, so I'm resubmitting it. It was >> previously marked as superseded. >> >> Thanks, >> Nathan >> >> From 0bb98a42bcb01c078f63513d9151d307dbfd6ccd Mon Sep 17 00:00:00 2001 >> From: Nathan Barrett-Morrison >> Date: Tue, 19 Apr 2022 17:35:21 -0400 >> Subject: [PATCH v2] Allow Falcon Mode boot to use raw kernel image when >> booting >> via SPI. >> >> When using Falcon Mode boot with a raw, unwrapped kernel image, the >> bootz_setup() call inside of spl_parse_image_header() is >> unreachable because the mkimage header magic check in spi_load_image_os() >> will never pass. This check is entirely redundant and unnecessary, >> as the spl_parse_image_header() call will also check for IH_MAGIC. >> >> Signed-off-by: Nathan Barrett-Morrison >> Cc: Tom Rini >> --- >> Changes for v2: >>- Remove proposed CONFIG_SYS_SPI_KERNEL_SKIP_HEADER option, as we've >> determined the entire check is redundant and unnecessary. Just delete it >> instead. >> >> common/spl/spl_spi.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c >> index cf3f7ef4c0..22e9c87eae 100644 >> --- a/common/spl/spl_spi.c >> +++ b/common/spl/spl_spi.c >> @@ -34,9 +34,6 @@ static int spi_load_image_os(struct spl_image_info >> *spl_image, >> spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), >>(void *)header); >> >> - if (image_get_magic(header) != IH_MAGIC) >> - return -1; >> - >> err = spl_parse_image_header(spl_image, bootdev, header); >> if (err) >> return err; >> -- >> 2.30.2 >> > > Can you see if [1] fixes your problem? You will also need the first patch in > the series. > > --Sean > > [1] > https://lore.kernel.org/u-boot/20220401190405.1932697-8-sean.ander...@seco.com/
spl: spi: Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices
Hi Tom, I believe this patch is still relevant, so I'm resubmitting it. It was previously marked as superseded. Thanks, Nathan >From 0bb98a42bcb01c078f63513d9151d307dbfd6ccd Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 19 Apr 2022 17:35:21 -0400 Subject: [PATCH v2] Allow Falcon Mode boot to use raw kernel image when booting via SPI. When using Falcon Mode boot with a raw, unwrapped kernel image, the bootz_setup() call inside of spl_parse_image_header() is unreachable because the mkimage header magic check in spi_load_image_os() will never pass. This check is entirely redundant and unnecessary, as the spl_parse_image_header() call will also check for IH_MAGIC. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- Changes for v2: - Remove proposed CONFIG_SYS_SPI_KERNEL_SKIP_HEADER option, as we've determined the entire check is redundant and unnecessary. Just delete it instead. common/spl/spl_spi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index cf3f7ef4c0..22e9c87eae 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -34,9 +34,6 @@ static int spi_load_image_os(struct spl_image_info *spl_image, spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), (void *)header); - if (image_get_magic(header) != IH_MAGIC) - return -1; - err = spl_parse_image_header(spl_image, bootdev, header); if (err) return err; -- 2.30.2
Falcon Mode Support For Uncompressed Kernel Images
Hi Tom, While trying to bring up Falcon Mode boot on an ARM64 board, I discovered that there is no path which allows you to use an uncompressed kernel image (booti). I've added this path and attached the relevant patch. Sincerely, Nathan >From f1c34333f79996bd2927a60f4858c01699431cba Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Wed, 2 Feb 2022 15:05:18 -0500 Subject: [PATCH v2] Add in the ability to load and boot an uncompressed kernel image during the Falcon Mode boot sequence. This is required for architectures which do not support compressed kernel images (i.e. ARM64). This is only used while not booting via FIT image. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- Changes for v2: - Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD_BOOTI and CMD_BOOTZ instead arch/arm/lib/Makefile | 5 - common/spl/spl.c | 21 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index c603fe61bc..08b7475e37 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o else obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o +ifdef CONFIG_SPL_FRAMEWORK +obj-$(CONFIG_CMD_BOOTI) += image.o +obj-$(CONFIG_CMD_BOOTZ) += zimage.o +endif obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o endif ifdef CONFIG_ARM64 diff --git a/common/spl/spl.c b/common/spl/spl.c index c9750ee163..7b86443f1b 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -107,6 +107,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end) { return 1; } + +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *size, bool force_reloc) +{ +return 1; +} #endif /* Weak default function for arch/board-specific fixups to the spl_image_info */ @@ -366,6 +371,21 @@ int spl_parse_image_header(struct spl_image_info *spl_image, #endif #if CONFIG_IS_ENABLED(OS_BOOT) +#if defined(CMD_BOOTI) + ulong start, size; + + if (!booti_setup((ulong)header, &start, &size, 0)) { + spl_image->name = "Linux"; + spl_image->os = IH_OS_LINUX; + spl_image->load_addr = start; + spl_image->entry_point = start; + spl_image->size = size; + debug(SPL_TPL_PROMPT + "payload Image, load addr: 0x%lx size: %d\n", + spl_image->load_addr, spl_image->size); + return 0; + } +#elif defined(CMD_BOOTZ) ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { @@ -379,6 +399,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } +#endif #endif if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, sizeof(*header))) -- 2.30.2
drivers: mtd: spi: Allow Quad I/O enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem
Hi All, I noticed this was missing from the spi-nor-tiny.c subsystem while trying to use an ISSI SPI flash device with the U-Boot SPL. This patch will allow Quad (4x) I/O mode to be enabled with ISSI flash devices while inside the U-Boot SPL / using spi-nor-tiny.c. Sincerely, Nathan >From 1a7fd52f21d3d3ad4b2ff736a9ea3c1affb9c007 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Wed, 26 Jan 2022 13:44:39 -0500 Subject: [PATCH] drivers: mtd: spi: Allow Quad I/O enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem Signed-off-by: Nathan Barrett-Morrison Cc: Jagan Teki Cc: Vignesh R CC: Tom Rini --- drivers/mtd/spi/spi-nor-tiny.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index 130917aaa8..4957448d11 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -664,6 +664,7 @@ static int spi_nor_setup(struct spi_nor *nor, const struct flash_info *info, switch (JEDEC_MFR(info)) { #ifdef CONFIG_SPI_FLASH_MACRONIX case SNOR_MFR_MACRONIX: + case SNOR_MFR_ISSI: err = macronix_quad_enable(nor); break; #endif -- 2.34.1
drivers: mtd: spi: Use correct 4 byte mode enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem
Hi All, I noticed this was missing from the spi-nor-tiny.c subsystem while trying to use an ISSI SPI flash device with the U-Boot SPL. This patch will allow 4 byte addressing mode to be enabled with ISSI flash devices while inside the U-Boot SPL / using spi-nor-tiny.c. Sincerely, Nathan >From 218e00fcaea8c5795e792af09f5d21fc19e3d831 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Wed, 26 Jan 2022 13:43:53 -0500 Subject: [PATCH] drivers: mtd: spi: Use correct 4 byte mode enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem Signed-off-by: Nathan Barrett-Morrison Cc: Jagan Teki Cc: Vignesh R CC: Tom Rini --- drivers/mtd/spi/spi-nor-tiny.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index 68152ce3b4..130917aaa8 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -219,6 +219,7 @@ static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info, case SNOR_MFR_MICRON: /* Some Micron need WREN command; all will accept it */ need_wren = true; + case SNOR_MFR_ISSI: case SNOR_MFR_MACRONIX: case SNOR_MFR_WINBOND: if (need_wren) -- 2.34.1
Re: Falcon Mode Support For Uncompressed Kernel Images
One more time -- >From f1c34333f79996bd2927a60f4858c01699431cba Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Wed, 2 Feb 2022 15:05:18 -0500 Subject: [PATCH v2] Add in the ability to load and boot an uncompressed kernel image during the Falcon Mode boot sequence. This is required for architectures which do not support compressed kernel images (i.e. ARM64). This is only used while not booting via FIT image. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- Changes for v2: - Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD_BOOTI and CMD_BOOTZ instead arch/arm/lib/Makefile | 5 - common/spl/spl.c | 21 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index c603fe61bc..08b7475e37 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o else obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o +ifdef CONFIG_SPL_FRAMEWORK +obj-$(CONFIG_CMD_BOOTI) += image.o +obj-$(CONFIG_CMD_BOOTZ) += zimage.o +endif obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o endif ifdef CONFIG_ARM64 diff --git a/common/spl/spl.c b/common/spl/spl.c index c9750ee163..7b86443f1b 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -107,6 +107,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end) { return 1; } + +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *size, bool force_reloc) +{ +return 1; +} #endif /* Weak default function for arch/board-specific fixups to the spl_image_info */ @@ -366,6 +371,21 @@ int spl_parse_image_header(struct spl_image_info *spl_image, #endif #if CONFIG_IS_ENABLED(OS_BOOT) +#if defined(CMD_BOOTI) + ulong start, size; + + if (!booti_setup((ulong)header, &start, &size, 0)) { + spl_image->name = "Linux"; + spl_image->os = IH_OS_LINUX; + spl_image->load_addr = start; + spl_image->entry_point = start; + spl_image->size = size; + debug(SPL_TPL_PROMPT + "payload Image, load addr: 0x%lx size: %d\n", + spl_image->load_addr, spl_image->size); + return 0; + } +#elif defined(CMD_BOOTZ) ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { @@ -379,6 +399,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } +#endif #endif if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, sizeof(*header))) -- 2.30.2 On 4/19/22 17:16, Nathan Barrett-Morrison wrote: > Hi Tom, > > Let's see if this works any better. Using a new mail client that is supposed > to not modify whitespace: > > From f1c34333f79996bd2927a60f4858c01699431cba Mon Sep 17 00:00:00 2001 > From: Nathan Barrett Morrison > Date: Wed, 2 Feb 2022 15:05:18 -0500 > Subject: [PATCH v2] Add in the ability to load and boot an uncompressed kernel > image during the Falcon Mode boot sequence. > > This is required for architectures which do not support compressed kernel > images (i.e. ARM64). This is only used while not booting via FIT image. > > Signed-off-by: Nathan Barrett-Morrison > Cc: Tom Rini > --- > Changes for v2: >- Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD_BOOTI > and CMD_BOOTZ instead > > arch/arm/lib/Makefile | 5 - > common/spl/spl.c | 21 + > 2 files changed, 25 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile > index c603fe61bc..08b7475e37 100644 > --- a/arch/arm/lib/Makefile > +++ b/arch/arm/lib/Makefile > @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o > obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o > else > obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o > -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o > +ifdef CONFIG_SPL_FRAMEWORK > +obj-$(CONFIG_CMD_BOOTI) += image.o > +obj-$(CONFIG_CMD_BOOTZ) += zimage.o > +endif > obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o > endif > ifdef CONFIG_ARM64 > diff --git a/common/spl/spl.c b/common/spl/spl.c > index c9750ee163..7b86443f1b 100644 > --- a/common/spl/spl.c > +++ b/common/spl/spl.c > @@ -107,6 +107,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong > *end) > { >return 1; > } > + > +int __weak booti_setup(ulong image, ulong *relocated
Re: Falcon Mode Support For Uncompressed Kernel Images
Hi Tom, Let's see if this works any better. Using a new mail client that is supposed to not modify whitespace: >From f1c34333f79996bd2927a60f4858c01699431cba Mon Sep 17 00:00:00 2001 From: Nathan Barrett Morrison Date: Wed, 2 Feb 2022 15:05:18 -0500 Subject: [PATCH v2] Add in the ability to load and boot an uncompressed kernel image during the Falcon Mode boot sequence. This is required for architectures which do not support compressed kernel images (i.e. ARM64). This is only used while not booting via FIT image. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- Changes for v2: - Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD_BOOTI and CMD_BOOTZ instead arch/arm/lib/Makefile | 5 - common/spl/spl.c | 21 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index c603fe61bc..08b7475e37 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o else obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o +ifdef CONFIG_SPL_FRAMEWORK +obj-$(CONFIG_CMD_BOOTI) += image.o +obj-$(CONFIG_CMD_BOOTZ) += zimage.o +endif obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o endif ifdef CONFIG_ARM64 diff --git a/common/spl/spl.c b/common/spl/spl.c index c9750ee163..7b86443f1b 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -107,6 +107,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end) { return 1; } + +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *size, bool force_reloc) +{ +return 1; +} #endif /* Weak default function for arch/board-specific fixups to the spl_image_info */ @@ -366,6 +371,21 @@ int spl_parse_image_header(struct spl_image_info *spl_image, #endif #if CONFIG_IS_ENABLED(OS_BOOT) +#if defined(CMD_BOOTI) + ulong start, size; + + if (!booti_setup((ulong)header, &start, &size, 0)) { + spl_image->name = "Linux"; + spl_image->os = IH_OS_LINUX; + spl_image->load_addr = start; + spl_image->entry_point = start; + spl_image->size = size; + debug(SPL_TPL_PROMPT + "payload Image, load addr: 0x%lx size: %d\n", + spl_image->load_addr, spl_image->size); + return 0; + } +#elif defined(CMD_BOOTZ) ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { @@ -379,6 +399,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } +#endif #endif if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, sizeof(*header))) -- 2.30.2 On 4/19/22 16:30, Tom Rini wrote: > On Wed, Feb 02, 2022 at 04:53:11PM -0500, Nathan Barrett-Morrison wrote: >> Hi Tom, >> >> I've attached version 2 of the patch. I believe this should adhere more >> closely to your suggestions. >> >> Keep in mind, CONFIG_IS_ENABLED will not work for checking >> CMD_BOOTI/CMD_BOOTZ in this case, as there is no CONFIG_SPL_CMD_BOOTx. So, >> I'm just directly checking if it's defined instead. >> >> I verified both CONFIG_IS_ENABLED() and IS_ENABLED() did not work. >> >> Sincerely, >> Nathan >> >> On Mon, Jan 31, 2022 at 10:35 AM Tom Rini wrote: >> >>> On Mon, Jan 31, 2022 at 10:23:58AM -0500, Nathan Barrett-Morrison wrote: >>> >>>> Hi Tom, >>>> >>>> Yea, I'm not sure if uncompressed ARM32 would work, but I don't believe >>> it >>>> was ever working to begin with... as bootz_setup is being called right >>> now >>>> ( @ >>> https://source.denx.de/u-boot/u-boot/-/blob/master/common/spl/spl.c#L366 >>>> ) >>>> >>>> My intent was for SPL_OS_BOOT_UNCOMPRESSED to only be used for platforms >>>> which need booti_setup (ARM64, ...). >>>> >>>> So... I could add a dependency on ARM64 in the config option or I could >>>> remove the option altogether and let the booti_setup fail and fallback to >>>> bootz_setup. Would either of those work for you? >>> >>> The code and logic overall needs a bit of refactoring to support >>> "booti", "bootz" and also FIT images. I believe FIT images are how >>> anyone doing falcon mode on arm64 has worked thus far.
[PATCH] common: spl: spl_mmc: Add full FIT image support for kernel/OS loading during Falcon boot mode while booting via MMC
Hi Tom, This patch adds support for Falcon mode boot via MMC flash boot devices with full FIT images. While attempting to use Falcon boot mode with FIT images on MMC flash boot devices, I've found the following additional code to be required. Patch attached and also added inline below: Sincerely, Nathan >From a3d066656df60856950c9cbb28914d02d57c9364 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:16:24 -0500 Subject: [PATCH] common: spl: spl_mmc: Add full FIT image support for kernel/OS loading during Falcon boot mode while booting via MMC Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- common/spl/spl_mmc.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index e1a7d25bd0..7fb2505c33 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -94,7 +94,19 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image, goto end; } - if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && + if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL) && +image_get_magic(header) == FDT_MAGIC) { + u32 image_size_sectors; + + debug("Found FIT\n"); + + image_size_sectors = (roundup(fdt_totalsize(header), 4) + mmc->read_bl_len - 1) / + mmc->read_bl_len; + count = blk_dread(bd, sector, image_size_sectors, CONFIG_SYS_LOAD_ADDR); + debug("hdr read sector %lx, count=%lu\n", sector, count); + + ret = spl_parse_image_header(spl_image, CONFIG_SYS_LOAD_ADDR); + } else if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && image_get_magic(header) == FDT_MAGIC) { struct spl_load_info load; -- 2.30.2 From a3d066656df60856950c9cbb28914d02d57c9364 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:16:24 -0500 Subject: [PATCH] common: spl: spl_mmc: Add full FIT image support for kernel/OS loading during Falcon boot mode while booting via MMC Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- common/spl/spl_mmc.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index e1a7d25bd0..7fb2505c33 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -94,7 +94,19 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image, goto end; } - if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && + if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL) && + image_get_magic(header) == FDT_MAGIC) { + u32 image_size_sectors; + + debug("Found FIT\n"); + + image_size_sectors = (roundup(fdt_totalsize(header), 4) + mmc->read_bl_len - 1) / + mmc->read_bl_len; + count = blk_dread(bd, sector, image_size_sectors, CONFIG_SYS_LOAD_ADDR); + debug("hdr read sector %lx, count=%lu\n", sector, count); + + ret = spl_parse_image_header(spl_image, CONFIG_SYS_LOAD_ADDR); + } else if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && image_get_magic(header) == FDT_MAGIC) { struct spl_load_info load; -- 2.30.2
[PATCH] common: spl: spl_spi: Add in FIT image support for kernel/OS loading during Falcon boot mode while booting via SPI
Hi Tom, This patch adds support for Falcon mode boot via SPI flash boot devices with FIT images. While attempting to use Falcon boot mode with FIT images on SPI flash boot devices, I've found the following additional code to be required. Patch attached and also added inline below: Sincerely, Nathan >From b93c9122114ee701f13a62af63d74a0644fcef92 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:05:34 -0500 Subject: [PATCH] common: spl: spl_spi: Add in FIT image support for kernel/OS loading during Falcon boot mode while booting via SPI Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- common/spl/spl_spi.c | 13 + 1 file changed, 13 insertions(+) diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 4e20a23dea..82b396fc62 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -29,6 +29,18 @@ static int spi_load_image_os(struct spl_image_info *spl_image, { int err; +#if CONFIG_IS_ENABLED(LOAD_FIT_FULL) || CONFIG_IS_ENABLED(LOAD_FIT) + spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(struct fdt_header), + (void *)header); + + if (image_get_magic(header) == FDT_MAGIC) + spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, + roundup(fdt_totalsize(header), 4), CONFIG_SYS_LOAD_ADDR); + + err = spl_parse_image_header(spl_image, CONFIG_SYS_LOAD_ADDR); + if (err) + return err; +#else /* Read for a header, parse or error out. */ spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), (void *)header); @@ -47,6 +59,7 @@ static int spi_load_image_os(struct spl_image_info *spl_image, spi_flash_read(flash, CONFIG_SYS_SPI_ARGS_OFFS, CONFIG_SYS_SPI_ARGS_SIZE, (void *)CONFIG_SYS_SPL_ARGS_ADDR); +#endif return 0; } -- 2.30.2 From b93c9122114ee701f13a62af63d74a0644fcef92 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:05:34 -0500 Subject: [PATCH] common: spl: spl_spi: Add in FIT image support for kernel/OS loading during Falcon boot mode while booting via SPI Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- common/spl/spl_spi.c | 13 + 1 file changed, 13 insertions(+) diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 4e20a23dea..82b396fc62 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -29,6 +29,18 @@ static int spi_load_image_os(struct spl_image_info *spl_image, { int err; +#if CONFIG_IS_ENABLED(LOAD_FIT_FULL) || CONFIG_IS_ENABLED(LOAD_FIT) + spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(struct fdt_header), + (void *)header); + + if (image_get_magic(header) == FDT_MAGIC) + spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, + roundup(fdt_totalsize(header), 4), CONFIG_SYS_LOAD_ADDR); + + err = spl_parse_image_header(spl_image, CONFIG_SYS_LOAD_ADDR); + if (err) + return err; +#else /* Read for a header, parse or error out. */ spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), (void *)header); @@ -47,6 +59,7 @@ static int spi_load_image_os(struct spl_image_info *spl_image, spi_flash_read(flash, CONFIG_SYS_SPI_ARGS_OFFS, CONFIG_SYS_SPI_ARGS_SIZE, (void *)CONFIG_SYS_SPL_ARGS_ADDR); +#endif return 0; } -- 2.30.2
Re: Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices
Hi Tom, I've attached v2 of this patch. I've also confirmed again that the offending lines are entirely unnecessary and amended the patch to delete them instead. Sincerely, Nathan On Mon, Jan 31, 2022 at 10:23 AM Tom Rini wrote: > On Mon, Jan 31, 2022 at 10:16:08AM -0500, Nathan Barrett-Morrison wrote: > > > Hi Tom, > > > > Yes -- I believe this section of code should not be checking for IH_MAGIC > > at all, as parse_image_header does it as well. > > > > Would you like me to resubmit this patch with the offending lines > deleted? > > Well, please take a good look over the whole area of code and see if it > really makes sense to do what it's doing there or not. > > -- > Tom > From 65e75debf7813760bf192b477818093e35909081 Mon Sep 17 00:00:00 2001 From: Nathan Barrett Morrison Date: Wed, 2 Feb 2022 16:56:50 -0500 Subject: [PATCH v2] Allow Falcon Mode boot to use raw kernel image when booting via SPI. When using Falcon Mode boot with a raw, unwrapped kernel image, the bootz_setup() call inside of spl_parse_image_header() is unreachable because the mkimage header magic check in spi_load_image_os() will never pass. This check is entirely redundant and unnecessary, as the spl_parse_image_header() call will also check for IH_MAGIC. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- Changes for v2: - Remove proposed CONFIG_SYS_SPI_KERNEL_SKIP_HEADER option, as we've determined the entire check is redundant and unnecessary. Just delete it instead. common/spl/spl_spi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 4e20a23dea..16e268be50 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -33,9 +33,6 @@ static int spi_load_image_os(struct spl_image_info *spl_image, spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), (void *)header); - if (image_get_magic(header) != IH_MAGIC) - return -1; - err = spl_parse_image_header(spl_image, header); if (err) return err; -- 2.30.2
Re: Falcon Mode Support For Uncompressed Kernel Images
Hi Tom, I've attached version 2 of the patch. I believe this should adhere more closely to your suggestions. Keep in mind, CONFIG_IS_ENABLED will not work for checking CMD_BOOTI/CMD_BOOTZ in this case, as there is no CONFIG_SPL_CMD_BOOTx. So, I'm just directly checking if it's defined instead. I verified both CONFIG_IS_ENABLED() and IS_ENABLED() did not work. Sincerely, Nathan On Mon, Jan 31, 2022 at 10:35 AM Tom Rini wrote: > On Mon, Jan 31, 2022 at 10:23:58AM -0500, Nathan Barrett-Morrison wrote: > > > Hi Tom, > > > > Yea, I'm not sure if uncompressed ARM32 would work, but I don't believe > it > > was ever working to begin with... as bootz_setup is being called right > now > > ( @ > https://source.denx.de/u-boot/u-boot/-/blob/master/common/spl/spl.c#L366 > > ) > > > > My intent was for SPL_OS_BOOT_UNCOMPRESSED to only be used for platforms > > which need booti_setup (ARM64, ...). > > > > So... I could add a dependency on ARM64 in the config option or I could > > remove the option altogether and let the booti_setup fail and fallback to > > bootz_setup. Would either of those work for you? > > The code and logic overall needs a bit of refactoring to support > "booti", "bootz" and also FIT images. I believe FIT images are how > anyone doing falcon mode on arm64 has worked thus far. booti/bootz > should only be an option when CMD_BOOTI/Z is set, and FIT should depend > on SPL_LOAD_FIT already. > > -- > Tom > From 5d37f2a930e7cb3455b6ec925ec6e67b40d4c022 Mon Sep 17 00:00:00 2001 From: Nathan Barrett Morrison Date: Wed, 2 Feb 2022 15:05:18 -0500 Subject: [PATCH v2] Add in the ability to load and boot an uncompressed kernel image during the Falcon Mode boot sequence. This is required for architectures which do not support compressed kernel images (i.e. ARM64). This is only used while not booting via FIT image. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- Changes for v2: - Remove original SPL_OS_BOOT_UNCOMPRESSED option and check via CMD_BOOTI and CMD_BOOTZ instead arch/arm/lib/Makefile | 5 - common/spl/spl.c | 21 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index c48e1f622d..57e49f69f7 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -36,7 +36,10 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o else obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o +ifdef CONFIG_SPL_FRAMEWORK +obj-$(CONFIG_CMD_BOOTI) += image.o +obj-$(CONFIG_CMD_BOOTZ) += zimage.o +endif obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o endif ifdef CONFIG_ARM64 diff --git a/common/spl/spl.c b/common/spl/spl.c index f51d1f3205..1f6b3f1ac8 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -104,6 +104,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end) { return 1; } + +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *size, bool force_reloc) +{ + return 1; +} #endif /* Weak default function for arch/board-specific fixups to the spl_image_info */ @@ -354,6 +359,21 @@ int spl_parse_image_header(struct spl_image_info *spl_image, #endif #if CONFIG_IS_ENABLED(OS_BOOT) +#if defined(CMD_BOOTI) + ulong start, size; + + if (!booti_setup((ulong)header, &start, &size, 0)) { + spl_image->name = "Linux"; + spl_image->os = IH_OS_LINUX; + spl_image->load_addr = start; + spl_image->entry_point = start; + spl_image->size = size; + debug(SPL_TPL_PROMPT + "payload Image, load addr: 0x%lx size: %d\n", + spl_image->load_addr, spl_image->size); + return 0; + } +#elif defined(CMD_BOOTZ) ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { @@ -367,6 +387,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } +#endif #endif if (!spl_parse_board_header(spl_image, (const void *)header, sizeof(*header))) -- 2.30.2
Re: Falcon Mode Support For Uncompressed Kernel Images
Hi Tom, Yea, I'm not sure if uncompressed ARM32 would work, but I don't believe it was ever working to begin with... as bootz_setup is being called right now ( @ https://source.denx.de/u-boot/u-boot/-/blob/master/common/spl/spl.c#L366 ) My intent was for SPL_OS_BOOT_UNCOMPRESSED to only be used for platforms which need booti_setup (ARM64, ...). So... I could add a dependency on ARM64 in the config option or I could remove the option altogether and let the booti_setup fail and fallback to bootz_setup. Would either of those work for you? Sincerely, Nathan On Mon, Jan 31, 2022 at 10:11 AM Tom Rini wrote: > On Mon, Jan 17, 2022 at 07:58:00PM -0500, Nathan Barrett-Morrison wrote: > > Hi All, > > > > While trying to bring up Falcon Mode boot on an ARM64 board, I discovered > > that there is no path which allows you to use an uncompressed kernel > image > > (booti). I've added this path and attached the relevant patch. > > > > I've made this a separate if/else CONFIG option instead of allowing both > > bootz+booti paths to coexist, as it seems unlikely to me that there would > > be such a board which needs both. Most architectures use either bootz or > > booti, but not both. > > > > Sincerely, > > Nathan Barrett-Morrison > > > From d5542ccc2d4f81ac0442be8ca772a99e1a13b6dd Mon Sep 17 00:00:00 2001 > > From: Nathan Barrett-Morrison > > Date: Mon, 17 Jan 2022 19:42:10 -0500 > > Subject: [PATCH] Add in the ability to load and boot an uncompressed > > kernel image during the Falcon Mode boot sequence. This is required for > > architectures which do not support compressed kernel image booting > (i.e., > > ARM64) > > > > Signed-off-by: Nathan Barrett-Morrison > > Cc: Tom Rini > > Cc: Aneesh V > > --- > > arch/arm/lib/Makefile | 2 +- > > common/spl/Kconfig| 6 ++ > > common/spl/spl.c | 21 + > > 3 files changed, 28 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile > > index c48e1f622d..24c9e3c1e5 100644 > > --- a/arch/arm/lib/Makefile > > +++ b/arch/arm/lib/Makefile > > @@ -36,7 +36,7 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o > > obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o > > else > > obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o > > -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o > > +obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o image.o > > obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o > > endif > > ifdef CONFIG_ARM64 > > diff --git a/common/spl/Kconfig b/common/spl/Kconfig > > index 4a739a7421..6d2c9f 100644 > > --- a/common/spl/Kconfig > > +++ b/common/spl/Kconfig > > @@ -917,6 +917,12 @@ config SYS_OS_BASE > > Specify the address, where the OS image is found, which > > gets booted. > > > > +config SPL_OS_BOOT_UNCOMPRESSED > > + bool "Use uncompressed kernel image alongside Falcon Mode" > > + depends on SPL_SPI_LOAD > > + help > > + Use an uncompressed kernel image to boot. This is targetting > > + architectures which use booti instead of bootz (i.e, ARM64). > > endif # SPL_OS_BOOT > > We shouldn't need another CONFIG option here, and this would then I > believe fail to boot uncompressed arm32 images. The real problem I > think is that the code assumed bootm/bootz but needs to instead be more > explicit in checking / supporting each and then also yes, adding booti > support. Following up with also supporting compressed Images may or may > not take additional logic, I'm not sure off-hand. > > -- > Tom >
Re: Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices
Hi Tom, Yes -- I believe this section of code should not be checking for IH_MAGIC at all, as parse_image_header does it as well. Would you like me to resubmit this patch with the offending lines deleted? Sincerely, Nathan On Mon, Jan 31, 2022 at 10:14 AM Tom Rini wrote: > On Mon, Jan 17, 2022 at 08:02:58PM -0500, Nathan Barrett-Morrison wrote: > > > Hi All, > > > > While trying to bring up Falcon Mode boot on an ARM64 board, I've > > discovered that the SPL+SPI(spl_spi.c) driver does not allow us to load a > > raw kernel image and subsequently call the bootz_setup() function which > > resides in spl_parse_image_header(). > > > > I've added a new config option (CONFIG_SYS_SPI_KERNEL_SKIP_HEADER) which > > will skip the mkimage header check, allowing the subsequent > > spl_parse_image_header() call to successfully fall through to > bootz_setup() > > and load/boot a raw kernel image. > > > > Sincerely, > > Nathan Barrett-Morrison > > > From e5a15a8ad2fd007e6d8d48dd64767d194bbd1833 Mon Sep 17 00:00:00 2001 > > From: Nathan Barrett-Morrison > > Date: Mon, 17 Jan 2022 19:42:59 -0500 > > Subject: [PATCH] Allow Falcon Mode boot to use raw kernel image when > > booting via SPI. When using Falcon Mode boot with a raw, unwrapped > kernel > > image, the bootz_setup() call inside of spl_parse_image_header() is > > unreachable because the mkimage header magic check will never pass. > Adding > > CONFIG_SYS_SPI_KERNEL_SKIP_HEADER gives us the ability to pass through > to the > > desired bootz_setup() call. > > > > Signed-off-by: Nathan Barrett-Morrison > > Cc: Tom Rini > > Cc: Aneesh V > > --- > > common/spl/spl_spi.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c > > index 4e20a23dea..62dad1d2fb 100644 > > --- a/common/spl/spl_spi.c > > +++ b/common/spl/spl_spi.c > > @@ -33,8 +33,10 @@ static int spi_load_image_os(struct spl_image_info > *spl_image, > > spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), > > (void *)header); > > > > +#ifndef CONFIG_SYS_SPI_KERNEL_SKIP_HEADER > > if (image_get_magic(header) != IH_MAGIC) > > return -1; > > +#endif > > > > err = spl_parse_image_header(spl_image, header); > > if (err) > > I'm not sure this is the right path. Why is this part of the code > checking for IH_MAGIC at all, and should it not instead allow for > graceful falling back so that zImage/Image/etc work? > > -- > Tom >
drivers: mtd: spi: Use correct 4 byte mode enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem
Hi All, I noticed this was missing from the spi-nor-tiny.c subsystem while trying to use an ISSI SPI flash device with the U-Boot SPL. This patch will allow 4 byte addressing mode to be enabled with ISSI flash devices while inside the U-Boot SPL / using spi-nor-tiny.c. Sincerely, Nathan From 218e00fcaea8c5795e792af09f5d21fc19e3d831 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Wed, 26 Jan 2022 13:43:53 -0500 Subject: [PATCH] drivers: mtd: spi: Use correct 4 byte mode enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem Signed-off-by: Nathan Barrett-Morrison Cc: Jagan Teki Cc: Vignesh R CC: Tom Rini --- drivers/mtd/spi/spi-nor-tiny.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index 68152ce3b4..130917aaa8 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -219,6 +219,7 @@ static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info, case SNOR_MFR_MICRON: /* Some Micron need WREN command; all will accept it */ need_wren = true; + case SNOR_MFR_ISSI: case SNOR_MFR_MACRONIX: case SNOR_MFR_WINBOND: if (need_wren) -- 2.34.1
[PATCH] drivers: mtd: spi: Use correct 4 byte mode enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem
Hi All, I noticed this was missing from the spi-nor-tiny.c subsystem while trying to use an ISSI SPI flash device with the U-Boot SPL. This patch will allow 4 byte addressing mode to be enabled with ISSI flash devices while inside the U-Boot SPL / using spi-nor-tiny.c. Sincerely, Nathan
drivers: mtd: spi: Allow Quad I/O enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem
Hi All, I noticed this was missing from the spi-nor-tiny.c subsystem while trying to use an ISSI SPI flash device with the U-Boot SPL. This patch will allow Quad (4x) I/O mode to be enabled with ISSI flash devices while inside the U-Boot SPL / using spi-nor-tiny.c. Sincerely, Nathan From 1a7fd52f21d3d3ad4b2ff736a9ea3c1affb9c007 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Wed, 26 Jan 2022 13:44:39 -0500 Subject: [PATCH] drivers: mtd: spi: Allow Quad I/O enablement for ISSI SPI flash devices alongside spi-nor-tiny.c subsystem Signed-off-by: Nathan Barrett-Morrison Cc: Jagan Teki Cc: Vignesh R CC: Tom Rini --- drivers/mtd/spi/spi-nor-tiny.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index 130917aaa8..4957448d11 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -664,6 +664,7 @@ static int spi_nor_setup(struct spi_nor *nor, const struct flash_info *info, switch (JEDEC_MFR(info)) { #ifdef CONFIG_SPI_FLASH_MACRONIX case SNOR_MFR_MACRONIX: + case SNOR_MFR_ISSI: err = macronix_quad_enable(nor); break; #endif -- 2.34.1
Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices
Hi All, While trying to bring up Falcon Mode boot on an ARM64 board, I've discovered that the SPL+SPI(spl_spi.c) driver does not allow us to load a raw kernel image and subsequently call the bootz_setup() function which resides in spl_parse_image_header(). I've added a new config option (CONFIG_SYS_SPI_KERNEL_SKIP_HEADER) which will skip the mkimage header check, allowing the subsequent spl_parse_image_header() call to successfully fall through to bootz_setup() and load/boot a raw kernel image. Sincerely, Nathan Barrett-Morrison From e5a15a8ad2fd007e6d8d48dd64767d194bbd1833 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Mon, 17 Jan 2022 19:42:59 -0500 Subject: [PATCH] Allow Falcon Mode boot to use raw kernel image when booting via SPI. When using Falcon Mode boot with a raw, unwrapped kernel image, the bootz_setup() call inside of spl_parse_image_header() is unreachable because the mkimage header magic check will never pass. Adding CONFIG_SYS_SPI_KERNEL_SKIP_HEADER gives us the ability to pass through to the desired bootz_setup() call. Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini Cc: Aneesh V --- common/spl/spl_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 4e20a23dea..62dad1d2fb 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -33,8 +33,10 @@ static int spi_load_image_os(struct spl_image_info *spl_image, spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header), (void *)header); +#ifndef CONFIG_SYS_SPI_KERNEL_SKIP_HEADER if (image_get_magic(header) != IH_MAGIC) return -1; +#endif err = spl_parse_image_header(spl_image, header); if (err) -- 2.34.1
Falcon Mode Support For Uncompressed Kernel Images
Hi All, While trying to bring up Falcon Mode boot on an ARM64 board, I discovered that there is no path which allows you to use an uncompressed kernel image (booti). I've added this path and attached the relevant patch. I've made this a separate if/else CONFIG option instead of allowing both bootz+booti paths to coexist, as it seems unlikely to me that there would be such a board which needs both. Most architectures use either bootz or booti, but not both. Sincerely, Nathan Barrett-Morrison From d5542ccc2d4f81ac0442be8ca772a99e1a13b6dd Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Mon, 17 Jan 2022 19:42:10 -0500 Subject: [PATCH] Add in the ability to load and boot an uncompressed kernel image during the Falcon Mode boot sequence. This is required for architectures which do not support compressed kernel image booting (i.e., ARM64) Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini Cc: Aneesh V --- arch/arm/lib/Makefile | 2 +- common/spl/Kconfig| 6 ++ common/spl/spl.c | 21 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index c48e1f622d..24c9e3c1e5 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -36,7 +36,7 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o else obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o -obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o +obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o image.o obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o endif ifdef CONFIG_ARM64 diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 4a739a7421..6d2c9f 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -917,6 +917,12 @@ config SYS_OS_BASE Specify the address, where the OS image is found, which gets booted. +config SPL_OS_BOOT_UNCOMPRESSED + bool "Use uncompressed kernel image alongside Falcon Mode" + depends on SPL_SPI_LOAD + help + Use an uncompressed kernel image to boot. This is targetting + architectures which use booti instead of bootz (i.e, ARM64). endif # SPL_OS_BOOT config SPL_PAYLOAD diff --git a/common/spl/spl.c b/common/spl/spl.c index f51d1f3205..9a826971eb 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -104,6 +104,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end) { return 1; } + +int __weak booti_setup(ulong image, ulong *relocated_addr, ulong *size, bool force_reloc) +{ + return 1; +} #endif /* Weak default function for arch/board-specific fixups to the spl_image_info */ @@ -354,6 +359,21 @@ int spl_parse_image_header(struct spl_image_info *spl_image, #endif #if CONFIG_IS_ENABLED(OS_BOOT) +#if CONFIG_IS_ENABLED(OS_BOOT_UNCOMPRESSED) + ulong start, size; + + if (!booti_setup((ulong)header, &start, &size, 0)) { + spl_image->name = "Linux"; + spl_image->os = IH_OS_LINUX; + spl_image->load_addr = start; + spl_image->entry_point = start; + spl_image->size = size; + printf(SPL_TPL_PROMPT + "payload Image, load addr: 0x%lx size: %d\n", + spl_image->load_addr, spl_image->size); + return 0; + } +#else ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { @@ -367,6 +387,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } +#endif #endif if (!spl_parse_board_header(spl_image, (const void *)header, sizeof(*header))) -- 2.34.1
mkimage regression when building ARCH=mips defconfig Linux kernel
Hi Simon, Apologies if this is not the proper way to report a regression, this is my first time interacting with the U-Boot community. My distribution updated the uboot-tools package to 2021.04, which broke my Linux kernel builds for ARCH=mips: $ make -skj"$(nproc)" ARCH=mips CROSS_COMPILE=mips-linux- defconfig all ... /usr/bin/mkimage: verify_header failed for FIT Image support with exit code 1 make[2]: *** [arch/mips/boot/Makefile:173: arch/mips/boot/vmlinux.gz.itb] Error 1 ... I bisected this down to your commit: 3f04db891a353f4b127ed57279279f851c6b4917 is the first bad commit commit 3f04db891a353f4b127ed57279279f851c6b4917 Author: Simon Glass Date: Mon Feb 15 17:08:12 2021 -0700 image: Check for unit addresses in FITs Using unit addresses in a FIT is a security risk. Add a check for this and disallow it. CVE-2021-27138 Signed-off-by: Simon Glass Reported-by: Bruce Monroe Reported-by: Arie Haenel Reported-by: Julien Lenoir common/image-fit.c | 56 + test/py/tests/test_vboot.py | 9 2 files changed, 57 insertions(+), 8 deletions(-) bisect run success $ git bisect log # bad: [e9c99db7787e3b5c2ef05701177c43ed1c023c27] Merge branch '2021-04-07-CI-improvements' # good: [c4fddedc48f336eabc4ce3f74940e6aa372de18c] Prepare v2021.01 git bisect start 'e9c99db7787e3b5c2ef05701177c43ed1c023c27' 'v2021.01' # good: [b2c86f596cfb1ea9f7f5138f72f1c5c49e3ae3f1] arm: dts: r8a774a1: Import DTS queued for Linux 5.12-rc1 git bisect good b2c86f596cfb1ea9f7f5138f72f1c5c49e3ae3f1 # bad: [74f4929c2c73beb595faf7d5d9bb6a78d710c2fd] ddr: marvell: axp: fix array types have different bounds warning git bisect bad 74f4929c2c73beb595faf7d5d9bb6a78d710c2fd # bad: [cbe607b920bc0827d8fe379ed4f5ae4e2058513e] Merge tag 'xilinx-for-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze git bisect bad cbe607b920bc0827d8fe379ed4f5ae4e2058513e # good: [d5f3aadacbc63df3b690d6fd9f0aa3f575b43356] test: Add tests for the 'evil' vboot attacks git bisect good d5f3aadacbc63df3b690d6fd9f0aa3f575b43356 # bad: [a1a652e8016426e2d67148cab225cd5ec45189fb] Merge tag 'mmc-2021-2-19' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc git bisect bad a1a652e8016426e2d67148cab225cd5ec45189fb # bad: [aeedeae40733131467de72c68e639cf9d795e059] spl: fit: Replace #ifdef blocks with more readable constructs git bisect bad aeedeae40733131467de72c68e639cf9d795e059 # bad: [eb5fd9e46c11ea41430d9c5bcc81d4583424216e] usb: kbd: destroy device after console is stopped git bisect bad eb5fd9e46c11ea41430d9c5bcc81d4583424216e # bad: [99cb2b996bd649d98069a95941beaaade0a4447a] stdio: Split out nulldev_register() and move it under #if git bisect bad 99cb2b996bd649d98069a95941beaaade0a4447a # bad: [3f04db891a353f4b127ed57279279f851c6b4917] image: Check for unit addresses in FITs git bisect bad 3f04db891a353f4b127ed57279279f851c6b4917 # good: [6f3c2d8aa5e6cbd80b5e869bbbddecb66c329d01] image: Add an option to do a full check of the FIT git bisect good 6f3c2d8aa5e6cbd80b5e869bbbddecb66c329d01 # good: [124c255731c76a2b09587378b2bcce561bcd3f2d] libfdt: Check for multiple/invalid root nodes git bisect good 124c255731c76a2b09587378b2bcce561bcd3f2d # first bad commit: [3f04db891a353f4b127ed57279279f851c6b4917] image: Check for unit addresses in FITs Is this an actual regression or is this now the expected behavior? I have added Thomas and the linux-mips mailing list to take a look and see if the Linux kernel needs to have its sources updated. Cheers, Nathan
Re: [PATCH] usb: gadget: Handle SPL_* configs
On Fri, 21 Feb 2020 at 19:24, Lukasz Majewski wrote: > > Hi Nathan, > > > On Tue, 28 Jan 2020 at 20:26, Lukasz Majewski wrote: > > > > > > On Tue, 28 Jan 2020 17:50:03 +1000 > > > Nathan Rossi wrote: > > > > > > > On Mon, 27 Jan 2020 at 22:51, Lukasz Majewski > > > > wrote: > > > > > > > > > > Hi Nathan, > > > > > > > > > > > Handle selection of objects based on $(SPL_) to allow for > > > > > > normal and SPL builds to have differing object compilation. > > > > > > > > > > Could you share the exact use case? I do guess that you want to > > > > > add some gadget(s) to SPL? > > > > > > > > I am primarily trying to disable SPL_ENV_SUPPORT for beaglebone > > > > (am335x_evm). SPL_USB_ETHER has a dependency on SPL_ENV_SUPPORT, > > > > thus the desire to disable it (whilst leaving SPL_USB_GADGET > > > > enabled). > > > > > > Ok. > > > > > > > > > > > > > > > > > (Such changes may cause issues on boards already using this > > > > > feature > > > > > - could you run: > > > > > > > > > > ./tools/buildman/buildman.py --branch=HEAD siemens samsung bbb > > > > > --detail --verbose --show_errors --force-build --count=1 > > > > > --output-dir=./BUILD/ > > > > > > > > Running this showed no regressions. Also I noticed "bbb" does not > > > > refer to any boards? > > > > > > I see. Then please try am335x instead. > > > > There are no regressions for those boards either. > > I did some tests before pulling: > > -master branch u-boot > SHA1: f2a73d6867ef973fbb8471cc87058205999b5e5c > > ./tools/buildman/buildman.py --branch=HEAD am43xx_evm_usbhost_boot > am335x --show_errors --force-build --verbose --count=1 > --output-dir=../BUILD/ > > >arm: + am43xx_evm_usbhost_boot > +../drivers/usb/gadget/ether.c: In function ‘usb_eth_probe’: > +../drivers/usb/gadget/ether.c:2654:17: error: ‘CONFIG_USBNET_DEVADDR’ > undeclared (first use in this function) > + get_ether_addr(CONFIG_USBNET_DEVADDR, pdata->enetaddr); > + ^ > > Could you fix it and repost the patch? It appears I may have misunderstood the purpose of CONFIG_SPL_USB_ETHER. But more importantly it is not used consistently. According to the Kconfig it is to enable "USB ethernet drivers" (e.g. a USB ethernet dongle, aka CONFIG_USB_HOST_ETHER), however it is contained within a if SPL_USB_GADGET block. Some parts of U-Boot such as drivers/Makefile use this to enable net/phy but this is the only clear example of the USB_HOST_ETHER equivalent. Whilst others use it to enable configuration for USB ethernet gadget (e.g. spl_net.c). If the config indeed does refer to an SPL_ equivalent of USB_ETHER there are some issues with its use when USB_ETHER is not configured as well, which causes the error above since CONFIG_USBNET_DEVADDR is not defined otherwise. This can be resolved by keeping the CONFIG_USBNET_* options common for both normal and spl, and having the Kconfig reflect that. This would also apply to the USB_ETH_RNDIS/CDC choice too. Though the am43xx_evm_usbhost_boot board might instead be setting CONFIG_SPL_USB_ETHER for USB_HOST_ETHER? Regards, Nathan > > > > > Regards, > > Nathan > > > > > > > > > > > > > Thanks, > > > > Nathan > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Nathan Rossi > > > > > > --- > > > > > > drivers/usb/gadget/Makefile | 8 > > > > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > > > > > > > diff --git a/drivers/usb/gadget/Makefile > > > > > > b/drivers/usb/gadget/Makefile index 70f3bf43e7..8967745513 > > > > > > 100644 --- a/drivers/usb/gadget/Makefile > > > > > > +++ b/drivers/usb/gadget/Makefile > > > > > > @@ -3,8 +3,8 @@ > > > > > > # (C) Copyright 2000-2007 > > > > > > # Wolfgang Denk, DENX Software Engineering, w...@denx.de. > > > > > > > > > > > > -obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o > > > > > > -obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o > > > > > > +obj-$(CONFIG_$(SPL_)USB_GADGET) += epautoconf.o c
Re: [PATCH v2] cmd: Handle CONFIG_(SPL_|TPL_)ENV_SUPPORT for toggling nvedit object
On Sun, 2 Feb 2020 at 23:52, Wolfgang Denk wrote: > > Dear Nathan, > > In message <20200202130227.7755-1-nat...@nathanrossi.com> you wrote: > > When CONFIG_SPL_ENV_SUPPORT is disabled, nvedit was still being included > > as part of the build. Use the CONFIG_ENV_SUPPORT, CONFIG_SPL_ENV_SUPPORT > > or CONFIG_TPL_ENV_SUPPORT values to enable/disable the inclusion of > > nvedit. > > Why should the availability of these commands depend on any of these > settings? I think this is wrong - whether someone wants to have > environment commands in SPL or TPM is an independent decision. You > must not dictate it in such a way for all users. This file is dependent on code from env/, specifically code that is conditional on the various ENV_SUPPORT configs. As the underlying compilation issue stems from nvedit providing what appears to be common environment code (e.g. env_get), it made sense to have nvedit conditional on the same config. Regards, Nathan
[PATCH v2] cmd: Handle CONFIG_(SPL_|TPL_)ENV_SUPPORT for toggling nvedit object
When CONFIG_SPL_ENV_SUPPORT is disabled, nvedit was still being included as part of the build. Use the CONFIG_ENV_SUPPORT, CONFIG_SPL_ENV_SUPPORT or CONFIG_TPL_ENV_SUPPORT values to enable/disable the inclusion of nvedit. Signed-off-by: Nathan Rossi --- Changes in v2: * Changed $(SPL_) to $(SPL_TPL_) to cover CONFIG_TPL_ENV_SUPPORT --- cmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/Makefile b/cmd/Makefile index 4f29b72c69..21b867d3a9 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -186,7 +186,7 @@ endif # !CONFIG_SPL_BUILD obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o # core command -obj-y += nvedit.o +obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += nvedit.o obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/ --- 2.24.1
Re: [PATCH] usb: gadget: Handle SPL_* configs
On Tue, 28 Jan 2020 at 20:26, Lukasz Majewski wrote: > > On Tue, 28 Jan 2020 17:50:03 +1000 > Nathan Rossi wrote: > > > On Mon, 27 Jan 2020 at 22:51, Lukasz Majewski wrote: > > > > > > Hi Nathan, > > > > > > > Handle selection of objects based on $(SPL_) to allow for normal > > > > and SPL builds to have differing object compilation. > > > > > > Could you share the exact use case? I do guess that you want to add > > > some gadget(s) to SPL? > > > > I am primarily trying to disable SPL_ENV_SUPPORT for beaglebone > > (am335x_evm). SPL_USB_ETHER has a dependency on SPL_ENV_SUPPORT, thus > > the desire to disable it (whilst leaving SPL_USB_GADGET enabled). > > Ok. > > > > > > > > > (Such changes may cause issues on boards already using this feature > > > - could you run: > > > > > > ./tools/buildman/buildman.py --branch=HEAD siemens samsung bbb > > > --detail --verbose --show_errors --force-build --count=1 > > > --output-dir=./BUILD/ > > > > Running this showed no regressions. Also I noticed "bbb" does not > > refer to any boards? > > I see. Then please try am335x instead. There are no regressions for those boards either. Regards, Nathan > > > > > Thanks, > > Nathan > > > > > > > > > > > > > > > > > > > Signed-off-by: Nathan Rossi > > > > --- > > > > drivers/usb/gadget/Makefile | 8 > > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/drivers/usb/gadget/Makefile > > > > b/drivers/usb/gadget/Makefile index 70f3bf43e7..8967745513 100644 > > > > --- a/drivers/usb/gadget/Makefile > > > > +++ b/drivers/usb/gadget/Makefile > > > > @@ -3,8 +3,8 @@ > > > > # (C) Copyright 2000-2007 > > > > # Wolfgang Denk, DENX Software Engineering, w...@denx.de. > > > > > > > > -obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o > > > > -obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o > > > > +obj-$(CONFIG_$(SPL_)USB_GADGET) += epautoconf.o config.o > > > > usbstring.o +obj-$(CONFIG_$(SPL_)USB_ETHER) += epautoconf.o > > > > config.o usbstring.o > > > > > > > > ifdef CONFIG_SPL_BUILD > > > > obj-$(CONFIG_SPL_USB_GADGET) += g_dnl.o > > > > @@ -13,7 +13,7 @@ obj-$(CONFIG_SPL_USB_SDP_SUPPORT) += f_sdp.o > > > > endif > > > > > > > > # new USB gadget layer dependencies > > > > -ifdef CONFIG_USB_GADGET > > > > +ifdef CONFIG_$(SPL_)USB_GADGET > > > > obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o > > > > obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o > > > > obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o > > > > @@ -31,7 +31,7 @@ obj-$(CONFIG_USB_FUNCTION_SDP) += f_sdp.o > > > > obj-$(CONFIG_USB_FUNCTION_ROCKUSB) += f_rockusb.o > > > > endif > > > > endif > > > > -ifdef CONFIG_USB_ETHER > > > > +ifdef CONFIG_$(SPL_)USB_ETHER > > > > obj-y += ether.o > > > > obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o > > > > obj-$(CONFIG_CI_UDC) += ci_udc.o > > > > --- > > > > 2.24.1 > > > > > > > > > > > > > > > Best regards, > > > > > > Lukasz Majewski > > > > > > -- > > > > > > DENX Software Engineering GmbH, Managing Director: Wolfgang > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > > > lu...@denx.de > > > > > Best regards, > > Lukasz Majewski > > -- > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de
[PATCH v2 2/2] net: Handle CONFIG_(SPL_)NET for conditional components
Use CONFIG_$(SPL_)NET to conditionally select object files depending on the SPL or U-Boot specific configuration. Signed-off-by: Nathan Rossi --- net/Makefile | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/Makefile b/net/Makefile index fef71b940a..8e45103168 100644 --- a/net/Makefile +++ b/net/Makefile @@ -5,20 +5,20 @@ #ccflags-y += -DDEBUG -obj-$(CONFIG_NET) += arp.o +obj-$(CONFIG_$(SPL_)NET) += arp.o obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o ifdef CONFIG_DM_ETH -obj-$(CONFIG_NET) += eth-uclass.o +obj-$(CONFIG_$(SPL_)NET) += eth-uclass.o else -obj-$(CONFIG_NET) += eth_legacy.o +obj-$(CONFIG_$(SPL_)NET) += eth_legacy.o endif obj-$(CONFIG_DM_MDIO) += mdio-uclass.o obj-$(CONFIG_DM_MDIO_MUX) += mdio-mux-uclass.o -obj-$(CONFIG_NET) += eth_common.o +obj-$(CONFIG_$(SPL_)NET) += eth_common.o obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o -obj-$(CONFIG_NET) += net.o +obj-$(CONFIG_$(SPL_)NET) += net.o obj-$(CONFIG_CMD_NFS) += nfs.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_PCAP) += pcap.o --- 2.24.1
[PATCH v2 1/2] spl: Kconfig: Replace CONFIG_SPL_NET_SUPPORT with CONFIG_SPL_NET
Replace CONFIG_SPL_NET_SUPPORT with CONFIG_SPL_NET to match CONFIG_NET so that CONFIG_$(SPL_)NET can be used to conditionally select build objects between SPL and U-Boot. Signed-off-by: Nathan Rossi --- Changes in v2: - Missed entry in common/spl/Makefile that already has conditional prefix --- common/Makefile | 2 +- common/spl/Kconfig | 10 +- common/spl/Makefile | 2 +- configs/am335x_boneblack_vboot_defconfig | 2 +- configs/am335x_evm_defconfig | 2 +- configs/am335x_guardian_defconfig| 2 +- configs/am43xx_evm_defconfig | 2 +- configs/am43xx_hs_evm_defconfig | 2 +- configs/chromebook_link64_defconfig | 2 +- configs/chromebook_samus_tpl_defconfig | 2 +- configs/pcm051_rev1_defconfig| 2 +- configs/pcm051_rev3_defconfig| 2 +- configs/pengwyn_defconfig| 2 +- configs/qemu-x86_64_defconfig| 2 +- doc/SPL/README.am335x-network| 2 +- lib/tiny-printf.c| 4 ++-- scripts/Makefile.spl | 2 +- tools/buildman/README| 8 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/common/Makefile b/common/Makefile index 5f62b8d0b1..9bb00dd66e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -71,7 +71,7 @@ obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o obj-$(CONFIG_TPL_HASH_SUPPORT) += hash.o obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o -obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o +obj-$(CONFIG_SPL_NET) += miiphyutil.o obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o ifdef CONFIG_SPL_USB_HOST_SUPPORT diff --git a/common/spl/Kconfig b/common/spl/Kconfig index b03a476b9f..abfc719c91 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -556,7 +556,7 @@ config SPL_ETH_SUPPORT drivers in SPL. This permits SPL to load U-Boot over an Ethernet link rather than from an on-board peripheral. Environment support is required since the network stack uses a number of environment - variables. See also SPL_NET_SUPPORT. + variables. See also SPL_NET. config SPL_FS_EXT4 bool "Support EXT filesystems" @@ -847,7 +847,7 @@ config UBI_SPL_SILENCE_MSG endif # if SPL_UBI -config SPL_NET_SUPPORT +config SPL_NET bool "Support networking" help Enable support for network devices (such as Ethernet) in SPL. @@ -856,7 +856,7 @@ config SPL_NET_SUPPORT the network stack uses a number of environment variables. See also SPL_ETH_SUPPORT. -if SPL_NET_SUPPORT +if SPL_NET config SPL_NET_VCI_STRING string "BOOTP Vendor Class Identifier string sent by SPL" help @@ -865,7 +865,7 @@ config SPL_NET_VCI_STRING of a client. This is often used in practice to allow for the DHCP server to specify different files to load depending on if the ROM, SPL or U-Boot itself makes the request -endif # if SPL_NET_SUPPORT +endif # if SPL_NET config SPL_NO_CPU_SUPPORT bool "Drop CPU code in SPL" @@ -1152,7 +1152,7 @@ config SPL_USB_ETHER USB-connected Ethernet link (such as a USB Ethernet dongle) rather than from an onboard peripheral. Environment support is required since the network stack uses a number of environment variables. - See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT. + See also SPL_NET and SPL_ETH_SUPPORT. config SPL_DFU bool "Support DFU (Device Firmware Upgrade)" diff --git a/common/spl/Makefile b/common/spl/Makefile index eaa57f5ce5..ed5ba9e057 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -18,7 +18,7 @@ obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += spl_nand.o obj-$(CONFIG_$(SPL_TPL_)ONENAND_SUPPORT) += spl_onenand.o endif obj-$(CONFIG_$(SPL_TPL_)UBI) += spl_ubi.o -obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o +obj-$(CONFIG_$(SPL_TPL_)NET) += spl_net.o obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig index 9cea85413b..11f6656938 100644 --- a/configs/am335x_boneblack_vboot_defconfig +++ b/configs/am335x_boneblack_vboot_defconfig @@ -16,7 +16,7 @@ CONFIG_VERSION_VARIABLE=y CONFIG_ARCH_MISC_INIT=y CONFIG_SPL_MUSB_NEW_SUPPORT=y # CONFIG_SPL_NAND_SUPPORT is not set -CONFIG_SPL_NET_SUPPORT=y +CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL" CONFIG_SPL_OS_BOOT=y CONFIG_SPL_USB_GADGET=y diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index 335aa8cfa1..4a2bd2e3ce 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -17,7 +17,7 @@ CONFIG_SPL_ETH_SUPPORT=
[PATCH 1/2] spl: Kconfig: Replace CONFIG_SPL_NET_SUPPORT with CONFIG_SPL_NET
Replace CONFIG_SPL_NET_SUPPORT with CONFIG_SPL_NET to match CONFIG_NET so that CONFIG_$(SPL_)NET can be used to conditionally select build objects between SPL and U-Boot. Signed-off-by: Nathan Rossi --- common/Makefile | 2 +- common/spl/Kconfig | 10 +- configs/am335x_boneblack_vboot_defconfig | 2 +- configs/am335x_evm_defconfig | 2 +- configs/am335x_guardian_defconfig| 2 +- configs/am43xx_evm_defconfig | 2 +- configs/am43xx_hs_evm_defconfig | 2 +- configs/chromebook_link64_defconfig | 2 +- configs/chromebook_samus_tpl_defconfig | 2 +- configs/pcm051_rev1_defconfig| 2 +- configs/pcm051_rev3_defconfig| 2 +- configs/pengwyn_defconfig| 2 +- configs/qemu-x86_64_defconfig| 2 +- doc/SPL/README.am335x-network| 2 +- lib/tiny-printf.c| 4 ++-- scripts/Makefile.spl | 2 +- tools/buildman/README| 8 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/common/Makefile b/common/Makefile index 5f62b8d0b1..9bb00dd66e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -71,7 +71,7 @@ obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o obj-$(CONFIG_TPL_HASH_SUPPORT) += hash.o obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o -obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o +obj-$(CONFIG_SPL_NET) += miiphyutil.o obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o ifdef CONFIG_SPL_USB_HOST_SUPPORT diff --git a/common/spl/Kconfig b/common/spl/Kconfig index b03a476b9f..abfc719c91 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -556,7 +556,7 @@ config SPL_ETH_SUPPORT drivers in SPL. This permits SPL to load U-Boot over an Ethernet link rather than from an on-board peripheral. Environment support is required since the network stack uses a number of environment - variables. See also SPL_NET_SUPPORT. + variables. See also SPL_NET. config SPL_FS_EXT4 bool "Support EXT filesystems" @@ -847,7 +847,7 @@ config UBI_SPL_SILENCE_MSG endif # if SPL_UBI -config SPL_NET_SUPPORT +config SPL_NET bool "Support networking" help Enable support for network devices (such as Ethernet) in SPL. @@ -856,7 +856,7 @@ config SPL_NET_SUPPORT the network stack uses a number of environment variables. See also SPL_ETH_SUPPORT. -if SPL_NET_SUPPORT +if SPL_NET config SPL_NET_VCI_STRING string "BOOTP Vendor Class Identifier string sent by SPL" help @@ -865,7 +865,7 @@ config SPL_NET_VCI_STRING of a client. This is often used in practice to allow for the DHCP server to specify different files to load depending on if the ROM, SPL or U-Boot itself makes the request -endif # if SPL_NET_SUPPORT +endif # if SPL_NET config SPL_NO_CPU_SUPPORT bool "Drop CPU code in SPL" @@ -1152,7 +1152,7 @@ config SPL_USB_ETHER USB-connected Ethernet link (such as a USB Ethernet dongle) rather than from an onboard peripheral. Environment support is required since the network stack uses a number of environment variables. - See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT. + See also SPL_NET and SPL_ETH_SUPPORT. config SPL_DFU bool "Support DFU (Device Firmware Upgrade)" diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig index 9cea85413b..11f6656938 100644 --- a/configs/am335x_boneblack_vboot_defconfig +++ b/configs/am335x_boneblack_vboot_defconfig @@ -16,7 +16,7 @@ CONFIG_VERSION_VARIABLE=y CONFIG_ARCH_MISC_INIT=y CONFIG_SPL_MUSB_NEW_SUPPORT=y # CONFIG_SPL_NAND_SUPPORT is not set -CONFIG_SPL_NET_SUPPORT=y +CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL" CONFIG_SPL_OS_BOOT=y CONFIG_SPL_USB_GADGET=y diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index 335aa8cfa1..4a2bd2e3ce 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -17,7 +17,7 @@ CONFIG_SPL_ETH_SUPPORT=y # CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_MUSB_NEW_SUPPORT=y -CONFIG_SPL_NET_SUPPORT=y +CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL" CONFIG_SPL_OS_BOOT=y CONFIG_SPL_USB_GADGET=y diff --git a/configs/am335x_guardian_defconfig b/configs/am335x_guardian_defconfig index 13974f7c0f..0f84ccc955 100644 --- a/configs/am335x_guardian_defconfig +++ b/configs/am335x_guardian_defconfig @@ -24,7 +24,7 @@ CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_ETH_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_MUSB_NEW_SUPPORT=y -CONFIG_SPL_NET_SUPPORT=y +CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="Guardian U-Boot SPL" CONFIG_SPL_POWER_SUPPOR
[PATCH 2/2] net: Handle CONFIG_(SPL_)NET for conditional components
Use CONFIG_$(SPL_)NET to conditionally select object files depending on the SPL or U-Boot specific configuration. Signed-off-by: Nathan Rossi --- net/Makefile | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/Makefile b/net/Makefile index fef71b940a..8e45103168 100644 --- a/net/Makefile +++ b/net/Makefile @@ -5,20 +5,20 @@ #ccflags-y += -DDEBUG -obj-$(CONFIG_NET) += arp.o +obj-$(CONFIG_$(SPL_)NET) += arp.o obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o ifdef CONFIG_DM_ETH -obj-$(CONFIG_NET) += eth-uclass.o +obj-$(CONFIG_$(SPL_)NET) += eth-uclass.o else -obj-$(CONFIG_NET) += eth_legacy.o +obj-$(CONFIG_$(SPL_)NET) += eth_legacy.o endif obj-$(CONFIG_DM_MDIO) += mdio-uclass.o obj-$(CONFIG_DM_MDIO_MUX) += mdio-mux-uclass.o -obj-$(CONFIG_NET) += eth_common.o +obj-$(CONFIG_$(SPL_)NET) += eth_common.o obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o -obj-$(CONFIG_NET) += net.o +obj-$(CONFIG_$(SPL_)NET) += net.o obj-$(CONFIG_CMD_NFS) += nfs.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_PCAP) += pcap.o --- 2.24.1
Re: [PATCH] net: Handle disabling of compilation for SPL builds
On Tue, 28 Jan 2020 at 02:51, Tom Rini wrote: > > On Mon, Jan 27, 2020 at 12:40:17PM +, Nathan Rossi wrote: > > > Whilst the net/ directory is excluded from libs-y when > > CONFIG_SPL_NET_SUPPORT is disabled, this does not prevent SPL builds > > trying to compile net/ objects. During SPL builds overwrite the value of > > CONFIG_NET with CONFIG_SPL_NET_SUPPORT to exclude compilation during SPL > > builds. > > > > Signed-off-by: Nathan Rossi > > --- > > net/Makefile | 4 > > 1 file changed, 4 insertions(+) > > > > diff --git a/net/Makefile b/net/Makefile > > index fef71b940a..0f57244015 100644 > > --- a/net/Makefile > > +++ b/net/Makefile > > @@ -5,6 +5,10 @@ > > > > #ccflags-y += -DDEBUG > > > > +ifdef CONFIG_SPL_BUILD > > +CONFIG_NET = $(CONFIG_SPL_NET_SUPPORT) > > +endif > > + > > obj-$(CONFIG_NET) += arp.o > > obj-$(CONFIG_CMD_BOOTP) += bootp.o > > obj-$(CONFIG_CMD_CDP) += cdp.o > > This needs to be fixed the same way we have in other cases and that is > for CONFIG_SPL_NET_SUPPORT to become CONFIG_SPL_NET and then Makefiles > use 'obj-$(CONFIG_$(SPL_)NET) += ...' and so forth. Thanks! Will do, new series incoming. Thanks, Nathan
Re: [PATCH] usb: gadget: Handle SPL_* configs
On Mon, 27 Jan 2020 at 22:51, Lukasz Majewski wrote: > > Hi Nathan, > > > Handle selection of objects based on $(SPL_) to allow for normal and > > SPL builds to have differing object compilation. > > Could you share the exact use case? I do guess that you want to add > some gadget(s) to SPL? I am primarily trying to disable SPL_ENV_SUPPORT for beaglebone (am335x_evm). SPL_USB_ETHER has a dependency on SPL_ENV_SUPPORT, thus the desire to disable it (whilst leaving SPL_USB_GADGET enabled). > > (Such changes may cause issues on boards already using this feature - > could you run: > > ./tools/buildman/buildman.py --branch=HEAD siemens samsung bbb > --detail --verbose --show_errors --force-build --count=1 > --output-dir=./BUILD/ Running this showed no regressions. Also I noticed "bbb" does not refer to any boards? Thanks, Nathan > > > > > > > Signed-off-by: Nathan Rossi > > --- > > drivers/usb/gadget/Makefile | 8 > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile > > index 70f3bf43e7..8967745513 100644 > > --- a/drivers/usb/gadget/Makefile > > +++ b/drivers/usb/gadget/Makefile > > @@ -3,8 +3,8 @@ > > # (C) Copyright 2000-2007 > > # Wolfgang Denk, DENX Software Engineering, w...@denx.de. > > > > -obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o > > -obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o > > +obj-$(CONFIG_$(SPL_)USB_GADGET) += epautoconf.o config.o usbstring.o > > +obj-$(CONFIG_$(SPL_)USB_ETHER) += epautoconf.o config.o usbstring.o > > > > ifdef CONFIG_SPL_BUILD > > obj-$(CONFIG_SPL_USB_GADGET) += g_dnl.o > > @@ -13,7 +13,7 @@ obj-$(CONFIG_SPL_USB_SDP_SUPPORT) += f_sdp.o > > endif > > > > # new USB gadget layer dependencies > > -ifdef CONFIG_USB_GADGET > > +ifdef CONFIG_$(SPL_)USB_GADGET > > obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o > > obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o > > obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o > > @@ -31,7 +31,7 @@ obj-$(CONFIG_USB_FUNCTION_SDP) += f_sdp.o > > obj-$(CONFIG_USB_FUNCTION_ROCKUSB) += f_rockusb.o > > endif > > endif > > -ifdef CONFIG_USB_ETHER > > +ifdef CONFIG_$(SPL_)USB_ETHER > > obj-y += ether.o > > obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o > > obj-$(CONFIG_CI_UDC) += ci_udc.o > > --- > > 2.24.1 > > > > > Best regards, > > Lukasz Majewski > > -- > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de
[PATCH] net: Handle disabling of compilation for SPL builds
Whilst the net/ directory is excluded from libs-y when CONFIG_SPL_NET_SUPPORT is disabled, this does not prevent SPL builds trying to compile net/ objects. During SPL builds overwrite the value of CONFIG_NET with CONFIG_SPL_NET_SUPPORT to exclude compilation during SPL builds. Signed-off-by: Nathan Rossi --- net/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/net/Makefile b/net/Makefile index fef71b940a..0f57244015 100644 --- a/net/Makefile +++ b/net/Makefile @@ -5,6 +5,10 @@ #ccflags-y += -DDEBUG +ifdef CONFIG_SPL_BUILD +CONFIG_NET = $(CONFIG_SPL_NET_SUPPORT) +endif + obj-$(CONFIG_NET) += arp.o obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o --- 2.24.1
[PATCH] usb: gadget: Handle SPL_* configs
Handle selection of objects based on $(SPL_) to allow for normal and SPL builds to have differing object compilation. Signed-off-by: Nathan Rossi --- drivers/usb/gadget/Makefile | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 70f3bf43e7..8967745513 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -3,8 +3,8 @@ # (C) Copyright 2000-2007 # Wolfgang Denk, DENX Software Engineering, w...@denx.de. -obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o -obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o +obj-$(CONFIG_$(SPL_)USB_GADGET) += epautoconf.o config.o usbstring.o +obj-$(CONFIG_$(SPL_)USB_ETHER) += epautoconf.o config.o usbstring.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_USB_GADGET) += g_dnl.o @@ -13,7 +13,7 @@ obj-$(CONFIG_SPL_USB_SDP_SUPPORT) += f_sdp.o endif # new USB gadget layer dependencies -ifdef CONFIG_USB_GADGET +ifdef CONFIG_$(SPL_)USB_GADGET obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o @@ -31,7 +31,7 @@ obj-$(CONFIG_USB_FUNCTION_SDP) += f_sdp.o obj-$(CONFIG_USB_FUNCTION_ROCKUSB) += f_rockusb.o endif endif -ifdef CONFIG_USB_ETHER +ifdef CONFIG_$(SPL_)USB_ETHER obj-y += ether.o obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o obj-$(CONFIG_CI_UDC) += ci_udc.o --- 2.24.1
[PATCH] cmd: Handle CONFIG_(SPL_)ENV_SUPPORT for toggling the nvedit object
When CONFIG_SPL_ENV_SUPPORT is disabled, nvedit was still being included as part of the build. Use the CONFIG_SPL_ENV_SUPPORT value as well as the non SPL CONFIG_ENV_SUPPORT variable to enable/disable the inclusion of nvedit. Signed-off-by: Nathan Rossi --- cmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/Makefile b/cmd/Makefile index 4f29b72c69..90dc09d095 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -186,7 +186,7 @@ endif # !CONFIG_SPL_BUILD obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o # core command -obj-y += nvedit.o +obj-$(CONFIG_$(SPL_)ENV_SUPPORT) += nvedit.o obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/ --- 2.24.1
Re: [U-Boot] [PATCH] tools: zynqimage: Add partition read support
On 16 March 2018 at 07:49, Alexander Graf wrote: > The zynqmp image format has support for inline partitions which are > used by FSBL to describe payloads that are loaded by FSBL itself. > > While we can't create images that contain partitions (yet), we should > still at least be able to examine them and show the user what's inside > when we analyze an image created by bootgen. > > Signed-off-by: Alexander Graf > --- > tools/zynqmpimage.c | 156 > +++- > 1 file changed, 155 insertions(+), 1 deletion(-) > > diff --git a/tools/zynqmpimage.c b/tools/zynqmpimage.c > index f48ac6dbe5..5183ea9bc8 100644 > --- a/tools/zynqmpimage.c > +++ b/tools/zynqmpimage.c > @@ -80,6 +80,71 @@ struct zynqmp_reginit { > #define HEADER_INTERRUPT_VECTORS 8 > #define HEADER_REGINITS256 > Please make sure to update the comment at the start of the file or add one here to state where these data structures are documented. For ZynqMP you likely got it from UG1137? This makes it easy for others to refer back to the documentation, as well as for legal reasons so that it is clear the details come from the user guide and not the FSBL source. Since for Zynq the FSBL specific image/partition table headers were only documented by Xilinx in the FSBL source itself, which is licensed such that it is incompatible with GPL. Thanks, Nathan > +struct image_header_table { > + uint32_t version; > + uint32_t nr_parts; > + uint32_t partition_header_offset; /* divided by 4 */ > + uint32_t __reserved1; > + uint32_t auth_certificate_offset; > + uint32_t partition_present_device; > + uint32_t __reserved2[9]; > + uint32_t checksum; > +}; > + > +#define PART_ATTR_VEC_LOCATION 0x80 > +#define PART_ATTR_BLOCK_SIZE_MASK 0x70 > +#define PART_ATTR_BIG_ENDIAN 0x04 > +#define PART_ATTR_PART_OWNER_MASK 0x03 > +#define PART_ATTR_PART_OWNER_FSBL 0x00 > +#define PART_ATTR_RSA_SIG 0x008000 > +#define PART_ATTR_CHECKSUM_MASK0x007000 > +#definePART_ATTR_CHECKSUM_NONE 0x00 > +#definePART_ATTR_CHECKSUM_MD5 0x001000 > +#definePART_ATTR_CHECKSUM_SHA2 0x002000 > +#definePART_ATTR_CHECKSUM_SHA3 0x003000 > +#define PART_ATTR_DEST_CPU_MASK0x000f00 > +#definePART_ATTR_DEST_CPU_NONE 0x00 > +#definePART_ATTR_DEST_CPU_A53_00x000100 > +#definePART_ATTR_DEST_CPU_A53_10x000200 > +#definePART_ATTR_DEST_CPU_A53_20x000300 > +#definePART_ATTR_DEST_CPU_A53_30x000400 > +#definePART_ATTR_DEST_CPU_R5_0 0x000500 > +#definePART_ATTR_DEST_CPU_R5_1 0x000600 > +#definePART_ATTR_DEST_CPU_R5_L 0x000700 > +#definePART_ATTR_DEST_CPU_PMU 0x000800 > +#define PART_ATTR_ENCRYPTED0x80 > +#define PART_ATTR_DEST_DEVICE_MASK 0x70 > +#definePART_ATTR_DEST_DEVICE_NONE 0x00 > +#definePART_ATTR_DEST_DEVICE_PS0x10 > +#definePART_ATTR_DEST_DEVICE_PL0x20 > +#definePART_ATTR_DEST_DEVICE_PMU 0x30 > +#define PART_ATTR_A53_EXEC_AARCH32 0x08 > +#define PART_ATTR_TARGET_EL_MASK 0x06 > +#define PART_ATTR_TR_SECURE_MASK 0x01 > + > +static const char *dest_cpus[0x10] = { > + "none", "A53-0", "A53-1", "A53-2", "A53-3", "R5-0", "R5-1", > + "R5-L", "PMU", "unknown", "unknown", "unknown", "unknown", > + "unknown", "unknown", "unknown" > +}; > + > +struct partition_header { > + uint32_t len_enc; /* divided by 4 */ > + uint32_t len_unenc; /* divided by 4 */ > + uint32_t len; /* divided by 4 */ > + uint32_t next_partition_offset; > + uint64_t entry_point; > + uint64_t load_address; > + uint32_t offset; /* divided by 4 */ > + uint32_t attributes; > + uint32_t section_count; > + uint32_t checksum_offset; /* divided by 4 */ > + uint32_t image_header_offset; > + uint32_t auth_certificate_offset; > + uint32_t __reserved1[1]; > + uint32_t checksum; > +}; > + > struct zynqmp_header { > uint32_t interrupt_vectors[HEADER_INTERRUPT_VECTORS]; /* 0x0 */ > uint32_t width_detection; /* 0x20 */ > @@ -93,7 +158,9 @@ struct zynqmp_header { > uint32_t image_stored_size; /* 0x40 */ > uint32_t image_at
Re: [U-Boot] Manual is out of date, missing commands and information
Hi Wolfgang, So I wrote that when I thought there were better guides online somewhere. I haven't found any more complete guides. Maybe that is intentional? Surely there is some guide out there, either for free or not. Also sorry for the emails with the confidentiality statement. I forgot it was there... -Nate Dear Nathan, In message < dm2pr0801mb074718634a75d114d3d5cd52b3...@dm2pr0801mb0747.namprd08.prod.outlook.com> you wrote: > This manual http://www.denx.de/wiki/DULG/Manual > is out of date and missing a lot of info. > I have been using it thinking it was the official manual. It is. And it is organized in the form of a wiki, where each and every U-Boot user has the opportnity to contribute, to fix bugs and to add missing parts. > But then I learned many commands are not listed there. Well, maybe you could help and add what you find is missing? > Please take down the manual so that people don't mistakenly use it thinking it is correct. This is IMO a stupid request. Incomplete documentation is still better than no documentation at all. Instead of complaining it would be more helpful if you supporteed the community by adding to and improving the documentation. Thanks. Wolfgang Denk ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Guide to hush shell in u-boot
Hi Wolfgang, How do people usually learn u-boot command line, scripting, and hush shell without any kind of syntax guide? -Nate Dear Nathan, In message < dm2pr0801mb074718634a75d114d3d5cd52b3...@dm2pr0801mb0747.namprd08.prod.outlook.com> you wrote: > This manual http://www.denx.de/wiki/DULG/Manual > is out of date and missing a lot of info. > I have been using it thinking it was the official manual. It is. And it is organized in the form of a wiki, where each and every U-Boot user has the opportnity to contribute, to fix bugs and to add missing parts. > But then I learned many commands are not listed there. Well, maybe you could help and add what you find is missing? > Please take down the manual so that people don't mistakenly use it thinking it is correct. This is IMO a stupid request. Incomplete documentation is still better than no documentation at all. Instead of complaining it would be more helpful if you supporteed the community by adding to and improving the documentation. Thanks. Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If you can't explain it to a six year old, you don't understand it yourself. - Albert Einstein ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] Guide to hush shell in u-boot
Anyone know where a guide to hush shell in u-boot would be? -Nate This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. If you have received this email in error, please immediately notify the Network Administrator by telephone at 336.615.8555. You will be reimbursed for reasonable costs incurred in notifying us. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] Manual is out of date, missing commands and information
This manual http://www.denx.de/wiki/DULG/Manual is out of date and missing a lot of info. I have been using it thinking it was the official manual. But then I learned many commands are not listed there. Please take down the manual so that people don't mistakenly use it thinking it is correct. -Nate This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. If you have received this email in error, please immediately notify the Network Administrator by telephone at 336.615.8555. You will be reimbursed for reasonable costs incurred in notifying us. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] List of architectures no longer printed
Hi, "mkimage -A -h" no longer prints architectures. Is there another way to get a list of architectures? Reference: http://manpages.ubuntu.com/manpages/xenial/man1/mkimage.1.html https://linux.die.net/man/1/mkimage "-A [architecture] Set architecture. Pass -h as the architecture to see the list of supported architectures." Using Ubuntu 16LTS, here is result: $ mkimage -A -h Usage: mkimage -l image -l ==> list image header information mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image -A ==> set architecture to 'arch' -O ==> set operating system to 'os' -T ==> set image type to 'type' -C ==> set compression type 'comp' -a ==> set load address to 'addr' (hex) -e ==> set entry point to 'ep' (hex) -n ==> set image name to 'name' -d ==> use image data from 'datafile' -x ==> set XIP (execute in place) mkimage [-D dtc_options] [-f fit-image.its|-F] fit-image -D => set all options for device tree compiler -f => input filename for FIT source Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined) mkimage -V ==> print version information and exit Use -T to see a list of available image types This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. If you have received this email in error, please immediately notify the Network Administrator by telephone at 336.615.8555. You will be reimbursed for reasonable costs incurred in notifying us. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] arm64: zynqmp: fail SPL build if no psu_init found
On 4 April 2017 at 17:20, Michal Simek wrote: > On 3.4.2017 13:38, Jean-Francois Dagenais wrote: >> >>> On Apr 3, 2017, at 02:55, Michal Simek wrote: >>> >>> This is not only one way how to configure system. You can use >>> psu_init*.tcl and configure chip through jtag and then you don't need >>> this .c/.h files. >>> You should be able to see warning already about it if you miss that files. >> >> Mmh. I had thought of that, but it seemed like this scenario might have been >> a >> minority issue. I guess this is a very yocto-centric problem. Warnings >> emitted >> inside builds that bitbake spawns are only visible in a log file for each >> steps >> (configure, compile, etc.) inside each recipe's work dir and so they are >> completely invisible to the operator that invokes bitbake. >> >> Perhaps I should come up with a strategy to emerge this particular warning in >> the u-boot-xlnx_%.bb recipe? >> >> Thoughts? The meta-xilinx layer has some logic to cause an error when these files are not available (currently only for zynq, this should work fine for the zynqmp use case as well). Specifically if nothing is providing the platform init files it will cause a dependency chain error. However due to u-boot source providing the platform init for some boards there is a list of u-boot configs that don't trigger the error on purpose. This could be extended to check that the symbols (the ps*_init ones) are compiled and included in the output u-boot-spl elf as a sanity check. Which would be more complete than just validating the files are there. Regards, Nathan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] net: zynq_gem: Fix masking of supported phydev features
When the zynq_gem driver initializes the phy it sets the supported features that the phy can support and advertise. However instead of masking the supported features such that it limits the available features it sets the phy to have the exact supported features of the zynq_gem. This is problematic as it will enable features that a phy does not have or cannot advertise. Specifically this appears as an issue when using a phy that is only capable of 10/100, but the zynq_gem driver will override this and try to enable and advertise 10/100/1000. Reported-by: Arno Steffens Fixes: 80243528ef ("net: gem: Fix gem driver on 1Gbps LAN") Signed-off-by: Nathan Rossi Tested-by: Arno Steffens Cc: Joe Hershberger Cc: Michal Simek --- drivers/net/zynq_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 86dd03feda..a160564439 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -340,7 +340,7 @@ static int zynq_phy_init(struct udevice *dev) if (!priv->phydev) return -ENODEV; - priv->phydev->supported = supported | ADVERTISED_Pause | + priv->phydev->supported &= supported | ADVERTISED_Pause | ADVERTISED_Asym_Pause; priv->phydev->advertising = priv->phydev->supported; -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 3/3] ARM64: zynqmp: Replace board specific with generic memory bank decoding
The dram_init and dram_init_banksize functions were using a board specific implementation for decoding the memory banks from the fdt. This board specific implementation uses a static variable 'tmp' which makes these functions unsafe for execution from within the board_init_f context. This change makes the dram_init* functions use a generic implementation of decoding and populating memory bank and size data. Signed-off-by: Nathan Rossi Fixes: 8d59d7f63b ("ARM64: zynqmp: Read RAM information from DT") Cc: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 112 ++- 1 file changed, 3 insertions(+), 109 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index cef1f6a13a..8a3d0043b9 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -180,121 +180,15 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) -{ - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys_size_t)); - } - - /* Return the first address size */ - return *(phys_size_t *)((char *)buf + sizeof(phys_addr_t)); -} - -#define FDT_REG_SIZE sizeof(u32) -/* Temp location for sharing data for storing */ -/* Up to 64-bit address + 64-bit size */ -static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; - void dram_init_banksize(void) { - int bank; - - memcpy(&gd->bd->bi_dram[0], &tmp, sizeof(tmp)); - - for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { - debug("Bank #%d: start %llx\n", bank, - (unsigned long long)gd->bd->bi_dram[bank].start); - debug("Bank #%d: size %llx\n", bank, - (unsigned long long)gd->bd->bi_dram[bank].size); - } + fdtdec_setup_memory_banksize(); } int dram_init(void) { - int node, len; - const void *blob = gd->fdt_blob; - const u32 *cell; - - memset(&tmp, 0, sizeof(tmp)); - - /* find or create "/memory" node. */ - node = fdt_subnode_offset(blob, 0, "memory"); - if (node < 0) { - printf("%s: Can't get memory node\n", __func__); - retu
[U-Boot] [PATCH v3 2/3] ARM: zynq: Replace board specific with generic memory bank decoding
The dram_init and dram_init_banksize functions were using a board specific implementation for decoding the memory banks from the fdt. This board specific implementation uses a static variable 'tmp' which makes these functions unsafe for execution from within the board_init_f context. This unsafe use of a static variable was causing a specific bug when using the zynq_zybo configuration, U-Boot would generate the following error during image load. This was caused due to dram_init overwriting the relocations for the 'image' variable within the do_bootm function. Out of coincidence the un-initialized memory has a compression type which is the same as the value for the relocation type R_ARM_RELATIVE. Uncompressing Invalid Image ... Unimplemented compression type 23 It should be noted that this is just one way the issue could surface, other cases my not be observed in normal boot flow. Depending on the size of various sections, and location of relocations within __rel_dyn and the compiler/linker the outcome of this bug can differ greatly. This change makes the dram_init* functions use a generic implementation of decoding and populating memory bank and size data. Signed-off-by: Nathan Rossi Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks") Cc: Michal Simek --- board/xilinx/zynq/board.c | 112 ++ 1 file changed, 3 insertions(+), 109 deletions(-) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 2c86940957..5cd9bbf711 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -124,121 +124,15 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) -{ - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys_size_t)); - } - - /* Return the first address size */ - return *(phys_size_t *)((char *)buf + sizeof(phys_addr_t)); -} - -#define FDT_REG_SIZE sizeof(u32) -/* Temp location for sharing data for storing */ -/* Up to 64-bit address + 64-bit size */ -static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; - void dram_init_banksize(void) { - int bank; - - memcpy(&gd->bd->bi_dram[0], &tmp, sizeof(tmp)); - - for (bank =
[U-Boot] [PATCH v3 0/3] Add generic FDT memory bank decoding and gd initialization
Currently most boards that have static memory config (which cannot be detected automatically) use CONFIG_SYS_SDRAM_SIZE to define the size of memory which is hard coded into U-Boot. With the addition of device tree support into U-Boot, boards that have device tree data can instead query the memory bank information from the embedded or appended device tree. This allows for more dynamic memory configuration and avoids the need to hard code memory configuration into U-Boot. The first patch of this series adds two helper functions for handling the memory bank decoding and initialization of global data which can be used by boards in their dram_init and dram_init_banksize functions. The purpose of these helper functions is to provide generic functions that handle the decoding and setup of memory and memory banks for boards that intend to use this mechanism. The series also changes the zynq and zynqmp board implementations to use these functions to resolve a issue with static variable use. Changes in v2: * Make fdtdec_setup_memory_banksize() return value consistent * Add more detail into the function documentation Changes in v3: * Wrap the fdtdec_setup_memory_banksize() function with an #if on CONFIG_NR_DRAM_BANKS, so that the function is only available for configs that have memory banks available in bd_t. Nathan Rossi (3): fdt: add memory bank decoding functions for board setup ARM: zynq: Replace board specific with generic memory bank decoding ARM64: zynqmp: Replace board specific with generic memory bank decoding board/xilinx/zynq/board.c| 112 ++- board/xilinx/zynqmp/zynqmp.c | 112 ++- include/fdtdec.h | 34 + lib/fdtdec.c | 56 ++ 4 files changed, 96 insertions(+), 218 deletions(-) -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/3] fdt: add memory bank decoding functions for board setup
Add two functions for use by board implementations to decode the memory banks of the /memory node so as to populate the global data with ram_size and board info for memory banks. The fdtdec_setup_memory_size() function decodes the first memory bank and sets up the gd->ram_size with the size of the memory bank. This function should be called from the boards dram_init(). The fdtdec_setup_memory_banksize() function decode the memory banks (up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size into the gd->bd->bi_dram array of banks. This function should be called from the boards dram_init_banksize(). Signed-off-by: Nathan Rossi Cc: Simon Glass Cc: Michal Simek Reviewed-by: Simon Glass --- v2: * Make fdtdec_setup_memory_banksize() return value consistent * Add more detail into the function documentation v3: * Wrap the fdtdec_setup_memory_banksize() function with an #if on CONFIG_NR_DRAM_BANKS, so that the function is only available for configs that have memory banks available in bd_t. This implementation of decoding has been tested on zynq and zynqmp boards with address/size cells of (1, 1), (1, 2), (2, 1), (2, 2) and up to 2 memory banks. --- include/fdtdec.h | 34 ++ lib/fdtdec.c | 56 2 files changed, 90 insertions(+) diff --git a/include/fdtdec.h b/include/fdtdec.h index 27887c8c21..d074478f14 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -976,6 +976,40 @@ struct display_timing { */ int fdtdec_decode_display_timing(const void *blob, int node, int index, struct display_timing *config); + +/** + * fdtdec_setup_memory_size() - decode and setup gd->ram_size + * + * Decode the /memory 'reg' property to determine the size of the first memory + * bank, populate the global data with the size of the first bank of memory. + * + * This function should be called from a boards dram_init(). This helper + * function allows for boards to query the device tree for DRAM size instead of + * hard coding the value in the case where the memory size cannot be detected + * automatically. + * + * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or + * invalid + */ +int fdtdec_setup_memory_size(void); + +/** + * fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram + * + * Decode the /memory 'reg' property to determine the address and size of the + * memory banks. Use this data to populate the global data board info with the + * phys address and size of memory banks. + * + * This function should be called from a boards dram_init_banksize(). This + * helper function allows for boards to query the device tree for memory bank + * information instead of hard coding the information in cases where it cannot + * be detected automatically. + * + * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or + * invalid + */ +int fdtdec_setup_memory_banksize(void); + /** * Set up the device tree ready for use */ diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 4e619c49a2..81f47ef2c7 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1174,6 +1174,62 @@ int fdtdec_decode_display_timing(const void *blob, int parent, int index, return ret; } +int fdtdec_setup_memory_size(void) +{ + int ret, mem; + struct fdt_resource res; + + mem = fdt_path_offset(gd->fdt_blob, "/memory"); + if (mem < 0) { + debug("%s: Missing /memory node\n", __func__); + return -EINVAL; + } + + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res); + if (ret != 0) { + debug("%s: Unable to decode first memory bank\n", __func__); + return -EINVAL; + } + + gd->ram_size = (phys_size_t)(res.end - res.start + 1); + debug("%s: Initial DRAM size %llx\n", __func__, (u64)gd->ram_size); + + return 0; +} + +#if defined(CONFIG_NR_DRAM_BANKS) +int fdtdec_setup_memory_banksize(void) +{ + int bank, ret, mem; + struct fdt_resource res; + + mem = fdt_path_offset(gd->fdt_blob, "/memory"); + if (mem < 0) { + debug("%s: Missing /memory node\n", __func__); + return -EINVAL; + } + + for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", bank, &res); + if (ret == -FDT_ERR_NOTFOUND) + break; + if (ret != 0) + return -EINVAL; + + gd->bd->bi_dram[bank].start = (phys_addr_t)res.start; + gd->bd->bi_dram[bank].size = + (phys_size_t)(res.end - res.start + 1); + + debug("%s: DRAM Bank #%d: start = 0x%llx, size = 0x%llx\
[U-Boot] [PATCH v2 1/3] fdt: add memory bank decoding functions for board setup
Add two functions for use by board implementations to decode the memory banks of the /memory node so as to populate the global data with ram_size and board info for memory banks. The fdtdec_setup_memory_size() function decodes the first memory bank and sets up the gd->ram_size with the size of the memory bank. This function should be called from the boards dram_init(). The fdtdec_setup_memory_banksize() function decode the memory banks (up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size into the gd->bd->bi_dram array of banks. This function should be called from the boards dram_init_banksize(). Signed-off-by: Nathan Rossi Cc: Simon Glass Cc: Michal Simek Reviewed-by: Simon Glass --- v2: * Make fdtdec_setup_memory_banksize() return value consistent * Add more detail into the function documentation This implementation of decoding has been tested on zynq and zynqmp boards with address/size cells of (1, 1), (1, 2), (2, 1), (2, 2) and up to 2 memory banks. --- include/fdtdec.h | 34 ++ lib/fdtdec.c | 54 ++ 2 files changed, 88 insertions(+) diff --git a/include/fdtdec.h b/include/fdtdec.h index 27887c8c21..d074478f14 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -976,6 +976,40 @@ struct display_timing { */ int fdtdec_decode_display_timing(const void *blob, int node, int index, struct display_timing *config); + +/** + * fdtdec_setup_memory_size() - decode and setup gd->ram_size + * + * Decode the /memory 'reg' property to determine the size of the first memory + * bank, populate the global data with the size of the first bank of memory. + * + * This function should be called from a boards dram_init(). This helper + * function allows for boards to query the device tree for DRAM size instead of + * hard coding the value in the case where the memory size cannot be detected + * automatically. + * + * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or + * invalid + */ +int fdtdec_setup_memory_size(void); + +/** + * fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram + * + * Decode the /memory 'reg' property to determine the address and size of the + * memory banks. Use this data to populate the global data board info with the + * phys address and size of memory banks. + * + * This function should be called from a boards dram_init_banksize(). This + * helper function allows for boards to query the device tree for memory bank + * information instead of hard coding the information in cases where it cannot + * be detected automatically. + * + * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or + * invalid + */ +int fdtdec_setup_memory_banksize(void); + /** * Set up the device tree ready for use */ diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 4e619c49a2..3bf9ff84f4 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1174,6 +1174,60 @@ int fdtdec_decode_display_timing(const void *blob, int parent, int index, return ret; } +int fdtdec_setup_memory_size(void) +{ + int ret, mem; + struct fdt_resource res; + + mem = fdt_path_offset(gd->fdt_blob, "/memory"); + if (mem < 0) { + debug("%s: Missing /memory node\n", __func__); + return -EINVAL; + } + + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res); + if (ret != 0) { + debug("%s: Unable to decode first memory bank\n", __func__); + return -EINVAL; + } + + gd->ram_size = (phys_size_t)(res.end - res.start + 1); + debug("%s: Initial DRAM size %llx\n", __func__, (u64)gd->ram_size); + + return 0; +} + +int fdtdec_setup_memory_banksize(void) +{ + int bank, ret, mem; + struct fdt_resource res; + + mem = fdt_path_offset(gd->fdt_blob, "/memory"); + if (mem < 0) { + debug("%s: Missing /memory node\n", __func__); + return -EINVAL; + } + + for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", bank, &res); + if (ret == -FDT_ERR_NOTFOUND) + break; + if (ret != 0) + return -EINVAL; + + gd->bd->bi_dram[bank].start = (phys_addr_t)res.start; + gd->bd->bi_dram[bank].size = + (phys_size_t)(res.end - res.start + 1); + + debug("%s: DRAM Bank #%d: start = 0x%llx, size = 0x%llx\n", + __func__, bank, + (unsigned long long)gd->bd->bi_dram[bank].start, + (unsigned long long)gd->bd->bi_dram[bank].size); + } + +
[U-Boot] [PATCH v2 3/3] ARM64: zynqmp: Replace board specific with generic memory bank decoding
The dram_init and dram_init_banksize functions were using a board specific implementation for decoding the memory banks from the fdt. This board specific implementation uses a static variable 'tmp' which makes these functions unsafe for execution from within the board_init_f context. This change makes the dram_init* functions use a generic implementation of decoding and populating memory bank and size data. Signed-off-by: Nathan Rossi Fixes: 8d59d7f63b ("ARM64: zynqmp: Read RAM information from DT") Cc: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 112 ++- 1 file changed, 3 insertions(+), 109 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index cef1f6a13a..8a3d0043b9 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -180,121 +180,15 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) -{ - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys_size_t)); - } - - /* Return the first address size */ - return *(phys_size_t *)((char *)buf + sizeof(phys_addr_t)); -} - -#define FDT_REG_SIZE sizeof(u32) -/* Temp location for sharing data for storing */ -/* Up to 64-bit address + 64-bit size */ -static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; - void dram_init_banksize(void) { - int bank; - - memcpy(&gd->bd->bi_dram[0], &tmp, sizeof(tmp)); - - for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { - debug("Bank #%d: start %llx\n", bank, - (unsigned long long)gd->bd->bi_dram[bank].start); - debug("Bank #%d: size %llx\n", bank, - (unsigned long long)gd->bd->bi_dram[bank].size); - } + fdtdec_setup_memory_banksize(); } int dram_init(void) { - int node, len; - const void *blob = gd->fdt_blob; - const u32 *cell; - - memset(&tmp, 0, sizeof(tmp)); - - /* find or create "/memory" node. */ - node = fdt_subnode_offset(blob, 0, "memory"); - if (node < 0) { - printf("%s: Can't get memory node\n", __func__); - retu
[U-Boot] [PATCH v2 0/3] Add generic FDT memory bank decoding and gd initialization
Currently most boards that have static memory config (which cannot be detected automatically) use CONFIG_SYS_SDRAM_SIZE to define the size of memory which is hard coded into U-Boot. With the addition of device tree support into U-Boot, boards that have device tree data can instead query the memory bank information from the embedded or appended device tree. This allows for more dynamic memory configuration and avoids the need to hard code memory configuration into U-Boot. The first patch of this series adds two helper functions for handling the memory bank decoding and initialization of global data which can be used by boards in their dram_init and dram_init_banksize functions. The purpose of these helper functions is to provide generic functions that handle the decoding and setup of memory and memory banks for boards that intend to use this mechanism. The series also changes the zynq and zynqmp board implementations to use these functions to resolve a issue with static variable use. Changes in v2: * Make fdtdec_setup_memory_banksize() return value consistent * Add more detail into the function documentation Nathan Rossi (3): fdt: add memory bank decoding functions for board setup ARM: zynq: Replace board specific with generic memory bank decoding ARM64: zynqmp: Replace board specific with generic memory bank decoding board/xilinx/zynq/board.c| 112 ++- board/xilinx/zynqmp/zynqmp.c | 112 ++- include/fdtdec.h | 34 + lib/fdtdec.c | 54 + 4 files changed, 94 insertions(+), 218 deletions(-) -- 2.10.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/3] ARM: zynq: Replace board specific with generic memory bank decoding
The dram_init and dram_init_banksize functions were using a board specific implementation for decoding the memory banks from the fdt. This board specific implementation uses a static variable 'tmp' which makes these functions unsafe for execution from within the board_init_f context. This unsafe use of a static variable was causing a specific bug when using the zynq_zybo configuration, U-Boot would generate the following error during image load. This was caused due to dram_init overwriting the relocations for the 'image' variable within the do_bootm function. Out of coincidence the un-initialized memory has a compression type which is the same as the value for the relocation type R_ARM_RELATIVE. Uncompressing Invalid Image ... Unimplemented compression type 23 It should be noted that this is just one way the issue could surface, other cases my not be observed in normal boot flow. Depending on the size of various sections, and location of relocations within __rel_dyn and the compiler/linker the outcome of this bug can differ greatly. This change makes the dram_init* functions use a generic implementation of decoding and populating memory bank and size data. Signed-off-by: Nathan Rossi Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks") Cc: Michal Simek --- board/xilinx/zynq/board.c | 112 ++ 1 file changed, 3 insertions(+), 109 deletions(-) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 2c86940957..5cd9bbf711 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -124,121 +124,15 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) -{ - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys_size_t)); - } - - /* Return the first address size */ - return *(phys_size_t *)((char *)buf + sizeof(phys_addr_t)); -} - -#define FDT_REG_SIZE sizeof(u32) -/* Temp location for sharing data for storing */ -/* Up to 64-bit address + 64-bit size */ -static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; - void dram_init_banksize(void) { - int bank; - - memcpy(&gd->bd->bi_dram[0], &tmp, sizeof(tmp)); - - for (bank =
Re: [U-Boot] [PATCH 1/3] fdt: add memory bank decoding functions for board setup
On 12 December 2016 at 06:27, Simon Glass wrote: > Hi Nathan, > > On 11 December 2016 at 08:58, Nathan Rossi wrote: >> Add two functions for use by board implementations to decode the memory >> banks of the /memory node so as to populate the global data with >> ram_size and board info for memory banks. >> >> The fdtdec_setup_memory_size() function decodes the first memory bank >> and sets up the gd->ram_size with the size of the memory bank. This >> function should be called from the boards dram_init(). >> >> The fdtdec_setup_memory_banksize() function decode the memory banks >> (up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size >> into the gd->bd->bi_dram array of banks. This function should be called >> from the boards dram_init_banksize(). >> >> Signed-off-by: Nathan Rossi >> Cc: Simon Glass >> Cc: Michal Simek >> --- >> This implementation of decoding has been tested on zynq and zynqmp >> boards with address/size cells of (1, 1), (1, 2), (2, 1), (2, 2) and >> up to 2 memory banks. >> --- >> include/fdtdec.h | 25 + >> lib/fdtdec.c | 54 ++ >> 2 files changed, 79 insertions(+) > > Reviewed-by: Simon Glass > > Please see nit below. > >> >> diff --git a/include/fdtdec.h b/include/fdtdec.h >> index 27887c8c21..59a204b571 100644 >> --- a/include/fdtdec.h >> +++ b/include/fdtdec.h >> @@ -976,6 +976,31 @@ struct display_timing { >> */ >> int fdtdec_decode_display_timing(const void *blob, int node, int index, >> struct display_timing *config); >> + >> +/** >> + * fdtdec_setup_memory_size() - decode and setup gd->ram_size >> + * >> + * Decode the /memory 'reg' property to determine the size of the first >> memory >> + * bank, populate the global data with the size of the first bank of memory. >> + * This function should be called from the boards dram_init(). >> + * >> + * @return 0 if OK, -EINVAL if the /memory node or reg property is missing >> or >> + * invalid >> + */ >> +int fdtdec_setup_memory_size(void); >> + >> +/** >> + * fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram >> + * >> + * Decode the /memory 'reg' property to determine the address and size of >> the >> + * memory banks. Use this data to populate the global data board info with >> the >> + * phys address and size of memory banks. This function should be called >> from >> + * the boards dram_init_banksize(). >> + * >> + * @return 0 if OK, negative on error > > Good to be specific, if e.g. it can only return -EINVAL. I will update this based on the change below. > >> + */ >> +int fdtdec_setup_memory_banksize(void); >> + >> /** >> * Set up the device tree ready for use >> */ >> diff --git a/lib/fdtdec.c b/lib/fdtdec.c >> index 4e619c49a2..bc3be017b6 100644 >> --- a/lib/fdtdec.c >> +++ b/lib/fdtdec.c >> @@ -1174,6 +1174,60 @@ int fdtdec_decode_display_timing(const void *blob, >> int parent, int index, >> return ret; >> } >> >> +int fdtdec_setup_memory_size(void) >> +{ >> + int ret, mem; >> + struct fdt_resource res; >> + >> + mem = fdt_path_offset(gd->fdt_blob, "/memory"); >> + if (mem < 0) { >> + debug("%s: Missing /memory node\n", __func__); >> + return -EINVAL; >> + } >> + >> + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res); >> + if (ret != 0) { >> + debug("%s: Unable to decode first memory bank\n", __func__); >> + return -EINVAL; >> + } >> + >> + gd->ram_size = (phys_size_t)(res.end - res.start + 1); >> + debug("%s: Initial DRAM size %llx\n", __func__, (u64)gd->ram_size); >> + >> + return 0; >> +} >> + >> +int fdtdec_setup_memory_banksize(void) >> +{ >> + int bank, ret, mem; >> + struct fdt_resource res; >> + >> + mem = fdt_path_offset(gd->fdt_blob, "/memory"); >> + if (mem < 0) { >> + debug("%s: Missing /memory node\n", __func__); >> + return -EINVAL; >> + } >> + >> + for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { >> + ret =
Re: [U-Boot] [PATCH 0/3] Add generic FDT memory bank decoding and gd initialization
On 12 December 2016 at 03:08, Igor Grinberg wrote: > On 12/11/16 18:47, Nathan Rossi wrote: >> On 12 December 2016 at 01:08, Igor Grinberg wrote: >>> Hi Nathan, >>> >>> On 12/11/16 15:58, Nathan Rossi wrote: >>>> This series adds two functions for handling the memory bank decoding and >>>> initialization of global data for use by boards in their dram_init and >>>> dram_init_banksize functions. >>> >>> I might have missed some discussions on this meter, >>> can you please provide the use cases for this? >>> IMO, the bootloader's job is to initialize the DRAM, detect its size, and >>> pass >>> the detected DRAM configuration on to an OS. >> >> Hi Igor, >> >> I do not think there have been any discussions on this (at least none >> that I am aware of). >> >> Some boards (like Zynq and ZynqMP ones) are using >> CONFIG_SYS_SDRAM_SIZE to define the amount of memory that is available >> (since detection is not possible). However with the introduction of >> dtbs for some boards they are also capable of loading the size of >> memory from the embedded/appended dtb (instead of hardcoded). This >> allows for more of the board config to be loaded from the device tree >> instead of from include/configs/*.h. This however is up to the >> individual board to implement in its dram_init* functions. > > Thanks for the explanation! > I assume that the key point is "detection is not possible" and therefore > we must rely on a user or a production process to place (append) the correct > dtb. > Makes sense to me now and looks like an improvement to the current situation. > >> >> The first patch of the series is only adding some decoding helper >> functions to make this generic between the Zynq and ZynqMP boards as >> well as to allow for any other boards that may want to use the same >> mechanism to get the memory size from the fdt. There is no requirement >> for boards to use these functions. > > Can you please next time place a similar explanation in at least the cover > letter. This way, the intent might be understood the first time ;-) Sorry about that, I will make sure future series have more complete descriptions in the cover letter. I have however updated the description for this in the v2 for completeness. > I would also like to see some parts of the above explanation in the functions > documentation (e.g. this allows to improve the DRAM configuration mechanics > on boards that cannot detect its DRAM size/config). Will add in v2. Regards, Nathan > > Thanks! > >> >> Regards, >> Nathan >> >>> >>>> >>>> The series also changes the zynq and zynqmp board implementations to use >>>> these functions to resolve a issue with static variable use. >>>> >>>> Nathan Rossi (3): >>>> fdt: add memory bank decoding functions for board setup >>>> ARM: zynq: Replace board specific with generic memory bank decoding >>>> ARM64: zynqmp: Replace board specific with generic memory bank >>>> decoding >>>> >>>> board/xilinx/zynq/board.c| 112 >>>> ++- >>>> board/xilinx/zynqmp/zynqmp.c | 112 >>>> ++- >>>> include/fdtdec.h | 25 ++ >>>> lib/fdtdec.c | 54 + >>>> 4 files changed, 85 insertions(+), 218 deletions(-) >>>> >>> >>> -- >>> Regards, >>> Igor. >> > > -- > Regards, > Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/3] Add generic FDT memory bank decoding and gd initialization
On 12 December 2016 at 01:08, Igor Grinberg wrote: > Hi Nathan, > > On 12/11/16 15:58, Nathan Rossi wrote: >> This series adds two functions for handling the memory bank decoding and >> initialization of global data for use by boards in their dram_init and >> dram_init_banksize functions. > > I might have missed some discussions on this meter, > can you please provide the use cases for this? > IMO, the bootloader's job is to initialize the DRAM, detect its size, and pass > the detected DRAM configuration on to an OS. Hi Igor, I do not think there have been any discussions on this (at least none that I am aware of). Some boards (like Zynq and ZynqMP ones) are using CONFIG_SYS_SDRAM_SIZE to define the amount of memory that is available (since detection is not possible). However with the introduction of dtbs for some boards they are also capable of loading the size of memory from the embedded/appended dtb (instead of hardcoded). This allows for more of the board config to be loaded from the device tree instead of from include/configs/*.h. This however is up to the individual board to implement in its dram_init* functions. The first patch of the series is only adding some decoding helper functions to make this generic between the Zynq and ZynqMP boards as well as to allow for any other boards that may want to use the same mechanism to get the memory size from the fdt. There is no requirement for boards to use these functions. Regards, Nathan > >> >> The series also changes the zynq and zynqmp board implementations to use >> these functions to resolve a issue with static variable use. >> >> Nathan Rossi (3): >> fdt: add memory bank decoding functions for board setup >> ARM: zynq: Replace board specific with generic memory bank decoding >> ARM64: zynqmp: Replace board specific with generic memory bank >> decoding >> >> board/xilinx/zynq/board.c| 112 >> ++- >> board/xilinx/zynqmp/zynqmp.c | 112 >> ++- >> include/fdtdec.h | 25 ++ >> lib/fdtdec.c | 54 + >> 4 files changed, 85 insertions(+), 218 deletions(-) >> > > -- > Regards, > Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] ARM64: zynqmp: Replace board specific with generic memory bank decoding
The dram_init and dram_init_banksize functions were using a board specific implementation for decoding the memory banks from the fdt. This board specific implementation uses a static variable 'tmp' which makes these functions unsafe for execution from within the board_init_f context. This change makes the dram_init* functions use a generic implementation of decoding and populating memory bank and size data. Signed-off-by: Nathan Rossi Fixes: 8d59d7f63b ("ARM64: zynqmp: Read RAM information from DT") Cc: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 112 ++- 1 file changed, 3 insertions(+), 109 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index cef1f6a13a..8a3d0043b9 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -180,121 +180,15 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) -{ - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys_size_t)); - } - - /* Return the first address size */ - return *(phys_size_t *)((char *)buf + sizeof(phys_addr_t)); -} - -#define FDT_REG_SIZE sizeof(u32) -/* Temp location for sharing data for storing */ -/* Up to 64-bit address + 64-bit size */ -static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; - void dram_init_banksize(void) { - int bank; - - memcpy(&gd->bd->bi_dram[0], &tmp, sizeof(tmp)); - - for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { - debug("Bank #%d: start %llx\n", bank, - (unsigned long long)gd->bd->bi_dram[bank].start); - debug("Bank #%d: size %llx\n", bank, - (unsigned long long)gd->bd->bi_dram[bank].size); - } + fdtdec_setup_memory_banksize(); } int dram_init(void) { - int node, len; - const void *blob = gd->fdt_blob; - const u32 *cell; - - memset(&tmp, 0, sizeof(tmp)); - - /* find or create "/memory" node. */ - node = fdt_subnode_offset(blob, 0, "memory"); - if (node < 0) { - printf("%s: Can't get memory node\n", __func__); - retu
[U-Boot] [PATCH 1/3] fdt: add memory bank decoding functions for board setup
Add two functions for use by board implementations to decode the memory banks of the /memory node so as to populate the global data with ram_size and board info for memory banks. The fdtdec_setup_memory_size() function decodes the first memory bank and sets up the gd->ram_size with the size of the memory bank. This function should be called from the boards dram_init(). The fdtdec_setup_memory_banksize() function decode the memory banks (up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size into the gd->bd->bi_dram array of banks. This function should be called from the boards dram_init_banksize(). Signed-off-by: Nathan Rossi Cc: Simon Glass Cc: Michal Simek --- This implementation of decoding has been tested on zynq and zynqmp boards with address/size cells of (1, 1), (1, 2), (2, 1), (2, 2) and up to 2 memory banks. --- include/fdtdec.h | 25 + lib/fdtdec.c | 54 ++ 2 files changed, 79 insertions(+) diff --git a/include/fdtdec.h b/include/fdtdec.h index 27887c8c21..59a204b571 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -976,6 +976,31 @@ struct display_timing { */ int fdtdec_decode_display_timing(const void *blob, int node, int index, struct display_timing *config); + +/** + * fdtdec_setup_memory_size() - decode and setup gd->ram_size + * + * Decode the /memory 'reg' property to determine the size of the first memory + * bank, populate the global data with the size of the first bank of memory. + * This function should be called from the boards dram_init(). + * + * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or + * invalid + */ +int fdtdec_setup_memory_size(void); + +/** + * fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram + * + * Decode the /memory 'reg' property to determine the address and size of the + * memory banks. Use this data to populate the global data board info with the + * phys address and size of memory banks. This function should be called from + * the boards dram_init_banksize(). + * + * @return 0 if OK, negative on error + */ +int fdtdec_setup_memory_banksize(void); + /** * Set up the device tree ready for use */ diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 4e619c49a2..bc3be017b6 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1174,6 +1174,60 @@ int fdtdec_decode_display_timing(const void *blob, int parent, int index, return ret; } +int fdtdec_setup_memory_size(void) +{ + int ret, mem; + struct fdt_resource res; + + mem = fdt_path_offset(gd->fdt_blob, "/memory"); + if (mem < 0) { + debug("%s: Missing /memory node\n", __func__); + return -EINVAL; + } + + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res); + if (ret != 0) { + debug("%s: Unable to decode first memory bank\n", __func__); + return -EINVAL; + } + + gd->ram_size = (phys_size_t)(res.end - res.start + 1); + debug("%s: Initial DRAM size %llx\n", __func__, (u64)gd->ram_size); + + return 0; +} + +int fdtdec_setup_memory_banksize(void) +{ + int bank, ret, mem; + struct fdt_resource res; + + mem = fdt_path_offset(gd->fdt_blob, "/memory"); + if (mem < 0) { + debug("%s: Missing /memory node\n", __func__); + return -EINVAL; + } + + for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { + ret = fdt_get_resource(gd->fdt_blob, mem, "reg", bank, &res); + if (ret == -FDT_ERR_NOTFOUND) + break; + if (ret != 0) + return ret; + + gd->bd->bi_dram[bank].start = (phys_addr_t)res.start; + gd->bd->bi_dram[bank].size = + (phys_size_t)(res.end - res.start + 1); + + debug("%s: DRAM Bank #%d: start = 0x%llx, size = 0x%llx\n", + __func__, bank, + (unsigned long long)gd->bd->bi_dram[bank].start, + (unsigned long long)gd->bd->bi_dram[bank].size); + } + + return 0; +} + int fdtdec_setup(void) { #if CONFIG_IS_ENABLED(OF_CONTROL) -- 2.10.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3] ARM: zynq: Replace board specific with generic memory bank decoding
The dram_init and dram_init_banksize functions were using a board specific implementation for decoding the memory banks from the fdt. This board specific implementation uses a static variable 'tmp' which makes these functions unsafe for execution from within the board_init_f context. This unsafe use of a static variable was causing a specific bug when using the zynq_zybo configuration, U-Boot would generate the following error during image load. This was caused due to dram_init overwriting the relocations for the 'image' variable within the do_bootm function. Out of coincidence the un-initialized memory has a compression type which is the same as the value for the relocation type R_ARM_RELATIVE. Uncompressing Invalid Image ... Unimplemented compression type 23 It should be noted that this is just one way the issue could surface, other cases my not be observed in normal boot flow. Depending on the size of various sections, and location of relocations within __rel_dyn and the compiler/linker the outcome of this bug can differ greatly. This change makes the dram_init* functions use a generic implementation of decoding and populating memory bank and size data. Signed-off-by: Nathan Rossi Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks") Cc: Michal Simek --- board/xilinx/zynq/board.c | 112 ++ 1 file changed, 3 insertions(+), 109 deletions(-) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 2c86940957..5cd9bbf711 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -124,121 +124,15 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) -{ - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys_size_t)); - } - - /* Return the first address size */ - return *(phys_size_t *)((char *)buf + sizeof(phys_addr_t)); -} - -#define FDT_REG_SIZE sizeof(u32) -/* Temp location for sharing data for storing */ -/* Up to 64-bit address + 64-bit size */ -static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; - void dram_init_banksize(void) { - int bank; - - memcpy(&gd->bd->bi_dram[0], &tmp, sizeof(tmp)); - - for (bank =
[U-Boot] [PATCH 0/3] Add generic FDT memory bank decoding and gd initialization
This series adds two functions for handling the memory bank decoding and initialization of global data for use by boards in their dram_init and dram_init_banksize functions. The series also changes the zynq and zynqmp board implementations to use these functions to resolve a issue with static variable use. Nathan Rossi (3): fdt: add memory bank decoding functions for board setup ARM: zynq: Replace board specific with generic memory bank decoding ARM64: zynqmp: Replace board specific with generic memory bank decoding board/xilinx/zynq/board.c| 112 ++- board/xilinx/zynqmp/zynqmp.c | 112 ++- include/fdtdec.h | 25 ++ lib/fdtdec.c | 54 + 4 files changed, 85 insertions(+), 218 deletions(-) -- 2.10.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC PATCH] ARM: zynq: Replace dram_init* functions with board_init_f safe ones
The dram_init* functions for the zynq board are not safe for use from the board_init_f stage due to its use of the 'tmp' static variable. This incorrect use of a static variable was causing rare issues where the dram_init function would overwrite some parts the __rel_dyn section which caused obscure failures. Using the zynq_zybo configuration, U-Boot would generate the following error during image load. This was caused due to dram_init overwriting the relocations for the "image" variable within the do_bootm function. Out of coincidence the un-initialized memory has a compression type which is the same as the value for the relocation type R_ARM_RELATIVE. Uncompressing Invalid Image ... Unimplemented compression type 23 It should be noted that this is just one way the issue could surface, other cases my not be observed in normal boot flow. This change removes the existing code and copies the implementation of the dram_init and dram_init_banksize from the arch/arm/mach-uniphier/dram_init.c source. This version of these functions does not use static variables and behaves the same (reading banks from fdt, and using the first bank as the ram_size). Signed-off-by: Nathan Rossi Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks") Cc: Michal Simek --- I am sending this as an RFC first to query whether it would make sense to have the setup of memory info based on FDT information as a common function that could be re-used or maybe always used (if OF enabled and SDRAM_SIZE not used) from board_init_f. And in that regard get some feedback on the best way to implement such. This change would also need to be applied to the zynqmp dram_init* functions. --- board/xilinx/zynq/board.c | 148 -- 1 file changed, 50 insertions(+), 98 deletions(-) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 2c86940957..c5e7b99d97 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -124,121 +124,73 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) -/* - * fdt_get_reg - Fill buffer by information from DT - */ -static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, - const u32 *cell, int n) +static const void *get_memory_reg_prop(const void *fdt, int *lenp) { - int i = 0, b, banks; - int parent_offset = fdt_parent_offset(fdt, nodeoffset); - int address_cells = fdt_address_cells(fdt, parent_offset); - int size_cells = fdt_size_cells(fdt, parent_offset); - char *p = buf; - u64 val; - u64 vals; - - debug("%s: addr_cells=%x, size_cell=%x, buf=%p, cell=%p\n", - __func__, address_cells, size_cells, buf, cell); - - /* Check memory bank setup */ - banks = n % (address_cells + size_cells); - if (banks) - panic("Incorrect memory setup cells=%d, ac=%d, sc=%d\n", - n, address_cells, size_cells); - - banks = n / (address_cells + size_cells); - - for (b = 0; b < banks; b++) { - debug("%s: Bank #%d:\n", __func__, b); - if (address_cells == 2) { - val = cell[i + 1]; - val <<= 32; - val |= cell[i]; - val = fdt64_to_cpu(val); - debug("%s: addr64=%llx, ptr=%p, cell=%p\n", - __func__, val, p, &cell[i]); - *(phys_addr_t *)p = val; - } else { - debug("%s: addr32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_addr_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_addr_t); - i += address_cells; - - debug("%s: pa=%p, i=%x, size=%zu\n", __func__, p, i, - sizeof(phys_addr_t)); - - if (size_cells == 2) { - vals = cell[i + 1]; - vals <<= 32; - vals |= cell[i]; - vals = fdt64_to_cpu(vals); - - debug("%s: size64=%llx, ptr=%p, cell=%p\n", - __func__, vals, p, &cell[i]); - *(phys_size_t *)p = vals; - } else { - debug("%s: size32=%x, ptr=%p\n", - __func__, fdt32_to_cpu(cell[i]), p); - *(phys_size_t *)p = fdt32_to_cpu(cell[i]); - } - p += sizeof(phys_size_t); - i += size_cells; - - debug("%s: ps=%p, i=%x, size=%zu\n", - __func__, p, i, sizeof(phys
[U-Boot] [PATCH] net: add synopsys QoS ethernet driver
This NIC is similar to the designware nic, however it has different registers and descriptors, hence the new driver. Signed-off-by: Nathan Sullivan --- drivers/net/Kconfig | 19 ++ drivers/net/Makefile | 1 + drivers/net/dwc_eth_qos.c | 773 ++ drivers/net/dwc_eth_qos.h | 219 + 4 files changed, 1012 insertions(+) create mode 100644 drivers/net/dwc_eth_qos.c create mode 100644 drivers/net/dwc_eth_qos.h diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 302c005..7a4dc68 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -124,6 +124,25 @@ config ETH_DESIGNWARE 100Mbit and 1 Gbit operation. You must enable CONFIG_PHYLIB to provide the PHY (physical media interface). +config ETH_DESIGNWARE_QOS + bool "Synopsys Designware Ethernet QoS MAC" + select PHYLIB + help + This MAC is present in SoCs from various vendors. It supports + 100Mbit and 1 Gbit operation. You must enable CONFIG_PHYLIB to + provide the PHY (physical media interface). It is similar to + designware ethernet, but with more features and a different + interface. + +config ETH_DESIGNWARE_QOS_FIXED_LINK + bool "Fixed 1G link on QoS MAC" + default n + depends on ETH_DESIGNWARE_QOS + help + Select to force the QoS MAC to always link at 1G, full duplex + with no attached phy. Useful for direct attachment to a + switch. + config ETHOC bool "OpenCores 10/100 Mbps Ethernet MAC" help diff --git a/drivers/net/Makefile b/drivers/net/Makefile index a448526..c8ba347 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -18,6 +18,7 @@ obj-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o obj-$(CONFIG_CS8900) += cs8900.o obj-$(CONFIG_TULIP) += dc2114x.o obj-$(CONFIG_ETH_DESIGNWARE) += designware.o +obj-$(CONFIG_ETH_DESIGNWARE_QOS) += dwc_eth_qos.o obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o obj-$(CONFIG_DNET) += dnet.o obj-$(CONFIG_E1000) += e1000.o diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c new file mode 100644 index 000..f97fca1 --- /dev/null +++ b/drivers/net/dwc_eth_qos.c @@ -0,0 +1,773 @@ +/* + * (C) Copyright 2016 + * National Instruments + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +/* + * Designware QoS ethernet IP driver for U-Boot + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "dwc_eth_qos.h" + +DECLARE_GLOBAL_DATA_PTR; + +#ifndef CONFIG_ETH_DESIGNWARE_QOS_FIXED_LINK + +static int dw_qos_mdio_read(struct mii_dev *bus, int addr, int devad, int reg) +{ +#ifdef CONFIG_DM_ETH + struct dw_qos_eth_dev *priv = dev_get_priv((struct udevice *)bus->priv); + struct eth_mac_regs *mac_p = priv->mac_regs_p; +#else + struct eth_mac_regs *mac_p = bus->priv; +#endif + ulong start; + u32 miiaddr; + int timeout = CONFIG_MDIO_TIMEOUT; + + miiaddr = ((addr << MIIADDRSHIFT) & MII_ADDRMSK) | + ((reg << MIIREGSHIFT) & MII_REGMSK) | MII_READ; + + miiaddr |= (MII_CLKRANGE_150_250M << MIICLKSHIFT) & MII_CLKMSK; + + writel(miiaddr | MII_BUSY, &mac_p->miiaddr); + + start = get_timer(0); + while (get_timer(start) < timeout) { + if (!(readl(&mac_p->miiaddr) & MII_BUSY)) + return readl(&mac_p->miidata); + udelay(10); + }; + + return -ETIMEDOUT; +} + +static int dw_qos_mdio_write(struct mii_dev *bus, int addr, int devad, int reg, + u16 val) +{ +#ifdef CONFIG_DM_ETH + struct dw_qos_eth_dev *priv = dev_get_priv((struct udevice *)bus->priv); + struct eth_mac_regs *mac_p = priv->mac_regs_p; +#else + struct eth_mac_regs *mac_p = bus->priv; +#endif + ulong start; + u32 miiaddr; + int ret = -ETIMEDOUT, timeout = CONFIG_MDIO_TIMEOUT; + + writel(val, &mac_p->miidata); + miiaddr = ((addr << MIIADDRSHIFT) & MII_ADDRMSK) | + ((reg << MIIREGSHIFT) & MII_REGMSK) | MII_WRITE; + + miiaddr |= (MII_CLKRANGE_150_250M << MIICLKSHIFT) & MII_CLKMSK; + + writel(miiaddr | MII_BUSY, &mac_p->miiaddr); + + start = get_timer(0); + while (get_timer(start) < timeout) { + if (!(readl(&mac_p->miiaddr) & MII_BUSY)) { + ret = 0; + break; + } + udelay(10); + }; + + return ret; +} + +#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO) +static int dw_qos_mdio_reset(struct mii_dev *bus) +{ + struct udevice *dev = bus->priv; + struct dw_qos_eth_dev *priv = dev_get_priv(dev); + struct dw_qos_eth_pdata *pdata = dev_get_platdat
[U-Boot] [PATCH] net: phy: marvell: Do not reset 88e1310 after autoneg
Commit a058052c "net: phy: do not read configuration register on reset", changes the behaviour of the phy_reset function such that the state of the BMCR register is not preserved during reset. Change the config function for the m88e1310 so that it does not do a reset after configuring auto-negotiation. Signed-off-by: Nathan Rossi Cc: Joe Hershberger Cc: Michal Simek Cc: Stefan Roese --- drivers/net/phy/marvell.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index d2e68d4..58d287b 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -476,10 +476,7 @@ static int m88e1310_config(struct phy_device *phydev) /* Ensure to return to page 0 */ phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1310_PHY_PAGE, 0x); - genphy_config_aneg(phydev); - phy_reset(phydev); - - return 0; + return genphy_config_aneg(phydev); } static struct phy_driver M88E1011S_driver = { -- 2.8.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] net: phy: marvell: Fix up reset ordering
On Thu, Jun 2, 2016 at 3:59 PM, Michal Simek wrote: > On 2.6.2016 07:42, Stefan Roese wrote: >> Hi Michal, >> >> On 02.06.2016 07:31, Michal Simek wrote: >>> On 1.6.2016 18:22, Nathan Rossi wrote: >>>> Commit a058052c "net: phy: do not read configuration register on reset", >>>> changes the behaviour of the phy_reset function such that the state of >>>> the BMCR register is not preserved during reset. >>>> >>>> Reorder the phy_reset and genphy_config_aneg calls for some of the >>>> marvell phy drivers so that auto-negotiation occurs after reset. >>>> >>>> Signed-off-by: Nathan Rossi >>>> Cc: Joe Hershberger >>>> Cc: Michal Simek >>>> Cc: Stefan Roese >>>> --- >>>> drivers/net/phy/marvell.c | 11 ++- >>>> 1 file changed, 6 insertions(+), 5 deletions(-) >>>> >>>> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c >>>> index d2e68d4..40284a5 100644 >>>> --- a/drivers/net/phy/marvell.c >>>> +++ b/drivers/net/phy/marvell.c >>>> @@ -414,10 +414,10 @@ static int m88e1145_config(struct phy_device >>>> *phydev) >>>> MIIM_M88E1145_RGMII_TX_DELAY; >>>> phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_EXT_CR, reg); >>>> >>>> -genphy_config_aneg(phydev); >>>> - >>>> phy_reset(phydev); >>>> >>>> +genphy_config_aneg(phydev); >>>> + >>> >>> As you see from my patch >>> 1b008fdb06848c7c84e7c1a4a9b2b76239550555 >>> you should return value from genphy_config_aneg() which should be fixed >>> everywhere. >>> >>> Also as you see above you do some writes to the phy and the question is >>> if you should run phy_reset here. >>> Based on my patch above and investigating I found that phy_reset is >>> called before this function is called and not sure if phy should be >>> reset twice. >> >> Some changes to the PHY registers need a soft-reset to occur >> before these changes to be effective. Not sure if this is the case >> here though. >> >> But I share your thoughts about this phy_reset() being called now >> in some of the xxx_config() functions and not in others. Your patch >> mentions that phy_reset() is already called in phy_connect_dev(), >> which not all ethernet drivers do right now AFAICT. >> >> We should perhaps take a look at the Linux Marvell PHY driver to >> check how it is done there. The m88e131(8/0) in linux does not reset during config. The m88e1145 in linux does not reset during config. The m88e1149 in linux does reset during config. Also there are differences in what is configured between linux and u-boot, so it is a bit hard to determine if the reset is required based on the registers being configured. > > That was also the part of the reason that I have fixed just one > particular phy which I have access to. I expect that some phy can > require this reset and some of them not. > But definitely this should be properly tested. > I am only using the 88e1318 (same as 88e1310 but 1.8V variant). In the configuration it is used on the board I am testing the phy reset does not appear to be needed, behaviour is consistent with and or without the reset (given the config_aneg being after the reset). With the config_aneg being before the reset, it causes the phy to disable autoneg. I will send a separate patch that only applies to that device, removing the phy reset and making the return value that of genphy_config_aneg. Regards, Nathan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] zynq: Add Adapteva Parallella board support
The Parallella is a single board computer showcasing the Epiphany multi-core processor from Adapteva. The board uses a Zynq-7000 SoC which interconnects to the Epiphany. This patch adds support for booting on the Zynq system of the board. More information on this board is available at: https://parallella.org/ Signed-off-by: Nathan Rossi Cc: Albert Aribaud Cc: Michal Simek --- arch/arm/dts/Makefile | 1 + arch/arm/dts/zynq-parallella.dts | 96 +++ configs/zynq_parallella_defconfig | 36 +++ include/configs/zynq_parallella.h | 17 +++ 4 files changed, 150 insertions(+) create mode 100644 arch/arm/dts/zynq-parallella.dts create mode 100644 configs/zynq_parallella_defconfig create mode 100644 include/configs/zynq_parallella.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 92c7545..de249a4 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -79,6 +79,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \ zynq-zed.dtb \ zynq-zybo.dtb \ zynq-microzed.dtb \ + zynq-parallella.dtb \ zynq-picozed.dtb \ zynq-zc770-xm010.dtb \ zynq-zc770-xm011.dtb \ diff --git a/arch/arm/dts/zynq-parallella.dts b/arch/arm/dts/zynq-parallella.dts new file mode 100644 index 000..2a8a805 --- /dev/null +++ b/arch/arm/dts/zynq-parallella.dts @@ -0,0 +1,96 @@ +/* + * Adapteva Parallella board DTS + * + * Copyright (C) 2011 - 2013 Xilinx + * Copyright (C) 2012 National Instruments Corp. + * Copyright (C) 2014 SUSE LINUX Products GmbH + * Copyright (C) 2016 Nathan Rossi + * + * SPDX-License-Identifier:GPL-2.0+ + */ +/dts-v1/; +/include/ "zynq-7000.dtsi" + +/ { + model = "Adapteva Parallella Board"; + compatible = "adapteva,parallella", "xlnx,zynq-7000"; + + aliases { + ethernet0 = &gem0; + serial0 = &uart1; + spi0 = &qspi; + mmc0 = &sdhci0; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x4000>; + }; + + chosen { + bootargs = "earlyprintk"; + stdout-path = "serial0:115200n8"; + }; +}; + +&clkc { + fclk-enable = <0xf>; + ps-clk-frequency = <>; +}; + +&gem0 { + status = "okay"; + phy-mode = "rgmii-id"; + phy-handle = <ðernet_phy>; + + ethernet_phy: ethernet-phy@0 { + /* Marvell 88E1318 */ + compatible = "ethernet-phy-id0141.0e90", +"ethernet-phy-ieee802.3-c22"; + reg = <0>; + marvell,reg-init = <0x3 0x10 0xff00 0x1e>, + <0x3 0x11 0xfff0 0xa>; + }; +}; + +&i2c0 { + status = "okay"; + + isl9305: isl9305@68 { + compatible = "isil,isl9305"; + reg = <0x68>; + + regulators { + dcd1 { + regulator-name = "VDD_DSP"; + regulator-always-on; + }; + dcd2 { + regulator-name = "1P35V"; + regulator-always-on; + }; + ldo1 { + regulator-name = "VDD_ADJ"; + }; + ldo2 { + regulator-name = "VDD_GPIO"; + regulator-always-on; + }; + }; + }; +}; + +&sdhci1 { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&uart1 { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&qspi { + u-boot,dm-pre-reloc; + status = "okay"; +}; diff --git a/configs/zynq_parallella_defconfig b/configs/zynq_parallella_defconfig new file mode 100644 index 000..fe05c82 --- /dev/null +++ b/configs/zynq_parallella_defconfig @@ -0,0 +1,36 @@ +CONFIG_ARM=y +CONFIG_SYS_CONFIG_NAME="zynq_parallella" +CONFIG_ARCH_ZYNQ=y +CONFIG_DEFAULT_DEVICE_TREE="zynq-parallella" +CONFIG_SPL=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_FIT_SIGNATURE=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_PROMPT="Parallella> " +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +CONFIG_CMD_GPIO=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_Z
[U-Boot] [PATCH] net: phy: marvell: Fix up reset ordering
Commit a058052c "net: phy: do not read configuration register on reset", changes the behaviour of the phy_reset function such that the state of the BMCR register is not preserved during reset. Reorder the phy_reset and genphy_config_aneg calls for some of the marvell phy drivers so that auto-negotiation occurs after reset. Signed-off-by: Nathan Rossi Cc: Joe Hershberger Cc: Michal Simek Cc: Stefan Roese --- drivers/net/phy/marvell.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index d2e68d4..40284a5 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -414,10 +414,10 @@ static int m88e1145_config(struct phy_device *phydev) MIIM_M88E1145_RGMII_TX_DELAY; phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1145_PHY_EXT_CR, reg); - genphy_config_aneg(phydev); - phy_reset(phydev); + genphy_config_aneg(phydev); + return 0; } @@ -443,10 +443,10 @@ static int m88e1149_config(struct phy_device *phydev) phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x0); phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100); - genphy_config_aneg(phydev); - phy_reset(phydev); + genphy_config_aneg(phydev); + return 0; } @@ -476,9 +476,10 @@ static int m88e1310_config(struct phy_device *phydev) /* Ensure to return to page 0 */ phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1310_PHY_PAGE, 0x); - genphy_config_aneg(phydev); phy_reset(phydev); + genphy_config_aneg(phydev); + return 0; } -- 2.8.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Altera Cyclone 5 UART Communication Issues - U-Boot 2016.03
Hello All, I'm currently running U-Boot 2016.03 on a Terasic SoC Kit without any apparent issues. However, when I go to run the same build on our custom board, the debug port's UART0 RXD fails to receive any key presses when I'm attempting to stop autoboot. On both boards, the debug UART0 TX and RX lines are using the same pins for. The only difference between the boards is that our custom board is routing the UART TX and RX lines through the FPGA fabric. I'm making sure to start up the FPGA with these few additional lines in the boot sequence: #fatload mmc 0:${mmcloadpart} 0x200 soc_system.rbf; fpga load 0 0x200 0x23C1B4; I can tell that the FPGA does seem to be running fine, as the UART TX is coming through (I see all the proper boot info) and an FPGA controlled heartbeat LED starts blinking. Does anyone have any insight into what could be going on? Thank you, Nathan Barrett confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e- mail and highlight the error. Security Warning: Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Viruses: Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-Boot 2016.03 on Altera Cyclone 5 SOCKIT
Hey Anatolij, Thanks for getting back to me. I actually just solved this a few minutes ago. Here's the relevant patch: --- git.old/include/configs/socfpga_common.h +++ git/include/configs/socfpga_common.h @@ -365,9 +365,12 @@ #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME"u-boot-dtb.img" #define CONFIG_SPL_LIBDISK_SUPPORT #else -#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 3 -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR0xa00 /* offset 2560 sect (1M+256k) */ -#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */ +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBDISK_SUPPORT +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 3 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200 /* offset 512 sectors (256k) */ +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */ #endif #endif Sincerely, Nathan Barrett -Original Message- From: Anatolij Gustschin [mailto:ag...@denx.de] Sent: Friday, May 13, 2016 9:44 AM To: Nathan Barrett Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] U-Boot 2016.03 on Altera Cyclone 5 SOCKIT Hi Nathan, On Thu, 12 May 2016 20:11:00 + Nathan Barrett nathan.barr...@ndc.com wrote: > Hello All, > > I'm trying to run U-Boot 2016 on a Terasic Cyclone 5 SoC Kit. I've got > everything running up to this point: > > U-Boot SPL 2016.03 (May 12 2016 - 14:56:58) > ../drivers/ddr/altera/sequencer.c: Preparing to start memory > calibration > ../drivers/ddr/altera/sequencer.c: CALIBRATION PASSED > ../drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot > from MMC bad magic > SPL: failed to boot from all boot devices ### ERROR ### Please RESET > the board ### > > If I look at my generated u-boot-with-spl.sfp, at address 0x3FFF0, I can see > that U-Boot is sitting there and starts with the proper magic number header > (0x27051956). > > This file is being placed onto my SD card via > > #sudo dd if=u-boot-with-spl.sfp of=/dev/sdb3 I think you do not have CONFIG_SPL_FAT_SUPPORT or CONFIG_SPL_EXT_SUPPORT defined in the board config file and SPL uses MMCSD_MODE_RAW and just reads at offset CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR of the card and not from the partition 3. > I went ahead and added some debugging breadcrumbs as well: > > U-Boot SPL 2016.03 (May 12 2016 - 15:27:36) > ../drivers/ddr/altera/sequencer.c: Preparing to start memory > calibration > ../drivers/ddr/altera/sequencer.c: CALIBRATION PASSED > ../drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot > from MMC > > ---At line 37 of common/spl/spl_mmc.c --- read sector a00, count=1 SPL reads at byte offset 0x14 of the device it seems. > CONFIG_SYS_TEXT_BASE = 140 > sizeof(struct image_header) = 40 > magic = dba5b8aa > --- > > bad magic > SPL: failed to boot from all boot devices ### ERROR ### Please RESET > the board ### > > Can anyone assist? Does SPL detect the image if you write it to the sd-card as below? dd if=u-boot-with-spl.sfp of=/dev/sdb bs=1M seek=1 But please only write it this way if there is no partition with important data at the beginning of your sd-card. HTH, Anatolij confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e- mail and highlight the error. Security Warning: Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Viruses: Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] U-Boot 2016.03 on Altera Cyclone 5 SOCKIT
Hello All, I'm trying to run U-Boot 2016 on a Terasic Cyclone 5 SoC Kit. I've got everything running up to this point: U-Boot SPL 2016.03 (May 12 2016 - 14:56:58) ../drivers/ddr/altera/sequencer.c: Preparing to start memory calibration ../drivers/ddr/altera/sequencer.c: CALIBRATION PASSED ../drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot from MMC bad magic SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### If I look at my generated u-boot-with-spl.sfp, at address 0x3FFF0, I can see that U-Boot is sitting there and starts with the proper magic number header (0x27051956). This file is being placed onto my SD card via #sudo dd if=u-boot-with-spl.sfp of=/dev/sdb3 I went ahead and added some debugging breadcrumbs as well: U-Boot SPL 2016.03 (May 12 2016 - 15:27:36) ../drivers/ddr/altera/sequencer.c: Preparing to start memory calibration ../drivers/ddr/altera/sequencer.c: CALIBRATION PASSED ../drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot from MMC ---At line 37 of common/spl/spl_mmc.c --- read sector a00, count=1 CONFIG_SYS_TEXT_BASE = 140 sizeof(struct image_header) = 40 magic = dba5b8aa --- bad magic SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### Can anyone assist? Thanks, Nathan Barrett confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e- mail and highlight the error. Security Warning: Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Viruses: Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 12/16] ARM: zynq: Extend microzed board support
On Fri, Apr 8, 2016 at 3:01 AM, Michal Simek wrote: > Add missing DT nodes and enable USB. > > Signed-off-by: Michal Simek Reviewed-by: Nathan Rossi > --- > > arch/arm/dts/zynq-microzed.dts | 38 +- > configs/zynq_microzed_defconfig | 4 > include/configs/zynq_microzed.h | 2 ++ > 3 files changed, 43 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/dts/zynq-microzed.dts b/arch/arm/dts/zynq-microzed.dts > index 793ab44eae24..cb238cd5e7bb 100644 > --- a/arch/arm/dts/zynq-microzed.dts > +++ b/arch/arm/dts/zynq-microzed.dts > @@ -1,7 +1,7 @@ > /* > * Xilinx MicroZED board DTS > * > - * Copyright (C) 2013 Xilinx, Inc. > + * Copyright (C) 2013 - 2016 Xilinx, Inc. > * > * SPDX-License-Identifier:GPL-2.0+ > */ > @@ -15,12 +15,27 @@ > aliases { > serial0 = &uart1; > spi0 = &qspi; > + mmc0 = &sdhci0; > }; > > memory { > device_type = "memory"; > reg = <0 0x4000>; > }; > + > + chosen { > + bootargs = "earlyprintk"; > + stdout-path = "serial0:115200n8"; > + }; > + > + usb_phy0: phy0 { > + compatible = "usb-nop-xceiv"; > + #phy-cells = <0>; > + }; > +}; > + > +&clkc { > + ps-clk-frequency = <>; > }; > > &qspi { > @@ -32,3 +47,24 @@ > u-boot,dm-pre-reloc; > status = "okay"; > }; > + > +&gem0 { > + status = "okay"; > + phy-mode = "rgmii-id"; > + phy-handle = <ðernet_phy>; > + > + ethernet_phy: ethernet-phy@0 { > + reg = <0>; > + }; > +}; > + > +&sdhci0 { > + u-boot,dm-pre-reloc; > + status = "okay"; > +}; > + > +&usb0 { > + status = "okay"; > + dr_mode = "host"; > + usb-phy = <&usb_phy0>; > +}; > diff --git a/configs/zynq_microzed_defconfig b/configs/zynq_microzed_defconfig > index 1d70e43df0c8..bd261c16ebb0 100644 > --- a/configs/zynq_microzed_defconfig > +++ b/configs/zynq_microzed_defconfig > @@ -21,3 +21,7 @@ CONFIG_SPI_FLASH_STMICRO=y > CONFIG_SPI_FLASH_WINBOND=y > CONFIG_ZYNQ_GEM=y > CONFIG_ZYNQ_QSPI=y > +CONFIG_USB=y > +CONFIG_USB_ULPI_VIEWPORT=y > +CONFIG_USB_ULPI=y > +CONFIG_USB_GADGET=y > diff --git a/include/configs/zynq_microzed.h b/include/configs/zynq_microzed.h > index e66088da4f79..ec7bb1cef553 100644 > --- a/include/configs/zynq_microzed.h > +++ b/include/configs/zynq_microzed.h > @@ -12,6 +12,8 @@ > > #define CONFIG_SYS_NO_FLASH > > +#define CONFIG_ZYNQ_USB > + > #include > > #endif /* __CONFIG_ZYNQ_MICROZED_H */ > -- > 1.9.1 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 09/16] ARM: zynq: Align spi and qspi node locations
On Fri, Apr 8, 2016 at 3:01 AM, Michal Simek wrote: > Keep nodes alphabelitally sorted. > > Signed-off-by: Michal Simek Reviewed-by: Nathan Rossi > --- > > arch/arm/dts/zynq-zc702.dts | 10 +- > arch/arm/dts/zynq-zc706.dts | 10 +- > arch/arm/dts/zynq-zc770-xm010.dts | 42 > +++ > arch/arm/dts/zynq-zed.dts | 6 +++--- > arch/arm/dts/zynq-zybo.dts| 6 +++--- > 5 files changed, 37 insertions(+), 37 deletions(-) > > diff --git a/arch/arm/dts/zynq-zc702.dts b/arch/arm/dts/zynq-zc702.dts > index 8ad1db281de8..6585010f4bc8 100644 > --- a/arch/arm/dts/zynq-zc702.dts > +++ b/arch/arm/dts/zynq-zc702.dts > @@ -387,6 +387,11 @@ > }; > }; > > +&qspi { > + u-boot,dm-pre-reloc; > + status = "okay"; > +}; > + > &sdhci0 { > u-boot,dm-pre-reloc; > status = "okay"; > @@ -401,11 +406,6 @@ > pinctrl-0 = <&pinctrl_uart1_default>; > }; > > -&qspi { > - u-boot,dm-pre-reloc; > - status = "okay"; > -}; > - > &usb0 { > status = "okay"; > dr_mode = "host"; > diff --git a/arch/arm/dts/zynq-zc706.dts b/arch/arm/dts/zynq-zc706.dts > index cefee253fb06..d04880a2cdd3 100644 > --- a/arch/arm/dts/zynq-zc706.dts > +++ b/arch/arm/dts/zynq-zc706.dts > @@ -306,6 +306,11 @@ > }; > }; > > +&qspi { > + u-boot,dm-pre-reloc; > + status = "okay"; > +}; > + > &sdhci0 { > u-boot,dm-pre-reloc; > status = "okay"; > @@ -320,11 +325,6 @@ > pinctrl-0 = <&pinctrl_uart1_default>; > }; > > -&qspi { > - u-boot,dm-pre-reloc; > - status = "okay"; > -}; > - > &usb0 { > status = "okay"; > dr_mode = "host"; > diff --git a/arch/arm/dts/zynq-zc770-xm010.dts > b/arch/arm/dts/zynq-zc770-xm010.dts > index 6dc7c89ddb2b..33524cb6def5 100644 > --- a/arch/arm/dts/zynq-zc770-xm010.dts > +++ b/arch/arm/dts/zynq-zc770-xm010.dts > @@ -36,27 +36,6 @@ > }; > }; > > -&spi1 { > - status = "okay"; > - num-cs = <4>; > - is-decoded-cs = <0>; > - flash@0 { > - compatible = "sst25wf080"; > - reg = <1>; > - spi-max-frequency = <100>; > - #address-cells = <1>; > - #size-cells = <1>; > - partition@test { > - label = "spi-flash"; > - reg = <0x0 0x10>; > - }; > - }; > -}; > - > -&qspi { > - status = "okay"; > -}; > - > &can0 { > status = "okay"; > }; > @@ -82,10 +61,31 @@ > > }; > > +&qspi { > + status = "okay"; > +}; > + > &sdhci0 { > status = "okay"; > }; > > +&spi1 { > + status = "okay"; > + num-cs = <4>; > + is-decoded-cs = <0>; > + flash@0 { > + compatible = "sst25wf080"; > + reg = <1>; > + spi-max-frequency = <100>; > + #address-cells = <1>; > + #size-cells = <1>; > + partition@test { > + label = "spi-flash"; > + reg = <0x0 0x10>; > + }; > + }; > +}; > + > &uart1 { > u-boot,dm-pre-reloc; > status = "okay"; > diff --git a/arch/arm/dts/zynq-zed.dts b/arch/arm/dts/zynq-zed.dts > index b262d83ee672..4363a4fcaccb 100644 > --- a/arch/arm/dts/zynq-zed.dts > +++ b/arch/arm/dts/zynq-zed.dts > @@ -50,17 +50,17 @@ > }; > }; > > -&sdhci0 { > +&qspi { > u-boot,dm-pre-reloc; > status = "okay"; > }; > > -&uart1 { > +&sdhci0 { > u-boot,dm-pre-reloc; > status = "okay"; > }; > > -&qspi { > +&uart1 { > u-boot,dm-pre-reloc; > status = "okay"; > }; > diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts > index acc6e42b46fc..f32923f5d25d 100644 > --- a/arch/arm/dts/zynq-zybo.dts > +++ b/arch/arm/dts/zynq-zybo.dts > @@ -51,17 +51,17 @@ > }; > }; > > -&sdhci0 { > +&qspi { > u-boot,dm-pre-reloc; > status = "okay"; > }; > > -&uart1 { > +&sdhci0 { > u-boot,dm-pre-reloc; > status = "okay"; > }; > > -&qspi { > +&uart1 { > u-boot,dm-pre-reloc; > status = "okay"; > }; > -- > 1.9.1 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 08/16] ARM: zynq: zc706: Add adv7511 on i2c bus
On Fri, Apr 8, 2016 at 3:01 AM, Michal Simek wrote: > From: Christian Kohn > > Add missing adv7511 and configure to match Base TRD. > > Signed-off-by: Christian Kohn > Signed-off-by: Michal Simek Reviewed-by: Nathan Rossi > --- > > arch/arm/dts/zynq-zc706.dts | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/arch/arm/dts/zynq-zc706.dts b/arch/arm/dts/zynq-zc706.dts > index bf996ad4d8af..cefee253fb06 100644 > --- a/arch/arm/dts/zynq-zc706.dts > +++ b/arch/arm/dts/zynq-zc706.dts > @@ -84,6 +84,21 @@ > }; > }; > > + i2c@1 { > + #address-cells = <1>; > + #size-cells = <0>; > + reg = <1>; > + adv7511: hdmi-tx@39 { > + compatible = "adi,adv7511"; > + reg = <0x39>; > + adi,input-depth = <8>; > + adi,input-colorspace = "yuv422"; > + adi,input-clock = "1x"; > + adi,input-style = <3>; > + adi,input-justification = "evenly"; > + }; > + }; > + > i2c@2 { > #address-cells = <1>; > #size-cells = <0>; > -- > 1.9.1 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: zynq: Enable u-boot,dm-pre-reloc for qspi
Enable u-boot,dm-pre-reloc for qspi for zc706, zed and microzed. Signed-off-by: Nathan Rossi Cc: Albert Aribaud Cc: Michal Simek Cc: Simon Glass --- arch/arm/dts/zynq-microzed.dts | 1 + arch/arm/dts/zynq-zc706.dts| 1 + arch/arm/dts/zynq-zed.dts | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/arm/dts/zynq-microzed.dts b/arch/arm/dts/zynq-microzed.dts index e841a1d..793ab44 100644 --- a/arch/arm/dts/zynq-microzed.dts +++ b/arch/arm/dts/zynq-microzed.dts @@ -24,6 +24,7 @@ }; &qspi { + u-boot,dm-pre-reloc; status = "okay"; }; diff --git a/arch/arm/dts/zynq-zc706.dts b/arch/arm/dts/zynq-zc706.dts index 1ba3a1c..1610520 100644 --- a/arch/arm/dts/zynq-zc706.dts +++ b/arch/arm/dts/zynq-zc706.dts @@ -306,6 +306,7 @@ }; &qspi { + u-boot,dm-pre-reloc; status = "okay"; }; diff --git a/arch/arm/dts/zynq-zed.dts b/arch/arm/dts/zynq-zed.dts index 5ec59e2..ec9b2f7 100644 --- a/arch/arm/dts/zynq-zed.dts +++ b/arch/arm/dts/zynq-zed.dts @@ -61,6 +61,7 @@ }; &qspi { + u-boot,dm-pre-reloc; status = "okay"; }; -- 2.7.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 4/4] arm: socfpga: Enable SPL_DM_SEQ_ALIAS for all SOCFPGA configs
This feature is required in SPL to enable support for loading from SPI flash. Also clean up the #define in socfpga_common.h. Signed-off-by: Nathan Rossi Reviewed-by: Stefan Roese Cc: Dinh Nguyen Cc: Chin-Liang See Cc: Marek Vasut Cc: Stefan Roese --- v2: Added this patch v3: Dropped config enablement for de0nano and mcvevk boards --- configs/socfpga_arria5_defconfig | 1 + configs/socfpga_cyclone5_defconfig | 1 + configs/socfpga_sockit_defconfig | 1 + configs/socfpga_socrates_defconfig | 1 + configs/socfpga_sr1500_defconfig | 1 + include/configs/socfpga_common.h | 1 - 6 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig index 68d12df..6e8976f 100644 --- a/configs/socfpga_arria5_defconfig +++ b/configs/socfpga_arria5_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_ARRIA5_SOCDK=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria5_socdk" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index accee92..e31aa71 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_CYCLONE5_SOCDK=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socdk" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig index b4f41a9..59fbb2c 100644 --- a/configs/socfpga_sockit_defconfig +++ b/configs/socfpga_sockit_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_TERASIC_SOCKIT=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sockit" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig index fe940f9..aaba8cb 100644 --- a/configs/socfpga_socrates_defconfig +++ b/configs/socfpga_socrates_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_EBV_SOCRATES=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_sr1500_defconfig b/configs/socfpga_sr1500_defconfig index 3d98a63..a4f0835 100644 --- a/configs/socfpga_sr1500_defconfig +++ b/configs/socfpga_sr1500_defconfig @@ -6,6 +6,7 @@ CONFIG_DM_GPIO=y CONFIG_TARGET_SOCFPGA_SR1500=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sr1500" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_ADDR=0x0080 # CONFIG_CMD_IMLS is not set diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index a09e906..8de0ab9 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -370,7 +370,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); /* SPL QSPI boot support */ #ifdef CONFIG_SPL_SPI_SUPPORT -#define CONFIG_DM_SEQ_ALIAS1 #define CONFIG_SPL_SPI_FLASH_SUPPORT #define CONFIG_SPL_SPI_LOAD #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x4 -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 3/4] arm: mvebu: Select SPL_DM_SEQ_ALIAS
Select SPL_DM_SEQ_ALIAS which is required for certain uclasses, specifically SPI Flash. Signed-off-by: Nathan Rossi Reviewed-by: Stefan Roese Cc: Albert Aribaud Cc: Stefan Roese --- v2: Added this patch v3: no changes. --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9bd6cf1..52b300d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -118,6 +118,7 @@ config ARCH_MVEBU select OF_SEPARATE select DM select DM_SERIAL + select SPL_DM_SEQ_ALIAS config TARGET_DEVKIT3250 bool "Support devkit3250" -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 0/4] Change DM_SEQ_ALIAS to be configurable for SPL
Add a config option for SPL_DM_SEQ_ALIAS and enable it for the Zynq targets which require it for SPI flash support in SPL. Changes in v2: * Add patches to enable the config for mvebu and socfpga targets. Changes in v3: * Removed de0nano and mcvevk boards from socfpga config patch Nathan Rossi (4): spl: dm: Add SPL_DM_SEQ_ALIAS config option arm: zynq: Enable SPL_DM_SEQ_ALIAS for all Zynq configs arm: mvebu: Select SPL_DM_SEQ_ALIAS arm: socfpga: Enable SPL_DM_SEQ_ALIAS for all SOCFPGA configs arch/arm/Kconfig | 1 + configs/socfpga_arria5_defconfig | 1 + configs/socfpga_cyclone5_defconfig | 1 + configs/socfpga_sockit_defconfig | 1 + configs/socfpga_socrates_defconfig | 1 + configs/socfpga_sr1500_defconfig | 1 + configs/zynq_microzed_defconfig| 1 + configs/zynq_picozed_defconfig | 1 + configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zc770_xm010_defconfig | 1 + configs/zynq_zc770_xm011_defconfig | 1 + configs/zynq_zc770_xm012_defconfig | 1 + configs/zynq_zc770_xm013_defconfig | 1 + configs/zynq_zed_defconfig | 1 + configs/zynq_zybo_defconfig| 1 + drivers/core/Kconfig | 9 + drivers/core/device.c | 2 +- include/config_uncmd_spl.h | 1 - include/configs/socfpga_common.h | 1 - 20 files changed, 26 insertions(+), 3 deletions(-) -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/4] spl: dm: Add SPL_DM_SEQ_ALIAS config option
The Device Model sequence alias feature is required by some Uclasses. Instead of disabling the feature for all SPL targets allow it to be configured. The config option is disabled by default to reduce code size for targets that are not interested or do not require this feature. Signed-off-by: Nathan Rossi Acked-by: Simon Glass Acked-by: Michal Simek Cc: Simon Glass Cc: Masahiro Yamada Cc: Linus Walleij Cc: Marek Vasut Cc: Michal Simek Cc: Stefan Roese --- v2: no changes. v3: no changes. --- drivers/core/Kconfig | 9 + drivers/core/device.c | 2 +- include/config_uncmd_spl.h | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index f332480..c5c9d2a 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -60,6 +60,15 @@ config DM_SEQ_ALIAS help Most boards will have a '/aliases' node containing the path to numbered devices (e.g. serial0 = &serial0). This feature can be + disabled if it is not required. + +config SPL_DM_SEQ_ALIAS + bool "Support numbered aliases in device tree in SPL" + depends on DM + default n + help + Most boards will have a '/aliases' node containing the path to + numbered devices (e.g. serial0 = &serial0). This feature can be disabled if it is not required, to save code space in SPL. config REGMAP diff --git a/drivers/core/device.c b/drivers/core/device.c index 758f390..b237b88 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -64,7 +64,7 @@ int device_bind(struct udevice *parent, const struct driver *drv, dev->seq = -1; dev->req_seq = -1; - if (CONFIG_IS_ENABLED(OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) { + if (CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_SEQ_ALIAS)) { /* * Some devices, such as a SPI bus, I2C bus and serial ports * are numbered using aliases. diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index 6e299f6..3b198ae 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -29,7 +29,6 @@ #endif #undef CONFIG_DM_WARN -#undef CONFIG_DM_SEQ_ALIAS #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */ -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 4/4] arm: socfpga: Enable SPL_DM_SEQ_ALIAS for all SOCFPGA configs
This feature is required in SPL to enable support for loading from SPI flash. Also clean up the #define in socfpga_common.h. Signed-off-by: Nathan Rossi Cc: Dinh Nguyen Cc: Chin-Liang See Cc: Marek Vasut Cc: Stefan Roese --- v2: Added this patch --- configs/socfpga_arria5_defconfig | 1 + configs/socfpga_cyclone5_defconfig | 1 + configs/socfpga_de0_nano_soc_defconfig | 1 + configs/socfpga_mcvevk_defconfig | 1 + configs/socfpga_sockit_defconfig | 1 + configs/socfpga_socrates_defconfig | 1 + configs/socfpga_sr1500_defconfig | 1 + include/configs/socfpga_common.h | 1 - 8 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig index 68d12df..6e8976f 100644 --- a/configs/socfpga_arria5_defconfig +++ b/configs/socfpga_arria5_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_ARRIA5_SOCDK=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria5_socdk" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index accee92..e31aa71 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_CYCLONE5_SOCDK=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socdk" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig index 65c1197..3a29238 100644 --- a/configs/socfpga_de0_nano_soc_defconfig +++ b/configs/socfpga_de0_nano_soc_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_TERASIC_DE0_NANO=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de0_nano_soc" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig index c98d4a1..61cee08 100644 --- a/configs/socfpga_mcvevk_defconfig +++ b/configs/socfpga_mcvevk_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_DENX_MCVEVK=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_mcvevk" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig index b4f41a9..59fbb2c 100644 --- a/configs/socfpga_sockit_defconfig +++ b/configs/socfpga_sockit_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_TERASIC_SOCKIT=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sockit" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig index fe940f9..aaba8cb 100644 --- a/configs/socfpga_socrates_defconfig +++ b/configs/socfpga_socrates_defconfig @@ -7,6 +7,7 @@ CONFIG_TARGET_SOCFPGA_EBV_SOCRATES=y CONFIG_SPL_STACK_R_ADDR=0x0080 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/socfpga_sr1500_defconfig b/configs/socfpga_sr1500_defconfig index 3d98a63..a4f0835 100644 --- a/configs/socfpga_sr1500_defconfig +++ b/configs/socfpga_sr1500_defconfig @@ -6,6 +6,7 @@ CONFIG_DM_GPIO=y CONFIG_TARGET_SOCFPGA_SR1500=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sr1500" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_ADDR=0x0080 # CONFIG_CMD_IMLS is not set diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index a09e906..8de0ab9 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -370,7 +370,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); /* SPL QSPI boot support */ #ifdef CONFIG_SPL_SPI_SUPPORT -#define CONFIG_DM_SEQ_ALIAS1 #define CONFIG_SPL_SPI_FLASH_SUPPORT #define CONFIG_SPL_SPI_LOAD #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x4 -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 3/4] arm: mvebu: Select SPL_DM_SEQ_ALIAS
Select SPL_DM_SEQ_ALIAS which is required for certain uclasses, specifically SPI Flash. Signed-off-by: Nathan Rossi Cc: Albert Aribaud Cc: Stefan Roese --- v2: Added this patch --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9bd6cf1..52b300d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -118,6 +118,7 @@ config ARCH_MVEBU select OF_SEPARATE select DM select DM_SERIAL + select SPL_DM_SEQ_ALIAS config TARGET_DEVKIT3250 bool "Support devkit3250" -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/4] arm: zynq: Enable SPL_DM_SEQ_ALIAS for all Zynq configs
This feature is required in SPL to enable support for loading from SPI flash when the device is booted from QSPI. Signed-off-by: Nathan Rossi Cc: Michal Simek --- v2: no changes. --- configs/zynq_microzed_defconfig| 1 + configs/zynq_picozed_defconfig | 1 + configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zc770_xm010_defconfig | 1 + configs/zynq_zc770_xm011_defconfig | 1 + configs/zynq_zc770_xm012_defconfig | 1 + configs/zynq_zc770_xm013_defconfig | 1 + configs/zynq_zed_defconfig | 1 + configs/zynq_zybo_defconfig| 1 + 10 files changed, 10 insertions(+) diff --git a/configs/zynq_microzed_defconfig b/configs/zynq_microzed_defconfig index e577c93..5420f83 100644 --- a/configs/zynq_microzed_defconfig +++ b/configs/zynq_microzed_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_MICROZED=y CONFIG_DEFAULT_DEVICE_TREE="zynq-microzed" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_picozed_defconfig b/configs/zynq_picozed_defconfig index 7d52d8e..152d26b 100644 --- a/configs/zynq_picozed_defconfig +++ b/configs/zynq_picozed_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_PICOZED=y CONFIG_DEFAULT_DEVICE_TREE="zynq-picozed" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig index 9d1b40d..9328196 100644 --- a/configs/zynq_zc702_defconfig +++ b/configs/zynq_zc702_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_ZYNQ=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig index bba91df..724c386 100644 --- a/configs/zynq_zc706_defconfig +++ b/configs/zynq_zc706_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC706=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm010_defconfig b/configs/zynq_zc770_xm010_defconfig index 96f0a79..62c1cb1 100644 --- a/configs/zynq_zc770_xm010_defconfig +++ b/configs/zynq_zc770_xm010_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm010" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm011_defconfig b/configs/zynq_zc770_xm011_defconfig index b0c535e..db43987 100644 --- a/configs/zynq_zc770_xm011_defconfig +++ b/configs/zynq_zc770_xm011_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm011" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm012_defconfig b/configs/zynq_zc770_xm012_defconfig index 7fb03eb..24a50a3 100644 --- a/configs/zynq_zc770_xm012_defconfig +++ b/configs/zynq_zc770_xm012_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm012" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm013_defconfig b/configs/zynq_zc770_xm013_defconfig index 6766512..ab692af 100644 --- a/configs/zynq_zc770_xm013_defconfig +++ b/configs/zynq_zc770_xm013_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm013" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zed_defconfig b/configs/zynq_zed_defconfig index 058bb05..5ee8c07 100644 --- a/configs/zynq_zed_defconfig +++ b/configs/zynq_zed_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZED=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zed" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig index 231483e..2f11494 100644 --- a/configs/zynq_zybo_defconfig +++ b/configs/zynq_zybo_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZYBO=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] spl: dm: Add SPL_DM_SEQ_ALIAS config option
The Device Model sequence alias feature is required by some Uclasses. Instead of disabling the feature for all SPL targets allow it to be configured. The config option is disabled by default to reduce code size for targets that are not interested or do not require this feature. Signed-off-by: Nathan Rossi Acked-by: Simon Glass Acked-by: Michal Simek Cc: Simon Glass Cc: Masahiro Yamada Cc: Linus Walleij Cc: Marek Vasut Cc: Michal Simek Cc: Stefan Roese --- v2: no changes. --- drivers/core/Kconfig | 9 + drivers/core/device.c | 2 +- include/config_uncmd_spl.h | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index f332480..c5c9d2a 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -60,6 +60,15 @@ config DM_SEQ_ALIAS help Most boards will have a '/aliases' node containing the path to numbered devices (e.g. serial0 = &serial0). This feature can be + disabled if it is not required. + +config SPL_DM_SEQ_ALIAS + bool "Support numbered aliases in device tree in SPL" + depends on DM + default n + help + Most boards will have a '/aliases' node containing the path to + numbered devices (e.g. serial0 = &serial0). This feature can be disabled if it is not required, to save code space in SPL. config REGMAP diff --git a/drivers/core/device.c b/drivers/core/device.c index 758f390..b237b88 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -64,7 +64,7 @@ int device_bind(struct udevice *parent, const struct driver *drv, dev->seq = -1; dev->req_seq = -1; - if (CONFIG_IS_ENABLED(OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) { + if (CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_SEQ_ALIAS)) { /* * Some devices, such as a SPI bus, I2C bus and serial ports * are numbered using aliases. diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index 6e299f6..3b198ae 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -29,7 +29,6 @@ #endif #undef CONFIG_DM_WARN -#undef CONFIG_DM_SEQ_ALIAS #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */ -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/4] Change DM_SEQ_ALIAS to be configurable for SPL
Add a config option for SPL_DM_SEQ_ALIAS and enable it for the Zynq targets which require it for SPI flash support in SPL. Changes in v2: * Add patches to enable the config for mvebu and socfpga targets. Nathan Rossi (4): spl: dm: Add SPL_DM_SEQ_ALIAS config option arm: zynq: Enable SPL_DM_SEQ_ALIAS for all Zynq configs arm: mvebu: Select SPL_DM_SEQ_ALIAS arm: socfpga: Enable SPL_DM_SEQ_ALIAS for all SOCFPGA configs arch/arm/Kconfig | 1 + configs/socfpga_arria5_defconfig | 1 + configs/socfpga_cyclone5_defconfig | 1 + configs/socfpga_de0_nano_soc_defconfig | 1 + configs/socfpga_mcvevk_defconfig | 1 + configs/socfpga_sockit_defconfig | 1 + configs/socfpga_socrates_defconfig | 1 + configs/socfpga_sr1500_defconfig | 1 + configs/zynq_microzed_defconfig| 1 + configs/zynq_picozed_defconfig | 1 + configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zc770_xm010_defconfig | 1 + configs/zynq_zc770_xm011_defconfig | 1 + configs/zynq_zc770_xm012_defconfig | 1 + configs/zynq_zc770_xm013_defconfig | 1 + configs/zynq_zed_defconfig | 1 + configs/zynq_zybo_defconfig| 1 + drivers/core/Kconfig | 9 + drivers/core/device.c | 2 +- include/config_uncmd_spl.h | 1 - include/configs/socfpga_common.h | 1 - 22 files changed, 28 insertions(+), 3 deletions(-) -- 2.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] spl: dm: Add SPL_DM_SEQ_ALIAS config option
On Mon, Dec 14, 2015 at 5:29 PM, Michal Simek wrote: > On 14.12.2015 07:26, Stefan Roese wrote: >> On 12.12.2015 15:08, Nathan Rossi wrote: >>> On Sat, Dec 12, 2015 at 10:05 PM, Stefan Roese wrote: >>>> On 11.12.2015 18:32, Marek Vasut wrote: >>>>> >>>>> On Friday, December 11, 2015 at 04:46:40 PM, Michal Simek wrote: >>>>>> >>>>>> On 11.12.2015 16:07, Marek Vasut wrote: >>>>>>> >>>>>>> On Friday, December 11, 2015 at 03:48:09 PM, Nathan Rossi wrote: >>>>>>>> >>>>>>>> The Device Model sequence alias feature is required by some >>>>>>>> Uclasses. >>>>>>>> Instead of disabling the feature for all SPL targets allow it to be >>>>>>>> configured. >>>>>>>> >>>>>>>> The config option is disabled by default to reduce code size for >>>>>>>> targets >>>>>>>> that are not interested or do not require this feature. >>>>>>>> >>>>>>>> Signed-off-by: Nathan Rossi >>>>>>>> Cc: Simon Glass >>>>>>>> Cc: Masahiro Yamada >>>>>>>> Cc: Linus Walleij >>>>>>>> Cc: Marek Vasut >>>>>>>> Cc: Michal Simek >>>>>>>> --- >>>>>>>> Based on a small amount of inspection for the Zynq platform, >>>>>>>> enabling >>>>>>>> this config option adds ~1KB of code size. >>>>>>>> >>>>>>>> Also on a side note, this might affect the socfpga target as it >>>>>>>> forcibly >>>>>>>> overrides the #undef from config_uncmd_spl.h in its common header. I >>>>>>>> have Cc'd the respective maintainer for this reason. >>>>>>> >>>>>>> >>>>>>> The fix for SoCFPGA is easy -- enable the SPL_DM_SEQ_ALIAS in >>>>>>> configs/socfpga*. It is needed for booting from QSPI NOR. >>> >>> I will add a patch to this series, depending on how it is agreed to >>> enable this option. >>> >>>>>> >>>>>> >>>>>> That's probably not the best solution. But of course we can use it. >>>>>> IRC Stefan had the same problem. >>> >>> So would a better solution be to force the ARCH_ZYNQ config (and >>> others ARCH_SOCFPGA/ARCH_MVEBU) to 'select SPL_DM_SEQ_ALIAS' instead >>> of enabling them separately for each defconfig? like is done for >>> SPL_OF_CONTROL/etc. >> >> Yes, please. Autoselecting this option is definitely better. > > TBH I don't think this is the best solution. We should select things > which are required all the time. For zynq case this selection is > necessary just for qspi boot mode. There are other boot modes which > doesn't require it that's why for these mods this is just additional code. > If you think that this is need/good to select by default for your SoC > then this can be done separately. Sorry for the slow response/follow up on this. So as I understand it makes sense for this to be configured slightly differently depending on when the boot options that need this are available. I guess this also makes sense as SPI is not the only user of the seq alias feature. I am sorting out v2 of this series for the additional patches to add the config for socfpga and mvebu, just want to clarify that this would be the preferred way (given recent comments) to enable it for the corresponding platforms: * socfpga -> enable in each defconfig * mvebu -> enable in arch/arm/Kconfig for ARCH_MVEBU (aka auto selecting) > > Note: Agree with Marek that will be good to check where exactly the > problem is that this config option is necessary to enable even for case > where only on qspi is in the system. I had a bit of a look into this, it would require changes to allow for it to fall-back to finding and using the first device which is matched for the uclass (instead of relying on just CONFIG_SF_DEFAULT_BUS), it would probably be an intrusive change to sf-uclass. A simpler solution might be to just default seq numbers to 0 when seq alias is not enabled? would allow for the change to work with other uclasses that use seq alias. Regards, Nathan > > Acked-by: Michal Simek > > Thanks, > Michal ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] spl: dm: Add SPL_DM_SEQ_ALIAS config option
On Sat, Dec 12, 2015 at 10:05 PM, Stefan Roese wrote: > On 11.12.2015 18:32, Marek Vasut wrote: >> >> On Friday, December 11, 2015 at 04:46:40 PM, Michal Simek wrote: >>> >>> On 11.12.2015 16:07, Marek Vasut wrote: >>>> >>>> On Friday, December 11, 2015 at 03:48:09 PM, Nathan Rossi wrote: >>>>> >>>>> The Device Model sequence alias feature is required by some Uclasses. >>>>> Instead of disabling the feature for all SPL targets allow it to be >>>>> configured. >>>>> >>>>> The config option is disabled by default to reduce code size for >>>>> targets >>>>> that are not interested or do not require this feature. >>>>> >>>>> Signed-off-by: Nathan Rossi >>>>> Cc: Simon Glass >>>>> Cc: Masahiro Yamada >>>>> Cc: Linus Walleij >>>>> Cc: Marek Vasut >>>>> Cc: Michal Simek >>>>> --- >>>>> Based on a small amount of inspection for the Zynq platform, enabling >>>>> this config option adds ~1KB of code size. >>>>> >>>>> Also on a side note, this might affect the socfpga target as it >>>>> forcibly >>>>> overrides the #undef from config_uncmd_spl.h in its common header. I >>>>> have Cc'd the respective maintainer for this reason. >>>> >>>> >>>> The fix for SoCFPGA is easy -- enable the SPL_DM_SEQ_ALIAS in >>>> configs/socfpga*. It is needed for booting from QSPI NOR. I will add a patch to this series, depending on how it is agreed to enable this option. >>> >>> >>> That's probably not the best solution. But of course we can use it. >>> IRC Stefan had the same problem. So would a better solution be to force the ARCH_ZYNQ config (and others ARCH_SOCFPGA/ARCH_MVEBU) to 'select SPL_DM_SEQ_ALIAS' instead of enabling them separately for each defconfig? like is done for SPL_OF_CONTROL/etc. >> >> >> So what is the solution ? > > > I added > > #define CONFIG_DM_SEQ_ALIAS1 > > to the common config header for MVEBU. If its possible to set this > via Kconfig in a way where its not #undef'ed by config_uncmd_spl.h, > that would be even better. As with socfpga, would you like me to do the same for MVEBU, add a patch to this series to enable it for MVEBU? Regards, Nathan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] arm: zynq: Enable SPL_DM_SEQ_ALIAS for all Zynq configs
This feature is required in SPL to enable support for loading from SPI flash when the device is booted from QSPI. Signed-off-by: Nathan Rossi Cc: Michal Simek --- configs/zynq_microzed_defconfig| 1 + configs/zynq_picozed_defconfig | 1 + configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zc770_xm010_defconfig | 1 + configs/zynq_zc770_xm011_defconfig | 1 + configs/zynq_zc770_xm012_defconfig | 1 + configs/zynq_zc770_xm013_defconfig | 1 + configs/zynq_zed_defconfig | 1 + configs/zynq_zybo_defconfig| 1 + 10 files changed, 10 insertions(+) diff --git a/configs/zynq_microzed_defconfig b/configs/zynq_microzed_defconfig index c68efc8..35d2285 100644 --- a/configs/zynq_microzed_defconfig +++ b/configs/zynq_microzed_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_MICROZED=y CONFIG_DEFAULT_DEVICE_TREE="zynq-microzed" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_picozed_defconfig b/configs/zynq_picozed_defconfig index 62eb79f..dfe70e6 100644 --- a/configs/zynq_picozed_defconfig +++ b/configs/zynq_picozed_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_PICOZED=y CONFIG_DEFAULT_DEVICE_TREE="zynq-picozed" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig index 5261b73..95d9774 100644 --- a/configs/zynq_zc702_defconfig +++ b/configs/zynq_zc702_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_ZYNQ=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig index 2e525b4..59166e0 100644 --- a/configs/zynq_zc706_defconfig +++ b/configs/zynq_zc706_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC706=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm010_defconfig b/configs/zynq_zc770_xm010_defconfig index 6f2ad17..6bb79f7 100644 --- a/configs/zynq_zc770_xm010_defconfig +++ b/configs/zynq_zc770_xm010_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm010" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm011_defconfig b/configs/zynq_zc770_xm011_defconfig index d20b3ed..241f1bf 100644 --- a/configs/zynq_zc770_xm011_defconfig +++ b/configs/zynq_zc770_xm011_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm011" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm012_defconfig b/configs/zynq_zc770_xm012_defconfig index 4e963a4..e9a337c 100644 --- a/configs/zynq_zc770_xm012_defconfig +++ b/configs/zynq_zc770_xm012_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm012" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zc770_xm013_defconfig b/configs/zynq_zc770_xm013_defconfig index f2d8f14..e410f6d 100644 --- a/configs/zynq_zc770_xm013_defconfig +++ b/configs/zynq_zc770_xm013_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZC770=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm013" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zed_defconfig b/configs/zynq_zed_defconfig index 2e7c68d..bc1051a 100644 --- a/configs/zynq_zed_defconfig +++ b/configs/zynq_zed_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZED=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zed" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig index d443e92..704f703 100644 --- a/configs/zynq_zybo_defconfig +++ b/configs/zynq_zybo_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ZYNQ=y CONFIG_TARGET_ZYNQ_ZYBO=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo" CONFIG_SPL=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_FIT_SIGNATURE=y -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] spl: dm: Add SPL_DM_SEQ_ALIAS config option
The Device Model sequence alias feature is required by some Uclasses. Instead of disabling the feature for all SPL targets allow it to be configured. The config option is disabled by default to reduce code size for targets that are not interested or do not require this feature. Signed-off-by: Nathan Rossi Cc: Simon Glass Cc: Masahiro Yamada Cc: Linus Walleij Cc: Marek Vasut Cc: Michal Simek --- Based on a small amount of inspection for the Zynq platform, enabling this config option adds ~1KB of code size. Also on a side note, this might affect the socfpga target as it forcibly overrides the #undef from config_uncmd_spl.h in its common header. I have Cc'd the respective maintainer for this reason. --- drivers/core/Kconfig | 9 + drivers/core/device.c | 2 +- include/config_uncmd_spl.h | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 53acee0..97aa01e 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -60,6 +60,15 @@ config DM_SEQ_ALIAS help Most boards will have a '/aliases' node containing the path to numbered devices (e.g. serial0 = &serial0). This feature can be + disabled if it is not required. + +config SPL_DM_SEQ_ALIAS + bool "Support numbered aliases in device tree in SPL" + depends on DM + default n + help + Most boards will have a '/aliases' node containing the path to + numbered devices (e.g. serial0 = &serial0). This feature can be disabled if it is not required, to save code space in SPL. config REGMAP diff --git a/drivers/core/device.c b/drivers/core/device.c index 758f390..b237b88 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -64,7 +64,7 @@ int device_bind(struct udevice *parent, const struct driver *drv, dev->seq = -1; dev->req_seq = -1; - if (CONFIG_IS_ENABLED(OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) { + if (CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_SEQ_ALIAS)) { /* * Some devices, such as a SPI bus, I2C bus and serial ports * are numbered using aliases. diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index 6e299f6..3b198ae 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -29,7 +29,6 @@ #endif #undef CONFIG_DM_WARN -#undef CONFIG_DM_SEQ_ALIAS #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */ -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/2] Change DM_SEQ_ALIAS to be configurable for SPL
Add a config option for SPL_DM_SEQ_ALIAS and enable it for the Zynq targets which require it for SPI flash support in SPL. Nathan Rossi (2): spl: dm: Add SPL_DM_SEQ_ALIAS config option arm: zynq: Enable SPL_DM_SEQ_ALIAS for all Zynq configs configs/zynq_microzed_defconfig| 1 + configs/zynq_picozed_defconfig | 1 + configs/zynq_zc702_defconfig | 1 + configs/zynq_zc706_defconfig | 1 + configs/zynq_zc770_xm010_defconfig | 1 + configs/zynq_zc770_xm011_defconfig | 1 + configs/zynq_zc770_xm012_defconfig | 1 + configs/zynq_zc770_xm013_defconfig | 1 + configs/zynq_zed_defconfig | 1 + configs/zynq_zybo_defconfig| 1 + drivers/core/Kconfig | 9 + drivers/core/device.c | 2 +- include/config_uncmd_spl.h | 1 - 13 files changed, 20 insertions(+), 2 deletions(-) -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] tools: zynqimage: Clean up check_params
Clean up the param checking, removing some code paths that will never happen. Signed-off-by: Nathan Rossi Cc: Michal Simek Cc: Tom Rini --- tools/zynqimage.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/zynqimage.c b/tools/zynqimage.c index 25f558d..c43bd5d 100644 --- a/tools/zynqimage.c +++ b/tools/zynqimage.c @@ -212,8 +212,7 @@ static int zynqimage_check_params(struct image_tool_params *params) return -1; } - return !((params->lflag || params->dflag) || - (params->dflag && params->eflag)); + return !(params->lflag || params->dflag); } static int zynqimage_check_image_types(uint8_t type) -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] spl: dm: Enable DM_SEQ_ALIAS
The Device Model sequence alias feature is required by some Uclasses. Specifically SPI which picks the bus to use based on the sequence. Without this the SPI Uclass will not probe any bus and will fail which prevents SPL from using SPI flash as a boot location. Signed-off-by: Nathan Rossi Cc: Simon Glass Cc: Masahiro Yamada Cc: Linus Walleij --- include/config_uncmd_spl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index 6e299f6..3b198ae 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -29,7 +29,6 @@ #endif #undef CONFIG_DM_WARN -#undef CONFIG_DM_SEQ_ALIAS #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */ -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm: zynq: Update ZYBO config options
Update the ZYBO device tree and enable config options that relate to the added devices in the device tree. Signed-off-by: Nathan Rossi Cc: Albert Aribaud Cc: Michal Simek Cc: Simon Glass --- arch/arm/dts/zynq-zybo.dts | 18 ++ configs/zynq_zybo_defconfig | 3 +++ include/configs/zynq_zybo.h | 1 + 3 files changed, 22 insertions(+) diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts index dcfc00e..fbbb891 100644 --- a/arch/arm/dts/zynq-zybo.dts +++ b/arch/arm/dts/zynq-zybo.dts @@ -16,6 +16,8 @@ aliases { ethernet0 = &gem0; serial0 = &uart1; + spi0 = &qspi; + mmc0 = &sdhci0; }; memory { @@ -28,6 +30,10 @@ stdout-path = "serial0:115200n8"; }; + usb_phy0: phy0 { + compatible = "usb-nop-xceiv"; + #phy-cells = <0>; + }; }; &clkc { @@ -45,6 +51,7 @@ }; &sdhci0 { + u-boot,dm-pre-reloc; status = "okay"; }; @@ -52,3 +59,14 @@ u-boot,dm-pre-reloc; status = "okay"; }; + +&qspi { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; + usb-phy = <&usb_phy0>; +}; diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig index 6f0bd0b..d443e92 100644 --- a/configs/zynq_zybo_defconfig +++ b/configs/zynq_zybo_defconfig @@ -17,3 +17,6 @@ CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_ZYNQ=y CONFIG_DEBUG_UART_BASE=0xe0001000 CONFIG_DEBUG_UART_CLOCK=5000 +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_ZYNQ_QSPI=y diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h index 5d1a9d5..c53ba79 100644 --- a/include/configs/zynq_zybo.h +++ b/include/configs/zynq_zybo.h @@ -15,6 +15,7 @@ #define CONFIG_SYS_NO_FLASH +#define CONFIG_ZYNQ_USB #define CONFIG_ZYNQ_SDHCI0 #define CONFIG_ZYNQ_BOOT_FREEBSD -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] spi: zynq_qspi: Add configuration to disable LQSPI feature
When the Zynq Boot ROM code loads the payload from QSPI it uses the LQSPI feature of the QSPI device, however it does not clean up its configuration before handing over to the payload which leaves the device confgured to by-pass the standard non-linear operating mode. This ensures the Linear QSPI mode is disabled before re-enabling the device. Signed-off-by: Nathan Rossi Cc: Jagan Teki Cc: Siva Durga Prasad Paladugu Cc: Simon Glass --- drivers/spi/zynq_qspi.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c index 5825c6d..b98663c 100644 --- a/drivers/spi/zynq_qspi.c +++ b/drivers/spi/zynq_qspi.c @@ -30,6 +30,7 @@ DECLARE_GLOBAL_DATA_PTR; #define ZYNQ_QSPI_IXR_TXOW_MASKBIT(2) /* TX_FIFO_not_full */ #define ZYNQ_QSPI_IXR_ALL_MASK GENMASK(6, 0) /* All IXR bits */ #define ZYNQ_QSPI_ENR_SPI_EN_MASK BIT(0) /* SPI Enable */ +#define ZYNQ_QSPI_LQSPICFG_LQMODE_MASK BIT(31) /* Linear QSPI Mode */ /* zynq qspi Transmit Data Register */ #define ZYNQ_QSPI_TXD_00_00_OFFSET 0x1C/* Transmit 4-byte inst */ @@ -68,6 +69,9 @@ struct zynq_qspi_regs { u32 txd1r; /* 0x80 */ u32 txd2r; /* 0x84 */ u32 txd3r; /* 0x88 */ + u32 reserved1[5]; + u32 lqspicfg; /* 0xA0 */ + u32 lqspists; /* 0xA4 */ }; /* zynq qspi platform data */ @@ -143,6 +147,11 @@ static void zynq_qspi_init_hw(struct zynq_qspi_priv *priv) ZYNQ_QSPI_CR_MSTREN_MASK; writel(confr, ®s->cr); + /* Disable the LQSPI feature */ + confr = readl(®s->lqspicfg); + confr &= ~ZYNQ_QSPI_LQSPICFG_LQMODE_MASK; + writel(confr, ®s->lqspicfg); + /* Enable SPI */ writel(ZYNQ_QSPI_ENR_SPI_EN_MASK, ®s->enr); } -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/2] ARM: zynq: Add target for building bootable SPL image for Zynq
Add a build target to generate 'boot.bin' which includes SPL. This is used by the platforms BootROM to load SPL directly. This change also conditionally changes what the 'boot.bin' target generates depending on the SoC. Leaving the behaviour unchanged for the AT91 targets. Signed-off-by: Nathan Rossi Signed-off-by: Michal Simek Cc: Tom Rini Cc: Andreas Bießmann Cc: Heiko Schocher Reviewed-by: Tom Rini --- Changes in v2: None --- Makefile | 3 +++ scripts/Makefile.spl | 11 +++ 2 files changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 61050ad..b7da462 100644 --- a/Makefile +++ b/Makefile @@ -1335,6 +1335,9 @@ spl/sunxi-spl.bin: spl/u-boot-spl spl/u-boot-spl-dtb.sfp: spl/u-boot-spl @: +spl/boot.bin: spl/u-boot-spl + @: + tpl/u-boot-tpl.bin: tools prepare $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index dd235b9..b0d8551 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -116,6 +116,7 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage) +ifeq ($(CONFIG_SYS_SOC),"at91") MKIMAGEFLAGS_boot.bin = -T atmelimage ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y) @@ -126,6 +127,12 @@ endif boot.bin: $(obj)/u-boot-spl.bin $(call if_changed,mkimage) +else +MKIMAGEFLAGS_boot.bin = -T zynqimage + +spl/boot.bin: $(obj)/u-boot-spl-dtb.bin + $(call if_changed,mkimage) +endif ALL-y += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg @@ -149,6 +156,10 @@ ifeq ($(CONFIG_SYS_SOC),"at91") ALL-y += boot.bin endif +ifdef CONFIG_ARCH_ZYNQ +ALL-y += $(obj)/boot.bin +endif + all: $(ALL-y) quiet_cmd_cat = CAT $@ -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/2] tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage
As with other platforms vendors love to create their own boot header formats. Xilinx is no different and for the Zynq platform/SoC there exists the "boot.bin" which is read by the platforms bootrom. This format is described to a useful extent within the Xilinx Zynq TRM. This implementation adds support for the 'zynqimage' to mkimage. The implementation only considers the most common boot header which is un-encrypted and packed directly after the boot header itself (no XIP, etc.). However this implementation does take into consideration the other fields of the header for image dumping use cases (vector table and register initialization). Signed-off-by: Nathan Rossi Cc: Michal Simek Cc: Tom Rini Reviewed-by: Tom Rini --- Changes in v2: * Remove code that was used for testing --- common/image.c| 1 + include/image.h | 3 +- tools/Makefile| 1 + tools/zynqimage.c | 257 ++ 4 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 tools/zynqimage.c diff --git a/common/image.c b/common/image.c index 85c4f39..c36927f 100644 --- a/common/image.c +++ b/common/image.c @@ -158,6 +158,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_RKIMAGE,"rkimage","Rockchip Boot Image" }, { IH_TYPE_RKSD, "rksd", "Rockchip SD Boot Image" }, { IH_TYPE_RKSPI, "rkspi", "Rockchip SPI Boot Image" }, + { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, { -1, "", "", }, }; diff --git a/include/image.h b/include/image.h index 08ae24a..299d6d2 100644 --- a/include/image.h +++ b/include/image.h @@ -248,8 +248,9 @@ struct lmb; #define IH_TYPE_RKIMAGE23 /* Rockchip Boot Image */ #define IH_TYPE_RKSD 24 /* Rockchip SD card */ #define IH_TYPE_RKSPI 25 /* Rockchip SPI image */ +#define IH_TYPE_ZYNQIMAGE 26 /* Xilinx Zynq Boot Image */ -#define IH_TYPE_COUNT 26 /* Number of image types */ +#define IH_TYPE_COUNT 27 /* Number of image types */ /* * Compression Types diff --git a/tools/Makefile b/tools/Makefile index 9082bda..9cfd80b 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -98,6 +98,7 @@ dumpimage-mkimage-objs := aisimage.o \ lib/sha256.o \ common/hash.o \ ublimage.o \ + zynqimage.o \ $(LIBFDT_OBJS) \ $(RSA_OBJS-y) diff --git a/tools/zynqimage.c b/tools/zynqimage.c new file mode 100644 index 000..25f558d --- /dev/null +++ b/tools/zynqimage.c @@ -0,0 +1,257 @@ +/* + * Copyright (C) 2015 Nathan Rossi + * + * SPDX-License-Identifier:GPL-2.0+ + * + * The following Boot Header format/structures and values are defined in the + * following documents: + * * Xilinx Zynq-7000 Technical Reference Manual (Section 6.3) + * * Xilinx Zynq-7000 Software Developers Guide (Appendix A.7 and A.8) + * + * Expected Header Size = 0x8C0 + * Forced as 'little' endian, 32-bit words + * + * 0x 0 - Interrupt Table (8 words) + * ... (Default value = 0xeafe) + * 0x 1f + * 0x 20 - Width Detection + * * DEFAULT_WIDTHDETECTION0xaa995566 + * 0x 24 - Image Identifier + * * DEFAULT_IMAGEIDENTIFIER 0x584c4e58 + * 0x 28 - Encryption + * * 0x - None + * * 0xa5c3c5a3 - eFuse + * * 0x3a5c3c5a - bbRam + * 0x 2C - User Field + * 0x 30 - Image Offset + * 0x 34 - Image Size + * 0x 38 - Reserved (0x) (according to spec) + * * FSBL defines this field for Image Destination Address. + * 0x 3C - Image Load + * 0x 40 - Image Stored Size + * 0x 44 - Reserved (0x) (according to spec) + * * FSBL defines this field for QSPI configuration Data. + * 0x 48 - Checksum + * 0x 4c - Unused (21 words) + * ... + * 0x 9c + * 0x a0 - Register Initialization, 256 Address and Data word pairs + * * List is terminated with an address of 0x or + * ...* at the max number of entries + * 0x89c + * 0x8a0 - Unused (8 words) + * ... + * 0x8bf + * 0x8c0 - Data/Image starts here or above + */ + +#include "imagetool.h" +#include "mkimage.h" +#include + +#define HEADER_INTERRUPT_DEFAULT (cpu_to_le32(0xeafe)) +#define HEADER_REGINIT_NULL (cpu_to_le32(0x)) +#define HEADER_WIDTHDETECTION (cpu_to_le32(0xaa995566)) +#define HEADER_IMAGEIDENTIFIER (cpu_to_le32(0x584c4e58)) + +enum { + ENCRYPTION_EFUSE = 0xa5c3c5a3, + ENCRYPTION_BBRAM = 0x3a5c3c5a, + ENCRYPTION_NONE = 0x0, +}; + +struct zynq_reginit { + uint32_t address; + uint32_t data; +}; + +#defin
[U-Boot] [PATCH v2 0/2] Add Xilinx Zynq boot.bin support
This patch series adds support for the 'zynqimage' type to mkimage for the Xilinx Zynq platform. As well as adding make targets to generate the boot.bin image file containing SPL by default. Changes in v2: * Remove test code Nathan Rossi (2): tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage ARM: zynq: Add target for building bootable SPL image for Zynq Makefile | 3 + common/image.c | 1 + include/image.h | 3 +- scripts/Makefile.spl | 11 +++ tools/Makefile | 1 + tools/zynqimage.c| 257 +++ 6 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 tools/zynqimage.c -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage
On Wed, Nov 11, 2015 at 9:46 PM, Nathan Rossi wrote: > As with other platforms vendors love to create their own boot header > formats. Xilinx is no different and for the Zynq platform/SoC there > exists the "boot.bin" which is read by the platforms bootrom. This > format is described to a useful extent within the Xilinx Zynq TRM. > > This implementation adds support for the 'zynqimage' to mkimage. The > implementation only considers the most common boot header which is > un-encrypted and packed directly after the boot header itself (no > XIP, etc.). However this implementation does take into consideration the > other fields of the header for image dumping use cases (vector table and > register initialization). > > Signed-off-by: Nathan Rossi > Cc: Michal Simek > Cc: Tom Rini > --- > common/image.c| 1 + > include/image.h | 3 +- > tools/Makefile| 1 + > tools/zynqimage.c | 259 > ++ > 4 files changed, 263 insertions(+), 1 deletion(-) > create mode 100644 tools/zynqimage.c > > diff --git a/common/image.c b/common/image.c > index 85c4f39..c36927f 100644 > --- a/common/image.c > +++ b/common/image.c > @@ -158,6 +158,7 @@ static const table_entry_t uimage_type[] = { > { IH_TYPE_RKIMAGE,"rkimage","Rockchip Boot Image" }, > { IH_TYPE_RKSD, "rksd", "Rockchip SD Boot Image" }, > { IH_TYPE_RKSPI, "rkspi", "Rockchip SPI Boot Image" }, > + { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, > { -1, "", "", }, > }; > > diff --git a/include/image.h b/include/image.h > index 08ae24a..299d6d2 100644 > --- a/include/image.h > +++ b/include/image.h > @@ -248,8 +248,9 @@ struct lmb; > #define IH_TYPE_RKIMAGE23 /* Rockchip Boot Image > */ > #define IH_TYPE_RKSD 24 /* Rockchip SD card */ > #define IH_TYPE_RKSPI 25 /* Rockchip SPI image */ > +#define IH_TYPE_ZYNQIMAGE 26 /* Xilinx Zynq Boot Image */ > > -#define IH_TYPE_COUNT 26 /* Number of image types */ > +#define IH_TYPE_COUNT 27 /* Number of image types */ > > /* > * Compression Types > diff --git a/tools/Makefile b/tools/Makefile > index 9082bda..9cfd80b 100644 > --- a/tools/Makefile > +++ b/tools/Makefile > @@ -98,6 +98,7 @@ dumpimage-mkimage-objs := aisimage.o \ > lib/sha256.o \ > common/hash.o \ > ublimage.o \ > + zynqimage.o \ > $(LIBFDT_OBJS) \ > $(RSA_OBJS-y) > > diff --git a/tools/zynqimage.c b/tools/zynqimage.c > new file mode 100644 > index 000..6d417d1 > --- /dev/null > +++ b/tools/zynqimage.c > @@ -0,0 +1,259 @@ > +/* > + * Copyright (C) 2015 Nathan Rossi > + * > + * SPDX-License-Identifier:GPL-2.0+ > + * > + * The following Boot Header format/structures and values are defined in the > + * following documents: > + * * Xilinx Zynq-7000 Technical Reference Manual (Section 6.3) > + * * Xilinx Zynq-7000 Software Developers Guide (Appendix A.7 and A.8) > + * > + * Expected Header Size = 0x8C0 > + * Forced as 'little' endian, 32-bit words > + * > + * 0x 0 - Interrupt Table (8 words) > + * ... (Default value = 0xeafe) > + * 0x 1f > + * 0x 20 - Width Detection > + * * DEFAULT_WIDTHDETECTION0xaa995566 > + * 0x 24 - Image Identifier > + * * DEFAULT_IMAGEIDENTIFIER 0x584c4e58 > + * 0x 28 - Encryption > + * * 0x - None > + * * 0xa5c3c5a3 - eFuse > + * * 0x3a5c3c5a - bbRam > + * 0x 2C - User Field > + * 0x 30 - Image Offset > + * 0x 34 - Image Size > + * 0x 38 - Reserved (0x) (according to spec) > + * * FSBL defines this field for Image Destination Address. > + * 0x 3C - Image Load > + * 0x 40 - Image Stored Size > + * 0x 44 - Reserved (0x) (according to spec) > + * * FSBL defines this field for QSPI configuration Data. > + * 0x 48 - Checksum > + * 0x 4c - Unused (21 words) > + * ... > + * 0x 9c > + * 0x a0 - Register Initialization, 256 Address and Data word pairs > + * * List is terminated with an address of 0x or > + * ...* at the max number of entries > + * 0x89c > + * 0x8a0 - Unused (8 words) > + * ... > + * 0x8bf > + * 0x8c0 - Data/Image starts here or above &g
[U-Boot] [PATCH 0/2] Add Xilinx Zynq boot.bin support
This patch series adds support for the 'zynqimage' type to mkimage for the Xilinx Zynq platform. As well as adding make targets to generate the boot.bin image file containing SPL by default. Nathan Rossi (2): tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage ARM: zynq: Add target for building bootable SPL image for Zynq Makefile | 3 + common/image.c | 1 + include/image.h | 3 +- scripts/Makefile.spl | 11 +++ tools/Makefile | 1 + tools/zynqimage.c| 259 +++ 6 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 tools/zynqimage.c -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage
As with other platforms vendors love to create their own boot header formats. Xilinx is no different and for the Zynq platform/SoC there exists the "boot.bin" which is read by the platforms bootrom. This format is described to a useful extent within the Xilinx Zynq TRM. This implementation adds support for the 'zynqimage' to mkimage. The implementation only considers the most common boot header which is un-encrypted and packed directly after the boot header itself (no XIP, etc.). However this implementation does take into consideration the other fields of the header for image dumping use cases (vector table and register initialization). Signed-off-by: Nathan Rossi Cc: Michal Simek Cc: Tom Rini --- common/image.c| 1 + include/image.h | 3 +- tools/Makefile| 1 + tools/zynqimage.c | 259 ++ 4 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 tools/zynqimage.c diff --git a/common/image.c b/common/image.c index 85c4f39..c36927f 100644 --- a/common/image.c +++ b/common/image.c @@ -158,6 +158,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_RKIMAGE,"rkimage","Rockchip Boot Image" }, { IH_TYPE_RKSD, "rksd", "Rockchip SD Boot Image" }, { IH_TYPE_RKSPI, "rkspi", "Rockchip SPI Boot Image" }, + { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, { -1, "", "", }, }; diff --git a/include/image.h b/include/image.h index 08ae24a..299d6d2 100644 --- a/include/image.h +++ b/include/image.h @@ -248,8 +248,9 @@ struct lmb; #define IH_TYPE_RKIMAGE23 /* Rockchip Boot Image */ #define IH_TYPE_RKSD 24 /* Rockchip SD card */ #define IH_TYPE_RKSPI 25 /* Rockchip SPI image */ +#define IH_TYPE_ZYNQIMAGE 26 /* Xilinx Zynq Boot Image */ -#define IH_TYPE_COUNT 26 /* Number of image types */ +#define IH_TYPE_COUNT 27 /* Number of image types */ /* * Compression Types diff --git a/tools/Makefile b/tools/Makefile index 9082bda..9cfd80b 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -98,6 +98,7 @@ dumpimage-mkimage-objs := aisimage.o \ lib/sha256.o \ common/hash.o \ ublimage.o \ + zynqimage.o \ $(LIBFDT_OBJS) \ $(RSA_OBJS-y) diff --git a/tools/zynqimage.c b/tools/zynqimage.c new file mode 100644 index 000..6d417d1 --- /dev/null +++ b/tools/zynqimage.c @@ -0,0 +1,259 @@ +/* + * Copyright (C) 2015 Nathan Rossi + * + * SPDX-License-Identifier:GPL-2.0+ + * + * The following Boot Header format/structures and values are defined in the + * following documents: + * * Xilinx Zynq-7000 Technical Reference Manual (Section 6.3) + * * Xilinx Zynq-7000 Software Developers Guide (Appendix A.7 and A.8) + * + * Expected Header Size = 0x8C0 + * Forced as 'little' endian, 32-bit words + * + * 0x 0 - Interrupt Table (8 words) + * ... (Default value = 0xeafe) + * 0x 1f + * 0x 20 - Width Detection + * * DEFAULT_WIDTHDETECTION0xaa995566 + * 0x 24 - Image Identifier + * * DEFAULT_IMAGEIDENTIFIER 0x584c4e58 + * 0x 28 - Encryption + * * 0x - None + * * 0xa5c3c5a3 - eFuse + * * 0x3a5c3c5a - bbRam + * 0x 2C - User Field + * 0x 30 - Image Offset + * 0x 34 - Image Size + * 0x 38 - Reserved (0x) (according to spec) + * * FSBL defines this field for Image Destination Address. + * 0x 3C - Image Load + * 0x 40 - Image Stored Size + * 0x 44 - Reserved (0x) (according to spec) + * * FSBL defines this field for QSPI configuration Data. + * 0x 48 - Checksum + * 0x 4c - Unused (21 words) + * ... + * 0x 9c + * 0x a0 - Register Initialization, 256 Address and Data word pairs + * * List is terminated with an address of 0x or + * ...* at the max number of entries + * 0x89c + * 0x8a0 - Unused (8 words) + * ... + * 0x8bf + * 0x8c0 - Data/Image starts here or above + */ + +#include "imagetool.h" +#include "mkimage.h" +#include + +#define HEADER_INTERRUPT_DEFAULT (cpu_to_le32(0xeafe)) +#define HEADER_REGINIT_NULL (cpu_to_le32(0x)) +#define HEADER_WIDTHDETECTION (cpu_to_le32(0xaa995566)) +#define HEADER_IMAGEIDENTIFIER (cpu_to_le32(0x584c4e58)) + +enum { + ENCRYPTION_EFUSE = 0xa5c3c5a3, + ENCRYPTION_BBRAM = 0x3a5c3c5a, + ENCRYPTION_NONE = 0x0, +}; + +struct zynq_reginit { + uint32_t address; + uint32_t data; +}; + +#define HEADER_INTERRUPT_VECTORS 8 +#define HEADER_REGINITS 256 + +struct zynq_header { + u
[U-Boot] [PATCH 2/2] ARM: zynq: Add target for building bootable SPL image for Zynq
Add a build target to generate 'boot.bin' which includes SPL. This is used by the platforms BootROM to load SPL directly. This change also conditionally changes what the 'boot.bin' target generates depending on the SoC. Leaving the behaviour unchanged for the AT91 targets. Signed-off-by: Nathan Rossi Signed-off-by: Michal Simek Cc: Tom Rini Cc: Andreas Bießmann Cc: Heiko Schocher --- Makefile | 3 +++ scripts/Makefile.spl | 11 +++ 2 files changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 61050ad..b7da462 100644 --- a/Makefile +++ b/Makefile @@ -1335,6 +1335,9 @@ spl/sunxi-spl.bin: spl/u-boot-spl spl/u-boot-spl-dtb.sfp: spl/u-boot-spl @: +spl/boot.bin: spl/u-boot-spl + @: + tpl/u-boot-tpl.bin: tools prepare $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index dd235b9..b0d8551 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -116,6 +116,7 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage) +ifeq ($(CONFIG_SYS_SOC),"at91") MKIMAGEFLAGS_boot.bin = -T atmelimage ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y) @@ -126,6 +127,12 @@ endif boot.bin: $(obj)/u-boot-spl.bin $(call if_changed,mkimage) +else +MKIMAGEFLAGS_boot.bin = -T zynqimage + +spl/boot.bin: $(obj)/u-boot-spl-dtb.bin + $(call if_changed,mkimage) +endif ALL-y += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg @@ -149,6 +156,10 @@ ifeq ($(CONFIG_SYS_SOC),"at91") ALL-y += boot.bin endif +ifdef CONFIG_ARCH_ZYNQ +ALL-y += $(obj)/boot.bin +endif + all: $(ALL-y) quiet_cmd_cat = CAT $@ -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] microblaze: Fix C99/gnu99 compatiblity for inline functions
'extern inline' is not portable across various C standards. To ensure compatiblity with various standards/compilers change the functions to static inline. This is a portable construct and serves as a comparable definition to 'extern inline' from the gnu90 standard. Additionally remove the function prototypes as they are not required due to the functions being declared static and functions are correctly ordered based on dependence. Signed-off-by: Nathan Rossi Cc: Michal Simek Cc: Tom Rini --- arch/microblaze/include/asm/bitops.h | 63 arch/microblaze/include/asm/system.h | 2 +- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h index d42ee61..2c11d1a 100644 --- a/arch/microblaze/include/asm/bitops.h +++ b/arch/microblaze/include/asm/bitops.h @@ -10,38 +10,14 @@ #ifdef __KERNEL__ /* - * Function prototypes to keep gcc -Wall happy - */ - -/* * The __ functions are not atomic */ -extern void set_bit(int nr, volatile void *addr); -extern void __set_bit(int nr, volatile void *addr); - -extern void clear_bit(int nr, volatile void *addr); -#define __clear_bit(nr, addr) clear_bit(nr, addr) -#define PLATFORM__CLEAR_BIT - -extern void change_bit(int nr, volatile void *addr); -extern void __change_bit(int nr, volatile void *addr); -extern int test_and_set_bit(int nr, volatile void *addr); -extern int __test_and_set_bit(int nr, volatile void *addr); -extern int test_and_clear_bit(int nr, volatile void *addr); -extern int __test_and_clear_bit(int nr, volatile void *addr); -extern int test_and_change_bit(int nr, volatile void *addr); -extern int __test_and_change_bit(int nr, volatile void *addr); -extern int __constant_test_bit(int nr, const volatile void *addr); -extern int __test_bit(int nr, volatile void *addr); -extern int find_first_zero_bit(void *addr, unsigned size); -extern int find_next_zero_bit(void *addr, int size, int offset); - /* * ffz = Find First Zero in word. Undefined if no zero exists, * so code should check against ~0UL first.. */ -extern inline unsigned long ffz(unsigned long word) +static inline unsigned long ffz(unsigned long word) { unsigned long result = 0; @@ -53,7 +29,7 @@ extern inline unsigned long ffz(unsigned long word) } -extern inline void set_bit(int nr, volatile void *addr) +static inline void set_bit(int nr, volatile void *addr) { int * a = (int *) addr; int mask; @@ -66,7 +42,7 @@ extern inline void set_bit(int nr, volatile void *addr) restore_flags(flags); } -extern inline void __set_bit(int nr, volatile void *addr) +static inline void __set_bit(int nr, volatile void *addr) { int * a = (int *) addr; int mask; @@ -83,7 +59,7 @@ extern inline void __set_bit(int nr, volatile void *addr) #define smp_mb__before_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier() -extern inline void clear_bit(int nr, volatile void *addr) +static inline void clear_bit(int nr, volatile void *addr) { int * a = (int *) addr; int mask; @@ -96,7 +72,10 @@ extern inline void clear_bit(int nr, volatile void *addr) restore_flags(flags); } -extern inline void change_bit(int nr, volatile void *addr) +#define __clear_bit(nr, addr) clear_bit(nr, addr) +#define PLATFORM__CLEAR_BIT + +static inline void change_bit(int nr, volatile void *addr) { int mask; unsigned long flags; @@ -109,7 +88,7 @@ extern inline void change_bit(int nr, volatile void *addr) restore_flags(flags); } -extern inline void __change_bit(int nr, volatile void *addr) +static inline void __change_bit(int nr, volatile void *addr) { int mask; unsigned long *ADDR = (unsigned long *) addr; @@ -119,7 +98,7 @@ extern inline void __change_bit(int nr, volatile void *addr) *ADDR ^= mask; } -extern inline int test_and_set_bit(int nr, volatile void *addr) +static inline int test_and_set_bit(int nr, volatile void *addr) { int mask, retval; volatile unsigned int *a = (volatile unsigned int *) addr; @@ -135,7 +114,7 @@ extern inline int test_and_set_bit(int nr, volatile void *addr) return retval; } -extern inline int __test_and_set_bit(int nr, volatile void *addr) +static inline int __test_and_set_bit(int nr, volatile void *addr) { int mask, retval; volatile unsigned int *a = (volatile unsigned int *) addr; @@ -147,7 +126,7 @@ extern inline int __test_and_set_bit(int nr, volatile void *addr) return retval; } -extern inline int test_and_clear_bit(int nr, volatile void *addr) +static inline int test_and_clear_bit(int nr, volatile void *addr) { int mask, retval; volatile unsigned int *a = (volatile unsigned int *) addr; @@ -163,7 +142,7 @@ extern inline int test_and_clear_bit(int nr, volatile void *addr) return
[U-Boot] [PATCH 1/2] microblaze: Fix style issues in header files
Fix various style issues in MicroBlaze header files. Specifically fixing style voilations including '__inline__', 'foo * bar' and 'void foo ('. Signed-off-by: Nathan Rossi Cc: Michal Simek Cc: Tom Rini --- arch/microblaze/include/asm/bitops.h | 66 ++-- arch/microblaze/include/asm/system.h | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h index 0ac78d7..d42ee61 100644 --- a/arch/microblaze/include/asm/bitops.h +++ b/arch/microblaze/include/asm/bitops.h @@ -17,31 +17,31 @@ * The __ functions are not atomic */ -extern void set_bit(int nr, volatile void * addr); -extern void __set_bit(int nr, volatile void * addr); +extern void set_bit(int nr, volatile void *addr); +extern void __set_bit(int nr, volatile void *addr); -extern void clear_bit(int nr, volatile void * addr); +extern void clear_bit(int nr, volatile void *addr); #define __clear_bit(nr, addr) clear_bit(nr, addr) #define PLATFORM__CLEAR_BIT -extern void change_bit(int nr, volatile void * addr); -extern void __change_bit(int nr, volatile void * addr); -extern int test_and_set_bit(int nr, volatile void * addr); -extern int __test_and_set_bit(int nr, volatile void * addr); -extern int test_and_clear_bit(int nr, volatile void * addr); -extern int __test_and_clear_bit(int nr, volatile void * addr); -extern int test_and_change_bit(int nr, volatile void * addr); -extern int __test_and_change_bit(int nr, volatile void * addr); -extern int __constant_test_bit(int nr, const volatile void * addr); -extern int __test_bit(int nr, volatile void * addr); -extern int find_first_zero_bit(void * addr, unsigned size); -extern int find_next_zero_bit (void * addr, int size, int offset); +extern void change_bit(int nr, volatile void *addr); +extern void __change_bit(int nr, volatile void *addr); +extern int test_and_set_bit(int nr, volatile void *addr); +extern int __test_and_set_bit(int nr, volatile void *addr); +extern int test_and_clear_bit(int nr, volatile void *addr); +extern int __test_and_clear_bit(int nr, volatile void *addr); +extern int test_and_change_bit(int nr, volatile void *addr); +extern int __test_and_change_bit(int nr, volatile void *addr); +extern int __constant_test_bit(int nr, const volatile void *addr); +extern int __test_bit(int nr, volatile void *addr); +extern int find_first_zero_bit(void *addr, unsigned size); +extern int find_next_zero_bit(void *addr, int size, int offset); /* * ffz = Find First Zero in word. Undefined if no zero exists, * so code should check against ~0UL first.. */ -extern __inline__ unsigned long ffz(unsigned long word) +extern inline unsigned long ffz(unsigned long word) { unsigned long result = 0; @@ -53,7 +53,7 @@ extern __inline__ unsigned long ffz(unsigned long word) } -extern __inline__ void set_bit(int nr, volatile void * addr) +extern inline void set_bit(int nr, volatile void *addr) { int * a = (int *) addr; int mask; @@ -66,7 +66,7 @@ extern __inline__ void set_bit(int nr, volatile void * addr) restore_flags(flags); } -extern __inline__ void __set_bit(int nr, volatile void * addr) +extern inline void __set_bit(int nr, volatile void *addr) { int * a = (int *) addr; int mask; @@ -83,7 +83,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr) #define smp_mb__before_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier() -extern __inline__ void clear_bit(int nr, volatile void * addr) +extern inline void clear_bit(int nr, volatile void *addr) { int * a = (int *) addr; int mask; @@ -96,7 +96,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr) restore_flags(flags); } -extern __inline__ void change_bit(int nr, volatile void * addr) +extern inline void change_bit(int nr, volatile void *addr) { int mask; unsigned long flags; @@ -109,7 +109,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr) restore_flags(flags); } -extern __inline__ void __change_bit(int nr, volatile void * addr) +extern inline void __change_bit(int nr, volatile void *addr) { int mask; unsigned long *ADDR = (unsigned long *) addr; @@ -119,7 +119,7 @@ extern __inline__ void __change_bit(int nr, volatile void * addr) *ADDR ^= mask; } -extern __inline__ int test_and_set_bit(int nr, volatile void * addr) +extern inline int test_and_set_bit(int nr, volatile void *addr) { int mask, retval; volatile unsigned int *a = (volatile unsigned int *) addr; @@ -135,7 +135,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr) return retval; } -extern __inline__ int __test_and_set_bit(int nr, volatile void * addr) +extern inline int __test_and_set_bit(int nr, volatile void *addr) { int
[U-Boot] [PATCH 0/2] Add support for GCC 5.x for MicroBlaze
This patch series fixes some issues with some MicroBlaze functions and declarations that are not compatible with newer C standards (e.g. C99) this includes the default C standard set by the GCC 5.x compiler (which is gnu11 by default). This series is split into two patches, the first patch being some code style clean up, followed by the patch that fixes the compatiblity. Nathan Rossi (2): microblaze: Fix style issues in header files microblaze: Fix C99/gnu99 compatiblity for inline functions arch/microblaze/include/asm/bitops.h | 63 arch/microblaze/include/asm/system.h | 2 +- 2 files changed, 22 insertions(+), 43 deletions(-) -- 2.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot