* MII command to read and write specific registers
@ 2019-07-11 13:30 Benjamin Beckmeyer
2019-07-11 17:36 ` Antony Pavlov
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Beckmeyer @ 2019-07-11 13:30 UTC (permalink / raw)
To: barebox
Hey all,
is there a possibility to read/write specific registers from/to different MII addresses?
I know that there is miitool but it just can give me the first 16 registers of a PHY.
But I need write specific registers e.g. MII addr 2 register 0 and read MII addr 2
register 1. I know uboot is having the mii command(exactly what I would need), and I
have seen that there were parameters for address and register in miitool but they
were deleted lastly.
Thanks in advance.
Cheers,
Benjamin
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MII command to read and write specific registers
2019-07-11 13:30 MII command to read and write specific registers Benjamin Beckmeyer
@ 2019-07-11 17:36 ` Antony Pavlov
2019-07-12 6:40 ` Benjamin Beckmeyer
2019-07-12 7:13 ` Andrey Smirnov
0 siblings, 2 replies; 4+ messages in thread
From: Antony Pavlov @ 2019-07-11 17:36 UTC (permalink / raw)
To: Benjamin Beckmeyer; +Cc: barebox
On Thu, 11 Jul 2019 15:30:01 +0200
Benjamin Beckmeyer <beb@eks-engel.de> wrote:
> Hey all,
> is there a possibility to read/write specific registers from/to different MII addresses?
>
> I know that there is miitool but it just can give me the first 16 registers of a PHY.
> But I need write specific registers e.g. MII addr 2 register 0 and read MII addr 2
> register 1. I know uboot is having the mii command(exactly what I would need), and I
> have seen that there were parameters for address and register in miitool but they
> were deleted lastly.
>
Hi Benjamin!
You can use /dev/mdio* devices for reading/writing MII registers.
E.g.
md -s /dev/mdio0-phy00
mw -d /dev/mdio0-phy00 -w 0 0x12345678
Just after barebox boot there is no /dev/mdio* devices.
After network interface initialization (e.g. after ifup command) or
after miitool command the /dev/mdio* devices appear.
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MII command to read and write specific registers
2019-07-11 17:36 ` Antony Pavlov
@ 2019-07-12 6:40 ` Benjamin Beckmeyer
2019-07-12 7:13 ` Andrey Smirnov
1 sibling, 0 replies; 4+ messages in thread
From: Benjamin Beckmeyer @ 2019-07-12 6:40 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
> On Thu, 11 Jul 2019 15:30:01 +0200
> Benjamin Beckmeyer <beb@eks-engel.de> wrote:
>
>> Hey all,
>> is there a possibility to read/write specific registers from/to different MII addresses?
>>
>> I know that there is miitool but it just can give me the first 16 registers of a PHY.
>> But I need write specific registers e.g. MII addr 2 register 0 and read MII addr 2
>> register 1. I know uboot is having the mii command(exactly what I would need), and I
>> have seen that there were parameters for address and register in miitool but they
>> were deleted lastly.
>>
> Hi Benjamin!
>
> You can use /dev/mdio* devices for reading/writing MII registers.
> E.g.
> md -s /dev/mdio0-phy00
> mw -d /dev/mdio0-phy00 -w 0 0x12345678
>
> Just after barebox boot there is no /dev/mdio* devices.
> After network interface initialization (e.g. after ifup command) or
> after miitool command the /dev/mdio* devices appear.
Hi Antony,
thanks for your reply. That will help me a lot.
Best regards,
Benjamin
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MII command to read and write specific registers
2019-07-11 17:36 ` Antony Pavlov
2019-07-12 6:40 ` Benjamin Beckmeyer
@ 2019-07-12 7:13 ` Andrey Smirnov
1 sibling, 0 replies; 4+ messages in thread
From: Andrey Smirnov @ 2019-07-12 7:13 UTC (permalink / raw)
To: Antony Pavlov; +Cc: Barebox List, Benjamin Beckmeyer
On Thu, Jul 11, 2019 at 10:36 AM Antony Pavlov <antonynpavlov@gmail.com> wrote:
>
> On Thu, 11 Jul 2019 15:30:01 +0200
> Benjamin Beckmeyer <beb@eks-engel.de> wrote:
>
> > Hey all,
> > is there a possibility to read/write specific registers from/to different MII addresses?
> >
> > I know that there is miitool but it just can give me the first 16 registers of a PHY.
> > But I need write specific registers e.g. MII addr 2 register 0 and read MII addr 2
> > register 1. I know uboot is having the mii command(exactly what I would need), and I
> > have seen that there were parameters for address and register in miitool but they
> > were deleted lastly.
> >
>
> Hi Benjamin!
>
> You can use /dev/mdio* devices for reading/writing MII registers.
> E.g.
> md -s /dev/mdio0-phy00
> mw -d /dev/mdio0-phy00 -w 0 0x12345678
>
> Just after barebox boot there is no /dev/mdio* devices.
> After network interface initialization (e.g. after ifup command) or
> after miitool command the /dev/mdio* devices appear.
>
Adding to that, if you device doesn't have register layout detectable
by MII bus probe algorithm an arbitrary phydev can be forcefully
created using
miitool -r <busno>:<addr>
Comes really handy when dealing with something other than PHY devices
(e.g reading switch registers).
Thanks,
Andrey Smirnov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-12 7:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 13:30 MII command to read and write specific registers Benjamin Beckmeyer
2019-07-11 17:36 ` Antony Pavlov
2019-07-12 6:40 ` Benjamin Beckmeyer
2019-07-12 7:13 ` Andrey Smirnov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox