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

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