[U-Boot] IS_ERR_VALUE failing on socfpga gen5

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Fri Oct 11 18:31:33 UTC 2019


Simon Glass <sjg at chromium.org> schrieb am Fr., 11. Okt. 2019, 20:27:

> Hi Simon,
>
> On Tue, 8 Oct 2019 at 14:34, Simon Goldschmidt
> <simon.k.r.goldschmidt at gmail.com> wrote:
> >
> > In a series I'm currently preparing, I've stumbled accross the fact that
> > IS_ERR_VALUE() doesn't reliably work on socfpga SPL as the onchip SRAM
> > begins at 0xffff0000 and the heap is at the end of the 32 bit range.
> >
>
> Which function is returning that address?
>

Sorry, I don't know right now and it was kind of hard to debug. But it was
somewhere in the DM initialization of new drivers I was adding. One of
those functions returned a heap pointer that was interpreted as an error
due to the address being in the range regarded as "error pointer"...

Regards,
Simon


> > Being like that, the current test for error (value >= -4095) which
> > equals 'value >= 0xfffff001' would require us to waste the last 4K of
> > that memory, which is not an option when it comes to using DM in SPL...
> >
> > Now on this platform, I'm sure I could find a range of 4096 bytes to use
> > as invalid pointer range, but the question is: how do I integrate that
> > into U-Boot in a clean manner? Would it be acceptable to change the
> > error headers imported from Linux or would I have to through the hassle
> > of changing Linux first?
> >
> > Or does anyone have a better idea to allow using the last 4K for heap?
>
> Regards,
> Simon
>


More information about the U-Boot mailing list