From: Baruch Siach <baruch@tkos•co.il>
To: Shawn Guo <shawn.guo@freescale•com>
Cc: davem@davemloft•net, gerg@snapgear•com, eric@eukrea•com,
bryan.wu@canonical•com, r64343@freescale•com,
B32542@freescale•com, u.kleine-koenig@pengutronix•de,
lw@karo-electronics•de, w.sang@pengutronix•de,
s.hauer@pengutronix•de, netdev@vger•kernel.org,
linux-arm-kernel@lists•infradead.org
Subject: Re: [PATCH v2 05/10] net/fec: add dual fec support for mx28
Date: Tue, 4 Jan 2011 17:07:33 +0200 [thread overview]
Message-ID: <20110104150733.GF2987@jasper.tkos.co.il> (raw)
In-Reply-To: <20110104141259.GA21274@freescale.com>
Hi Shawn,
On Tue, Jan 04, 2011 at 10:13:09PM +0800, Shawn Guo wrote:
> On Tue, Jan 04, 2011 at 11:59:16AM +0200, Baruch Siach wrote:
> > On Tue, Jan 04, 2011 at 05:24:11PM +0800, Shawn Guo wrote:
[snip]
> > > -#ifdef CONFIG_ARCH_MXC
> > > -#include <mach/hardware.h>
> >
> > Since you now remove mach/hardware.h for ARCH_MXC, does this build for all
> > i.MX variants?
> >
> Did the test build for mx25, mx27, mx3 and mx51.
This is surprising. It means that this include was not needed in the first
place. git blame says this was added in 196719ec (fec: Add support for
Freescale MX27) by Sascha.
> > > +#ifdef CONFIG_SOC_IMX28
> > > +/*
> > > + * mx28 does not have MIIGSK registers
> > > + */
> > > +#undef FEC_MIIGSK_ENR
> > > +#include <mach/mxs.h>
> > > +#else
> > > +#define cpu_is_mx28() (0)
> > > +#endif
> >
> > This breaks kernels for multiple archs (e.g. i.MX28 and i.MX25). Please use
> > run-time detection of CPU type, and do the MII/RMII etc. configuration
> > accordingly.
> >
> I do not find a good way to detect cpu type. Neither adding a new
> platform data field nor using __machine_arch_type to enumerate all
> mx28 based machine (though there is only one currently) seems to be
> good for me.
How about:
#ifdef CONFIG_SOC_IMX28
#include <mach/mxs.h>
#else
#define cpu_is_mx28() (0)
#endif
if (cpu_is_mx28() {
/* Do i.MX28 stuff */
} else {
/* Do other i.MX stuff */
}
Note that the '#ifdef FEC_MIIGSK_ENR' section in fec_restart() is there only
to allow build for M5272 which does not have this define in fec.h. Physically,
i.MX27 does not have this register either.
> I will try to manipulate some mx28 unique register to identify mx28
> from other i.mx variants. Hopefully, it will work.
>
> Thanks for the comments.
baruch
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos•co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
next prev parent reply other threads:[~2011-01-04 15:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 9:24 [PATCH v2 00/10] net/fec: add dual fec support for i.MX28 Shawn Guo
2011-01-04 9:24 ` [PATCH v2 01/10] net/fec: fix MMFR_OP type in fec_enet_mdio_write Shawn Guo
2011-01-04 9:24 ` [PATCH v2 02/10] net/fec: remove the use of "index" which is legacy Shawn Guo
2011-01-04 9:24 ` [PATCH v2 03/10] net/fec: add mac field into platform data and consolidate fec_get_mac Shawn Guo
2011-01-04 9:24 ` [PATCH v2 04/10] net/fec: improve pm for better suspend/resume Shawn Guo
2011-01-04 9:24 ` [PATCH v2 05/10] net/fec: add dual fec support for mx28 Shawn Guo
2011-01-04 9:59 ` Baruch Siach
2011-01-04 14:13 ` Shawn Guo
2011-01-04 15:07 ` Baruch Siach [this message]
2011-01-05 8:45 ` Sascha Hauer
2011-01-05 9:03 ` Uwe Kleine-König
2011-01-05 9:40 ` Shawn Guo
2011-01-04 9:24 ` [PATCH v2 06/10] ARM: mx28: update clocks for dual fec support Shawn Guo
2011-01-04 13:58 ` Uwe Kleine-König
2011-01-04 14:26 ` Shawn Guo
2011-01-04 9:24 ` [PATCH v2 07/10] ARM: mx28: add the second fec device registration Shawn Guo
2011-01-04 9:24 ` [PATCH v2 08/10] ARM: mxs: add ocotp read function Shawn Guo
2011-01-04 9:24 ` [PATCH v2 09/10] ARM: mx28: read fec mac address from ocotp Shawn Guo
2011-01-04 9:24 ` [PATCH v2 10/10] ARM: mxs: add initial pm support Shawn Guo
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=20110104150733.GF2987@jasper.tkos.co.il \
--to=baruch@tkos$(echo .)co.il \
--cc=B32542@freescale$(echo .)com \
--cc=bryan.wu@canonical$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric@eukrea$(echo .)com \
--cc=gerg@snapgear$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=lw@karo-electronics$(echo .)de \
--cc=netdev@vger$(echo .)kernel.org \
--cc=r64343@freescale$(echo .)com \
--cc=s.hauer@pengutronix$(echo .)de \
--cc=shawn.guo@freescale$(echo .)com \
--cc=u.kleine-koenig@pengutronix$(echo .)de \
--cc=w.sang@pengutronix$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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