All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem on imx: add rom api support on imx8mn
@ 2021-07-03 17:24 Michael Nazzareno Trimarchi
  2021-07-08  7:12 ` Peng Fan (OSS)
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-07-03 17:24 UTC (permalink / raw)
  To: Peng Fan, U-Boot-Denx, Stefano Babic; +Cc: Fabio Estevam, Jagan Teki

Hi all

I have some problems that I have understood and fixed but I can not
explain. Right now I have on imx8mn that can boot from boot0 or boot1
partition after remove
a condition in the is_boot_from_stream_device

This is a boot from mmcblk0boot0 with some debug

U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 - 17:00:27 +0000)
power_bd71837_init
DDRINFO: start DRAM init
DDRINFO: DRAM rate 1600MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
ROM API interface 2 from boot 131073

Interface is 2 MMC and boot is 131073 and according to this

static int is_boot_from_stream_device(u32 boot)
+{
+       u32 interface;
+
+       interface = boot >> 16;
+       if (interface >= BT_DEV_TYPE_USB)
+               return 1;
+
+       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
+               return 1;
+
+       return 0;
+}

means a stream interface but it does not boot.

Boot from boot1 give 131072 that is boot1 this let device boot because
is_boot_from_stream_device is 0 and
romapi use spl_romapi_load_image_seekable

Remove boot & 1 condition let me boot from mmcblk0boot0 and
mmcblk0boot1 without any problem

mmc partconf 0
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x0
BOOT_PARTITION_ENABLE: 0x1
PARTITION_ACCESS: 0x0

and the board was fused already.

Any idea why?

Michael

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem on imx: add rom api support on imx8mn
  2021-07-03 17:24 Problem on imx: add rom api support on imx8mn Michael Nazzareno Trimarchi
@ 2021-07-08  7:12 ` Peng Fan (OSS)
  2021-07-08  9:15   ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Peng Fan (OSS) @ 2021-07-08  7:12 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi, Peng Fan, U-Boot-Denx, Stefano Babic, Ye Li
  Cc: Fabio Estevam, Jagan Teki

On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
> Hi all
> 
> I have some problems that I have understood and fixed but I can not
> explain. Right now I have on imx8mn that can boot from boot0 or boot1
> partition after remove
> a condition in the is_boot_from_stream_device
> 
> This is a boot from mmcblk0boot0 with some debug
> 
> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 - 17:00:27 +0000)
> power_bd71837_init
> DDRINFO: start DRAM init
> DDRINFO: DRAM rate 1600MTS
> DDRINFO:ddrphy calibration done
> DDRINFO: ddrmix config done
> Normal Boot
> Trying to boot from BOOTROM
> ROM API interface 2 from boot 131073
> 
> Interface is 2 MMC and boot is 131073 and according to this
> 
> static int is_boot_from_stream_device(u32 boot)
> +{
> +       u32 interface;
> +
> +       interface = boot >> 16;
> +       if (interface >= BT_DEV_TYPE_USB)
> +               return 1;
> +
> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> +               return 1;
> +
> +       return 0;
> +}
> 
> means a stream interface but it does not boot.
> 
> Boot from boot1 give 131072 that is boot1 this let device boot because

Who gives 131073? Boot from boot1, you mean emmc boot partition0?

> is_boot_from_stream_device is 0 and
> romapi use spl_romapi_load_image_seekable
> 
> Remove boot & 1 condition let me boot from mmcblk0boot0 and
> mmcblk0boot1 without any problem

Have you enabled emmc fastboot in fuse?

boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
stream device. If fastboot mode enabled, you need burn your
flash.bin into offset 0. Not 32KB offset.

Regards,
Peng.

> 
> mmc partconf 0
> EXT_CSD[179], PARTITION_CONFIG:
> BOOT_ACK: 0x0
> BOOT_PARTITION_ENABLE: 0x1
> PARTITION_ACCESS: 0x0
> 
> and the board was fused already.
> 
> Any idea why?
> 
> Michael
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem on imx: add rom api support on imx8mn
  2021-07-08  7:12 ` Peng Fan (OSS)
@ 2021-07-08  9:15   ` Michael Nazzareno Trimarchi
  2021-07-15  6:47     ` Peng Fan (OSS)
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-07-08  9:15 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Peng Fan, U-Boot-Denx, Stefano Babic, Ye Li, Fabio Estevam, Jagan Teki

Hi Peng

On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
> > Hi all
> >
> > I have some problems that I have understood and fixed but I can not
> > explain. Right now I have on imx8mn that can boot from boot0 or boot1
> > partition after remove
> > a condition in the is_boot_from_stream_device
> >
> > This is a boot from mmcblk0boot0 with some debug
> >
> > U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 - 17:00:27 +0000)
> > power_bd71837_init
> > DDRINFO: start DRAM init
> > DDRINFO: DRAM rate 1600MTS
> > DDRINFO:ddrphy calibration done
> > DDRINFO: ddrmix config done
> > Normal Boot
> > Trying to boot from BOOTROM
> > ROM API interface 2 from boot 131073
> >
> > Interface is 2 MMC and boot is 131073 and according to this
> >
> > static int is_boot_from_stream_device(u32 boot)
> > +{
> > +       u32 interface;
> > +
> > +       interface = boot >> 16;
> > +       if (interface >= BT_DEV_TYPE_USB)
> > +               return 1;
> > +
> > +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> > +               return 1;
> > +
> > +       return 0;
> > +}
> >
> > means a stream interface but it does not boot.
> >
> > Boot from boot1 give 131072 that is boot1 this let device boot because
>
> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
>
> > is_boot_from_stream_device is 0 and
> > romapi use spl_romapi_load_image_seekable
> >
> > Remove boot & 1 condition let me boot from mmcblk0boot0 and
> > mmcblk0boot1 without any problem
>
> Have you enabled emmc fastboot in fuse?
>
> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
> stream device. If fastboot mode enabled, you need burn your
> flash.bin into offset 0. Not 32KB offset.

The offset is correct and the spl is starting on boot0 but then it
should load the rest from
boot0 block and not from usb. And why in case of boot1 the 1 is not
present. I flash both
on offset 0. Anyway I sent a patch

Michael

>
> Regards,
> Peng.
>
> >
> > mmc partconf 0
> > EXT_CSD[179], PARTITION_CONFIG:
> > BOOT_ACK: 0x0
> > BOOT_PARTITION_ENABLE: 0x1
> > PARTITION_ACCESS: 0x0
> >
> > and the board was fused already.
> >
> > Any idea why?
> >
> > Michael
> >



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem on imx: add rom api support on imx8mn
  2021-07-08  9:15   ` Michael Nazzareno Trimarchi
