Skip to content

Commit

Permalink
Merge tag 'renesas-boards3-for-v3.15' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/horms/renesas into next/boards

Merge "Third Round of Renesas ARM Based SoC Boards Updates for v3.15" from
Simon Horman:

* r7s72100 SoC (RZ/A1H) based Genmai board
  - Set proper DMA masks for Ether device

* r8a7791 (R-Car M2) based Koelsch board
  - Remove Koelsch DT reference legacy clock bits
  - Set proper DMA masks for Ether device
  - Add DU device to koelsch-reference
  - Refactor clock lookup hack in koelsch-reference
  - Add SDHI devices

* r8a7790 (R-Car H2) based Lager board
  - Remove Lager DT reference legacy clock bits
  - Set proper DMA masks for Ether device
  - Add internal USB PCI support
  - Add QSPI pinmux
  - Sdd SDHI0/2 support

* emev2 (Emma Mobile EV2) based kzm9d board
  - Remove KZM9D board code

* r8a7778 (R-Car M1) based bock-w board
  - Set proper DMA masks for Ether device

* r8a7740 (R-Mobile A1) based Armadillo 800 EVA board
  - Set proper DMA masks for Ether device

* tag 'renesas-boards3-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: Remove Lager DT reference legacy clock bits
  ARM: shmobile: Remove Koelsch DT reference legacy clock bits
  ARM: shmobile: Remove KZM9D board code
  ARM: shmobile: Genmai: set proper DMA masks for Ether device
  ARM: shmobile: Koelsch: set proper DMA masks for Ether device
  ARM: shmobile: Lager: set proper DMA masks for Ether device
  ARM: shmobile: BOCK-W: set proper DMA masks for Ether device
  ARM: shmobile: Armadillo 800 EVA: set proper DMA masks for Ether device
  ARM: shmobile: koelsch-reference: Add DU device
  ARM: shmobile: koelsch-reference: Refactor clock lookup hack
  ARM: shmobile: lager-reference: Add DU device
  ARM: shmobile: lager-reference: Refactor clock lookup hack
  ARM: shmobile: lager: Add internal USB PCI support
  ARM: shmobile: lager legacy: Add QSPI pinmux
  ARM: shmobile: lager: add SDHI0/2 support
  ARM: shmobile: Add SDHI devices for legacy Koelsch

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
olofj committed Mar 17, 2014
2 parents 79c3766 + 6197c08 commit d898932
Show file tree
Hide file tree
Showing 10 changed files with 506 additions and 113 deletions.
6 changes: 0 additions & 6 deletions arch/arm/mach-shmobile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ config MACH_KOELSCH
depends on ARCH_R8A7791
select MICREL_PHY if SH_ETH

config MACH_KZM9D
bool "KZM9D board"
depends on ARCH_EMEV2
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select SMSC_PHY if SMSC911X

