]> Git Repo - linux.git/commitdiff
Merge tag 'renesas-soc2-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorOlof Johansson <[email protected]>
Sat, 15 Jun 2013 01:00:00 +0000 (18:00 -0700)
committerOlof Johansson <[email protected]>
Sat, 15 Jun 2013 01:00:00 +0000 (18:00 -0700)
From Simon Horman:
Second Round of Renesas ARM-based SoC updates for v3.11

* Ether device name updates for r8a7778 and r8a7779 Sergei Shtylyov
* Extended clock and driver coverage for r8a7778 by Goda-san and Morimoto-san
* Extended clock and coverage for r8a73a4 and r8a7790 by  Guennadi Liakhovetski
* HSCIF support for r8a7790 by Ulrich Hecht

* tag 'renesas-soc2-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7790: add clock definitions and aliases for MMCIF and SDHI
  ARM: shmobile: r8a73a4: add clock definitions and aliases for MMCIF and SDHI
  ARM: shmobile: r8a7778: add support MMC driver
  ARM: shmobile: r8a7778: add support HSPI driver
  ARM: shmobile: r8a7778: add support I2C driver
  ARM: shmobile: r8a7778: add support MMC clock
  ARM: shmobile: r8a7778: add support HSPI clock
  ARM: shmobile: r8a7778: add support I2C clock
  ARM: shmobile: r8a7790: HSCIF support
  ARM: shmobile: r8a7778: fix Ether device name
  ARM: shmobile: r8a7779: fix Ether device name

Signed-off-by: Olof Johansson <[email protected]>
Conflicts:
arch/arm/mach-shmobile/clock-r8a7778.c
arch/arm/mach-shmobile/include/mach/r8a7778.h

1  2 
arch/arm/mach-shmobile/clock-r8a7778.c
arch/arm/mach-shmobile/include/mach/r8a7778.h
arch/arm/mach-shmobile/setup-r8a7778.c
arch/arm/mach-shmobile/setup-r8a7779.c

index 696d206adc3f8fb691fff948e856926b8d28fd76,18d44f51ca6700d2155ad43f70e5f3c993cd75c6..53798e5037d7a98b24f9a375db35a653d0c5291a
@@@ -103,19 -103,25 +103,27 @@@ static struct clk *main_clks[] = 
  };
  
  enum {
+       MSTP331,
        MSTP323, MSTP322, MSTP321,
        MSTP114,
-       MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 +      MSTP100,
+       MSTP030,
+       MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
        MSTP016, MSTP015,
+       MSTP007,
        MSTP_NR };
  
  static struct clk mstp_clks[MSTP_NR] = {
+       [MSTP331] = SH_CLK_MSTP32(&s4_clk, MSTPCR3, 31, 0), /* MMC */
        [MSTP323] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 23, 0), /* SDHI0 */
        [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */
        [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */
        [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */
 +      [MSTP100] = SH_CLK_MSTP32(&p_clk, MSTPCR1,  0, 0), /* USB0/1 */
+       [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */
+       [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */
+       [MSTP028] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 28, 0), /* I2C2 */
+       [MSTP027] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 27, 0), /* I2C3 */
        [MSTP026] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 26, 0), /* SCIF0 */
        [MSTP025] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 25, 0), /* SCIF1 */
        [MSTP024] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 24, 0), /* SCIF2 */
        [MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */
        [MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */
        [MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */
+       [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0,  7, 0), /* HSPI */
  };
  
  static struct clk_lookup lookups[] = {
+       /* main */
+       CLKDEV_CON_ID("shyway_clk",     &s_clk),
+       CLKDEV_CON_ID("peripheral_clk", &p_clk),
        /* MSTP32 clocks */
+       CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP331]), /* MMC */
        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 */
        CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */
 +      CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
 +      CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
+       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 */
        CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
        CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
        CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
+       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 */
  };
  
  void __init r8a7778_clock_init(void)
index 1d4207cc0b04f7b0e87f750d62df4090cb737abf,97ba66b3a7a199efd4eea121230ba2bc18a7ebbe..851d027a2f06143a1ec938789f3d1aa5c294e1f7
  #ifndef __ASM_R8A7778_H__
  #define __ASM_R8A7778_H__
  
+ #include <linux/mmc/sh_mmcif.h>
  #include <linux/mmc/sh_mobile_sdhi.h>
  #include <linux/sh_eth.h>
 +#include <linux/platform_data/usb-rcar-phy.h>
  
  extern void r8a7778_add_standard_devices(void);
  extern void r8a7778_add_standard_devices_dt(void);
  extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
 +extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
