]> Git Repo - J-u-boot.git/commitdiff
spl: Drop use of uintptr_t
authorSimon Glass <[email protected]>
Thu, 19 Dec 2024 18:29:00 +0000 (11:29 -0700)
committerTom Rini <[email protected]>
Fri, 27 Dec 2024 21:16:10 +0000 (15:16 -0600)
U-Boot uses ulong for addresses. It is confusing to use uintptr_t in a
few places, since it makes people wonder if the types are compatible.
Change the few occurences in SPL to use ulong

Signed-off-by: Simon Glass <[email protected]>
common/spl/spl_atf.c
common/spl/spl_fit.c
common/spl/spl_legacy.c
include/spl.h

index 0397b86a33b115608676de219603613ab91b463b..8bc5db7739508c416efe6daacc008ff4068c9c46 100644 (file)
@@ -41,9 +41,9 @@ struct bl2_to_bl31_params_mem_v2 {
        struct entry_point_info bl31_ep_info;
 };
 
-struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
-                                                    uintptr_t bl33_entry,
-                                                    uintptr_t fdt_addr)
+struct bl31_params *bl2_plat_get_bl31_params_default(ulong bl32_entry,
+                                                    ulong bl33_entry,
+                                                    ulong fdt_addr)
 {
        static struct bl2_to_bl31_params_mem bl31_params_mem;
        struct bl31_params *bl2_to_bl31_params;
@@ -100,17 +100,17 @@ struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
        return bl2_to_bl31_params;
 }
 
-__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
-                                                   uintptr_t bl33_entry,
-                                                   uintptr_t fdt_addr)
+__weak struct bl31_params *bl2_plat_get_bl31_params(ulong bl32_entry,
+                                                   ulong bl33_entry,
+                                                   ulong fdt_addr)
 {
        return bl2_plat_get_bl31_params_default(bl32_entry, bl33_entry,
                                                fdt_addr);
 }
 
-struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry,
-                                                     uintptr_t bl33_entry,
-                                                     uintptr_t fdt_addr)
+struct bl_params *bl2_plat_get_bl31_params_v2_default(ulong bl32_entry,
+                                                     ulong bl33_entry,
+                                                     ulong fdt_addr)
 {
        static struct bl2_to_bl31_params_mem_v2 bl31_params_mem;
        struct bl_params *bl_params;
@@ -173,9 +173,9 @@ struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry,
        return bl_params;
 }
 
-__weak struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,
-                                                    uintptr_t bl33_entry,
-                                                    uintptr_t fdt_addr)
+__weak struct bl_params *bl2_plat_get_bl31_params_v2(ulong bl32_entry,
+                                                    ulong bl33_entry,
+                                                    ulong fdt_addr)
 {
        return bl2_plat_get_bl31_params_v2_default(bl32_entry, bl33_entry,
                                                   fdt_addr);
@@ -188,8 +188,8 @@ static inline void raw_write_daif(unsigned int daif)
 
 typedef void __noreturn (*atf_entry_t)(struct bl31_params *params, void *plat_params);
 
-static void __noreturn bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry,
-                                 uintptr_t bl33_entry, uintptr_t fdt_addr)
+static void __noreturn bl31_entry(ulong bl31_entry, ulong bl32_entry,
+                                 ulong bl33_entry, ulong fdt_addr)
 {
        atf_entry_t  atf_entry = (atf_entry_t)bl31_entry;
        void *bl31_params;
@@ -238,7 +238,7 @@ static int spl_fit_images_find(void *blob, int os)
        return -FDT_ERR_NOTFOUND;
 }
 
