Skip to content

Commit

Permalink
Merge tag 'renesas-boards2-for-v3.14' 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

From Simon Horman:
Second Round of Renesas ARM based SoC Board updates for v3.14

* r8a7791 (R-Car M2) based Koelsch board
  - Let Koelsch multiplatform boot with Koelsch DTB
  - Remove non-multiplatform DT reference support
  - Instantiate clkdevs for SCIF and CMT
  - Remove duplicate CCF initialization
  - Add Ether and DU support

* r8a7790 (R-Car H2) based Lager board
  - Let Lager multiplatform boot with Lager DTB
  - Remove non-multiplatform DT reference support
  - Instantiate clkdevs for SCIF and CMT
  - Enable multiplaform kernel support

* r8a7740 (R-Mobile A1) based Armadillo board
  - Set backlight enable GPIO

* sh7374 (SH-Mobile AP4) based Mackerel board
  - Correct USBHS pinconf entry

* tag 'renesas-boards2-for-v3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (25 commits)
  ARM: shmobile: mackerel: Fix USBHS pinconf entry
  ARM: shmobile: Let Koelsch multiplatform boot with Koelsch DTB
  ARM: shmobile: Let Lager multiplatform boot with Lager DTB
  ARM: shmobile: Remove non-multiplatform Koelsch reference support
  ARM: shmobile: Remove non-multiplatform Lager reference support
  ARM: shmobile: koelsch-reference: Instantiate clkdevs for SCIF and CMT
  ARM: shmobile: lager-reference: Instantiate clkdevs for SCIF and CMT
  ARM: shmobile: koelsch-reference: Remove duplicate CCF initialization
  ARM: shmobile: lager-reference: Enable multiplaform kernel support
  ARM: shmobile: armadillo: Set backlight enable GPIO
  ARM: shmobile: Koelsch: add Ether support
  ARM: shmobile: koelsch: Add DU device
  arm: shmobile: clks: remove duplicated clock from r7s72100
  ARM: shmobile: koelsch: Conditionally select MICREL_PHY
  ARM: shmobile: rcar-gen2: Initialize CCF before clock sources
  ARM: shmobile: r8a7791: Add clock index macros for DT sources
  ARM: shmobile: r8a7790: Add clock index macros for DT sources
  ARM: shmobile: Add select MIGHT_HAVE_PCI for PCI-AHB bridge code
  ARM: shmobile: r8a7778: add USB Func DMAEngine support
  ARM: rcar-gen2: Do not setup timer in non-secure mode
  ...

Signed-off-by: Olof Johansson <[email protected]>
  • Loading branch information
olofj committed Jan 2, 2014
2 parents 160c39a + b58c8e7 commit cf90bb2
Show file tree
Hide file tree
Showing 20 changed files with 547 additions and 44 deletions.
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
r8a7779-marzen-reference.dtb \
r8a7791-koelsch.dtb \
r8a7790-lager.dtb \
r8a7790-lager-reference.dtb \
sh73a0-kzm9g.dtb \
sh73a0-kzm9g-reference.dtb \
r8a73a4-ape6evm.dtb \
r8a73a4-ape6evm-reference.dtb \
sh7372-mackerel.dtb
dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
r7s72100-genmai-reference.dtb \
r8a7791-koelsch-reference.dtb
r8a7791-koelsch.dtb \
r8a7790-lager.dtb
dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \
socfpga_cyclone5_socdk.dtb \
socfpga_cyclone5_sockit.dtb \
Expand Down
35 changes: 13 additions & 22 deletions arch/arm/mach-shmobile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ config ARCH_SHMOBILE_MULTI
select HAVE_SMP
select ARM_GIC
select MIGHT_HAVE_CACHE_L2X0
select MIGHT_HAVE_PCI
select NO_IOPORT
select PINCTRL
select ARCH_REQUIRE_GPIOLIB
Expand All @@ -27,6 +28,10 @@ config ARCH_EMEV2
config ARCH_R7S72100
bool "RZ/A1H (R7S72100)"

config ARCH_R8A7790
bool "R-Car H2 (R8A77900)"
select RENESAS_IRQC

config ARCH_R8A7791
bool "R-Car M2 (R8A77910)"
select RENESAS_IRQC
Expand All @@ -46,6 +51,10 @@ config MACH_KZM9D
depends on ARCH_EMEV2
select REGULATOR_FIXED_VOLTAGE if REGULATOR

