History log of /freebsd-9.3-release/sys/i386/i386/elan-mmcr.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)


# 214346 25-Oct-2010 jhb

Use intr_disable() and intr_restore() instead of frobbing the flags register
directly to disable interrupts.

Reviewed by: bde (earlier version)
MFC after: 2 weeks


# 201223 29-Dec-2009 rnoland

Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.

This replaces d_mmap() with the d_mmap2() implementation and also
changes the type of offset to vm_ooffset_t.

Purge d_mmap2().

All driver modules will need to be rebuilt since D_VERSION is also
bumped.

Reviewed by: jhb@
MFC after: Not in this lifetime...


# 170289 04-Jun-2007 dwmalone

Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
The type must always be an int or an unsigned int.

Remove the instances where a sizeof(variable) is passed to stop
people accidently cut and pasting these examples.

In a few places this was sysctl_handle_int was being used on 64 bit
types, which would truncate the value to be exported. In these
cases use sysctl_handle_quad to export them and change the format
to Q so that sysctl(1) can still print them.


# 167950 27-Mar-2007 n_hibma

Revisit the watchdogs: Resetting the error to EINVAL after failing to set the
watchdog might hide the succesful arming of an earlier one. Accept that on
failing to arm any watchdog (because of non-supported timeouts) EOPNOTSUPP is
returned instead of the more appropriate EINVAL.

MFC after: 3 days


# 165260 15-Dec-2006 n_hibma

Align the interfaces for the various watchdogs and make the interface
behave as expected.

Also:
- Return an error if WD_PASSIVE is passed in to the ioctl as only
WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an
explanation of the difference between WD_ACTIVE and WD_PASSIVE.
- Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've
lost your sense of humor, than don't add a define.

Specific changes:

i80321_wdog.c
Don't roll your own passive watchdog tickle as this would defeat the
purpose of an active (userland) watchdog tickle.

ichwd.c / ipmi.c:
WD_ACTIVE means active patting of the watchdog by a userland process,
not whether the watchdog is active. See sys/watchdog.h.

kern_clock.c:
(software watchdog) Remove a check for WD_ACTIVE as this does not make
sense here. This reverts r1.181.


# 148231 21-Jul-2005 phk

Make the facility for recognizing BIOS-signatures more general
and return a printable representation.

This fixes recognition of the PC Engines WRAP and improves the
recognition of the Soekris boards (Bios version can now be
seen in the dmesg output for instance).

Also, add watchdog support for PCM-582x platforms.

Submitted by: Adrian Steinmann <ast@marabu.ch>
Slightly changed by: phk
PR: 81360


# 136419 12-Oct-2004 phk

Add zero flags argument to sysctl calls.


# 131755 07-Jul-2004 phk

Fix an oversight in r1.26: remove #ifdef around necessary variable.

Spotted by: philip


# 130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


# 128677 27-Apr-2004 phk

Make sure we are all set up before creating the LED instance.


# 127801 03-Apr-2004 phk

Unbreak LED support on Elan cpus.


# 127039 15-Mar-2004 phk

The PPS code needs to be much more brutal to avoid synchronism on
hardware with non-sucky clocks.


# 126762 09-Mar-2004 jb

Add #ifdef CPU_SOEKRIS in the missing places around the led_* code
that is specific to those boards.

This allows this file to compile again with CPU_ELAN enabled, but not
CPU_SOEKRIS, for a Compulab board.


# 126370 28-Feb-2004 phk

Add a generic watchdog facility which through a single device entry
in /dev controls all available watchdog implementations.


# 126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


# 124144 05-Jan-2004 phk

Add struct definition of the Elan MMCR registers (from jb@)

Put a CTASSERT() on the size of the struct.

Use the struct where it is easy to do so in elan_mmcr.c

Add the Elan specific hardware reset code (also from jb@).


# 123015 27-Nov-2003 phk

Refactor AMD Elan 520 CPU support.

Make it possible to configure GPIO pins as led(4) devices, PPS inputs
and PPS-echo outputs with a sysctl. Led(4) and PPS-echo can be configured
for active-high or active-low.

