diff options
author | imp <imp@FreeBSD.org> | 2006-10-30 19:18:46 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-10-30 19:18:46 +0000 |
commit | 4bea281f9ade627bae92397e800c3f3b5a307283 (patch) | |
tree | 4fd056502338d70664fa352221552819df190c2c /sys/dev/pci/pcivar.h | |
parent | 95289e010fb3674d4ab102b64dcae134233b1b1c (diff) | |
download | FreeBSD-src-4bea281f9ade627bae92397e800c3f3b5a307283.zip FreeBSD-src-4bea281f9ade627bae92397e800c3f3b5a307283.tar.gz |
More fully support 64-bit bars. Prior to this commit, we supported
only those bars that had addresses assigned by the BIOS and where the
bridges were properly programmed. Now even unprogrammed ones work.
This was needed for sun4v. We still only implement up to 2GB memory
ranges, even for 64-bit bars. PCI standards at least through 2.2 say
that this is the max (or 1GB is, I only know it is < 32bits).
o Always define pci_addr_t as uint64_t. A pci address is always 64-bits,
but some hosts can't address all of them.
o Preserve the upper half of the 64-bit word during resource probing.
o Test to make sure that 64-bit values can fit in a u_long (true on some
platforms, but not others). Don't use those that can't.
o minor pedantry about data sizes.
o Better bridge resource reporting in bootverbose case.
o Minor formatting changes to cope with different data types on different
platforms.
Submitted by: jmg, with many changes by me to fully support 64-bit
addresses.
Diffstat (limited to 'sys/dev/pci/pcivar.h')
-rw-r--r-- | sys/dev/pci/pcivar.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index fc37941..1c026c9 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -43,13 +43,7 @@ #define PCI_MAXMAPS_1 2 /* max. no. of maps for PCI to PCI bridge */ #define PCI_MAXMAPS_2 1 /* max. no. of maps for CardBus bridge */ -/* pci_addr_t covers this system's PCI bus address space: 32 or 64 bit */ - -#ifdef PCI_A64 -typedef uint64_t pci_addr_t; /* uint64_t for system with 64bit addresses */ -#else -typedef uint32_t pci_addr_t; /* uint64_t for system with 64bit addresses */ -#endif +typedef uint64_t pci_addr_t; /* Interesting values for PCI power management */ struct pcicfg_pp { @@ -130,14 +124,8 @@ typedef struct pcicfg { /* additional type 1 device config header information (PCI to PCI bridge) */ -#ifdef PCI_A64 #define PCI_PPBMEMBASE(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) & ~0xfffff) #define PCI_PPBMEMLIMIT(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) | 0xfffff) -#else -#define PCI_PPBMEMBASE(h,l) (((l)<<16) & ~0xfffff) -#define PCI_PPBMEMLIMIT(h,l) (((l)<<16) | 0xfffff) -#endif /* PCI_A64 */ - #define PCI_PPBIOBASE(h,l) ((((h)<<16) + ((l)<<8)) & ~0xfff) #define PCI_PPBIOLIMIT(h,l) ((((h)<<16) + ((l)<<8)) | 0xfff) |