Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/hp300/dev/dma.c
RevisionDateAuthorComments
 1.48  30-Apr-2024  tsutsui Fix another fatal typo that prevents dma(4) interrupts.
 1.47  16-Jan-2024  thorpej Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on aaaancient HP320 Rev A DMA boards. To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).
 1.46  16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.45  15-Jan-2023  tsutsui TAB/space cleanup.
 1.44  06-Sep-2021  andvar branches: 1.44.4;
fix typos in word "segment" and two additional typos in if_tl.c.
 1.43  06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.42  22-Jun-2008  tsutsui branches: 1.42.16; 1.42.18;
Don't recompute an ipl level for IPL_VM during or after cpu_configure(9)
and use a static and possible highest ipl value (ipl 5) for IPL_VM
so that we can put ipl2psl_table[] conversion into makeiplcookie(9),
which could be called before cpu_configure(9).

Fixes "panic: sbappendaddr" on NFS load.
 1.41  15-Jun-2008  tsutsui Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k.

For hp300:
- use ipl2psl_table[] for makeiplcookie() conversion
- use uint16_t for ipl2psl_table[]
 1.40  28-Apr-2008  martin branches: 1.40.2; 1.40.4;
Remove clause 3 and 4 from TNF licenses
 1.39  29-Mar-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc, and misc cosmetic changes.
 1.38  05-Dec-2007  tsutsui branches: 1.38.12;
Use queue(3) macro.
 1.37  17-Oct-2007  garbled branches: 1.37.2; 1.37.4;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.36  12-Jul-2007  he branches: 1.36.8; 1.36.10;
Adapt to new signature for callout_init().
 1.35  21-Dec-2006  yamt branches: 1.35.6; 1.35.14;
merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.34  21-Jul-2006  tsutsui branches: 1.34.4; 1.34.6;
Some KNF.
 1.33  11-Dec-2005  christos branches: 1.33.4; 1.33.8;
merge ktrace-lwp.
 1.32  03-Jun-2005  tsutsui branches: 1.32.2;
Replace badbaddr() with hp300_bus_space_probe() to avoid -Wcast-qual warning.
 1.31  28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.30  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.29  01-Apr-2003  thorpej branches: 1.29.2;
Use PAGE_SIZE rather than NBPG.
 1.28  22-Dec-2002  gmcgarry Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.27  20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.26  15-Mar-2002  gmcgarry Add RCSIDs.
 1.25  23-Mar-2000  thorpej branches: 1.25.8; 1.25.12;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.24  01-Aug-1999  thorpej branches: 1.24.2;
Store computed PSL values in an array indexed by abstract interrupt
level, rather than individual shortwords.
 1.23  20-Aug-1998  kleink branches: 1.23.8;
vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.22  24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.21  23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.20  04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.19  05-May-1997  thorpej branches: 1.19.4;
Do a bit of spring cleaning.
 1.18  27-Apr-1997  thorpej Use information provided by <machine/hp300spu.h> to determine if we
might have a physical address cache.
 1.17  14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.16  06-Apr-1997  mycroft Fix some #ifdef lossage if HP340, HP360, or HP375 is defined, but HP370 is not.
 1.15  02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.14  01-Apr-1997  scottr Add prototypes, and make this compile with -Wall.
 1.13  31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.12  31-Jan-1997  carrel Make "options HP340" actually work without having "option HP360".
 1.11  30-Jan-1997  thorpej - Use indicies, rather than pointer arithmetic, to track DMA chain
segments.
- Use a much more obvious DMA job queueing scheme.
- Fixup some debugging code.
 1.10  09-Dec-1996  thorpej Defer hooking up the DMA controller interrupt. Add a new funciton,
dmacomputeipl(), which is called by drivers which use DMA once they've
hooked up their interrupts. This new function computes the appropriate
ipl to use for the DMA controller and (re-)establishes it's interrupt.
 1.9  13-Oct-1996  christos backout previous kprintf changes
 1.8  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7  14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.6  02-Dec-1995  thorpej Make the DMA controller driver a little more new config-friendly. Still
more work to do, but this is a step in the right direction.
 1.5  26-Oct-1994  cgd new RCS ID format.
 1.4  23-May-1994  mycroft Merge with 4.4-Lite.
 1.3  05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.2  01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1  13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.19.4.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.8.1  02-Aug-1999  thorpej Update from trunk.
 1.24.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.25.12.3  29-Dec-2002  thorpej Sync with HEAD.
 1.25.12.2  11-Nov-2002  nathanw Catch up to -current
 1.25.12.1  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.25.8.1  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.29.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.29.2.2  03-Sep-2004  skrll Sync with HEAD
 1.29.2.1  03-Aug-2004  skrll Sync with HEAD
 1.32.2.3  07-Dec-2007  yamt sync with head
 1.32.2.2  03-Sep-2007  yamt sync with head.
 1.32.2.1  30-Dec-2006  yamt sync with head.
 1.33.8.1  11-Aug-2006  yamt sync with head
 1.33.4.1  09-Sep-2006  rpaulo sync with head
 1.34.6.1  06-Oct-2006  tsutsui Reorganize IPL macros for proper splraiseipl() implementation:
- merge HP300_IPL_* and IPL_* macros
- prepare independent _IPL_SOFT_* macro to determine softintr(9) handlers
- rename hp300_ipls[] array to hp300_ipl2psl[]
- then use these macro for makeiplcookie() and splraiseipl()
Tested on HP382.
 1.34.4.1  12-Jan-2007  ad Sync with head.
 1.35.14.1  03-Oct-2007  garbled Sync with HEAD
 1.35.6.1  15-Jul-2007  ad Sync with head.
 1.36.10.2  09-Jan-2008  matt sync with HEAD
 1.36.10.1  06-Nov-2007  matt sync with HEAD
 1.36.8.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.37.4.1  08-Dec-2007  ad Sync with head.
 1.37.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.38.12.3  29-Jun-2008  mjf Sync with HEAD.
 1.38.12.2  02-Jun-2008  mjf Sync with HEAD.
 1.38.12.1  03-Apr-2008  mjf Sync with HEAD.
 1.39.4.3  11-Aug-2010  yamt sync with head.
 1.39.4.2  04-May-2009  yamt sync with head.
 1.39.4.1  16-May-2008  yamt sync with head.
 1.39.2.2  17-Jun-2008  yamt sync with head.
 1.39.2.1  18-May-2008  yamt sync with head.
 1.40.4.2  27-Jun-2008  simonb Sync with head.
 1.40.4.1  18-Jun-2008  simonb Sync with head.
 1.40.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.42.18.1  03-Jul-2010  rmind sync with head
 1.42.16.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.44.4.1  22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.

RSS XML Feed