config MACH_LAGER
bool "Lager board"
depends on ARCH_R8A7790

comment "Renesas ARM SoCs System Configuration"
endif

Expand Down Expand Up @@ -111,6 +120,7 @@ config ARCH_R8A7790
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_GIC
select CPU_V7
select MIGHT_HAVE_PCI
select SH_CLK_CPG
select RENESAS_IRQC

Expand All @@ -119,6 +129,7 @@ config ARCH_R8A7791
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_GIC
select CPU_V7
select MIGHT_HAVE_PCI
select SH_CLK_CPG
select RENESAS_IRQC

Expand All @@ -127,6 +138,7 @@ config ARCH_EMEV2
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARM_GIC
select CPU_V7
select MIGHT_HAVE_PCI
select USE_OF
select AUTO_ZRELADDR

Expand Down Expand Up @@ -250,32 +262,11 @@ config MACH_LAGER
depends on ARCH_R8A7790
select USE_OF

config MACH_LAGER_REFERENCE
bool "Lager board - Reference Device Tree Implementation"
depends on ARCH_R8A7790
select USE_OF
---help---
Use reference implementation of Lager 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_KOELSCH
bool "Koelsch board"
depends on ARCH_R8A7791
select USE_OF

config MACH_KOELSCH_REFERENCE
bool "Koelsch board - Reference Device Tree Implementation"
depends on ARCH_R8A7791
select USE_OF
---help---
Use reference implementation of Koelsch board support
which makes use of device tree at the expense
of not supporting a number of devices.

This is intended to aid developers
select MICREL_PHY if SH_ETH

config MACH_KZM9G
bool "KZM-A9-GT board"
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-shmobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ 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
obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o
Expand All @@ -70,11 +71,9 @@ obj-$(CONFIG_MACH_GENMAI_REFERENCE) += board-genmai-reference.o
obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
obj-$(CONFIG_MACH_LAGER) += board-lager.o
obj-$(CONFIG_MACH_LAGER_REFERENCE) += board-lager-reference.o
obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
obj-$(CONFIG_MACH_KOELSCH) += board-koelsch.o
obj-$(CONFIG_MACH_KOELSCH_REFERENCE) += board-koelsch-reference.o
obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
obj-$(CONFIG_MACH_KZM9G_REFERENCE) += board-kzm9g-reference.o
endif
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-shmobile/Makefile.boot
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
loadaddr-$(CONFIG_MACH_GENMAI) += 0x08008000
loadaddr-$(CONFIG_MACH_GENMAI_REFERENCE) += 0x08008000
loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000
loadaddr-$(CONFIG_MACH_KOELSCH_REFERENCE) += 0x40008000
loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 0x40008000
loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
Expand Down
5 changes: 1 addition & 4 deletions arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static struct platform_pwm_backlight_data pwm_backlight_data = {
.max_brightness = 255,
.dft_brightness = 255,
.pwm_period_ns = 33333, /* 30kHz */
.enable_gpio = -1,
.enable_gpio = 61,
};

