Commit | Line | Data |
---|---|---|
5924486d RK |
1 | /* |
2 | * linux/arch/arm/mm/nommu.c | |
3 | * | |
4 | * ARM uCLinux supporting functions. | |
5 | */ | |
6 | #include <linux/module.h> | |
e6b1b38c RK |
7 | #include <linux/mm.h> |
8 | #include <linux/pagemap.h> | |
3ff1559e | 9 | #include <linux/bootmem.h> |
fced80c7 | 10 | #include <linux/io.h> |
5924486d | 11 | |
e6b1b38c | 12 | #include <asm/cacheflush.h> |
37efe642 | 13 | #include <asm/sections.h> |
5924486d | 14 | #include <asm/page.h> |
b32f3afe | 15 | #include <asm/setup.h> |
3ff1559e | 16 | #include <asm/mach/arch.h> |
5924486d | 17 | |
d111e8f9 RK |
18 | #include "mm.h" |
19 | ||
d111e8f9 RK |
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 | |
37efe642 | 30 | reserve_bootmem_node(pgdat, __pa(_data), _end - _data, |
72a7fe39 | 31 | BOOTMEM_DEFAULT); |
d111e8f9 | 32 | #else |
37efe642 | 33 | reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext, |
72a7fe39 | 34 | BOOTMEM_DEFAULT); |
d111e8f9 RK |
35 | #endif |
36 | ||
37 | /* | |
38 | * Register the exception vector page. | |
39 | * some architectures which the DRAM is the exception vector to trap, | |
40 | * alloc_page breaks with error, although it is not NULL, but "0." | |
41 | */ | |
72a7fe39 BW |
42 | reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE, |
43 | BOOTMEM_DEFAULT); | |
d111e8f9 RK |
44 | } |
45 | ||
46 | /* | |
47 | * paging_init() sets up the page tables, initialises the zone memory | |
48 | * maps, and sets up the zero page, bad page and bad page tables. | |
49 | */ | |
4b5f32ce | 50 | void __init paging_init(struct machine_desc *mdesc) |
d111e8f9 | 51 | { |
4b5f32ce | 52 | bootmem_init(); |
d111e8f9 RK |
53 | } |
54 | ||
80878d6c RK |
55 | /* |
56 | * We don't need to do anything here for nommu machines. | |
57 | */ | |
58 | void setup_mm_for_reboot(char mode) | |
59 | { | |
60 | } | |
61 | ||
e6b1b38c RK |
62 | void flush_dcache_page(struct page *page) |
63 | { | |
2c9b9c84 | 64 | __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE); |
e6b1b38c | 65 | } |
3e361225 | 66 | EXPORT_SYMBOL(flush_dcache_page); |
e6b1b38c | 67 | |
3603ab2b RK |
68 | void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset, |
69 | size_t size, unsigned int mtype) | |
5924486d RK |
70 | { |
71 | if (pfn >= (0x100000000ULL >> PAGE_SHIFT)) | |
72 | return NULL; | |
73 | return (void __iomem *) (offset + (pfn << PAGE_SHIFT)); | |
74 | } | |
3603ab2b | 75 | EXPORT_SYMBOL(__arm_ioremap_pfn); |
5924486d | 76 | |
3603ab2b RK |
77 | void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size, |
78 | unsigned int mtype) | |
5924486d RK |
79 | { |
80 | return (void __iomem *)phys_addr; | |
81 | } | |
3603ab2b | 82 | EXPORT_SYMBOL(__arm_ioremap); |
5924486d | 83 | |
3ff1559e | 84 | void __iounmap(volatile void __iomem *addr) |
5924486d RK |
85 | { |
86 | } | |
87 | EXPORT_SYMBOL(__iounmap); |