* [PATCH v4 0/8] Update Kona drivers to use clocks
@ 2013-12-05 19:20 Tim Kryger
2013-12-05 19:20 ` [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351 Tim Kryger
` (7 more replies)
0 siblings, 8 replies; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Tim Kryger, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
This series declares the clocks present on bcm11351 (aka bcm281xx) SoCs
to be fixed at the rates configured by development bootloaders and then
updates the Kona drivers to make use of clock calls where appropriate.
Changes in v4:
- Rebased on v3.13-rc2
- DT binding documents now say "phandle + clock specifier pair"
- Recent change by Axel to use sdhci_pltfm_unregister must be undone
to allow clk_disable_unprepare to be called at the right point in
sdhci_bcm_kona_remove
Changes in v3:
- Updated the commit message for the UART DTS change
- Added a patch to change the kona timer binding doc
- Updated the commit message for the kona timer driver change
- Updated the panic message in the kona timer driver
- Added a patch to change the kona sdhci binding doc
- Moved the SDHCI driver change earlier in the series
- Removed unrelated change from SDHCI driver patch
Changes in v2:
- Renamed bsc4_clk to pmu_bsc_clk
Tim Kryger (8):
ARM: dts: Declare clocks as fixed on bcm11351
ARM: dts: Specify clocks for UARTs on bcm11351
Documentation: dt: kona-sdhci: Add clocks property
ARM: dts: Specify clocks for SDHCIs on bcm11351
mmc: sdhci-bcm-kona: Add basic use of clocks
Documentation: dt: kona-timer: Add clocks property
clocksource: kona: Add basic use of external clock
ARM: dts: Specify clocks for timer on bcm11351
.../devicetree/bindings/arm/bcm/kona-timer.txt | 7 +-
.../devicetree/bindings/mmc/kona-sdhci.txt | 4 +
arch/arm/boot/dts/bcm11351.dtsi | 111 ++++++++++++++++++++-
drivers/clocksource/bcm_kona_timer.c | 14 ++-
drivers/mmc/host/sdhci-bcm-kona.c | 37 ++++++-
5 files changed, 162 insertions(+), 11 deletions(-)
--
1.8.0.1
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-10 7:18 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 2/8] ARM: dts: Specify clocks for UARTs " Tim Kryger
` (6 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
Declare clocks that are enabled and configured by bootloaders as fixed
rate clocks in the DTS such that device drivers may use standard clock
function calls.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
arch/arm/boot/dts/bcm11351.dtsi | 97 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index b0c0610..eca6fbc 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -142,4 +142,101 @@
status = "disabled";
};
+ clocks {
+ bsc1_clk: bsc1 {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ bsc2_clk: bsc2 {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ bsc3_clk: bsc3 {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ pmu_bsc_clk: pmu_bsc {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ hub_timer_clk: hub_timer {
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ #clock-cells = <0>;
+ };
+
+ pwm_clk: pwm {
+ compatible = "fixed-clock";
+ clock-frequency = <26000000>;
+ #clock-cells = <0>;
+ };
+
+ sdio1_clk: sdio1 {
+ compatible = "fixed-clock";
+ clock-frequency = <48000000>;
+ #clock-cells = <0>;
+ };
+
+ sdio2_clk: sdio2 {
+ compatible = "fixed-clock";
+ clock-frequency = <48000000>;
+ #clock-cells = <0>;
+ };
+
+ sdio3_clk: sdio3 {
+ compatible = "fixed-clock";
+ clock-frequency = <48000000>;
+ #clock-cells = <0>;
+ };
+
+ sdio4_clk: sdio4 {
+ compatible = "fixed-clock";
+ clock-frequency = <48000000>;
+ #clock-cells = <0>;
+ };
+
+ tmon_1m_clk: tmon_1m {
+ compatible = "fixed-clock";
+ clock-frequency = <1000000>;
+ #clock-cells = <0>;
+ };
+
+ uartb_clk: uartb {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ uartb2_clk: uartb2 {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ uartb3_clk: uartb3 {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ uartb4_clk: uartb4 {
+ compatible = "fixed-clock";
+ clock-frequency = <13000000>;
+ #clock-cells = <0>;
+ };
+
+ usb_otg_ahb_clk: usb_otg_ahb {
+ compatible = "fixed-clock";
+ clock-frequency = <52000000>;
+ #clock-cells = <0>;
+ };
+ };
};
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 2/8] ARM: dts: Specify clocks for UARTs on bcm11351
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
2013-12-05 19:20 ` [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351 Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-13 7:56 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 3/8] Documentation: dt: kona-sdhci: Add clocks property Tim Kryger
` (5 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
The frequency property in "snps,dw-apb-uart" entries are no longer
required if the rate of the external clock can be determined using the
clk api (see e302cd9 serial: 8250_dw: add support for clk api).
This patch replaces the frequency property in the UART nodes of
bcm11351.dtsi with references to the relevant clocks following the
common clock binding.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
arch/arm/boot/dts/bcm11351.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index eca6fbc..9b99c52 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -43,7 +43,7 @@
compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
status = "disabled";
reg = <0x3e000000 0x1000>;
- clock-frequency = <13000000>;
+ clocks = <&uartb_clk>;
interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
@@ -53,7 +53,7 @@
compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
status = "disabled";
reg = <0x3e001000 0x1000>;
- clock-frequency = <13000000>;
+ clocks = <&uartb2_clk>;
interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
@@ -63,7 +63,7 @@
compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
status = "disabled";
reg = <0x3e002000 0x1000>;
- clock-frequency = <13000000>;
+ clocks = <&uartb3_clk>;
interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
@@ -73,7 +73,7 @@
compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
status = "disabled";
reg = <0x3e003000 0x1000>;
- clock-frequency = <13000000>;
+ clocks = <&uartb4_clk>;
interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
reg-io-width = <4>;
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 3/8] Documentation: dt: kona-sdhci: Add clocks property
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
2013-12-05 19:20 ` [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351 Tim Kryger
2013-12-05 19:20 ` [PATCH v4 2/8] ARM: dts: Specify clocks for UARTs " Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-13 8:02 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 4/8] ARM: dts: Specify clocks for SDHCIs on bcm11351 Tim Kryger
` (4 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
The Kona SDHCI block requires a clock that must be specified in the
device tree. Update the documentation to reflect this requirement.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
Documentation/devicetree/bindings/mmc/kona-sdhci.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/kona-sdhci.txt b/Documentation/devicetree/bindings/mmc/kona-sdhci.txt
index 789fb07..aaba248 100644
--- a/Documentation/devicetree/bindings/mmc/kona-sdhci.txt
+++ b/Documentation/devicetree/bindings/mmc/kona-sdhci.txt
@@ -6,12 +6,16 @@ and the properties present in the bcm281xx SDHCI
Required properties:
- compatible : Should be "brcm,kona-sdhci"
- DEPRECATED: compatible : Should be "bcm,kona-sdhci"
+- clocks: phandle + clock specifier pair of the external clock
+
+Refer to clocks/clock-bindings.txt for generic clock consumer properties.
Example:
sdio2: sdio@0x3f1a0000 {
compatible = "brcm,kona-sdhci";
reg = <0x3f1a0000 0x10000>;
+ clocks = <&sdio3_clk>;
interrupts = <0x0 74 0x4>;
};
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 4/8] ARM: dts: Specify clocks for SDHCIs on bcm11351
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
` (2 preceding siblings ...)
2013-12-05 19:20 ` [PATCH v4 3/8] Documentation: dt: kona-sdhci: Add clocks property Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-13 8:22 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks Tim Kryger
` (3 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
Specify the external clock label in each SDHCI node.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
arch/arm/boot/dts/bcm11351.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index 9b99c52..25ca128 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -118,6 +118,7 @@
compatible = "brcm,kona-sdhci";
reg = <0x3f180000 0x10000>;
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sdio1_clk>;
status = "disabled";
};
@@ -125,6 +126,7 @@
compatible = "brcm,kona-sdhci";
reg = <0x3f190000 0x10000>;
interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sdio2_clk>;
status = "disabled";
};
@@ -132,6 +134,7 @@
compatible = "brcm,kona-sdhci";
reg = <0x3f1a0000 0x10000>;
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sdio3_clk>;
status = "disabled";
};
@@ -139,6 +142,7 @@
compatible = "brcm,kona-sdhci";
reg = <0x3f1b0000 0x10000>;
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sdio4_clk>;
status = "disabled";
};
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
` (3 preceding siblings ...)
2013-12-05 19:20 ` [PATCH v4 4/8] ARM: dts: Specify clocks for SDHCIs on bcm11351 Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-14 8:14 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 6/8] Documentation: dt: kona-timer: Add clocks property Tim Kryger
` (2 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Tim Kryger, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
Enable the external clock needed by the host controller during the
probe and disable it during the remove.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
drivers/mmc/host/sdhci-bcm-kona.c | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index 7a190fe..923eefa 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -54,6 +54,7 @@
struct sdhci_bcm_kona_dev {
struct mutex write_lock; /* protect back to back writes */
+ struct clk *external_clk;
};
@@ -257,6 +258,24 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)
goto err_pltfm_free;
}
+ /* Get and enable the external clock */
+ kona_dev->external_clk = devm_clk_get(dev, NULL);
+ if (IS_ERR(kona_dev->external_clk)) {
+ dev_err(dev, "Failed to get external clock\n");
+ ret = PTR_ERR(kona_dev->external_clk);
+ goto err_pltfm_free;
+ }
+
+ if (clk_set_rate(kona_dev->external_clk, host->mmc->f_max) != 0) {
+ dev_err(dev, "Failed to set rate external clock\n");
+ goto err_pltfm_free;
+ }
+
+ if (clk_prepare_enable(kona_dev->external_clk) != 0) {
+ dev_err(dev, "Failed to enable external clock\n");
+ goto err_pltfm_free;
+ }
+
dev_dbg(dev, "non-removable=%c\n",
(host->mmc->caps & MMC_CAP_NONREMOVABLE) ? 'Y' : 'N');
dev_dbg(dev, "cd_gpio %c, wp_gpio %c\n",
@@ -271,7 +290,7 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)
ret = sdhci_bcm_kona_sd_reset(host);
if (ret)
- goto err_pltfm_free;
+ goto err_clk_disable;
sdhci_bcm_kona_sd_init(host);
@@ -307,6 +326,9 @@ err_remove_host:
err_reset:
sdhci_bcm_kona_sd_reset(host);
+err_clk_disable:
+ clk_disable_unprepare(kona_dev->external_clk);
+
err_pltfm_free:
sdhci_pltfm_free(pdev);
@@ -316,7 +338,18 @@ err_pltfm_free:
static int __exit sdhci_bcm_kona_remove(struct platform_device *pdev)
{
- return sdhci_pltfm_unregister(pdev);
+ struct sdhci_host *host = platform_get_drvdata(pdev);
+ struct sdhci_pltfm_host *pltfm_priv = sdhci_priv(host);
+ struct sdhci_bcm_kona_dev *kona_dev = sdhci_pltfm_priv(pltfm_priv);
+ int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
+
+ sdhci_remove_host(host, dead);
+
+ clk_disable_unprepare(kona_dev->external_clk);
+
+ sdhci_pltfm_free(pdev);
+
+ return 0;
}
static struct platform_driver sdhci_bcm_kona_driver = {
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 6/8] Documentation: dt: kona-timer: Add clocks property
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
` (4 preceding siblings ...)
2013-12-05 19:20 ` [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-14 8:19 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 7/8] clocksource: kona: Add basic use of external clock Tim Kryger
2013-12-05 19:20 ` [PATCH v4 8/8] ARM: dts: Specify clocks for timer on bcm11351 Tim Kryger
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
The frequency for the Kona timer can either be specified through the
device tree or determined by checking the rate of the clock specified
in the device tree. Update the documentation to reflect both ways.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
Documentation/devicetree/bindings/arm/bcm/kona-timer.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt b/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt
index 17d88b2..39adf54 100644
--- a/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt
+++ b/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt
@@ -8,13 +8,18 @@ Required properties:
- DEPRECATED: compatible : "bcm,kona-timer"
- reg : Register range for the timer
- interrupts : interrupt for the timer
+- clocks: phandle + clock specifier pair of the external clock
- clock-frequency: frequency that the clock operates
+Only one of clocks or clock-frequency should be specified.
+
+Refer to clocks/clock-bindings.txt for generic clock consumer properties.
+
Example:
timer@35006000 {
compatible = "brcm,kona-timer";
reg = <0x35006000 0x1000>;
interrupts = <0x0 7 0x4>;
- clock-frequency = <32768>;
+ clocks = <&hub_timer_clk>;
};
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 7/8] clocksource: kona: Add basic use of external clock
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
` (5 preceding siblings ...)
2013-12-05 19:20 ` [PATCH v4 6/8] Documentation: dt: kona-timer: Add clocks property Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-14 8:26 ` Christian Daudt
2013-12-16 10:34 ` Daniel Lezcano
2013-12-05 19:20 ` [PATCH v4 8/8] ARM: dts: Specify clocks for timer on bcm11351 Tim Kryger
7 siblings, 2 replies; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
When an clock is specified in the device tree, enable it and use it to
determine the external clock frequency.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
drivers/clocksource/bcm_kona_timer.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
index 0d7d8c3..8a4ab36 100644
--- a/drivers/clocksource/bcm_kona_timer.c
+++ b/drivers/clocksource/bcm_kona_timer.c
@@ -17,6 +17,7 @@
#include <linux/jiffies.h>
#include <linux/clockchips.h>
#include <linux/types.h>
+#include <linux/clk.h>
#include <linux/io.h>
#include <asm/mach/time.h>
@@ -107,11 +108,18 @@ static const struct of_device_id bcm_timer_ids[] __initconst = {
static void __init kona_timers_init(struct device_node *node)
{
u32 freq;
+ struct clk *external_clk;
- if (!of_property_read_u32(node, "clock-frequency", &freq))
+ external_clk = of_clk_get_by_name(node, NULL);
+
+ if (!IS_ERR(external_clk)) {
+ arch_timer_rate = clk_get_rate(external_clk);
+ clk_prepare_enable(external_clk);
+ } else if (!of_property_read_u32(node, "clock-frequency", &freq)) {
arch_timer_rate = freq;
- else
- panic("clock-frequency not set in the .dts file");
+ } else {
+ panic("unable to determine clock-frequency");
+ }
/* Setup IRQ numbers */
timers.tmr_irq = irq_of_parse_and_map(node, 0);
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 8/8] ARM: dts: Specify clocks for timer on bcm11351
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
` (6 preceding siblings ...)
2013-12-05 19:20 ` [PATCH v4 7/8] clocksource: kona: Add basic use of external clock Tim Kryger
@ 2013-12-05 19:20 ` Tim Kryger
2013-12-13 8:06 ` Christian Daudt
7 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-05 19:20 UTC (permalink / raw)
To: Christian Daudt, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Daniel Lezcano, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linaro Patches List, Tim Kryger, Linux MMC List,
Linux Kernel Mailing List, Linux ARM Kernel List
Specify the external clock label in the timer node.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
---
arch/arm/boot/dts/bcm11351.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index 25ca128..1246885 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -95,7 +95,7 @@
compatible = "brcm,kona-timer";
reg = <0x35006000 0x1000>;
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
- clock-frequency = <32768>;
+ clocks = <&hub_timer_clk>;
};
gpio: gpio@35003000 {
--
1.8.0.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351
2013-12-05 19:20 ` [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351 Tim Kryger
@ 2013-12-10 7:18 ` Christian Daudt
2013-12-10 20:26 ` Tim Kryger
0 siblings, 1 reply; 24+ messages in thread
From: Christian Daudt @ 2013-12-10 7:18 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
Applied to armsoc/for-3.14/dt
thanks,
csd
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> Declare clocks that are enabled and configured by bootloaders as fixed
> rate clocks in the DTS such that device drivers may use standard clock
> function calls.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
> arch/arm/boot/dts/bcm11351.dtsi | 97 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 97 insertions(+)
>
> diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
> index b0c0610..eca6fbc 100644
> --- a/arch/arm/boot/dts/bcm11351.dtsi
> +++ b/arch/arm/boot/dts/bcm11351.dtsi
> @@ -142,4 +142,101 @@
> status = "disabled";
> };
>
> + clocks {
> + bsc1_clk: bsc1 {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + bsc2_clk: bsc2 {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + bsc3_clk: bsc3 {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + pmu_bsc_clk: pmu_bsc {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + hub_timer_clk: hub_timer {
> + compatible = "fixed-clock";
> + clock-frequency = <32768>;
> + #clock-cells = <0>;
> + };
> +
> + pwm_clk: pwm {
> + compatible = "fixed-clock";
> + clock-frequency = <26000000>;
> + #clock-cells = <0>;
> + };
> +
> + sdio1_clk: sdio1 {
> + compatible = "fixed-clock";
> + clock-frequency = <48000000>;
> + #clock-cells = <0>;
> + };
> +
> + sdio2_clk: sdio2 {
> + compatible = "fixed-clock";
> + clock-frequency = <48000000>;
> + #clock-cells = <0>;
> + };
> +
> + sdio3_clk: sdio3 {
> + compatible = "fixed-clock";
> + clock-frequency = <48000000>;
> + #clock-cells = <0>;
> + };
> +
> + sdio4_clk: sdio4 {
> + compatible = "fixed-clock";
> + clock-frequency = <48000000>;
> + #clock-cells = <0>;
> + };
> +
> + tmon_1m_clk: tmon_1m {
> + compatible = "fixed-clock";
> + clock-frequency = <1000000>;
> + #clock-cells = <0>;
> + };
> +
> + uartb_clk: uartb {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + uartb2_clk: uartb2 {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + uartb3_clk: uartb3 {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + uartb4_clk: uartb4 {
> + compatible = "fixed-clock";
> + clock-frequency = <13000000>;
> + #clock-cells = <0>;
> + };
> +
> + usb_otg_ahb_clk: usb_otg_ahb {
> + compatible = "fixed-clock";
> + clock-frequency = <52000000>;
> + #clock-cells = <0>;
> + };
> + };
> };
> --
> 1.8.0.1
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351
2013-12-10 7:18 ` Christian Daudt
@ 2013-12-10 20:26 ` Tim Kryger
2013-12-13 7:48 ` Christian Daudt
0 siblings, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2013-12-10 20:26 UTC (permalink / raw)
To: Christian Daudt
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Mon, Dec 9, 2013 at 11:18 PM, Christian Daudt <bcm@fixthebug.org> wrote:
> Applied to armsoc/for-3.14/dt
Could you wait till other maintainers provide their acks and then take
the entire series into a branch that feeds into the arm-soc
drivers-for-linus branch?
Thanks,
Tim Kryger
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351
2013-12-10 20:26 ` Tim Kryger
@ 2013-12-13 7:48 ` Christian Daudt
2013-12-13 15:56 ` Tim Kryger
0 siblings, 1 reply; 24+ messages in thread
From: Christian Daudt @ 2013-12-13 7:48 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Tue, Dec 10, 2013 at 12:26 PM, Tim Kryger <tim.kryger@linaro.org> wrote:
> On Mon, Dec 9, 2013 at 11:18 PM, Christian Daudt <bcm@fixthebug.org> wrote:
>> Applied to armsoc/for-3.14/dt
>
> Could you wait till other maintainers provide their acks and then take
> the entire series into a branch that feeds into the arm-soc
> drivers-for-linus branch?
>
> Thanks,
> Tim Kryger
I'll try to sync with other maintainers to pull it in together. I'll
leave this commit in as-is for now as it is harmless on its own. I'll
back it off before 3.14 merge if it poses a problem.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 2/8] ARM: dts: Specify clocks for UARTs on bcm11351
2013-12-05 19:20 ` [PATCH v4 2/8] ARM: dts: Specify clocks for UARTs " Tim Kryger
@ 2013-12-13 7:56 ` Christian Daudt
0 siblings, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-13 7:56 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> The frequency property in "snps,dw-apb-uart" entries are no longer
> required if the rate of the external clock can be determined using the
> clk api (see e302cd9 serial: 8250_dw: add support for clk api).
>
> This patch replaces the frequency property in the UART nodes of
> bcm11351.dtsi with references to the relevant clocks following the
> common clock binding.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
> arch/arm/boot/dts/bcm11351.dtsi | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
> index eca6fbc..9b99c52 100644
> --- a/arch/arm/boot/dts/bcm11351.dtsi
> +++ b/arch/arm/boot/dts/bcm11351.dtsi
> @@ -43,7 +43,7 @@
> compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
> status = "disabled";
> reg = <0x3e000000 0x1000>;
> - clock-frequency = <13000000>;
> + clocks = <&uartb_clk>;
> interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
> reg-shift = <2>;
> reg-io-width = <4>;
> @@ -53,7 +53,7 @@
> compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
> status = "disabled";
> reg = <0x3e001000 0x1000>;
> - clock-frequency = <13000000>;
> + clocks = <&uartb2_clk>;
> interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
> reg-shift = <2>;
> reg-io-width = <4>;
> @@ -63,7 +63,7 @@
> compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
> status = "disabled";
> reg = <0x3e002000 0x1000>;
> - clock-frequency = <13000000>;
> + clocks = <&uartb3_clk>;
> interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
> reg-shift = <2>;
> reg-io-width = <4>;
> @@ -73,7 +73,7 @@
> compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
> status = "disabled";
> reg = <0x3e003000 0x1000>;
> - clock-frequency = <13000000>;
> + clocks = <&uartb4_clk>;
> interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> reg-shift = <2>;
> reg-io-width = <4>;
> --
> 1.8.0.1
>
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 3/8] Documentation: dt: kona-sdhci: Add clocks property
2013-12-05 19:20 ` [PATCH v4 3/8] Documentation: dt: kona-sdhci: Add clocks property Tim Kryger
@ 2013-12-13 8:02 ` Christian Daudt
0 siblings, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-13 8:02 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> The Kona SDHCI block requires a clock that must be specified in the
> device tree. Update the documentation to reflect this requirement.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
> Documentation/devicetree/bindings/mmc/kona-sdhci.txt | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/kona-sdhci.txt b/Documentation/devicetree/bindings/mmc/kona-sdhci.txt
> index 789fb07..aaba248 100644
> --- a/Documentation/devicetree/bindings/mmc/kona-sdhci.txt
> +++ b/Documentation/devicetree/bindings/mmc/kona-sdhci.txt
> @@ -6,12 +6,16 @@ and the properties present in the bcm281xx SDHCI
> Required properties:
> - compatible : Should be "brcm,kona-sdhci"
> - DEPRECATED: compatible : Should be "bcm,kona-sdhci"
> +- clocks: phandle + clock specifier pair of the external clock
> +
> +Refer to clocks/clock-bindings.txt for generic clock consumer properties.
>
> Example:
>
> sdio2: sdio@0x3f1a0000 {
> compatible = "brcm,kona-sdhci";
> reg = <0x3f1a0000 0x10000>;
> + clocks = <&sdio3_clk>;
> interrupts = <0x0 74 0x4>;
> };
>
> --
> 1.8.0.1
>
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 8/8] ARM: dts: Specify clocks for timer on bcm11351
2013-12-05 19:20 ` [PATCH v4 8/8] ARM: dts: Specify clocks for timer on bcm11351 Tim Kryger
@ 2013-12-13 8:06 ` Christian Daudt
0 siblings, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-13 8:06 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> Specify the external clock label in the timer node.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
> arch/arm/boot/dts/bcm11351.dtsi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
> index 25ca128..1246885 100644
> --- a/arch/arm/boot/dts/bcm11351.dtsi
> +++ b/arch/arm/boot/dts/bcm11351.dtsi
> @@ -95,7 +95,7 @@
> compatible = "brcm,kona-timer";
> reg = <0x35006000 0x1000>;
> interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
> - clock-frequency = <32768>;
> + clocks = <&hub_timer_clk>;
> };
>
> gpio: gpio@35003000 {
> --
> 1.8.0.1
>
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 4/8] ARM: dts: Specify clocks for SDHCIs on bcm11351
2013-12-05 19:20 ` [PATCH v4 4/8] ARM: dts: Specify clocks for SDHCIs on bcm11351 Tim Kryger
@ 2013-12-13 8:22 ` Christian Daudt
0 siblings, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-13 8:22 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> Specify the external clock label in each SDHCI node.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
> arch/arm/boot/dts/bcm11351.dtsi | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
> index 9b99c52..25ca128 100644
> --- a/arch/arm/boot/dts/bcm11351.dtsi
> +++ b/arch/arm/boot/dts/bcm11351.dtsi
> @@ -118,6 +118,7 @@
> compatible = "brcm,kona-sdhci";
> reg = <0x3f180000 0x10000>;
> interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sdio1_clk>;
> status = "disabled";
> };
>
> @@ -125,6 +126,7 @@
> compatible = "brcm,kona-sdhci";
> reg = <0x3f190000 0x10000>;
> interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sdio2_clk>;
> status = "disabled";
> };
>
> @@ -132,6 +134,7 @@
> compatible = "brcm,kona-sdhci";
> reg = <0x3f1a0000 0x10000>;
> interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sdio3_clk>;
> status = "disabled";
> };
>
> @@ -139,6 +142,7 @@
> compatible = "brcm,kona-sdhci";
> reg = <0x3f1b0000 0x10000>;
> interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sdio4_clk>;
> status = "disabled";
> };
>
> --
> 1.8.0.1
>
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351
2013-12-13 7:48 ` Christian Daudt
@ 2013-12-13 15:56 ` Tim Kryger
0 siblings, 0 replies; 24+ messages in thread
From: Tim Kryger @ 2013-12-13 15:56 UTC (permalink / raw)
To: Christian Daudt
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 12, 2013 at 11:48 PM, Christian Daudt <bcm@fixthebug.org> wrote:
> I'll try to sync with other maintainers to pull it in together. I'll
> leave this commit in as-is for now as it is harmless on its own. I'll
> back it off before 3.14 merge if it poses a problem.
Sounds great. Thank you.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
2013-12-05 19:20 ` [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks Tim Kryger
@ 2013-12-14 8:14 ` Christian Daudt
2013-12-23 8:26 ` Christian Daudt
2014-01-07 19:37 ` Tim Kryger
0 siblings, 2 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-14 8:14 UTC (permalink / raw)
To: Tim Kryger, Chris Ball
Cc: Mark Rutland, Device Tree List, Axel Lin, Pawel Moll,
Ian Campbell, Daniel Lezcano, Linux MMC List,
Linux Kernel Mailing List, Rob Herring, Linaro Patches List,
Stephen Warren, Thomas Gleixner, Linux ARM Kernel List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> Enable the external clock needed by the host controller during the
> probe and disable it during the remove.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
Chris,
Are you ok with me pulling this patch along with the rest of the
patchset into the bcm tree?
Thanks,
csd
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 6/8] Documentation: dt: kona-timer: Add clocks property
2013-12-05 19:20 ` [PATCH v4 6/8] Documentation: dt: kona-timer: Add clocks property Tim Kryger
@ 2013-12-14 8:19 ` Christian Daudt
0 siblings, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-14 8:19 UTC (permalink / raw)
To: Tim Kryger
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Chris Ball,
Axel Lin, Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> The frequency for the Kona timer can either be specified through the
> device tree or determined by checking the rate of the clock specified
> in the device tree. Update the documentation to reflect both ways.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
> Documentation/devicetree/bindings/arm/bcm/kona-timer.txt | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt b/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt
> index 17d88b2..39adf54 100644
> --- a/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt
> +++ b/Documentation/devicetree/bindings/arm/bcm/kona-timer.txt
> @@ -8,13 +8,18 @@ Required properties:
> - DEPRECATED: compatible : "bcm,kona-timer"
> - reg : Register range for the timer
> - interrupts : interrupt for the timer
> +- clocks: phandle + clock specifier pair of the external clock
> - clock-frequency: frequency that the clock operates
>
> +Only one of clocks or clock-frequency should be specified.
> +
> +Refer to clocks/clock-bindings.txt for generic clock consumer properties.
> +
> Example:
> timer@35006000 {
> compatible = "brcm,kona-timer";
> reg = <0x35006000 0x1000>;
> interrupts = <0x0 7 0x4>;
> - clock-frequency = <32768>;
> + clocks = <&hub_timer_clk>;
> };
>
> --
> 1.8.0.1
>
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 7/8] clocksource: kona: Add basic use of external clock
2013-12-05 19:20 ` [PATCH v4 7/8] clocksource: kona: Add basic use of external clock Tim Kryger
@ 2013-12-14 8:26 ` Christian Daudt
2013-12-16 10:34 ` Daniel Lezcano
1 sibling, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-14 8:26 UTC (permalink / raw)
To: Tim Kryger, Daniel Lezcano
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Thomas Gleixner, Chris Ball, Axel Lin,
Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> When an clock is specified in the device tree, enable it and use it to
> determine the external clock frequency.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
> ---
Reviewed-by: Christian Daudt <bcm@fixthebug.org>
Daniel,
Are you ok with me pulling this patch in with the rest of the
patchset into the bcm tree ?
Thanks,
csd
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 7/8] clocksource: kona: Add basic use of external clock
2013-12-05 19:20 ` [PATCH v4 7/8] clocksource: kona: Add basic use of external clock Tim Kryger
2013-12-14 8:26 ` Christian Daudt
@ 2013-12-16 10:34 ` Daniel Lezcano
1 sibling, 0 replies; 24+ messages in thread
From: Daniel Lezcano @ 2013-12-16 10:34 UTC (permalink / raw)
To: Tim Kryger, Christian Daudt, Rob Herring, Pawel Moll,
Mark Rutland, Stephen Warren, Ian Campbell, Thomas Gleixner,
Chris Ball, Axel Lin
Cc: Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On 12/05/2013 08:20 PM, Tim Kryger wrote:
> When an clock is specified in the device tree, enable it and use it to
> determine the external clock frequency.
>
> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Matt Porter <matt.porter@linaro.org>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/clocksource/bcm_kona_timer.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
> index 0d7d8c3..8a4ab36 100644
> --- a/drivers/clocksource/bcm_kona_timer.c
> +++ b/drivers/clocksource/bcm_kona_timer.c
> @@ -17,6 +17,7 @@
> #include <linux/jiffies.h>
> #include <linux/clockchips.h>
> #include <linux/types.h>
> +#include <linux/clk.h>
>
> #include <linux/io.h>
> #include <asm/mach/time.h>
> @@ -107,11 +108,18 @@ static const struct of_device_id bcm_timer_ids[] __initconst = {
> static void __init kona_timers_init(struct device_node *node)
> {
> u32 freq;
> + struct clk *external_clk;
>
> - if (!of_property_read_u32(node, "clock-frequency", &freq))
> + external_clk = of_clk_get_by_name(node, NULL);
> +
> + if (!IS_ERR(external_clk)) {
> + arch_timer_rate = clk_get_rate(external_clk);
> + clk_prepare_enable(external_clk);
> + } else if (!of_property_read_u32(node, "clock-frequency", &freq)) {
> arch_timer_rate = freq;
> - else
> - panic("clock-frequency not set in the .dts file");
> + } else {
> + panic("unable to determine clock-frequency");
> + }
>
> /* Setup IRQ numbers */
> timers.tmr_irq = irq_of_parse_and_map(node, 0);
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
2013-12-14 8:14 ` Christian Daudt
@ 2013-12-23 8:26 ` Christian Daudt
2014-01-07 19:37 ` Tim Kryger
1 sibling, 0 replies; 24+ messages in thread
From: Christian Daudt @ 2013-12-23 8:26 UTC (permalink / raw)
To: Tim Kryger, Chris Ball
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Axel Lin,
Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List
On Sat, Dec 14, 2013 at 12:14 AM, Christian Daudt <bcm@fixthebug.org> wrote:
> On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
>> Enable the external clock needed by the host controller during the
>> probe and disable it during the remove.
>>
>> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
>> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
>> Reviewed-by: Matt Porter <matt.porter@linaro.org>
>
> Reviewed-by: Christian Daudt <bcm@fixthebug.org>
>
> Chris,
> Are you ok with me pulling this patch along with the rest of the
> patchset into the bcm tree?
>
> Thanks,
> csd
Hi Chris,
I'm hoping to get this patchset and "rename ARCH_BCM to
ARCH_BCM_MOBILE (mmc)" patch into 3.14 still, and these 2 patches are
waiting for your ack and confirmation that you're ok with me pulling
them through armsoc. Can you pls review them ?
Thanks,
csd
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
2013-12-14 8:14 ` Christian Daudt
2013-12-23 8:26 ` Christian Daudt
@ 2014-01-07 19:37 ` Tim Kryger
2014-01-24 17:07 ` Tim Kryger
1 sibling, 1 reply; 24+ messages in thread
From: Tim Kryger @ 2014-01-07 19:37 UTC (permalink / raw)
To: Christian Daudt, Chris Ball
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Axel Lin,
Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List,
Ulf Hansson
On Sat, Dec 14, 2013 at 12:14 AM, Christian Daudt <bcm@fixthebug.org> wrote:
> On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
>> Enable the external clock needed by the host controller during the
>> probe and disable it during the remove.
>>
>> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
>> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
>> Reviewed-by: Matt Porter <matt.porter@linaro.org>
>
> Reviewed-by: Christian Daudt <bcm@fixthebug.org>
>
> Chris,
> Are you ok with me pulling this patch along with the rest of the
> patchset into the bcm tree?
>
> Thanks,
> csd
Chris,
Can you please provide an answer to csd?
Thanks,
Tim Kryger
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
2014-01-07 19:37 ` Tim Kryger
@ 2014-01-24 17:07 ` Tim Kryger
0 siblings, 0 replies; 24+ messages in thread
From: Tim Kryger @ 2014-01-24 17:07 UTC (permalink / raw)
To: Christian Daudt, Chris Ball
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Daniel Lezcano, Thomas Gleixner, Axel Lin,
Device Tree List, Linux ARM Kernel List,
Linux Kernel Mailing List, Linux MMC List, Linaro Patches List,
Ulf Hansson
On Tue, Jan 7, 2014 at 11:37 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
> On Sat, Dec 14, 2013 at 12:14 AM, Christian Daudt <bcm@fixthebug.org> wrote:
>> On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger <tim.kryger@linaro.org> wrote:
>>> Enable the external clock needed by the host controller during the
>>> probe and disable it during the remove.
>>>
>>> Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
>>> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
>>> Reviewed-by: Matt Porter <matt.porter@linaro.org>
>>
>> Reviewed-by: Christian Daudt <bcm@fixthebug.org>
>>
>> Chris,
>> Are you ok with me pulling this patch along with the rest of the
>> patchset into the bcm tree?
>>
>> Thanks,
>> csd
>
> Chris,
>
> Can you please provide an answer to csd?
>
> Thanks,
> Tim Kryger
Chris,
I haven't heard back so this patch has been dropped for 3.14 to allow
the remaining patches in the series to move forward. As such, I will
be re-posting this patch for 3.15. It is essential for the
bcm28155_ap board to transition away from fake fixed clocks to the
real clock driver. This is because the bcm281xx clock driver does not
set the CLK_IGNORE_UNUSED flag for the SDHCI peripheral clocks and the
common clock code will shut them off in late init unless the SDHCI
driver has asked for them to be enabled.
Thanks,
Tim
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2014-01-24 17:07 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 19:20 [PATCH v4 0/8] Update Kona drivers to use clocks Tim Kryger
2013-12-05 19:20 ` [PATCH v4 1/8] ARM: dts: Declare clocks as fixed on bcm11351 Tim Kryger
2013-12-10 7:18 ` Christian Daudt
2013-12-10 20:26 ` Tim Kryger
2013-12-13 7:48 ` Christian Daudt
2013-12-13 15:56 ` Tim Kryger
2013-12-05 19:20 ` [PATCH v4 2/8] ARM: dts: Specify clocks for UARTs " Tim Kryger
2013-12-13 7:56 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 3/8] Documentation: dt: kona-sdhci: Add clocks property Tim Kryger
2013-12-13 8:02 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 4/8] ARM: dts: Specify clocks for SDHCIs on bcm11351 Tim Kryger
2013-12-13 8:22 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks Tim Kryger
2013-12-14 8:14 ` Christian Daudt
2013-12-23 8:26 ` Christian Daudt
2014-01-07 19:37 ` Tim Kryger
2014-01-24 17:07 ` Tim Kryger
2013-12-05 19:20 ` [PATCH v4 6/8] Documentation: dt: kona-timer: Add clocks property Tim Kryger
2013-12-14 8:19 ` Christian Daudt
2013-12-05 19:20 ` [PATCH v4 7/8] clocksource: kona: Add basic use of external clock Tim Kryger
2013-12-14 8:26 ` Christian Daudt
2013-12-16 10:34 ` Daniel Lezcano
2013-12-05 19:20 ` [PATCH v4 8/8] ARM: dts: Specify clocks for timer on bcm11351 Tim Kryger
2013-12-13 8:06 ` Christian Daudt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).