setup.c 2.0 KB

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