ixp4xx-of.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * IXP4xx Device Tree boot support
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/init.h>
  7. #include <linux/io.h>
  8. #include <asm/mach/arch.h>
  9. #include <asm/mach/map.h>
  10. /*
  11. * These are the only fixed phys to virt mappings we ever need
  12. * we put it right after the UART mapping at 0xffc80000-0xffc81fff
  13. */
  14. #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000
  15. #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000
  16. static struct map_desc ixp4xx_of_io_desc[] __initdata = {
  17. /*
  18. * This is needed for runtime system configuration checks,
  19. * such as reading if hardware so-and-so is present. This
  20. * could eventually be converted into a syscon once all boards
  21. * are converted to device tree.
  22. */
  23. {
  24. .virtual = IXP4XX_EXP_CFG_BASE_VIRT,
  25. .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
  26. .length = SZ_4K,
  27. .type = MT_DEVICE,
  28. },
  29. #ifdef CONFIG_DEBUG_UART_8250
  30. /* This is needed for LL-debug/earlyprintk/debug-macro.S */
  31. {
  32. .virtual = CONFIG_DEBUG_UART_VIRT,
  33. .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
  34. .length = SZ_4K,
  35. .type = MT_DEVICE,
  36. },
  37. #endif
  38. };
  39. static void __init ixp4xx_of_map_io(void)
  40. {
  41. iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc));
  42. }
  43. /*
  44. * We handle 4 different SoC families. These compatible strings are enough
  45. * to provide the core so that different boards can add their more detailed
  46. * specifics.
  47. */
  48. static const char *ixp4xx_of_board_compat[] = {
  49. "intel,ixp42x",
  50. "intel,ixp43x",
  51. "intel,ixp45x",
  52. "intel,ixp46x",
  53. NULL,
  54. };
  55. DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)")
  56. .map_io = ixp4xx_of_map_io,
  57. .dt_compat = ixp4xx_of_board_compat,
  58. MACHINE_END