soc/mediatek/mt8186: add GIC pre-initialization function

GIC (generic interrupt controller) defines architectural requirements
for handling all interrupt sources and common interrupt controller
programming interface.
GIC needs to be pre-initialized on MT8186, so we add this initialize
function.

TEST=build pass
BUG=b:202871018

Change-Id: I6bf439d0d9e1ca7130a69b9006b957afca8b133c
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59252
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Rex-BC Chen 2021-10-15 21:02:25 +08:00 committed by Hung-Te Lin
parent 2f9e5b9e34
commit b9f95db1dc
4 changed files with 36 additions and 0 deletions

View File

@ -3,6 +3,7 @@ ifeq ($(CONFIG_SOC_MEDIATEK_MT8186),y)
bootblock-y += bootblock.c
bootblock-y += ../common/eint_event.c
bootblock-y += ../common/flash_controller.c
bootblock-y += gic.c
bootblock-y += ../common/gpio.c gpio.c
bootblock-y += ../common/mmu_operations.c
bootblock-y += ../common/pll.c pll.c

View File

@ -2,6 +2,7 @@
#include <bootblock_common.h>
#include <soc/eint_event.h>
#include <soc/gic.h>
#include <soc/mmu_operations.h>
#include <soc/pll.h>
#include <soc/wdt.h>
@ -12,4 +13,5 @@ void bootblock_soc_init(void)
mtk_wdt_init();
mt_pll_init();
unmask_eint_event_mask();
mtk_gic_preinit();
}

View File

@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* This file is created based on MT8186 Functional Specification
* Chapter number: 4.3
*/
#include <device/mmio.h>
#include <soc/addressmap.h>
#include <soc/gic.h>
void mtk_gic_preinit(void)
{
int i;
for (i = 3; i < 15; i++) {
write32((void *)((uintptr_t)MCUSYS_BASE + 0xA600 + i * 4), 0);
write32((void *)((uintptr_t)MCUSYS_BASE + 0xA650 + i * 4), 0xFFFFFFFF);
}
}

View File

@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* This file is created based on MT8186 Functional Specification
* Chapter number: 4.3
*/
#ifndef SOC_MEDIATEK_MT8186_GIC_H
#define SOC_MEDIATEK_MT8186_GIC_H
void mtk_gic_preinit(void);
#endif