netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: srinivas kandagatla <srinivas.kandagatla@st.com>
Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Landley <rob@landley.net>,
	Russell King <linux@arm.linux.org.uk>,
	Stuart Menefy <stuart.menefy@st.com>, Pavel Machek <pavel@ucw.cz>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	stephen.gallimore@st.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Grant Likely <grant.likely@linaro.org>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@stlinux.com,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH RFC 08/10] net: stmmac:sti: Add STi SOC glue driver.
Date: Fri, 6 Dec 2013 19:37:57 +0100	[thread overview]
Message-ID: <20131206183757.GH24519@lukather> (raw)
In-Reply-To: <529C8198.7000106@st.com>

[-- Attachment #1: Type: text/plain, Size: 3218 bytes --]

Hi Srinivas,

On Mon, Dec 02, 2013 at 12:48:24PM +0000, srinivas kandagatla wrote:
> Hi Maxime,
> 
> Thankyou for the comments.
> 
> On 29/11/13 19:37, Maxime Ripard wrote:
> >> +
> >> > +ethernet0: ethernet0{
> >> > +	#address-cells = <1>;
> >> > +	#size-cells = <1>;
> >> > +	compatible		= "st,stih415-dwmac";
> >> > +	reg			= <0x148 0x4>;
> >> > +	resets			= <&softreset STIH415_ETH0_SOFTRESET>;
> >> > +	st,syscon		= <&syscfg_rear>;
> >> > +	st,tx-retime-src	= "clk_125";
> >> > +	ranges;
> >> > +
> >> > +	dwmac0:dwmac@fe810000 {
> >> > +		device_type 	= "network";
> >> > +		compatible	= "snps,dwmac", "snps,dwmac-3.610";
> >> > +		reg 		= <0xfe810000 0x8000>;
> >> > +		interrupts 	= <0 147 0>;
> >> > +		interrupt-names = "macirq";
> >> > +		...
> >> > +	};
> >> > +};
> > Sorry for stepping up so late, but I dont' think this is the right way
> > to do it.
> > 
> Not a issue.
> 
> > DT is to describe how the hardware is laid out in a system agnostic
> > way, hence, it should not be impacted by the implementation details.
> > 
> If "hardware is laid out" means at SoC level? Then I attempted to do
> describe it in system agnostic way.
> 
> On ST SoCs "snps,dwmac" IP always has a hw glue layer on top of it.
> 
> > The fact that you use a glue to the dwmac driver *is* an
> > implementation detail.
> 
> Glue layer described here is actually a hardware glue on ST SoCs.

Ho, ok, it makes sense then :)

Sorry for the noise.

> > I think you'd rather have something like:
> > 
> > dwmac0: ethernet@fe810000 {
> > 	compatible		= "st,stih415-dwmac";
> > 	reg 			= <0xfe810000 0x8000 0x148 0x4>;
> > 	resets			= <&softreset STIH415_ETH0_SOFTRESET>;
> > 	st,syscon		= <&syscfg_rear>;
> > 	st,tx-retime-src	= "clk_125";
> > 	interrupts 		= <0 147 0>;
> > 	interrupt-names 	= "macirq";Am happy to go with 
> > 	...
> > };
> > 
> > Then, the driver can have its init functions associated to the
> > compatible you're using, through the .data field of the of_device_id
> > structure, and you just call it in the generic driver at probe's time.
> 
> This is changing the device tree bindings for the generic driver.
> Is this something Acceptable?

It really depends. As long as these are based on new compatibles, and
you require these new properties only for this new compatible, it's
fine most of the time.

> Peppe, are you Ok with such intrusive changes to the driver?
> 
> I did try few things before I sent this patch,
> 
> 1> Doing it via AUXDATA which was discouraged by Arnd.
> 
> 2> Doing it the way you suggested which did not fit in very neatly,
> which looked like lot of SOC specific changes are added to generic driver.
> 
> 3> Doing it as this patch, influenced by dwc3 code drivers/usb/dwc3/,
> Which fitted in very neatly without touching the existing generic driver.
> 
> stmmac driver is a generic synopsis driver which ST has written the
> driver, so I did not want to pollute this driver with ST specific glue
> logic bindings.

Yeah, I didn't know that. My apologies.

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-12-06 18:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 13:51 [PATCH RFC 00/10] ARM: STi: Add dwmac glue and reset controller srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 01/10] drivers: reset: STi SoC system configuration reset controller support srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 02/10] drivers: reset: Reset controller driver for STiH415 srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 03/10] drivers: reset: Reset controller driver for STiH416 srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 04/10] drivers: reset: stih415: add softreset controller srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 05/10] drivers: reset: stih416: " srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 06/10] ARM: STi: Add reset controller support to mach-sti Kconfig srinivas.kandagatla
2013-11-12 13:52 ` [PATCH RFC 07/10] PM / wakeup : Introduce device_child_may_wakeup srinivas.kandagatla
2013-11-12 14:20   ` Rafael J. Wysocki
2013-11-12 14:09     ` srinivas kandagatla
2013-11-12 13:53 ` [PATCH RFC 08/10] net: stmmac:sti: Add STi SOC glue driver srinivas.kandagatla
2013-11-29 19:37   ` Maxime Ripard
2013-12-02 12:48     ` srinivas kandagatla
2013-12-06 18:37       ` Maxime Ripard [this message]
2013-11-12 13:53 ` [PATCH RFC 09/10] ARM: STi: Add STiH415 ethernet support srinivas.kandagatla
2013-11-12 13:53 ` [PATCH RFC 10/10] ARM: STi: Add STiH416 " srinivas.kandagatla
2013-11-19  5:28 ` [PATCH RFC 00/10] ARM: STi: Add dwmac glue and reset controller Giuseppe CAVALLARO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131206183757.GH24519@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kernel@stlinux.com \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pawel.moll@arm.com \
    --cc=peppe.cavallaro@st.com \
    --cc=rjw@rjwysocki.net \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=srinivas.kandagatla@st.com \
    --cc=stephen.gallimore@st.com \
    --cc=stuart.menefy@st.com \
    --cc=swarren@wwwdotorg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).