mm.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Static mappings for Gemini
  3. *
  4. * Copyright (C) 2001-2006 Storlink, Corp.
  5. * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. */
  12. #include <linux/mm.h>
  13. #include <linux/init.h>
  14. #include <asm/mach/map.h>
  15. #include <mach/hardware.h>
  16. /* Page table mapping for I/O region */
  17. static struct map_desc gemini_io_desc[] __initdata = {
  18. {
  19. .virtual = (unsigned long)IO_ADDRESS(GEMINI_GLOBAL_BASE),
  20. .pfn =__phys_to_pfn(GEMINI_GLOBAL_BASE),
  21. .length = SZ_512K,
  22. .type = MT_DEVICE,
  23. }, {
  24. .virtual = (unsigned long)IO_ADDRESS(GEMINI_UART_BASE),
  25. .pfn = __phys_to_pfn(GEMINI_UART_BASE),
  26. .length = SZ_512K,
  27. .type = MT_DEVICE,
  28. }, {
  29. .virtual = (unsigned long)IO_ADDRESS(GEMINI_TIMER_BASE),
  30. .pfn = __phys_to_pfn(GEMINI_TIMER_BASE),
  31. .length = SZ_512K,
  32. .type = MT_DEVICE,
  33. }, {
  34. .virtual = (unsigned long)IO_ADDRESS(GEMINI_INTERRUPT_BASE),
  35. .pfn = __phys_to_pfn(GEMINI_INTERRUPT_BASE),
  36. .length = SZ_512K,
  37. .type = MT_DEVICE,
  38. }, {
  39. .virtual = (unsigned long)IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
  40. .pfn = __phys_to_pfn(GEMINI_POWER_CTRL_BASE),
  41. .length = SZ_512K,
  42. .type = MT_DEVICE,
  43. }, {
  44. .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(0)),
  45. .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(0)),
  46. .length = SZ_512K,
  47. .type = MT_DEVICE,
  48. }, {
  49. .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(1)),
  50. .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(1)),
  51. .length = SZ_512K,
  52. .type = MT_DEVICE,
  53. }, {
  54. .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(2)),
  55. .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(2)),
  56. .length = SZ_512K,
  57. .type = MT_DEVICE,
  58. }, {
  59. .virtual = (unsigned long)IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
  60. .pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
  61. .length = SZ_512K,
  62. .type = MT_DEVICE,
  63. }, {
  64. .virtual = (unsigned long)IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
  65. .pfn = __phys_to_pfn(GEMINI_DRAM_CTRL_BASE),
  66. .length = SZ_512K,
  67. .type = MT_DEVICE,
  68. }, {
  69. .virtual = (unsigned long)IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
  70. .pfn = __phys_to_pfn(GEMINI_GENERAL_DMA_BASE),
  71. .length = SZ_512K,
  72. .type = MT_DEVICE,
  73. },
  74. };
  75. void __init gemini_map_io(void)
  76. {
  77. iotable_init(gemini_io_desc, ARRAY_SIZE(gemini_io_desc));
  78. }