Skip to contentSkip to conversation

Renesas ARM-based SoC boards for v3.8

GIT PULL New Simon Horman 3 participants 18 messages Oct 28, 2012 – Oct 29, 2012

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

PATCH 1/12 ARM: shmobile: r8a7740: Enable PMU

From: Nobuhiro Iwamatsu <[email protected]>

This patch enables PMU for r8a7740.

---
 arch/arm/configs/armadillo800eva_defconfig |    1 +
 arch/arm/mach-shmobile/setup-r8a7740.c     |   16 ++++++++++++++++
 2 files changed, 17 insertions(+)
arch/arm/configs/armadillo800eva_defconfig +1 -0
index f78d259..3d76407 100644
@@ -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
arch/arm/mach-shmobile/setup-r8a7740.c +16 -0
index 11bb1d9..1e032cb 100644
@@ -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,
 };
 
 /*
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 1/12 ARM: shmobile: r8a7740: Enable PMU

Hello.

Quoted 3 lines · Simon Horman

From: Nobuhiro Iwamatsu <[email protected]>

This patch enables PMU for r8a7740.

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

Quoted 2 lines

[...]

Quoted 9 lines
arch/arm/mach-shmobile/setup-r8a7740.c +1 -0
index 11bb1d9..1e032cb 100644
@@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
  	.num_resources	= ARRAY_SIZE(i2c1_resources),
  };
 
+static struct resource pmu_resources[] = {

arch/arm/mach-shmobile/setup-r8a7740.c static struct platform_device i2c1_device = { · line 603

Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7740.c +10 -0
+	[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. :-)

arch/arm/mach-shmobile/setup-r8a7740.c static struct platform_device i2c1_device = { · line 610

Quoted 7 lines
arch/arm/mach-shmobile/setup-r8a7740.c +4 -0
+	.num_resources = ARRAY_SIZE(pmu_resources),
+	.resource = pmu_resources,
+};
+
  static struct platform_device *r8a7740_late_devices[] __initdata = {
  	&i2c0_device,
  	&i2c1_device,

WBR, Sergei

#3 lore raw

PATCH 1/12 ARM: shmobile: r8a7740: Enable PMU

Quoted 10 lines · Sergei Shtylyov

Hello.

Quoted 3 lines · Simon Horman

From: Nobuhiro Iwamatsu <[email protected]>

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.

Quoted 12 lines
Quoted 2 lines

[...]

Quoted 8 lines
arch/arm/mach-shmobile/setup-r8a7740.c +0 -0
index 11bb1d9..1e032cb 100644
@@ -590,6 +590,21 @@ static struct platform_device i2c1_device = {
 	.num_resources	= ARRAY_SIZE(i2c1_resources),
 };
 
Quoted 14 lines

arch/arm/mach-shmobile/setup-r8a7740.c static struct platform_device i2c1_device = { · line 603

Quoted 11 lines
arch/arm/mach-shmobile/setup-r8a7740.c +11 -0
+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.

Quoted 10 lines

arch/arm/mach-shmobile/setup-r8a7740.c static struct platform_device i2c1_device = { · line 610

Quoted 7 lines
arch/arm/mach-shmobile/setup-r8a7740.c +4 -0
+	.num_resources = ARRAY_SIZE(pmu_resources),
+	.resource = pmu_resources,
+};
+
 static struct platform_device *r8a7740_late_devices[] __initdata = {
 	&i2c0_device,
 	&i2c1_device,

WBR, Sergei

#4 lore raw

PATCH 2/12 ARM: shmobile: kzm9g: enable magnetometer ak8975.

In reply to Simon Horman

From: Tetsuyuki Kobayashi <[email protected]>

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

---
 arch/arm/configs/kzm9g_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-kzm9g.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/configs/kzm9g_defconfig +2 -0
index c88b578..1404b04 100644
@@ -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
arch/arm/mach-shmobile/board-kzm9g.c +5 -1
index 0a43f31..a37da78 100644
@@ -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[] = {
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 3/12 ARM: shmobile: kzm9g: enable three-axis digital accelerometer ADXL345

In reply to Simon Horman

From: Tetsuyuki Kobayashi <[email protected]>

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.

---
 arch/arm/configs/kzm9g_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++++
 2 files changed, 6 insertions(+)
arch/arm/configs/kzm9g_defconfig +2 -0
index 1404b04..ce99e3e 100644
@@ -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
arch/arm/mach-shmobile/board-kzm9g.c +4 -0
index a37da78..1a46422 100644
@@ -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[] = {
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 4/12 ARM: shmobile: kzm9g: enable DMAEngine on SHDI0 and SDHI2

In reply to Simon Horman

From: Tetsuyuki Kobayashi <[email protected]>

This patch enables DMAEngine on SHDI0 and SDHI2 for kzm9g.

---
 arch/arm/mach-shmobile/board-kzm9g.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-shmobile/board-kzm9g.c +4 -0
index 1a46422..f63f2ee 100644
@@ -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,
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH 5/12 ARM: mach-shmobile: add FLCTL DMA slave definitions for sh7372

In reply to Simon Horman

From: Bastian Hecht <[email protected]>

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

---
 arch/arm/mach-shmobile/include/mach/sh7372.h |    4 ++++
 arch/arm/mach-shmobile/setup-sh7372.c        |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)
arch/arm/mach-shmobile/include/mach/sh7372.h +4 -0
index eb98b45..d65fbbe 100644
@@ -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,
arch/arm/mach-shmobile/setup-sh7372.c +20 -0
index a07954f..a360111 100644
@@ -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),
Signature · 1 line
1.7.10.4
#8 lore raw

PATCH 6/12 ARM: shmobile: armadillo800eva: enable restart

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm/mach-shmobile/board-armadillo800eva.c |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +8 -0
index 2912eab..fe27d7e 100644
@@ -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
Signature · 1 line
1.7.10.4
#9 lore raw

PATCH 7/12 ARM: shmobile: r8a7779: add HSPI clock support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm/mach-shmobile/clock-r8a7779.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-shmobile/clock-r8a7779.c +5 -0
index 3cafb6a..90d717b 100644
@@ -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 */
Signature · 1 line
1.7.10.4
#10 lore raw