static struct platform_device pwm_backlight_device = {
Expand Down Expand Up @@ -1203,9 +1203,6 @@ static void __init eva_init(void)
r8a7740_pinmux_init();
r8a7740_meram_workaround();

/* LCDC0 */
gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */

/* GETHER */
gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-shmobile/board-bockw.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/mmc/sh_mmcif.h>
#include <linux/mtd/partitions.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/camera-rcar.h>
#include <linux/platform_data/usb-rcar-phy.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
Expand Down
30 changes: 28 additions & 2 deletions arch/arm/mach-shmobile/board-koelsch-reference.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <linux/clk-provider.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <mach/common.h>
Expand All @@ -30,7 +31,31 @@
static void __init koelsch_add_standard_devices(void)
{
#ifdef CONFIG_COMMON_CLK
of_clk_init(NULL);
/*
* This is a really crude hack to provide clkdev support to the SCIF
* and CMT 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",
};
struct clk *clk;
unsigned int i;

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

clk = clk_get(NULL, "cmt0");
if (clk) {
clk_register_clkdev(clk, NULL, "sh_cmt.0");
clk_put(clk);
}
#else
r8a7791_clock_init();
#endif
Expand All @@ -39,6 +64,7 @@ static void __init koelsch_add_standard_devices(void)
}

static const char * const koelsch_boards_compat_dt[] __initconst = {
"renesas,koelsch",
"renesas,koelsch-reference",
NULL,
};
Expand Down
119 changes: 118 additions & 1 deletion arch/arm/mach-shmobile/board-koelsch.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,89 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <linux/dma-mapping.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/phy.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_data/rcar-du.h>
#include <linux/platform_device.h>
#include <linux/sh_eth.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/r8a7791.h>
#include <mach/rcar-gen2.h>
#include <asm/mach-types.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 const struct rcar_du_platform_data koelsch_du_pdata __initconst = {
.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);
}

/* Ether */
static const struct sh_eth_plat_data ether_pdata __initconst = {
.phy = 0x1,
.edmac_endian = EDMAC_LITTLE_ENDIAN,
.phy_interface = PHY_INTERFACE_MODE_RMII,
.ether_link_active_low = 1,
};

static const struct resource ether_resources[] __initconst = {
DEFINE_RES_MEM(0xee700000, 0x400),
DEFINE_RES_IRQ(gic_spi(162)),
};

/* LEDS */
static struct gpio_led koelsch_leds[] = {
{
Expand Down Expand Up @@ -80,6 +149,22 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
};

static const struct pinctrl_map koelsch_pinctrl_map[] = {
/* DU */
PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
"du_rgb666", "du"),
PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
"du_sync", "du"),
PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
"du_clk_out_0", "du"),
/* Ether */
PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791",
"eth_link", "eth"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791",
"eth_mdio", "eth"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791",
"eth_rmii", "eth"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791",
"intc_irq0", "intc"),
/* SCIF0 (CN19: DEBUG SERIAL0) */
PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791",
"scif0_data_d", "scif0"),
Expand All @@ -95,12 +180,44 @@ static void __init koelsch_add_standard_devices(void)
ARRAY_SIZE(koelsch_pinctrl_map));
r8a7791_pinmux_init();
r8a7791_add_standard_devices();
platform_device_register_resndata(&platform_bus, "r8a7791-ether", -1,
ether_resources,
ARRAY_SIZE(ether_resources),
&ether_pdata, sizeof(ether_pdata));
platform_device_register_data(&platform_bus, "leds-gpio", -1,
&koelsch_leds_pdata,
sizeof(koelsch_leds_pdata));
platform_device_register_data(&platform_bus, "gpio-keys", -1,
&koelsch_keys_pdata,
sizeof(koelsch_keys_pdata));

koelsch_add_du_device();
}

/*
* Ether LEDs on the Koelsch board are named LINK and ACTIVE which corresponds
* to non-default 01 setting of the Micrel KSZ8041 PHY control register 1 bits
* 14-15. We have to set them back to 01 from the default 00 value each time
* the PHY is reset. It's also important because the PHY's LED0 signal is
* connected to SoC's ETH_LINK signal and in the PHY's default mode it will
* bounce on and off after each packet, which we apparently want to avoid.
*/
static int koelsch_ksz8041_fixup(struct phy_device *phydev)
{
u16 phyctrl1 = phy_read(phydev, 0x1e);

phyctrl1 &= ~0xc000;
phyctrl1 |= 0x4000;
return phy_write(phydev, 0x1e, phyctrl1);
}

static void __init koelsch_init(void)
{
koelsch_add_standard_devices();

if (IS_ENABLED(CONFIG_PHYLIB))
phy_register_fixup_for_id("r8a7791-ether-ff:01",
koelsch_ksz8041_fixup);
}

static const char * const koelsch_boards_compat_dt[] __initconst = {
Expand All @@ -112,7 +229,7 @@ DT_MACHINE_START(KOELSCH_DT, "koelsch")
.smp = smp_ops(r8a7791_smp_ops),
.init_early = r8a7791_init_early,
.init_time = rcar_gen2_timer_init,
.init_machine = koelsch_add_standard_devices,
.init_machine = koelsch_init,
.init_late = shmobile_init_late,
.dt_compat = koelsch_boards_compat_dt,
MACHINE_END
Loading

0 comments on commit cf90bb2

Please sign in to comment.