Skip to contentSkip to conversation

Raspberry Pi clock support

PATCH Applied Eric Anholt 4 participants 20 messages Jul 20, 2015 – Aug 12, 2015

Subsystems (4)

v4 of 7 Applied Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover Raspberry Pi clock support

This is a respin of my rpi-dt-clocks series (also available at
https://github.com/anholt/linux/tree/rpi-dt-clocks). New in this version is mentioning the clk subsystem for drivers/clk/* patches, some better documentation of behavior in clk-raspberrypi.c, and a new patch at the tail of the series for updating the EMMC clock.

#1 lore raw

PATCH v4 1/8 clk: bcm2835: Add binding docs for the Raspberry Pi clock provider

The hardware clocks are not controllable by the ARM, so we have to make requests to the firmware to do so from the VPU side. This will let us replace fixed clocks in our DT with actual clock control (and correct frequency information).

---

v2: Include the dt-bindings header in this commit instead of the next
one. Make the clock indices match the firmware clock IDs. Rename the binding's compat string. Move the firmware phandle to be under a vendor-specific namespace.
v4: Mention 'clk' in the subject instead of the more generic
dt/bindings.

 .../clock/raspberrypi,bcm2835-firmware-clocks.txt  | 25 ++++++++++++++++++++++
 include/dt-bindings/clk/raspberrypi.h              | 23 ++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/raspberrypi,bcm2835-firmware-clocks.txt
 create mode 100644 include/dt-bindings/clk/raspberrypi.h
Documentation/devicetree/bindings/clock/raspberrypi,bcm2835-firmware-clocks.txt new file +25 -0
new file mode 100644
index 0000000..0972602
@@ -0,0 +1,25 @@
+Raspberry Pi firmware clock provider.
+
+The Raspberry Pi architecture doesn't provide direct access to the
+CLOCKMAN peripheral from the ARM side, so Linux has to make requests
+to the VPU firmware to program them.
+
+This binding uses the common clock binding:
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties:
+- compatible:		Should be "raspberrypi,bcm2835-firmware-clocks"
+
+- #clock-cells:		Shall have value <1>.  The permitted clock-specifier
+			  values can be found in
+			  include/dt-bindings/clk/raspberrypi.h.
+
+- raspberrypi,firmware:	Phandle to the firmware driver node.
+
+Example:
+
+firmware_clocks: firmware-clocks {
+	compatible = "raspberrypi,bcm2835-firmware-clocks";
+	#clock-cells = <1>;
+	raspberrypi,firmware = <&firmware>;
+};
include/dt-bindings/clk/raspberrypi.h new file +23 -0
new file mode 100644
index 0000000..ceec90f
@@ -0,0 +1,23 @@
+#/*
+ *  Copyright ?? 2015 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _DT_BINDINGS_CLK_RASPBERRYPI_H
+#define _DT_BINDINGS_CLK_RASPBERRYPI_H
+
+#define RPI_CLOCK_EMMC	1
+#define RPI_CLOCK_UART0	2
+#define RPI_CLOCK_ARM	3
+#define RPI_CLOCK_CORE	4
+#define RPI_CLOCK_V3D	5
+#define RPI_CLOCK_H264	6
+#define RPI_CLOCK_ISP	7
+#define RPI_CLOCK_SDRAM	8
+#define RPI_CLOCK_PIXEL	9
+#define RPI_CLOCK_PWM	10
+
+#endif
Signature · 1 line
2.1.4
Acked-by on v4 1/8
#2 lore raw

Re: [PATCH v4 1/8] clk: bcm2835: Add binding docs for the Raspberry Pi clock provider

Quoting Eric Anholt (2015-07-20 12:33:00)

Quoted 8 lines

The hardware clocks are not controllable by the ARM, so we have to make requests to the firmware to do so from the VPU side. This will let us replace fixed clocks in our DT with actual clock control (and correct frequency information).

Looks good to me. Do you want the clk patches to go through the clk tree or do you want them all together? For this patch feel free to add:

Regards,
Mike

Quoted 78 lines

---

v2: Include the dt-bindings header in this commit instead of the next
one. Make the clock indices match the firmware clock IDs. Rename the binding's compat string. Move the firmware phandle to be under a vendor-specific namespace.
v4: Mention 'clk' in the subject instead of the more generic
dt/bindings.

 .../clock/raspberrypi,bcm2835-firmware-clocks.txt  | 25 ++++++++++++++++++++++
 include/dt-bindings/clk/raspberrypi.h              | 23 ++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/raspberrypi,bcm2835-firmware-clocks.txt
 create mode 100644 include/dt-bindings/clk/raspberrypi.h
Documentation/devicetree/bindings/clock/raspberrypi,bcm2835-firmware-clocks.txt new file +25 -0
new file mode 100644
index 0000000..0972602
@@ -0,0 +1,25 @@
+Raspberry Pi firmware clock provider.
+
+The Raspberry Pi architecture doesn't provide direct access to the
+CLOCKMAN peripheral from the ARM side, so Linux has to make requests
+to the VPU firmware to program them.
+
+This binding uses the common clock binding:
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties:
+- compatible:          Should be "raspberrypi,bcm2835-firmware-clocks"
+
+- #clock-cells:                Shall have value <1>.  The permitted clock-specifier
+                         values can be found in
+                         include/dt-bindings/clk/raspberrypi.h.
+
+- raspberrypi,firmware:        Phandle to the firmware driver node.
+
+Example:
+
+firmware_clocks: firmware-clocks {
+       compatible = "raspberrypi,bcm2835-firmware-clocks";
+       #clock-cells = <1>;
+       raspberrypi,firmware = <&firmware>;
+};
include/dt-bindings/clk/raspberrypi.h new file +23 -0
new file mode 100644
index 0000000..ceec90f
@@ -0,0 +1,23 @@
+#/*
+ *  Copyright ?? 2015 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _DT_BINDINGS_CLK_RASPBERRYPI_H
+#define _DT_BINDINGS_CLK_RASPBERRYPI_H
+
+#define RPI_CLOCK_EMMC 1
+#define RPI_CLOCK_UART0        2
+#define RPI_CLOCK_ARM  3
+#define RPI_CLOCK_CORE 4
+#define RPI_CLOCK_V3D  5
+#define RPI_CLOCK_H264 6
+#define RPI_CLOCK_ISP  7
+#define RPI_CLOCK_SDRAM        8
+#define RPI_CLOCK_PIXEL        9
+#define RPI_CLOCK_PWM  10
+
+#endif
Signature · 1 line
2.1.4
#3 lore raw

Re: [PATCH v4 1/8] clk: bcm2835: Add binding docs for the Raspberry Pi clock provider

Quoted 6 lines · Michael Turquette

Quoting Eric Anholt (2015-07-20 12:33:00)

Quoted 5 lines

The hardware clocks are not controllable by the ARM, so we have to make requests to the firmware to do so from the VPU side. This will let us replace fixed clocks in our DT with actual clock control (and correct frequency information).

Quoted 8 lines
Quoted 3 lines

Looks good to me. Do you want the clk patches to go through the clk tree or do you want them all together? For this patch feel free to add:

It would be nice to do them all together in the arm-soc tree, since the
later DT changes require that the clock driver be present. (And, since
this is a dependency of the RPi2 work, it would let us stack that on
top, too).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150812/0d1a7c0d/attachment-0001.sig>

#4 lore raw

PATCH v4 2/8 clk: Add a Raspberry Pi-specific clock driver.

In reply to Eric Anholt

Unfortunately, the clock manager's registers are not accessible by the ARM, so we have to request that the firmware modify our clocks for us.

This driver only registers the clocks at the point they are requested by a client driver. This is partially to support returning -EPROBE_DEFER when the firmware driver isn't supported yet, but it also avoids issues with disabling "unused" clocks due to them not yet being connected to their consumers in the DT.

---

v2: Declare the mutex static (from review by Baruch Siach), merge
description and copyright comments.

v3: Update for new rpi firmware API. Update the compatible string.
Make the firmware handle be under a vendor-namespaced property. Make the DT indices match the firmware clock IDs. Move the driver under the firmware driver's Kconfig, since it requires it. Move a container_of() from 2 callers into the callee.

v4: Update commit message to mention subsystem. Add #defines for a
couple of bitfield checks, and use the bitfield check for rpi_clk_is_on(). Return an error when appropriate in rpi_clk_is_on(), and return specific rpi_firmware_property() errors in other places when we were only returning -EINVAL. Add some comment text describing how return values work from the firmware.

 drivers/clk/Makefile          |   1 +
 drivers/clk/clk-raspberrypi.c | 259 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 260 insertions(+)
 create mode 100644 drivers/clk/clk-raspberrypi.c
drivers/clk/Makefile +1 -0
index c4cf075..ad0a4a5 100644
@@ -20,6 +20,7 @@ obj-$(CONFIG_MACH_ASM9260)		+= clk-asm9260.o
 obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN)	+= clk-axi-clkgen.o
 obj-$(CONFIG_ARCH_AXXIA)		+= clk-axm5516.o
 obj-$(CONFIG_ARCH_BCM2835)		+= clk-bcm2835.o
