Skip to content

Commit 06d3c5a

Browse files
authored
Merge pull request adafruit#627 from tannewt/qspi
Add QSPI support for the SAMD51
2 parents 3642fcb + 653fc88 commit 06d3c5a

23 files changed

Lines changed: 587 additions & 228 deletions

File tree

ports/atmel-samd/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
252252
SRC_C += internal_flash.c
253253
endif
254254
ifeq ($(SPI_FLASH_FILESYSTEM),1)
255-
SRC_C += spi_flash.c
255+
SRC_C += external_flash/external_flash.c external_flash/spi_flash.c
256+
endif
257+
ifeq ($(QSPI_FLASH_FILESYSTEM),1)
258+
SRC_C += external_flash/external_flash.c external_flash/qspi_flash.c
256259
endif
257260

258261
SRC_COMMON_HAL = \

ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#define SPEAKER_ENABLE_PIN (&pin_PA30)
4040

41-
#include "spi_flash.h"
41+
#include "external_flash/external_flash.h"
4242

4343
// If you change this, then make sure to update the linker scripts as well to
4444
// make sure you don't overwrite code.
@@ -47,8 +47,8 @@
4747

4848
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4949

50-
#include "flash_S25FL216K.h"
51-
#include "flash_GD25Q16C.h"
50+
#include "external_flash/devices/S25FL216K.h"
51+
#include "external_flash/devices/GD25Q16C.h"
5252

5353
#define CALIBRATE_CRYSTALLESS 1
5454

ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define MICROPY_PORT_B ( 0 )
3232
#define MICROPY_PORT_C ( 0 )
3333

34-
#include "spi_flash.h"
34+
#include "external_flash/external_flash.h"
3535

3636
// If you change this, then make sure to update the linker scripts as well to
3737
// make sure you don't overwrite code.
@@ -40,5 +40,5 @@
4040

4141
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4242

43-
#include "flash_S25FL216K.h"
44-
#include "flash_GD25Q16C.h"
43+
#include "external_flash/devices/S25FL216K.h"
44+
#include "external_flash/devices/GD25Q16C.h"

ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define MICROPY_PORT_B ( 0 )
3434
#define MICROPY_PORT_C ( 0 )
3535

36-
#include "spi_flash.h"
36+
#include "external_flash/external_flash.h"
3737

3838
// If you change this, then make sure to update the linker scripts as well to
3939
// make sure you don't overwrite code.
@@ -42,4 +42,4 @@
4242

4343
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4444

45-
#include "flash_S25FL064L.h"
45+
#include "external_flash/devices/S25FL064L.h"

ports/atmel-samd/boards/itsybitsy_m0/mpconfigboard.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
#define MICROPY_PORT_B (PORT_PB22 | PORT_PB23 | PORT_PB03 )
3434
#define MICROPY_PORT_C (0)
3535

36-
#include "spi_flash.h"
36+
#include "external_flash/external_flash.h"
3737

3838
// If you change this, then make sure to update the linker scripts as well to
3939
// make sure you don't overwrite code.
4040
// #define CIRCUITPY_INTERNAL_NVM_SIZE 256
4141
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
4242
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4343

44-
//#include "flash_S25FL216K.h"
45-
#include "flash_W25Q80DV.h"
46-
//#include "flash_GD25Q16C.h"
44+
//#include "external_flash/devices/S25FL216K.h"
45+
#include "external_flash/devices/W25Q80DV.h"
46+
//#include "external_flash/devices/GD25Q16C.h"

ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define MICROPY_PORT_B (PORT_PB03 | PORT_PB22 | PORT_PB23)
3535
#define MICROPY_PORT_C (0)
3636

37-
#include "spi_flash.h"
37+
#include "external_flash/external_flash.h"
3838

3939
// If you change this, then make sure to update the linker scripts as well to
4040
// make sure you don't overwrite code.
@@ -43,5 +43,5 @@
4343

4444
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4545

46-
#include "flash_S25FL216K.h"
47-
#include "flash_GD25Q16C.h"
46+
#include "external_flash/devices/S25FL216K.h"
47+
#include "external_flash/devices/GD25Q16C.h"

ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
#define SPI_FLASH_DIPO 3 // same as MISO pad
3434

3535
// These are pins not to reset.
36-
#define MICROPY_PORT_A (PORT_PA27)
37-
#define MICROPY_PORT_B (PORT_PB06 | PORT_PB08 | PORT_PB09 | PORT_PB10 | PORT_PB11 | PORT_PB17)
36+
#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11 | PORT_PA27)
37+
#define MICROPY_PORT_B (PORT_PB10 | PORT_PB11 | PORT_PB17)
3838
#define MICROPY_PORT_C (0)
3939
#define MICROPY_PORT_D (0)
4040

4141
#define AUTORESET_DELAY_MS 500
4242

43-
#include "spi_flash.h"
43+
#include "external_flash/external_flash.h"
4444

4545
// If you change this, then make sure to update the linker scripts as well to
4646
// make sure you don't overwrite code
@@ -49,5 +49,5 @@
4949

5050
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
5151

52-
#include "flash_S25FL216K.h"
53-
#include "flash_GD25Q16C.h"
52+
#include "external_flash/devices/S25FL216K.h"
53+
#include "external_flash/devices/GD25Q16C.h"

ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ USB_PID = 0x8021
44
USB_PRODUCT = "Metro M4 Express"
55
USB_MANUFACTURER = "Adafruit Industries LLC"
66

7-
SPI_FLASH_FILESYSTEM = 1
7+
QSPI_FLASH_FILESYSTEM = 1
88

99
CHIP_VARIANT = SAMD51J19A
1010
CHIP_FAMILY = samd51

ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@
4040

4141
#define CALIBRATE_CRYSTALLESS 1
4242

43-
#include "spi_flash.h"
43+
#include "external_flash/external_flash.h"
4444

4545
// If you change this, then make sure to update the linker scripts as well to
4646
// make sure you don't overwrite code.
4747
//#define CIRCUITPY_INTERNAL_NVM_SIZE 256
4848
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
4949
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
5050

51-
#include "flash_W25Q32BV.h"
52-
51+
#include "external_flash/devices/W25Q32BV.h"

ports/atmel-samd/boards/ugame10/mpconfigboard.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333

3434
#define CALIBRATE_CRYSTALLESS 1
3535

36-
#include "spi_flash.h"
36+
#include "external_flash/external_flash.h"
3737

3838
// If you change this, then make sure to update the linker scripts as well to
3939
// make sure you don't overwrite code.
4040
//#define CIRCUITPY_INTERNAL_NVM_SIZE 256
4141
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
4242
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4343

44-
//#include "flash_W25Q32BV.h"
45-
#include "flash_S25FL216K.h"
44+
//#include "external_flash/devices/W25Q32BV.h"
45+
#include "external_flash/devices/S25FL216K.h"

0 commit comments

Comments
 (0)