mm.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (C) 1999,2000 Arm Limited
  3. * Copyright (C) 2000 Deep Blue Solutions Ltd
  4. * Copyright (C) 2002 Shane Nay (shane@minirl.com)
  5. * Copyright 2004-2005 Freescale Semiconductor, Inc. All Rights Reserved.
  6. * - add MXC specific definitions
  7. * Copyright 2006 Motorola, Inc.
  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 as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. *
  23. */
  24. #include <linux/mm.h>
  25. #include <linux/init.h>
  26. #include <mach/hardware.h>
  27. #include <mach/common.h>
  28. #include <asm/pgtable.h>
  29. #include <asm/mach/map.h>
  30. /*
  31. * This structure defines the MXC memory map.
  32. */
  33. static struct map_desc mxc_io_desc[] __initdata = {
  34. {
  35. .virtual = MXC91231_L2CC_BASE_ADDR_VIRT,
  36. .pfn = __phys_to_pfn(MXC91231_L2CC_BASE_ADDR),
  37. .length = MXC91231_L2CC_SIZE,
  38. .type = MT_DEVICE,
  39. }, {
  40. .virtual = MXC91231_X_MEMC_BASE_ADDR_VIRT,
  41. .pfn = __phys_to_pfn(MXC91231_X_MEMC_BASE_ADDR),
  42. .length = MXC91231_X_MEMC_SIZE,
  43. .type = MT_DEVICE,
  44. }, {
  45. .virtual = MXC91231_ROMP_BASE_ADDR_VIRT,
  46. .pfn = __phys_to_pfn(MXC91231_ROMP_BASE_ADDR),
  47. .length = MXC91231_ROMP_SIZE,
  48. .type = MT_DEVICE,
  49. }, {
  50. .virtual = MXC91231_AVIC_BASE_ADDR_VIRT,
  51. .pfn = __phys_to_pfn(MXC91231_AVIC_BASE_ADDR),
  52. .length = MXC91231_AVIC_SIZE,
  53. .type = MT_DEVICE,
  54. }, {
  55. .virtual = MXC91231_AIPS1_BASE_ADDR_VIRT,
  56. .pfn = __phys_to_pfn(MXC91231_AIPS1_BASE_ADDR),
  57. .length = MXC91231_AIPS1_SIZE,
  58. .type = MT_DEVICE,
  59. }, {
  60. .virtual = MXC91231_SPBA0_BASE_ADDR_VIRT,
  61. .pfn = __phys_to_pfn(MXC91231_SPBA0_BASE_ADDR),
  62. .length = MXC91231_SPBA0_SIZE,
  63. .type = MT_DEVICE,
  64. }, {
  65. .virtual = MXC91231_SPBA1_BASE_ADDR_VIRT,
  66. .pfn = __phys_to_pfn(MXC91231_SPBA1_BASE_ADDR),
  67. .length = MXC91231_SPBA1_SIZE,
  68. .type = MT_DEVICE,
  69. }, {
  70. .virtual = MXC91231_AIPS2_BASE_ADDR_VIRT,
  71. .pfn = __phys_to_pfn(MXC91231_AIPS2_BASE_ADDR),
  72. .length = MXC91231_AIPS2_SIZE,
  73. .type = MT_DEVICE,
  74. },
  75. };
  76. /*
  77. * This function initializes the memory map. It is called during the
  78. * system startup to create static physical to virtual memory map for
  79. * the IO modules.
  80. */
  81. void __init mxc91231_map_io(void)
  82. {
  83. mxc_set_cpu_type(MXC_CPU_MXC91231);
  84. iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
  85. }
  86. void __init mxc91231_init_irq(void)
  87. {
  88. mxc_init_irq(MXC91231_IO_ADDRESS(MXC91231_AVIC_BASE_ADDR));
  89. }