From patchwork Thu Jun 11 19:45:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Yadav X-Patchwork-Id: 242151 List-Id: U-Boot discussion From: p.yadav at ti.com (Pratyush Yadav) Date: Fri, 12 Jun 2020 01:15:05 +0530 Subject: [PATCH v3 5/6] sandbox: Enable memio operations in board_init In-Reply-To: <20200611194506.7263-1-p.yadav@ti.com> References: <20200611194506.7263-1-p.yadav@ti.com> Message-ID: <20200611194506.7263-6-p.yadav@ti.com> 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. Signed-off-by: Pratyush Yadav --- board/sandbox/sandbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index 1372003018..d7eb207822 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -55,6 +55,8 @@ int board_init(void) if (IS_ENABLED(CONFIG_LED)) led_default_state(); + sandbox_set_enable_memio(true); + return 0; }