nommu.c 1.9 KB

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