config MACH_LAGER
bool "Lager board"
depends on ARCH_R8A7790
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-shmobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
ifdef CONFIG_ARCH_SHMOBILE_MULTI
obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o
obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o
obj-$(CONFIG_MACH_KZM9D) += board-kzm9d-reference.o
obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o
else
obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ static struct platform_device sh_eth_device = {
.id = -1,
.dev = {
.platform_data = &sh_eth_platdata,
.dma_mask = &sh_eth_device.dev.coherent_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.resource = sh_eth_resources,
.num_resources = ARRAY_SIZE(sh_eth_resources),
Expand Down
21 changes: 14 additions & 7 deletions arch/arm/mach-shmobile/board-bockw.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Bock-W board support
*
* Copyright (C) 2013 Renesas Solutions Corp.
* Copyright (C) 2013-2014 Renesas Solutions Corp.
* Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
* Copyright (C) 2013 Cogent Embedded, Inc.
* Copyright (C) 2013-2014 Cogent Embedded, Inc.
*
* 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
Expand Down Expand Up @@ -235,6 +235,17 @@ static struct sh_eth_plat_data ether_platform_data __initdata = {
.no_ether_link = 1,
};

static struct platform_device_info ether_info __initdata = {
.parent = &platform_bus,
.name = "r8a777x-ether",
.id = -1,
.res = ether_resources,
.num_res = ARRAY_SIZE(ether_resources),
.data = &ether_platform_data,
.size_data = sizeof(ether_platform_data),
.dma_mask = DMA_BIT_MASK(32),
};

/* I2C */
static struct i2c_board_info i2c0_devices[] = {
{
Expand Down Expand Up @@ -592,11 +603,7 @@ static void __init bockw_init(void)
r8a7778_init_irq_extpin(1);
r8a7778_add_standard_devices();

platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
ether_resources,
ARRAY_SIZE(ether_resources),
&ether_platform_data,
sizeof(ether_platform_data));
platform_device_register_full(&ether_info);

platform_device_register_full(&vin0_info);
/* VIN1 has a pin conflict with Ether */
Expand Down
19 changes: 14 additions & 5 deletions arch/arm/mach-shmobile/board-genmai.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* Genmai board support
*
* Copyright (C) 2013 Renesas Solutions Corp.
* Copyright (C) 2013-2014 Renesas Solutions Corp.
* Copyright (C) 2013 Magnus Damm
* Copyright (C) 2014 Cogent Embedded, Inc.
*
* 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
Expand Down Expand Up @@ -43,6 +44,17 @@ static const struct resource ether_resources[] __initconst = {
DEFINE_RES_IRQ(gic_iid(359)),
};

static const struct platform_device_info ether_info __initconst = {
.parent = &platform_bus,
.name = "r7s72100-ether",
.id = -1,
.res = ether_resources,
.num_res = ARRAY_SIZE(ether_resources),
.data = &ether_pdata,
.size_data = sizeof(ether_pdata),
.dma_mask = DMA_BIT_MASK(32),
};

/* RSPI */
#define RSPI_RESOURCE(idx, baseaddr, irq) \
static const struct resource rspi##idx##_resources[] __initconst = { \
Expand Down Expand Up @@ -82,10 +94,7 @@ static void __init genmai_add_standard_devices(void)
r7s72100_clock_init();
r7s72100_add_dt_devices();

platform_device_register_resndata(&platform_bus, "r7s72100-ether", -1,
ether_resources,
ARRAY_SIZE(ether_resources),
&ether_pdata, sizeof(ether_pdata));
platform_device_register_full(&ether_info);

r7s72100_register_rspi(0);
r7s72100_register_rspi(1);
Expand Down
104 changes: 86 additions & 18 deletions arch/arm/mach-shmobile/board-koelsch-reference.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,114 @@

#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <linux/platform_data/rcar-du.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/rcar-gen2.h>
#include <mach/r8a7791.h>
#include <asm/mach/arch.h>

/* DU */
static struct rcar_du_encoder_data koelsch_du_encoders[] = {
{
.type = RCAR_DU_ENCODER_NONE,
.output = RCAR_DU_OUTPUT_LVDS0,
.connector.lvds.panel = {
.width_mm = 210,
.height_mm = 158,
.mode = {
.clock = 65000,
.hdisplay = 1024,
.hsync_start = 1048,
.hsync_end = 1184,
.htotal = 1344,
.vdisplay = 768,
.vsync_start = 771,
.vsync_end = 777,
.vtotal = 806,
.flags = 0,
},
},
},
};

static struct rcar_du_platform_data koelsch_du_pdata = {
.encoders = koelsch_du_encoders,
.num_encoders = ARRAY_SIZE(koelsch_du_encoders),
};

static const struct resource du_resources[] __initconst = {
DEFINE_RES_MEM(0xfeb00000, 0x40000),
DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
DEFINE_RES_IRQ(gic_spi(256)),
DEFINE_RES_IRQ(gic_spi(268)),
};

static void __init koelsch_add_du_device(void)
{
struct platform_device_info info = {
.name = "rcar-du-r8a7791",
.id = -1,
.res = du_resources,
.num_res = ARRAY_SIZE(du_resources),
.data = &koelsch_du_pdata,
.size_data = sizeof(koelsch_du_pdata),
.dma_mask = DMA_BIT_MASK(32),
};

platform_device_register_full(&info);
}

static void __init koelsch_add_standard_devices(void)
{
#ifdef CONFIG_COMMON_CLK
/*
* This is a really crude hack to provide clkdev support to the SCIF
* and CMT devices until they get moved to DT.
* This is a really crude hack to provide clkdev support to the CMT and
* DU devices until they get moved to DT.
*/
static const char * const scif_names[] = {
"scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifa2",
"scif0", "scif1", "scif2", "scif3", "scif4", "scif5", "scifa3",
"scifa4", "scifa5",
static const struct clk_name {
const char *clk;
const char *con_id;
const char *dev_id;
} clk_names[] = {
{ "cmt0", NULL, "sh_cmt.0" },
{ "scifa0", NULL, "sh-sci.0" },
{ "scifa1", NULL, "sh-sci.1" },
{ "scifb0", NULL, "sh-sci.2" },
{ "scifb1", NULL, "sh-sci.3" },
{ "scifb2", NULL, "sh-sci.4" },
{ "scifa2", NULL, "sh-sci.5" },
{ "scif0", NULL, "sh-sci.6" },
{ "scif1", NULL, "sh-sci.7" },
{ "scif2", NULL, "sh-sci.8" },
{ "scif3", NULL, "sh-sci.9" },
{ "scif4", NULL, "sh-sci.10" },
{ "scif5", NULL, "sh-sci.11" },
{ "scifa3", NULL, "sh-sci.12" },
{ "scifa4", NULL, "sh-sci.13" },
{ "scifa5", NULL, "sh-sci.14" },
{ "du0", "du.0", "rcar-du-r8a7791" },
{ "du1", "du.1", "rcar-du-r8a7791" },
{ "lvds0", "lvds.0", "rcar-du-r8a7791" },
};
struct clk *clk;
unsigned int i;

for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
clk = clk_get(NULL, scif_names[i]);
for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
clk = clk_get(NULL, clk_names[i].clk);
if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
clk_register_clkdev(clk, clk_names[i].con_id,
clk_names[i].dev_id);
clk_put(clk);
}
}

clk = clk_get(NULL, "cmt0");
if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh_cmt.0");
clk_put(clk);
}
#else
r8a7791_clock_init();
#endif
r8a7791_add_dt_devices();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);

koelsch_add_du_device();
}

static const char * const koelsch_boards_compat_dt[] __initconst = {
Expand Down
Loading

0 comments on commit d898932

Please sign in to comment.