Adding support for new Ethernet PHY
Christian Mauderer
list at c-mauderer.de
Mon Jun 17 19:18:36 UTC 2019
On 17/06/2019 20:35, Jonathan Brandmeyer wrote:
> I ran into some device tree support for this phy in
> sys/gnu/dts/include/dt-bindings/net/ti-dp83867.h It looks like
> configuration information that would be fed to the generic mii_fdt
> driver somehow.
>
> Thanks for the tip re: ukphy. What exactly does "basic support
> without any extras" entail? The test environment uses standard
> gigabit workgroup switches. So as long as it comes up in a
> full-duplex gigabit mode, we're happy.
>From a quick look at the registers that should work. The PHY seems to
support some extras like special LED settings or impedance control. But
as long as you don't need that or set it with strapping options I would
expect it to work out of the box.
But even if you need some extra bits: PHY drivers are not that
complicated most of the time. For an example you can have a look at the
rtemsbsd/sys/dev/mii/ksz8091rnb_50MHz.c in libbsd. That PHY needed some
special bits for a 50MHz clock source. Otherwise it not much more than
the ukphy driver.
>
> On Mon, Jun 17, 2019 at 12:09 PM Christian Mauderer <list at c-mauderer.de> wrote:
>>
>> On 17/06/2019 18:16, Jonathan Brandmeyer wrote:
>>> What does it take to support a new Ethernet PHY in rtems-libbsd? We've
>>> got a board with a TI DP83867 family member on it, which appears to have
>>> some support in FreeBSD. How can that get pulled into a particular
>>> rtems-libbsd BSP?
>>>
>>> Thanks,
>>> -Jonathan Brandmeyer
>>>
>>
>> Hello Jonathan,
>>
>> if there is already a PHY driver for that PHY, you basically just follow
>> the steps from "How to Import Code from FreeBSD" in the libbsd
>> CONTRIBUTING.md. PHYs should be quite simple so it would be about:
>>
>> - Add the files to libbsd.py
>> - Run ./freebsd-to-rtems.py -R and ./freebsd-to-rtems.py
>> - Commit the _unchanged_ imported files.
>> - Commit libbsd.py and (if necessary) changes.
>> - Add the driver reference to nexus-devices (if it is a officially
>> supported BSP) or to your application.
>>
>> If it is supported, it should be most likely one of the files in
>> freebsd-org/sys/dev/mii. But to be honest: I didn't find it on a quick
>> look. Where did you find the support?
>>
>> On the other hand: The DP83867E seems to have the default registers. If
>> you only need basic support without any extras, the generic ukphy (short
>> for UnKnown PHY) driver should work.
>>
>> Best regards
>>
>> Christian Mauderer
>
>
>
More information about the devel
mailing list