Home | History | Annotate | Download | only in isa
History log of /src/sys/arch/atari/isa/isa_machdep.c
RevisionDateAuthorComments
 1.43  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42  24-Apr-2021  thorpej branches: 1.42.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.41  20-Jan-2018  tsutsui branches: 1.41.18;
Fix silent hang during config_console() (before consinit()) on Milan.

config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.
 1.40  13-Oct-2012  jdc branches: 1.40.30;
Adapt to the changed signature of pckbc_cnattach().
 1.39  01-Jul-2011  dyoung branches: 1.39.2; 1.39.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.38  10-Jun-2011  tsutsui Split device_t/softc. Compile test only.
 1.37  13-Apr-2010  tsutsui branches: 1.37.6;
Misc KNF.
 1.36  23-Aug-2009  mrg branches: 1.36.2; 1.36.4;
fix atari builds in two ways:
- isa_detach_hook() was missing a parameter name (hi dyoung!)
- PCI_CONF_SIZE -> PCI_CONFIG_SIZE; pcivar.h has a PCI_CONF_SIZE now (hi jak!)
 1.35  19-Aug-2009  dyoung isa_detach_hook() needs two arguments, the first an isa_chipset_tag_t.
 1.34  18-Aug-2009  dyoung These are stragglers from my last commit ("Let us safely detach
the ISA bus and devices attaching to the ISA bus"). Define
isa_detach_hook() in MD ISA implementations. Define isa_dmadestroy().
 1.33  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.32  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.31  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.30  24-Jan-2007  hubertf branches: 1.30.48; 1.30.56; 1.30.62;
Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
 1.29  11-Dec-2005  christos branches: 1.29.20;
merge ktrace-lwp.
 1.28  30-Aug-2004  drochner branches: 1.28.12;
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.27  15-Jul-2003  lukem __KERNEL_RCSID()
 1.26  08-Dec-2002  leo branches: 1.26.6;
Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.25  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.24  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.23  14-May-2001  leo branches: 1.23.2; 1.23.8;
Allow attachment of a pc-keyboard at console attach time.
 1.22  24-Apr-2001  leo Split the ISA common attachment stuff and the interrupt handling.
There are too many differences between the Hades and Milan in this area.
 1.21  09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.20  07-Jan-2001  leo branches: 1.20.2;
Nuke a cf_unit abuse.
 1.19  29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18  26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.17  04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.16  19-Jan-2000  leo branches: 1.16.2;
Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.15  23-Nov-1999  leo Correct the test for a free-slot for isa_intr_alloc(). Also issue a warning
that should make it clear in which slot the card is expected to be in.
Isapnp is not what it seems to be on the atari (where interrupts are
hardwired to slot numbers).
 1.14  21-Oct-1999  leo Implement at least a bit of isa_intr_alloc().
 1.13  06-Aug-1999  leo branches: 1.13.2; 1.13.4; 1.13.6;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.12  08-Jan-1999  leo Return NULL when trying to establish a non-EDGE_TRIGGERED interrupt.
This can be used by drivers to choose another type. Currently used in
isnd4bsd.
 1.11  26-Nov-1998  leo Check-point work on isa-interrupt handling
 1.10  15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.9  11-Jun-1998  leo Fix typo.
 1.8  09-Jun-1998  thorpej Provide an isa_chipset_tag_t to the ISA bus device.
 1.7  25-May-1998  leo Fix some severe bogons in the pci and isa interrupt system.
 1.6  22-Apr-1998  leo Fix prototype of interrupt function.
 1.5  10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.4  10-Mar-1998  leo Bus-dma implementation for the atari. Heavily based on the i386
implementation.
 1.3  12-Jan-1998  thorpej Update for changes to config.
 1.2  27-Aug-1997  leo Number the slots 0&1 instead of 1&2 .
 1.1  15-Jul-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1  15-Jul-1997  leo branches: 1.1.1.1.2;
isabus support
 1.1.1.1.2.1  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.4.1  15-Nov-1999  fvdl Sync with -current
 1.13.2.3  12-Mar-2001  bouyer Sync with HEAD.
 1.13.2.2  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.13.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.16.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.20.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.23.8.3  11-Dec-2002  thorpej Sync with HEAD.
 1.23.8.2  18-Oct-2002  nathanw Catch up to -current.
 1.23.8.1  14-May-2001  nathanw file isa_machdep.c was added on branch nathanw_sa on 2002-10-18 02:35:58 +0000
 1.23.2.1  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.26.6.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.6.3  18-Sep-2004  skrll Sync with HEAD.
 1.26.6.2  03-Sep-2004  skrll Sync with HEAD
 1.26.6.1  03-Aug-2004  skrll Sync with HEAD
 1.28.12.1  26-Feb-2007  yamt sync with head.
 1.29.20.1  01-Feb-2007  ad Sync with head.
 1.30.62.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.56.1  28-Apr-2009  skrll Sync with HEAD.
 1.30.48.4  11-Aug-2010  yamt sync with head.
 1.30.48.3  16-Sep-2009  yamt sync with head
 1.30.48.2  19-Aug-2009  yamt sync with head.
 1.30.48.1  04-May-2009  yamt sync with head.
 1.36.4.2  12-Jun-2011  rmind sync with head
 1.36.4.1  30-May-2010  rmind sync with head
 1.36.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.37.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.39.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.39.2.1  30-Oct-2012  yamt sync with head
 1.40.30.1  13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.41.18.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.42.8.1  03-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed