arm: tegra: populate device nodes from device tree
Nitin Kumbhar [Wed, 29 Aug 2012 05:00:43 +0000 (10:00 +0530)]
Update init_machine routine for cardhu and enterprise
so that device nodes can be populated from device tree.

Disable nodes which are currently added from board files.

Bug 1036909

Change-Id: Iedf394bf5ea414b1e64cace565931991fec858a4
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/130158
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

arch/arm/boot/dts/tegra30-enterprise.dts
arch/arm/boot/dts/tegra30.dtsi
arch/arm/mach-tegra/board-cardhu.c
arch/arm/mach-tegra/board-enterprise.c

index c78821c..1175305 100644 (file)
@@ -5,4 +5,61 @@
 / {
        model = "NVIDIA Tegra30 Enterprise evaluation board";
        compatible = "nvidia,enterprise", "nvidia,tegra30";
+
+       serial@70006000 {
+               status = "disable";
+       };
+
+       serial@70006040 {
+               status = "disable";
+       };
+
+       serial@70006200 {
+               status = "disable";
+       };
+
+       serial@70006300 {
+               status = "disable";
+       };
+
+       serial@70006400 {
+               status = "disable";
+       };
+
+       i2c@7000c000 {
+               status = "disable";
+       };
+
+       i2c@7000c400 {
+               status = "disable";
+       };
+
+       i2c@7000c500 {
+               status = "disable";
+       };
+
+       i2c@7000c700 {
+               status = "disable";
+       };
+
+       i2c@7000d000 {
+               status = "disable";
+       };
+
+       sdhci@78000000 {
+               status = "disable";
+       };
+
+       sdhci@78000200 {
+               status = "disable";
+       };
+
+       sdhci@78000400 {
+               status = "disable";
+       };
+
+       sdhci@78000600 {
+               status = "disable";
+       };
+
 };
index 62a7b39..4d3ff92 100644 (file)
                gpio-controller;
                #interrupt-cells = <2>;
                interrupt-controller;
+               status = "disable";
        };
 
        serial@70006000 {
                compatible = "nvidia,tegra30-pinmux";
                reg = < 0x70000868 0xd0     /* Pad control registers */
                        0x70003000 0x3e0 >; /* Mux registers */
+               status = "disable";
        };
 };
index 5b0deef..011bee3 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-cardhu.c
  *
- * Copyright (c) 2011-2012, NVIDIA Corporation.  All rights reserved.
- * Copyright (c) 2011-2012, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,7 +40,7 @@
 #include <linux/spi-tegra.h>
 #include <linux/nfc/pn544.h>
 #include <linux/rfkill-gpio.h>
-
+#include <linux/of_platform.h>
 
 #include <sound/wm8903.h>
 #include <sound/max98095.h>
@@ -1483,6 +1482,14 @@ static void __init tegra_cardhu_init(void)
        tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
 }
 
+static void __init tegra_cardhu_dt_init(void)
+{
+       tegra_cardhu_init();
+
+       of_platform_populate(NULL,
+               of_default_bus_match_table, NULL, NULL);
+}
+
 static void __init tegra_cardhu_reserve(void)
 {
 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
@@ -1508,7 +1515,7 @@ MACHINE_START(CARDHU, "cardhu")
        .init_irq       = tegra_init_irq,
        .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
-       .init_machine   = tegra_cardhu_init,
+       .init_machine   = tegra_cardhu_dt_init,
        .restart        = tegra_assert_system_reset,
        .dt_compat      = cardhu_dt_board_compat,
 MACHINE_END
index 7c1d203..5102c3a 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/mfd/tlv320aic3262-core.h>
 
 #include <linux/nfc/pn544.h>
+#include <linux/of_platform.h>
 
 #include <sound/max98088.h>
 
@@ -1130,6 +1131,14 @@ static void __init tegra_enterprise_init(void)
        tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
 }
 
+static void __init tegra_enterprise_dt_init(void)
+{
+       tegra_enterprise_init();
+
+       of_platform_populate(NULL,
+               of_default_bus_match_table, NULL, NULL);
+}
+
 static void __init tegra_enterprise_reserve(void)
 {
 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
@@ -1154,7 +1163,7 @@ MACHINE_START(TEGRA_ENTERPRISE, "tegra_enterprise")
        .init_irq       = tegra_init_irq,
        .handle_irq     = gic_handle_irq,
        .timer          = &tegra_timer,
-       .init_machine   = tegra_enterprise_init,
+       .init_machine   = tegra_enterprise_dt_init,
        .restart        = tegra_assert_system_reset,
        .dt_compat      = enterprise_dt_board_compat,
 MACHINE_END