Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/agp_intel.c
RevisionDateAuthorComments
 1.39  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.38  05-Feb-2019  mrg fix a >15 year old code rework bug, and add a missing break;.

the code in rev 1.7 looks like it does in this change, but rev 1.8 would
write the I443 AGP_INTEL_AGPCTRL value, and then the other value.
 1.37  04-Apr-2011  dyoung branches: 1.37.48; 1.37.56;
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.36  13-Nov-2010  uebayasi branches: 1.36.2;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.35  04-Apr-2010  jakllsch Add (non-IGP) AGP port support for Intel 82855GM.
agp_intel tested with radeondrm(4). agp_i810 tested with i915drm(4).
 1.34  24-Feb-2010  dyoung branches: 1.34.2;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.33  08-Jan-2010  dyoung branches: 1.33.2;
Expand PMF_FN_* macros.
 1.32  09-Jun-2008  freza branches: 1.32.8;
o Split device_t/softc for agp(4).
o agp_ali.c: remove unused 'agp' member from agp_ali_softc.
o drm: agp_find_device() returns 'void *', not a device_t.
o Use device_t, cfdata_t instead of struct pointers.
o Don't cast void pointers in assignments.
 1.31  10-Apr-2008  cegger branches: 1.31.2; 1.31.4; 1.31.6;
use aprint_*_dev and device_xname
 1.30  29-Feb-2008  dyoung Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.29  21-Feb-2008  drochner clean up the error bit clear code:
-use an aligned pci config space address as everyone else -- I'm sorry
about that because I like gson's way a lot -- it keeps the address
offset due to alignment visually close to the data shift --, but since
aligned addresses are used everywhere else in definitions, this
causes confusion
-the mask applied to the data didn't make much sense, a look at the
FreeBSD code where this code originates from suggests that there
was just a mistake -- one trailing zero missing --
anyway, the datasheet tells that the error bits are all write-one-
to-clear, so just write back the value and we are done
 1.28  15-Feb-2008  gson branches: 1.28.2; 1.28.6;
Fix unaligned write to PCI configuration space. Should fix PR kern/37824.
 1.27  04-Jan-2008  ad Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
 1.26  15-Dec-2007  perry __FUNCTION__ -> __func__
 1.25  09-Dec-2007  jmcneill branches: 1.25.2;
Merge jmcneill-pm branch.
 1.24  12-Nov-2007  joerg branches: 1.24.2; 1.24.4;
Merge bunch of AGP changes from jmcneill-pm.
 1.23  19-Oct-2007  ad branches: 1.23.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.22  26-Mar-2007  hubertf branches: 1.22.8; 1.22.10; 1.22.14;
Remove duplicate include of <sys/agpio.h>
From: Slava Semushin <php-coder@altlinux.ru>
 1.21  16-Nov-2006  christos branches: 1.21.4; 1.21.8; 1.21.10; 1.21.12;
__unused removal on arguments; approved by core.
 1.20  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.19  24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.18  11-Mar-2006  jmcneill branches: 1.18.10; 1.18.12;
Add Intel AGP powerhook. Tested on an 82855PM.
 1.17  16-Jan-2006  christos branches: 1.17.2; 1.17.4; 1.17.6; 1.17.8;
PR/32550: Michael Eriksson: No agp(4) support for i915 integrated graphics
 1.16  11-Dec-2005  christos branches: 1.16.2;
merge ktrace-lwp.
 1.15  28-Jun-2005  thorpej branches: 1.15.2;
Use ANSI function decls and static.
 1.14  26-Aug-2003  tron branches: 1.14.14;
Rework support for i845, i865 and i875P. agp(4) now doesn't "kill" the
i82547EI on my i865PE motherboard any longer.
 1.13  26-Aug-2003  tron Replaces space with tabs.
 1.12  22-Jul-2003  simonb Clean up autoconfiguration output a little.
 1.11  06-Jul-2003  tron Handle i865 and i875P chipsets like the i845. This works good enough to