+obj-$(CONFIG_RASPBERRYPI_FIRMWARE)	+= clk-raspberrypi.o
 obj-$(CONFIG_COMMON_CLK_CDCE706)	+= clk-cdce706.o
 obj-$(CONFIG_ARCH_CLPS711X)		+= clk-clps711x.o
 obj-$(CONFIG_ARCH_EFM32)		+= clk-efm32gg.o
drivers/clk/clk-raspberrypi.c new file +259 -0

259 lines not on this page · raw message

Signature · 1 line
2.1.4
#5 lore raw

Re: [PATCH v4 2/8] clk: Add a Raspberry Pi-specific clock driver.

Hi Eric,

Quoting Eric Anholt (2015-07-20 12:33:01)

drivers/clk/clk-raspberrypi.c line 259

Quoted 12 lines
drivers/clk/clk-raspberrypi.c new file +12 -0
+void __init rpi_firmware_init_clock_provider(struct device_node *node)
+{
+       /* We delay construction of our struct clks until get time,
+        * because we need to be able to return -EPROBE_DEFER if the
+        * firmware driver isn't up yet.  clk core doesn't support
+        * re-probing on -EPROBE_DEFER, but callers of clk_get can.
+        */
+       of_clk_add_provider(node, rpi_firmware_delayed_get_clk, node);
+}
+
+CLK_OF_DECLARE(rpi_firmware_clocks, "raspberrypi,bcm2835-firmware-clocks",
+              rpi_firmware_init_clock_provider);

