cats-hw.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 tag *tags, char **cmdline)
  63. {
  64. #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
  65. screen_info.orig_video_lines = 25;
  66. screen_info.orig_video_points = 16;
  67. screen_info.orig_y = 24;
  68. #endif
  69. }
  70. MACHINE_START(CATS, "Chalice-CATS")
  71. /* Maintainer: Philip Blundell */
  72. .atag_offset = 0x100,
  73. .reboot_mode = REBOOT_SOFT,
  74. .fixup = fixup_cats,
  75. .map_io = footbridge_map_io,
  76. .init_irq = footbridge_init_irq,
  77. .init_time = isa_timer_init,
  78. .restart = footbridge_restart,
  79. MACHINE_END