From fd7e2ee0b2b8ad42303a4f57052fce3f0f9a29f9 Mon Sep 17 00:00:00 2001 From: Markinus Date: Sun, 29 Aug 2010 13:40:28 +0200 Subject: [PATCH] htcleo: fixed wrong memory configuration Credits to manusfreedom Still problems with gralloc but no stripes --- arch/arm/mach-msm/board-htcleo.c | 43 +++++++++++++++++++++++++++++--- arch/arm/mach-msm/board-htcleo.h | 10 ++------ 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-msm/board-htcleo.c b/arch/arm/mach-msm/board-htcleo.c index 1b698a75..1690dbbd 100644 --- a/arch/arm/mach-msm/board-htcleo.c +++ b/arch/arm/mach-msm/board-htcleo.c @@ -348,16 +348,12 @@ static struct platform_device msm_kgsl_device = static struct android_pmem_platform_data android_pmem_pdata = { .name = "pmem", - .start = MSM_PMEM_MDP_BASE, - .size = MSM_PMEM_MDP_SIZE, .no_allocator = 0, .cached = 1, }; static struct android_pmem_platform_data android_pmem_adsp_pdata = { .name = "pmem_adsp", - .start = MSM_PMEM_ADSP_BASE, - .size = MSM_PMEM_ADSP_SIZE, .no_allocator = 0, .cached = 1, }; @@ -597,9 +593,48 @@ int __init ram_console_early_init(void); #endif #endif +static unsigned pmem_sf_size = MSM_PMEM_SF_SIZE; +static void __init pmem_sf_size_setup(char **p) +{ + pmem_sf_size = memparse(*p, p); +} +__early_param("pmem_sf_size=", pmem_sf_size_setup); + +static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; +static void __init pmem_adsp_size_setup(char **p) +{ + pmem_adsp_size = memparse(*p, p); +} +__early_param("pmem_adsp_size=", pmem_adsp_size_setup); + +static void __init htcleo_allocate_memory_regions(void) +{ + void *addr; + unsigned long size; + + size = pmem_sf_size; + if (size) { + addr = alloc_bootmem(size); + android_pmem_pdata.start = __pa(addr); + android_pmem_pdata.size = size; + pr_info("allocating %lu bytes at %p (%lx physical) for sf " + "pmem arena\n", size, addr, __pa(addr)); + } + + size = pmem_adsp_size; + if (size) { + addr = alloc_bootmem(size); + android_pmem_adsp_pdata.start = __pa(addr); + android_pmem_adsp_pdata.size = size; + pr_info("allocating %lu bytes at %p (%lx physical) for adsp " + "pmem arena\n", size, addr, __pa(addr)); + } +} + static void __init htcleo_map_io(void) { msm_map_common_io(); + htcleo_allocate_memory_regions(); msm_clock_init(); #if defined(CONFIG_VERY_EARLY_CONSOLE) diff --git a/arch/arm/mach-msm/board-htcleo.h b/arch/arm/mach-msm/board-htcleo.h index a592eb2d..36435646 100644 --- a/arch/arm/mach-msm/board-htcleo.h +++ b/arch/arm/mach-msm/board-htcleo.h @@ -20,13 +20,7 @@ #define MSM_EBI1_BANK0_BASE 0x11800000 //#define MSM_EBI1_BANK0_SIZE 0x1E800000 /* 488MB */ -#define MSM_EBI1_BANK0_SIZE 0x1A7C0000 /* 424MB - 0x00040000 RAM CONSOLE*/ - -#define MSM_PMEM_MDP_BASE (MSM_EBI1_BANK0_BASE+MSM_EBI1_BANK0_SIZE) -#define MSM_PMEM_MDP_SIZE 0x02000000 - -#define MSM_PMEM_ADSP_BASE (MSM_PMEM_MDP_BASE+MSM_PMEM_MDP_SIZE) -#define MSM_PMEM_ADSP_SIZE 0x02000000 +#define MSM_EBI1_BANK0_SIZE 0x1E7C0000 /* 488MB - 0x00040000 RAM CONSOLE*/ /* Don't change that */ #define MSM_SMI_BASE 0x00000000 @@ -56,7 +50,7 @@ #define MSM_PMEM_SF_SIZE 0x02000000 -//#define MSM_PMEM_ADSP_SIZE 0x02196000 +#define MSM_PMEM_ADSP_SIZE 0x02196000 /* MSM_RAM_CONSOLE uses the last 0x00040000 of EBI memory, defined in msm_iomap.h #define MSM_RAM_CONSOLE_SIZE 0x00040000