All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8
@ 2012-10-28  2:26 ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Arnd,

please consider the following board enhancements for 3.8.

----------------------------------------------------------------
The following changes since commit ddffeb8c4d0331609ef2581d84de4d763607bd37:

  Linux 3.7-rc1 (2012-10-14 14:41:04 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards

for you to fetch changes up to 39fe22dd9b60c26a6e1a5279abfb6473d67723e6:

  ARM: mach-shmobile: Use DT_MACHINE for mackerel (2012-10-24 17:06:15 +0900)

----------------------------------------------------------------
Bastian Hecht (1):
      ARM: mach-shmobile: add FLCTL DMA slave definitions for sh7372

Kuninori Morimoto (6):
      ARM: shmobile: armadillo800eva: enable restart
      ARM: shmobile: r8a7779: add HSPI clock support
      ARM: shmobile: r8a7779: add I2C clock support
      ARM: shmobile: r8a7779: add I2C driver support
      ARM: shmobile: marzen: add HSPI support
      ARM: shmobile: r8a7740: fixup DT machine desc name typo

Nobuhiro Iwamatsu (2):
      ARM: shmobile: r8a7740: Enable PMU
      ARM: mach-shmobile: Use DT_MACHINE for mackerel

Tetsuyuki Kobayashi (3):
      ARM: shmobile: kzm9g: enable magnetometer ak8975.
      ARM: shmobile: kzm9g: enable three-axis digital accelerometer ADXL345
      ARM: shmobile: kzm9g: enable DMAEngine on SHDI0 and SDHI2

 arch/arm/boot/dts/Makefile                     |    3 +-
 arch/arm/boot/dts/sh7372-mackerel.dts          |   22 +++++++
 arch/arm/configs/armadillo800eva_defconfig     |    1 +
 arch/arm/configs/kzm9g_defconfig               |    4 ++
 arch/arm/configs/marzen_defconfig              |    4 ++
 arch/arm/mach-shmobile/Kconfig                 |    1 +
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 +++
 arch/arm/mach-shmobile/board-kzm9g.c           |   14 ++++-
 arch/arm/mach-shmobile/board-mackerel.c        |    8 ++-
 arch/arm/mach-shmobile/board-marzen.c          |   25 ++++++++
 arch/arm/mach-shmobile/clock-r8a7779.c         |   16 ++++-
 arch/arm/mach-shmobile/include/mach/sh7372.h   |    4 ++
 arch/arm/mach-shmobile/setup-r8a7740.c         |   18 +++++-
 arch/arm/mach-shmobile/setup-r8a7779.c         |   77 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/setup-sh7372.c          |   20 ++++++
 15 files changed, 220 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/sh7372-mackerel.dts

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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8
@ 2012-10-28  2:26 ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Arnd,

please consider the following board enhancements for 3.8.

----------------------------------------------------------------
The following changes since commit ddffeb8c4d0331609ef2581d84de4d763607bd37:

  Linux 3.7-rc1 (2012-10-14 14:41:04 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards

for you to fetch changes up to 39fe22dd9b60c26a6e1a5279abfb6473d67723e6:

  ARM: mach-shmobile: Use DT_MACHINE for mackerel (2012-10-24 17:06:15 +0900)

----------------------------------------------------------------
Bastian Hecht (1):
      ARM: mach-shmobile: add FLCTL DMA slave definitions for sh7372

Kuninori Morimoto (6):
      ARM: shmobile: armadillo800eva: enable restart
      ARM: shmobile: r8a7779: add HSPI clock support
      ARM: shmobile: r8a7779: add I2C clock support
      ARM: shmobile: r8a7779: add I2C driver support
      ARM: shmobile: marzen: add HSPI support
      ARM: shmobile: r8a7740: fixup DT machine desc name typo

Nobuhiro Iwamatsu (2):
      ARM: shmobile: r8a7740: Enable PMU
      ARM: mach-shmobile: Use DT_MACHINE for mackerel

Tetsuyuki Kobayashi (3):
      ARM: shmobile: kzm9g: enable magnetometer ak8975.
      ARM: shmobile: kzm9g: enable three-axis digital accelerometer ADXL345
      ARM: shmobile: kzm9g: enable DMAEngine on SHDI0 and SDHI2

 arch/arm/boot/dts/Makefile                     |    3 +-
 arch/arm/boot/dts/sh7372-mackerel.dts          |   22 +++++++
 arch/arm/configs/armadillo800eva_defconfig     |    1 +
 arch/arm/configs/kzm9g_defconfig               |    4 ++
 arch/arm/configs/marzen_defconfig              |    4 ++
 arch/arm/mach-shmobile/Kconfig                 |    1 +
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 +++
 arch/arm/mach-shmobile/board-kzm9g.c           |   14 ++++-
 arch/arm/mach-shmobile/board-mackerel.c        |    8 ++-
 arch/arm/mach-shmobile/board-marzen.c          |   25 ++++++++
 arch/arm/mach-shmobile/clock-r8a7779.c         |   16 ++++-
 arch/arm/mach-shmobile/include/mach/sh7372.h   |    4 ++
 arch/arm/mach-shmobile/setup-r8a7740.c         |   18 +++++-
 arch/arm/mach-shmobile/setup-r8a7779.c         |   77 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/setup-sh7372.c          |   20 ++++++
 15 files changed, 220 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/sh7372-mackerel.dts

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

* [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

This patch enables PMU for r8a7740.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/armadillo800eva_defconfig |    1 +
 arch/arm/mach-shmobile/setup-r8a7740.c     |   16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index f78d259..3d76407 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -7,6 +7,7 @@ CONFIG_LOG_BUF_SHIFT\x16
 # CONFIG_IPC_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_PERF_EVENTS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 11bb1d9..1e032cb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
 	.num_resources	= ARRAY_SIZE(i2c1_resources),
 };
 
+static struct resource pmu_resources[] = {
+	[0] = {
+		.start	= evt2irq(0x19a0),
+		.end	= evt2irq(0x19a0),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device pmu_device = {
+	.name	= "arm-pmu",
+	.id		= -1,
+	.num_resources = ARRAY_SIZE(pmu_resources),
+	.resource = pmu_resources,
+};
+
 static struct platform_device *r8a7740_late_devices[] __initdata = {
 	&i2c0_device,
 	&i2c1_device,
@@ -597,6 +612,7 @@ static struct platform_device *r8a7740_late_devices[] __initdata = {
 	&dma1_device,
 	&dma2_device,
 	&usb_dma_device,
+	&pmu_device,
 };
 
 /*
-- 
1.7.10.4


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

* [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

This patch enables PMU for r8a7740.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/armadillo800eva_defconfig |    1 +
 arch/arm/mach-shmobile/setup-r8a7740.c     |   16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index f78d259..3d76407 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -7,6 +7,7 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_IPC_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_PERF_EVENTS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 11bb1d9..1e032cb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
 	.num_resources	= ARRAY_SIZE(i2c1_resources),
 };
 
+static struct resource pmu_resources[] = {
+	[0] = {
+		.start	= evt2irq(0x19a0),
+		.end	= evt2irq(0x19a0),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device pmu_device = {
+	.name	= "arm-pmu",
+	.id		= -1,
+	.num_resources = ARRAY_SIZE(pmu_resources),
+	.resource = pmu_resources,
+};
+
 static struct platform_device *r8a7740_late_devices[] __initdata = {
 	&i2c0_device,
 	&i2c1_device,
@@ -597,6 +612,7 @@ static struct platform_device *r8a7740_late_devices[] __initdata = {
 	&dma1_device,
 	&dma2_device,
 	&usb_dma_device,
+	&pmu_device,
 };
 
 /*
-- 
1.7.10.4

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

* [PATCH 02/12] ARM: shmobile: kzm9g: enable magnetometer ak8975.
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

This patch enables magnetometer ak8975.
I checked ak8975_probe() returns successfully.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/kzm9g_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-kzm9g.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index c88b578..1404b04 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -119,6 +119,8 @@ CONFIG_DMADEVICES=y
 CONFIG_SH_DMAE=y
 CONFIG_ASYNC_TX_DMA=y
 CONFIG_STAGING=y
+CONFIG_SENSORS_AK8975=y
+CONFIG_IIO=y
 # CONFIG_DNOTIFY is not set
 CONFIG_INOTIFY_USER=y
 CONFIG_VFAT_FS=y
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 0a43f31..a37da78 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -557,7 +557,11 @@ static struct i2c_board_info i2c0_devices[] = {
 	},
 	{
 		I2C_BOARD_INFO("r2025sd", 0x32),
-	}
+	},
+	{
+		I2C_BOARD_INFO("ak8975", 0x0c),
+		.irq = intcs_evt2irq(0x3380), /* IRQ28 */
+	},
 };
 
 static struct i2c_board_info i2c1_devices[] = {
-- 
1.7.10.4


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

* [PATCH 02/12] ARM: shmobile: kzm9g: enable magnetometer ak8975.
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

This patch enables magnetometer ak8975.
I checked ak8975_probe() returns successfully.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/kzm9g_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-kzm9g.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index c88b578..1404b04 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -119,6 +119,8 @@ CONFIG_DMADEVICES=y
 CONFIG_SH_DMAE=y
 CONFIG_ASYNC_TX_DMA=y
 CONFIG_STAGING=y
+CONFIG_SENSORS_AK8975=y
+CONFIG_IIO=y
 # CONFIG_DNOTIFY is not set
 CONFIG_INOTIFY_USER=y
 CONFIG_VFAT_FS=y
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 0a43f31..a37da78 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -557,7 +557,11 @@ static struct i2c_board_info i2c0_devices[] = {
 	},
 	{
 		I2C_BOARD_INFO("r2025sd", 0x32),
-	}
+	},
+	{
+		I2C_BOARD_INFO("ak8975", 0x0c),
+		.irq = intcs_evt2irq(0x3380), /* IRQ28 */
+	},
 };
 
 static struct i2c_board_info i2c1_devices[] = {
-- 
1.7.10.4

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

* [PATCH 03/12] ARM: shmobile: kzm9g: enable three-axis digital accelerometer ADXL345
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

This patch enables three-axis digital accelerometer ADXL345.
Test:
  sudo cat /dev/input/event2
then tip up the board. You get something from /dev/input/event2.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/kzm9g_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index 1404b04..ce99e3e 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -74,6 +74,8 @@ CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ST1232=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_ADXL34X=y
 # CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=9
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index a37da78..1a46422 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -562,6 +562,10 @@ static struct i2c_board_info i2c0_devices[] = {
 		I2C_BOARD_INFO("ak8975", 0x0c),
 		.irq = intcs_evt2irq(0x3380), /* IRQ28 */
 	},
+	{
+		I2C_BOARD_INFO("adxl34x", 0x1d),
+		.irq = intcs_evt2irq(0x3340), /* IRQ26 */
+	},
 };
 
 static struct i2c_board_info i2c1_devices[] = {
-- 
1.7.10.4


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

* [PATCH 03/12] ARM: shmobile: kzm9g: enable three-axis digital accelerometer ADXL345
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

This patch enables three-axis digital accelerometer ADXL345.
Test:
  sudo cat /dev/input/event2
then tip up the board. You get something from /dev/input/event2.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/kzm9g_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index 1404b04..ce99e3e 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -74,6 +74,8 @@ CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ST1232=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_ADXL34X=y
 # CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=9
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index a37da78..1a46422 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -562,6 +562,10 @@ static struct i2c_board_info i2c0_devices[] = {
 		I2C_BOARD_INFO("ak8975", 0x0c),
 		.irq = intcs_evt2irq(0x3380), /* IRQ28 */
 	},
+	{
+		I2C_BOARD_INFO("adxl34x", 0x1d),
+		.irq = intcs_evt2irq(0x3340), /* IRQ26 */
+	},
 };
 
 static struct i2c_board_info i2c1_devices[] = {
-- 
1.7.10.4

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

* [PATCH 04/12] ARM: shmobile: kzm9g: enable DMAEngine on SHDI0 and SDHI2
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

This patch enables DMAEngine on SHDI0 and SDHI2 for kzm9g.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 1a46422..f63f2ee 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -384,6 +384,8 @@ static struct regulator_consumer_supply fixed2v8_power_consumers[]  
 /* SDHI */
 static struct sh_mobile_sdhi_info sdhi0_info = {
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED,
 	.tmio_ocr_mask	= MMC_VDD_27_28 | MMC_VDD_28_29,
@@ -424,6 +426,8 @@ static struct platform_device sdhi0_device = {
 
 /* Micro SD */
 static struct sh_mobile_sdhi_info sdhi2_info = {
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI2_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI2_RX,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_USE_GPIO_CD |
 			  TMIO_MMC_WRPROTECT_DISABLE,
-- 
1.7.10.4


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

* [PATCH 04/12] ARM: shmobile: kzm9g: enable DMAEngine on SHDI0 and SDHI2
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>

This patch enables DMAEngine on SHDI0 and SDHI2 for kzm9g.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 1a46422..f63f2ee 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -384,6 +384,8 @@ static struct regulator_consumer_supply fixed2v8_power_consumers[] =
 
 /* SDHI */
 static struct sh_mobile_sdhi_info sdhi0_info = {
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED,
 	.tmio_ocr_mask	= MMC_VDD_27_28 | MMC_VDD_28_29,
@@ -424,6 +426,8 @@ static struct platform_device sdhi0_device = {
 
 /* Micro SD */
 static struct sh_mobile_sdhi_info sdhi2_info = {
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI2_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI2_RX,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_USE_GPIO_CD |
 			  TMIO_MMC_WRPROTECT_DISABLE,
-- 
1.7.10.4

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

* [PATCH 05/12] ARM: mach-shmobile: add FLCTL DMA slave definitions for sh7372
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bastian Hecht <hechtb@googlemail.com>

SH7372 can use DMA with the FLCTL flash controller. Add required slave
IDs and slave descriptors.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/include/mach/sh7372.h |    4 ++++
 arch/arm/mach-shmobile/setup-sh7372.c        |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index eb98b45..d65fbbe 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -452,6 +452,10 @@ enum {
 	SHDMA_SLAVE_SCIF5_RX,
 	SHDMA_SLAVE_SCIF6_TX,
 	SHDMA_SLAVE_SCIF6_RX,
+	SHDMA_SLAVE_FLCTL0_TX,
+	SHDMA_SLAVE_FLCTL0_RX,
+	SHDMA_SLAVE_FLCTL1_TX,
+	SHDMA_SLAVE_FLCTL1_RX,
 	SHDMA_SLAVE_SDHI0_RX,
 	SHDMA_SLAVE_SDHI0_TX,
 	SHDMA_SLAVE_SDHI1_RX,
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index a07954f..a360111 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -408,6 +408,26 @@ static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
 		.chcr		= CHCR_RX(XMIT_SZ_8BIT),
 		.mid_rid	= 0x3e,
 	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL0_TX,
+		.addr		= 0xe6a30050,
+		.chcr		= CHCR_TX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x83,
+	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL0_RX,
+		.addr		= 0xe6a30050,
+		.chcr		= CHCR_RX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x83,
+	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL1_TX,
+		.addr		= 0xe6a30060,
+		.chcr		= CHCR_TX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x87,
+	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL1_RX,
+		.addr		= 0xe6a30060,
+		.chcr		= CHCR_RX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x87,
+	}, {
 		.slave_id	= SHDMA_SLAVE_SDHI0_TX,
 		.addr		= 0xe6850030,
 		.chcr		= CHCR_TX(XMIT_SZ_16BIT),
-- 
1.7.10.4


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

* [PATCH 05/12] ARM: mach-shmobile: add FLCTL DMA slave definitions for sh7372
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bastian Hecht <hechtb@googlemail.com>

SH7372 can use DMA with the FLCTL flash controller. Add required slave
IDs and slave descriptors.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/include/mach/sh7372.h |    4 ++++
 arch/arm/mach-shmobile/setup-sh7372.c        |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index eb98b45..d65fbbe 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -452,6 +452,10 @@ enum {
 	SHDMA_SLAVE_SCIF5_RX,
 	SHDMA_SLAVE_SCIF6_TX,
 	SHDMA_SLAVE_SCIF6_RX,
+	SHDMA_SLAVE_FLCTL0_TX,
+	SHDMA_SLAVE_FLCTL0_RX,
+	SHDMA_SLAVE_FLCTL1_TX,
+	SHDMA_SLAVE_FLCTL1_RX,
 	SHDMA_SLAVE_SDHI0_RX,
 	SHDMA_SLAVE_SDHI0_TX,
 	SHDMA_SLAVE_SDHI1_RX,
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index a07954f..a360111 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -408,6 +408,26 @@ static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
 		.chcr		= CHCR_RX(XMIT_SZ_8BIT),
 		.mid_rid	= 0x3e,
 	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL0_TX,
+		.addr		= 0xe6a30050,
+		.chcr		= CHCR_TX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x83,
+	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL0_RX,
+		.addr		= 0xe6a30050,
+		.chcr		= CHCR_RX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x83,
+	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL1_TX,
+		.addr		= 0xe6a30060,
+		.chcr		= CHCR_TX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x87,
+	}, {
+		.slave_id	= SHDMA_SLAVE_FLCTL1_RX,
+		.addr		= 0xe6a30060,
+		.chcr		= CHCR_RX(XMIT_SZ_32BIT),
+		.mid_rid	= 0x87,
+	}, {
 		.slave_id	= SHDMA_SLAVE_SDHI0_TX,
 		.addr		= 0xe6850030,
 		.chcr		= CHCR_TX(XMIT_SZ_16BIT),
-- 
1.7.10.4

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

* [PATCH 06/12] ARM: shmobile: armadillo800eva: enable restart
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Cc: Masahiro Nakai <nakai@atmark-techno.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 2912eab..fe27d7e 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -1229,6 +1229,13 @@ static void __init eva_add_early_devices(void)
 	shmobile_timer.init = eva_earlytimer_init;
 }
 
+#define RESCNT2 IOMEM(0xe6188020)
+static void eva_restart(char mode, const char *cmd)
+{
+	/* Do soft power on reset */
+	writel((1 << 31), RESCNT2);
+}
+
 static const char *eva_boards_compat_dt[] __initdata = {
 	"renesas,armadillo800eva",
 	NULL,
@@ -1243,4 +1250,5 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
 	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 	.dt_compat	= eva_boards_compat_dt,
+	.restart	= eva_restart,
 MACHINE_END
-- 
1.7.10.4


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

* [PATCH 06/12] ARM: shmobile: armadillo800eva: enable restart
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Cc: Masahiro Nakai <nakai@atmark-techno.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 2912eab..fe27d7e 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -1229,6 +1229,13 @@ static void __init eva_add_early_devices(void)
 	shmobile_timer.init = eva_earlytimer_init;
 }
 
+#define RESCNT2 IOMEM(0xe6188020)
+static void eva_restart(char mode, const char *cmd)
+{
+	/* Do soft power on reset */
+	writel((1 << 31), RESCNT2);
+}
+
 static const char *eva_boards_compat_dt[] __initdata = {
 	"renesas,armadillo800eva",
 	NULL,
@@ -1243,4 +1250,5 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
 	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 	.dt_compat	= eva_boards_compat_dt,
+	.restart	= eva_restart,
 MACHINE_END
-- 
1.7.10.4

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

* [PATCH 07/12] ARM: shmobile: r8a7779: add HSPI clock support
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7779.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 3cafb6a..90d717b 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -89,6 +89,7 @@ static struct clk div4_clks[DIV4_NR] = {
 enum { MSTP323, MSTP322, MSTP321, MSTP320,
 	MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015, MSTP014,
+	MSTP007,
 	MSTP_NR };
 
 static struct clk mstp_clks[MSTP_NR] = {
@@ -105,6 +106,7 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP016] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 16, 0), /* TMU0 */
 	[MSTP015] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), /* TMU1 */
 	[MSTP014] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 14, 0), /* TMU2 */
+	[MSTP007] = SH_CLK_MSTP32(&div4_clks[DIV4_S], MSTPCR0,  7, 0), /* HSPI */
 };
 
 static unsigned long mul4_recalc(struct clk *clk)
@@ -154,6 +156,9 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
 	CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
+	CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
+	CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
+	CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */
 	CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
 	CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
 	CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
-- 
1.7.10.4


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

* [PATCH 07/12] ARM: shmobile: r8a7779: add HSPI clock support
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7779.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 3cafb6a..90d717b 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -89,6 +89,7 @@ static struct clk div4_clks[DIV4_NR] = {
 enum { MSTP323, MSTP322, MSTP321, MSTP320,
 	MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015, MSTP014,
+	MSTP007,
 	MSTP_NR };
 
 static struct clk mstp_clks[MSTP_NR] = {
@@ -105,6 +106,7 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP016] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 16, 0), /* TMU0 */
 	[MSTP015] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), /* TMU1 */
 	[MSTP014] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 14, 0), /* TMU2 */
+	[MSTP007] = SH_CLK_MSTP32(&div4_clks[DIV4_S], MSTPCR0,  7, 0), /* HSPI */
 };
 
 static unsigned long mul4_recalc(struct clk *clk)
@@ -154,6 +156,9 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
 	CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
 	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
+	CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
+	CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
+	CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */
 	CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
 	CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
 	CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
-- 
1.7.10.4

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

* [PATCH 08/12] ARM: shmobile: r8a7779: add I2C clock support
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch is required from R-Car I2C driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7779.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 90d717b..24f5a84 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -87,7 +87,8 @@ static struct clk div4_clks[DIV4_NR] = {
 };
 
 enum { MSTP323, MSTP322, MSTP321, MSTP320,
-	MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
+	MSTP030,
+	MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015, MSTP014,
 	MSTP007,
 	MSTP_NR };
@@ -97,6 +98,10 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0), /* SDHI1 */
 	[MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0), /* SDHI2 */
 	[MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0), /* SDHI3 */
+	[MSTP030] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 30, 0), /* I2C0 */
+	[MSTP029] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 29, 0), /* I2C1 */
+	[MSTP028] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 28, 0), /* I2C2 */
+	[MSTP027] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 27, 0), /* I2C3 */
 	[MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */
 	[MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */
 	[MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */
@@ -150,6 +155,10 @@ static struct clk_lookup lookups[] = {
 	/* MSTP32 clocks */
 	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
 	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
+	CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
+	CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
+	CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
+	CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
 	CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
 	CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
 	CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
-- 
1.7.10.4


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

* [PATCH 08/12] ARM: shmobile: r8a7779: add I2C clock support
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch is required from R-Car I2C driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7779.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 90d717b..24f5a84 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -87,7 +87,8 @@ static struct clk div4_clks[DIV4_NR] = {
 };
 
 enum { MSTP323, MSTP322, MSTP321, MSTP320,
-	MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
+	MSTP030,
+	MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015, MSTP014,
 	MSTP007,
 	MSTP_NR };
@@ -97,6 +98,10 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0), /* SDHI1 */
 	[MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0), /* SDHI2 */
 	[MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0), /* SDHI3 */
+	[MSTP030] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 30, 0), /* I2C0 */
+	[MSTP029] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 29, 0), /* I2C1 */
+	[MSTP028] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 28, 0), /* I2C2 */
+	[MSTP027] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 27, 0), /* I2C3 */
 	[MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */
 	[MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */
 	[MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */
@@ -150,6 +155,10 @@ static struct clk_lookup lookups[] = {
 	/* MSTP32 clocks */
 	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
 	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
+	CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
+	CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
+	CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
+	CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
 	CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
 	CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
 	CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
-- 
1.7.10.4

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

* [PATCH 09/12] ARM: shmobile: r8a7779: add I2C driver support
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch enable R-Car I2C driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig      |    2 +
 arch/arm/mach-shmobile/setup-r8a7779.c |   77 ++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 53382b6..f79b55c 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -69,6 +69,8 @@ CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=6
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_RCAR=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_HWMON is not set
 CONFIG_THERMAL=y
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 2917668..63de5cb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -229,6 +229,79 @@ static struct platform_device tmu01_device = {
 	.num_resources	= ARRAY_SIZE(tmu01_resources),
 };
 
+/* I2C */
+static struct resource rcar_i2c0_res[] = {
+	{
+		.start  = 0xffc70000,
+		.end    = 0xffc70fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(79),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c0_device = {
+	.name		= "i2c-rcar",
+	.id		= 0,
+	.resource	= rcar_i2c0_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c0_res),
+};
+
+static struct resource rcar_i2c1_res[] = {
+	{
+		.start  = 0xffc71000,
+		.end    = 0xffc71fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(82),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c1_device = {
+	.name		= "i2c-rcar",
+	.id		= 1,
+	.resource	= rcar_i2c1_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c1_res),
+};
+
+static struct resource rcar_i2c2_res[] = {
+	{
+		.start  = 0xffc72000,
+		.end    = 0xffc72fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(80),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c2_device = {
+	.name		= "i2c-rcar",
+	.id		= 2,
+	.resource	= rcar_i2c2_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c2_res),
+};
+
+static struct resource rcar_i2c3_res[] = {
+	{
+		.start  = 0xffc73000,
+		.end    = 0xffc73fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(81),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c3_device = {
+	.name		= "i2c-rcar",
+	.id		= 3,
+	.resource	= rcar_i2c3_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c3_res),
+};
+
 static struct platform_device *r8a7779_early_devices[] __initdata = {
 	&scif0_device,
 	&scif1_device,
@@ -238,6 +311,10 @@ static struct platform_device *r8a7779_early_devices[] __initdata = {
 	&scif5_device,
 	&tmu00_device,
 	&tmu01_device,
+	&i2c0_device,
+	&i2c1_device,
+	&i2c2_device,
+	&i2c3_device,
 };
 
 static struct platform_device *r8a7779_late_devices[] __initdata = {
-- 
1.7.10.4


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

* [PATCH 09/12] ARM: shmobile: r8a7779: add I2C driver support
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch enable R-Car I2C driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig      |    2 +
 arch/arm/mach-shmobile/setup-r8a7779.c |   77 ++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 53382b6..f79b55c 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -69,6 +69,8 @@ CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=6
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_RCAR=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_HWMON is not set
 CONFIG_THERMAL=y
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 2917668..63de5cb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -229,6 +229,79 @@ static struct platform_device tmu01_device = {
 	.num_resources	= ARRAY_SIZE(tmu01_resources),
 };
 
+/* I2C */
+static struct resource rcar_i2c0_res[] = {
+	{
+		.start  = 0xffc70000,
+		.end    = 0xffc70fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(79),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c0_device = {
+	.name		= "i2c-rcar",
+	.id		= 0,
+	.resource	= rcar_i2c0_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c0_res),
+};
+
+static struct resource rcar_i2c1_res[] = {
+	{
+		.start  = 0xffc71000,
+		.end    = 0xffc71fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(82),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c1_device = {
+	.name		= "i2c-rcar",
+	.id		= 1,
+	.resource	= rcar_i2c1_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c1_res),
+};
+
+static struct resource rcar_i2c2_res[] = {
+	{
+		.start  = 0xffc72000,
+		.end    = 0xffc72fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(80),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c2_device = {
+	.name		= "i2c-rcar",
+	.id		= 2,
+	.resource	= rcar_i2c2_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c2_res),
+};
+
+static struct resource rcar_i2c3_res[] = {
+	{
+		.start  = 0xffc73000,
+		.end    = 0xffc73fff,
+		.flags  = IORESOURCE_MEM,
+	}, {
+		.start  = gic_spi(81),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device i2c3_device = {
+	.name		= "i2c-rcar",
+	.id		= 3,
+	.resource	= rcar_i2c3_res,
+	.num_resources	= ARRAY_SIZE(rcar_i2c3_res),
+};
+
 static struct platform_device *r8a7779_early_devices[] __initdata = {
 	&scif0_device,
 	&scif1_device,
@@ -238,6 +311,10 @@ static struct platform_device *r8a7779_early_devices[] __initdata = {
 	&scif5_device,
 	&tmu00_device,
 	&tmu01_device,
+	&i2c0_device,
+	&i2c1_device,
+	&i2c2_device,
+	&i2c3_device,
 };
 
 static struct platform_device *r8a7779_late_devices[] __initdata = {
-- 
1.7.10.4

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

* [PATCH 10/12] ARM: shmobile: marzen: add HSPI support
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-marzen.c |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index f79b55c..5b8215f 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -71,6 +71,8 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_RCAR=y
+CONFIG_SPI=y
+CONFIG_SPI_SH_HSPI=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_HWMON is not set
 CONFIG_THERMAL=y
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index b8a7525..69f7f46 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -30,6 +30,8 @@
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/smsc911x.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/sh_hspi.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <mach/hardware.h>
@@ -126,10 +128,27 @@ static struct platform_device thermal_device = {
 	.num_resources	= ARRAY_SIZE(thermal_resources),
 };
 
+/* HSPI */
+static struct resource hspi_resources[] = {
+	[0] = {
+		.start		= 0xFFFC7000,
+		.end		= 0xFFFC7018 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device hspi_device = {
+	.name	= "sh-hspi",
+	.id	= 0,
+	.resource	= hspi_resources,
+	.num_resources	= ARRAY_SIZE(hspi_resources),
+};
+
 static struct platform_device *marzen_devices[] __initdata = {
 	&eth_device,
 	&sdhi0_device,
 	&thermal_device,
+	&hspi_device,
 };
 
 static void __init marzen_init(void)
@@ -163,6 +182,12 @@ static void __init marzen_init(void)
 	gpio_request(GPIO_FN_SD0_CD, NULL);
 	gpio_request(GPIO_FN_SD0_WP, NULL);
 
+	/* HSPI 0 */
+	gpio_request(GPIO_FN_HSPI_CLK0,	NULL);
+	gpio_request(GPIO_FN_HSPI_CS0,	NULL);
+	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
+	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
+
 	r8a7779_add_standard_devices();
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }
-- 
1.7.10.4


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

* [PATCH 10/12] ARM: shmobile: marzen: add HSPI support
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-marzen.c |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index f79b55c..5b8215f 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -71,6 +71,8 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_RCAR=y
+CONFIG_SPI=y
+CONFIG_SPI_SH_HSPI=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_HWMON is not set
 CONFIG_THERMAL=y
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index b8a7525..69f7f46 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -30,6 +30,8 @@
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/smsc911x.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/sh_hspi.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <mach/hardware.h>
@@ -126,10 +128,27 @@ static struct platform_device thermal_device = {
 	.num_resources	= ARRAY_SIZE(thermal_resources),
 };
 
+/* HSPI */
+static struct resource hspi_resources[] = {
+	[0] = {
+		.start		= 0xFFFC7000,
+		.end		= 0xFFFC7018 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device hspi_device = {
+	.name	= "sh-hspi",
+	.id	= 0,
+	.resource	= hspi_resources,
+	.num_resources	= ARRAY_SIZE(hspi_resources),
+};
+
 static struct platform_device *marzen_devices[] __initdata = {
 	&eth_device,
 	&sdhi0_device,
 	&thermal_device,
+	&hspi_device,
 };
 
 static void __init marzen_init(void)
@@ -163,6 +182,12 @@ static void __init marzen_init(void)
 	gpio_request(GPIO_FN_SD0_CD, NULL);
 	gpio_request(GPIO_FN_SD0_WP, NULL);
 
+	/* HSPI 0 */
+	gpio_request(GPIO_FN_HSPI_CLK0,	NULL);
+	gpio_request(GPIO_FN_HSPI_CS0,	NULL);
+	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
+	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
+
 	r8a7779_add_standard_devices();
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }
-- 
1.7.10.4

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

* [PATCH 11/12] ARM: shmobile: r8a7740: fixup DT machine desc name typo
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

r8a7740 machine desc name should be R8A7740,
not SH7372

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/setup-r8a7740.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 1e032cb..6649a77 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -763,7 +763,7 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
 	NULL,
 };
 
-DT_MACHINE_START(SH7372_DT, "Generic R8A7740 (Flattened Device Tree)")
+DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
 	.map_io		= r8a7740_map_io,
 	.init_early	= r8a7740_add_early_devices_dt,
 	.init_irq	= r8a7740_init_irq,
-- 
1.7.10.4


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

* [PATCH 11/12] ARM: shmobile: r8a7740: fixup DT machine desc name typo
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

r8a7740 machine desc name should be R8A7740,
not SH7372

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/setup-r8a7740.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 1e032cb..6649a77 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -763,7 +763,7 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
 	NULL,
 };
 
-DT_MACHINE_START(SH7372_DT, "Generic R8A7740 (Flattened Device Tree)")
+DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
 	.map_io		= r8a7740_map_io,
 	.init_early	= r8a7740_add_early_devices_dt,
 	.init_irq	= r8a7740_init_irq,
-- 
1.7.10.4

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

* [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
  2012-10-28  2:26 ` Simon Horman
@ 2012-10-28  2:26   ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

Use DT_MACHINE_START() on the sh7372 based mackerel board.

Also include a tiny DTS file to describe the board and update the
Kconfig dependencies to select CONFIG_USE_OF.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/boot/dts/Makefile              |    3 ++-
 arch/arm/boot/dts/sh7372-mackerel.dts   |   22 ++++++++++++++++++++++
 arch/arm/mach-shmobile/Kconfig          |    1 +
 arch/arm/mach-shmobile/board-mackerel.c |    8 +++++++-
 4 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/sh7372-mackerel.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index c1ce813..0632239 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -75,7 +75,8 @@ dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
 dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
-	sh73a0-kzm9g.dtb
+	sh73a0-kzm9g.dtb \
+	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
 	spear1340-evb.dtb
 dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
diff --git a/arch/arm/boot/dts/sh7372-mackerel.dts b/arch/arm/boot/dts/sh7372-mackerel.dts
new file mode 100644
index 0000000..286f0ca
--- /dev/null
+++ b/arch/arm/boot/dts/sh7372-mackerel.dts
@@ -0,0 +1,22 @@
+/*
+ * Device Tree Source for the mackerel board
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "Mackerel (AP4 EVM 2nd)";
+	compatible = "renesas,mackerel";
+
+	memory {
+		device_type = "memory";
+		reg = <0x40000000 0x10000000>;
+	};
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 8ae100c..0750d9c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -95,6 +95,7 @@ config MACH_MACKEREL
 	select ARCH_REQUIRE_GPIOLIB
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select SND_SOC_AK4642 if SND_SIMPLE_CARD
+	select USE_OF
 
 config MACH_KOTA2
 	bool "KOTA2 board"
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 0c27c81..39b8f2e 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1651,7 +1651,12 @@ static void __init mackerel_init(void)
 	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
 }
 
-MACHINE_START(MACKEREL, "mackerel")
+static const char *mackerel_boards_compat_dt[] __initdata = {
+	"renesas,mackerel",
+	NULL,
+};
+
+DT_MACHINE_START(MACKEREL_DT, "mackerel")
 	.map_io		= sh7372_map_io,
 	.init_early	= sh7372_add_early_devices,
 	.init_irq	= sh7372_init_irq,
@@ -1659,4 +1664,5 @@ MACHINE_START(MACKEREL, "mackerel")
 	.init_machine	= mackerel_init,
 	.init_late	= sh7372_pm_init_late,
 	.timer		= &shmobile_timer,
+	.dt_compat  = mackerel_boards_compat_dt,
 MACHINE_END
-- 
1.7.10.4


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

* [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
@ 2012-10-28  2:26   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

Use DT_MACHINE_START() on the sh7372 based mackerel board.

Also include a tiny DTS file to describe the board and update the
Kconfig dependencies to select CONFIG_USE_OF.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/boot/dts/Makefile              |    3 ++-
 arch/arm/boot/dts/sh7372-mackerel.dts   |   22 ++++++++++++++++++++++
 arch/arm/mach-shmobile/Kconfig          |    1 +
 arch/arm/mach-shmobile/board-mackerel.c |    8 +++++++-
 4 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/sh7372-mackerel.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index c1ce813..0632239 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -75,7 +75,8 @@ dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
 dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
-	sh73a0-kzm9g.dtb
+	sh73a0-kzm9g.dtb \
+	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
 	spear1340-evb.dtb
 dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
diff --git a/arch/arm/boot/dts/sh7372-mackerel.dts b/arch/arm/boot/dts/sh7372-mackerel.dts
new file mode 100644
index 0000000..286f0ca
--- /dev/null
+++ b/arch/arm/boot/dts/sh7372-mackerel.dts
@@ -0,0 +1,22 @@
+/*
+ * Device Tree Source for the mackerel board
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "Mackerel (AP4 EVM 2nd)";
+	compatible = "renesas,mackerel";
+
+	memory {
+		device_type = "memory";
+		reg = <0x40000000 0x10000000>;
+	};
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 8ae100c..0750d9c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -95,6 +95,7 @@ config MACH_MACKEREL
 	select ARCH_REQUIRE_GPIOLIB
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select SND_SOC_AK4642 if SND_SIMPLE_CARD
+	select USE_OF
 
 config MACH_KOTA2
 	bool "KOTA2 board"
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 0c27c81..39b8f2e 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1651,7 +1651,12 @@ static void __init mackerel_init(void)
 	pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
 }
 
-MACHINE_START(MACKEREL, "mackerel")
+static const char *mackerel_boards_compat_dt[] __initdata = {
+	"renesas,mackerel",
+	NULL,
+};
+
+DT_MACHINE_START(MACKEREL_DT, "mackerel")
 	.map_io		= sh7372_map_io,
 	.init_early	= sh7372_add_early_devices,
 	.init_irq	= sh7372_init_irq,
@@ -1659,4 +1664,5 @@ MACHINE_START(MACKEREL, "mackerel")
 	.init_machine	= mackerel_init,
 	.init_late	= sh7372_pm_init_late,
 	.timer		= &shmobile_timer,
+	.dt_compat  = mackerel_boards_compat_dt,
 MACHINE_END
-- 
1.7.10.4

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

* Re: [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
  2012-10-28  2:26   ` Simon Horman
@ 2012-10-28  9:37     ` Thomas Petazzoni
  -1 siblings, 0 replies; 112+ messages in thread
From: Thomas Petazzoni @ 2012-10-28  9:37 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Simon Horman,

On Sun, 28 Oct 2012 11:26:13 +0900, Simon Horman wrote:

> -MACHINE_START(MACKEREL, "mackerel")
> +static const char *mackerel_boards_compat_dt[] __initdata = {
> +	"renesas,mackerel",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(MACKEREL_DT, "mackerel")
>  	.map_io		= sh7372_map_io,
>  	.init_early	= sh7372_add_early_devices,
>  	.init_irq	= sh7372_init_irq,
> @@ -1659,4 +1664,5 @@ MACHINE_START(MACKEREL, "mackerel")
>  	.init_machine	= mackerel_init,
>  	.init_late	= sh7372_pm_init_late,
>  	.timer		= &shmobile_timer,
> +	.dt_compat  = mackerel_boards_compat_dt,
>  MACHINE_END

Not sure what is the status of mach-shmobile with regard to the device
tree, but one of the idea of the device tree is to avoid having one .c
file per board, and therefore one DT_MACHINE_START definition per
board. There should be only only DT_MACHINE_START definition per SoC or
SoC family, with the DT giving the detailed hardware description.

Of course, during a transition period, not all your drivers may have DT
bindings, and therefore some devices may need to be probed in the "old"
way (manual registration of platform_device). In that case, your
->init_machine() hook can call initialization function on a per-board
basis by testing if the machine is such or such board.

See arch/arm/mach-kirkwood/board-dt.c for an example. The advantage is
that with this solution, the board specific C files are progressively
reducing in size as more and more devices get registered through the
Device Tree, until the point where they become empty and can be removed.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
@ 2012-10-28  9:37     ` Thomas Petazzoni
  0 siblings, 0 replies; 112+ messages in thread
From: Thomas Petazzoni @ 2012-10-28  9:37 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Simon Horman,

On Sun, 28 Oct 2012 11:26:13 +0900, Simon Horman wrote:

> -MACHINE_START(MACKEREL, "mackerel")
> +static const char *mackerel_boards_compat_dt[] __initdata = {
> +	"renesas,mackerel",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(MACKEREL_DT, "mackerel")
>  	.map_io		= sh7372_map_io,
>  	.init_early	= sh7372_add_early_devices,
>  	.init_irq	= sh7372_init_irq,
> @@ -1659,4 +1664,5 @@ MACHINE_START(MACKEREL, "mackerel")
>  	.init_machine	= mackerel_init,
>  	.init_late	= sh7372_pm_init_late,
>  	.timer		= &shmobile_timer,
> +	.dt_compat  = mackerel_boards_compat_dt,
>  MACHINE_END

Not sure what is the status of mach-shmobile with regard to the device
tree, but one of the idea of the device tree is to avoid having one .c
file per board, and therefore one DT_MACHINE_START definition per
board. There should be only only DT_MACHINE_START definition per SoC or
SoC family, with the DT giving the detailed hardware description.

Of course, during a transition period, not all your drivers may have DT
bindings, and therefore some devices may need to be probed in the "old"
way (manual registration of platform_device). In that case, your
->init_machine() hook can call initialization function on a per-board
basis by testing if the machine is such or such board.

See arch/arm/mach-kirkwood/board-dt.c for an example. The advantage is
that with this solution, the board specific C files are progressively
reducing in size as more and more devices get registered through the
Device Tree, until the point where they become empty and can be removed.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
  2012-10-28  9:37     ` Thomas Petazzoni
@ 2012-10-28 10:44       ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 28, 2012 at 10:37:11AM +0100, Thomas Petazzoni wrote:
> Dear Simon Horman,
> 
> On Sun, 28 Oct 2012 11:26:13 +0900, Simon Horman wrote:
> 
> > -MACHINE_START(MACKEREL, "mackerel")
> > +static const char *mackerel_boards_compat_dt[] __initdata = {
> > +	"renesas,mackerel",
> > +	NULL,
> > +};
> > +
> > +DT_MACHINE_START(MACKEREL_DT, "mackerel")
> >  	.map_io		= sh7372_map_io,
> >  	.init_early	= sh7372_add_early_devices,
> >  	.init_irq	= sh7372_init_irq,
> > @@ -1659,4 +1664,5 @@ MACHINE_START(MACKEREL, "mackerel")
> >  	.init_machine	= mackerel_init,
> >  	.init_late	= sh7372_pm_init_late,
> >  	.timer		= &shmobile_timer,
> > +	.dt_compat  = mackerel_boards_compat_dt,
> >  MACHINE_END
> 
> Not sure what is the status of mach-shmobile with regard to the device
> tree, but one of the idea of the device tree is to avoid having one .c
> file per board, and therefore one DT_MACHINE_START definition per
> board. There should be only only DT_MACHINE_START definition per SoC or
> SoC family, with the DT giving the detailed hardware description.
> 
> Of course, during a transition period, not all your drivers may have DT
> bindings, and therefore some devices may need to be probed in the "old"
> way (manual registration of platform_device). In that case, your
> ->init_machine() hook can call initialization function on a per-board
> basis by testing if the machine is such or such board.
> 
> See arch/arm/mach-kirkwood/board-dt.c for an example. The advantage is
> that with this solution, the board specific C files are progressively
> reducing in size as more and more devices get registered through the
> Device Tree, until the point where they become empty and can be removed.

Hi Thomas,

shmobile is very much in the transition phase and we are, patch by patch,
working towards full(er) DT support for boards, SoCs and drivers. I am not
sure that now is the right time to jump to a approach similar to that taken
by mach-kirkwood/board-dt.c.

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

* [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
@ 2012-10-28 10:44       ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-28 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 28, 2012 at 10:37:11AM +0100, Thomas Petazzoni wrote:
> Dear Simon Horman,
> 
> On Sun, 28 Oct 2012 11:26:13 +0900, Simon Horman wrote:
> 
> > -MACHINE_START(MACKEREL, "mackerel")
> > +static const char *mackerel_boards_compat_dt[] __initdata = {
> > +	"renesas,mackerel",
> > +	NULL,
> > +};
> > +
> > +DT_MACHINE_START(MACKEREL_DT, "mackerel")
> >  	.map_io		= sh7372_map_io,
> >  	.init_early	= sh7372_add_early_devices,
> >  	.init_irq	= sh7372_init_irq,
> > @@ -1659,4 +1664,5 @@ MACHINE_START(MACKEREL, "mackerel")
> >  	.init_machine	= mackerel_init,
> >  	.init_late	= sh7372_pm_init_late,
> >  	.timer		= &shmobile_timer,
> > +	.dt_compat  = mackerel_boards_compat_dt,
> >  MACHINE_END
> 
> Not sure what is the status of mach-shmobile with regard to the device
> tree, but one of the idea of the device tree is to avoid having one .c
> file per board, and therefore one DT_MACHINE_START definition per
> board. There should be only only DT_MACHINE_START definition per SoC or
> SoC family, with the DT giving the detailed hardware description.
> 
> Of course, during a transition period, not all your drivers may have DT
> bindings, and therefore some devices may need to be probed in the "old"
> way (manual registration of platform_device). In that case, your
> ->init_machine() hook can call initialization function on a per-board
> basis by testing if the machine is such or such board.
> 
> See arch/arm/mach-kirkwood/board-dt.c for an example. The advantage is
> that with this solution, the board specific C files are progressively
> reducing in size as more and more devices get registered through the
> Device Tree, until the point where they become empty and can be removed.

Hi Thomas,

shmobile is very much in the transition phase and we are, patch by patch,
working towards full(er) DT support for boards, SoCs and drivers. I am not
sure that now is the right time to jump to a approach similar to that taken
by mach-kirkwood/board-dt.c.

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

* Re: [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
  2012-10-28 10:44       ` Simon Horman
@ 2012-10-28 10:57         ` Thomas Petazzoni
  -1 siblings, 0 replies; 112+ messages in thread
From: Thomas Petazzoni @ 2012-10-28 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

Simon,

On Sun, 28 Oct 2012 19:44:38 +0900, Simon Horman wrote:

> shmobile is very much in the transition phase and we are, patch by patch,
> working towards full(er) DT support for boards, SoCs and drivers. I am not
> sure that now is the right time to jump to a approach similar to that taken
> by mach-kirkwood/board-dt.c.

Ok, I understand that for transition needs, each SoC family may need a
different method. My comment was more a general comment to make sure
that the right final direction is being taken. For sure the
intermediate steps may be different.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel
@ 2012-10-28 10:57         ` Thomas Petazzoni
  0 siblings, 0 replies; 112+ messages in thread
From: Thomas Petazzoni @ 2012-10-28 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

Simon,

On Sun, 28 Oct 2012 19:44:38 +0900, Simon Horman wrote:

> shmobile is very much in the transition phase and we are, patch by patch,
> working towards full(er) DT support for boards, SoCs and drivers. I am not
> sure that now is the right time to jump to a approach similar to that taken
> by mach-kirkwood/board-dt.c.

Ok, I understand that for transition needs, each SoC family may need a
different method. My comment was more a general comment to make sure
that the right final direction is being taken. For sure the
intermediate steps may be different.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU
  2012-10-28  2:26   ` Simon Horman
@ 2012-10-28 11:28     ` Sergei Shtylyov
  -1 siblings, 0 replies; 112+ messages in thread
From: Sergei Shtylyov @ 2012-10-28 11:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 28-10-2012 6:26, Simon Horman wrote:

> From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

> This patch enables PMU for r8a7740.

    And enables performance events on the Armadillo board. Perhaps the 
defconfig part was worth a separate patch...

> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
[...]

> diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
> index 11bb1d9..1e032cb 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7740.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7740.c
> @@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
>   	.num_resources	= ARRAY_SIZE(i2c1_resources),
>   };
>
> +static struct resource pmu_resources[] = {
> +	[0] = {
> +		.start	= evt2irq(0x19a0),
> +		.end	= evt2irq(0x19a0),
> +		.flags  = IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct platform_device pmu_device = {
> +	.name	= "arm-pmu",
> +	.id		= -1,

    I think you should either align '=' with tabs, or not bother doing this, 
not both. :-)

> +	.num_resources = ARRAY_SIZE(pmu_resources),
> +	.resource = pmu_resources,
> +};
> +
>   static struct platform_device *r8a7740_late_devices[] __initdata = {
>   	&i2c0_device,
>   	&i2c1_device,

WBR, Sergei


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

* [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU
@ 2012-10-28 11:28     ` Sergei Shtylyov
  0 siblings, 0 replies; 112+ messages in thread
From: Sergei Shtylyov @ 2012-10-28 11:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 28-10-2012 6:26, Simon Horman wrote:

> From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

> This patch enables PMU for r8a7740.

    And enables performance events on the Armadillo board. Perhaps the 
defconfig part was worth a separate patch...

> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
[...]

> diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
> index 11bb1d9..1e032cb 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7740.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7740.c
> @@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
>   	.num_resources	= ARRAY_SIZE(i2c1_resources),
>   };
>
> +static struct resource pmu_resources[] = {
> +	[0] = {
> +		.start	= evt2irq(0x19a0),
> +		.end	= evt2irq(0x19a0),
> +		.flags  = IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct platform_device pmu_device = {
> +	.name	= "arm-pmu",
> +	.id		= -1,

    I think you should either align '=' with tabs, or not bother doing this, 
not both. :-)

> +	.num_resources = ARRAY_SIZE(pmu_resources),
> +	.resource = pmu_resources,
> +};
> +
>   static struct platform_device *r8a7740_late_devices[] __initdata = {
>   	&i2c0_device,
>   	&i2c1_device,

WBR, Sergei

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

* Re: [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU
  2012-10-28 11:28     ` Sergei Shtylyov
@ 2012-10-29  5:11       ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-29  5:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 28, 2012 at 03:28:47PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 28-10-2012 6:26, Simon Horman wrote:
> 
> >From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> 
> >This patch enables PMU for r8a7740.
> 
>    And enables performance events on the Armadillo board. Perhaps
> the defconfig part was worth a separate patch...

As I understand things, the Armadillo is currently the only
board in-tree that uses the r8a7740 SoC and it seems
reasonable to enable performance events to activate the
code that comprises the rest of the patch.

So while I don't feel strongly about this I do have a slight preference
for the current single-patch approach.

> >Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> >Signed-off-by: Simon Horman <horms@verge.net.au>
> [...]
> 
> >diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
> >index 11bb1d9..1e032cb 100644
> >--- a/arch/arm/mach-shmobile/setup-r8a7740.c
> >+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
> >@@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
> >  	.num_resources	= ARRAY_SIZE(i2c1_resources),
> >  };
> >
> >+static struct resource pmu_resources[] = {
> >+	[0] = {
> >+		.start	= evt2irq(0x19a0),
> >+		.end	= evt2irq(0x19a0),
> >+		.flags  = IORESOURCE_IRQ,
> >+	},
> >+};
> >+
> >+static struct platform_device pmu_device = {
> >+	.name	= "arm-pmu",
> >+	.id		= -1,
> 
>    I think you should either align '=' with tabs, or not bother
> doing this, not both. :-)

Thanks, there seems to be an extra tab there.

I'll roll this into an updated patch and series once
we come to a consensus about the defconfig change.

> >+	.num_resources = ARRAY_SIZE(pmu_resources),
> >+	.resource = pmu_resources,
> >+};
> >+
> >  static struct platform_device *r8a7740_late_devices[] __initdata = {
> >  	&i2c0_device,
> >  	&i2c1_device,
> 
> WBR, Sergei
> 

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

* [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU
@ 2012-10-29  5:11       ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-10-29  5:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 28, 2012 at 03:28:47PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 28-10-2012 6:26, Simon Horman wrote:
> 
> >From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> 
> >This patch enables PMU for r8a7740.
> 
>    And enables performance events on the Armadillo board. Perhaps
> the defconfig part was worth a separate patch...

As I understand things, the Armadillo is currently the only
board in-tree that uses the r8a7740 SoC and it seems
reasonable to enable performance events to activate the
code that comprises the rest of the patch.

So while I don't feel strongly about this I do have a slight preference
for the current single-patch approach.

> >Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> >Signed-off-by: Simon Horman <horms@verge.net.au>
> [...]
> 
> >diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
> >index 11bb1d9..1e032cb 100644
> >--- a/arch/arm/mach-shmobile/setup-r8a7740.c
> >+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
> >@@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
> >  	.num_resources	= ARRAY_SIZE(i2c1_resources),
> >  };
> >
> >+static struct resource pmu_resources[] = {
> >+	[0] = {
> >+		.start	= evt2irq(0x19a0),
> >+		.end	= evt2irq(0x19a0),
> >+		.flags  = IORESOURCE_IRQ,
> >+	},
> >+};
> >+
> >+static struct platform_device pmu_device = {
> >+	.name	= "arm-pmu",
> >+	.id		= -1,
> 
>    I think you should either align '=' with tabs, or not bother
> doing this, not both. :-)

Thanks, there seems to be an extra tab there.

I'll roll this into an updated patch and series once
we come to a consensus about the defconfig change.

> >+	.num_resources = ARRAY_SIZE(pmu_resources),
> >+	.resource = pmu_resources,
> >+};
> >+
> >  static struct platform_device *r8a7740_late_devices[] __initdata = {
> >  	&i2c0_device,
> >  	&i2c1_device,
> 
> WBR, Sergei
> 

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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #2
@ 2012-11-08  1:27   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Arnd,

please consider the following board enhancements for 3.8.

* This pull-request is based on an earlier request which I
  posted on the 1st and was merged yesterday: [GIT PULL v3] Renesas
  ARM-based SoC boards for v3.8

* This pull request replaces the one that I sent yesterday:
  [GIT PULL] Renesas ARM-based SoC boards for v3.8 #2

* Patch #2 of this series has a build-time dependency on
  the soc pull request that I sent a few minutes ago:
  [GIT PULL] Renesas ARM-based SoC for v3.8 #2

  In particular, "ARM: shmobile: marzen: add USB EHCI driver support"
  depends on "[PATCH 1/7] ARM: shmobile: r8a7779: PFC rename PENCx -> USB_PENCx"

* Patch 4 of this pull-request is a driver patch which is a dependency
  of patches 6 and 7 of this pull-request. I have spoken to the driver
  maintainer, Paul Mundt, and he has indicated that he thinks it
  is best to merge all in one go.

  In more detail:

  "sh: clkfwk: add sh_clk_fsidiv_register()" is a dependency of
  - "ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks"
  - "ARM: shmobile: r8a7740: add FSI-DVI clocks"

----------------------------------------------------------------
The following changes since commit 631a7b5d958d2ef2c2333b105794c693642f0641:

  ARM: shmobile: Remove G4EVM machine support (2012-10-30 15:25:59 +0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards

for you to fetch changes up to 32ce635f0251bf5b2232cc59151d344303b73718:

  ARM: shmobile: r8a7740: add FSI-DVI clocks (2012-11-08 10:16:13 +0900)

----------------------------------------------------------------
Kuninori Morimoto (7):
      ARM: shmobile: marzen: add USB phy support
      ARM: shmobile: marzen: add USB EHCI driver support
      ARM: shmobile: marzen: add USB OHCI driver support
      sh: clkfwk: add sh_clk_fsidiv_register()
      ARM: shmobile: sh7372: sh7372_fsidivX_clk become non-global
      ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks
      ARM: shmobile: r8a7740: add FSI-DVI clocks

 arch/arm/configs/marzen_defconfig            |   14 +-
 arch/arm/mach-shmobile/Kconfig               |    2 +
 arch/arm/mach-shmobile/board-ap4evb.c        |    2 +-
 arch/arm/mach-shmobile/board-mackerel.c      |    2 +-
 arch/arm/mach-shmobile/board-marzen.c        |  186 +++++++++++++++++++++++++-
 arch/arm/mach-shmobile/clock-r8a7740.c       |   16 +++
 arch/arm/mach-shmobile/clock-sh7372.c        |   92 ++-----------
 arch/arm/mach-shmobile/include/mach/sh7372.h |    2 -
 drivers/sh/clk/cpg.c                         |   86 ++++++++++++
 include/linux/sh_clk.h                       |    9 ++
 10 files changed, 321 insertions(+), 90 deletions(-)

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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #2
@ 2012-11-08  1:27   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Arnd,

please consider the following board enhancements for 3.8.

* This pull-request is based on an earlier request which I
  posted on the 1st and was merged yesterday: [GIT PULL v3] Renesas
  ARM-based SoC boards for v3.8

* This pull request replaces the one that I sent yesterday:
  [GIT PULL] Renesas ARM-based SoC boards for v3.8 #2

* Patch #2 of this series has a build-time dependency on
  the soc pull request that I sent a few minutes ago:
  [GIT PULL] Renesas ARM-based SoC for v3.8 #2

  In particular, "ARM: shmobile: marzen: add USB EHCI driver support"
  depends on "[PATCH 1/7] ARM: shmobile: r8a7779: PFC rename PENCx -> USB_PENCx"

* Patch 4 of this pull-request is a driver patch which is a dependency
  of patches 6 and 7 of this pull-request. I have spoken to the driver
  maintainer, Paul Mundt, and he has indicated that he thinks it
  is best to merge all in one go.

  In more detail:

  "sh: clkfwk: add sh_clk_fsidiv_register()" is a dependency of
  - "ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks"
  - "ARM: shmobile: r8a7740: add FSI-DVI clocks"

----------------------------------------------------------------
The following changes since commit 631a7b5d958d2ef2c2333b105794c693642f0641:

  ARM: shmobile: Remove G4EVM machine support (2012-10-30 15:25:59 +0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards

for you to fetch changes up to 32ce635f0251bf5b2232cc59151d344303b73718:

  ARM: shmobile: r8a7740: add FSI-DVI clocks (2012-11-08 10:16:13 +0900)

----------------------------------------------------------------
Kuninori Morimoto (7):
      ARM: shmobile: marzen: add USB phy support
      ARM: shmobile: marzen: add USB EHCI driver support
      ARM: shmobile: marzen: add USB OHCI driver support
      sh: clkfwk: add sh_clk_fsidiv_register()
      ARM: shmobile: sh7372: sh7372_fsidivX_clk become non-global
      ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks
      ARM: shmobile: r8a7740: add FSI-DVI clocks

 arch/arm/configs/marzen_defconfig            |   14 +-
 arch/arm/mach-shmobile/Kconfig               |    2 +
 arch/arm/mach-shmobile/board-ap4evb.c        |    2 +-
 arch/arm/mach-shmobile/board-mackerel.c      |    2 +-
 arch/arm/mach-shmobile/board-marzen.c        |  186 +++++++++++++++++++++++++-
 arch/arm/mach-shmobile/clock-r8a7740.c       |   16 +++
 arch/arm/mach-shmobile/clock-sh7372.c        |   92 ++-----------
 arch/arm/mach-shmobile/include/mach/sh7372.h |    2 -
 drivers/sh/clk/cpg.c                         |   86 ++++++++++++
 include/linux/sh_clk.h                       |    9 ++
 10 files changed, 321 insertions(+), 90 deletions(-)

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

* [PATCH 1/7] ARM: shmobile: marzen: add USB phy support
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    3 ++-
 arch/arm/mach-shmobile/board-marzen.c |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 5b8215f..8a861b7 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -78,7 +78,8 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_SSB=y
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB=y
+CONFIG_USB_RCAR_PHY=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_UIO=y
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 69f7f46..74c7f0b 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -144,11 +144,32 @@ static struct platform_device hspi_device = {
 	.num_resources	= ARRAY_SIZE(hspi_resources),
 };
 
+/* USB PHY */
+static struct resource usb_phy_resources[] = {
+	[0] = {
+		.start		= 0xffe70000,
+		.end		= 0xffe70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= 0xfff70000,
+		.end		= 0xfff70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device usb_phy_device = {
+	.name		= "rcar_usb_phy",
+	.resource	= usb_phy_resources,
+	.num_resources	= ARRAY_SIZE(usb_phy_resources),
+};
+
 static struct platform_device *marzen_devices[] __initdata = {
 	&eth_device,
 	&sdhi0_device,
 	&thermal_device,
 	&hspi_device,
+	&usb_phy_device,
 };
 
 static void __init marzen_init(void)
-- 
1.7.10.4


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

* [PATCH 1/7] ARM: shmobile: marzen: add USB phy support
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    3 ++-
 arch/arm/mach-shmobile/board-marzen.c |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 5b8215f..8a861b7 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -78,7 +78,8 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_SSB=y
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB=y
+CONFIG_USB_RCAR_PHY=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_UIO=y
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 69f7f46..74c7f0b 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -144,11 +144,32 @@ static struct platform_device hspi_device = {
 	.num_resources	= ARRAY_SIZE(hspi_resources),
 };
 
+/* USB PHY */
+static struct resource usb_phy_resources[] = {
+	[0] = {
+		.start		= 0xffe70000,
+		.end		= 0xffe70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= 0xfff70000,
+		.end		= 0xfff70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device usb_phy_device = {
+	.name		= "rcar_usb_phy",
+	.resource	= usb_phy_resources,
+	.num_resources	= ARRAY_SIZE(usb_phy_resources),
+};
+
 static struct platform_device *marzen_devices[] __initdata = {
 	&eth_device,
 	&sdhi0_device,
 	&thermal_device,
 	&hspi_device,
+	&usb_phy_device,
 };
 
 static void __init marzen_init(void)
-- 
1.7.10.4

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

* [PATCH 2/7] ARM: shmobile: marzen: add USB EHCI driver support
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch supports CN21/CN22 USB 2.0 (port 0/1/2),
and enable USB momery on defconfig

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    6 ++
 arch/arm/mach-shmobile/Kconfig        |    1 +
 arch/arm/mach-shmobile/board-marzen.c |  108 ++++++++++++++++++++++++++++++++-
 3 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 8a861b7..6540dfb 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -47,6 +47,8 @@ CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 # CONFIG_FW_LOADER is not set
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
 # CONFIG_NET_VENDOR_FARADAY is not set
@@ -82,6 +84,10 @@ CONFIG_USB=y
 CONFIG_USB_RCAR_PHY=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_STORAGE=y
 CONFIG_UIO=y
 CONFIG_UIO_PDRV_GENIRQ=y
 # CONFIG_IOMMU_SUPPORT is not set
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index f58c3ea..c03aeec 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -41,6 +41,7 @@ config ARCH_R8A7779
 	select ARM_GIC
 	select CPU_V7
 	select SH_CLK_CPG
+	select USB_ARCH_HAS_EHCI
 
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 74c7f0b..707b3bd 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -34,6 +34,9 @@
 #include <linux/spi/sh_hspi.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
+#include <linux/usb/otg.h>
+#include <linux/usb/ehci_pdriver.h>
+#include <linux/pm_runtime.h>
 #include <mach/hardware.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -172,6 +175,101 @@ static struct platform_device *marzen_devices[] __initdata = {
 	&usb_phy_device,
 };
 
+/* USB */
+static struct usb_phy *phy;
+static int usb_power_on(struct platform_device *pdev)
+{
+	if (!phy)
+		return -EIO;
+
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
+	usb_phy_init(phy);
+
+	return 0;
+}
+
+static void usb_power_off(struct platform_device *pdev)
+{
+	if (!phy)
+		return;
+
+	usb_phy_shutdown(phy);
+
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+}
+
+static struct usb_ehci_pdata ehcix_pdata = {
+	.power_on	= usb_power_on,
+	.power_off	= usb_power_off,
+	.power_suspend	= usb_power_off,
+};
+
+static struct resource ehci0_resources[] = {
+	[0] = {
+		.start	= 0xffe70000,
+		.end	= 0xffe70400 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(44),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ehci0_device = {
+	.name	= "ehci-platform",
+	.id	= 0,
+	.dev	= {
+		.dma_mask		= &ehci0_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ehcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ehci0_resources),
+	.resource	= ehci0_resources,
+};
+
+static struct resource ehci1_resources[] = {
+	[0] = {
+		.start	= 0xfff70000,
+		.end	= 0xfff70400 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(45),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ehci1_device = {
+	.name	= "ehci-platform",
+	.id	= 1,
+	.dev	= {
+		.dma_mask		= &ehci1_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ehcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ehci1_resources),
+	.resource	= ehci1_resources,
+};
+
+static struct platform_device *marzen_late_devices[] __initdata = {
+	&ehci0_device,
+	&ehci1_device,
+};
+
+void __init marzen_init_late(void)
+{
+	/* get usb phy */
+	phy = usb_get_phy(USB_PHY_TYPE_USB2);
+
+	shmobile_init_late();
+	platform_add_devices(marzen_late_devices,
+			     ARRAY_SIZE(marzen_late_devices));
+}
+
 static void __init marzen_init(void)
 {
 	regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
@@ -209,6 +307,14 @@ static void __init marzen_init(void)
 	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
 	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
 
+	/* USB (CN21) */
+	gpio_request(GPIO_FN_USB_OVC0, NULL);
+	gpio_request(GPIO_FN_USB_OVC1, NULL);
+	gpio_request(GPIO_FN_USB_OVC2, NULL);
+
+	/* USB (CN22) */
+	gpio_request(GPIO_FN_USB_PENC2, NULL);
+
 	r8a7779_add_standard_devices();
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }
@@ -221,6 +327,6 @@ MACHINE_START(MARZEN, "marzen")
 	.init_irq	= r8a7779_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= marzen_init,
-	.init_late	= shmobile_init_late,
+	.init_late	= marzen_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
-- 
1.7.10.4


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

* [PATCH 2/7] ARM: shmobile: marzen: add USB EHCI driver support
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch supports CN21/CN22 USB 2.0 (port 0/1/2),
and enable USB momery on defconfig

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    6 ++
 arch/arm/mach-shmobile/Kconfig        |    1 +
 arch/arm/mach-shmobile/board-marzen.c |  108 ++++++++++++++++++++++++++++++++-
 3 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 8a861b7..6540dfb 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -47,6 +47,8 @@ CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 # CONFIG_FW_LOADER is not set
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
 # CONFIG_NET_VENDOR_FARADAY is not set
@@ -82,6 +84,10 @@ CONFIG_USB=y
 CONFIG_USB_RCAR_PHY=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_STORAGE=y
 CONFIG_UIO=y
 CONFIG_UIO_PDRV_GENIRQ=y
 # CONFIG_IOMMU_SUPPORT is not set
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index f58c3ea..c03aeec 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -41,6 +41,7 @@ config ARCH_R8A7779
 	select ARM_GIC
 	select CPU_V7
 	select SH_CLK_CPG
+	select USB_ARCH_HAS_EHCI
 
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 74c7f0b..707b3bd 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -34,6 +34,9 @@
 #include <linux/spi/sh_hspi.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
+#include <linux/usb/otg.h>
+#include <linux/usb/ehci_pdriver.h>
+#include <linux/pm_runtime.h>
 #include <mach/hardware.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -172,6 +175,101 @@ static struct platform_device *marzen_devices[] __initdata = {
 	&usb_phy_device,
 };
 
+/* USB */
+static struct usb_phy *phy;
+static int usb_power_on(struct platform_device *pdev)
+{
+	if (!phy)
+		return -EIO;
+
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
+	usb_phy_init(phy);
+
+	return 0;
+}
+
+static void usb_power_off(struct platform_device *pdev)
+{
+	if (!phy)
+		return;
+
+	usb_phy_shutdown(phy);
+
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+}
+
+static struct usb_ehci_pdata ehcix_pdata = {
+	.power_on	= usb_power_on,
+	.power_off	= usb_power_off,
+	.power_suspend	= usb_power_off,
+};
+
+static struct resource ehci0_resources[] = {
+	[0] = {
+		.start	= 0xffe70000,
+		.end	= 0xffe70400 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(44),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ehci0_device = {
+	.name	= "ehci-platform",
+	.id	= 0,
+	.dev	= {
+		.dma_mask		= &ehci0_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ehcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ehci0_resources),
+	.resource	= ehci0_resources,
+};
+
+static struct resource ehci1_resources[] = {
+	[0] = {
+		.start	= 0xfff70000,
+		.end	= 0xfff70400 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(45),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ehci1_device = {
+	.name	= "ehci-platform",
+	.id	= 1,
+	.dev	= {
+		.dma_mask		= &ehci1_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ehcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ehci1_resources),
+	.resource	= ehci1_resources,
+};
+
+static struct platform_device *marzen_late_devices[] __initdata = {
+	&ehci0_device,
+	&ehci1_device,
+};
+
+void __init marzen_init_late(void)
+{
+	/* get usb phy */
+	phy = usb_get_phy(USB_PHY_TYPE_USB2);
+
+	shmobile_init_late();
+	platform_add_devices(marzen_late_devices,
+			     ARRAY_SIZE(marzen_late_devices));
+}
+
 static void __init marzen_init(void)
 {
 	regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
@@ -209,6 +307,14 @@ static void __init marzen_init(void)
 	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
 	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
 
+	/* USB (CN21) */
+	gpio_request(GPIO_FN_USB_OVC0, NULL);
+	gpio_request(GPIO_FN_USB_OVC1, NULL);
+	gpio_request(GPIO_FN_USB_OVC2, NULL);
+
+	/* USB (CN22) */
+	gpio_request(GPIO_FN_USB_PENC2, NULL);
+
 	r8a7779_add_standard_devices();
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }
@@ -221,6 +327,6 @@ MACHINE_START(MARZEN, "marzen")
 	.init_irq	= r8a7779_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= marzen_init,
-	.init_late	= shmobile_init_late,
+	.init_late	= marzen_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
-- 
1.7.10.4

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

* [PATCH 3/7] ARM: shmobile: marzen: add USB OHCI driver support
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch supports CN21/CN22 USB 1.x (port 0/1/2),
and enable input event on defconfig

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    5 +--
 arch/arm/mach-shmobile/Kconfig        |    1 +
 arch/arm/mach-shmobile/board-marzen.c |   57 +++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 6540dfb..728a43c 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -61,9 +61,8 @@ CONFIG_SMSC911X=y
 # CONFIG_NET_VENDOR_STMICRO is not set
 # CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
 # CONFIG_DEVKMEM is not set
@@ -86,6 +85,8 @@ CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_STORAGE=y
 CONFIG_UIO=y
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index c03aeec..64db252 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -42,6 +42,7 @@ config ARCH_R8A7779
 	select CPU_V7
 	select SH_CLK_CPG
 	select USB_ARCH_HAS_EHCI
+	select USB_ARCH_HAS_OHCI
 
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 707b3bd..449f928 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -36,6 +36,7 @@
 #include <linux/mfd/tmio.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
 #include <linux/pm_runtime.h>
 #include <mach/hardware.h>
 #include <mach/r8a7779.h>
@@ -255,9 +256,65 @@ static struct platform_device ehci1_device = {
 	.resource	= ehci1_resources,
 };
 
+static struct usb_ohci_pdata ohcix_pdata = {
+	.power_on	= usb_power_on,
+	.power_off	= usb_power_off,
+	.power_suspend	= usb_power_off,
+};
+
+static struct resource ohci0_resources[] = {
+	[0] = {
+		.start	= 0xffe70400,
+		.end	= 0xffe70800 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(44),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ohci0_device = {
+	.name	= "ohci-platform",
+	.id	= 0,
+	.dev	= {
+		.dma_mask		= &ohci0_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ohcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ohci0_resources),
+	.resource	= ohci0_resources,
+};
+
+static struct resource ohci1_resources[] = {
+	[0] = {
+		.start	= 0xfff70400,
+		.end	= 0xfff70800 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(45),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ohci1_device = {
+	.name	= "ohci-platform",
+	.id	= 1,
+	.dev	= {
+		.dma_mask		= &ohci1_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ohcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ohci1_resources),
+	.resource	= ohci1_resources,
+};
+
 static struct platform_device *marzen_late_devices[] __initdata = {
 	&ehci0_device,
 	&ehci1_device,
+	&ohci0_device,
+	&ohci1_device,
 };
 
 void __init marzen_init_late(void)
-- 
1.7.10.4


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

* [PATCH 3/7] ARM: shmobile: marzen: add USB OHCI driver support
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch supports CN21/CN22 USB 1.x (port 0/1/2),
and enable input event on defconfig

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    5 +--
 arch/arm/mach-shmobile/Kconfig        |    1 +
 arch/arm/mach-shmobile/board-marzen.c |   57 +++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 6540dfb..728a43c 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -61,9 +61,8 @@ CONFIG_SMSC911X=y
 # CONFIG_NET_VENDOR_STMICRO is not set
 # CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
 # CONFIG_DEVKMEM is not set
@@ -86,6 +85,8 @@ CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_STORAGE=y
 CONFIG_UIO=y
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index c03aeec..64db252 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -42,6 +42,7 @@ config ARCH_R8A7779
 	select CPU_V7
 	select SH_CLK_CPG
 	select USB_ARCH_HAS_EHCI
+	select USB_ARCH_HAS_OHCI
 
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 707b3bd..449f928 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -36,6 +36,7 @@
 #include <linux/mfd/tmio.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
 #include <linux/pm_runtime.h>
 #include <mach/hardware.h>
 #include <mach/r8a7779.h>
@@ -255,9 +256,65 @@ static struct platform_device ehci1_device = {
 	.resource	= ehci1_resources,
 };
 
+static struct usb_ohci_pdata ohcix_pdata = {
+	.power_on	= usb_power_on,
+	.power_off	= usb_power_off,
+	.power_suspend	= usb_power_off,
+};
+
+static struct resource ohci0_resources[] = {
+	[0] = {
+		.start	= 0xffe70400,
+		.end	= 0xffe70800 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(44),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ohci0_device = {
+	.name	= "ohci-platform",
+	.id	= 0,
+	.dev	= {
+		.dma_mask		= &ohci0_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ohcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ohci0_resources),
+	.resource	= ohci0_resources,
+};
+
+static struct resource ohci1_resources[] = {
+	[0] = {
+		.start	= 0xfff70400,
+		.end	= 0xfff70800 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(45),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device ohci1_device = {
+	.name	= "ohci-platform",
+	.id	= 1,
+	.dev	= {
+		.dma_mask		= &ohci1_device.dev.coherent_dma_mask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data		= &ohcix_pdata,
+	},
+	.num_resources	= ARRAY_SIZE(ohci1_resources),
+	.resource	= ohci1_resources,
+};
+
 static struct platform_device *marzen_late_devices[] __initdata = {
 	&ehci0_device,
 	&ehci1_device,
+	&ohci0_device,
+	&ohci1_device,
 };
 
 void __init marzen_init_late(void)
-- 
1.7.10.4

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

* [PATCH 4/7] sh: clkfwk: add sh_clk_fsidiv_register()
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch adds sh_clk_fsidiv_register() to share FSI-DIV clock code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 drivers/sh/clk/cpg.c   |   86 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/sh_clk.h |    9 +++++
 2 files changed, 95 insertions(+)

diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index 07e9fb4..b3dc441 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -361,3 +361,89 @@ int __init sh_clk_div4_reparent_register(struct clk *clks, int nr,
 	return sh_clk_div_register_ops(clks, nr, table,
 				       &sh_clk_div4_reparent_clk_ops);
 }
+
+/* FSI-DIV */
+static unsigned long fsidiv_recalc(struct clk *clk)
+{
+	u32 value;
+
+	value = __raw_readl(clk->mapping->base);
+
+	value >>= 16;
+	if (value < 2)
+		return clk->parent->rate;
+
+	return clk->parent->rate / value;
+}
+
+static long fsidiv_round_rate(struct clk *clk, unsigned long rate)
+{
+	return clk_rate_div_range_round(clk, 1, 0xffff, rate);
+}
+
+static void fsidiv_disable(struct clk *clk)
+{
+	__raw_writel(0, clk->mapping->base);
+}
+
+static int fsidiv_enable(struct clk *clk)
+{
+	u32 value;
+
+	value  = __raw_readl(clk->mapping->base) >> 16;
+	if (value < 2)
+		return 0;
+
+	__raw_writel((value << 16) | 0x3, clk->mapping->base);
+
+	return 0;
+}
+
+static int fsidiv_set_rate(struct clk *clk, unsigned long rate)
+{
+	u32 val;
+	int idx;
+
+	idx = (clk->parent->rate / rate) & 0xffff;
+	if (idx < 2)
+		__raw_writel(0, clk->mapping->base);
+	else
+		__raw_writel(idx << 16, clk->mapping->base);
+
+	return 0;
+}
+
+static struct sh_clk_ops fsidiv_clk_ops = {
+	.recalc		= fsidiv_recalc,
+	.round_rate	= fsidiv_round_rate,
+	.set_rate	= fsidiv_set_rate,
+	.enable		= fsidiv_enable,
+	.disable	= fsidiv_disable,
+};
+
+int __init sh_clk_fsidiv_register(struct clk *clks, int nr)
+{
+	struct clk_mapping *map;
+	int i;
+
+	for (i = 0; i < nr; i++) {
+
+		map = kzalloc(sizeof(struct clk_mapping), GFP_KERNEL);
+		if (!map) {
+			pr_err("%s: unable to alloc memory\n", __func__);
+			return -ENOMEM;
+		}
+
+		/* clks[i].enable_reg came from SH_CLK_FSIDIV() */
+		map->phys		= (phys_addr_t)clks[i].enable_reg;
+		map->len		= 8;
+
+		clks[i].enable_reg	= 0; /* remove .enable_reg */
+		clks[i].ops		= &fsidiv_clk_ops;
+		clks[i].mapping		= map;
+
+		clk_register(&clks[i]);
+	}
+
+	return 0;
+}
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 5091091..60c7239 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -199,4 +199,13 @@ int sh_clk_div6_reparent_register(struct clk *clks, int nr);
 #define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
 #define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
 
+/* .enable_reg will be updated to .mapping on sh_clk_fsidiv_register() */
+#define SH_CLK_FSIDIV(_reg, _parent)		\
+{						\
+	.enable_reg = (void __iomem *)_reg,	\
+	.parent		= _parent,		\
+}
+
+int sh_clk_fsidiv_register(struct clk *clks, int nr);
+
 #endif /* __SH_CLOCK_H */
-- 
1.7.10.4


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

* [PATCH 4/7] sh: clkfwk: add sh_clk_fsidiv_register()
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch adds sh_clk_fsidiv_register() to share FSI-DIV clock code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 drivers/sh/clk/cpg.c   |   86 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/sh_clk.h |    9 +++++
 2 files changed, 95 insertions(+)

diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index 07e9fb4..b3dc441 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -361,3 +361,89 @@ int __init sh_clk_div4_reparent_register(struct clk *clks, int nr,
 	return sh_clk_div_register_ops(clks, nr, table,
 				       &sh_clk_div4_reparent_clk_ops);
 }
+
+/* FSI-DIV */
+static unsigned long fsidiv_recalc(struct clk *clk)
+{
+	u32 value;
+
+	value = __raw_readl(clk->mapping->base);
+
+	value >>= 16;
+	if (value < 2)
+		return clk->parent->rate;
+
+	return clk->parent->rate / value;
+}
+
+static long fsidiv_round_rate(struct clk *clk, unsigned long rate)
+{
+	return clk_rate_div_range_round(clk, 1, 0xffff, rate);
+}
+
+static void fsidiv_disable(struct clk *clk)
+{
+	__raw_writel(0, clk->mapping->base);
+}
+
+static int fsidiv_enable(struct clk *clk)
+{
+	u32 value;
+
+	value  = __raw_readl(clk->mapping->base) >> 16;
+	if (value < 2)
+		return 0;
+
+	__raw_writel((value << 16) | 0x3, clk->mapping->base);
+
+	return 0;
+}
+
+static int fsidiv_set_rate(struct clk *clk, unsigned long rate)
+{
+	u32 val;
+	int idx;
+
+	idx = (clk->parent->rate / rate) & 0xffff;
+	if (idx < 2)
+		__raw_writel(0, clk->mapping->base);
+	else
+		__raw_writel(idx << 16, clk->mapping->base);
+
+	return 0;
+}
+
+static struct sh_clk_ops fsidiv_clk_ops = {
+	.recalc		= fsidiv_recalc,
+	.round_rate	= fsidiv_round_rate,
+	.set_rate	= fsidiv_set_rate,
+	.enable		= fsidiv_enable,
+	.disable	= fsidiv_disable,
+};
+
+int __init sh_clk_fsidiv_register(struct clk *clks, int nr)
+{
+	struct clk_mapping *map;
+	int i;
+
+	for (i = 0; i < nr; i++) {
+
+		map = kzalloc(sizeof(struct clk_mapping), GFP_KERNEL);
+		if (!map) {
+			pr_err("%s: unable to alloc memory\n", __func__);
+			return -ENOMEM;
+		}
+
+		/* clks[i].enable_reg came from SH_CLK_FSIDIV() */
+		map->phys		= (phys_addr_t)clks[i].enable_reg;
+		map->len		= 8;
+
+		clks[i].enable_reg	= 0; /* remove .enable_reg */
+		clks[i].ops		= &fsidiv_clk_ops;
+		clks[i].mapping		= map;
+
+		clk_register(&clks[i]);
+	}
+
+	return 0;
+}
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 5091091..60c7239 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -199,4 +199,13 @@ int sh_clk_div6_reparent_register(struct clk *clks, int nr);
 #define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
 #define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
 
+/* .enable_reg will be updated to .mapping on sh_clk_fsidiv_register() */
+#define SH_CLK_FSIDIV(_reg, _parent)		\
+{						\
+	.enable_reg = (void __iomem *)_reg,	\
+	.parent		= _parent,		\
+}
+
+int sh_clk_fsidiv_register(struct clk *clks, int nr);
+
 #endif /* __SH_CLOCK_H */
-- 
1.7.10.4

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

* [PATCH 5/7] ARM: shmobile: sh7372: sh7372_fsidivX_clk become non-global
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Not only sh7372 but also many Renesas chip has FSI-DIV clock,
and we can share its sh_clk_ops.
To support common FSI-DIV clock, sh7372_fsidivX_clk
becomes non-global by this patch.
This is preparation for FSI DT support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/board-ap4evb.c        |    2 +-
 arch/arm/mach-shmobile/board-mackerel.c      |    2 +-
 arch/arm/mach-shmobile/clock-sh7372.c        |   10 ++++++----
 arch/arm/mach-shmobile/include/mach/sh7372.h |    2 --
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 790dc68..cefdd03 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -728,7 +728,7 @@ fsia_ick_out:
 static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable)
 {
 	struct clk *fsib_clk;
-	struct clk *fdiv_clk = &sh7372_fsidivb_clk;
+	struct clk *fdiv_clk = clk_get(NULL, "fsidivb");
 	long fsib_rate = 0;
 	long fdiv_rate = 0;
 	int ackmd_bpfmd;
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 39b8f2e..f274252 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -882,7 +882,7 @@ static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
 static int fsi_b_set_rate(struct device *dev, int rate, int enable)
 {
 	struct clk *fsib_clk;
-	struct clk *fdiv_clk = &sh7372_fsidivb_clk;
+	struct clk *fdiv_clk = clk_get(NULL, "fsidivb");
 	long fsib_rate = 0;
 	long fdiv_rate = 0;
 	int ackmd_bpfmd;
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 430a90f..18dcff7 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -481,7 +481,7 @@ static struct clk_mapping fsidiva_clk_mapping = {
 	.len	= 8,
 };
 
-struct clk sh7372_fsidiva_clk = {
+static struct clk fsidiva_clk = {
 	.ops		= &fsidiv_clk_ops,
 	.parent		= &div6_reparent_clks[DIV6_FSIA], /* late install */
 	.mapping	= &fsidiva_clk_mapping,
@@ -492,15 +492,15 @@ static struct clk_mapping fsidivb_clk_mapping = {
 	.len	= 8,
 };
 
-struct clk sh7372_fsidivb_clk = {
+static struct clk fsidivb_clk = {
 	.ops		= &fsidiv_clk_ops,
 	.parent		= &div6_reparent_clks[DIV6_FSIB],  /* late install */
 	.mapping	= &fsidivb_clk_mapping,
 };
 
 static struct clk *late_main_clks[] = {
-	&sh7372_fsidiva_clk,
-	&sh7372_fsidivb_clk,
+	&fsidiva_clk,
+	&fsidivb_clk,
 };
 
 enum { MSTP001, MSTP000,
@@ -583,6 +583,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
 	CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
 	CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
+	CLKDEV_CON_ID("fsidiva", &fsidiva_clk),
+	CLKDEV_CON_ID("fsidivb", &fsidivb_clk),
 
 	/* DIV4 clocks */
 	CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index eb98b45..bf93a86 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -475,8 +475,6 @@ extern struct clk sh7372_dv_clki_div2_clk;
 extern struct clk sh7372_pllc2_clk;
 extern struct clk sh7372_fsiack_clk;
 extern struct clk sh7372_fsibck_clk;
-extern struct clk sh7372_fsidiva_clk;
-extern struct clk sh7372_fsidivb_clk;
 
 extern void sh7372_intcs_suspend(void);
 extern void sh7372_intcs_resume(void);
-- 
1.7.10.4


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

* [PATCH 5/7] ARM: shmobile: sh7372: sh7372_fsidivX_clk become non-global
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Not only sh7372 but also many Renesas chip has FSI-DIV clock,
and we can share its sh_clk_ops.
To support common FSI-DIV clock, sh7372_fsidivX_clk
becomes non-global by this patch.
This is preparation for FSI DT support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/board-ap4evb.c        |    2 +-
 arch/arm/mach-shmobile/board-mackerel.c      |    2 +-
 arch/arm/mach-shmobile/clock-sh7372.c        |   10 ++++++----
 arch/arm/mach-shmobile/include/mach/sh7372.h |    2 --
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 790dc68..cefdd03 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -728,7 +728,7 @@ fsia_ick_out:
 static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable)
 {
 	struct clk *fsib_clk;
-	struct clk *fdiv_clk = &sh7372_fsidivb_clk;
+	struct clk *fdiv_clk = clk_get(NULL, "fsidivb");
 	long fsib_rate = 0;
 	long fdiv_rate = 0;
 	int ackmd_bpfmd;
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 39b8f2e..f274252 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -882,7 +882,7 @@ static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
 static int fsi_b_set_rate(struct device *dev, int rate, int enable)
 {
 	struct clk *fsib_clk;
-	struct clk *fdiv_clk = &sh7372_fsidivb_clk;
+	struct clk *fdiv_clk = clk_get(NULL, "fsidivb");
 	long fsib_rate = 0;
 	long fdiv_rate = 0;
 	int ackmd_bpfmd;
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 430a90f..18dcff7 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -481,7 +481,7 @@ static struct clk_mapping fsidiva_clk_mapping = {
 	.len	= 8,
 };
 
-struct clk sh7372_fsidiva_clk = {
+static struct clk fsidiva_clk = {
 	.ops		= &fsidiv_clk_ops,
 	.parent		= &div6_reparent_clks[DIV6_FSIA], /* late install */
 	.mapping	= &fsidiva_clk_mapping,
@@ -492,15 +492,15 @@ static struct clk_mapping fsidivb_clk_mapping = {
 	.len	= 8,
 };
 
-struct clk sh7372_fsidivb_clk = {
+static struct clk fsidivb_clk = {
 	.ops		= &fsidiv_clk_ops,
 	.parent		= &div6_reparent_clks[DIV6_FSIB],  /* late install */
 	.mapping	= &fsidivb_clk_mapping,
 };
 
 static struct clk *late_main_clks[] = {
-	&sh7372_fsidiva_clk,
-	&sh7372_fsidivb_clk,
+	&fsidiva_clk,
+	&fsidivb_clk,
 };
 
 enum { MSTP001, MSTP000,
@@ -583,6 +583,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
 	CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
 	CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
+	CLKDEV_CON_ID("fsidiva", &fsidiva_clk),
+	CLKDEV_CON_ID("fsidivb", &fsidivb_clk),
 
 	/* DIV4 clocks */
 	CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index eb98b45..bf93a86 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -475,8 +475,6 @@ extern struct clk sh7372_dv_clki_div2_clk;
 extern struct clk sh7372_pllc2_clk;
 extern struct clk sh7372_fsiack_clk;
 extern struct clk sh7372_fsibck_clk;
-extern struct clk sh7372_fsidiva_clk;
-extern struct clk sh7372_fsidivb_clk;
 
 extern void sh7372_intcs_suspend(void);
 extern void sh7372_intcs_resume(void);
-- 
1.7.10.4

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

* [PATCH 6/7] ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Now, sh7372 can use sh_clk_fsidiv_register() for FSI-DIV clocks.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-sh7372.c |   94 ++++-----------------------------
 1 file changed, 10 insertions(+), 84 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 18dcff7..bee2d05 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -420,87 +420,11 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
 };
 
 /* FSI DIV */
-static unsigned long fsidiv_recalc(struct clk *clk)
-{
-	unsigned long value;
-
-	value = __raw_readl(clk->mapping->base);
-
-	value >>= 16;
-	if (value < 2)
-		return 0;
-
-	return clk->parent->rate / value;
-}
-
-static long fsidiv_round_rate(struct clk *clk, unsigned long rate)
-{
-	return clk_rate_div_range_round(clk, 2, 0xffff, rate);
-}
-
-static void fsidiv_disable(struct clk *clk)
-{
-	__raw_writel(0, clk->mapping->base);
-}
-
-static int fsidiv_enable(struct clk *clk)
-{
-	unsigned long value;
-
-	value  = __raw_readl(clk->mapping->base) >> 16;
-	if (value < 2)
-		return -EIO;
-
-	__raw_writel((value << 16) | 0x3, clk->mapping->base);
-
-	return 0;
-}
+enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR };
 
-static int fsidiv_set_rate(struct clk *clk, unsigned long rate)
-{
-	int idx;
-
-	idx = (clk->parent->rate / rate) & 0xffff;
-	if (idx < 2)
-		return -EINVAL;
-
-	__raw_writel(idx << 16, clk->mapping->base);
-	return 0;
-}
-
-static struct sh_clk_ops fsidiv_clk_ops = {
-	.recalc		= fsidiv_recalc,
-	.round_rate	= fsidiv_round_rate,
-	.set_rate	= fsidiv_set_rate,
-	.enable		= fsidiv_enable,
-	.disable	= fsidiv_disable,
-};
-
-static struct clk_mapping fsidiva_clk_mapping = {
-	.phys	= FSIDIVA,
-	.len	= 8,
-};
-
-static struct clk fsidiva_clk = {
-	.ops		= &fsidiv_clk_ops,
-	.parent		= &div6_reparent_clks[DIV6_FSIA], /* late install */
-	.mapping	= &fsidiva_clk_mapping,
-};
-
-static struct clk_mapping fsidivb_clk_mapping = {
-	.phys	= FSIDIVB,
-	.len	= 8,
-};
-
-static struct clk fsidivb_clk = {
-	.ops		= &fsidiv_clk_ops,
-	.parent		= &div6_reparent_clks[DIV6_FSIB],  /* late install */
-	.mapping	= &fsidivb_clk_mapping,
-};
-
-static struct clk *late_main_clks[] = {
-	&fsidiva_clk,
-	&fsidivb_clk,
+static struct clk fsidivs[] = {
+	[FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]),
+	[FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]),
 };
 
 enum { MSTP001, MSTP000,
@@ -583,8 +507,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
 	CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
 	CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
-	CLKDEV_CON_ID("fsidiva", &fsidiva_clk),
-	CLKDEV_CON_ID("fsidivb", &fsidivb_clk),
+	CLKDEV_CON_ID("fsidiva", &fsidivs[FSIDIV_A]),
+	CLKDEV_CON_ID("fsidivb", &fsidivs[FSIDIV_B]),
 
 	/* DIV4 clocks */
 	CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
@@ -680,6 +604,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
 	CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
 	CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]),
+	CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
+	CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
 };
 
 void __init sh7372_clock_init(void)
@@ -708,8 +634,8 @@ void __init sh7372_clock_init(void)
 	if (!ret)
 		ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
 
-	for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
-		ret = clk_register(late_main_clks[k]);
+	if (!ret)
+		ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
 
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
-- 
1.7.10.4


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

* [PATCH 6/7] ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Now, sh7372 can use sh_clk_fsidiv_register() for FSI-DIV clocks.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-sh7372.c |   94 ++++-----------------------------
 1 file changed, 10 insertions(+), 84 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 18dcff7..bee2d05 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -420,87 +420,11 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
 };
 
 /* FSI DIV */
-static unsigned long fsidiv_recalc(struct clk *clk)
-{
-	unsigned long value;
-
-	value = __raw_readl(clk->mapping->base);
-
-	value >>= 16;
-	if (value < 2)
-		return 0;
-
-	return clk->parent->rate / value;
-}
-
-static long fsidiv_round_rate(struct clk *clk, unsigned long rate)
-{
-	return clk_rate_div_range_round(clk, 2, 0xffff, rate);
-}
-
-static void fsidiv_disable(struct clk *clk)
-{
-	__raw_writel(0, clk->mapping->base);
-}
-
-static int fsidiv_enable(struct clk *clk)
-{
-	unsigned long value;
-
-	value  = __raw_readl(clk->mapping->base) >> 16;
-	if (value < 2)
-		return -EIO;
-
-	__raw_writel((value << 16) | 0x3, clk->mapping->base);
-
-	return 0;
-}
+enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR };
 
-static int fsidiv_set_rate(struct clk *clk, unsigned long rate)
-{
-	int idx;
-
-	idx = (clk->parent->rate / rate) & 0xffff;
-	if (idx < 2)
-		return -EINVAL;
-
-	__raw_writel(idx << 16, clk->mapping->base);
-	return 0;
-}
-
-static struct sh_clk_ops fsidiv_clk_ops = {
-	.recalc		= fsidiv_recalc,
-	.round_rate	= fsidiv_round_rate,
-	.set_rate	= fsidiv_set_rate,
-	.enable		= fsidiv_enable,
-	.disable	= fsidiv_disable,
-};
-
-static struct clk_mapping fsidiva_clk_mapping = {
-	.phys	= FSIDIVA,
-	.len	= 8,
-};
-
-static struct clk fsidiva_clk = {
-	.ops		= &fsidiv_clk_ops,
-	.parent		= &div6_reparent_clks[DIV6_FSIA], /* late install */
-	.mapping	= &fsidiva_clk_mapping,
-};
-
-static struct clk_mapping fsidivb_clk_mapping = {
-	.phys	= FSIDIVB,
-	.len	= 8,
-};
-
-static struct clk fsidivb_clk = {
-	.ops		= &fsidiv_clk_ops,
-	.parent		= &div6_reparent_clks[DIV6_FSIB],  /* late install */
-	.mapping	= &fsidivb_clk_mapping,
-};
-
-static struct clk *late_main_clks[] = {
-	&fsidiva_clk,
-	&fsidivb_clk,
+static struct clk fsidivs[] = {
+	[FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]),
+	[FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]),
 };
 
 enum { MSTP001, MSTP000,
@@ -583,8 +507,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
 	CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
 	CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
-	CLKDEV_CON_ID("fsidiva", &fsidiva_clk),
-	CLKDEV_CON_ID("fsidivb", &fsidivb_clk),
+	CLKDEV_CON_ID("fsidiva", &fsidivs[FSIDIV_A]),
+	CLKDEV_CON_ID("fsidivb", &fsidivs[FSIDIV_B]),
 
 	/* DIV4 clocks */
 	CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
@@ -680,6 +604,8 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
 	CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
 	CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]),
+	CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
+	CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
 };
 
 void __init sh7372_clock_init(void)
@@ -708,8 +634,8 @@ void __init sh7372_clock_init(void)
 	if (!ret)
 		ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
 
-	for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
-		ret = clk_register(late_main_clks[k]);
+	if (!ret)
+		ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
 
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
-- 
1.7.10.4

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

* [PATCH 7/7] ARM: shmobile: r8a7740: add FSI-DVI clocks
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  1:27     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7740.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index 6729e00..71ee224 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -65,6 +65,9 @@
 #define SMSTPCR3	IOMEM(0xe615013c)
 #define SMSTPCR4	IOMEM(0xe6150140)
 
+#define FSIDIVA		IOMEM(0xFE1F8000)
+#define FSIDIVB		IOMEM(0xFE1F8008)
+
 /* Fixed 32 KHz root clock from EXTALR pin */
 static struct clk extalr_clk = {
 	.rate	= 32768,
@@ -427,6 +430,14 @@ static struct clk *late_main_clks[] = {
 	&hdmi2_clk,
 };
 
+/* FSI DIV */
+enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR };
+
+static struct clk fsidivs[] = {
+	[FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]),
+	[FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]),
+};
+
 /* MSTP */
 enum {
 	DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP,
@@ -596,6 +607,8 @@ static struct clk_lookup lookups[] = {
 
 	CLKDEV_ICK_ID("icka", "sh_fsi2",	&div6_reparent_clks[DIV6_FSIA]),
 	CLKDEV_ICK_ID("ickb", "sh_fsi2",	&div6_reparent_clks[DIV6_FSIB]),
+	CLKDEV_ICK_ID("diva", "sh_fsi2",	&fsidivs[FSIDIV_A]),
+	CLKDEV_ICK_ID("divb", "sh_fsi2",	&fsidivs[FSIDIV_B]),
 };
 
 void __init r8a7740_clock_init(u8 md_ck)
@@ -641,6 +654,9 @@ void __init r8a7740_clock_init(u8 md_ck)
 	for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
 		ret = clk_register(late_main_clks[k]);
 
+	if (!ret)
+		ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
+
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
 	if (!ret)
-- 
1.7.10.4


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

* [PATCH 7/7] ARM: shmobile: r8a7740: add FSI-DVI clocks
@ 2012-11-08  1:27     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7740.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index 6729e00..71ee224 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -65,6 +65,9 @@
 #define SMSTPCR3	IOMEM(0xe615013c)
 #define SMSTPCR4	IOMEM(0xe6150140)
 
+#define FSIDIVA		IOMEM(0xFE1F8000)
+#define FSIDIVB		IOMEM(0xFE1F8008)
+
 /* Fixed 32 KHz root clock from EXTALR pin */
 static struct clk extalr_clk = {
 	.rate	= 32768,
@@ -427,6 +430,14 @@ static struct clk *late_main_clks[] = {
 	&hdmi2_clk,
 };
 
+/* FSI DIV */
+enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR };
+
+static struct clk fsidivs[] = {
+	[FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]),
+	[FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]),
+};
+
 /* MSTP */
 enum {
 	DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP,
@@ -596,6 +607,8 @@ static struct clk_lookup lookups[] = {
 
 	CLKDEV_ICK_ID("icka", "sh_fsi2",	&div6_reparent_clks[DIV6_FSIA]),
 	CLKDEV_ICK_ID("ickb", "sh_fsi2",	&div6_reparent_clks[DIV6_FSIB]),
+	CLKDEV_ICK_ID("diva", "sh_fsi2",	&fsidivs[FSIDIV_A]),
+	CLKDEV_ICK_ID("divb", "sh_fsi2",	&fsidivs[FSIDIV_B]),
 };
 
 void __init r8a7740_clock_init(u8 md_ck)
@@ -641,6 +654,9 @@ void __init r8a7740_clock_init(u8 md_ck)
 	for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
 		ret = clk_register(late_main_clks[k]);
 
+	if (!ret)
+		ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
+
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
 	if (!ret)
-- 
1.7.10.4

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

* Re: [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #2
  2012-11-08  1:27   ` Simon Horman
@ 2012-11-08  6:29     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  6:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 08, 2012 at 10:27:29AM +0900, Simon Horman wrote:
> Hi Olof, Hi Arnd,
> 
> please consider the following board enhancements for 3.8.
> 
> * This pull-request is based on an earlier request which I
>   posted on the 1st and was merged yesterday: [GIT PULL v3] Renesas
>   ARM-based SoC boards for v3.8
> 
> * This pull request replaces the one that I sent yesterday:
>   [GIT PULL] Renesas ARM-based SoC boards for v3.8 #2
> 
> * Patch #2 of this series has a build-time dependency on
>   the soc pull request that I sent a few minutes ago:
>   [GIT PULL] Renesas ARM-based SoC for v3.8 #2
> 
>   In particular, "ARM: shmobile: marzen: add USB EHCI driver support"
>   depends on "[PATCH 1/7] ARM: shmobile: r8a7779: PFC rename PENCx -> USB_PENCx"
> 
> * Patch 4 of this pull-request is a driver patch which is a dependency
>   of patches 6 and 7 of this pull-request. I have spoken to the driver
>   maintainer, Paul Mundt, and he has indicated that he thinks it
>   is best to merge all in one go.
> 
>   In more detail:
> 
>   "sh: clkfwk: add sh_clk_fsidiv_register()" is a dependency of
>   - "ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks"
>   - "ARM: shmobile: r8a7740: add FSI-DVI clocks"

I have found some problems with this pull-request,
I will send an revised one.


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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #2
@ 2012-11-08  6:29     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-08  6:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 08, 2012 at 10:27:29AM +0900, Simon Horman wrote:
> Hi Olof, Hi Arnd,
> 
> please consider the following board enhancements for 3.8.
> 
> * This pull-request is based on an earlier request which I
>   posted on the 1st and was merged yesterday: [GIT PULL v3] Renesas
>   ARM-based SoC boards for v3.8
> 
> * This pull request replaces the one that I sent yesterday:
>   [GIT PULL] Renesas ARM-based SoC boards for v3.8 #2
> 
> * Patch #2 of this series has a build-time dependency on
>   the soc pull request that I sent a few minutes ago:
>   [GIT PULL] Renesas ARM-based SoC for v3.8 #2
> 
>   In particular, "ARM: shmobile: marzen: add USB EHCI driver support"
>   depends on "[PATCH 1/7] ARM: shmobile: r8a7779: PFC rename PENCx -> USB_PENCx"
> 
> * Patch 4 of this pull-request is a driver patch which is a dependency
>   of patches 6 and 7 of this pull-request. I have spoken to the driver
>   maintainer, Paul Mundt, and he has indicated that he thinks it
>   is best to merge all in one go.
> 
>   In more detail:
> 
>   "sh: clkfwk: add sh_clk_fsidiv_register()" is a dependency of
>   - "ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks"
>   - "ARM: shmobile: r8a7740: add FSI-DVI clocks"

I have found some problems with this pull-request,
I will send an revised one.

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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #3
@ 2012-11-20  0:43   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-20  0:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Arnd,

Please consider the following board fix for 3.8.

The commit message for the patch has been revised since yesterday's
pull-request.

Also, please let me know if you would prefer me to supply
this as a fixes branch as we are now in the 3.7-rc6 timeframe
where I understand that non-fix commits are no longer allowed for 3.8.

This commit is based on the renesas/boards2 branch of the arm-soc tree.

----------------------------------------------------------------
The following changes since commit 12818d82ccad9868a820dbb193b4f9b797cd02d4:

  ARM: shmobile: use FSI driver's audio clock on ap4evb (2012-11-08 17:52:05 +0900)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards3

for you to fetch changes up to 3042ac5731e6db441dfce85612da4aa3913dab3b:

  ARM: shmobile: mackerel: Add FLCTL IRQ resource (2012-11-20 09:14:43 +0900)

----------------------------------------------------------------
Bastian Hecht (1):
      ARM: shmobile: mackerel: Add FLCTL IRQ resource

 arch/arm/mach-shmobile/board-mackerel.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #3
@ 2012-11-20  0:43   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-20  0:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof, Hi Arnd,

Please consider the following board fix for 3.8.

The commit message for the patch has been revised since yesterday's
pull-request.

Also, please let me know if you would prefer me to supply
this as a fixes branch as we are now in the 3.7-rc6 timeframe
where I understand that non-fix commits are no longer allowed for 3.8.

This commit is based on the renesas/boards2 branch of the arm-soc tree.

----------------------------------------------------------------
The following changes since commit 12818d82ccad9868a820dbb193b4f9b797cd02d4:

  ARM: shmobile: use FSI driver's audio clock on ap4evb (2012-11-08 17:52:05 +0900)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards3

for you to fetch changes up to 3042ac5731e6db441dfce85612da4aa3913dab3b:

  ARM: shmobile: mackerel: Add FLCTL IRQ resource (2012-11-20 09:14:43 +0900)

----------------------------------------------------------------
Bastian Hecht (1):
      ARM: shmobile: mackerel: Add FLCTL IRQ resource

 arch/arm/mach-shmobile/board-mackerel.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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

* [PATCH] ARM: shmobile: mackerel: Add FLCTL IRQ resource
  2012-11-20  0:43   ` Simon Horman
@ 2012-11-20  0:43     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-20  0:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bastian Hecht <hechtb@gmail.com>

Since commit 3c7ea4e (mtd: sh_flctl: Add support for error IRQ)
the sh_flctl driver requires the error IRQ line to signal failed
transactions between the flash controller and the NAND chip.
This information is mandatory - else the driver refuses to start
up. We provide it here for the board mackerel.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index bf2bcb9..3f56e70 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -950,7 +950,11 @@ static struct resource nand_flash_resources[] = {
 		.start	= 0xe6a30000,
 		.end	= 0xe6a3009b,
 		.flags	= IORESOURCE_MEM,
-	}
+	},
+	[1] = {
+		.start	= evt2irq(0x0d80), /* flstei: status error irq */
+		.flags	= IORESOURCE_IRQ,
+	},
 };
 
 static struct sh_flctl_platform_data nand_flash_data = {
-- 
1.7.10.4


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

* [PATCH] ARM: shmobile: mackerel: Add FLCTL IRQ resource
@ 2012-11-20  0:43     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2012-11-20  0:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bastian Hecht <hechtb@gmail.com>

Since commit 3c7ea4e (mtd: sh_flctl: Add support for error IRQ)
the sh_flctl driver requires the error IRQ line to signal failed
transactions between the flash controller and the NAND chip.
This information is mandatory - else the driver refuses to start
up. We provide it here for the board mackerel.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index bf2bcb9..3f56e70 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -950,7 +950,11 @@ static struct resource nand_flash_resources[] = {
 		.start	= 0xe6a30000,
 		.end	= 0xe6a3009b,
 		.flags	= IORESOURCE_MEM,
-	}
+	},
+	[1] = {
+		.start	= evt2irq(0x0d80), /* flstei: status error irq */
+		.flags	= IORESOURCE_IRQ,
+	},
 };
 
 static struct sh_flctl_platform_data nand_flash_data = {
-- 
1.7.10.4

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

* Re: [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #3
  2012-11-20  0:43   ` Simon Horman
@ 2012-11-21  7:21     ` Olof Johansson
  -1 siblings, 0 replies; 112+ messages in thread
From: Olof Johansson @ 2012-11-21  7:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 20, 2012 at 09:43:06AM +0900, Simon Horman wrote:
> Hi Olof, Hi Arnd,
> 
> Please consider the following board fix for 3.8.
> 
> The commit message for the patch has been revised since yesterday's
> pull-request.
> 
> Also, please let me know if you would prefer me to supply
> this as a fixes branch as we are now in the 3.7-rc6 timeframe
> where I understand that non-fix commits are no longer allowed for 3.8.
>
> This commit is based on the renesas/boards2 branch of the arm-soc tree.

It's not super-strictly "fixes only" at this point in the tree, but we really
want to make sure that we don't get any large pull requests from here on out.

For an update like this (adding one more patch on top of a previous branch),
this format is perfect since it allows us to just pull the same branch again,
really. So I've pulled this on top of the previous contents into next/boards2.


-Olof

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

* [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #3
@ 2012-11-21  7:21     ` Olof Johansson
  0 siblings, 0 replies; 112+ messages in thread
From: Olof Johansson @ 2012-11-21  7:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 20, 2012 at 09:43:06AM +0900, Simon Horman wrote:
> Hi Olof, Hi Arnd,
> 
> Please consider the following board fix for 3.8.
> 
> The commit message for the patch has been revised since yesterday's
> pull-request.
> 
> Also, please let me know if you would prefer me to supply
> this as a fixes branch as we are now in the 3.7-rc6 timeframe
> where I understand that non-fix commits are no longer allowed for 3.8.
>
> This commit is based on the renesas/boards2 branch of the arm-soc tree.

It's not super-strictly "fixes only" at this point in the tree, but we really
want to make sure that we don't get any large pull requests from here on out.

For an update like this (adding one more patch on top of a previous branch),
this format is perfect since it allows us to just pull the same branch again,
really. So I've pulled this on top of the previous contents into next/boards2.


-Olof

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-19  2:17   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd, Hi Olof,

The following changes since commit a9cc2c88aa9514296f868c9ea740b8addc7b8115:

  Merge branches 'soc' and 'pinmux' into boards-base (2013-03-18 21:26:33 +0900)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-boards-for-v3.10

for you to fetch changes up to 48296a13e7f411402f080d0603724623fa3eee14:

  ARM: shmobile: kzm9g: correct smsc regulator registration (2013-03-18 21:27:03 +0900)

----------------------------------------------------------------
Renesas ARM-based SoC board updates for v3.10

This is based on a merge of the following:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-pinmux-for-v3.10
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.10

----------------------------------------------------------------
Arnd Bergmann (1):
      ARM: shmobile: mark mackerel sh_mmcif_device __maybe_unused

Guennadi Liakhovetski (6):
      ARM: shmobile: use GPIO SD-card detection on armadillo800eva
      ARM: shmobile: switch SDHI0 to GPIO regulator on armadillo800eva
      ARM: shmobile: streamline mackerel SD and MMC devices
      ARM: shmobile: parse DT and configure pinmux early on kzm9g-reference
      ARM: shmobile: SDHI and MMCIF interfaces to kzm9g-reference
      ARM: shmobile: simplify kzm9g Kconfig dependencies

Kuninori Morimoto (1):
      ARM: shmobile: marzen: Use gic_iid macro for ICCIAR / interrupt ID

Simon Horman (5):
      ARM: shmobile: marzen: Reference DT implementation
      ARM: shmobile: kzm9g: Reference DT implementation
      ARM: shmobile: kzm9g: Remove warning about SMP
      ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START
      ARM: shmobile: kzm9g: correct smsc regulator registration

 arch/arm/boot/dts/Makefile                      |    2 +
 arch/arm/boot/dts/r8a7779-marzen-reference.dts  |   47 +++++++++
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts    |   77 +++++++++++++++
 arch/arm/mach-shmobile/Kconfig                  |   27 ++++++
 arch/arm/mach-shmobile/Makefile                 |    2 +
 arch/arm/mach-shmobile/board-armadillo800eva.c  |  111 ++++++++++++++++++----
 arch/arm/mach-shmobile/board-kzm9g-reference.c  |  108 +++++++++++++++++++++
 arch/arm/mach-shmobile/board-kzm9g.c            |    4 +-
 arch/arm/mach-shmobile/board-mackerel.c         |  115 ++++++++++++-----------
 arch/arm/mach-shmobile/board-marzen-reference.c |   75 +++++++++++++++
 arch/arm/mach-shmobile/board-marzen.c           |   12 +--
 11 files changed, 496 insertions(+), 84 deletions(-)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c
 create mode 100644 arch/arm/mach-shmobile/board-marzen-reference.c

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-19  2:17   ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd, Hi Olof,

The following changes since commit a9cc2c88aa9514296f868c9ea740b8addc7b8115:

  Merge branches 'soc' and 'pinmux' into boards-base (2013-03-18 21:26:33 +0900)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-boards-for-v3.10

for you to fetch changes up to 48296a13e7f411402f080d0603724623fa3eee14:

  ARM: shmobile: kzm9g: correct smsc regulator registration (2013-03-18 21:27:03 +0900)

----------------------------------------------------------------
Renesas ARM-based SoC board updates for v3.10

This is based on a merge of the following:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-pinmux-for-v3.10
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.10

----------------------------------------------------------------
Arnd Bergmann (1):
      ARM: shmobile: mark mackerel sh_mmcif_device __maybe_unused

Guennadi Liakhovetski (6):
      ARM: shmobile: use GPIO SD-card detection on armadillo800eva
      ARM: shmobile: switch SDHI0 to GPIO regulator on armadillo800eva
      ARM: shmobile: streamline mackerel SD and MMC devices
      ARM: shmobile: parse DT and configure pinmux early on kzm9g-reference
      ARM: shmobile: SDHI and MMCIF interfaces to kzm9g-reference
      ARM: shmobile: simplify kzm9g Kconfig dependencies

Kuninori Morimoto (1):
      ARM: shmobile: marzen: Use gic_iid macro for ICCIAR / interrupt ID

Simon Horman (5):
      ARM: shmobile: marzen: Reference DT implementation
      ARM: shmobile: kzm9g: Reference DT implementation
      ARM: shmobile: kzm9g: Remove warning about SMP
      ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START
      ARM: shmobile: kzm9g: correct smsc regulator registration

 arch/arm/boot/dts/Makefile                      |    2 +
 arch/arm/boot/dts/r8a7779-marzen-reference.dts  |   47 +++++++++
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts    |   77 +++++++++++++++
 arch/arm/mach-shmobile/Kconfig                  |   27 ++++++
 arch/arm/mach-shmobile/Makefile                 |    2 +
 arch/arm/mach-shmobile/board-armadillo800eva.c  |  111 ++++++++++++++++++----
 arch/arm/mach-shmobile/board-kzm9g-reference.c  |  108 +++++++++++++++++++++
 arch/arm/mach-shmobile/board-kzm9g.c            |    4 +-
 arch/arm/mach-shmobile/board-mackerel.c         |  115 ++++++++++++-----------
 arch/arm/mach-shmobile/board-marzen-reference.c |   75 +++++++++++++++
 arch/arm/mach-shmobile/board-marzen.c           |   12 +--
 11 files changed, 496 insertions(+), 84 deletions(-)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c
 create mode 100644 arch/arm/mach-shmobile/board-marzen-reference.c

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

* [PATCH 01/13] ARM: shmobile: use GPIO SD-card detection on armadillo800eva
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Switch SDHI0 and SDHI1 SD-card interfaces on armadillo800eva to using GPIO
card detection, which provides maximum power saving and automatically
selects IRQ or polling mode, depending on the CD GPIO capability.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 04eff93..60694e8 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -579,10 +579,10 @@ static struct regulator_consumer_supply fixed3v3_power_consumers[]  static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
-	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
-			  MMC_CAP_NEEDS_POLL,
+	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
+	.cd_gpio	= GPIO_PORT167,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -623,7 +623,9 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
+	/* Port72 cannot generate IRQs, will be used in polling mode. */
+	.cd_gpio	= GPIO_PORT72,
 };
 
 static struct resource sdhi1_resources[] = {
-- 
1.7.10.4


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

* [PATCH 01/13] ARM: shmobile: use GPIO SD-card detection on armadillo800eva
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Switch SDHI0 and SDHI1 SD-card interfaces on armadillo800eva to using GPIO
card detection, which provides maximum power saving and automatically
selects IRQ or polling mode, depending on the CD GPIO capability.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 04eff93..60694e8 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -579,10 +579,10 @@ static struct regulator_consumer_supply fixed3v3_power_consumers[] =
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
-	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
-			  MMC_CAP_NEEDS_POLL,
+	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
+	.cd_gpio	= GPIO_PORT167,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -623,7 +623,9 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
+	/* Port72 cannot generate IRQs, will be used in polling mode. */
+	.cd_gpio	= GPIO_PORT72,
 };
 
 static struct resource sdhi1_resources[] = {
-- 
1.7.10.4

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

* [PATCH 02/13] ARM: shmobile: switch SDHI0 to GPIO regulator on armadillo800eva
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

When regulators are used with MMC devices, explicitly provided OCR masks
are ignored, they can be removed from platform data. Also switch SDHI0
from fixed regulator with hard-wired GPIO levels to a proper GPIO regulator
instance to enable dynamic voltage switching.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |  101 ++++++++++++++++++++----
 1 file changed, 86 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 60694e8..f322a18 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -28,8 +28,10 @@
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
+#include <linux/regulator/driver.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/regulator/fixed.h>
+#include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
 #include <linux/sh_eth.h>
 #include <linux/videodev2.h>
@@ -555,17 +557,94 @@ static struct platform_device gpio_keys_device = {
 	},
 };
 
-/* Fixed 3.3V regulator to be used by SDHI0, SDHI1, MMCIF */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] -{
-	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
-	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
+/* Fixed 3.3V regulator to be used by SDHI1, MMCIF */
+static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
 	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
 	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
 	REGULATOR_SUPPLY("vmmc", "sh_mmcif"),
 	REGULATOR_SUPPLY("vqmmc", "sh_mmcif"),
 };
 
+/* Fixed 3.3V regulator to be used by SDHI0 */
+static struct regulator_consumer_supply vcc_sdhi0_consumers[] = {
+	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
+};
+
+static struct regulator_init_data vcc_sdhi0_init_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
+	.consumer_supplies      = vcc_sdhi0_consumers,
+};
+
+static struct fixed_voltage_config vcc_sdhi0_info = {
+	.supply_name = "SDHI0 Vcc",
+	.microvolts = 3300000,
+	.gpio = GPIO_PORT75,
+	.enable_high = 1,
+	.init_data = &vcc_sdhi0_init_data,
+};
+
+static struct platform_device vcc_sdhi0 = {
+	.name = "reg-fixed-voltage",
+	.id   = 1,
+	.dev  = {
+		.platform_data = &vcc_sdhi0_info,
+	},
+};
+
+/* 1.8 / 3.3V SDHI0 VccQ regulator */
+static struct regulator_consumer_supply vccq_sdhi0_consumers[] = {
+	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
+};
+
+static struct regulator_init_data vccq_sdhi0_init_data = {
+	.constraints = {
+		.input_uV	= 3300000,
+		.min_uV		= 1800000,
+		.max_uV         = 3300000,
+		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+				  REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies  = ARRAY_SIZE(vccq_sdhi0_consumers),
+	.consumer_supplies      = vccq_sdhi0_consumers,
+};
+
+static struct gpio vccq_sdhi0_gpios[] = {
+	{GPIO_PORT17, GPIOF_OUT_INIT_LOW, "vccq-sdhi0" },
+};
+
+static struct gpio_regulator_state vccq_sdhi0_states[] = {
+	{ .value = 3300000, .gpios = (0 << 0) },
+	{ .value = 1800000, .gpios = (1 << 0) },
+};
+
+static struct gpio_regulator_config vccq_sdhi0_info = {
+	.supply_name = "vqmmc",
+
+	.enable_gpio = GPIO_PORT74,
+	.enable_high = 1,
+	.enabled_at_boot = 0,
+
+	.gpios = vccq_sdhi0_gpios,
+	.nr_gpios = ARRAY_SIZE(vccq_sdhi0_gpios),
+
+	.states = vccq_sdhi0_states,
+	.nr_states = ARRAY_SIZE(vccq_sdhi0_states),
+
+	.type = REGULATOR_VOLTAGE,
+	.init_data = &vccq_sdhi0_init_data,
+};
+
+static struct platform_device vccq_sdhi0 = {
+	.name = "gpio-regulator",
+	.id   = -1,
+	.dev  = {
+		.platform_data = &vccq_sdhi0_info,
+	},
+};
+
 /* SDHI0 */
 /*
  * FIXME
@@ -580,7 +659,6 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
 	.cd_gpio	= GPIO_PORT167,
 };
@@ -622,7 +700,6 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
 	/* Port72 cannot generate IRQs, will be used in polling mode. */
 	.cd_gpio	= GPIO_PORT72,
@@ -673,7 +750,6 @@ static const struct pinctrl_map eva_sdhi1_pinctrl_map[] = {
 /* MMCIF */
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.sup_pclk	= 0,
-	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NONREMOVABLE,
@@ -926,6 +1002,8 @@ static struct platform_device *eva_devices[] __initdata = {
 	&fsi_wm8978_device,
 	&fsi_hdmi_device,
 	&i2c_gpio_device,
+	&vcc_sdhi0,
+	&vccq_sdhi0,
 };
 
 static const struct pinctrl_map eva_pinctrl_map[] = {
@@ -1060,13 +1138,6 @@ static void __init eva_init(void)
 		usb = &usbhsf_device;
 	}
 
-	/* SDHI0 */
-	gpio_request_one(17, GPIOF_OUT_INIT_LOW, NULL);  /* SDHI0_18/33_B */
-	gpio_request_one(74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
-	gpio_request_one(75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
-
-	/* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
-
 	/* CEU0 */
 	gpio_request(GPIO_FN_VIO0_D7,		NULL);
 	gpio_request(GPIO_FN_VIO0_D6,		NULL);
-- 
1.7.10.4


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

* [PATCH 02/13] ARM: shmobile: switch SDHI0 to GPIO regulator on armadillo800eva
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

When regulators are used with MMC devices, explicitly provided OCR masks
are ignored, they can be removed from platform data. Also switch SDHI0
from fixed regulator with hard-wired GPIO levels to a proper GPIO regulator
instance to enable dynamic voltage switching.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c |  101 ++++++++++++++++++++----
 1 file changed, 86 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 60694e8..f322a18 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -28,8 +28,10 @@
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
+#include <linux/regulator/driver.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/regulator/fixed.h>
+#include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
 #include <linux/sh_eth.h>
 #include <linux/videodev2.h>
@@ -555,17 +557,94 @@ static struct platform_device gpio_keys_device = {
 	},
 };
 
-/* Fixed 3.3V regulator to be used by SDHI0, SDHI1, MMCIF */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
-{
-	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
-	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
+/* Fixed 3.3V regulator to be used by SDHI1, MMCIF */
+static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
 	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
 	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
 	REGULATOR_SUPPLY("vmmc", "sh_mmcif"),
 	REGULATOR_SUPPLY("vqmmc", "sh_mmcif"),
 };
 
+/* Fixed 3.3V regulator to be used by SDHI0 */
+static struct regulator_consumer_supply vcc_sdhi0_consumers[] = {
+	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
+};
+
+static struct regulator_init_data vcc_sdhi0_init_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
+	.consumer_supplies      = vcc_sdhi0_consumers,
+};
+
+static struct fixed_voltage_config vcc_sdhi0_info = {
+	.supply_name = "SDHI0 Vcc",
+	.microvolts = 3300000,
+	.gpio = GPIO_PORT75,
+	.enable_high = 1,
+	.init_data = &vcc_sdhi0_init_data,
+};
+
+static struct platform_device vcc_sdhi0 = {
+	.name = "reg-fixed-voltage",
+	.id   = 1,
+	.dev  = {
+		.platform_data = &vcc_sdhi0_info,
+	},
+};
+
+/* 1.8 / 3.3V SDHI0 VccQ regulator */
+static struct regulator_consumer_supply vccq_sdhi0_consumers[] = {
+	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
+};
+
+static struct regulator_init_data vccq_sdhi0_init_data = {
+	.constraints = {
+		.input_uV	= 3300000,
+		.min_uV		= 1800000,
+		.max_uV         = 3300000,
+		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+				  REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies  = ARRAY_SIZE(vccq_sdhi0_consumers),
+	.consumer_supplies      = vccq_sdhi0_consumers,
+};
+
+static struct gpio vccq_sdhi0_gpios[] = {
+	{GPIO_PORT17, GPIOF_OUT_INIT_LOW, "vccq-sdhi0" },
+};
+
+static struct gpio_regulator_state vccq_sdhi0_states[] = {
+	{ .value = 3300000, .gpios = (0 << 0) },
+	{ .value = 1800000, .gpios = (1 << 0) },
+};
+
+static struct gpio_regulator_config vccq_sdhi0_info = {
+	.supply_name = "vqmmc",
+
+	.enable_gpio = GPIO_PORT74,
+	.enable_high = 1,
+	.enabled_at_boot = 0,
+
+	.gpios = vccq_sdhi0_gpios,
+	.nr_gpios = ARRAY_SIZE(vccq_sdhi0_gpios),
+
+	.states = vccq_sdhi0_states,
+	.nr_states = ARRAY_SIZE(vccq_sdhi0_states),
+
+	.type = REGULATOR_VOLTAGE,
+	.init_data = &vccq_sdhi0_init_data,
+};
+
+static struct platform_device vccq_sdhi0 = {
+	.name = "gpio-regulator",
+	.id   = -1,
+	.dev  = {
+		.platform_data = &vccq_sdhi0_info,
+	},
+};
+
 /* SDHI0 */
 /*
  * FIXME
@@ -580,7 +659,6 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
 	.cd_gpio	= GPIO_PORT167,
 };
@@ -622,7 +700,6 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.tmio_ocr_mask	= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
 	/* Port72 cannot generate IRQs, will be used in polling mode. */
 	.cd_gpio	= GPIO_PORT72,
@@ -673,7 +750,6 @@ static const struct pinctrl_map eva_sdhi1_pinctrl_map[] = {
 /* MMCIF */
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.sup_pclk	= 0,
-	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NONREMOVABLE,
@@ -926,6 +1002,8 @@ static struct platform_device *eva_devices[] __initdata = {
 	&fsi_wm8978_device,
 	&fsi_hdmi_device,
 	&i2c_gpio_device,
+	&vcc_sdhi0,
+	&vccq_sdhi0,
 };
 
 static const struct pinctrl_map eva_pinctrl_map[] = {
@@ -1060,13 +1138,6 @@ static void __init eva_init(void)
 		usb = &usbhsf_device;
 	}
 
-	/* SDHI0 */
-	gpio_request_one(17, GPIOF_OUT_INIT_LOW, NULL);  /* SDHI0_18/33_B */
-	gpio_request_one(74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
-	gpio_request_one(75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */
-
-	/* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
-
 	/* CEU0 */
 	gpio_request(GPIO_FN_VIO0_D7,		NULL);
 	gpio_request(GPIO_FN_VIO0_D6,		NULL);
-- 
1.7.10.4

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

* [PATCH 03/13] ARM: shmobile: streamline mackerel SD and MMC devices
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

This patch fixes the following issues with SD and MMC interfaces on mackerel:
1. replace custom card-detection functions with standard GPIO CD API
2. resources don't have to be numbered
3. add SDHI interrupt names
4. remove OCR masks, where regulators are used
5. only specify SDHI CD interrupts on interfaces where a CD pin is present -
   SDHI0
6. don't instantiate an MMCIF device and initialise MMCIF pins if SDHI1 is
   selected

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c |  113 ++++++++++++++++---------------
 1 file changed, 57 insertions(+), 56 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 336ccb4..fb058c7 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -963,15 +963,6 @@ static struct platform_device nand_flash_device = {
 	},
 };
 
-/*
- * The card detect pin of the top SD/MMC slot (CN7) is active low and is
- * connected to GPIO A22 of SH7372 (GPIO 41).
- */
-static int slot_cn7_get_cd(struct platform_device *pdev)
-{
-	return !gpio_get_value(41);
-}
-
 /* SDHI0 */
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
@@ -982,21 +973,21 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 };
 
 static struct resource sdhi0_resources[] = {
-	[0] = {
+	{
 		.name	= "SDHI0",
 		.start	= 0xe6850000,
 		.end	= 0xe68500ff,
 		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
+	}, {
+		.name	= SH_MOBILE_SDHI_IRQ_CARD_DETECT,
 		.start	= evt2irq(0x0e00) /* SDHI0_SDHI0I0 */,
 		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
+	}, {
+		.name	= SH_MOBILE_SDHI_IRQ_SDCARD,
 		.start	= evt2irq(0x0e20) /* SDHI0_SDHI0I1 */,
 		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
+	}, {
+		.name	= SH_MOBILE_SDHI_IRQ_SDIO,
 		.start	= evt2irq(0x0e40) /* SDHI0_SDHI0I2 */,
 		.flags	= IORESOURCE_IRQ,
 	},
@@ -1014,34 +1005,28 @@ static struct platform_device sdhi0_device = {
 
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 /* SDHI1 */
+
+/* GPIO_PORT41 can trigger IRQ8, but it is used by USBHS1, we have to poll */
 static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
-	.tmio_ocr_mask	= MMC_VDD_165_195,
-	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_USE_GPIO_CD,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= slot_cn7_get_cd,
+	.cd_gpio	= GPIO_PORT41,
 };
 
 static struct resource sdhi1_resources[] = {
-	[0] = {
+	{
 		.name	= "SDHI1",
 		.start	= 0xe6860000,
 		.end	= 0xe68600ff,
 		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= SH_MOBILE_SDHI_IRQ_CARD_DETECT,
-		.start	= evt2irq(0x0e80), /* SDHI1_SDHI1I0 */
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDCARD,
 		.start	= evt2irq(0x0ea0), /* SDHI1_SDHI1I1 */
 		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDIO,
 		.start	= evt2irq(0x0ec0), /* SDHI1_SDHI1I2 */
 		.flags	= IORESOURCE_IRQ,
@@ -1059,43 +1044,32 @@ static struct platform_device sdhi1_device = {
 };
 #endif
 
+/* SDHI2 */
+
 /*
  * The card detect pin of the top SD/MMC slot (CN23) is active low and is
- * connected to GPIO SCIFB_SCK of SH7372 (162).
+ * connected to GPIO SCIFB_SCK of SH7372 (GPIO_PORT162).
  */
-static int slot_cn23_get_cd(struct platform_device *pdev)
-{
-	return !gpio_get_value(162);
-}
-
-/* SDHI2 */
 static struct sh_mobile_sdhi_info sdhi2_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI2_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI2_RX,
-	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_USE_GPIO_CD,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= slot_cn23_get_cd,
+	.cd_gpio	= GPIO_PORT162,
 };
 
 static struct resource sdhi2_resources[] = {
-	[0] = {
+	{
 		.name	= "SDHI2",
 		.start	= 0xe6870000,
 		.end	= 0xe68700ff,
 		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= SH_MOBILE_SDHI_IRQ_CARD_DETECT,
-		.start	= evt2irq(0x1200), /* SDHI2_SDHI2I0 */
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDCARD,
 		.start	= evt2irq(0x1220), /* SDHI2_SDHI2I1 */
 		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDIO,
 		.start	= evt2irq(0x1240), /* SDHI2_SDHI2I2 */
 		.flags	= IORESOURCE_IRQ,
@@ -1134,11 +1108,12 @@ static struct resource sh_mmcif_resources[] = {
 
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.sup_pclk	= 0,
-	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= slot_cn7_get_cd,
+	.use_cd_gpio	= true,
+	/* card detect pin for SD/MMC slot (CN7) */
+	.cd_gpio	= GPIO_PORT41,
 	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
 	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
@@ -1263,9 +1238,10 @@ static struct platform_device *mackerel_devices[] __initdata = {
 	&sdhi0_device,
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 	&sdhi1_device,
+#else
+	&sh_mmcif_device,
 #endif
 	&sdhi2_device,
-	&sh_mmcif_device,
 	&ceu_device,
 	&mackerel_camera,
 	&hdmi_device,
@@ -1372,10 +1348,11 @@ static void __init mackerel_init(void)
 		{ "A3SP", &usbhs0_device, },
 		{ "A3SP", &usbhs1_device, },
 		{ "A3SP", &nand_flash_device, },
-		{ "A3SP", &sh_mmcif_device, },
 		{ "A3SP", &sdhi0_device, },
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 		{ "A3SP", &sdhi1_device, },
+#else
+		{ "A3SP", &sh_mmcif_device, },
 #endif
 		{ "A3SP", &sdhi2_device, },
 		{ "A4R", &ceu_device, },
@@ -1486,11 +1463,35 @@ static void __init mackerel_init(void)
 	/* SDHI0 PORT172 card-detect IRQ26 */
 	gpio_request(GPIO_FN_IRQ26_172, NULL);
 
-	/* card detect pin for MMC slot (CN7) */
-	gpio_request_one(41, GPIOF_IN, NULL);
+#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
+	/* enable SDHI1 */
+	gpio_request(GPIO_FN_SDHICMD1, NULL);
+	gpio_request(GPIO_FN_SDHICLK1, NULL);
+	gpio_request(GPIO_FN_SDHID1_3, NULL);
+	gpio_request(GPIO_FN_SDHID1_2, NULL);
+	gpio_request(GPIO_FN_SDHID1_1, NULL);
+	gpio_request(GPIO_FN_SDHID1_0, NULL);
+#else
+	/* MMCIF */
+	gpio_request(GPIO_FN_MMCD0_0, NULL);
+	gpio_request(GPIO_FN_MMCD0_1, NULL);
+	gpio_request(GPIO_FN_MMCD0_2, NULL);
+	gpio_request(GPIO_FN_MMCD0_3, NULL);
+	gpio_request(GPIO_FN_MMCD0_4, NULL);
+	gpio_request(GPIO_FN_MMCD0_5, NULL);
+	gpio_request(GPIO_FN_MMCD0_6, NULL);
+	gpio_request(GPIO_FN_MMCD0_7, NULL);
+	gpio_request(GPIO_FN_MMCCMD0, NULL);
+	gpio_request(GPIO_FN_MMCCLK0, NULL);
+#endif
 
-	/* card detect pin for microSD slot (CN23) */
-	gpio_request_one(162, GPIOF_IN, NULL);
+	/* enable SDHI2 */
+	gpio_request(GPIO_FN_SDHICMD2, NULL);
+	gpio_request(GPIO_FN_SDHICLK2, NULL);
+	gpio_request(GPIO_FN_SDHID2_3, NULL);
+	gpio_request(GPIO_FN_SDHID2_2, NULL);
+	gpio_request(GPIO_FN_SDHID2_1, NULL);
+	gpio_request(GPIO_FN_SDHID2_0, NULL);
 
 	/* FLCTL */
 	gpio_request(GPIO_FN_D0_NAF0, NULL);
-- 
1.7.10.4


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

* [PATCH 03/13] ARM: shmobile: streamline mackerel SD and MMC devices
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

This patch fixes the following issues with SD and MMC interfaces on mackerel:
1. replace custom card-detection functions with standard GPIO CD API
2. resources don't have to be numbered
3. add SDHI interrupt names
4. remove OCR masks, where regulators are used
5. only specify SDHI CD interrupts on interfaces where a CD pin is present -
   SDHI0
6. don't instantiate an MMCIF device and initialise MMCIF pins if SDHI1 is
   selected

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c |  113 ++++++++++++++++---------------
 1 file changed, 57 insertions(+), 56 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 336ccb4..fb058c7 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -963,15 +963,6 @@ static struct platform_device nand_flash_device = {
 	},
 };
 
-/*
- * The card detect pin of the top SD/MMC slot (CN7) is active low and is
- * connected to GPIO A22 of SH7372 (GPIO 41).
- */
-static int slot_cn7_get_cd(struct platform_device *pdev)
-{
-	return !gpio_get_value(41);
-}
-
 /* SDHI0 */
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
@@ -982,21 +973,21 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 };
 
 static struct resource sdhi0_resources[] = {
-	[0] = {
+	{
 		.name	= "SDHI0",
 		.start	= 0xe6850000,
 		.end	= 0xe68500ff,
 		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
+	}, {
+		.name	= SH_MOBILE_SDHI_IRQ_CARD_DETECT,
 		.start	= evt2irq(0x0e00) /* SDHI0_SDHI0I0 */,
 		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
+	}, {
+		.name	= SH_MOBILE_SDHI_IRQ_SDCARD,
 		.start	= evt2irq(0x0e20) /* SDHI0_SDHI0I1 */,
 		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
+	}, {
+		.name	= SH_MOBILE_SDHI_IRQ_SDIO,
 		.start	= evt2irq(0x0e40) /* SDHI0_SDHI0I2 */,
 		.flags	= IORESOURCE_IRQ,
 	},
@@ -1014,34 +1005,28 @@ static struct platform_device sdhi0_device = {
 
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 /* SDHI1 */
+
+/* GPIO_PORT41 can trigger IRQ8, but it is used by USBHS1, we have to poll */
 static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
-	.tmio_ocr_mask	= MMC_VDD_165_195,
-	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_USE_GPIO_CD,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= slot_cn7_get_cd,
+	.cd_gpio	= GPIO_PORT41,
 };
 
 static struct resource sdhi1_resources[] = {
-	[0] = {
+	{
 		.name	= "SDHI1",
 		.start	= 0xe6860000,
 		.end	= 0xe68600ff,
 		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= SH_MOBILE_SDHI_IRQ_CARD_DETECT,
-		.start	= evt2irq(0x0e80), /* SDHI1_SDHI1I0 */
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDCARD,
 		.start	= evt2irq(0x0ea0), /* SDHI1_SDHI1I1 */
 		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDIO,
 		.start	= evt2irq(0x0ec0), /* SDHI1_SDHI1I2 */
 		.flags	= IORESOURCE_IRQ,
@@ -1059,43 +1044,32 @@ static struct platform_device sdhi1_device = {
 };
 #endif
 
+/* SDHI2 */
+
 /*
  * The card detect pin of the top SD/MMC slot (CN23) is active low and is
- * connected to GPIO SCIFB_SCK of SH7372 (162).
+ * connected to GPIO SCIFB_SCK of SH7372 (GPIO_PORT162).
  */
-static int slot_cn23_get_cd(struct platform_device *pdev)
-{
-	return !gpio_get_value(162);
-}
-
-/* SDHI2 */
 static struct sh_mobile_sdhi_info sdhi2_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI2_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI2_RX,
-	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_USE_GPIO_CD,
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= slot_cn23_get_cd,
+	.cd_gpio	= GPIO_PORT162,
 };
 
 static struct resource sdhi2_resources[] = {
-	[0] = {
+	{
 		.name	= "SDHI2",
 		.start	= 0xe6870000,
 		.end	= 0xe68700ff,
 		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= SH_MOBILE_SDHI_IRQ_CARD_DETECT,
-		.start	= evt2irq(0x1200), /* SDHI2_SDHI2I0 */
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDCARD,
 		.start	= evt2irq(0x1220), /* SDHI2_SDHI2I1 */
 		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
+	}, {
 		.name	= SH_MOBILE_SDHI_IRQ_SDIO,
 		.start	= evt2irq(0x1240), /* SDHI2_SDHI2I2 */
 		.flags	= IORESOURCE_IRQ,
@@ -1134,11 +1108,12 @@ static struct resource sh_mmcif_resources[] = {
 
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.sup_pclk	= 0,
-	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= slot_cn7_get_cd,
+	.use_cd_gpio	= true,
+	/* card detect pin for SD/MMC slot (CN7) */
+	.cd_gpio	= GPIO_PORT41,
 	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
 	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
@@ -1263,9 +1238,10 @@ static struct platform_device *mackerel_devices[] __initdata = {
 	&sdhi0_device,
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 	&sdhi1_device,
+#else
+	&sh_mmcif_device,
 #endif
 	&sdhi2_device,
-	&sh_mmcif_device,
 	&ceu_device,
 	&mackerel_camera,
 	&hdmi_device,
@@ -1372,10 +1348,11 @@ static void __init mackerel_init(void)
 		{ "A3SP", &usbhs0_device, },
 		{ "A3SP", &usbhs1_device, },
 		{ "A3SP", &nand_flash_device, },
-		{ "A3SP", &sh_mmcif_device, },
 		{ "A3SP", &sdhi0_device, },
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 		{ "A3SP", &sdhi1_device, },
+#else
+		{ "A3SP", &sh_mmcif_device, },
 #endif
 		{ "A3SP", &sdhi2_device, },
 		{ "A4R", &ceu_device, },
@@ -1486,11 +1463,35 @@ static void __init mackerel_init(void)
 	/* SDHI0 PORT172 card-detect IRQ26 */
 	gpio_request(GPIO_FN_IRQ26_172, NULL);
 
-	/* card detect pin for MMC slot (CN7) */
-	gpio_request_one(41, GPIOF_IN, NULL);
+#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
+	/* enable SDHI1 */
+	gpio_request(GPIO_FN_SDHICMD1, NULL);
+	gpio_request(GPIO_FN_SDHICLK1, NULL);
+	gpio_request(GPIO_FN_SDHID1_3, NULL);
+	gpio_request(GPIO_FN_SDHID1_2, NULL);
+	gpio_request(GPIO_FN_SDHID1_1, NULL);
+	gpio_request(GPIO_FN_SDHID1_0, NULL);
+#else
+	/* MMCIF */
+	gpio_request(GPIO_FN_MMCD0_0, NULL);
+	gpio_request(GPIO_FN_MMCD0_1, NULL);
+	gpio_request(GPIO_FN_MMCD0_2, NULL);
+	gpio_request(GPIO_FN_MMCD0_3, NULL);
+	gpio_request(GPIO_FN_MMCD0_4, NULL);
+	gpio_request(GPIO_FN_MMCD0_5, NULL);
+	gpio_request(GPIO_FN_MMCD0_6, NULL);
+	gpio_request(GPIO_FN_MMCD0_7, NULL);
+	gpio_request(GPIO_FN_MMCCMD0, NULL);
+	gpio_request(GPIO_FN_MMCCLK0, NULL);
+#endif
 
-	/* card detect pin for microSD slot (CN23) */
-	gpio_request_one(162, GPIOF_IN, NULL);
+	/* enable SDHI2 */
+	gpio_request(GPIO_FN_SDHICMD2, NULL);
+	gpio_request(GPIO_FN_SDHICLK2, NULL);
+	gpio_request(GPIO_FN_SDHID2_3, NULL);
+	gpio_request(GPIO_FN_SDHID2_2, NULL);
+	gpio_request(GPIO_FN_SDHID2_1, NULL);
+	gpio_request(GPIO_FN_SDHID2_0, NULL);
 
 	/* FLCTL */
 	gpio_request(GPIO_FN_D0_NAF0, NULL);
-- 
1.7.10.4

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

* [PATCH 04/13] ARM: shmobile: mark mackerel sh_mmcif_device __maybe_unused
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Arnd Bergmann <arnd@arndb.de>

Patch eac036ef9e "ARM: shmobile: streamline mackerel SD and MMC devices"
made the use of the sh_mmcif_device variable for mackarel optional,
but the definition is always provided, causing a build warning.

arch/arm/mach-shmobile/board-mackerel.c:1120:31: warning: 'sh_mmcif_device'
	defined but not used [-Wunused-variable]

Marking the variable as __maybe_unused will do the right thing here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index fb058c7..ef22ec4 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1118,7 +1118,7 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
 
-static struct platform_device sh_mmcif_device = {
+static struct platform_device sh_mmcif_device __maybe_unused = {
 	.name		= "sh_mmcif",
 	.id		= 0,
 	.dev		= {
-- 
1.7.10.4


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

* [PATCH 04/13] ARM: shmobile: mark mackerel sh_mmcif_device __maybe_unused
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Arnd Bergmann <arnd@arndb.de>

Patch eac036ef9e "ARM: shmobile: streamline mackerel SD and MMC devices"
made the use of the sh_mmcif_device variable for mackarel optional,
but the definition is always provided, causing a build warning.

arch/arm/mach-shmobile/board-mackerel.c:1120:31: warning: 'sh_mmcif_device'
	defined but not used [-Wunused-variable]

Marking the variable as __maybe_unused will do the right thing here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index fb058c7..ef22ec4 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1118,7 +1118,7 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
 
-static struct platform_device sh_mmcif_device = {
+static struct platform_device sh_mmcif_device __maybe_unused = {
 	.name		= "sh_mmcif",
 	.id		= 0,
 	.dev		= {
-- 
1.7.10.4

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

* [PATCH 05/13] ARM: shmobile: marzen: Reference DT implementation
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Provide alternate board code for the marzen to demonstrate
how DT may be used given the current state of driver
device tree support. This is intended to act as a reference
for mach-shmobile developers.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                      |    1 +
 arch/arm/boot/dts/r8a7779-marzen-reference.dts  |   47 ++++++++++++++
 arch/arm/mach-shmobile/Kconfig                  |   13 ++++
 arch/arm/mach-shmobile/Makefile                 |    1 +
 arch/arm/mach-shmobile/board-marzen-reference.c |   75 +++++++++++++++++++++++
 5 files changed, 137 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-marzen-reference.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c62558..7965b9a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -136,6 +136,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
 	ccu9540.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
+	r8a7779-marzen-reference.dtb \
 	sh73a0-kzm9g.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
new file mode 100644
index 0000000..72be4c8
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
@@ -0,0 +1,47 @@
+/*
+ * Reference Device Tree Source for the Marzen board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r8a7779.dtsi"
+
+/ {
+	model = "marzen";
+	compatible = "renesas,marzen-reference", "renesas,r8a7779";
+
+	chosen {
+		bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x60000000 0x40000000>;
+	};
+
+	fixedregulator3v3: fixedregulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	lan0@18000000 {
+		compatible = "smsc,lan9220", "smsc,lan9115";
+		reg = <0x18000000 0x100>;
+		phy-mode = "mii";
+		interrupt-parent = <&gic>;
+		interrupts = <0 28 0x4>;
+		reg-io-width = <4>;
+		vddvario-supply = <&fixedregulator3v3>;
+		vdd33a-supply = <&fixedregulator3v3>;
+	};
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 9255546..b15d4ff 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -102,6 +102,19 @@ config MACH_MARZEN
 	select ARCH_REQUIRE_GPIOLIB
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
+config MACH_MARZEN_REFERENCE
+	bool "MARZEN board - Reference Device Tree Implementation"
+	depends on ARCH_R8A7779
+	select ARCH_REQUIRE_GPIOLIB
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+	select USE_OF
+	---help---
+	   Use reference implementation of Marzen board support
+	   which makes use of device tree at the expense
+	   of not supporting a number of devices.
+
+	   This is intended to aid developers
+
 config MACH_KZM9D
 	bool "KZM9D board"
 	depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index b646ff4..3705d4f 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_MACH_MACKEREL)	+= board-mackerel.o
 obj-$(CONFIG_MACH_KOTA2)	+= board-kota2.o
 obj-$(CONFIG_MACH_BONITO)	+= board-bonito.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
+obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
new file mode 100644
index 0000000..480d882
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -0,0 +1,75 @@
+/*
+ * marzen board support - Reference DT implementation
+ *
+ * Copyright (C) 2011  Renesas Solutions Corp.
+ * Copyright (C) 2011  Magnus Damm
+ * Copyright (C) 2013  Simon Horman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/pinctrl/machine.h>
+#include <mach/r8a7779.h>
+#include <mach/common.h>
+#include <mach/irqs.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+
+static const struct pinctrl_map marzen_pinctrl_map[] = {
+	/* SCIF2 (CN18: DEBUG0) */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779",
+				  "scif2_data_c", "scif2"),
+	/* SCIF4 (CN19: DEBUG1) */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779",
+				  "scif4_data", "scif4"),
+	/* SDHI0 */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_data4", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_ctrl", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_cd", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_wp", "sdhi0"),
+	/* SMSC */
+	PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
+				  "intc_irq1_b", "intc"),
+	PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
+				  "lbsc_ex_cs0", "lbsc"),
+};
+
+static void __init marzen_init(void)
+{
+	pinctrl_register_mappings(marzen_pinctrl_map,
+				  ARRAY_SIZE(marzen_pinctrl_map));
+	r8a7779_pinmux_init();
+
+	r8a7779_add_standard_devices_dt();
+}
+
+static const char *marzen_boards_compat_dt[] __initdata = {
+	"renesas,marzen-reference",
+	NULL,
+};
+
+DT_MACHINE_START(MARZEN, "marzen")
+	.smp		= smp_ops(r8a7779_smp_ops),
+	.map_io		= r8a7779_map_io,
+	.init_early	= r8a7779_init_delay,
+	.nr_irqs	= NR_IRQS_LEGACY,
+	.init_irq	= r8a7779_init_irq_dt,
+	.init_machine	= marzen_init,
+	.init_time	= shmobile_timer_init,
+	.dt_compat	= marzen_boards_compat_dt,
+MACHINE_END
-- 
1.7.10.4


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

* [PATCH 05/13] ARM: shmobile: marzen: Reference DT implementation
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Provide alternate board code for the marzen to demonstrate
how DT may be used given the current state of driver
device tree support. This is intended to act as a reference
for mach-shmobile developers.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                      |    1 +
 arch/arm/boot/dts/r8a7779-marzen-reference.dts  |   47 ++++++++++++++
 arch/arm/mach-shmobile/Kconfig                  |   13 ++++
 arch/arm/mach-shmobile/Makefile                 |    1 +
 arch/arm/mach-shmobile/board-marzen-reference.c |   75 +++++++++++++++++++++++
 5 files changed, 137 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-marzen-reference.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c62558..7965b9a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -136,6 +136,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
 	ccu9540.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
+	r8a7779-marzen-reference.dtb \
 	sh73a0-kzm9g.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
new file mode 100644
index 0000000..72be4c8
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
@@ -0,0 +1,47 @@
+/*
+ * Reference Device Tree Source for the Marzen board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r8a7779.dtsi"
+
+/ {
+	model = "marzen";
+	compatible = "renesas,marzen-reference", "renesas,r8a7779";
+
+	chosen {
+		bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x60000000 0x40000000>;
+	};
+
+	fixedregulator3v3: fixedregulator at 0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	lan0 at 18000000 {
+		compatible = "smsc,lan9220", "smsc,lan9115";
+		reg = <0x18000000 0x100>;
+		phy-mode = "mii";
+		interrupt-parent = <&gic>;
+		interrupts = <0 28 0x4>;
+		reg-io-width = <4>;
+		vddvario-supply = <&fixedregulator3v3>;
+		vdd33a-supply = <&fixedregulator3v3>;
+	};
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 9255546..b15d4ff 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -102,6 +102,19 @@ config MACH_MARZEN
 	select ARCH_REQUIRE_GPIOLIB
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
+config MACH_MARZEN_REFERENCE
+	bool "MARZEN board - Reference Device Tree Implementation"
+	depends on ARCH_R8A7779
+	select ARCH_REQUIRE_GPIOLIB
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+	select USE_OF
+	---help---
+	   Use reference implementation of Marzen board support
+	   which makes use of device tree at the expense
+	   of not supporting a number of devices.
+
+	   This is intended to aid developers
+
 config MACH_KZM9D
 	bool "KZM9D board"
 	depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index b646ff4..3705d4f 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_MACH_MACKEREL)	+= board-mackerel.o
 obj-$(CONFIG_MACH_KOTA2)	+= board-kota2.o
 obj-$(CONFIG_MACH_BONITO)	+= board-bonito.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
+obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
new file mode 100644
index 0000000..480d882
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -0,0 +1,75 @@
+/*
+ * marzen board support - Reference DT implementation
+ *
+ * Copyright (C) 2011  Renesas Solutions Corp.
+ * Copyright (C) 2011  Magnus Damm
+ * Copyright (C) 2013  Simon Horman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/pinctrl/machine.h>
+#include <mach/r8a7779.h>
+#include <mach/common.h>
+#include <mach/irqs.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+
+static const struct pinctrl_map marzen_pinctrl_map[] = {
+	/* SCIF2 (CN18: DEBUG0) */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779",
+				  "scif2_data_c", "scif2"),
+	/* SCIF4 (CN19: DEBUG1) */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779",
+				  "scif4_data", "scif4"),
+	/* SDHI0 */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_data4", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_ctrl", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_cd", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
+				  "sdhi0_wp", "sdhi0"),
+	/* SMSC */
+	PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
+				  "intc_irq1_b", "intc"),
+	PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
+				  "lbsc_ex_cs0", "lbsc"),
+};
+
+static void __init marzen_init(void)
+{
+	pinctrl_register_mappings(marzen_pinctrl_map,
+				  ARRAY_SIZE(marzen_pinctrl_map));
+	r8a7779_pinmux_init();
+
+	r8a7779_add_standard_devices_dt();
+}
+
+static const char *marzen_boards_compat_dt[] __initdata = {
+	"renesas,marzen-reference",
+	NULL,
+};
+
+DT_MACHINE_START(MARZEN, "marzen")
+	.smp		= smp_ops(r8a7779_smp_ops),
+	.map_io		= r8a7779_map_io,
+	.init_early	= r8a7779_init_delay,
+	.nr_irqs	= NR_IRQS_LEGACY,
+	.init_irq	= r8a7779_init_irq_dt,
+	.init_machine	= marzen_init,
+	.init_time	= shmobile_timer_init,
+	.dt_compat	= marzen_boards_compat_dt,
+MACHINE_END
-- 
1.7.10.4

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

* [PATCH 06/13] ARM: shmobile: kzm9g: Reference DT implementation
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Provide alternate board code for the kzm9g to demonstrate
how DT may be used given the current state of driver
device tree support. This is intended to act as a reference
for mach-shmobile developers.

Some notes:

* Brings up the GIC interrupt handler using device tree
* Brings up the following device using device tree:
  - MMCIF (MMC)
* Does not bring up the INTC interrupt controller at all,
  thus external devices may not be used. In particular,
  the SMSC ethernet device may not be used and thus
  NFS root may not be used.
* Uses existing C code and not device tree to initialise the following,
  which are needed for a working board:
  - SCIF (Serial)
  - CMT (Clock)
  - PFC (GPIO)

To use this alternate board code instead of the normal board code,
CONFIG_MACH_KZM9G_REFERENCE should be selected in the kernel config.
And the sh73a0-kzm9g-reference.dtb flattened device tree blob should be used.

Includes fix by Thierry Reding to no longer use gic_handle_irq()

Includes fixes by Guennadi Liakhovetski for recent pinmux changes.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                     |    1 +
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts   |   41 +++++++++++
 arch/arm/mach-shmobile/Kconfig                 |   10 +++
 arch/arm/mach-shmobile/Makefile                |    1 +
 arch/arm/mach-shmobile/board-kzm9g-reference.c |   87 ++++++++++++++++++++++++
 5 files changed, 140 insertions(+)
 create mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7965b9a..ee9fbe4 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -138,6 +138,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
 	r8a7779-marzen-reference.dtb \
 	sh73a0-kzm9g.dtb \
+	sh73a0-kzm9g-reference.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
new file mode 100644
index 0000000..06f52f9
--- /dev/null
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -0,0 +1,41 @@
+/*
+ * Device Tree Source for the KZM-A9-GT board
+ *
+ * Copyright (C) 2012 Horms Solutions Ltd.
+ *
+ * Based on sh73a0-kzm9g.dts
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "sh73a0-reference.dtsi"
+
+/ {
+	model = "KZM-A9-GT";
+	compatible = "renesas,kzm9g-reference", "renesas,sh73a0";
+
+	chosen {
+		bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x41000000 0x1e800000>;
+	};
+
+	fixedregulator1v8: fixedregulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+};
+
+&mmcif {
+	vmmc-supply = <&fixedregulator1v8>;
+	vqmmc-supply = <&fixedregulator1v8>;
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index b15d4ff..0c48af9 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -129,6 +129,16 @@ config MACH_KZM9G
 	select SND_SOC_AK4642 if SND_SIMPLE_CARD
 	select USE_OF
 
+config MACH_KZM9G_REFERENCE
+	bool "KZM-A9-GT board - Reference Device Tree Implementation"
+	depends on MACH_KZM9G
+	---help---
+	   Use reference implementation of KZM-A9-GT board support
+	   which makes as greater use of device tree at the expense
+	   of not supporting a number of devices.
+
+	   This is intended to aid developers
+
 comment "SH-Mobile System Configuration"
 
 config CPU_HAS_INTEVT
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 3705d4f..c621edf 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
+obj-$(CONFIG_MACH_KZM9G_REFERENCE)	+= board-kzm9g-reference.o
 
 # Framework support
 obj-$(CONFIG_SMP)		+= $(smp-y)
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
new file mode 100644
index 0000000..caba1bb
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -0,0 +1,87 @@
+/*
+ * KZM-A9-GT board support - Reference Device Tree Implementation
+ *
+ * Copyright (C) 2012	Horms Solutions Ltd.
+ *
+ * Based on board-kzm9g.c
+ * Copyright (C) 2012	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/input.h>
+#include <linux/of_platform.h>
+#include <linux/pinctrl/machine.h>
+#include <mach/sh73a0.h>
+#include <mach/common.h>
+#include <asm/hardware/cache-l2x0.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+static const struct pinctrl_map kzm_pinctrl_map[] = {
+	PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
+				  "i2c3_1", "i2c3"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
+				  "scifa4_data", "scifa4"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
+				  "scifa4_ctrl", "scifa4"),
+};
+
+static void __init kzm_init(void)
+{
+	sh73a0_add_standard_devices_dt();
+	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
+
+#ifdef CONFIG_CACHE_L2X0
+	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
+	l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
+#endif
+}
+
+static void kzm9g_restart(char mode, const char *cmd)
+{
+#define RESCNT2 IOMEM(0xe6188020)
+	/* Do soft power on reset */
+	writel((1 << 31), RESCNT2);
+}
+
+static const char *kzm9g_boards_compat_dt[] __initdata = {
+	"renesas,kzm9g-reference",
+	NULL,
+};
+
+/* Please note that the clock initialisation shcheme used in
+ * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
+ * does not work with SMP as there is a yet to be resolved lock-up in
+ * workqueue initialisation.
+ *
+ * CONFIG_SMP should be disabled when using this code.
+ */
+DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
+	.smp		= smp_ops(sh73a0_smp_ops),
+	.map_io		= sh73a0_map_io,
+	.init_early	= sh73a0_init_delay,
+	.nr_irqs	= NR_IRQS_LEGACY,
+	.init_irq	= irqchip_init,
+	.init_machine	= kzm_init,
+	.init_late	= shmobile_init_late,
+	.init_time	= shmobile_timer_init,
+	.restart	= kzm9g_restart,
+	.dt_compat	= kzm9g_boards_compat_dt,
+MACHINE_END
-- 
1.7.10.4


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

* [PATCH 06/13] ARM: shmobile: kzm9g: Reference DT implementation
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Provide alternate board code for the kzm9g to demonstrate
how DT may be used given the current state of driver
device tree support. This is intended to act as a reference
for mach-shmobile developers.

Some notes:

* Brings up the GIC interrupt handler using device tree
* Brings up the following device using device tree:
  - MMCIF (MMC)
* Does not bring up the INTC interrupt controller at all,
  thus external devices may not be used. In particular,
  the SMSC ethernet device may not be used and thus
  NFS root may not be used.
* Uses existing C code and not device tree to initialise the following,
  which are needed for a working board:
  - SCIF (Serial)
  - CMT (Clock)
  - PFC (GPIO)

To use this alternate board code instead of the normal board code,
CONFIG_MACH_KZM9G_REFERENCE should be selected in the kernel config.
And the sh73a0-kzm9g-reference.dtb flattened device tree blob should be used.

Includes fix by Thierry Reding to no longer use gic_handle_irq()

Includes fixes by Guennadi Liakhovetski for recent pinmux changes.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                     |    1 +
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts   |   41 +++++++++++
 arch/arm/mach-shmobile/Kconfig                 |   10 +++
 arch/arm/mach-shmobile/Makefile                |    1 +
 arch/arm/mach-shmobile/board-kzm9g-reference.c |   87 ++++++++++++++++++++++++
 5 files changed, 140 insertions(+)
 create mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7965b9a..ee9fbe4 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -138,6 +138,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
 	r8a7779-marzen-reference.dtb \
 	sh73a0-kzm9g.dtb \
+	sh73a0-kzm9g-reference.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
new file mode 100644
index 0000000..06f52f9
--- /dev/null
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -0,0 +1,41 @@
+/*
+ * Device Tree Source for the KZM-A9-GT board
+ *
+ * Copyright (C) 2012 Horms Solutions Ltd.
+ *
+ * Based on sh73a0-kzm9g.dts
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "sh73a0-reference.dtsi"
+
+/ {
+	model = "KZM-A9-GT";
+	compatible = "renesas,kzm9g-reference", "renesas,sh73a0";
+
+	chosen {
+		bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x41000000 0x1e800000>;
+	};
+
+	fixedregulator1v8: fixedregulator at 0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+};
+
+&mmcif {
+	vmmc-supply = <&fixedregulator1v8>;
+	vqmmc-supply = <&fixedregulator1v8>;
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index b15d4ff..0c48af9 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -129,6 +129,16 @@ config MACH_KZM9G
 	select SND_SOC_AK4642 if SND_SIMPLE_CARD
 	select USE_OF
 
+config MACH_KZM9G_REFERENCE
+	bool "KZM-A9-GT board - Reference Device Tree Implementation"
+	depends on MACH_KZM9G
+	---help---
+	   Use reference implementation of KZM-A9-GT board support
+	   which makes as greater use of device tree at the expense
+	   of not supporting a number of devices.
+
+	   This is intended to aid developers
+
 comment "SH-Mobile System Configuration"
 
 config CPU_HAS_INTEVT
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 3705d4f..c621edf 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
+obj-$(CONFIG_MACH_KZM9G_REFERENCE)	+= board-kzm9g-reference.o
 
 # Framework support
 obj-$(CONFIG_SMP)		+= $(smp-y)
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
new file mode 100644
index 0000000..caba1bb
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -0,0 +1,87 @@
+/*
+ * KZM-A9-GT board support - Reference Device Tree Implementation
+ *
+ * Copyright (C) 2012	Horms Solutions Ltd.
+ *
+ * Based on board-kzm9g.c
+ * Copyright (C) 2012	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/input.h>
+#include <linux/of_platform.h>
+#include <linux/pinctrl/machine.h>
+#include <mach/sh73a0.h>
+#include <mach/common.h>
+#include <asm/hardware/cache-l2x0.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+static const struct pinctrl_map kzm_pinctrl_map[] = {
+	PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
+				  "i2c3_1", "i2c3"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
+				  "scifa4_data", "scifa4"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
+				  "scifa4_ctrl", "scifa4"),
+};
+
+static void __init kzm_init(void)
+{
+	sh73a0_add_standard_devices_dt();
+	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
+
+#ifdef CONFIG_CACHE_L2X0
+	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
+	l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
+#endif
+}
+
+static void kzm9g_restart(char mode, const char *cmd)
+{
+#define RESCNT2 IOMEM(0xe6188020)
+	/* Do soft power on reset */
+	writel((1 << 31), RESCNT2);
+}
+
+static const char *kzm9g_boards_compat_dt[] __initdata = {
+	"renesas,kzm9g-reference",
+	NULL,
+};
+
+/* Please note that the clock initialisation shcheme used in
+ * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
+ * does not work with SMP as there is a yet to be resolved lock-up in
+ * workqueue initialisation.
+ *
+ * CONFIG_SMP should be disabled when using this code.
+ */
+DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
+	.smp		= smp_ops(sh73a0_smp_ops),
+	.map_io		= sh73a0_map_io,
+	.init_early	= sh73a0_init_delay,
+	.nr_irqs	= NR_IRQS_LEGACY,
+	.init_irq	= irqchip_init,
+	.init_machine	= kzm_init,
+	.init_late	= shmobile_init_late,
+	.init_time	= shmobile_timer_init,
+	.restart	= kzm9g_restart,
+	.dt_compat	= kzm9g_boards_compat_dt,
+MACHINE_END
-- 
1.7.10.4

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

* [PATCH 07/13] ARM: shmobile: parse DT and configure pinmux early on kzm9g-reference
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

GPIOs can be provided by the pinctrl subsystem, which can be initialised
by DT. Therefore DT has to be parsed before requesting GPIOs. Also non-DT
pinmux has to be configured early.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index caba1bb..add537c 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -47,6 +47,7 @@ static void __init kzm_init(void)
 {
 	sh73a0_add_standard_devices_dt();
 	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
+	sh73a0_pinmux_init();
 
 #ifdef CONFIG_CACHE_L2X0
 	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
-- 
1.7.10.4


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

* [PATCH 07/13] ARM: shmobile: parse DT and configure pinmux early on kzm9g-reference
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

GPIOs can be provided by the pinctrl subsystem, which can be initialised
by DT. Therefore DT has to be parsed before requesting GPIOs. Also non-DT
pinmux has to be configured early.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index caba1bb..add537c 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -47,6 +47,7 @@ static void __init kzm_init(void)
 {
 	sh73a0_add_standard_devices_dt();
 	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
+	sh73a0_pinmux_init();
 
 #ifdef CONFIG_CACHE_L2X0
 	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
-- 
1.7.10.4

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

* [PATCH 08/13] ARM: shmobile: SDHI and MMCIF interfaces to kzm9g-reference
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Add SDHI0 and SDHI2 interfaces to kzm9g-reference. With no pinctrl DT
support we cannot use GPIO card-detection and regulator switching.
Also update the MMCIF DT node to use all 8 data lines and avoid
redundant information in DT.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
[ horms+renesas@verge.net.au: Updated for pinmux changes by Laurent Pinchart ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts   |   42 ++++++++++++++++++++++--
 arch/arm/mach-shmobile/board-kzm9g-reference.c |   36 ++++++++++++++++++++
 2 files changed, 75 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index 06f52f9..7fad4b9 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -27,15 +27,51 @@
 		reg = <0x41000000 0x1e800000>;
 	};
 
-	fixedregulator1v8: fixedregulator@0 {
+	reg_1p8v: regulator@0 {
 		compatible = "regulator-fixed";
 		regulator-name = "fixed-1.8V";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	reg_2p8v: regulator@1 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-2.8V";
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	sdhi0: sdhi@0xee100000 {
+		compatible = "renesas,shmobile-sdhi";
+		reg = <0xee100000 0x100>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 83 4
+				0 84 4
+				0 85 4>;
+		vmmc-supply = <&reg_2p8v>;
+		bus-width = <4>;
+		toshiba,mmc-has-idle-wait;
+	};
+
+	sdhi2: sdhi@0xee140000 {
+		compatible = "renesas,shmobile-sdhi";
+		reg = <0xee140000 0x100>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 104 4
+				0 105 4>;
+		vmmc-supply = <&reg_2p8v>;
+		bus-width = <4>;
+		broken-cd;
+		toshiba,mmc-wrprotect-disable;
+		toshiba,mmc-has-idle-wait;
 	};
 };
 
 &mmcif {
-	vmmc-supply = <&fixedregulator1v8>;
-	vqmmc-supply = <&fixedregulator1v8>;
+	bus-width = <8>;
+	vmmc-supply = <&reg_1p8v>;
 };
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index add537c..3056698 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -28,19 +28,48 @@
 #include <linux/input.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/pinctrl/pinconf-generic.h>
 #include <mach/sh73a0.h>
 #include <mach/common.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+static unsigned long pin_pullup_conf[] = {
+	PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
+};
+
 static const struct pinctrl_map kzm_pinctrl_map[] = {
 	PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
 				  "i2c3_1", "i2c3"),
+	/* MMCIF */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				  "mmc0_data8_0", "mmc0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				  "mmc0_ctrl_0", "mmc0"),
+	PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				    "PORT279", pin_pullup_conf),
+	PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				      "mmc0_data8_0", pin_pullup_conf),
+	/* SCIFA4 */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
 				  "scifa4_data", "scifa4"),
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
 				  "scifa4_ctrl", "scifa4"),
+	/* SDHI0 */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_data4", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_ctrl", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_cd", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_wp", "sdhi0"),
+	/* SDHI2 */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
+				  "sdhi2_data4", "sdhi2"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
+				  "sdhi2_ctrl", "sdhi2"),
 };
 
 static void __init kzm_init(void)
@@ -49,6 +78,13 @@ static void __init kzm_init(void)
 	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
 	sh73a0_pinmux_init();
 
+	/* enable SD */
+	gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON,	NULL);
+	gpio_request_one(GPIO_PORT15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
+
+	gpio_request(GPIO_FN_SDHICLK2,		NULL);
+	gpio_request_one(GPIO_PORT14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
+
 #ifdef CONFIG_CACHE_L2X0
 	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
 	l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
-- 
1.7.10.4


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

* [PATCH 08/13] ARM: shmobile: SDHI and MMCIF interfaces to kzm9g-reference
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Add SDHI0 and SDHI2 interfaces to kzm9g-reference. With no pinctrl DT
support we cannot use GPIO card-detection and regulator switching.
Also update the MMCIF DT node to use all 8 data lines and avoid
redundant information in DT.

Cc: Laurent Pinchart <laurent.pinchart+renesas at ideasonboard.com
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
[ horms+renesas at verge.net.au: Updated for pinmux changes by Laurent Pinchart ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts   |   42 ++++++++++++++++++++++--
 arch/arm/mach-shmobile/board-kzm9g-reference.c |   36 ++++++++++++++++++++
 2 files changed, 75 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index 06f52f9..7fad4b9 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -27,15 +27,51 @@
 		reg = <0x41000000 0x1e800000>;
 	};
 
-	fixedregulator1v8: fixedregulator at 0 {
+	reg_1p8v: regulator at 0 {
 		compatible = "regulator-fixed";
 		regulator-name = "fixed-1.8V";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	reg_2p8v: regulator at 1 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-2.8V";
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	sdhi0: sdhi at 0xee100000 {
+		compatible = "renesas,shmobile-sdhi";
+		reg = <0xee100000 0x100>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 83 4
+				0 84 4
+				0 85 4>;
+		vmmc-supply = <&reg_2p8v>;
+		bus-width = <4>;
+		toshiba,mmc-has-idle-wait;
+	};
+
+	sdhi2: sdhi at 0xee140000 {
+		compatible = "renesas,shmobile-sdhi";
+		reg = <0xee140000 0x100>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 104 4
+				0 105 4>;
+		vmmc-supply = <&reg_2p8v>;
+		bus-width = <4>;
+		broken-cd;
+		toshiba,mmc-wrprotect-disable;
+		toshiba,mmc-has-idle-wait;
 	};
 };
 
 &mmcif {
-	vmmc-supply = <&fixedregulator1v8>;
-	vqmmc-supply = <&fixedregulator1v8>;
+	bus-width = <8>;
+	vmmc-supply = <&reg_1p8v>;
 };
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index add537c..3056698 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -28,19 +28,48 @@
 #include <linux/input.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/pinctrl/pinconf-generic.h>
 #include <mach/sh73a0.h>
 #include <mach/common.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+static unsigned long pin_pullup_conf[] = {
+	PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
+};
+
 static const struct pinctrl_map kzm_pinctrl_map[] = {
 	PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
 				  "i2c3_1", "i2c3"),
+	/* MMCIF */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				  "mmc0_data8_0", "mmc0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				  "mmc0_ctrl_0", "mmc0"),
+	PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				    "PORT279", pin_pullup_conf),
+	PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+				      "mmc0_data8_0", pin_pullup_conf),
+	/* SCIFA4 */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
 				  "scifa4_data", "scifa4"),
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
 				  "scifa4_ctrl", "scifa4"),
+	/* SDHI0 */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_data4", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_ctrl", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_cd", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+				  "sdhi0_wp", "sdhi0"),
+	/* SDHI2 */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
+				  "sdhi2_data4", "sdhi2"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
+				  "sdhi2_ctrl", "sdhi2"),
 };
 
 static void __init kzm_init(void)
@@ -49,6 +78,13 @@ static void __init kzm_init(void)
 	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
 	sh73a0_pinmux_init();
 
+	/* enable SD */
+	gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON,	NULL);
+	gpio_request_one(GPIO_PORT15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
+
+	gpio_request(GPIO_FN_SDHICLK2,		NULL);
+	gpio_request_one(GPIO_PORT14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
+
 #ifdef CONFIG_CACHE_L2X0
 	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
 	l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
-- 
1.7.10.4

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

* [PATCH 09/13] ARM: shmobile: simplify kzm9g Kconfig dependencies
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Reference kernel configurations for armadillo800eva and kzm9g boards do not
have to depend on their respective "legacy" configurations, doing device
instantiation in .c, they can be configured and built independently.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
[horms+renesas@verge.net.au: created separate patch for kzm9g portion]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/Kconfig |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 0c48af9..ab2bb71 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -131,7 +131,11 @@ config MACH_KZM9G
 
 config MACH_KZM9G_REFERENCE
 	bool "KZM-A9-GT board - Reference Device Tree Implementation"
-	depends on MACH_KZM9G
+	depends on ARCH_SH73A0
+	select ARCH_REQUIRE_GPIOLIB
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+	select SND_SOC_AK4642 if SND_SIMPLE_CARD
+	select USE_OF
 	---help---
 	   Use reference implementation of KZM-A9-GT board support
 	   which makes as greater use of device tree at the expense
-- 
1.7.10.4


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

* [PATCH 09/13] ARM: shmobile: simplify kzm9g Kconfig dependencies
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Reference kernel configurations for armadillo800eva and kzm9g boards do not
have to depend on their respective "legacy" configurations, doing device
instantiation in .c, they can be configured and built independently.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
[horms+renesas at verge.net.au: created separate patch for kzm9g portion]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/Kconfig |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 0c48af9..ab2bb71 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -131,7 +131,11 @@ config MACH_KZM9G
 
 config MACH_KZM9G_REFERENCE
 	bool "KZM-A9-GT board - Reference Device Tree Implementation"
-	depends on MACH_KZM9G
+	depends on ARCH_SH73A0
+	select ARCH_REQUIRE_GPIOLIB
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+	select SND_SOC_AK4642 if SND_SIMPLE_CARD
+	select USE_OF
 	---help---
 	   Use reference implementation of KZM-A9-GT board support
 	   which makes as greater use of device tree at the expense
-- 
1.7.10.4

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

* [PATCH 10/13] ARM: shmobile: kzm9g: Remove warning about SMP
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Remove warning about SMP not working with the
clock initialisation used for kzm9g reference.

This is resolved by not selecting CONFIG_PREEMPT.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index 3056698..4da3501 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -103,13 +103,6 @@ static const char *kzm9g_boards_compat_dt[] __initdata = {
 	NULL,
 };
 
-/* Please note that the clock initialisation shcheme used in
- * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
- * does not work with SMP as there is a yet to be resolved lock-up in
- * workqueue initialisation.
- *
- * CONFIG_SMP should be disabled when using this code.
- */
 DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.smp		= smp_ops(sh73a0_smp_ops),
 	.map_io		= sh73a0_map_io,
-- 
1.7.10.4


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

* [PATCH 10/13] ARM: shmobile: kzm9g: Remove warning about SMP
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Remove warning about SMP not working with the
clock initialisation used for kzm9g reference.

This is resolved by not selecting CONFIG_PREEMPT.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index 3056698..4da3501 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -103,13 +103,6 @@ static const char *kzm9g_boards_compat_dt[] __initdata = {
 	NULL,
 };
 
-/* Please note that the clock initialisation shcheme used in
- * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
- * does not work with SMP as there is a yet to be resolved lock-up in
- * workqueue initialisation.
- *
- * CONFIG_SMP should be disabled when using this code.
- */
 DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.smp		= smp_ops(sh73a0_smp_ops),
 	.map_io		= sh73a0_map_io,
-- 
1.7.10.4

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

* [PATCH 11/13] ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:17     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Remove .init_late and .restart from DT_MACHINE_START
for kzm9g reference as these are not necessary to
bring the board up which is the main aim of kzm9g reference.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index 4da3501..e93473c 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -91,13 +91,6 @@ static void __init kzm_init(void)
 #endif
 }
 
-static void kzm9g_restart(char mode, const char *cmd)
-{
-#define RESCNT2 IOMEM(0xe6188020)
-	/* Do soft power on reset */
-	writel((1 << 31), RESCNT2);
-}
-
 static const char *kzm9g_boards_compat_dt[] __initdata = {
 	"renesas,kzm9g-reference",
 	NULL,
@@ -110,8 +103,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.init_irq	= irqchip_init,
 	.init_machine	= kzm_init,
-	.init_late	= shmobile_init_late,
 	.init_time	= shmobile_timer_init,
-	.restart	= kzm9g_restart,
 	.dt_compat	= kzm9g_boards_compat_dt,
 MACHINE_END
-- 
1.7.10.4


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

* [PATCH 11/13] ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START
@ 2013-03-19  2:17     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

Remove .init_late and .restart from DT_MACHINE_START
for kzm9g reference as these are not necessary to
bring the board up which is the main aim of kzm9g reference.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index 4da3501..e93473c 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -91,13 +91,6 @@ static void __init kzm_init(void)
 #endif
 }
 
-static void kzm9g_restart(char mode, const char *cmd)
-{
-#define RESCNT2 IOMEM(0xe6188020)
-	/* Do soft power on reset */
-	writel((1 << 31), RESCNT2);
-}
-
 static const char *kzm9g_boards_compat_dt[] __initdata = {
 	"renesas,kzm9g-reference",
 	NULL,
@@ -110,8 +103,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.init_irq	= irqchip_init,
 	.init_machine	= kzm_init,
-	.init_late	= shmobile_init_late,
 	.init_time	= shmobile_timer_init,
-	.restart	= kzm9g_restart,
 	.dt_compat	= kzm9g_boards_compat_dt,
 MACHINE_END
-- 
1.7.10.4

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

* [PATCH 12/13] ARM: shmobile: marzen: Use gic_iid macro for ICCIAR / interrupt ID
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:18     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ARM: shmobile: add gic_iid macro for ICCIAR / interrupt ID
enabled to use gic_iid macro.
This patch exchange current GIC interrupt setting
from gic_spi() to gic_iid()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[ horms+renesas@verge.net.au: Split irq.h portion into a separate patch ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-marzen.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 5852331..2333a2d 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -67,7 +67,7 @@ static struct resource smsc911x_resources[] = {
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start		= gic_spi(28), /* IRQ 1 */
+		.start		= gic_iid(0x3c), /* IRQ 1 */
 		.flags		= IORESOURCE_IRQ,
 	},
 };
@@ -97,7 +97,7 @@ static struct resource sdhi0_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(104),
+		.start	= gic_iid(0x88),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -215,7 +215,7 @@ static struct resource ehci0_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(44),
+		.start	= gic_iid(0x4c),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -239,7 +239,7 @@ static struct resource ehci1_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(45),
+		.start	= gic_iid(0x4d),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -269,7 +269,7 @@ static struct resource ohci0_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(44),
+		.start	= gic_iid(0x4c),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -293,7 +293,7 @@ static struct resource ohci1_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(45),
+		.start	= gic_iid(0x4d),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
-- 
1.7.10.4


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

* [PATCH 12/13] ARM: shmobile: marzen: Use gic_iid macro for ICCIAR / interrupt ID
@ 2013-03-19  2:18     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:18 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ARM: shmobile: add gic_iid macro for ICCIAR / interrupt ID
enabled to use gic_iid macro.
This patch exchange current GIC interrupt setting
from gic_spi() to gic_iid()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[ horms+renesas at verge.net.au: Split irq.h portion into a separate patch ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-marzen.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 5852331..2333a2d 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -67,7 +67,7 @@ static struct resource smsc911x_resources[] = {
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start		= gic_spi(28), /* IRQ 1 */
+		.start		= gic_iid(0x3c), /* IRQ 1 */
 		.flags		= IORESOURCE_IRQ,
 	},
 };
@@ -97,7 +97,7 @@ static struct resource sdhi0_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(104),
+		.start	= gic_iid(0x88),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -215,7 +215,7 @@ static struct resource ehci0_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(44),
+		.start	= gic_iid(0x4c),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -239,7 +239,7 @@ static struct resource ehci1_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(45),
+		.start	= gic_iid(0x4d),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -269,7 +269,7 @@ static struct resource ohci0_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(44),
+		.start	= gic_iid(0x4c),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -293,7 +293,7 @@ static struct resource ohci1_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gic_spi(45),
+		.start	= gic_iid(0x4d),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
-- 
1.7.10.4

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

* [PATCH 13/13] ARM: shmobile: kzm9g: correct smsc regulator registration
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-19  2:18     ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:18 UTC (permalink / raw)
  To: linux-arm-kernel

Correct the name of smsc devices used for regulator registration
allowing the regulators to be found and used.

This eliminates the need for CONFIG_REGULATOR_DUMMY
when CONFIG_REGULATOR is set.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index c1c0401..d2ace3a 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -63,8 +63,8 @@
 
 /* Dummy supplies, where voltage doesn't matter */
 static struct regulator_consumer_supply dummy_supplies[] = {
-	REGULATOR_SUPPLY("vddvario", "smsc911x"),
-	REGULATOR_SUPPLY("vdd33a", "smsc911x"),
+	REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 };
 
 /*
-- 
1.7.10.4


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

* [PATCH 13/13] ARM: shmobile: kzm9g: correct smsc regulator registration
@ 2013-03-19  2:18     ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-19  2:18 UTC (permalink / raw)
  To: linux-arm-kernel

Correct the name of smsc devices used for regulator registration
allowing the regulators to be found and used.

This eliminates the need for CONFIG_REGULATOR_DUMMY
when CONFIG_REGULATOR is set.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index c1c0401..d2ace3a 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -63,8 +63,8 @@
 
 /* Dummy supplies, where voltage doesn't matter */
 static struct regulator_consumer_supply dummy_supplies[] = {
-	REGULATOR_SUPPLY("vddvario", "smsc911x"),
-	REGULATOR_SUPPLY("vdd33a", "smsc911x"),
+	REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 };
 
 /*
-- 
1.7.10.4

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-19  2:17   ` Simon Horman
@ 2013-03-21 17:18     ` Arnd Bergmann
  -1 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-21 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 19 March 2013, Simon Horman wrote:

> ----------------------------------------------------------------
> Renesas ARM-based SoC board updates for v3.10
> 
> This is based on a merge of the following:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-pinmux-for-v3.10
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.10

Pulled into next/boards.

Please verify that I have pulled everything you sent me. If not, it my mistake.

Thanks,

	Arnd

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-21 17:18     ` Arnd Bergmann
  0 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-21 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 19 March 2013, Simon Horman wrote:

> ----------------------------------------------------------------
> Renesas ARM-based SoC board updates for v3.10
> 
> This is based on a merge of the following:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-pinmux-for-v3.10
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.10

Pulled into next/boards.

Please verify that I have pulled everything you sent me. If not, it my mistake.

Thanks,

	Arnd

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-21 17:18     ` Arnd Bergmann
@ 2013-03-21 19:22       ` Arnd Bergmann
  -1 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-21 19:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 21 March 2013, Arnd Bergmann wrote:
> On Tuesday 19 March 2013, Simon Horman wrote:

> Pulled into next/boards.
> 
> Please verify that I have pulled everything you sent me. If not, it my mistake.

With everything applied, I now get one build failure and a new build warning:

=> build/mackerel_defconfig/faillog <=
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c: In function 'mackerel_init':
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: error: 'GPIO_FN_MMCD0_0' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: note: each undeclared identifier is reported only once for each function it appears in
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1477:15: error: 'GPIO_FN_MMCD0_1' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1478:15: error: 'GPIO_FN_MMCD0_2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1479:15: error: 'GPIO_FN_MMCD0_3' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1480:15: error: 'GPIO_FN_MMCD0_4' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1481:15: error: 'GPIO_FN_MMCD0_5' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1482:15: error: 'GPIO_FN_MMCD0_6' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1483:15: error: 'GPIO_FN_MMCD0_7' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1484:15: error: 'GPIO_FN_MMCCMD0' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1485:15: error: 'GPIO_FN_MMCCLK0' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1489:15: error: 'GPIO_FN_SDHICMD2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1490:15: error: 'GPIO_FN_SDHICLK2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1491:15: error: 'GPIO_FN_SDHID2_3' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1492:15: error: 'GPIO_FN_SDHID2_2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1493:15: error: 'GPIO_FN_SDHID2_1' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1494:15: error: 'GPIO_FN_SDHID2_0' undeclared (first use in this function)
make[3]: *** [arch/arm/mach-shmobile/board-mackerel.o] Error 1
make[3]: Target `__build' not remade because of errors.
make[2]: *** [arch/arm/mach-shmobile] Error 2
make[2]: Target `_all' not remade because of errors.
make[1]: *** [sub-make] Error 2
make[1]: Target `_all' not remade because of errors.

=> build/marzen_defconfig/faillog <=
In file included from /git/arm-soc/arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
/git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct of_device_id' declared inside parameter list [enabled by default]
/git/arm-soc/include/linux/of_platform.h:107:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
/git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct device_node' declared inside parameter list [enabled by default]


I have not tried bisecting the problems. Could you find out what is going on
and send bug fixes to apply on top?

	Arnd

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-21 19:22       ` Arnd Bergmann
  0 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-21 19:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 21 March 2013, Arnd Bergmann wrote:
> On Tuesday 19 March 2013, Simon Horman wrote:

> Pulled into next/boards.
> 
> Please verify that I have pulled everything you sent me. If not, it my mistake.

With everything applied, I now get one build failure and a new build warning:

==> build/mackerel_defconfig/faillog <==
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c: In function 'mackerel_init':
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: error: 'GPIO_FN_MMCD0_0' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: note: each undeclared identifier is reported only once for each function it appears in
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1477:15: error: 'GPIO_FN_MMCD0_1' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1478:15: error: 'GPIO_FN_MMCD0_2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1479:15: error: 'GPIO_FN_MMCD0_3' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1480:15: error: 'GPIO_FN_MMCD0_4' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1481:15: error: 'GPIO_FN_MMCD0_5' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1482:15: error: 'GPIO_FN_MMCD0_6' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1483:15: error: 'GPIO_FN_MMCD0_7' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1484:15: error: 'GPIO_FN_MMCCMD0' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1485:15: error: 'GPIO_FN_MMCCLK0' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1489:15: error: 'GPIO_FN_SDHICMD2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1490:15: error: 'GPIO_FN_SDHICLK2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1491:15: error: 'GPIO_FN_SDHID2_3' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1492:15: error: 'GPIO_FN_SDHID2_2' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1493:15: error: 'GPIO_FN_SDHID2_1' undeclared (first use in this function)
/git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1494:15: error: 'GPIO_FN_SDHID2_0' undeclared (first use in this function)
make[3]: *** [arch/arm/mach-shmobile/board-mackerel.o] Error 1
make[3]: Target `__build' not remade because of errors.
make[2]: *** [arch/arm/mach-shmobile] Error 2
make[2]: Target `_all' not remade because of errors.
make[1]: *** [sub-make] Error 2
make[1]: Target `_all' not remade because of errors.

==> build/marzen_defconfig/faillog <==
In file included from /git/arm-soc/arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
/git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct of_device_id' declared inside parameter list [enabled by default]
/git/arm-soc/include/linux/of_platform.h:107:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
/git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct device_node' declared inside parameter list [enabled by default]


I have not tried bisecting the problems. Could you find out what is going on
and send bug fixes to apply on top?

	Arnd

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-21 19:22       ` Arnd Bergmann
@ 2013-03-22  0:32         ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-22  0:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 07:22:56PM +0000, Arnd Bergmann wrote:
> On Thursday 21 March 2013, Arnd Bergmann wrote:
> > On Tuesday 19 March 2013, Simon Horman wrote:
> 
> > Pulled into next/boards.
> > 
> > Please verify that I have pulled everything you sent me. If not, it my mistake.
> 
> With everything applied, I now get one build failure and a new build warning:
> 
> => build/mackerel_defconfig/faillog <=
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c: In function 'mackerel_init':
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: error: 'GPIO_FN_MMCD0_0' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: note: each undeclared identifier is reported only once for each function it appears in
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1477:15: error: 'GPIO_FN_MMCD0_1' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1478:15: error: 'GPIO_FN_MMCD0_2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1479:15: error: 'GPIO_FN_MMCD0_3' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1480:15: error: 'GPIO_FN_MMCD0_4' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1481:15: error: 'GPIO_FN_MMCD0_5' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1482:15: error: 'GPIO_FN_MMCD0_6' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1483:15: error: 'GPIO_FN_MMCD0_7' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1484:15: error: 'GPIO_FN_MMCCMD0' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1485:15: error: 'GPIO_FN_MMCCLK0' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1489:15: error: 'GPIO_FN_SDHICMD2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1490:15: error: 'GPIO_FN_SDHICLK2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1491:15: error: 'GPIO_FN_SDHID2_3' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1492:15: error: 'GPIO_FN_SDHID2_2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1493:15: error: 'GPIO_FN_SDHID2_1' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1494:15: error: 'GPIO_FN_SDHID2_0' undeclared (first use in this function)
> make[3]: *** [arch/arm/mach-shmobile/board-mackerel.o] Error 1
> make[3]: Target `__build' not remade because of errors.
> make[2]: *** [arch/arm/mach-shmobile] Error 2
> make[2]: Target `_all' not remade because of errors.
> make[1]: *** [sub-make] Error 2
> make[1]: Target `_all' not remade because of errors.
> 
> => build/marzen_defconfig/faillog <=
> In file included from /git/arm-soc/arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
> /git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct of_device_id' declared inside parameter list [enabled by default]
> /git/arm-soc/include/linux/of_platform.h:107:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> /git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct device_node' declared inside parameter list [enabled by default]
> 
> 
> I have not tried bisecting the problems. Could you find out what is going on
> and send bug fixes to apply on top?

Thanks Arnd,

I noticed this only slightly before you did and I apologise for not catching it earlier.
I have a fix queued up and will send you a pull request shortly.

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-22  0:32         ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-22  0:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 07:22:56PM +0000, Arnd Bergmann wrote:
> On Thursday 21 March 2013, Arnd Bergmann wrote:
> > On Tuesday 19 March 2013, Simon Horman wrote:
> 
> > Pulled into next/boards.
> > 
> > Please verify that I have pulled everything you sent me. If not, it my mistake.
> 
> With everything applied, I now get one build failure and a new build warning:
> 
> ==> build/mackerel_defconfig/faillog <==
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c: In function 'mackerel_init':
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: error: 'GPIO_FN_MMCD0_0' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1476:15: note: each undeclared identifier is reported only once for each function it appears in
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1477:15: error: 'GPIO_FN_MMCD0_1' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1478:15: error: 'GPIO_FN_MMCD0_2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1479:15: error: 'GPIO_FN_MMCD0_3' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1480:15: error: 'GPIO_FN_MMCD0_4' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1481:15: error: 'GPIO_FN_MMCD0_5' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1482:15: error: 'GPIO_FN_MMCD0_6' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1483:15: error: 'GPIO_FN_MMCD0_7' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1484:15: error: 'GPIO_FN_MMCCMD0' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1485:15: error: 'GPIO_FN_MMCCLK0' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1489:15: error: 'GPIO_FN_SDHICMD2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1490:15: error: 'GPIO_FN_SDHICLK2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1491:15: error: 'GPIO_FN_SDHID2_3' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1492:15: error: 'GPIO_FN_SDHID2_2' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1493:15: error: 'GPIO_FN_SDHID2_1' undeclared (first use in this function)
> /git/arm-soc/arch/arm/mach-shmobile/board-mackerel.c:1494:15: error: 'GPIO_FN_SDHID2_0' undeclared (first use in this function)
> make[3]: *** [arch/arm/mach-shmobile/board-mackerel.o] Error 1
> make[3]: Target `__build' not remade because of errors.
> make[2]: *** [arch/arm/mach-shmobile] Error 2
> make[2]: Target `_all' not remade because of errors.
> make[1]: *** [sub-make] Error 2
> make[1]: Target `_all' not remade because of errors.
> 
> ==> build/marzen_defconfig/faillog <==
> In file included from /git/arm-soc/arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
> /git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct of_device_id' declared inside parameter list [enabled by default]
> /git/arm-soc/include/linux/of_platform.h:107:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> /git/arm-soc/include/linux/of_platform.h:107:13: warning: 'struct device_node' declared inside parameter list [enabled by default]
> 
> 
> I have not tried bisecting the problems. Could you find out what is going on
> and send bug fixes to apply on top?

Thanks Arnd,

I noticed this only slightly before you did and I apologise for not catching it earlier.
I have a fix queued up and will send you a pull request shortly.

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-21 17:18     ` Arnd Bergmann
@ 2013-03-22  0:58       ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-22  0:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:18:32PM +0000, Arnd Bergmann wrote:
> On Tuesday 19 March 2013, Simon Horman wrote:
> 
> > ----------------------------------------------------------------
> > Renesas ARM-based SoC board updates for v3.10
> > 
> > This is based on a merge of the following:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-pinmux-for-v3.10
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.10
> 
> Pulled into next/boards.
> 
> Please verify that I have pulled everything you sent me. If not, it my mistake.

Thanks.

Sorry about sending so many all at once. There were quite a few changes
queued up and it might have been better if I flushed some of them out
a bit earlier.

Of the batch that I sent last week, I think you are missing the following one:

From:	Simon Horman <horms+renesas@verge.net.au>
To:	Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>
Cc:	linux-sh@vger.kernel.org, arm@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Paul Mundt <lethal@linux-sh.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: [GIT PULL] ARM and SH based SoC clocksource update for v3.10
Date:	Mon, 18 Mar 2013 22:02:26 +0900
Message-Id: <1363611758-6655-1-git-send-email-horms+renesas@verge.net.au>

Hi Olof, Hi Arnd,

The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9:

  Linux 3.9-rc2 (2013-03-10 16:54:19 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-clocksource-for-v3.10

for you to fetch changes up to 342896a5c565e38dfb87954f362735f03ae1efb0:

  clocksource: sh_mtu2: Set initcall level to subsys (2013-03-13 02:24:37 +0900)

----------------------------------------------------------------
Renesas ARM and SH based SoC clocksource update for v3.10

I has been agreed by Paul Mundt and myself, that it would be best to take
these changes through the renesas tree and in turn the arm-soc tree.

----------------------------------------------------------------
Magnus Damm (8):
      clocksource: sh_cmt: Take care of clk_put() when setup_irq() fails
      clocksource: sh_cmt: Initialize 'max_match_value' and 'lock' in sh_cmt_setup()
      clocksource: sh_cmt: Introduce per-register functions
      clocksource: sh_cmt: Consolidate platform_set_drvdata() call
      clocksource: sh_cmt: CMSTR and CMCSR register access update
      clocksource: sh_cmt: CMCNT and CMCOR register access update
      clocksource: sh_cmt: Add control register callbacks
      clocksource: sh_cmt: Add CMT register layout comment

Simon Horman (4):
      clocksource: sh_cmt: Set initcall level to subsys
      clocksource: sh_tmu: Set initcall level to subsys
      clocksource: em_sti: Set initcall level to subsys
      clocksource: sh_mtu2: Set initcall level to subsys

 drivers/clocksource/em_sti.c  |   13 ++-
 drivers/clocksource/sh_cmt.c  |  189 +++++++++++++++++++++++++----------------
 drivers/clocksource/sh_mtu2.c |    2 +-
 drivers/clocksource/sh_tmu.c  |    2 +-
 4 files changed, 132 insertions(+), 74 deletions(-)



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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-22  0:58       ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-22  0:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:18:32PM +0000, Arnd Bergmann wrote:
> On Tuesday 19 March 2013, Simon Horman wrote:
> 
> > ----------------------------------------------------------------
> > Renesas ARM-based SoC board updates for v3.10
> > 
> > This is based on a merge of the following:
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-pinmux-for-v3.10
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.10
> 
> Pulled into next/boards.
> 
> Please verify that I have pulled everything you sent me. If not, it my mistake.

Thanks.

Sorry about sending so many all at once. There were quite a few changes
queued up and it might have been better if I flushed some of them out
a bit earlier.

Of the batch that I sent last week, I think you are missing the following one:

From:	Simon Horman <horms+renesas@verge.net.au>
To:	Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>
Cc:	linux-sh at vger.kernel.org, arm at kernel.org,
	linux-arm-kernel at lists.infradead.org,
	Paul Mundt <lethal@linux-sh.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: [GIT PULL] ARM and SH based SoC clocksource update for v3.10
Date:	Mon, 18 Mar 2013 22:02:26 +0900
Message-Id: <1363611758-6655-1-git-send-email-horms+renesas@verge.net.au>

Hi Olof, Hi Arnd,

The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9:

  Linux 3.9-rc2 (2013-03-10 16:54:19 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-clocksource-for-v3.10

for you to fetch changes up to 342896a5c565e38dfb87954f362735f03ae1efb0:

  clocksource: sh_mtu2: Set initcall level to subsys (2013-03-13 02:24:37 +0900)

----------------------------------------------------------------
Renesas ARM and SH based SoC clocksource update for v3.10

I has been agreed by Paul Mundt and myself, that it would be best to take
these changes through the renesas tree and in turn the arm-soc tree.

----------------------------------------------------------------
Magnus Damm (8):
      clocksource: sh_cmt: Take care of clk_put() when setup_irq() fails
      clocksource: sh_cmt: Initialize 'max_match_value' and 'lock' in sh_cmt_setup()
      clocksource: sh_cmt: Introduce per-register functions
      clocksource: sh_cmt: Consolidate platform_set_drvdata() call
      clocksource: sh_cmt: CMSTR and CMCSR register access update
      clocksource: sh_cmt: CMCNT and CMCOR register access update
      clocksource: sh_cmt: Add control register callbacks
      clocksource: sh_cmt: Add CMT register layout comment

Simon Horman (4):
      clocksource: sh_cmt: Set initcall level to subsys
      clocksource: sh_tmu: Set initcall level to subsys
      clocksource: em_sti: Set initcall level to subsys
      clocksource: sh_mtu2: Set initcall level to subsys

 drivers/clocksource/em_sti.c  |   13 ++-
 drivers/clocksource/sh_cmt.c  |  189 +++++++++++++++++++++++++----------------
 drivers/clocksource/sh_mtu2.c |    2 +-
 drivers/clocksource/sh_tmu.c  |    2 +-
 4 files changed, 132 insertions(+), 74 deletions(-)

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-22  0:58       ` Simon Horman
@ 2013-03-22 12:40         ` Arnd Bergmann
  -1 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-22 12:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 22 March 2013, Simon Horman wrote:
> Sorry about sending so many all at once. There were quite a few changes
> queued up and it might have been better if I flushed some of them out
> a bit earlier.
> 
> Of the batch that I sent last week, I think you are missing the following one:
> 

Right, I've pulled it into next/drivers now. Thanks for checking this.

	Arnd

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-22 12:40         ` Arnd Bergmann
  0 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-22 12:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 22 March 2013, Simon Horman wrote:
> Sorry about sending so many all at once. There were quite a few changes
> queued up and it might have been better if I flushed some of them out
> a bit earlier.
> 
> Of the batch that I sent last week, I think you are missing the following one:
> 

Right, I've pulled it into next/drivers now. Thanks for checking this.

	Arnd

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-22 12:40         ` Arnd Bergmann
@ 2013-03-22 13:52           ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-22 13:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
> On Friday 22 March 2013, Simon Horman wrote:
> > Sorry about sending so many all at once. There were quite a few changes
> > queued up and it might have been better if I flushed some of them out
> > a bit earlier.
> > 
> > Of the batch that I sent last week, I think you are missing the following one:
> > 
> 
> Right, I've pulled it into next/drivers now. Thanks for checking this.

Thanks. I now have no outstanding pull requests.

I do have a few new patches in my tree.
I plan to let a few more accumulate before sending the next pull request(s).

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-22 13:52           ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-22 13:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
> On Friday 22 March 2013, Simon Horman wrote:
> > Sorry about sending so many all at once. There were quite a few changes
> > queued up and it might have been better if I flushed some of them out
> > a bit earlier.
> > 
> > Of the batch that I sent last week, I think you are missing the following one:
> > 
> 
> Right, I've pulled it into next/drivers now. Thanks for checking this.

Thanks. I now have no outstanding pull requests.

I do have a few new patches in my tree.
I plan to let a few more accumulate before sending the next pull request(s).

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-22 13:52           ` Simon Horman
@ 2013-03-22 15:39             ` Arnd Bergmann
  -1 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-22 15:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 22 March 2013, Simon Horman wrote:
> On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
> > On Friday 22 March 2013, Simon Horman wrote:
> > > Sorry about sending so many all at once. There were quite a few changes
> > > queued up and it might have been better if I flushed some of them out
> > > a bit earlier.
> > > 
> > > Of the batch that I sent last week, I think you are missing the following one:
> > > 
> > 
> > Right, I've pulled it into next/drivers now. Thanks for checking this.
> 
> Thanks. I now have no outstanding pull requests.
> 
> I do have a few new patches in my tree.
> I plan to let a few more accumulate before sending the next pull request(s).

Ok, sounds good.

One general question about your plans (probably more for Magnus than for you):
What is your expected time line for moving shmobile under
CONFIG_ARCH_MULTIPLATFORM? It seems you are making great progress, but
there is also still a lot to be done.

I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
most of the work would be changing drivers/sh/clk to integrate into the common
clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
AUTO_ZRELADDR. Are those things you think can be done for 3.11?

	Arnd

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-22 15:39             ` Arnd Bergmann
  0 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-22 15:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 22 March 2013, Simon Horman wrote:
> On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
> > On Friday 22 March 2013, Simon Horman wrote:
> > > Sorry about sending so many all at once. There were quite a few changes
> > > queued up and it might have been better if I flushed some of them out
> > > a bit earlier.
> > > 
> > > Of the batch that I sent last week, I think you are missing the following one:
> > > 
> > 
> > Right, I've pulled it into next/drivers now. Thanks for checking this.
> 
> Thanks. I now have no outstanding pull requests.
> 
> I do have a few new patches in my tree.
> I plan to let a few more accumulate before sending the next pull request(s).

Ok, sounds good.

One general question about your plans (probably more for Magnus than for you):
What is your expected time line for moving shmobile under
CONFIG_ARCH_MULTIPLATFORM? It seems you are making great progress, but
there is also still a lot to be done.

I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
most of the work would be changing drivers/sh/clk to integrate into the common
clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
AUTO_ZRELADDR. Are those things you think can be done for 3.11?

	Arnd

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-22 15:39             ` Arnd Bergmann
@ 2013-03-27  5:30               ` Simon Horman
  -1 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-27  5:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 22, 2013 at 03:39:39PM +0000, Arnd Bergmann wrote:
> On Friday 22 March 2013, Simon Horman wrote:
> > On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
> > > On Friday 22 March 2013, Simon Horman wrote:
> > > > Sorry about sending so many all at once. There were quite a few changes
> > > > queued up and it might have been better if I flushed some of them out
> > > > a bit earlier.
> > > > 
> > > > Of the batch that I sent last week, I think you are missing the following one:
> > > > 
> > > 
> > > Right, I've pulled it into next/drivers now. Thanks for checking this.
> > 
> > Thanks. I now have no outstanding pull requests.
> > 
> > I do have a few new patches in my tree.
> > I plan to let a few more accumulate before sending the next pull request(s).
> 
> Ok, sounds good.
> 
> One general question about your plans (probably more for Magnus than for you):

Indeed, it is more for Magnus than I.

> What is your expected time line for moving shmobile under
> CONFIG_ARCH_MULTIPLATFORM? It seems you are making great progress, but
> there is also still a lot to be done.
> 
> I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> most of the work would be changing drivers/sh/clk to integrate into the common
> clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> AUTO_ZRELADDR. Are those things you think can be done for 3.11?

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-27  5:30               ` Simon Horman
  0 siblings, 0 replies; 112+ messages in thread
From: Simon Horman @ 2013-03-27  5:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 22, 2013 at 03:39:39PM +0000, Arnd Bergmann wrote:
> On Friday 22 March 2013, Simon Horman wrote:
> > On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
> > > On Friday 22 March 2013, Simon Horman wrote:
> > > > Sorry about sending so many all at once. There were quite a few changes
> > > > queued up and it might have been better if I flushed some of them out
> > > > a bit earlier.
> > > > 
> > > > Of the batch that I sent last week, I think you are missing the following one:
> > > > 
> > > 
> > > Right, I've pulled it into next/drivers now. Thanks for checking this.
> > 
> > Thanks. I now have no outstanding pull requests.
> > 
> > I do have a few new patches in my tree.
> > I plan to let a few more accumulate before sending the next pull request(s).
> 
> Ok, sounds good.
> 
> One general question about your plans (probably more for Magnus than for you):

Indeed, it is more for Magnus than I.

> What is your expected time line for moving shmobile under
> CONFIG_ARCH_MULTIPLATFORM? It seems you are making great progress, but
> there is also still a lot to be done.
> 
> I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> most of the work would be changing drivers/sh/clk to integrate into the common
> clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> AUTO_ZRELADDR. Are those things you think can be done for 3.11?

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-22 15:39             ` Arnd Bergmann
@ 2013-03-27  9:54               ` Magnus Damm
  -1 siblings, 0 replies; 112+ messages in thread
From: Magnus Damm @ 2013-03-27  9:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

Thanks for your email.

On Sat, Mar 23, 2013 at 12:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 22 March 2013, Simon Horman wrote:
>> On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
>> > On Friday 22 March 2013, Simon Horman wrote:
>> > > Sorry about sending so many all at once. There were quite a few changes
>> > > queued up and it might have been better if I flushed some of them out
>> > > a bit earlier.
>> > >
>> > > Of the batch that I sent last week, I think you are missing the following one:
>> > >
>> >
>> > Right, I've pulled it into next/drivers now. Thanks for checking this.
>>
>> Thanks. I now have no outstanding pull requests.
>>
>> I do have a few new patches in my tree.
>> I plan to let a few more accumulate before sending the next pull request(s).
>
> Ok, sounds good.
>
> One general question about your plans (probably more for Magnus than for you):
> What is your expected time line for moving shmobile under
> CONFIG_ARCH_MULTIPLATFORM? It seems you are making great progress, but
> there is also still a lot to be done.

Indeed, there is still a lot to be done!

> I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> most of the work would be changing drivers/sh/clk to integrate into the common
> clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> AUTO_ZRELADDR. Are those things you think can be done for 3.11?

Good to hear that most ARM platforms will be converted by v3.10. This
is definitely something that I want to make happen for mach-shmobile
as well.

Our biggest challenge now is the move to common clocks. I suspect that
moving all our boards and SoCs to common clocks will take much longer
than v3.11 I'm afraid.

Starting with something smaller like EMEV2 may be a good first step.
So somehow I'd like to start converting them one by one, perhaps also
moving over the converted SoCs/boards to CONFIG_ARCH_MULTIPLATFORM in
an incremental fashion. Do you happen to have any example subarch that
has been migrated in an increment fashion already?

Regarding ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR, I believe those
should be enabled for the mach-shmobile bits that are used with
CONFIG_ARCH_MULTIPLATFORM. Best way forward there is TBD, any
recommendations would be very welcome!

Thanks,

/ magnus

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-27  9:54               ` Magnus Damm
  0 siblings, 0 replies; 112+ messages in thread
From: Magnus Damm @ 2013-03-27  9:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

Thanks for your email.

On Sat, Mar 23, 2013 at 12:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 22 March 2013, Simon Horman wrote:
>> On Fri, Mar 22, 2013 at 12:40:53PM +0000, Arnd Bergmann wrote:
>> > On Friday 22 March 2013, Simon Horman wrote:
>> > > Sorry about sending so many all at once. There were quite a few changes
>> > > queued up and it might have been better if I flushed some of them out
>> > > a bit earlier.
>> > >
>> > > Of the batch that I sent last week, I think you are missing the following one:
>> > >
>> >
>> > Right, I've pulled it into next/drivers now. Thanks for checking this.
>>
>> Thanks. I now have no outstanding pull requests.
>>
>> I do have a few new patches in my tree.
>> I plan to let a few more accumulate before sending the next pull request(s).
>
> Ok, sounds good.
>
> One general question about your plans (probably more for Magnus than for you):
> What is your expected time line for moving shmobile under
> CONFIG_ARCH_MULTIPLATFORM? It seems you are making great progress, but
> there is also still a lot to be done.

Indeed, there is still a lot to be done!

> I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> most of the work would be changing drivers/sh/clk to integrate into the common
> clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> AUTO_ZRELADDR. Are those things you think can be done for 3.11?

Good to hear that most ARM platforms will be converted by v3.10. This
is definitely something that I want to make happen for mach-shmobile
as well.

Our biggest challenge now is the move to common clocks. I suspect that
moving all our boards and SoCs to common clocks will take much longer
than v3.11 I'm afraid.

Starting with something smaller like EMEV2 may be a good first step.
So somehow I'd like to start converting them one by one, perhaps also
moving over the converted SoCs/boards to CONFIG_ARCH_MULTIPLATFORM in
an incremental fashion. Do you happen to have any example subarch that
has been migrated in an increment fashion already?

Regarding ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR, I believe those
should be enabled for the mach-shmobile bits that are used with
CONFIG_ARCH_MULTIPLATFORM. Best way forward there is TBD, any
recommendations would be very welcome!

Thanks,

/ magnus

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-27  9:54               ` Magnus Damm
@ 2013-03-27 11:37                 ` Arnd Bergmann
  -1 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-27 11:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 27 March 2013, Magnus Damm wrote:
> On Sat, Mar 23, 2013 at 12:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 22 March 2013, Simon Horman wrote:
> > I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> > with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> > can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> > most of the work would be changing drivers/sh/clk to integrate into the common
> > clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> > AUTO_ZRELADDR. Are those things you think can be done for 3.11?
> 
> Good to hear that most ARM platforms will be converted by v3.10. This
> is definitely something that I want to make happen for mach-shmobile
> as well.
> 
> Our biggest challenge now is the move to common clocks. I suspect that
> moving all our boards and SoCs to common clocks will take much longer
> than v3.11 I'm afraid.

Ok, I see. If you think it's not likely to be ready for 3.12, we might
need to discuss again whether there is another way of making the
common clk and the sh-clk code coexist. For instance, we could rename
all if the sh/shmobile specific clk functions and their users from
clk_* to shclk_*, and provide a thin wrapper around them that integrates
into common clk.
 
> Starting with something smaller like EMEV2 may be a good first step.
> So somehow I'd like to start converting them one by one, perhaps also
> moving over the converted SoCs/boards to CONFIG_ARCH_MULTIPLATFORM in
> an incremental fashion. Do you happen to have any example subarch that
> has been migrated in an increment fashion already?

We have had a few that were able to do both multiplatform and
single-platform for some time, but then changed to multiplatform-only.
I think mvebu and vt8500 are in this category.

> Regarding ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR, I believe those
> should be enabled for the mach-shmobile bits that are used with
> CONFIG_ARCH_MULTIPLATFORM. Best way forward there is TBD, any
> recommendations would be very welcome!

Yes, makes sense.

What I think you should do is rename CONFIG_ARCH_SHMOBILE to
CONFIG_ARCH_SHMOBILE_SINGLE, and add a new symbol in
arch/arm/mach-shmobile/Kconfig like

config ARCH_SHMOBILE
	bool "Renesas SH-Mobile / R-Mobile" if ARCH_MULTI_V6_V7
	default CONFIG_ARCH_SHMOBILE_SINGLE
        help
          Support for Renesas's SH-Mobile and R-Mobile ARM platforms.

This way, the platform is a non-exclusive option for the multiplatform
case, and a hidden enabled option when building CONFIG_ARCH_SHMOBILE_SINGLE.
Every machine that is not ready for multiplatform can then add "depends on
CONFIG_ARCH_SHMOBILE_SINGLE".

	Arnd

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-03-27 11:37                 ` Arnd Bergmann
  0 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-03-27 11:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 27 March 2013, Magnus Damm wrote:
> On Sat, Mar 23, 2013 at 12:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 22 March 2013, Simon Horman wrote:
> > I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> > with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> > can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> > most of the work would be changing drivers/sh/clk to integrate into the common
> > clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> > AUTO_ZRELADDR. Are those things you think can be done for 3.11?
> 
> Good to hear that most ARM platforms will be converted by v3.10. This
> is definitely something that I want to make happen for mach-shmobile
> as well.
> 
> Our biggest challenge now is the move to common clocks. I suspect that
> moving all our boards and SoCs to common clocks will take much longer
> than v3.11 I'm afraid.

Ok, I see. If you think it's not likely to be ready for 3.12, we might
need to discuss again whether there is another way of making the
common clk and the sh-clk code coexist. For instance, we could rename
all if the sh/shmobile specific clk functions and their users from
clk_* to shclk_*, and provide a thin wrapper around them that integrates
into common clk.
 
> Starting with something smaller like EMEV2 may be a good first step.
> So somehow I'd like to start converting them one by one, perhaps also
> moving over the converted SoCs/boards to CONFIG_ARCH_MULTIPLATFORM in
> an incremental fashion. Do you happen to have any example subarch that
> has been migrated in an increment fashion already?

We have had a few that were able to do both multiplatform and
single-platform for some time, but then changed to multiplatform-only.
I think mvebu and vt8500 are in this category.

> Regarding ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR, I believe those
> should be enabled for the mach-shmobile bits that are used with
> CONFIG_ARCH_MULTIPLATFORM. Best way forward there is TBD, any
> recommendations would be very welcome!

Yes, makes sense.

What I think you should do is rename CONFIG_ARCH_SHMOBILE to
CONFIG_ARCH_SHMOBILE_SINGLE, and add a new symbol in
arch/arm/mach-shmobile/Kconfig like

config ARCH_SHMOBILE
	bool "Renesas SH-Mobile / R-Mobile" if ARCH_MULTI_V6_V7
	default CONFIG_ARCH_SHMOBILE_SINGLE
        help
          Support for Renesas's SH-Mobile and R-Mobile ARM platforms.

This way, the platform is a non-exclusive option for the multiplatform
case, and a hidden enabled option when building CONFIG_ARCH_SHMOBILE_SINGLE.
Every machine that is not ready for multiplatform can then add "depends on
CONFIG_ARCH_SHMOBILE_SINGLE".

	Arnd

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-03-27 11:37                 ` Arnd Bergmann
@ 2013-04-01  9:15                   ` Magnus Damm
  -1 siblings, 0 replies; 112+ messages in thread
From: Magnus Damm @ 2013-04-01  9:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 27, 2013 at 8:37 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wednesday 27 March 2013, Magnus Damm wrote:
> > On Sat, Mar 23, 2013 at 12:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > > On Friday 22 March 2013, Simon Horman wrote:
> > > I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> > > with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> > > can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> > > most of the work would be changing drivers/sh/clk to integrate into the common
> > > clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> > > AUTO_ZRELADDR. Are those things you think can be done for 3.11?
> >
> > Good to hear that most ARM platforms will be converted by v3.10. This
> > is definitely something that I want to make happen for mach-shmobile
> > as well.
> >
> > Our biggest challenge now is the move to common clocks. I suspect that
> > moving all our boards and SoCs to common clocks will take much longer
> > than v3.11 I'm afraid.
>
> Ok, I see. If you think it's not likely to be ready for 3.12, we might
> need to discuss again whether there is another way of making the
> common clk and the sh-clk code coexist. For instance, we could rename
> all if the sh/shmobile specific clk functions and their users from
> clk_* to shclk_*, and provide a thin wrapper around them that integrates
> into common clk.

Yeah, I am not sure if it is likely that we will be able to convert
all platforms at v3.12 timing.

I actually tried to let common clocks and sh-clk coexist when the
common clock framework was under heavy development. I recall it being
far from trivial.

One possible way to develop this could be to force the mach-shmobile
"reference DT" implementations use common clocks and keep the old
boards as-is. Then we can also make sure the "reference DT"
implementations can be used as CONFIG_ARCH_MULTIPLATFORM. So if we
only have "reference DT" code as MULTIPLATFORM and then finally kill
off the old board code one by one.

> > Starting with something smaller like EMEV2 may be a good first step.
> > So somehow I'd like to start converting them one by one, perhaps also
> > moving over the converted SoCs/boards to CONFIG_ARCH_MULTIPLATFORM in
> > an incremental fashion. Do you happen to have any example subarch that
> > has been migrated in an increment fashion already?
>
> We have had a few that were able to do both multiplatform and
> single-platform for some time, but then changed to multiplatform-only.
> I think mvebu and vt8500 are in this category.

Thanks.

> > Regarding ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR, I believe those
> > should be enabled for the mach-shmobile bits that are used with
> > CONFIG_ARCH_MULTIPLATFORM. Best way forward there is TBD, any
> > recommendations would be very welcome!
>
> Yes, makes sense.
>
> What I think you should do is rename CONFIG_ARCH_SHMOBILE to
> CONFIG_ARCH_SHMOBILE_SINGLE, and add a new symbol in
> arch/arm/mach-shmobile/Kconfig like
>
> config ARCH_SHMOBILE
>         bool "Renesas SH-Mobile / R-Mobile" if ARCH_MULTI_V6_V7
>         default CONFIG_ARCH_SHMOBILE_SINGLE
>         help
>           Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
>
> This way, the platform is a non-exclusive option for the multiplatform
> case, and a hidden enabled option when building CONFIG_ARCH_SHMOBILE_SINGLE.
> Every machine that is not ready for multiplatform can then add "depends on
> CONFIG_ARCH_SHMOBILE_SINGLE".

I see, that makes sense. Thanks.

Since we're on the topic of CONFIG_ARCH_MULTIPLATFORM, do you have any
recommendatoin about LPAE?

Judging by the ARM_LPAE help text it seems that selecting ARM_LPAE
will result in a kernel only working on LPAE hardware:

config ARM_LPAE
[snip]
          Say Y if you have an ARMv7 processor supporting the LPAE page
          table format and you would like to access memory beyond the
          4GB limit. The resulting kernel image will not run on
          processors without the LPA extension.

With the above text it sounds to me like we should not to a "select
ARM_LPAE" on each board in the case of CONFIG_ARCH_MULTIPLATFORM.

I sort of expect LPAE to behave similar to x86 PAE. At least the board
DT file should describe all physical memory available and depending on
kernel configuration (HIGHMEM=y/n, LPAE=y/n) we get different amounts
of usable memory in the kernel. Then if LPAE should be selected or not
is something that the distributions have to decide.

Thanks!

/ magnus

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-04-01  9:15                   ` Magnus Damm
  0 siblings, 0 replies; 112+ messages in thread
From: Magnus Damm @ 2013-04-01  9:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 27, 2013 at 8:37 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wednesday 27 March 2013, Magnus Damm wrote:
> > On Sat, Mar 23, 2013 at 12:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > > On Friday 22 March 2013, Simon Horman wrote:
> > > I expect that in 3.10, we will have all ARMv6 and ARMv7 platforms converted,
> > > with the exception of realview, mmp, s5p, msm, and shmobile. I'm sure we
> > > can do realview and mmp for 3.11, possibly also s5p. For shmobile, I think
> > > most of the work would be changing drivers/sh/clk to integrate into the common
> > > clk framework, and you need to find a way to enable ARM_PATCH_PHYS_VIRT and
> > > AUTO_ZRELADDR. Are those things you think can be done for 3.11?
> >
> > Good to hear that most ARM platforms will be converted by v3.10. This
> > is definitely something that I want to make happen for mach-shmobile
> > as well.
> >
> > Our biggest challenge now is the move to common clocks. I suspect that
> > moving all our boards and SoCs to common clocks will take much longer
> > than v3.11 I'm afraid.
>
> Ok, I see. If you think it's not likely to be ready for 3.12, we might
> need to discuss again whether there is another way of making the
> common clk and the sh-clk code coexist. For instance, we could rename
> all if the sh/shmobile specific clk functions and their users from
> clk_* to shclk_*, and provide a thin wrapper around them that integrates
> into common clk.

Yeah, I am not sure if it is likely that we will be able to convert
all platforms at v3.12 timing.

I actually tried to let common clocks and sh-clk coexist when the
common clock framework was under heavy development. I recall it being
far from trivial.

One possible way to develop this could be to force the mach-shmobile
"reference DT" implementations use common clocks and keep the old
boards as-is. Then we can also make sure the "reference DT"
implementations can be used as CONFIG_ARCH_MULTIPLATFORM. So if we
only have "reference DT" code as MULTIPLATFORM and then finally kill
off the old board code one by one.

> > Starting with something smaller like EMEV2 may be a good first step.
> > So somehow I'd like to start converting them one by one, perhaps also
> > moving over the converted SoCs/boards to CONFIG_ARCH_MULTIPLATFORM in
> > an incremental fashion. Do you happen to have any example subarch that
> > has been migrated in an increment fashion already?
>
> We have had a few that were able to do both multiplatform and
> single-platform for some time, but then changed to multiplatform-only.
> I think mvebu and vt8500 are in this category.

Thanks.

> > Regarding ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR, I believe those
> > should be enabled for the mach-shmobile bits that are used with
> > CONFIG_ARCH_MULTIPLATFORM. Best way forward there is TBD, any
> > recommendations would be very welcome!
>
> Yes, makes sense.
>
> What I think you should do is rename CONFIG_ARCH_SHMOBILE to
> CONFIG_ARCH_SHMOBILE_SINGLE, and add a new symbol in
> arch/arm/mach-shmobile/Kconfig like
>
> config ARCH_SHMOBILE
>         bool "Renesas SH-Mobile / R-Mobile" if ARCH_MULTI_V6_V7
>         default CONFIG_ARCH_SHMOBILE_SINGLE
>         help
>           Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
>
> This way, the platform is a non-exclusive option for the multiplatform
> case, and a hidden enabled option when building CONFIG_ARCH_SHMOBILE_SINGLE.
> Every machine that is not ready for multiplatform can then add "depends on
> CONFIG_ARCH_SHMOBILE_SINGLE".

I see, that makes sense. Thanks.

Since we're on the topic of CONFIG_ARCH_MULTIPLATFORM, do you have any
recommendatoin about LPAE?

Judging by the ARM_LPAE help text it seems that selecting ARM_LPAE
will result in a kernel only working on LPAE hardware:

config ARM_LPAE
[snip]
          Say Y if you have an ARMv7 processor supporting the LPAE page
          table format and you would like to access memory beyond the
          4GB limit. The resulting kernel image will not run on
          processors without the LPA extension.

With the above text it sounds to me like we should not to a "select
ARM_LPAE" on each board in the case of CONFIG_ARCH_MULTIPLATFORM.

I sort of expect LPAE to behave similar to x86 PAE. At least the board
DT file should describe all physical memory available and depending on
kernel configuration (HIGHMEM=y/n, LPAE=y/n) we get different amounts
of usable memory in the kernel. Then if LPAE should be selected or not
is something that the distributions have to decide.

Thanks!

/ magnus

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

* Re: [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
  2013-04-01  9:15                   ` Magnus Damm
@ 2013-04-02 10:09                     ` Arnd Bergmann
  -1 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-04-02 10:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 01 April 2013, Magnus Damm wrote:
> On Wed, Mar 27, 2013 at 8:37 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> > Ok, I see. If you think it's not likely to be ready for 3.12, we might
> > need to discuss again whether there is another way of making the
> > common clk and the sh-clk code coexist. For instance, we could rename
> > all if the sh/shmobile specific clk functions and their users from
> > clk_* to shclk_*, and provide a thin wrapper around them that integrates
> > into common clk.
> 
> Yeah, I am not sure if it is likely that we will be able to convert
> all platforms at v3.12 timing.
> 
> I actually tried to let common clocks and sh-clk coexist when the
> common clock framework was under heavy development. I recall it being
> far from trivial.
> 
> One possible way to develop this could be to force the mach-shmobile
> "reference DT" implementations use common clocks and keep the old
> boards as-is. Then we can also make sure the "reference DT"
> implementations can be used as CONFIG_ARCH_MULTIPLATFORM. So if we
> only have "reference DT" code as MULTIPLATFORM and then finally kill
> off the old board code one by one.

Works for me, but wouldn't that mean that half the shmobile boards
become incompatible with the other half, forcing you to build two
separate kernels if you want to run on all the machines?

Maybe that's not a problem for you, since you tend to have per-soc
defconfigs  anyway, and it will only be temporary.

> Since we're on the topic of CONFIG_ARCH_MULTIPLATFORM, do you have any
> recommendatoin about LPAE?
> 
> Judging by the ARM_LPAE help text it seems that selecting ARM_LPAE
> will result in a kernel only working on LPAE hardware:
> 
> config ARM_LPAE
> [snip]
>           Say Y if you have an ARMv7 processor supporting the LPAE page
>           table format and you would like to access memory beyond the
>           4GB limit. The resulting kernel image will not run on
>           processors without the LPA extension.
> 
> With the above text it sounds to me like we should not to a "select
> ARM_LPAE" on each board in the case of CONFIG_ARCH_MULTIPLATFORM.

Correct.

> I sort of expect LPAE to behave similar to x86 PAE. At least the board
> DT file should describe all physical memory available and depending on
> kernel configuration (HIGHMEM=y/n, LPAE=y/n) we get different amounts
> of usable memory in the kernel. Then if LPAE should be selected or not
> is something that the distributions have to decide.

Yes. I believe all distros are planning to build one non-LPAE nd one
LPAE kernel. There will have to be a way to enable all LPAE-capable
platforms in Kconfig, but I don't know if that exists already.

Presumably, the LPAE kernel will also be using THUMB2 in the kernel,
while the non-LPAE kernel may get built with ARMv6 platform support
enabled, which rules out THUMB2.

Also, we could enable KVM support in the non-LPAE kernel, but since 
all KVM capable CPU cores (Cortex-A7 and Cortex-A15) so far also
come with LPAE, that's not even necessary.

You can always use #address-cells=<2> in the DT root node if that
helps, and you can also keep your peripherals using #address-cells=<1>
with an appropriate ranges property in the soc bus node.

	Arnd

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

* [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10
@ 2013-04-02 10:09                     ` Arnd Bergmann
  0 siblings, 0 replies; 112+ messages in thread
From: Arnd Bergmann @ 2013-04-02 10:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 01 April 2013, Magnus Damm wrote:
> On Wed, Mar 27, 2013 at 8:37 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> > Ok, I see. If you think it's not likely to be ready for 3.12, we might
> > need to discuss again whether there is another way of making the
> > common clk and the sh-clk code coexist. For instance, we could rename
> > all if the sh/shmobile specific clk functions and their users from
> > clk_* to shclk_*, and provide a thin wrapper around them that integrates
> > into common clk.
> 
> Yeah, I am not sure if it is likely that we will be able to convert
> all platforms at v3.12 timing.
> 
> I actually tried to let common clocks and sh-clk coexist when the
> common clock framework was under heavy development. I recall it being
> far from trivial.
> 
> One possible way to develop this could be to force the mach-shmobile
> "reference DT" implementations use common clocks and keep the old
> boards as-is. Then we can also make sure the "reference DT"
> implementations can be used as CONFIG_ARCH_MULTIPLATFORM. So if we
> only have "reference DT" code as MULTIPLATFORM and then finally kill
> off the old board code one by one.

Works for me, but wouldn't that mean that half the shmobile boards
become incompatible with the other half, forcing you to build two
separate kernels if you want to run on all the machines?

Maybe that's not a problem for you, since you tend to have per-soc
defconfigs  anyway, and it will only be temporary.

> Since we're on the topic of CONFIG_ARCH_MULTIPLATFORM, do you have any
> recommendatoin about LPAE?
> 
> Judging by the ARM_LPAE help text it seems that selecting ARM_LPAE
> will result in a kernel only working on LPAE hardware:
> 
> config ARM_LPAE
> [snip]
>           Say Y if you have an ARMv7 processor supporting the LPAE page
>           table format and you would like to access memory beyond the
>           4GB limit. The resulting kernel image will not run on
>           processors without the LPA extension.
> 
> With the above text it sounds to me like we should not to a "select
> ARM_LPAE" on each board in the case of CONFIG_ARCH_MULTIPLATFORM.

Correct.

> I sort of expect LPAE to behave similar to x86 PAE. At least the board
> DT file should describe all physical memory available and depending on
> kernel configuration (HIGHMEM=y/n, LPAE=y/n) we get different amounts
> of usable memory in the kernel. Then if LPAE should be selected or not
> is something that the distributions have to decide.

Yes. I believe all distros are planning to build one non-LPAE nd one
LPAE kernel. There will have to be a way to enable all LPAE-capable
platforms in Kconfig, but I don't know if that exists already.

Presumably, the LPAE kernel will also be using THUMB2 in the kernel,
while the non-LPAE kernel may get built with ARMv6 platform support
enabled, which rules out THUMB2.

Also, we could enable KVM support in the non-LPAE kernel, but since 
all KVM capable CPU cores (Cortex-A7 and Cortex-A15) so far also
come with LPAE, that's not even necessary.

You can always use #address-cells=<2> in the DT root node if that
helps, and you can also keep your peripherals using #address-cells=<1>
with an appropriate ranges property in the soc bus node.

	Arnd

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

end of thread, other threads:[~2013-04-02 10:09 UTC | newest]

Thread overview: 112+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-28  2:26 [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 Simon Horman
2012-10-28  2:26 ` Simon Horman
2012-10-28  2:26 ` [PATCH 01/12] ARM: shmobile: r8a7740: Enable PMU Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28 11:28   ` Sergei Shtylyov
2012-10-28 11:28     ` Sergei Shtylyov
2012-10-29  5:11     ` Simon Horman
2012-10-29  5:11       ` Simon Horman
2012-10-28  2:26 ` [PATCH 02/12] ARM: shmobile: kzm9g: enable magnetometer ak8975 Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 03/12] ARM: shmobile: kzm9g: enable three-axis digital accelerometer ADXL345 Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 04/12] ARM: shmobile: kzm9g: enable DMAEngine on SHDI0 and SDHI2 Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 05/12] ARM: mach-shmobile: add FLCTL DMA slave definitions for sh7372 Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 06/12] ARM: shmobile: armadillo800eva: enable restart Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 07/12] ARM: shmobile: r8a7779: add HSPI clock support Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 08/12] ARM: shmobile: r8a7779: add I2C " Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 09/12] ARM: shmobile: r8a7779: add I2C driver support Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 10/12] ARM: shmobile: marzen: add HSPI support Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 11/12] ARM: shmobile: r8a7740: fixup DT machine desc name typo Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  2:26 ` [PATCH 12/12] ARM: mach-shmobile: Use DT_MACHINE for mackerel Simon Horman
2012-10-28  2:26   ` Simon Horman
2012-10-28  9:37   ` Thomas Petazzoni
2012-10-28  9:37     ` Thomas Petazzoni
2012-10-28 10:44     ` Simon Horman
2012-10-28 10:44       ` Simon Horman
2012-10-28 10:57       ` Thomas Petazzoni
2012-10-28 10:57         ` Thomas Petazzoni
2012-11-08  1:27 ` [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #2 Simon Horman
2012-11-08  1:27   ` Simon Horman
2012-11-08  1:27   ` [PATCH 1/7] ARM: shmobile: marzen: add USB phy support Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  1:27   ` [PATCH 2/7] ARM: shmobile: marzen: add USB EHCI driver support Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  1:27   ` [PATCH 3/7] ARM: shmobile: marzen: add USB OHCI " Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  1:27   ` [PATCH 4/7] sh: clkfwk: add sh_clk_fsidiv_register() Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  1:27   ` [PATCH 5/7] ARM: shmobile: sh7372: sh7372_fsidivX_clk become non-global Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  1:27   ` [PATCH 6/7] ARM: shmobile: sh7372: use sh_clk_fsidiv_register() for FSI-DIV clocks Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  1:27   ` [PATCH 7/7] ARM: shmobile: r8a7740: add FSI-DVI clocks Simon Horman
2012-11-08  1:27     ` Simon Horman
2012-11-08  6:29   ` [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #2 Simon Horman
2012-11-08  6:29     ` Simon Horman
2012-11-20  0:43 ` [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #3 Simon Horman
2012-11-20  0:43   ` Simon Horman
2012-11-20  0:43   ` [PATCH] ARM: shmobile: mackerel: Add FLCTL IRQ resource Simon Horman
2012-11-20  0:43     ` Simon Horman
2012-11-21  7:21   ` [GIT PULL v2] Renesas ARM-based SoC boards for v3.8 #3 Olof Johansson
2012-11-21  7:21     ` Olof Johansson
2013-03-19  2:17 ` [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10 Simon Horman
2013-03-19  2:17   ` Simon Horman
2013-03-19  2:17   ` [PATCH 01/13] ARM: shmobile: use GPIO SD-card detection on armadillo800eva Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 02/13] ARM: shmobile: switch SDHI0 to GPIO regulator " Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 03/13] ARM: shmobile: streamline mackerel SD and MMC devices Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 04/13] ARM: shmobile: mark mackerel sh_mmcif_device __maybe_unused Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 05/13] ARM: shmobile: marzen: Reference DT implementation Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 06/13] ARM: shmobile: kzm9g: " Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 07/13] ARM: shmobile: parse DT and configure pinmux early on kzm9g-reference Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 08/13] ARM: shmobile: SDHI and MMCIF interfaces to kzm9g-reference Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 09/13] ARM: shmobile: simplify kzm9g Kconfig dependencies Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 10/13] ARM: shmobile: kzm9g: Remove warning about SMP Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:17   ` [PATCH 11/13] ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START Simon Horman
2013-03-19  2:17     ` Simon Horman
2013-03-19  2:18   ` [PATCH 12/13] ARM: shmobile: marzen: Use gic_iid macro for ICCIAR / interrupt ID Simon Horman
2013-03-19  2:18     ` Simon Horman
2013-03-19  2:18   ` [PATCH 13/13] ARM: shmobile: kzm9g: correct smsc regulator registration Simon Horman
2013-03-19  2:18     ` Simon Horman
2013-03-21 17:18   ` [GIT PULL v2] Renesas ARM-based SoC board updates for v3.10 Arnd Bergmann
2013-03-21 17:18     ` Arnd Bergmann
2013-03-21 19:22     ` Arnd Bergmann
2013-03-21 19:22       ` Arnd Bergmann
2013-03-22  0:32       ` Simon Horman
2013-03-22  0:32         ` Simon Horman
2013-03-22  0:58     ` Simon Horman
2013-03-22  0:58       ` Simon Horman
2013-03-22 12:40       ` Arnd Bergmann
2013-03-22 12:40         ` Arnd Bergmann
2013-03-22 13:52         ` Simon Horman
2013-03-22 13:52           ` Simon Horman
2013-03-22 15:39           ` Arnd Bergmann
2013-03-22 15:39             ` Arnd Bergmann
2013-03-27  5:30             ` Simon Horman
2013-03-27  5:30               ` Simon Horman
2013-03-27  9:54             ` Magnus Damm
2013-03-27  9:54               ` Magnus Damm
2013-03-27 11:37               ` Arnd Bergmann
2013-03-27 11:37                 ` Arnd Bergmann
2013-04-01  9:15                 ` Magnus Damm
2013-04-01  9:15                   ` Magnus Damm
2013-04-02 10:09                   ` Arnd Bergmann
2013-04-02 10:09                     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.