make XFree86 work with agp(4) enabled on an i865PE motherboard.
 1.10  25-Jun-2003  ichiro branches: 1.10.2;
The problem which stops in the middle of booting was solved.

(kern/21843 Brian Stark <bpstark@pacbell.net>)
 1.9  14-Jun-2003  ichiro make compile
 1.8  14-Jun-2003  ichiro fix some bugs
 1.7  09-Jun-2003  ichiro fix bug report - xsrc/17810, kern/16898

add AGP configuration registers for i840/855PM, i840/i850E, 82443LX/BX/GX
Although there chips are well alike, but initialization and so on procedures differ.
 1.6  31-Jan-2003  thorpej Use aprint_*().
 1.5  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.4  13-Nov-2001  lukem add RCSID
 1.3  15-Sep-2001  thorpej branches: 1.3.2; 1.3.4;
Clean up the AGP match/attach code somewhat.
 1.2  11-Sep-2001  fvdl branches: 1.2.2;
Don't forget to install the pointer to the chip-specific chipc.
 1.1  10-Sep-2001  fvdl AGP GART support code. Originally written by Doug Rabson for FreeBSD,
modifications to fit it into the NetBSD device/config structure and
to use bus_dma by me.
 1.2.2.4  11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.2  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.2.1  11-Sep-2001  thorpej file agp_intel.c was added on branch kqueue on 2001-09-13 01:15:51 +0000
 1.3.4.2  01-Oct-2001  fvdl Catch up with -current.
 1.3.4.1  15-Sep-2001  fvdl file agp_intel.c was added on branch thorpej-devvp on 2001-10-01 12:45:51 +0000
 1.3.2.4  28-Feb-2002  nathanw Catch up to -current.
 1.3.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.3.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.3.2.1  15-Sep-2001  nathanw file agp_intel.c was added on branch nathanw_sa on 2001-09-21 22:35:53 +0000
 1.10.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1  03-Aug-2004  skrll Sync with HEAD
 1.14.14.1  14-Feb-2006  riz Pull up following revision(s) (requested by tron in ticket #1168):
sys/dev/pci/agp_i810.c: revision 1.28
sys/arch/i386/pci/pchb.c: revision 1.57
sys/dev/pci/agpvar.h: revision 1.11
sys/dev/pci/agp_via.c: revision 1.9
sys/dev/pci/agp.c: revision 1.37
sys/dev/pci/agpreg.h: revision 1.10
sys/dev/pci/pcidevs: revision 1.757
sys/dev/pci/agp_amd.c: revision 1.14
sys/dev/pci/agp_intel.c: revision 1.17
sys/dev/pci/agp_sis.c: revision 1.8
sys/dev/pci/agp_ali.c: revision 1.9
sys/arch/i386/pci/pchb_rnd.c: revision 1.16
PR/32550: Michael Eriksson: No agp(4) support for i915 integrated graphics
 1.15.2.8  17-Mar-2008  yamt sync with head.
 1.15.2.7  27-Feb-2008  yamt sync with head.
 1.15.2.6  21-Jan-2008  yamt sync with head
 1.15.2.5  15-Nov-2007  yamt sync with head.
 1.15.2.4  27-Oct-2007  yamt sync with head.
 1.15.2.3  03-Sep-2007  yamt sync with head.
 1.15.2.2  30-Dec-2006  yamt sync with head.
 1.15.2.1  21-Jun-2006  yamt sync with head.
 1.16.2.1  01-Feb-2006  yamt sync with head.
 1.17.8.1  19-Apr-2006  elad sync with head.
 1.17.6.1  13-Mar-2006  yamt sync with head.
 1.17.4.1  22-Apr-2006  simonb Sync with head.
 1.17.2.1  09-Sep-2006  rpaulo sync with head
 1.18.12.2  10-Dec-2006  yamt sync with head.
 1.18.12.1  22-Oct-2006  yamt sync with head
 1.18.10.1  18-Nov-2006  ad Sync with head.
 1.21.12.1  29-Mar-2007  reinoud Pullup to -current
 1.21.10.1  11-Jul-2007  mjf Sync with head.
 1.21.8.2  23-Oct-2007  ad Sync with head.
 1.21.8.1  10-Apr-2007  ad Sync with head.
 1.21.4.1  15-Apr-2007  yamt sync with head.
 1.22.14.2  13-Nov-2007  bouyer Sync with HEAD
 1.22.14.1  25-Oct-2007  bouyer Sync with HEAD.
 1.22.10.3  23-Mar-2008  matt sync with HEAD
 1.22.10.2  09-Jan-2008  matt sync with HEAD
 1.22.10.1  06-Nov-2007  matt sync with HEAD
 1.22.8.5  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.22.8.4  06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.22.8.3  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.22.8.2  01-Oct-2007  joerg Extend device API by device_power_private and device_power_set_private.
The latter is a temporary mean until the pnp_register API itself is
overhault. This functions allow a generic power handler to store its
state independent of the driver.

Use this and revamp the PCI power handling. Pretty much all PCI devices
had power handlers that did the same thing, generalize this in
pci_generic_power_register/deregister and the handler. This interface
offers callbacks for the drivers to save and restore state on
transistions. After a long discussion with jmcneill@ it was considered
to be powerful enough until evidence is shown that devices can handle
D1/D2 with less code and higher speed than without the full
save/restore. The generic code is carefully written to handle device
without PCI-PM support and ensure that the correct registers are written
to when D3 loses all state.

Reimplement the generic PCI network device handling on
top of PCI generic power handling.

Introduce pci_disable_retry as used and implemented locally at least by
ath(4) and iwi(4). Use it in this drivers to restore behaviour from
before the introduction of generic PCI network handling.

Convert all PCI drivers that were using pnp_register to the new
framework. The only exception is vga(4) as it is commonly used as
console device. Add a note therein that this should be fixed later.
 1.22.8.1  08-Aug-2007  jmcneill Add Intel (older version) AGP power management support.
 1.23.2.3  18-Feb-2008  mjf Sync with HEAD.
 1.23.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.23.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.24.4.1  11-Dec-2007  yamt sync with head.
 1.24.2.1  26-Dec-2007  ad Sync with head.
 1.25.2.2  08-Jan-2008  bouyer Sync with HEAD
 1.25.2.1  02-Jan-2008  bouyer Sync with HEAD
 1.28.6.3  29-Jun-2008  mjf Sync with HEAD.
 1.28.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.28.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.28.2.1  24-Mar-2008  keiichi sync with head.
 1.31.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.31.4.3  11-Aug-2010  yamt sync with head.
 1.31.4.2  11-Mar-2010  yamt sync with head
 1.31.4.1  04-May-2009  yamt sync with head.
 1.31.2.1  17-Jun-2008  yamt sync with head.
 1.32.8.1  20-Nov-2010  riz Pull up following revision(s) (requested by jakllsch in ticket #1362):
sys/dev/pci/pcidevs: revision 1.1026
sys/dev/pci/agp_intel.c: revision 1.35
sys/dev/pci/agp_i810.c: revision 1.67
Add Intel 82855GM Host-AGP Bridge.
regen
Add (non-IGP) AGP port support for Intel 82855GM.
agp_intel tested with radeondrm(4). agp_i810 tested with i915drm(4).
 1.33.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.34.2.3  21-Apr-2011  rmind sync with head
 1.34.2.2  05-Mar-2011  rmind sync with head
 1.34.2.1  30-May-2010  rmind sync with head
 1.36.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.37.56.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.56.1  10-Jun-2019  christos Sync with HEAD
 1.37.48.1  01-Aug-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1311):

sys/dev/pci/agp_intel.c: revision 1.38

fix a >15 year old code rework bug, and add a missing break;.

the code in rev 1.7 looks like it does in this change, but rev 1.8 would
write the I443 AGP_INTEL_AGPCTRL value, and then the other value.

RSS XML Feed