blob: 68456b79a0a872787b7ef7068747bf52e08dc762 [file] [log] [blame]
Tony Lindgren1dbae812005-11-10 14:26:51 +00001/*
2 * linux/arch/arm/mach-omap2/io.c
3 *
4 * OMAP2 I/O mapping code
5 *
6 * Copyright (C) 2005 Nokia Corporation
7 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/config.h>
15#include <linux/module.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18
Tony Lindgren120db2c2006-04-02 17:46:27 +010019#include <asm/tlb.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000020#include <asm/io.h>
Tony Lindgren120db2c2006-04-02 17:46:27 +010021
22#include <asm/mach/map.h>
23
Tony Lindgren1dbae812005-11-10 14:26:51 +000024#include <asm/arch/mux.h>
Tony Lindgren120db2c2006-04-02 17:46:27 +010025#include <asm/arch/omapfb.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000026
27extern void omap_sram_init(void);
28extern int omap2_clk_init(void);
29extern void omap2_check_revision(void);
Juha Yrjola4bbbc1a2006-06-26 16:16:16 -070030extern void gpmc_init(void);
Tony Lindgren1dbae812005-11-10 14:26:51 +000031
32/*
33 * The machine specific code may provide the extra mapping besides the
34 * default mapping provided here.
35 */
36static struct map_desc omap2_io_desc[] __initdata = {
37 {
38 .virtual = L3_24XX_VIRT,
39 .pfn = __phys_to_pfn(L3_24XX_PHYS),
40 .length = L3_24XX_SIZE,
41 .type = MT_DEVICE
42 },
43 {
44 .virtual = L4_24XX_VIRT,
45 .pfn = __phys_to_pfn(L4_24XX_PHYS),
46 .length = L4_24XX_SIZE,
47 .type = MT_DEVICE
48 }
49};
50
Tony Lindgren120db2c2006-04-02 17:46:27 +010051void __init omap2_map_common_io(void)
Tony Lindgren1dbae812005-11-10 14:26:51 +000052{
53 iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc));
Tony Lindgren120db2c2006-04-02 17:46:27 +010054
55 /* Normally devicemaps_init() would flush caches and tlb after
56 * mdesc->map_io(), but we must also do it here because of the CPU
57 * revision check below.
58 */
59 local_flush_tlb_all();
60 flush_cache_all();
61
Tony Lindgren1dbae812005-11-10 14:26:51 +000062 omap2_check_revision();
63 omap_sram_init();
Tony Lindgren120db2c2006-04-02 17:46:27 +010064 omapfb_reserve_mem();
65}
66
67void __init omap2_init_common_hw(void)
68{
Tony Lindgren1dbae812005-11-10 14:26:51 +000069 omap2_mux_init();
70 omap2_clk_init();
Juha Yrjola4bbbc1a2006-06-26 16:16:16 -070071 gpmc_init();
Tony Lindgren1dbae812005-11-10 14:26:51 +000072}