History log of /freebsd-9.3-release/sys/dev/atkbdc/atkbdc.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 216592 20-Dec-2010 tijl

Merge amd64 and i386 bus.h and move the resulting header to x86. Replace
the original amd64 and i386 headers with stubs.

Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere.

Reviewed by: imp (previous version), jhb
Approved by: kib (mentor)


# 207354 29-Apr-2010 sobomax

On certain chipsets AT keyboard controller isn't present and is
emulated by BIOS using SMI interrupt. On those chipsets reading
from the status port may be thousand times slower than usually.
Sometimes this emilation is not working properly resulting in
commands timing out and since we assume that inb() operation
takes very little time to complete we need to adjust number of
retries to keep waiting time within a designed limits (100ms).
Measure time it takes to make read_status() call and adjust
number of retries accordingly.

To keep it simple, use TSC to measure inb() performance and
keep it to amd64-only, since TSC may not available on older
CPUs.

Also enable detection of the AT controller absence on amd64.

Reviewed by: jhb
MFC after: 1 month


# 161969 03-Sep-2006 dwhite

Avoid an infinite loop in empty_both_buffers() by adding a timeout.
This helps systems that don't actually have atkbd controllers, such as the Intel
SBX82 blade, boot without device.hints hacks.

Hardware for this fix provided by iXsystems.

PR: 94822
Submitted by: Devon H. O'Dell <devon.odell@coyotepoint.com>
MFC After: 3 days


# 158471 12-May-2006 jhb

Remove various bits of conditional Alpha code and fixup a few comments.


# 158041 26-Apr-2006 sobomax

Use the same method for detecting actual presence of AT-style keyboard
controller as we use in boot blocks (querying status register until
bit 1 goes off). If that doesn't happed during reasonable period assume
that the hardware doesn't have AT-style keyboard controller. This makes
FreeBSD working almost OOB on MacBook Pro (still there are issues with
putting second CPU core on-line, but since installation CD comes with
UP kernel with this change one should be able to install FreeBSD without
playing tricks with hints). Other legacy-free hardware (e.g. IBM NetVista
S40) should benefit from this as well, but since I don't have any I can't
verify.

