Re: [PATCH v3] ARC: [plat-hsdk]: Add reset controller node to manage ethernet reset

From: Eugeniy Paltsev
Date: Wed Sep 27 2017 - 14:55:12 EST


On Wed, 2017-09-27 at 10:40 -0700, Vineet Gupta wrote:
> On 09/22/2017 09:49 AM, Eugeniy Paltsev wrote:
> > DW ethernet controller on HSDK hangs sometimes after SW reset, so
> > add reset node to make possible to reset DW ethernet controller HW.
> >
> > Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@xxxxxxxxxxxx>
> > ---
> > Changes v2 -> v3:
> > ÂÂÂ* Remove v1 suffix as we finaly got rid of v1 suffix in reset
> > ÂÂÂÂÂdriver and docs.
> > ÂÂÂ* Rename reset node to "reset-controller" for consistency with
> > ÂÂÂÂÂthe other bindings.
> >
> > Changes v1 -> v2:
> > ÂÂÂ* Enable HSDK reset driver in hsdk_defconfig
> >
> > Â arch/arc/boot/dts/hsdk.dtsÂÂÂÂÂÂ| 9 +++++++++
> > Â arch/arc/configs/hsdk_defconfig | 1 +
> > Â 2 files changed, 10 insertions(+)
> >
> > diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
> > index b922f3f..8adde1b 100644
> > --- a/arch/arc/boot/dts/hsdk.dts
> > +++ b/arch/arc/boot/dts/hsdk.dts
> > @@ -12,6 +12,7 @@
> > Â /dts-v1/;
> > ÂÂ
> > Â #include <dt-bindings/net/ti-dp83867.h>
> > +#include <dt-bindings/reset/snps,hsdk-reset.h>
> > ÂÂ
> > Â / {
> > ÂÂ model = "snps,hsdk";
> > @@ -102,6 +103,12 @@
> > ÂÂ
> > ÂÂ ranges = <0x00000000 0xf0000000 0x10000000>;
> > ÂÂ
> > + cgu_rst: reset-controller@8a0 {
> > + compatible = "snps,hsdk-reset";
> > + #reset-cells = <1>;
> > + reg = <0x8A0 0x4>, <0xFF0 0x4>;
> > + };
> > +
> > ÂÂ core_clk: core-clk@0 {
> > ÂÂ compatible = "snps,hsdk-core-pll-clock";
> > ÂÂ reg = <0x00 0x10>, <0x14B8 0x4>;
> > @@ -158,6 +165,8 @@
> > ÂÂ clocks = <&gmacclk>;
> > ÂÂ clock-names = "stmmaceth";
> > ÂÂ phy-handle = <&phy0>;
> > + resets = <&cgu_rst HSDK_ETH_RESET>;
> > + reset-names = "stmmaceth";
> > ÂÂ
> > ÂÂ mdio {
> > ÂÂ #address-cells = <1>;
> > diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
> > index 7b8f8fa..15f0f6b 100644
> > --- a/arch/arc/configs/hsdk_defconfig
> > +++ b/arch/arc/configs/hsdk_defconfig
> > @@ -63,6 +63,7 @@ CONFIG_MMC_SDHCI=y
> > Â CONFIG_MMC_SDHCI_PLTFM=y
> > Â CONFIG_MMC_DW=y
> > Â # CONFIG_IOMMU_SUPPORT is not set
> > +CONFIG_RESET_HSDK=y
>
> Since we need this feature for our platform, better to just select it in Kconfig.
> I can fix it up here if you agree !

Sure, I'm fine with it.

>
> -Vineet
>
> > Â CONFIG_EXT3_FS=y
> > Â CONFIG_VFAT_FS=y
> > Â CONFIG_TMPFS=y
>
>
--
ÂEugeniy Paltsev