redwood5.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * arch/ppc/platforms/4xx/redwood5.c
  3. *
  4. * Support for the IBM redwood5 eval board file
  5. *
  6. * Author: Armin Kuster <akuster@mvista.com>
  7. *
  8. * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
  9. * the terms of the GNU General Public License version 2. This program
  10. * is licensed "as is" without any warranty of any kind, whether express
  11. * or implied.
  12. */
  13. #include <linux/config.h>
  14. #include <linux/init.h>
  15. #include <linux/pagemap.h>
  16. #include <linux/device.h>
  17. #include <linux/ioport.h>
  18. #include <asm/io.h>
  19. #include <asm/machdep.h>
  20. #include <asm/ppc4xx_pic.h>
  21. /*
  22. * Define external IRQ senses and polarities.
  23. */
  24. unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
  25. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */
  26. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */
  27. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */
  28. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */
  29. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */
  30. (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */
  31. };
  32. static struct resource smc91x_resources[] = {
  33. [0] = {
  34. .start = SMC91111_BASE_ADDR,
  35. .end = SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
  36. .flags = IORESOURCE_MEM,
  37. },
  38. [1] = {
  39. .start = SMC91111_IRQ,
  40. .end = SMC91111_IRQ,
  41. .flags = IORESOURCE_IRQ,
  42. },
  43. };
  44. static struct platform_device smc91x_device = {
  45. .name = "smc91x",
  46. .id = 0,
  47. .num_resources = ARRAY_SIZE(smc91x_resources),
  48. .resource = smc91x_resources,
  49. };
  50. static struct platform_device *redwood5_devs[] __initdata = {
  51. &smc91x_device,
  52. };
  53. static int __init
  54. redwood5_platform_add_devices(void)
  55. {
  56. return platform_add_devices(redwood5_devs, ARRAY_SIZE(redwood5_devs));
  57. }
  58. void __init
  59. redwood5_setup_arch(void)
  60. {
  61. ppc4xx_setup_arch();
  62. #ifdef CONFIG_DEBUG_BRINGUP
  63. printk("\n");
  64. printk("machine\t: %s\n", PPC4xx_MACHINE_NAME);
  65. printk("\n");
  66. printk("bi_s_version\t %s\n", bip->bi_s_version);
  67. printk("bi_r_version\t %s\n", bip->bi_r_version);
  68. printk("bi_memsize\t 0x%8.8x\t %dMBytes\n", bip->bi_memsize,bip->bi_memsize/(1024*1000));
  69. printk("bi_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", 0,
  70. bip->bi_enetaddr[0], bip->bi_enetaddr[1],
  71. bip->bi_enetaddr[2], bip->bi_enetaddr[3],
  72. bip->bi_enetaddr[4], bip->bi_enetaddr[5]);
  73. printk("bi_intfreq\t 0x%8.8x\t clock:\t %dMhz\n",
  74. bip->bi_intfreq, bip->bi_intfreq/ 1000000);
  75. printk("bi_busfreq\t 0x%8.8x\t plb bus clock:\t %dMHz\n",
  76. bip->bi_busfreq, bip->bi_busfreq / 1000000 );
  77. printk("bi_tbfreq\t 0x%8.8x\t TB freq:\t %dMHz\n",
  78. bip->bi_tbfreq, bip->bi_tbfreq/1000000);
  79. printk("\n");
  80. #endif
  81. device_initcall(redwood5_platform_add_devices);
  82. }
  83. void __init
  84. redwood5_map_io(void)
  85. {
  86. int i;
  87. ppc4xx_map_io();
  88. for (i = 0; i < 16; i++) {
  89. unsigned long v, p;
  90. /* 0x400x0000 -> 0xe00x0000 */
  91. p = 0x40000000 | (i << 16);
  92. v = STB04xxx_IO_BASE | (i << 16);
  93. io_block_mapping(v, p, PAGE_SIZE,
  94. _PAGE_NO_CACHE | pgprot_val(PAGE_KERNEL) | _PAGE_GUARDED);
  95. }
  96. }
  97. void __init
  98. platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  99. unsigned long r6, unsigned long r7)
  100. {
  101. ppc4xx_init(r3, r4, r5, r6, r7);
  102. ppc_md.setup_arch = redwood5_setup_arch;
  103. ppc_md.setup_io_mappings = redwood5_map_io;
  104. }