setup.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * linux/arch/sh/boards/cat68701/setup.c
  3. *
  4. * Copyright (C) 2000 Niibe Yutaka
  5. * 2001 Yutaro Ebihara
  6. *
  7. * Setup routines for A-ONE Corp CAT-68701 SH7708 Board
  8. *
  9. * This file is subject to the terms and conditions of the GNU General Public
  10. * License. See the file "COPYING" in the main directory of this archive
  11. * for more details.
  12. *
  13. */
  14. #include <asm/io.h>
  15. #include <asm/machvec.h>
  16. #include <asm/mach/io.h>
  17. #include <linux/config.h>
  18. #include <linux/module.h>
  19. #include <linux/init.h>
  20. #include <linux/sched.h>
  21. const char *get_system_type(void)
  22. {
  23. return "CAT-68701";
  24. }
  25. #ifdef CONFIG_HEARTBEAT
  26. void heartbeat_cat68701()
  27. {
  28. static unsigned int cnt = 0, period = 0 , bit = 0;
  29. cnt += 1;
  30. if (cnt < period) {
  31. return;
  32. }
  33. cnt = 0;
  34. /* Go through the points (roughly!):
  35. * f(0)=10, f(1)=16, f(2)=20, f(5)=35,f(inf)->110
  36. */
  37. period = 110 - ( (300<<FSHIFT)/
  38. ((avenrun[0]/5) + (3<<FSHIFT)) );
  39. if(bit){ bit=0; }else{ bit=1; }
  40. outw(bit<<15,0x3fe);
  41. }
  42. #endif /* CONFIG_HEARTBEAT */
  43. unsigned long cat68701_isa_port2addr(unsigned long offset)
  44. {
  45. /* CompactFlash (IDE) */
  46. if (((offset >= 0x1f0) && (offset <= 0x1f7)) || (offset==0x3f6))
  47. return 0xba000000 + offset;
  48. /* INPUT PORT */
  49. if ((offset >= 0x3fc) && (offset <= 0x3fd))
  50. return 0xb4007000 + offset;
  51. /* OUTPUT PORT */
  52. if ((offset >= 0x3fe) && (offset <= 0x3ff))
  53. return 0xb4007400 + offset;
  54. return offset + 0xb4000000; /* other I/O (EREA 5)*/
  55. }
  56. /*
  57. * The Machine Vector
  58. */
  59. struct sh_machine_vector mv_cat68701 __initmv = {
  60. .mv_nr_irqs = 32,
  61. .mv_isa_port2addr = cat68701_isa_port2addr,
  62. .mv_irq_demux = cat68701_irq_demux,
  63. .mv_init_irq = init_cat68701_IRQ,
  64. #ifdef CONFIG_HEARTBEAT
  65. .mv_heartbeat = heartbeat_cat68701,
  66. #endif
  67. };
  68. ALIAS_MV(cat68701)
  69. int __init platform_setup(void)
  70. {
  71. /* dummy read erea5 (CS8900A) */
  72. }