setup.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * linux/arch/sh/kernel/setup_sh2000.c
  3. *
  4. * Copyright (C) 2001 SUGIOKA Tochinobu
  5. *
  6. * SH-2000 Support.
  7. *
  8. */
  9. #include <linux/config.h>
  10. #include <linux/init.h>
  11. #include <linux/irq.h>
  12. #include <asm/io.h>
  13. #include <asm/machvec.h>
  14. #include <asm/mach/sh2000.h>
  15. #define CF_CIS_BASE 0xb4200000
  16. #define PORT_PECR 0xa4000108
  17. #define PORT_PHCR 0xa400010E
  18. #define PORT_ICR1 0xa4000010
  19. #define PORT_IRR0 0xa4000004
  20. #define IDE_OFFSET 0xb6200000
  21. #define NIC_OFFSET 0xb6000000
  22. #define EXTBUS_OFFSET 0xba000000
  23. const char *get_system_type(void)
  24. {
  25. return "sh2000";
  26. }
  27. static unsigned long sh2000_isa_port2addr(unsigned long offset)
  28. {
  29. if((offset & ~7) == 0x1f0 || offset == 0x3f6)
  30. return IDE_OFFSET + offset;
  31. else if((offset & ~0x1f) == 0x300)
  32. return NIC_OFFSET + offset;
  33. return EXTBUS_OFFSET + offset;
  34. }
  35. /*
  36. * The Machine Vector
  37. */
  38. struct sh_machine_vector mv_sh2000 __initmv = {
  39. .mv_nr_irqs = 80,
  40. .mv_isa_port2addr = sh2000_isa_port2addr,
  41. };
  42. ALIAS_MV(sh2000)
  43. /*
  44. * Initialize the board
  45. */
  46. int __init platform_setup(void)
  47. {
  48. /* XXX: RTC setting comes here */
  49. /* These should be done by BIOS/IPL ... */
  50. /* Enable nCE2A, nCE2B output */
  51. ctrl_outw(ctrl_inw(PORT_PECR) & ~0xf00, PORT_PECR);
  52. /* Enable the Compact Flash card, and set the level interrupt */
  53. ctrl_outw(0x0042, CF_CIS_BASE+0x0200);
  54. /* Enable interrupt */
  55. ctrl_outw(ctrl_inw(PORT_PHCR) & ~0x03f3, PORT_PHCR);
  56. ctrl_outw(1, PORT_ICR1);
  57. ctrl_outw(ctrl_inw(PORT_IRR0) & ~0xff3f, PORT_IRR0);
  58. printk(KERN_INFO "SH-2000 Setup...done\n");
  59. return 0;
  60. }