Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Fabio Estevam
On 21/04/2022 14:10, Michael Nazzareno Trimarchi wrote: The uboot has no problem, the problem is that the function is wrong ;). When you boot from USB you should inform where to pick the environment. You can force ENV_EVERYWHERE for those architectures, you can decide to change the switch as I s

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Michael Nazzareno Trimarchi
Hi On Thu, Apr 21, 2022 at 7:03 PM Fabio Estevam wrote: > > On 21/04/2022 14:01, Michael Nazzareno Trimarchi wrote: > > > I have seen those patches already but the cost of a function pointer > > and a call is more readable. If they get applied, I will be fine with > > them ;) > > They are already

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Fabio Estevam
On 21/04/2022 14:01, Michael Nazzareno Trimarchi wrote: I have seen those patches already but the cost of a function pointer and a call is more readable. If they get applied, I will be fine with them ;) They are already in master. How do we proceed to fix the U-Boot load via USB?

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Michael Nazzareno Trimarchi
Hi On Thu, Apr 21, 2022 at 6:51 PM Adam Ford wrote: > > On Thu, Apr 21, 2022 at 11:47 AM Fabio Estevam wrote: > > > > Hi Michael, > > > > On 21/04/2022 13:34, Michael Nazzareno Trimarchi wrote: > > > > > That function should drop. There is not other architecture that does > > > it. What about: >

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Adam Ford
On Thu, Apr 21, 2022 at 11:47 AM Fabio Estevam wrote: > > Hi Michael, > > On 21/04/2022 13:34, Michael Nazzareno Trimarchi wrote: > > > That function should drop. There is not other architecture that does > > it. What about: > > I implemented your suggestion like this: > > --- a/arch/arm/mach-imx/

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Fabio Estevam
Hi Michael, On 21/04/2022 13:34, Michael Nazzareno Trimarchi wrote: That function should drop. There is not other architecture that does it. What about: I implemented your suggestion like this: --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1536,6 +1536,14 @@ enu

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Michael Nazzareno Trimarchi
Hi Fabio On Thu, Apr 21, 2022 at 6:19 PM Fabio Estevam wrote: > > Hi Michael, > > On 21/04/2022 11:34, Michael Nazzareno Trimarchi wrote: > > > You need only add USB_ case in MMC and NAND > > #ifdef CONFIG_ENV_IS_IN_NAND > > /* add */ > > case USB_BOOT: > > case NAND_BOOT:

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Fabio Estevam
Hi Michael, On 21/04/2022 11:34, Michael Nazzareno Trimarchi wrote: You need only add USB_ case in MMC and NAND #ifdef CONFIG_ENV_IS_IN_NAND /* add */ case USB_BOOT: case NAND_BOOT: env_loc = ENVL_NAND; break; #endif #ifdef CONFIG_ENV_IS_I

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Marek Vasut
On 4/21/22 16:17, Fabio Estevam wrote: Hi Marek, On Wed, Apr 20, 2022 at 7:15 PM Marek Vasut wrote: Did you actually hit the USB_BOOT case or did you fall into the default: case ? It does hit the USB_BOOT case. I also tested forcing to return ENVL_UNKNOWN: Hum, sigh. Can you check where

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Michael Nazzareno Trimarchi
Hi Fabio On Thu, Apr 21, 2022 at 4:17 PM Fabio Estevam wrote: > > Hi Marek, > > On Wed, Apr 20, 2022 at 7:15 PM Marek Vasut wrote: > > > Did you actually hit the USB_BOOT case or did you fall into the default: > > case ? > > It does hit the USB_BOOT case. > > I also tested forcing to return ENVL

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-21 Thread Fabio Estevam
Hi Marek, On Wed, Apr 20, 2022 at 7:15 PM Marek Vasut wrote: > Did you actually hit the USB_BOOT case or did you fall into the default: > case ? It does hit the USB_BOOT case. I also tested forcing to return ENVL_UNKNOWN: --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-20 Thread Marek Vasut
On 4/21/22 00:03, Fabio Estevam wrote: Hi Marek, Hi, On Wed, Apr 20, 2022 at 6:42 PM Marek Vasut wrote: I suspect this happens because arch/arm/mach-imx/imx8m/soc.c env_get_location() contains " ... default: return ENVL_NOWHERE; " right ? I wonder what would happen if you were to ad

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-20 Thread Fabio Estevam
Hi Marek, On Wed, Apr 20, 2022 at 6:42 PM Marek Vasut wrote: > I suspect this happens because > > arch/arm/mach-imx/imx8m/soc.c env_get_location() > > contains > " > ... > default: > return ENVL_NOWHERE; > " > > right ? > > I wonder what would happen if you were to add: > > case USB_BOOT: >

Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-20 Thread Marek Vasut
On 4/20/22 23:07, Fabio Estevam wrote: From: Fabio Estevam Currently, on i.MX8MN/i.MX8MP (Bootrom version 2) it is not possible to load U-Boot via serial download mode, unless CONFIG_ENV_IS_NOWHERE is selected. This was noticed before by Adam Ford and fixed on the imx8mn beacon board in commit

[PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

2022-04-20 Thread Fabio Estevam
From: Fabio Estevam Currently, on i.MX8MN/i.MX8MP (Bootrom version 2) it is not possible to load U-Boot via serial download mode, unless CONFIG_ENV_IS_NOWHERE is selected. This was noticed before by Adam Ford and fixed on the imx8mn beacon board in commit 2c7ebf7778cf ("imx: imx8mn_beacon: Fix U