blob: 63c62fdea52115e168751c5efa5eec96c7602341 [file] [log] [blame]
Russell King59244862006-06-22 15:05:36 +01001/*
2 * linux/arch/arm/mm/nommu.c
3 *
4 * ARM uCLinux supporting functions.
5 */
6#include <linux/module.h>
Russell Kinge6b1b382006-06-24 10:46:23 +01007#include <linux/mm.h>
8#include <linux/pagemap.h>
Russell King3ff15592006-11-30 13:53:54 +00009#include <linux/bootmem.h>
Russell King59244862006-06-22 15:05:36 +010010
Russell Kinge6b1b382006-06-24 10:46:23 +010011#include <asm/cacheflush.h>
Russell King59244862006-06-22 15:05:36 +010012#include <asm/io.h>
13#include <asm/page.h>
Russell King3ff15592006-11-30 13:53:54 +000014#include <asm/mach/arch.h>
Russell King59244862006-06-22 15:05:36 +010015
Russell Kingd111e8f2006-09-27 15:27:33 +010016#include "mm.h"
17
18extern void _stext, __data_start, _end;
19
20/*
21 * Reserve the various regions of node 0
22 */
23void __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
Bernhard Walle72a7fe32008-02-07 00:15:17 -080030 reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start,
31 BOOTMEM_DEFAULT);
Russell Kingd111e8f2006-09-27 15:27:33 +010032#else
Bernhard Walle72a7fe32008-02-07 00:15:17 -080033 reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext,
34 BOOTMEM_DEFAULT);
Russell Kingd111e8f2006-09-27 15:27:33 +010035#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 */
Bernhard Walle72a7fe32008-02-07 00:15:17 -080042 reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE,
43 BOOTMEM_DEFAULT);
Russell Kingd111e8f2006-09-27 15:27:33 +010044}
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 */
50void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
51{
52 bootmem_init(mi);
53}
54
Russell King80878d62006-09-27 15:43:47 +010055/*
56 * We don't need to do anything here for nommu machines.
57 */
58void setup_mm_for_reboot(char mode)
59{
60}
61
Russell Kinge6b1b382006-06-24 10:46:23 +010062void flush_dcache_page(struct page *page)
63{
64 __cpuc_flush_dcache_page(page_address(page));
65}
Hyok S. Choi3e361222006-06-27 20:55:43 +010066EXPORT_SYMBOL(flush_dcache_page);
Russell Kinge6b1b382006-06-24 10:46:23 +010067
Russell King3603ab22007-05-05 20:59:27 +010068void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
69 size_t size, unsigned int mtype)
Russell King59244862006-06-22 15:05:36 +010070{
71 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
72 return NULL;
73 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
74}
Russell King3603ab22007-05-05 20:59:27 +010075EXPORT_SYMBOL(__arm_ioremap_pfn);
Russell King59244862006-06-22 15:05:36 +010076
Russell King3603ab22007-05-05 20:59:27 +010077void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
78 unsigned int mtype)
Russell King59244862006-06-22 15:05:36 +010079{
80 return (void __iomem *)phys_addr;
81}
Russell King3603ab22007-05-05 20:59:27 +010082EXPORT_SYMBOL(__arm_ioremap);
Russell King59244862006-06-22 15:05:36 +010083
Russell King3ff15592006-11-30 13:53:54 +000084void __iounmap(volatile void __iomem *addr)
Russell King59244862006-06-22 15:05:36 +010085{
86}
87EXPORT_SYMBOL(__iounmap);