mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
Merge branch 'for-4.12/dax' into libnvdimm-for-next
This commit is contained in:
commit
736163671b
110 changed files with 4759 additions and 2054 deletions
|
|
@ -128,9 +128,6 @@
|
|||
</sect1>
|
||||
<sect1 id="Device_model_support"><title>Device model support</title>
|
||||
!Idrivers/rapidio/rio-driver.c
|
||||
</sect1>
|
||||
<sect1 id="Sysfs_support"><title>Sysfs support</title>
|
||||
!Idrivers/rapidio/rio-sysfs.c
|
||||
</sect1>
|
||||
<sect1 id="PPC32_support"><title>PPC32 support</title>
|
||||
!Iarch/powerpc/sysdev/fsl_rio.c
|
||||
|
|
|
|||
44
Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt
Normal file
44
Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
DT bindings for the Hitachi HD44780 Character LCD Controller
|
||||
|
||||
The Hitachi HD44780 Character LCD Controller is commonly used on character LCDs
|
||||
that can display one or more lines of text. It exposes an M6800 bus interface,
|
||||
which can be used in either 4-bit or 8-bit mode.
|
||||
|
||||
Required properties:
|
||||
- compatible: Must contain "hit,hd44780",
|
||||
- data-gpios: Must contain an array of either 4 or 8 GPIO specifiers,
|
||||
referring to the GPIO pins connected to the data signal lines DB0-DB7
|
||||
(8-bit mode) or DB4-DB7 (4-bit mode) of the LCD Controller's bus interface,
|
||||
- enable-gpios: Must contain a GPIO specifier, referring to the GPIO pin
|
||||
connected to the "E" (Enable) signal line of the LCD Controller's bus
|
||||
interface,
|
||||
- rs-gpios: Must contain a GPIO specifier, referring to the GPIO pin
|
||||
connected to the "RS" (Register Select) signal line of the LCD Controller's
|
||||
bus interface,
|
||||
- display-height: Height of the display, in character cells,
|
||||
- display-width: Width of the display, in character cells.
|
||||
|
||||
Optional properties:
|
||||
- rw-gpios: Must contain a GPIO specifier, referring to the GPIO pin
|
||||
connected to the "RW" (Read/Write) signal line of the LCD Controller's bus
|
||||
interface,
|
||||
- backlight-gpios: Must contain a GPIO specifier, referring to the GPIO pin
|
||||
used for enabling the LCD's backlight,
|
||||
- internal-buffer-width: Internal buffer width (default is 40 for displays
|
||||
with 1 or 2 lines, and display-width for displays with more than 2 lines).
|
||||
|
||||
Example:
|
||||
|
||||
auxdisplay {
|
||||
compatible = "hit,hd44780";
|
||||
|
||||
data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>,
|
||||
<&hc595 1 GPIO_ACTIVE_HIGH>,
|
||||
<&hc595 2 GPIO_ACTIVE_HIGH>,
|
||||
<&hc595 3 GPIO_ACTIVE_HIGH>;
|
||||
enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
|
||||
rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
display-height = <2>;
|
||||
display-width = <16>;
|
||||
};
|
||||
|
|
@ -186,6 +186,7 @@ Optional properties:
|
|||
otherwise full reconfiguration is done.
|
||||
- external-fpga-config : boolean, set if the FPGA has already been configured
|
||||
prior to OS boot up.
|
||||
- encrypted-fpga-config : boolean, set if the bitstream is encrypted
|
||||
- region-unfreeze-timeout-us : The maximum time in microseconds to wait for
|
||||
bridges to successfully become enabled after the region has been
|
||||
programmed.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
Lattice iCE40 FPGA Manager
|
||||
|
||||
Required properties:
|
||||
- compatible: Should contain "lattice,ice40-fpga-mgr"
|
||||
- reg: SPI chip select
|
||||
- spi-max-frequency: Maximum SPI frequency (>=1000000, <=25000000)
|
||||
- cdone-gpios: GPIO input connected to CDONE pin
|
||||
- reset-gpios: Active-low GPIO output connected to CRESET_B pin. Note
|
||||
that unless the GPIO is held low during startup, the
|
||||
FPGA will enter Master SPI mode and drive SCK with a
|
||||
clock signal potentially jamming other devices on the
|
||||
bus until the firmware is loaded.
|
||||
|
||||
Example:
|
||||
fpga: fpga@0 {
|
||||
compatible = "lattice,ice40-fpga-mgr";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <1000000>;
|
||||
cdone-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
|
||||
reset-gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
|
@ -6,36 +6,15 @@ Driver registration
|
|||
|
||||
As with other subsystems within the Linux kernel, VME device drivers register
|
||||
with the VME subsystem, typically called from the devices init routine. This is
|
||||
achieved via a call to the following function:
|
||||
achieved via a call to :c:func:`vme_register_driver`.
|
||||
|
||||
.. code-block:: c
|
||||
A pointer to a structure of type :c:type:`struct vme_driver <vme_driver>` must
|
||||
be provided to the registration function. Along with the maximum number of
|
||||
devices your driver is able to support.
|
||||
|
||||
int vme_register_driver (struct vme_driver *driver, unsigned int ndevs);
|
||||
|
||||
If driver registration is successful this function returns zero, if an error
|
||||
occurred a negative error code will be returned.
|
||||
|
||||
A pointer to a structure of type 'vme_driver' must be provided to the
|
||||
registration function. Along with ndevs, which is the number of devices your
|
||||
driver is able to support. The structure is as follows:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_driver {
|
||||
struct list_head node;
|
||||
const char *name;
|
||||
int (*match)(struct vme_dev *);
|
||||
int (*probe)(struct vme_dev *);
|
||||
int (*remove)(struct vme_dev *);
|
||||
void (*shutdown)(void);
|
||||
struct device_driver driver;
|
||||
struct list_head devices;
|
||||
unsigned int ndev;
|
||||
};
|
||||
|
||||
At the minimum, the '.name', '.match' and '.probe' elements of this structure
|
||||
should be correctly set. The '.name' element is a pointer to a string holding
|
||||
the device driver's name.
|
||||
At the minimum, the '.name', '.match' and '.probe' elements of
|
||||
:c:type:`struct vme_driver <vme_driver>` should be correctly set. The '.name'
|
||||
element is a pointer to a string holding the device driver's name.
|
||||
|
||||
The '.match' function allows control over which VME devices should be registered
|
||||
with the driver. The match function should return 1 if a device should be
|
||||
|
|
@ -54,29 +33,16 @@ the number of devices probed to one:
|
|||
}
|
||||
|
||||
The '.probe' element should contain a pointer to the probe routine. The
|
||||
probe routine is passed a 'struct vme_dev' pointer as an argument. The
|
||||
'struct vme_dev' structure looks like the following:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_dev {
|
||||
int num;
|
||||
struct vme_bridge *bridge;
|
||||
struct device dev;
|
||||
struct list_head drv_list;
|
||||
struct list_head bridge_list;
|
||||
};
|
||||
probe routine is passed a :c:type:`struct vme_dev <vme_dev>` pointer as an
|
||||
argument.
|
||||
|
||||
Here, the 'num' field refers to the sequential device ID for this specific
|
||||
driver. The bridge number (or bus number) can be accessed using
|
||||
dev->bridge->num.
|
||||
|
||||
A function is also provided to unregister the driver from the VME core and is
|
||||
usually called from the device driver's exit routine:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
void vme_unregister_driver (struct vme_driver *driver);
|
||||
A function is also provided to unregister the driver from the VME core called
|
||||
:c:func:`vme_unregister_driver` and should usually be called from the device
|
||||
driver's exit routine.
|
||||
|
||||
|
||||
Resource management
|
||||
|
|
@ -90,47 +56,29 @@ driver is called. The probe routine is passed a pointer to the devices
|
|||
device structure. This pointer should be saved, it will be required for
|
||||
requesting VME resources.
|
||||
|
||||
The driver can request ownership of one or more master windows, slave windows
|
||||
and/or dma channels. Rather than allowing the device driver to request a
|
||||
specific window or DMA channel (which may be used by a different driver) this
|
||||
driver allows a resource to be assigned based on the required attributes of the
|
||||
driver in question:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_resource * vme_master_request(struct vme_dev *dev,
|
||||
u32 aspace, u32 cycle, u32 width);
|
||||
|
||||
struct vme_resource * vme_slave_request(struct vme_dev *dev, u32 aspace,
|
||||
u32 cycle);
|
||||
|
||||
struct vme_resource *vme_dma_request(struct vme_dev *dev, u32 route);
|
||||
|
||||
For slave windows these attributes are split into the VME address spaces that
|
||||
need to be accessed in 'aspace' and VME bus cycle types required in 'cycle'.
|
||||
Master windows add a further set of attributes in 'width' specifying the
|
||||
required data transfer widths. These attributes are defined as bitmasks and as
|
||||
such any combination of the attributes can be requested for a single window,
|
||||
the core will assign a window that meets the requirements, returning a pointer
|
||||
of type vme_resource that should be used to identify the allocated resource
|
||||
when it is used. For DMA controllers, the request function requires the
|
||||
potential direction of any transfers to be provided in the route attributes.
|
||||
This is typically VME-to-MEM and/or MEM-to-VME, though some hardware can
|
||||
support VME-to-VME and MEM-to-MEM transfers as well as test pattern generation.
|
||||
If an unallocated window fitting the requirements can not be found a NULL
|
||||
pointer will be returned.
|
||||
The driver can request ownership of one or more master windows
|
||||
(:c:func:`vme_master_request`), slave windows (:c:func:`vme_slave_request`)
|
||||
and/or dma channels (:c:func:`vme_dma_request`). Rather than allowing the device
|
||||
driver to request a specific window or DMA channel (which may be used by a
|
||||
different driver) the API allows a resource to be assigned based on the required
|
||||
attributes of the driver in question. For slave windows these attributes are
|
||||
split into the VME address spaces that need to be accessed in 'aspace' and VME
|
||||
bus cycle types required in 'cycle'. Master windows add a further set of
|
||||
attributes in 'width' specifying the required data transfer widths. These
|
||||
attributes are defined as bitmasks and as such any combination of the
|
||||
attributes can be requested for a single window, the core will assign a window
|
||||
that meets the requirements, returning a pointer of type vme_resource that
|
||||
should be used to identify the allocated resource when it is used. For DMA
|
||||
controllers, the request function requires the potential direction of any
|
||||
transfers to be provided in the route attributes. This is typically VME-to-MEM
|
||||
and/or MEM-to-VME, though some hardware can support VME-to-VME and MEM-to-MEM
|
||||
transfers as well as test pattern generation. If an unallocated window fitting
|
||||
the requirements can not be found a NULL pointer will be returned.
|
||||
|
||||
Functions are also provided to free window allocations once they are no longer
|
||||
required. These functions should be passed the pointer to the resource provided
|
||||
during resource allocation:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
void vme_master_free(struct vme_resource *res);
|
||||
|
||||
void vme_slave_free(struct vme_resource *res);
|
||||
|
||||
void vme_dma_free(struct vme_resource *res);
|
||||
required. These functions (:c:func:`vme_master_free`, :c:func:`vme_slave_free`
|
||||
and :c:func:`vme_dma_free`) should be passed the pointer to the resource
|
||||
provided during resource allocation.
|
||||
|
||||
|
||||
Master windows
|
||||
|
|
@ -144,61 +92,22 @@ the underlying chipset. A window must be configured before it can be used.
|
|||
Master window configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Once a master window has been assigned the following functions can be used to
|
||||
configure it and retrieve the current settings:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_master_set (struct vme_resource *res, int enabled,
|
||||
unsigned long long base, unsigned long long size, u32 aspace,
|
||||
u32 cycle, u32 width);
|
||||
|
||||
int vme_master_get (struct vme_resource *res, int *enabled,
|
||||
unsigned long long *base, unsigned long long *size, u32 *aspace,
|
||||
u32 *cycle, u32 *width);
|
||||
|
||||
The address spaces, transfer widths and cycle types are the same as described
|
||||
Once a master window has been assigned :c:func:`vme_master_set` can be used to
|
||||
configure it and :c:func:`vme_master_get` to retrieve the current settings. The
|
||||
address spaces, transfer widths and cycle types are the same as described
|
||||
under resource management, however some of the options are mutually exclusive.
|
||||
For example, only one address space may be specified.
|
||||
|
||||
These functions return 0 on success or an error code should the call fail.
|
||||
|
||||
|
||||
Master window access
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The following functions can be used to read from and write to configured master
|
||||
windows. These functions return the number of bytes copied:
|
||||
The function :c:func:`vme_master_read` can be used to read from and
|
||||
:c:func:`vme_master_write` used to write to configured master windows.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
ssize_t vme_master_read(struct vme_resource *res, void *buf,
|
||||
size_t count, loff_t offset);
|
||||
|
||||
ssize_t vme_master_write(struct vme_resource *res, void *buf,
|
||||
size_t count, loff_t offset);
|
||||
|
||||
In addition to simple reads and writes, a function is provided to do a
|
||||
read-modify-write transaction. This function returns the original value of the
|
||||
VME bus location :
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
unsigned int vme_master_rmw (struct vme_resource *res,
|
||||
unsigned int mask, unsigned int compare, unsigned int swap,
|
||||
loff_t offset);
|
||||
|
||||
This functions by reading the offset, applying the mask. If the bits selected in
|
||||
the mask match with the values of the corresponding bits in the compare field,
|
||||
the value of swap is written the specified offset.
|
||||
|
||||
Parts of a VME window can be mapped into user space memory using the following
|
||||
function:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_master_mmap(struct vme_resource *resource,
|
||||
struct vm_area_struct *vma)
|
||||
In addition to simple reads and writes, :c:func:`vme_master_rmw` is provided to
|
||||
do a read-modify-write transaction. Parts of a VME window can also be mapped
|
||||
into user space memory using :c:func:`vme_master_mmap`.
|
||||
|
||||
|
||||
Slave windows
|
||||
|
|
@ -213,41 +122,23 @@ it can be used.
|
|||
Slave window configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Once a slave window has been assigned the following functions can be used to
|
||||
configure it and retrieve the current settings:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_slave_set (struct vme_resource *res, int enabled,
|
||||
unsigned long long base, unsigned long long size,
|
||||
dma_addr_t mem, u32 aspace, u32 cycle);
|
||||
|
||||
int vme_slave_get (struct vme_resource *res, int *enabled,
|
||||
unsigned long long *base, unsigned long long *size,
|
||||
dma_addr_t *mem, u32 *aspace, u32 *cycle);
|
||||
Once a slave window has been assigned :c:func:`vme_slave_set` can be used to
|
||||
configure it and :c:func:`vme_slave_get` to retrieve the current settings.
|
||||
|
||||
The address spaces, transfer widths and cycle types are the same as described
|
||||
under resource management, however some of the options are mutually exclusive.
|
||||
For example, only one address space may be specified.
|
||||
|
||||
These functions return 0 on success or an error code should the call fail.
|
||||
|
||||
|
||||
Slave window buffer allocation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Functions are provided to allow the user to allocate and free a contiguous
|
||||
buffers which will be accessible by the VME bridge. These functions do not have
|
||||
to be used, other methods can be used to allocate a buffer, though care must be
|
||||
taken to ensure that they are contiguous and accessible by the VME bridge:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
void * vme_alloc_consistent(struct vme_resource *res, size_t size,
|
||||
dma_addr_t *mem);
|
||||
|
||||
void vme_free_consistent(struct vme_resource *res, size_t size,
|
||||
void *virt, dma_addr_t mem);
|
||||
Functions are provided to allow the user to allocate
|
||||
(:c:func:`vme_alloc_consistent`) and free (:c:func:`vme_free_consistent`)
|
||||
contiguous buffers which will be accessible by the VME bridge. These functions
|
||||
do not have to be used, other methods can be used to allocate a buffer, though
|
||||
care must be taken to ensure that they are contiguous and accessible by the VME
|
||||
bridge.
|
||||
|
||||
|
||||
Slave window access
|
||||
|
|
@ -269,29 +160,18 @@ executed, reused and destroyed.
|
|||
List Management
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
The following functions are provided to create and destroy DMA lists. Execution
|
||||
of a list will not automatically destroy the list, thus enabling a list to be
|
||||
reused for repetitive tasks:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_dma_list *vme_new_dma_list(struct vme_resource *res);
|
||||
|
||||
int vme_dma_list_free(struct vme_dma_list *list);
|
||||
The function :c:func:`vme_new_dma_list` is provided to create and
|
||||
:c:func:`vme_dma_list_free` to destroy DMA lists. Execution of a list will not
|
||||
automatically destroy the list, thus enabling a list to be reused for repetitive
|
||||
tasks.
|
||||
|
||||
|
||||
List Population
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
An item can be added to a list using the following function ( the source and
|
||||
An item can be added to a list using :c:func:`vme_dma_list_add` (the source and
|
||||
destination attributes need to be created before calling this function, this is
|
||||
covered under "Transfer Attributes"):
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_dma_list_add(struct vme_dma_list *list,
|
||||
struct vme_dma_attr *src, struct vme_dma_attr *dest,
|
||||
size_t count);
|
||||
covered under "Transfer Attributes").
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
@ -310,41 +190,19 @@ an item to a list. This is due to the diverse attributes required for each type
|
|||
of source and destination. There are functions to create attributes for PCI, VME
|
||||
and pattern sources and destinations (where appropriate):
|
||||
|
||||
Pattern source:
|
||||
- PCI source or destination: :c:func:`vme_dma_pci_attribute`
|
||||
- VME source or destination: :c:func:`vme_dma_vme_attribute`
|
||||
- Pattern source: :c:func:`vme_dma_pattern_attribute`
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_dma_attr *vme_dma_pattern_attribute(u32 pattern, u32 type);
|
||||
|
||||
PCI source or destination:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t mem);
|
||||
|
||||
VME source or destination:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long base,
|
||||
u32 aspace, u32 cycle, u32 width);
|
||||
|
||||
The following function should be used to free an attribute:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
void vme_dma_free_attribute(struct vme_dma_attr *attr);
|
||||
The function :c:func:`vme_dma_free_attribute` should be used to free an
|
||||
attribute.
|
||||
|
||||
|
||||
List Execution
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
The following function queues a list for execution. The function will return
|
||||
once the list has been executed:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_dma_list_exec(struct vme_dma_list *list);
|
||||
The function :c:func:`vme_dma_list_exec` queues a list for execution and will
|
||||
return once the list has been executed.
|
||||
|
||||
|
||||
Interrupts
|
||||
|
|
@ -358,20 +216,13 @@ specific VME level and status IDs.
|
|||
Attaching Interrupt Handlers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The following functions can be used to attach and free a specific VME level and
|
||||
status ID combination. Any given combination can only be assigned a single
|
||||
callback function. A void pointer parameter is provided, the value of which is
|
||||
passed to the callback function, the use of this pointer is user undefined:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_irq_request(struct vme_dev *dev, int level, int statid,
|
||||
void (*callback)(int, int, void *), void *priv);
|
||||
|
||||
void vme_irq_free(struct vme_dev *dev, int level, int statid);
|
||||
|
||||
The callback parameters are as follows. Care must be taken in writing a callback
|
||||
function, callback functions run in interrupt context:
|
||||
The function :c:func:`vme_irq_request` can be used to attach and
|
||||
:c:func:`vme_irq_free` to free a specific VME level and status ID combination.
|
||||
Any given combination can only be assigned a single callback function. A void
|
||||
pointer parameter is provided, the value of which is passed to the callback
|
||||
function, the use of this pointer is user undefined. The callback parameters are
|
||||
as follows. Care must be taken in writing a callback function, callback
|
||||
functions run in interrupt context:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
|
|
@ -381,12 +232,8 @@ function, callback functions run in interrupt context:
|
|||
Interrupt Generation
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The following function can be used to generate a VME interrupt at a given VME
|
||||
level and VME status ID:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_irq_generate(struct vme_dev *dev, int level, int statid);
|
||||
The function :c:func:`vme_irq_generate` can be used to generate a VME interrupt
|
||||
at a given VME level and VME status ID.
|
||||
|
||||
|
||||
Location monitors
|
||||
|
|
@ -399,54 +246,29 @@ monitor.
|
|||
Location Monitor Management
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The following functions are provided to request the use of a block of location
|
||||
monitors and to free them after they are no longer required:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct vme_resource * vme_lm_request(struct vme_dev *dev);
|
||||
|
||||
void vme_lm_free(struct vme_resource * res);
|
||||
|
||||
Each block may provide a number of location monitors, monitoring adjacent
|
||||
locations. The following function can be used to determine how many locations
|
||||
are provided:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_lm_count(struct vme_resource * res);
|
||||
The function :c:func:`vme_lm_request` is provided to request the use of a block
|
||||
of location monitors and :c:func:`vme_lm_free` to free them after they are no
|
||||
longer required. Each block may provide a number of location monitors,
|
||||
monitoring adjacent locations. The function :c:func:`vme_lm_count` can be used
|
||||
to determine how many locations are provided.
|
||||
|
||||
|
||||
Location Monitor Configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Once a bank of location monitors has been allocated, the following functions
|
||||
are provided to configure the location and mode of the location monitor:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_lm_set(struct vme_resource *res, unsigned long long base,
|
||||
u32 aspace, u32 cycle);
|
||||
|
||||
int vme_lm_get(struct vme_resource *res, unsigned long long *base,
|
||||
u32 *aspace, u32 *cycle);
|
||||
Once a bank of location monitors has been allocated, the function
|
||||
:c:func:`vme_lm_set` is provided to configure the location and mode of the
|
||||
location monitor. The function :c:func:`vme_lm_get` can be used to retrieve
|
||||
existing settings.
|
||||
|
||||
|
||||
Location Monitor Use
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The following functions allow a callback to be attached and detached from each
|
||||
location monitor location. Each location monitor can monitor a number of
|
||||
adjacent locations:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_lm_attach(struct vme_resource *res, int num,
|
||||
void (*callback)(void *));
|
||||
|
||||
int vme_lm_detach(struct vme_resource *res, int num);
|
||||
|
||||
The callback function is declared as follows.
|
||||
The function :c:func:`vme_lm_attach` enables a callback to be attached and
|
||||
:c:func:`vme_lm_detach` allows on to be detached from each location monitor
|
||||
location. Each location monitor can monitor a number of adjacent locations. The
|
||||
callback function is declared as follows.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
|
|
@ -456,19 +278,20 @@ The callback function is declared as follows.
|
|||
Slot Detection
|
||||
--------------
|
||||
|
||||
This function returns the slot ID of the provided bridge.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_slot_num(struct vme_dev *dev);
|
||||
The function :c:func:`vme_slot_num` returns the slot ID of the provided bridge.
|
||||
|
||||
|
||||
Bus Detection
|
||||
-------------
|
||||
|
||||
This function returns the bus ID of the provided bridge.
|
||||
The function :c:func:`vme_bus_num` returns the bus ID of the provided bridge.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int vme_bus_num(struct vme_dev *dev);
|
||||
VME API
|
||||
-------
|
||||
|
||||
.. kernel-doc:: include/linux/vme.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: drivers/vme/vme.c
|
||||
:export:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@
|
|||
- This file
|
||||
w1_therm
|
||||
- The Maxim/Dallas Semiconductor ds18*20 temperature sensor.
|
||||
w1_ds2413
|
||||
- The Maxim/Dallas Semiconductor ds2413 dual channel addressable switch.
|
||||
w1_ds2423
|
||||
- The Maxim/Dallas Semiconductor ds2423 counter device.
|
||||
w1_ds2438
|
||||
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
|
||||
w1_ds28e04
|
||||
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
|
||||
|
|
|
|||
50
Documentation/w1/slaves/w1_ds2413
Normal file
50
Documentation/w1/slaves/w1_ds2413
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
Kernel driver w1_ds2413
|
||||
=======================
|
||||
|
||||
Supported chips:
|
||||
* Maxim DS2413 1-Wire Dual Channel Addressable Switch
|
||||
|
||||
supported family codes:
|
||||
W1_FAMILY_DS2413 0x3A
|
||||
|
||||
Author: Mariusz Bialonczyk <manio@skyboo.net>
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The DS2413 chip has two open-drain outputs (PIO A and PIO B).
|
||||
Support is provided through the sysfs files "output" and "state".
|
||||
|
||||
Reading state
|
||||
-------------
|
||||
The "state" file provides one-byte value which is in the same format as for
|
||||
the chip PIO_ACCESS_READ command (refer the datasheet for details):
|
||||
|
||||
Bit 0: PIOA Pin State
|
||||
Bit 1: PIOA Output Latch State
|
||||
Bit 2: PIOB Pin State
|
||||
Bit 3: PIOB Output Latch State
|
||||
Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
|
||||
|
||||
This file is readonly.
|
||||
|
||||
Writing output
|
||||
--------------
|
||||
You can set the PIO pins using the "output" file.
|
||||
It is writable, you can write one-byte value to this sysfs file.
|
||||
Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
|
||||
|
||||
Bit 0: PIOA
|
||||
Bit 1: PIOB
|
||||
Bit 2-7: No matter (driver will set it to "1"s)
|
||||
|
||||
|
||||
The chip has some kind of basic protection against transmission errors.
|
||||
When reading the state, there is a four complement bits.
|
||||
The driver is checking this complement, and when it is wrong then it is
|
||||
returning I/O error.
|
||||
|
||||
When writing output, the master must repeat the PIO Output Data byte in
|
||||
its inverted form and it is waiting for a confirmation.
|
||||
If the write is unsuccessful for three times, the write also returns
|
||||
I/O error.
|
||||
63
Documentation/w1/slaves/w1_ds2438
Normal file
63
Documentation/w1/slaves/w1_ds2438
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
Kernel driver w1_ds2438
|
||||
=======================
|
||||
|
||||
Supported chips:
|
||||
* Maxim DS2438 Smart Battery Monitor
|
||||
|
||||
supported family codes:
|
||||
W1_FAMILY_DS2438 0x26
|
||||
|
||||
Author: Mariusz Bialonczyk <manio@skyboo.net>
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The DS2438 chip provides several functions that are desirable to carry in
|
||||
a battery pack. It also has a 40 bytes of nonvolatile EEPROM.
|
||||
Because the ability of temperature, current and voltage measurement, the chip
|
||||
is also often used in weather stations and applications such as: rain gauge,
|
||||
wind speed/direction measuring, humidity sensing, etc.
|
||||
|
||||
Current support is provided through the following sysfs files (all files
|
||||
except "iad" are readonly):
|
||||
|
||||
"iad"
|
||||
-----
|
||||
This file controls the 'Current A/D Control Bit' (IAD) in the
|
||||
Status/Configuration Register.
|
||||
Writing a zero value will clear the IAD bit and disables the current
|
||||
measurements.
|
||||
Writing value "1" is setting the IAD bit (enables the measurements).
|
||||
The IAD bit is enabled by default in the DS2438.
|
||||
|
||||
When writing to sysfs file bits 2-7 are ignored, so it's safe to write ASCII.
|
||||
An I/O error is returned when there is a problem setting the new value.
|
||||
|
||||
"page0"
|
||||
-------
|
||||
This file provides full 8 bytes of the chip Page 0 (00h).
|
||||
This page contains the most frequently accessed information of the DS2438.
|
||||
Internally when this file is read, the additional CRC byte is also obtained
|
||||
from the slave device. If it is correct, the 8 bytes page data are passed
|
||||
to userspace, otherwise an I/O error is returned.
|
||||
|
||||
"temperature"
|
||||
-------------
|
||||
Opening and reading this file initiates the CONVERT_T (temperature conversion)
|
||||
command of the chip, afterwards the temperature is read from the device
|
||||
registers and provided as an ASCII decimal value.
|
||||
|
||||
Important: The returned value has to be divided by 256 to get a real
|
||||
temperature in degrees Celsius.
|
||||
|
||||
"vad", "vdd"
|
||||
------------
|
||||
Opening and reading this file initiates the CONVERT_V (voltage conversion)
|
||||
command of the chip.
|
||||
|
||||
Depending on a sysfs filename a different input for the A/D will be selected:
|
||||
vad: general purpose A/D input (VAD)
|
||||
vdd: battery input (VDD)
|
||||
|
||||
After the voltage conversion the value is returned as decimal ASCII.
|
||||
Note: The value is in mV, so to get a volts the value has to be divided by 10.
|
||||
|
|
@ -5109,7 +5109,6 @@ F: include/uapi/linux/firewire*.h
|
|||
F: tools/firewire/
|
||||
|
||||
FIRMWARE LOADER (request_firmware)
|
||||
M: Ming Lei <ming.lei@canonical.com>
|
||||
M: Luis R. Rodriguez <mcgrof@kernel.org>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
|
|
|
|||
|
|
@ -210,6 +210,28 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
|
|||
.phy_id = 1,
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
|
||||
|
||||
/* Relative to EP93XX_CS1_PHYS_BASE */
|
||||
#define TS73XX_FPGA_LOADER_BASE 0x03c00000
|
||||
|
||||
static struct resource ts73xx_fpga_resources[] = {
|
||||
{
|
||||
.start = EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
|
||||
.end = EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device ts73xx_fpga_device = {
|
||||
.name = "ts73xx-fpga-mgr",
|
||||
.id = -1,
|
||||
.resource = ts73xx_fpga_resources,
|
||||
.num_resources = ARRAY_SIZE(ts73xx_fpga_resources),
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static void __init ts72xx_init_machine(void)
|
||||
{
|
||||
ep93xx_init_devices();
|
||||
|
|
@ -218,6 +240,10 @@ static void __init ts72xx_init_machine(void)
|
|||
platform_device_register(&ts72xx_wdt_device);
|
||||
|
||||
ep93xx_register_eth(&ts72xx_eth_data, 1);
|
||||
#if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
|
||||
if (board_is_ts7300())
|
||||
platform_device_register(&ts73xx_fpga_device);
|
||||
#endif
|
||||
}
|
||||
|
||||
MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ config CPM2
|
|||
config AXON_RAM
|
||||
tristate "Axon DDR2 memory device driver"
|
||||
depends on PPC_IBM_CELL_BLADE && BLOCK
|
||||
select DAX
|
||||
default m
|
||||
help
|
||||
It registers one block device per Axon's DDR2 memory bank found
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/dax.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
|
|
@ -62,6 +63,7 @@ static int azfs_major, azfs_minor;
|
|||
struct axon_ram_bank {
|
||||
struct platform_device *device;
|
||||
struct gendisk *disk;
|
||||
struct dax_device *dax_dev;
|
||||
unsigned int irq_id;
|
||||
unsigned long ph_addr;
|
||||
unsigned long io_addr;
|
||||
|
|
@ -137,25 +139,32 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
|
|||
return BLK_QC_T_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* axon_ram_direct_access - direct_access() method for block device
|
||||
* @device, @sector, @data: see block_device_operations method
|
||||
*/
|
||||
static const struct block_device_operations axon_ram_devops = {
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static long
|
||||
axon_ram_direct_access(struct block_device *device, sector_t sector,
|
||||
void **kaddr, pfn_t *pfn, long size)
|
||||
__axon_ram_direct_access(struct axon_ram_bank *bank, pgoff_t pgoff, long nr_pages,
|
||||
void **kaddr, pfn_t *pfn)
|
||||
{
|
||||
struct axon_ram_bank *bank = device->bd_disk->private_data;
|
||||
loff_t offset = (loff_t)sector << AXON_RAM_SECTOR_SHIFT;
|
||||
resource_size_t offset = pgoff * PAGE_SIZE;
|
||||
|
||||
*kaddr = (void *) bank->io_addr + offset;
|
||||
*pfn = phys_to_pfn_t(bank->ph_addr + offset, PFN_DEV);
|
||||
return bank->size - offset;
|
||||
return (bank->size - offset) / PAGE_SIZE;
|
||||
}
|
||||
|
||||
static const struct block_device_operations axon_ram_devops = {
|
||||
.owner = THIS_MODULE,
|
||||
.direct_access = axon_ram_direct_access
|
||||
static long
|
||||
axon_ram_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
|
||||
void **kaddr, pfn_t *pfn)
|
||||
{
|
||||
struct axon_ram_bank *bank = dax_get_private(dax_dev);
|
||||
|
||||
return __axon_ram_direct_access(bank, pgoff, nr_pages, kaddr, pfn);
|
||||
}
|
||||
|
||||
static const struct dax_operations axon_ram_dax_ops = {
|
||||
.direct_access = axon_ram_dax_direct_access,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -219,6 +228,7 @@ static int axon_ram_probe(struct platform_device *device)
|
|||
goto failed;
|
||||
}
|
||||
|
||||
|
||||
bank->disk->major = azfs_major;
|
||||
bank->disk->first_minor = azfs_minor;
|
||||
bank->disk->fops = &axon_ram_devops;
|
||||
|
|
@ -227,6 +237,13 @@ static int axon_ram_probe(struct platform_device *device)
|
|||
sprintf(bank->disk->disk_name, "%s%d",
|
||||
AXON_RAM_DEVICE_NAME, axon_ram_bank_id);
|
||||
|
||||
bank->dax_dev = alloc_dax(bank, bank->disk->disk_name,
|
||||
&axon_ram_dax_ops);
|
||||
if (!bank->dax_dev) {
|
||||
rc = -ENOMEM;
|
||||
goto failed;
|
||||
}
|
||||
|
||||
bank->disk->queue = blk_alloc_queue(GFP_KERNEL);
|
||||
if (bank->disk->queue == NULL) {
|
||||
dev_err(&device->dev, "Cannot register disk queue\n");
|
||||
|
|
@ -278,6 +295,8 @@ failed:
|
|||
del_gendisk(bank->disk);
|
||||
put_disk(bank->disk);
|
||||
}
|
||||
kill_dax(bank->dax_dev);
|
||||
put_dax(bank->dax_dev);
|
||||
device->dev.platform_data = NULL;
|
||||
if (bank->io_addr != 0)
|
||||
iounmap((void __iomem *) bank->io_addr);
|
||||
|
|
@ -300,6 +319,8 @@ axon_ram_remove(struct platform_device *device)
|
|||
|
||||
device_remove_file(&device->dev, &dev_attr_ecc);
|
||||
free_irq(bank->irq_id, device);
|
||||
kill_dax(bank->dax_dev);
|
||||
put_dax(bank->dax_dev);
|
||||
del_gendisk(bank->disk);
|
||||
put_disk(bank->disk);
|
||||
iounmap((void __iomem *) bank->io_addr);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <linux/vmalloc.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/clockchips.h>
|
||||
|
||||
#include <linux/hyperv.h>
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
|
||||
|
|
|
|||
|
|
@ -44,11 +44,6 @@ static inline void arch_memcpy_to_pmem(void *dst, const void *src, size_t n)
|
|||
BUG();
|
||||
}
|
||||
|
||||
static inline int arch_memcpy_from_pmem(void *dst, const void *src, size_t n)
|
||||
{
|
||||
return memcpy_mcsafe(dst, src, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* arch_wb_cache_pmem - write back a cache range with CLWB
|
||||
* @vaddr: virtual start address
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ int strcmp(const char *cs, const char *ct);
|
|||
#define memset(s, c, n) __memset(s, c, n)
|
||||
#endif
|
||||
|
||||
#define __HAVE_ARCH_MEMCPY_MCSAFE 1
|
||||
__must_check int memcpy_mcsafe_unrolled(void *dst, const void *src, size_t cnt);
|
||||
DECLARE_STATIC_KEY_FALSE(mcsafe_key);
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@
|
|||
* Recommend using hypercall for address space switches rather
|
||||
* than MOV to CR3 instruction
|
||||
*/
|
||||
#define HV_X64_MWAIT_RECOMMENDED (1 << 0)
|
||||
#define HV_X64_AS_SWITCH_RECOMMENDED (1 << 0)
|
||||
/* Recommend using hypercall for local TLB flushes rather
|
||||
* than INVLPG or MOV to CR3 instructions */
|
||||
#define HV_X64_LOCAL_TLB_FLUSH_RECOMMENDED (1 << 1)
|
||||
|
|
@ -147,6 +147,11 @@
|
|||
*/
|
||||
#define HV_X64_RELAXED_TIMING_RECOMMENDED (1 << 5)
|
||||
|
||||
/*
|
||||
* Virtual APIC support
|
||||
*/
|
||||
#define HV_X64_DEPRECATING_AEOI_RECOMMENDED (1 << 9)
|
||||
|
||||
/*
|
||||
* Crash notification flag.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ menuconfig BLOCK
|
|||
default y
|
||||
select SBITMAP
|
||||
select SRCU
|
||||
select DAX
|
||||
help
|
||||
Provide block layer support for the kernel.
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include <linux/kmod.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/dax.h>
|
||||
#include <linux/blktrace_api.h>
|
||||
|
||||
#include "partitions/check.h"
|
||||
|
|
@ -631,24 +630,12 @@ int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct page *read_pagecache_sector(struct block_device *bdev, sector_t n)
|
||||
{
|
||||
struct address_space *mapping = bdev->bd_inode->i_mapping;
|
||||
|
||||
return read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_SHIFT-9)),
|
||||
NULL);
|
||||
}
|
||||
|
||||
unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
|
||||
{
|
||||
struct address_space *mapping = bdev->bd_inode->i_mapping;
|
||||
struct page *page;
|
||||
|
||||
/* don't populate page cache for dax capable devices */
|
||||
if (IS_DAX(bdev->bd_inode))
|
||||
page = read_dax_sector(bdev, n);
|
||||
else
|
||||
page = read_pagecache_sector(bdev, n);
|
||||
|
||||
page = read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_SHIFT-9)), NULL);
|
||||
if (!IS_ERR(page)) {
|
||||
if (PageError(page))
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ obj-$(CONFIG_PARPORT) += parport/
|
|||
obj-$(CONFIG_NVM) += lightnvm/
|
||||
obj-y += base/ block/ misc/ mfd/ nfc/
|
||||
obj-$(CONFIG_LIBNVDIMM) += nvdimm/
|
||||
obj-$(CONFIG_DEV_DAX) += dax/
|
||||
obj-$(CONFIG_DAX) += dax/
|
||||
obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
|
||||
obj-$(CONFIG_NUBUS) += nubus/
|
||||
obj-y += macintosh/
|
||||
|
|
|
|||
|
|
@ -1849,8 +1849,7 @@ static int acpi_nfit_blk_single_io(struct nfit_blk *nfit_blk,
|
|||
mmio_flush_range((void __force *)
|
||||
mmio->addr.aperture + offset, c);
|
||||
|
||||
memcpy_from_pmem(iobuf + copied,
|
||||
mmio->addr.aperture + offset, c);
|
||||
memcpy(iobuf + copied, mmio->addr.aperture + offset, c);
|
||||
}
|
||||
|
||||
copied += c;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue