<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/net/ksz9477.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>net: ksz9477: add support for KSZ GbE switches using SPI bus</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6989f7ba1657ea55315396767222eba79500a397'/>
<id>6989f7ba1657ea55315396767222eba79500a397</id>
<content type='text'>
The Microchip KSZ Gigabit Ethernet Switches support
SGMII/RGMII/MII/RMII with register access via SPI, I2C, or MDIO.

Since this driver is now able to check the underlying bus type,
handle the case when the SPI bus is used.

The SPI bus is only used for 8/16/32 wide access of registers.

Reword Kconfig option to include SPI bus support.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Microchip KSZ Gigabit Ethernet Switches support
SGMII/RGMII/MII/RMII with register access via SPI, I2C, or MDIO.

Since this driver is now able to check the underlying bus type,
handle the case when the SPI bus is used.

The SPI bus is only used for 8/16/32 wide access of registers.

Reword Kconfig option to include SPI bus support.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: prepare ksz9477 without I2C support</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d164577fdbb3e49b3d93ab170753a7ab94790490'/>
<id>d164577fdbb3e49b3d93ab170753a7ab94790490</id>
<content type='text'>
With the upcoming ksz9477 SPI support added, the I2C support
will be optional. Either the I2C or the SPI bus will be used.

For now, DM_I2C is still mandatory.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the upcoming ksz9477 SPI support added, the I2C support
will be optional. Either the I2C or the SPI bus will be used.

For now, DM_I2C is still mandatory.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: rename ksz_i2c_probe() to ksz_probe()</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8a63113de037a5d1f86d0b7081ad88f87e86787d'/>
<id>8a63113de037a5d1f86d0b7081ad88f87e86787d</id>
<content type='text'>
In order to support management bus other than the I2C, rename
ksz_i2c_probe() to ksz_probe() since this function is no longer
specific to the I2C bus.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to support management bus other than the I2C, rename
ksz_i2c_probe() to ksz_probe() since this function is no longer
specific to the I2C bus.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: store ksz bus operations functions</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9c4413b24697ec3942e92f74772c3798fcf0ad6b'/>
<id>9c4413b24697ec3942e92f74772c3798fcf0ad6b</id>
<content type='text'>
The ksz9477 Linux kernel driver is based on regmap API to seamlessly
communicate to switch devices connected via different buses like SPI
or I2C. The current regmap implementation in U-Boot only supports
memory-mapped registers access [1].

Until regmap API with bus support is available in U-boot, introduce
struct ksz_phy_ops to store low-level ksz bus operations (I2C for now).

[1] https://lists.denx.de/pipermail/u-boot/2018-May/329392.html

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ksz9477 Linux kernel driver is based on regmap API to seamlessly
communicate to switch devices connected via different buses like SPI
or I2C. The current regmap implementation in U-Boot only supports
memory-mapped registers access [1].

Until regmap API with bus support is available in U-boot, introduce
struct ksz_phy_ops to store low-level ksz bus operations (I2C for now).

[1] https://lists.denx.de/pipermail/u-boot/2018-May/329392.html

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: set i2c bus offset length only when needed</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b507f1a5077f8589df000e32715978b8f43a02b6'/>
<id>b507f1a5077f8589df000e32715978b8f43a02b6</id>
<content type='text'>
In order to add ksz9477 SPI bus support, check parent bus
is an I2C bus before calling i2c_set_offset_len().

Doing so, ksz_i2c_probe() will now return an error (-EINVAL) if
the parent bus is not the one expected by the ksz-switch u-boot
driver.

Indeed, the DSA KSZ devicetree binding doesn't specify anything
about the underlying bus between the SoC and the DSA switch, so
the same "compatible" string can be used wathever the management
interface used (SPI or I2C).

The ksz-switch u-boot driver currently only support I2C interface
but will match a compatible "microchip,ksz9xxx" located under
under an SPI bus node.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to add ksz9477 SPI bus support, check parent bus
is an I2C bus before calling i2c_set_offset_len().

Doing so, ksz_i2c_probe() will now return an error (-EINVAL) if
the parent bus is not the one expected by the ksz-switch u-boot
driver.

Indeed, the DSA KSZ devicetree binding doesn't specify anything
about the underlying bus between the SoC and the DSA switch, so
the same "compatible" string can be used wathever the management
interface used (SPI or I2C).

The ksz-switch u-boot driver currently only support I2C interface
but will match a compatible "microchip,ksz9xxx" located under
under an SPI bus node.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: rename udevice_id tab to ksz_ids</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=04c183c542ad727afa946dc879a1b76785573548'/>
<id>04c183c542ad727afa946dc879a1b76785573548</id>
<content type='text'>
The DSA KSZ devicetree binding doesn't specify anything about the
underlying bus between the SoC and the DSA switch, so the same
"compatible" string can be used wathever the management interface
used. The driver must be able to access the underlying bus without
any help from the compatible string (like for TPM2 TIS devices).

