rpi_pico: Fix DTC warnings concerning the flash
The addresses of the flash and flash controller of the RP2040 SoC were mixed up. There was no clear distinction between the flash and the flash controller, which was unclear but also caused a DTC warning. This commit makes the distinction clearer: The SSI peripheral at 0x18000000 is the flash controller, and the flash itself starts at 0x10000000. The flash driver and rpi_pico.dts were fixed accordingly. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
This commit is contained in:
parent
a73aeacaa4
commit
abe50cc929
|
@ -18,7 +18,7 @@
|
|||
chosen {
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,flash-controller = &flash_controller;
|
||||
zephyr,flash-controller = &ssi;
|
||||
zephyr,console = &uart0;
|
||||
zephyr,shell-uart = &uart0;
|
||||
zephyr,code-partition = &code_partition;
|
||||
|
|
|
@ -27,10 +27,11 @@ LOG_MODULE_REGISTER(flash_rpi_pico, CONFIG_FLASH_LOG_LEVEL);
|
|||
#define DT_DRV_COMPAT raspberrypi_pico_flash_controller
|
||||
|
||||
#define PAGE_SIZE 256
|
||||
#define SECTOR_SIZE DT_PROP(DT_CHILD(DT_NODELABEL(flash_controller), flash_0), erase_block_size)
|
||||
#define SECTOR_SIZE DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)
|
||||
#define ERASE_VALUE 0xff
|
||||
#define FLASH_SIZE KB(CONFIG_FLASH_SIZE)
|
||||
#define FLASH_BASE DT_REG_ADDR(DT_NODELABEL(flash_controller))
|
||||
#define FLASH_BASE CONFIG_FLASH_BASE_ADDRESS
|
||||
#define SSI_BASE_ADDRESS DT_REG_ADDR(DT_CHOSEN(zephyr_flash_controller))
|
||||
|
||||
static const struct flash_parameters flash_rpi_parameters = {
|
||||
.write_block_size = 1,
|
||||
|
@ -56,7 +57,7 @@ enum outover {
|
|||
OUTOVER_HIGH
|
||||
};
|
||||
|
||||
static ssi_hw_t *const ssi = (ssi_hw_t *)XIP_SSI_BASE;
|
||||
static ssi_hw_t *const ssi = (ssi_hw_t *)SSI_BASE_ADDRESS;
|
||||
static uint32_t boot2_copyout[BOOT2_SIZE_WORDS];
|
||||
static bool boot2_copyout_valid;
|
||||
|
||||
|
|
|
@ -33,15 +33,14 @@
|
|||
reg = <0x20000000 DT_SIZE_K(264)>;
|
||||
};
|
||||
|
||||
flash_controller: flash-controller@10000000 {
|
||||
ssi: flash-controller@18000000 {
|
||||
compatible = "raspberrypi,pico-flash-controller";
|
||||
reg = <0x10000000 DT_SIZE_K(4)>;
|
||||
interrupts = <15 0>;
|
||||
reg = <0x18000000 0xfc>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
flash0: flash@0 {
|
||||
flash0: flash@10000000 {
|
||||
compatible = "soc-nv-flash";
|
||||
write-block-size = <1>;
|
||||
erase-block-size = <DT_SIZE_K(4)>;
|
||||
|
|
Loading…
Reference in a new issue