Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 1 | /* |
| 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 Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 14 | #include <linux/module.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/init.h> |
| 17 | |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 18 | #include <asm/tlb.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 19 | #include <asm/io.h> |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 20 | |
| 21 | #include <asm/mach/map.h> |
| 22 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 23 | #include <asm/arch/mux.h> |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 24 | #include <asm/arch/omapfb.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 25 | |
| 26 | extern void omap_sram_init(void); |
| 27 | extern int omap2_clk_init(void); |
| 28 | extern void omap2_check_revision(void); |
Juha Yrjola | 4bbbc1a | 2006-06-26 16:16:16 -0700 | [diff] [blame] | 29 | extern void gpmc_init(void); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 30 | |
| 31 | /* |
| 32 | * The machine specific code may provide the extra mapping besides the |
| 33 | * default mapping provided here. |
| 34 | */ |
| 35 | static struct map_desc omap2_io_desc[] __initdata = { |
| 36 | { |
| 37 | .virtual = L3_24XX_VIRT, |
| 38 | .pfn = __phys_to_pfn(L3_24XX_PHYS), |
| 39 | .length = L3_24XX_SIZE, |
| 40 | .type = MT_DEVICE |
| 41 | }, |
| 42 | { |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 43 | .virtual = DSP_MEM_24XX_VIRT, |
| 44 | .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), |
| 45 | .length = DSP_MEM_24XX_SIZE, |
| 46 | .type = MT_DEVICE |
| 47 | }, |
| 48 | { |
| 49 | .virtual = DSP_IPI_24XX_VIRT, |
| 50 | .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), |
| 51 | .length = DSP_IPI_24XX_SIZE, |
| 52 | .type = MT_DEVICE |
| 53 | }, |
| 54 | { |
| 55 | .virtual = DSP_MMU_24XX_VIRT, |
| 56 | .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), |
| 57 | .length = DSP_MMU_24XX_SIZE, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 58 | .type = MT_DEVICE |
| 59 | } |
| 60 | }; |
| 61 | |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 62 | void __init omap2_map_common_io(void) |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 63 | { |
| 64 | iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc)); |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 65 | |
| 66 | /* Normally devicemaps_init() would flush caches and tlb after |
| 67 | * mdesc->map_io(), but we must also do it here because of the CPU |
| 68 | * revision check below. |
| 69 | */ |
| 70 | local_flush_tlb_all(); |
| 71 | flush_cache_all(); |
| 72 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 73 | omap2_check_revision(); |
| 74 | omap_sram_init(); |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 75 | omapfb_reserve_mem(); |
| 76 | } |
| 77 | |
| 78 | void __init omap2_init_common_hw(void) |
| 79 | { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 80 | omap2_mux_init(); |
| 81 | omap2_clk_init(); |
Juha Yrjola | 4bbbc1a | 2006-06-26 16:16:16 -0700 | [diff] [blame] | 82 | gpmc_init(); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 83 | } |