diff options
author | Marek Vasut <marex@denx.de> | 2023-10-16 18:16:12 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2023-10-17 23:55:10 +0200 |
commit | e936db953600aba0986743f12229d8b7ebff92ae (patch) | |
tree | b9a76226e83d2092323071747df0b58da242e5f7 /include/spl.h | |
parent | fb2bdc4efcb99fab62051274ad2330aef07360f6 (diff) |
spl: mmc: Introduce proper layering for spl_mmc_get_uboot_raw_sector()
Introduce two new weak functions, arch_spl_mmc_get_uboot_raw_sector() and
board_spl_mmc_get_uboot_raw_sector(), each of which can be overridden at
a matching level, that is arch/ and board/ , in addition to the existing
weak function spl_mmc_get_uboot_raw_sector().
This way, architecture code can define a default architecture specific
implementation of arch_spl_mmc_get_uboot_raw_sector(), while the board
code can override that using board_spl_mmc_get_uboot_raw_sector() which
takes precedence over the architecture code. In some sort of unlikely
special case where code has to take precedence over board code too, the
spl_mmc_get_uboot_raw_sector() is still left out to be a weak function,
but it should be unlikely that this is ever needed to be overridden.
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'include/spl.h')
-rw-r--r-- | include/spl.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/spl.h b/include/spl.h index 1d416b4c92..1241f09123 100644 --- a/include/spl.h +++ b/include/spl.h @@ -487,6 +487,32 @@ 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 (architecture override) + * + * 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 arch_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, + unsigned long raw_sect); + +/** + * spl_mmc_get_uboot_raw_sector() - Provide raw sector of the start of U-Boot (board override) + * + * 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 board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, + unsigned long raw_sect); + +/** * 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 |