ARM: tegra: bonaire: Move sim enet to pre-si cfg
Peng Du [Thu, 14 Mar 2013 20:18:18 +0000 (13:18 -0700)]
Sim ethernet device has been moved to common.c to share
among chips. This change refactored bonaire board as
such. In addition, the newly added smsc911x device is
also moved to common.c

Origin change: http://git-master/r/162270

Change-Id: Ibf5dd386e5038cd30abb9dc96b29ecf5e56571da
Signed-off-by: Peng Du <pdu@nvidia.com>
Reviewed-on: http://git-master/r/209776
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Chao Xu <cxu@nvidia.com>

arch/arm/mach-tegra/board-bonaire.c
arch/arm/mach-tegra/common.c
arch/arm/mach-tegra/include/mach/irqs.h
drivers/video/tegra/dc/window.c

index fa09489..3dd5c72 100644 (file)
@@ -393,58 +393,6 @@ struct platform_device tegra_nand_device = {
 };
 #endif
 
-#if defined(CONFIG_TEGRA_SIMULATION_PLATFORM) && defined(CONFIG_SMC91X)
-static struct resource tegra_sim_smc91x_resources[] = {
-       [0] = {
-               .start          = TEGRA_SIM_ETH_BASE,
-               .end            = TEGRA_SIM_ETH_BASE + TEGRA_SIM_ETH_SIZE - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = IRQ_ETH,
-               .end            = IRQ_ETH,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tegra_sim_smc91x_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(tegra_sim_smc91x_resources),
-       .resource       = tegra_sim_smc91x_resources,
-};
-#endif
-
-#if defined(CONFIG_SMSC911X)
-static struct resource tegra_smsc911x_resources[] = {
-       [0] = {
-               .start          = 0x4E000000,
-               .end            = 0x4E000000 + SZ_64K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = IRQ_ETH,
-               .end            = IRQ_ETH,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct smsc911x_platform_config tegra_smsc911x_config = {
-       .flags          = SMSC911X_USE_32BIT,
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
-       .irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
-};
-
-static struct platform_device tegra_smsc911x_device = {
-       .name              = "smsc911x",
-       .id                = 0,
-       .resource          = tegra_smsc911x_resources,
-       .num_resources     = ARRAY_SIZE(tegra_smsc911x_resources),
-       .dev.platform_data = &tegra_smsc911x_config,
-};
-#endif
-
 static struct platform_device *bonaire_devices[] __initdata = {
 #if ENABLE_OTG
        &tegra_otg_device,
@@ -653,18 +601,6 @@ static void __init tegra_bonaire_init(void)
 
        platform_add_devices(bonaire_devices, ARRAY_SIZE(bonaire_devices));
 
-#if defined(CONFIG_TEGRA_SIMULATION_PLATFORM) && defined(CONFIG_SMC91X)
-       if (!tegra_cpu_is_dsim()) { /* no ethernet card on DSIM */
-               platform_device_register(&tegra_sim_smc91x_device);
-       }
-#endif
-
-#if defined(CONFIG_SMSC911X)
-       if (!tegra_cpu_is_dsim()) { /* no ethernet card on DSIM */
-               platform_device_register(&tegra_smsc911x_device);
-       }
-#endif
-
 #ifdef CONFIG_TEGRA_SIMULATION_PLATFORM
        bonaire_power_off_init();
 #endif
index 4082061..78baf5c 100644 (file)
@@ -2051,14 +2051,53 @@ static struct platform_device tegra_asim_smc91x_device = {
        .resource       = tegra_asim_smc91x_resources,
 };
 
-static int __init asim_enet_init(void)
+static int __init asim_enet_smc91x_init(void)
 {
-       if (tegra_cpu_is_asim())
+       if (tegra_cpu_is_asim() && !tegra_cpu_is_dsim())
                platform_device_register(&tegra_asim_smc91x_device);
        return 0;
 }
 
-rootfs_initcall(asim_enet_init);
+rootfs_initcall(asim_enet_smc91x_init);
+#endif
+
+#if defined(CONFIG_SMSC911X)
+static struct resource tegra_smsc911x_resources[] = {
+       [0] = {
+               .start          = 0x4E000000,
+               .end            = 0x4E000000 + SZ_64K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = IRQ_ETH,
+               .end            = IRQ_ETH,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct smsc911x_platform_config tegra_smsc911x_config = {
+       .flags          = SMSC911X_USE_32BIT,
+       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+       .irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
+       .phy_interface  = PHY_INTERFACE_MODE_MII,
+};
+
+static struct platform_device tegra_smsc911x_device = {
+       .name              = "smsc911x",
+       .id                = 0,
+       .resource          = tegra_smsc911x_resources,
+       .num_resources     = ARRAY_SIZE(tegra_smsc911x_resources),
+       .dev.platform_data = &tegra_smsc911x_config,
+};
+
+static int __init asim_enet_smsc911x_init(void)
+{
+       if (tegra_cpu_is_asim() && !tegra_cpu_is_dsim())
+               platform_device_register(&tegra_smsc911x_device);
+       return 0;
+}
+
+rootfs_initcall(asim_enet_smsc911x_init);
 #endif
 
 #ifdef CONFIG_TEGRA_SIMULATION_SPLIT_MEM
index bf09ca4..8c73bd6 100644 (file)
 #define INT_ACTMON                     (INT_SEC_BASE + 13)
 #define INT_UARTC                      (INT_SEC_BASE + 14)
 #define INT_MIPI                       (INT_SEC_BASE + 15)
-#ifdef CONFIG_TEGRA_SIMULATION_PLATFORM
+#ifdef CONFIG_TEGRA_PRE_SILICON_SUPPORT
 #define IRQ_ETH                                (INT_SEC_BASE + 16)
 #endif
 /* unused                              (INT_SEC_BASE + 17) */
index 7a59ef7..24dc59d 100644 (file)
@@ -803,8 +803,9 @@ void tegra_dc_trigger_windows(struct tegra_dc *dc)
                if (val2 & INTERLACE_MODE_ENABLE) {
                        if (val2 & INTERLACE_STATUS_FIELD_2) {
                                if (tegra_platform_is_linsim()) {
-                                       /* FIXME: this is not needed when the simulator
-                                        * clears WIN_x_UPDATE bits as in HW */
+                                       /* FIXME: this is not needed when
+                                       the simulator clears WIN_x_UPDATE
+                                       bits as in HW */
                                        dc->windows[i].dirty = 0;
                                        completed = 1;
                                } else {