ARM: tegra: Enable SLINK controller driver
v4 cover ARM: tegra: Enable SLINK controller driver
This series modify the dts file to add the slink addresses, make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and enable slink controller defconfig.
Changes from V1:
- Remove changes from clock tables.
- Make the dma req dt property name to nvidia,dma-request-selector.
- change the spi max frequency prop to spi-max-frequency.
Changes from V2:
- make node name to spi.
- get rid of iomap.h.
Changes from V3:
- Enable spi flash connected on slink4-cs1.
- Enable require defconfigs.
Laxman Dewangan (4):
ARM: tegra: dts: add slink controller dt entry
ARM: tegra: Add OF_DEV_AUXDATA for SLINK driver in board dt
ARM: tegra: dts: cardhu: enable SLINK4
ARM: tegra: config: enable spi driver for Tegra SLINK controller
.../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/tegra20.dtsi | 41 +++++++++++++ arch/arm/boot/dts/tegra30-cardhu.dtsi | 10 +++ arch/arm/boot/dts/tegra30.dtsi | 60 ++++++++++++++++++++ arch/arm/configs/tegra_defconfig | 5 +- arch/arm/mach-tegra/board-dt-tegra20.c | 8 +++ arch/arm/mach-tegra/board-dt-tegra30.c | 12 ++++ 7 files changed, 136 insertions(+), 1 deletions(-)
PATCH v4 2/4 ARM: tegra: Add OF_DEV_AUXDATA for SLINK driver in board dt
Add OF_DEV_AUXDATA for slink driver for Tegra20 and Tegra30 board dt files.
Set the parent clock of slink controller to PLLP and configure clock to 100MHz.
---
Changes from V1:
- Revert the changes in clock table to get the driver name.
Changes from V2:
- Get rid of the iomap.h
Changes from V3:
- None
arch/arm/mach-tegra/board-dt-tegra20.c | 8 ++++++++ arch/arm/mach-tegra/board-dt-tegra30.c | 12 ++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-dt-tegra20.c +8 -0
@@ -90,6 +90,10 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { &tegra_ehci3_pdata),OF_DEV_AUXDATA ("nvidia,tegra20-apbdma" ,TEGRA_APB_DMA_BASE ,"tegra-apbdma" ,NULL ),OF_DEV_AUXDATA ("nvidia,tegra20-pwm" ,TEGRA_PWFM_BASE ,"tegra-pwm" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra20-slink" ,0x7000D400 ,"spi_tegra.0" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra20-slink" ,0x7000D600 ,"spi_tegra.1" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra20-slink" ,0x7000D800 ,"spi_tegra.2" ,NULL ), + OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000DA00, "spi_tegra.3", NULL), {} };
@@ -109,6 +113,10 @@ static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = { { "sdmmc1", "pll_p", 48000000, false}, { "sdmmc3", "pll_p", 48000000, false}, { "sdmmc4", "pll_p", 48000000, false}, + { "sbc1", "pll_p", 100000000, false }, + { "sbc2", "pll_p", 100000000, false }, + { "sbc3", "pll_p", 100000000, false }, + { "sbc4", "pll_p", 100000000, false }, { NULL, NULL, 0, 0}, };
arch/arm/mach-tegra/board-dt-tegra30.c +12 -0
@@ -52,6 +52,12 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {OF_DEV_AUXDATA ("nvidia,tegra30-ahub" ,0x70080000 ,"tegra30-ahub" ,NULL ),OF_DEV_AUXDATA ("nvidia,tegra30-apbdma" ,0x6000a000 ,"tegra-apbdma" ,NULL ),OF_DEV_AUXDATA ("nvidia,tegra30-pwm" ,TEGRA_PWFM_BASE ,"tegra-pwm" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra30-slink" ,0x7000D400 ,"spi_tegra.0" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra30-slink" ,0x7000D600 ,"spi_tegra.1" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra30-slink" ,0x7000D800 ,"spi_tegra.2" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra30-slink" ,0x7000DA00 ,"spi_tegra.3" ,NULL ), +OF_DEV_AUXDATA ("nvidia,tegra30-slink" ,0x7000DC00 ,"spi_tegra.4" ,NULL ), + OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DE00, "spi_tegra.5", NULL), {} };
@@ -71,6 +77,12 @@ static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = { { "sdmmc1", "pll_p", 48000000, false}, { "sdmmc3", "pll_p", 48000000, false}, { "sdmmc4", "pll_p", 48000000, false}, + { "sbc1", "pll_p", 100000000, false}, + { "sbc2", "pll_p", 100000000, false}, + { "sbc3", "pll_p", 100000000, false}, + { "sbc4", "pll_p", 100000000, false}, + { "sbc5", "pll_p", 100000000, false}, + { "sbc6", "pll_p", 100000000, false}, { NULL, NULL, 0, 0}, };
Signature · 1 line
1.7.1.1
PATCH v4 3/4 ARM: tegra: dts: cardhu: enable SLINK4
In reply to Laxman DewanganEnable SLINK4 and connected device in Tegra30 based platform Cardhu.
Setting maximum spi frequency to 25MHz.
Spi serial flash is connected on CS1 of SLINK4 on
cardhu platform.
---
Changes from V1:
- rename the max freq prop to spi-max-frequency
Changes from V2:
- make node name to spi@
Changes from V3:
- Add winbond spi flash as cs1 for slink4.
- Add winbond company name in vendor list.
.../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/tegra30-cardhu.dtsi | 10 ++++++++++ 2 files changed, 11 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -51,4 +51,5 @@ ti Texas Instruments via VIA Technologies, Inc. wlf Wolfson Microelectronics wm Wondermedia Technologies, Inc. +winbond Winbond Electronics corp. xlnx Xilinx
arch/arm/boot/dts/tegra30-cardhu.dtsi +10 -0
@@ -275,6 +275,16 @@ }; }; + spi at 7000da00 { + status = "okay"; + spi-max-frequency = <25000000>; + spi-flash at 1 { + compatible = "winbond,w25q32"; + spi-max-frequency = <20000000>; + reg = <1>; + }; + }; + ahub { i2s at 70080400 { status = "okay";
Signature · 1 line
1.7.1.1
Re: [PATCH V4 3/4] ARM: tegra: dts: cardhu: enable SLINK4
Documentation/devicetree/bindings/vendor-prefixes.txt
Quoted 10 lines · Laxman Dewangan
Enable SLINK4 and connected device in Tegra30 based platform Cardhu.
Setting maximum spi frequency to 25MHz.Spi serial flash is connected on CS1 of SLINK4 on
cardhu platform.Documentation/devicetree/bindings/vendor-prefixes.txt +1
-0+winbond Winbond Electronics corp.
That should really be a separate patch that goes through the devicetree branch. But I guess it's fairly trivial, so it's not a big deal.
arch/arm/boot/dts/tegra30-cardhu.dtsi line 285
Quoted 7 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +5
-0+ spi-flash at 1 { + compatible = "winbond,w25q32"; + spi-max-frequency = <20000000>; + reg = <1>; + };
Since I have an Atmel flash on my board, I see:
[ 1.282958] m25p80 spi32766.1: found at25df321a, expected w25q32 [ 1.289103] m25p80 spi32766.1: at25df321a (4096 Kbytes)
Is there any way around that (the first log line above)?
I suppose the answer is that the DT should reflect the exact flash device that's on the board, and perhaps the bootloader should be adjusting the DT to reflect the correct value. That's probably complex.
Do you have any idea whether Atmel or Winbond flash is more common, so we can at least minimize the number of times this message appears?
Re: [PATCH V4 3/4] ARM: tegra: dts: cardhu: enable SLINK4
Quoted 5 lines · Stephen Warren
Quoted 4 lines · Laxman Dewangan
Enable SLINK4 and connected device in Tegra30 based platform Cardhu.
Setting maximum spi frequency to 25MHz.
Quoted 7 lines
Documentation/devicetree/bindings/vendor-prefixes.txt ti Texas Instruments · line 54
Quoted 4 lines
Spi serial flash is connected on CS1 of SLINK4 on
cardhu platform.Documentation/devicetree/bindings/vendor-prefixes.txt +1
-0+winbond Winbond Electronics corp.That should really be a separate patch that goes through the devicetree branch. But I guess it's fairly trivial, so it's not a big deal.
Yes, I thought that it should be in separate change. I did same on earlier for ISL29028 driver and found that this small change still not get merged. Therefore I clubbed this together as it can go without any issue.
I believe it is fine to merge vendor-prefix from any tree.
Quoted 11 lines
Documentation/devicetree/bindings/vendor-prefixes.txt
Quoted 6 lines
Documentation/devicetree/bindings/vendor-prefixes.txt +5
-0+ spi-flash at 1 { + compatible = "winbond,w25q32"; + spi-max-frequency =<20000000>; + reg =<1>; + };Since I have an Atmel flash on my board, I see:
[ 1.282958] m25p80 spi32766.1: found at25df321a, expected w25q32 [ 1.289103] m25p80 spi32766.1: at25df321a (4096 Kbytes)
Quoted 8 lines
Is there any way around that (the first log line above)?
I suppose the answer is that the DT should reflect the exact flash device that's on the board, and perhaps the bootloader should be adjusting the DT to reflect the correct value. That's probably complex.
Do you have any idea whether Atmel or Winbond flash is more common, so we can at least minimize the number of times this message appears?
I observe that most of cardhu have the winbond. All SQA machine has winbond. Also I believe on A04, it is winbond.
Better to go with winbond.
PATCH v4 4/4 ARM: tegra: config: enable spi driver for Tegra SLINK controller
In reply to Laxman DewanganAlso enable the MTD, MTD_M25P80 and MTD_CHAR driver to enable SPI flash.
---
No change from V1 and V2.
Changes from V2:
- enable MTD, MTD_M25P80 and MTD_CHAR drivers.
arch/arm/configs/tegra_defconfig | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/configs/tegra_defconfig +4 -1
@@ -80,6 +80,9 @@ CONFIG_RFKILL_GPIO=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_MTD=y +CONFIG_MTD_CHAR=y +CONFIG_MTD_M25P80=y CONFIG_PROC_DEVICETREE=y CONFIG_BLK_DEV_LOOP=y CONFIG_AD525X_DPOT=y
@@ -117,7 +120,7 @@ CONFIG_I2C_MUX=y CONFIG_I2C_MUX_PINCTRL=y CONFIG_I2C_TEGRA=y CONFIG_SPI=y -CONFIG_SPI_TEGRA=y +CONFIG_SPI_TEGRA20_SLINK=y CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GPIO_TPS6586X=y CONFIG_GPIO_TPS65910=y
Signature · 1 line
1.7.1.1
v4 cover ARM: tegra: Enable SLINK controller driver
In reply to Laxman DewanganThis series modify the dts file to add the slink addresses, make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and enable slink controller defconfig.
Changes from V1:
- Remove changes from clock tables.
- Make the dma req dt property name to nvidia,dma-request-selector.
- change the spi max frequency prop to spi-max-frequency.
Changes from V2:
- make node name to spi.
- get rid of iomap.h.
Changes from V3:
- Enable spi flash connected on slink4-cs1.
- Enable require defconfigs.
Laxman Dewangan (4):
ARM: tegra: dts: add slink controller dt entry
ARM: tegra: Add OF_DEV_AUXDATA for SLINK driver in board dt
ARM: tegra: dts: cardhu: enable SLINK4
ARM: tegra: config: enable spi driver for Tegra SLINK controller
.../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/boot/dts/tegra20.dtsi | 41 +++++++++++++ arch/arm/boot/dts/tegra30-cardhu.dtsi | 10 +++ arch/arm/boot/dts/tegra30.dtsi | 60 ++++++++++++++++++++ arch/arm/configs/tegra_defconfig | 5 +- arch/arm/mach-tegra/board-dt-tegra20.c | 8 +++ arch/arm/mach-tegra/board-dt-tegra30.c | 12 ++++ 7 files changed, 136 insertions(+), 1 deletions(-)
Quoted 3 lines · Laxman Dewangan
This series modify the dts file to add the slink addresses, make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and enable slink controller defconfig.
I don't appear to have received patch 1/4 this time around. I'll assume it's identical to V3, since I don't think anything needed to change there...
Quoted 6 lines · Stephen Warren
Quoted 3 lines · Laxman Dewangan
This series modify the dts file to add the slink addresses, make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and enable slink controller defconfig.
I don't appear to have received patch 1/4 this time around. I'll assume it's identical to V3, since I don't think anything needed to change there...
Yes, it is identical to V3, no change on the 1/4.
Only change in 3/4 and 4/4. I realize later that you already applied the 2/4 yesterday.
Quoted 10 lines · Laxman Dewangan
Quoted 7 lines · Stephen Warren
Quoted 3 lines · Laxman Dewangan
This series modify the dts file to add the slink addresses, make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and enable slink controller defconfig.
I don't appear to have received patch 1/4 this time around. I'll assume it's identical to V3, since I don't think anything needed to change there...
Yes, it is identical to V3, no change on the 1/4.
OK, I have applied the series now. Thanks.
BTW, I noticed that the Cardu board files sets the SPI controller's max frequency to 25MHZ (which is consistent with the commit description) but the SPI flash node's frequency to 20MHz. Was that intended, or should I fix it up to be 25MHz?
Quoted 2 lines
Only change in 3/4 and 4/4. I realize later that you already applied the 2/4 yesterday.
Oops, that was a mistake; I forgot to pull it out after testing and not getting it to work. Oh well.
Quoted 9 lines · Stephen Warren
Quoted 8 lines · Laxman Dewangan
Quoted 7 lines · Stephen Warren
Quoted 3 lines · Laxman Dewangan
This series modify the dts file to add the slink addresses, make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and enable slink controller defconfig.
I don't appear to have received patch 1/4 this time around. I'll assume it's identical to V3, since I don't think anything needed to change there...
Quoted 7 lines
Quoted 1 line
Yes, it is identical to V3, no change on the 1/4.
OK, I have applied the series now. Thanks.
BTW, I noticed that the Cardu board files sets the SPI controller's max frequency to 25MHZ (which is consistent with the commit description) but the SPI flash node's frequency to 20MHz. Was that intended, or should I fix it up to be 25MHz?
If device provide the max frequency then the spi communciation will on this requested frequency.
If device does not provide the max spi frequency then it will communciate with the controller max frequency.
In this case we provide the 20MHz for device and 25MHz for controller. So spi communciation with this device will be always 20MHz.