From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/3] ARM: Rockchip: bbu: rename rk3568_bbu_mmc_register to rockchip_*
Date: Mon, 15 Apr 2024 07:28:13 +0200 [thread overview]
Message-ID: <20240415052815.366527-1-a.fatoum@pengutronix.de> (raw)
The update handler isn't restricted to the RK3568, but is also usable
for other RKNS SoCs. With minor modification, it is also usable for the
RK3399 and perhaps even older SoCs, so let's rename it to
rockchip_bbu_mmc_handler instead. We can always do SoC-type checks
inside to handle differences.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/boards/radxa-cm3/board.c | 6 +++---
arch/arm/boards/radxa-rock3/board.c | 4 ++--
arch/arm/boards/radxa-rock5/board.c | 4 ++--
arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c | 5 ++---
arch/arm/boards/rockchip-rk3568-evb/board.c | 5 ++---
arch/arm/mach-rockchip/bbu.c | 10 +++++-----
include/mach/rockchip/bbu.h | 6 ++++--
7 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/arm/boards/radxa-cm3/board.c b/arch/arm/boards/radxa-cm3/board.c
index 14b678417910..19d37e31d9b0 100644
--- a/arch/arm/boards/radxa-cm3/board.c
+++ b/arch/arm/boards/radxa-cm3/board.c
@@ -26,9 +26,9 @@ static int cm3_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc0");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
+ "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/radxa-rock3/board.c b/arch/arm/boards/radxa-rock3/board.c
index 0d425e266755..df99eded2ca8 100644
--- a/arch/arm/boards/radxa-rock3/board.c
+++ b/arch/arm/boards/radxa-rock3/board.c
@@ -26,8 +26,8 @@ static int rock3_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/radxa-rock5/board.c b/arch/arm/boards/radxa-rock5/board.c
index 6ea6ffeaaf4e..eab0c0104000 100644
--- a/arch/arm/boards/radxa-rock5/board.c
+++ b/arch/arm/boards/radxa-rock5/board.c
@@ -23,8 +23,8 @@ static int rock5_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
index 94d1dac2c2d1..7178c02d8f09 100644
--- a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
+++ b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
@@ -28,9 +28,8 @@ static int rk3568_bpi_r2pro_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc1");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc0");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/rockchip-rk3568-evb/board.c b/arch/arm/boards/rockchip-rk3568-evb/board.c
index f404af217bb7..9659bd69c5b8 100644
--- a/arch/arm/boards/rockchip-rk3568-evb/board.c
+++ b/arch/arm/boards/rockchip-rk3568-evb/board.c
@@ -28,9 +28,8 @@ static int rk3568_evb_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc1");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc0");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/mach-rockchip/bbu.c b/arch/arm/mach-rockchip/bbu.c
index 3ab6c1e68502..0f50fd1282ed 100644
--- a/arch/arm/mach-rockchip/bbu.c
+++ b/arch/arm/mach-rockchip/bbu.c
@@ -36,8 +36,8 @@
* leaves the previously written inactive image as a fallback in case writing the
* first one gets interrupted.
*/
-static int rk3568_bbu_mmc_handler(struct bbu_handler *handler,
- struct bbu_data *data)
+static int rockchip_bbu_mmc_handler(struct bbu_handler *handler,
+ struct bbu_data *data)
{
enum filetype filetype;
int ret, fd, wr0, wr1;
@@ -113,8 +113,8 @@ static int rk3568_bbu_mmc_handler(struct bbu_handler *handler,
return ret;
}
-int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
- const char *devicefile)
+int rockchip_bbu_mmc_register(const char *name, unsigned long flags,
+ const char *devicefile)
{
struct bbu_handler *handler;
int ret;
@@ -124,7 +124,7 @@ int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
handler->flags = flags;
handler->devicefile = devicefile;
handler->name = name;
- handler->handler = rk3568_bbu_mmc_handler;
+ handler->handler = rockchip_bbu_mmc_handler;
ret = bbu_register_handler(handler);
if (ret)
diff --git a/include/mach/rockchip/bbu.h b/include/mach/rockchip/bbu.h
index 2cc9b74081e4..9ae137b0e6ab 100644
--- a/include/mach/rockchip/bbu.h
+++ b/include/mach/rockchip/bbu.h
@@ -6,14 +6,16 @@
#include <bbu.h>
#ifdef CONFIG_BAREBOX_UPDATE
-int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
+int rockchip_bbu_mmc_register(const char *name, unsigned long flags,
const char *devicefile);
#else
-static inline int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
+static inline int rockchip_bbu_mmc_register(const char *name, unsigned long flags,
const char *devicefile)
{
return -ENOSYS;
}
#endif
+#define rk3568_bbu_mmc_register rockchip_bbu_mmc_register
+
# endif /* __MACH_ROCKCHIP_BBU_H */
--
2.39.2
next reply other threads:[~2024-04-15 5:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 5:28 Ahmad Fatoum [this message]
2024-04-15 5:28 ` [PATCH 2/3] ARM: Rockchip: bbu: output unallocated space size on error Ahmad Fatoum
2024-04-15 5:28 ` [PATCH 3/3] ARM: Rockchip: bbu: allow forcing barebox update handler despite size Ahmad Fatoum
2024-04-16 11:05 ` [PATCH 1/3] ARM: Rockchip: bbu: rename rk3568_bbu_mmc_register to rockchip_* Sascha Hauer
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=20240415052815.366527-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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