]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: stmmac: dwmac-loongson: Add DT-less GMAC PCI-device support
authorYanteng Si <siyanteng@loongson.cn>
Wed, 7 Aug 2024 13:48:05 +0000 (21:48 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 13 Aug 2024 07:48:00 +0000 (09:48 +0200)
commit126f4f96c41d2efe9ea1b949ff3e6d997010991e
tree5c3f1d2e60528ed8a3762d3546bff29487839058
parent0ec04d32b5e7f03f1a18713a4958a056240763c8
net: stmmac: dwmac-loongson: Add DT-less GMAC PCI-device support

The Loongson GMAC driver currently supports the network controllers
installed on the LS2K1000 SoC and LS7A1000 chipset, for which the GMAC
devices are required to be defined in the platform device tree source.
But Loongson machines may have UEFI (implies ACPI) or PMON/UBOOT
(implies FDT) as the system bootloaders. In order to have both system
configurations support let's extend the driver functionality with the
case of having the Loongson GMAC probed on the PCI bus with no device
tree node defined for it. That requires to make the device DT-node
optional, to rely on the IRQ line detected by the PCI core and to
have the MDIO bus ID calculated using the PCIe Domain+BDF numbers.

In order to have the device probe() and remove() methods less
complicated let's move the DT- and ACPI-specific code to the
respective sub-functions.

Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
Signed-off-by: Yinggang Gu <guyinggang@loongson.cn>
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c