public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 00/19] Second step support for A100
@ 2020-11-10  6:20 Frank Lee
  2020-11-10  6:45 ` [RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles Frank Lee
  2020-11-10  6:46 ` [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller Frank Lee
  0 siblings, 2 replies; 6+ messages in thread
From: Frank Lee @ 2020-11-10  6:20 UTC (permalink / raw)
  To: tiny.windzz, dmaengine, devicetree, linux-arm-kernel,
	linux-kernel, linux-mmc, linux-watchdog, linux-gpio
  Cc: Frank Lee, Vinod Koul, Rob Herring, Maxime Ripard, Chen-Yu Tsai,
	Ulf Hansson, Kishon Vijay Abraham I, Wim Van Sebroeck,
	Guenter Roeck, Dan Williams, Linus Walleij, Wolfram Sang,
	Marek Vasut, Douglas Anderson, Randy Dunlap, Krzysztof Kozlowski,
	Colin Ian King, Ondrej Jirman, Rikard Falkeborn,
	Greg Kroah-Hartman

Let's add watchdog, arm-pmu, dma, usb, mmc..... support for allwinner
a100 soc.

Yangtao Li (19):
  pinctrl: sunxi: fix irq bank map for the Allwinner A100 pin controller
  pinctrl: sunxi: Mark the irq bank not found in
    sunxi_pinctrl_irq_handler() with WARN_ON
  pinctrl: sunxi: Always call chained_irq_{enter, exit} in
    sunxi_pinctrl_irq_handler
  dt-bindings: dma: allwinner,sun50i-a64-dma: Add A100 compatible
  dmaengine: sun6i: Add support for A100 DMA
  arm64: allwinner: a100: Add device node for DMA controller
  arm64: dts: allwinner: A100: Add PMU mode
  phy: sun4i-usb: remove enable_pmu_unk1 from sun50i_h6_cfg
  phy: allwinner: Convert to devm_platform_ioremap_* API
  dt-bindings: watchdog: sun4i: Add A100 compatible
  arm64: dts: allwinner: a100: add watchdog node
  dt-bindings: Add bindings for USB phy on Allwinner A100
  phy: sun4i-usb: add support for A100 USB PHY
  arm64: dts: allwinner: a100: add usb related nodes
  arm64: allwinner: A100: enable EHCI, OHCI and USB PHY nodes in Perf1
  dt-bindings: mmc: sunxi: Add A100 compatibles
  mmc: sunxi: add support for A100 mmc controller
  arm64: allwinner: a100: Add MMC related nodes
  arm64: dts: allwinner: a100: perf1: Add eMMC and MMC node

 .../dma/allwinner,sun50i-a64-dma.yaml         |   5 +-
 .../bindings/mmc/allwinner,sun4i-a10-mmc.yaml |   2 +
 .../phy/allwinner,sun50i-a100-usb-phy.yaml    | 105 ++++++++++
 .../watchdog/allwinner,sun4i-a10-wdt.yaml     |   3 +
 .../allwinner/sun50i-a100-allwinner-perf1.dts |  54 +++++
 .../arm64/boot/dts/allwinner/sun50i-a100.dtsi | 197 +++++++++++++++++-
 drivers/dma/sun6i-dma.c                       |  25 +++
 drivers/mmc/host/sunxi-mmc.c                  |  28 ++-
 drivers/phy/allwinner/phy-sun4i-usb.c         |  29 ++-
 drivers/phy/allwinner/phy-sun50i-usb3.c       |   4 +-
 drivers/phy/allwinner/phy-sun6i-mipi-dphy.c   |   4 +-
 drivers/phy/allwinner/phy-sun9i-usb.c         |   4 +-
 drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c   |   2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c         |   9 +-
 14 files changed, 443 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/allwinner,sun50i-a100-usb-phy.yaml

-- 
2.28.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles
  2020-11-10  6:20 [RESEND PATCH 00/19] Second step support for A100 Frank Lee
@ 2020-11-10  6:45 ` Frank Lee
  2020-11-11 22:51   ` Rob Herring
  2020-11-10  6:46 ` [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller Frank Lee
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Lee @ 2020-11-10  6:45 UTC (permalink / raw)
  To: tiny.windzz
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mmc, Yangtao Li,
	Ulf Hansson, Rob Herring, Maxime Ripard, Chen-Yu Tsai

From: Yangtao Li <frank@allwinnertech.com>

Add binding for A100's mmc and emmc controller.

Signed-off-by: Yangtao Li <frank@allwinnertech.com>
---
 .../devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml        | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml b/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml
index e82c9a07b6fb..41821f14ecaa 100644
--- a/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml
+++ b/Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml
@@ -26,6 +26,8 @@ properties:
       - const: allwinner,sun9i-a80-mmc
       - const: allwinner,sun50i-a64-emmc
       - const: allwinner,sun50i-a64-mmc
+      - const: allwinner,sun50i-a100-emmc
+      - const: allwinner,sun50i-a100-mmc
       - items:
           - const: allwinner,sun8i-a83t-mmc
           - const: allwinner,sun7i-a20-mmc
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller
  2020-11-10  6:20 [RESEND PATCH 00/19] Second step support for A100 Frank Lee
  2020-11-10  6:45 ` [RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles Frank Lee
@ 2020-11-10  6:46 ` Frank Lee
  2020-11-28 19:56   ` André Przywara
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Lee @ 2020-11-10  6:46 UTC (permalink / raw)
  To: tiny.windzz
  Cc: linux-arm-kernel, linux-kernel, linux-mmc, Yangtao Li,
	Ulf Hansson, Maxime Ripard, Chen-Yu Tsai, Marek Vasut,
	Rui Miguel Silva, Wolfram Sang, Douglas Anderson

From: Yangtao Li <frank@allwinnertech.com>

This patch adds support for A100 MMC controller, which use word address
for internal dma.

Signed-off-by: Yangtao Li <frank@allwinnertech.com>
---
 drivers/mmc/host/sunxi-mmc.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index fc62773602ec..1518b64112b7 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -244,6 +244,7 @@ struct sunxi_idma_des {
 
 struct sunxi_mmc_cfg {
 	u32 idma_des_size_bits;
+	u32 idma_des_shift;
 	const struct sunxi_mmc_clk_delay *clk_delays;
 
 	/* does the IP block support autocalibration? */
@@ -343,7 +344,7 @@ static int sunxi_mmc_init_host(struct sunxi_mmc_host *host)
 	/* Enable CEATA support */
 	mmc_writel(host, REG_FUNS, SDXC_CEATA_ON);
 	/* Set DMA descriptor list base address */
-	mmc_writel(host, REG_DLBA, host->sg_dma);
+	mmc_writel(host, REG_DLBA, host->sg_dma >> host->cfg->idma_des_shift);
 
 	rval = mmc_readl(host, REG_GCTRL);
 	rval |= SDXC_INTERRUPT_ENABLE_BIT;
@@ -373,8 +374,10 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
 
 		next_desc += sizeof(struct sunxi_idma_des);
 		pdes[i].buf_addr_ptr1 =
-			cpu_to_le32(sg_dma_address(&data->sg[i]));
-		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc);
+			cpu_to_le32(sg_dma_address(&data->sg[i]) >>
+				    host->cfg->idma_des_shift);
+		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc >>
+						    host->cfg->idma_des_shift);
 	}
 
 	pdes[0].config |= cpu_to_le32(SDXC_IDMAC_DES0_FD);
@@ -1178,6 +1181,23 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = {
 	.needs_new_timings = true,
 };
 
+static const struct sunxi_mmc_cfg sun50i_a100_cfg = {
+	.idma_des_size_bits = 16,
+	.idma_des_shift = 2,
+	.clk_delays = NULL,
+	.can_calibrate = true,
+	.mask_data0 = true,
+	.needs_new_timings = true,
+};
+
+static const struct sunxi_mmc_cfg sun50i_a100_emmc_cfg = {
+	.idma_des_size_bits = 13,
+	.idma_des_shift = 2,
+	.clk_delays = NULL,
+	.can_calibrate = true,
+	.needs_new_timings = true,
+};
+
 static const struct of_device_id sunxi_mmc_of_match[] = {
 	{ .compatible = "allwinner,sun4i-a10-mmc", .data = &sun4i_a10_cfg },
 	{ .compatible = "allwinner,sun5i-a13-mmc", .data = &sun5i_a13_cfg },
@@ -1186,6 +1206,8 @@ static const struct of_device_id sunxi_mmc_of_match[] = {
 	{ .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg },
 	{ .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg },
 	{ .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg },
+	{ .compatible = "allwinner,sun50i-a100-mmc", .data = &sun50i_a100_cfg },
+	{ .compatible = "allwinner,sun50i-a100-emmc", .data = &sun50i_a100_emmc_cfg },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles
  2020-11-10  6:45 ` [RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles Frank Lee
@ 2020-11-11 22:51   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2020-11-11 22:51 UTC (permalink / raw)
  To: Frank Lee
  Cc: Chen-Yu Tsai, Rob Herring, linux-kernel, Maxime Ripard, linux-mmc,
	tiny.windzz, Ulf Hansson, devicetree, linux-arm-kernel

On Tue, 10 Nov 2020 14:45:16 +0800, Frank Lee wrote:
> From: Yangtao Li <frank@allwinnertech.com>
> 
> Add binding for A100's mmc and emmc controller.
> 
> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> ---
>  .../devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml        | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller
  2020-11-10  6:46 ` [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller Frank Lee
@ 2020-11-28 19:56   ` André Przywara
  2020-11-29  1:38     ` André Przywara
  0 siblings, 1 reply; 6+ messages in thread
From: André Przywara @ 2020-11-28 19:56 UTC (permalink / raw)
  To: Frank Lee, tiny.windzz
  Cc: Marek Vasut, Ulf Hansson, Wolfram Sang, linux-mmc, linux-kernel,
	Maxime Ripard, Douglas Anderson, Rui Miguel Silva, Chen-Yu Tsai,
	linux-arm-kernel

On 10/11/2020 06:46, Frank Lee wrote:

Hi,

> From: Yangtao Li <frank@allwinnertech.com>
> 
> This patch adds support for A100 MMC controller, which use word address
> for internal dma.
> 
> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index fc62773602ec..1518b64112b7 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -244,6 +244,7 @@ struct sunxi_idma_des {
>  
>  struct sunxi_mmc_cfg {
>  	u32 idma_des_size_bits;
> +	u32 idma_des_shift;
>  	const struct sunxi_mmc_clk_delay *clk_delays;
>  
>  	/* does the IP block support autocalibration? */
> @@ -343,7 +344,7 @@ static int sunxi_mmc_init_host(struct sunxi_mmc_host *host)
>  	/* Enable CEATA support */
>  	mmc_writel(host, REG_FUNS, SDXC_CEATA_ON);
>  	/* Set DMA descriptor list base address */
> -	mmc_writel(host, REG_DLBA, host->sg_dma);
> +	mmc_writel(host, REG_DLBA, host->sg_dma >> host->cfg->idma_des_shift);
>  
>  	rval = mmc_readl(host, REG_GCTRL);
>  	rval |= SDXC_INTERRUPT_ENABLE_BIT;
> @@ -373,8 +374,10 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
>  
>  		next_desc += sizeof(struct sunxi_idma_des);
>  		pdes[i].buf_addr_ptr1 =
> -			cpu_to_le32(sg_dma_address(&data->sg[i]));
> -		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc);
> +			cpu_to_le32(sg_dma_address(&data->sg[i]) >>
> +				    host->cfg->idma_des_shift);
> +		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc >>
> +						    host->cfg->idma_des_shift);

I think you should cast after the shift, otherwise you lose the ability
to run above 4 GB. This won't be a problem at the moment, since we still
use the default 32-bit DMA mask, but might bite us later.

Otherwise this patch looks fine, and works on the H616 as well.

Cheers,
Andre

>  	}
>  
>  	pdes[0].config |= cpu_to_le32(SDXC_IDMAC_DES0_FD);
> @@ -1178,6 +1181,23 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = {
>  	.needs_new_timings = true,
>  };
>  
> +static const struct sunxi_mmc_cfg sun50i_a100_cfg = {
> +	.idma_des_size_bits = 16,
> +	.idma_des_shift = 2,
> +	.clk_delays = NULL,
> +	.can_calibrate = true,
> +	.mask_data0 = true,
> +	.needs_new_timings = true,
> +};
> +
> +static const struct sunxi_mmc_cfg sun50i_a100_emmc_cfg = {
> +	.idma_des_size_bits = 13,
> +	.idma_des_shift = 2,
> +	.clk_delays = NULL,
> +	.can_calibrate = true,
> +	.needs_new_timings = true,
> +};
> +
>  static const struct of_device_id sunxi_mmc_of_match[] = {
>  	{ .compatible = "allwinner,sun4i-a10-mmc", .data = &sun4i_a10_cfg },
>  	{ .compatible = "allwinner,sun5i-a13-mmc", .data = &sun5i_a13_cfg },
> @@ -1186,6 +1206,8 @@ static const struct of_device_id sunxi_mmc_of_match[] = {
>  	{ .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg },
>  	{ .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg },
>  	{ .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg },
> +	{ .compatible = "allwinner,sun50i-a100-mmc", .data = &sun50i_a100_cfg },
> +	{ .compatible = "allwinner,sun50i-a100-emmc", .data = &sun50i_a100_emmc_cfg },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller
  2020-11-28 19:56   ` André Przywara
@ 2020-11-29  1:38     ` André Przywara
  0 siblings, 0 replies; 6+ messages in thread
From: André Przywara @ 2020-11-29  1:38 UTC (permalink / raw)
  To: Frank Lee, tiny.windzz
  Cc: Marek Vasut, Ulf Hansson, Wolfram Sang, linux-mmc, linux-kernel,
	Maxime Ripard, Douglas Anderson, Rui Miguel Silva, Chen-Yu Tsai,
	linux-arm-kernel, Jernej Skrabec

On 28/11/2020 19:56, André Przywara wrote:
> On 10/11/2020 06:46, Frank Lee wrote:

Hi,

one more thing below ...

>> From: Yangtao Li <frank@allwinnertech.com>
>>
>> This patch adds support for A100 MMC controller, which use word address
>> for internal dma.
>>
>> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
>> ---
>>  drivers/mmc/host/sunxi-mmc.c | 28 +++++++++++++++++++++++++---
>>  1 file changed, 25 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
>> index fc62773602ec..1518b64112b7 100644
>> --- a/drivers/mmc/host/sunxi-mmc.c
>> +++ b/drivers/mmc/host/sunxi-mmc.c
>> @@ -244,6 +244,7 @@ struct sunxi_idma_des {
>>  
>>  struct sunxi_mmc_cfg {
>>  	u32 idma_des_size_bits;
>> +	u32 idma_des_shift;
>>  	const struct sunxi_mmc_clk_delay *clk_delays;
>>  
>>  	/* does the IP block support autocalibration? */
>> @@ -343,7 +344,7 @@ static int sunxi_mmc_init_host(struct sunxi_mmc_host *host)
>>  	/* Enable CEATA support */
>>  	mmc_writel(host, REG_FUNS, SDXC_CEATA_ON);
>>  	/* Set DMA descriptor list base address */
>> -	mmc_writel(host, REG_DLBA, host->sg_dma);
>> +	mmc_writel(host, REG_DLBA, host->sg_dma >> host->cfg->idma_des_shift);
>>  
>>  	rval = mmc_readl(host, REG_GCTRL);
>>  	rval |= SDXC_INTERRUPT_ENABLE_BIT;
>> @@ -373,8 +374,10 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
>>  
>>  		next_desc += sizeof(struct sunxi_idma_des);
>>  		pdes[i].buf_addr_ptr1 =
>> -			cpu_to_le32(sg_dma_address(&data->sg[i]));
>> -		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc);
>> +			cpu_to_le32(sg_dma_address(&data->sg[i]) >>
>> +				    host->cfg->idma_des_shift);
>> +		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc >>
>> +						    host->cfg->idma_des_shift);
> 
> I think you should cast after the shift, otherwise you lose the ability
> to run above 4 GB. This won't be a problem at the moment, since we still
> use the default 32-bit DMA mask, but might bite us later.
> 
> Otherwise this patch looks fine, and works on the H616 as well.
> 
> Cheers,
> Andre
> 
>>  	}
>>  
>>  	pdes[0].config |= cpu_to_le32(SDXC_IDMAC_DES0_FD);
>> @@ -1178,6 +1181,23 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = {
>>  	.needs_new_timings = true,
>>  };
>>  
>> +static const struct sunxi_mmc_cfg sun50i_a100_cfg = {
>> +	.idma_des_size_bits = 16,
>> +	.idma_des_shift = 2,
>> +	.clk_delays = NULL,
>> +	.can_calibrate = true,
>> +	.mask_data0 = true,
>> +	.needs_new_timings = true,
>> +};
>> +
>> +static const struct sunxi_mmc_cfg sun50i_a100_emmc_cfg = {
>> +	.idma_des_size_bits = 13,
>> +	.idma_des_shift = 2,

Is that actually true? Don't know about the A100, but the H616 manual
mentions that "SMHC2" deals with byte addresses, in contrast to the
other two ones. So MMC2 would be compatible with the a64_emmc_cfg?

Cheers,
Andre

>> +	.clk_delays = NULL,
>> +	.can_calibrate = true,
>> +	.needs_new_timings = true,
>> +};
>> +
>>  static const struct of_device_id sunxi_mmc_of_match[] = {
>>  	{ .compatible = "allwinner,sun4i-a10-mmc", .data = &sun4i_a10_cfg },
>>  	{ .compatible = "allwinner,sun5i-a13-mmc", .data = &sun5i_a13_cfg },
>> @@ -1186,6 +1206,8 @@ static const struct of_device_id sunxi_mmc_of_match[] = {
>>  	{ .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg },
>>  	{ .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg },
>>  	{ .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg },
>> +	{ .compatible = "allwinner,sun50i-a100-mmc", .data = &sun50i_a100_cfg },
>> +	{ .compatible = "allwinner,sun50i-a100-emmc", .data = &sun50i_a100_emmc_cfg },
>>  	{ /* sentinel */ }
>>  };
>>  MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
>>
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-29  1:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-10  6:20 [RESEND PATCH 00/19] Second step support for A100 Frank Lee
2020-11-10  6:45 ` [RESEND PATCH 16/19] dt-bindings: mmc: sunxi: Add A100 compatibles Frank Lee
2020-11-11 22:51   ` Rob Herring
2020-11-10  6:46 ` [RESEND PATCH 17/19] mmc: sunxi: add support for A100 mmc controller Frank Lee
2020-11-28 19:56   ` André Przywara
2020-11-29  1:38     ` André Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox