setup.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * arch/sh/stboard/setup.c
  3. *
  4. * Copyright (C) 2001 Stuart Menefy (stuart.menefy@st.com)
  5. *
  6. * May be copied or modified under the terms of the GNU General Public
  7. * License. See linux/COPYING for more information.
  8. *
  9. * STMicroelectronics ST40STB1 HARP and compatible support.
  10. */
  11. #include <linux/config.h>
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <asm/io.h>
  15. #include <asm/harp/harp.h>
  16. const char *get_system_type(void)
  17. {
  18. return "STB1 Harp";
  19. }
  20. /*
  21. * Initialize the board
  22. */
  23. int __init platform_setup(void)
  24. {
  25. #ifdef CONFIG_SH_STB1_HARP
  26. unsigned long ic8_version, ic36_version;
  27. ic8_version = ctrl_inl(EPLD_REVID2);
  28. ic36_version = ctrl_inl(EPLD_REVID1);
  29. printk("STMicroelectronics STB1 HARP initialisaton\n");
  30. printk("EPLD versions: IC8: %d.%02d, IC36: %d.%02d\n",
  31. (ic8_version >> 4) & 0xf, ic8_version & 0xf,
  32. (ic36_version >> 4) & 0xf, ic36_version & 0xf);
  33. #elif defined(CONFIG_SH_STB1_OVERDRIVE)
  34. unsigned long version;
  35. version = ctrl_inl(EPLD_REVID);
  36. printk("STMicroelectronics STB1 Overdrive initialisaton\n");
  37. printk("EPLD version: %d.%02d\n",
  38. (version >> 4) & 0xf, version & 0xf);
  39. #else
  40. #error Undefined machine
  41. #endif
  42. /* Currently all STB1 chips have problems with the sleep instruction,
  43. * so disable it here.
  44. */
  45. disable_hlt();
  46. return 0;
  47. }
  48. /*
  49. * pcibios_map_platform_irq
  50. *
  51. * This is board specific and returns the IRQ for a given PCI device.
  52. * It is used by the PCI code (arch/sh/kernel/st40_pci*)
  53. *
  54. */
  55. #define HARP_PCI_IRQ 1
  56. #define HARP_BRIDGE_IRQ 2
  57. #define OVERDRIVE_SLOT0_IRQ 0
  58. int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
  59. {
  60. switch (slot) {
  61. #ifdef CONFIG_SH_STB1_HARP
  62. case 2: /*This is the PCI slot on the */
  63. return HARP_PCI_IRQ;
  64. case 1: /* this is the bridge */
  65. return HARP_BRIDGE_IRQ;
  66. #elif defined(CONFIG_SH_STB1_OVERDRIVE)
  67. case 1:
  68. case 2:
  69. case 3:
  70. return slot - 1;
  71. #else
  72. #error Unknown board
  73. #endif
  74. default:
  75. return -1;
  76. }
  77. }