On 09/01/2018 02:05 PM, Hauke Mehrtens wrote: > This adds the DSA driver for the GSWIP Switch found in the VRX200 SoC. > This switch is integrated in the DSL SoC, this SoC uses a GSWIP version > 2.1, there are other SoCs using different versions of this IP block, but > this driver was only tested with the version found in the VRX200. > Currently only the basic features are implemented which will forward all > packages to the CPU and let the CPU do the forwarding. The hardware also > support Layer 2 offloading which is not yet implemented in this driver. > > The GPHY FW loaded is now done by this driver and not any more by the > separate driver in drivers/soc/lantiq/gphy.c, I will remove this driver > is a separate patch. to make use of the GPHY this switch driver is > needed anyway. Other SoCs have more embedded GPHYs so this driver should > support a variable number of GPHYs. After the firmware was loaded the > GPHY can be probed on the MDIO bus and it behaves like an external GPHY, > without the firmware it can not be probed on the MDIO bus. > > Currently this depends on SOC_TYPE_XWAY because the SoC revision > detection function ltq_soc_type() is used to load the correct GPHY > firmware on the VRX200 SoCs. > > The clock names in the sysctrl.c file have to be changed because the > clocks are now used by a different driver. This should be cleaned up and > a real common clock driver should provide the clocks instead. > > Signed-off-by: Hauke Mehrtens <[email protected]> > --- > MAINTAINERS | 2 + > arch/mips/lantiq/xway/sysctrl.c | 8 +- > drivers/net/dsa/Kconfig | 8 + > drivers/net/dsa/Makefile | 1 + > drivers/net/dsa/lantiq_gswip.c | 1018 > +++++++++++++++++++++++++++++++++++++++ > drivers/net/dsa/lantiq_pce.h | 153 ++++++ > 6 files changed, 1186 insertions(+), 4 deletions(-) > create mode 100644 drivers/net/dsa/lantiq_gswip.c > create mode 100644 drivers/net/dsa/lantiq_pce.h >
.....
> +
> +static int gswip_gphy_fw_list(struct gswip_priv *priv,
> + struct device_node *gphy_fw_list_np)
> +{
> + struct device *dev = priv->dev;
> + struct device_node *gphy_fw_np;
> + const struct of_device_id *match;
> + int err;
> + int i = 0;
> +
> + if (of_device_is_compatible(dev->of_node, "lantiq,xrx200-gphy-fw")) {
> + switch (ltq_soc_type()) {
I just found out that the older revision of the xrx200 SoC uses also an
older GSWIP version, so we do not have to call ltq_soc_type() here, but
can use the GSWIP version register.
xRX200 rev 1.1 uses GSWIP 2.0, xrx200 rev 1.2 uses GSWIP 2.1.
1e10804c: 00000100 on xRX200 rev 1.1
1e10804c: 00000021 on xRX200 rev 1.2
Then I can also remove the compile dependency on the Lantiq arch code.
> + case SOC_TYPE_VR9:
> + priv->gphy_fw_name_cfg = &xrx200a1x_gphy_data;
> + break;
> + case SOC_TYPE_VR9_2:
> + priv->gphy_fw_name_cfg = &xrx200a2x_gphy_data;
> + break;
> + }
> + }
> +
.....
> +
> + platform_set_drvdata(pdev, priv);
> +
> + version = gswip_switch_r(priv, GSWIP_VERSION);
> + dev_info(dev, "probed GSWIP version %lx mod %lx\n",
> + (version & GSWIP_VERSION_REV_MASK) >> GSWIP_VERSION_REV_SHIFT,
> + (version & GSWIP_VERSION_MOD_MASK) >> GSWIP_VERSION_MOD_SHIFT);
> + return 0;
> +
signature.asc
Description: OpenPGP digital signature
