setup.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * ATSTK1000 board-specific setup code.
  3. *
  4. * Copyright (C) 2005-2006 Atmel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/bootmem.h>
  11. #include <linux/init.h>
  12. #include <linux/types.h>
  13. #include <linux/linkage.h>
  14. #include <asm/setup.h>
  15. #include <asm/arch/board.h>
  16. /* Initialized by bootloader-specific startup code. */
  17. struct tag *bootloader_tags __initdata;
  18. struct lcdc_platform_data __initdata atstk1000_fb0_data;
  19. void __init board_setup_fbmem(unsigned long fbmem_start,
  20. unsigned long fbmem_size)
  21. {
  22. if (!fbmem_size)
  23. return;
  24. if (!fbmem_start) {
  25. void *fbmem;
  26. fbmem = alloc_bootmem_low_pages(fbmem_size);
  27. fbmem_start = __pa(fbmem);
  28. } else {
  29. pg_data_t *pgdat;
  30. for_each_online_pgdat(pgdat) {
  31. if (fbmem_start >= pgdat->bdata->node_boot_start
  32. && fbmem_start <= pgdat->bdata->node_low_pfn)
  33. reserve_bootmem_node(pgdat, fbmem_start,
  34. fbmem_size);
  35. }
  36. }
  37. printk("%luKiB framebuffer memory at address 0x%08lx\n",
  38. fbmem_size >> 10, fbmem_start);
  39. atstk1000_fb0_data.fbmem_start = fbmem_start;
  40. atstk1000_fb0_data.fbmem_size = fbmem_size;
  41. }