Skip to content

Commit

Permalink
Merge tag 'char-misc-3.11-rc1' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  ...
  • Loading branch information
torvalds committed Jul 2, 2013
2 parents ce49b62 + 3806726 commit fe3c22b
Show file tree
Hide file tree
Showing 130 changed files with 5,322 additions and 919 deletions.
2 changes: 2 additions & 0 deletions Documentation/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ firmware_class/
- request_firmware() hotplug interface info.
flexible-arrays.txt
- how to make use of flexible sized arrays in linux
fmc/
- information about the FMC bus abstraction
frv/
- Fujitsu FR-V Linux documentation.
futex-requeue-pi.txt
Expand Down
19 changes: 19 additions & 0 deletions Documentation/devicetree/bindings/ata/atmel-at91_cf.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Atmel AT91RM9200 CompactFlash

Required properties:
- compatible : "atmel,at91rm9200-cf".
- reg : should specify localbus address and size used.
- gpios : specifies the gpio pins to control the CF device. Detect
and reset gpio's are mandatory while irq and vcc gpio's are
optional and may be set to 0 if not present.

Example:
compact-flash@50000000 {
compatible = "atmel,at91rm9200-cf";
reg = <0x50000000 0x30000000>;
gpios = <&pioC 13 0 /* irq */
&pioC 15 0 /* detect */
0 /* vcc */
&pioC 5 0 /* reset */
>;
};
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/extcon/extcon-twl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
EXTCON FOR TWL CHIPS

PALMAS USB COMPARATOR
Required Properties:
- compatible : Should be "ti,palmas-usb" or "ti,twl6035-usb"
- vbus-supply : phandle to the regulator device tree node.

Optional Properties:
- ti,wakeup : To enable the wakeup comparator in probe

palmas-usb {
compatible = "ti,twl6035-usb", "ti,palmas-usb";
vbus-supply = <&smps10_reg>;
ti,wakeup;
};
156 changes: 156 additions & 0 deletions Documentation/devicetree/bindings/memory-controllers/mvebu-devbus.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
Device tree bindings for MVEBU Device Bus controllers

The Device Bus controller available in some Marvell's SoC allows to control
different types of standard memory and I/O devices such as NOR, NAND, and FPGA.
The actual devices are instantiated from the child nodes of a Device Bus node.

Required properties:

- compatible: Currently only Armada 370/XP SoC are supported,
with this compatible string:

marvell,mvebu-devbus

- reg: A resource specifier for the register space.
This is the base address of a chip select within
the controller's register space.
(see the example below)

- #address-cells: Must be set to 1
- #size-cells: Must be set to 1
- ranges: Must be set up to reflect the memory layout with four
integer values for each chip-select line in use:
0 <physical address of mapping> <size>

Mandatory timing properties for child nodes:

Read parameters:

- devbus,turn-off-ps: Defines the time during which the controller does not
drive the AD bus after the completion of a device read.
This prevents contentions on the Device Bus after a read
cycle from a slow device.

- devbus,bus-width: Defines the bus width (e.g. <16>)

- devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle,
to read data sample. This parameter is useful for
synchronous pipelined devices, where the address
precedes the read data by one or two cycles.

- devbus,acc-first-ps: Defines the time delay from the negation of
ALE[0] to the cycle that the first read data is sampled
by the controller.

- devbus,acc-next-ps: Defines the time delay between the cycle that
samples data N and the cycle that samples data N+1
(in burst accesses).

- devbus,rd-setup-ps: Defines the time delay between DEV_CSn assertion to
DEV_OEn assertion. If set to 0 (default),
DEV_OEn and DEV_CSn are asserted at the same cycle.
This parameter has no affect on <acc-first-ps> parameter
(no affect on first data sample). Set <rd-setup-ps>
to a value smaller than <acc-first-ps>.

- devbus,rd-hold-ps: Defines the time between the last data sample to the
de-assertion of DEV_CSn. If set to 0 (default),
DEV_OEn and DEV_CSn are de-asserted at the same cycle
(the cycle of the last data sample).
This parameter has no affect on DEV_OEn de-assertion.
DEV_OEn is always de-asserted the next cycle after
last data sampled. Also this parameter has no
affect on <turn-off-ps> parameter.
Set <rd-hold-ps> to a value smaller than <turn-off-ps>.

Write parameters:

- devbus,ale-wr-ps: Defines the time delay from the ALE[0] negation cycle
to the DEV_WEn assertion.

