From: Ion Agorria <[email protected]>

Modify the FDT that OS is about to be executed to fill out framebuffer
info. If node is absent it will be created along with the  memory
reservation needed.

Tested-by: Svyatoslav Ryhel <[email protected]> # P990 Star
Signed-off-by: Ion Agorria <[email protected]>
Signed-off-by: Svyatoslav Ryhel <[email protected]>
---
 arch/arm/mach-tegra/Kconfig    |  2 ++
 arch/arm/mach-tegra/dt-setup.c | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 8c074dce189..9d340198463 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -64,6 +64,8 @@ config TEGRA_COMMON
        select MMC
        select MTD
        select OF_CONTROL
+       select OF_SYSTEM_SETUP
+       select FDT_SIMPLEFB if VIDEO
        select SPI
        select SYSRESET
        select SYSRESET_TEGRA
diff --git a/arch/arm/mach-tegra/dt-setup.c b/arch/arm/mach-tegra/dt-setup.c
index a74d59205d4..4fc440f7e13 100644
--- a/arch/arm/mach-tegra/dt-setup.c
+++ b/arch/arm/mach-tegra/dt-setup.c
@@ -9,6 +9,10 @@
 #include <linux/if_ether.h>
 #include <asm/arch-tegra/cboot.h>
 #include <asm/arch-tegra/gpu.h>
+#if defined(CONFIG_FDT_SIMPLEFB)
+#include <fdt_support.h>
+#include <fdt_simplefb.h>
+#endif
 
 /*
  * This function is called right before the kernel is booted. "blob" is the
@@ -24,7 +28,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
                "nvidia,gm20b",
 #endif
        };
-       int i, ret;
+       int i, ret, node;
 
        /* Enable GPU node if GPU setup has been performed */
        for (i = 0; i < ARRAY_SIZE(gpu_compats); i++) {
@@ -32,6 +36,15 @@ int ft_system_setup(void *blob, struct bd_info *bd)
                if (ret)
                        return ret;
        }
+
+       /* Pass simplefb parameters */
+       if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) {
+               node = fdt_node_offset_by_compatible(blob, -1, 
"simple-framebuffer");
+               if (node < 0)
+                       fdt_simplefb_add_node(blob);
+
+               fdt_simplefb_enable_and_mem_rsv(blob);
+       }
 
        return 0;
 }
-- 
2.53.0

Reply via email to