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