History log of /netbsd-current/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.56 02-Jun-2024 andvar

fix various typos in word `interrupt', mainly in comments.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
# 1.55 11-Oct-2021 rin

Fix workaround for SH-3 PCMCIA bug in accordance with description
found in TECH I vol. 14 (CQ Publishing, Tokyo, 2002, in Japanese),
as well as experiment on real hardware:

Byte-access to area 6 becomes word-access (both CE1# and CE2# are
wrongly asserted), if preceding access is word-wise. Inserting a
dummy byte-access works around the problem. Area 5 is not affected.

Therefore,

(1) Insert a dummy byte-read before all byte-wise operations.

(2) Restrict the workaround to area 6 (channel 0), and rename
fixup_sh3_pcmcia_area() to fixup_sh3_pcmcia_area6() for clarity.

Also, we used to use 0xba000000 (== HD64461_PCC0_IOBASE) as target
for the dummy read. However, this can modify device states, which
breaks ep(4) at least. Thus,

(3) Use HD64461_PCC0_MEMBASE as target for the dummy read. This is
assigned to attribute memory space, and byte-read should be
harmless.


Revision tags: thorpej-i2c-spi-conf2-base
# 1.54 07-Aug-2021 thorpej

Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.53 24-Apr-2021 thorpej

branches: 1.53.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?).


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.52 21-Nov-2020 thorpej

branches: 1.52.2;
malloc(9) -> kmem(9)


Revision tags: netbsd-8-3-RELEASE netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.51 09-Nov-2013 christos

branches: 1.51.42;
fix unused variable warnings


# 1.50 13-Oct-2013 riz

Catch up to recent changes in config_pending_{incr,decr}().


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.49 26-Jul-2011 dyoung

branches: 1.49.2; 1.49.12; 1.49.16;
Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.


# 1.48 20-Jul-2011 dyoung

Move macros _BUS_SPACE_WRITE(), _BUS_SPACE_WRITE_MULTI(), et
cetera, into <hpcsh/bus_util.h> for both hpcsh/bus_space.c and
dev/hd64461/hd64461pcmcia.c to use them.

(I haven't had a close look at what hd64461pcmcia.c is doing, but I have
a hunch that it is a good use for bus_space_tag_create(9).)


# 1.47 19-Jul-2011 dyoung

Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark hpcsh/bus.h obsolete.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 jym-xensuspend-base nick-hppapmap-base
# 1.46 05-Apr-2009 uwe

Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


# 1.45 21-Mar-2009 uwe

In the current code the even loop is never exited, but it's cleaner to
have explicit kthread_exit at the end of the event thread routine.


# 1.44 21-Mar-2009 uwe

Move channel attachment to event thread (we already have one, so it's
easier to do it there rather than mess with config_interrupts()).

From kiyohara@. Discussed with drochner@, who pointed out that pcmcia
drivers are expected to attach with interrupts enabled.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.43 28-Apr-2008 martin

branches: 1.43.8; 1.43.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.42 27-Mar-2008 uwe

branches: 1.42.2; 1.42.4;
Split device_t and softc.


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.41 17-Feb-2008 uwe

branches: 1.41.6;
Use aprint_*, device_xname.


# 1.40 17-Feb-2008 uwe

hd64461_set_bus_width - use named constants instead of bit shift magic.


Revision tags: vmlocking2-base3 bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.39 15-Dec-2007 perry

__FUNCTION__ -> __func__


Revision tags: yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.38 17-Oct-2007 garbled

branches: 1.38.2; 1.38.4; 1.38.8;
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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base vmlocking-base
# 1.37 11-Jul-2007 uwe

branches: 1.37.10;
Fix previous: sc_event_thread should be a pointer to lwp_t.


Revision tags: mjf-ufs-trans-base
# 1.36 09-Jul-2007 ad

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.35 03-Jan-2006 uwe

branches: 1.35.28; 1.35.30; 1.35.36;
Fix constification fallout under #ifdef HD64461PCMCIA_DEBUG.


# 1.34 03-Jan-2006 uwe

HD64461PCMCIA options now come from "opt_hd64461pcmcia.h".


# 1.33 18-Dec-2005 uwe

branches: 1.33.2;
Use ANSI uintN_t types. Propagate "static" to function definitions.


# 1.32 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.31 26-Aug-2005 drochner

s/locdesc_t/int/g


# 1.30 28-Jun-2005 drochner

branches: 1.30.2;
convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.29 11-Aug-2004 mycroft

Forget to reset to memory mode on power up.
The hd64465 looks a bit incomplete, but "not my problem".


# 1.28 11-Aug-2004 mycroft

Attempt to fix these up, but I have no way to test them.


# 1.27 14-Jul-2004 uch

enable to power off and reset card.


# 1.26 11-Jul-2004 uch

cosmetic changes. (whitespace,<tab>)


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.25 27-Mar-2004 uwe

When we attach a channel, set a high level to DRV control pin of the
external buffer for the PC card connected to the channel. This hack
makes pcmcia cards "being used" at the boot time (by WinCE or NetBSD)
correctly detected. A machine running with root on NFS can now be
properly rebooted.


# 1.24 27-Mar-2004 uwe

Add option HD64461PCMCIA_REORDER_ATTACH that attaches channels in
reversed order.

When you boot with two CF cards inserted, this options makes the one
in the "memory only" slot (channel 1), which is almost always the card
with the NetBSD install, attached as wd0.

Unlike using fixed unit numbers in the kernel config, if you boot with
only a single CF card, that single card will still be wd0 regardless
of which slot it is inserted in.

http://mail-index.netbsd.org/port-hpcsh/2003/10/23/0000.html provides
a more verbose description of why this option is convenient for most
usage patterns.


# 1.23 23-Oct-2003 uwe

In hd64461pcmcia_chip_io_map set *windowp to 0.

This driver ignores i/o window handle, but most 'at pcmcia'
attachments init their sc_io_window to -1 and then check at detach
time if it was changed from the "bad" value. Keep them happy, so that
they can correctly clean up when card is detached.


# 1.22 15-Jul-2003 lukem

__KERNEL_RCSID()


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.21 01-Jan-2003 thorpej

branches: 1.21.2;
Use aprint_normal() for cfprint routines.


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.20 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL


# 1.19 01-Oct-2002 thorpej

Use CFATTACH_DECL().


# 1.18 27-Sep-2002 thorpej

Declare all cfattach structures const.


# 1.17 27-Sep-2002 thorpej

Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.


Revision tags: gehenna-devsw-base
# 1.16 01-Jun-2002 lukem

branches: 1.16.2;
SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.15 28-Mar-2002 uch

branches: 1.15.2;
rework HD64461, HD64465 interrupt handling.


Revision tags: eeh-devprop-base newlock-base
# 1.14 03-Mar-2002 uch

platform dependent HD64461 PCMCIA module (power supply).


Revision tags: ifpoll-base
# 1.13 28-Feb-2002 uch

Cleanup register definition


# 1.12 17-Feb-2002 uch

SH3/SH4 common kernel support.


# 1.11 11-Feb-2002 uch

{} -> do {} (0)


# 1.10 29-Jan-2002 uch

clean up debug print and configuration.


# 1.9 27-Jan-2002 uch

clean up debug print and configuration.


# 1.8 15-Dec-2001 soren

To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.7 08-Oct-2001 uch

HITACHI PERSONA support. patch by KIYOHARA Takashi


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.6 13-Jul-2001 uch

branches: 1.6.2;
cosmetic changes.


# 1.5 13-Jul-2001 uch

fix interrupt, voltage supply bug of channel 1.
(patch by Masanori Kanaoka).


# 1.4 04-Jul-2001 uch

branches: 1.4.2;
#ifdef notyet power on/off sequence code. it doesn't work.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.3 15-Mar-2001 uch

HD64461 UART module support.


# 1.2 08-Mar-2001 uch

branches: 1.2.2;
channel 1 interface don't provide fake pcmcia io space tag.


# 1.1 21-Feb-2001 uch

branches: 1.1.2;
HD64461 driver (SH3 companion chip for Windows CE)


# 1.55 11-Oct-2021 rin

Fix workaround for SH-3 PCMCIA bug in accordance with description
found in TECH I vol. 14 (CQ Publishing, Tokyo, 2002, in Japanese),
as well as experiment on real hardware:

Byte-access to area 6 becomes word-access (both CE1# and CE2# are
wrongly asserted), if preceding access is word-wise. Inserting a
dummy byte-access works around the problem. Area 5 is not affected.

Therefore,

(1) Insert a dummy byte-read before all byte-wise operations.

(2) Restrict the workaround to area 6 (channel 0), and rename
fixup_sh3_pcmcia_area() to fixup_sh3_pcmcia_area6() for clarity.

Also, we used to use 0xba000000 (== HD64461_PCC0_IOBASE) as target
for the dummy read. However, this can modify device states, which
breaks ep(4) at least. Thus,

(3) Use HD64461_PCC0_MEMBASE as target for the dummy read. This is
assigned to attribute memory space, and byte-read should be
harmless.


Revision tags: thorpej-i2c-spi-conf2-base
# 1.54 07-Aug-2021 thorpej

Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.53 24-Apr-2021 thorpej

branches: 1.53.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?).


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.52 21-Nov-2020 thorpej

branches: 1.52.2;
malloc(9) -> kmem(9)


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.51 09-Nov-2013 christos

branches: 1.51.42;
fix unused variable warnings


# 1.50 13-Oct-2013 riz

Catch up to recent changes in config_pending_{incr,decr}().


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.49 26-Jul-2011 dyoung

branches: 1.49.2; 1.49.12; 1.49.16;
Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.


# 1.48 20-Jul-2011 dyoung

Move macros _BUS_SPACE_WRITE(), _BUS_SPACE_WRITE_MULTI(), et
cetera, into <hpcsh/bus_util.h> for both hpcsh/bus_space.c and
dev/hd64461/hd64461pcmcia.c to use them.

(I haven't had a close look at what hd64461pcmcia.c is doing, but I have
a hunch that it is a good use for bus_space_tag_create(9).)


# 1.47 19-Jul-2011 dyoung

Change <machine/bus.h> to <sys/bus.h> throughout.

Split bus.h -> bus_{defs,funcs}.h.

Mark hpcsh/bus.h obsolete.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 jym-xensuspend-base nick-hppapmap-base
# 1.46 05-Apr-2009 uwe

Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


# 1.45 21-Mar-2009 uwe

In the current code the even loop is never exited, but it's cleaner to
have explicit kthread_exit at the end of the event thread routine.


# 1.44 21-Mar-2009 uwe

Move channel attachment to event thread (we already have one, so it's
easier to do it there rather than mess with config_interrupts()).

From kiyohara@. Discussed with drochner@, who pointed out that pcmcia
drivers are expected to attach with interrupts enabled.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.43 28-Apr-2008 martin

branches: 1.43.8; 1.43.14;
Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.42 27-Mar-2008 uwe

branches: 1.42.2; 1.42.4;
Split device_t and softc.


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.41 17-Feb-2008 uwe

branches: 1.41.6;
Use aprint_*, device_xname.


# 1.40 17-Feb-2008 uwe

hd64461_set_bus_width - use named constants instead of bit shift magic.


Revision tags: vmlocking2-base3 bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.39 15-Dec-2007 perry

__FUNCTION__ -> __func__


Revision tags: yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.38 17-Oct-2007 garbled

branches: 1.38.2; 1.38.4; 1.38.8;
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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base vmlocking-base
# 1.37 11-Jul-2007 uwe

branches: 1.37.10;
Fix previous: sc_event_thread should be a pointer to lwp_t.


Revision tags: mjf-ufs-trans-base
# 1.36 09-Jul-2007 ad

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 yamt-idlelwp-base8 wrstuden-fixsa-base thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.35 03-Jan-2006 uwe

branches: 1.35.28; 1.35.30; 1.35.36;
Fix constification fallout under #ifdef HD64461PCMCIA_DEBUG.


# 1.34 03-Jan-2006 uwe

HD64461PCMCIA options now come from "opt_hd64461pcmcia.h".


# 1.33 18-Dec-2005 uwe

branches: 1.33.2;
Use ANSI uintN_t types. Propagate "static" to function definitions.


# 1.32 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.31 26-Aug-2005 drochner

s/locdesc_t/int/g


# 1.30 28-Jun-2005 drochner

branches: 1.30.2;
convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.29 11-Aug-2004 mycroft

Forget to reset to memory mode on power up.
The hd64465 looks a bit incomplete, but "not my problem".


# 1.28 11-Aug-2004 mycroft

Attempt to fix these up, but I have no way to test them.


# 1.27 14-Jul-2004 uch

enable to power off and reset card.


# 1.26 11-Jul-2004 uch

cosmetic changes. (whitespace,<tab>)


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.25 27-Mar-2004 uwe

When we attach a channel, set a high level to DRV control pin of the
external buffer for the PC card connected to the channel. This hack
makes pcmcia cards "being used" at the boot time (by WinCE or NetBSD)
correctly detected. A machine running with root on NFS can now be
properly rebooted.


# 1.24 27-Mar-2004 uwe

Add option HD64461PCMCIA_REORDER_ATTACH that attaches channels in
reversed order.

When you boot with two CF cards inserted, this options makes the one
in the "memory only" slot (channel 1), which is almost always the card
with the NetBSD install, attached as wd0.

Unlike using fixed unit numbers in the kernel config, if you boot with
only a single CF card, that single card will still be wd0 regardless
of which slot it is inserted in.

http://mail-index.netbsd.org/port-hpcsh/2003/10/23/0000.html provides
a more verbose description of why this option is convenient for most
usage patterns.


# 1.23 23-Oct-2003 uwe

In hd64461pcmcia_chip_io_map set *windowp to 0.

This driver ignores i/o window handle, but most 'at pcmcia'
attachments init their sc_io_window to -1 and then check at detach
time if it was changed from the "bad" value. Keep them happy, so that
they can correctly clean up when card is detached.


# 1.22 15-Jul-2003 lukem

__KERNEL_RCSID()


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.21 01-Jan-2003 thorpej

branches: 1.21.2;
Use aprint_normal() for cfprint routines.


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.20 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL


# 1.19 01-Oct-2002 thorpej

Use CFATTACH_DECL().


# 1.18 27-Sep-2002 thorpej

Declare all cfattach structures const.


# 1.17 27-Sep-2002 thorpej

Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.


Revision tags: gehenna-devsw-base
# 1.16 01-Jun-2002 lukem

branches: 1.16.2;
SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.15 28-Mar-2002 uch

branches: 1.15.2;
rework HD64461, HD64465 interrupt handling.


Revision tags: eeh-devprop-base newlock-base
# 1.14 03-Mar-2002 uch

platform dependent HD64461 PCMCIA module (power supply).


Revision tags: ifpoll-base
# 1.13 28-Feb-2002 uch

Cleanup register definition


# 1.12 17-Feb-2002 uch

SH3/SH4 common kernel support.


# 1.11 11-Feb-2002 uch

{} -> do {} (0)


# 1.10 29-Jan-2002 uch

clean up debug print and configuration.


# 1.9 27-Jan-2002 uch

clean up debug print and configuration.


# 1.8 15-Dec-2001 soren

To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.


Revision tags: thorpej-mips-cache-base thorpej-devvp-base3
# 1.7 08-Oct-2001 uch

HITACHI PERSONA support. patch by KIYOHARA Takashi


Revision tags: thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.6 13-Jul-2001 uch

branches: 1.6.2;
cosmetic changes.


# 1.5 13-Jul-2001 uch

fix interrupt, voltage supply bug of channel 1.
(patch by Masanori Kanaoka).


# 1.4 04-Jul-2001 uch

branches: 1.4.2;
#ifdef notyet power on/off sequence code. it doesn't work.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.3 15-Mar-2001 uch

HD64461 UART module support.


# 1.2 08-Mar-2001 uch

branches: 1.2.2;
channel 1 interface don't provide fake pcmcia io space tag.


# 1.1 21-Feb-2001 uch

branches: 1.1.2;
HD64461 driver (SH3 companion chip for Windows CE)