fix non-working eMMC on Marvell BG2Q DMP board
Subsystems (3)
cover fix non-working eMMC on Marvell BG2Q DMP board
The eMMC on Marvell BG2Q DMP board doesn't work due to the following reasons:
1. the sdhci2 host needs "core" clk to work.
2. there's no card detection for the eMMC.
3. the non-exist "smemc" clk occpuies the enable bit for nfc clock which is use for the sdhci2's "core" clk.
These pathes fix them.
Please consider for stable as well.
Jisheng Zhang (3):
ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2
host
ARM: berlin: add broken-cd and set bus width for eMMC in Marvell DMP
DT
clk: berlin: bg2q: remove non-exist "smemc" gate clock
arch/arm/boot/dts/berlin2q-marvell-dmp.dts | 2 ++ arch/arm/boot/dts/berlin2q.dtsi | 3 ++- drivers/clk/berlin/bg2q.c | 1 - 3 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/3 ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
On BG2Q, the sdhci2 host uses nfcecc for "io" clk and nfc for "core" clk. The shdci2 can't work Without this patch due to the "core" clk is gated.
--- arch/arm/boot/dts/berlin2q.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/berlin2q.dtsi +2 -1
@@ -83,7 +83,8 @@ compatible = "mrvl,pxav3-mmc"; reg = <0xab1000 0x200>; interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&chip CLKID_SDIO1XIN>; + clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>; + clock-names = "io", "core"; status = "disabled"; };
Signature · 1 line
2.1.4
Sebastian Hesselbarth
AppliedRe: [PATCH 1/3] ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
Quoted 5 lines · Jisheng Zhang
On BG2Q, the sdhci2 host uses nfcecc for "io" clk and nfc for "core" clk. The shdci2 can't work Without this patch due to the "core" clk is gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+
Applied to berlin/fixes.
Thanks!
Quoted 19 lines
--- arch/arm/boot/dts/berlin2q.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/boot/dts/berlin2q.dtsi +2
-1@@ -83,7 +83,8 @@ compatible = "mrvl,pxav3-mmc"; reg = <0xab1000 0x200>; interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&chip CLKID_SDIO1XIN>; + clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>; + clock-names = "io", "core"; status = "disabled"; };
PATCH 2/3 ARM: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
In reply to Jisheng ZhangThere's no card detection for the eMMC, so this patch adds the missing broken-cd property. This patch also sets bus width as 8 to add MMC_CAP_8_BIT_DATA in the Host capabilities.
--- arch/arm/boot/dts/berlin2q-marvell-dmp.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/berlin2q-marvell-dmp.dts +2 -0
@@ -65,6 +65,8 @@ }; &sdhci2 { + broken-cd; + bus-width = <8>; non-removable; status = "okay"; };
Signature · 1 line
2.1.4
Sebastian Hesselbarth
AppliedRe: [PATCH 2/3] ARM: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
Quoted 6 lines · Jisheng Zhang
There's no card detection for the eMMC, so this patch adds the missing broken-cd property. This patch also sets bus width as 8 to add
MMC_CAP_8_BIT_DATAin the Host capabilities.Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+
Applied to berlin/fixes.
Thanks!
Quoted 18 lines
--- arch/arm/boot/dts/berlin2q-marvell-dmp.dts | 2 ++ 1 file changed, 2 insertions(+)arch/arm/boot/dts/berlin2q-marvell-dmp.dts +2
-0@@ -65,6 +65,8 @@ }; &sdhci2 { + broken-cd; + bus-width = <8>; non-removable; status = "okay"; };
PATCH 3/3 clk: berlin: bg2q: remove non-exist "smemc" gate clock
In reply to Jisheng ZhangThe "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)
drivers/clk/berlin/bg2q.c +0 -1
@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 }, - { "smemc", "perif", 19 }, { "pcie", "perif", 22 }, };
Signature · 1 line
2.1.4
Re: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Quoted 16 lines · Jisheng Zhang
The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)drivers/clk/berlin/bg2q.c +0
-0
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] __initconst = { · line 288
Quoted 4 lines
drivers/clk/berlin/bg2q.c +0
-1@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 }, - { "smemc", "perif", 19 },
Jisheng,
if bit 19 is for nfc, how does that work out with bit 18 which is still assigned to nfc? Can you re-evaluate clkenable registers for BG2Q and fix it up accordingly? I'd suggest to still disable as many clocks as possible rather than removing the corresponding clk_gates.
Sebastian
Quoted 4 lines
drivers/clk/berlin/bg2q.c +0
-0{ "pcie", "perif", 22 }, };
Re: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Dear Sebastian,
Quoted 12 lines · On Wed, 7 Jan 2015 06:11:58 -0800 Sebastian Hesselbarth…
Quoted 11 lines · Jisheng Zhang
The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)
Quoted 8 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] · line 287
Quoted 8 lines
drivers/clk/berlin/bg2q.c +0
-0@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 },
The nfc here is really confusing, we call it as nfccore internally. Is it better to rename it as nfccore?
Quoted 6 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] __initconst = { · line 288
Quoted 1 line
drivers/clk/berlin/bg2q.c +0
-1- { "smemc", "perif", 19 },Jisheng,
if bit 19 is for nfc, how does that work out with bit 18 which is still assigned to nfc? Can you re-evaluate clkenable registers for
bit 19 is for nfcEcc, the "io" clock; bit 18 is for nfcCore, the "core" clock.
Quoted 1 line
BG2Q and fix it up accordingly? I'd suggest to still disable as many
I'll recheck the clk driver for BG2Q.
Thanks very much,
Jisheng
Re: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Quoted 17 lines · Jisheng Zhang
Dear Sebastian,
Quoted 12 lines · On Wed, 7 Jan 2015 06:11:58 -0800 Sebastian Hesselbarth…
Quoted 11 lines · Jisheng Zhang
The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)
Quoted 11 lines
Quoted 8 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] · line 287
Quoted 8 lines
drivers/clk/berlin/bg2q.c +0
-0@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 },The nfc here is really confusing, we call it as nfccore internally. Is it better to rename it as nfccore?
I guess it comes from some early Marvell BSP code, if there is no issues with the name, e.g. something already depends on "nfc", feel free to rename it to something more meaningful.
Quoted 8 lines
Quoted 6 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] __initconst = { · line 288
Quoted 1 line
drivers/clk/berlin/bg2q.c +0
-1- { "smemc", "perif", 19 },Jisheng,
if bit 19 is for nfc, how does that work out with bit 18 which is still assigned to nfc? Can you re-evaluate clkenable registers for
bit 19 is for nfcEcc, the "io" clock; bit 18 is for nfcCore, the "core" clock.
Ok, then both bits should be dealt with accordingly, i.e. rename "smemc" to "nfcecc" and use it in the corresponding dts node.
If this clk_gate just disables a clock that is fed into another gateable clock module, I can live with removing it - although I still think it is best to leave the clk_gate in place and pick another name that does not collide with any other clock name.
Quoted 3 lines
Quoted 1 line
BG2Q and fix it up accordingly? I'd suggest to still disable as many
I'll recheck the clk driver for BG2Q.
Ok, thanks a lot!
Sebastian
Re: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Dear Sebastian,
Quoted 30 lines · On Wed, 7 Jan 2015 06:30:55 -0800 Sebastian Hesselbarth…
Quoted 17 lines · Jisheng Zhang
Dear Sebastian,
Quoted 12 lines · On Wed, 7 Jan 2015 06:11:58 -0800 Sebastian Hesselbarth…
Quoted 11 lines · Jisheng Zhang
The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)Quoted 11 lines
Quoted 8 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] · line 287
Quoted 8 lines
drivers/clk/berlin/bg2q.c +0
-0@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 },The nfc here is really confusing, we call it as nfccore internally. Is it better to rename it as nfccore?
Quoted 3 lines
I guess it comes from some early Marvell BSP code, if there is no issues with the name, e.g. something already depends on "nfc", feel free to rename it to something more meaningful.
In BG2, mrvl call the clock as nfccore. The code use "nfc" for it. The situation is similar for usbcore, satacore etc. So keep the name here, what do you think?
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] __initconst = { · line 288
Quoted 2 lines
drivers/clk/berlin/bg2q.c +0
-1- { "smemc", "perif", 19 },Jisheng,
if bit 19 is for nfc, how does that work out with bit 18 which is still assigned to nfc? Can you re-evaluate clkenable registers for
bit 19 is for nfcEcc, the "io" clock; bit 18 is for nfcCore, the "core" clock.
Quoted 7 lines
Ok, then both bits should be dealt with accordingly, i.e. rename "smemc" to "nfcecc" and use it in the corresponding dts node.
If this
clk_gatejust disables a clock that is fed into another gateable clock module, I can live with removing it - although I still think it is best to leave theclk_gatein place and pick another name that does not collide with any other clock name.
The nfcecc is already defined in the bg2q_divs, the gate bit is correct there.
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
BG2Q and fix it up accordingly? I'd suggest to still disable as many
I'll recheck the clk driver for BG2Q.
I checked the clk driver for BG2Q one by one. The only problem is the "smemc" issue. Removing it is the only thing we need to do. So I think we can use the patch I sent.
Thanks,
Jisheng
Sebastian Hesselbarth
Acked-byRe: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Quoted 29 lines · Jisheng Zhang
Quoted 27 lines · On Wed, 7 Jan 2015 06:30:55 -0800 Sebastian Hesselbarth…
Quoted 25 lines · Jisheng Zhang
Quoted 12 lines · On Wed, 7 Jan 2015 06:11:58 -0800 Sebastian Hesselbarth…
Quoted 11 lines · Jisheng Zhang
The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)Quoted 8 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] · line 287
Quoted 8 lines
drivers/clk/berlin/bg2q.c +0
-0@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 },The nfc here is really confusing, we call it as nfccore internally. Is it better to rename it as nfccore?
Quoted 7 lines
Quoted 3 lines
I guess it comes from some early Marvell BSP code, if there is no issues with the name, e.g. something already depends on "nfc", feel free to rename it to something more meaningful.
In BG2, mrvl call the clock as nfccore. The code use "nfc" for it. The situation is similar for usbcore, satacore etc. So keep the name here, what do you think?
Yes, I am fine with keeping the name as is.
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] __initconst = { · line 288
Quoted 1 line
drivers/clk/berlin/bg2q.c +0
-1- { "smemc", "perif", 19 },if bit 19 is for nfc, how does that work out with bit 18 which is still assigned to nfc? Can you re-evaluate clkenable registers for
bit 19 is for nfcEcc, the "io" clock; bit 18 is for nfcCore, the "core" clock.
Ok, then both bits should be dealt with accordingly, i.e. rename "smemc" to "nfcecc" and use it in the corresponding dts node.
Quoted 6 lines
Quoted 4 lines
If this
clk_gatejust disables a clock that is fed into another gateable clock module, I can live with removing it - although I still think it is best to leave theclk_gatein place and pick another name that does not collide with any other clock name.The nfcecc is already defined in the
bg2q_divs, the gate bit is correct there.
Ok, I had a look in the actual code and agree that the same bit 19 is used twice. The patch is fine and we can take it as is.
This is clk subsystem, so either Mike takes it through his fixes branch including my
or decides to agree that I take it instead with his Ack. I am fine with both.
Sebastian
Mike Turquette
Acked-byRe: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Quoting Sebastian Hesselbarth (2015-01-10 05:08:22)
Quoted 61 lines · Jisheng Zhang
Quoted 29 lines
Quoted 27 lines · On Wed, 7 Jan 2015 06:30:55 -0800 Sebastian Hesselbarth…
Quoted 25 lines · Jisheng Zhang
Quoted 12 lines · On Wed, 7 Jan 2015 06:11:58 -0800 Sebastian Hesselbarth…
Quoted 11 lines · Jisheng Zhang
The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable register is for nfc. Current code use bit19 for non-exist "smemc" incorrectly, this prevents eMMC from working due to the sdhci's "core" clk is still gated.
Signed-off-by Jisheng Zhang <[email protected]>Cc stable at vger.kernel.org # 3.16+--- drivers/clk/berlin/bg2q.c | 1 - 1 file changed, 1 deletion(-)Quoted 8 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] · line 287
Quoted 8 lines
drivers/clk/berlin/bg2q.c +0
-0@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { { "pbridge", "perif", 15, CLK_IGNORE_UNUSED }, { "sdio", "perif", 16, CLK_IGNORE_UNUSED }, { "nfc", "perif", 18 },The nfc here is really confusing, we call it as nfccore internally. Is it better to rename it as nfccore?
Quoted 7 lines
Quoted 3 lines
I guess it comes from some early Marvell BSP code, if there is no issues with the name, e.g. something already depends on "nfc", feel free to rename it to something more meaningful.
In BG2, mrvl call the clock as nfccore. The code use "nfc" for it. The situation is similar for usbcore, satacore etc. So keep the name here, what do you think?
Yes, I am fine with keeping the name as is.
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
drivers/clk/berlin/bg2q.c static const struct berlin2_gate_data bg2q_gates[] __initconst = { · line 288
Quoted 1 line
drivers/clk/berlin/bg2q.c +0
-1- { "smemc", "perif", 19 },if bit 19 is for nfc, how does that work out with bit 18 which is still assigned to nfc? Can you re-evaluate clkenable registers for
bit 19 is for nfcEcc, the "io" clock; bit 18 is for nfcCore, the "core" clock.
Ok, then both bits should be dealt with accordingly, i.e. rename "smemc" to "nfcecc" and use it in the corresponding dts node.
Quoted 6 lines
Quoted 4 lines
If this
clk_gatejust disables a clock that is fed into another gateable clock module, I can live with removing it - although I still think it is best to leave theclk_gatein place and pick another name that does not collide with any other clock name.The nfcecc is already defined in the
bg2q_divs, the gate bit is correct there.Ok, I had a look in the actual code and agree that the same bit 19 is used twice. The patch is fine and we can take it as is.
Quoted 7 lines
This is clk subsystem, so either Mike takes it through his fixes branch including my
or decides to agree that I take it instead with his Ack. I am fine with both.
Now the three fixes can stay together and live happily ever after.
Regards,
Mike
Quoted 3 lines
Sebastian
Re: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Quoted 4 lines · Mike Turquette
Quoting Sebastian Hesselbarth (2015-01-10 05:08:22)
Quoted 3 lines
This is clk subsystem, so either Mike takes it through his fixes branch including my
Quoted 8 lines
Quoted 4 lines
or decides to agree that I take it instead with his Ack. I am fine with both.
Now the three fixes can stay together and live happily ever after.
Mike,
I already had the two others pulled by Olof some days ago. If you plan for a fixes branch for v3.19, please take this in too.
If you have no other fixes, I can take it and do a 2nd round of fixes for Berlin.
Sebastian
Mike Turquette
AppliedRe: [PATCH 3/3] clk: berlin: bg2q: remove non-exist "smemc" gate clock
Quoting Sebastian Hesselbarth (2015-01-13 04:17:30)
Quoted 14 lines · Mike Turquette
Quoted 4 lines
Quoting Sebastian Hesselbarth (2015-01-10 05:08:22)
Quoted 3 lines
This is clk subsystem, so either Mike takes it through his fixes branch including my
Quoted 8 lines
Quoted 4 lines
or decides to agree that I take it instead with his Ack. I am fine with both.
Now the three fixes can stay together and live happily ever after.
Quoted 7 lines
Mike,
I already had the two others pulled by Olof some days ago. If you plan for a fixes branch for v3.19, please take this in too.
If you have no other fixes, I can take it and do a 2nd round of fixes for Berlin.
The fixes family has been broken up. How sad.
Applied to clk-fixes for the next -rc.
Regards,
Mike
Quoted 3 lines
Sebastian