So, rename udevice_id tab to ksz_ids since it's not specific to i2c
bus.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DSA KSZ devicetree binding doesn't specify anything about the
underlying bus between the SoC and the DSA switch, so the same
"compatible" string can be used wathever the management interface
used. The driver must be able to access the underlying bus without
any help from the compatible string (like for TPM2 TIS devices).

So, rename udevice_id tab to ksz_ids since it's not specific to i2c
bus.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: add KSZ9896 switch support</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2708c81672f8d8be954afdf8d7187bae51d38a22'/>
<id>2708c81672f8d8be954afdf8d7187bae51d38a22</id>
<content type='text'>
Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the
ksz9477 driver.

The KSZ9896 is similar to KSZ9897 but has only one configurable
MII/RMII/RGMII/GMII cpu port.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the
ksz9477 driver.

The KSZ9896 is similar to KSZ9897 but has only one configurable
MII/RMII/RGMII/GMII cpu port.

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: remove dev_set_parent_priv() call</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5b87af441f8ef5e5c74fbb4337e1f42816b73189'/>
<id>5b87af441f8ef5e5c74fbb4337e1f42816b73189</id>
<content type='text'>
The ksz9477 is currently the only driver using dev_set_parent_priv()
outside of the driver model. Also, there was no explanation in the
commit adding ksz9477 driver and why dev_set_parent_priv() is
required.

Actually there is a typo in ksz_mdio_probe() while retrieving
the parent (switch@0) private data:

-	priv-&gt;ksz = dev_get_parent_priv(dev-&gt;parent);
+	priv-&gt;ksz = dev_get_priv(dev-&gt;parent);

Printing the address of struct ksz_dsa_priv *priv allows
to notice the slight difference:

ksz_i2c_probe: ksz_dsa_priv *priv 0xfdf45768 // address of the saved priv
ksz_mdio_bind: ksz_dsa_priv *priv 0xfdf45798 // address returned by dev_get_parent_priv(dev-&gt;parent)
ksz_mdio_bind: ksz_dsa_priv *priv 0xfdf45768 // address returned by dev_get_priv(dev-&gt;parent)

The ksz_mdio driver get the wrong data and without
dev_set_parent_priv() the mdio driver fail to access the underlying
bus.

While it doesn't cause any issue with I2C bus, it override the
per-child data used by the SPI bus (struct spi_slave) and prevent
further bus access (even with sspi command).

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ksz9477 is currently the only driver using dev_set_parent_priv()
outside of the driver model. Also, there was no explanation in the
commit adding ksz9477 driver and why dev_set_parent_priv() is
required.

Actually there is a typo in ksz_mdio_probe() while retrieving
the parent (switch@0) private data:

-	priv-&gt;ksz = dev_get_parent_priv(dev-&gt;parent);
+	priv-&gt;ksz = dev_get_priv(dev-&gt;parent);

Printing the address of struct ksz_dsa_priv *priv allows
to notice the slight difference:

ksz_i2c_probe: ksz_dsa_priv *priv 0xfdf45768 // address of the saved priv
ksz_mdio_bind: ksz_dsa_priv *priv 0xfdf45798 // address returned by dev_get_parent_priv(dev-&gt;parent)
ksz_mdio_bind: ksz_dsa_priv *priv 0xfdf45768 // address returned by dev_get_priv(dev-&gt;parent)

The ksz_mdio driver get the wrong data and without
dev_set_parent_priv() the mdio driver fail to access the underlying
bus.

While it doesn't cause any issue with I2C bus, it override the
per-child data used by the SPI bus (struct spi_slave) and prevent
further bus access (even with sspi command).

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: move struct ksz_dsa_priv *priv declaration</title>
<updated>2024-10-27T16:19:44+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@smile.fr</email>
</author>
<published>2024-10-08T07:54:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6df5c5aee3d1bcbb0a9a0d5cfd62609c8c3ec24c'/>
<id>6df5c5aee3d1bcbb0a9a0d5cfd62609c8c3ec24c</id>
<content type='text'>
struct ksz_dsa_priv *priv should be declared before dev_dbg()

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
struct ksz_dsa_priv *priv should be declared before dev_dbg()

Signed-off-by: Romain Naour &lt;romain.naour@smile.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: ksz9477: add support for KSZ9893 GbE switch</title>
<updated>2023-07-27T18:32:12+00:00</updated>
<author>
<name>Karsten Wiese</name>
<email>karsten.wiese@protechna.com</email>
</author>
<published>2023-06-28T14:54:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3ca495576070f85143372e3070fa405b513c72a2'/>
<id>3ca495576070f85143372e3070fa405b513c72a2</id>
<content type='text'>
Copy and tweak the required code from the linux kernel.
Only the KSZ9893 has been tested.

Signed-off-by: Karsten Wiese &lt;karsten.wiese@protechna.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Copy and tweak the required code from the linux kernel.
Only the KSZ9893 has been tested.

Signed-off-by: Karsten Wiese &lt;karsten.wiese@protechna.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
