Skip to content

Commit fe3c22b

Browse files
committed
Merge tag 'char-misc-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc updates from Greg KH: "Here's the big char/misc driver tree merge for 3.11-rc1 A variety of different driver patches here. All of these have been in linux-next for a while, and the networking patches were acked-by David Miller, as it made sense for those patches to come through this tree" * tag 'char-misc-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (102 commits) Revert "char: misc: assign file->private_data in all cases" drivers: uio_pdrv_genirq: Use of_match_ptr() macro mei: check whether hw start has succeeded mei: check if the hardware reset succeeded mei: mei_cl_connect: don't multiply the timeout twice mei: do not override a client writing state when buffering mei: move mei_cl_irq_write_complete to client.c UIO: Fix concurrency issue drivers: uio_dmem_genirq: Use of_match_ptr() macro char: misc: assign file->private_data in all cases drivers: hv: allocate synic structures before hv_synic_init() drivers: hv: check interrupt mask before read_index vme: vme_tsi148.c: fix error return code in tsi148_probe() FMC: fix error handling in probe() function fmc: avoid readl/writel namespace conflict FMC: NULL dereference on allocation failure UIO: fix uio_pdrv_genirq with device tree but no interrupt UIO: allow binding uio_pdrv_genirq.c to devices using command line option FMC: add a char-device mezzanine driver FMC: add a driver to write mezzanine EEPROM ...
2 parents ce49b62 + 3806726 commit fe3c22b

130 files changed

Lines changed: 5322 additions & 919 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/00-INDEX‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ firmware_class/
187187
- request_firmware() hotplug interface info.
188188
flexible-arrays.txt
189189
- how to make use of flexible sized arrays in linux
190+
fmc/
191+
- information about the FMC bus abstraction
190192
frv/
191193
- Fujitsu FR-V Linux documentation.
192194
futex-requeue-pi.txt
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Atmel AT91RM9200 CompactFlash
2+
3+
Required properties:
4+
- compatible : "atmel,at91rm9200-cf".
5+
- reg : should specify localbus address and size used.
6+
- gpios : specifies the gpio pins to control the CF device. Detect
7+
and reset gpio's are mandatory while irq and vcc gpio's are
8+
optional and may be set to 0 if not present.
9+
10+
Example:
11+
compact-flash@50000000 {
12+
compatible = "atmel,at91rm9200-cf";
13+
reg = <0x50000000 0x30000000>;
14+
gpios = <&pioC 13 0 /* irq */
15+
&pioC 15 0 /* detect */
16+
0 /* vcc */
17+
&pioC 5 0 /* reset */
18+
>;
19+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
EXTCON FOR TWL CHIPS
2+
3+
PALMAS USB COMPARATOR
4+
Required Properties:
5+
- compatible : Should be "ti,palmas-usb" or "ti,twl6035-usb"
6+
- vbus-supply : phandle to the regulator device tree node.
7+
8+
Optional Properties:
9+
- ti,wakeup : To enable the wakeup comparator in probe
10+
11+
palmas-usb {
12+
compatible = "ti,twl6035-usb", "ti,palmas-usb";
13+
vbus-supply = <&smps10_reg>;
14+
ti,wakeup;
15+
};
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
Device tree bindings for MVEBU Device Bus controllers
2+
3+
The Device Bus controller available in some Marvell's SoC allows to control
4+
different types of standard memory and I/O devices such as NOR, NAND, and FPGA.
5+
The actual devices are instantiated from the child nodes of a Device Bus node.
6+
7+
Required properties:
8+
9+
- compatible: Currently only Armada 370/XP SoC are supported,
10+
with this compatible string:
11+
12+
marvell,mvebu-devbus
13+
14+
- reg: A resource specifier for the register space.
15+
This is the base address of a chip select within
16+
the controller's register space.
17+
(see the example below)
18+
19+
- #address-cells: Must be set to 1
20+
- #size-cells: Must be set to 1
21+
- ranges: Must be set up to reflect the memory layout with four
22+
integer values for each chip-select line in use:
23+
0 <physical address of mapping> <size>
24+
25+
Mandatory timing properties for child nodes:
26+
27+
Read parameters:
28+
29+
- devbus,turn-off-ps: Defines the time during which the controller does not
30+
drive the AD bus after the completion of a device read.
31+
This prevents contentions on the Device Bus after a read
32+
cycle from a slow device.
33+
34+
- devbus,bus-width: Defines the bus width (e.g. <16>)
35+
36+
- devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle,
37+
to read data sample. This parameter is useful for
38+
synchronous pipelined devices, where the address
39+
precedes the read data by one or two cycles.
40+
41+
- devbus,acc-first-ps: Defines the time delay from the negation of
42+
ALE[0] to the cycle that the first read data is sampled
43+
by the controller.
44+
45+
- devbus,acc-next-ps: Defines the time delay between the cycle that
46+
samples data N and the cycle that samples data N+1
47+
(in burst accesses).
48+
49+
- devbus,rd-setup-ps: Defines the time delay between DEV_CSn assertion to
50+
DEV_OEn assertion. If set to 0 (default),
51+
DEV_OEn and DEV_CSn are asserted at the same cycle.
52+
This parameter has no affect on <acc-first-ps> parameter
53+
(no affect on first data sample). Set <rd-setup-ps>
54+
to a value smaller than <acc-first-ps>.
55+
56+
- devbus,rd-hold-ps: Defines the time between the last data sample to the
57+
de-assertion of DEV_CSn. If set to 0 (default),
58+
DEV_OEn and DEV_CSn are de-asserted at the same cycle
59+
(the cycle of the last data sample).
60+
This parameter has no affect on DEV_OEn de-assertion.
61+
DEV_OEn is always de-asserted the next cycle after
62+
last data sampled. Also this parameter has no
63+
affect on <turn-off-ps> parameter.
64+
Set <rd-hold-ps> to a value smaller than <turn-off-ps>.
65+
66+
Write parameters:
67+
68+
- devbus,ale-wr-ps: Defines the time delay from the ALE[0] negation cycle
69+
to the DEV_WEn assertion.
70+
71+
- devbus,wr-low-ps: Defines the time during which DEV_WEn is active.
72+
A[2:0] and Data are kept valid as long as DEV_WEn
73+
is active. This parameter defines the setup time of
74+
address and data to DEV_WEn rise.
75+
76+
- devbus,wr-high-ps: Defines the time during which DEV_WEn is kept
77+
inactive (high) between data beats of a burst write.
78+
DEV_A[2:0] and Data are kept valid (do not toggle) for
79+
<wr-high-ps> - <tick> ps.
80+
This parameter defines the hold time of address and
81+
data after DEV_WEn rise.
82+
83+
- devbus,sync-enable: Synchronous device enable.
84+
1: True
85+
0: False
86+
87+
An example for an Armada XP GP board, with a 16 MiB NOR device as child
88+
is showed below. Note that the Device Bus driver is in charge of allocating
89+
the mbus address decoding window for each of its child devices.
90+
The window is created using the chip select specified in the child
91+
device node together with the base address and size specified in the ranges
92+
property. For instance, in the example below the allocated decoding window
93+
will start at base address 0xf0000000, with a size 0x1000000 (16 MiB)
94+
for chip select 0 (a.k.a DEV_BOOTCS).
95+
96+
This address window handling is done in this mvebu-devbus only as a temporary
97+
solution. It will be removed when the support for mbus device tree binding is
98+
added.
99+
100+
The reg property implicitly specifies the chip select as this:
101+
102+
0x10400: DEV_BOOTCS
103+
0x10408: DEV_CS0
104+
0x10410: DEV_CS1
105+
0x10418: DEV_CS2
106+
0x10420: DEV_CS3
107+
108+
Example:
109+
110+
devbus-bootcs@d0010400 {
111+
status = "okay";
112+
ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */
113+
#address-cells = <1>;
114+
#size-cells = <1>;
115+
116+
/* Device Bus parameters are required */
117+
118+
/* Read parameters */
119+
devbus,bus-width = <8>;
120+
devbus,turn-off-ps = <60000>;
121+
devbus,badr-skew-ps = <0>;
122+
devbus,acc-first-ps = <124000>;
123+
devbus,acc-next-ps = <248000>;
124+
devbus,rd-setup-ps = <0>;
125+
devbus,rd-hold-ps = <0>;
126+
127+
/* Write parameters */
128+
devbus,sync-enable = <0>;
129+
devbus,wr-high-ps = <60000>;
130+
devbus,wr-low-ps = <60000>;
131+
devbus,ale-wr-ps = <60000>;
132+
133+
flash@0 {
134+
compatible = "cfi-flash";
135+
136+
/* 16 MiB */
137+
reg = <0 0x1000000>;
138+
bank-width = <2>;
139+
#address-cells = <1>;
140+
#size-cells = <1>;
141+
142+
/*
143+
* We split the 16 MiB in two partitions,
144+
* just as an example.
145+
*/
146+
partition@0 {
147+
label = "First";
148+
reg = <0 0x800000>;
149+
};
150+
151+
partition@800000 {
152+
label = "Second";
153+
reg = <0x800000 0x800000>;
154+
};
155+
};
156+
};

‎Documentation/fmc/00-INDEX‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
Documentation in this directory comes from sections of the manual we
3+
wrote for the externally-developed fmc-bus package. The complete
4+
manual as of today (2013-02) is available in PDF format at
5+
http://www.ohwr.org/projects/fmc-bus/files
6+
7+
00-INDEX
8+
- this file.
9+
10+
FMC-and-SDB.txt
11+
- What are FMC and SDB, basic concepts for this framework
12+
13+
API.txt
14+
- The functions that are exported by the bus driver
15+
16+
parameters.txt
17+
- The module parameters
18+
19+
carrier.txt
20+
- writing a carrier (a device)
21+
22+
mezzanine.txt
23+
- writing code for your mezzanine (a driver)
24+
25+
identifiers.txt
26+
- how identification and matching works
27+
28+
fmc-fakedev.txt
29+
- about drivers/fmc/fmc-fakedev.ko
30+
31+
fmc-trivial.txt
32+
- about drivers/fmc/fmc-trivial.ko
33+
34+
fmc-write-eeprom.txt
35+
- about drivers/fmc/fmc-write-eeprom.ko
36+
37+
fmc-chardev.txt
38+
- about drivers/fmc/fmc-chardev.ko

‎Documentation/fmc/API.txt‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Functions Exported by fmc.ko
2+
****************************
3+
4+
The FMC core exports the usual 4 functions that are needed for a bus to
5+
work, and a few more:
6+
7+
int fmc_driver_register(struct fmc_driver *drv);
8+
void fmc_driver_unregister(struct fmc_driver *drv);
9+
int fmc_device_register(struct fmc_device *fmc);
10+
void fmc_device_unregister(struct fmc_device *fmc);
11+
12+
int fmc_device_register_n(struct fmc_device **fmc, int n);
13+
void fmc_device_unregister_n(struct fmc_device **fmc, int n);
14+
15+
uint32_t fmc_readl(struct fmc_device *fmc, int offset);
16+
void fmc_writel(struct fmc_device *fmc, uint32_t val, int off);
17+
void *fmc_get_drvdata(struct fmc_device *fmc);
18+
void fmc_set_drvdata(struct fmc_device *fmc, void *data);
19+
20+
int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw,
21+
int sdb_entry);
22+
23+
The data structure that describe a device is detailed in *note FMC
24+
Device::, the one that describes a driver is detailed in *note FMC
25+
Driver::. Please note that structures of type fmc_device must be
26+
allocated by the caller, but must not be released after unregistering.
27+
The fmc-bus itself takes care of releasing the structure when their use
28+
count reaches zero - actually, the device model does that in lieu of us.
29+
30+
The functions to register and unregister n devices are meant to be used
31+
by carriers that host more than one mezzanine. The devices must all be
32+
registered at the same time because if the FPGA is reprogrammed, all
33+
devices in the array are affected. Usually, the driver matching the
34+
first device will reprogram the FPGA, so other devices must know they
35+
are already driven by a reprogrammed FPGA.
36+
37+
If a carrier hosts slots that are driven by different FPGA devices, it
38+
should register as a group only mezzanines that are driven by the same
39+
FPGA, for the reason outlined above.
40+
41+
Finally, the fmc_reprogram function calls the reprogram method (see
42+
*note The API Offered by Carriers:: and also scans the memory area for
43+
an SDB tree. You can pass -1 as sdb_entry to disable such scan.
44+
Otherwise, the function fails if no tree is found at the specified
45+
entry point. The function is meant to factorize common code, and by
46+
the time you read this it is already used by the spec-sw and fine-delay
47+
modules.

‎Documentation/fmc/FMC-and-SDB.txt‎

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
FMC (FPGA Mezzanine Card) is the standard we use for our I/O devices,
3+
in the context of White Rabbit and related hardware.
4+
5+
In our I/O environments we need to write drivers for each mezzanine
6+
card, and such drivers must work regardless of the carrier being used.
7+
To achieve this, we abstract the FMC interface.
8+
9+
We have a carrier for PCI-E called SPEC and one for VME called SVEC,
10+
but more are planned. Also, we support stand-alone devices (usually
11+
plugged on a SPEC card), controlled through Etherbone, developed by GSI.
12+
13+
Code and documentation for the FMC bus was born as part of the spec-sw
14+
project, but now it lives in its own project. Other projects, i.e.
15+
software support for the various carriers, should include this as a
16+
submodule.
17+
18+
The most up to date version of code and documentation is always
19+
available from the repository you can clone from:
20+
21+
git://ohwr.org/fmc-projects/fmc-bus.git (read-only)
22+
git@ohwr.org:fmc-projects/fmc-bus.git (read-write for developers)
23+
24+
Selected versions of the documentation, as well as complete tar
25+
archives for selected revisions are placed to the Files section of the
26+
project: `http://www.ohwr.org/projects/fmc-bus/files'
27+
28+
29+
What is FMC
30+
***********
31+
32+
FMC, as said, stands for "FPGA Mezzanine Card". It is a standard
33+
developed by the VME consortium called VITA (VMEbus International Trade
34+
Association and ratified by ANSI, the American National Standard
35+
Institute. The official documentation is called "ANSI-VITA 57.1".
36+
37+
The FMC card is an almost square PCB, around 70x75 millimeters, that is
38+
called mezzanine in this document. It usually lives plugged into
39+
another PCB for power supply and control; such bigger circuit board is
40+
called carrier from now on, and a single carrier may host more than one
41+
mezzanine.
42+
43+
In the typical application the mezzanine is mostly analog while the
44+
carrier is mostly digital, and hosts an FPGA that must be configured to
45+
match the specific mezzanine and the desired application. Thus, you may
46+
need to load different FPGA images to drive different instances of the
47+
same mezzanine.
48+
49+
FMC, as such, is not a bus in the usual meaning of the term, because
50+
most carriers have only one connector, and carriers with several
51+
connectors have completely separate electrical connections to them.
52+
This package, however, implements a bus as a software abstraction.
53+
54+
55+
What is SDB
56+
***********
57+
58+
SDB (Self Describing Bus) is a set of data structures that we use for
59+
enumerating the internal structure of an FPGA image. We also use it as
60+
a filesystem inside the FMC EEPROM.
61+
62+
SDB is not mandatory for use of this FMC kernel bus, but if you have SDB
63+
this package can make good use of it. SDB itself is developed in the
64+
fpga-config-space OHWR project. The link to the repository is
65+
`git://ohwr.org/hdl-core-lib/fpga-config-space.git' and what is used in
66+
this project lives in the sdbfs subdirectory in there.
67+
68+
SDB support for FMC is described in *note FMC Identification:: and
69+
*note SDB Support::
70+
71+
72+
SDB Support
73+
***********
74+
75+
The fmc.ko bus driver exports a few functions to help drivers taking
76+
advantage of the SDB information that may be present in your own FPGA
77+
memory image.
78+
79+
The module exports the following functions, in the special header
80+
<linux/fmc-sdb.h>. The linux/ prefix in the name is there because we
81+
plan to submit it upstream in the future, and don't want to force
82+
changes on our drivers if that happens.
83+
84+
int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
85+
void fmc_show_sdb_tree(struct fmc_device *fmc);
86+
signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
87+
uint32_t device, unsigned long *sz);
88+
int fmc_free_sdb_tree(struct fmc_device *fmc);

0 commit comments

Comments
 (0)