]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3588: add constants for some register address spaces
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Mon, 11 Mar 2024 12:01:55 +0000 (13:01 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 13 Mar 2024 10:14:19 +0000 (18:14 +0800)
It's one thing to have the register mapped via a well-defined struct but
it's another to be able to make use of it. For that to happen, one needs
to cast the physical address memory of the beginning of the register
address space with the struct. Since this cannot change, let's hardcode
it in the include files so that users do not need to duplicate this line
of code in their own implementation.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
arch/arm/include/asm/arch-rockchip/cru_rk3588.h
arch/arm/include/asm/arch-rockchip/ioc_rk3588.h
arch/arm/mach-rockchip/rk3588/rk3588.c

index 7f4a90853929cee5e690b610e3216f64b70fa6b9..a4507e5fdd77b04ccba250b7b0c35416bc3ac664 100644 (file)
@@ -63,6 +63,8 @@ struct rk3588_pll {
        unsigned int reserved0[3];
 };
 
+#define CRU_BASE       0xfd7c0000
+
 struct rk3588_cru {
        struct rk3588_pll pll[18];
        unsigned int reserved0[16];/* Address Offset: 0x0240 */
index 5a656f850c795afdc1cbaa80fd1c9163b0b316ff..7ad98466c39a40eb703a594b5656eb0cffc5b31c 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef _ASM_ARCH_IOC_RK3588_H
 #define _ASM_ARCH_IOC_RK3588_H
 
+#define BUS_IOC_BASE   0xfd5f8000
+
 struct rk3588_bus_ioc {
        unsigned int reserved0000[3];      /* Address Offset: 0x0000 */
        unsigned int gpio0b_iomux_sel_h;   /* Address Offset: 0x000C */
@@ -48,6 +50,8 @@ struct rk3588_bus_ioc {
 
 check_member(rk3588_bus_ioc, gpio4d_iomux_sel_h, 0x009C);
 
+#define PMU1_IOC_BASE  0xfd5f0000
+
 struct rk3588_pmu1_ioc {
        unsigned int gpio0a_iomux_sel_l;   /* Address Offset: 0x0000 */
        unsigned int gpio0a_iomux_sel_h;   /* Address Offset: 0x0004 */
@@ -70,6 +74,8 @@ struct rk3588_pmu1_ioc {
 
 check_member(rk3588_pmu1_ioc, xin_con, 0x0040);
 
+#define PMU2_IOC_BASE  0xfd5f4000
+
 struct rk3588_pmu2_ioc {
        unsigned int gpio0b_iomux_sel_h;  /* Address Offset: 0x0000 */
        unsigned int gpio0c_iomux_sel_l;  /* Address Offset: 0x0004 */
index d18c4e4b4119f90d4a270e63728e7b03cda3e1a5..7a190e6aa18a694fcfe11e3007094df5a69a6171 100644 (file)
 #define FW_SYSM_MST26_REG              0xa8
 #define FW_SYSM_MST27_REG              0xac
 
-#define PMU1_IOC_BASE                  0xfd5f0000
-#define PMU2_IOC_BASE                  0xfd5f4000
-
-#define BUS_IOC_BASE                   0xfd5f8000
 #define BUS_IOC_GPIO2A_IOMUX_SEL_L     0x40
 #define BUS_IOC_GPIO2B_IOMUX_SEL_L     0x48
 #define BUS_IOC_GPIO2D_IOMUX_SEL_L     0x58