kuninori.morimoto.gx | 19 Jun 2012 04:22
Gravatar

[PATCH 0/4] ARM: shmobile: kzm9g: enable USB/SD/MMC-DMAEngine


Hi Rafael
Cc Magnus Simon

These patch set enable USB/SD and MMC-DMAEngine for kzm9g board.
These depend on my previous
[PATCH 0/27] ARM: shmobile: resend patch set

Kuninori Morimoto (4):
      ARM: shmobile: sh73a0: add USB clock support
      ARM: shmobile: kzm9g: enable DMAEngine of MMCIF
      ARM: shmobile: kzm9g: enable USB func
      ARM: shmobile: kzm9g: enable MicroSD

#4 patch require Laurent's patch.
      mmc: tmio: Don't access hardware registers after stopping clocks
With out this patch, MicroSD will dead when boot.

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Kuninori Morimoto | 19 Jun 2012 04:23
Gravatar

[PATCH 1/4] ARM: shmobile: sh73a0: add USB clock support

It is required from renesas_usbhs driver.
This patch is based on v2.0 manual.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>
---
 arch/arm/mach-shmobile/clock-sh73a0.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 76bdcca..37ba014 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
 <at>  <at>  -477,7 +477,7  <at>  <at>  enum { MSTP001,
 	MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
 	MSTP219, MSTP218, MSTP217,
 	MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
-	MSTP331, MSTP329, MSTP328, MSTP325, MSTP323,
+	MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP322,
 	MSTP314, MSTP313, MSTP312, MSTP311,
 	MSTP303, MSTP302, MSTP301, MSTP300,
 	MSTP411, MSTP410, MSTP403,
 <at>  <at>  -511,6 +511,7  <at>  <at>  static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/
 	[MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
 	[MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
+	[MSTP322] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 22, 0), /* USB */
 	[MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */
 	[MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */
 	[MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
 <at>  <at>  -568,6 +569,7  <at>  <at>  static struct clk_lookup lookups[] = {
(Continue reading)

Tetsuyuki Kobayashi | 19 Jun 2012 06:51
Picon

Re: [PATCH 1/4] ARM: shmobile: sh73a0: add USB clock support

(2012/06/19 11:23), Kuninori Morimoto wrote:
> It is required from renesas_usbhs driver.
> This patch is based on v2.0 manual.
>
> Signed-off-by: Kuninori Morimoto<kuninori.morimoto.gx <at> renesas.com>
Tested-by: Tetsuyuki Kobayashi <koba <at> kmckk.co.jp>

> ---
>   arch/arm/mach-shmobile/clock-sh73a0.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
> index 76bdcca..37ba014 100644
> --- a/arch/arm/mach-shmobile/clock-sh73a0.c
> +++ b/arch/arm/mach-shmobile/clock-sh73a0.c
>  <at>  <at>  -477,7 +477,7  <at>  <at>  enum { MSTP001,
>   	MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
>   	MSTP219, MSTP218, MSTP217,
>   	MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
> -	MSTP331, MSTP329, MSTP328, MSTP325, MSTP323,
> +	MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP322,
>   	MSTP314, MSTP313, MSTP312, MSTP311,
>   	MSTP303, MSTP302, MSTP301, MSTP300,
>   	MSTP411, MSTP410, MSTP403,
>  <at>  <at>  -511,6 +511,7  <at>  <at>  static struct clk mstp_clks[MSTP_NR] = {
>   	[MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/
>   	[MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
>   	[MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
> +	[MSTP322] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 22, 0), /* USB */
>   	[MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */
(Continue reading)

Simon Horman | 20 Jun 2012 06:41
Picon
Gravatar

Re: [PATCH 1/4] ARM: shmobile: sh73a0: add USB clock support

On Mon, Jun 18, 2012 at 07:23:41PM -0700, Kuninori Morimoto wrote:
> It is required from renesas_usbhs driver.
> This patch is based on v2.0 manual.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>

Tested-by: Simon Horman <horms <at> verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Kuninori Morimoto | 19 Jun 2012 04:23
Gravatar

[PATCH 2/4] ARM: shmobile: kzm9g: enable DMAEngine on MMCIF

It is possible to reduce CPU load if MMCIF used DMAEngine.
This patch enabled it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>
---
 arch/arm/mach-shmobile/board-kzm9g.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index d2feee1..ba80e72 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
 <at>  <at>  -197,6 +197,8  <at>  <at>  static struct resource sh_mmcif_resources[] = {
 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
 	.ocr		= MMC_VDD_165_195,
 	.caps		= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
+	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
+	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };

 static struct platform_device mmc_device = {
--

-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Tetsuyuki Kobayashi | 19 Jun 2012 06:36
Picon

Re: [PATCH 2/4] ARM: shmobile: kzm9g: enable DMAEngine on MMCIF

Hi, morimoto-san

After applying this patch, I can mount and read/write to eMMC.
Is it enough to test?
Or how do I know DMAEngine is working properly?

(2012/06/19 11:23), Kuninori Morimoto wrote:
> It is possible to reduce CPU load if MMCIF used DMAEngine.
> This patch enabled it.
>
> Signed-off-by: Kuninori Morimoto<kuninori.morimoto.gx <at> renesas.com>
> ---
>   arch/arm/mach-shmobile/board-kzm9g.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
> index d2feee1..ba80e72 100644
> --- a/arch/arm/mach-shmobile/board-kzm9g.c
> +++ b/arch/arm/mach-shmobile/board-kzm9g.c
>  <at>  <at>  -197,6 +197,8  <at>  <at>  static struct resource sh_mmcif_resources[] = {
>   static struct sh_mmcif_plat_data sh_mmcif_platdata = {
>   	.ocr		= MMC_VDD_165_195,
>   	.caps		= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
> +	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
> +	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
>   };
>
>   static struct platform_device mmc_device = {

--
(Continue reading)

Kuninori Morimoto | 19 Jun 2012 06:59
Gravatar

Re: [PATCH 2/4] ARM: shmobile: kzm9g: enable DMAEngine on MMCIF


Hi Kobayashi-san

Thank you for testing patch

> After applying this patch, I can mount and read/write to eMMC.
> Is it enough to test?
> Or how do I know DMAEngine is working properly?

Can you check /proc/interrupts ?
Did your dmaeXX increment ?

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Simon Horman | 19 Jun 2012 10:26
Picon
Gravatar

Re: [PATCH 2/4] ARM: shmobile: kzm9g: enable DMAEngine on MMCIF

On Mon, Jun 18, 2012 at 07:23:53PM -0700, Kuninori Morimoto wrote:
> It is possible to reduce CPU load if MMCIF used DMAEngine.
> This patch enabled it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>

Tested-by: Simon Horman <horms <at> verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Kuninori Morimoto | 19 Jun 2012 04:24
Gravatar

[PATCH 3/4] ARM: shmobile: kzm9g: enable USB func

This patch enable USB function on CN17

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>
---
 arch/arm/configs/kzm9g_defconfig     |    5 +
 arch/arm/mach-shmobile/board-kzm9g.c |  150 ++++++++++++++++++++++++++++++++++
 2 files changed, 155 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index e3ebc20..eeeb29f 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
 <at>  <at>  -100,7 +100,12  <at>  <at>  CONFIG_SND_SOC_SH4_FSI=y
 CONFIG_USB=y
 CONFIG_USB_DEVICEFS=y
 CONFIG_USB_R8A66597_HCD=y
+CONFIG_USB_RENESAS_USBHS=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_RENESAS_USBHS_UDC=y
+CONFIG_USB_ETH=m
+CONFIG_USB_MASS_STORAGE=m
 CONFIG_MMC=y
 # CONFIG_MMC_BLOCK_BOUNCE is not set
 CONFIG_MMC_SDHI=y
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index ba80e72..ade2d6f 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
 <at>  <at>  -32,6 +32,7  <at>  <at> 
(Continue reading)

Tetsuyuki Kobayashi | 19 Jun 2012 06:20
Picon

Re: [PATCH 3/4] ARM: shmobile: kzm9g: enable USB func

Hi,

(2012/06/19 11:24), Kuninori Morimoto wrote:
> This patch enable USB function on CN17

I applied this patch set on v3.5-rc3
  after applying [PATCH 0/27] ARM: shmobile: resend patch set

It works good on my kzm9g board.

What I did:
Connecting mini USB cable to CN17,
# insmod g_ether.ko
# ifconfig usb0 192.168.30.10
And opposite side,
$ sudo ifconfig usb0 192.168.30.1
it succeed ping each other.

Note: you should disable NetworkManager. Because NetworkManager
reset these manual IP address setting.

>
> Signed-off-by: Kuninori Morimoto<kuninori.morimoto.gx <at> renesas.com>
Tested-by: Tetsuyuki Kobayashi <koba <at> kmckk.co.jp>

> ---
>   arch/arm/configs/kzm9g_defconfig     |    5 +
>   arch/arm/mach-shmobile/board-kzm9g.c |  150 ++++++++++++++++++++++++++++++++++
>   2 files changed, 155 insertions(+), 0 deletions(-)
>
(Continue reading)

Simon Horman | 20 Jun 2012 06:41
Picon
Gravatar

Re: [PATCH 3/4] ARM: shmobile: kzm9g: enable USB func

On Mon, Jun 18, 2012 at 07:24:01PM -0700, Kuninori Morimoto wrote:
> This patch enable USB function on CN17
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>

Tested-by: Simon Horman <horms <at> verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Kuninori Morimoto | 19 Jun 2012 04:24
Gravatar

[PATCH 4/4] ARM: shmobile: kzm9g: enable MicroSD

This patch enable MicroSD on CN20

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>
Signed-off-by: Tetsuyuki Kobayashi <koba <at> kmckk.co.jp>
---
 arch/arm/mach-shmobile/board-kzm9g.c |   55 ++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index ade2d6f..43bb42f 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
 <at>  <at>  -398,6 +398,50  <at>  <at>  static struct platform_device sdhi0_device = {
 	},
 };

+/* Micro SD */
+static struct sh_mobile_sdhi_info sdhi2_info = {
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
+			  TMIO_MMC_USE_GPIO_CD |
+			  TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_caps	= MMC_CAP_SD_HIGHSPEED,
+	.tmio_ocr_mask	= MMC_VDD_27_28 | MMC_VDD_28_29,
+	.cd_gpio	= GPIO_PORT13,
+};
+
+static struct resource sdhi2_resources[] = {
+	[0] = {
+		.name	= "SDHI2",
+		.start	= 0xee140000,
(Continue reading)

Tetsuyuki Kobayashi | 19 Jun 2012 06:10
Picon

Re: [PATCH 4/4] ARM: shmobile: kzm9g: enable MicroSD

Hi, Morimoto-san.

I applied this patch set on v3.5-rc3
 after applying [PATCH 0/27] ARM: shmobile: resend patch set

It failed at probing the device.
kernel log is:

  ...
sh_mobile_sdhi sh_mobile_sdhi.0: mmc0 base at 0xee100000 clock rate 69 MHz
genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 802
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU04G 3.69 GiB
 mmcblk0: p1 p2
sh_mobile_sdhi: probe of sh_mobile_sdhi.2 failed with error -22
  ...

Using debugger I found
  drivers/mmc/host/sh_mobile_sdhi.c: 168 
	ret = tmio_mmc_host_probe(&host, pdev, mmc_data);
returns -22.

It makes no difference with or without the following patch
  mmc: tmio: Don't access hardware registers after stopping clocks

(2012/06/19 11:24), Kuninori Morimoto wrote:
> This patch enable MicroSD on CN20
> 
> Signed-off-by: Kuninori Morimoto<kuninori.morimoto.gx <at> renesas.com>
> Signed-off-by: Tetsuyuki Kobayashi<koba <at> kmckk.co.jp>
(Continue reading)

Kuninori Morimoto | 19 Jun 2012 06:18
Gravatar

Re: [PATCH 4/4] ARM: shmobile: kzm9g: enable MicroSD


Hi Kobayashi-san

> genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 802
> mmc0: new high speed SDHC card at address e624
> mmcblk0: mmc0:e624 SU04G 3.69 GiB
>  mmcblk0: p1 p2
> sh_mobile_sdhi: probe of sh_mobile_sdhi.2 failed with error -22
>   ...
> 
> Using debugger I found
>   drivers/mmc/host/sh_mobile_sdhi.c: 168 
> 	ret = tmio_mmc_host_probe(&host, pdev, mmc_data);
> returns -22.

Oops. yes indeed.
Sorry, I didn't explain about this.
It depends on latest mmc ML branch too.
I'm not sure detail of mmc branch status,
but is below patch solve your issue ?

------------------------------------------
diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c
index f13e38d..f303cbc 100644
--- a/drivers/mmc/core/cd-gpio.c
+++ b/drivers/mmc/core/cd-gpio.c
 <at>  <at>  -50,7 +50,7  <at>  <at>  int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio)
 		goto egpioreq;

 	ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt,
(Continue reading)

Tetsuyuki Kobayashi | 19 Jun 2012 06:49
Picon

Re: [PATCH 4/4] ARM: shmobile: kzm9g: enable MicroSD

Hi, morimoto-san.

(2012/06/19 13:18), Kuninori Morimoto wrote:

>> genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 802
>> mmc0: new high speed SDHC card at address e624
>> mmcblk0: mmc0:e624 SU04G 3.69 GiB
>>   mmcblk0: p1 p2
>> sh_mobile_sdhi: probe of sh_mobile_sdhi.2 failed with error -22
>>    ...
>>
>> Using debugger I found
>>    drivers/mmc/host/sh_mobile_sdhi.c: 168
>> 	ret = tmio_mmc_host_probe(&host, pdev, mmc_data);
>> returns -22.
>
> Oops. yes indeed.
> Sorry, I didn't explain about this.
> It depends on latest mmc ML branch too.
> I'm not sure detail of mmc branch status,
> but is below patch solve your issue ?

Yes. It works fine with this patch and
   mmc: tmio: Don't access hardware registers after stopping clocks

>
> ------------------------------------------
> diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c
> index f13e38d..f303cbc 100644
> --- a/drivers/mmc/core/cd-gpio.c
(Continue reading)

Simon Horman | 20 Jun 2012 04:24
Picon
Gravatar

Re: [PATCH 4/4] ARM: shmobile: kzm9g: enable MicroSD

On Mon, Jun 18, 2012 at 07:24:11PM -0700, Kuninori Morimoto wrote:
> This patch enable MicroSD on CN20
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx <at> renesas.com>
> Signed-off-by: Tetsuyuki Kobayashi <koba <at> kmckk.co.jp>

Tested-by: Simon Horman <horms <at> verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane