sama5d2-xult: add support for QSPI flash and nxffs
Add support for onboard qspi flash with nxffs fs Signed-off-by: Janne Rosberg <janne.rosberg@offcode.fi>
This commit is contained in:
parent
77df430f30
commit
7f48c185c8
@ -127,4 +127,18 @@ config SAMA5_SDMMC1_WIDTH_D1_D4
|
||||
default y
|
||||
depends on SAMA5_SDMMC1
|
||||
|
||||
config SAMA5_QSPI0_SIZE
|
||||
int "QSPI0 memory size in bytes"
|
||||
default 1073741824
|
||||
depends on SAMA5_QSPI0
|
||||
---help---
|
||||
Size of QSPI0 memory mapped area in bytes. Default: 1GB
|
||||
|
||||
config SAMA5_QSPI1_SIZE
|
||||
int "QSPI1 memory size in bytes"
|
||||
default 1073741824
|
||||
depends on SAMA5_QSPI1
|
||||
---help---
|
||||
Size of QSPI1 memory mapped area in bytes. Default: 1GB
|
||||
|
||||
endif # ARCH_BOARD_SAMA5D2_XULT
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <nuttx/usb/usbdev.h>
|
||||
#include <nuttx/usb/usbhost.h>
|
||||
#include <nuttx/usb/usbdev_trace.h>
|
||||
#include <nuttx/drivers/drivers.h>
|
||||
|
||||
#include "sama5d2-xult.h"
|
||||
|
||||
@ -61,6 +62,15 @@
|
||||
# include "sam_sdmmc.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MX25RXX
|
||||
# include "sam_qspi.h"
|
||||
# include <nuttx/mtd/mtd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MX25RXX_NXFFS
|
||||
# include <nuttx/fs/nxffs.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@ -242,6 +252,10 @@ static int nsh_sdmmc_initialize(void)
|
||||
|
||||
int sam_bringup(void)
|
||||
{
|
||||
#ifdef HAVE_MX25RXX
|
||||
struct qspi_dev_s *qspi;
|
||||
struct mtd_dev_s *mtd;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
/* Register I2C drivers on behalf of the I2C tool */
|
||||
@ -458,6 +472,42 @@ int sam_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MX25RXX
|
||||
qspi = sam_qspi_initialize(0);
|
||||
if (!qspi)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_qspi_initialize failed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
mtd = mx25rxx_initialize(qspi, true);
|
||||
if (!mtd)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: mx25rxx_initialize failed\n");
|
||||
}
|
||||
|
||||
#if HAVE_MX25RXX_NXFFS
|
||||
/* Initialize to provide NXFFS on the mx25rxx MTD interface */
|
||||
|
||||
ret = nxffs_initialize(mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
}
|
||||
|
||||
/* Mount the file system at /mnt/mx25 */
|
||||
|
||||
ret = nx_mount(NULL, "/mnt/mx25", "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount the NXFFS volume: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_MX25RXX */
|
||||
|
||||
/* If we got here then perhaps not all initialization was successful, but
|
||||
* at least enough succeeded to bring-up NSH with perhaps reduced
|
||||
* capabilities.
|
||||
|
@ -42,13 +42,15 @@
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#define HAVE_SDMMC 1
|
||||
#define HAVE_AT25 1
|
||||
#define HAVE_NAND 1
|
||||
#define HAVE_USBHOST 1
|
||||
#define HAVE_USBDEV 1
|
||||
#define HAVE_USBMONITOR 1
|
||||
#define HAVE_NETWORK 1
|
||||
#define HAVE_SDMMC 1
|
||||
#define HAVE_AT25 1
|
||||
#define HAVE_NAND 1
|
||||
#define HAVE_USBHOST 1
|
||||
#define HAVE_USBDEV 1
|
||||
#define HAVE_USBMONITOR 1
|
||||
#define HAVE_NETWORK 1
|
||||
#define HAVE_MX25RXX 1
|
||||
#define HAVE_MX25RXX_NXFFS 1
|
||||
|
||||
/* SDMMC */
|
||||
|
||||
@ -169,6 +171,17 @@
|
||||
# define AT25_MINOR _AT25_MINOR
|
||||
#endif
|
||||
|
||||
/* MX25RXX QuadSPI flash */
|
||||
|
||||
#if !defined(CONFIG_MTD_MX25RXX) || !defined(CONFIG_SAMA5_QSPI0)
|
||||
# undef HAVE_MX25RXX
|
||||
# undef HAVE_MX25RXX_NXFFS
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_FS_NXFFS
|
||||
# undef HAVE_MX25RXX_NXFFS
|
||||
#endif
|
||||
|
||||
/* MMC/SD minor numbers: The NSH device minor extended is extended to
|
||||
* support two devices. If CONFIG_NSH_MMCSDMINOR is zero, these will be:
|
||||
* /dev/mmcsd0 and /dev/mmcsd1.
|
||||
|
Loading…
Reference in New Issue
Block a user