Commit d80e2bb1 authored by Haavard Skinnemoen's avatar Haavard Skinnemoen

[AVR32] Get rid of board_setup_fbmem()

Since the core setup code takes care of both allocation and
reservation of framebuffer memory, there's no need for this board-
specific hook anymore. Replace it with two global variables,
fbmem_start and fbmem_size, which can be used directly.
Signed-off-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent f9692b95
...@@ -33,7 +33,7 @@ struct eth_addr { ...@@ -33,7 +33,7 @@ struct eth_addr {
static struct eth_addr __initdata hw_addr[2]; static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2]; static struct eth_platform_data __initdata eth_data[2];
extern struct lcdc_platform_data atstk1000_fb0_data; static struct lcdc_platform_data atstk1000_fb0_data;
static struct spi_board_info spi0_board_info[] __initdata = { static struct spi_board_info spi0_board_info[] __initdata = {
{ {
...@@ -148,6 +148,8 @@ static int __init atstk1002_init(void) ...@@ -148,6 +148,8 @@ static int __init atstk1002_init(void)
set_hw_addr(at32_add_device_eth(0, &eth_data[0])); set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
atstk1000_fb0_data.fbmem_start = fbmem_start;
atstk1000_fb0_data.fbmem_size = fbmem_size;
at32_add_device_lcdc(0, &atstk1000_fb0_data); at32_add_device_lcdc(0, &atstk1000_fb0_data);
return 0; return 0;
......
...@@ -18,33 +18,3 @@ ...@@ -18,33 +18,3 @@
/* Initialized by bootloader-specific startup code. */ /* Initialized by bootloader-specific startup code. */
struct tag *bootloader_tags __initdata; struct tag *bootloader_tags __initdata;
struct lcdc_platform_data __initdata atstk1000_fb0_data;
void __init board_setup_fbmem(unsigned long fbmem_start,
unsigned long fbmem_size)
{
if (!fbmem_size)
return;
if (!fbmem_start) {
void *fbmem;
fbmem = alloc_bootmem_low_pages(fbmem_size);
fbmem_start = __pa(fbmem);
} else {
pg_data_t *pgdat;
for_each_online_pgdat(pgdat) {
if (fbmem_start >= pgdat->bdata->node_boot_start
&& fbmem_start <= pgdat->bdata->node_low_pfn)
reserve_bootmem_node(pgdat, fbmem_start,
fbmem_size);
}
}
printk("%luKiB framebuffer memory at address 0x%08lx\n",
fbmem_size >> 10, fbmem_start);
atstk1000_fb0_data.fbmem_start = fbmem_start;
atstk1000_fb0_data.fbmem_size = fbmem_size;
}
...@@ -228,8 +228,8 @@ alloc_reserved_region(resource_size_t *start, resource_size_t size, ...@@ -228,8 +228,8 @@ alloc_reserved_region(resource_size_t *start, resource_size_t size,
* Board-specific code may use these variables to set up platform data * Board-specific code may use these variables to set up platform data
* for the framebuffer driver if fbmem_size is nonzero. * for the framebuffer driver if fbmem_size is nonzero.
*/ */
static resource_size_t __initdata fbmem_start; resource_size_t __initdata fbmem_start;
static resource_size_t __initdata fbmem_size; resource_size_t __initdata fbmem_size;
/* /*
* "fbmem=xxx[kKmM]" allocates the specified amount of boot memory for * "fbmem=xxx[kKmM]" allocates the specified amount of boot memory for
...@@ -561,13 +561,10 @@ void __init setup_arch (char **cmdline_p) ...@@ -561,13 +561,10 @@ void __init setup_arch (char **cmdline_p)
setup_bootmem(); setup_bootmem();
board_setup_fbmem(fbmem_start, fbmem_size);
#ifdef CONFIG_VT #ifdef CONFIG_VT
conswitchp = &dummy_con; conswitchp = &dummy_con;
#endif #endif
paging_init(); paging_init();
resource_init(); resource_init();
} }
...@@ -126,10 +126,10 @@ struct tagtable { ...@@ -126,10 +126,10 @@ struct tagtable {
extern struct tag *bootloader_tags; extern struct tag *bootloader_tags;
extern resource_size_t fbmem_start;
extern resource_size_t fbmem_size;
void setup_processor(void); void setup_processor(void);
extern void board_setup_fbmem(unsigned long fbmem_start,
unsigned long fbmem_size);
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment