Creation of Cybook 2416 (actually Gen4) repository
This commit is contained in:
31
Documentation/w1/masters/ds2482
Normal file
31
Documentation/w1/masters/ds2482
Normal file
@@ -0,0 +1,31 @@
|
||||
Kernel driver ds2482
|
||||
====================
|
||||
|
||||
Supported chips:
|
||||
* Maxim DS2482-100, Maxim DS2482-800
|
||||
Prefix: 'ds2482'
|
||||
Addresses scanned: None
|
||||
Datasheets:
|
||||
http://pdfserv.maxim-ic.com/en/ds/DS2482-100-DS2482S-100.pdf
|
||||
http://pdfserv.maxim-ic.com/en/ds/DS2482-800-DS2482S-800.pdf
|
||||
|
||||
Author: Ben Gardner <bgardner@wabtec.com>
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The Maixm/Dallas Semiconductor DS2482 is a I2C device that provides
|
||||
one (DS2482-100) or eight (DS2482-800) 1-wire busses.
|
||||
|
||||
|
||||
General Remarks
|
||||
---------------
|
||||
|
||||
Valid addresses are 0x18, 0x19, 0x1a, and 0x1b.
|
||||
However, the device cannot be detected without writing to the i2c bus, so no
|
||||
detection is done.
|
||||
You should force the device address.
|
||||
|
||||
$ modprobe ds2482 force=0,0x18
|
||||
|
||||
18
Documentation/w1/masters/ds2490
Normal file
18
Documentation/w1/masters/ds2490
Normal file
@@ -0,0 +1,18 @@
|
||||
Kernel driver ds2490
|
||||
====================
|
||||
|
||||
Supported chips:
|
||||
* Maxim DS2490 based
|
||||
|
||||
Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The Maixm/Dallas Semiconductor DS2490 is a chip
|
||||
which allows to build USB <-> W1 bridges.
|
||||
|
||||
DS9490(R) is a USB <-> W1 bus master device
|
||||
which has 0x81 family ID integrated chip and DS2490
|
||||
low-level operational chip.
|
||||
104
Documentation/w1/w1.generic
Normal file
104
Documentation/w1/w1.generic
Normal file
@@ -0,0 +1,104 @@
|
||||
The 1-wire (w1) subsystem
|
||||
------------------------------------------------------------------
|
||||
The 1-wire bus is a simple master-slave bus that communicates via a single
|
||||
signal wire (plus ground, so two wires).
|
||||
|
||||
Devices communicate on the bus by pulling the signal to ground via an open
|
||||
drain output and by sampling the logic level of the signal line.
|
||||
|
||||
The w1 subsystem provides the framework for managing w1 masters and
|
||||
communication with slaves.
|
||||
|
||||
All w1 slave devices must be connected to a w1 bus master device.
|
||||
|
||||
Example w1 master devices:
|
||||
DS9490 usb device
|
||||
W1-over-GPIO
|
||||
DS2482 (i2c to w1 bridge)
|
||||
Emulated devices, such as a RS232 converter, parallel port adapter, etc
|
||||
|
||||
|
||||
What does the w1 subsystem do?
|
||||
------------------------------------------------------------------
|
||||
When a w1 master driver registers with the w1 subsystem, the following occurs:
|
||||
|
||||
- sysfs entries for that w1 master are created
|
||||
- the w1 bus is periodically searched for new slave devices
|
||||
|
||||
When a device is found on the bus, w1 core checks if driver for it's family is
|
||||
loaded. If so, the family driver is attached to the slave.
|
||||
If there is no driver for the family, default one is assigned, which allows to perform
|
||||
almost any kind of operations. Each logical operation is a transaction
|
||||
in nature, which can contain several (two or one) low-level operations.
|
||||
Let's see how one can read EEPROM context:
|
||||
1. one must write control buffer, i.e. buffer containing command byte
|
||||
and two byte address. At this step bus is reset and appropriate device
|
||||
is selected using either W1_SKIP_ROM or W1_MATCH_ROM command.
|
||||
Then provided control buffer is being written to the wire.
|
||||
2. reading. This will issue reading eeprom response.
|
||||
|
||||
It is possible that between 1. and 2. w1 master thread will reset bus for searching
|
||||
and slave device will be even removed, but in this case 0xff will
|
||||
be read, since no device was selected.
|
||||
|
||||
|
||||
W1 device families
|
||||
------------------------------------------------------------------
|
||||
Slave devices are handled by a driver written for a family of w1 devices.
|
||||
|
||||
A family driver populates a struct w1_family_ops (see w1_family.h) and
|
||||
registers with the w1 subsystem.
|
||||
|
||||
Current family drivers:
|
||||
w1_therm - (ds18?20 thermal sensor family driver)
|
||||
provides temperature reading function which is bound to ->rbin() method
|
||||
of the above w1_family_ops structure.
|
||||
|
||||
w1_smem - driver for simple 64bit memory cell provides ID reading method.
|
||||
|
||||
You can call above methods by reading appropriate sysfs files.
|
||||
|
||||
|
||||
What does a w1 master driver need to implement?
|
||||
------------------------------------------------------------------
|
||||
|
||||
The driver for w1 bus master must provide at minimum two functions.
|
||||
|
||||
Emulated devices must provide the ability to set the output signal level
|
||||
(write_bit) and sample the signal level (read_bit).
|
||||
|
||||
Devices that support the 1-wire natively must provide the ability to write and
|
||||
sample a bit (touch_bit) and reset the bus (reset_bus).
|
||||
|
||||
Most hardware provides higher-level functions that offload w1 handling.
|
||||
See struct w1_bus_master definition in w1.h for details.
|
||||
|
||||
|
||||
w1 master sysfs interface
|
||||
------------------------------------------------------------------
|
||||
<xx-xxxxxxxxxxxxx> - a directory for a found device. The format is family-serial
|
||||
bus - (standard) symlink to the w1 bus
|
||||
driver - (standard) symlink to the w1 driver
|
||||
w1_master_attempts - the number of times a search was attempted
|
||||
w1_master_max_slave_count
|
||||
- the maximum slaves that may be attached to a master
|
||||
w1_master_name - the name of the device (w1_bus_masterX)
|
||||
w1_master_search - the number of searches left to do, -1=continual (default)
|
||||
w1_master_slave_count
|
||||
- the number of slaves found
|
||||
w1_master_slaves - the names of the slaves, one per line
|
||||
w1_master_timeout - the delay in seconds between searches
|
||||
|
||||
If you have a w1 bus that never changes (you don't add or remove devices),
|
||||
you can set w1_master_search to a positive value to disable searches.
|
||||
|
||||
|
||||
w1 slave sysfs interface
|
||||
------------------------------------------------------------------
|
||||
bus - (standard) symlink to the w1 bus
|
||||
driver - (standard) symlink to the w1 driver
|
||||
name - the device name, usually the same as the directory name
|
||||
w1_slave - (optional) a binary file whose meaning depends on the
|
||||
family driver
|
||||
rw - (optional) created for slave devices which do not have
|
||||
appropriate family driver. Allows to read/write binary data.
|
||||
98
Documentation/w1/w1.netlink
Normal file
98
Documentation/w1/w1.netlink
Normal file
@@ -0,0 +1,98 @@
|
||||
Userspace communication protocol over connector [1].
|
||||
|
||||
|
||||
Message types.
|
||||
=============
|
||||
|
||||
There are three types of messages between w1 core and userspace:
|
||||
1. Events. They are generated each time new master or slave device found
|
||||
either due to automatic or requested search.
|
||||
2. Userspace commands. Includes read/write and search/alarm search comamnds.
|
||||
3. Replies to userspace commands.
|
||||
|
||||
|
||||
Protocol.
|
||||
========
|
||||
|
||||
[struct cn_msg] - connector header. It's length field is equal to size of the attached data.
|
||||
[struct w1_netlink_msg] - w1 netlink header.
|
||||
__u8 type - message type.
|
||||
W1_SLAVE_ADD/W1_SLAVE_REMOVE - slave add/remove events.
|
||||
W1_MASTER_ADD/W1_MASTER_REMOVE - master add/remove events.
|
||||
W1_MASTER_CMD - userspace command for bus master device (search/alarm search).
|
||||
W1_SLAVE_CMD - userspace command for slave device (read/write/ search/alarm search
|
||||
for bus master device where given slave device found).
|
||||
__u8 res - reserved
|
||||
__u16 len - size of attached to this header data.
|
||||
union {
|
||||
__u8 id; - slave unique device id
|
||||
struct w1_mst {
|
||||
__u32 id; - master's id.
|
||||
__u32 res; - reserved
|
||||
} mst;
|
||||
} id;
|
||||
|
||||
[strucrt w1_netlink_cmd] - command for gived master or slave device.
|
||||
__u8 cmd - command opcode.
|
||||
W1_CMD_READ - read command.
|
||||
W1_CMD_WRITE - write command.
|
||||
W1_CMD_SEARCH - search command.
|
||||
W1_CMD_ALARM_SEARCH - alarm search command.
|
||||
__u8 res - reserved
|
||||
__u16 len - length of data for this command.
|
||||
For read command data must be allocated like for write command.
|
||||
__u8 data[0] - data for this command.
|
||||
|
||||
|
||||
Each connector message can include one or more w1_netlink_msg with zero of more attached w1_netlink_cmd messages.
|
||||
|
||||
For event messages there are no w1_netlink_cmd embedded structures, only connector header
|
||||
and w1_netlink_msg strucutre with "len" field being zero and filled type (one of event types)
|
||||
and id - either 8 bytes of slave unique id in host order, or master's id, which is assigned
|
||||
to bus master device when it is added to w1 core.
|
||||
|
||||
Currently replies to userspace commands are only generated for read command request.
|
||||
One reply is generated exactly for one w1_netlink_cmd read request.
|
||||
Replies are not combined when sent - i.e. typical reply messages looks like the following:
|
||||
[cn_msg][w1_netlink_msg][w1_netlink_cmd]
|
||||
cn_msg.len = sizeof(struct w1_netlink_msg) + sizeof(struct w1_netlink_cmd) + cmd->len;
|
||||
w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len;
|
||||
w1_netlink_cmd.len = cmd->len;
|
||||
|
||||
|
||||
Operation steps in w1 core when new command is received.
|
||||
=======================================================
|
||||
|
||||
When new message (w1_netlink_msg) is received w1 core detects if it is master of slave request,
|
||||
according to w1_netlink_msg.type field.
|
||||
Then master or slave device is searched for.
|
||||
When found, master device (requested or those one on where slave device is found) is locked.
|
||||
If slave command is requested, then reset/select procedure is started to select given device.
|
||||
|
||||
Then all requested in w1_netlink_msg operations are performed one by one.
|
||||
If command requires reply (like read command) it is sent on command completion.
|
||||
|
||||
When all commands (w1_netlink_cmd) are processed muster device is unlocked
|
||||
and next w1_netlink_msg header processing started.
|
||||
|
||||
|
||||
Connector [1] specific documentation.
|
||||
====================================
|
||||
|
||||
Each connector message includes two u32 fields as "address".
|
||||
w1 uses CN_W1_IDX and CN_W1_VAL defined in include/linux/connector.h header.
|
||||
Each message also includes sequence and acknowledge numbers.
|
||||
Sequence number for event messages is appropriate bus master sequence number increased with
|
||||
each event message sent "through" this master.
|
||||
Sequence number for userspace requests is set by userspace application.
|
||||
Sequence number for reply is the same as was in request, and
|
||||
acknowledge number is set to seq+1.
|
||||
|
||||
|
||||
Additional documantion, source code examples.
|
||||
============================================
|
||||
|
||||
1. Documentation/connector
|
||||
2. http://tservice.net.ru/~s0mbre/archive/w1
|
||||
This archive includes userspace application w1d.c which
|
||||
uses read/write/search commands for all master/slave devices found on the bus.
|
||||
Reference in New Issue
Block a user