os/board/bk7239n: Optimize the internal code of bk7239n#7280
os/board/bk7239n: Optimize the internal code of bk7239n#7280Poly-J wants to merge 2 commits intoSamsung:masterfrom
Conversation
Poly-J
commented
Apr 16, 2026
- The form of the security interface has changed, and the corresponding test code also needs to be modified accordingly.
- Logic optimization related to security dump
- Optimize the logic related to the system entering sleep
e7bc91f to
9da17b6
Compare
ewoodev
left a comment
There was a problem hiding this comment.
I think, this is only important agenda of this commit.
- The form of the security interface has changed, and
the corresponding test code also needs to be modified accordingly.
It's optimization
- Logic optimization related to security dump
it's another agenda
- Optimize the logic related to the system entering sleep
Could you please seperate commit?
|
|
||
| void bk_security_to_nosecurity_dump_register_callback(void) | ||
| { | ||
| if (get_security_level() > LOW_SECURITY_LEVEL) { |
There was a problem hiding this comment.
Yes, it should not be added here, because after adding this logic, since security_level defaults to HIGH, it will cause this callback not to be injected.
There was a problem hiding this comment.
ah okay, this fuction is just register callback.
Okay, I will split it into three commits |
9da17b6 to
25c4876
Compare
| void bk_security_donmain_notifies_non_security_domain_to_dump(uint32_t *reg) | ||
| { | ||
| // High security level will not dump the exception information. | ||
| if (get_security_level() > LOW_SECURITY_LEVEL) { |
There was a problem hiding this comment.
if (get_security_level() != LOW_SECURITY_LEVEL)
The value can be changed, please use !=
There was a problem hiding this comment.
Thank you for your feedback, I have already modified itit.
|
|
||
| void bk_security_to_nosecurity_dump_register_callback(void) | ||
| { | ||
| if (get_security_level() > LOW_SECURITY_LEVEL) { |
There was a problem hiding this comment.
ah okay, this fuction is just register callback.
25c4876 to
45037fd
Compare
| { | ||
| if(bk_rtc_get_first_alarm_name() != NULL) | ||
| { | ||
| if(strcmp(bk_rtc_get_first_alarm_name(), PM_WIFI_RTC_ALARM_NAME) == 0) |
There was a problem hiding this comment.
Could you please use strncmp?
There was a problem hiding this comment.
Dear customer
Okay, we will make the modification. Thank you
| #define PM_VANALDO_STEP_SIZE (2) | ||
| #define PM_VANALDO_STEP_UP_DELAY_US (10) | ||
| __attribute__((section(".iram"))) int32 sys_hal_vanaldo_set(uint32_t value) | ||
| { | ||
| uint32_t cur = 0; | ||
| cur = sys_ana_ll_get_ana_reg7_vanaldosel(); | ||
| if (cur == value) { | ||
| return 0; | ||
| } | ||
|
|
||
| if (value < cur) { | ||
| /* Target is lower or equal: set directly */ | ||
| sys_ana_ll_set_ana_reg7_vanaldosel(value); | ||
| } else { | ||
| /* Target is higher: step up by PM_VANALDO_STEP_SIZE, delay PM_VANALDO_STEP_UP_DELAY_US each step */ | ||
| uint32_t v; | ||
| for (v = cur + PM_VANALDO_STEP_SIZE; v < value; v += PM_VANALDO_STEP_SIZE) { | ||
| sys_ana_ll_set_ana_reg7_vanaldosel(v); | ||
| pm_delay_us(PM_VANALDO_STEP_UP_DELAY_US); | ||
| } | ||
| sys_ana_ll_set_ana_reg7_vanaldosel(value); | ||
|
|
||
| pm_delay_us(PM_VANALDO_STEP_UP_DELAY_US); | ||
| } | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
Could you please explain this changes in commit description?
There was a problem hiding this comment.
Dear customer
This adjustment is an optimization of the recovery sequence after low-power wake-up: first adjust the voltage, then configure other items. Compared to the previous approach of writing all at once, it is more robust. This modification does not affect functionality.
| /*step 1: restore ana voltage*/ | ||
| sys_hal_vanaldo_set(vanaldosel); | ||
|
|
||
| sys_ana_ll_set_ana_reg7_spi_pwd_regpow(pwd_regpow); | ||
| sys_ana_ll_set_ana_reg7_vbspbuf_lp(vbspbuf_lp); | ||
| sys_ana_ll_set_ana_reg7_envrefh1v(envrefh1v); | ||
| sys_ana_ll_set_ana_reg7_aldohp(aldohp); | ||
| sys_ana_ll_set_ana_reg7_dldohp(dldohp); |
There was a problem hiding this comment.
Dear customer
The same as the above
45037fd to
b497f9c
Compare
…rface The form of the security interface has changed, and the corresponding test code also needs to be modified accordingly
58302ac to
0ad7c04
Compare
…leep Optimized the logic of some wake-up source prompts after the system enters sleep