rk3568 build failed
Dear sirs,
when I try to build u-boot for Rockchip's RK3568 evaluation board I have the following error:
CC arch/arm/mach-rockchip/rk3568/clk_rk3568.o
arch/arm/mach-rockchip/cpu-info.c: In function 'get_reset_cause':
arch/arm/mach-rockchip/cpu-info.c:24:13: error: invalid use of undefined type 'struct rockchip_cru'
24 | switch (cru->glb_rst_st) {
make[1]: *** [scripts/Makefile.build:256: arch/arm/mach-rockchip/cpu-info.o] Error 1
make[1]: *** Waiting for unfinished jobs....
While investigating the problem I've found that:
- in included file asm/arch-rockchip/cru.h there's no any links to file asm/arch-rockchip/cru_rk3568.h where the similar struct is defined. I've made a modification into asm/arch-rockchip/cru.h as:
--- a/arch/arm/include/asm/arch-rockchip/cru.h
+++ b/arch/arm/include/asm/arch-rockchip/cru.h
@@ -15,6 +15,8 @@
#include <asm/arch-rockchip/cru_rk3288.h>
#elif defined(CONFIG_ROCKCHIP_RK3399)
#include <asm/arch-rockchip/cru_rk3399.h>
+#elif defined(CONFIG_ROCKCHIP_RK3568)
+#include <asm/arch-rockchip/cru_rk3568.h>
#endif
/* CRU_GLB_RST_ST */
and then 2) there's no any mention of rockchip_cru struct there, in cru-rk3568.h I've modified it as:
--- a/arch/arm/include/asm/arch-rockchip/cru_rk3568.h
+++ b/arch/arm/include/asm/arch-rockchip/cru_rk3568.h
@@ -106,6 +106,8 @@ struct rk3568_cru {
unsigned int emmc_con[2];/* Address Offset: 0x0598 */
};
+#define rockchip_cru rk3568_cru
check_member(rk3568_cru, mode_con00, 0xc0);
check_member(rk3568_cru, softrst_con[0], 0x400);
Am I doing something wrong and there's a better way how to get rid of an error?
Thank you!