diff --git a/configs/samv71-xult/src/sam_bringup.c b/configs/samv71-xult/src/sam_bringup.c index 54bc01d9eb..16a62f8335 100644 --- a/configs/samv71-xult/src/sam_bringup.c +++ b/configs/samv71-xult/src/sam_bringup.c @@ -55,6 +55,12 @@ #include "samv71-xult.h" +#ifdef HAVE_ST25FL1 +#include +#include +#include "sam_qspi.h" +#endif + #ifdef HAVE_ROMFS # include #endif @@ -89,6 +95,10 @@ int sam_bringup(void) { +#ifdef HAVE_ST25FL1 + FAR struct qspi_dev_s *qspi; + FAR struct mtd_dev_s *mtd; +#endif int ret; #ifdef HAVE_MACADDR @@ -178,6 +188,31 @@ int sam_bringup(void) } #endif +#ifdef HAVE_ST25FL1 + /* Create an instance of the SAMV71 QSPI device driver */ + + qspi = sam_qspi_initialize(0); + if (!qspi) + { + SYSLOG("ERROR: sam_qspi_initialize failed\n"); + } + else + { + /* Use the QSPI device instance to initialize the + * ST25FL1 device. + */ + + mtd = st25fl1_initialize(qspi); + if (!mtd) + { + SYSLOG("ERROR: st25fl1_initialize failed\n"); + } + + /* And now do what with the ST25FL1 MTD device? */ +#warning Missing Logic + } +#endif + #ifdef HAVE_USBHOST /* Initialize USB host operation. sam_usbhost_initialize() starts a thread * will monitor for USB connection and disconnection events. diff --git a/configs/samv71-xult/src/samv71-xult.h b/configs/samv71-xult/src/samv71-xult.h index 8a1dba7a8d..53c548fa93 100644 --- a/configs/samv71-xult/src/samv71-xult.h +++ b/configs/samv71-xult/src/samv71-xult.h @@ -61,6 +61,7 @@ #define HAVE_NETWORK 1 #define HAVE_MACADDR 1 #define HAVE_MTDCONFIG 1 +#define HAVE_ST25FL1 1 #define HAVE_WM8904 1 #define HAVE_AUDIO_NULL 1 @@ -181,6 +182,16 @@ # undef HAVE_MTDCONFIG #endif +/* ST25FL1 QuadSPI FLASH */ + +#ifndef CONFIG_MTD_ST25FL1 +# undef HAVE_ST25FL1 +#endif + +#ifndef CONFIG_SAMV7_QSPI +# undef HAVE_ST25FL1 +#endif + /* Audio */ /* PCM/WM8904 driver */