]> Git Repo - linux.git/commitdiff
Merge tag 'renesas-fixes3-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel...
authorOlof Johansson <[email protected]>
Tue, 10 Sep 2013 00:15:32 +0000 (17:15 -0700)
committerOlof Johansson <[email protected]>
Tue, 10 Sep 2013 00:15:32 +0000 (17:15 -0700)
From Simon Horman:
Third Round of Renesas ARM based SoC fixes for v3.12

* Update early timer initialisation order of r8a7779 SoC

This resolves a regression introduced by
a894fcc2d01a89e6fe3da0845a4d80a5312e1124 ("ARM: smp_twd: Divorce smp_twd
from local timer API").

This problem was introduced in v3.10-rc2.

* tag 'renesas-fixes3-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7779: Update early timer initialisation order

Signed-off-by: Olof Johansson <[email protected]>
1  2 
arch/arm/mach-shmobile/setup-r8a7779.c

index b5b2f787da2e3b015584b8ac0f855a409f3b29ab,3c5fae543cbcc4d480c95b645d5909bf5184df1c..ecd0148ee1e1711144eb2fd75bc146d97a582bb6
  #include <linux/init.h>
  #include <linux/interrupt.h>
  #include <linux/irq.h>
 +#include <linux/irqchip.h>
 +#include <linux/irqchip/arm-gic.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/delay.h>
  #include <linux/input.h>
  #include <linux/io.h>
  #include <linux/serial_sci.h>
 -#include <linux/sh_intc.h>
  #include <linux/sh_timer.h>
  #include <linux/dma-mapping.h>
  #include <linux/usb/otg.h>
@@@ -39,6 -37,7 +39,6 @@@
  #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>
  #include <mach/common.h>
@@@ -70,60 -69,6 +70,60 @@@ void __init r8a7779_map_io(void
        iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
  }
  
 +/* IRQ */
 +#define INT2SMSKCR0 IOMEM(0xfe7822a0)
 +#define INT2SMSKCR1 IOMEM(0xfe7822a4)
 +#define INT2SMSKCR2 IOMEM(0xfe7822a8)
 +#define INT2SMSKCR3 IOMEM(0xfe7822ac)
 +#define INT2SMSKCR4 IOMEM(0xfe7822b0)
 +
 +#define INT2NTSR0 IOMEM(0xfe700060)
 +#define INT2NTSR1 IOMEM(0xfe700064)
 +
 +static struct renesas_intc_irqpin_config irqpin0_platform_data __initdata = {
 +      .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
 +      .sense_bitfield_width = 2,
 +};
 +
 +static struct resource irqpin0_resources[] __initdata = {
 +      DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
 +      DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
 +      DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
 +      DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
 +      DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
 +      DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */
 +      DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */
 +      DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */
 +      DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */
 +};
 +
 +void __init r8a7779_init_irq_extpin(int irlm)
 +{
 +      void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
 +      u32 tmp;
 +
 +      if (!icr0) {
 +              pr_warn("r8a7779: unable to setup external irq pin mode\n");
 +              return;
 +      }
 +
 +      tmp = ioread32(icr0);
 +      if (irlm)
 +              tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
 +      else
 +              tmp &= ~(1 << 23); /* IRL mode - not supported */
 +      tmp |= (1 << 21); /* LVLMODE = 1 */
 +      iowrite32(tmp, icr0);
 +      iounmap(icr0);
 +
 +      if (irlm)
 +              platform_device_register_resndata(
 +                      &platform_bus, "renesas_intc_irqpin", -1,
 +                      irqpin0_resources, ARRAY_SIZE(irqpin0_resources),
 +                      &irqpin0_platform_data, sizeof(irqpin0_platform_data));
 +}
 +
 +/* PFC/GPIO */
  static struct resource r8a7779_pfc_resources[] = {
        DEFINE_RES_MEM(0xfffc0000, 0x023c),
  };
@@@ -443,6 -388,15 +443,6 @@@ 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;
  
@@@ -594,7 -548,7 +594,7 @@@ static struct platform_device ohci1_dev
  };
  
  /* Ether */
 -static struct resource ether_resources[] = {
 +static struct resource ether_resources[] __initdata = {
        {
                .start  = 0xfde00000,
                .end    = 0xfde003ff,
        },
  };
  
 +#define R8A7779_VIN(idx) \
 +static struct resource vin##idx##_resources[] __initdata = {          \
 +      DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000),            \
 +      DEFINE_RES_IRQ(gic_iid(0x5f + (idx))),                          \
 +};                                                                    \
 +                                                                      \
 +static struct platform_device_info vin##idx##_info __initdata = {     \
 +      .parent         = &platform_bus,                                \
 +      .name           = "r8a7779-vin",                                \
 +      .id             = idx,                                          \
 +      .res            = vin##idx##_resources,                         \
 +      .num_res        = ARRAY_SIZE(vin##idx##_resources),             \
 +      .dma_mask       = DMA_BIT_MASK(32),                             \
 +}
 +
 +R8A7779_VIN(0);
 +R8A7779_VIN(1);
 +R8A7779_VIN(2);
 +R8A7779_VIN(3);
 +
 +static struct platform_device_info *vin_info_table[] __initdata = {
 +      &vin0_info,
 +      &vin1_info,
 +      &vin2_info,
 +      &vin3_info,
 +};
 +
  static struct platform_device *r8a7779_devices_dt[] __initdata = {
        &scif0_device,
        &scif1_device,
@@@ -675,14 -602,12 +675,14 @@@ void __init r8a7779_add_ether_device(st
                                          pdata, sizeof(*pdata));
  }
  
 -void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
 +void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
  {
 -      platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
 -                                        usb_phy_resources,
 -                                        ARRAY_SIZE(usb_phy_resources),
 -                                        pdata, sizeof(*pdata));
 +      BUG_ON(id < 0 || id > 3);
 +
 +      vin_info_table[id]->data = pdata;
 +      vin_info_table[id]->size_data = sizeof(*pdata);
 +
 +      platform_device_register_full(vin_info_table[id]);
  }
  
  /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
