Commit 65b108ec authored by Olof Johansson's avatar Olof Johansson

Merge tag 'renesas-boards-for-v3.15' of...

Merge tag 'renesas-boards-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards

Merge "Renesas ARM based SoC Board Updates for v3.15" from Simon Horman:

* r8a7791 (R-Car M2) based Koelsch board
  - Fix error return code check from clk_get()
  - Add SATA0 support
  - Conditionally select MICREL_PHY for Multiplatform

* r8a7790 (R-Car H2) based Lager board
  - Add USBHS support
  - Fix error return code check from clk_get()
  - Add SATA support
  - Make spi_flash_data const
  - Add VIN1 SoC camera support
  - Conditionally select CONFIG_MICREL_PHY

* r8a7778 (R-Car M1) based Bock-W board
  - Add USB Func DMAEngine support
  - Use HPBIF DMAEngine for sound
  - Use SSI DMAEngine for sound

* emev2 (Emma Mobile EV2) based kzm9d board
  - Use common clock framework

* r8a773a0 (SH-Mobile AG5) based kzm9g board
  - Add zboot support

* Many boards
  - Conditionally select SMSC_PHY

* tag 'renesas-boards-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (21 commits)
  ARM: shmobile: Remove Lager USBHS UDC ifdefs
  ARM: shmobile: lager: Add USBHS support
  ARM: shmobile: koelsch: fix error return code check from clk_get()
  ARM: shmobile: lager: fix error return code check from clk_get()
  ARM: shmobile: marzen: Conditionally select SMSC_PHY
  ARM: shmobile: mackerel: Conditionally select SMSC_PHY
  ARM: shmobile: kzm9d: Conditionally select SMSC_PHY
  ARM: shmobile: bockw: Sort Kconfig node's selections
  ARM: shmobile: armadillo800eva: Conditionally select SMSC_PHY
  ARM: shmobile: ape6evm: Conditionally select SMSC_PHY
  ARM: shmobile: koelsch: Add SATA0 support
  ARM: shmobile: lager: Add SATA support
  ARM: shmobile: lager: Make spi_flash_data const
  ARM: shmobile: kzm9d: Use common clock framework
  ARM: shmobile: lager: Add VIN1 SoC camera support
  ARM: mach-shmobile: kzm9g: add zboot support
  ARM: shmobile: koelsch: Conditionally select MICREL_PHY for Multiplatform
  ARM: shmobile: bockw: add USB Func DMAEngine support
  ARM: shmobile: bockw: use HPBIF DMAEngine for sound
  ARM: shmobile: bockw: use SSI DMAEngine for sound
  ...
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 6d0abeca 235cda29
......@@ -45,15 +45,18 @@ config MACH_GENMAI
config MACH_KOELSCH
bool "Koelsch board"
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
select MICREL_PHY if SH_ETH
comment "Renesas ARM SoCs System Configuration"
endif
......@@ -154,11 +157,13 @@ comment "Renesas ARM SoCs Board Type"
config MACH_APE6EVM
bool "APE6EVM board"
depends on ARCH_R8A73A4
select SMSC_PHY if SMSC911X
select USE_OF
config MACH_APE6EVM_REFERENCE
bool "APE6EVM board - Reference Device Tree Implementation"
depends on ARCH_R8A73A4
select SMSC_PHY if SMSC911X
select USE_OF
---help---
Use reference implementation of APE6EVM board support
......@@ -172,6 +177,7 @@ config MACH_MACKEREL
depends on ARCH_SH7372
select ARCH_REQUIRE_GPIOLIB
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select SMSC_PHY if SMSC911X
select SND_SOC_AK4642 if SND_SIMPLE_CARD
select USE_OF
......@@ -180,6 +186,7 @@ config MACH_ARMADILLO800EVA
depends on ARCH_R8A7740
select ARCH_REQUIRE_GPIOLIB
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select SMSC_PHY if SH_ETH
select SND_SOC_WM8978 if SND_SIMPLE_CARD
select USE_OF
......@@ -188,6 +195,7 @@ config MACH_ARMADILLO800EVA_REFERENCE
depends on ARCH_R8A7740
select ARCH_REQUIRE_GPIOLIB
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select SMSC_PHY if SH_ETH
select SND_SOC_WM8978 if SND_SIMPLE_CARD
select USE_OF
---help---
......@@ -201,11 +209,11 @@ config MACH_BOCKW
bool "BOCK-W platform"
depends on ARCH_R8A7778
select ARCH_REQUIRE_GPIOLIB
select RENESAS_INTC_IRQPIN
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select USE_OF
select RENESAS_INTC_IRQPIN
select SND_SOC_AK4554 if SND_SIMPLE_CARD
select SND_SOC_AK4642 if SND_SIMPLE_CARD
select USE_OF
config MACH_BOCKW_REFERENCE
bool "BOCK-W - Reference Device Tree Implementation"
......@@ -242,6 +250,7 @@ config MACH_MARZEN
depends on ARCH_R8A7779
select ARCH_REQUIRE_GPIOLIB
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select SMSC_PHY if SMSC911X
select USE_OF
config MACH_MARZEN_REFERENCE
......@@ -249,6 +258,7 @@ config MACH_MARZEN_REFERENCE
depends on ARCH_R8A7779
select ARCH_REQUIRE_GPIOLIB
select REGULATOR_FIXED_VOLTAGE if REGULATOR
select SMSC_PHY if SMSC911X
select USE_OF
---help---
Use reference implementation of Marzen board support
......@@ -261,6 +271,7 @@ config MACH_LAGER
bool "Lager board"
depends on ARCH_R8A7790
select USE_OF
select MICREL_PHY if SH_ETH
config MACH_KOELSCH
bool "Koelsch board"
......
......@@ -168,6 +168,8 @@ static struct renesas_usbhs_platform_info usbhs_info __initdata = {
},
.driver_param = {
.buswait_bwait = 4,
.d0_tx_id = HPBDMA_SLAVE_USBFUNC_TX,
.d1_rx_id = HPBDMA_SLAVE_USBFUNC_RX,
},
};
......@@ -332,16 +334,24 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
RSND_SSI_UNUSED, /* SSI 0 */
RSND_SSI_UNUSED, /* SSI 1 */
RSND_SSI_UNUSED, /* SSI 2 */
RSND_SSI_SET(1, 0, gic_iid(0x85), RSND_SSI_PLAY),
RSND_SSI_SET(2, 0, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
RSND_SSI_SET(0, 0, gic_iid(0x86), RSND_SSI_PLAY),
RSND_SSI_SET(0, 0, gic_iid(0x86), 0),
RSND_SSI_SET(3, 0, gic_iid(0x86), RSND_SSI_PLAY),
RSND_SSI_SET(4, 0, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
RSND_SSI_SET(1, HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), RSND_SSI_PLAY),
RSND_SSI_SET(2, HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), RSND_SSI_PLAY),
RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
RSND_SSI_SET(3, HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), RSND_SSI_PLAY),
RSND_SSI_SET(4, HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
};
static struct rsnd_scu_platform_info rsnd_scu[9] = {
/* no member at this point */
{ .flags = 0, }, /* SRU 0 */
{ .flags = 0, }, /* SRU 1 */
{ .flags = 0, }, /* SRU 2 */
{ .flags = RSND_SCU_USE_HPBIF, },
{ .flags = RSND_SCU_USE_HPBIF, },
{ .flags = RSND_SCU_USE_HPBIF, },
{ .flags = RSND_SCU_USE_HPBIF, },
{ .flags = RSND_SCU_USE_HPBIF, },
{ .flags = RSND_SCU_USE_HPBIF, },
};
enum {
......
......@@ -45,14 +45,14 @@ static void __init koelsch_add_standard_devices(void)
for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
clk = clk_get(NULL, scif_names[i]);
if (clk) {
if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
clk_put(clk);
}
}
clk = clk_get(NULL, "cmt0");
if (clk) {
if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh_cmt.0");
clk_put(clk);
}
......
......@@ -148,6 +148,21 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
.nbuttons = ARRAY_SIZE(gpio_buttons),
};
/* SATA0 */
static const struct resource sata0_resources[] __initconst = {
DEFINE_RES_MEM(0xee300000, 0x2000),
DEFINE_RES_IRQ(gic_spi(105)),
};
static const struct platform_device_info sata0_info __initconst = {
.parent = &platform_bus,
.name = "sata-r8a7791",
.id = 0,
.res = sata0_resources,
.num_res = ARRAY_SIZE(sata0_resources),
.dma_mask = DMA_BIT_MASK(32),
};
static const struct pinctrl_map koelsch_pinctrl_map[] = {
/* DU */
PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
......@@ -192,6 +207,8 @@ static void __init koelsch_add_standard_devices(void)
sizeof(koelsch_keys_pdata));
koelsch_add_du_device();
platform_device_register_full(&sata0_info);
}
/*
......
......@@ -20,15 +20,14 @@
#include <linux/init.h>
#include <linux/of_platform.h>
#include <linux/clk-provider.h>
#include <mach/emev2.h>
#include <mach/common.h>
#include <asm/mach/arch.h>
static void __init kzm9d_add_standard_devices(void)
{
if (!IS_ENABLED(CONFIG_COMMON_CLK))
emev2_clock_init();
of_clk_init(NULL);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
......
......@@ -44,14 +44,14 @@ static void __init lager_add_standard_devices(void)
for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
clk = clk_get(NULL, scif_names[i]);
if (clk) {
if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
clk_put(clk);
}
}
clk = clk_get(NULL, "cmt0");
if (clk) {
if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh_cmt.0");
clk_put(clk);
}
......
......@@ -27,8 +27,10 @@
#include <linux/mmc/host.h>
#include <linux/mmc/sh_mmcif.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/camera-rcar.h>
#include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_data/rcar-du.h>
#include <linux/platform_data/usb-rcar-gen2-phy.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/regulator/driver.h>
......@@ -36,9 +38,12 @@
#include <linux/regulator/gpio-regulator.h>
#include <linux/regulator/machine.h>
#include <linux/sh_eth.h>
#include <linux/usb/phy.h>
#include <linux/usb/renesas_usbhs.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/r8a7790.h>
#include <media/soc_camera.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <linux/mtd/partitions.h>
......@@ -263,7 +268,7 @@ static struct mtd_partition spi_flash_part[] = {
},
};
static struct flash_platform_data spi_flash_data = {
static const struct flash_platform_data spi_flash_data = {
.name = "m25p80",
.parts = spi_flash_part,
.nr_parts = ARRAY_SIZE(spi_flash_part),
......@@ -291,6 +296,198 @@ static const struct resource qspi_resources[] __initconst = {
DEFINE_RES_IRQ(gic_spi(184)),
};
/* VIN */
static const struct resource vin_resources[] __initconst = {
/* VIN0 */
DEFINE_RES_MEM(0xe6ef0000, 0x1000),
DEFINE_RES_IRQ(gic_spi(188)),
/* VIN1 */
DEFINE_RES_MEM(0xe6ef1000, 0x1000),
DEFINE_RES_IRQ(gic_spi(189)),
};
static void __init lager_add_vin_device(unsigned idx,
struct rcar_vin_platform_data *pdata)
{
struct platform_device_info vin_info = {
.parent = &platform_bus,
.name = "r8a7790-vin",
.id = idx,
.res = &vin_resources[idx * 2],
.num_res = 2,
.dma_mask = DMA_BIT_MASK(32),
.data = pdata,
.size_data = sizeof(*pdata),
};
BUG_ON(idx > 1);
platform_device_register_full(&vin_info);
}
#define LAGER_CAMERA(idx, name, addr, pdata, flag) \
static struct i2c_board_info i2c_cam##idx##_device = { \
I2C_BOARD_INFO(name, addr), \
}; \
\
static struct rcar_vin_platform_data vin##idx##_pdata = { \
.flags = flag, \
}; \
\
static struct soc_camera_link cam##idx##_link = { \
.bus_id = idx, \
.board_info = &i2c_cam##idx##_device, \
.i2c_adapter_id = 2, \
.module_name = name, \
.priv = pdata, \
}
/* Camera 0 is not currently supported due to adv7612 support missing */
LAGER_CAMERA(1, "adv7180", 0x20, NULL, RCAR_VIN_BT656);
static void __init lager_add_camera1_device(void)
{
platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
&cam1_link, sizeof(cam1_link));
lager_add_vin_device(1, &vin1_pdata);
}
/* SATA1 */
static const struct resource sata1_resources[] __initconst = {
DEFINE_RES_MEM(0xee500000, 0x2000),
DEFINE_RES_IRQ(gic_spi(106)),
};
static const struct platform_device_info sata1_info __initconst = {
.parent = &platform_bus,
.name = "sata-r8a7790",
.id = 1,
.res = sata1_resources,
.num_res = ARRAY_SIZE(sata1_resources),
.dma_mask = DMA_BIT_MASK(32),
};
/* USBHS */
static const struct resource usbhs_resources[] __initconst = {
DEFINE_RES_MEM(0xe6590000, 0x100),
DEFINE_RES_IRQ(gic_spi(107)),
};
struct usbhs_private {
struct renesas_usbhs_platform_info info;
struct usb_phy *phy;
};
#define usbhs_get_priv(pdev) \
container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info)
static int usbhs_power_ctrl(struct platform_device *pdev,
void __iomem *base, int enable)
{
struct usbhs_private *priv = usbhs_get_priv(pdev);
if (!priv->phy)
return -ENODEV;
if (enable) {
int retval = usb_phy_init(priv->phy);
if (!retval)
retval = usb_phy_set_suspend(priv->phy, 0);
return retval;
}
usb_phy_set_suspend(priv->phy, 1);
usb_phy_shutdown(priv->phy);
return 0;
}
static int usbhs_hardware_init(struct platform_device *pdev)
{
struct usbhs_private *priv = usbhs_get_priv(pdev);
struct usb_phy *phy;
phy = usb_get_phy_dev(&pdev->dev, 0);
if (IS_ERR(phy))
return PTR_ERR(phy);
priv->phy = phy;
return 0;
}
static int usbhs_hardware_exit(struct platform_device *pdev)
{
struct usbhs_private *priv = usbhs_get_priv(pdev);
if (!priv->phy)
return 0;
usb_put_phy(priv->phy);
priv->phy = NULL;
return 0;
}
static int usbhs_get_id(struct platform_device *pdev)
{
return USBHS_GADGET;
}
static u32 lager_usbhs_pipe_type[] = {
USB_ENDPOINT_XFER_CONTROL,
USB_ENDPOINT_XFER_ISOC,
USB_ENDPOINT_XFER_ISOC,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_INT,
USB_ENDPOINT_XFER_INT,
USB_ENDPOINT_XFER_INT,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
USB_ENDPOINT_XFER_BULK,
};
static struct usbhs_private usbhs_priv __initdata = {
.info = {
.platform_callback = {
.power_ctrl = usbhs_power_ctrl,
.hardware_init = usbhs_hardware_init,
.hardware_exit = usbhs_hardware_exit,
.get_id = usbhs_get_id,
},
.driver_param = {
.buswait_bwait = 4,
.pipe_type = lager_usbhs_pipe_type,
.pipe_size = ARRAY_SIZE(lager_usbhs_pipe_type),
},
}
};
static void __init lager_register_usbhs(void)
{
usb_bind_phy("renesas_usbhs", 0, "usb_phy_rcar_gen2");
platform_device_register_resndata(&platform_bus,
"renesas_usbhs", -1,
usbhs_resources,
ARRAY_SIZE(usbhs_resources),
&usbhs_priv.info,
sizeof(usbhs_priv.info));
}
/* USBHS PHY */
static const struct rcar_gen2_phy_platform_data usbhs_phy_pdata __initconst = {
.chan0_pci = 0, /* Channel 0 is USBHS */
.chan2_pci = 1, /* Channel 2 is PCI USB */
};
static const struct resource usbhs_phy_resources[] __initconst = {
DEFINE_RES_MEM(0xe6590100, 0x100),
};
static const struct pinctrl_map lager_pinctrl_map[] = {
/* DU (CN10: ARGB0, CN13: LVDS) */
PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
......@@ -319,6 +516,25 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
"eth_rmii", "eth"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
"intc_irq0", "intc"),
/* VIN0 */
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
"vin0_data24", "vin0"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
"vin0_sync", "vin0"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
"vin0_field", "vin0"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
"vin0_clkenb", "vin0"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
"vin0_clk", "vin0"),
/* VIN1 */
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
"vin1_data8", "vin1"),
PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
"vin1_clk", "vin1"),
/* USB0 */
PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7790",
"usb0", "usb0"),
};
static void __init lager_add_standard_devices(void)
......@@ -368,6 +584,17 @@ static void __init lager_add_standard_devices(void)
&vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
&vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
lager_add_camera1_device();
platform_device_register_full(&sata1_info);
platform_device_register_resndata(&platform_bus, "usb_phy_rcar_gen2",
-1, usbhs_phy_resources,
ARRAY_SIZE(usbhs_phy_resources),
&usbhs_phy_pdata,
sizeof(usbhs_phy_pdata));
lager_register_usbhs();
}
/*
......
This diff is collapsed.
......@@ -12,6 +12,9 @@
#ifdef CONFIG_MACH_MACKEREL
#define MEMORY_START 0x40000000
#include "mach/head-mackerel.txt"
#elif defined(CONFIG_MACH_KZM9G) || defined(CONFIG_MACH_KZM9G_REFERENCE)
#define MEMORY_START 0x43000000
#include "mach/head-kzm9g.txt"
#else
#error "unsupported board."
#endif
......
......@@ -62,4 +62,47 @@
2 :
.endm
/* loop until a given value has been read (with mask) */
.macro WAIT_MASK, addr, data, cmp
LDR r0, 2f
LDR r1, 3f
LDR r2, 4f
1:
LDR r3, [r0, #0]
AND r3, r1, r3
CMP r2, r3
BNE 1b
B 5f
2: .long \addr
3: .long \data
4: .long \cmp
5:
.endm
/* read 32-bit value from addr, "or" an immediate and write back */
.macro ED_OR, addr, data
LDR r4, 1f
LDR r5, 2f
LDR r6, [r4]
ORR r5, r6, r5
STR r5, [r4]
B 3f
1: .long \addr
2: .long \data
3:
.endm
/* read 32-bit value from addr, "and" an immediate and write back */
.macro ED_AND, addr, data
LDR r4, 1f
LDR r5, 2f
LDR r6, [r4]
AND r5, r6, r5
STR r5, [r4]
B 3f
1: .long \addr
2: .long \data
3:
.endm
#endif /* __ZBOOT_MACRO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment