cats-hw.c 2.0 KB

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