Home | History | Annotate | Download | only in s3c2xx0
History log of /src/sys/arch/arm/s3c2xx0/s3c2800_pci.c
RevisionDateAuthorComments
 1.34  25-Sep-2022  andvar s/itnerrupt/interrupt/
 1.33  23-May-2022  andvar s/boundries/boundaries/, s/itterate/iterate/ and few more typos.
 1.32  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.31  24-Apr-2021  thorpej branches: 1.31.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.30  20-Nov-2020  thorpej branches: 1.30.2;
malloc(9) -> kmem(9)
 1.29  07-Jul-2020  thorpej branches: 1.29.2;
Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.28  14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.27  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.26  26-Nov-2018  jmcneill Switch to designated initializers
 1.25  16-Nov-2018  jmcneill Add intr_establish_xname support to arm and expose it to intrctl
 1.24  08-Nov-2018  skrll Fix build after recent arm32_pci_chipset change
 1.23  19-Apr-2017  jmcneill branches: 1.23.10; 1.23.12;
Initialize intr_setattr of arm32_pci_chipset
 1.22  02-Oct-2015  msaitoh branches: 1.22.2; 1.22.4;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.21  29-Mar-2014  christos branches: 1.21.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.20  18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.19  27-Oct-2012  chs branches: 1.19.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.18  07-Sep-2012  matt branches: 1.18.2;
Fix more pci_conf_interrupt/pci_conf_hook problems
 1.17  27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.16  01-Jul-2011  dyoung branches: 1.16.2; 1.16.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.15  17-May-2011  dyoung PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.14  04-Apr-2011  dyoung Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.13  06-Jan-2008  matt branches: 1.13.32; 1.13.38;
Cleanup softint lossage.
 1.12  04-Mar-2007  christos branches: 1.12.16; 1.12.20; 1.12.22; 1.12.28; 1.12.34;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11  24-Nov-2005  yamt branches: 1.11.26;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.10  01-Apr-2005  yamt branches: 1.10.2; 1.10.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.9  30-Aug-2004  drochner branches: 1.9.4; 1.9.6;
Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.8  24-Apr-2004  kleink Update for new pci_devinfo(9) signature.
 1.7  15-Jul-2003  lukem __KERNEL_RCSID()
 1.6  18-Jun-2003  bsh branches: 1.6.2;
don't map PCI device's I/O ports at address 0.

This fixed a problem when 3com 3C905 is a only PCI card on SMDK2800.
 1.5  15-Jun-2003  fvdl Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.4  12-May-2003  bsh add an arg to s3c2800_intr_establish() for interrupt type.
 1.3  01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.2  01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.1  20-Nov-2002  bsh branches: 1.1.2;
Samsung S3C2800 is a CPU with ARM920T core.
 1.1.2.3  03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2  11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1  20-Nov-2002  thorpej file s3c2800_pci.c was added on branch nathanw_sa on 2002-12-11 05:53:14 +0000
 1.6.2.6  11-Dec-2005  christos Sync with head.
 1.6.2.5  01-Apr-2005  skrll Sync with HEAD.
 1.6.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.6.2.2  03-Sep-2004  skrll Sync with HEAD
 1.6.2.1  03-Aug-2004  skrll Sync with HEAD
 1.9.6.1  28-Jan-2005  yamt convert arch/arm to new apis.
 1.9.4.1  29-Apr-2005  kent sync with -current
 1.10.8.1  29-Nov-2005  yamt sync with head.
 1.10.2.3  21-Jan-2008  yamt sync with head
 1.10.2.2  03-Sep-2007  yamt sync with head.
 1.10.2.1  21-Jun-2006  yamt sync with head.
 1.11.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.12.34.1  08-Jan-2008  bouyer Sync with HEAD
 1.12.28.1  18-Feb-2008  mjf Sync with HEAD.
 1.12.22.1  09-Jan-2008  matt sync with HEAD
 1.12.20.1  20-Jan-2008  chris Sync to HEAD.
 1.12.16.1  28-Feb-2008  rjs Sync with HEAD.
 1.13.38.1  06-Jun-2011  jruoho Sync with HEAD.
 1.13.32.2  31-May-2011  rmind sync with head
 1.13.32.1  21-Apr-2011  rmind sync with head
 1.16.6.1  18-Feb-2012  mrg merge to -current.
 1.16.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.2.2  30-Oct-2012  yamt sync with head
 1.16.2.1  17-Apr-2012  yamt sync with head
 1.18.2.3  03-Dec-2017  jdolecek update from HEAD
 1.18.2.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.19.2.2  18-May-2014  rmind sync with head
 1.19.2.1  28-Aug-2013  rmind sync with head
 1.21.6.2  28-Aug-2017  skrll Sync with HEAD
 1.21.6.1  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.22.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.22.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.23.12.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.23.12.1  10-Jun-2019  christos Sync with HEAD
 1.23.10.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.23.10.1  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.29.2.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.30.2.1  23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.31.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed