rockchip: enable sdcard for firefly-rk3399
Subsystems (3)
cover rockchip: enable sdcard for firefly-rk3399
Update rockchip soc mmc dts nodes to use max-frequency instead of clock-min-max.
update mmc driver to use max-frequency when OF_PLATDATA enabled.
Kever Yang (7):
rockchip: rk3036: dtsi use max-frequency for mmc node
rockchip: rk3288: dtsi use max-frequency for mmc node
rockchip: rk3328: dtsi use max-frequency for mmc node
rockchip: dwmmc: use max-frequency when OF_PLATDATA enabled
rockchip: firefly-rk3399: dts: enable sdmmc device
rockchip: firefly-rk3399: enable dwmmc driver for the board Revert "mmc: dw_mmc: rockchip: select proper card clock"
arch/arm/dts/rk3036.dtsi | 2 +- arch/arm/dts/rk3288.dtsi | 8 ++++---- arch/arm/dts/rk3328.dtsi | 8 ++++---- arch/arm/dts/rk3399-firefly.dts | 7 +++++++ configs/firefly-rk3399_defconfig | 2 +- drivers/mmc/rockchip_dw_mmc.c | 7 ++++--- 6 files changed, 21 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/7 rockchip: rk3036: dtsi use max-frequency for mmc node
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
---
arch/arm/dts/rk3036.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/rk3036.dtsi +1 -1
@@ -244,7 +244,7 @@ emmc: dwmmc at 1021c000 { compatible = "rockchip,rk3288-dw-mshc"; clock-frequency = <37500000>; - clock-freq-min-max = <400000 37500000>; + max-frequency = <37500000>; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
Signature · 1 line
1.9.1
PATCH 1/7 rockchip: rk3036: dtsi use max-frequency for mmc node
Quoted 7 lines · Kever Yang
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3036.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 1/7 rockchip: rk3036: dtsi use max-frequency for mmc node
In reply to Kever YangQuoted 9 lines
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
Signed-off-by Kever Yang <[email protected]>Reviewed-by Simon Glass <[email protected]>---
arch/arm/dts/rk3036.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-rockchip/next, thanks!
PATCH 2/7 rockchip: rk3288: dtsi use max-frequency for mmc node
In reply to Kever YangSince the 'clock-freq-min-max' is deprecated, we use max-frequency.
---
arch/arm/dts/rk3288.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/rk3288.dtsi +4 -4
@@ -167,7 +167,7 @@ sdmmc: dwmmc at ff0c0000 { compatible = "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
@@ -179,7 +179,7 @@ sdio0: dwmmc at ff0d0000 { compatible = "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_SDIO0>, <&cru SCLK_SDIO0>, <&cru SCLK_SDIO0_DRV>, <&cru SCLK_SDIO0_SAMPLE>; clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
@@ -191,7 +191,7 @@ sdio1: dwmmc at ff0e0000 { compatible = "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_SDIO1>, <&cru SCLK_SDIO1>, <&cru SCLK_SDIO1_DRV>, <&cru SCLK_SDIO1_SAMPLE>; clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
@@ -203,7 +203,7 @@ emmc: dwmmc at ff0f0000 { compatible = "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
Signature · 1 line
1.9.1
PATCH 2/7 rockchip: rk3288: dtsi use max-frequency for mmc node
Quoted 7 lines · Kever Yang
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3288.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
PATCH 2/7 rockchip: rk3288: dtsi use max-frequency for mmc node
In reply to Kever YangQuoted 9 lines
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
Signed-off-by Kever Yang <[email protected]>Reviewed-by Simon Glass <[email protected]>---
arch/arm/dts/rk3288.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied to u-boot-rockchip/next, thanks!
PATCH 3/7 rockchip: rk3328: dtsi use max-frequency for mmc node
In reply to Kever YangSince the 'clock-freq-min-max' is deprecated, we use max-frequency.
---
arch/arm/dts/rk3328.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/rk3328.dtsi +4 -4
@@ -418,7 +418,7 @@ sdmmc: rksdmmc at ff500000 { compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xff500000 0x0 0x4000>; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>; clock-names = "biu", "ciu"; fifo-depth = <0x100>;
@@ -429,7 +429,7 @@ sdio: dwmmc at ff510000 { compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xff510000 0x0 0x4000>; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
@@ -441,7 +441,7 @@ emmc: rksdmmc at ff520000 { compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xff520000 0x0 0x4000>; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>; clock-names = "biu", "ciu"; fifo-depth = <0x100>;
@@ -466,7 +466,7 @@ sdmmc_ext: rksdmmc at ff5f0000 { compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xff5f0000 0x0 0x4000>; - clock-freq-min-max = <400000 150000000>; + max-frequency = <150000000>; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>; clock-names = "biu", "ciu"; fifo-depth = <0x100>;
Signature · 1 line
1.9.1
PATCH 3/7 rockchip: rk3328: dtsi use max-frequency for mmc node
Quoted 7 lines · Kever Yang
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3328.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
PATCH 3/7 rockchip: rk3328: dtsi use max-frequency for mmc node
In reply to Kever YangQuoted 9 lines
Since the 'clock-freq-min-max' is deprecated, we use max-frequency.
Signed-off-by Kever Yang <[email protected]>Reviewed-by Simon Glass <[email protected]>---
arch/arm/dts/rk3328.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied to u-boot-rockchip/next, thanks!
PATCH 4/7 rockchip: dwmmc: use max-frequency when OF_PLATDATA enabled
In reply to Kever YangSince the 'clock-freq-min-max' is deprecated, we use max-frequency for all rockchip SoC dwmmc controller.
---
drivers/mmc/rockchip_dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +2 -1
@@ -119,7 +119,8 @@ static int rockchip_dwmmc_probe(struct udevice *dev) host->dev_index =0 ; priv->fifo_depth = dtplat->fifo_depth; priv->fifo_mode =0 ; -memcpy (priv->minmax, dtplat->clock_freq_min_max,sizeof (priv->minmax)); + priv->minmax[0 ] =400000 ;/* 400 kHz */ + priv->minmax[1 ] = dtplat->max_frequency; ret =clk_get_by_index_platdata (dev,0 , dtplat->clocks, &priv->clk);if (ret <0 )
Signature · 1 line
1.9.1
PATCH 4/7 rockchip: dwmmc: use max-frequency when OF_PLATDATA enabled
Quoted 8 lines · Kever Yang
Since the 'clock-freq-min-max' is deprecated, we use max-frequency for all rockchip SoC dwmmc controller.
Signed-off-by Kever Yang <[email protected]>---
drivers/mmc/rockchip_dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
I wonder that your earlier patches don't cause a build error though.
PATCH 4/7 rockchip: dwmmc: use max-frequency when OF_PLATDATA enabled
In reply to Kever YangQuoted 10 lines
Since the 'clock-freq-min-max' is deprecated, we use max-frequency for all rockchip SoC dwmmc controller.
Signed-off-by Kever Yang <[email protected]>Reviewed-by Simon Glass <[email protected]>---
drivers/mmc/rockchip_dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-rockchip/next, thanks!
PATCH 5/7 rockchip: firefly-rk3399: dts: enable sdmmc device
In reply to Kever YangEnable sdmmc device and add the spl boot device sequence.
---
arch/arm/dts/rk3399-firefly.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/dts/rk3399-firefly.dts +7 -0
@@ -16,6 +16,7 @@ chosen { stdout-path = &uart2; + u-boot,spl-boot-order = &sdhci, &sdmmc; }; backlight: backlight {
@@ -590,6 +591,12 @@ status = "okay"; }; +&sdmmc { + u-boot,dm-pre-reloc; + bus-width = <4>; + status = "okay"; +}; + &sdhci { bus-width = <8>; keep-power-in-suspend;
Signature · 1 line
1.9.1
PATCH 5/7 rockchip: firefly-rk3399: dts: enable sdmmc device
Quoted 7 lines · Kever Yang
Enable sdmmc device and add the spl boot device sequence.
Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3399-firefly.dts | 7 +++++++ 1 file changed, 7 insertions(+)
PATCH 5/7 rockchip: firefly-rk3399: dts: enable sdmmc device
In reply to Kever YangQuoted 9 lines
Enable sdmmc device and add the spl boot device sequence.
Signed-off-by Kever Yang <[email protected]>Reviewed-by Simon Glass <[email protected]>---
arch/arm/dts/rk3399-firefly.dts | 7 +++++++ 1 file changed, 7 insertions(+)
Applied to u-boot-rockchip/next, thanks!
PATCH 6/7 rockchip: firefly-rk3399: enable dwmmc driver for the board
In reply to Kever YangEnable mmc_dw_rockchip driver, disable CONFIG_SPL_OF_PLATDATA first for some dependence patches still not merged.
---
configs/firefly-rk3399_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/firefly-rk3399_defconfig +1 -1
@@ -22,7 +22,6 @@ CONFIG_CMD_USB=y CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -CONFIG_SPL_OF_PLATDATA=y CONFIG_REGMAP=y CONFIG_SPL_REGMAP=y CONFIG_SYSCON=y
@@ -32,6 +31,7 @@ CONFIG_SPL_CLK=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_DM_ETH=y
Signature · 1 line
1.9.1
PATCH 6/7 rockchip: firefly-rk3399: enable dwmmc driver for the board
Quoted 4 lines · Kever Yang
Enable
mmc_dw_rockchipdriver, disableCONFIG_SPL_OF_PLATDATAfirst for some dependence patches still not merged.Signed-off-by Kever Yang <[email protected]>
Tested v2017.07-rc1 with this patch series booting off of microSD on a firefly-rk3399.
Quoted 18 lines
---
configs/firefly-rk3399_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/firefly-rk3399_defconfig +0
-1@@ -22,7 +22,6 @@ CONFIG_CMD_USB=y CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -CONFIG_SPL_OF_PLATDATA=y CONFIG_REGMAP=y CONFIG_SPL_REGMAP=y CONFIG_SYSCON=y
configs/firefly-rk3399_defconfig CONFIG_SPL_CLK=y · line 37
Quoted 7 lines
configs/firefly-rk3399_defconfig +1
-0@@ -32,6 +31,7 @@ CONFIG_SPL_CLK=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_DM_ETH=y
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170614/3611f77c/attachment.sig>
PATCH 6/7 rockchip: firefly-rk3399: enable dwmmc driver for the board
Quoted 4 lines · Vagrant Cascadian
Quoted 3 lines · Kever Yang
Enable
mmc_dw_rockchipdriver, disableCONFIG_SPL_OF_PLATDATAfirst for some dependence patches still not merged.
Quoted 12 lines
Quoted 1 line
Signed-off-by Kever Yang <[email protected]>Tested v2017.07-rc1 with this patch series booting off of microSD on a firefly-rk3399.
Tested-by Vagrant Cascadian <[email protected]>Quoted 5 lines
---
configs/firefly-rk3399_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 6/7 rockchip: firefly-rk3399: enable dwmmc driver for the board
In reply to Kever YangQuoted 11 lines
Enable
mmc_dw_rockchipdriver, disableCONFIG_SPL_OF_PLATDATAfirst for some dependence patches still not merged.Signed-off-by Kever Yang <[email protected]>Tested-by Vagrant Cascadian <[email protected]>Reviewed-by Simon Glass <[email protected]>---
configs/firefly-rk3399_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-rockchip/next, thanks!
PATCH 7/7 Revert "mmc: dw_mmc: rockchip: select proper card clock"
In reply to Kever YangThe origin patch get rockchip dwmmc by name 'ciu', which lead to the SPL not able to remove 'clock-names' node in dts. I'm not saying this is not correct, but I would prefer to handle this in dts or clock driver to save memory for SPL. For example the rk3288 SPL size has out of memory if not enable BACK_TO_BROM option, there are many other SoCs has less internal memory than rk3288.
This reverts commit 480a9b834c661fc88217f50bdf780192c3018d66.
---
drivers/mmc/rockchip_dw_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/rockchip_dw_mmc.c +2 -2
@@ -44,7 +44,7 @@ static uint rockchip_dwmmc_get_mmc_clk(struct dwmci_host *host, uint freq) ret =clk_set_rate (&priv->clk, freq);if (ret <0 ) { -printf ("%s: err=%d\n" , __func__, ret); +debug ("%s: err=%d\n" , __func__, ret);return ret; }
@@ -126,7 +126,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)if (ret <0 )return ret;#else - ret =clk_get_by_name (dev,"ciu" , &priv->clk); + ret =clk_get_by_index (dev,0 , &priv->clk);if (ret <0 )return ret;#endif
Signature · 1 line
1.9.1
PATCH 7/7 Revert "mmc: dw_mmc: rockchip: select proper card clock"
Quoted 8 lines · Kever Yang
The origin patch get rockchip dwmmc by name 'ciu', which lead to the SPL not able to remove 'clock-names' node in dts. I'm not saying this is not correct, but I would prefer to handle this in dts or clock driver to save memory for SPL. For example the rk3288 SPL size has out of memory if not enable
BACK_TO_BROMoption, there are many other SoCs has less internal memory than rk3288.
Quoted 7 lines
This reverts commit
480a9b834c661fc88217f50bdf780192c3018d66.Signed-off-by Kever Yang <[email protected]>---
drivers/mmc/rockchip_dw_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 7/7 Revert "mmc: dw_mmc: rockchip: select proper card clock"
In reply to Kever YangQuoted 8 lines
The origin patch get rockchip dwmmc by name 'ciu', which lead to the SPL not able to remove 'clock-names' node in dts. I'm not saying this is not correct, but I would prefer to handle this in dts or clock driver to save memory for SPL. For example the rk3288 SPL size has out of memory if not enable
BACK_TO_BROMoption, there are many other SoCs has less internal memory than rk3288.
Quoted 9 lines
This reverts commit
480a9b834c661fc88217f50bdf780192c3018d66.Signed-off-by Kever Yang <[email protected]>Reviewed-by Simon Glass <[email protected]>---
drivers/mmc/rockchip_dw_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to u-boot-rockchip/next, thanks!