soc: rockchip: pm_config: replace memset with memset_io

Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: Ia75fbfba4efd9d10eb2d15f5ae646135d858e0a0
This commit is contained in:
XiaoDong Huang
2024-09-10 10:49:07 +08:00
committed by Tao Huang
parent 629aef9788
commit 247f5deabf

View File

@@ -351,8 +351,12 @@ static int parse_mcu_sleep_config(struct device_node *node)
goto free_mcu_mode;
}
/* Initialize core tag */
memset((void *)res.a1, 0, sizeof(struct rk_mcu_sleep_tags));
/* Initialize core tag.
* Compiler may optimize the following code into: "str xzr, ..." or "stp xzr, xzr, ..."
* if using memset, that can't guarantee the target address to be 8-byte alignment.
* So we use memset_io instead.
*/
memset_io((void *)res.a1, 0, sizeof(struct rk_mcu_sleep_tags));
config = (struct rk_mcu_sleep_tags *)res.a1;
config->core.hdr.tag = RK_ATAG_MCU_SLP_CORE;
config->core.hdr.size = sizeof(struct rk_mcu_sleep_core_tag) / sizeof(u32);