<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/soc/mscc, branch v5.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-09-25T03:00:40Z</updated>
<entry>
<title>net: mscc: ocelot: fix fields offset in SG_CONFIG_REG_3</title>
<updated>2020-09-25T03:00:40Z</updated>
<author>
<name>Xiaoliang Yang</name>
<email>xiaoliang.yang_1@nxp.com</email>
</author>
<published>2020-09-24T02:11:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ab810a4e04ab6c851007033d39c13e6d3f55110'/>
<id>urn:sha1:4ab810a4e04ab6c851007033d39c13e6d3f55110</id>
<content type='text'>
INIT_IPS and GATE_ENABLE fields have a wrong offset in SG_CONFIG_REG_3.
This register is used by stream gate control of PSFP, and it has not
been used before, because PSFP is not implemented in ocelot driver.

Signed-off-by: Xiaoliang Yang &lt;xiaoliang.yang_1@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: deinitialize only initialized ports</title>
<updated>2020-09-18T20:52:34Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2020-09-18T01:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5fb512d81d021b7c7a0c2547c3dafb9de759285'/>
<id>urn:sha1:e5fb512d81d021b7c7a0c2547c3dafb9de759285</id>
<content type='text'>
Currently mscc_ocelot_init_ports() will skip initializing a port when it
doesn't have a phy-handle, so the ocelot-&gt;ports[port] pointer will be
NULL. Take this into consideration when tearing down the driver, and add
a new function ocelot_deinit_port() to the switch library, mirror of
ocelot_init_port(), which needs to be called by the driver for all ports
it has initialized.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Tested-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Reviewed-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: add locking for the port TX timestamp ID</title>
<updated>2020-09-18T20:52:33Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2020-09-18T01:07:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6565243c0677aa2befa5a953cf11bc7b4a6f0a47'/>
<id>urn:sha1:6565243c0677aa2befa5a953cf11bc7b4a6f0a47</id>
<content type='text'>
The ocelot_port-&gt;ts_id is used to:
(a) populate skb-&gt;cb[0] for matching the TX timestamp in the PTP IRQ
    with an skb.
(b) populate the REW_OP from the injection header of the ongoing skb.
Only then is ocelot_port-&gt;ts_id incremented.

