36a5faec | 04-Sep-2024 |
Vasileios Amoiridis <vassilisamir@gmail.com> |
net: dsa: realtek: rtl8366rb: Make use of irq_get_trigger_type()
Convert irqd_get_trigger_type(irq_get_irq_data(irq)) cases to the more simple irq_get_trigger_type(irq).
Reviewed-by: Alvin Šipraga
net: dsa: realtek: rtl8366rb: Make use of irq_get_trigger_type()
Convert irqd_get_trigger_type(irq_get_irq_data(irq)) cases to the more simple irq_get_trigger_type(irq).
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20240904151018.71967-3-vassilisamir@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
32d61700 | 27-Apr-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: add LED drivers for rtl8366rb
This commit introduces LED drivers for rtl8366rb, enabling LEDs to be described in the device tree using the same format as qca8k. Each port can conf
net: dsa: realtek: add LED drivers for rtl8366rb
This commit introduces LED drivers for rtl8366rb, enabling LEDs to be described in the device tree using the same format as qca8k. Each port can configure up to 4 LEDs.
If all LEDs in a group use the default state "keep", they will use the default behavior after a reset. Changing the brightness of one LED, either manually or by a trigger, will disable the default hardware trigger and switch the entire LED group to manually controlled LEDs. Once in this mode, there is no way to revert to hardware-controlled LEDs (except by resetting the switch).
Software triggers function as expected with manually controlled LEDs.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
4f580e9a | 27-Apr-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: do not assert reset on remove
The necessity of asserting the reset on removal was previously questioned, as DSA's own cleanup methods should suffice to prevent traffic leakage[1].
net: dsa: realtek: do not assert reset on remove
The necessity of asserting the reset on removal was previously questioned, as DSA's own cleanup methods should suffice to prevent traffic leakage[1].
When a driver has subdrivers controlled by devres, they will be unregistered after the main driver's .remove is executed. If it asserts a reset, the subdrivers will be unable to communicate with the hardware during their cleanup. For LEDs, this means that they will fail to turn off, resulting in a timeout error.
[1] https://lore.kernel.org/r/20240123215606.26716-9-luizluca@gmail.com/
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
9fc469b2 | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: embed dsa_switch into realtek_priv
Embed dsa_switch within realtek_priv to eliminate the need for a second memory allocation.
Suggested-by: Alvin Šipraga <alsi@bang-olufsen.dk> S
net: dsa: realtek: embed dsa_switch into realtek_priv
Embed dsa_switch within realtek_priv to eliminate the need for a second memory allocation.
Suggested-by: Alvin Šipraga <alsi@bang-olufsen.dk> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
bba140a5 | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: use the same mii bus driver for both interfaces
The realtek-mdio will now use this driver instead of the generic DSA driver ("dsa user smi"), which should not be used with OF[1].
net: dsa: realtek: use the same mii bus driver for both interfaces
The realtek-mdio will now use this driver instead of the generic DSA driver ("dsa user smi"), which should not be used with OF[1].
With a single ds_ops for both interfaces, the ds_ops in realtek_priv is no longer necessary. Now, the realtek_variant.ds_ops can be used directly.
The realtek_priv.setup_interface() has been removed as we can directly call the new common function.
[1] https://lkml.kernel.org/netdev/20220630200423.tieprdu5fpabflj7@bang-olufsen.dk/T/
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
b4bd7797 | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: migrate user_mii_bus setup to realtek_dsa
In the user MDIO driver, despite numerous references to SMI, including its compatible string, there's nothing inherently specific about t
net: dsa: realtek: migrate user_mii_bus setup to realtek_dsa
In the user MDIO driver, despite numerous references to SMI, including its compatible string, there's nothing inherently specific about the SMI interface in the user MDIO bus. Consequently, the code has been migrated to the rtl83xx module. All references to SMI have been eliminated.
The MDIO bus id was changed from Realtek-<switch id> to the switch devname suffixed with :user_mii, giving more information about the bus it is referencing.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
68c66d8d | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: clean user_mii_bus setup
Remove the line assigning dev.of_node in mdio_bus as subsequent of_mdiobus_register will always overwrite it.
As discussed in [1], allow the DSA core to
net: dsa: realtek: clean user_mii_bus setup
Remove the line assigning dev.of_node in mdio_bus as subsequent of_mdiobus_register will always overwrite it.
As discussed in [1], allow the DSA core to be simplified, by not assigning ds->user_mii_bus when the MDIO bus is described in OF, as it is unnecessary.
Since commit 3b73a7b8ec38 ("net: mdio_bus: add refcounting for fwnodes to mdiobus"), we can put the "mdio" node just after the MDIO bus registration.
[1] https://lkml.kernel.org/netdev/20231213120656.x46fyad6ls7sqyzv@skbuf/T/#u
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
8685c98d | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: get internal MDIO node by name
The binding docs requires for SMI-connected devices that the switch must have a child node named "mdio" and with a compatible string of "realtek,smi
net: dsa: realtek: get internal MDIO node by name
The binding docs requires for SMI-connected devices that the switch must have a child node named "mdio" and with a compatible string of "realtek,smi-mdio". Meanwile, for MDIO-connected switches, the binding docs only requires a child node named "mdio".
This patch changes the driver to use the common denominator for both interfaces, looking for the MDIO node by name, ignoring the compatible string.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
98b75c1c | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: merge rtl83xx and interface modules into realtek_dsa
Since rtl83xx and realtek-{smi,mdio} are always loaded together, we can optimize resource usage by consolidating them into a s
net: dsa: realtek: merge rtl83xx and interface modules into realtek_dsa
Since rtl83xx and realtek-{smi,mdio} are always loaded together, we can optimize resource usage by consolidating them into a single module.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
8be040ec | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: common rtl83xx module
Some code can be shared between both interface modules (MDIO and SMI) and among variants. These interface functions migrated to a common module:
- rtl83xx_l
net: dsa: realtek: common rtl83xx module
Some code can be shared between both interface modules (MDIO and SMI) and among variants. These interface functions migrated to a common module:
- rtl83xx_lock - rtl83xx_unlock - rtl83xx_probe - rtl83xx_register_switch - rtl83xx_unregister_switch - rtl83xx_shutdown - rtl83xx_remove
The reset during probe was moved to the end of the common probe. This way, we avoid a reset if anything else fails.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
4667a1db | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: keep variant reference in realtek_priv
Instead of copying values from the variant, we can keep a reference in realtek_priv.
This is a preliminary change for sharing code betwen i
net: dsa: realtek: keep variant reference in realtek_priv
Instead of copying values from the variant, we can keep a reference in realtek_priv.
This is a preliminary change for sharing code betwen interfaces. It will allow to move most of the probe into a common module while still allow code specific to each interface to read variant fields.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
bce254b8 | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: convert variants into real drivers
Previously, the interface modules realtek-smi and realtek-mdio served as a platform and an MDIO driver, respectively. Each interface module redu
net: dsa: realtek: convert variants into real drivers
Previously, the interface modules realtek-smi and realtek-mdio served as a platform and an MDIO driver, respectively. Each interface module redundantly specified the same compatible strings for both variants and referenced symbols from the variants.
Now, each variant module has been transformed into a unified driver serving both as a platform and an MDIO driver. This modification reverses the relationship between the interface and variant modules, with the variant module now utilizing symbols from the interface modules.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
ded3813b | 09-Feb-2024 |
Luiz Angelo Daros de Luca <luizluca@gmail.com> |
net: dsa: realtek: introduce REALTEK_DSA namespace
Create a namespace to group the exported symbols.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olte
net: dsa: realtek: introduce REALTEK_DSA namespace
Create a namespace to group the exported symbols.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|