- devbus,wr-low-ps: Defines the time during which DEV_WEn is active.
A[2:0] and Data are kept valid as long as DEV_WEn
is active. This parameter defines the setup time of
address and data to DEV_WEn rise.

- devbus,wr-high-ps: Defines the time during which DEV_WEn is kept
inactive (high) between data beats of a burst write.
DEV_A[2:0] and Data are kept valid (do not toggle) for
<wr-high-ps> - <tick> ps.
This parameter defines the hold time of address and
data after DEV_WEn rise.

- devbus,sync-enable: Synchronous device enable.
1: True
0: False

An example for an Armada XP GP board, with a 16 MiB NOR device as child
is showed below. Note that the Device Bus driver is in charge of allocating
the mbus address decoding window for each of its child devices.
The window is created using the chip select specified in the child
device node together with the base address and size specified in the ranges
property. For instance, in the example below the allocated decoding window
will start at base address 0xf0000000, with a size 0x1000000 (16 MiB)
for chip select 0 (a.k.a DEV_BOOTCS).

This address window handling is done in this mvebu-devbus only as a temporary
solution. It will be removed when the support for mbus device tree binding is
added.

The reg property implicitly specifies the chip select as this:

0x10400: DEV_BOOTCS
0x10408: DEV_CS0
0x10410: DEV_CS1
0x10418: DEV_CS2
0x10420: DEV_CS3

Example:

devbus-bootcs@d0010400 {
status = "okay";
ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */
#address-cells = <1>;
#size-cells = <1>;

/* Device Bus parameters are required */

/* Read parameters */
devbus,bus-width = <8>;
devbus,turn-off-ps = <60000>;
devbus,badr-skew-ps = <0>;
devbus,acc-first-ps = <124000>;
devbus,acc-next-ps = <248000>;
devbus,rd-setup-ps = <0>;
devbus,rd-hold-ps = <0>;

/* Write parameters */
devbus,sync-enable = <0>;
devbus,wr-high-ps = <60000>;
devbus,wr-low-ps = <60000>;
devbus,ale-wr-ps = <60000>;

flash@0 {
compatible = "cfi-flash";

/* 16 MiB */
reg = <0 0x1000000>;
bank-width = <2>;
#address-cells = <1>;
#size-cells = <1>;

/*
* We split the 16 MiB in two partitions,
* just as an example.
*/
partition@0 {
label = "First";
reg = <0 0x800000>;
};

partition@800000 {
label = "Second";
reg = <0x800000 0x800000>;
};
};
};
38 changes: 38 additions & 0 deletions Documentation/fmc/00-INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

Documentation in this directory comes from sections of the manual we
wrote for the externally-developed fmc-bus package. The complete
manual as of today (2013-02) is available in PDF format at
http://www.ohwr.org/projects/fmc-bus/files

00-INDEX
- this file.

FMC-and-SDB.txt
- What are FMC and SDB, basic concepts for this framework

API.txt
- The functions that are exported by the bus driver

parameters.txt
- The module parameters

carrier.txt
- writing a carrier (a device)

mezzanine.txt
- writing code for your mezzanine (a driver)

identifiers.txt
- how identification and matching works

fmc-fakedev.txt
- about drivers/fmc/fmc-fakedev.ko

fmc-trivial.txt
- about drivers/fmc/fmc-trivial.ko

fmc-write-eeprom.txt
- about drivers/fmc/fmc-write-eeprom.ko

fmc-chardev.txt
- about drivers/fmc/fmc-chardev.ko
47 changes: 47 additions & 0 deletions Documentation/fmc/API.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Functions Exported by fmc.ko
****************************

The FMC core exports the usual 4 functions that are needed for a bus to
work, and a few more:

int fmc_driver_register(struct fmc_driver *drv);
void fmc_driver_unregister(struct fmc_driver *drv);
int fmc_device_register(struct fmc_device *fmc);
void fmc_device_unregister(struct fmc_device *fmc);

int fmc_device_register_n(struct fmc_device **fmc, int n);
void fmc_device_unregister_n(struct fmc_device **fmc, int n);

uint32_t fmc_readl(struct fmc_device *fmc, int offset);
void fmc_writel(struct fmc_device *fmc, uint32_t val, int off);
void *fmc_get_drvdata(struct fmc_device *fmc);
void fmc_set_drvdata(struct fmc_device *fmc, void *data);

int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw,
int sdb_entry);

