arm: tegra: init laguna and ardbeg as separate devices
Mitch Luban [Wed, 24 Jul 2013 07:50:37 +0000 (00:50 -0700)]
Need to call DT_MACHINE_START for each platform so that
ro.hardware property is set according to platform name.
This also enforces one dts file per platform.

Bug 1328162

Change-Id: Ia6091791f664d6b047fc1f69263a9f30e3fd3497
Signed-off-by: Mitch Luban <mluban@nvidia.com>
Reviewed-on: http://git-master/r/252797
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>

arch/arm/boot/dts/tegra124-laguna.dts
arch/arm/mach-tegra/board-ardbeg-sdhci.c
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-laguna-power.c

index 3d7a5a5..a7ad7d1 100644 (file)
@@ -4,7 +4,7 @@
 
 / {
        model = "NVIDIA Tegra124 Laguna";
-       compatible = "nvidia,ardbeg", "nvidia,tegra124";
+       compatible = "nvidia,laguna", "nvidia,tegra124";
        #address-cells = <1>;
        #size-cells = <1>;
 
index 11f4175..d58a097 100644 (file)
@@ -282,7 +282,8 @@ static int __init ardbeg_wifi_init(void)
 #ifdef CONFIG_TEGRA_PREPOWER_WIFI
 static int __init ardbeg_wifi_prepower(void)
 {
-       if (!of_machine_is_compatible("nvidia,ardbeg"))
+       if (!of_machine_is_compatible("nvidia,ardbeg") &&
+               !of_machine_is_compatible("nvidia,laguna"))
                return 0;
        ardbeg_wifi_power(1);
 
index adb2451..72fc23d 100644 (file)
@@ -1031,7 +1031,10 @@ static void __init tegra_ardbeg_early_init(void)
 {
        tegra_clk_init_from_table(ardbeg_clk_init_table);
        tegra_clk_verify_parents();
-       tegra_soc_device_init("ardbeg");
+       if (of_machine_is_compatible("nvidia,laguna"))
+               tegra_soc_device_init("laguna");
+       else
+               tegra_soc_device_init("ardbeg");
 }
 
 static void __init tegra_ardbeg_late_init(void)
@@ -1141,6 +1144,24 @@ static const char * const ardbeg_dt_board_compat[] = {
        NULL
 };
 
+static const char * const laguna_dt_board_compat[] = {
+       "nvidia,laguna",
+       NULL
+};
+
+DT_MACHINE_START(LAGUNA, "laguna")
+       .atag_offset    = 0x100,
+       .smp            = smp_ops(tegra_smp_ops),
+       .map_io         = tegra_map_common_io,
+       .reserve        = tegra_ardbeg_reserve,
+       .init_early     = tegra12x_init_early,
+       .init_irq       = tegra_dt_init_irq,
+       .init_time      = tegra_init_timer,
+       .init_machine   = tegra_ardbeg_dt_init,
+       .restart        = tegra_assert_system_reset,
+       .dt_compat      = laguna_dt_board_compat,
+MACHINE_END
+
 DT_MACHINE_START(ARDBEG, "ardbeg")
        .atag_offset    = 0x100,
        .smp            = smp_ops(tegra_smp_ops),
index d6c4ebc..2b9be2d 100644 (file)
@@ -774,7 +774,7 @@ static int __init laguna_fixed_regulator_init(void)
 {
        struct board_info board_info;
 
-       if (!of_machine_is_compatible("nvidia,ardbeg"))
+       if (!of_machine_is_compatible("nvidia,laguna"))
                return 0;
 
        tegra_get_board_info(&board_info);