PATCH 8/12 ARM: shmobile: r8a7779: add I2C clock support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

This patch is required from R-Car I2C driver

---
 arch/arm/mach-shmobile/clock-r8a7779.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/clock-r8a7779.c +10 -1
index 90d717b..24f5a84 100644
@@ -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 */
Signature · 1 line
1.7.10.4
#11 lore raw

PATCH 9/12 ARM: shmobile: r8a7779: add I2C driver support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

This patch enable R-Car I2C driver

---
 arch/arm/configs/marzen_defconfig      |    2 +
 arch/arm/mach-shmobile/setup-r8a7779.c |   77 ++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
arch/arm/configs/marzen_defconfig +2 -0
index 53382b6..f79b55c 100644
@@ -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
arch/arm/mach-shmobile/setup-r8a7779.c +77 -0

89 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#12 lore raw

PATCH 10/12 ARM: shmobile: marzen: add HSPI support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm/configs/marzen_defconfig     |    2 ++
 arch/arm/mach-shmobile/board-marzen.c |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
arch/arm/configs/marzen_defconfig +2 -0
index f79b55c..5b8215f 100644
@@ -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
arch/arm/mach-shmobile/board-marzen.c +25 -0
index b8a7525..69f7f46 100644
@@ -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));
 }
Signature · 1 line
1.7.10.4
#13 lore raw

PATCH 11/12 ARM: shmobile: r8a7740: fixup DT machine desc name typo

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

r8a7740 machine desc name should be R8A7740,
not SH7372

---
 arch/arm/mach-shmobile/setup-r8a7740.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-r8a7740.c +1 -1
index 1e032cb..6649a77 100644
@@ -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,
Signature · 1 line
1.7.10.4
#14 lore raw

PATCH 12/12 ARM: mach-shmobile: Use DT_MACHINE for mackerel

In reply to Simon Horman

From: Nobuhiro Iwamatsu <[email protected]>

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.

---
 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
arch/arm/boot/dts/Makefile +2 -1
index c1ce813..0632239 100644
@@ -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 \
arch/arm/boot/dts/sh7372-mackerel.dts new file +22 -0
new file mode 100644
index 0000000..286f0ca
@@ -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>;
+	};
+};
arch/arm/mach-shmobile/Kconfig +1 -0
index 8ae100c..0750d9c 100644
@@ -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"
arch/arm/mach-shmobile/board-mackerel.c +7 -1
index 0c27c81..39b8f2e 100644
@@ -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
Signature · 1 line
1.7.10.4
#15 lore raw

PATCH 12/12 ARM: mach-shmobile: Use DT_MACHINE for mackerel

Dear Simon Horman,

Quoted 11 lines · Simon Horman
arch/arm/mach-shmobile/board-mackerel.c +6 -1
-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,

arch/arm/mach-shmobile/board-mackerel.c MACHINE_START(MACKEREL, "mackerel") · line 1668

Quoted 5 lines
arch/arm/mach-shmobile/board-mackerel.c +1 -0
@@ -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

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#16 lore raw

PATCH 12/12 ARM: mach-shmobile: Use DT_MACHINE for mackerel

Quoted 33 lines · Thomas Petazzoni

Dear Simon Horman,

Quoted 11 lines · Simon Horman
arch/arm/mach-shmobile/board-mackerel.c +6 -1
-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,

arch/arm/mach-shmobile/board-mackerel.c MACHINE_START(MACKEREL, "mackerel") · line 1668

Quoted 5 lines
arch/arm/mach-shmobile/board-mackerel.c +1 -0
@@ -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.

Quoted 4 lines

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.

#17 lore raw

PATCH 12/12 ARM: mach-shmobile: Use DT_MACHINE for mackerel

Simon,

Quoted 4 lines · Simon Horman

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

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