blob: d0e66424a59720886d81908643ba1431afdd609e [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 King59244862006-06-22 15:05:36 +01009
Russell Kinge6b1b382006-06-24 10:46:23 +010010#include <asm/cacheflush.h>
Russell King59244862006-06-22 15:05:36 +010011#include <asm/io.h>
12#include <asm/page.h>
13
Russell Kingd111e8f2006-09-27 15:27:33 +010014#include "mm.h"
15
16extern void _stext, __data_start, _end;
17
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
28 reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start);
29#else
30 reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
31#endif
32
33 /*
34 * Register the exception vector page.
35 * some architectures which the DRAM is the exception vector to trap,
36 * alloc_page breaks with error, although it is not NULL, but "0."
37 */
38 reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE);
39}
40
41/*
42 * paging_init() sets up the page tables, initialises the zone memory
43 * maps, and sets up the zero page, bad page and bad page tables.
44 */
45void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
46{
47 bootmem_init(mi);
48}
49
Russell King80878d62006-09-27 15:43:47 +010050/*
51 * We don't need to do anything here for nommu machines.
52 */
53void setup_mm_for_reboot(char mode)
54{
55}
56
Russell Kinge6b1b382006-06-24 10:46:23 +010057void flush_dcache_page(struct page *page)
58{
59 __cpuc_flush_dcache_page(page_address(page));
60}
Hyok S. Choi3e361222006-06-27 20:55:43 +010061EXPORT_SYMBOL(flush_dcache_page);
Russell Kinge6b1b382006-06-24 10:46:23 +010062
Russell King59244862006-06-22 15:05:36 +010063void __iomem *__ioremap_pfn(unsigned long pfn, unsigned long offset,
64 size_t size, unsigned long flags)
65{
66 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
67 return NULL;
68 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
69}
70EXPORT_SYMBOL(__ioremap_pfn);
71
72void __iomem *__ioremap(unsigned long phys_addr, size_t size,
73 unsigned long flags)
74{
75 return (void __iomem *)phys_addr;
76}
77EXPORT_SYMBOL(__ioremap);
78
79void __iounmap(void __iomem *addr)
80{
81}
82EXPORT_SYMBOL(__iounmap);