Home | History | Annotate | Download | only in include
History log of /src/sys/arch/mipsco/include/bus.h
RevisionDateAuthorComments
 1.28  27-Apr-2025  tsutsui Use proper uintNN_t integer types.
 1.27  26-Apr-2025  tsutsui Unbreak bus_dmamem_map for mipsco.

Patch is sent from Miod Vallat:
> The switch to common code in 2009 did not account for private fields in
> bus_dma_segment_t, which are now left uninitialized but were relied upon
> by bus_dmamem_map().
>
> Remove these fields as their values were trivial to compute from the MI
> fields.
>
> This gives Ethernet and SCSI a chance to work again on this platform.

"switch to common code in 2009" was the following commit:
https://mail-index.netbsd.org/source-changes/2009/08/21/msg224405.html

We should eventually switch to the common mips bus_dma and it still
requires private _ds_vaddr for VIPT cache in MIPS3 case, but for now
his priority is to unbreak the code before attempting to improve it.

Note it looks the private _ds_paddr for mipsco was also pulled from
NetBSD/arc, where DMA address != physical address on jazzio devices.
 1.26  20-Jul-2024  andvar fix typos in comments, mainly s/harware/hardware/.
 1.25  08-Dec-2023  thorpej Excise extent(9) from the mipsco bus_space -- it was completely unused,
so let's make the code smaller.
 1.24  08-Oct-2023  andvar Update __BS_TYPENAME(BITS) macro to combine uint type instead of u_int.
Constify bus_space_write_multi one of params.
Remove unused ic_intr property from mipsco_isa_chipset struct.
Add __INTR_PRIVATE definition to mipsco isa_machdep.c.

Fixes RC3230 mipsco kernel config (w/o KGDB option, will be addressed later).
 1.23  23-Apr-2021  skrll branches: 1.23.16;
Use sys/cdefs.h __CONCAT3
 1.22  23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.21  12-Feb-2012  matt branches: 1.21.48;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.20  14-Mar-2009  dsl branches: 1.20.12; 1.20.16;
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.19  28-Apr-2008  martin branches: 1.19.8; 1.19.14;
Remove clause 3 and 4 from TNF licenses
 1.18  04-Mar-2007  christos branches: 1.18.40; 1.18.42; 1.18.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17  21-Feb-2007  mrg add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
bus_addr_t min_addr,
bus_addr_t max_addr,
bus_dma_tag_t *newtag,
int flags)
void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to. this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
 1.16  26-May-2006  tsutsui branches: 1.16.12;
Tweak bus_space_barrier(9) macro to appease
"left-hand operand of comma expression has no effect"
warnings by gcc4.
 1.15  16-Feb-2006  perry branches: 1.15.2; 1.15.8;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.14  24-Dec-2005  perry branches: 1.14.2; 1.14.4; 1.14.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.13  11-Dec-2005  christos merge ktrace-lwp.
 1.12  09-Mar-2005  matt branches: 1.12.4;
Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.11  15-Jun-2003  fvdl branches: 1.11.2; 1.11.10; 1.11.12;
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.10  28-Jan-2003  kent Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it.
 1.9  17-Mar-2002  simonb Make sure that private DMA flags don't overlap with standard DMA flags;
start these at 0x10000 to leave room for an increase in the latter.
 1.8  14-Nov-2001  thorpej branches: 1.8.2;
Merge the thorpej-mips-cache branch onto the trunk. This is an
overhaul of how caches are handled for NetBSD's MIPS ports.
 1.7  15-Sep-2001  wdk branches: 1.7.2;
bus_space_mmap support based on -arc implementation
 1.6  19-Jul-2001  thorpej branches: 1.6.2;
Add BUS_DMA_READ and BUS_DMA_WRITE flags, that hint the back-end
at dmamap load time that the mapping will be used for a unidirectional
transfer of the specified direction.
 1.5  30-Mar-2001  wdk branches: 1.5.2;
