blob: a57a4295ce2308fc6c3a42fd4eb261f1f9e7161f [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
Tony Lindgren1dbae812005-11-10 14:26:51 +000014#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17
Tony Lindgren120db2c2006-04-02 17:46:27 +010018#include <asm/tlb.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000019#include <asm/io.h>
Tony Lindgren120db2c2006-04-02 17:46:27 +010020
21#include <asm/mach/map.h>
22
Tony Lindgren1dbae812005-11-10 14:26:51 +000023#include <asm/arch/mux.h>
Tony Lindgren120db2c2006-04-02 17:46:27 +010024#include <asm/arch/omapfb.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000025
26extern void omap_sram_init(void);
27extern int omap2_clk_init(void);
28extern void omap2_check_revision(void);
Juha Yrjola33c99072006-12-06 17:13:46 -080029extern void omap2_init_memory(void);
Juha Yrjola4bbbc1a2006-06-26 16:16:16 -070030extern void gpmc_init(void);
Imre Deakb7cc6d42007-03-06 03:16:36 -080031extern void omapfb_reserve_sdram(void);
Tony Lindgren1dbae812005-11-10 14:26:51 +000032
33/*
34 * The machine specific code may provide the extra mapping besides the
35 * default mapping provided here.
36 */
37static struct map_desc omap2_io_desc[] __initdata = {
38 {
39 .virtual = L3_24XX_VIRT,
40 .pfn = __phys_to_pfn(L3_24XX_PHYS),
41 .length = L3_24XX_SIZE,
42 .type = MT_DEVICE
43 },
44 {
Tony Lindgrenc40fae92006-12-07 13:58:10 -080045 .virtual = DSP_MEM_24XX_VIRT,
46 .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
47 .length = DSP_MEM_24XX_SIZE,
48 .type = MT_DEVICE
49 },
50 {
51 .virtual = DSP_IPI_24XX_VIRT,
52 .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS),
53 .length = DSP_IPI_24XX_SIZE,
54 .type = MT_DEVICE
55 },
56 {
57 .virtual = DSP_MMU_24XX_VIRT,
58 .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
59 .length = DSP_MMU_24XX_SIZE,
Tony Lindgren1dbae812005-11-10 14:26:51 +000060 .type = MT_DEVICE
61 }
62};
63
Tony Lindgren120db2c2006-04-02 17:46:27 +010064void __init omap2_map_common_io(void)
Tony Lindgren1dbae812005-11-10 14:26:51 +000065{
66 iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc));
Tony Lindgren120db2c2006-04-02 17:46:27 +010067
68 /* Normally devicemaps_init() would flush caches and tlb after
69 * mdesc->map_io(), but we must also do it here because of the CPU
70 * revision check below.
71 */
72 local_flush_tlb_all();
73 flush_cache_all();
74
Tony Lindgren1dbae812005-11-10 14:26:51 +000075 omap2_check_revision();
76 omap_sram_init();
Imre Deakb7cc6d42007-03-06 03:16:36 -080077 omapfb_reserve_sdram();
Tony Lindgren120db2c2006-04-02 17:46:27 +010078}
79
80void __init omap2_init_common_hw(void)
81{
Tony Lindgren1dbae812005-11-10 14:26:51 +000082 omap2_mux_init();
83 omap2_clk_init();
Juha Yrjola33c99072006-12-06 17:13:46 -080084 omap2_init_memory();
Juha Yrjola4bbbc1a2006-06-26 16:16:16 -070085 gpmc_init();
Tony Lindgren1dbae812005-11-10 14:26:51 +000086}