feat(mtd): add NOR FLASH support

This commit is contained in:
alexcekay
2026-06-02 13:47:43 +02:00
committed by Alexander Lerach
parent b5f69ac4e8
commit 6f1f7035a5
5 changed files with 243 additions and 107 deletions

View File

@@ -49,6 +49,7 @@ typedef struct {
const px4_mtd_types_t type;
const char *path;
const uint32_t nblocks;
const bool bypass_ftl;
} px4_mtd_part_t;
typedef struct {

View File

@@ -33,6 +33,10 @@
#pragma once
#include <stdint.h>
#if defined(__PX4_NUTTX)
#include <nuttx/config.h>
#endif
typedef enum {
MFT = 0,
MTD = 1,
@@ -49,9 +53,16 @@ typedef struct {
I2C = 0,
SPI = 1,
ONCHIP = 2,
FLEXSPI = 3
FLEXSPI = 3,
} bus_type;
enum px4_spi_driver {
SPI_DRIVER_DEFAULT = 0, /* Ramtron (FRAM) */
#if defined(CONFIG_MTD_MX25L)
SPI_DRIVER_MX25L = 1, /* Macronix MX25L NOR flash */
#endif
} spi_driver;
uint32_t devid;
} px4_mft_device_t;

View File

@@ -44,6 +44,7 @@ typedef struct {
int *partition_block_counts;
int *partition_types;
const char **partition_names;
bool *partition_bypass_ftl;
struct mtd_dev_s **part_dev;
uint32_t devid;
unsigned n_partitions_current;