@ 2021-07-15  6:47     ` Peng Fan (OSS)
  2021-07-15  6:52       ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Peng Fan (OSS) @ 2021-07-15  6:47 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: Peng Fan, U-Boot-Denx, Stefano Babic, Ye Li, Fabio Estevam, Jagan Teki



On 2021/7/8 17:15, Michael Nazzareno Trimarchi wrote:
> Hi Peng
> 
> On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>>
>> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
>>> Hi all
>>>
>>> I have some problems that I have understood and fixed but I can not
>>> explain. Right now I have on imx8mn that can boot from boot0 or boot1
>>> partition after remove
>>> a condition in the is_boot_from_stream_device
>>>
>>> This is a boot from mmcblk0boot0 with some debug
>>>
>>> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 - 17:00:27 +0000)
>>> power_bd71837_init
>>> DDRINFO: start DRAM init
>>> DDRINFO: DRAM rate 1600MTS
>>> DDRINFO:ddrphy calibration done
>>> DDRINFO: ddrmix config done
>>> Normal Boot
>>> Trying to boot from BOOTROM
>>> ROM API interface 2 from boot 131073
>>>
>>> Interface is 2 MMC and boot is 131073 and according to this
>>>
>>> static int is_boot_from_stream_device(u32 boot)
>>> +{
>>> +       u32 interface;
>>> +
>>> +       interface = boot >> 16;
>>> +       if (interface >= BT_DEV_TYPE_USB)
>>> +               return 1;
>>> +
>>> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
>>> +               return 1;
>>> +
>>> +       return 0;
>>> +}
>>>
>>> means a stream interface but it does not boot.
>>>
>>> Boot from boot1 give 131072 that is boot1 this let device boot because
>>
>> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
>>
>>> is_boot_from_stream_device is 0 and
>>> romapi use spl_romapi_load_image_seekable
>>>
>>> Remove boot & 1 condition let me boot from mmcblk0boot0 and
>>> mmcblk0boot1 without any problem
>>
>> Have you enabled emmc fastboot in fuse?
>>
>> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
>> stream device. If fastboot mode enabled, you need burn your
>> flash.bin into offset 0. Not 32KB offset.
> 
> The offset is correct and the spl is starting on boot0 but then it
> should load the rest from
> boot0 block and not from usb. And why in case of boot1 the 1 is not
> present. I flash both
> on offset 0. Anyway I sent a patch

I suspect you have eMMC fastboot enabled for boot0, but not for boot1.

Regards,
Peng.

> 
> Michael
> 
>>
>> Regards,
>> Peng.
>>
>>>
>>> mmc partconf 0
>>> EXT_CSD[179], PARTITION_CONFIG:
>>> BOOT_ACK: 0x0
>>> BOOT_PARTITION_ENABLE: 0x1
>>> PARTITION_ACCESS: 0x0
>>>
>>> and the board was fused already.
>>>
>>> Any idea why?
>>>
>>> Michael
>>>
> 
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem on imx: add rom api support on imx8mn
  2021-07-15  6:47     ` Peng Fan (OSS)
@ 2021-07-15  6:52       ` Michael Nazzareno Trimarchi
  2021-07-15  7:56         ` [EXT] " Ye Li
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-07-15  6:52 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Peng Fan, U-Boot-Denx, Stefano Babic, Ye Li, Fabio Estevam, Jagan Teki

Hi

On Thu, Jul 15, 2021 at 8:47 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
>
>
> On 2021/7/8 17:15, Michael Nazzareno Trimarchi wrote:
> > Hi Peng
> >
> > On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
> >>
> >> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
> >>> Hi all
> >>>
> >>> I have some problems that I have understood and fixed but I can not
> >>> explain. Right now I have on imx8mn that can boot from boot0 or boot1
> >>> partition after remove
> >>> a condition in the is_boot_from_stream_device
> >>>
> >>> This is a boot from mmcblk0boot0 with some debug
> >>>
> >>> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 - 17:00:27 +0000)
> >>> power_bd71837_init
> >>> DDRINFO: start DRAM init
> >>> DDRINFO: DRAM rate 1600MTS
> >>> DDRINFO:ddrphy calibration done
> >>> DDRINFO: ddrmix config done
> >>> Normal Boot
> >>> Trying to boot from BOOTROM
> >>> ROM API interface 2 from boot 131073
> >>>
> >>> Interface is 2 MMC and boot is 131073 and according to this
> >>>
> >>> static int is_boot_from_stream_device(u32 boot)
> >>> +{
> >>> +       u32 interface;
> >>> +
> >>> +       interface = boot >> 16;
> >>> +       if (interface >= BT_DEV_TYPE_USB)
> >>> +               return 1;
> >>> +
> >>> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> >>> +               return 1;
> >>> +
> >>> +       return 0;
> >>> +}
> >>>
> >>> means a stream interface but it does not boot.
> >>>
> >>> Boot from boot1 give 131072 that is boot1 this let device boot because
> >>
> >> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
> >>
> >>> is_boot_from_stream_device is 0 and
> >>> romapi use spl_romapi_load_image_seekable
> >>>
> >>> Remove boot & 1 condition let me boot from mmcblk0boot0 and
> >>> mmcblk0boot1 without any problem
> >>
> >> Have you enabled emmc fastboot in fuse?
> >>
> >> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
> >> stream device. If fastboot mode enabled, you need burn your
> >> flash.bin into offset 0. Not 32KB offset.
> >
> > The offset is correct and the spl is starting on boot0 but then it
> > should load the rest from
> > boot0 block and not from usb. And why in case of boot1 the 1 is not
> > present. I flash both
> > on offset 0. Anyway I sent a patch
>
> I suspect you have eMMC fastboot enabled for boot0, but not for boot1.

