Skip to content

Commit

Permalink
Add Zephyr support for SPI Flash
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Jan 9, 2020
1 parent d4d0c5d commit 30b22c1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zephyr/boards/riscv/swervolf_nexys/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ if BOARD_SWERVOLF_NEXYS
config BOARD
default "swervolf_nexys"

if FLASH

config SPI_NOR
def_bool y

endif

endif
12 changes: 12 additions & 0 deletions zephyr/boards/riscv/swervolf_nexys/swervolf_nexys.dts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,15 @@
clock-frequency = <50000000>;
};

&spi0 {
status = "okay";

flash0: flash@0 {
compatible = "jedec,spi-nor";
label = "FLASH0";
jedec-id = [01 20 18];
size = <0x1000000>;
reg = <0>;
spi-max-frequency = <2000000>;
};
};
10 changes: 10 additions & 0 deletions zephyr/dts/riscv/riscv32-swerv.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,15 @@
interrupts = <12 15>;
status = "disabled";
};

spi0: spi@80001040 {
compatible = "opencores,spi-simple";
reg = <0x80001040 0x40>;
reg-names = "control";
label = "SPI0";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
};
};
10 changes: 10 additions & 0 deletions zephyr/soc/riscv/swervolf/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ config GPIO_MMIO32

endif # GPIO

if SPI

config SPI_OC_SIMPLE
def_bool y

config SPI_OC_SIMPLE_BUS_WIDTH
def_int 64

endif # SPI

config XIP
def_bool n

Expand Down

0 comments on commit 30b22c1

Please sign in to comment.