+ extern void r8a7778_add_i2c_device(int id);
+ extern void r8a7778_add_hspi_device(int id);
+ extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
 +extern void r8a7778_init_late(void);
  extern void r8a7778_init_delay(void);
  extern void r8a7778_init_irq(void);
  extern void r8a7778_init_irq_dt(void);
  extern void r8a7778_clock_init(void);
  extern void r8a7778_init_irq_extpin(int irlm);
 +extern void r8a7778_pinmux_init(void);
  extern void r8a7778_sdhi_init(int id, struct sh_mobile_sdhi_info *info);
  
  #endif /* __ASM_R8A7778_H__ */
index f84885a71f6f49a21ad16748a76401adf16f8801,c8e481f6c9e25cde18c7eecdf985ab069d14259d..80c20392ad7ce6c9711d83d006f2cc6e7c776a62
  #include <linux/irqchip/arm-gic.h>
  #include <linux/of.h>
  #include <linux/of_platform.h>
 +#include <linux/platform_data/gpio-rcar.h>
  #include <linux/platform_data/irq-renesas-intc-irqpin.h>
  #include <linux/platform_device.h>
  #include <linux/irqchip.h>
  #include <linux/serial_sci.h>
  #include <linux/sh_timer.h>
 +#include <linux/pm_runtime.h>
 +#include <linux/usb/phy.h>
 +#include <linux/usb/hcd.h>
 +#include <linux/usb/ehci_pdriver.h>
 +#include <linux/usb/ohci_pdriver.h>
 +#include <linux/dma-mapping.h>
  #include <mach/irqs.h>
  #include <mach/r8a7778.h>
  #include <mach/common.h>
