sandbox: Move PCI EA space out of RAM

The address chosen for testing this feature is 1MB which is part of the
sandbox RAM. When devices access this, e.g. with map_sysmem(), the
memory is mapped to a PCI device. Any changes then apply to that device
and are not written to memory. Reads also come from the device.

It is not safe to use RAM space in this way.

A symptom that something is wrong is the log message:

   map_physmem: Warning: partial map at 100000, wanted 4, got 2000

Move the memory out of the way and document it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 21ebbafde8 ("test: dm: Add a test for PCI Enhanced Allocation")
This commit is contained in:
Simon Glass
2025-08-17 13:58:02 -06:00
parent dcfec7fd37
commit 9932bb407a
2 changed files with 5 additions and 4 deletions

View File

@@ -38,10 +38,10 @@ struct unit_test_state;
#define SANDBOX_CLK_RATE 32768
/* Macros used to test PCI EA capability structure */
#define PCI_CAP_EA_BASE_LO0 0x00100000
#define PCI_CAP_EA_BASE_LO1 0x00110000
#define PCI_CAP_EA_BASE_LO2 0x00120000
#define PCI_CAP_EA_BASE_LO4 0x00140000
#define PCI_CAP_EA_BASE_LO0 0x20100000
#define PCI_CAP_EA_BASE_LO1 0x20110000
#define PCI_CAP_EA_BASE_LO2 0x20120000
#define PCI_CAP_EA_BASE_LO4 0x20140000
#define PCI_CAP_EA_BASE_HI2 0x00020000ULL
#define PCI_CAP_EA_BASE_HI4 0x00040000ULL
#define PCI_CAP_EA_SIZE_LO 0x0000ffff

View File

@@ -785,6 +785,7 @@ Addr Config Usage
200000 CONFIG_TRACE_EARLY_ADDR Early trace buffer (if enabled). Also used
400000 CONFIG_TEXT_BASE Load buffer for U-Boot (sandbox_spl only)
10000000 PCI address space (see test.dts)
20000000 PCI EA space (see PCI_CAP_EA_BASE_LO0)
ff000000 Memory-mapping tags start here
======== ======================== ===============================