efika.c (d66584086717f6dda76d523ef58363deaa3efe51) efika.c (5516b540e98de6f7474a4e7149470ad6a0bbc54a)
1/*
2 * Efika 5K2 platform code
3 * Some code really inspired from the lite5200b platform.
4 *
5 * Copyright (C) 2006 bplan GmbH
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any

--- 40 unchanged lines hidden (view full) ---

49 * Access functions for PCI config space using RTAS calls.
50 */
51static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
52 int len, u32 * val)
53{
54 struct pci_controller *hose = bus->sysdata;
55 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
56 | (((bus->number - hose->first_busno) & 0xff) << 16)
1/*
2 * Efika 5K2 platform code
3 * Some code really inspired from the lite5200b platform.
4 *
5 * Copyright (C) 2006 bplan GmbH
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any

--- 40 unchanged lines hidden (view full) ---

49 * Access functions for PCI config space using RTAS calls.
50 */
51static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
52 int len, u32 * val)
53{
54 struct pci_controller *hose = bus->sysdata;
55 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
56 | (((bus->number - hose->first_busno) & 0xff) << 16)
57 | (hose->index << 24);
57 | (hose->global_number << 24);
58 int ret = -1;
59 int rval;
60
61 rval = rtas_call(rtas_token("read-pci-config"), 2, 2, &ret, addr, len);
62 *val = ret;
63 return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
64}
65
66static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
67 int offset, int len, u32 val)
68{
69 struct pci_controller *hose = bus->sysdata;
70 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
71 | (((bus->number - hose->first_busno) & 0xff) << 16)
58 int ret = -1;
59 int rval;
60
61 rval = rtas_call(rtas_token("read-pci-config"), 2, 2, &ret, addr, len);
62 *val = ret;
63 return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
64}
65
66static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
67 int offset, int len, u32 val)
68{
69 struct pci_controller *hose = bus->sysdata;
70 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
71 | (((bus->number - hose->first_busno) & 0xff) << 16)
72 | (hose->index << 24);
72 | (hose->global_number << 24);
73 int rval;
74
75 rval = rtas_call(rtas_token("write-pci-config"), 3, 1, NULL,
76 addr, len, val);
77 return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
78}
79
80static struct pci_ops rtas_pci_ops = {

--- 179 unchanged lines hidden ---
73 int rval;
74
75 rval = rtas_call(rtas_token("write-pci-config"), 3, 1, NULL,
76 addr, len, val);
77 return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
78}
79
80static struct pci_ops rtas_pci_ops = {

--- 179 unchanged lines hidden ---