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