summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2011-07-05 18:27:43 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:25 -0800
commitece493d6698b37e4e8960a00013ea3bc14ac0077 (patch)
treed701fa1973a9149d796694b0317ff803539cb126 /arch/arm/mach-tegra
parent6bb75fef198e459478cd846ef2cfa0026647a90f (diff)
arm: tegra: cardhu: Fix the issue of boot screen corruption.
- The issue is due to the corruption of bootloader fb during kernel initialization. This change reserves the bootloader fb and then frees it until bootloader fb is copied to fb for Cardhu, Ventana, Whistler, Enterprise and Aruba. - Change color depth of Cardhu and Harmony to 32-bit. Bug 828271 Bug 832016 Original-Change-Id: I05ef5930ee68dcbd672a5cb59b4568a2c88a2e55 Reviewed-on: http://git-master/r/34966 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rb3c9280ea4643ccee661d37d24fb540319470bf7
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-aruba-panel.c4
-rw-r--r--arch/arm/mach-tegra/board-aruba.c1
-rw-r--r--arch/arm/mach-tegra/board-cardhu-panel.c7
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c1
-rw-r--r--arch/arm/mach-tegra/board-enterprise-panel.c8
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c1
-rw-r--r--arch/arm/mach-tegra/board-harmony-panel.c2
-rw-r--r--arch/arm/mach-tegra/board-ventana-panel.c6
-rw-r--r--arch/arm/mach-tegra/board-ventana.c1
-rw-r--r--arch/arm/mach-tegra/board-whistler-panel.c6
-rw-r--r--arch/arm/mach-tegra/board-whistler.c1
-rw-r--r--arch/arm/mach-tegra/board.h1
-rw-r--r--arch/arm/mach-tegra/common.c33
13 files changed, 59 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/board-aruba-panel.c b/arch/arm/mach-tegra/board-aruba-panel.c
index 5db69f66a13a..deb2a089560a 100644
--- a/arch/arm/mach-tegra/board-aruba-panel.c
+++ b/arch/arm/mach-tegra/board-aruba-panel.c
@@ -228,6 +228,10 @@ int __init aruba_panel_init(void)
res->start = tegra_fb_start;
res->end = tegra_fb_start + tegra_fb_size - 1;
+ /* Copy the bootloader fb to the fb. */
+ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,
+ min(tegra_fb_size, tegra_bootloader_fb_size));
+
if (!err)
err = nvhost_device_register(&aruba_disp1_device);
diff --git a/arch/arm/mach-tegra/board-aruba.c b/arch/arm/mach-tegra/board-aruba.c
index 0f0befe0c6d0..df7d4c65598f 100644
--- a/arch/arm/mach-tegra/board-aruba.c
+++ b/arch/arm/mach-tegra/board-aruba.c
@@ -493,6 +493,7 @@ static void __init tegra_aruba_init(void)
aruba_sensors_init();
aruba_bt_rfkill();
aruba_sata_init();
+ tegra_release_bootloader_fb();
}
static void __init tegra_aruba_reserve(void)
diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c
index 2d7398ff20e5..1f7c2bce0eb3 100644
--- a/arch/arm/mach-tegra/board-cardhu-panel.c
+++ b/arch/arm/mach-tegra/board-cardhu-panel.c
@@ -499,6 +499,7 @@ static struct tegra_fb_data cardhu_fb_data = {
.xres = 1366,
.yres = 768,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
static struct tegra_fb_data cardhu_hdmi_fb_data = {
@@ -506,6 +507,7 @@ static struct tegra_fb_data cardhu_hdmi_fb_data = {
.xres = 1366,
.yres = 768,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
static struct tegra_dc_out cardhu_disp2_out = {
@@ -781,6 +783,7 @@ static struct tegra_fb_data cardhu_dsi_fb_data = {
.yres = 480,
.bits_per_pixel = 32,
#endif
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
@@ -899,6 +902,10 @@ int __init cardhu_panel_init(void)
res->start = tegra_fb_start;
res->end = tegra_fb_start + tegra_fb_size - 1;
+ /* Copy the bootloader fb to the fb. */
+ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,
+ min(tegra_fb_size, tegra_bootloader_fb_size));
+
if (!err)
err = nvhost_device_register(&cardhu_disp1_device);
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index 051a0c817e1e..cc3df088fa0d 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -662,6 +662,7 @@ static void __init tegra_cardhu_init(void)
//audio_wired_jack_init();
cardhu_pins_state_init();
cardhu_emc_init();
+ tegra_release_bootloader_fb();
}
static void __init tegra_cardhu_reserve(void)
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c
index c2c31ba8dea4..e64a031bfbcf 100644
--- a/arch/arm/mach-tegra/board-enterprise-panel.c
+++ b/arch/arm/mach-tegra/board-enterprise-panel.c
@@ -309,7 +309,8 @@ static struct tegra_fb_data enterprise_hdmi_fb_data = {
.win = 0,
.xres = 1366,
.yres = 768,
- .bits_per_pixel = 16,
+ .bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
static struct tegra_dc_out enterprise_disp2_out = {
@@ -499,6 +500,7 @@ static struct tegra_fb_data enterprise_dsi_fb_data = {
.xres = 540,
.yres = 960,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
@@ -611,6 +613,10 @@ int __init enterprise_panel_init(void)
res->start = tegra_fb_start;
res->end = tegra_fb_start + tegra_fb_size - 1;
+ /* Copy the bootloader fb to the fb. */
+ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,
+ min(tegra_fb_size, tegra_bootloader_fb_size));
+
if (!err)
err = nvhost_device_register(&enterprise_disp1_device);
diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c
index 981bbdb82860..23a13a9eae72 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -422,6 +422,7 @@ static void __init tegra_enterprise_init(void)
enterprise_emc_init();
enterprise_sensors_init();
enterprise_suspend_init();
+ tegra_release_bootloader_fb();
}
static void __init tegra_enterprise_reserve(void)
diff --git a/arch/arm/mach-tegra/board-harmony-panel.c b/arch/arm/mach-tegra/board-harmony-panel.c
index 309d72e4b490..a7890a797e92 100644
--- a/arch/arm/mach-tegra/board-harmony-panel.c
+++ b/arch/arm/mach-tegra/board-harmony-panel.c
@@ -45,7 +45,7 @@ static struct tegra_fb_lcd_data tegra_fb_lcd_platform_data = {
.lcd_yres = 600,
.fb_xres = 1024,
.fb_yres = 600,
- .bits_per_pixel = 16,
+ .bits_per_pixel = 32,
};
static struct platform_device tegra_fb_device = {
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c
index 8aeee024fca2..6563e7cf6d75 100644
--- a/arch/arm/mach-tegra/board-ventana-panel.c
+++ b/arch/arm/mach-tegra/board-ventana-panel.c
@@ -215,6 +215,7 @@ static struct tegra_fb_data ventana_fb_data = {
.xres = 1366,
.yres = 768,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
static struct tegra_fb_data ventana_hdmi_fb_data = {
@@ -222,6 +223,7 @@ static struct tegra_fb_data ventana_hdmi_fb_data = {
.xres = 1366,
.yres = 768,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
static struct tegra_dc_out ventana_disp1_out = {
@@ -357,6 +359,10 @@ int __init ventana_panel_init(void)
res->start = tegra_fb2_start;
res->end = tegra_fb2_start + tegra_fb2_size - 1;
+ /* Copy the bootloader fb to the fb. */
+ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,
+ min(tegra_fb_size, tegra_bootloader_fb_size));
+
if (!err)
err = nvhost_device_register(&ventana_disp1_device);
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 31a848af7177..760ff726a5f1 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -540,6 +540,7 @@ static void __init tegra_ventana_init(void)
ventana_bt_rfkill();
ventana_power_off_init();
ventana_emc_init();
+ tegra_release_bootloader_fb();
}
int __init tegra_ventana_protected_aperture_init(void)
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index d41459fa43ff..9603b69bc107 100644
--- a/arch/arm/mach-tegra/board-whistler-panel.c
+++ b/arch/arm/mach-tegra/board-whistler-panel.c
@@ -207,6 +207,7 @@ static struct tegra_fb_data whistler_fb_data = {
.xres = 800,
.yres = 480,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
static struct tegra_fb_data whistler_hdmi_fb_data = {
@@ -214,6 +215,7 @@ static struct tegra_fb_data whistler_hdmi_fb_data = {
.xres = 800,
.yres = 480,
.bits_per_pixel = 32,
+ .flags = TEGRA_FB_FLIP_ON_PROBE,
};
@@ -299,6 +301,10 @@ int __init whistler_panel_init(void)
res->start = tegra_fb_start;
res->end = tegra_fb_start + tegra_fb_size - 1;
+ /* Copy the bootloader fb to the fb. */
+ tegra_move_framebuffer(tegra_fb_start, tegra_bootloader_fb_start,
+ min(tegra_fb_size, tegra_bootloader_fb_size));
+
res = nvhost_get_resource_byname(&whistler_disp2_device,
IORESOURCE_MEM, "fbmem");
res->start = tegra_fb2_start;
diff --git a/arch/arm/mach-tegra/board-whistler.c b/arch/arm/mach-tegra/board-whistler.c
index e324442b0e45..db827fd54875 100644
--- a/arch/arm/mach-tegra/board-whistler.c
+++ b/arch/arm/mach-tegra/board-whistler.c
@@ -392,6 +392,7 @@ static void __init tegra_whistler_init(void)
whistler_power_off_init();
whistler_emc_init();
whistler_baseband_init();
+ tegra_release_bootloader_fb();
}
int __init tegra_whistler_protected_aperture_init(void)
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 2665a6f0df41..eaba871b7d72 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -42,6 +42,7 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
unsigned long fb2_size);
int __init tegra_pcie_init(bool init_port0, bool init_port1);
void tegra_init_cache(void);
+void __init tegra_release_bootloader_fb(void);
void __init tegra_protected_aperture_init(unsigned long aperture);
void __init tegra_tsensor_init(void);
void tegra_move_framebuffer(unsigned long to, unsigned long from,
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 9839708d3316..1c621bc67c08 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -499,7 +499,7 @@ void tegra_move_framebuffer(unsigned long to, unsigned long from,
goto out;
}
- for (i = 0; i < size; i+= 4)
+ for (i = 0; i < size; i += 4)
writel(readl(from_io + i), to_io + i);
iounmap(from_io);
@@ -542,16 +542,15 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
carveout_size, tegra_carveout_start);
tegra_carveout_start = 0;
tegra_carveout_size = 0;
- }
- else
+ } else
tegra_carveout_size = carveout_size;
}
if (fb2_size) {
tegra_fb2_start = memblock_end_of_DRAM() - fb2_size;
if (memblock_remove(tegra_fb2_start, fb2_size)) {
- pr_err("Failed to remove second framebuffer %08lx@%08lx "
- "from memory map\n",
+ pr_err("Failed to remove second framebuffer "
+ "%08lx@%08lx from memory map\n",
fb2_size, tegra_fb2_start);
tegra_fb2_start = 0;
tegra_fb2_size = 0;
@@ -606,17 +605,20 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
#endif
/*
- * TODO: We should copy the bootloader's framebuffer to the framebuffer
- * allocated above, and then free this one.
- */
- if (tegra_bootloader_fb_size)
+ * We copy the bootloader's framebuffer to the framebuffer allocated
+ * above, and then free this one.
+ * */
+ if (tegra_bootloader_fb_size) {
+ tegra_bootloader_fb_size = PAGE_ALIGN(tegra_bootloader_fb_size);
if (memblock_reserve(tegra_bootloader_fb_start,
tegra_bootloader_fb_size)) {
- pr_err("Failed to reserve bootloader frame buffer %08lx@%08lx\n",
- tegra_bootloader_fb_size, tegra_bootloader_fb_start);
+ pr_err("Failed to reserve bootloader frame buffer "
+ "%08lx@%08lx\n", tegra_bootloader_fb_size,
+ tegra_bootloader_fb_start);
tegra_bootloader_fb_start = 0;
tegra_bootloader_fb_size = 0;
}
+ }
pr_info("Tegra reserved memory:\n"
"LP0: %08lx - %08lx\n"
@@ -646,3 +648,12 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
smmu_window->start, smmu_window->end);
#endif
}
+
+void __init tegra_release_bootloader_fb(void)
+{
+ /* Since bootloader fb is reserved in common.c, it is freed here. */
+ if (tegra_bootloader_fb_size)
+ if (memblock_free(tegra_bootloader_fb_start,
+ tegra_bootloader_fb_size))
+ pr_err("Failed to free bootloader fb.\n");
+}