Patchwork ARM: mxs: m28evk: Disable OCOTP OUI loading

login
register
mail settings
Submitter Marek Vasut
Date Sept. 20, 2012, 4:33 p.m.
Message ID <201209201833.38960.marex@denx.de>
Download mbox | patch
Permalink /patch/185431/
State New
Headers show

Comments

Marek Vasut - Sept. 20, 2012, 4:33 p.m.
Dear Maxime Ripard,

> Hi Marek,
> 
> Le 20/09/2012 15:10, Marek Vasut a écrit :
> >>> If barebox can't handle even basic DT fixup, it's broken.
> >> 
> >> It can. It maybe was just not needed up to now, dunno.
> > 
> > Fix it and send patch, so this problem doesn't spread.
> 
> I'm sorry, but you still miss the point.
> 
> If someone wants to use another bootloader than U-boot (or a possible
> patched barebox), or none other than the bootlets to boot directly the
> Linux (with an appended device tree), you will still have no way to get
> the NIC from the OCOTP, and I'm sorry, but it is just wrong.
> 
> The kernel shouldn't rely on a particular feature of a given bootloader.

So what do you think about this patch (skip loading from OCOTP if it's already 
present in DT):



Best regards,
Marek Vasut
Maxime Ripard - Sept. 20, 2012, 5:01 p.m.
Le 20/09/2012 18:33, Marek Vasut a écrit :
> Dear Maxime Ripard,
> 
>> Hi Marek,
>>
>> Le 20/09/2012 15:10, Marek Vasut a écrit :
>>>>> If barebox can't handle even basic DT fixup, it's broken.
>>>>
>>>> It can. It maybe was just not needed up to now, dunno.
>>>
>>> Fix it and send patch, so this problem doesn't spread.
>>
>> I'm sorry, but you still miss the point.
>>
>> If someone wants to use another bootloader than U-boot (or a possible
>> patched barebox), or none other than the bootlets to boot directly the
>> Linux (with an appended device tree), you will still have no way to get
>> the NIC from the OCOTP, and I'm sorry, but it is just wrong.
>>
>> The kernel shouldn't rely on a particular feature of a given bootloader.
> 
> So what do you think about this patch (skip loading from OCOTP if it's already 
> present in DT):
> 
> diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
> index 71d47f5..4f014ef 100644
> --- a/arch/arm/mach-mxs/mach-mxs.c
> +++ b/arch/arm/mach-mxs/mach-mxs.c
> @@ -175,6 +175,10 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
>                 np = of_find_compatible_node(from, NULL, "fsl,imx28-fec");
>                 if (!np)
>                         return;
> +
> +               if (of_get_property(np, "local-mac-address", NULL))
> +                       continue;
> +
>                 from = np;
>  
>                 newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);

That definitely looks like the best solution, yes.

You can add my Acked-by if you want.

Maxime
Marek Vasut - Sept. 20, 2012, 5:31 p.m.
Dear Maxime Ripard,

> Le 20/09/2012 18:33, Marek Vasut a écrit :
> > Dear Maxime Ripard,
> > 
> >> Hi Marek,
> >> 
> >> Le 20/09/2012 15:10, Marek Vasut a écrit :
> >>>>> If barebox can't handle even basic DT fixup, it's broken.
> >>>> 
> >>>> It can. It maybe was just not needed up to now, dunno.
> >>> 
> >>> Fix it and send patch, so this problem doesn't spread.
> >> 
> >> I'm sorry, but you still miss the point.
> >> 
> >> If someone wants to use another bootloader than U-boot (or a possible
> >> patched barebox), or none other than the bootlets to boot directly the
> >> Linux (with an appended device tree), you will still have no way to get
> >> the NIC from the OCOTP, and I'm sorry, but it is just wrong.
> >> 
> >> The kernel shouldn't rely on a particular feature of a given bootloader.
> > 
> > So what do you think about this patch (skip loading from OCOTP if it's
> > already present in DT):
> > 
> > diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
> > index 71d47f5..4f014ef 100644
> > --- a/arch/arm/mach-mxs/mach-mxs.c
> > +++ b/arch/arm/mach-mxs/mach-mxs.c
> > @@ -175,6 +175,10 @@ static void __init update_fec_mac_prop(enum mac_oui
> > oui)
> > 
> >                 np = of_find_compatible_node(from, NULL,
> >                 "fsl,imx28-fec"); if (!np)
> >                 
> >                         return;
> > 
> > +
> > +               if (of_get_property(np, "local-mac-address", NULL))
> > +                       continue;
> > +
> > 
> >                 from = np;
> >                 
> >                 newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);
> 
> That definitely looks like the best solution, yes.

Two things I'm not sure about:

1) Use of_get_property() for this task or some other of_*() ?
2) I'll send it as a separate patch

Thanks!

> You can add my Acked-by if you want.
> 
> Maxime

Best regards,
Marek Vasut

Patch

diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 71d47f5..4f014ef 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -175,6 +175,10 @@  static void __init update_fec_mac_prop(enum mac_oui oui)
                np = of_find_compatible_node(from, NULL, "fsl,imx28-fec");
                if (!np)
                        return;
+
+               if (of_get_property(np, "local-mac-address", NULL))
+                       continue;
+
                from = np;
 
                newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);