]> bbs.cooldavid.org Git - net-next-2.6.git/blame - arch/arm/mm/nommu.c
[ARM] rationalize memory configuration code some more
[net-next-2.6.git] / arch / arm / mm / nommu.c
CommitLineData
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>
5924486d 13#include <asm/page.h>
3ff1559e 14#include <asm/mach/arch.h>
5924486d 15
d111e8f9
RK
16#include "mm.h"
17
d111e8f9
RK
18/*
19 * Reserve the various regions of node 0
20 */
21void __init reserve_node_zero(pg_data_t *pgdat)
22{
23 /*
24 * Register the kernel text and data with bootmem.
25 * Note that this can only be in node 0.
26 */
27#ifdef CONFIG_XIP_KERNEL
72a7fe39
BW
28 reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start,
29 BOOTMEM_DEFAULT);
d111e8f9 30#else
72a7fe39
BW
31 reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext,
32 BOOTMEM_DEFAULT);
d111e8f9
RK
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 */
72a7fe39
BW
40 reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE,
41 BOOTMEM_DEFAULT);
d111e8f9
RK
42}
43
44/*
45 * paging_init() sets up the page tables, initialises the zone memory
46 * maps, and sets up the zero page, bad page and bad page tables.
47 */
4b5f32ce 48void __init paging_init(struct machine_desc *mdesc)
d111e8f9 49{
4b5f32ce 50 bootmem_init();
d111e8f9
RK
51}
52
80878d6c
RK
53/*
54 * We don't need to do anything here for nommu machines.
55 */
56void setup_mm_for_reboot(char mode)
57{
58}
59
e6b1b38c
RK
60void flush_dcache_page(struct page *page)
61{
62 __cpuc_flush_dcache_page(page_address(page));
63}
3e361225 64EXPORT_SYMBOL(flush_dcache_page);
e6b1b38c 65
3603ab2b
RK
66void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
67 size_t size, unsigned int mtype)
5924486d
RK
68{
69 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
70 return NULL;
71 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
72}
3603ab2b 73EXPORT_SYMBOL(__arm_ioremap_pfn);
5924486d 74
3603ab2b
RK
75void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
76 unsigned int mtype)
5924486d
RK
77{
78 return (void __iomem *)phys_addr;
79}
3603ab2b 80EXPORT_SYMBOL(__arm_ioremap);
5924486d 81
3ff1559e 82void __iounmap(volatile void __iomem *addr)
5924486d
RK
83{
84}
85EXPORT_SYMBOL(__iounmap);