ARM: tegra12: enable DT support for host1x
Deepak Nibade [Thu, 3 Oct 2013 09:20:05 +0000 (14:20 +0530)]
- make board file changes to enable DT support for host1x
- rename clocks to isp.0/vi.0/vic03.0/gk20a.0 to match with
  device names

bug 1366383

Change-Id: I97d8dcf1435c93be9cd81c40f101b645f8073019
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/304871
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

arch/arm/mach-tegra/board-ardbeg-panel.c
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-bonaire-panel.c
arch/arm/mach-tegra/board-bonaire.c
arch/arm/mach-tegra/board-loki-panel.c
arch/arm/mach-tegra/board-loki.c
arch/arm/mach-tegra/board-vcm30_t124-panel.c
arch/arm/mach-tegra/board-vcm30_t124.c
arch/arm/mach-tegra/tegra12_clocks.c

index d96f15a..c2fbebb 100644 (file)
@@ -48,7 +48,11 @@ struct platform_device * __init ardbeg_host1x_init(void)
        struct platform_device *pdev = NULL;
 
 #ifdef CONFIG_TEGRA_GRHOST
-       pdev = tegra12_register_host1x_devices();
+       if (!of_have_populated_dt())
+               pdev = tegra12_register_host1x_devices();
+       else
+               pdev = to_platform_device(bus_find_device_by_name(
+                       &platform_bus_type, NULL, "host1x"));
 
        if (!pdev) {
                pr_err("host1x devices registration failed\n");
index a18a589..3033ad8 100644 (file)
@@ -876,14 +876,16 @@ static struct of_dev_auxdata ardbeg_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-host1x", TEGRA_HOST1X_BASE, "host1x",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", 0x538F0000, "gk20a", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", TEGRA_GK20A_BAR0_BASE,
+               "gk20a.0", NULL),
 #ifdef CONFIG_ARCH_TEGRA_VIC
-       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03.0", NULL),
 #endif
        OF_DEV_AUXDATA("nvidia,tegra124-msenc", TEGRA_MSENC_BASE, "msenc",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISPB_BASE, "isp.1", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
                                NULL),
index 712c141..4a3f04a 100644 (file)
@@ -61,16 +61,16 @@ struct platform_device * __init bonaire_host1x_init(void)
        struct platform_device *pdev = NULL;
 
 #ifdef CONFIG_TEGRA_GRHOST
-       /* FIXME: remove this #if 0 and below line when DT will be enabled for
-       * bonaire */
-#if 0
        if (!of_have_populated_dt())
                pdev = tegra12_register_host1x_devices();
        else
                pdev = to_platform_device(bus_find_device_by_name(
                        &platform_bus_type, NULL, "host1x"));
-#endif
-       pdev = tegra12_register_host1x_devices();
+
+       if (!pdev) {
+               pr_err("host1x devices registration failed\n");
+               return NULL;
+       }
 #endif
        return pdev;
 }
index c85b6d0..e0c708f 100644 (file)
@@ -608,12 +608,14 @@ static void __init tegra_bonaire_init(void)
 struct of_dev_auxdata tegra_bonaire_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("nvidia,tegra124-host1x", TEGRA_HOST1X_BASE, "host1x",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", 0x538F0000, "gk20a", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", TEGRA_GK20A_BAR0_BASE,
+               "gk20a.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03.0", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-msenc", TEGRA_MSENC_BASE, "msenc",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISPB_BASE, "isp.1", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
        {}
 };
index 35dfaae..ba6b536 100644 (file)
@@ -45,7 +45,11 @@ struct platform_device * __init loki_host1x_init(void)
        struct platform_device *pdev = NULL;
 
 #ifdef CONFIG_TEGRA_GRHOST
-       pdev = tegra12_register_host1x_devices();
+       if (!of_have_populated_dt())
+               pdev = tegra12_register_host1x_devices();
+       else
+               pdev = to_platform_device(bus_find_device_by_name(
+                       &platform_bus_type, NULL, "host1x"));
 
        if (!pdev) {
                pr_err("host1x devices registration failed\n");
index 01a31e9..d259b57 100644 (file)
@@ -736,14 +736,16 @@ struct of_dev_auxdata loki_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-host1x", TEGRA_HOST1X_BASE, "host1x",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", 0x538F0000, "gk20a", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", TEGRA_GK20A_BAR0_BASE,
+               "gk20a.0", NULL),
 #ifdef CONFIG_ARCH_TEGRA_VIC
-       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03.0", NULL),
 #endif
        OF_DEV_AUXDATA("nvidia,tegra124-msenc", TEGRA_MSENC_BASE, "msenc",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISPB_BASE, "isp.1", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
                                NULL),
