Re: [PATCH v4 12/16] MIPS: lantiq: Add a GPHY driver which uses the RCU syscon-mfd
From: Hauke Mehrtens <hidden>
Date: 2017-06-20 22:19:09
Also in:
linux-mips, linux-spi, linux-watchdog
On 06/20/2017 01:36 AM, Andy Shevchenko wrote:
On Tue, Jun 20, 2017 at 1:26 AM, Hauke Mehrtens [off-list ref] wrote:quoted
From: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> Compared to the old xrx200_phy_fw driver the new version has multiple enhancements. The name of the firmware files does not have to be added to all .dts files anymore - one now configures the GPHY mode (FE or GE) instead. Each GPHY can now also boot separate firmware (thus mixing of GE and FE GPHYs is now possible). The new implementation is based on the RCU syscon-mfd and uses the reeset_controller framework instead of raw RCU register reads/writes.Couple of comments, otherwise FWIW, Reviewed-by: Andy Shevchenko <redacted>quoted
Signed-off-by: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> --- .../devicetree/bindings/mips/lantiq/rcu-gphy.txt | 36 +++ arch/mips/lantiq/xway/sysctrl.c | 6 +- drivers/soc/lantiq/Makefile | 1 + drivers/soc/lantiq/gphy.c | 261 +++++++++++++++++++++ include/dt-bindings/mips/lantiq_rcu_gphy.h | 15 ++ 5 files changed, 317 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/mips/lantiq/rcu-gphy.txt create mode 100644 drivers/soc/lantiq/gphy.c create mode 100644 include/dt-bindings/mips/lantiq_rcu_gphy.h
......
quoted
+ + /* + * GPHY cores need the firmware code in a persistent and contiguous + * memory area with a 16 kB boundary aligned start address. + */ + priv->size = fw->size + XRX200_GPHY_FW_ALIGN; + + priv->fw_addr = dma_alloc_coherent(dev, priv->size, + &priv->dma_addr, GFP_KERNEL);dmam_ ?
Thanks, didn't know this functions was looking for something with devm_ prefix, but dmam_ makes the code simpler. ....
quoted
+ + ret = xway_gphy_load(dev, priv, &fw_addr); + if (ret)You need to disable and unprepare a clock.
Done
quoted
+ return ret; +
....
quoted
+ dma_free_coherent(dev, priv->size, priv->fw_addr, priv->dma_addr);It will go away if dmam_ variant is in use.
Done
quoted
+ + ret = unregister_reboot_notifier(&priv->gphy_reboot_nb); + if (ret) + dev_warn(dev, "Failed to unregister reboot notifier\n");
... Hauke -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html