[PATCH] lpc24xx/lpc17xx: hack to enable ETHERNET support on LPC4088.

Pavel Pisa ppisa4lists at pikron.com
Fri Mar 14 10:17:32 UTC 2014


Hello Sebastian,

On Friday 14 of March 2014 09:09:59 Sebastian Huber wrote:
> thanks for your patience.  I checked in everything except this patch.
> Hopefully it works.

thanks, I will check code over weekend.

As for this actual patch, it is not intended for mainlining
in this form for sure.

> On 2014-03-09 14:24, Pavel Pisa wrote:
> > Pin P1.17 (ENET_MDIO) has changed type to W (analog option).
> > The pin was D category on LPC1788 and if analog option is
> > not explicitly switched off on LPC4088 then it does
> > not work as digital pin.
> > ---
> >   c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h |    7
> > +++++++ 1 file changed, 7 insertions(+)
> >
> > diff --git a/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h
> > b/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h
> > index 0af7256..8753fda 100644
> > --- a/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h
> > +++ b/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h
> > @@ -90,6 +90,13 @@ extern "C" {
> >           lpc24xx_gpio_set(pin);
> >         }
> >       #endif
> > +
> > +    /* Pin P1.17 (ENET_MDIO) has changed type to W (analog option).
> > +     * The pin was D category on LPC1788 and if analog option is
> > +     * not explicitly switched off on LPC4088 then it does
> > +     * not work as digital pin.
> > +     */
> > +    *(uint32_t*)0x4002C0C4 = 0xA1;
>
> Is it possible to use one of the register structures for this instead of
> the magic value?

The problem source is in different subsystem. The ETHERNET
should request pins function/setup exactly same way
LPC1788 and LPC4088 and list of pins is exactly same for both
of our boards variants and even for boards already included
in RTEMS. There is not much options for variations,
if I remember well. There is only one pin usable as
MDIO on this LPC sub-families.

Problem is, that generic pin configuration function does not
distinguish between pin types W and D. When it applies
correct MDIO mode setting for pin D (i.e. input/output digital
pin) then in the fact W type pin is switched to analog mode
which disconnect digital output path and ETHERNET doesnot
work.

The lpc24xx_pin_set_function() in
  rtems/c/src/lib/libbsp/arm/lpc24xx/misc/io.c
needs to distinguish for W type pins.
I check actual LPC17XX_PIN_TYPE_ if it can cover
the W. Change in lpc24xx_pin_set_function() is
required for sure. The MDIO pin should be declared
as D for LPC1788 and as type W for LPC4088, but according
to my testing setup of pin for (incorrect) W on LPC1788
works as well even that it set reserved bit to one
against specs.

I am sending this to the list as well to inform others
about these changes and use of RTEMS for LPC4088.

I look at the code and try to propose correct solution.

Best wishes,

             Pavel



More information about the devel mailing list