From 33735ca3523d404a3bed1c68381e53a668711d32 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 7 Sep 2011 17:05:34 -0700 Subject: arm: tegra: enterprise: add ram console Reviewed-on: http://git-master/r/51212 (cherry picked from commit a9abc3b04bed4a8aae95e17656aaa61240464b01) Change-Id: I00b905215d73cb8c1454263edded62d410d51b0d Reviewed-on: http://git-master/r/53611 Tested-by: Thomas Cherry Reviewed-by: Bharat Nihalani --- arch/arm/mach-tegra/board-enterprise.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c index fca0d5d1635b..c823f2adf479 100644 --- a/arch/arm/mach-tegra/board-enterprise.c +++ b/arch/arm/mach-tegra/board-enterprise.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -722,6 +723,19 @@ static struct platform_device tegra_camera = { .id = -1, }; +static struct resource ram_console_resources[] = { + { + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device ram_console_device = { + .name = "ram_console", + .id = -1, + .num_resources = ARRAY_SIZE(ram_console_resources), + .resource = ram_console_resources, +}; + static struct platform_device *enterprise_devices[] __initdata = { &tegra_usb_fsg_device, &androidusb_device, @@ -741,6 +755,7 @@ static struct platform_device *enterprise_devices[] __initdata = { #if defined(CONFIG_CRYPTO_DEV_TEGRA_AES) &tegra_aes_device, #endif + &ram_console_device, }; static struct usb_phy_plat_data tegra_usb_phy_pdata[] = { @@ -1008,11 +1023,23 @@ static void __init tegra_enterprise_init(void) static void __init tegra_enterprise_reserve(void) { + struct resource *res; + long ret; #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM) tegra_reserve(0, SZ_4M, SZ_8M); #else tegra_reserve(SZ_128M, SZ_4M, SZ_8M); #endif + + res = platform_get_resource(&ram_console_device, IORESOURCE_MEM, 0); + res->start = memblock_end_of_DRAM() - SZ_1M; + res->end = res->start + SZ_1M - 1; + ret = memblock_remove(res->start, SZ_1M); + if (ret) { + ram_console_device.resource = NULL; + ram_console_device.num_resources = 0; + pr_err("Failed to reserve memory block for ram console\n"); + } } MACHINE_START(TEGRA_ENTERPRISE, "tegra_enterprise") -- cgit v1.2.3