Linux kernel failed to resume.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Linux kernel failed to resume.

跳至解决方案
364 次查看
Jeff-CF-Huang
Contributor III

Hi Sir,

Printing a log message to UART inresume_bl31 causes the Linux kernel to fail to resume.

static void resume_bl31(struct s32g_ssram_mailbox *ssram_mb)
{
  ...
  if (ddrss_to_normal_mode(csr_addr)) {
    ERROR("Failed to transition DDR to normal mode\n");
    panic();
  }
  NOTICE("Print some debug messages here!\n");
  isb();
  dsb();
  disable_mmu_el3();
  resume_entrypoint();
}



Best regards,
Jeff Huang

0 项奖励
回复
1 解答
259 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your reply.

I have checked the code and found you had put the print message after "ddrss_to_normal_mode", since DDR mod changed via executing the function, the buffer of the Notice macro may possibly impacted by the changes, thus caused the issue.

I suggest not putting your debug messages there and try putting it before the DDR state changes, which should work for print debug messages.

 

BR

Chenyin

在原帖中查看解决方案

0 项奖励
回复
7 回复数
343 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your post.
1. May I know which version BSP is used? Is it based on S32G2/3? on a custom board or RDB?

2. The issue could be reproduced from STR operation?

 

BR

Chenyin

0 项奖励
回复
308 次查看
Jeff-CF-Huang
Contributor III
1. BSP 40, custom board
2.Yes

The system resumes normally when the NOTICE("Print some debug messages here!\n"); line is removed.
0 项奖励
回复
303 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your reply.

I had checked the code you mentioned, seems at the stage you pointed, the console had not been registered from default BSP's perspective, which may be the reason for the issue you met, may I know if you had done any modification regarding to code of the console part?

 

BR

Chenyin

0 项奖励
回复
299 次查看
Jeff-CF-Huang
Contributor III

Hi Chenyin,

The other log message can appear if it is located far from the wakeup_resume_point of the Linux kernel.

void bl2_el3_early_platform_setup(u_register_t arg0, u_register_t arg1,
				  u_register_t arg2, u_register_t arg3)
{
  enum reset_cause reset_cause;
  struct s32g_ssram_mailbox *ssram_mb = (void *)BL31SSRAM_MAILBOX;
  ...
  s32_early_plat_init();
  console_s32_register();

  NOTICE("Reset status: %s\n", get_reset_cause_str(reset_cause));

  if (reset_cause == CAUSE_WAKEUP_DURING_STANDBY) {
    /* Trampoline to bl31_warm_entrypoint */
    resume_bl31(ssram_mb);
    panic();
  }
  ...

 

0 项奖励
回复
292 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for the reply.

I have mentioned that the console had been initialized in your code samples, then I will investigate it directly on my board.

May I know you tested it on a S32G2 or S32G3 board?

 

B R

Chenyin

0 项奖励
回复
289 次查看
Jeff-CF-Huang
Contributor III

S32G3 board

0 项奖励
回复
260 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your reply.

I have checked the code and found you had put the print message after "ddrss_to_normal_mode", since DDR mod changed via executing the function, the buffer of the Notice macro may possibly impacted by the changes, thus caused the issue.

I suggest not putting your debug messages there and try putting it before the DDR state changes, which should work for print debug messages.

 

BR

Chenyin

0 项奖励
回复