Hi Pratyush, On Mon, 3 Aug 2020 at 05:34, Pratyush Yadav <p.ya...@ti.com> wrote: > > Hi Simon, > > On 16/06/20 09:12PM, Simon Glass wrote: > > Hi Pratyush, > > > > On Thu, 11 Jun 2020 at 13:45, Pratyush Yadav <p.ya...@ti.com> wrote: > > > > > > initr_dm_devices() is called somewhere after board_init(). It can be > > > used by drivers to initialize devices to some default bootup state. > > > Those devices might use mmio read/write operations to perform the > > > initialization. > > > > > > One such example is the mux devices. The mux framework initializes the > > > muxes to their default state after idle state in > > > mux_uclass_post_probe(). One type of mux controller is the MMIO mux > > > controller. Initializing a MMIO mux to idle state can require a mmio > > > read and write operation. > > > > > > With memio disabled, the reads return 0 and the writes go off into the > > > void. This makes it impossible to initialize muxes to their idle state > > > on boot, and consequentially makes it impossible to test that in > > > sandbox. > > > > > > These same initializations work fine on actual hardware (tested on TI > > > J721E EVM). So, enable memio operations on boot so devices like mux can > > > perform whatever initialization they need. state_reset_for_test() will > > > disable it before running tests so tests still need to enable memio > > > manually. > > > > We have a similar issue with PCI and we only enable it when needed. > > Can we do something similar here? > > I went and looked, but I can't figure out how we do it for PCI. Any > pointers?
Yes it is enable_pci_map in arch/sandbox/cpu/cpu.c Regards, Simon