I think that was fuse this way

# Alternative Boot ("Fast boot")
# =>[BT_FUSE_SEL | eMMC boot | USDHC1 EMMC]
FB: ucmd fuse prog -y 1 3 0x10002A00
# =>[Fast boot | 8-bit DDR | MMC High speed | 1.8V | eMMC reset enable]
FB: ucmd fuse prog -y 2 1 0x000000E7
# =>[Fast Boot Ack enable]
FB: ucmd fuse prog -y 2 2 0x00000001
# boot_bus_width: 2 (8-bit), reset_boot_bus_width: 0, boot_mode: 2
(use dual data rate (DDR))
FB: ucmd mmc bootbus 0 2 0 2
# boot_ack: 1, boot_partition: 1 (Boot partition 1), 7 (User area),
partition_access: No access to boot partition (default)
FB: ucmd mmc partconf 0 1 1 0

How is it supposed to work in this case?

Michael



>
> Regards,
> Peng.
>
> >
> > Michael
> >
> >>
> >> Regards,
> >> Peng.
> >>
> >>>
> >>> mmc partconf 0
> >>> EXT_CSD[179], PARTITION_CONFIG:
> >>> BOOT_ACK: 0x0
> >>> BOOT_PARTITION_ENABLE: 0x1
> >>> PARTITION_ACCESS: 0x0
> >>>
> >>> and the board was fused already.
> >>>
> >>> Any idea why?
> >>>
> >>> Michael
> >>>
> >
> >
> >



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [EXT] Re: Problem on imx: add rom api support on imx8mn
  2021-07-15  6:52       ` Michael Nazzareno Trimarchi
@ 2021-07-15  7:56         ` Ye Li
  2021-07-15  8:19           ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Ye Li @ 2021-07-15  7:56 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi, Peng Fan (OSS)
  Cc: Peng Fan, U-Boot-Denx, Stefano Babic, Fabio Estevam, Jagan Teki

Hi Michael,

> -----Original Message-----
> From: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
> Sent: Thursday, July 15, 2021 2:52 PM
> To: Peng Fan (OSS) <peng.fan@oss.nxp.com>
> Cc: Peng Fan <peng.fan@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> Stefano Babic <sbabic@denx.de>; Ye Li <ye.li@nxp.com>; Fabio Estevam
> <festevam@gmail.com>; Jagan Teki <jagan@amarulasolutions.com>
> Subject: [EXT] Re: Problem on imx: add rom api support on imx8mn
> 
> Caution: EXT Email
> 
> Hi
> 
> On Thu, Jul 15, 2021 at 8:47 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> >
> >
> >
> > On 2021/7/8 17:15, Michael Nazzareno Trimarchi wrote:
> > > Hi Peng
> > >
> > > On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> > >>
> > >> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
> > >>> Hi all
> > >>>
> > >>> I have some problems that I have understood and fixed but I can
> > >>> not explain. Right now I have on imx8mn that can boot from boot0
> > >>> or boot1 partition after remove a condition in the
> > >>> is_boot_from_stream_device
> > >>>
> > >>> This is a boot from mmcblk0boot0 with some debug
> > >>>
> > >>> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 -
> > >>> 17:00:27 +0000) power_bd71837_init
> > >>> DDRINFO: start DRAM init
> > >>> DDRINFO: DRAM rate 1600MTS
> > >>> DDRINFO:ddrphy calibration done
> > >>> DDRINFO: ddrmix config done
> > >>> Normal Boot
> > >>> Trying to boot from BOOTROM
> > >>> ROM API interface 2 from boot 131073
> > >>>
> > >>> Interface is 2 MMC and boot is 131073 and according to this
> > >>>
> > >>> static int is_boot_from_stream_device(u32 boot)
> > >>> +{
> > >>> +       u32 interface;
> > >>> +
> > >>> +       interface = boot >> 16;
> > >>> +       if (interface >= BT_DEV_TYPE_USB)
> > >>> +               return 1;
> > >>> +
> > >>> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> > >>> +               return 1;
> > >>> +
> > >>> +       return 0;
> > >>> +}
> > >>>
> > >>> means a stream interface but it does not boot.
> > >>>
> > >>> Boot from boot1 give 131072 that is boot1 this let device boot
> > >>> because
> > >>
> > >> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
> > >>
> > >>> is_boot_from_stream_device is 0 and romapi use
> > >>> spl_romapi_load_image_seekable
> > >>>
> > >>> Remove boot & 1 condition let me boot from mmcblk0boot0 and
> > >>> mmcblk0boot1 without any problem
> > >>
> > >> Have you enabled emmc fastboot in fuse?
> > >>
> > >> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
> > >> stream device. If fastboot mode enabled, you need burn your
> > >> flash.bin into offset 0. Not 32KB offset.
> > >
> > > The offset is correct and the spl is starting on boot0 but then it
> > > should load the rest from
> > > boot0 block and not from usb. And why in case of boot1 the 1 is not
> > > present. I flash both on offset 0. Anyway I sent a patch
> >
> > I suspect you have eMMC fastboot enabled for boot0, but not for boot1.
> 
> I think that was fuse this way
> 
> # Alternative Boot ("Fast boot")
> # =>[BT_FUSE_SEL | eMMC boot | USDHC1 EMMC]
> FB: ucmd fuse prog -y 1 3 0x10002A00
> # =>[Fast boot | 8-bit DDR | MMC High speed | 1.8V | eMMC reset enable]
> FB: ucmd fuse prog -y 2 1 0x000000E7
> # =>[Fast Boot Ack enable]
> FB: ucmd fuse prog -y 2 2 0x00000001
> # boot_bus_width: 2 (8-bit), reset_boot_bus_width: 0, boot_mode: 2 (use dual
> data rate (DDR))
> FB: ucmd mmc bootbus 0 2 0 2
> # boot_ack: 1, boot_partition: 1 (Boot partition 1), 7 (User area),
> partition_access: No access to boot partition (default)
> FB: ucmd mmc partconf 0 1 1 0
> 
> How is it supposed to work in this case?
> 

