U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>,
	Chanho Park <chanho61.park@samsung.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	Manoj Sai <abbaraju.manojsai@amarulasolutions.com>,
	Marek Vasut <marex@denx.de>, Sean Anderson <seanga2@gmail.com>,
	Suniel Mahesh <sunil@amarulasolutions.com>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH 12/19] spl: Drop use of uintptr_t
Date: Thu, 29 Aug 2024 08:57:55 -0600	[thread overview]
Message-ID: <20240829145802.1827952-13-sjg@chromium.org> (raw)
In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org>

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 <sjg@chromium.org>
---

 common/spl/spl_atf.c    | 36 ++++++++++++++++++------------------
 common/spl/spl_fit.c    |  2 +-
 common/spl/spl_legacy.c |  8 ++++----
 include/spl.h           | 28 ++++++++++++++--------------
 4 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
index 0397b86a33b..8bc5db77395 100644
--- a/common/spl/spl_atf.c
+++ b/common/spl/spl_atf.c
@@ -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;
 
 	/*
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 1ad5a69d807..614dea9ae18 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -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;
diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index a77893455f2..3af7ea33ae9 100644
--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -16,11 +16,11 @@
 
 #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) ||
diff --git a/include/spl.h b/include/spl.h
index de808ccd413..d90eed956af 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -256,8 +256,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
@@ -939,9 +939,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.
@@ -960,9 +960,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
@@ -976,9 +976,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.
@@ -995,9 +995,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
  *
-- 
2.34.1


  parent reply	other threads:[~2024-08-29 15:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 14:57 [PATCH 00/19] vbe: Series part E Simon Glass
2024-08-29 14:57 ` [PATCH 01/19] image: Add a prototype for fit_image_get_phase() Simon Glass
2024-08-29 14:57 ` [PATCH 02/19] serial: ns16550: Allow clocks to be missing Simon Glass
2024-08-29 17:24   ` Tom Rini
2024-09-20  7:25     ` Simon Glass
2024-08-29 14:57 ` [PATCH 03/19] boot: Allow FIT to fall back from best-match option Simon Glass
2024-09-04 22:25   ` Tom Rini
2024-09-20 15:59     ` Simon Glass
2024-09-20 16:34       ` Tom Rini
2024-08-29 14:57 ` [PATCH 04/19] bootstd: Avoid sprintf() in SPL when creating bootdevs Simon Glass
2024-08-29 14:57 ` [PATCH 05/19] boot: Respect the load_op in fit_image_load() Simon Glass
2024-09-04 22:25   ` Tom Rini
2024-08-29 14:57 ` [PATCH 06/19] malloc: Show amount of used space when memory runs out Simon Glass
2024-08-29 17:26   ` Tom Rini
2024-09-20  7:25     ` Simon Glass
2024-09-20 14:59       ` Tom Rini
2024-09-20 16:04         ` Simon Glass
2024-09-20 16:35           ` Tom Rini
2024-09-21 11:37             ` Simon Glass
2024-08-29 14:57 ` [PATCH 07/19] malloc: Provide a simple malloc for VPL Simon Glass
2024-08-29 14:57 ` [PATCH 08/19] Support setting a maximum size for the VPL image Simon Glass
2024-08-29 14:57 ` [PATCH 09/19] spl: Report a loader failure Simon Glass
2024-08-29 14:57 ` [PATCH 10/19] spl: Allow serial to be disabled in any XPL phase Simon Glass
2024-08-29 14:57 ` [PATCH 11/19] spl: Support a relocated stack " Simon Glass
2024-08-29 14:57 ` Simon Glass [this message]
2024-08-29 14:57 ` [PATCH 13/19] spl: Drop a duplicate variable in boot_from_devices() Simon Glass
2024-08-29 14:57 ` [PATCH 14/19] spl: Add some more debugging to load_simple_fit() Simon Glass
2024-08-29 14:57 ` [PATCH 15/19] spl: lib: Allow for decompression in any SPL build Simon Glass
2024-08-29 14:57 ` [PATCH 16/19] boot: Allow use of FIT in TPL and VPL Simon Glass
2024-08-29 14:58 ` [PATCH 17/19] lib: Allow crc8 " Simon Glass
2024-08-29 17:30   ` Tom Rini
2024-08-29 14:58 ` [PATCH 18/19] boot: Imply CRC8 with VBE Simon Glass
2024-08-29 17:31   ` Tom Rini
2024-09-20  7:25     ` Simon Glass
2024-08-29 14:58 ` [PATCH 19/19] hash: Plumb crc8 into the hash functions Simon Glass
2024-08-30 12:17   ` Peter Robinson
2024-09-01 20:09     ` Simon Glass
2024-08-29 18:32 ` [PATCH 00/19] vbe: Series part E Tom Rini
2024-08-30  1:06   ` Simon Glass
2024-08-30 12:18 ` Caleb Connolly
2024-09-19 14:11   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240829145802.1827952-13-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=abbaraju.manojsai@amarulasolutions.com \
    --cc=chanho61.park@samsung.com \
    --cc=kever.yang@rock-chips.com \
    --cc=marex@denx.de \
    --cc=seanga2@gmail.com \
    --cc=sunil@amarulasolutions.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox