mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
"Highlights:
1) Support AES128-CCM ciphers in kTLS, from Vakul Garg.
2) Add fib_sync_mem to control the amount of dirty memory we allow to
queue up between synchronize RCU calls, from David Ahern.
3) Make flow classifier more lockless, from Vlad Buslov.
4) Add PHY downshift support to aquantia driver, from Heiner
Kallweit.
5) Add SKB cache for TCP rx and tx, from Eric Dumazet. This reduces
contention on SLAB spinlocks in heavy RPC workloads.
6) Partial GSO offload support in XFRM, from Boris Pismenny.
7) Add fast link down support to ethtool, from Heiner Kallweit.
8) Use siphash for IP ID generator, from Eric Dumazet.
9) Pull nexthops even further out from ipv4/ipv6 routes and FIB
entries, from David Ahern.
10) Move skb->xmit_more into a per-cpu variable, from Florian
Westphal.
11) Improve eBPF verifier speed and increase maximum program size,
from Alexei Starovoitov.
12) Eliminate per-bucket spinlocks in rhashtable, and instead use bit
spinlocks. From Neil Brown.
13) Allow tunneling with GUE encap in ipvs, from Jacky Hu.
14) Improve link partner cap detection in generic PHY code, from
Heiner Kallweit.
15) Add layer 2 encap support to bpf_skb_adjust_room(), from Alan
Maguire.
16) Remove SKB list implementation assumptions in SCTP, your's truly.
17) Various cleanups, optimizations, and simplifications in r8169
driver. From Heiner Kallweit.
18) Add memory accounting on TX and RX path of SCTP, from Xin Long.
19) Switch PHY drivers over to use dynamic featue detection, from
Heiner Kallweit.
20) Support flow steering without masking in dpaa2-eth, from Ioana
Ciocoi.
21) Implement ndo_get_devlink_port in netdevsim driver, from Jiri
Pirko.
22) Increase the strict parsing of current and future netlink
attributes, also export such policies to userspace. From Johannes
Berg.
23) Allow DSA tag drivers to be modular, from Andrew Lunn.
24) Remove legacy DSA probing support, also from Andrew Lunn.
25) Allow ll_temac driver to be used on non-x86 platforms, from Esben
Haabendal.
26) Add a generic tracepoint for TX queue timeouts to ease debugging,
from Cong Wang.
27) More indirect call optimizations, from Paolo Abeni"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1763 commits)
cxgb4: Fix error path in cxgb4_init_module
net: phy: improve pause mode reporting in phy_print_status
dt-bindings: net: Fix a typo in the phy-mode list for ethernet bindings
net: macb: Change interrupt and napi enable order in open
net: ll_temac: Improve error message on error IRQ
net/sched: remove block pointer from common offload structure
net: ethernet: support of_get_mac_address new ERR_PTR error
net: usb: smsc: fix warning reported by kbuild test robot
staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check
net: dsa: support of_get_mac_address new ERR_PTR error
net: dsa: sja1105: Fix status initialization in sja1105_get_ethtool_stats
vrf: sit mtu should not be updated when vrf netdev is the link
net: dsa: Fix error cleanup path in dsa_init_module
l2tp: Fix possible NULL pointer dereference
taprio: add null check on sched_nest to avoid potential null pointer dereference
net: mvpp2: cls: fix less than zero check on a u32 variable
net_sched: sch_fq: handle non connected flows
net_sched: sch_fq: do not assume EDT packets are ordered
net: hns3: use devm_kcalloc when allocating desc_cb
net: hns3: some cleanup for struct hns3_enet_ring
...
This commit is contained in:
@@ -387,14 +387,14 @@ ForEachMacros:
|
||||
- 'rhl_for_each_entry_rcu'
|
||||
- 'rhl_for_each_rcu'
|
||||
- 'rht_for_each'
|
||||
- 'rht_for_each_continue'
|
||||
- 'rht_for_each_from'
|
||||
- 'rht_for_each_entry'
|
||||
- 'rht_for_each_entry_continue'
|
||||
- 'rht_for_each_entry_from'
|
||||
- 'rht_for_each_entry_rcu'
|
||||
- 'rht_for_each_entry_rcu_continue'
|
||||
- 'rht_for_each_entry_rcu_from'
|
||||
- 'rht_for_each_entry_safe'
|
||||
- 'rht_for_each_rcu'
|
||||
- 'rht_for_each_rcu_continue'
|
||||
- 'rht_for_each_rcu_from'
|
||||
- '__rq_for_each_bio'
|
||||
- 'rq_for_each_bvec'
|
||||
- 'rq_for_each_segment'
|
||||
|
||||
9
.mailmap
9
.mailmap
@@ -16,6 +16,9 @@ Alan Cox <alan@lxorguk.ukuu.org.uk>
|
||||
Alan Cox <root@hraefn.swansea.linux.org.uk>
|
||||
Aleksey Gorelov <aleksey_gorelov@phoenix.com>
|
||||
Aleksandar Markovic <aleksandar.markovic@mips.com> <aleksandar.markovic@imgtec.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
|
||||
Al Viro <viro@ftp.linux.org.uk>
|
||||
Al Viro <viro@zenIV.linux.org.uk>
|
||||
Andi Shyti <andi@etezian.org> <andi.shyti@samsung.com>
|
||||
@@ -46,6 +49,12 @@ Christoph Hellwig <hch@lst.de>
|
||||
Christophe Ricard <christophe.ricard@gmail.com>
|
||||
Corey Minyard <minyard@acm.org>
|
||||
Damian Hobson-Garcia <dhobsong@igel.co.jp>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <dborkman@redhat.com>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <dborkmann@redhat.com>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <danborkmann@iogearbox.net>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <daniel.borkmann@tik.ee.ethz.ch>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <danborkmann@googlemail.com>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <dxchgb@gmail.com>
|
||||
David Brownell <david-b@pacbell.net>
|
||||
David Woodhouse <dwmw2@shinybook.infradead.org>
|
||||
Dengcheng Zhu <dzhu@wavecomp.com> <dengcheng.zhu@mips.com>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
This ABI is deprecated and will be removed after 2021. It is
|
||||
replaced with the batadv generic netlink family.
|
||||
|
||||
What: /sys/class/net/<iface>/batman-adv/elp_interval
|
||||
Date: Feb 2014
|
||||
@@ -1,3 +1,5 @@
|
||||
This ABI is deprecated and will be removed after 2021. It is
|
||||
replaced with the batadv generic netlink family.
|
||||
|
||||
What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
|
||||
Date: May 2010
|
||||
@@ -85,8 +85,33 @@ Q: Can loops be supported in a safe way?
|
||||
A: It's not clear yet.
|
||||
|
||||
BPF developers are trying to find a way to
|
||||
support bounded loops where the verifier can guarantee that
|
||||
the program terminates in less than 4096 instructions.
|
||||
support bounded loops.
|
||||
|
||||
Q: What are the verifier limits?
|
||||
--------------------------------
|
||||
A: The only limit known to the user space is BPF_MAXINSNS (4096).
|
||||
It's the maximum number of instructions that the unprivileged bpf
|
||||
program can have. The verifier has various internal limits.
|
||||
Like the maximum number of instructions that can be explored during
|
||||
program analysis. Currently, that limit is set to 1 million.
|
||||
Which essentially means that the largest program can consist
|
||||
of 1 million NOP instructions. There is a limit to the maximum number
|
||||
of subsequent branches, a limit to the number of nested bpf-to-bpf
|
||||
calls, a limit to the number of the verifier states per instruction,
|
||||
a limit to the number of maps used by the program.
|
||||
All these limits can be hit with a sufficiently complex program.
|
||||
There are also non-numerical limits that can cause the program
|
||||
to be rejected. The verifier used to recognize only pointer + constant
|
||||
expressions. Now it can recognize pointer + bounded_register.
|
||||
bpf_lookup_map_elem(key) had a requirement that 'key' must be
|
||||
a pointer to the stack. Now, 'key' can be a pointer to map value.
|
||||
The verifier is steadily getting 'smarter'. The limits are
|
||||
being removed. The only way to know that the program is going to
|
||||
be accepted by the verifier is to try to load it.
|
||||
The bpf development process guarantees that the future kernel
|
||||
versions will accept all bpf programs that were accepted by
|
||||
the earlier versions.
|
||||
|
||||
|
||||
Instruction level questions
|
||||
---------------------------
|
||||
|
||||
@@ -82,6 +82,8 @@ sequentially and type id is assigned to each recognized type starting from id
|
||||
#define BTF_KIND_RESTRICT 11 /* Restrict */
|
||||
#define BTF_KIND_FUNC 12 /* Function */
|
||||
#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
|
||||
#define BTF_KIND_VAR 14 /* Variable */
|
||||
#define BTF_KIND_DATASEC 15 /* Section */
|
||||
|
||||
Note that the type section encodes debug info, not just pure types.
|
||||
``BTF_KIND_FUNC`` is not a type, and it represents a defined subprogram.
|
||||
@@ -393,6 +395,61 @@ refers to parameter type.
|
||||
If the function has variable arguments, the last parameter is encoded with
|
||||
``name_off = 0`` and ``type = 0``.
|
||||
|
||||
2.2.14 BTF_KIND_VAR
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``struct btf_type`` encoding requirement:
|
||||
* ``name_off``: offset to a valid C identifier
|
||||
* ``info.kind_flag``: 0
|
||||
* ``info.kind``: BTF_KIND_VAR
|
||||
* ``info.vlen``: 0
|
||||
* ``type``: the type of the variable
|
||||
|
||||
``btf_type`` is followed by a single ``struct btf_variable`` with the
|
||||
following data::
|
||||
|
||||
struct btf_var {
|
||||
__u32 linkage;
|
||||
};
|
||||
|
||||
``struct btf_var`` encoding:
|
||||
* ``linkage``: currently only static variable 0, or globally allocated
|
||||
variable in ELF sections 1
|
||||
|
||||
Not all type of global variables are supported by LLVM at this point.
|
||||
The following is currently available:
|
||||
|
||||
* static variables with or without section attributes
|
||||
* global variables with section attributes
|
||||
|
||||
The latter is for future extraction of map key/value type id's from a
|
||||
map definition.
|
||||
|
||||
2.2.15 BTF_KIND_DATASEC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``struct btf_type`` encoding requirement:
|
||||
* ``name_off``: offset to a valid name associated with a variable or
|
||||
one of .data/.bss/.rodata
|
||||
* ``info.kind_flag``: 0
|
||||
* ``info.kind``: BTF_KIND_DATASEC
|
||||
* ``info.vlen``: # of variables
|
||||
* ``size``: total section size in bytes (0 at compilation time, patched
|
||||
to actual size by BPF loaders such as libbpf)
|
||||
|
||||
``btf_type`` is followed by ``info.vlen`` number of ``struct btf_var_secinfo``.::
|
||||
|
||||
struct btf_var_secinfo {
|
||||
__u32 type;
|
||||
__u32 offset;
|
||||
__u32 size;
|
||||
};
|
||||
|
||||
``struct btf_var_secinfo`` encoding:
|
||||
* ``type``: the type of the BTF_KIND_VAR variable
|
||||
* ``offset``: the in-section offset of the variable
|
||||
* ``size``: the size of the variable in bytes
|
||||
|
||||
3. BTF Kernel API
|
||||
*****************
|
||||
|
||||
|
||||
@@ -36,6 +36,16 @@ Two sets of Questions and Answers (Q&A) are maintained.
|
||||
bpf_devel_QA
|
||||
|
||||
|
||||
Program types
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
prog_cgroup_sysctl
|
||||
prog_flow_dissector
|
||||
|
||||
|
||||
.. Links:
|
||||
.. _Documentation/networking/filter.txt: ../networking/filter.txt
|
||||
.. _man-pages: https://www.kernel.org/doc/man-pages/
|
||||
|
||||
125
Documentation/bpf/prog_cgroup_sysctl.rst
Normal file
125
Documentation/bpf/prog_cgroup_sysctl.rst
Normal file
@@ -0,0 +1,125 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
===========================
|
||||
BPF_PROG_TYPE_CGROUP_SYSCTL
|
||||
===========================
|
||||
|
||||
This document describes ``BPF_PROG_TYPE_CGROUP_SYSCTL`` program type that
|
||||
provides cgroup-bpf hook for sysctl.
|
||||
|
||||
The hook has to be attached to a cgroup and will be called every time a
|
||||
process inside that cgroup tries to read from or write to sysctl knob in proc.
|
||||
|
||||
1. Attach type
|
||||
**************
|
||||
|
||||
``BPF_CGROUP_SYSCTL`` attach type has to be used to attach
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` program to a cgroup.
|
||||
|
||||
2. Context
|
||||
**********
|
||||
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` provides access to the following context from
|
||||
BPF program::
|
||||
|
||||
struct bpf_sysctl {
|
||||
__u32 write;
|
||||
__u32 file_pos;
|
||||
};
|
||||
|
||||
* ``write`` indicates whether sysctl value is being read (``0``) or written
|
||||
(``1``). This field is read-only.
|
||||
|
||||
* ``file_pos`` indicates file position sysctl is being accessed at, read
|
||||
or written. This field is read-write. Writing to the field sets the starting
|
||||
position in sysctl proc file ``read(2)`` will be reading from or ``write(2)``
|
||||
will be writing to. Writing zero to the field can be used e.g. to override
|
||||
whole sysctl value by ``bpf_sysctl_set_new_value()`` on ``write(2)`` even
|
||||
when it's called by user space on ``file_pos > 0``. Writing non-zero
|
||||
value to the field can be used to access part of sysctl value starting from
|
||||
specified ``file_pos``. Not all sysctl support access with ``file_pos !=
|
||||
0``, e.g. writes to numeric sysctl entries must always be at file position
|
||||
``0``. See also ``kernel.sysctl_writes_strict`` sysctl.
|
||||
|
||||
See `linux/bpf.h`_ for more details on how context field can be accessed.
|
||||
|
||||
3. Return code
|
||||
**************
|
||||
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` program must return one of the following
|
||||
return codes:
|
||||
|
||||
* ``0`` means "reject access to sysctl";
|
||||
* ``1`` means "proceed with access".
|
||||
|
||||
If program returns ``0`` user space will get ``-1`` from ``read(2)`` or
|
||||
``write(2)`` and ``errno`` will be set to ``EPERM``.
|
||||
|
||||
4. Helpers
|
||||
**********
|
||||
|
||||
Since sysctl knob is represented by a name and a value, sysctl specific BPF
|
||||
helpers focus on providing access to these properties:
|
||||
|
||||
* ``bpf_sysctl_get_name()`` to get sysctl name as it is visible in
|
||||
``/proc/sys`` into provided by BPF program buffer;
|
||||
|
||||
* ``bpf_sysctl_get_current_value()`` to get string value currently held by
|
||||
sysctl into provided by BPF program buffer. This helper is available on both
|
||||
``read(2)`` from and ``write(2)`` to sysctl;
|
||||
|
||||
* ``bpf_sysctl_get_new_value()`` to get new string value currently being
|
||||
written to sysctl before actual write happens. This helper can be used only
|
||||
on ``ctx->write == 1``;
|
||||
|
||||
* ``bpf_sysctl_set_new_value()`` to override new string value currently being
|
||||
written to sysctl before actual write happens. Sysctl value will be
|
||||
overridden starting from the current ``ctx->file_pos``. If the whole value
|
||||
has to be overridden BPF program can set ``file_pos`` to zero before calling
|
||||
to the helper. This helper can be used only on ``ctx->write == 1``. New
|
||||
string value set by the helper is treated and verified by kernel same way as
|
||||
an equivalent string passed by user space.
|
||||
|
||||
BPF program sees sysctl value same way as user space does in proc filesystem,
|
||||
i.e. as a string. Since many sysctl values represent an integer or a vector
|
||||
of integers, the following helpers can be used to get numeric value from the
|
||||
string:
|
||||
|
||||
* ``bpf_strtol()`` to convert initial part of the string to long integer
|
||||
similar to user space `strtol(3)`_;
|
||||
* ``bpf_strtoul()`` to convert initial part of the string to unsigned long
|
||||
integer similar to user space `strtoul(3)`_;
|
||||
|
||||
See `linux/bpf.h`_ for more details on helpers described here.
|
||||
|
||||
5. Examples
|
||||
***********
|
||||
|
||||
See `test_sysctl_prog.c`_ for an example of BPF program in C that access
|
||||
sysctl name and value, parses string value to get vector of integers and uses
|
||||
the result to make decision whether to allow or deny access to sysctl.
|
||||
|
||||
6. Notes
|
||||
********
|
||||
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` is intended to be used in **trusted** root
|
||||
environment, for example to monitor sysctl usage or catch unreasonable values
|
||||
an application, running as root in a separate cgroup, is trying to set.
|
||||
|
||||
Since `task_dfl_cgroup(current)` is called at `sys_read` / `sys_write` time it
|
||||
may return results different from that at `sys_open` time, i.e. process that
|
||||
opened sysctl file in proc filesystem may differ from process that is trying
|
||||
to read from / write to it and two such processes may run in different
|
||||
cgroups, what means ``BPF_PROG_TYPE_CGROUP_SYSCTL`` should not be used as a
|
||||
security mechanism to limit sysctl usage.
|
||||
|
||||
As with any cgroup-bpf program additional care should be taken if an
|
||||
application running as root in a cgroup should not be allowed to
|
||||
detach/replace BPF program attached by administrator.
|
||||
|
||||
.. Links
|
||||
.. _linux/bpf.h: ../../include/uapi/linux/bpf.h
|
||||
.. _strtol(3): http://man7.org/linux/man-pages/man3/strtol.3p.html
|
||||
.. _strtoul(3): http://man7.org/linux/man-pages/man3/strtoul.3p.html
|
||||
.. _test_sysctl_prog.c:
|
||||
../../tools/testing/selftests/bpf/progs/test_sysctl_prog.c
|
||||
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
==================
|
||||
BPF Flow Dissector
|
||||
==================
|
||||
============================
|
||||
BPF_PROG_TYPE_FLOW_DISSECTOR
|
||||
============================
|
||||
|
||||
Overview
|
||||
========
|
||||
@@ -46,9 +46,8 @@ Required properties:
|
||||
- reg: phy id used to communicate to phy.
|
||||
- device_type: Must be "ethernet-phy".
|
||||
|
||||
Optional properties:
|
||||
- local-mac-address: See ethernet.txt in the same directory.
|
||||
- max-frame-size: See ethernet.txt in the same directory.
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
ethernet.txt.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ Required properties:
|
||||
- phy-mode: See ethernet.txt file in the same directory
|
||||
|
||||
Optional properties:
|
||||
- mac-address: mac address to be assigned to the device. Can be overridden
|
||||
by UEFI.
|
||||
- dma-coherent: Present if dma operations are coherent
|
||||
- amd,per-channel-interrupt: Indicates that Rx and Tx complete will generate
|
||||
a unique interrupt for each DMA channel - this requires an additional
|
||||
@@ -34,6 +32,9 @@ Optional properties:
|
||||
0 - 1GbE and 10GbE (default)
|
||||
1 - 2.5GbE and 10GbE
|
||||
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
ethernet.txt.
|
||||
|
||||
The following optional properties are represented by an array with each
|
||||
value corresponding to a particular speed. The first array value represents
|
||||
the setting for the 1GbE speed, the second value for the 2.5GbE speed and
|
||||
|
||||
@@ -16,8 +16,8 @@ Required properties:
|
||||
registers (required for Northstar2)
|
||||
- interrupts: Interrupt number
|
||||
|
||||
Optional properties:
|
||||
- mac-address: See ethernet.txt file in the same directory
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Examples:
|
||||
|
||||
|
||||
@@ -49,10 +49,12 @@ Required properties:
|
||||
|
||||
Optional properties:
|
||||
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
|
||||
- mac-address : See ethernet.txt file in the same directory
|
||||
- phy_id : Specifies slave phy id (deprecated, use phy-handle)
|
||||
- phy-handle : See ethernet.txt file in the same directory
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Slave sub-nodes:
|
||||
- fixed-link : See fixed-link.txt file in the same directory
|
||||
|
||||
|
||||
@@ -20,11 +20,12 @@ Required properties:
|
||||
Optional properties:
|
||||
- phy-handle: See ethernet.txt file in the same directory.
|
||||
If absent, davinci_emac driver defaults to 100/FULL.
|
||||
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
|
||||
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
|
||||
- ti,davinci-rmii-en: 1 byte, 1 means use RMII
|
||||
- ti,davinci-no-bd-ram: boolean, does EMAC have BD RAM?
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example (enbw_cmc board):
|
||||
eth0: emac@1e20000 {
|
||||
compatible = "ti,davinci-dm6467-emac";
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Distributed Switch Architecture Device Tree Bindings
|
||||
----------------------------------------------------
|
||||
|
||||
Two bindings exist, one of which has been deprecated due to
|
||||
limitations.
|
||||
|
||||
Current Binding
|
||||
---------------
|
||||
|
||||
Switches are true Linux devices and can be probed by any means. Once
|
||||
probed, they register to the DSA framework, passing a node
|
||||
pointer. This node is expected to fulfil the following binding, and
|
||||
@@ -71,9 +65,8 @@ properties, described in binding documents:
|
||||
Documentation/devicetree/bindings/net/fixed-link.txt
|
||||
for details.
|
||||
|
||||
- local-mac-address : See
|
||||
Documentation/devicetree/bindings/net/ethernet.txt
|
||||
for details.
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example
|
||||
|
||||
@@ -262,152 +255,3 @@ linked into one DSA cluster.
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Deprecated Binding
|
||||
------------------
|
||||
|
||||
The deprecated binding makes use of a platform device to represent the
|
||||
switches. The switches themselves are not Linux devices, and make use
|
||||
of an MDIO bus for management.
|
||||
|
||||
Required properties:
|
||||
- compatible : Should be "marvell,dsa"
|
||||
- #address-cells : Must be 2, first cell is the address on the MDIO bus
|
||||
and second cell is the address in the switch tree.
|
||||
Second cell is used only when cascading/chaining.
|
||||
- #size-cells : Must be 0
|
||||
- dsa,ethernet : Should be a phandle to a valid Ethernet device node
|
||||
- dsa,mii-bus : Should be a phandle to a valid MDIO bus device node
|
||||
|
||||
Optional properties:
|
||||
- interrupts : property with a value describing the switch
|
||||
interrupt number (not supported by the driver)
|
||||
|
||||
A DSA node can contain multiple switch chips which are therefore child nodes of
|
||||
the parent DSA node. The maximum number of allowed child nodes is 4
|
||||
(DSA_MAX_SWITCHES).
|
||||
Each of these switch child nodes should have the following required properties:
|
||||
|
||||
- reg : Contains two fields. The first one describes the
|
||||
address on the MII bus. The second is the switch
|
||||
number that must be unique in cascaded configurations
|
||||
- #address-cells : Must be 1
|
||||
- #size-cells : Must be 0
|
||||
|
||||
A switch child node has the following optional property:
|
||||
|
||||
- eeprom-length : Set to the length of an EEPROM connected to the
|
||||
switch. Must be set if the switch can not detect
|
||||
the presence and/or size of a connected EEPROM,
|
||||
otherwise optional.
|
||||
|
||||
A switch may have multiple "port" children nodes
|
||||
|
||||
Each port children node must have the following mandatory properties:
|
||||
- reg : Describes the port address in the switch
|
||||
- label : Describes the label associated with this port, special
|
||||
labels are "cpu" to indicate a CPU port and "dsa" to
|
||||
indicate an uplink/downlink port.
|
||||
|
||||
Note that a port labelled "dsa" will imply checking for the uplink phandle
|
||||
described below.
|
||||
|
||||
Optional property:
|
||||
- link : Should be a list of phandles to another switch's DSA port.
|
||||
This property is only used when switches are being
|
||||
chained/cascaded together. This port is used as outgoing port
|
||||
towards the phandle port, which can be more than one hop away.
|
||||
|
||||
- phy-handle : Phandle to a PHY on an external MDIO bus, not the
|
||||
switch internal one. See
|
||||
Documentation/devicetree/bindings/net/ethernet.txt
|
||||
for details.
|
||||
|
||||
- phy-mode : String representing the connection to the designated
|
||||
PHY node specified by the 'phy-handle' property. See
|
||||
Documentation/devicetree/bindings/net/ethernet.txt
|
||||
for details.
|
||||
|
||||
- mii-bus : Should be a phandle to a valid MDIO bus device node.
|
||||
This mii-bus will be used in preference to the
|
||||
global dsa,mii-bus defined above, for this switch.
|
||||
|
||||
Optional subnodes:
|
||||
- fixed-link : Fixed-link subnode describing a link to a non-MDIO
|
||||
managed entity. See
|
||||
Documentation/devicetree/bindings/net/fixed-link.txt
|
||||
for details.
|
||||
|
||||
Example:
|
||||
|
||||
dsa@0 {
|
||||
compatible = "marvell,dsa";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <0>;
|
||||
|
||||
interrupts = <10>;
|
||||
dsa,ethernet = <ðernet0>;
|
||||
dsa,mii-bus = <&mii_bus0>;
|
||||
|
||||
switch@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <16 0>; /* MDIO address 16, switch 0 in tree */
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
label = "lan1";
|
||||
phy-handle = <&phy0>;
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
port@5 {
|
||||
reg = <5>;
|
||||
label = "cpu";
|
||||
};
|
||||
|
||||
switch0port6: port@6 {
|
||||
reg = <6>;
|
||||
label = "dsa";
|
||||
link = <&switch1port0
|
||||
&switch2port0>;
|
||||
};
|
||||
};
|
||||
|
||||
switch@1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <17 1>; /* MDIO address 17, switch 1 in tree */
|
||||
mii-bus = <&mii_bus1>;
|
||||
reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
|
||||
|
||||
switch1port0: port@0 {
|
||||
reg = <0>;
|
||||
label = "dsa";
|
||||
link = <&switch0port6>;
|
||||
};
|
||||
switch1port1: port@1 {
|
||||
reg = <1>;
|
||||
label = "dsa";
|
||||
link = <&switch2port1>;
|
||||
};
|
||||
};
|
||||
|
||||
switch@2 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <18 2>; /* MDIO address 18, switch 2 in tree */
|
||||
mii-bus = <&mii_bus1>;
|
||||
|
||||
switch2port0: port@0 {
|
||||
reg = <0>;
|
||||
label = "dsa";
|
||||
link = <&switch1port1
|
||||
&switch0port6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
156
Documentation/devicetree/bindings/net/dsa/sja1105.txt
Normal file
156
Documentation/devicetree/bindings/net/dsa/sja1105.txt
Normal file
@@ -0,0 +1,156 @@
|
||||
NXP SJA1105 switch driver
|
||||
=========================
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible:
|
||||
Must be one of:
|
||||
- "nxp,sja1105e"
|
||||
- "nxp,sja1105t"
|
||||
- "nxp,sja1105p"
|
||||
- "nxp,sja1105q"
|
||||
- "nxp,sja1105r"
|
||||
- "nxp,sja1105s"
|
||||
|
||||
Although the device ID could be detected at runtime, explicit bindings
|
||||
are required in order to be able to statically check their validity.
|
||||
For example, SGMII can only be specified on port 4 of R and S devices,
|
||||
and the non-SGMII devices, while pin-compatible, are not equal in terms
|
||||
of support for RGMII internal delays (supported on P/Q/R/S, but not on
|
||||
E/T).
|
||||
|
||||
Optional properties:
|
||||
|
||||
- sja1105,role-mac:
|
||||
- sja1105,role-phy:
|
||||
Boolean properties that can be assigned under each port node. By
|
||||
default (unless otherwise specified) a port is configured as MAC if it
|
||||
is driving a PHY (phy-handle is present) or as PHY if it is PHY-less
|
||||
(fixed-link specified, presumably because it is connected to a MAC).
|
||||
The effect of this property (in either its implicit or explicit form)
|
||||
is:
|
||||
- In the case of MII or RMII it specifies whether the SJA1105 port is a
|
||||
clock source or sink for this interface (not applicable for RGMII
|
||||
where there is a Tx and an Rx clock).
|
||||
- In the case of RGMII it affects the behavior regarding internal
|
||||
delays:
|
||||
1. If sja1105,role-mac is specified, and the phy-mode property is one
|
||||
of "rgmii-id", "rgmii-txid" or "rgmii-rxid", then the entity
|
||||
designated to apply the delay/clock skew necessary for RGMII
|
||||
is the PHY. The SJA1105 MAC does not apply any internal delays.
|
||||
2. If sja1105,role-phy is specified, and the phy-mode property is one
|
||||
of the above, the designated entity to apply the internal delays
|
||||
is the SJA1105 MAC (if hardware-supported). This is only supported
|
||||
by the second-generation (P/Q/R/S) hardware. On a first-generation
|
||||
E or T device, it is an error to specify an RGMII phy-mode other
|
||||
than "rgmii" for a port that is in fixed-link mode. In that case,
|
||||
the clock skew must either be added by the MAC at the other end of
|
||||
the fixed-link, or by PCB serpentine traces on the board.
|
||||
These properties are required, for example, in the case where SJA1105
|
||||
ports are at both ends of a MII/RMII PHY-less setup. One end would need
|
||||
to have sja1105,role-mac, while the other sja1105,role-phy.
|
||||
|
||||
See Documentation/devicetree/bindings/net/dsa/dsa.txt for the list of standard
|
||||
DSA required and optional properties.
|
||||
|
||||
Other observations
|
||||
------------------
|
||||
|
||||
The SJA1105 SPI interface requires a CS-to-CLK time (t2 in UM10944) of at least
|
||||
one half of t_CLK. At an SPI frequency of 1MHz, this means a minimum
|
||||
cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed
|
||||
depends on the SPI bus master driver.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
Ethernet switch connected via SPI to the host, CPU port wired to enet2:
|
||||
|
||||
arch/arm/boot/dts/ls1021a-tsn.dts:
|
||||
|
||||
/* SPI controller of the LS1021 */
|
||||
&dspi0 {
|
||||
sja1105@1 {
|
||||
reg = <0x1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "nxp,sja1105t";
|
||||
spi-max-frequency = <4000000>;
|
||||
fsl,spi-cs-sck-delay = <1000>;
|
||||
fsl,spi-sck-cs-delay = <1000>;
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
port@0 {
|
||||
/* ETH5 written on chassis */
|
||||
label = "swp5";
|
||||
phy-handle = <&rgmii_phy6>;
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <0>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@1 {
|
||||
/* ETH2 written on chassis */
|
||||
label = "swp2";
|
||||
phy-handle = <&rgmii_phy3>;
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <1>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@2 {
|
||||
/* ETH3 written on chassis */
|
||||
label = "swp3";
|
||||
phy-handle = <&rgmii_phy4>;
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <2>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@3 {
|
||||
/* ETH4 written on chassis */
|
||||
phy-handle = <&rgmii_phy5>;
|
||||
label = "swp4";
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <3>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@4 {
|
||||
/* Internal port connected to eth2 */
|
||||
ethernet = <&enet2>;
|
||||
phy-mode = "rgmii";
|
||||
reg = <4>;
|
||||
/* Implicit "sja1105,role-phy;" */
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* MDIO controller of the LS1021 */
|
||||
&mdio0 {
|
||||
/* BCM5464 */
|
||||
rgmii_phy3: ethernet-phy@3 {
|
||||
reg = <0x3>;
|
||||
};
|
||||
rgmii_phy4: ethernet-phy@4 {
|
||||
reg = <0x4>;
|
||||
};
|
||||
rgmii_phy5: ethernet-phy@5 {
|
||||
reg = <0x5>;
|
||||
};
|
||||
rgmii_phy6: ethernet-phy@6 {
|
||||
reg = <0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
/* Ethernet master port of the LS1021 */
|
||||
&enet2 {
|
||||
phy-connection-type = "rgmii";
|
||||
status = "ok";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
@@ -4,12 +4,14 @@ NOTE: All 'phy*' properties documented below are Ethernet specific. For the
|
||||
generic PHY 'phys' property, see
|
||||
Documentation/devicetree/bindings/phy/phy-bindings.txt.
|
||||
|
||||
- local-mac-address: array of 6 bytes, specifies the MAC address that was
|
||||
assigned to the network device;
|
||||
- mac-address: array of 6 bytes, specifies the MAC address that was last used by
|
||||
the boot program; should be used in cases where the MAC address assigned to
|
||||
the device by the boot program is different from the "local-mac-address"
|
||||
property;
|
||||
- local-mac-address: array of 6 bytes, specifies the MAC address that was
|
||||
assigned to the network device;
|
||||
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
|
||||
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
|
||||
- max-speed: number, specifies maximum speed in Mbit/s supported by the device;
|
||||
- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
|
||||
the maximum frame size (there's contradiction in the Devicetree
|
||||
@@ -36,7 +38,7 @@ Documentation/devicetree/bindings/phy/phy-bindings.txt.
|
||||
* "smii"
|
||||
* "xgmii"
|
||||
* "trgmii"
|
||||
* "2000base-x",
|
||||
* "1000base-x",
|
||||
* "2500base-x",
|
||||
* "rxaui"
|
||||
* "xaui"
|
||||
|
||||
@@ -14,7 +14,6 @@ Required properties:
|
||||
the PHY reset signal(optional).
|
||||
- reset-names: should contain the reset signal name "mac"(required)
|
||||
and "phy"(optional).
|
||||
- mac-address: see ethernet.txt [1].
|
||||
- phy-mode: see ethernet.txt [1].
|
||||
- phy-handle: see ethernet.txt [1].
|
||||
- hisilicon,phy-reset-delays-us: triplet of delays if PHY reset signal given.
|
||||
@@ -22,6 +21,9 @@ Required properties:
|
||||
The 2nd cell is reset pulse in micro seconds.
|
||||
The 3rd cell is reset post-delay in micro seconds.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt[1].
|
||||
|
||||
[1] Documentation/devicetree/bindings/net/ethernet.txt
|
||||
|
||||
Example:
|
||||
|
||||
@@ -18,7 +18,6 @@ Required properties:
|
||||
- #size-cells: must be <0>.
|
||||
- phy-mode: see ethernet.txt [1].
|
||||
- phy-handle: see ethernet.txt [1].
|
||||
- mac-address: see ethernet.txt [1].
|
||||
- clocks: clock phandle and specifier pair.
|
||||
- clock-names: contain the clock name "mac_core"(required) and "mac_ifc"(optional).
|
||||
- resets: should contain the phandle to the MAC core reset signal(optional),
|
||||
@@ -31,6 +30,9 @@ Required properties:
|
||||
The 2nd cell is reset pulse in micro seconds.
|
||||
The 3rd cell is reset post-delay in micro seconds.
|
||||
|
||||
The MAC address will be determined using the properties defined in
|
||||
ethernet.txt[1].
|
||||
|
||||
- PHY subnode: inherits from phy binding [2]
|
||||
|
||||
[1] Documentation/devicetree/bindings/net/ethernet.txt
|
||||
|
||||
@@ -135,14 +135,14 @@ Optional properties:
|
||||
are swapped. The netcp driver will swap the two DWORDs
|
||||
back to the proper order when this property is set to 2
|
||||
when it obtains the mac address from efuse.
|
||||
- local-mac-address: the driver is designed to use the of_get_mac_address api
|
||||
only if efuse-mac is 0. When efuse-mac is 0, the MAC
|
||||
address is obtained from local-mac-address. If this
|
||||
attribute is not present, then the driver will use a
|
||||
random MAC address.
|
||||
- "netcp-device label": phandle to the device specification for each of NetCP
|
||||
sub-module attached to this interface.
|
||||
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
ethernet.txt, as provided by the of_get_mac_address API and only if efuse-mac
|
||||
is set to 0. If any of the optional MAC address properties are not present,
|
||||
then the driver will use random MAC address.
|
||||
|
||||
Example binding:
|
||||
|
||||
netcp: netcp@2000000 {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user