This is a problem because, at least theoretically, another timestampable
skb might use the same ocelot_port-&gt;ts_id before that is incremented.
Normally all transmit calls are serialized by the netdev transmit
spinlock, but in this case, ocelot_port_add_txtstamp_skb() is also
called by DSA, which has started declaring the NETIF_F_LLTX feature
since commit 2b86cb829976 ("net: dsa: declare lockless TX feature for
slave ports").  So the logic of using and incrementing the timestamp id
should be atomic per port.

The solution is to use the global ocelot_port-&gt;ts_id only while
protected by the associated ocelot_port-&gt;ts_id_lock. That's where we
populate skb-&gt;cb[0]. Note that for ocelot, ocelot_port_add_txtstamp_skb
is called for the actual skb, but for felix, it is called for the skb's
clone. That is something which will also be changed in the future.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Tested-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Reviewed-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: extend watermark encoding function</title>
<updated>2020-07-14T00:40:02Z</updated>
<author>
<name>Maxim Kochetkov</name>
<email>fido_max@inbox.ru</email>
</author>
<published>2020-07-13T16:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa92d836d5c40a7e21e563a272ad177f1bfd44dd'/>
<id>urn:sha1:aa92d836d5c40a7e21e563a272ad177f1bfd44dd</id>
<content type='text'>
The ocelot_wm_encode function deals with setting thresholds for pause
frame start and stop. In Ocelot and Felix the register layout is the
same, but for Seville, it isn't. The easiest way to accommodate Seville
hardware configuration is to introduce a function pointer for setting
this up.

Signed-off-by: Maxim Kochetkov &lt;fido_max@inbox.ru&gt;
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: convert SYS_PAUSE_CFG register access to regfield</title>
<updated>2020-07-14T00:40:02Z</updated>
<author>
<name>Maxim Kochetkov</name>
<email>fido_max@inbox.ru</email>
</author>
<published>2020-07-13T16:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=541132f0961a4f17b02974902085af964adf5966'/>
<id>urn:sha1:541132f0961a4f17b02974902085af964adf5966</id>
<content type='text'>
Seville has a different bitwise layout than Ocelot and Felix.

Signed-off-by: Maxim Kochetkov &lt;fido_max@inbox.ru&gt;
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: felix: create a template for the DSA tags on xmit</title>
<updated>2020-07-14T00:40:01Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2020-07-13T16:57:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67c2404922c2c3f9cc0898aafaa4e3bea2bde084'/>
<id>urn:sha1:67c2404922c2c3f9cc0898aafaa4e3bea2bde084</id>
<content type='text'>
With this patch we try to kill 2 birds with 1 stone.

First of all, some switches that use tag_ocelot.c don't have the exact
same bitfield layout for the DSA tags. The destination ports field is
different for Seville VSC9953 for example. So the choices are to either
duplicate tag_ocelot.c into a new tag_seville.c (sub-optimal) or somehow
take into account a supposed ocelot-&gt;dest_ports_offset when packing this
field into the DSA injection header (again not ideal).

Secondly, tag_ocelot.c already needs to memset a 128-bit area to zero
and call some packing() functions of dubious performance in the
fastpath. And most of the values it needs to pack are pretty much
constant (BYPASS=1, SRC_PORT=CPU, DEST=port index). So it would be good
if we could improve that.

The proposed solution is to allocate a memory area per port at probe
time, initialize that with the statically defined bits as per chip
hardware revision, and just perform a simpler memcpy in the fastpath.

Other alternatives have been analyzed, such as:
- Create a separate tag_seville.c: too much code duplication for just 1
  bit field difference.
- Create a separate DSA_TAG_PROTO_SEVILLE under tag_ocelot.c, just like
  tag_brcm.c, which would have a separate .xmit function. Again, too
  much code duplication for just 1 bit field difference.
- Allocate the template from the init function of the tag_ocelot.c
  module, instead of from the driver: couldn't figure out a method of
  accessing the correct port template corresponding to the correct
  tagger in the .xmit function.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: convert QSYS_SWITCH_PORT_MODE and SYS_PORT_MODE to regfields</title>
<updated>2020-07-14T00:40:01Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2020-07-13T16:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=886e1387c73d895ad0eff53353913081983570c0'/>
<id>urn:sha1:886e1387c73d895ad0eff53353913081983570c0</id>
<content type='text'>
Currently Felix and Ocelot share the same bit layout in these per-port
registers, but Seville does not. So we need reg_fields for that.

Actually since these are per-port registers, we need to also specify the
number of ports, and register size per port, and use the regmap API for
multiple ports.

There's a more subtle point to be made about the other 2 register
fields:
- QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG
- QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE
which we are not writing any longer, for 2 reasons:
- Using the previous API (ocelot_write_rix), we were only writing 1 for
  Felix and Ocelot, which was their hardware-default value, and which
  there wasn't any intention in changing.
- In the case of SCH_NEXT_CFG, in fact Seville does not have this
  register field at all, and therefore, if we want to have common code
  we would be required to not write to it.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>soc: mscc: ocelot: add MII registers description</title>
<updated>2020-07-14T00:40:01Z</updated>
<author>
<name>Maxim Kochetkov</name>
<email>fido_max@inbox.ru</email>
</author>
<published>2020-07-13T16:57:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2789658fa319f51db43a585e076bb99a3de3c6d1'/>
<id>urn:sha1:2789658fa319f51db43a585e076bb99a3de3c6d1</id>
<content type='text'>
Add the register definitions for the MSCC MIIM MDIO controller in
preparation for seville_vsc9959.c to create its accessors for the
internal MDIO bus.

Since we've introduced elements to ocelot_regfields that are not
instantiated by felix and ocelot, we need to define the size of the
regfields arrays explicitly, otherwise ocelot_regfields_init, which
iterates up to REGFIELD_MAX, will fault on the undefined regfield
entries (if we're lucky).

Signed-off-by: Maxim Kochetkov &lt;fido_max@inbox.ru&gt;
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: convert port registers to regmap</title>
<updated>2020-07-14T00:40:01Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2020-07-13T16:57:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=91c724cfc0cbc049f18c04634ad56080650e93b8'/>
<id>urn:sha1:91c724cfc0cbc049f18c04634ad56080650e93b8</id>
<content type='text'>
At the moment, there are some minimal register differences between
VSC7514 Ocelot and VSC9959 Felix. To be precise, the PCS1G registers are
missing from Felix because it was integrated with an NXP PCS.

But with VSC9953 Seville (not yet introduced), the register differences
are more pronounced.  The MAC registers are located at different offsets
within the DEV_GMII target. So we need to refactor the driver to keep a
regmap even for per-port registers. The callers of the ocelot_port_readl
and ocelot_port_writel were kept unchanged, only the implementation is
now more generic.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mscc: ocelot: introduce macros for iterating over PGIDs</title>
<updated>2020-06-23T03:41:05Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2020-06-21T11:46:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=96b029b004942ecdb50e40d3e45cdc8a3aec9135'/>
<id>urn:sha1:96b029b004942ecdb50e40d3e45cdc8a3aec9135</id>
<content type='text'>
The current iterators are impossible to understand at first glance
without switching back and forth between the definitions and their
actual use in the for loops.

So introduce some convenience names to help readability.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