Do you require CLK_OF_DECLARE here? Could this be a platform driver instead?

Regards,
Mike

Quoted 3 lines
Signature · 1 line
2.1.4
#6 lore raw

Re: [PATCH v4 2/8] clk: Add a Raspberry Pi-specific clock driver.

Quoted 18 lines · Michael Turquette

Hi Eric,

Quoting Eric Anholt (2015-07-20 12:33:01)

drivers/clk/clk-raspberrypi.c line 259

Quoted 12 lines
drivers/clk/clk-raspberrypi.c new file +12 -0
+void __init rpi_firmware_init_clock_provider(struct device_node *node)
+{
+       /* We delay construction of our struct clks until get time,
+        * because we need to be able to return -EPROBE_DEFER if the
+        * firmware driver isn't up yet.  clk core doesn't support
+        * re-probing on -EPROBE_DEFER, but callers of clk_get can.
+        */
+       of_clk_add_provider(node, rpi_firmware_delayed_get_clk, node);
+}
+
+CLK_OF_DECLARE(rpi_firmware_clocks, "raspberrypi,bcm2835-firmware-clocks",
+              rpi_firmware_init_clock_provider);

Do you require CLK_OF_DECLARE here? Could this be a platform driver instead?

I'm not actually sure. The common pattern seemed to be using
CLK_OF_DECLARE (130 files using it versus declaring a struct
platform_driver), and it seems to avoid a whole lot of boilerplate.
What would the advantage be?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150812/82521ee8/attachment.sig>

#7 lore raw

Re: [PATCH v4 2/8] clk: Add a Raspberry Pi-specific clock driver.

Quoting Eric Anholt (2015-08-12 11:04:05)

Quoted 21 lines
Quoted 18 lines · Michael Turquette

Hi Eric,

Quoting Eric Anholt (2015-07-20 12:33:01)

drivers/clk/clk-raspberrypi.c line 259

Quoted 12 lines
drivers/clk/clk-raspberrypi.c new file +12 -0
+void __init rpi_firmware_init_clock_provider(struct device_node *node)
+{
+       /* We delay construction of our struct clks until get time,
+        * because we need to be able to return -EPROBE_DEFER if the
+        * firmware driver isn't up yet.  clk core doesn't support
+        * re-probing on -EPROBE_DEFER, but callers of clk_get can.
+        */
+       of_clk_add_provider(node, rpi_firmware_delayed_get_clk, node);
+}
+
+CLK_OF_DECLARE(rpi_firmware_clocks, "raspberrypi,bcm2835-firmware-clocks",
+              rpi_firmware_init_clock_provider);

Do you require CLK_OF_DECLARE here? Could this be a platform driver instead?

Quoted 4 lines

I'm not actually sure. The common pattern seemed to be using CLK_OF_DECLARE (130 files using it versus declaring a struct platform_driver), and it seems to avoid a whole lot of boilerplate. What would the advantage be?

Correctly using the Linux driver model, having a nice struct device and things like supsend and resume handlers, etc.

There is a lot of CLK_OF_DECLARE going on in drivers/clk, but I am hoping we can fix that. The main reason for CLK_OF_DECLARE is when you need to register clocks very early (e.g. timers). This is often not the case.

Regards,
Mike

#8 lore raw

PATCH v4 3/8 ARM: bcm2835: Add DT for the firmware clocks driver.

In reply to Eric Anholt

---

v2: Rename our compat string to mention bcm2835, and make our firmware
phandle be under a vendor-namespaced property.

 arch/arm/boot/dts/bcm2835-rpi.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/bcm2835-rpi.dtsi +6 -0
index ab5474e..7cc47fb 100644
@@ -20,6 +20,12 @@
 			compatible = "raspberrypi,bcm2835-firmware";
 			mboxes = <&mailbox>;
 		};
+
+		firmware_clocks: firmware-clocks {
+			compatible = "raspberrypi,bcm2835-firmware-clocks";
+			#clock-cells = <1>;
+			raspberrypi,firmware = <&firmware>;
+		};
 	};
 };
 
Signature · 1 line
2.1.4
Acked-by on v4 3/8
#9 lore raw

Re: [PATCH v4 3/8] ARM: bcm2835: Add DT for the firmware clocks driver.

Quoted 9 lines · Eric Anholt

---

v2: Rename our compat string to mention bcm2835, and make our firmware
phandle be under a vendor-namespaced property.

 arch/arm/boot/dts/bcm2835-rpi.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

For my own reference:

Quoted 17 lines
arch/arm/boot/dts/bcm2835-rpi.dtsi +6 -0
index ab5474e..7cc47fb 100644
@@ -20,6 +20,12 @@
 			compatible = "raspberrypi,bcm2835-firmware";
 			mboxes = <&mailbox>;
 		};
+
+		firmware_clocks: firmware-clocks {
+			compatible = "raspberrypi,bcm2835-firmware-clocks";
+			#clock-cells = <1>;
+			raspberrypi,firmware = <&firmware>;
+		};
 	};
 };
 
#10 lore raw

PATCH v4 4/8 ARM: bcm2835: Drop never-used clock-frequency property of uart0.

In reply to Eric Anholt

This appears to have been copy-and-paste from another serial driver's DT. The driver has never used this value -- instead, the pl011 driver is getting the fixed 20201000.uart clock from clk-bcm2835.c.

---
 arch/arm/boot/dts/bcm2835.dtsi | 1 -
 1 file changed, 1 deletion(-)
arch/arm/boot/dts/bcm2835.dtsi +0 -1
index 301c73f..32f5830 100644
@@ -96,7 +96,6 @@
 			compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
 			reg = <0x7e201000 0x1000>;
 			interrupts = <2 25>;
-			clock-frequency = <3000000>;
 			arm,primecell-periphid = <0x00241011>;
 		};
 
Signature · 1 line
2.1.4
Acked-by on v4 4/8
#11 lore raw

Re: [PATCH v4 4/8] ARM: bcm2835: Drop never-used clock-frequency property of uart0.