index 26ac56b..b9cea30 100644 (file)
@@ -44,7 +44,11 @@ struct platform_device * __init vcm30_t124_host1x_init(void)
        struct platform_device *pdev = NULL;
 
 #ifdef CONFIG_TEGRA_GRHOST
-       pdev = tegra12_register_host1x_devices();
+       if (!of_have_populated_dt())
+               pdev = tegra12_register_host1x_devices();
+       else
+               pdev = to_platform_device(bus_find_device_by_name(
+                       &platform_bus_type, NULL, "host1x"));
 
        if (!pdev) {
                pr_err("host1x devices registration failed\n");
index 24e15f1..8478b6a 100644 (file)
@@ -470,12 +470,13 @@ struct of_dev_auxdata vcm30_t124_auxdata_lookup[] __initdata = {
                                "serial-tegra.3", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-host1x", TEGRA_HOST1X_BASE, "host1x",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", 0x538F0000, "gk20a", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", TEGRA_GK20A_BAR0_BASE, "gk20a.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03.0", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-msenc", TEGRA_MSENC_BASE, "msenc",
                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi", NULL),
-       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp.0", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISPB_BASE, "isp.1", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
        OF_DEV_AUXDATA("nvidia,tegra124-apbdma", 0x60020000, "tegra-apbdma",
                                NULL),
index bb81cca..d1b1784 100644 (file)
@@ -7999,10 +7999,10 @@ struct clk tegra_list_clks[] = {
        SHARED_EMC_CLK("mon.emc",       "tegra_actmon", "emc",  &tegra_clk_emc, NULL, 0, 0, 0),
        SHARED_EMC_CLK("cap.emc",       "cap.emc",      NULL,   &tegra_clk_emc, NULL, 0, SHARED_CEILING, 0),
        SHARED_EMC_CLK("cap.throttle.emc", "cap_throttle", NULL, &tegra_clk_emc, NULL, 0, SHARED_CEILING_BUT_ISO, 0),
-       SHARED_EMC_CLK("3d.emc",        "tegra_gk20a",  "emc",  &tegra_clk_emc, NULL, 0, 0,             BIT(EMC_USER_3D)),
+       SHARED_EMC_CLK("3d.emc",        "tegra_gk20a.0", "emc", &tegra_clk_emc, NULL, 0, 0, BIT(EMC_USER_3D)),
        SHARED_EMC_CLK("msenc.emc",     "tegra_msenc",  "emc",  &tegra_clk_emc, NULL, 0, SHARED_BW,     BIT(EMC_USER_MSENC)),
        SHARED_EMC_CLK("tsec.emc",      "tegra_tsec",   "emc",  &tegra_clk_emc, NULL, 0, 0, 0),
-       SHARED_EMC_CLK("via.emc",       "tegra_vi",     "emc",  &tegra_clk_emc, NULL, 0, SHARED_ISO_BW, BIT(EMC_USER_VI)),
+       SHARED_EMC_CLK("via.emc",       "tegra_vi.0",   "emc",  &tegra_clk_emc, NULL, 0, SHARED_ISO_BW, BIT(EMC_USER_VI)),
        SHARED_EMC_CLK("vib.emc",       "tegra_vi.1",   "emc",  &tegra_clk_emc, NULL, 0, SHARED_ISO_BW, BIT(EMC_USER_VI2)),
        SHARED_EMC_CLK("ispa.emc",      "tegra_isp",    "emc",  &tegra_clk_emc, NULL, 0, SHARED_ISO_BW, BIT(EMC_USER_ISP1)),
        SHARED_EMC_CLK("ispb.emc",      "tegra_isp.1",  "emc",  &tegra_clk_emc, NULL, 0, SHARED_ISO_BW, BIT(EMC_USER_ISP2)),
@@ -8010,7 +8010,7 @@ struct clk tegra_list_clks[] = {
        SHARED_EMC_CLK("floor.emc",     "floor.emc",    NULL,   &tegra_clk_emc, NULL, 0, 0, 0),
        SHARED_EMC_CLK("override.emc", "override.emc",  NULL,   &tegra_clk_emc, NULL, 0, SHARED_OVERRIDE, 0),
        SHARED_EMC_CLK("edp.emc",       "edp.emc",      NULL,   &tegra_clk_emc, NULL, 0, SHARED_CEILING, 0),
-       SHARED_EMC_CLK("vic.emc",       "tegra_vic03",  "emc",  &tegra_clk_emc, NULL, 0, 0, 0),
+       SHARED_EMC_CLK("vic.emc",       "tegra_vic03.0",        "emc",  &tegra_clk_emc, NULL, 0, 0, 0),
        SHARED_EMC_CLK("battery.emc",   "battery_edp",  "emc",  &tegra_clk_emc, NULL, 0, SHARED_CEILING, 0),
 
 #ifdef CONFIG_TEGRA_DUAL_CBUS
@@ -8023,14 +8023,14 @@ struct clk tegra_list_clks[] = {
        SHARED_CLK("override.c2bus",    "override.c2bus",       NULL,    &tegra_clk_c2bus, NULL,  0, SHARED_OVERRIDE),
        SHARED_LIMIT("edp.c2bus",       "edp.c2bus",            NULL,    &tegra_clk_c2bus, NULL,  0, SHARED_CEILING),
 
-       DUAL_CBUS_CLK("vic03.cbus",     "tegra_vic03",          "vic03", &tegra_clk_c3bus, "vic03", 0, 0),
+       DUAL_CBUS_CLK("vic03.cbus",     "tegra_vic03.0",                "vic03", &tegra_clk_c3bus, "vic03", 0, 0),
        DUAL_CBUS_CLK("tsec.cbus",      "tegra_tsec",           "tsec",  &tegra_clk_c3bus,  "tsec", 0, 0),
        SHARED_LIMIT("cap.c3bus",       "cap.c3bus",            NULL,    &tegra_clk_c3bus, NULL,    0, SHARED_CEILING),
        SHARED_LIMIT("cap.throttle.c3bus", "cap_throttle",      NULL,    &tegra_clk_c3bus, NULL,    0, SHARED_CEILING),
        SHARED_LIMIT("floor.c3bus",     "floor.c3bus",          NULL,    &tegra_clk_c3bus, NULL,    0, 0),
        SHARED_CLK("override.c3bus",    "override.c3bus",       NULL,    &tegra_clk_c3bus, NULL,  0, SHARED_OVERRIDE),
 #else
-       SHARED_CLK("vic03.cbus",  "tegra_vic03",        "vic03", &tegra_clk_cbus, "vic03", 0, 0),
+       SHARED_CLK("vic03.cbus",  "tegra_vic03.0",      "vic03", &tegra_clk_cbus, "vic03", 0, 0),
        SHARED_CLK("msenc.cbus","tegra_msenc",          "msenc",&tegra_clk_cbus, "msenc", 0, 0),
        SHARED_CLK("tsec.cbus", "tegra_tsec",           "tsec", &tegra_clk_cbus, "tsec", 0, 0),
        SHARED_CLK("vde.cbus",  "tegra-avp",            "vde",  &tegra_clk_cbus, "vde", 0, 0),
@@ -8233,18 +8233,18 @@ struct clk_duplicate tegra_clk_duplicates[] = {
        CLK_DUPLICATE("i2c5", "tegra_cl_dvfs", "i2c"),
        CLK_DUPLICATE("cpu_g", "tegra_cl_dvfs", "safe_dvfs"),
        CLK_DUPLICATE("actmon", "tegra_host1x", "actmon"),
-       CLK_DUPLICATE("gpu_ref", "tegra_gk20a", "PLLG_ref"),
-       CLK_DUPLICATE("gbus", "tegra_gk20a", "PLLG_out"),
-       CLK_DUPLICATE("pll_p_out5", "tegra_gk20a", "pwr"),
-       CLK_DUPLICATE("ispa.isp.c4bus", "tegra_isp", "isp"),
+       CLK_DUPLICATE("gpu_ref", "tegra_gk20a.0", "PLLG_ref"),
+       CLK_DUPLICATE("gbus", "tegra_gk20a.0", "PLLG_out"),
+       CLK_DUPLICATE("pll_p_out5", "tegra_gk20a.0", "pwr"),
+       CLK_DUPLICATE("ispa.isp.c4bus", "tegra_isp.0", "isp"),
        CLK_DUPLICATE("ispb.isp.c4bus", "tegra_isp.1", "isp"),
-       CLK_DUPLICATE("via.vi.c4bus", "tegra_vi", "vi"),
+       CLK_DUPLICATE("via.vi.c4bus", "tegra_vi.0", "vi"),
        CLK_DUPLICATE("vib.vi.c4bus", "tegra_vi.1", "vi"),
-       CLK_DUPLICATE("csi", "tegra_vi", "csi"),
+       CLK_DUPLICATE("csi", "tegra_vi.0", "csi"),
        CLK_DUPLICATE("csi", "tegra_vi.1", "csi"),
-       CLK_DUPLICATE("csus", "tegra_vi", "csus"),
+       CLK_DUPLICATE("csus", "tegra_vi.0", "csus"),
        CLK_DUPLICATE("vim2_clk", "tegra_vi.1", "vim2_clk"),
-       CLK_DUPLICATE("cilab", "tegra_vi", "cilab"),
+       CLK_DUPLICATE("cilab", "tegra_vi.0", "cilab"),
        CLK_DUPLICATE("cilcd", "tegra_vi.1", "cilcd"),
        CLK_DUPLICATE("cile", "tegra_vi.1", "cile"),
        CLK_DUPLICATE("i2s0", NULL, "i2s0"),