0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 9120234bb37043477ef69fec8c03c3731ed6861f Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Mon, 25 Jan 2016 09:12:06 +0000
  4. Subject: [PATCH] BCM270X_DT: Add sdio_overclock parameter to sdio overlay
  5. The sdio_overclock parameter is like the overclock_50 parameter, i.e.
  6. it sets an alternate frequency (in MHz) to use when the MMC framework
  7. requests 50MHz, except that it applies to the SDIO bus.
  8. Be aware that the actual frequencies achievable are limited to even integer
  9. divisions of 250MHz, and that the driver will round up to include fractions
  10. (e.g. 62 will include 62.5) but then round down to the nearest frequency.
  11. In other words, the chosen frequency is the highest possible that is less than
  12. the parameter value + 1. In practise this means that 62 is the only sensible
  13. value.
  14. Examples:
  15. 250MHz/4 = 62.5MHz (sdio_overclock=62)
  16. 250MHz/2 = 125MHz (sdio_overclock=125) # Too fast
  17. ---
  18. arch/arm/boot/dts/overlays/README | 9 ++++++---
  19. arch/arm/boot/dts/overlays/sdio-overlay.dts | 2 ++
  20. 2 files changed, 8 insertions(+), 3 deletions(-)
  21. --- a/arch/arm/boot/dts/overlays/README
  22. +++ b/arch/arm/boot/dts/overlays/README
  23. @@ -53,8 +53,8 @@ have its contents deleted (or commented
  24. Using Overlays
  25. ==============
  26. -Overlays are loaded using the "dtoverlay" directive. As an example, consider the
  27. -popular lirc-rpi module, the Linux Infrared Remote Control driver. In the
  28. +Overlays are loaded using the "dtoverlay" directive. As an example, consider
  29. +the popular lirc-rpi module, the Linux Infrared Remote Control driver. In the
  30. pre-DT world this would be loaded from /etc/modules, with an explicit
  31. "modprobe lirc-rpi" command, or programmatically by lircd. With DT enabled,
  32. this becomes a line in config.txt:
  33. @@ -621,9 +621,12 @@ Name: sdio
  34. Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock,
  35. and enables SDIO via GPIOs 22-27.
  36. Load: dtoverlay=sdio,<param>=<val>
  37. -Params: overclock_50 Clock (in MHz) to use when the MMC framework
  38. +Params: overclock_50 SD Clock (in MHz) to use when the MMC framework
  39. requests 50MHz
  40. + sdio_overclock SDIO Clock (in MHz) to use when the MMC
  41. + framework requests 50MHz
  42. +
  43. force_pio Disable DMA support (default off)
  44. pio_limit Number of blocks above which to use DMA
  45. --- a/arch/arm/boot/dts/overlays/sdio-overlay.dts
  46. +++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts
  47. @@ -12,6 +12,7 @@
  48. pinctrl-0 = <&sdio_pins>;
  49. non-removable;
  50. bus-width = <4>;
  51. + brcm,overclock-50 = <0>;
  52. status = "okay";
  53. };
  54. };
  55. @@ -30,5 +31,6 @@
  56. __overrides__ {
  57. poll_once = <&sdio_mmc>,"non-removable?";
  58. bus_width = <&sdio_mmc>,"bus-width:0";
  59. + sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0";
  60. };
  61. };