setup.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * linux/arch/arm/mach-iop32x/setup.c
  3. *
  4. * Author: Nicolas Pitre <nico@cam.org>
  5. * Copyright (C) 2001 MontaVista Software, Inc.
  6. * Copyright (C) 2004 Intel Corporation.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include <linux/mm.h>
  14. #include <linux/init.h>
  15. #include <linux/major.h>
  16. #include <linux/fs.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/serial.h>
  19. #include <linux/tty.h>
  20. #include <linux/serial_core.h>
  21. #include <asm/io.h>
  22. #include <asm/pgtable.h>
  23. #include <asm/page.h>
  24. #include <asm/mach/map.h>
  25. #include <asm/setup.h>
  26. #include <asm/system.h>
  27. #include <asm/memory.h>
  28. #include <asm/hardware.h>
  29. #include <asm/mach-types.h>
  30. #include <asm/mach/arch.h>
  31. #include <asm/hardware/iop3xx.h>
  32. #define IOP321_UART_XTAL 1843200
  33. #ifdef CONFIG_ARCH_IQ80321
  34. #define UARTBASE IQ80321_UART
  35. #define IRQ_UART IRQ_IQ80321_UART
  36. #endif
  37. #ifdef CONFIG_ARCH_IQ31244
  38. #define UARTBASE IQ31244_UART
  39. #define IRQ_UART IRQ_IQ31244_UART
  40. #endif
  41. static struct uart_port iop321_serial_ports[] = {
  42. {
  43. .membase = (char*)(UARTBASE),
  44. .mapbase = (UARTBASE),
  45. .irq = IRQ_UART,
  46. .flags = UPF_SKIP_TEST,
  47. .iotype = UPIO_MEM,
  48. .regshift = 0,
  49. .uartclk = IOP321_UART_XTAL,
  50. .line = 0,
  51. .type = PORT_16550A,
  52. .fifosize = 16
  53. }
  54. };
  55. void __init iop32x_init(void)
  56. {
  57. platform_device_register(&iop3xx_i2c0_device);
  58. platform_device_register(&iop3xx_i2c1_device);
  59. early_serial_setup(&iop321_serial_ports[0]);
  60. }
  61. #ifdef CONFIG_ARCH_IQ80321
  62. extern void iq80321_map_io(void);
  63. extern struct sys_timer iop321_timer;
  64. extern void iop321_init_time(void);
  65. #endif
  66. #ifdef CONFIG_ARCH_IQ31244
  67. extern void iq31244_map_io(void);
  68. extern struct sys_timer iop321_timer;
  69. extern void iop321_init_time(void);
  70. #endif
  71. #if defined(CONFIG_ARCH_IQ80321)
  72. MACHINE_START(IQ80321, "Intel IQ80321")
  73. /* Maintainer: Intel Corporation */
  74. .phys_io = IQ80321_UART,
  75. .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc,
  76. .map_io = iq80321_map_io,
  77. .init_irq = iop321_init_irq,
  78. .timer = &iop321_timer,
  79. .boot_params = 0xa0000100,
  80. .init_machine = iop32x_init,
  81. MACHINE_END
  82. #elif defined(CONFIG_ARCH_IQ31244)
  83. MACHINE_START(IQ31244, "Intel IQ31244")
  84. /* Maintainer: Intel Corp. */
  85. .phys_io = IQ31244_UART,
  86. .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
  87. .map_io = iq31244_map_io,
  88. .init_irq = iop321_init_irq,
  89. .timer = &iop321_timer,
  90. .boot_params = 0xa0000100,
  91. .init_machine = iop32x_init,
  92. MACHINE_END
  93. #else
  94. #error No machine descriptor defined for this IOP3XX implementation
  95. #endif