Date: Fri, 7 Mar 2014 20:42:30 +0100 From: Milan Obuch <freebsd-mips@dino.sk> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-mips@freebsd.org Subject: Re: I (think) the AR8327 switch support now works Message-ID: <20140307204230.3c86b9b1@zeta.dino.sk> In-Reply-To: <CAJ-Vmok-nF4QdVmUMGJxt4tX=X%2Bvc4_-G100ZPRnQ-2aWyNCog@mail.gmail.com> References: <CAJ-Vmok0cVLnH9DQh%2Bz6XF-NQmPKy_Ez37kLtuCSRThwjQHTJQ@mail.gmail.com> <20140301143607.13a96bd6@zeta.dino.sk> <CAJ-Vmom2coTLFn0zcTa=BzxAOopMjCDUBOtQwOVOyQmCeB19wA@mail.gmail.com> <20140301200546.7ff373d1@zeta.dino.sk> <20140301231239.023b8733@zeta.dino.sk> <CAJ-VmoknT-SWVmcDX-Cx8StUVuZNX%2BqNPzLcMBdLxN7qwssNoA@mail.gmail.com> <20140307140432.0a460da1@zeta.dino.sk> <CAJ-Vmok-nF4QdVmUMGJxt4tX=X%2Bvc4_-G100ZPRnQ-2aWyNCog@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.
--=_mailhost.netlab.sk-59782-1394221353-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On Fri, 7 Mar 2014 10:19:03 -0800
Adrian Chadd <adrian@freebsd.org> wrote:
> On 7 March 2014 05:04, Milan Obuch <freebsd-mips@dino.sk> wrote:
> > On Thu, 6 Mar 2014 23:05:56 -0800
> > Adrian Chadd <adrian@freebsd.org> wrote:
> >
> >> Hi,
> >>
> >> So I'd add some debugging in arswitch_readreg() and
> >> arswitch_writereg() to see what's being read/written. It should be
> >> obviously wrong or not.
> >>
> >> It may be something like the arge0/arge1 MDIO speeds need to be
> >> changed.
> >>
> >>
> >> -a
> >
> > Where is this debugging? I just svn update my src-current tree,
> > built new kernel and does not see any debug info...
>
> There isn't any; you have to add printfs to them. :)
>
>
> -a
Ahh, I misunderstood you, sorry...
So, yes, I did add some printfs, diff in attachment, and voila,
arswitch1 probes and /dev/etherswitch0 got created... so this looks
like some timing issue. I am going to repeat this test with new flash
with fresh world, so I can actually try to do something. In the
meantime, do you have any idea how can I adjust MDIO speed so no printf
is necessary?
Milan
--=_mailhost.netlab.sk-59782-1394221353-0001-2
Content-Type: text/x-patch; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=arswitch.diff
Index: /data/src/11/sys/dev/etherswitch/arswitch/arswitch_reg.c
===================================================================
--- /data/src/11/sys/dev/etherswitch/arswitch/arswitch_reg.c (revision 262886)
+++ /data/src/11/sys/dev/etherswitch/arswitch/arswitch_reg.c (working copy)
@@ -164,9 +164,14 @@
int
arswitch_readreg(device_t dev, int addr)
{
+ int r;
- return (arswitch_readreg_lsb(dev, addr) |
+ r = (arswitch_readreg_lsb(dev, addr) |
arswitch_readreg_msb(dev, addr));
+
+ device_printf(dev, "readreg %4X: %4X\n", addr, r);
+
+ return r;
}
int
@@ -186,6 +191,8 @@
r |= arswitch_writereg_lsb(dev, addr, value);
}
+ device_printf(dev, "writereg %4X: %4X (%4X)\n", addr, value, r);
+
return r;
}
--=_mailhost.netlab.sk-59782-1394221353-0001-2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140307204230.3c86b9b1>
