/arch/arm/mach-footbridge/cats-hw.c

https://bitbucket.org/evzijst/gittest · C · 95 lines · 57 code · 18 blank · 20 comment · 1 complexity · a395cd35e75f1cd088c6f989fededf8d MD5 · raw file

  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/tty.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. BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
  71. BOOT_PARAMS(0x00000100)
  72. SOFT_REBOOT
  73. FIXUP(fixup_cats)
  74. MAPIO(footbridge_map_io)
  75. INITIRQ(footbridge_init_irq)
  76. .timer = &isa_timer,
  77. MACHINE_END