io.c 1.9 KB

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