0420-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 0583a0c3f173c327dff70ee9d7a0d70e50b5d120 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Fri, 1 Jul 2016 22:34:52 +0100
  4. Subject: [PATCH] BCM270X_DT: Overlay to re-enable HW CS on SPI0
  5. See: https://github.com/raspberrypi/linux/issues/1547
  6. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  7. ---
  8. arch/arm/boot/dts/overlays/Makefile | 1 +
  9. arch/arm/boot/dts/overlays/README | 6 ++++++
  10. arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts | 26 +++++++++++++++++++++++
  11. 3 files changed, 33 insertions(+)
  12. create mode 100644 arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts
  13. --- a/arch/arm/boot/dts/overlays/Makefile
  14. +++ b/arch/arm/boot/dts/overlays/Makefile
  15. @@ -81,6 +81,7 @@ dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo
  16. dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo
  17. dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo
  18. dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo
  19. +dtbo-$(RPI_DT_OVERLAYS) += spi0-hw-cs.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo
  21. dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo
  22. dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo
  23. --- a/arch/arm/boot/dts/overlays/README
  24. +++ b/arch/arm/boot/dts/overlays/README
  25. @@ -1006,6 +1006,12 @@ Load: dtoverlay=spi-rtc,<param>=<val>
  26. Params: pcf2123 Select the PCF2123 device
  27. +Name: spi0-hw-cs
  28. +Info: Re-enables hardware CS/CE (chip selects) for SPI0
  29. +Load: dtoverlay=spi0-hw-cs
  30. +Params: <None>
  31. +
  32. +
  33. Name: spi1-1cs
  34. Info: Enables spi1 with a single chip select (CS) line and associated spidev
  35. dev node. The gpio pin number for the CS line and spidev device node
  36. --- /dev/null
  37. +++ b/arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts
  38. @@ -0,0 +1,26 @@
  39. +/*
  40. + * Device tree overlay to re-enable hardware CS for SPI0
  41. + */
  42. +
  43. +/dts-v1/;
  44. +/plugin/;
  45. +
  46. +/ {
  47. + compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
  48. +
  49. + fragment@0 {
  50. + target = <&spi0>;
  51. + __overlay__ {
  52. + cs-gpios = <0>, <0>;
  53. + status = "okay";
  54. + };
  55. + };
  56. +
  57. + fragment@1 {
  58. + target = <&spi0_cs_pins>;
  59. + __overlay__ {
  60. + brcm,pins = <8 7>;
  61. + brcm,function = <4>; /* alt0 */
  62. + };
  63. + };
  64. +};