Be more complete in initialization of timecounter hardware.

Approved by: re@


# 121944 03-Nov-2003 phk

Change /dev/soekris-errled to be /dev/led/error and make it conditional
on CPU_SOEKRIS.

Note the subtle change in semantfics for 'f%d' flash instruction and the
new morse facility (see details in dev/led/led.c)


# 121942 03-Nov-2003 phk

Free major#100


# 120506 27-Sep-2003 phk

The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.


# 119715 03-Sep-2003 phk

Give the ELAN timecounter better quality than i8254


# 119452 25-Aug-2003 obrien

Fix copyright comment & FBSDID style nits.

Requested by: bde


# 115683 02-Jun-2003 obrien

Use __FBSDID().


# 112569 24-Mar-2003 jake

- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
with PAE.
- Use this to represent physical addresses in the MI vm system and in the
i386 pmap code. This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by: DARPA, Network Associates Laboratories
Discussed with: re, phk (cdevsw change)


# 111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


# 111647 27-Feb-2003 phk

Add support for the Elan CPU hardware watchdog used in "active" mode.


# 111462 25-Feb-2003 mux

Cleanup of the d_mmap_t interface.

- Get rid of the useless atop() / pmap_phys_address() detour. The
device mmap handlers must now give back the physical address
without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
int. Now we properly pass a vm_offset_t * and expect it to be
filled by the mmap handler when the mapping was successful. The
mmap handler must now return 0 when successful, any other value
is considered as an error. Previously, returning -1 was the only
way to fail. This change thus accidentally fixes some devices
which were bogusly returning errno constants which would have been
considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with: alc, phk, jake
Reviewed by: peter
Compile-tested on: LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on: i386


# 111138 19-Feb-2003 phk

#include "opt_cpu.h" so we notice our options.


# 111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


# 109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


# 109327 15-Jan-2003 phk

Add machdep.elan_freq sysctl which can be used to set the CPU clock
frequency in Hz. The default is still 33.333 MHz. Please notice
that the number is round to a multiple of four internally so it may
not read back exactly the same as written.

Add compile time ELAN_XTAL option to override the 33.333 MHz default.

Add compile time ELAN_PPS option to enable code for high precision
(250 nanoseconds) timestamping of external signals.


# 103482 17-Sep-2002 phk

Add /dev/soekris-errled device to control the Error-LED on Soekris cards/boxes.

# turn LED off
echo '0' > /dev/soekris-errled

# turn LED on
echo '1' > /dev/soekris-errled

# flash LED (5 hz)
echo 'f' > /dev/soekris-errled

# flash LED (4/2 = 2 hz), syntax: "f[1-9]" -> .5 -> 4.5 Hz
echo 'f4' > /dev/soekris-errled

# flash digits 1,3 and 7, syntax: "d[1-9]*"
echo 'd137' > /dev/soekris-errled

Characters not understood are ignored.


# 103168 10-Sep-2002 sam

move some printfs under bootverbose

Reviewed by: phk


# 102935 04-Sep-2002 phk

On the ElanSC520 CPU use general purpose timer#2 as timecounter.

This is a vast improvement over the i8254, since it is a simple
memory load rather than a comples sequence of interrupt blocking,
multiple input/output instructions, and wrap-around detection.

I have not bothered to time the fundamental timecounter get routine,
but gettimeofday(2) is 10% faster with the ELAN timecounte.

The downside is that HZ=100 is not enough, 150 or more recommended,
I use 250 myself.


# 102934 04-Sep-2002 phk

Change the support for AMDs ElanSC520 CPU from being a device driver to
be
options CPU_ELAN
(NB: Soekris.com users!)

It is cleaner this way. We still recognize the cpu on the host-pci bridge.


# 101229 02-Aug-2002 phk

SYSINIT needs to be SI_SUB_PSEUDO. Add a printf to tell we are here.


# 101225 02-Aug-2002 phk

Add the minimalist elan-mmcr device driver.

This driver allows a userland program to mmap the MMCR of the AMD
Elan sc520 CPU.