Above settings use the boot0 for fastboot. When you switch to boot1 for fastboot, did you change the 
partconf setting to "mmc partconf 0 1 2 0"?

If the ROM boots from emmc fastboot, it will set the bit0 to 1 to indicate the fastboot. Since at this time, ROM
does not leave fastboot (just stop the clock), we should continue the stream mode read in SPL for FIT image load. 
So below checking is correct.  If you continue the stream mode read, what is the failure do you meet?
The codes will read max 640KB data from ROM to search to FIT header. Can it get the header or not?

	if (interface == BT_DEV_TYPE_MMC && (boot & 1))
		return 1;

Best regards,
Ye Li

> Michael
> 
> 
> 
> >
> > Regards,
> > Peng.
> >
> > >
> > > Michael
> > >
> > >>
> > >> Regards,
> > >> Peng.
> > >>
> > >>>
> > >>> mmc partconf 0
> > >>> EXT_CSD[179], PARTITION_CONFIG:
> > >>> BOOT_ACK: 0x0
> > >>> BOOT_PARTITION_ENABLE: 0x1
> > >>> PARTITION_ACCESS: 0x0
> > >>>
> > >>> and the board was fused already.
> > >>>
> > >>> Any idea why?
> > >>>
> > >>> Michael
> > >>>
> > >
> > >
> > >
> 
> 
> 
> --
> Michael Nazzareno Trimarchi
> Co-Founder & Chief Executive Officer
> M. +39 347 913 2170
> michael@amarulasolutions.com
> __________________________________
> 
> Amarula Solutions BV
> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172
> info@amarulasolutions.com
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ama
> rulasolutions.com%2F&amp;data=04%7C01%7Cye.li%40nxp.com%7C1e6a78bc
> a6d441c39f8608d9475d2495%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C637619287640324977%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> data=xIsVMyj9Qp1vciZnjJJK1wAT7A8fLdNRAs9pp4tll%2F0%3D&amp;reserved=
> 0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [EXT] Re: Problem on imx: add rom api support on imx8mn
  2021-07-15  7:56         ` [EXT] " Ye Li
@ 2021-07-15  8:19           ` Michael Nazzareno Trimarchi
  2021-08-06  9:56             ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-07-15  8:19 UTC (permalink / raw)
  To: Ye Li
  Cc: Peng Fan (OSS),
	Peng Fan, U-Boot-Denx, Stefano Babic, Fabio Estevam, Jagan Teki

Hi

On Thu, Jul 15, 2021 at 9:56 AM Ye Li <ye.li@nxp.com> wrote:
>
> Hi Michael,
>
> > -----Original Message-----
> > From: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
> > Sent: Thursday, July 15, 2021 2:52 PM
> > To: Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > Cc: Peng Fan <peng.fan@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > Stefano Babic <sbabic@denx.de>; Ye Li <ye.li@nxp.com>; Fabio Estevam
> > <festevam@gmail.com>; Jagan Teki <jagan@amarulasolutions.com>
> > Subject: [EXT] Re: Problem on imx: add rom api support on imx8mn
> >
> > Caution: EXT Email
> >
> > Hi
> >
> > On Thu, Jul 15, 2021 at 8:47 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > >
> > >
> > >
> > > On 2021/7/8 17:15, Michael Nazzareno Trimarchi wrote:
> > > > Hi Peng
> > > >
> > > > On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > > >>
> > > >> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
> > > >>> Hi all
> > > >>>
> > > >>> I have some problems that I have understood and fixed but I can
> > > >>> not explain. Right now I have on imx8mn that can boot from boot0
> > > >>> or boot1 partition after remove a condition in the
> > > >>> is_boot_from_stream_device
> > > >>>
> > > >>> This is a boot from mmcblk0boot0 with some debug
> > > >>>
> > > >>> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 -
> > > >>> 17:00:27 +0000) power_bd71837_init
> > > >>> DDRINFO: start DRAM init
> > > >>> DDRINFO: DRAM rate 1600MTS
> > > >>> DDRINFO:ddrphy calibration done
> > > >>> DDRINFO: ddrmix config done
> > > >>> Normal Boot
> > > >>> Trying to boot from BOOTROM
> > > >>> ROM API interface 2 from boot 131073
> > > >>>
> > > >>> Interface is 2 MMC and boot is 131073 and according to this
> > > >>>
> > > >>> static int is_boot_from_stream_device(u32 boot)
> > > >>> +{
> > > >>> +       u32 interface;
> > > >>> +
> > > >>> +       interface = boot >> 16;
> > > >>> +       if (interface >= BT_DEV_TYPE_USB)
> > > >>> +               return 1;
> > > >>> +
> > > >>> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> > > >>> +               return 1;
> > > >>> +
> > > >>> +       return 0;
> > > >>> +}
> > > >>>
> > > >>> means a stream interface but it does not boot.
> > > >>>
> > > >>> Boot from boot1 give 131072 that is boot1 this let device boot
> > > >>> because
> > > >>
> > > >> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
> > > >>
> > > >>> is_boot_from_stream_device is 0 and romapi use
> > > >>> spl_romapi_load_image_seekable
> > > >>>
> > > >>> Remove boot & 1 condition let me boot from mmcblk0boot0 and
> > > >>> mmcblk0boot1 without any problem
> > > >>
> > > >> Have you enabled emmc fastboot in fuse?
> > > >>
> > > >> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
> > > >> stream device. If fastboot mode enabled, you need burn your
> > > >> flash.bin into offset 0. Not 32KB offset.
> > > >
> > > > The offset is correct and the spl is starting on boot0 but then it
> > > > should load the rest from
> > > > boot0 block and not from usb. And why in case of boot1 the 1 is not
> > > > present. I flash both on offset 0. Anyway I sent a patch
> > >
> > > I suspect you have eMMC fastboot enabled for boot0, but not for boot1.
> >
> > I think that was fuse this way
> >
> > # Alternative Boot ("Fast boot")
> > # =>[BT_FUSE_SEL | eMMC boot | USDHC1 EMMC]
> > FB: ucmd fuse prog -y 1 3 0x10002A00
> > # =>[Fast boot | 8-bit DDR | MMC High speed | 1.8V | eMMC reset enable]
> > FB: ucmd fuse prog -y 2 1 0x000000E7
> > # =>[Fast Boot Ack enable]
> > FB: ucmd fuse prog -y 2 2 0x00000001
> > # boot_bus_width: 2 (8-bit), reset_boot_bus_width: 0, boot_mode: 2 (use dual
> > data rate (DDR))
> > FB: ucmd mmc bootbus 0 2 0 2
> > # boot_ack: 1, boot_partition: 1 (Boot partition 1), 7 (User area),
> > partition_access: No access to boot partition (default)
> > FB: ucmd mmc partconf 0 1 1 0
> >
> > How is it supposed to work in this case?
> >
>
> Above settings use the boot0 for fastboot. When you switch to boot1 for fastboot, did you change the
> partconf setting to "mmc partconf 0 1 2 0"?

