Merge tag 'renesas-soc-fixes3-for-v3.19' of git://git.kernel.org/pub/scm/linux/kernel...
authorOlof Johansson <olof@lixom.net>
Sun, 1 Feb 2015 16:51:12 +0000 (08:51 -0800)
committerOlof Johansson <olof@lixom.net>
Sun, 1 Feb 2015 16:51:12 +0000 (08:51 -0800)
Merge "Third Round of Renesas ARM Based SoC Fixes for v3.19" from Simon Horman:

* Instantiate GIC from C board code in legacy builds on r8a7790 and r8a73a4

* tag 'renesas-soc-fixes3-for-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7790: Instantiate GIC from C board code in legacy builds
  ARM: shmobile: r8a73a4: Instantiate GIC from C board code in legacy builds

Signed-off-by: Olof Johansson <olof@lixom.net>
1  2 
arch/arm/mach-shmobile/board-ape6evm.c
arch/arm/mach-shmobile/board-lager.c
arch/arm/mach-shmobile/setup-rcar-gen2.c
arch/arm/mach-shmobile/timer.c

   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   */
  
  #include <linux/gpio.h>
  #include <linux/gpio_keys.h>
  #include <linux/input.h>
  #include <linux/interrupt.h>
+ #include <linux/irqchip.h>
+ #include <linux/irqchip/arm-gic.h>
  #include <linux/kernel.h>
  #include <linux/mfd/tmio.h>
  #include <linux/mmc/host.h>
@@@ -273,6 -279,22 +275,22 @@@ static void __init ape6evm_add_standard
                                      sizeof(ape6evm_leds_pdata));
  }
  
+ static void __init ape6evm_legacy_init_time(void)
+ {
+       /* Do not invoke DT-based timers via clocksource_of_init() */
+ }
+ static void __init ape6evm_legacy_init_irq(void)
+ {
+       void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000);
+       void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000);
+       gic_init(0, 29, gic_dist_base, gic_cpu_base);
+       /* Do not invoke DT-based interrupt code via irqchip_init() */
+ }
  static const char *ape6evm_boards_compat_dt[] __initdata = {
        "renesas,ape6evm",
        NULL,
  
  DT_MACHINE_START(APE6EVM_DT, "ape6evm")
        .init_early     = shmobile_init_delay,
+       .init_irq       = ape6evm_legacy_init_irq,
        .init_machine   = ape6evm_add_standard_devices,
        .init_late      = shmobile_init_late,
        .dt_compat      = ape6evm_boards_compat_dt,
+       .init_time      = ape6evm_legacy_init_time,
  MACHINE_END
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   */
  
  #include <linux/gpio.h>
@@@ -21,6 -25,8 +21,8 @@@
  #include <linux/input.h>
  #include <linux/interrupt.h>
  #include <linux/irq.h>
+ #include <linux/irqchip.h>
+ #include <linux/irqchip/arm-gic.h>
  #include <linux/kernel.h>
  #include <linux/leds.h>
  #include <linux/mfd/tmio.h>
@@@ -32,6 -38,7 +34,6 @@@
  #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>
   *
   */
  
 -/* DU */
 -static struct rcar_du_encoder_data lager_du_encoders[] = {
 -      {
 -              .type = RCAR_DU_ENCODER_VGA,
 -              .output = RCAR_DU_OUTPUT_DPAD0,
 -      }, {
 -              .type = RCAR_DU_ENCODER_NONE,
 -              .output = RCAR_DU_OUTPUT_LVDS1,
 -              .connector.lvds.panel = {
 -                      .width_mm = 210,
 -                      .height_mm = 158,
 -                      .mode = {
 -                              .pixelclock = 65000000,
 -                              .hactive = 1024,
 -                              .hfront_porch = 20,
 -                              .hback_porch = 160,
 -                              .hsync_len = 136,
 -                              .vactive = 768,
 -                              .vfront_porch = 3,
 -                              .vback_porch = 29,
 -                              .vsync_len = 6,
 -                      },
 -              },
 -      },
 -};
 -
 -static const struct rcar_du_platform_data lager_du_pdata __initconst = {
 -      .encoders = lager_du_encoders,
 -      .num_encoders = ARRAY_SIZE(lager_du_encoders),
 -};
 -
 -static const struct resource du_resources[] __initconst = {
 -      DEFINE_RES_MEM(0xfeb00000, 0x70000),
 -      DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
 -      DEFINE_RES_MEM_NAMED(0xfeb94000, 0x1c, "lvds.1"),
 -      DEFINE_RES_IRQ(gic_spi(256)),
 -      DEFINE_RES_IRQ(gic_spi(268)),
 -      DEFINE_RES_IRQ(gic_spi(269)),
 -};
 -
 -static void __init lager_add_du_device(void)
 -{
 -      struct platform_device_info info = {
 -              .name = "rcar-du-r8a7790",
 -              .id = -1,
 -              .res = du_resources,
 -              .num_res = ARRAY_SIZE(du_resources),
 -              .data = &lager_du_pdata,
 -              .size_data = sizeof(lager_du_pdata),
 -              .dma_mask = DMA_BIT_MASK(32),
 -      };
 -
 -      platform_device_register_full(&info);
 -}
 -
  /* LEDS */
  static struct gpio_led lager_leds[] = {
        {
@@@ -744,6 -806,8 +746,6 @@@ static void __init lager_add_standard_d
  
        platform_device_register_full(&ether_info);
  
 -      lager_add_du_device();
 -
        platform_device_register_resndata(NULL, "qspi", 0,
                                          qspi_resources,
                                          ARRAY_SIZE(qspi_resources),
@@@ -811,6 -875,16 +813,16 @@@ static void __init lager_init(void
                                          lager_ksz8041_fixup);
  }
  
+ static void __init lager_legacy_init_irq(void)
+ {
+       void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000);
+       void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000);
+       gic_init(0, 29, gic_dist_base, gic_cpu_base);
+       /* Do not invoke DT-based interrupt code via irqchip_init() */
+ }
  static const char * const lager_boards_compat_dt[] __initconst = {
        "renesas,lager",
        NULL,
  DT_MACHINE_START(LAGER_DT, "lager")
        .smp            = smp_ops(r8a7790_smp_ops),
        .init_early     = shmobile_init_delay,
+       .init_irq       = lager_legacy_init_irq,
        .init_time      = rcar_gen2_timer_init,
        .init_machine   = lager_init,
        .init_late      = shmobile_init_late,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   */
  
  #include <linux/clk/shmobile.h>
@@@ -133,7 -137,9 +133,9 @@@ void __init rcar_gen2_timer_init(void
  #ifdef CONFIG_COMMON_CLK
        rcar_gen2_clocks_init(mode);
  #endif
+ #ifdef CONFIG_ARCH_SHMOBILE_MULTI
        clocksource_of_init();
+ #endif
  }
  
  struct memory_reserve_config {
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 - *
   */
  #include <linux/platform_device.h>
  #include <linux/clocksource.h>
@@@ -70,6 -75,18 +70,18 @@@ void __init shmobile_init_delay(void
        if (!max_freq)
                return;
  
+ #ifdef CONFIG_ARCH_SHMOBILE_LEGACY
+       /* Non-multiplatform r8a73a4 SoC cannot use arch timer due
+        * to GIC being initialized from C and arch timer via DT */
+       if (of_machine_is_compatible("renesas,r8a73a4"))
+               has_arch_timer = false;
+       /* Non-multiplatform r8a7790 SoC cannot use arch timer due
+        * to GIC being initialized from C and arch timer via DT */
+       if (of_machine_is_compatible("renesas,r8a7790"))
+               has_arch_timer = false;
+ #endif
        if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) {
                if (is_a7_a8_a9)
                        shmobile_setup_delay_hz(max_freq, 1, 3);