-uintptr_t spl_fit_images_get_entry(void *blob, int node)
+ulong spl_fit_images_get_entry(void *blob, int node)
 {
        ulong  val;
        int ret;
@@ -253,10 +253,10 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node)
 
 void __noreturn spl_invoke_atf(struct spl_image_info *spl_image)
 {
-       uintptr_t  bl32_entry = 0;
-       uintptr_t  bl33_entry = CONFIG_TEXT_BASE;
+       ulong  bl32_entry = 0;
+       ulong  bl33_entry = CONFIG_TEXT_BASE;
        void *blob = spl_image->fdt_addr;
-       uintptr_t platform_param = (uintptr_t)blob;
+       ulong platform_param = (ulong)blob;
        int node;
 
        /*
index 3160f573bfbd49b089064086aef005800e1b14f7..ef40a50082cc8f1309017c2ead32a3461e391bf3 100644 (file)
@@ -862,7 +862,7 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
 {
        struct bootm_headers images;
        const char *fit_uname_config = NULL;
-       uintptr_t fdt_hack;
+       ulong fdt_hack;
        const char *uname;
        ulong fw_data = 0, dt_data = 0, img_data = 0;
        ulong fw_len = 0, dt_len = 0, img_len = 0;
index 9252b3a3de0e8338ccbd5479624ef6715566817a..b3efb3e630e39c2cd52ed77761255245b9aea8d5 100644 (file)
 
 #define LZMA_LEN       (1 << 20)
 
-static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size)
+static void spl_parse_legacy_validate(ulong start, ulong size)
 {
-       uintptr_t spl_start = (uintptr_t)_start;
-       uintptr_t spl_end = (uintptr_t)&_image_binary_end;
-       uintptr_t end = start + size;
+       ulong spl_start = (ulong)_start;
+       ulong spl_end = (ulong)&_image_binary_end;
+       ulong end = start + size;
 
        if ((start >= spl_start && start < spl_end) ||
            (end > spl_start && end <= spl_end) ||
index 269e36bb44175e5746b420da3ca9cca6128eed4e..43b344dbc55316e25469b6621968b4540fd2165b 100644 (file)
@@ -268,8 +268,8 @@ enum spl_sandbox_flags {
 struct spl_image_info {
        const char *name;
        u8 os;
-       uintptr_t load_addr;
-       uintptr_t entry_point;
+       ulong load_addr;
+       ulong entry_point;
 #if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL)
        void *fdt_addr;
 #endif
@@ -951,9 +951,9 @@ void __noreturn spl_invoke_atf(struct spl_image_info *spl_image);
  *
  * Return: bl31 params structure pointer
  */
-struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
-                                            uintptr_t bl33_entry,
-                                            uintptr_t fdt_addr);
+struct bl31_params *bl2_plat_get_bl31_params(ulong bl32_entry,
+                                            ulong bl33_entry,
+                                            ulong fdt_addr);
 
 /**
  * bl2_plat_get_bl31_params_default() - prepare params for bl31.
@@ -972,9 +972,9 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
  *
  * Return: bl31 params structure pointer
  */
-struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
-                                                    uintptr_t bl33_entry,
-                                                    uintptr_t fdt_addr);
+struct bl31_params *bl2_plat_get_bl31_params_default(ulong bl32_entry,
+                                                    ulong bl33_entry,
+                                                    ulong fdt_addr);
 
 /**
  * bl2_plat_get_bl31_params_v2() - return params for bl31
@@ -988,9 +988,9 @@ struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
  *
  * Return: bl31 params structure pointer
  */
-struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,
-                                             uintptr_t bl33_entry,
-                                             uintptr_t fdt_addr);
+struct bl_params *bl2_plat_get_bl31_params_v2(ulong bl32_entry,
+                                             ulong bl33_entry,
+                                             ulong fdt_addr);
 
 /**
  * bl2_plat_get_bl31_params_v2_default() - prepare params for bl31.
@@ -1007,9 +1007,9 @@ struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,
  *
  * Return: bl31 params structure pointer
  */
-struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry,
-                                                     uintptr_t bl33_entry,
-                                                     uintptr_t fdt_addr);
+struct bl_params *bl2_plat_get_bl31_params_v2_default(ulong bl32_entry,
+                                                     ulong bl33_entry,
+                                                     ulong fdt_addr);
 /**
  * spl_optee_entry - entry function for optee
  *
This page took 0.048343 seconds and 4 git commands to generate.