Signed-off-by: Jean-Christophe Dubois <j...@tribudubois.net>
---

Changes since v1:
 * Not present on v1.

 hw/arm/sabrelite.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c
index 8db9bbc..237dfa1 100644
--- a/hw/arm/sabrelite.c
+++ b/hw/arm/sabrelite.c
@@ -70,6 +70,15 @@ static void sabrelite_init(MachineState *machine)
     memory_region_add_subregion(get_system_memory(), FSL_IMX6_MMDC_ADDR,
                                 &s->ram);
 
+    {
+        /* Add the sst25vf016b NOR FLASH memory to first SPI */
+        SSIBus *spi = (SSIBus *)qdev_get_child_bus(DEVICE(&s->soc.spi[0]),
+                                                   "spi");
+        DeviceState *flash_dev = ssi_create_slave(spi, "sst25vf016b");
+        qemu_irq cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
+        sysbus_connect_irq(SYS_BUS_DEVICE(&s->soc.spi[0]), 1, cs_line);
+    }
+
     sabrelite_binfo.ram_size = machine->ram_size;
     sabrelite_binfo.kernel_filename = machine->kernel_filename;
     sabrelite_binfo.kernel_cmdline = machine->kernel_cmdline;
-- 
2.5.0


Reply via email to