@@@ -691,8 -616,8 +691,8 @@@ void __init __weak r8a7779_register_twd
  void __init r8a7779_earlytimer_init(void)
  {
        r8a7779_clock_init();
-       shmobile_earlytimer_init();
        r8a7779_register_twd();
+       shmobile_earlytimer_init();
  }
  
  void __init r8a7779_add_early_devices(void)
@@@ -735,34 -660,15 +735,34 @@@ void __init r8a7779_init_late(void
  }
  
  #ifdef CONFIG_USE_OF
 +static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
 +{
 +      return 0; /* always allow wakeup */
 +}
 +
 +void __init r8a7779_init_irq_dt(void)
 +{
 +      gic_arch_extn.irq_set_wake = r8a7779_set_wake;
 +
 +      irqchip_init();
 +
 +      /* route all interrupts to ARM */
 +      __raw_writel(0xffffffff, INT2NTSR0);
 +      __raw_writel(0x3fffffff, INT2NTSR1);
 +
 +      /* unmask all known interrupts in INTCS2 */
 +      __raw_writel(0xfffffff0, INT2SMSKCR0);
 +      __raw_writel(0xfff7ffff, INT2SMSKCR1);
 +      __raw_writel(0xfffbffdf, INT2SMSKCR2);
 +      __raw_writel(0xbffffffc, INT2SMSKCR3);
 +      __raw_writel(0x003fee3f, INT2SMSKCR4);
 +}
 +
  void __init r8a7779_init_delay(void)
  {
        shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */
  }
  
 -static const struct of_dev_auxdata r8a7779_auxdata_lookup[] __initconst = {
 -      {},
 -};
 -
  void __init r8a7779_add_standard_devices_dt(void)
  {
        /* clocks are setup late during boot in the case of DT */
  
        platform_add_devices(r8a7779_devices_dt,
                             ARRAY_SIZE(r8a7779_devices_dt));
 -      of_platform_populate(NULL, of_default_bus_match_table,
 -                           r8a7779_auxdata_lookup, NULL);
 +      of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  }
  
  static const char *r8a7779_compat_dt[] __initdata = {
@@@ -784,6 -691,7 +784,6 @@@ DT_MACHINE_START(R8A7779_DT, "Generic R
        .nr_irqs        = NR_IRQS_LEGACY,
        .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
This page took 0.081153 seconds and 4 git commands to generate.