Fix an issue in flash controller when BOOT_CLOCKS is false
authorAnton Blanchard <anton@linux.ibm.com>
Mon, 14 Dec 2020 05:54:07 +0000 (16:54 +1100)
committerAnton Blanchard <anton@ozlabs.org>
Mon, 14 Dec 2020 05:54:07 +0000 (16:54 +1100)
If BOOT_CLOCKS is false we currently get stuck in the flash
state machine. This patch from Ben fixes it.

Also fix an x state issue I see in icarus verilog where we need
to reset auto_state.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
spi_flash_ctrl.vhdl

index d2b49929d3e8aef00c2519be4511f911b5a80621..e34a7c0398028a5bd103cd8b053a29ebd8552571 100644 (file)
@@ -350,6 +350,7 @@ begin
         if rising_edge(clk) then
            if rst = '1' then
                 auto_last_addr <= (others => '0');
+               auto_state <= AUTO_BOOT;
            else
                 auto_state <= auto_next;
                 auto_cnt   <= auto_cnt_next;
@@ -429,6 +430,8 @@ begin
                     if cmd_ready = '1' then
                         auto_next <= AUTO_IDLE;
                     end if;
+                else
+                    auto_next <= AUTO_IDLE;
                 end if;
             when AUTO_IDLE =>
                 -- Access to the memory map only when manual CS isn't set