Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b794743 authored by Guan Xuetao's avatar Guan Xuetao
Browse files

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: default avatarGuan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 28e58cc9
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -23,16 +23,6 @@
#define PKUNITY_SDRAM_BASE		0x00000000 /* 0x00000000 - 0x7FFFFFFF 2GB */
#define PKUNITY_MMIO_BASE		0x80000000 /* 0x80000000 - 0xFFFFFFFF 2GB */

/*
 * PKUNITY Memory Map Addresses: 0x0D000000 - 0x0EFFFFFF (32MB)
 *	0x0D000000 - 0x0DFFFFFF 16MB: for UVC
 *	0x0E000000 - 0x0EFFFFFF 16MB: for UNIGFX
 */
#define PKUNITY_UVC_MMAP_BASE		0x0D000000
#define PKUNITY_UVC_MMAP_SIZE		0x01000000 /* 16MB */
#define PKUNITY_UNIGFX_MMAP_BASE        0x0E000000
#define PKUNITY_UNIGFX_MMAP_SIZE        0x01000000 /* 16MB */

/*
 * PKUNITY System Bus Addresses (PCI): 0x80000000 - 0xBFFFFFFF (1GB)
 * 0x80000000 - 0x8000000B 12B    PCI Configuration regs
+0 −1
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ void puv3_pci_adjust_zones(unsigned long *size, unsigned long *holes);

/* kuser area */
#define KUSER_VECPAGE_BASE	(KUSER_BASE + UL(0x3fff0000))
#define KUSER_UNIGFX_BASE	(PAGE_OFFSET + PKUNITY_UNIGFX_MMAP_BASE)
/* kuser_vecpage (0xbfff0000) is ro, and vectors page (0xffff0000) is rw */
#define kuser_vecpage_to_vectors(x)	((x) - (KUSER_VECPAGE_BASE)	\
					+ (VECTORS_BASE))
+0 −5
Original line number Diff line number Diff line
@@ -99,11 +99,6 @@ static struct resource puv3_unigfx_resources[] = {
		.end	= io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= PKUNITY_UNIGFX_MMAP_BASE,
		.end	= PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE,
		.flags	= IORESOURCE_MEM,
	},
};

static struct resource puv3_rtc_resources[] = {
+2 −13
Original line number Diff line number Diff line
@@ -63,12 +63,6 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
 * Standard memory resources
 */
static struct resource mem_res[] = {
	{
		.name = "Video RAM",
		.start = 0,
		.end = 0,
		.flags = IORESOURCE_MEM
	},
	{
		.name = "Kernel text",
		.start = 0,
@@ -83,9 +77,8 @@ static struct resource mem_res[] = {
	}
};

#define video_ram   mem_res[0]
#define kernel_code mem_res[1]
#define kernel_data mem_res[2]
#define kernel_code mem_res[0]
#define kernel_data mem_res[1]

/*
 * These functions re-use the assembly code in head.S, which
@@ -224,10 +217,6 @@ request_standard_resources(struct meminfo *mi)
		    kernel_data.end <= res->end)
			request_resource(res, &kernel_data);
	}

	video_ram.start = PKUNITY_UNIGFX_MMAP_BASE;
	video_ram.end   = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE;
	request_resource(&iomem_resource, &video_ram);
}

static void (*init_machine)(void) __initdata;
+0 −20
Original line number Diff line number Diff line
@@ -338,15 +338,6 @@ void __init uc32_mm_memblock_reserve(void)
	 * and can only be in node 0.
	 */
	memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));

#ifdef CONFIG_PUV3_UNIGFX
	/*
	 * These should likewise go elsewhere.  They pre-reserve the
	 * screen/video memory region at the 48M~64M of main system memory.
	 */
	memblock_reserve(PKUNITY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE);
	memblock_reserve(PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE);
#endif
}

/*
@@ -370,17 +361,6 @@ static void __init devicemaps_init(void)
	for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
		pmd_clear(pmd_off_k(addr));

	/*
	 * Create a mapping for UniGFX VRAM
	 */
#ifdef CONFIG_PUV3_UNIGFX
	map.pfn = __phys_to_pfn(PKUNITY_UNIGFX_MMAP_BASE);
	map.virtual = KUSER_UNIGFX_BASE;
	map.length = PKUNITY_UNIGFX_MMAP_SIZE;
	map.type = MT_KUSER;
	create_mapping(&map);
#endif

	/*
	 * Create a mapping for the machine vectors at the high-vectors
	 * location (0xffff0000).  If we aren't using high-vectors, also
Loading