Quoted 9 lines · Eric Anholt

This appears to have been copy-and-paste from another serial driver's DT. The driver has never used this value -- instead, the pl011 driver is getting the fixed 20201000.uart clock from clk-bcm2835.c.

---
 arch/arm/boot/dts/bcm2835.dtsi | 1 -
 1 file changed, 1 deletion(-)

For my own reference:

Quoted 12 lines
arch/arm/boot/dts/bcm2835.dtsi +0 -1
index 301c73f..32f5830 100644
@@ -96,7 +96,6 @@
 			compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
 			reg = <0x7e201000 0x1000>;
 			interrupts = <2 25>;
-			clock-frequency = <3000000>;
 			arm,primecell-periphid = <0x00241011>;
 		};
 
#12 lore raw

PATCH v4 5/8 clk: bcm2835: Drop the fixed sys_pclk.

In reply to Eric Anholt

Nothing uses it, and I can't find any evidence that anything ever has. Its role is now filled by the core clock in the firmware driver.

---
 drivers/clk/clk-bcm2835.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/clk/clk-bcm2835.c +0 -5
index 6b950ca..dd295e4 100644
@@ -32,11 +32,6 @@ void __init bcm2835_init_clocks(void)
 	struct clk *clk;
 	int ret;
 
-	clk = clk_register_fixed_rate(NULL, "sys_pclk", NULL, CLK_IS_ROOT,
-					250000000);
-	if (IS_ERR(clk))
-		pr_err("sys_pclk not registered\n");
-
 	clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT,
 					126000000);
 	if (IS_ERR(clk))
Signature · 1 line
2.1.4
#13 lore raw

Re: [PATCH v4 5/8] clk: bcm2835: Drop the fixed sys_pclk.

Quoting Eric Anholt (2015-07-20 12:33:04)

Quoted 5 lines

Nothing uses it, and I can't find any evidence that anything ever has. Its role is now filled by the core clock in the firmware driver.

Applied to clk-next.

Regards,
Mike

Quoted 23 lines
---
 drivers/clk/clk-bcm2835.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/clk/clk-bcm2835.c +0 -5
index 6b950ca..dd295e4 100644
@@ -32,11 +32,6 @@ void __init bcm2835_init_clocks(void)
        struct clk *clk;
        int ret;
 
-       clk = clk_register_fixed_rate(NULL, "sys_pclk", NULL, CLK_IS_ROOT,
-                                       250000000);
-       if (IS_ERR(clk))
-               pr_err("sys_pclk not registered\n");
-
        clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT,
                                        126000000);
        if (IS_ERR(clk))
Signature · 1 line
2.1.4
#14 lore raw

PATCH v4 6/8 ARM: bcm2835: Use the RPi firmware clocks for uart.

In reply to Eric Anholt

This gets us a correct apb_pclk, which previously was accidentally using the "20201000.uart" clock from clk-bcm2835.c, due to the fallback clk_get_sys() path.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 7 +++++++
 arch/arm/boot/dts/bcm2835.dtsi     | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arm/boot/dts/bcm2835-rpi.dtsi +7 -0
index 7cc47fb..9549eb8 100644
@@ -1,3 +1,4 @@
+#include <dt-bindings/clk/raspberrypi.h>
 #include "bcm2835.dtsi"
 
 / {
@@ -62,3 +63,9 @@
 	status = "okay";
 	bus-width = <4>;
 };
+
+&uart0 {
+	clocks = <&firmware_clocks RPI_CLOCK_UART0>,
+		 <&firmware_clocks RPI_CLOCK_CORE>;
+	clock-names = "uartclk", "apb_pclk";
+};
arch/arm/boot/dts/bcm2835.dtsi +1 -1
index 32f5830..5be2862 100644
@@ -92,7 +92,7 @@
 			#interrupt-cells = <2>;
 		};
 
