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 duplicate ISP clock name to tegra_isp.0
  since with DT, device name becomes isp.0 now

bug 1366383

Change-Id: I3b8f08c8c52035dfcd019126774c9d1569499d8c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/299483
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-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/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 7616485..00de52e 100644 (file)
@@ -918,7 +918,8 @@ static struct of_dev_auxdata ardbeg_auxdata_lookup[] __initdata = {
        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-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 ee50e44..0a7929c 100644 (file)
@@ -614,7 +614,8 @@ struct of_dev_auxdata tegra_bonaire_auxdata_lookup[] __initdata = {
        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-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 56693aa..59361d7 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 d304218..16c0e19 100644 (file)
@@ -706,7 +706,8 @@ struct of_dev_auxdata loki_auxdata_lookup[] __initdata = {
        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-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 01071e7..ad2b88b 100644 (file)
@@ -8213,7 +8213,7 @@ struct clk_duplicate tegra_clk_duplicates[] = {
        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("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("vib.vi.c4bus", "tegra_vi.1", "vi"),