Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cpu_elan(4) [debian man page]

CPU_ELAN(4)						 BSD/i386 Kernel Interfaces Manual					       CPU_ELAN(4)

NAME
CPU_ELAN -- AMD Elan 520 CPU support SYNOPSIS
options CPU_ELAN options CPU_ELAN_PPS options CPU_ELAN_XTAL machdep.elan_gpio_config machdep.elan_freq options CPU_SOEKRIS DESCRIPTION
The options CPU_ELAN enables support for the AMD Elan 520 CPU. A device /dev/elan-mmcr exports the MMCR register bank to userland using mmap(2). The i8254 timer will be adjusted to the slightly unorthodox frequency 1189161 Hz (32768 * 45 * 25 / 31) employed by the Elan. A timecounter named ``ELAN'' is implemented using the general purpose timer 2, but it will not be usable unless HZ is configured at 150 or higher. This timecounter is much better than the ``i8254'' timecounter and should be used at all times. The machdep.elan_gpio_config sysctl(8) variable enables configuration of the GPIO pins of the CPU. The string must be exactly 32 characters long. A '-' means the GPIO is unavailable. A 'l' (lower-case ell) configures a led(4) device (active low). A 'L' configures a led(4) device (active high). A '.' means no configuration for this GPIO. These led(4) devices will be named /dev/led/gpio%d. For meaning of 'P', 'e' and 'E', see under options CPU_ELAN_PPS. The options CPU_ELAN_XTAL and the machdep.elan_freq sysctl(8) variable can be used to set the CPU clock crystal frequency in Hz. The default is 33333333 Hz. The options CPU_ELAN_PPS enables precision timestamping using the RFC2783 PPS-API via the /dev/elan-mmcr device. The resolution will be approximately 125 nsec and the precision +- 125 nsec. (For 125 nsec read ``4 / CPU clock crystal frequency''.) The input signal must be connected to the TMR1IN pin and a GPIO pin. The GPIO pin must be configured with a 'P' in machdep.elan_gpio_config. In addition, one GPIO pin can be configured with either 'e' (active low) or 'E' (active high) to become a ``echo'' output of the input sig- nal. Please notice that this signal is not suitable for calibration. If the options CPU_SOEKRIS is given, the support will additionally be tailored to the Soekris Engineering 45xx series of embedded computers. The ``error'' led will be configured (as /dev/led/error) and the GPIO pins which are not available will be disabled. SEE ALSO
led(4), sysctl(8) HISTORY
The CPU_ELAN code first appeared in FreeBSD 4.7. AUTHORS
Poul-Henning Kamp <phk@FreeBSD.org> BSD
November 23, 2003 BSD

Check Out this Related Man Page

GPIO(4) 						   BSD Kernel Interfaces Manual 						   GPIO(4)

NAME
gpio -- General Purpose Input/Output SYNOPSIS
gpio* at elansc? gpio* at epgpio? gpio* at gcscpcib? gpio* at gpiosim? gpio* at gscpcib? gpio* at ichlpcib? gpio* at nsclpcsio? gpio* at ppbus? #include <sys/types.h> #include <sys/gpio.h> #include <sys/ioctl.h> DESCRIPTION
The gpio device attaches to the GPIO controller and provides a uniform programming interface to its pins. Each GPIO controller with an attached gpio device has an associated device file under the /dev directory, e.g. /dev/gpio0. Access from user- land is performed through ioctl(2) calls on these devices. Whether the layout of the GPIO device can be configured is subject to authorization by the kauth(9) framework. If for example secmodel_securelevel(9) is active, the layout of the GPIO device is defined at a securelevel less than 1, i.e. typically dur- ing system boot, and cannot be changed later. GPIO pins can be configured and given a symbolic name and device drivers that use GPIO pins can be attached to the gpio device at a securelevel less than 1. All other pins will not be accessible once the runlevel has been raised. IOCTL INTERFACE
The following structures and constants are defined in the <sys/gpio.h> header file: GPIOINFO (struct gpio_info) Returns information about the GPIO controller in the gpio_info structure: struct gpio_info { int gpio_npins; /* total number of pins available */ }; GPIOREAD (struct gpio_req) Returns the input pin value in the gpio_pin_op structure: #define GPIOMAXNAME 64 struct gpio_req { char gp_name[GPIOMAXNAME]; /* pin name */ int gp_pin; /* pin number */ int gp_value; /* value */ }; The gp_name or gp_pin field must be set before calling. GPIOWRITE (struct gpio_req) Writes the output value to the pin. The value set in the gp_value field must be either GPIO_PIN_LOW (logical 0) or GPIO_PIN_HIGH (log- ical 1). On return, the gp_value field contains the old pin state. GPIOTOGGLE (struct gpio_req) Toggles the pin output value, i.e. changes it to the opposite. gp_value field is ignored and on return contains the old pin state. GPIOSET (struct gpio_set) Changes pin configuration flags with the new ones provided in the gpio_set structure: #define GPIOMAXNAME 64 struct gpio_set { char gp_name[GPIOMAXNAME]; /* pin name */ int gp_pin; /* pin number */ int gp_caps; /* pin capabilities (ro) */ int gp_flags; /* pin configuration flags */ char gp_name2[GPIOMAXNAME]; /* new name */ }; The gp_flags field is a combination of the following flags: GPIO_PIN_INPUT input direction GPIO_PIN_OUTPUT output direction GPIO_PIN_INOUT bi-directional GPIO_PIN_OPENDRAIN open-drain output GPIO_PIN_PUSHPULL push-pull output GPIO_PIN_TRISTATE output disabled GPIO_PIN_PULLUP internal pull-up enabled GPIO_PIN_PULLDOWN internal pull-down enabled GPIO_PIN_INVIN invert input GPIO_PIN_INVOUT invert output GPIO_PIN_PULSATE pulsate output Note that the GPIO controller may not support all of these flags. On return the gp_caps field contains flags that are supported. If no flags are specified, the pin configuration stays unchanged. Only GPIO pins that have been set using GPIOSET will be accessible at securelevels greater than 0. GPIOUNSET (struct gpio_set) Unset the specified pin, i.e. clear its name and make it unaccessible at securelevels greater than 0. GPIOATTACH (struct gpio_attach) Attach the device described in the gpio_attach structure on this gpio device. struct gpio_attach { char ga_dvname[16]; /* device name */ int ga_offset; /* pin number */ uint32_t ga_mask; /* binary mask */ uint32_t ga_flags; /* driver dependent */ }; The drvctl(8) command can be used to detach a device from a gpio pin. FILES
/dev/gpiou GPIO device unit u file. SEE ALSO
ioctl(2), drvctl(8), gpioctl(8) HISTORY
The gpio device first appeared in OpenBSD 3.6 and NetBSD 4.0. AUTHORS
The gpio driver was written by Alexander Yurchenko <grange@openbsd.org>. gpio and was ported to NetBSD by Jared D. McNeill <jmcneill@NetBSD.org>. Runtime device attachment was added by Marc Balmer <marc@msys.ch>. BUGS
Event capabilities are not supported. BSD
November 13, 2011 BSD
Man Page