]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/blobdiff - sw/app/rocon/appl_main.c
RoCoN: initial unfinished support for SPI connected Flash.
[fpga/lx-cpu1/lx-rocon.git] / sw / app / rocon / appl_main.c
index b5775ece756c3839abd8bbf2f1ef8d539981c62e..c7a146a23430d6c65b396d544b637df50bb448f8 100644 (file)
@@ -6,6 +6,10 @@
 #include "appl_version.h"
 #include "appl_fpga.h"
 
+#ifdef CONFIG_OC_MTD_DRV_SYSLESS
+#include <mtd_spi_drv.h>
+#endif
+
 #ifndef APPL_WITH_SIM_POSIX
 #include <hal_machperiph.h>
 #endif /*APPL_WITH_SIM_POSIX*/
@@ -63,6 +67,13 @@ ul_fd_t ul_fd4timeprog;
 #endif
 #endif /*APPL_WITH_ULAN*/
 
+#ifdef CONFIG_OC_MTD_DRV_SYSLESS
+struct mtd_spi_state_t mtd_spi_state = {
+  .spi_addr = 0x08,
+  .page_size = 256,
+};
+#endif
+
 uint32_t usn; /* uLAN/USB device serial number */
 
 int usb_enable_flag = 1;
@@ -411,6 +422,12 @@ int main()
   appl_distore_init();
 #endif /* APPL_WITH_DISTORE_EEPROM_USER */
 
+  /***********************************/
+  // SPI connected FLASH
+#ifdef CONFIG_OC_MTD_DRV_SYSLESS
+  mtd_spi_state.spi_drv = spi_find_drv(NULL, 0);
+#endif
+
   /***********************************/
   // Micro Windows GUI