It should make no difference on the ordinary i386 hardware (since in
that case that hardware already would be having an issues with A20
routines in boot blocks). I don't know much about AT-style keyboard
controller on other platforms (and don't have dedicated access to one),
therefore, the code is restricted to i386 for now. I suspect that amd64
may need this as well, but I would rather leave this decision to someone
who knows better about the platform(s) in question.

I have tested this change on as many "ordinary i386 boxes" as I can get
my hands on, and it doesn't create any false negatives on hardware with
AT-style keyboard present.

MFC after: 1 month


# 153072 04-Dec-2005 ru

Fix -Wundef.


# 147271 10-Jun-2005 marius

- Hook up the new locations of the atkbdc(4), atkbd(4) and psm(4) source
files after they were repo-copied to sys/dev/atkbdc. The sources of
atkbdc(4) and its children were moved to the new location in preparation
for adding an EBus front-end to atkbdc(4) for use on sparc64; i.e. in
order to not further scatter them over the whole tree which would have
been the result of adding atkbdc_ebus.c in e.g. sys/sparc64/ebus. Another
reason for the repo-copies was that some of the sources were misfiled,
e.g. sys/isa/atkbd_isa.c wasn't ISA-specific at all but for hanging
atkbd(4) off of atkbdc(4) and was renamed to atkbd_atkbdc.c accordingly.
Most of sys/isa/psm.c, i.e. expect for its PSMC PNP part, also isn't
ISA-specific.
- Separate the parts of atkbdc_isa.c which aren't actually ISA-specific
but are shareable between different atkbdc(4) bus front-ends into
atkbdc_subr.c (repo-copied from atkbdc_isa.c). While here use
bus_generic_rl_alloc_resource() and bus_generic_rl_release_resource()
respectively in atkbdc_isa.c instead of rolling own versions.
- Add sparc64 MD bits to atkbdc(4) and atkbd(4) and an EBus front-end for
atkbdc(4). PS/2 controllers and input devices are used on a couple of
Sun OEM boards and occur on either the EBus or the ISA bus. Depending on
the board it's either the only on-board mean to connect a keyboard and
mouse or an alternative to either RS232 or USB devices.
- Wrap the PSMC PNP part of psm.c in #ifdef DEV_ISA so it can be compiled
without isa(4) (e.g. for EBus-only machines). This ISA-specific part
isn't separated into its own source file, yet, as it requires more work
than was feasible for 6.0 in order to do it in a clean way. Actually
philip@ is working on a rewrite of psm(4) so a more comprehensive
clean-up and separation of hardware dependent and independent parts is
expected to happen after 6.0.

Tested on: i386, sparc64 (AX1105, AXe and AXi boards)
Reviewed by: philip


# 147263 10-Jun-2005 marius

Forced commit to denote that the following repo-copies have taken place:

sys/dev/kbd/atkbd.c -> sys/dev/atkbdc/atkbd.c
sys/dev/kbd/atkbdc.c -> sys/dev/atkbdc/atkbdc.c
sys/dev/kbd/atkbdcreg.h -> sys/dev/atkbdc/atkbdcreg.h
sys/dev/kbd/atkbdreg.h -> sys/dev/atkbdc/atkbdreg.h
sys/isa/atkbd_isa.c -> sys/dev/atkbdc/atkbd_atkbdc.c
sys/isa/atkbdc_isa.c -> sys/dev/atkbdc/atkbdc_isa.c
sys/isa/atkbdc_isa.c -> sys/dev/atkbdc/atkbdc_subr.c
sys/isa/psm.c -> sys/dev/atkbdc/psm.c

Repo-copies done by: markm


# 146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


# 144768 07-Apr-2005 sobomax

Backout previous diffs - this functionality is already provided by the
hints to the atkbd(4).

PR:
Submitted by: jhb


# 144753 07-Apr-2005 sobomax

Make previous commit actually working by replacing TUNABLE_INT() with
TUNABLE_INT_FETCH(). Apparently keyboard init is performed earlier
in the boot process than fetching all static tunables.

MFC after: 1 day


# 144749 07-Apr-2005 sobomax

Provide a new tunable hw.atkbdc.broken_kit_cmd, which if set to 1
instructs the driver to avoid using Keyboard Interface Test command.
This command causes problems with some non-compliant hardware, resulting
in machine being abruptly powered down early in the boot process.

Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks
are affected by this problem.

Due to popularity of those models this patch is good MFC5.4 candidate.

PR: 67745
Submitted by: Jung-uk Kim jkim at niksun.com
MFC after: 1 days


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 114930 12-May-2003 peter

AMD64 physical space is much larger than i386, de-i386 the bus_space and
bus_dma MD code for AMD64. (And a trivial ifdef update in dev/kbd because
of this). More updates are needed here to take advantage of the 64 bit
instructions.

Approved by: re (blanket amd64/*)


# 114382 01-May-2003 peter

Update the hardcoded bus tags for early console support for amd64.


# 102149 19-Aug-2002 peter

de-count atkbdc. I have more extensive patches to make properly dynamic,
but since pc hardware only allows one AT-style keyboard controller, this
doesn't seem particularly urgent. (I do not know what the old sunriver
remote keyboard/mouse/vga cards do, that might be an exception).


# 93279 27-Mar-2002 murray

Fix spelling and grammar bogons in a comment.

PR: kern/30540
Submitted by: Tony Finch <dot@dotat.at>
MFC after: 3 days


# 92661 19-Mar-2002 peter

Add the ia64 bus space tag for the IO ports (!).
Add a #else and #error so that this doesn't go unnoticed again.


# 69781 08-Dec-2000 dwmalone

Convert more malloc+bzero to malloc+M_ZERO.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>


# 67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


# 65176 28-Aug-2000 dfr

* Completely rewrite the alpha busspace to hide the implementation from
the drivers.
* Remove legacy inx/outx support from chipset and replace with macros
which call busspace.
* Rework pci config accesses to route through the pcib device instead of
calling a MD function directly.

With these changes it is possible to cleanly support machines which have
more than one independantly numbered PCI busses. As a bonus, the new
busspace implementation should be measurably faster than the old one.


# 58271 19-Mar-2000 yokota

- Properly keep track of I/O port resources.
- Use bus_space_read/write() to access the ports.


# 56836 29-Jan-2000 peter

Use config's conditional compilation rather than using #ifdefs that make
modular compilation harder. I'm doing this because people seem to like
cut/pasting examples of bad practices in existing code.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 47335 20-May-1999 yokota

Include sys/isa/isareg.h rather than i386/isa/isa.h for i386.


# 47296 18-May-1999 yokota

Slight reorganization of internal interface in the keyboard controller
driver.


# 42421 09-Jan-1999 yokota

Add the new keyboard driver and video card driver. They will be
used by console drivers.

(They are not yet activated yet. Wait for announcement later.)