mmc: sunxi: Enable DM_MMC
v2 cover mmc: sunxi: Enable DM_MMC
V2 for previous version[1] changes, for enabling DM_MMC on Allwinner platform.
Changes for v2:
- update the 'reset enablement' logic to do
required SoC's
Note: All changes available at u-boot-sunxi/next
[1] https://patchwork.ozlabs.org/cover/1023710/
Any comments?
Jagan.
Jagan Teki (7):
mmc: sunxi: Configure reset support for DM_MMC
mmc: sunxi: Add A83T emmc compatible
mmc: sunxi: Add mmc, emmc H5/A64 compatible
mmc: sunxi: Add DM_MMC support for H6
mmc: sunxi: Add DM_MMC support for A80
arm: sunxi: Enable DM_MMC
arm: dts: sunxi: Enumerate MMC2 as MMC1
arch/arm/Kconfig | 1 + arch/arm/dts/sunxi-u-boot.dtsi | 4 + .../include/asm/arch-sunxi/clock_sun50i_h6.h | 3 + arch/arm/mach-sunxi/Kconfig | 1 - configs/Linksprite_pcDuino3_defconfig | 1 - drivers/mmc/sunxi_mmc.c | 73 ++++++++++++++++++- 6 files changed, 79 insertions(+), 4 deletions(-)
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 1/7 mmc: sunxi: Configure reset support for DM_MMC
Start with Allwinner A31, mmc controllers do support reset control bit. This code add support to enable the reset control start from SUN6I even though it share same compatible between SUN4I and SUN6I.
--- drivers/mmc/sunxi_mmc.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/mmc/sunxi_mmc.c +19 -2
@@ -21,8 +21,11 @@#ifdef CONFIG_DM_MMC struct sunxi_mmc_variant { +bool has_reset;u16 gate_offset;u16 mclk_offset; +u16 reset_offset; +u8 reset_start_bit; };#endif
@@ -609,7 +612,7 @@ static int sunxi_mmc_probe(struct udevice *dev)struct sunxi_mmc_priv *priv =dev_get_priv (dev);struct mmc_config *cfg = &plat->cfg;struct ofnode_phandle_args args; -u32 *gate_reg, *ccu_reg; +u32 *gate_reg, *reset_reg, *ccu_reg;int bus_width, ret; cfg->name = dev->name;
@@ -644,6 +647,12 @@ static int sunxi_mmc_probe(struct udevice *dev) gate_reg = (void *)ccu_reg + priv->variant->gate_offset;setbits_le32 (gate_reg,BIT (AHB_GATE_OFFSET_MMC (priv->mmc_no))); +if ((!IS_ENABLED (CONFIG_MACH_SUN7I )) && priv->variant->has_reset) { + reset_reg = (void *)ccu_reg + priv->variant->reset_offset; +setbits_le32 (reset_reg,BIT (priv->mmc_no + + priv->variant->reset_start_bit)); + } + ret =mmc_set_mod_clk (priv,24000000 );if (ret)return ret;
@@ -680,6 +689,14 @@ static const struct sunxi_mmc_variant sun4i_a10_variant = { .mclk_offset = 0x88, }; +static const struct sunxi_mmc_variant sun7i_a20_variant = { + .has_reset = true, + .gate_offset =0x60 , + .mclk_offset =0x88 , + .reset_offset =0x2c0 , + .reset_start_bit =8 , +}; +static const struct udevice_id sunxi_mmc_ids[] = { { .compatible ="allwinner,sun4i-a10-mmc" ,
@@ -691,7 +708,7 @@ static const struct udevice_id sunxi_mmc_ids[] = { }, { .compatible = "allwinner,sun7i-a20-mmc", - .data = (ulong)&sun4i_a10_variant, + .data = (ulong)&sun7i_a20_variant, }, {/* sentinel */ } };
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 2/7 mmc: sunxi: Add A83T emmc compatible
In reply to Jagan TekiAdd emmc compatible for A83T SoC.
--- drivers/mmc/sunxi_mmc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mmc/sunxi_mmc.c +4 -0
@@ -710,6 +710,10 @@ static const struct udevice_id sunxi_mmc_ids[] = { .compatible = "allwinner,sun7i-a20-mmc", .data = (ulong)&sun7i_a20_variant, }, + { + .compatible = "allwinner,sun8i-a83t-emmc", + .data = (ulong)&sun7i_a20_variant, + }, {/* sentinel */ } };
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 3/7 mmc: sunxi: Add mmc, emmc H5/A64 compatible
In reply to Jagan TekiAdded H5, A64 compatible for mmc and emmc.
--- drivers/mmc/sunxi_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/mmc/sunxi_mmc.c +8 -0
@@ -714,6 +714,14 @@ static const struct udevice_id sunxi_mmc_ids[] = { .compatible = "allwinner,sun8i-a83t-emmc", .data = (ulong)&sun7i_a20_variant, }, + { + .compatible = "allwinner,sun50i-a64-mmc", + .data = (ulong)&sun7i_a20_variant, + }, + { + .compatible = "allwinner,sun50i-a64-emmc", + .data = (ulong)&sun7i_a20_variant, + }, {/* sentinel */ } };
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 4/7 mmc: sunxi: Add DM_MMC support for H6
In reply to Jagan TekiUnlike other Allwinner SoC's, H6 comes with different clock and reset control offset values. So support them via driver data.
--- .../arm/include/asm/arch-sunxi/clock_sun50i_h6.h | 3 +++ drivers/mmc/sunxi_mmc.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+)
arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h +3 -0
@@ -301,6 +301,9 @@ struct sunxi_ccm_reg {#define DRAM_CLK_SRC_PLL5 (0 << 24)#define DRAM_CLK_M (m) (((m)-1) << 0) +/* MMC ahb clock bit field */ +#define AHB_GATE_OFFSET_MMC (n) ((n)) +/* MMC clock bit field */ #define CCM_MMC_CTRL_M (x) ((x) - 1)#define CCM_MMC_CTRL_N (x) ((x) << 8)
drivers/mmc/sunxi_mmc.c +16 -0
@@ -697,6 +697,14 @@ static const struct sunxi_mmc_variant sun7i_a20_variant = { .reset_start_bit = 8, }; +static const struct sunxi_mmc_variant sun50i_h6_variant = { + .has_reset = true, + .gate_offset =0x84c , + .mclk_offset =0x830 , + .reset_offset =0x84c , + .reset_start_bit =16 , +}; +static const struct udevice_id sunxi_mmc_ids[] = { { .compatible ="allwinner,sun4i-a10-mmc" ,
@@ -722,6 +730,14 @@ static const struct udevice_id sunxi_mmc_ids[] = { .compatible = "allwinner,sun50i-a64-emmc", .data = (ulong)&sun7i_a20_variant, }, + { + .compatible = "allwinner,sun50i-h6-mmc", + .data = (ulong)&sun50i_h6_variant, + }, + { + .compatible = "allwinner,sun50i-h6-emmc", + .data = (ulong)&sun50i_h6_variant, + }, {/* sentinel */ } };
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 5/7 mmc: sunxi: Add DM_MMC support for A80
In reply to Jagan TekiUnlike other Allwinner SoC's, A80 comes with different ahb gate clock offset values and also has mmc common controller. So support them via driver data.
--- drivers/mmc/sunxi_mmc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/mmc/sunxi_mmc.c +24 -0
@@ -22,6 +22,7 @@ #ifdef CONFIG_DM_MMC struct sunxi_mmc_variant { bool has_reset; + bool has_mmc_common; u16 gate_offset; u16 mclk_offset; u16 reset_offset;
@@ -653,6 +654,19 @@ static int sunxi_mmc_probe(struct udevice *dev) priv->variant->reset_start_bit)); } +if (priv->variant->has_mmc_common) { +u32 *mmc_config_clk, *mmc_common_base; + + ret =dev_read_phandle_with_args (dev,"clocks" ,"#clock-cells" ,0 , +0 , &args); +if (ret) +return ret; + mmc_config_clk = (u32 *)ofnode_get_addr (args.node); + + mmc_common_base = (void *)mmc_config_clk + (priv->mmc_no *4 ); +setbits_le32 (mmc_common_base,BIT (18 ) |BIT (16 )); + } + ret =mmc_set_mod_clk (priv,24000000 );if (ret)return ret;
@@ -697,6 +711,12 @@ static const struct sunxi_mmc_variant sun7i_a20_variant = { .reset_start_bit = 8, }; +static const struct sunxi_mmc_variant sun9i_a80_variant = { + .has_mmc_common = true, + .gate_offset =0x580 , + .mclk_offset =0x410 , +}; +static const struct sunxi_mmc_variant sun50i_h6_variant = { .has_reset = true, .gate_offset =0x84c ,
@@ -722,6 +742,10 @@ static const struct udevice_id sunxi_mmc_ids[] = { .compatible = "allwinner,sun8i-a83t-emmc", .data = (ulong)&sun7i_a20_variant, }, + { + .compatible = "allwinner,sun9i-a80-mmc", + .data = (ulong)&sun9i_a80_variant, + }, { .compatible = "allwinner,sun50i-a64-mmc", .data = (ulong)&sun7i_a20_variant,
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 6/7 arm: sunxi: Enable DM_MMC
In reply to Jagan TekiEnable DM_MMC for all Allwinner SoCs, this will eventually enable BLK.
Also removed DM_MMC enablement in few parts of sunxi configurations.
--- arch/arm/Kconfig | 1 + arch/arm/mach-sunxi/Kconfig | 1 - configs/Linksprite_pcDuino3_defconfig | 1 - 3 files changed, 1 insertion(+), 2 deletions(-)
arch/arm/Kconfig +1 -0
@@ -851,6 +851,7 @@ config ARCH_SUNXI select DM_ETH select DM_GPIO select DM_KEYBOARD + select DM_MMC if MMC select DM_SERIAL select DM_USB if DISTRO_DEFAULTS select OF_BOARD_SETUP
arch/arm/mach-sunxi/Kconfig +0 -1
@@ -154,7 +154,6 @@ config MACH_SUN4I bool "sun4i (Allwinner A10)" select CPU_V7A select ARM_CORTEX_CPU_IS_UP - select DM_MMC if MMC select DM_SCSI if SCSI select PHY_SUN4I_USB select DRAM_SUN4I
configs/Linksprite_pcDuino3_defconfig +0 -1
@@ -14,7 +14,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3" CONFIG_SCSI_AHCI=y -CONFIG_DM_MMC=y CONFIG_ETH_DESIGNWARE=y CONFIG_MII=y CONFIG_SUN7I_GMAC=y
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH v2 7/7 arm: dts: sunxi: Enumerate MMC2 as MMC1
In reply to Jagan TekiEnvironment and fastboot MMC devices are configured based number of mmc slots defined on particular board in sunxi platform.
If number of slots are not more than 1, it assigns 0 which usually mmc device on SD slot. With DM_MMC it is detected as 0 since mmc0 node always be an mmc device.
If number of slots are more than 1, it assigns 1 which assumes 0 is mmc device and 1 is emmc device. But with DM_MMC there is chance of detecting emmc as device 2 since mmc1 is SDIO as per devicetree definition.
So override mmc2 to mmc1 in sunxi dtsi, this will eventually detect mmc2 as mmc 1 device even if the board dts has mmc0, mmc1, mmc2.
Some platforms like A20 has mmc0...mmc3, but there is no usecases now for enabling all mmc controllers in any of A20 board dts files.
--- arch/arm/dts/sunxi-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/sunxi-u-boot.dtsi +4 -0
@@ -1,6 +1,10 @@ #include <config.h> / { + aliases { + mmc1 = &mmc2; + }; + binman { filename = "u-boot-sunxi-with-spl.bin"; pad-byte = <0xff>;
Signature · 1 line
2.18.0.321.gffc6fa0e3
v2 cover mmc: sunxi: Enable DM_MMC
In reply to Jagan TekiQuoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.
So this is a neat and simple solution to the DM_MMC problem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place.
But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).
Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.
Does that make sense? Happy to bake some patches for that on the weekend.
Btw: After talking to Tom on IRC, the DM_MMC deadline is actually _after_ the 2019.04 release, so we don't need to have DM_MMC support in this merge window.
Cheers,
Andre.
Quoted 28 lines
Changes for v2:
- update the 'reset enablement' logic to do
required SoC'sNote: All changes available at u-boot-sunxi/next
[1] https://patchwork.ozlabs.org/cover/1023710/
Any comments?
Jagan.Jagan Teki (7):
mmc: sunxi: Configure reset support forDM_MMC
mmc: sunxi: Add A83T emmc compatible
mmc: sunxi: Add mmc, emmc H5/A64 compatible
mmc: sunxi: AddDM_MMCsupport for H6
mmc: sunxi: AddDM_MMCsupport for A80
arm: sunxi: EnableDM_MMC
arm: dts: sunxi: Enumerate MMC2 as MMC1arch/arm/Kconfig | 1 + arch/arm/dts/sunxi-u-boot.dtsi | 4 + .../include/asm/arch-sunxi/clock_sun50i_h6.h | 3 + arch/arm/mach-sunxi/Kconfig | 1 - configs/Linksprite_pcDuino3_defconfig | 1 - drivers/mmc/sunxi_mmc.c | 73++++++++++++++++++- 6 files changed, 79 insertions(+), 4 deletions(-)
v2 cover mmc: sunxi: Enable DM_MMC
Quoted 24 lines · Andre Przywara
Quoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.So this is a neat and simple solution to the
DM_MMCproblem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place.
But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.
Quoted 6 lines
Does that make sense? Happy to bake some patches for that on the weekend.
Btw: After talking to Tom on IRC, the
DM_MMCdeadline is actually _after_ the 2019.04 release, so we don't need to haveDM_MMCsupport in this merge window.
To be clearer, I plan to mark as BROKEN and start saying we're going to remove stuff that isn't migrated, after the release. So it would be good to get things moved this release that can be moved this release. Trying to use sunxi w/o MMC isn't going to be fun :)
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190118/8315887e/attachment.sig>
v2 cover mmc: sunxi: Enable DM_MMC
Quoted 28 lines · On Fri, 18 Jan 2019 07:17:41 -0500 Tom Rini <[email protected]> wrote:
Quoted 27 lines · Andre Przywara
Quoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.So this is a neat and simple solution to the
DM_MMCproblem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place.
But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.Does that make sense? Happy to bake some patches for that on the weekend.
Quoted 8 lines
Quoted 3 lines
Btw: After talking to Tom on IRC, the
DM_MMCdeadline is actually _after_ the 2019.04 release, so we don't need to haveDM_MMCsupport in this merge window.To be clearer, I plan to mark as BROKEN and start saying we're going to remove stuff that isn't migrated, after the release. So it would be good to get things moved this release that can be moved this release. Trying to use sunxi w/o MMC isn't going to be fun :)
Understood. I just gave it a quick try and it is actually quite easy: We are pretty good already regarding gate clocks and resets, with the new DM_CLK driver (v2 on the list). And using them in sunxi_mmc.c is a piece of cake and very clean.
We just need to keep the MMC mod clock hack in (which this series here does as well), but can still enable DM_MMC.
And for the next merge window we can tackle this by implementing the MMC mod clock properly in the clock driver, then replacing the hack with the normal clk_get_by_name(); clk_set_rate(); sequence.
Will send a patch later.
Cheers,
Andre
v2 cover mmc: sunxi: Enable DM_MMC
Quoted 41 lines · Andre Przywara
Quoted 28 lines · On Fri, 18 Jan 2019 07:17:41 -0500 Tom Rini <[email protected]> wrote:
Quoted 27 lines · Andre Przywara
Quoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.So this is a neat and simple solution to the
DM_MMCproblem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place.
But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.Does that make sense? Happy to bake some patches for that on the weekend.
Quoted 8 lines
Quoted 3 lines
Btw: After talking to Tom on IRC, the
DM_MMCdeadline is actually _after_ the 2019.04 release, so we don't need to haveDM_MMCsupport in this merge window.To be clearer, I plan to mark as BROKEN and start saying we're going to remove stuff that isn't migrated, after the release. So it would be good to get things moved this release that can be moved this release. Trying to use sunxi w/o MMC isn't going to be fun :)
Quoted 9 lines
Understood. I just gave it a quick try and it is actually quite easy: We are pretty good already regarding gate clocks and resets, with the new
DM_CLKdriver (v2 on the list). And using them insunxi_mmc.cis a piece of cake and very clean.
We just need to keep the MMC mod clock hack in (which this series here does as well), but can still enableDM_MMC.
And for the next merge window we can tackle this by implementing the MMC mod clock properly in the clock driver, then replacing the hack with the normalclk_get_by_name();clk_set_rate(); sequence.
I tried with ahb clock and reset, with v2 version of CLK series and it's straightforward. but mmc clock may take some time along with series of testing. So I just windup this, instead of making some noise at last minute.
v2 cover mmc: sunxi: Enable DM_MMC
On Fri, 18 Jan 2019 22:11:36 +0530
Jagan Teki <[email protected]> wrote:
Hi,
Quoted 55 lines
Quoted 43 lines · Andre Przywara
Quoted 33 lines · On Fri, 18 Jan 2019 07:17:41 -0500 Tom Rini <[email protected]> wrote:
Quoted 25 lines · Andre Przywara
Quoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.So this is a neat and simple solution to the
DM_MMCproblem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place. But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.Quoted 6 lines
Does that make sense? Happy to bake some patches for that on the weekend.
Btw: After talking to Tom on IRC, the
DM_MMCdeadline is actually _after_ the 2019.04 release, so we don't need to haveDM_MMCsupport in this merge window.Quoted 5 lines
To be clearer, I plan to mark as BROKEN and start saying we're going to remove stuff that isn't migrated, after the release. So it would be good to get things moved this release that can be moved this release. Trying to use sunxi w/o MMC isn't going to be fun :)
Quoted 9 lines
Understood. I just gave it a quick try and it is actually quite
easy: We are pretty good already regarding gate clocks and resets, with the newDM_CLKdriver (v2 on the list). And using them insunxi_mmc.cis a piece of cake and very clean.
We just need to keep the MMC mod clock hack in (which this series here does as well), but can still enableDM_MMC.
And for the next merge window we can tackle this by implementing the MMC mod clock properly in the clock driver, then replacing the hack with the normalclk_get_by_name();clk_set_rate(); sequence.
Quoted 4 lines
I tried with ahb clock and reset, with v2 version of CLK series and it's straightforward. but mmc clock may take some time along with series of testing. So I just windup this, instead of making some noise at last minute.
What do you mean with that, exactly?
Do you plan to take your platdata hack for 2019.04?
I don't like the idea of hacking something up that has no future and will be reverted very soon anyway. Instead we should expose the foundation part of the clock driver to people now for testing (as you did by pushing it, thanks!), but including the MMC gates and resets. I have this code ready, just need to test it on some SoCs this evening.
I think taking this change is the best compromise between changing not too many things at once, yet still exposing new code to the users for testing.
And yes, the MMC mod clock is somewhat of a beast, but if we have just this in the next release, it should be easier to debug than when we expose the whole of the new clock framework to MMC by then only.
Cheers,
Andre.
v2 cover mmc: sunxi: Enable DM_MMC
Quoted 74 lines · Andre Przywara
On Fri, 18 Jan 2019 22:11:36 +0530
Jagan Teki <[email protected]> wrote:Hi,
Quoted 55 lines
Quoted 43 lines · Andre Przywara
Quoted 33 lines · On Fri, 18 Jan 2019 07:17:41 -0500 Tom Rini <[email protected]> wrote:
Quoted 25 lines · Andre Przywara
Quoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.So this is a neat and simple solution to the
DM_MMCproblem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place. But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.Quoted 6 lines
Does that make sense? Happy to bake some patches for that on the weekend.
Btw: After talking to Tom on IRC, the
DM_MMCdeadline is actually _after_ the 2019.04 release, so we don't need to haveDM_MMCsupport in this merge window.Quoted 5 lines
To be clearer, I plan to mark as BROKEN and start saying we're going to remove stuff that isn't migrated, after the release. So it would be good to get things moved this release that can be moved this release. Trying to use sunxi w/o MMC isn't going to be fun :)
Quoted 9 lines
Understood. I just gave it a quick try and it is actually quite
easy: We are pretty good already regarding gate clocks and resets, with the newDM_CLKdriver (v2 on the list). And using them insunxi_mmc.cis a piece of cake and very clean.
We just need to keep the MMC mod clock hack in (which this series here does as well), but can still enableDM_MMC.
And for the next merge window we can tackle this by implementing the MMC mod clock properly in the clock driver, then replacing the hack with the normalclk_get_by_name();clk_set_rate(); sequence.Quoted 4 lines
I tried with ahb clock and reset, with v2 version of CLK series and it's straightforward. but mmc clock may take some time along with series of testing. So I just windup this, instead of making some noise at last minute.
What do you mean with that, exactly?
Do you plan to take your platdata hack for 2019.04?
I don't like the idea of hacking something up that has no future and will be reverted very soon anyway. Instead we should expose the foundation part of the clock driver to people now for testing (as you did by pushing it, thanks!), but including the MMC gates and resets. I have this code ready, just need to test it on some SoCs this evening.
Quoted 7 lines
I think taking this change is the best compromise between changing not too many things at once, yet still exposing new code to the users for testing.
And yes, the MMC mod clock is somewhat of a beast, but if we have just this in the next release, it should be easier to debug than when we expose the whole of the new clock framework to MMC by then only.
This is I was thinking too, in fact I have created next version wrt CLK support which may override your recent changes. May be I can prepare and by combining both. what do you say?
v2 cover mmc: sunxi: Enable DM_MMC
Quoted 79 lines · Jagan Teki
Quoted 78 lines · Andre Przywara
On Fri, 18 Jan 2019 22:11:36 +0530
Jagan Teki <[email protected]> wrote:Hi,
Quoted 55 lines
Quoted 43 lines · Andre Przywara
Quoted 33 lines · On Fri, 18 Jan 2019 07:17:41 -0500 Tom Rini <[email protected]> wrote:
Quoted 25 lines · Andre Przywara
Quoted 2 lines · On Thu, 17 Jan 2019 22:39:44 +0530 Jagan Teki <[email protected]>…
V2 for previous version[1] changes, for enabling
DM_MMCon Allwinner platform.So this is a neat and simple solution to the
DM_MMCproblem, to the point where I am wondering why we actually need all those DT driven clock and reset drivers in the first place. But as I understand using plat data in this way is somewhat frowned upon and considered deprecated (although it makes a lot of sense in this context).Also, isn't this series independent from the clock gates/reset patches? So why do you pile them on top of each other in sunxi/next?
If we really want to have the full featured DT driven clock and reset support, why not use it together:
We keep the current mod clock support in the MMC driver, but use the newly introduced clock gates and reset support via the new clock driver, mostly replacing this series. This would give us some test coverage of the new clock driver, while still avoiding to rush the MMC mod clock implementation.Quoted 6 lines
Does that make sense? Happy to bake some patches for that on the weekend.
Btw: After talking to Tom on IRC, the
DM_MMCdeadline is actually _after_ the 2019.04 release, so we don't need to haveDM_MMCsupport in this merge window.Quoted 5 lines
To be clearer, I plan to mark as BROKEN and start saying we're going to remove stuff that isn't migrated, after the release. So it would be good to get things moved this release that can be moved this release. Trying to use sunxi w/o MMC isn't going to be fun :)
Quoted 9 lines
Understood. I just gave it a quick try and it is actually quite
easy: We are pretty good already regarding gate clocks and resets, with the newDM_CLKdriver (v2 on the list). And using them insunxi_mmc.cis a piece of cake and very clean.
We just need to keep the MMC mod clock hack in (which this series here does as well), but can still enableDM_MMC.
And for the next merge window we can tackle this by implementing the MMC mod clock properly in the clock driver, then replacing the hack with the normalclk_get_by_name();clk_set_rate(); sequence.Quoted 4 lines
I tried with ahb clock and reset, with v2 version of CLK series and it's straightforward. but mmc clock may take some time along with series of testing. So I just windup this, instead of making some noise at last minute.
What do you mean with that, exactly?
Do you plan to take your platdata hack for 2019.04?
I don't like the idea of hacking something up that has no future and will be reverted very soon anyway. Instead we should expose the foundation part of the clock driver to people now for testing (as you did by pushing it, thanks!), but including the MMC gates and resets. I have this code ready, just need to test it on some SoCs this evening.I think taking this change is the best compromise between changing not too many things at once, yet still exposing new code to the users for testing.
Quoted 7 lines
Quoted 3 lines
And yes, the MMC mod clock is somewhat of a beast, but if we have just this in the next release, it should be easier to debug than when we expose the whole of the new clock framework to MMC by then only.
This is I was thinking too, in fact I have created next version wrt CLK support which may override your recent changes. May be I can prepare and by combining both. what do you say?
It's hard to say without seeing the code, but I think we should take it easy, since I believe we have enough invasive changes for one release already.
Given the sheer number of Allwinner boards that we change (142!) compared to the number of boards that we can test ourselves we should be more careful, thinking about the breakages we had in December alone.
What's in sunxi/master is probably in good shape, and together with the part that enables MMC to use it we get rid of the warnings already, so I think it's worth trying to push this into the 2019.04 release. This relieves us from the pressure and allows to give the new clock framework some testing.
And by running buildman I saw that we still get warnings about DM_VIDEO (95 boards) and DM_SCSI (22 boards), so there is still enough work ahead.
So sure, let's share the code, but lets keep the changes as minimal as possible. The MMC mod clock certainly isn't minimal.
Cheers,
Andre.