soc/mediatek/mt8196: Add dynamic power-saving for peripheral clocks
In MT8196, CKSYS achieves power efficiency by dynamically turning the clocks on or off based on the status provided by PERI. TEST=Build pass, boot log: mtk_cksys_init = 0x1 BUG=b:317009620 Change-Id: I70f710f068d7d882037691930a90c83adaab15d2 Signed-off-by: Jarried Lin <jarried.lin@mediatek.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/85774 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yidi Lin <yidilin@google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
67b140a949
commit
94c1307fdb
4 changed files with 26 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ all-y += ../common/uart.c
|
|||
bootblock-y += booker.c
|
||||
bootblock-y += bootblock.c
|
||||
bootblock-y += ../common/bootblock.c bootblock.c
|
||||
bootblock-y += cksys.c
|
||||
bootblock-y += ../common/early_init.c
|
||||
bootblock-y += ../common/lastbus_v2.c lastbus.c
|
||||
bootblock-y += mminfra.c
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <soc/booker.h>
|
||||
#include <bootblock_common.h>
|
||||
#include <soc/cksys.h>
|
||||
#include <soc/early_init.h>
|
||||
#include <soc/lastbus_v2.h>
|
||||
#include <soc/mminfra.h>
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
void bootblock_soc_init(void)
|
||||
{
|
||||
booker_init();
|
||||
mtk_cksys_init();
|
||||
mtk_mmu_init();
|
||||
bustracker_init();
|
||||
lastbus_init();
|
||||
|
|
|
|||
15
src/soc/mediatek/mt8196/cksys.c
Normal file
15
src/soc/mediatek/mt8196/cksys.c
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
|
||||
|
||||
#include <console/console.h>
|
||||
#include <device/mmio.h>
|
||||
#include <soc/addressmap.h>
|
||||
#include <soc/cksys.h>
|
||||
|
||||
#define CKSYS_OFFSET 0x270
|
||||
#define PERI_MASK_IDLE_TO_CKSYS (PERICFG_AO_SEC_BASE + CKSYS_OFFSET)
|
||||
|
||||
void mtk_cksys_init(void)
|
||||
{
|
||||
setbits32p(PERI_MASK_IDLE_TO_CKSYS, BIT(0));
|
||||
printk(BIOS_INFO, "%s = %#x\n", __func__, read32p(PERI_MASK_IDLE_TO_CKSYS));
|
||||
}
|
||||
8
src/soc/mediatek/mt8196/include/soc/cksys.h
Normal file
8
src/soc/mediatek/mt8196/include/soc/cksys.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
|
||||
|
||||
#ifndef __SOC_MEDIATEK_MT8196_CKSYS_H__
|
||||
#define __SOC_MEDIATEK_MT8196_CKSYS_H__
|
||||
|
||||
void mtk_cksys_init(void);
|
||||
|
||||
#endif /* __SOC_MEDIATEK_MT8196_CKSYS_H__ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue