[PATCH v3 2/6] arm: mach-imx: Add command to expose QB functionality
Marek Vasut
marek.vasut at mailbox.org
Sat Apr 4 01:16:40 CEST 2026
On 4/2/26 11:40 AM, Simona Toaca (OSS) wrote:
[...]
> +static void parse_qb_args(int argc, char * const argv[],
> + int *qb_dev, int qb_bootdev)
> +{
> + long dev = -1;
> + char *interface = "";
> +
> + if (argc < 2) {
> + /* qb save -> use boot device */
> + *qb_dev = qb_bootdev;
> + } else {
> + interface = argv[1];
> + }
> +
> + if (argc == 3)
> + dev = simple_strtol(argv[2], NULL, 10);
> +
> + if (!strcmp(interface, "mmc") && dev >= 0 &&
> + dev <= (BOOT_DEVICE_MMC2_2 - BOOT_DEVICE_MMC1))
> + *qb_dev = BOOT_DEVICE_MMC1 + dev;
> + else if (!strcmp(interface, "spi"))
> + *qb_dev = BOOT_DEVICE_SPI;
if (!strcmp(interface, "spi")) {
*qb_dev = BOOT_DEVICE_SPI;
} else {
blk_get_device_by_str(interface, argv[2], ...);
-> This will handle all block devices and all block device
names and format strings of those, no need to write yet
another ad-hoc decoder for those by hand. Then use
blk_dread()/blk_dwrite() to access block storage.
}
[...]
More information about the U-Boot
mailing list