* [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC
@ 2023-07-05 23:26 Marek Vasut
2023-07-06 8:00 ` Peng Fan
2023-07-11 19:43 ` sbabic
0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2023-07-05 23:26 UTC (permalink / raw)
To: u-boot; +Cc: trini, Marek Vasut, Fabio Estevam, Peng Fan, Stefano Babic
In case the i.MX8M Plus starts from eMMC BOOT1/BOOT2 HW partitions, the
flash.bin container is stored at offset 0 from the start, that means the
fitImage itb is at offset 0x2c0 instead of 0x300 sectors from the start.
Handle this difference in custom spl_mmc_get_uboot_raw_sector() .
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
board/data_modul/imx8mp_edm_sbc/spl.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/board/data_modul/imx8mp_edm_sbc/spl.c b/board/data_modul/imx8mp_edm_sbc/spl.c
index c30185e48d4..2fdd95a730c 100644
--- a/board/data_modul/imx8mp_edm_sbc/spl.c
+++ b/board/data_modul/imx8mp_edm_sbc/spl.c
@@ -107,6 +107,20 @@ void board_boot_order(u32 *spl_boot_list)
spl_boot_list[4] = BOOT_DEVICE_NONE;
}
+unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long sect)
+{
+ const u32 boot_dev = spl_boot_device();
+ int part;
+
+ if (boot_dev == BOOT_DEVICE_MMC2) { /* eMMC */
+ part = spl_mmc_emmc_boot_partition(mmc);
+ if (part == 1 || part == 2) /* eMMC BOOT1/BOOT2 HW partitions */
+ return sect - 0x40;
+ }
+
+ return sect;
+}
+
static struct dram_timing_info *dram_timing_info[8] = {
&dmo_imx8mp_sbc_dram_timing_32_32, /* 32 Gbit x32 */
NULL, /* 32 Gbit x16 */
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC
2023-07-05 23:26 [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC Marek Vasut
@ 2023-07-06 8:00 ` Peng Fan
2023-07-06 22:55 ` Jaehoon Chung
2023-07-11 19:43 ` sbabic
1 sibling, 1 reply; 4+ messages in thread
From: Peng Fan @ 2023-07-06 8:00 UTC (permalink / raw)
To: Marek Vasut, u-boot@lists.denx.de
Cc: trini@konsulko.com, Fabio Estevam, Peng Fan, Stefano Babic
On 7/6/2023 7:26 AM, Marek Vasut wrote:
> In case the i.MX8M Plus starts from eMMC BOOT1/BOOT2 HW partitions, the
> flash.bin container is stored at offset 0 from the start, that means the
> fitImage itb is at offset 0x2c0 instead of 0x300 sectors from the start.
> Handle this difference in custom spl_mmc_get_uboot_raw_sector() .
>
> Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> board/data_modul/imx8mp_edm_sbc/spl.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/board/data_modul/imx8mp_edm_sbc/spl.c b/board/data_modul/imx8mp_edm_sbc/spl.c
> index c30185e48d4..2fdd95a730c 100644
> --- a/board/data_modul/imx8mp_edm_sbc/spl.c
> +++ b/board/data_modul/imx8mp_edm_sbc/spl.c
> @@ -107,6 +107,20 @@ void board_boot_order(u32 *spl_boot_list)
> spl_boot_list[4] = BOOT_DEVICE_NONE;
> }
>
> +unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long sect)
> +{
> + const u32 boot_dev = spl_boot_device();
> + int part;
> +
> + if (boot_dev == BOOT_DEVICE_MMC2) { /* eMMC */
> + part = spl_mmc_emmc_boot_partition(mmc);
> + if (part == 1 || part == 2) /* eMMC BOOT1/BOOT2 HW partitions */
> + return sect - 0x40;
> + }
> +
> + return sect;
> +}
> +
> static struct dram_timing_info *dram_timing_info[8] = {
> &dmo_imx8mp_sbc_dram_timing_32_32, /* 32 Gbit x32 */
> NULL, /* 32 Gbit x16 */
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC
2023-07-06 8:00 ` Peng Fan
@ 2023-07-06 22:55 ` Jaehoon Chung
0 siblings, 0 replies; 4+ messages in thread
From: Jaehoon Chung @ 2023-07-06 22:55 UTC (permalink / raw)
To: 'Peng Fan', 'Marek Vasut', u-boot
Cc: trini, 'Fabio Estevam', 'Peng Fan',
'Stefano Babic'
> -----Original Message-----
> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Peng Fan
> Sent: Thursday, July 6, 2023 5:01 PM
> To: Marek Vasut <marex@denx.de>; u-boot@lists.denx.de
> Cc: trini@konsulko.com; Fabio Estevam <festevam@gmail.com>; Peng Fan <peng.fan@nxp.com>; Stefano Babic
> <sbabic@denx.de>
> Subject: Re: [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC
>
>
>
> On 7/6/2023 7:26 AM, Marek Vasut wrote:
> > In case the i.MX8M Plus starts from eMMC BOOT1/BOOT2 HW partitions, the
> > flash.bin container is stored at offset 0 from the start, that means the
> > fitImage itb is at offset 0x2c0 instead of 0x300 sectors from the start.
> > Handle this difference in custom spl_mmc_get_uboot_raw_sector() .
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Best Regards,
Jaehoon Chung
>
> > ---
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Peng Fan <peng.fan@nxp.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > ---
> > board/data_modul/imx8mp_edm_sbc/spl.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/board/data_modul/imx8mp_edm_sbc/spl.c b/board/data_modul/imx8mp_edm_sbc/spl.c
> > index c30185e48d4..2fdd95a730c 100644
> > --- a/board/data_modul/imx8mp_edm_sbc/spl.c
> > +++ b/board/data_modul/imx8mp_edm_sbc/spl.c
> > @@ -107,6 +107,20 @@ void board_boot_order(u32 *spl_boot_list)
> > spl_boot_list[4] = BOOT_DEVICE_NONE;
> > }
> >
> > +unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long sect)
> > +{
> > + const u32 boot_dev = spl_boot_device();
> > + int part;
> > +
> > + if (boot_dev == BOOT_DEVICE_MMC2) { /* eMMC */
> > + part = spl_mmc_emmc_boot_partition(mmc);
> > + if (part == 1 || part == 2) /* eMMC BOOT1/BOOT2 HW partitions */
> > + return sect - 0x40;
> > + }
> > +
> > + return sect;
> > +}
> > +
> > static struct dram_timing_info *dram_timing_info[8] = {
> > &dmo_imx8mp_sbc_dram_timing_32_32, /* 32 Gbit x32 */
> > NULL, /* 32 Gbit x16 */
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC
2023-07-05 23:26 [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC Marek Vasut
2023-07-06 8:00 ` Peng Fan
@ 2023-07-11 19:43 ` sbabic
1 sibling, 0 replies; 4+ messages in thread
From: sbabic @ 2023-07-11 19:43 UTC (permalink / raw)
To: Marek Vasut, u-boot
> In case the i.MX8M Plus starts from eMMC BOOT1/BOOT2 HW partitions, the
> flash.bin container is stored at offset 0 from the start, that means the
> fitImage itb is at offset 0x2c0 instead of 0x300 sectors from the start.
> Handle this difference in custom spl_mmc_get_uboot_raw_sector() .
> Signed-off-by: Marek Vasut <marex@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-11 19:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 23:26 [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC Marek Vasut
2023-07-06 8:00 ` Peng Fan
2023-07-06 22:55 ` Jaehoon Chung
2023-07-11 19:43 ` sbabic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox