io.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. * Updated map desc to add 2430 support : <x0khasim@ti.com>
  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. #include <linux/module.h>
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/io.h>
  18. #include <asm/tlb.h>
  19. #include <asm/mach/map.h>
  20. #include <mach/mux.h>
  21. #include <mach/omapfb.h>
  22. extern void omap_sram_init(void);
  23. extern int omap2_clk_init(void);
  24. extern void omap2_check_revision(void);
  25. extern void omap2_init_memory(void);
  26. extern void gpmc_init(void);
  27. extern void omapfb_reserve_sdram(void);
  28. /*
  29. * The machine specific code may provide the extra mapping besides the
  30. * default mapping provided here.
  31. */
  32. static struct map_desc omap2_io_desc[] __initdata = {
  33. {
  34. .virtual = L3_24XX_VIRT,
  35. .pfn = __phys_to_pfn(L3_24XX_PHYS),
  36. .length = L3_24XX_SIZE,
  37. .type = MT_DEVICE
  38. },
  39. {
  40. .virtual = L4_24XX_VIRT,
  41. .pfn = __phys_to_pfn(L4_24XX_PHYS),
  42. .length = L4_24XX_SIZE,
  43. .type = MT_DEVICE
  44. },
  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
  59. {
  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,
  75. .type = MT_DEVICE
  76. }
  77. };
  78. void __init omap2_map_common_io(void)
  79. {
  80. iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc));
  81. /* Normally devicemaps_init() would flush caches and tlb after
  82. * mdesc->map_io(), but we must also do it here because of the CPU
  83. * revision check below.
  84. */
  85. local_flush_tlb_all();
  86. flush_cache_all();
  87. omap2_check_revision();
  88. omap_sram_init();
  89. omapfb_reserve_sdram();
  90. }
  91. void __init omap2_init_common_hw(void)
  92. {
  93. omap2_mux_init();
  94. omap2_clk_init();
  95. /*
  96. * Need to Fix this for 2430
  97. */
  98. #ifndef CONFIG_ARCH_OMAP2430
  99. omap2_init_memory();
  100. #endif
  101. gpmc_init();
  102. }