0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 22c2725b4321128985d9780152d85a8dd1ace706 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Mon, 4 Jan 2016 14:42:17 +0000
  4. Subject: [PATCH] BCM270X_DT: Add the sdtweak overlay, for tuning sdhost
  5. The sdhost overlay declares the sdhost interface and allows parameters
  6. to be set. This is overkill for situations where the user just wants to
  7. tweak the parameters of a pre-declared sdhost interface, so create an
  8. sdtweak overlay that does just that.
  9. ---
  10. arch/arm/boot/dts/overlays/Makefile | 1 +
  11. arch/arm/boot/dts/overlays/README | 14 ++++++++++++++
  12. arch/arm/boot/dts/overlays/sdtweak-overlay.dts | 21 +++++++++++++++++++++
  13. 3 files changed, 36 insertions(+)
  14. create mode 100644 arch/arm/boot/dts/overlays/sdtweak-overlay.dts
  15. --- a/arch/arm/boot/dts/overlays/Makefile
  16. +++ b/arch/arm/boot/dts/overlays/Makefile
  17. @@ -53,6 +53,7 @@ dtb-$(RPI_DT_OVERLAYS) += rpi-proto-over
  18. dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
  19. dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
  20. dtb-$(RPI_DT_OVERLAYS) += sdio-overlay.dtb
  21. +dtb-$(RPI_DT_OVERLAYS) += sdtweak-overlay.dtb
  22. dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb
  23. dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb
  24. dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb
  25. --- a/arch/arm/boot/dts/overlays/README
  26. +++ b/arch/arm/boot/dts/overlays/README
  27. @@ -635,6 +635,20 @@ Params: overclock_50 Clock (
  28. (default on: polling once at boot-time)
  29. +Name: sdtweak
  30. +Info: Tunes the bcm2835-sdhost SD/MMC driver
  31. +Load: dtoverlay=sdtweak,<param>=<val>
  32. +Params: overclock_50 Clock (in MHz) to use when the MMC framework
  33. + requests 50MHz
  34. +
  35. + force_pio Disable DMA support (default off)
  36. +
  37. + pio_limit Number of blocks above which to use DMA
  38. + (default 1)
  39. +
  40. + debug Enable debug output (default off)
  41. +
  42. +
  43. Name: smi
  44. Info: Enables the Secondary Memory Interface peripheral. Uses GPIOs 2-25!
  45. Load: dtoverlay=smi
  46. --- /dev/null
  47. +++ b/arch/arm/boot/dts/overlays/sdtweak-overlay.dts
  48. @@ -0,0 +1,21 @@
  49. +/dts-v1/;
  50. +/plugin/;
  51. +
  52. +/{
  53. + compatible = "brcm,bcm2708";
  54. +
  55. + fragment@0 {
  56. + target = <&sdhost>;
  57. + frag1: __overlay__ {
  58. + brcm,overclock-50 = <0>;
  59. + brcm,pio-limit = <1>;
  60. + };
  61. + };
  62. +
  63. + __overrides__ {
  64. + overclock_50 = <&frag1>,"brcm,overclock-50:0";
  65. + force_pio = <&frag1>,"brcm,force-pio?";
  66. + pio_limit = <&frag1>,"brcm,pio-limit:0";
  67. + debug = <&frag1>,"brcm,debug?";
  68. + };
  69. +};