Re-implement bus_space(9) functions:
- Correctly handle striding of data
- Better support for endian neutral access
- Correctly implement _stream variants of bus_space functions that can
byte swap. This reverses the automatic byte swapping done in hardware
for 16 bit ISA bus cards
 1.4  07-Mar-2001  thorpej Add the BUS_DMA_STREAMING flag.
 1.3  04-Sep-2000  wdk branches: 1.3.2; 1.3.4;
Add wbflush() to bus_space_{write_multi,write_region,set_region,copy_region}
functions
 1.2  15-Aug-2000  wdk * Tidy up interrupt handlers by implementing an intr_establish()
handler to hook up device interrupts and softc callbacks.

Suggested by: Jason Thorpe and Toru Nishimura

* Fixup the indenting in a few places to conform to NetBSD style
 1.1  12-Aug-2000  wdk Initial commit of port to MIPS Computer Systems RC3xxx systems.
Currently supports the RC3230
 1.3.4.1  09-Apr-2001  nathanw Catch up with -current.
 1.3.2.4  21-Apr-2001  bouyer Sync with HEAD
 1.3.2.3  12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.2  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.3.2.1  04-Sep-2000  bouyer file bus.h was added on branch thorpej_scsipi on 2000-11-20 20:14:02 +0000
 1.5.2.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1  03-Aug-2001  lukem update to -current
 1.6.2.1  01-Oct-2001  fvdl Catch up with -current.
 1.7.2.1  13-Nov-2001  thorpej Make the mipsco port compile with the thorpej-mips-cache branch.
 1.8.2.2  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.1  14-Nov-2001  nathanw file bus.h was added on branch nathanw_sa on 2002-04-01 07:41:16 +0000
 1.11.12.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.10.1  29-Apr-2005  kent sync with -current
 1.11.2.1  01-Apr-2005  skrll Sync with HEAD.
 1.12.4.3  03-Sep-2007  yamt sync with head.
 1.12.4.2  26-Feb-2007  yamt sync with head.
 1.12.4.1  21-Jun-2006  yamt sync with head.
 1.14.6.2  01-Jun-2006  kardel Sync with head.
 1.14.6.1  22-Apr-2006  simonb Sync with head.
 1.14.4.1  09-Sep-2006  rpaulo sync with head
 1.14.2.1  18-Feb-2006  yamt sync with head.
 1.15.8.1  19-Jun-2006  chap Sync with head.
 1.15.2.1  26-Jun-2006  yamt sync with head.
 1.16.12.2  12-Mar-2007  rmind Sync with HEAD.
 1.16.12.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.18.44.2  04-May-2009  yamt sync with head.
 1.18.44.1  16-May-2008  yamt sync with head.
 1.18.42.1  18-May-2008  yamt sync with head.
 1.18.40.1  02-Jun-2008  mjf Sync with HEAD.
 1.19.14.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.8.1  28-Apr-2009  skrll Sync with HEAD.
 1.20.16.1  18-Feb-2012  mrg merge to -current.
 1.20.12.1  17-Apr-2012  yamt sync with head
 1.21.48.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.23.16.1  09-May-2025  martin Pull up following revision(s) (requested by tsutsui in ticket #1107):

sys/arch/mipsco/mipsco/bus_dma.c: revision 1.32
sys/arch/mipsco/include/bus.h: revision 1.27

Unbreak bus_dmamem_map for mipsco.

Patch is sent from Miod Vallat:
The switch to common code in 2009 did not account for private fields in
bus_dma_segment_t, which are now left uninitialized but were relied upon
by bus_dmamem_map().
Remove these fields as their values were trivial to compute from the MI
fields.

This gives Ethernet and SCSI a chance to work again on this platform.
"switch to common code in 2009" was the following commit:

https://mail-index.netbsd.org/source-changes/2009/08/21/msg224405.html

We should eventually switch to the common mips bus_dma and it still
requires private _ds_vaddr for VIPT cache in MIPS3 case, but for now
his priority is to unbreak the code before attempting to improve it.

Note it looks the private _ds_paddr for mipsco was also pulled from
NetBSD/arc, where DMA address != physical address on jazzio devices.

RSS XML Feed