Chapter 14 SPI configuration
As you can see from the data sheet, SSD20X has two SPI interfaces, one of which is already used in SPIFLASH, so only one SPI interface is available to developers.
As you can see from the data sheet, SSD20X has two SPI interfaces, one of which is already used in SPIFLASH, so only one SPI interface is available to developers.
# vi arch/arm/boot/dts/infinity2m.dtsi
spinandflash {
compatible = "ms-spinand";
clocks =<&CLK_bdma>;
status = "ok";
};
spi: spi {
compatible = "sstar_spi";
io_phy_addr = <0x1f000000>;
banks = <0x1110>,<0x1111>,<0x1038>,<0x101E>,<0x100B>;
clocks = <&CLK_mspi0>;
interrupts = <GIC_SPI INT_IRQ_MSPI_0 IRQ_TYPE_LEVEL_HIGH>;
/*
* padmux:
* mode=1: PAD_PM_SD_CDZ,PAD_SD_D1,PAD_SD_D0,PAD_SD_CLK,PAD_SD_CMD
* mode=2: PAD_TTL16,PAD_TTL17,PAD_TTL18,PAD_TTL19
* mode=3: PAD_GPIO4,PAD_GPIO5,PAD_GPIO6,PAD_GPIO7
* mode=4: PAD_FUART_RX,PAD_FUART_TX,PAD_FUART_CTS,PAD_FUART_RTS
* mode=5: PAD_GPIO8,PAD_GPIO9,PAD_GPIO10,PAD_GPIO11
* mode=6: PAD_GPIO0,PAD_GPIO1,PAD_GPIO2,PAD_GPIO3
*/
dma = <1>;
spi0_mode = <2>;
status = "ok";
spidev: spidev0 {
compatible = "rohm,dh2228fv";
reg = <0>;
status = "ok";
};
};
Then configure the corresponding pin as SPI_MODE:
# vi arch/arm/boot/dts/infinity2m-ssc011a-s01a-padmux-display.dtsi
<PAD_GPIO8 PINMUX_FOR_SPI0_MODE_5 MDRV_PUSE_SPI0_CZ>,
<PAD_GPIO9 PINMUX_FOR_SPI0_MODE_5 MDRV_PUSE_SPI0_CK >,
<PAD_GPIO10 PINMUX_FOR_SPI0_MODE_5 MDRV_PUSE_SPI0_DI >,
<PAD_GPIO11 PINMUX_FOR_SPI0_MODE_5 MDRV_PUSE_SPI0_DO >,
Since it is already set to SPI_MODE by default, you just need to make sure that it is not configured for other functions.Finally load the MSPI driver:
# cd kernel && ARCH=arm make menuconfig
文档更新时间: 2021-12-10 10:42 作者:Aeeditor