From 632ece8195536e2a20e55e58e9ce71ba0e8d80a8 Mon Sep 17 00:00:00 2001 From: Andrejs Cainikovs Date: Wed, 22 May 2019 16:30:26 +0200 Subject: [PATCH] nmhw23: Add spi3 software SPI --- arch/arm/dts/imx8_nmhw23.dts | 38 +++++++++++++++++++++++++++++------ configs/imx8_nmhw23_defconfig | 4 ++++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/arch/arm/dts/imx8_nmhw23.dts b/arch/arm/dts/imx8_nmhw23.dts index 6eafb31a92..e86d0b24a4 100644 --- a/arch/arm/dts/imx8_nmhw23.dts +++ b/arch/arm/dts/imx8_nmhw23.dts @@ -12,6 +12,10 @@ model = "NetModule NMHW23"; compatible = "netmodule,imx8-nmhw23", "fsl,imx8qxp"; + aliases { + spi3 = &spi3; + }; + chosen { bootargs = "console=ttyLP0,115200 earlycon=lpuart32,0x5a060000,115200"; stdout-path = &lpuart0; @@ -20,28 +24,41 @@ pmu { interrupt-affinity = <&A35_0>, <&A35_1>; }; + + spi3: soft-spi3 { + compatible = "spi-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi3>; + status = "okay"; + + gpio-sck = <&gpio0 13 GPIO_ACTIVE_HIGH>; + gpio-mosi = <&gpio0 14 GPIO_ACTIVE_HIGH>; + gpio-miso = <&gpio0 15 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + }; }; &iomuxc { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_hog>; - imx8qxp-mek { - pinctrl_hog: hoggrp { + imx8-nmhw23 { + pinctrl_hog: hog_grp { fsl,pins = < SC_P_MCLK_OUT0_ADMA_ACM_MCLK_OUT0 0x0600004c SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD 0x000514a0 >; }; - pinctrl_lpuart0: lpuart0grp { + pinctrl_lpuart0: lpuart0_grp { fsl,pins = < - SC_P_UART0_RX_ADMA_UART0_RX 0x06000020 - SC_P_UART0_TX_ADMA_UART0_TX 0x06000020 + SC_P_UART0_RX_ADMA_UART0_RX 0x06000020 + SC_P_UART0_TX_ADMA_UART0_TX 0x06000020 >; }; - pinctrl_usdhc1: usdhc1grp { + pinctrl_usdhc1: usdhc1_grp { fsl,pins = < SC_P_EMMC0_CLK_CONN_EMMC0_CLK 0x06000041 SC_P_EMMC0_CMD_CONN_EMMC0_CMD 0x00000021 @@ -56,6 +73,15 @@ SC_P_EMMC0_STROBE_CONN_EMMC0_STROBE 0x00000041 >; }; + + pinctrl_spi3: spi3_grp { + fsl,pins = < + SC_P_SPI3_SCK_LSIO_GPIO0_IO13 0x00000060 + SC_P_SPI3_SDO_LSIO_GPIO0_IO14 0x00000020 + SC_P_SPI3_SDI_LSIO_GPIO0_IO15 0x00000020 + SC_P_SPI3_CS0_LSIO_GPIO0_IO16 0x00000060 + >; + }; }; }; diff --git a/configs/imx8_nmhw23_defconfig b/configs/imx8_nmhw23_defconfig index 553e75cad5..af0a5ae605 100644 --- a/configs/imx8_nmhw23_defconfig +++ b/configs/imx8_nmhw23_defconfig @@ -74,3 +74,7 @@ CONFIG_DM_SERIAL=y CONFIG_FSL_LPUART=y CONFIG_SPL_TINY_MEMSET=y # CONFIG_EFI_LOADER is not set +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_SOFT_SPI=y +CONFIG_CMD_SPI=y