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 <karsten.koenig.030@gmail.com>
This commit is contained in:
Karsten Koenig 2019-08-21 19:56:57 +02:00 committed by Maureen Helm
parent ee2dd7322f
commit 8a6fd43439
5 changed files with 37 additions and 0 deletions

View file

@ -68,4 +68,11 @@ config I2C_3
endif # I2C
if SPI
config SPI_1
default y
endif # SPI
endif # BOARD_RV32M1_VEGA

View file

@ -62,6 +62,14 @@ static int rv32m1_vega_pinmux_init(struct device *dev)
pinmux_pin_set(porte, 22, PORT_PCR_MUX(kPORT_MuxAsGpio));
pinmux_pin_set(porte, 27, PORT_PCR_MUX(kPORT_MuxAsGpio));
#if CONFIG_SPI_1
/* LPSPI1 SCK, SIN, SOUT, CS */
pinmux_pin_set(portb, 20, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(portb, 21, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(portb, 24, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAlt2));
#endif
return 0;
}

View file

@ -108,3 +108,17 @@ arduino_i2c: &i2c0 {
int2-gpios = <&gpioe 22 0>;
};
};
&spi1 {
status = "okay";
cs-gpios = <&gpiob 22 0>;
mx25r32: mx25r3235f@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <80000000>;
label = "MX25R32";
jedec-id = [c2 28 16];
size = <33554432>;
has-be32k;
};
};

View file

@ -9,3 +9,4 @@ supported:
- arduino_gpio
- arduino_i2c
- i2c
- spi

View file

@ -0,0 +1,7 @@
#
# Copyright (c) 2019 Karsten Koenig <karsten.koenig.030@gmail.com>
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_NOR=y