The data structure that describe a device is detailed in *note FMC
Device::, the one that describes a driver is detailed in *note FMC
Driver::. Please note that structures of type fmc_device must be
allocated by the caller, but must not be released after unregistering.
The fmc-bus itself takes care of releasing the structure when their use
count reaches zero - actually, the device model does that in lieu of us.

The functions to register and unregister n devices are meant to be used
by carriers that host more than one mezzanine. The devices must all be
registered at the same time because if the FPGA is reprogrammed, all
devices in the array are affected. Usually, the driver matching the
first device will reprogram the FPGA, so other devices must know they
are already driven by a reprogrammed FPGA.

If a carrier hosts slots that are driven by different FPGA devices, it
should register as a group only mezzanines that are driven by the same
FPGA, for the reason outlined above.

Finally, the fmc_reprogram function calls the reprogram method (see
*note The API Offered by Carriers:: and also scans the memory area for
an SDB tree. You can pass -1 as sdb_entry to disable such scan.
Otherwise, the function fails if no tree is found at the specified
entry point. The function is meant to factorize common code, and by
the time you read this it is already used by the spec-sw and fine-delay
modules.
88 changes: 88 additions & 0 deletions Documentation/fmc/FMC-and-SDB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

FMC (FPGA Mezzanine Card) is the standard we use for our I/O devices,
in the context of White Rabbit and related hardware.

In our I/O environments we need to write drivers for each mezzanine
card, and such drivers must work regardless of the carrier being used.
To achieve this, we abstract the FMC interface.

We have a carrier for PCI-E called SPEC and one for VME called SVEC,
but more are planned. Also, we support stand-alone devices (usually
plugged on a SPEC card), controlled through Etherbone, developed by GSI.

Code and documentation for the FMC bus was born as part of the spec-sw
project, but now it lives in its own project. Other projects, i.e.
software support for the various carriers, should include this as a
submodule.

The most up to date version of code and documentation is always
available from the repository you can clone from:

git://ohwr.org/fmc-projects/fmc-bus.git (read-only)
[email protected]:fmc-projects/fmc-bus.git (read-write for developers)

Selected versions of the documentation, as well as complete tar
archives for selected revisions are placed to the Files section of the
project: `http://www.ohwr.org/projects/fmc-bus/files'


What is FMC
***********

FMC, as said, stands for "FPGA Mezzanine Card". It is a standard
developed by the VME consortium called VITA (VMEbus International Trade
Association and ratified by ANSI, the American National Standard
Institute. The official documentation is called "ANSI-VITA 57.1".

The FMC card is an almost square PCB, around 70x75 millimeters, that is
called mezzanine in this document. It usually lives plugged into
another PCB for power supply and control; such bigger circuit board is
called carrier from now on, and a single carrier may host more than one
mezzanine.

In the typical application the mezzanine is mostly analog while the
carrier is mostly digital, and hosts an FPGA that must be configured to
match the specific mezzanine and the desired application. Thus, you may
need to load different FPGA images to drive different instances of the
same mezzanine.

FMC, as such, is not a bus in the usual meaning of the term, because
most carriers have only one connector, and carriers with several
connectors have completely separate electrical connections to them.
This package, however, implements a bus as a software abstraction.


What is SDB
***********

SDB (Self Describing Bus) is a set of data structures that we use for
enumerating the internal structure of an FPGA image. We also use it as
a filesystem inside the FMC EEPROM.

SDB is not mandatory for use of this FMC kernel bus, but if you have SDB
this package can make good use of it. SDB itself is developed in the
fpga-config-space OHWR project. The link to the repository is
`git://ohwr.org/hdl-core-lib/fpga-config-space.git' and what is used in
this project lives in the sdbfs subdirectory in there.

SDB support for FMC is described in *note FMC Identification:: and
*note SDB Support::


SDB Support
***********

The fmc.ko bus driver exports a few functions to help drivers taking
advantage of the SDB information that may be present in your own FPGA
memory image.

The module exports the following functions, in the special header
<linux/fmc-sdb.h>. The linux/ prefix in the name is there because we
plan to submit it upstream in the future, and don't want to force
changes on our drivers if that happens.

int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
void fmc_show_sdb_tree(struct fmc_device *fmc);
signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
uint32_t device, unsigned long *sz);
int fmc_free_sdb_tree(struct fmc_device *fmc);
Loading

0 comments on commit fe3c22b

Please sign in to comment.