summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cherry <tcherry@nvidia.com>2011-09-07 17:10:38 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-09-15 12:26:21 -0700
commitcb64054a12aca84b097556c7c4f4e7c67916fd93 (patch)
tree27ca93647c66f4d0d1bd346008eb7bb7423654b0
parent12a4cfbd7b0c0eafcc5f9bc8fa0cf18cb051d8ae (diff)
arm: tegra: cardhu: cleanup ram console
Various cleanup including removing two unneeded static variables and an unneeded function, as well as reserving the ram console after the carveout and framebuffer. Change-Id: I946399600ff65cd9e64c79ce0bc6613c7c4e855c Reviewed-on: http://git-master/r/51214 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index aa3db628cc6c..e2f085f6d4bd 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -65,9 +65,6 @@
#include "fuse.h"
#include "baseband-xmm-power.h"
-static unsigned long ramconsole_start;
-static unsigned long ramconsole_size;
-
static struct usb_mass_storage_platform_data tegra_usb_fsg_platform = {
.vendor = "NVIDIA",
.product = "Tegra 3",
@@ -1104,14 +1101,6 @@ static void cardhu_sata_init(void)
static void cardhu_sata_init(void) { }
#endif
-static void cardhu_ramconsole_init(void)
-{
- struct resource *res;
- res = platform_get_resource(&ram_console_device, IORESOURCE_MEM, 0);
- res->start = ramconsole_start;
- res->end = res->start + ramconsole_size - 1;
-}
-
static void __init tegra_cardhu_init(void)
{
tegra_common_init();
@@ -1126,7 +1115,6 @@ static void __init tegra_cardhu_init(void)
cardhu_uart_init();
snprintf(usb_serial_num, sizeof(usb_serial_num), "%llx", tegra_chip_uid());
andusb_plat.serial_number = kstrdup(usb_serial_num, GFP_KERNEL);
- cardhu_ramconsole_init();
platform_add_devices(cardhu_devices, ARRAY_SIZE(cardhu_devices));
cardhu_audio_init();
cardhu_sdhci_init();
@@ -1155,21 +1143,24 @@ static void __init tegra_cardhu_init(void)
static void __init tegra_cardhu_reserve(void)
{
+ struct resource *res;
long ret;
- ramconsole_size = SZ_1M;
- ramconsole_start = memblock_end_of_DRAM() - ramconsole_size;
- ret = memblock_remove(ramconsole_start, ramconsole_size);
- if (ret) {
- ramconsole_size = 0;
- pr_err("Failed to reserve memory block for ram console\n");
- }
-
#if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
/* support 1920X1200 with 24bpp */
tegra_reserve(0, SZ_8M + SZ_1M, SZ_8M + SZ_1M);
#else
tegra_reserve(SZ_128M, SZ_8M, 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(CARDHU, "cardhu")