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