1
2
3
4
5
6
7
8
9
10
11
12#include <linux/config.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <asm/io.h>
16#include "harp.h"
17
18
19
20int __init setup_harp(void)
21{
22#ifdef CONFIG_SH_STB1_HARP
23 unsigned long ic8_version, ic36_version;
24
25 ic8_version = ctrl_inl(EPLD_REVID2);
26 ic36_version = ctrl_inl(EPLD_REVID1);
27
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
35 version = ctrl_inl(EPLD_REVID);
36
37 printk("STMicroelectronics STB1 Overdrive initialisaton\n");
38 printk("EPLD version: %d.%02d\n",
39 (version >> 4) & 0xf, version & 0xf);
40#else
41#error Undefined machine
42#endif
43
44
45
46
47 disable_hlt();
48
49 return 0;
50}
51
52#ifdef CONFIG_PCI
53
54
55
56
57
58int __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:
63 return HARP_PCI_IRQ;
64 case 1:
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}
78#endif
79