mm.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * The code contained herein is licensed under the GNU General Public
  5. * License. You may obtain a copy of the GNU General Public License
  6. * Version 2 or later at the following locations:
  7. *
  8. * http://www.opensource.org/licenses/gpl-license.html
  9. * http://www.gnu.org/copyleft/gpl.html
  10. *
  11. * Create static mapping between physical to virtual memory.
  12. */
  13. #include <linux/mm.h>
  14. #include <linux/init.h>
  15. #include <linux/pinctrl/machine.h>
  16. #include <asm/mach/map.h>
  17. #include <mach/mx23.h>
  18. #include <mach/mx28.h>
  19. #include <mach/common.h>
  20. #include <mach/iomux.h>
  21. /*
  22. * Define the MX23 memory map.
  23. */
  24. static struct map_desc mx23_io_desc[] __initdata = {
  25. mxs_map_entry(MX23, OCRAM, MT_DEVICE),
  26. mxs_map_entry(MX23, IO, MT_DEVICE),
  27. };
  28. /*
  29. * Define the MX28 memory map.
  30. */
  31. static struct map_desc mx28_io_desc[] __initdata = {
  32. mxs_map_entry(MX28, OCRAM, MT_DEVICE),
  33. mxs_map_entry(MX28, IO, MT_DEVICE),
  34. };
  35. /*
  36. * This function initializes the memory map. It is called during the
  37. * system startup to create static physical to virtual memory mappings
  38. * for the IO modules.
  39. */
  40. void __init mx23_map_io(void)
  41. {
  42. iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc));
  43. }
  44. void __init mx23_init_irq(void)
  45. {
  46. icoll_init_irq();
  47. }
  48. void __init mx28_map_io(void)
  49. {
  50. iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc));
  51. }
  52. void __init mx28_init_irq(void)
  53. {
  54. icoll_init_irq();
  55. }
  56. void __init mx23_soc_init(void)
  57. {
  58. pinctrl_provide_dummies();
  59. mxs_add_dma("imx23-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
  60. mxs_add_dma("imx23-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
  61. mxs_add_gpio("imx23-gpio", 0, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO0);
  62. mxs_add_gpio("imx23-gpio", 1, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO1);
  63. mxs_add_gpio("imx23-gpio", 2, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO2);
  64. }
  65. void __init mx28_soc_init(void)
  66. {
  67. pinctrl_provide_dummies();
  68. mxs_add_dma("imx28-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
  69. mxs_add_dma("imx28-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
  70. mxs_add_gpio("imx28-gpio", 0, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO0);
  71. mxs_add_gpio("imx28-gpio", 1, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO1);
  72. mxs_add_gpio("imx28-gpio", 2, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO2);
  73. mxs_add_gpio("imx28-gpio", 3, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO3);
  74. mxs_add_gpio("imx28-gpio", 4, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO4);
  75. }