@@@ -95,99 -88,6 +95,99 @@@ static struct sh_timer_config sh_tmu1_p
                &sh_tmu##idx##_platform_data,           \
                sizeof(sh_tmu##idx##_platform_data))
  
 +/* USB PHY */
 +static struct resource usb_phy_resources[] __initdata = {
 +      DEFINE_RES_MEM(0xffe70800, 0x100),
 +      DEFINE_RES_MEM(0xffe76000, 0x100),
 +};
 +
 +void __init r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
 +{
 +      platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
 +                                        usb_phy_resources,
 +                                        ARRAY_SIZE(usb_phy_resources),
 +                                        pdata, sizeof(*pdata));
 +}
 +
 +/* USB */
 +static struct usb_phy *phy;
 +
 +static int usb_power_on(struct platform_device *pdev)
 +{
 +      if (IS_ERR(phy))
 +              return PTR_ERR(phy);
 +
 +      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 (IS_ERR(phy))
 +              return;
 +
 +      usb_phy_shutdown(phy);
 +
 +      pm_runtime_put_sync(&pdev->dev);
 +      pm_runtime_disable(&pdev->dev);
 +}
 +
 +static int ehci_init_internal_buffer(struct usb_hcd *hcd)
 +{
 +      /*
 +       * Below are recommended values from the datasheet;
 +       * see [USB :: Setting of EHCI Internal Buffer].
 +       */
 +      /* EHCI IP internal buffer setting */
 +      iowrite32(0x00ff0040, hcd->regs + 0x0094);
 +      /* EHCI IP internal buffer enable */
 +      iowrite32(0x00000001, hcd->regs + 0x009C);
 +
 +      return 0;
 +}
 +
 +static struct usb_ehci_pdata ehci_pdata __initdata = {
 +      .power_on       = usb_power_on,
 +      .power_off      = usb_power_off,
 +      .power_suspend  = usb_power_off,
 +      .pre_setup      = ehci_init_internal_buffer,
 +};
 +
 +static struct resource ehci_resources[] __initdata = {
 +      DEFINE_RES_MEM(0xffe70000, 0x400),
 +      DEFINE_RES_IRQ(gic_iid(0x4c)),
 +};
 +
 +static struct usb_ohci_pdata ohci_pdata __initdata = {
 +      .power_on       = usb_power_on,
 +      .power_off      = usb_power_off,
 +      .power_suspend  = usb_power_off,
 +};
 +
 +static struct resource ohci_resources[] __initdata = {
 +      DEFINE_RES_MEM(0xffe70400, 0x400),
 +      DEFINE_RES_IRQ(gic_iid(0x4c)),
 +};
 +
 +#define USB_PLATFORM_INFO(hci)                                        \
 +static struct platform_device_info hci##_info __initdata = {  \
 +      .parent         = &platform_bus,                        \
 +      .name           = #hci "-platform",                     \
 +      .id             = -1,                                   \
 +      .res            = hci##_resources,                      \
 +      .num_res        = ARRAY_SIZE(hci##_resources),          \
 +      .data           = &hci##_pdata,                         \
 +      .size_data      = sizeof(hci##_pdata),                  \
 +      .dma_mask       = DMA_BIT_MASK(32),                     \
 +}
 +
 +USB_PLATFORM_INFO(ehci);
 +USB_PLATFORM_INFO(ohci);
 +
  /* Ether */
  static struct resource ether_resources[] = {
        DEFINE_RES_MEM(0xfde00000, 0x400),
  
  void __init r8a7778_add_ether_device(struct sh_eth_plat_data *pdata)
  {
-       platform_device_register_resndata(&platform_bus, "sh_eth", -1,
+       platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
                                          ether_resources,
                                          ARRAY_SIZE(ether_resources),
                                          pdata, sizeof(*pdata));
  }
  
 +/* PFC/GPIO */
 +static struct resource pfc_resources[] = {
 +      DEFINE_RES_MEM(0xfffc0000, 0x118),
 +};
 +
 +#define R8A7778_GPIO(idx)                                             \
 +static struct resource r8a7778_gpio##idx##_resources[] = {            \
 +      DEFINE_RES_MEM(0xffc40000 + 0x1000 * (idx), 0x30),              \
 +      DEFINE_RES_IRQ(gic_iid(0x87)),                                  \
 +};                                                                    \
 +                                                                      \
 +static struct gpio_rcar_config r8a7778_gpio##idx##_platform_data = {  \
 +      .gpio_base      = 32 * (idx),                                   \
 +      .irq_base       = GPIO_IRQ_BASE(idx),                           \
 +      .number_of_pins = 32,                                           \
 +      .pctl_name      = "pfc-r8a7778",                                \
 +}
 +
 +R8A7778_GPIO(0);
 +R8A7778_GPIO(1);
 +R8A7778_GPIO(2);
 +R8A7778_GPIO(3);
 +R8A7778_GPIO(4);
 +
 +#define r8a7778_register_gpio(idx)                            \
 +      platform_device_register_resndata(                      \
 +              &platform_bus, "gpio_rcar", idx,                \
 +              r8a7778_gpio##idx##_resources,                  \
 +              ARRAY_SIZE(r8a7778_gpio##idx##_resources),      \
 +              &r8a7778_gpio##idx##_platform_data,             \
 +              sizeof(r8a7778_gpio##idx##_platform_data))
 +
 +void __init r8a7778_pinmux_init(void)
 +{
 +      platform_device_register_simple(
 +              "pfc-r8a7778", -1,
 +              pfc_resources,
 +              ARRAY_SIZE(pfc_resources));
 +
 +      r8a7778_register_gpio(0);
 +      r8a7778_register_gpio(1);
 +      r8a7778_register_gpio(2);
 +      r8a7778_register_gpio(3);
 +      r8a7778_register_gpio(4);
 +};
 +
  /* SDHI */
  static struct resource sdhi_resources[] = {
        /* SDHI0 */
@@@ -272,6 -126,67 +272,67 @@@ void __init r8a7778_sdhi_init(int id
                info, sizeof(*info));
  }
  
+ /* I2C */
+ static struct resource i2c_resources[] __initdata = {
+       /* I2C0 */
+       DEFINE_RES_MEM(0xffc70000, 0x1000),
+       DEFINE_RES_IRQ(gic_iid(0x63)),
+       /* I2C1 */
+       DEFINE_RES_MEM(0xffc71000, 0x1000),
+       DEFINE_RES_IRQ(gic_iid(0x6e)),
+       /* I2C2 */
+       DEFINE_RES_MEM(0xffc72000, 0x1000),
+       DEFINE_RES_IRQ(gic_iid(0x6c)),
+       /* I2C3 */
+       DEFINE_RES_MEM(0xffc73000, 0x1000),
+       DEFINE_RES_IRQ(gic_iid(0x6d)),
+ };
+ void __init r8a7778_add_i2c_device(int id)
+ {
+       BUG_ON(id < 0 || id > 3);
+       platform_device_register_simple(
+               "i2c-rcar", id,
+               i2c_resources + (2 * id), 2);
+ }
+ /* HSPI */
+ static struct resource hspi_resources[] __initdata = {
+       /* HSPI0 */
+       DEFINE_RES_MEM(0xfffc7000, 0x18),
+       DEFINE_RES_IRQ(gic_iid(0x5f)),
+       /* HSPI1 */
+       DEFINE_RES_MEM(0xfffc8000, 0x18),
+       DEFINE_RES_IRQ(gic_iid(0x74)),
+       /* HSPI2 */
+       DEFINE_RES_MEM(0xfffc6000, 0x18),
+       DEFINE_RES_IRQ(gic_iid(0x75)),
+ };
+ void __init r8a7778_add_hspi_device(int id)
+ {
+       BUG_ON(id < 0 || id > 2);
+       platform_device_register_simple(
+               "sh-hspi", id,
+               hspi_resources + (2 * id), 2);
+ }
+ /* MMC */
+ static struct resource mmc_resources[] __initdata = {
+       DEFINE_RES_MEM(0xffe4e000, 0x100),
+       DEFINE_RES_IRQ(gic_iid(0x5d)),
+ };
+ void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info)
+ {
+       platform_device_register_resndata(
+               &platform_bus, "sh_mmcif", -1,
+               mmc_resources, ARRAY_SIZE(mmc_resources),
+               info, sizeof(*info));
+ }
  void __init r8a7778_add_standard_devices(void)
  {
        int i;
        r8a7778_register_tmu(1);
  }
  
 +void __init r8a7778_init_late(void)
 +{
 +      phy = usb_get_phy(USB_PHY_TYPE_USB2);
 +
 +      platform_device_register_full(&ehci_info);
 +      platform_device_register_full(&ohci_info);
 +}
 +
  static struct renesas_intc_irqpin_config irqpin_platform_data = {
        .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
        .sense_bitfield_width = 2,
@@@ -417,7 -324,6 +478,7 @@@ DT_MACHINE_START(R8A7778_DT, "Generic R
        .init_machine   = r8a7778_add_standard_devices_dt,
        .init_time      = shmobile_timer_init,
        .dt_compat      = r8a7778_compat_dt,
 +      .init_late      = r8a7778_init_late,
  MACHINE_END
  
  #endif /* CONFIG_USE_OF */
index 06804a1eb1ebb5326eef658a5bcae255d8919031,d8a70dcd72237f82409fd7c3657d5cb68fee4b78..398687761f504046a5567c5d2ac58f4e8076a528
  #include <linux/sh_intc.h>
  #include <linux/sh_timer.h>
  #include <linux/dma-mapping.h>
 +#include <linux/usb/otg.h>
 +#include <linux/usb/hcd.h>
 +#include <linux/usb/ehci_pdriver.h>
 +#include <linux/usb/ohci_pdriver.h>
 +#include <linux/pm_runtime.h>
  #include <mach/hardware.h>
  #include <mach/irqs.h>
  #include <mach/r8a7779.h>
@@@ -70,7 -65,11 +70,7 @@@ void __init r8a7779_map_io(void
  }
  
  static struct resource r8a7779_pfc_resources[] = {
 -      [0] = {
 -              .start  = 0xfffc0000,
 -              .end    = 0xfffc023b,
 -              .flags  = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(0xfffc0000, 0x023c),
  };
  
  static struct platform_device r8a7779_pfc_device = {
  
  #define R8A7779_GPIO(idx, npins) \
  static struct resource r8a7779_gpio##idx##_resources[] = {            \
 -      [0] = {                                                         \
 -              .start  = 0xffc40000 + 0x1000 * (idx),                  \
 -              .end    = 0xffc4002b + 0x1000 * (idx),                  \
 -              .flags  = IORESOURCE_MEM,                               \
 -      },                                                              \
 -      [1] = {                                                         \
 -              .start  = gic_iid(0xad + (idx)),                        \
 -              .flags  = IORESOURCE_IRQ,                               \
 -      }                                                               \
 +      DEFINE_RES_MEM(0xffc40000 + (0x1000 * (idx)), 0x002c),          \
 +      DEFINE_RES_IRQ(gic_iid(0xad + (idx))),                          \
  };                                                                    \
                                                                        \
  static struct gpio_rcar_config r8a7779_gpio##idx##_platform_data = {  \
@@@ -388,165 -394,6 +388,165 @@@ static struct platform_device sata_devi
        },
  };
  
 +/* USB PHY */
 +static struct resource usb_phy_resources[] __initdata = {
 +      [0] = {
 +              .start          = 0xffe70800,
 +              .end            = 0xffe70900 - 1,
 +              .flags          = IORESOURCE_MEM,
 +      },
 +};
 +
 +/* USB */
 +static struct usb_phy *phy;
 +
 +static int usb_power_on(struct platform_device *pdev)
 +{
 +      if (IS_ERR(phy))
 +              return PTR_ERR(phy);
 +
 +      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 (IS_ERR(phy))
 +              return;
 +
 +      usb_phy_shutdown(phy);
 +
 +      pm_runtime_put_sync(&pdev->dev);
 +      pm_runtime_disable(&pdev->dev);
 +}
 +
 +static int ehci_init_internal_buffer(struct usb_hcd *hcd)
 +{
 +      /*
 +       * Below are recommended values from the datasheet;
 +       * see [USB :: Setting of EHCI Internal Buffer].
 +       */
 +      /* EHCI IP internal buffer setting */
 +      iowrite32(0x00ff0040, hcd->regs + 0x0094);
 +      /* EHCI IP internal buffer enable */
 +      iowrite32(0x00000001, hcd->regs + 0x009C);
 +
 +      return 0;
 +}
 +
 +static struct usb_ehci_pdata ehcix_pdata = {
 +      .power_on       = usb_power_on,
 +      .power_off      = usb_power_off,
 +      .power_suspend  = usb_power_off,
 +      .pre_setup      = ehci_init_internal_buffer,
 +};
 +
 +static struct resource ehci0_resources[] = {
 +      [0] = {
 +              .start  = 0xffe70000,
 +              .end    = 0xffe70400 - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = gic_iid(0x4c),
 +              .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_iid(0x4d),
 +              .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 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_iid(0x4c),
 +              .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_iid(0x4d),
 +              .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,
 +};
 +
  /* Ether */
  static struct resource ether_resources[] = {
        {
@@@ -570,7 -417,7 +570,7 @@@ static struct platform_device *r8a7779_
        &tmu01_device,
  };
  
 -static struct platform_device *r8a7779_late_devices[] __initdata = {
 +static struct platform_device *r8a7779_standard_devices[] __initdata = {
        &i2c0_device,
        &i2c1_device,
        &i2c2_device,
@@@ -590,26 -437,18 +590,26 @@@ void __init r8a7779_add_standard_device
  
        platform_add_devices(r8a7779_devices_dt,
                            ARRAY_SIZE(r8a7779_devices_dt));
 -      platform_add_devices(r8a7779_late_devices,
 -                          ARRAY_SIZE(r8a7779_late_devices));
 +      platform_add_devices(r8a7779_standard_devices,
 +                          ARRAY_SIZE(r8a7779_standard_devices));
  }
  
  void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
  {
-       platform_device_register_resndata(&platform_bus, "sh_eth", -1,
+       platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
                                          ether_resources,
                                          ARRAY_SIZE(ether_resources),
                                          pdata, sizeof(*pdata));
  }
  
 +void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
 +{
 +      platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
 +                                        usb_phy_resources,
 +                                        ARRAY_SIZE(usb_phy_resources),
 +                                        pdata, sizeof(*pdata));
 +}
 +
  /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
  void __init __weak r8a7779_register_twd(void) { }
  
@@@ -642,23 -481,6 +642,23 @@@ void __init r8a7779_add_early_devices(v
         */
  }
  
 +static struct platform_device *r8a7779_late_devices[] __initdata = {
 +      &ehci0_device,
 +      &ehci1_device,
 +      &ohci0_device,
 +      &ohci1_device,
 +};
 +
 +void __init r8a7779_init_late(void)
 +{
 +      /* get USB PHY */
 +      phy = usb_get_phy(USB_PHY_TYPE_USB2);
 +
 +      shmobile_init_late();
 +      platform_add_devices(r8a7779_late_devices,
 +                           ARRAY_SIZE(r8a7779_late_devices));
 +}
 +
  #ifdef CONFIG_USE_OF
  void __init r8a7779_init_delay(void)
  {
@@@ -692,7 -514,6 +692,7 @@@ DT_MACHINE_START(R8A7779_DT, "Generic R
        .init_irq       = r8a7779_init_irq_dt,
        .init_machine   = r8a7779_add_standard_devices_dt,
        .init_time      = shmobile_timer_init,
 +      .init_late      = r8a7779_init_late,
        .dt_compat      = r8a7779_compat_dt,
  MACHINE_END
  #endif /* CONFIG_USE_OF */
This page took 0.090126 seconds and 4 git commands to generate.