Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34085
b: refs/heads/master
c: 6f3d5d3
h: refs/heads/master
i:
  34083: 6162bfd
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Aug 25, 2006
1 parent d6b1334 commit c813483
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0a428e30077fd64c39aadf5221cf2c7a14dc281
refs/heads/master: 6f3d5d3cc4b1447578ae8484166bbc34a64150c5
6 changes: 2 additions & 4 deletions trunk/arch/powerpc/kernel/rtas_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
if (!config_access_valid(pdn, where))
return PCIBIOS_BAD_REGISTER_NUMBER;

addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
(pdn->devfn << 8) | (where & 0xff);
addr = rtas_config_addr(pdn->busno, pdn->devfn, where);
buid = pdn->phb->buid;
if (buid) {
ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval,
Expand Down Expand Up @@ -134,8 +133,7 @@ int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val)
if (!config_access_valid(pdn, where))
return PCIBIOS_BAD_REGISTER_NUMBER;

addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
(pdn->devfn << 8) | (where & 0xff);
addr = rtas_config_addr(pdn->busno, pdn->devfn, where);
buid = pdn->phb->buid;
if (buid) {
ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr,
Expand Down
16 changes: 16 additions & 0 deletions trunk/include/asm-powerpc/rtas.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,21 @@ extern unsigned long rtas_rmo_buf;

#define GLOBAL_INTERRUPT_QUEUE 9005

/**
* rtas_config_addr - Format a busno, devfn and reg for RTAS.
* @busno: The bus number.
* @devfn: The device and function number as encoded by PCI_DEVFN().
* @reg: The register number.
*
* This function encodes the given busno, devfn and register number as
* required for RTAS calls that take a "config_addr" parameter.
* See PAPR requirement 7.3.4-1 for more info.
*/
static inline u32 rtas_config_addr(int busno, int devfn, int reg)
{
return ((reg & 0xf00) << 20) | ((busno & 0xff) << 16) |
(devfn << 8) | (reg & 0xff);
}

#endif /* __KERNEL__ */
#endif /* _POWERPC_RTAS_H */

0 comments on commit c813483

Please sign in to comment.