mmc clock-frequency property update and
Subsystems (4)
cover mmc clock-frequency property update and
From: Rashmi A <[email protected]>
Patch1: If clock-frequency property is set and it is not the same as the
current clock rate of clk_xin(base clock frequency), set clk_xin to use the provided clock rate.
Patch2: Since the EMMC clock in KMB was changed from 200Mhz to 175Mhz in
FIP,there were some warnings introduced, as the frequency values being checked was still wrt 200Mhz in code. Hence, the frequency checks are now updated based on the current 175Mhz EMMC clock changed in FIP.
Review comments from Adrian Hunter have been incorporated. Above 2 patches are tested with Keem Bay evaluation module board.
Please help to review this patch set.
Rashmi A (2):
mmc: sdhci-of-arasan: Use clock-frequency property to update clk_xin
phy: intel: Fix for warnings due to EMMC clock 175Mhz change in FIP
drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++++++++-- drivers/phy/intel/phy-intel-keembay-emmc.c | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 mmc: sdhci-of-arasan: Use clock-frequency property to update clk_xin
From: Rashmi A <[email protected]>
If clock-frequency property is set and it is not the same as the current clock rate of clk_xin(base clock frequency), set clk_xin to use the provided clock rate.
--- drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +12 -2
@@ -1542,6 +1542,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) } } +sdhci_get_of_property (pdev); + sdhci_arasan->clk_ahb =devm_clk_get (dev,"clk_ahb" );if (IS_ERR (sdhci_arasan->clk_ahb)) { ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->clk_ahb),
@@ -1561,14 +1563,22 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto err_pltfm_free; } +/* If clock-frequency property is set, use the provided value */ +if (pltfm_host->clock && + pltfm_host->clock !=clk_get_rate (clk_xin)) { + ret =clk_set_rate (clk_xin, pltfm_host->clock); +if (ret) { +dev_err (&pdev->dev,"Failed to set SD clock rate\n" ); + goto clk_dis_ahb; + } + } + ret =clk_prepare_enable (clk_xin);if (ret) {dev_err (dev,"Unable to enable SD clock.\n" ); goto clk_dis_ahb; } -sdhci_get_of_property (pdev); -if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ;
Signature · 1 line
2.17.1
Re: [“PATCH” 1/2] mmc: sdhci-of-arasan: Use clock-frequency property to update clk_xin
Quoted 41 lines · On 6/3/21 8:22 PM, [email protected] wrote:
From: Rashmi A <[email protected]>
If clock-frequency property is set and it is not the same as the current clock rate of
clk_xin(base clock frequency), setclk_xinto use the provided clock rate.Signed-off-by Rashmi A <[email protected]>Reviewed-by Adrian Hunter <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-arasan.c +12
-0@@ -1542,6 +1542,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) } } +sdhci_get_of_property (pdev); + sdhci_arasan->clk_ahb =devm_clk_get (dev,"clk_ahb" );if (IS_ERR (sdhci_arasan->clk_ahb)) { ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->clk_ahb),@@ -1561,14 +1563,22 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto err_pltfm_free; } +/* If clock-frequency property is set, use the provided value */ +if (pltfm_host->clock && + pltfm_host->clock !=clk_get_rate (clk_xin)) { + ret =clk_set_rate (clk_xin, pltfm_host->clock); +if (ret) { +dev_err (&pdev->dev,"Failed to set SD clock rate\n" ); + goto clk_dis_ahb; + } + } + ret =clk_prepare_enable (clk_xin);
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 1584
Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +0
-2if (ret) {dev_err (dev,"Unable to enable SD clock.\n" ); goto clk_dis_ahb; } -sdhci_get_of_property (pdev); -if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ;
Manish/Sai: Please retest this on Xilinx SOC.
Thanks,
Michal
Re: [“PATCH” 1/2] mmc: sdhci-of-arasan: Use clock-frequency property to update clk_xin
Quoted 58 lines · Michal Simek
Quoted 41 lines · On 6/3/21 8:22 PM, [email protected] wrote:
From: Rashmi A <[email protected]>
If clock-frequency property is set and it is not the same as the current clock rate of
clk_xin(base clock frequency), setclk_xinto use the provided clock rate.Signed-off-by Rashmi A <[email protected]>Reviewed-by Adrian Hunter <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-arasan.c +12
-0@@ -1542,6 +1542,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) } } +sdhci_get_of_property (pdev); + sdhci_arasan->clk_ahb =devm_clk_get (dev,"clk_ahb" );if (IS_ERR (sdhci_arasan->clk_ahb)) { ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->clk_ahb),@@ -1561,14 +1563,22 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto err_pltfm_free; } +/* If clock-frequency property is set, use the provided value */ +if (pltfm_host->clock && + pltfm_host->clock !=clk_get_rate (clk_xin)) { + ret =clk_set_rate (clk_xin, pltfm_host->clock); +if (ret) { +dev_err (&pdev->dev,"Failed to set SD clock rate\n" ); + goto clk_dis_ahb; + } + } + ret =clk_prepare_enable (clk_xin);drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 1584
Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +0
-2if (ret) {dev_err (dev,"Unable to enable SD clock.\n" ); goto clk_dis_ahb; } -sdhci_get_of_property (pdev); -if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ;Manish/Sai: Please retest this on Xilinx SOC.
Quoted 2 lines
Thanks,
Michal
I am about to queue this patch, but it would be nice to get your confirmation and tested-by tags before doing so. Would that be possible within the next couple of days?
Kind regards
Uffe
Sai Krishna Potthuri
Tested-byRE: [“PATCH” 1/2] mmc: sdhci-of-arasan: Use clock-frequency property to update clk_xin
Hi,
Quoted 82 lines
-----Original Message-----
From: Ulf Hansson <[email protected]>
Sent: Thursday, June 17, 2021 3:34 PM
To: Michal Simek <[email protected]>; Manish Narani <[email protected]>; Sai Krishna Potthuri <[email protected]>
Cc: [email protected]; [email protected]; linux-mmc <[email protected]>; Linux ARM <linux-arm- [email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Kishon <[email protected]>; Vinod Koul <[email protected]>; Andy Shevchenko <[email protected]>; [email protected]; Mark Gross <[email protected]>; [email protected]; [email protected]; [email protected]; Adrian Hunter <[email protected]>; [email protected]; [email protected]; Raja Subramanian, Lakshmi Bai <[email protected]>
Subject: Re: [“PATCH” 1/2] mmc: sdhci-of-arasan: Use clock-frequency property to updateclk_xinQuoted 16 lines · Michal Simek
Quoted 12 lines · On 6/3/21 8:22 PM, [email protected] wrote:
From: Rashmi A <[email protected]>
If clock-frequency property is set and it is not the same as the current clock rate of
clk_xin(base clock frequency), setclk_xinto use the provided clock rate.Signed-off-by Rashmi A <[email protected]>Reviewed-by Adrian Hunter <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)Quoted 6 lines
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct
Quoted 6 lines
drivers/mmc/host/sdhci-of-arasan.c +0
-0@@ -1542,6 +1542,8 @@ static int sdhci_arasan_probe(struct
platform_device*pdev)Quoted 9 lines
Quoted 9 lines
drivers/mmc/host/sdhci-of-arasan.c +2
-0} } +sdhci_get_of_property (pdev); + sdhci_arasan->clk_ahb =devm_clk_get (dev,"clk_ahb" );if (IS_ERR (sdhci_arasan->clk_ahb)) { ret = dev_err_probe(dev,
PTR_ERR(sdhci_arasan->clk_ahb), @@ -1561,14 +1563,22 @@ static int
sdhci_arasan_probe(struct platform_device *pdev)Quoted 29 lines
Quoted 23 lines
goto err_pltfm_free; }drivers/mmc/host/sdhci-of-arasan.c +10
-2+/* If clock-frequency property is set, use the provided value */ +if (pltfm_host->clock && + pltfm_host->clock !=clk_get_rate (clk_xin)) { + ret =clk_set_rate (clk_xin, pltfm_host->clock); +if (ret) { +dev_err (&pdev->dev,"Failed to set SD clock rate\n" ); + goto clk_dis_ahb; + } + } + ret =clk_prepare_enable (clk_xin);if (ret) {dev_err (dev,"Unable to enable SD clock.\n" ); goto clk_dis_ahb; } -sdhci_get_of_property (pdev); -if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=Quoted 3 lines
SDHCI_ARASAN_QUIRK_FORCE_CDTEST;Manish/Sai: Please retest this on Xilinx SOC.
Quoted 6 lines
Quoted 2 lines
Thanks,
MichalI am about to queue this patch, but it would be nice to get your confirmation and tested-by tags before doing so. Would that be possible within the next couple of days?
Tested this patch on Xilinx platforms.
Regards
Sai Krishna
PATCH 2/2 phy: intel: Fix for warnings due to EMMC clock 175Mhz change in FIP
In reply to [email protected]From: Rashmi A <[email protected]>
Since the EMMC clock was changed from 200Mhz to 175Mhz in FIP, there were some warnings introduced, as the frequency values being checked was still wrt 200Mhz in code. Hence, the frequency checks are now updated based on the current 175Mhz EMMC clock changed in FIP.
Spamming kernel log msg:
"phy phy-20290000.mmc_phy.2: Unsupported rate: 43750000"
--- drivers/phy/intel/phy-intel-keembay-emmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/intel/phy-intel-keembay-emmc.c +2 -1
@@ -95,7 +95,8 @@ static int keembay_emmc_phy_power(struct phy *phy, bool on_off)else freqsel =0x0 ; -if (mhz <50 || mhz >200 ) +/* Check for EMMC clock rate*/ +if (mhz >175 )dev_warn (&phy->dev,"Unsupported rate: %d MHz\n" , mhz);/*
Signature · 1 line
2.17.1
Re: [“PATCH” 2/2] phy: intel: Fix for warnings due to EMMC clock 175Mhz change in FIP
Quoted 9 lines · On Thu, 3 Jun 2021 at 20:22, <[email protected]> wrote:
From: Rashmi A <[email protected]>
Since the EMMC clock was changed from 200Mhz to 175Mhz in FIP, there were some warnings introduced, as the frequency values being checked was still wrt 200Mhz in code. Hence, the frequency checks are now updated based on the current 175Mhz EMMC clock changed in FIP.
Quoted 5 lines
Spamming kernel log msg:
"phy phy-20290000.mmc_phy.2: Unsupported rate: 43750000"Signed-off-by Rashmi A <[email protected]>Reviewed-by Adrian Hunter <[email protected]>
I guess $subject patch should be queued together with patch1/2 (via the mmc tree?), no?
Vinod, Kishion, if that's okay I need an ack from you to pick it up.
Kind regards
Uffe
Quoted 21 lines
--- drivers/phy/intel/phy-intel-keembay-emmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/phy/intel/phy-intel-keembay-emmc.c +2
-2@@ -95,7 +95,8 @@ static int keembay_emmc_phy_power(struct phy *phy, bool on_off)else freqsel =0x0 ; -if (mhz <50 || mhz >200 ) +/* Check for EMMC clock rate*/ +if (mhz >175 )dev_warn (&phy->dev,"Unsupported rate: %d MHz\n" , mhz);/* -- 2.17.1
Re: [“PATCH” 2/2] phy: intel: Fix for warnings due to EMMC clock 175Mhz change in FIP
Quoted 13 lines · Ulf Hansson
Quoted 12 lines · On Thu, 3 Jun 2021 at 20:22, <[email protected]> wrote:
From: Rashmi A <[email protected]>
Since the EMMC clock was changed from 200Mhz to 175Mhz in FIP, there were some warnings introduced, as the frequency values being checked was still wrt 200Mhz in code. Hence, the frequency checks are now updated based on the current 175Mhz EMMC clock changed in FIP.
Spamming kernel log msg:
"phy phy-20290000.mmc_phy.2: Unsupported rate: 43750000"
Quoted 7 lines
Quoted 2 lines
Signed-off-by Rashmi A <[email protected]>Reviewed-by Adrian Hunter <[email protected]>I guess $subject patch should be queued together with patch1/2 (via the mmc tree?), no?
Vinod, Kishion, if that's okay I need an ack from you to pick it up.
Sure:
Signature · 1 line
~Vinod
Quoted 23 lines · On Thu, 3 Jun 2021 at 20:22, <[email protected]> wrote:
From: Rashmi A <[email protected]>
Patch1: If clock-frequency property is set and it is not the same as the
current clock rate ofclk_xin(base clock frequency), setclk_xinto use the provided clock rate.Patch2: Since the EMMC clock in KMB was changed from 200Mhz to 175Mhz in
FIP,there were some warnings introduced, as the frequency values being checked was still wrt 200Mhz in code. Hence, the frequency checks are now updated based on the current 175Mhz EMMC clock changed in FIP.Review comments from Adrian Hunter have been incorporated. Above 2 patches are tested with Keem Bay evaluation module board.
Please help to review this patch set.
Rashmi A (2):
mmc: sdhci-of-arasan: Use clock-frequency property to updateclk_xin
phy: intel: Fix for warnings due to EMMC clock 175Mhz change in FIP
Quoted 7 lines
drivers/mmc/host/sdhci-of-arasan.c | 14 ++++++++++++-- drivers/phy/intel/phy-intel-keembay-emmc.c | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-)--
2.17.1
Applied for fixes, thanks!
Kind regards
Uffe