I don't need to use fastboot. I mean the idea is if I boot from block0
I want to continue there. BOOTROM
fill the mode but then it should be able to not fail. Am I right?

>
> If the ROM boots from emmc fastboot, it will set the bit0 to 1 to indicate the fastboot. Since at this time, ROM
> does not leave fastboot (just stop the clock), we should continue the stream mode read in SPL for FIT image load.
> So below checking is correct.  If you continue the stream mode read, what is the failure do you meet?
> The codes will read max 640KB data from ROM to search to FIT header. Can it get the header or not?
>

It does not find the header, in this case and it's not  problem of
size of 640Kb (I have extend it). My impression
is that is loading from mmcblk0 and not boot partition

Michael

>         if (interface == BT_DEV_TYPE_MMC && (boot & 1))
>                 return 1;
>
> Best regards,
> Ye Li
>
> > Michael
> >
> >
> >
> > >
> > > Regards,
> > > Peng.
> > >
> > > >
> > > > Michael
> > > >
> > > >>
> > > >> Regards,
> > > >> Peng.
> > > >>
> > > >>>
> > > >>> mmc partconf 0
> > > >>> EXT_CSD[179], PARTITION_CONFIG:
> > > >>> BOOT_ACK: 0x0
> > > >>> BOOT_PARTITION_ENABLE: 0x1
> > > >>> PARTITION_ACCESS: 0x0
> > > >>>
> > > >>> and the board was fused already.
> > > >>>
> > > >>> Any idea why?
> > > >>>
> > > >>> Michael
> > > >>>
> > > >
> > > >
> > > >
> >
> >
> >
> > --
> > Michael Nazzareno Trimarchi
> > Co-Founder & Chief Executive Officer
> > M. +39 347 913 2170
> > michael@amarulasolutions.com
> > __________________________________
> >
> > Amarula Solutions BV
> > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172
> > info@amarulasolutions.com
> > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ama
> > rulasolutions.com%2F&amp;data=04%7C01%7Cye.li%40nxp.com%7C1e6a78bc
> > a6d441c39f8608d9475d2495%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> > 7C0%7C637619287640324977%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> > jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> > data=xIsVMyj9Qp1vciZnjJJK1wAT7A8fLdNRAs9pp4tll%2F0%3D&amp;reserved=
> > 0



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [EXT] Re: Problem on imx: add rom api support on imx8mn
  2021-07-15  8:19           ` Michael Nazzareno Trimarchi
@ 2021-08-06  9:56             ` Michael Nazzareno Trimarchi
  2021-08-06 10:16               ` Peng Fan (OSS)
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-08-06  9:56 UTC (permalink / raw)
  To: Ye Li
  Cc: Peng Fan (OSS),
	Peng Fan, U-Boot-Denx, Stefano Babic, Fabio Estevam, Jagan Teki

Hi Ye

On Thu, Jul 15, 2021 at 10:19 AM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
>
> Hi
>
> On Thu, Jul 15, 2021 at 9:56 AM Ye Li <ye.li@nxp.com> wrote:
> >
> > Hi Michael,
> >
> > > -----Original Message-----
> > > From: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
> > > Sent: Thursday, July 15, 2021 2:52 PM
> > > To: Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > > Cc: Peng Fan <peng.fan@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > > Stefano Babic <sbabic@denx.de>; Ye Li <ye.li@nxp.com>; Fabio Estevam
> > > <festevam@gmail.com>; Jagan Teki <jagan@amarulasolutions.com>
> > > Subject: [EXT] Re: Problem on imx: add rom api support on imx8mn
> > >
> > > Caution: EXT Email
> > >
> > > Hi
> > >
> > > On Thu, Jul 15, 2021 at 8:47 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > > wrote:
> > > >
> > > >
> > > >
> > > > On 2021/7/8 17:15, Michael Nazzareno Trimarchi wrote:
> > > > > Hi Peng
> > > > >
> > > > > On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > > wrote:
> > > > >>
> > > > >> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
> > > > >>> Hi all
> > > > >>>
> > > > >>> I have some problems that I have understood and fixed but I can
> > > > >>> not explain. Right now I have on imx8mn that can boot from boot0
> > > > >>> or boot1 partition after remove a condition in the
> > > > >>> is_boot_from_stream_device
> > > > >>>
> > > > >>> This is a boot from mmcblk0boot0 with some debug
> > > > >>>
> > > > >>> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 -
> > > > >>> 17:00:27 +0000) power_bd71837_init
> > > > >>> DDRINFO: start DRAM init
> > > > >>> DDRINFO: DRAM rate 1600MTS
> > > > >>> DDRINFO:ddrphy calibration done
> > > > >>> DDRINFO: ddrmix config done
> > > > >>> Normal Boot
> > > > >>> Trying to boot from BOOTROM
> > > > >>> ROM API interface 2 from boot 131073
> > > > >>>
> > > > >>> Interface is 2 MMC and boot is 131073 and according to this
> > > > >>>
> > > > >>> static int is_boot_from_stream_device(u32 boot)
> > > > >>> +{
> > > > >>> +       u32 interface;
> > > > >>> +
> > > > >>> +       interface = boot >> 16;
> > > > >>> +       if (interface >= BT_DEV_TYPE_USB)
> > > > >>> +               return 1;
> > > > >>> +
> > > > >>> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> > > > >>> +               return 1;
> > > > >>> +
> > > > >>> +       return 0;
> > > > >>> +}
> > > > >>>
> > > > >>> means a stream interface but it does not boot.
> > > > >>>
> > > > >>> Boot from boot1 give 131072 that is boot1 this let device boot
> > > > >>> because
> > > > >>
> > > > >> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
> > > > >>
> > > > >>> is_boot_from_stream_device is 0 and romapi use
> > > > >>> spl_romapi_load_image_seekable
> > > > >>>
> > > > >>> Remove boot & 1 condition let me boot from mmcblk0boot0 and
> > > > >>> mmcblk0boot1 without any problem
> > > > >>
> > > > >> Have you enabled emmc fastboot in fuse?
> > > > >>
> > > > >> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
> > > > >> stream device. If fastboot mode enabled, you need burn your
> > > > >> flash.bin into offset 0. Not 32KB offset.
> > > > >
> > > > > The offset is correct and the spl is starting on boot0 but then it
> > > > > should load the rest from
> > > > > boot0 block and not from usb. And why in case of boot1 the 1 is not
> > > > > present. I flash both on offset 0. Anyway I sent a patch
> > > >
> > > > I suspect you have eMMC fastboot enabled for boot0, but not for boot1.
> > >
> > > I think that was fuse this way
> > >
> > > # Alternative Boot ("Fast boot")
> > > # =>[BT_FUSE_SEL | eMMC boot | USDHC1 EMMC]
> > > FB: ucmd fuse prog -y 1 3 0x10002A00
> > > # =>[Fast boot | 8-bit DDR | MMC High speed | 1.8V | eMMC reset enable]
> > > FB: ucmd fuse prog -y 2 1 0x000000E7
> > > # =>[Fast Boot Ack enable]
> > > FB: ucmd fuse prog -y 2 2 0x00000001
> > > # boot_bus_width: 2 (8-bit), reset_boot_bus_width: 0, boot_mode: 2 (use dual
> > > data rate (DDR))
> > > FB: ucmd mmc bootbus 0 2 0 2
> > > # boot_ack: 1, boot_partition: 1 (Boot partition 1), 7 (User area),
> > > partition_access: No access to boot partition (default)
> > > FB: ucmd mmc partconf 0 1 1 0
> > >
> > > How is it supposed to work in this case?
> > >
> >
> > Above settings use the boot0 for fastboot. When you switch to boot1 for fastboot, did you change the
> > partconf setting to "mmc partconf 0 1 2 0"?
>
> I don't need to use fastboot. I mean the idea is if I boot from block0
> I want to continue there. BOOTROM
> fill the mode but then it should be able to not fail. Am I right?
>
> >
> > If the ROM boots from emmc fastboot, it will set the bit0 to 1 to indicate the fastboot. Since at this time, ROM
> > does not leave fastboot (just stop the clock), we should continue the stream mode read in SPL for FIT image load.
> > So below checking is correct.  If you continue the stream mode read, what is the failure do you meet?
> > The codes will read max 640KB data from ROM to search to FIT header. Can it get the header or not?
> >
>
> It does not find the header, in this case and it's not  problem of
> size of 640Kb (I have extend it). My impression
> is that is loading from mmcblk0 and not boot partition

U-Boot SPL 2020.04-00190-g4bad07fb61-dirty (Aug 06 2021 - 11:38:18 +0200)
spl_init
power_bd71837_init
DDRINFO: start DRAM init
DDRINFO: DRAM rate 1600MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
>>SPL: board_init_r()
Normal Boot
Trying to boot from BOOTROM
ROM API interface 2 from boot 131073
Can't found uboot FIT image in 640K range
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

This is my error but if I continue stream mode but it works in seakble mode.
2 is the MMC and boot mode is 131073

Michael

>
> Michael
>
> >         if (interface == BT_DEV_TYPE_MMC && (boot & 1))
> >                 return 1;
> >
> > Best regards,
> > Ye Li
> >
> > > Michael
> > >
> > >
> > >
> > > >
> > > > Regards,
> > > > Peng.
> > > >
> > > > >
> > > > > Michael
> > > > >
> > > > >>
> > > > >> Regards,
> > > > >> Peng.
> > > > >>
> > > > >>>
> > > > >>> mmc partconf 0
> > > > >>> EXT_CSD[179], PARTITION_CONFIG:
> > > > >>> BOOT_ACK: 0x0
> > > > >>> BOOT_PARTITION_ENABLE: 0x1
> > > > >>> PARTITION_ACCESS: 0x0
> > > > >>>
> > > > >>> and the board was fused already.
> > > > >>>
> > > > >>> Any idea why?
> > > > >>>
> > > > >>> Michael
> > > > >>>
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> > > --
> > > Michael Nazzareno Trimarchi
> > > Co-Founder & Chief Executive Officer
> > > M. +39 347 913 2170
> > > michael@amarulasolutions.com
> > > __________________________________
> > >
> > > Amarula Solutions BV
> > > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172
> > > info@amarulasolutions.com
> > > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ama
> > > rulasolutions.com%2F&amp;data=04%7C01%7Cye.li%40nxp.com%7C1e6a78bc
> > > a6d441c39f8608d9475d2495%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> > > 7C0%7C637619287640324977%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> > > jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> > > data=xIsVMyj9Qp1vciZnjJJK1wAT7A8fLdNRAs9pp4tll%2F0%3D&amp;reserved=
> > > 0
>
>
>
> --
> Michael Nazzareno Trimarchi
> Co-Founder & Chief Executive Officer
> M. +39 347 913 2170
> michael@amarulasolutions.com
> __________________________________
>
> Amarula Solutions BV
> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
> T. +31 (0)85 111 9172
> info@amarulasolutions.com
> www.amarulasolutions.com



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [EXT] Re: Problem on imx: add rom api support on imx8mn
  2021-08-06  9:56             ` Michael Nazzareno Trimarchi
