lluart.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2011 Freescale Semiconductor, Inc.
  3. * Copyright 2011 Linaro Ltd.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/init.h>
  13. #include <asm/page.h>
  14. #include <asm/sizes.h>
  15. #include <asm/mach/map.h>
  16. #include "hardware.h"
  17. #define IMX6Q_UART1_BASE_ADDR 0x02020000
  18. #define IMX6Q_UART2_BASE_ADDR 0x021e8000
  19. #define IMX6Q_UART3_BASE_ADDR 0x021ec000
  20. #define IMX6Q_UART4_BASE_ADDR 0x021f0000
  21. #define IMX6Q_UART5_BASE_ADDR 0x021f4000
  22. /*
  23. * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
  24. * of IMX6Q_UART##n##_BASE_ADDR.
  25. */
  26. #define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
  27. #define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
  28. #define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
  29. static struct map_desc imx_lluart_desc = {
  30. #ifdef CONFIG_DEBUG_IMX6Q_UART
  31. .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE),
  32. .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE),
  33. .length = 0x4000,
  34. .type = MT_DEVICE,
  35. #endif
  36. };
  37. void __init imx_lluart_map_io(void)
  38. {
  39. if (imx_lluart_desc.virtual)
  40. iotable_init(&imx_lluart_desc, 1);
  41. }