Skip to content

Commit 8a6fd43

Browse files
karstenkoenigMaureenHelm
authored andcommitted
boards: riscv: rv32m1_vega: Add onboard SPI flash
Enable the MX25R32 SPI NOR Flash on the VEGAboard and provide board config file for the spi_flash sample. Signed-off-by: Karsten Koenig <[email protected]>
1 parent ee2dd73 commit 8a6fd43

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

boards/riscv/rv32m1_vega/Kconfig.defconfig

+7
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,11 @@ config I2C_3
6868

6969
endif # I2C
7070

71+
if SPI
72+
73+
config SPI_1
74+
default y
75+
76+
endif # SPI
77+
7178
endif # BOARD_RV32M1_VEGA

boards/riscv/rv32m1_vega/pinmux.c

+8
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ static int rv32m1_vega_pinmux_init(struct device *dev)
6262
pinmux_pin_set(porte, 22, PORT_PCR_MUX(kPORT_MuxAsGpio));
6363
pinmux_pin_set(porte, 27, PORT_PCR_MUX(kPORT_MuxAsGpio));
6464

65+
#if CONFIG_SPI_1
66+
/* LPSPI1 SCK, SIN, SOUT, CS */
67+
pinmux_pin_set(portb, 20, PORT_PCR_MUX(kPORT_MuxAlt2));
68+
pinmux_pin_set(portb, 21, PORT_PCR_MUX(kPORT_MuxAlt2));
69+
pinmux_pin_set(portb, 24, PORT_PCR_MUX(kPORT_MuxAlt2));
70+
pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAlt2));
71+
#endif
72+
6573
return 0;
6674
}
6775

boards/riscv/rv32m1_vega/rv32m1_vega.dtsi

+14
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,17 @@ arduino_i2c: &i2c0 {
108108
int2-gpios = <&gpioe 22 0>;
109109
};
110110
};
111+
112+
&spi1 {
113+
status = "okay";
114+
cs-gpios = <&gpiob 22 0>;
115+
mx25r32: mx25r3235f@0 {
116+
compatible = "jedec,spi-nor";
117+
reg = <0>;
118+
spi-max-frequency = <80000000>;
119+
label = "MX25R32";
120+
jedec-id = [c2 28 16];
121+
size = <33554432>;
122+
has-be32k;
123+
};
124+
};

boards/riscv/rv32m1_vega/rv32m1_vega_ri5cy.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ supported:
99
- arduino_gpio
1010
- arduino_i2c
1111
- i2c
12+
- spi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) 2019 Karsten Koenig <[email protected]>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_SPI_NOR=y

0 commit comments

Comments
 (0)