[AVR32] Get rid of board_setup_fbmem()
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Wed, 21 Mar 2007 15:23:41 +0000 (16:23 +0100)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 27 Apr 2007 11:44:15 +0000 (13:44 +0200)
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: Haavard Skinnemoen <hskinnemoen@atmel.com>
arch/avr32/boards/atstk1000/atstk1002.c
arch/avr32/boards/atstk1000/setup.c
arch/avr32/kernel/setup.c
include/asm-avr32/setup.h

index 5974768..abe6ca2 100644 (file)
@@ -33,7 +33,7 @@ struct eth_addr {
 static struct eth_addr __initdata hw_addr[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 = {
        {
@@ -148,6 +148,8 @@ static int __init atstk1002_init(void)
        set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
 
        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);
 
        return 0;
index 272c011..2bc4b88 100644 (file)
 
 /* Initialized by bootloader-specific startup code. */
 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;
-}
index 1682e2d..b279d66 100644 (file)
@@ -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
  * for the framebuffer driver if fbmem_size is nonzero.
  */
-static resource_size_t __initdata fbmem_start;
-static resource_size_t __initdata fbmem_size;
+resource_size_t __initdata fbmem_start;
+resource_size_t __initdata fbmem_size;
 
 /*
  * "fbmem=xxx[kKmM]" allocates the specified amount of boot memory for
@@ -561,13 +561,10 @@ void __init setup_arch (char **cmdline_p)
 
        setup_bootmem();
 
-       board_setup_fbmem(fbmem_start, fbmem_size);
-
 #ifdef CONFIG_VT
        conswitchp = &dummy_con;
 #endif
 
        paging_init();
-
        resource_init();
 }
index bca2ee1..1ff1a21 100644 (file)
@@ -126,10 +126,10 @@ struct tagtable {
 
 extern struct tag *bootloader_tags;
 
+extern resource_size_t fbmem_start;
+extern resource_size_t fbmem_size;
 
 void setup_processor(void);
-extern void board_setup_fbmem(unsigned long fbmem_start,
-                             unsigned long fbmem_size);
 
 #endif /* !__ASSEMBLY__ */