cats-hw.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * linux/arch/arm/mach-footbridge/cats-hw.c
  3. *
  4. * CATS machine fixup
  5. *
  6. * Copyright (C) 1998, 1999 Russell King, Phil Blundell
  7. */
  8. #include <linux/ioport.h>
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/screen_info.h>
  12. #include <linux/io.h>
  13. #include <linux/spinlock.h>
  14. #include <asm/hardware/dec21285.h>
  15. #include <asm/mach-types.h>
  16. #include <asm/setup.h>
  17. #include <asm/mach/arch.h>
  18. #include "common.h"
  19. #define CFG_PORT 0x370
  20. #define INDEX_PORT (CFG_PORT)
  21. #define DATA_PORT (CFG_PORT + 1)
  22. static int __init cats_hw_init(void)
  23. {
  24. if (machine_is_cats()) {
  25. /* Set Aladdin to CONFIGURE mode */
  26. outb(0x51, CFG_PORT);
  27. outb(0x23, CFG_PORT);
  28. /* Select logical device 3 */
  29. outb(0x07, INDEX_PORT);
  30. outb(0x03, DATA_PORT);
  31. /* Set parallel port to DMA channel 3, ECP+EPP1.9,
  32. enable EPP timeout */
  33. outb(0x74, INDEX_PORT);
  34. outb(0x03, DATA_PORT);
  35. outb(0xf0, INDEX_PORT);
  36. outb(0x0f, DATA_PORT);
  37. outb(0xf1, INDEX_PORT);
  38. outb(0x07, DATA_PORT);
  39. /* Select logical device 4 */
  40. outb(0x07, INDEX_PORT);
  41. outb(0x04, DATA_PORT);
  42. /* UART1 high speed mode */
  43. outb(0xf0, INDEX_PORT);
  44. outb(0x02, DATA_PORT);
  45. /* Select logical device 5 */
  46. outb(0x07, INDEX_PORT);
  47. outb(0x05, DATA_PORT);
  48. /* UART2 high speed mode */
  49. outb(0xf0, INDEX_PORT);
  50. outb(0x02, DATA_PORT);
  51. /* Set Aladdin to RUN mode */
  52. outb(0xbb, CFG_PORT);
  53. }
  54. return 0;
  55. }
  56. __initcall(cats_hw_init);
  57. /*
  58. * CATS uses soft-reboot by default, since
  59. * hard reboots fail on early boards.
  60. */
  61. static void __init
  62. fixup_cats(struct machine_desc *desc, struct tag *tags,
  63. char **cmdline, struct meminfo *mi)
  64. {
  65. screen_info.orig_video_lines = 25;
  66. screen_info.orig_video_points = 16;
  67. screen_info.orig_y = 24;
  68. }
  69. MACHINE_START(CATS, "Chalice-CATS")
  70. /* Maintainer: Philip Blundell */
  71. .boot_params = 0x00000100,
  72. .soft_reboot = 1,
  73. .fixup = fixup_cats,
  74. .map_io = footbridge_map_io,
  75. .init_irq = footbridge_init_irq,
  76. .timer = &isa_timer,
  77. MACHINE_END