On Wed, Dec 29, 2021 at 9:51 PM Fabio Estevam <[email protected]> wrote: > > Hi Peter, > > On Wed, Dec 29, 2021 at 6:14 PM Peter Robinson <[email protected]> wrote: > > > I'll give that a go shortly, that was still on my todo list do debug, > > it was detecting it earlier in the boot for memory detection but > > failing with a -6 when doing board detection and working later but > > hadn't got to the bottom of it yet. > > I think I understand the issue: since get_board_value() is called from > SPL and U-Boot > proper, we need to call gpio_free(), otherwise, the gpio_request() > will be called on GPIOs > that were already requested. > > Does the patch below fix the problem? > > diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c > index 62f81fff6817..075c4f208f23 100644 > --- a/board/udoo/neo/neo.c > +++ b/board/udoo/neo/neo.c > @@ -333,6 +333,8 @@ static int get_board_value(void) > * Extended 1 1 > */ > > + gpio_free(IMX_GPIO_NR(4, 13)); > + gpio_free(IMX_GPIO_NR(4, 0)); > return (r184 << 1) + r185;
I actually have a patch locally that does exactly that and tried it a few days ago but to no avail. I was trying to work out if it could be done via DM but I couldn't work out how to do that. I'll dig into it more tomorrow and report back. P

