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