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