* [PATCH 0/2] Fixes for 3.8-rc1
@ 2012-12-18 22:13 Andrew Lunn
2012-12-18 22:13 ` [PATCH 1/2] ARM: Kirkwood: Fix missing sdio clock Andrew Lunn
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrew Lunn @ 2012-12-18 22:13 UTC (permalink / raw)
To: linux-arm-kernel
These two patches are fixes needed for Linux 3.8.
The first patch fixes a lockup due to the missing SDIO clock. Since
the clkdev alias is missing, the sdio driver fails to
clk_prepare_enable() the clock. The lateinit call in the clk framework
then disables the clock since nobody owns it. The next access to the
SDIO register space causes the SoC to lockup.
The second patch fixes a null-pointer dereference. The conversion of
Kirkwood to pinctrl/gpio resulted in that using GPIO calls inside the
board-*.c file causes an exception, since the gpio driver has not yet
been loaded. Topkick is using the GPIO to control power to the SATA0
device. So convert the gpio to a fixed regulator, in DT, which gets
loaded after the gpio driver is available.
Andrew Lunn (2):
ARM: Kirkwood: Fix missing sdio clock
ARM: Kirkwood: Use fixed-regulator instead of board gpio call
arch/arm/boot/dts/kirkwood-topkick.dts | 17 +++++++++++++++++
arch/arm/mach-kirkwood/board-dt.c | 4 ++++
arch/arm/mach-kirkwood/board-usi_topkick.c | 4 ----
3 files changed, 21 insertions(+), 4 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ARM: Kirkwood: Fix missing sdio clock
2012-12-18 22:13 [PATCH 0/2] Fixes for 3.8-rc1 Andrew Lunn
@ 2012-12-18 22:13 ` Andrew Lunn
2012-12-18 22:13 ` [PATCH 2/2] ARM: Kirkwood: Use fixed-regulator instead of board gpio call Andrew Lunn
2012-12-27 22:57 ` [PATCH 0/2] Fixes for 3.8-rc1 Stefan Peter
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2012-12-18 22:13 UTC (permalink / raw)
To: linux-arm-kernel
We moved to declaring clk gates in DT. However, device which do not
yet have a DT binding need to have a clkdev alias. This was missing
for SDIO.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
arch/arm/mach-kirkwood/board-dt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index ff4150a..de4fd2b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -67,6 +67,10 @@ static void __init kirkwood_legacy_clk_init(void)
orion_clkdev_add(NULL, "mv643xx_eth_port.1",
of_clk_get_from_provider(&clkspec));
+ clkspec.args[0] = CGC_BIT_SDIO;
+ orion_clkdev_add(NULL, "mvsdio",
+ of_clk_get_from_provider(&clkspec));
+
}
static void __init kirkwood_of_clk_init(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: Kirkwood: Use fixed-regulator instead of board gpio call
2012-12-18 22:13 [PATCH 0/2] Fixes for 3.8-rc1 Andrew Lunn
2012-12-18 22:13 ` [PATCH 1/2] ARM: Kirkwood: Fix missing sdio clock Andrew Lunn
@ 2012-12-18 22:13 ` Andrew Lunn
2012-12-27 22:57 ` [PATCH 0/2] Fixes for 3.8-rc1 Stefan Peter
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2012-12-18 22:13 UTC (permalink / raw)
To: linux-arm-kernel
With the change to a DT based pinctrl/gpio driver, using gpio API
calls in board-*.c files no longer works, a dereferenced NULL pointer
exception occurs instead. By converting the GPIO code into a
fixed-regulator which gets probed later once pinctrl/gpio is
available, we avoid the exception.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
arch/arm/boot/dts/kirkwood-topkick.dts | 17 +++++++++++++++++
arch/arm/mach-kirkwood/board-usi_topkick.c | 4 ----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index c0de5a7..cd15452 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -82,4 +82,21 @@
gpios = <&gpio1 16 1>;
};
};
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sata0_power: regulator at 1 {
+ compatible = "regulator-fixed";
+ reg = <1>;
+ regulator-name = "SATA0 Power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ regulator-always-on;
+ regulator-boot-on;
+ gpio = <&gpio1 4 0>;
+ };
+ };
};
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 15e69fc..23d2dd1 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -64,8 +64,6 @@ static unsigned int topkick_mpp_config[] __initdata = {
0
};
-#define TOPKICK_SATA0_PWR_ENABLE 36
-
void __init usi_topkick_init(void)
{
/*
@@ -73,8 +71,6 @@ void __init usi_topkick_init(void)
*/
kirkwood_mpp_conf(topkick_mpp_config);
- /* SATA0 power enable */
- gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
kirkwood_ge00_init(&topkick_ge00_data);
kirkwood_sdio_init(&topkick_mvsdio_data);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 0/2] Fixes for 3.8-rc1
2012-12-18 22:13 [PATCH 0/2] Fixes for 3.8-rc1 Andrew Lunn
2012-12-18 22:13 ` [PATCH 1/2] ARM: Kirkwood: Fix missing sdio clock Andrew Lunn
2012-12-18 22:13 ` [PATCH 2/2] ARM: Kirkwood: Use fixed-regulator instead of board gpio call Andrew Lunn
@ 2012-12-27 22:57 ` Stefan Peter
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Peter @ 2012-12-27 22:57 UTC (permalink / raw)
To: linux-arm-kernel
On 18.12.2012 23:13, Andrew Lunn wrote:
> These two patches are fixes needed for Linux 3.8.
>
> The first patch fixes a lockup due to the missing SDIO clock. Since
> the clkdev alias is missing, the sdio driver fails to
> clk_prepare_enable() the clock. The lateinit call in the clk framework
> then disables the clock since nobody owns it. The next access to the
> SDIO register space causes the SoC to lockup.
>
> The second patch fixes a null-pointer dereference. The conversion of
> Kirkwood to pinctrl/gpio resulted in that using GPIO calls inside the
> board-*.c file causes an exception, since the gpio driver has not yet
> been loaded. Topkick is using the GPIO to control power to the SATA0
> device. So convert the gpio to a fixed regulator, in DT, which gets
> loaded after the gpio driver is available.
>
> Andrew Lunn (2):
> ARM: Kirkwood: Fix missing sdio clock
> ARM: Kirkwood: Use fixed-regulator instead of board gpio call
>
> arch/arm/boot/dts/kirkwood-topkick.dts | 17 +++++++++++++++++
> arch/arm/mach-kirkwood/board-dt.c | 4 ++++
> arch/arm/mach-kirkwood/board-usi_topkick.c | 4 ----
> 3 files changed, 21 insertions(+), 4 deletions(-)
>
Tested-by: Stefan Peter <s.peter@mplch>
--
MPL AG, Switzerland http://www.mpl.ch
Tel. +41 (0)56 483 34 34 Fax: +41(0)56 493 30 20
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-27 22:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 22:13 [PATCH 0/2] Fixes for 3.8-rc1 Andrew Lunn
2012-12-18 22:13 ` [PATCH 1/2] ARM: Kirkwood: Fix missing sdio clock Andrew Lunn
2012-12-18 22:13 ` [PATCH 2/2] ARM: Kirkwood: Use fixed-regulator instead of board gpio call Andrew Lunn
2012-12-27 22:57 ` [PATCH 0/2] Fixes for 3.8-rc1 Stefan Peter
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).