summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cherry <tcherry@nvidia.com>2010-12-02 13:35:46 -0800
committerBharat Nihalani <bnihalani@nvidia.com>2010-12-18 00:48:58 -0800
commita37a8664c99213050017b5a89dabd9d0d5969a82 (patch)
tree6eb08696c08b774ef38e76e3857ed40d310247d2
parentfaed21a8c68afa6dc5528e53a8aea5ba1e5b3a20 (diff)
tegra: whistler: memblock_reserve
use memblock_reserve fb functions for fb memory reservation Cherry-picked from http://git-master/r/#change,11090 Change-Id: I71c47dfb381eb070c87b94620989ff99b053df30 Reviewed-on: http://git-master/r/12348 Tested-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-whistler-panel.c12
-rw-r--r--arch/arm/mach-tegra/board-whistler.c16
2 files changed, 26 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index 8aa46ef86185..90acf239ecfd 100644
--- a/arch/arm/mach-tegra/board-whistler-panel.c
+++ b/arch/arm/mach-tegra/board-whistler-panel.c
@@ -34,6 +34,7 @@
#include "devices.h"
#include "gpio-names.h"
+#include "board.h"
static struct resource whistler_disp1_resources[] = {
{
@@ -50,8 +51,6 @@ static struct resource whistler_disp1_resources[] = {
},
{
.name = "fbmem",
- .start = 0x18012000,
- .end = 0x18414000 - 1, /* enough for 1080P 16bpp */
.flags = IORESOURCE_MEM,
},
};
@@ -161,10 +160,19 @@ static struct platform_device *whistler_gfx_devices[] __initdata = {
int __init whistler_panel_init(void)
{
int err;
+ struct resource *res;
+
+ whistler_carveouts[1].base = tegra_carveout_start;
+ whistler_carveouts[1].size = tegra_carveout_size;
err = platform_add_devices(whistler_gfx_devices,
ARRAY_SIZE(whistler_gfx_devices));
+ res = nvhost_get_resource_byname(&whistler_disp1_device,
+ IORESOURCE_MEM, "fbmem");
+ res->start = tegra_fb_start;
+ res->end = tegra_fb_start + tegra_fb_size - 1;
+
if (!err)
err = nvhost_device_register(&whistler_disp1_device);
diff --git a/arch/arm/mach-tegra/board-whistler.c b/arch/arm/mach-tegra/board-whistler.c
index 45bc0fd67acd..80fa1d788c15 100644
--- a/arch/arm/mach-tegra/board-whistler.c
+++ b/arch/arm/mach-tegra/board-whistler.c
@@ -34,6 +34,7 @@
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/usb/android_composite.h>
+#include <linux/memblock.h>
#include <mach/clk.h>
#include <mach/iomap.h>
@@ -207,6 +208,20 @@ static void __init tegra_whistler_init(void)
whistler_touch_init();
}
+int __init tegra_whistler_protected_aperture_init(void)
+{
+ tegra_protected_aperture_init(tegra_grhost_aperture);
+ return 0;
+}
+
+void __init tegra_whistler_reserve(void)
+{
+ if (memblock_reserve(0x0, 4096) < 0)
+ pr_warn("Cannot reserve first 4K of memory for safety\n");
+
+ tegra_reserve(SZ_128M, SZ_8M, SZ_16M);
+}
+
MACHINE_START(WHISTLER, "whistler")
.boot_params = 0x00000100,
.phys_io = IO_APB_PHYS,
@@ -214,5 +229,6 @@ MACHINE_START(WHISTLER, "whistler")
.init_irq = tegra_init_irq,
.init_machine = tegra_whistler_init,
.map_io = tegra_map_common_io,
+ .reserve = tegra_whistler_reserve,
.timer = &tegra_timer,
MACHINE_END