Skip to contentSkip to conversation

rockchip: include cru_rk3588.h and define rockchip_cru for RK3588

PATCH In review FUKAUMI Naoki 2 participants 5 messages Jun 18, 2024 – Jul 16, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: include cru_rk3588.h and define rockchip_cru for RK3588

fix following error found by clang:

CC arch/arm/mach-rockchip/cpu-info.o
arch/arm/mach-rockchip/cpu-info.c:23:13: error: incomplete definition of type 'struct rockchip_cru'
23 | switch (cru->glb_rst_st) {
| ~~~^
./arch/arm/include/asm/arch-rockchip/clock.h:181:8: note: forward declaration of 'struct rockchip_cru'
181 | struct rockchip_cru;
| ^
1 error generated.

---
 arch/arm/include/asm/arch-rockchip/cru.h        | 2 ++
 arch/arm/include/asm/arch-rockchip/cru_rk3588.h | 2 ++
 2 files changed, 4 insertions(+)
arch/arm/include/asm/arch-rockchip/cru.h +2 -0
index 9778790f34..c3259b8e7c 100644
@@ -17,6 +17,8 @@
 # include <asm/arch-rockchip/cru_rk3399.h>
 #elif defined(CONFIG_ROCKCHIP_RK3568)
 #include <asm/arch-rockchip/cru_rk3568.h>
+#elif defined(CONFIG_ROCKCHIP_RK3588)
+#include <asm/arch-rockchip/cru_rk3588.h>
 #endif
 
 /* CRU_GLB_RST_ST */
arch/arm/include/asm/arch-rockchip/cru_rk3588.h +2 -0
index a0e54d3965..dad484813f 100644
@@ -92,6 +92,8 @@ struct rk3588_cru {
 	unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */
 };
 
+#define rockchip_cru rk3588_cru
+
 check_member(rk3588_cru, mode_con00, 0x280);
 check_member(rk3588_cru, pmuclksel_con[1], 0x30304);
 
Signature · 1 line
2.43.0
#1 lore raw

Hello,

this happens only if HOSTCC=clang. I can see several other errors on several other targets with HOSTCC=clang.

CC=clang seems to be fine.

Best regards,

--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.

Quoted 43 lines · FUKAUMI Naoki

fix following error found by clang:

CC arch/arm/mach-rockchip/cpu-info.o
arch/arm/mach-rockchip/cpu-info.c:23:13: error: incomplete definition of type 'struct rockchip_cru'

    23 |         switch (cru->glb_rst_st) {
       |                 ~~~^

./arch/arm/include/asm/arch-rockchip/clock.h:181:8: note: forward declaration of 'struct rockchip_cru'
181 | struct rockchip_cru;
| ^
1 error generated.

---
  arch/arm/include/asm/arch-rockchip/cru.h        | 2 ++
  arch/arm/include/asm/arch-rockchip/cru_rk3588.h | 2 ++
  2 files changed, 4 insertions(+)
arch/arm/include/asm/arch-rockchip/cru.h +2 -0
index 9778790f34..c3259b8e7c 100644
@@ -17,6 +17,8 @@
  # include <asm/arch-rockchip/cru_rk3399.h>
  #elif defined(CONFIG_ROCKCHIP_RK3568)
  #include <asm/arch-rockchip/cru_rk3568.h>
+#elif defined(CONFIG_ROCKCHIP_RK3588)
+#include <asm/arch-rockchip/cru_rk3588.h>
  #endif
 
  /* CRU_GLB_RST_ST */
arch/arm/include/asm/arch-rockchip/cru_rk3588.h +2 -0
index a0e54d3965..dad484813f 100644
@@ -92,6 +92,8 @@ struct rk3588_cru {
  	unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */
  };
 
+#define rockchip_cru rk3588_cru
+
  check_member(rk3588_cru, mode_con00, 0x280);
  check_member(rk3588_cru, pmuclksel_con[1], 0x30304);
 
#2 lore raw

sorry,

Quoted 3 lines · FUKAUMI Naoki

Hello,

this happens only if HOSTCC=clang. I can see several other errors on several other targets with HOSTCC=clang.

^this happens only if clang is used at make foo-bar_defconfig stage.

it seems

make foo-bar_defconfig
make HOSTCC=clang CC=clang all

works.

Quoted 49 lines

CC=clang seems to be fine.

Best regards,

Signature · 2 lines
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.
Quoted 40 lines · FUKAUMI Naoki

fix following error found by clang:

   CC      arch/arm/mach-rockchip/cpu-info.o
arch/arm/mach-rockchip/cpu-info.c:23:13: error: incomplete definition of type 'struct rockchip_cru' 23 |         switch (cru->glb_rst_st) {
       |                 ~~~^
./arch/arm/include/asm/arch-rockchip/clock.h:181:8: note: forward declaration of 'struct rockchip_cru' 181 | struct rockchip_cru;
       |        ^
1 error generated.

---
  arch/arm/include/asm/arch-rockchip/cru.h        | 2 ++ arch/arm/include/asm/arch-rockchip/cru_rk3588.h | 2 ++

  2 files changed, 4 insertions(+)
arch/arm/include/asm/arch-rockchip/cru.h +2 -0
index 9778790f34..c3259b8e7c 100644
@@ -17,6 +17,8 @@
   # include <asm/arch-rockchip/cru_rk3399.h>
   #elif defined(CONFIG_ROCKCHIP_RK3568)
   #include <asm/arch-rockchip/cru_rk3568.h>
+#elif defined(CONFIG_ROCKCHIP_RK3588)
+#include <asm/arch-rockchip/cru_rk3588.h>
   #endif
   /* CRU_GLB_RST_ST */
arch/arm/include/asm/arch-rockchip/cru_rk3588.h +0 -0
index a0e54d3965..dad484813f 100644
@@ -92,6 +92,8 @@ struct rk3588_cru {

      unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */ };

arch/arm/include/asm/arch-rockchip/cru_rk3588.h +2 -0
+#define rockchip_cru rk3588_cru
+

  check_member(rk3588_cru, mode_con00, 0x280); check_member(rk3588_cru, pmuclksel_con[1], 0x30304);

Reviewed-by on v1 1/1
#3 lore raw
In reply to FUKAUMI Naoki
Quoted 4 lines · FUKAUMI Naoki

fix following error found by clang:

CC arch/arm/mach-rockchip/cpu-info.o
arch/arm/mach-rockchip/cpu-info.c:23:13: error: incomplete definition of type 'struct rockchip_cru'

Quoted 8 lines
    23 |         switch (cru->glb_rst_st) {
       |                 ~~~^

./arch/arm/include/asm/arch-rockchip/clock.h:181:8: note: forward declaration of 'struct rockchip_cru'
181 | struct rockchip_cru;
| ^
1 error generated.

Thanks,
- Kever

Quoted 31 lines
---
  arch/arm/include/asm/arch-rockchip/cru.h        | 2 ++
  arch/arm/include/asm/arch-rockchip/cru_rk3588.h | 2 ++
  2 files changed, 4 insertions(+)
arch/arm/include/asm/arch-rockchip/cru.h +2 -0
index 9778790f34..c3259b8e7c 100644
@@ -17,6 +17,8 @@
  # include <asm/arch-rockchip/cru_rk3399.h>
  #elif defined(CONFIG_ROCKCHIP_RK3568)
  #include <asm/arch-rockchip/cru_rk3568.h>
+#elif defined(CONFIG_ROCKCHIP_RK3588)
+#include <asm/arch-rockchip/cru_rk3588.h>
  #endif
 
  /* CRU_GLB_RST_ST */
arch/arm/include/asm/arch-rockchip/cru_rk3588.h +2 -0
index a0e54d3965..dad484813f 100644
@@ -92,6 +92,8 @@ struct rk3588_cru {
  	unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */
  };
 
+#define rockchip_cru rk3588_cru
+
  check_member(rk3588_cru, mode_con00, 0x280);
  check_member(rk3588_cru, pmuclksel_con[1], 0x30304);
 
#4 lore raw

hi

Quoted 8 lines · FUKAUMI Naoki

sorry,

Quoted 4 lines · FUKAUMI Naoki

Hello,

this happens only if HOSTCC=clang. I can see several other errors on several other targets with HOSTCC=clang.

Quoted 16 lines

^this happens only if clang is used at make foo-bar_defconfig stage.

it seems

make foo-bar_defconfig
make HOSTCC=clang CC=clang all

works.

Quoted 7 lines

CC=clang seems to be fine.

Best regards,

--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.

should I check/make patches for other RK3xxx targets? or should I avoid to use clang for defconfig?

Best regards,

--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.

Quoted 47 lines · Kever Yang
Quoted 11 lines · FUKAUMI Naoki

fix following error found by clang:

   CC      arch/arm/mach-rockchip/cpu-info.o
arch/arm/mach-rockchip/cpu-info.c:23:13: error: incomplete definition of type 'struct rockchip_cru' 23 |         switch (cru->glb_rst_st) {
       |                 ~~~^
./arch/arm/include/asm/arch-rockchip/clock.h:181:8: note: forward declaration of 'struct rockchip_cru' 181 | struct rockchip_cru;
       |        ^
1 error generated.

Quoted 1 line

Thanks,
- Kever

Quoted 28 lines

---
  arch/arm/include/asm/arch-rockchip/cru.h        | 2 ++ arch/arm/include/asm/arch-rockchip/cru_rk3588.h | 2 ++

  2 files changed, 4 insertions(+)
arch/arm/include/asm/arch-rockchip/cru.h +2 -0
index 9778790f34..c3259b8e7c 100644
@@ -17,6 +17,8 @@
   # include <asm/arch-rockchip/cru_rk3399.h>
   #elif defined(CONFIG_ROCKCHIP_RK3568)
   #include <asm/arch-rockchip/cru_rk3568.h>
+#elif defined(CONFIG_ROCKCHIP_RK3588)
+#include <asm/arch-rockchip/cru_rk3588.h>
   #endif
   /* CRU_GLB_RST_ST */
arch/arm/include/asm/arch-rockchip/cru_rk3588.h +0 -0
index a0e54d3965..dad484813f 100644
@@ -92,6 +92,8 @@ struct rk3588_cru {

      unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */ };

arch/arm/include/asm/arch-rockchip/cru_rk3588.h +2 -0
+#define rockchip_cru rk3588_cru
+

  check_member(rk3588_cru, mode_con00, 0x280); check_member(rk3588_cru, pmuclksel_con[1], 0x30304);