aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32
diff options
context:
space:
mode:
authorGuan Xuetao <gxt@mprc.pku.edu.cn>2011-04-01 04:38:59 -0400
committerGuan Xuetao <gxt@mprc.pku.edu.cn>2011-04-02 04:17:38 -0400
commit6b794743b2c5e21825d35b5d5dd57d6fcc388198 (patch)
tree4568d347074a1b7e7917de1114be045d61515256 /arch/unicore32
parent28e58cc9586ab3f4dbc79c55110955ad192e4c29 (diff)
unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable
1. get videomemory by __get_free_pages() in fb-puv3.c 2. remove resource reservation for old fixed UNIGFX_MMAP & UVC_MMAP space 3. remove unused macros: PKUNTIY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE, PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE and KUSER_UNIGFX_BASE 4. remove unused header linux/vmalloc.h in fb-puv3.h Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32')
-rw-r--r--arch/unicore32/include/mach/PKUnity.h10
-rw-r--r--arch/unicore32/include/mach/memory.h1
-rw-r--r--arch/unicore32/kernel/puv3-core.c5
-rw-r--r--arch/unicore32/kernel/setup.c15
-rw-r--r--arch/unicore32/mm/mmu.c20
5 files changed, 2 insertions, 49 deletions
diff --git a/arch/unicore32/include/mach/PKUnity.h b/arch/unicore32/include/mach/PKUnity.h
index a18bdc3810e6..8040d575dddb 100644
--- a/arch/unicore32/include/mach/PKUnity.h
+++ b/arch/unicore32/include/mach/PKUnity.h
@@ -24,16 +24,6 @@
24#define PKUNITY_MMIO_BASE 0x80000000 /* 0x80000000 - 0xFFFFFFFF 2GB */ 24#define PKUNITY_MMIO_BASE 0x80000000 /* 0x80000000 - 0xFFFFFFFF 2GB */
25 25
26/* 26/*
27 * PKUNITY Memory Map Addresses: 0x0D000000 - 0x0EFFFFFF (32MB)
28 * 0x0D000000 - 0x0DFFFFFF 16MB: for UVC
29 * 0x0E000000 - 0x0EFFFFFF 16MB: for UNIGFX
30 */
31#define PKUNITY_UVC_MMAP_BASE 0x0D000000
32#define PKUNITY_UVC_MMAP_SIZE 0x01000000 /* 16MB */
33#define PKUNITY_UNIGFX_MMAP_BASE 0x0E000000
34#define PKUNITY_UNIGFX_MMAP_SIZE 0x01000000 /* 16MB */
35
36/*
37 * PKUNITY System Bus Addresses (PCI): 0x80000000 - 0xBFFFFFFF (1GB) 27 * PKUNITY System Bus Addresses (PCI): 0x80000000 - 0xBFFFFFFF (1GB)
38 * 0x80000000 - 0x8000000B 12B PCI Configuration regs 28 * 0x80000000 - 0x8000000B 12B PCI Configuration regs
39 * 0x80010000 - 0x80010250 592B PCI Bridge Base 29 * 0x80010000 - 0x80010250 592B PCI Bridge Base
diff --git a/arch/unicore32/include/mach/memory.h b/arch/unicore32/include/mach/memory.h
index 0bf21c944710..4be72c21d491 100644
--- a/arch/unicore32/include/mach/memory.h
+++ b/arch/unicore32/include/mach/memory.h
@@ -50,7 +50,6 @@ void puv3_pci_adjust_zones(unsigned long *size, unsigned long *holes);
50 50
51/* kuser area */ 51/* kuser area */
52#define KUSER_VECPAGE_BASE (KUSER_BASE + UL(0x3fff0000)) 52#define KUSER_VECPAGE_BASE (KUSER_BASE + UL(0x3fff0000))
53#define KUSER_UNIGFX_BASE (PAGE_OFFSET + PKUNITY_UNIGFX_MMAP_BASE)
54/* kuser_vecpage (0xbfff0000) is ro, and vectors page (0xffff0000) is rw */ 53/* kuser_vecpage (0xbfff0000) is ro, and vectors page (0xffff0000) is rw */
55#define kuser_vecpage_to_vectors(x) ((x) - (KUSER_VECPAGE_BASE) \ 54#define kuser_vecpage_to_vectors(x) ((x) - (KUSER_VECPAGE_BASE) \
56 + (VECTORS_BASE)) 55 + (VECTORS_BASE))
diff --git a/arch/unicore32/kernel/puv3-core.c b/arch/unicore32/kernel/puv3-core.c
index 8b1b6beb858e..1a505a787765 100644
--- a/arch/unicore32/kernel/puv3-core.c
+++ b/arch/unicore32/kernel/puv3-core.c
@@ -99,11 +99,6 @@ static struct resource puv3_unigfx_resources[] = {
99 .end = io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff, 99 .end = io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff,
100 .flags = IORESOURCE_MEM, 100 .flags = IORESOURCE_MEM,
101 }, 101 },
102 [1] = {
103 .start = PKUNITY_UNIGFX_MMAP_BASE,
104 .end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE,
105 .flags = IORESOURCE_MEM,
106 },
107}; 102};
108 103
109static struct resource puv3_rtc_resources[] = { 104static struct resource puv3_rtc_resources[] = {
diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c
index 1e175a82844d..471b6bca8da4 100644
--- a/arch/unicore32/kernel/setup.c
+++ b/arch/unicore32/kernel/setup.c
@@ -64,12 +64,6 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
64 */ 64 */
65static struct resource mem_res[] = { 65static struct resource mem_res[] = {
66 { 66 {
67 .name = "Video RAM",
68 .start = 0,
69 .end = 0,
70 .flags = IORESOURCE_MEM
71 },
72 {
73 .name = "Kernel text", 67 .name = "Kernel text",
74 .start = 0, 68 .start = 0,
75 .end = 0, 69 .end = 0,
@@ -83,9 +77,8 @@ static struct resource mem_res[] = {
83 } 77 }
84}; 78};
85 79
86#define video_ram mem_res[0] 80#define kernel_code mem_res[0]
87#define kernel_code mem_res[1] 81#define kernel_data mem_res[1]
88#define kernel_data mem_res[2]
89 82
90/* 83/*
91 * These functions re-use the assembly code in head.S, which 84 * These functions re-use the assembly code in head.S, which
@@ -224,10 +217,6 @@ request_standard_resources(struct meminfo *mi)
224 kernel_data.end <= res->end) 217 kernel_data.end <= res->end)
225 request_resource(res, &kernel_data); 218 request_resource(res, &kernel_data);
226 } 219 }
227
228 video_ram.start = PKUNITY_UNIGFX_MMAP_BASE;
229 video_ram.end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE;
230 request_resource(&iomem_resource, &video_ram);
231} 220}
232 221
233static void (*init_machine)(void) __initdata; 222static void (*init_machine)(void) __initdata;
diff --git a/arch/unicore32/mm/mmu.c b/arch/unicore32/mm/mmu.c
index 7bf3d588631f..db2d334941b4 100644
--- a/arch/unicore32/mm/mmu.c
+++ b/arch/unicore32/mm/mmu.c
@@ -338,15 +338,6 @@ void __init uc32_mm_memblock_reserve(void)
338 * and can only be in node 0. 338 * and can only be in node 0.
339 */ 339 */
340 memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t)); 340 memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));
341
342#ifdef CONFIG_PUV3_UNIGFX
343 /*
344 * These should likewise go elsewhere. They pre-reserve the
345 * screen/video memory region at the 48M~64M of main system memory.
346 */
347 memblock_reserve(PKUNITY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE);
348 memblock_reserve(PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE);
349#endif
350} 341}
351 342
352/* 343/*
@@ -371,17 +362,6 @@ static void __init devicemaps_init(void)
371 pmd_clear(pmd_off_k(addr)); 362 pmd_clear(pmd_off_k(addr));
372 363
373 /* 364 /*
374 * Create a mapping for UniGFX VRAM
375 */
376#ifdef CONFIG_PUV3_UNIGFX
377 map.pfn = __phys_to_pfn(PKUNITY_UNIGFX_MMAP_BASE);
378 map.virtual = KUSER_UNIGFX_BASE;
379 map.length = PKUNITY_UNIGFX_MMAP_SIZE;
380 map.type = MT_KUSER;
381 create_mapping(&map);
382#endif
383
384 /*
385 * Create a mapping for the machine vectors at the high-vectors 365 * Create a mapping for the machine vectors at the high-vectors
386 * location (0xffff0000). If we aren't using high-vectors, also 366 * location (0xffff0000). If we aren't using high-vectors, also
387 * create a mapping at the low-vectors virtual address. 367 * create a mapping at the low-vectors virtual address.