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 |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame^] | 7 | * Copyright (C) 2007 Texas Instruments |
| 8 | * |
| 9 | * Author: |
| 10 | * Juha Yrjola <juha.yrjola@nokia.com> |
| 11 | * Syed Khasim <x0khasim@ti.com> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 12 | * |
| 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License version 2 as |
| 15 | * published by the Free Software Foundation. |
| 16 | */ |
| 17 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 18 | #include <linux/module.h> |
| 19 | #include <linux/kernel.h> |
| 20 | #include <linux/init.h> |
| 21 | |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 22 | #include <asm/tlb.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 23 | #include <asm/io.h> |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 24 | |
| 25 | #include <asm/mach/map.h> |
| 26 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 27 | #include <mach/mux.h> |
| 28 | #include <mach/omapfb.h> |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame^] | 29 | #include <mach/sram.h> |
| 30 | |
| 31 | #include "memory.h" |
| 32 | |
| 33 | #include "clock.h" |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 34 | |
Paul Walmsley | 9717100 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 35 | #include <mach/powerdomain.h> |
| 36 | |
| 37 | #include "powerdomains.h" |
| 38 | |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 39 | #include <mach/clockdomain.h> |
| 40 | #include "clockdomains.h" |
| 41 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 42 | /* |
| 43 | * The machine specific code may provide the extra mapping besides the |
| 44 | * default mapping provided here. |
| 45 | */ |
| 46 | static struct map_desc omap2_io_desc[] __initdata = { |
| 47 | { |
| 48 | .virtual = L3_24XX_VIRT, |
| 49 | .pfn = __phys_to_pfn(L3_24XX_PHYS), |
| 50 | .length = L3_24XX_SIZE, |
| 51 | .type = MT_DEVICE |
| 52 | }, |
Kyungmin Park | 09f21ed | 2008-02-20 15:30:06 -0800 | [diff] [blame] | 53 | { |
| 54 | .virtual = L4_24XX_VIRT, |
| 55 | .pfn = __phys_to_pfn(L4_24XX_PHYS), |
| 56 | .length = L4_24XX_SIZE, |
| 57 | .type = MT_DEVICE |
| 58 | }, |
Syed Mohammed Khasim | 72d0f1c | 2006-12-06 17:14:05 -0800 | [diff] [blame] | 59 | #ifdef CONFIG_ARCH_OMAP2430 |
| 60 | { |
| 61 | .virtual = L4_WK_243X_VIRT, |
| 62 | .pfn = __phys_to_pfn(L4_WK_243X_PHYS), |
| 63 | .length = L4_WK_243X_SIZE, |
| 64 | .type = MT_DEVICE |
| 65 | }, |
| 66 | { |
| 67 | .virtual = OMAP243X_GPMC_VIRT, |
| 68 | .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS), |
| 69 | .length = OMAP243X_GPMC_SIZE, |
| 70 | .type = MT_DEVICE |
| 71 | }, |
| 72 | #endif |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 73 | { |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 74 | .virtual = DSP_MEM_24XX_VIRT, |
| 75 | .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), |
| 76 | .length = DSP_MEM_24XX_SIZE, |
| 77 | .type = MT_DEVICE |
| 78 | }, |
| 79 | { |
| 80 | .virtual = DSP_IPI_24XX_VIRT, |
| 81 | .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), |
| 82 | .length = DSP_IPI_24XX_SIZE, |
| 83 | .type = MT_DEVICE |
| 84 | }, |
| 85 | { |
| 86 | .virtual = DSP_MMU_24XX_VIRT, |
| 87 | .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), |
| 88 | .length = DSP_MMU_24XX_SIZE, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 89 | .type = MT_DEVICE |
| 90 | } |
| 91 | }; |
| 92 | |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 93 | void __init omap2_map_common_io(void) |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 94 | { |
| 95 | iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc)); |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 96 | |
| 97 | /* Normally devicemaps_init() would flush caches and tlb after |
| 98 | * mdesc->map_io(), but we must also do it here because of the CPU |
| 99 | * revision check below. |
| 100 | */ |
| 101 | local_flush_tlb_all(); |
| 102 | flush_cache_all(); |
| 103 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 104 | omap2_check_revision(); |
| 105 | omap_sram_init(); |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 106 | omapfb_reserve_sdram(); |
Tony Lindgren | 120db2c | 2006-04-02 17:46:27 +0100 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | void __init omap2_init_common_hw(void) |
| 110 | { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 111 | omap2_mux_init(); |
Paul Walmsley | 9717100 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 112 | pwrdm_init(powerdomains_omap); |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 113 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 114 | omap2_clk_init(); |
Syed Mohammed Khasim | 72d0f1c | 2006-12-06 17:14:05 -0800 | [diff] [blame] | 115 | /* |
| 116 | * Need to Fix this for 2430 |
| 117 | */ |
| 118 | #ifndef CONFIG_ARCH_OMAP2430 |
Juha Yrjola | 33c9907 | 2006-12-06 17:13:46 -0800 | [diff] [blame] | 119 | omap2_init_memory(); |
Syed Mohammed Khasim | 72d0f1c | 2006-12-06 17:14:05 -0800 | [diff] [blame] | 120 | #endif |
Juha Yrjola | 4bbbc1a | 2006-06-26 16:16:16 -0700 | [diff] [blame] | 121 | gpmc_init(); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 122 | } |