Re: [PATCH 2/6] spl: Add function prototype for spl_mmc_get_uboot_raw_sector

2023-03-22 Thread Tom Rini
On Thu, Mar 09, 2023 at 11:22:08AM -0500, Tom Rini wrote:

> We did not add a prototype for spl_mmc_get_uboot_raw_sector to
> include/spl.h before, so add and document one now. Correct the incorrect
> prototype in board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c and
> ensure that we have spl.h where we define a non-weak
> spl_mmc_get_uboot_raw_sector as well.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH 2/6] spl: Add function prototype for spl_mmc_get_uboot_raw_sector

2023-03-09 Thread Tom Rini
We did not add a prototype for spl_mmc_get_uboot_raw_sector to
include/spl.h before, so add and document one now. Correct the incorrect
prototype in board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c and
ensure that we have spl.h where we define a non-weak
spl_mmc_get_uboot_raw_sector as well.

Signed-off-by: Tom Rini 
---
 arch/arm/mach-imx/image-container.c |  1 +
 board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c |  3 ++-
 include/spl.h   | 13 +
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/image-container.c 
b/arch/arm/mach-imx/image-container.c
index 06ee608c4a46..5b059a64292e 100644
--- a/arch/arm/mach-imx/image-container.c
+++ b/arch/arm/mach-imx/image-container.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c 
b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
index 34109c69ddbd..09e63e052100 100644
--- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
+++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
@@ -208,7 +208,8 @@ int board_late_init(void)
 
 #ifdef CONFIG_SPL_MMC
 #define UBOOT_RAW_SECTOR_OFFSET 0x40
-unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc)
+unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
+  unsigned long raw_sector)
 {
u32 boot_dev = spl_boot_device();
 
diff --git a/include/spl.h b/include/spl.h
index 827bd25c8839..a6cec91f1845 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -466,6 +466,19 @@ int spl_mmc_emmc_boot_partition(struct mmc *mmc);
 
 void spl_set_bd(void);
 
+/**
+ * spl_mmc_get_uboot_raw_sector() - Provide raw sector of the start of U-Boot
+ *
+ * This is a weak function which by default will provide the raw sector that is
+ * where the start of the U-Boot image has been written to.
+ *
+ * @mmc: struct mmc that describes the devie where U-Boot resides
+ * @raw_sect: The raw sector number where U-Boot is by default.
+ * Return: The raw sector location that U-Boot resides at
+ */
+unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
+  unsigned long raw_sect);
+
 /**
  * spl_set_header_raw_uboot() - Set up a standard SPL image structure
  *
-- 
2.34.1