hw/arm: Enable U-Boot boot on MCIMX6UL-EVK
Subsystems (2)
v4 cover hw/arm: Enable U-Boot boot on MCIMX6UL-EVK
The mcimx6ul-evk machine can boot Linux directly, but it cannot run the U-Boot proper produced by Buildroot far enough to load a kernel from its SD card. Early U-Boot boot test accesses currently abort or observe placeholder values, and the i.MX uSDHC model exposes several issues.
This series lets an unmodified Buildroot 2026.05 U-Boot 2024.07 image run on mcimx6ul-evk, load zImage and imx6ul-14x14-evk.dtb from USDHC2, start Linux, mount the SD card root file system, and reach the Buildroot login prompt. It also documents and tests the existing direct Linux boot path.
Patches 1 through 4 provide the minimum early-firmware-visible state. Patches 5 through 8 address i.MX uSDHC behavior needed by U-Boot. The last two patches document both boot paths and add functional tests for U-Boot and direct Linux boot.
This series is based on:
<[email protected]> as the sdhci changes have conflicts.
Changes in v4:
- Rebase on the v4 PolarFire SoC Icicle Kit series
- Simplify the reserved page to a MemoryRegion
- Log invalid reserved accesses and explain the RAZ/WI behaviour
- Reference the U-Boot fix for the reserved-register access
- Make the functional test executable
Changes in v3:
- hw/cpu: a15mpcore: Model the reserved page as RAZ/WI
- Rebase on the v3 PolarFire SoC Icicle Kit series
- Model the full reserved page as a child of a15mpcore_priv
- Validate MMDC RAM geometry and document supported capacities
- Translate uSDHC vendor clock gates in its MMIO handlers
- Cover partial reset accesses and migrate vendor clock state
- Extend contiguous SDMA completion to both eSDHC byte orders
Bin Meng (10):
hw/cpu: a15mpcore: Model the reserved page as RAZ/WI hw/misc: imx6ul_ccm: Update PMU_MISC0 reset value hw/arm: fsl-imx6ul: Map early firmware register placeholders hw/arm: fsl-imx6ul: Add a minimal MMDC geometry model hw/sd: sdhci: Use a QEMU-local no-busy IRQ quirk bit hw/sd: sdhci: Honor i.MX uSDHC vendor clock gates hw/sd: sdhci: Preserve uSDHC status enables for U-Boot hw/sd: sdhci: Skip SDMA boundary stops for eSDHC and uSDHC docs/system/arm: Document MCIMX6UL-EVK Buildroot boot tests/functional/arm: Add MCIMX6UL-EVK boot tests
MAINTAINERS | 1 + docs/system/arm/mcimx6ul-evk.rst | 72 +++++++++++ include/hw/arm/fsl-imx6ul.h | 2 + include/hw/cpu/a15mpcore.h | 1 + include/hw/sd/sdhci.h | 10 +- hw/arm/fsl-imx6ul.c | 87 ++++++++++++- hw/arm/mcimx6ul-evk.c | 2 + hw/cpu/a15mpcore.c | 32 +++++ hw/misc/imx6ul_ccm.c | 2 +- hw/sd/sdhci.c | 151 +++++++++++++++++----- tests/functional/arm/meson.build | 2 + tests/functional/arm/test_mcimx6ul_evk.py | 69 ++++++++++ 12 files changed, 390 insertions(+), 41 deletions(-) create mode 100755 tests/functional/arm/test_mcimx6ul_evk.py
---
base-commit: 864e276a646ca77b5fc7eb1ae1966b4c290c3b57
branch: imx6ul-evk
Signature · 1 line
2.53.0
PATCH v4 1/10 hw/cpu: a15mpcore: Model the reserved page as RAZ/WI
U-Boot's shared i.MX6 identification code reads PERIPHBASE + 0x4 on MCIMX6UL-EVK. The first private peripheral page is currently unmapped, so that access causes a data abort before the console is ready.
The Cortex-A15 and Cortex-A7 TRMs describe errors for reserved accesses, while the related GIC-400 TRM documents RAZ/WI. Follow the behaviour relied on by existing U-Boot on i.MX6 boards and log these accesses as guest errors. Keep the reserved page in the private peripheral device.
A U-Boot fix has been posted:
<[email protected]>
Reference: GIC-400 TRM (ARM DDI 0471B), section 3.1 and 3.2
https://documentation-service.arm.com/static/5e8f15e27100066a414f7424
---
Changes in v4:
- Replace the reserved-page child device with a MemoryRegion
- Log reserved reads and writes as guest errors
- Explain the RAZ/WI compatibility choice and reference the U-Boot fix
Changes in v3:
- New
include/hw/cpu/a15mpcore.h | 1 + hw/cpu/a15mpcore.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+)
include/hw/cpu/a15mpcore.h +1 -0
@@ -38,6 +38,7 @@ struct A15MPPrivState {uint32_t num_irq;MemoryRegion container; +MemoryRegion reserved;GICState gic; };
hw/cpu/a15mpcore.c +32 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/cpu/a15mpcore.h" #include "hw/core/cpu.h"
@@ -28,6 +29,28 @@#include "system/kvm.h" #include "target/arm/gtimer.h" +static uint64_t a15mp_reserved_read (void *opaque,hwaddr offset,unsigned size) +{ +qemu_log_mask (LOG_GUEST_ERROR , +"%s: read from reserved offset 0x%" HWADDR_PRIx"\n" , + __func__, offset); +return 0 ; +} + +static void a15mp_reserved_write (void *opaque,hwaddr offset,uint64_t value, +unsigned size) +{ +qemu_log_mask (LOG_GUEST_ERROR , +"%s: write to reserved offset 0x%" HWADDR_PRIx"\n" , + __func__, offset); +} + +static const MemoryRegionOps a15mp_reserved_ops = { + .read = a15mp_reserved_read, + .write = a15mp_reserved_write, + .endianness =DEVICE_LITTLE_ENDIAN , +}; +static void a15mp_priv_set_irq (void *opaque,int irq,int level) {A15MPPrivState *s = (A15MPPrivState *)opaque;
@@ -43,6 +66,8 @@ static void a15mp_priv_initfn(Object *obj)memory_region_init (&s->container, obj,"a15mp-priv-container" ,0x8000 );sysbus_init_mmio (sbd, &s->container); +memory_region_init_io (&s->reserved, obj, &a15mp_reserved_ops, s, +"a15mp-reserved" ,0x1000 );object_initialize_child (obj,"gic" , &s->gic,gic_class_name ());qdev_prop_set_uint32 (DEVICE (&s->gic),"revision" ,2 ); }
@@ -130,7 +155,14 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)* 0x5400-0x55ff -- GIC virtual interface control for CPU 2 * 0x5600-0x57ff -- GIC virtual interface control for CPU 3 * 0x6000-0x7fff -- GIC virtual CPU interface +* +* The Cortex-A15 TRM specifies a bus error for reserved accesses, and +* the Cortex-A7 TRM says they can abort. The GIC-400 TRM instead +* specifies RAZ/WI. Existing U-Boot code on i.MX6 boards relies on +* these accesses completing without an abort, so use RAZ/WI here +* for compatibility and log the invalid guest accesses. */ +memory_region_add_subregion (&s->container,0 , &s->reserved);memory_region_add_subregion (&s->container,0x1000 ,sysbus_mmio_get_region (busdev,0 )); memory_region_add_subregion(&s->container, 0x2000,
Signature · 1 line
2.53.0
Re: [PATCH v4 01/10] hw/cpu: a15mpcore: Model the reserved page as RAZ/WI
Quoted 11 lines · Bin Meng
U-Boot's shared i.MX6 identification code reads PERIPHBASE +
0x4on MCIMX6UL-EVK. The first private peripheral page is currently unmapped, so that access causes a data abort before the console is ready.The Cortex-A15 and Cortex-A7 TRMs describe errors for reserved accesses, while the related GIC-400 TRM documents RAZ/WI. Follow the behaviour relied on by existing U-Boot on i.MX6 boards and log these accesses as guest errors. Keep the reserved page in the private peripheral device.
Quoted 7 lines
A U-Boot fix has been posted:
<[email protected]>Reference: GIC-400 TRM (ARM DDI 0471B), section 3.1 and 3.2
https://documentation-service.arm.com/static/5e8f15e27100066a414f7424Signed-off-by Bin Meng <[email protected]>
thanks
-- PMM
PATCH v4 2/10 hw/misc: imx6ul_ccm: Update PMU_MISC0 reset value
In reply to Bin MengCommit 56a11a9b7580 ("hw/misc: imx6_ccm: Update PMU_MISC0 reset value") updated the i.MX6 CCM model so U-Boot sees PMU_MISC0[REFTOP_VBGUP] set after reset. The i.MX6UL CCM model still returns this bit clear, causing U-Boot init_bandgap() to wait for a state that the model never reaches.
Apply the same reset behavior to the i.MX6UL CCM model so U-Boot can observe that the bandgap has stabilized.
---
(no changes since v1)
hw/misc/imx6ul_ccm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/imx6ul_ccm.c +1 -1
@@ -592,7 +592,7 @@ static void imx6ul_ccm_reset(DeviceState *dev) s->analog[PMU_REG_3P0 ] =0x00000F74 ; s->analog[PMU_REG_2P5 ] =0x00001073 ; s->analog[PMU_REG_CORE ] =0x00482012 ; - s->analog[PMU_MISC0 ] =0x04000000 ; + s->analog[PMU_MISC0 ] =0x04000080 ; s->analog[PMU_MISC1 ] =0x00000000 ; s->analog[PMU_MISC2 ] =0x00272727 ; s->analog[PMU_LOWPWR_CTRL ] =0x00004009 ;
Signature · 1 line
2.53.0
Re: [PATCH v4 02/10] hw/misc: imx6ul_ccm: Update PMU_MISC0 reset value
Am 14. Oktober 2026 04:55:52 UTC schrieb Bin Meng <[email protected]>:
Quoted 22 lines
Commit
56a11a9b7580("hw/misc:imx6_ccm: UpdatePMU_MISC0reset value") updated the i.MX6 CCM model so U-Boot sees PMU_MISC0[REFTOP_VBGUP] set after reset. The i.MX6UL CCM model still returns this bit clear, causing U-Bootinit_bandgap()to wait for a state that the model never reaches.Apply the same reset behavior to the i.MX6UL CCM model so U-Boot can observe that the bandgap has stabilized.
Signed-off-by Bin Meng <[email protected]>---
(no changes since v1)
hw/misc/imx6ul_ccm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/misc/imx6ul_ccm.c +0
-0
hw/misc/imx6ul_ccm.c static void imx6ul_ccm_reset(DeviceState *dev) · line 598
Quoted 8 lines
hw/misc/imx6ul_ccm.c +1
-1@@ -592,7 +592,7 @@ static void imx6ul_ccm_reset(DeviceState *dev) s->analog[PMU_REG_3P0 ] =0x00000F74 ; s->analog[PMU_REG_2P5 ] =0x00001073 ; s->analog[PMU_REG_CORE ] =0x00482012 ; - s->analog[PMU_MISC0 ] =0x04000000 ; + s->analog[PMU_MISC0 ] =0x04000080 ; s->analog[PMU_MISC1 ] =0x00000000 ; s->analog[PMU_MISC2 ] =0x00272727 ; s->analog[PMU_LOWPWR_CTRL ] =0x00004009 ;
PATCH v4 3/10 hw/arm: fsl-imx6ul: Map early firmware register placeholders
In reply to Bin MengU-Boot configures the AIPS bus access controls and the i.MX6UL SNVS low-power registers before its console is available. Its timer setup also enables the system counter through the control window on AIPS2.
These blocks are not modeled yet. Map unimplemented regions at their documented addresses so early firmware accesses complete without falling through to unmapped memory.
---
(no changes since v1)
hw/arm/fsl-imx6ul.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
hw/arm/fsl-imx6ul.c +15 -0
@@ -201,6 +201,21 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)create_unimplemented_device ("a7mpcore-dap" ,FSL_IMX6UL_A7MPCORE_DAP_ADDR ,FSL_IMX6UL_A7MPCORE_DAP_SIZE ); +/* AIPS bus configuration */ +create_unimplemented_device ("aips1-config" ,FSL_IMX6UL_AIPS1_CFG_ADDR , +FSL_IMX6UL_AIPS1_CFG_SIZE ); +create_unimplemented_device ("aips2-config" ,FSL_IMX6UL_AIPS2_CFG_ADDR , +FSL_IMX6UL_AIPS2_CFG_SIZE ); + +/* SNVS low-power general-purpose registers */ +create_unimplemented_device ("snvs-lp" ,FSL_IMX6UL_SNVS_LP_ADDR , +FSL_IMX6UL_SNVS_LP_SIZE ); + +/* System counter control */ +create_unimplemented_device ("sys-counter-control" , +FSL_IMX6UL_SYS_CNT_CTRL_ADDR , +FSL_IMX6UL_SYS_CNT_CTRL_SIZE ); +/* * MMDC */
Signature · 1 line
2.53.0
PATCH v4 4/10 hw/arm: fsl-imx6ul: Add a minimal MMDC geometry model
In reply to Bin MengU-Boot probes DRAM size from the MMDC MDCTL and MDMISC registers. The existing unimplemented region returns zero, so U-Boot cannot derive a geometry matching the RAM mapped by the machine.
Replace the placeholder with a small read-only model. Use the 8-bank, 16-bit DDR3 layout of the EVK and derive the row and column counts from the machine RAM size.
The MMDC permits 11 to 16 row bits; ROW encodings 6 and 7 are reserved. Preserve the existing layouts through 1 GiB. For 2 GiB, use 16 row bits and 11 column bits instead of an invalid 17-bit row.
Reference: IMX6ULRM (Rev.2), section 33.12.1
https://www.nxp.com/webapp/Download?colCode=IMX6ULRM
---
(no changes since v3)
Changes in v3:
- Reject RAM below 16 MiB instead of advertising unmapped memory
- Keep power-of-two geometry bounded by the configured RAM size
- Use 11 column bits to represent 2 GiB with a valid geometry
include/hw/arm/fsl-imx6ul.h | 2 ++ hw/arm/fsl-imx6ul.c | 72 +++++++++++++++++++++++++++++++++++-- hw/arm/mcimx6ul-evk.c | 2 ++ 3 files changed, 74 insertions(+), 2 deletions(-)
include/hw/arm/fsl-imx6ul.h +2 -0
@@ -90,9 +90,11 @@ struct FslIMX6ULState {MemoryRegion caam;MemoryRegion ocram;MemoryRegion ocram_alias; +MemoryRegion mmdc;uint32_t phy_num[FSL_IMX6UL_NUM_ETHS ];bool phy_connected[FSL_IMX6UL_NUM_ETHS ]; +uint64_t ram_size; };enum FslIMX6ULMemoryMap {
hw/arm/fsl-imx6ul.c +70 -2
107 lines not on this page · raw message
hw/arm/mcimx6ul-evk.c +2 -0
@@ -44,6 +44,8 @@ static void mcimx6ul_evk_init(MachineState *machine)object_property_set_uint (OBJECT (s),"fec2-phy-num" ,1 , &error_fatal);object_property_set_bool (OBJECT (s),"fec1-phy-connected" , false, &error_fatal); +object_property_set_uint (OBJECT (s),"ram-size" , machine->ram_size, + &error_fatal);qdev_realize (DEVICE (s),NULL , &error_fatal); memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
Signature · 1 line
2.53.0
PATCH v4 5/10 hw/sd: sdhci: Use a QEMU-local no-busy IRQ quirk bit
In reply to Bin MengSDHCI_QUIRK_NO_BUSY_IRQ was copied from Linux with its bit number unchanged. The quirk mask is internal to QEMU: it is neither visible to guests nor part of migration state. Mirroring Linux therefore provides no compatibility benefit and constrains local allocations.
Move it to bit zero so QEMU can allocate SDHCI quirks sequentially in its own namespace.
---
(no changes since v3)
Changes in v3:
- Align the quirk definition before adding another bit
include/hw/sd/sdhci.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
include/hw/sd/sdhci.h +1 -4
@@ -111,11 +111,8 @@ typedef struct SDHCIState SDHCIState;/* * Controller does not provide transfer-complete interrupt when not * busy. -* -* NOTE: This definition is taken out of Linux kernel and so the -* original bit number is preserved */ -#define SDHCI_QUIRK_NO_BUSY_IRQ BIT(14) +#define SDHCI_QUIRK_NO_BUSY_IRQ BIT(0)#define TYPE_PCI_SDHCI "sdhci-pci" DECLARE_INSTANCE_CHECKER(SDHCIState, PCI_SDHCI,
Signature · 1 line
2.53.0
PATCH v4 6/10 hw/sd: sdhci: Honor i.MX uSDHC vendor clock gates
In reply to Bin MengU-Boot enables i.MX uSDHC clocks through VEND_SPEC, so checking only the standard SDHCI clock-control bits drops commands and prevents firmware from loading its kernel from the SD card.
Present vendor gates to the common clock check during uSDHC command writes, then restore the guest clock register. Retain the standard clock path used by Linux without adding vendor quirks to generic code. Report SDSTB and handle partial vendor accesses in uSDHC MMIO handlers.
Reference: IMX6ULRM (Rev.2), sections 56.8.10, 56.8.12 and 56.8.26
https://www.nxp.com/webapp/Download?colCode=IMX6ULRM
---
(no changes since v3)
Changes in v3:
- Translate vendor gates in uSDHC MMIO instead of a generic quirk
- Preserve the standard clock path used by direct Linux boot
- Handle partial vendor accesses and report SDSTB in uSDHC reads
- Migrate the vendor register in an optional subsection
hw/sd/sdhci.c | 93 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 13 deletions(-)
hw/sd/sdhci.c +80 -13
@@ -1604,6 +1604,24 @@ static const VMStateDescription sdhci_hostctl2_vmstate = { }, }; +static bool sdhci_vendor_spec_vmstate_needed (void *opaque) +{ +SDHCIState *s = opaque; + +return s->vendor_spec; +} + +static const VMStateDescription sdhci_vendor_spec_vmstate = { + .name ="sdhci/vendor-spec" , + .version_id =1 , + .minimum_version_id =1 , + .needed = sdhci_vendor_spec_vmstate_needed, + .fields = (const VMStateField []) { +VMSTATE_UINT16 (vendor_spec, SDHCIState), +VMSTATE_END_OF_LIST () + }, +}; +static bool sdhci_pending_insert_vmstate_needed (void *opaque) {SDHCIState *s = opaque;
@@ -1623,6 +1641,7 @@ static int sdhci_pre_load(void *opaque)SDHCIState *s = opaque; s->hostctl2 =0 ; + s->vendor_spec =0 ; s->sdma_boundary_paused = false;return 0 ; }
@@ -1698,6 +1717,7 @@ const VMStateDescription sdhci_vmstate = { }, .subsections = (const VMStateDescription * const []) { &sdhci_hostctl2_vmstate, + &sdhci_vendor_spec_vmstate, &sdhci_pending_insert_vmstate, &sdhci_sdma_boundary_paused_vmstate,NULL
@@ -1801,6 +1821,10 @@ static void sdhci_bus_class_init(ObjectClass *klass, const void *data)#define ESDHC_VENDOR_SPEC 0xc0#define ESDHC_FRC_SDCLK_ON (1 << 8) +#define ESDHC_VENDOR_IPGEN (1 << 11) +#define ESDHC_VENDOR_HCKEN (1 << 12) +#define ESDHC_VENDOR_PEREN (1 << 13) +#define ESDHC_VENDOR_CKEN (1 << 14)#define ESDHC_DLL_CTRL 0x60
@@ -2051,12 +2075,67 @@ static void fsl_esdhc_le_init(Object *obj)qdev_prop_set_uint8 (dev,"sd-spec-version" ,2 ); } +static bool usdhc_vendor_clocks_on (SDHCIState *s) +{ +uint16_t clocks =ESDHC_VENDOR_IPGEN |ESDHC_VENDOR_HCKEN | +ESDHC_VENDOR_PEREN |ESDHC_VENDOR_CKEN ; + +return (s->vendor_spec & clocks) == clocks; +} + +static uint64_t usdhc_read (void *opaque,hwaddr offset,unsigned size) +{ +SDHCIState *s =SYSBUS_SDHCI (opaque); +uint32_t value; + +switch (offset & ~3 ) { +case SDHC_PRNSTS : + value =esdhc_read (opaque,SDHC_PRNSTS ,4 ); +if ((s->vendor_spec & (ESDHC_VENDOR_IPGEN |ESDHC_VENDOR_HCKEN )) == + (ESDHC_VENDOR_IPGEN |ESDHC_VENDOR_HCKEN )) { + value |=ESDHC_PRNSTS_SDSTB ; + } +break ; +case ESDHC_VENDOR_SPEC : + value = s->vendor_spec; +break ; +default : +return esdhc_read (opaque, offset, size); + } +return extract32 (value, (offset &3 ) *8 , size *8 ); +} +static void usdhc_write (void *opaque,hwaddr offset,uint64_t val,unsigned size) {SDHCIState *s =SYSBUS_SDHCI (opaque);uint32_t value = (uint32_t )val; +if ((offset & ~3 ) ==ESDHC_VENDOR_SPEC ) { + value =deposit32 (s->vendor_spec, (offset &3 ) *8 , + size *8 , value); +esdhc_write (opaque,ESDHC_VENDOR_SPEC , value,4 ); +return ; + } +if ((offset & ~3 ) ==SDHC_CLKCON ) { +esdhc_write (opaque, offset, val, size); +return ; + } +if ((offset & ~3 ) ==SDHC_TRNMOD ) { +uint16_t clkcon = s->clkcon; + +/* Present vendor clocks to the common command check */ +if (usdhc_vendor_clocks_on (s)) { + s->clkcon |=SDHC_CLOCK_CHK_MASK ; + } +if (offset ==SDHC_TRNMOD && size ==4 ) { + val |= s->trnmod; + } +sdhci_write (opaque, offset, val, size); + s->clkcon = clkcon; +return ; + } +switch (offset) {case ESDHC_MIX_CTRL :/*
@@ -2076,18 +2155,6 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) s->trnmod = value &UINT16_MAX ;break ; -case SDHC_TRNMOD : -/* -* Similar to above, but this time a write to "Command -* Register" will be translated into a 4-byte write to -* "Transfer Mode register" where lower 16-bit of value would -* be set to zero. So what we do is fill those bits with -* cached value from s->trnmod and let the SDHCI -* infrastructure handle the rest -*/ -sdhci_write (opaque, offset, val | s->trnmod, size); -break ; -default :esdhc_write (opaque, offset, val, size);break ;
@@ -2095,7 +2162,7 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) }static const MemoryRegionOps usdhc_mmio_ops = { - .read = esdhc_read, + .read = usdhc_read, .write = usdhc_write, .valid = { .min_access_size =1 ,
Signature · 1 line
2.53.0
Re: [PATCH v4 06/10] hw/sd: sdhci: Honor i.MX uSDHC vendor clock gates
Am 14. Oktober 2026 04:55:56 UTC schrieb Bin Meng <[email protected]>:
Quoted 84 lines
U-Boot enables i.MX uSDHC clocks through
VEND_SPEC, so checking only the standard SDHCI clock-control bits drops commands and prevents firmware from loading its kernel from the SD card.Present vendor gates to the common clock check during uSDHC command writes, then restore the guest clock register. Retain the standard clock path used by Linux without adding vendor quirks to generic code. Report SDSTB and handle partial vendor accesses in uSDHC MMIO handlers.
Reference: IMX6ULRM (Rev.2), sections 56.8.10, 56.8.12 and 56.8.26
https://www.nxp.com/webapp/Download?colCode=IMX6ULRMSigned-off-by Bin Meng <[email protected]>---
(no changes since v3)
Changes in v3:
- Translate vendor gates in uSDHC MMIO instead of a generic quirk
- Preserve the standard clock path used by direct Linux boot
- Handle partial vendor accesses and report SDSTB in uSDHC reads
- Migrate the vendor register in an optional subsection
hw/sd/sdhci.c| 93 ++++++++++++++++++++++++++++++++++++++++++++-------1 file changed, 80 insertions(+), 13 deletions(-)hw/sd/sdhci.c +24
-0@@ -1604,6 +1604,24 @@ static const VMStateDescription sdhci_hostctl2_vmstate = { }, }; +static bool sdhci_vendor_spec_vmstate_needed (void *opaque) +{ +SDHCIState *s = opaque; + +return s->vendor_spec; +} + +static const VMStateDescription sdhci_vendor_spec_vmstate = { + .name ="sdhci/vendor-spec" , + .version_id =1 , + .minimum_version_id =1 , + .needed = sdhci_vendor_spec_vmstate_needed, + .fields = (const VMStateField []) { +VMSTATE_UINT16 (vendor_spec, SDHCIState), +VMSTATE_END_OF_LIST () + }, +}; +static bool sdhci_pending_insert_vmstate_needed (void *opaque) {SDHCIState *s = opaque;@@ -1623,6 +1641,7 @@ static int sdhci_pre_load(void *opaque)SDHCIState *s = opaque; s->hostctl2 =0 ; + s->vendor_spec =0 ; s->sdma_boundary_paused = false;return 0 ; }@@ -1698,6 +1717,7 @@ const VMStateDescription sdhci_vmstate = { }, .subsections = (const VMStateDescription * const []) { &sdhci_hostctl2_vmstate, + &sdhci_vendor_spec_vmstate, &sdhci_pending_insert_vmstate, &sdhci_sdma_boundary_paused_vmstate,NULL @@ -1801,6 +1821,10 @@ static void sdhci_bus_class_init(ObjectClass *klass, const void *data)#define ESDHC_VENDOR_SPEC 0xc0#define ESDHC_FRC_SDCLK_ON (1 << 8) +#define ESDHC_VENDOR_IPGEN (1 << 11) +#define ESDHC_VENDOR_HCKEN (1 << 12) +#define ESDHC_VENDOR_PEREN (1 << 13) +#define ESDHC_VENDOR_CKEN (1 << 14)#define ESDHC_DLL_CTRL 0x60
hw/sd/sdhci.c static void fsl_esdhc_le_init(Object *obj) · line 2078
Quoted 4 lines
hw/sd/sdhci.c +1
-0@@ -2051,12 +2075,67 @@ static void fsl_esdhc_le_init(Object *obj)qdev_prop_set_uint8 (dev,"sd-spec-version" ,2 ); } +static bool usdhc_vendor_clocks_on (SDHCIState *s)
s could be pointer to const (though this isn't very common in QEMU, so no blocker).
hw/sd/sdhci.c static void fsl_esdhc_le_init(Object *obj) · line 2088
Quoted 10 lines
hw/sd/sdhci.c +10
-0+{ +uint16_t clocks =ESDHC_VENDOR_IPGEN |ESDHC_VENDOR_HCKEN | +ESDHC_VENDOR_PEREN |ESDHC_VENDOR_CKEN ; + +return (s->vendor_spec & clocks) == clocks; +} + +static uint64_t usdhc_read (void *opaque,hwaddr offset,unsigned size) +{ +SDHCIState *s =SYSBUS_SDHCI (opaque);
No need for an explicit cast.
Quoted 39 lines
hw/sd/sdhci.c +19
-0+uint32_t value; + +switch (offset & ~3 ) { +case SDHC_PRNSTS : + value =esdhc_read (opaque,SDHC_PRNSTS ,4 ); +if ((s->vendor_spec & (ESDHC_VENDOR_IPGEN |ESDHC_VENDOR_HCKEN )) == + (ESDHC_VENDOR_IPGEN |ESDHC_VENDOR_HCKEN )) { + value |=ESDHC_PRNSTS_SDSTB ; + } +break ; +case ESDHC_VENDOR_SPEC : + value = s->vendor_spec; +break ; +default : +return esdhc_read (opaque, offset, size); + } +return extract32 (value, (offset &3 ) *8 , size *8 ); +} +static void
usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size){ SDHCIState *s = SYSBUS_SDHCI(opaque); uint32_t value = (uint32_t)val;hw/sd/sdhci.c +14
-0+if ((offset & ~3 ) ==ESDHC_VENDOR_SPEC ) { + value =deposit32 (s->vendor_spec, (offset &3 ) *8 , + size *8 , value); +esdhc_write (opaque,ESDHC_VENDOR_SPEC , value,4 ); +return ; + } +if ((offset & ~3 ) ==SDHC_CLKCON ) { +esdhc_write (opaque, offset, val, size); +return ; + } +if ((offset & ~3 ) ==SDHC_TRNMOD ) { +uint16_t clkcon = s->clkcon; + +/* Present vendor clocks to the common command check */
hw/sd/sdhci.c static void fsl_esdhc_le_init(Object *obj) · line 2137
Quoted 10 lines
hw/sd/sdhci.c +10
-0+if (usdhc_vendor_clocks_on (s)) { + s->clkcon |=SDHC_CLOCK_CHK_MASK ; + } +if (offset ==SDHC_TRNMOD && size ==4 ) { + val |= s->trnmod; + } +sdhci_write (opaque, offset, val, size); + s->clkcon = clkcon; +return ; + }
Any reason why these if statements aren't incorporated into the switch statement below?
Best regards,
Bernhard
Quoted 32 lines
hw/sd/sdhci.c +2
-13+switch (offset) {case ESDHC_MIX_CTRL :/* @@ -2076,18 +2155,6 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) s->trnmod = value &UINT16_MAX ;break ; -case SDHC_TRNMOD : -/* -* Similar to above, but this time a write to "Command -* Register" will be translated into a 4-byte write to -* "Transfer Mode register" where lower 16-bit of value would -* be set to zero. So what we do is fill those bits with -* cached value from s->trnmod and let the SDHCI -* infrastructure handle the rest -*/ -sdhci_write (opaque, offset, val | s->trnmod, size); -break ; -default :esdhc_write (opaque, offset, val, size);break ;@@ -2095,7 +2162,7 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) }static const MemoryRegionOps usdhc_mmio_ops = { - .read = esdhc_read, + .read = usdhc_read, .write = usdhc_write, .valid = { .min_access_size =1 ,
PATCH v4 7/10 hw/sd: sdhci: Preserve uSDHC status enables for U-Boot
In reply to Bin MengU-Boot's i.MX uSDHC probe calls fsl_esdhc_init(), which resets the controller and programs INT_STATUS_EN. esdhc_init_common() is then called, which issues a second RSTA and only clears the BRR/BWR status enables afterward.
The generic SDHCI reset clears QEMU's normal and error status-enable fields. Consequently, the second RSTA removes command-complete, transfer-complete, DMA, and error enables. Commands still reach the card, but QEMU does not latch completion status, so U-Boot times out and fails to expose an MMC block device.
Preserve the normal and error status-enable fields around RSTA in the i.MX uSDHC register path. Signal enables still follow the generic reset because U-Boot disables interrupt signaling and polls INT_STATUS.
The IMX6ULRM describes RSTA as clearing read-write state and does not document INT_STATUS_EN as reset-persistent. Treat this as compatibility with U-Boot's established two-reset initialization sequence rather than as behavior directly specified by the reference manual.
---
(no changes since v3)
Changes in v3:
- Preserve status enables for byte, halfword and word RSTA writes
- Integrate RSTA handling with the uSDHC clock translation
hw/sd/sdhci.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
hw/sd/sdhci.c +16 -0
@@ -1831,6 +1831,7 @@ static void sdhci_bus_class_init(ObjectClass *klass, const void *data)#define ESDHC_TUNING_CTRL 0xcc#define ESDHC_TUNE_CTRL_STATUS 0x68#define ESDHC_WTMK_LVL 0x44 +#define ESDHC_SYSCTL_RSTA BIT(24)/* Undocumented register used by guests working around erratum ERR004536 */ #define ESDHC_UNDOCUMENTED_REG27 0x6c
@@ -2118,7 +2119,22 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)return ; }if ((offset & ~3 ) ==SDHC_CLKCON ) { +uint16_t norintstsen = s->norintstsen; +uint16_t errintstsen = s->errintstsen; +bool reset_all = (val << ((offset &3 ) *8 )) &ESDHC_SYSCTL_RSTA ; +esdhc_write (opaque, offset, val, size); +if (reset_all) { +/* +* U-Boot programs INT_STATUS_EN before issuing another RSTA. +* Preserve status enables for this initialization sequence. +* Signal enables and pending status retain generic reset +* semantics. This compatibility behavior is not specified +* by the reference manual. +*/ + s->norintstsen = norintstsen; + s->errintstsen = errintstsen; + }return ; }if ((offset & ~3 ) ==SDHC_TRNMOD ) {
Signature · 1 line
2.53.0
PATCH v4 8/10 hw/sd: sdhci: Skip SDMA boundary stops for eSDHC and uSDHC
In reply to Bin MengThe common SDHCI core pauses SDMA at the selected buffer boundary and waits for software to rewrite the system address. Freescale eSDHC and i.MX uSDHC expose BLKATTR without that programmable boundary field.
T4240 eSDHC transfers the complete block-count times block-size range from DSADDR, and DINT reports successful DMA completion. Its BLKSIZE is 12 bits and bits 15:12 are reserved. i.MX6UL uSDHC also completes the contiguous transfer, but uses a 13-bit block-size field with bits 15:13 reserved. Neither needs the synthetic 512 KiB boundary pause.
Enable the no-boundary quirk for both eSDHC byte orders and uSDHC. Remove the artificial boundary encoding in their shared translation. Keep the standard SDHCI boundary handshake, block-gap stops and DMA error handling unchanged.
References:
- T4240RM (Rev.4), section 15.3.2, 15.3.13 and 15.4.1.3
https://www.nxp.com/webapp/Download?colCode=T4240RM
- IMX6ULRM (Rev.2), section 56.8.2 and 56.8.13
https://www.nxp.com/webapp/Download?colCode=IMX6ULRM
---
(no changes since v3)
Changes in v3:
- Enable the no-boundary quirk for both eSDHC byte orders
- Remove the synthetic 512 KiB boundary field translation
include/hw/sd/sdhci.h | 5 +++++ hw/sd/sdhci.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 21 deletions(-)
include/hw/sd/sdhci.h +5 -0
@@ -113,6 +113,11 @@ typedef struct SDHCIState SDHCIState;* busy. */ #define SDHCI_QUIRK_NO_BUSY_IRQ BIT(0) +/* +* Controller completes contiguous SDMA transfers without the standard +* intermediate buffer-boundary stop and address-update handshake +*/ +#define SDHCI_QUIRK_NO_SDMA_BOUNDARY BIT(1)#define TYPE_PCI_SDHCI "sdhci-pci" DECLARE_INSTANCE_CHECKER(SDHCIState, PCI_SDHCI,
hw/sd/sdhci.c +21 -21
94 lines not on this page · raw message
Signature · 1 line
2.53.0
PATCH v4 9/10 docs/system/arm: Document MCIMX6UL-EVK Buildroot boot
In reply to Bin MengProvide verified instructions for U-Boot and direct Linux boot using Buildroot images.
---
(no changes since v3)
Changes in v3:
- Document the RAM limits and firmware geometry rounding
docs/system/arm/mcimx6ul-evk.rst | 72 ++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
docs/system/arm/mcimx6ul-evk.rst +72 -0
@@ -3,3 +3,75 @@ NXP MCIMX6UL-EVK (``mcimx6ul-evk``) The ``mcimx6ul-evk`` machine models the NXP i.MX6UltraLite Evaluation Kit MCIMX6UL-EVK development board. It has a single Cortex-A7 CPU. + +The minimum RAM size is 16 MiB and the maximum is 2 GiB. +The MMDC geometry reports the largest power-of-two capacity +not exceeding the configured RAM size to firmware. Direct Linux +boot uses the full configured RAM size. + +Booting Buildroot images +------------------------ + +Build the SD card image with the tested Buildroot version: + +.. code-block:: bash + + $ git clone https://gitlab.com/buildroot.org/buildroot.git + $ cd buildroot + $ git checkout 2026.05 + $ make imx6ulevk_defconfig + $ make + +The following examples use images generated by Buildroot:: + + IMAGES=/path/to/buildroot/output/images + QEMU_BUILD=/path/to/qemu/build + +The generated raw ``sdcard.img`` is about 84 MiB, which is not a capacity +supported by QEMU's SD card model. Resize the image in place to 128 MiB:: + + "$QEMU_BUILD/qemu-img" resize -f raw "$IMAGES/sdcard.img" 128M + +This modifies the Buildroot output image; rebuilding the image restores its +original size. + +The SD card must be attached to USDHC2 with ``index=1``. It is consequently +named ``mmc1`` by U-Boot and ``mmcblk1`` by Linux. The first partition contains +the kernel and device tree, while the second partition contains the root file +system. + +U-Boot boot +~~~~~~~~~~~ + +The machine does not model the i.MX6UL Boot ROM or its SPL loading sequence. +Load U-Boot proper at its linked address:: + +.. code-block:: bash + + "$QEMU_BUILD/qemu-system-arm" \ + -M mcimx6ul-evk -m 512M \ + -device loader,file="$IMAGES/u-boot.bin",addr=0x87800000,cpu-num=0 \ + -drive file="$IMAGES/sdcard.img",if=sd,index=1,format=raw \ + -nographic + +The default Buildroot U-Boot environment selects ``mmc1``, loads ``zImage`` +and ``imx6ul-14x14-evk.dtb`` from the first partition, and starts Linux with +``/dev/mmcblk1p2`` as the root file system. A ``bad CRC`` warning while loading +an uninitialized persistent U-Boot environment is expected; U-Boot continues +with its compiled-in defaults. + +Direct Linux boot +~~~~~~~~~~~~~~~~~ + +QEMU can load the Buildroot kernel and device tree directly. The kernel then +mounts the second SD card partition as its root file system:: + +.. code-block:: bash + + "$QEMU_BUILD/qemu-system-arm" \ + -M mcimx6ul-evk -m 512M \ + -kernel "$IMAGES/zImage" \ + -dtb "$IMAGES/imx6ul-14x14-evk.dtb" \ + -append "console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw" \ + -drive file="$IMAGES/sdcard.img",if=sd,index=1,format=raw \ + -nographic
Signature · 1 line
2.53.0
Re: [PATCH v4 09/10] docs/system/arm: Document MCIMX6UL-EVK Buildroot boot
Am 14. Oktober 2026 04:55:59 UTC schrieb Bin Meng <[email protected]>:
Quoted 55 lines
Provide verified instructions for U-Boot and direct Linux boot using Buildroot images.
Signed-off-by Bin Meng <[email protected]>---
(no changes since v3)
Changes in v3:
- Document the RAM limits and firmware geometry rounding
docs/system/arm/mcimx6ul-evk.rst| 72 ++++++++++++++++++++++++++++++++1 file changed, 72 insertions(+)docs/system/arm/mcimx6ul-evk.rst +0
-0@@ -3,3 +3,75 @@ NXP MCIMX6UL-EVK (``mcimx6ul-evk``)The ``mcimx6ul-evk`` machine models the NXP i.MX6UltraLite Evaluation Kit MCIMX6UL-EVK development board. It has a single Cortex-A7 CPU.
docs/system/arm/mcimx6ul-evk.rst +32
-0+ +The minimum RAM size is 16 MiB and the maximum is 2 GiB. +The MMDC geometry reports the largest power-of-two capacity +not exceeding the configured RAM size to firmware. Direct Linux +boot uses the full configured RAM size. + +Booting Buildroot images +------------------------ + +Build the SD card image with the tested Buildroot version: + +.. code-block:: bash + + $ git clone https://gitlab.com/buildroot.org/buildroot.git + $ cd buildroot + $ git checkout 2026.05 + $ make imx6ulevk_defconfig + $ make + +The following examples use images generated by Buildroot:: + + IMAGES=/path/to/buildroot/output/images + QEMU_BUILD=/path/to/qemu/build + +The generated raw ``sdcard.img`` is about 84 MiB, which is not a capacity +supported by QEMU's SD card model. Resize the image in place to 128 MiB:: + + "$QEMU_BUILD/qemu-img" resize -f raw "$IMAGES/sdcard.img" 128M + +This modifies the Buildroot output image; rebuilding the image restores its +original size. +
docs/system/arm/mcimx6ul-evk.rst NXP MCIMX6UL-EVK (``mcimx6ul-evk``) · line 47
Quoted 10 lines
docs/system/arm/mcimx6ul-evk.rst +10
-0+The SD card must be attached to USDHC2 with ``index=1``. It is consequently +named ``mmc1`` by U-Boot and ``mmcblk1`` by Linux. The first partition contains +the kernel and device tree, while the second partition contains the root file +system. + +U-Boot boot +~~~~~~~~~~~ + +The machine does not model the i.MX6UL Boot ROM or its SPL loading sequence. +Load U-Boot proper at its linked address::
Extra ':' which prevents the code block being rendered correctly. Removing it fixes it.
docs/system/arm/mcimx6ul-evk.rst NXP MCIMX6UL-EVK (``mcimx6ul-evk``) · line 52
Quoted 5 lines
docs/system/arm/mcimx6ul-evk.rst +5
-0+ +.. code-block:: bash + + "$QEMU_BUILD/qemu-system-arm" \ + -M mcimx6ul-evk -m 512M \
The -m 512M will become redundant once my imx cleanup series lands. Same in the command below.
Quoted 5 lines
docs/system/arm/mcimx6ul-evk.rst +5
-0+ -device loader,file="$IMAGES/u-boot.bin",addr=0x87800000,cpu-num=0 \ + -drive file="$IMAGES/sdcard.img",if=sd,index=1,format=raw \ + -nographic + +The default Buildroot U-Boot environment selects ``mmc1``, loads ``zImage``
docs/system/arm/mcimx6ul-evk.rst NXP MCIMX6UL-EVK (``mcimx6ul-evk``) · line 67
Quoted 10 lines
docs/system/arm/mcimx6ul-evk.rst +10
-0+and ``imx6ul-14x14-evk.dtb`` from the first partition, and starts Linux with +``/dev/mmcblk1p2`` as the root file system. A ``bad CRC`` warning while loading +an uninitialized persistent U-Boot environment is expected; U-Boot continues +with its compiled-in defaults. + +Direct Linux boot +~~~~~~~~~~~~~~~~~ + +QEMU can load the Buildroot kernel and device tree directly. The kernel then +mounts the second SD card partition as its root file system::
Extra ':' here, too.
Best regards,
Bernhard
Quoted 10 lines
docs/system/arm/mcimx6ul-evk.rst +10
-0+ +.. code-block:: bash + + "$QEMU_BUILD/qemu-system-arm" \ + -M mcimx6ul-evk -m 512M \ + -kernel "$IMAGES/zImage" \ + -dtb "$IMAGES/imx6ul-14x14-evk.dtb" \ + -append "console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw" \ + -drive file="$IMAGES/sdcard.img",if=sd,index=1,format=raw \ + -nographic
Bernhard Beschow
Reviewed-byRe: [PATCH v4 09/10] docs/system/arm: Document MCIMX6UL-EVK Buildroot boot
Am 22. Oktober 2026 22:50:11 UTC schrieb Bernhard Beschow <[email protected]>:
Quoted 88 lines
Am 14. Oktober 2026 04:55:59 UTC schrieb Bin Meng <[email protected]>:
Quoted 55 lines
Provide verified instructions for U-Boot and direct Linux boot using Buildroot images.
Signed-off-by Bin Meng <[email protected]>---
(no changes since v3)
Changes in v3:
- Document the RAM limits and firmware geometry rounding
docs/system/arm/mcimx6ul-evk.rst| 72 ++++++++++++++++++++++++++++++++1 file changed, 72 insertions(+)docs/system/arm/mcimx6ul-evk.rst +0
-0@@ -3,3 +3,75 @@ NXP MCIMX6UL-EVK (``mcimx6ul-evk``)The ``mcimx6ul-evk`` machine models the NXP i.MX6UltraLite Evaluation Kit MCIMX6UL-EVK development board. It has a single Cortex-A7 CPU.
docs/system/arm/mcimx6ul-evk.rst +32
-0+ +The minimum RAM size is 16 MiB and the maximum is 2 GiB. +The MMDC geometry reports the largest power-of-two capacity +not exceeding the configured RAM size to firmware. Direct Linux +boot uses the full configured RAM size. + +Booting Buildroot images +------------------------ + +Build the SD card image with the tested Buildroot version: + +.. code-block:: bash + + $ git clone https://gitlab.com/buildroot.org/buildroot.git + $ cd buildroot + $ git checkout 2026.05 + $ make imx6ulevk_defconfig + $ make + +The following examples use images generated by Buildroot:: + + IMAGES=/path/to/buildroot/output/images + QEMU_BUILD=/path/to/qemu/build + +The generated raw ``sdcard.img`` is about 84 MiB, which is not a capacity +supported by QEMU's SD card model. Resize the image in place to 128 MiB:: + + "$QEMU_BUILD/qemu-img" resize -f raw "$IMAGES/sdcard.img" 128M + +This modifies the Buildroot output image; rebuilding the image restores its +original size. +docs/system/arm/mcimx6ul-evk.rst NXP MCIMX6UL-EVK (``mcimx6ul-evk``) · line 47
Quoted 10 lines
docs/system/arm/mcimx6ul-evk.rst +10
-0+The SD card must be attached to USDHC2 with ``index=1``. It is consequently +named ``mmc1`` by U-Boot and ``mmcblk1`` by Linux. The first partition contains +the kernel and device tree, while the second partition contains the root file +system. + +U-Boot boot +~~~~~~~~~~~ + +The machine does not model the i.MX6UL Boot ROM or its SPL loading sequence. +Load U-Boot proper at its linked address::Extra ':' which prevents the code block being rendered correctly. Removing it fixes it.
docs/system/arm/mcimx6ul-evk.rst NXP MCIMX6UL-EVK (``mcimx6ul-evk``) · line 52
Quoted 5 lines
docs/system/arm/mcimx6ul-evk.rst +5
-0+ +.. code-block:: bash + + "$QEMU_BUILD/qemu-system-arm" \ + -M mcimx6ul-evk -m 512M \The
-m 512Mwill become redundant once my imx cleanup series lands. Same in the command below.Quoted 9 lines
docs/system/arm/mcimx6ul-evk.rst +9
-0+ -device loader,file="$IMAGES/u-boot.bin",addr=0x87800000,cpu-num=0 \ + -drive file="$IMAGES/sdcard.img",if=sd,index=1,format=raw \ + -nographic + +The default Buildroot U-Boot environment selects ``mmc1``, loads ``zImage`` +and ``imx6ul-14x14-evk.dtb`` from the first partition, and starts Linux with +``/dev/mmcblk1p2`` as the root file system. A ``bad CRC`` warning while loading +an uninitialized persistent U-Boot environment is expected; U-Boot continues +with its compiled-in defaults.
Quoted 8 lines
docs/system/arm/mcimx6ul-evk.rst NXP MCIMX6UL-EVK (``mcimx6ul-evk``) · line 67
Quoted 6 lines
docs/system/arm/mcimx6ul-evk.rst +6
-0+ +Direct Linux boot +~~~~~~~~~~~~~~~~~ + +QEMU can load the Buildroot kernel and device tree directly. The kernel then +mounts the second SD card partition as its root file system::Extra ':' here, too.
With the above fixes:
Quoted 14 lines
Best regards,
BernhardQuoted 10 lines
docs/system/arm/mcimx6ul-evk.rst +10
-0+ +.. code-block:: bash + + "$QEMU_BUILD/qemu-system-arm" \ + -M mcimx6ul-evk -m 512M \ + -kernel "$IMAGES/zImage" \ + -dtb "$IMAGES/imx6ul-14x14-evk.dtb" \ + -append "console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw" \ + -drive file="$IMAGES/sdcard.img",if=sd,index=1,format=raw \ + -nographic
PATCH v4 10/10 tests/functional/arm: Add MCIMX6UL-EVK boot tests
In reply to Bin MengThe MCIMX6UL-EVK machine supports loading U-Boot proper with the generic loader and booting Linux directly, but neither path has functional coverage.
Add a versioned Buildroot asset containing U-Boot, a Linux kernel, the board DTB, and a 128 MiB SD card image. Exercise both boot paths and verify that they reach the Buildroot login prompt.
---
Changes in v4:
- Make the functional test script executable
MAINTAINERS | 1 + tests/functional/arm/meson.build | 2 + tests/functional/arm/test_mcimx6ul_evk.py | 69 +++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100755 tests/functional/arm/test_mcimx6ul_evk.py
MAINTAINERS +1 -0
@@ -922,6 +922,7 @@ F: include/hw/arm/fsl-imx6ul.h F: include/hw/display/imx6ul_lcdif.h F: include/hw/misc/imx6ul_ccm.h F: docs/system/arm/mcimx6ul-evk.rst +F: tests/functional/arm/test_mcimx6ul_evk.py MCIMX7D SABRE / i.MX7 M: Peter Maydell <[email protected]>
tests/functional/arm/meson.build +2 -0
@@ -20,6 +20,7 @@ test_arm_timeouts = { 'bpim2u' : 500, 'collie' : 180, 'cubieboard' : 360, + 'mcimx6ul_evk' : 240, 'orangepi' : 540, 'quanta_gsj' : 240, 'raspi2' : 120,
@@ -59,6 +60,7 @@ tests_arm_system_thorough = [ 'emcraft_sf2', 'integratorcp', 'max78000fthr', + 'mcimx6ul_evk', 'microbit', 'orangepi', 'quanta_gsj',
tests/functional/arm/test_mcimx6ul_evk.py new file +69 -0
69 lines not on this page · raw message
Signature · 1 line
2.53.0
Quoted 13 lines · Bin Meng
The mcimx6ul-evk machine can boot Linux directly, but it cannot run the U-Boot proper produced by Buildroot far enough to load a kernel from its SD card. Early U-Boot boot test accesses currently abort or observe placeholder values, and the i.MX uSDHC model exposes several issues.
This series lets an unmodified Buildroot 2026.05 U-Boot 2024.07 image run on mcimx6ul-evk, load zImage and imx6ul-14x14-evk.dtb from USDHC2, start Linux, mount the SD card root file system, and reach the Buildroot login prompt. It also documents and tests the existing direct Linux boot path.
Quoted 8 lines
Patches 1 through 4 provide the minimum early-firmware-visible state. Patches 5 through 8 address i.MX uSDHC behavior needed by U-Boot. The last two patches document both boot paths and add functional tests for U-Boot and direct Linux boot.
This series is based on:
<[email protected]> as the sdhci changes have conflicts.
I've reviewed patch 1. If imx and sdcard people review the other patches, I'm happy to take it via target-arm.next (ping me at that point), but I don't currently have the bandwidth to review large Arm SoC/board model patchseries myself.
thanks
-- PMM