setup.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. #define IOP321_UART_XTAL 1843200
  32. #ifdef CONFIG_ARCH_IQ80321
  33. #define UARTBASE IQ80321_UART
  34. #define IRQ_UART IRQ_IQ80321_UART
  35. #endif
  36. #ifdef CONFIG_ARCH_IQ31244
  37. #define UARTBASE IQ31244_UART
  38. #define IRQ_UART IRQ_IQ31244_UART
  39. #endif
  40. static struct uart_port iop321_serial_ports[] = {
  41. {
  42. .membase = (char*)(UARTBASE),
  43. .mapbase = (UARTBASE),
  44. .irq = IRQ_UART,
  45. .flags = UPF_SKIP_TEST,
  46. .iotype = UPIO_MEM,
  47. .regshift = 0,
  48. .uartclk = IOP321_UART_XTAL,
  49. .line = 0,
  50. .type = PORT_16550A,
  51. .fifosize = 16
  52. }
  53. };
  54. static struct resource iop32x_i2c_0_resources[] = {
  55. [0] = {
  56. .start = 0xfffff680,
  57. .end = 0xfffff698,
  58. .flags = IORESOURCE_MEM,
  59. },
  60. [1] = {
  61. .start = IRQ_IOP321_I2C_0,
  62. .end = IRQ_IOP321_I2C_0,
  63. .flags = IORESOURCE_IRQ
  64. }
  65. };
  66. static struct resource iop32x_i2c_1_resources[] = {
  67. [0] = {
  68. .start = 0xfffff6a0,
  69. .end = 0xfffff6b8,
  70. .flags = IORESOURCE_MEM,
  71. },
  72. [1] = {
  73. .start = IRQ_IOP321_I2C_1,
  74. .end = IRQ_IOP321_I2C_1,
  75. .flags = IORESOURCE_IRQ
  76. }
  77. };
  78. static struct platform_device iop32x_i2c_0_controller = {
  79. .name = "IOP3xx-I2C",
  80. .id = 0,
  81. .num_resources = 2,
  82. .resource = iop32x_i2c_0_resources
  83. };
  84. static struct platform_device iop32x_i2c_1_controller = {
  85. .name = "IOP3xx-I2C",
  86. .id = 1,
  87. .num_resources = 2,
  88. .resource = iop32x_i2c_1_resources
  89. };
  90. static struct platform_device *iop32x_devices[] __initdata = {
  91. &iop32x_i2c_0_controller,
  92. &iop32x_i2c_1_controller
  93. };
  94. void __init iop32x_init(void)
  95. {
  96. if(iop_is_321())
  97. {
  98. platform_add_devices(iop32x_devices,
  99. ARRAY_SIZE(iop32x_devices));
  100. }
  101. early_serial_setup(&iop321_serial_ports[0]);
  102. }
  103. #ifdef CONFIG_ARCH_IQ80321
  104. extern void iq80321_map_io(void);
  105. extern struct sys_timer iop321_timer;
  106. extern void iop321_init_time(void);
  107. #endif
  108. #ifdef CONFIG_ARCH_IQ31244
  109. extern void iq31244_map_io(void);
  110. extern struct sys_timer iop321_timer;
  111. extern void iop321_init_time(void);
  112. #endif
  113. #if defined(CONFIG_ARCH_IQ80321)
  114. MACHINE_START(IQ80321, "Intel IQ80321")
  115. /* Maintainer: Intel Corporation */
  116. .phys_io = IQ80321_UART,
  117. .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc,
  118. .map_io = iq80321_map_io,
  119. .init_irq = iop321_init_irq,
  120. .timer = &iop321_timer,
  121. .boot_params = 0xa0000100,
  122. .init_machine = iop32x_init,
  123. MACHINE_END
  124. #elif defined(CONFIG_ARCH_IQ31244)
  125. MACHINE_START(IQ31244, "Intel IQ31244")
  126. /* Maintainer: Intel Corp. */
  127. .phys_io = IQ31244_UART,
  128. .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
  129. .map_io = iq31244_map_io,
  130. .init_irq = iop321_init_irq,
  131. .timer = &iop321_timer,
  132. .boot_params = 0xa0000100,
  133. .init_machine = iop32x_init,
  134. MACHINE_END
  135. #else
  136. #error No machine descriptor defined for this IOP3XX implementation
  137. #endif