From: Fabio Giovagnini <fabio.giovagnini@aurion-tech.com>
To: linux-sh@vger.kernel.org
Subject: Re: Hi All, hot to debug my eth0' hw?
Date: Wed, 17 Mar 2010 05:47:14 +0000 [thread overview]
Message-ID: <201003170647.15084.fabio.giovagnini@aurion-tech.com> (raw)
In-Reply-To: <201003161225.42600.fabio.giovagnini@aurion-tech.com>
Hi Magnus,
yesterday I used the following command
git clone git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git
Am I ok?
My configuration is :
SH2a 7203 smc9118
Addresses:
A1...A7 A1...A7
Data:
D0...D31 D0...D31
when I execute
static int __init smc911x_probe(struct net_device *dev, unsigned long ioaddr)
{
struct smc911x_local *lp = netdev_priv(dev);
int i, retval;
unsigned int val, chip_id, revision;
const char *version_string;
unsigned long endian;
DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __FUNCTION__);
activedev = dev;
/* First, see if the endian word is recognized */
val = SMC_GET_BYTE_TEST();
DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val);
if (val != 0x87654321) {
DBG(SMC_DEBUG_MISC, "%s: swapping endianness of card \n", CARDNAME);
endian = SMC_GET_ENDIAN();
SMC_SET_ENDIAN(~endian);
SMC_SET_ENDIAN(~endian);
val = SMC_GET_BYTE_TEST();
DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val);
if (val != 0x87654321) {
printk(KERN_ERR "Invalid chip endian 0x%x\n",val);
retval = -ENODEV;
goto err_out;
}
}
if I use
/* 4567_0123 --> 0123_4567 */
#define SWAPDW(x) ( (_uint32)( (((_uint32)x & 0x0000FFFF) << 16) | \
(((_uint32)x & 0xFFFF0000) >> 16) ) )
//#define SWAPDW(x) (x)
/* 2301_6745 --> 0123_4567 */
#define SWAPDB(x) ( (_uint32)( (((_uint32)x & 0x000000FF) << 8) | \
(((_uint32)x & 0x0000FF00) >> 8) | \
(((_uint32)x & 0x00FF0000) << 8) | \
(((_uint32)x & 0xFF000000) >> 8)) )
//#define SWAPDB(x) (x)
The check fails;
If I use
/* 4567_0123 --> 0123_4567 */
/*
#define SWAPDW(x) ( (_uint32)( (((_uint32)x & 0x0000FFFF) << 16) | \
(((_uint32)x & 0xFFFF0000) >> 16) ) )
*/
#define SWAPDW(x) (x)
/* 2301_6745 --> 0123_4567 */
/*
#define SWAPDB(x) ( (_uint32)( (((_uint32)x & 0x000000FF) << 8) | \
(((_uint32)x & 0x0000FF00) >> 8) | \
(((_uint32)x & 0x00FF0000) << 8) | \
(((_uint32)x & 0xFF000000) >> 8)) )
*/
#define SWAPDB(x) (x)
That means no swap it seems to work but really fails.
My hw configration is good for actual version of the kernel driver or I need to
be carefull to other stuff?
Thanks a lot again
In data mercoledì 17 marzo 2010 04:29:27, Magnus Damm ha scritto:
: > On Tue, Mar 16, 2010 at 9:32 PM, Magnus Damm <magnus.damm@gmail.com>
wrote:
> > On Tue, Mar 16, 2010 at 8:59 PM, Fabio Giovagnini
> >
> > <fabio.giovagnini@aurion-tech.com> wrote:
> >> 2) I have a 32 bus connected sh2a D0 do smc9118 D0 and sh2a D31 do
> >> smc9118 D31; do I need a software swap? ( I followed the schematics of
> >> rsk+ 7203 eva board before to learn that for big endioan processors the
> >> designer needs to physically swap the bytes).
> >
> > I've added code to enable swap on upstream for the rsk7203. It was
> > needed by big endian platforms.
>
> Look here:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h
> r4cfb944007b7f8d346523a7810b53a35921bc5
>
> and here:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h
> ƒ3cc67c7722e35863c6aaee9df56b442ef957ae
>
> > Please use a newer kernel if possible.
>
> If you use the latest kernel then the fixes above are already included.
>
> I recommend you to use the sh-2.6 git tree for development.
>
> Thanks,
>
> / magnus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
next prev parent reply other threads:[~2010-03-17 5:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-16 11:25 Hi All, hot to debug my eth0' hw? Fabio Giovagnini
2010-03-16 11:35 ` Magnus Damm
2010-03-16 11:59 ` Fabio Giovagnini
2010-03-16 12:32 ` Magnus Damm
2010-03-16 12:38 ` Fabio Giovagnini
2010-03-16 12:43 ` Magnus Damm
2010-03-16 13:16 ` Fabio Giovagnini
2010-03-17 3:29 ` Magnus Damm
2010-03-17 5:47 ` Fabio Giovagnini [this message]
2010-03-17 6:15 ` Fabio Giovagnini
2010-03-17 6:41 ` Magnus Damm
2010-03-17 6:47 ` Magnus Damm
2010-03-17 8:43 ` Fabio Giovagnini
2010-03-17 9:17 ` Magnus Damm
2010-03-17 11:02 ` Fabio Giovagnini
2010-03-17 11:06 ` Magnus Damm
2010-03-17 11:11 ` Fabio Giovagnini
2010-03-17 11:15 ` Magnus Damm
2010-03-17 11:31 ` Fabio Giovagnini
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=201003170647.15084.fabio.giovagnini@aurion-tech.com \
--to=fabio.giovagnini@aurion-tech.com \
--cc=linux-sh@vger.kernel.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