5 #include <linux/kernel.h>
8 #include <linux/string.h>
12 #include <asm/pgtable.h>
16 #include <asm/machdep.h>
17 #include <asm/sections.h>
18 #include <asm/pci-bridge.h>
36 volatile void __iomem *cfg_data;
45 cfg_data = hose->cfg_data + ((bus->
number<<16) | (devfn<<8) | off);
48 *val =
in_8(cfg_data);
63 volatile void __iomem *cfg_data;
72 cfg_data = hose->cfg_data + ((bus->
number<<16) | (devfn<<8) | off);
87 static struct pci_ops gg2_pci_ops =
100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
102 | (hose->global_number << 24);
115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
117 | (hose->global_number << 24);
125 static struct pci_ops rtas_pci_ops =
146 printk(
"Hydra Mac I/O at %llx\n", (
unsigned long long)r.
start);
147 printk(
"Hydra Feature_Control was %x",
150 HYDRA_FC_SCSI_CELL_EN |
151 HYDRA_FC_SCCA_ENABLE |
152 HYDRA_FC_SCCB_ENABLE |
153 HYDRA_FC_ARB_BYPASS |
154 HYDRA_FC_MPIC_ENABLE |
155 HYDRA_FC_SLOW_SCC_PCLK |
156 HYDRA_FC_MPIC_IS_MASTER));
161 #define PRG_CL_RESET_VALID 0x00010000
180 out_be32(®[12], val & ~PRG_CL_RESET_VALID);
196 hose->
ops = &rtas_pci_ops;
199 printk (
"RTAS supporting Pegasos OF not found, please upgrade"
202 pci_add_flags(PCI_REASSIGN_ALL_BUS);
210 const int *bus_range;
213 const unsigned int *
dma;
215 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
224 if (machine !=
NULL) {
225 is_longtrail =
strncmp(machine,
"IBM,LongTrail", 13) == 0;
226 is_mot =
strncmp(machine,
"MOT", 3) == 0;
227 if (
strncmp(machine,
"Pegasos2", 8) == 0)
229 else if (
strncmp(machine,
"Pegasos", 7) == 0)
243 if (bus_range ==
NULL || len < 2 *
sizeof(
int)) {
248 if (bus_range[1] == bus_range[0])
252 bus_range[0], bus_range[1]);
260 printk(
"Can't allocate PCI controller structure for %s\n",
264 hose->
first_busno = hose->self_busno = bus_range[0];
270 if (
strncmp(model,
"IBM, Python", 11) == 0) {
271 setup_python(hose, dev);
273 ||
strncmp(model,
"Motorola, Grackle", 17) == 0) {
275 }
else if (is_longtrail) {
277 hose->
ops = &gg2_pci_ops;
280 }
else if (is_pegasos == 1) {
282 }
else if (is_pegasos == 2) {
283 setup_peg2(hose, dev);
284 }
else if (!
strncmp(model,
"IBM,CPC710", 10)) {
286 r.
start + 0x000f8000,
287 r.
start + 0x000f8010,
292 if (dma && len >=
sizeof(*dma)) {
293 dma = (
unsigned int *)
294 (((
unsigned long)dma) +
300 printk(
"No methods for %s (model %s), using RTAS\n",
302 hose->
ops = &rtas_pci_ops;
310 if (index == 0 && dma !=
NULL && len >= 6 *
sizeof(*dma)) {
319 #define SL82C105_IDECSR 0x40
334 if ((sl82c105->
class & 5) != 5) {
335 printk(
"W83C553: Switching SL82C105 IDE to PCI native mode\n");
339 sl82c105->
class |= 0x05;
350 chrp_pci_fixup_winbond_ata);
358 static void chrp_pci_fixup_vt8231_ata(
struct pci_dev *viaide)
365 if (viaide->
irq != 14)
371 dev_info(&viaide->
dev,
"Fixing VIA IDE, force legacy mode on\n");
375 viaide->
class &= ~0x5;