-		uart at 7e201000 {
+		uart0: uart at 7e201000 {
 			compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
 			reg = <0x7e201000 0x1000>;
 			interrupts = <2 25>;
Signature · 1 line
2.1.4
Acked-by on v4 6/8
#15 lore raw

Re: [PATCH v4 6/8] ARM: bcm2835: Use the RPi firmware clocks for uart.

Quoted 10 lines · Eric Anholt

This gets us a correct apb_pclk, which previously was accidentally using the "20201000.uart" clock from clk-bcm2835.c, due to the fallback clk_get_sys() path.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 7 +++++++
 arch/arm/boot/dts/bcm2835.dtsi     | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

For my own reference:

Quoted 32 lines
arch/arm/boot/dts/bcm2835-rpi.dtsi +7 -0
index 7cc47fb..9549eb8 100644
@@ -1,3 +1,4 @@
+#include <dt-bindings/clk/raspberrypi.h>
 #include "bcm2835.dtsi"
 
 / {
@@ -62,3 +63,9 @@
 	status = "okay";
 	bus-width = <4>;
 };
+
+&uart0 {
+	clocks = <&firmware_clocks RPI_CLOCK_UART0>,
+		 <&firmware_clocks RPI_CLOCK_CORE>;
+	clock-names = "uartclk", "apb_pclk";
+};
arch/arm/boot/dts/bcm2835.dtsi +1 -1
index 32f5830..5be2862 100644
@@ -92,7 +92,7 @@
 			#interrupt-cells = <2>;
 		};
 
-		uart at 7e201000 {
+		uart0: uart at 7e201000 {
 			compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
 			reg = <0x7e201000 0x1000>;
 			interrupts = <2 25>;
#16 lore raw

PATCH v4 7/8 ARM: bcm2835: Tie SPI clock to the core clock rate.

In reply to Eric Anholt

We were previously using a fixed clock declared in the 2835 DT, but it's actually the core clock, and it might not be the same if you had adjusted it using the firmware's config.txt.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/bcm2835-rpi.dtsi +4 -0
index 9549eb8..0a32123 100644
@@ -69,3 +69,7 @@
 		 <&firmware_clocks RPI_CLOCK_CORE>;
 	clock-names = "uartclk", "apb_pclk";
 };
+
+&spi {
+	clocks = <&firmware_clocks RPI_CLOCK_CORE>;
+};
Signature · 1 line
2.1.4
Acked-by on v4 7/8
#17 lore raw

Re: [PATCH v4 7/8] ARM: bcm2835: Tie SPI clock to the core clock rate.

Quoted 9 lines · Eric Anholt

We were previously using a fixed clock declared in the 2835 DT, but it's actually the core clock, and it might not be the same if you had adjusted it using the firmware's config.txt.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

For my own reference:

Quoted 12 lines
arch/arm/boot/dts/bcm2835-rpi.dtsi +4 -0
index 9549eb8..0a32123 100644
@@ -69,3 +69,7 @@
 		 <&firmware_clocks RPI_CLOCK_CORE>;
 	clock-names = "uartclk", "apb_pclk";
 };
+
+&spi {
+	clocks = <&firmware_clocks RPI_CLOCK_CORE>;
+};
#18 lore raw

PATCH v4 8/8 ARM: bcm2835: Use the firmware on rpi to get the EMMC clock.

In reply to Eric Anholt

This updates the MMC frequency from 100Mhz to 250Mhz.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/bcm2835-rpi.dtsi +1 -0
index 0a32123..5d370cb 100644
@@ -62,6 +62,7 @@
 &sdhci {
 	status = "okay";
 	bus-width = <4>;
+	clocks = <&firmware_clocks RPI_CLOCK_EMMC>;
 };
 
 &uart0 {
Signature · 1 line
2.1.4
Acked-by on v4 8/8
#19 lore raw

Re: [PATCH v4 8/8] ARM: bcm2835: Use the firmware on rpi to get the EMMC clock.

Quoted 6 lines · Eric Anholt

This updates the MMC frequency from 100Mhz to 250Mhz.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 1 +
 1 file changed, 1 insertion(+)

For my own reference:

Quoted 12 lines
arch/arm/boot/dts/bcm2835-rpi.dtsi +1 -0
index 0a32123..5d370cb 100644
@@ -62,6 +62,7 @@
 &sdhci {
 	status = "okay";
 	bus-width = <4>;
+	clocks = <&firmware_clocks RPI_CLOCK_EMMC>;
 };
 
 &uart0 {