nommu.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * linux/arch/arm/mm/nommu.c
  3. *
  4. * ARM uCLinux supporting functions.
  5. */
  6. #include <linux/module.h>
  7. #include <linux/mm.h>
  8. #include <linux/pagemap.h>
  9. #include <linux/bootmem.h>
  10. #include <asm/cacheflush.h>
  11. #include <asm/io.h>
  12. #include <asm/page.h>
  13. #include <asm/mach/arch.h>
  14. #include "mm.h"
  15. extern void _stext, __data_start, _end;
  16. /*
  17. * Reserve the various regions of node 0
  18. */
  19. void __init reserve_node_zero(pg_data_t *pgdat)
  20. {
  21. /*
  22. * Register the kernel text and data with bootmem.
  23. * Note that this can only be in node 0.
  24. */
  25. #ifdef CONFIG_XIP_KERNEL
  26. reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start);
  27. #else
  28. reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
  29. #endif
  30. /*
  31. * Register the exception vector page.
  32. * some architectures which the DRAM is the exception vector to trap,
  33. * alloc_page breaks with error, although it is not NULL, but "0."
  34. */
  35. reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE);
  36. }
  37. /*
  38. * paging_init() sets up the page tables, initialises the zone memory
  39. * maps, and sets up the zero page, bad page and bad page tables.
  40. */
  41. void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
  42. {
  43. bootmem_init(mi);
  44. }
  45. /*
  46. * We don't need to do anything here for nommu machines.
  47. */
  48. void setup_mm_for_reboot(char mode)
  49. {
  50. }
  51. void flush_dcache_page(struct page *page)
  52. {
  53. __cpuc_flush_dcache_page(page_address(page));
  54. }
  55. EXPORT_SYMBOL(flush_dcache_page);
  56. void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
  57. size_t size, unsigned int mtype)
  58. {
  59. if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
  60. return NULL;
  61. return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
  62. }
  63. EXPORT_SYMBOL(__arm_ioremap_pfn);
  64. void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
  65. unsigned int mtype)
  66. {
  67. return (void __iomem *)phys_addr;
  68. }
  69. EXPORT_SYMBOL(__arm_ioremap);
  70. void __iounmap(volatile void __iomem *addr)
  71. {
  72. }
  73. EXPORT_SYMBOL(__iounmap);