io.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * linux/arch/arm/mach-omap2/io.c
  3. *
  4. * OMAP2 I/O mapping code
  5. *
  6. * Copyright (C) 2005 Nokia Corporation
  7. * Copyright (C) 2007 Texas Instruments
  8. *
  9. * Author:
  10. * Juha Yrjola <juha.yrjola@nokia.com>
  11. * Syed Khasim <x0khasim@ti.com>
  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. #include <linux/module.h>
  18. #include <linux/kernel.h>
  19. #include <linux/init.h>
  20. #include <asm/tlb.h>
  21. #include <asm/io.h>
  22. #include <asm/mach/map.h>
  23. #include <mach/mux.h>
  24. #include <mach/omapfb.h>
  25. #include <mach/sram.h>
  26. #include "memory.h"
  27. #include "clock.h"
  28. #include <mach/powerdomain.h>
  29. #include "powerdomains.h"
  30. #include <mach/clockdomain.h>
  31. #include "clockdomains.h"
  32. /*
  33. * The machine specific code may provide the extra mapping besides the
  34. * default mapping provided here.
  35. */
  36. static struct map_desc omap2_io_desc[] __initdata = {
  37. {
  38. .virtual = L3_24XX_VIRT,
  39. .pfn = __phys_to_pfn(L3_24XX_PHYS),
  40. .length = L3_24XX_SIZE,
  41. .type = MT_DEVICE
  42. },
  43. {
  44. .virtual = L4_24XX_VIRT,
  45. .pfn = __phys_to_pfn(L4_24XX_PHYS),
  46. .length = L4_24XX_SIZE,
  47. .type = MT_DEVICE
  48. },
  49. #ifdef CONFIG_ARCH_OMAP2430
  50. {
  51. .virtual = L4_WK_243X_VIRT,
  52. .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
  53. .length = L4_WK_243X_SIZE,
  54. .type = MT_DEVICE
  55. },
  56. {
  57. .virtual = OMAP243X_GPMC_VIRT,
  58. .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
  59. .length = OMAP243X_GPMC_SIZE,
  60. .type = MT_DEVICE
  61. },
  62. #endif
  63. {
  64. .virtual = DSP_MEM_24XX_VIRT,
  65. .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
  66. .length = DSP_MEM_24XX_SIZE,
  67. .type = MT_DEVICE
  68. },
  69. {
  70. .virtual = DSP_IPI_24XX_VIRT,
  71. .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS),
  72. .length = DSP_IPI_24XX_SIZE,
  73. .type = MT_DEVICE
  74. },
  75. {
  76. .virtual = DSP_MMU_24XX_VIRT,
  77. .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
  78. .length = DSP_MMU_24XX_SIZE,
  79. .type = MT_DEVICE
  80. }
  81. };
  82. void __init omap2_map_common_io(void)
  83. {
  84. iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc));
  85. /* Normally devicemaps_init() would flush caches and tlb after
  86. * mdesc->map_io(), but we must also do it here because of the CPU
  87. * revision check below.
  88. */
  89. local_flush_tlb_all();
  90. flush_cache_all();
  91. omap2_check_revision();
  92. omap_sram_init();
  93. omapfb_reserve_sdram();
  94. }
  95. void __init omap2_init_common_hw(void)
  96. {
  97. omap2_mux_init();
  98. pwrdm_init(powerdomains_omap);
  99. clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
  100. omap2_clk_init();
  101. /*
  102. * Need to Fix this for 2430
  103. */
  104. #ifndef CONFIG_ARCH_OMAP2430
  105. omap2_init_memory();
  106. #endif
  107. gpmc_init();
  108. }