@ 2021-08-06 10:16               ` Peng Fan (OSS)
  0 siblings, 0 replies; 9+ messages in thread
From: Peng Fan (OSS) @ 2021-08-06 10:16 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi, Ye Li
  Cc: Peng Fan, U-Boot-Denx, Stefano Babic, Fabio Estevam, Jagan Teki



On 2021/8/6 17:56, Michael Nazzareno Trimarchi wrote:
> Hi Ye
> 
> On Thu, Jul 15, 2021 at 10:19 AM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
>>
>> Hi
>>
>> On Thu, Jul 15, 2021 at 9:56 AM Ye Li <ye.li@nxp.com> wrote:
>>>
>>> Hi Michael,
>>>
>>>> -----Original Message-----
>>>> From: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
>>>> Sent: Thursday, July 15, 2021 2:52 PM
>>>> To: Peng Fan (OSS) <peng.fan@oss.nxp.com>
>>>> Cc: Peng Fan <peng.fan@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
>>>> Stefano Babic <sbabic@denx.de>; Ye Li <ye.li@nxp.com>; Fabio Estevam
>>>> <festevam@gmail.com>; Jagan Teki <jagan@amarulasolutions.com>
>>>> Subject: [EXT] Re: Problem on imx: add rom api support on imx8mn
>>>>
>>>> Caution: EXT Email
>>>>
>>>> Hi
>>>>
>>>> On Thu, Jul 15, 2021 at 8:47 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On 2021/7/8 17:15, Michael Nazzareno Trimarchi wrote:
>>>>>> Hi Peng
>>>>>>
>>>>>> On Thu, Jul 8, 2021 at 9:12 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
>>>> wrote:
>>>>>>>
>>>>>>> On 2021/7/4 1:24, Michael Nazzareno Trimarchi wrote:
>>>>>>>> Hi all
>>>>>>>>
>>>>>>>> I have some problems that I have understood and fixed but I can
>>>>>>>> not explain. Right now I have on imx8mn that can boot from boot0
>>>>>>>> or boot1 partition after remove a condition in the
>>>>>>>> is_boot_from_stream_device
>>>>>>>>
>>>>>>>> This is a boot from mmcblk0boot0 with some debug
>>>>>>>>
>>>>>>>> U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 -
>>>>>>>> 17:00:27 +0000) power_bd71837_init
>>>>>>>> DDRINFO: start DRAM init
>>>>>>>> DDRINFO: DRAM rate 1600MTS
>>>>>>>> DDRINFO:ddrphy calibration done
>>>>>>>> DDRINFO: ddrmix config done
>>>>>>>> Normal Boot
>>>>>>>> Trying to boot from BOOTROM
>>>>>>>> ROM API interface 2 from boot 131073
>>>>>>>>
>>>>>>>> Interface is 2 MMC and boot is 131073 and according to this
>>>>>>>>
>>>>>>>> static int is_boot_from_stream_device(u32 boot)
>>>>>>>> +{
>>>>>>>> +       u32 interface;
>>>>>>>> +
>>>>>>>> +       interface = boot >> 16;
>>>>>>>> +       if (interface >= BT_DEV_TYPE_USB)
>>>>>>>> +               return 1;
>>>>>>>> +
>>>>>>>> +       if (interface == BT_DEV_TYPE_MMC && (boot & 1))
>>>>>>>> +               return 1;
>>>>>>>> +
>>>>>>>> +       return 0;
>>>>>>>> +}
>>>>>>>>
>>>>>>>> means a stream interface but it does not boot.
>>>>>>>>
>>>>>>>> Boot from boot1 give 131072 that is boot1 this let device boot
>>>>>>>> because
>>>>>>>
>>>>>>> Who gives 131073? Boot from boot1, you mean emmc boot partition0?
>>>>>>>
>>>>>>>> is_boot_from_stream_device is 0 and romapi use
>>>>>>>> spl_romapi_load_image_seekable
>>>>>>>>
>>>>>>>> Remove boot & 1 condition let me boot from mmcblk0boot0 and
>>>>>>>> mmcblk0boot1 without any problem
>>>>>>>
>>>>>>> Have you enabled emmc fastboot in fuse?
>>>>>>>
>>>>>>> boot & 1 is checking emmc fastboot. emmc fastboot mode is actually
>>>>>>> stream device. If fastboot mode enabled, you need burn your
>>>>>>> flash.bin into offset 0. Not 32KB offset.
>>>>>>
>>>>>> The offset is correct and the spl is starting on boot0 but then it
>>>>>> should load the rest from
>>>>>> boot0 block and not from usb. And why in case of boot1 the 1 is not
>>>>>> present. I flash both on offset 0. Anyway I sent a patch
>>>>>
>>>>> I suspect you have eMMC fastboot enabled for boot0, but not for boot1.
>>>>
>>>> I think that was fuse this way
>>>>
>>>> # Alternative Boot ("Fast boot")
>>>> # =>[BT_FUSE_SEL | eMMC boot | USDHC1 EMMC]
>>>> FB: ucmd fuse prog -y 1 3 0x10002A00
>>>> # =>[Fast boot | 8-bit DDR | MMC High speed | 1.8V | eMMC reset enable]
>>>> FB: ucmd fuse prog -y 2 1 0x000000E7
>>>> # =>[Fast Boot Ack enable]
>>>> FB: ucmd fuse prog -y 2 2 0x00000001
>>>> # boot_bus_width: 2 (8-bit), reset_boot_bus_width: 0, boot_mode: 2 (use dual
>>>> data rate (DDR))
>>>> FB: ucmd mmc bootbus 0 2 0 2
>>>> # boot_ack: 1, boot_partition: 1 (Boot partition 1), 7 (User area),
>>>> partition_access: No access to boot partition (default)
>>>> FB: ucmd mmc partconf 0 1 1 0
>>>>
>>>> How is it supposed to work in this case?
>>>>
>>>
>>> Above settings use the boot0 for fastboot. When you switch to boot1 for fastboot, did you change the
>>> partconf setting to "mmc partconf 0 1 2 0"?
>>
>> I don't need to use fastboot. I mean the idea is if I boot from block0
>> I want to continue there. BOOTROM
>> fill the mode but then it should be able to not fail. Am I right?
>>
>>>
>>> If the ROM boots from emmc fastboot, it will set the bit0 to 1 to indicate the fastboot. Since at this time, ROM
>>> does not leave fastboot (just stop the clock), we should continue the stream mode read in SPL for FIT image load.
>>> So below checking is correct.  If you continue the stream mode read, what is the failure do you meet?
>>> The codes will read max 640KB data from ROM to search to FIT header. Can it get the header or not?
>>>
>>
>> It does not find the header, in this case and it's not  problem of
>> size of 640Kb (I have extend it). My impression
>> is that is loading from mmcblk0 and not boot partition
> 
> U-Boot SPL 2020.04-00190-g4bad07fb61-dirty (Aug 06 2021 - 11:38:18 +0200)
> spl_init
> power_bd71837_init
> DDRINFO: start DRAM init
> DDRINFO: DRAM rate 1600MTS
> DDRINFO:ddrphy calibration done
> DDRINFO: ddrmix config done
>>> SPL: board_init_r()
> Normal Boot
> Trying to boot from BOOTROM
> ROM API interface 2 from boot 131073
> Can't found uboot FIT image in 640K range
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> This is my error but if I continue stream mode but it works in seakble mode.

stream mode is only effective when usb download and eMMC fastboot.

Note eMMC fastboot, needs both set eMMC chip and SoC fuse(or boot switch)

Otherwise, there is bug somewhere.

Regards,
Peng.

> 2 is the MMC and boot mode is 131073
> 
> Michael
> 
>>
>> Michael
>>
>>>          if (interface == BT_DEV_TYPE_MMC && (boot & 1))
>>>                  return 1;
>>>
>>> Best regards,
>>> Ye Li
>>>
>>>> Michael
>>>>
>>>>
>>>>
>>>>>
>>>>> Regards,
>>>>> Peng.
>>>>>
>>>>>>
>>>>>> Michael
>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>> Peng.
>>>>>>>
>>>>>>>>
>>>>>>>> mmc partconf 0
>>>>>>>> EXT_CSD[179], PARTITION_CONFIG:
>>>>>>>> BOOT_ACK: 0x0
>>>>>>>> BOOT_PARTITION_ENABLE: 0x1
>>>>>>>> PARTITION_ACCESS: 0x0
>>>>>>>>
>>>>>>>> and the board was fused already.
>>>>>>>>
>>>>>>>> Any idea why?
>>>>>>>>
>>>>>>>> Michael
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Michael Nazzareno Trimarchi
>>>> Co-Founder & Chief Executive Officer
>>>> M. +39 347 913 2170
>>>> michael@amarulasolutions.com
>>>> __________________________________
>>>>
>>>> Amarula Solutions BV
>>>> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172
>>>> info@amarulasolutions.com
>>>> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ama%2F&amp;data=04%7C01%7Cpeng.fan%40nxp.com%7Cf865f9a2910d45fa445f08d958c07a17%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637638405967351694%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=y%2Fj1UGXJIzqV4A2mbyse8GhQbFXejyplQwsd6xYbIbs%3D&amp;reserved=0
>>>> rulasolutions.com%2F&amp;data=04%7C01%7Cye.li%40nxp.com%7C1e6a78bc
>>>> a6d441c39f8608d9475d2495%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
>>>> 7C0%7C637619287640324977%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
>>>> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
>>>> data=xIsVMyj9Qp1vciZnjJJK1wAT7A8fLdNRAs9pp4tll%2F0%3D&amp;reserved=
>>>> 0
>>
>>
>>
>> --
>> Michael Nazzareno Trimarchi
>> Co-Founder & Chief Executive Officer
>> M. +39 347 913 2170
>> michael@amarulasolutions.com
>> __________________________________
>>
>> Amarula Solutions BV
>> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
>> T. +31 (0)85 111 9172
>> info@amarulasolutions.com
>> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.amarulasolutions.com%2F&amp;data=04%7C01%7Cpeng.fan%40nxp.com%7Cf865f9a2910d45fa445f08d958c07a17%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637638405967351694%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=M6K%2FtGU2BF3wBoNT9U722IgtKb47VXkW%2Fd8aGYjAXGY%3D&amp;reserved=0
> 
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-06 10:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 17:24 Problem on imx: add rom api support on imx8mn Michael Nazzareno Trimarchi
2021-07-08  7:12 ` Peng Fan (OSS)
2021-07-08  9:15   ` Michael Nazzareno Trimarchi
2021-07-15  6:47     ` Peng Fan (OSS)
2021-07-15  6:52       ` Michael Nazzareno Trimarchi
2021-07-15  7:56         ` [EXT] " Ye Li
2021-07-15  8:19           ` Michael Nazzareno Trimarchi
2021-08-06  9:56             ` Michael Nazzareno Trimarchi
2021-08-06 10:16               ` Peng Fan (OSS)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.