summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cherry <tcherry@nvidia.com>2011-09-07 17:05:34 -0700
committerSimone Willett <swillett@nvidia.com>2011-09-21 16:18:37 -0700
commit33735ca3523d404a3bed1c68381e53a668711d32 (patch)
treeb45e0f07cc507d9c239c5f50af117f3cfc72f404
parent31edf6de69113e9895d495c5b584e1af6375cfed (diff)
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 <tcherry@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c27
1 files changed, 27 insertions, 0 deletions
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 <linux/spi/spi.h>
#include <linux/tegra_uart.h>
#include <linux/fsl_devices.h>
+#include <linux/memblock.h>
#include <mach/clk.h>
#include <mach/iomap.h>
@@ -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")