Yidi Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. set CPUEB to secure sideband
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 54 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/1
diff --git a/src/soc/mediatek/mt8192/Makefile.inc b/src/soc/mediatek/mt8192/Makefile.inc index 5609a06..4ce5e6a 100755 --- a/src/soc/mediatek/mt8192/Makefile.inc +++ b/src/soc/mediatek/mt8192/Makefile.inc @@ -47,6 +47,7 @@ ramstage-y += ../common/mmu_operations.c mmu_operations.c ramstage-y += ../common/mtcmos.c mtcmos.c ramstage-y += soc.c +ramstage-y += devapc.c ramstage-y += mcupm.c ramstage-y += ../common/timer.c ramstage-y += ../common/uart.c diff --git a/src/soc/mediatek/mt8192/devapc.c b/src/soc/mediatek/mt8192/devapc.c new file mode 100644 index 0000000..96a2a01 --- /dev/null +++ b/src/soc/mediatek/mt8192/devapc.c @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <soc/devapc.h> + +static unsigned long devapc_ao_base = (unsigned long)DEVAPC_INFRA_AO_BASE; + +static void master_sec_init(void) +{ + unsigned int val = 0; + + SET32_BITFIELDS(&val, CPU_EB_SEC, 1); + + write32((void*)MAS_SEC, val); + + if (read32((const void*)MAS_SEC) != val) + printk(BIOS_ERR, "[DEVAPC] %s: FAILED to set INFRA MAS_SEC\n", __func__); + else + printk(BIOS_INFO, "[DEVAPC] %s: INFRA MAS_SEC is set to 0x%x\n", __func__, val); +} + +void dapc_init(void) +{ + /* Init dapc */ + write32((void*)AO_APC_CON, 0x1); + + /* Init master sideband */ + master_sec_init(); +} diff --git a/src/soc/mediatek/mt8192/include/soc/addressmap.h b/src/soc/mediatek/mt8192/include/soc/addressmap.h index bd9b755..19728a3 100644 --- a/src/soc/mediatek/mt8192/include/soc/addressmap.h +++ b/src/soc/mediatek/mt8192/include/soc/addressmap.h @@ -60,6 +60,7 @@ IOCFG_TL_BASE = IO_PHYS + 0x01F30000, MSDC0_TOP_BASE = IO_PHYS + 0x01F50000, MSDC0_BASE = IO_PHYS + 0x01F60000, + DEVAPC_INFRA_AO_BASE = IO_PHYS + 0x00030000, };
#endif diff --git a/src/soc/mediatek/mt8192/include/soc/devapc.h b/src/soc/mediatek/mt8192/include/soc/devapc.h new file mode 100644 index 0000000..0cd67d3 --- /dev/null +++ b/src/soc/mediatek/mt8192/include/soc/devapc.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_MT8192_DEVAPC_H +#define SOC_MEDIATEK_MT8192_DEVAPC_H + +#include <device/mmio.h> +#include <soc/addressmap.h> + +void dapc_init(void); + +enum devapc_ao_offset { + OFF_AO_APC_CON = 0x0F00, + OFF_MAS_SEC_0 = 0x0A00, +}; + +#define AO_APC_CON (devapc_ao_base + (unsigned long)OFF_AO_APC_CON) +#define MAS_SEC (devapc_ao_base + (unsigned long)OFF_MAS_SEC_0) + +DEFINE_BIT(CPU_EB_SEC, 4) + +#endif /* SOC_MEDIATEK_MT8192_DEVAPC_H */ diff --git a/src/soc/mediatek/mt8192/soc.c b/src/soc/mediatek/mt8192/soc.c index 6deb833..ba153f2 100644 --- a/src/soc/mediatek/mt8192/soc.c +++ b/src/soc/mediatek/mt8192/soc.c @@ -4,6 +4,7 @@ #include <soc/emi.h> #include <soc/mmu_operations.h> #include <symbols.h> +#include <soc/devapc.h> #include <soc/mcupm.h>
static void soc_read_resources(struct device *dev) @@ -14,6 +15,7 @@ static void soc_init(struct device *dev) { mtk_mmu_disable_l2c_sram(); + dapc_init(); mcupm_init(); }
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 1:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/1/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/1/src/soc/mediatek/mt8192/dev... PS1, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/1/src/soc/mediatek/mt8192/dev... PS1, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/1/src/soc/mediatek/mt8192/dev... PS1, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/2/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/2/src/soc/mediatek/mt8192/dev... PS2, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/2/src/soc/mediatek/mt8192/dev... PS2, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/2/src/soc/mediatek/mt8192/dev... PS2, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/3/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/3/src/soc/mediatek/mt8192/dev... PS3, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/3/src/soc/mediatek/mt8192/dev... PS3, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/3/src/soc/mediatek/mt8192/dev... PS3, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 4:
(5 comments)
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 6: unsigned long uintptr_t
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 6: unsigned long uintptr_t
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 12: &val you're setting at address zero? Or do you want to get?
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 14: void*)MAS_SEC maybe put this as variable
void *mas_sec = (void *)MAS_SEC;
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 28: master_sec_init what about rename this to your comment - init_master_sideband() ?
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 4:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 5:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/5/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/5/src/soc/mediatek/mt8192/dev... PS5, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/5/src/soc/mediatek/mt8192/dev... PS5, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/5/src/soc/mediatek/mt8192/dev... PS5, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 6:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/6/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/6/src/soc/mediatek/mt8192/dev... PS6, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/6/src/soc/mediatek/mt8192/dev... PS6, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/6/src/soc/mediatek/mt8192/dev... PS6, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 7:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/7/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/7/src/soc/mediatek/mt8192/dev... PS7, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/7/src/soc/mediatek/mt8192/dev... PS7, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/7/src/soc/mediatek/mt8192/dev... PS7, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#8).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. set CPUEB to secure sideband
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 54 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/8
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 8:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/8/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/8/src/soc/mediatek/mt8192/dev... PS8, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/8/src/soc/mediatek/mt8192/dev... PS8, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/8/src/soc/mediatek/mt8192/dev... PS8, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 9:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/9/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/9/src/soc/mediatek/mt8192/dev... PS9, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/9/src/soc/mediatek/mt8192/dev... PS9, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/9/src/soc/mediatek/mt8192/dev... PS9, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 10:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/10/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/10/src/soc/mediatek/mt8192/de... PS10, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/10/src/soc/mediatek/mt8192/de... PS10, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/10/src/soc/mediatek/mt8192/de... PS10, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 12:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/12/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/12/src/soc/mediatek/mt8192/de... PS12, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/12/src/soc/mediatek/mt8192/de... PS12, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/12/src/soc/mediatek/mt8192/de... PS12, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 13:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/13/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/13/src/soc/mediatek/mt8192/de... PS13, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/13/src/soc/mediatek/mt8192/de... PS13, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/13/src/soc/mediatek/mt8192/de... PS13, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 14:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/14/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/14/src/soc/mediatek/mt8192/de... PS14, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/14/src/soc/mediatek/mt8192/de... PS14, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/14/src/soc/mediatek/mt8192/de... PS14, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 15:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/15/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/15/src/soc/mediatek/mt8192/de... PS15, Line 14: write32((void*)MAS_SEC, val); "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/15/src/soc/mediatek/mt8192/de... PS15, Line 16: if (read32((const void*)MAS_SEC) != val) "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/46402/15/src/soc/mediatek/mt8192/de... PS15, Line 25: write32((void*)AO_APC_CON, 0x1); "(foo*)" should be "(foo *)"
Nina-CM Wu has uploaded a new patch set (#16) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 115 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/16
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 17:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/17/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/17/src/soc/mediatek/mt8192/de... PS17, Line 26: { that open brace { should be on the previous line
https://review.coreboot.org/c/coreboot/+/46402/17/src/soc/mediatek/mt8192/de... PS17, Line 56: if (master_init[i]) master_init[i](); trailing statements should be on next line
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 18:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/18/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/18/src/soc/mediatek/mt8192/de... PS18, Line 26: { that open brace { should be on the previous line
https://review.coreboot.org/c/coreboot/+/46402/18/src/soc/mediatek/mt8192/de... PS18, Line 56: if (master_init[i]) master_init[i](); trailing statements should be on next line
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 19:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/19/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/19/src/soc/mediatek/mt8192/de... PS19, Line 26: { that open brace { should be on the previous line
https://review.coreboot.org/c/coreboot/+/46402/19/src/soc/mediatek/mt8192/de... PS19, Line 56: if (master_init[i]) master_init[i](); trailing statements should be on next line
Hello Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#20).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 115 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/20
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 20:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/20/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/20/src/soc/mediatek/mt8192/de... PS20, Line 26: { that open brace { should be on the previous line
https://review.coreboot.org/c/coreboot/+/46402/20/src/soc/mediatek/mt8192/de... PS20, Line 56: if (master_init[i]) master_init[i](); trailing statements should be on next line
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 21:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/21/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/21/src/soc/mediatek/mt8192/de... PS21, Line 26: { that open brace { should be on the previous line
https://review.coreboot.org/c/coreboot/+/46402/21/src/soc/mediatek/mt8192/de... PS21, Line 56: if (master_init[i]) master_init[i](); trailing statements should be on next line
Nina-CM Wu has uploaded a new patch set (#22) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/22
Hello Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#25).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/25
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 25:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46402/25//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/25//COMMIT_MSG@8 PS25, Line 8: please add some short description for what is a devapc, and why you have to init infra/peri (e.g., the relationship between devapc, dapc, and infra/peri).
Hello Xi Chen, Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#35).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/35
Hello Hung-Te Lin, Xi Chen, Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#36).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/36
Hello Hung-Te Lin, Xi Chen, Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#38).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/38
Hello Hung-Te Lin, Xi Chen, Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#39).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/39
Hello Hung-Te Lin, Xi Chen, Nina-CM Wu, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#41).
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic dapc drivers
Add basic dapc drivers: 1. init dapc 2. init infra master 3. init peri master
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/41
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 42:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/42//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/42//COMMIT_MSG@9 PS42, Line 9: Add basic dapc drivers: please explain what does 'dapc' mean
https://review.coreboot.org/c/coreboot/+/46402/42//COMMIT_MSG@11 PS42, Line 11: 2. init infra master : 3. init peri master short description for what are infra/peri and why they are related to dapc
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic dapc drivers ......................................................................
Patch Set 42:
(5 comments)
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 13: &val writing to 0x00?
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 16: write32 Are you trying to do
SET32_BITFIELDS((void *)MAS_SEC, SCP_SSPM_SEC, 1, CPU_EB_SEC, 1);
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 33: /* Sidband */ ?? empty?
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 48: 0 no need to add 0
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 54: NULL, : NULL, : NULL, : NULL, no need to have these NULL
Nina-CM Wu has uploaded a new patch set (#43) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc drivers
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M 3rdparty/blobs M 3rdparty/intel-microcode M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 7 files changed, 119 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/43
Nina-CM Wu has uploaded a new patch set (#44) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc drivers
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 117 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/44
Nina-CM Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 44:
(5 comments)
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 13: &val
writing to 0x00?
Done
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 16: write32
Are you trying to do […]
Done
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 33: /* Sidband */
?? empty?
Done
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 48: 0
no need to add 0
Done
https://review.coreboot.org/c/coreboot/+/46402/42/src/soc/mediatek/mt8192/de... PS42, Line 54: NULL, : NULL, : NULL, : NULL,
no need to have these NULL
Done
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 44:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46402/44/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/44/src/soc/mediatek/mt8192/de... PS44, Line 15: SET32_BITFIELDS((void *)MAS_DOM_1, SCP_SSPM_DOM, MAS_DOMAIN_2, CPU_EB_DOM, MAS_DOMAIN_2); line over 96 characters
Nina-CM Wu has uploaded a new patch set (#45) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M 3rdparty/blobs M 3rdparty/intel-microcode M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 7 files changed, 120 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/45
Nina-CM Wu has uploaded a new patch set (#46) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 118 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/46
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 46:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46402/42//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/42//COMMIT_MSG@9 PS42, Line 9: Add basic dapc drivers:
please explain what does 'dapc' mean
Ack
https://review.coreboot.org/c/coreboot/+/46402/42//COMMIT_MSG@11 PS42, Line 11: 2. init infra master : 3. init peri master
short description for what are infra/peri and why they are related to dapc
Ack
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 46:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... PS46, Line 6: static unsigned long devapc_ao_base; I think relying on this static variable is not a good idea. Let's change this to:
static uint32_t *getreg(uintptr_t base, unsigned offset) { return (uint32_t *)(base + offset); }
Then you can do the init as:
static void infra_master_init(uintptr_t base) { SET32_BITFLIELDS(getreg(base, MAS_SEC), ...); ... }
That's more clear to read and understand.
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... PS46, Line 43: devapc_ao_base this can be a local variable.
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/in... File src/soc/mediatek/mt8192/include/soc/devapc.h:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/in... PS46, Line 20: #define AO_APC_CON (devapc_ao_base + (unsigned long)OFF_AO_APC_CON) : #define MAS_SEC (devapc_ao_base + (unsigned long)OFF_MAS_SEC_0) : #define MAS_DOM_0 (devapc_ao_base + (unsigned long)OFF_MAS_DOM_0) : #define MAS_DOM_1 (devapc_ao_base + (unsigned long)OFF_MAS_DOM_1) I think this coding style (have define in header that uses some static variable inside c, and didn't use the variable explicitly in c) is confusing. Let's move them to C file.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 46:
(3 comments)
https://review.coreboot.org/c/coreboot/+/46402/46//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/46//COMMIT_MSG@9 PS46, Line 9: s nit: missing period
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/Ma... File src/soc/mediatek/mt8192/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/Ma... PS46, Line 44: ramstage-y += devapc.c Put it before dpm.c
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... PS46, Line 16: Remove extra indents
Nina-CM Wu has uploaded a new patch set (#47) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/47
Nina-CM Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 47:
(4 comments)
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/Ma... File src/soc/mediatek/mt8192/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/Ma... PS46, Line 44: ramstage-y += devapc.c
Put it before dpm. […]
Done
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... PS46, Line 6: static unsigned long devapc_ao_base;
I think relying on this static variable is not a good idea. […]
Done
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... PS46, Line 16:
Remove extra indents
Done
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/de... PS46, Line 43: devapc_ao_base
this can be a local variable.
Done
Nina-CM Wu has uploaded a new patch set (#48) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/48
Nina-CM Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 48:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46402/46//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/46//COMMIT_MSG@9 PS46, Line 9: s
nit: missing period
Done
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 48:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/in... File src/soc/mediatek/mt8192/include/soc/devapc.h:
https://review.coreboot.org/c/coreboot/+/46402/46/src/soc/mediatek/mt8192/in... PS46, Line 20: #define AO_APC_CON (devapc_ao_base + (unsigned long)OFF_AO_APC_CON) : #define MAS_SEC (devapc_ao_base + (unsigned long)OFF_MAS_SEC_0) : #define MAS_DOM_0 (devapc_ao_base + (unsigned long)OFF_MAS_DOM_0) : #define MAS_DOM_1 (devapc_ao_base + (unsigned long)OFF_MAS_DOM_1)
I think this coding style (have define in header that uses some static variable inside c, and didn't […]
Done
Nina-CM Wu has uploaded a new patch set (#49) to the change originally created by Yidi Lin. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to setup bus fabric security and data protection among hardwares. DAPC driver groups the master hardwares into different domains and gives secure and non-secure property. The slave hardware can configure different access permissions for different domains via DAPC driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/49
Hello Nina-CM Wu, Hung-Te Lin, Xi Chen, build bot (Jenkins), Patrick Georgi, Martin Roth, Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#50).
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to setup bus fabric security and data protection among hardwares. DAPC driver groups the master hardwares into different domains and gives secure and non-secure property.The slave hardware can configure different access permissions for different domains via DAPC driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/50
Hello Nina-CM Wu, Hung-Te Lin, Xi Chen, build bot (Jenkins), Patrick Georgi, Martin Roth, Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#51).
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to setup bus fabric security and data protection among hardwares. DAPC driver groups the master hardwares into different domains and gives secure and non-secure property.The slave hardware can configure different access permissions for different domains via DAPC driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/51
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 51:
(6 comments)
https://review.coreboot.org/c/coreboot/+/46402/25//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/25//COMMIT_MSG@8 PS25, Line 8:
please add some short description for what is a devapc, and why you have to init infra/peri (e.g. […]
Done
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 6: unsigned long
uintptr_t
Done
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 6: unsigned long
uintptr_t
Done
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 12: &val
you're setting at address zero? […]
Done
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 14: void*)MAS_SEC
maybe put this as variable […]
Done
https://review.coreboot.org/c/coreboot/+/46402/4/src/soc/mediatek/mt8192/dev... PS4, Line 28: master_sec_init
what about rename this to your comment - init_master_sideband() ?
Done
Hello Nina-CM Wu, Hung-Te Lin, Xi Chen, build bot (Jenkins), Patrick Georgi, Martin Roth, Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#52).
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to setup bus fabric security and data protection among hardwares. DAPC driver groups the master hardwares into different domains and gives secure and non-secure property.The slave hardware can configure different access permissions for different domains via DAPC driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 119 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/52
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 53:
Hung-Te & Yu-Ping,
Please review this patch.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 53:
(6 comments)
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG@11 PS53, Line 11: setup "set up"
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG@13 PS53, Line 13: DAPC Either move to the previous line or start with a new paragraph.
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG@14 PS53, Line 14: . A space after "."
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/de... PS53, Line 6: uint32_t Can we return void* here?
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/de... PS53, Line 46: devapc_base[i] What is this condition for? Can we use
i < ARRAY_SIZE(devapc_base)
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/in... File src/soc/mediatek/mt8192/include/soc/devapc.h:
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/in... PS53, Line 19: UNSIGNED_MAX Where is this used?
Hello Nina-CM Wu, Hung-Te Lin, Xi Chen, build bot (Jenkins), Patrick Georgi, Martin Roth, Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46402
to look at the new patch set (#54).
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to set up bus fabric security and data protection among hardwares. DAPC driver groups the master hardwares into different domains and gives secure and non-secure property. The slave hardware can configure different access permissions for different domains via DAPC driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 117 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/46402/54
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 54:
(6 comments)
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG@11 PS53, Line 11: setup
"set up"
Done
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG@13 PS53, Line 13: DAPC
Either move to the previous line or start with a new paragraph.
Done
https://review.coreboot.org/c/coreboot/+/46402/53//COMMIT_MSG@14 PS53, Line 14: .
A space after ". […]
Done
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/de... File src/soc/mediatek/mt8192/devapc.c:
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/de... PS53, Line 6: uint32_t
Can we return void* here?
Done
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/de... PS53, Line 46: devapc_base[i]
What is this condition for? Can we use […]
Done
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/in... File src/soc/mediatek/mt8192/include/soc/devapc.h:
https://review.coreboot.org/c/coreboot/+/46402/53/src/soc/mediatek/mt8192/in... PS53, Line 19: UNSIGNED_MAX
Where is this used?
Removed
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
Patch Set 54: Code-Review+2
Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46402 )
Change subject: soc/mediatek/mt8192: devapc: add basic devapc drivers ......................................................................
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to set up bus fabric security and data protection among hardwares. DAPC driver groups the master hardwares into different domains and gives secure and non-secure property. The slave hardware can configure different access permissions for different domains via DAPC driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013 Signed-off-by: Nina Wu nina-cm.wu@mediatek.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/46402 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/soc/mediatek/mt8192/Makefile.inc A src/soc/mediatek/mt8192/devapc.c M src/soc/mediatek/mt8192/include/soc/addressmap.h A src/soc/mediatek/mt8192/include/soc/devapc.h M src/soc/mediatek/mt8192/soc.c 5 files changed, 117 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/soc/mediatek/mt8192/Makefile.inc b/src/soc/mediatek/mt8192/Makefile.inc index a81e532..415acf3 100644 --- a/src/soc/mediatek/mt8192/Makefile.inc +++ b/src/soc/mediatek/mt8192/Makefile.inc @@ -40,6 +40,7 @@
ramstage-y += ../common/auxadc.c ramstage-y += ../common/ddp.c ddp.c +ramstage-y += devapc.c ramstage-y += dpm.c ramstage-y += ../common/dsi.c ../common/mtk_mipi_dphy.c ramstage-y += flash_controller.c diff --git a/src/soc/mediatek/mt8192/devapc.c b/src/soc/mediatek/mt8192/devapc.c new file mode 100644 index 0000000..77d5fc5 --- /dev/null +++ b/src/soc/mediatek/mt8192/devapc.c @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <soc/devapc.h> + +static void *getreg(uintptr_t base, unsigned int offset) +{ + return (void *)(base + offset); +} + +static void infra_master_init(uintptr_t base) +{ + /* Sidband */ + SET32_BITFIELDS(getreg(base, MAS_SEC_0), SCP_SSPM_SEC, 1, CPU_EB_SEC, 1); + + /* Domain */ + SET32_BITFIELDS(getreg(base, MAS_SEC_0), PCIE_DOM, MAS_DOMAIN_1); + SET32_BITFIELDS(getreg(base, MAS_DOM_1), SCP_SSPM_DOM, MAS_DOMAIN_2, + CPU_EB_DOM, MAS_DOMAIN_2); +} + +static void peri_master_init(uintptr_t base) +{ + /* Domain */ + SET32_BITFIELDS(getreg(base, MAS_DOM_0), SPM_DOM, MAS_DOMAIN_2); +} + +static uintptr_t devapc_base[DEVAPC_AO_MAX] = { + DEVAPC_INFRA_AO_BASE, + DEVAPC_PERI_AO_BASE, + DEVAPC_PERI2_AO_BASE, + DEVAPC_PERI_PAR_AO_BASE, + DEVAPC_FMEM_AO_BASE, +}; + +static void (*master_init[DEVAPC_AO_MAX])(uintptr_t) = { + infra_master_init, + peri_master_init, +}; + +void dapc_init(void) +{ + int i; + uintptr_t devapc_ao_base; + + for (i = 0; i < ARRAY_SIZE(devapc_base); i++) { + devapc_ao_base = devapc_base[i]; + + /* Init dapc */ + write32(getreg(devapc_ao_base, AO_APC_CON), 0x0); + write32(getreg(devapc_ao_base, AO_APC_CON), 0x1); + + /* Init master */ + if (master_init[i]) + master_init[i](devapc_ao_base); + } +} diff --git a/src/soc/mediatek/mt8192/include/soc/addressmap.h b/src/soc/mediatek/mt8192/include/soc/addressmap.h index 7660bcc..e4d57b0 100644 --- a/src/soc/mediatek/mt8192/include/soc/addressmap.h +++ b/src/soc/mediatek/mt8192/include/soc/addressmap.h @@ -28,6 +28,11 @@ PMIF_SPMI_BASE = IO_PHYS + 0x00027000, PMICSPI_MST_BASE = IO_PHYS + 0x00028000, SPMI_MST_BASE = IO_PHYS + 0x00029000, + DEVAPC_INFRA_AO_BASE = IO_PHYS + 0x00030000, + DEVAPC_PERI_AO_BASE = IO_PHYS + 0x00034000, + DEVAPC_PERI2_AO_BASE = IO_PHYS + 0x00038000, + DEVAPC_PERI_PAR_AO_BASE = IO_PHYS + 0x0003C000, + DEVAPC_FMEM_AO_BASE = IO_PHYS + 0x00044000, I2C_DMA_BASE = IO_PHYS + 0x00217080, EMI_BASE = IO_PHYS + 0x00219000, EMI_MPU_BASE = IO_PHYS + 0x00226000, diff --git a/src/soc/mediatek/mt8192/include/soc/devapc.h b/src/soc/mediatek/mt8192/include/soc/devapc.h new file mode 100644 index 0000000..f227aaa --- /dev/null +++ b/src/soc/mediatek/mt8192/include/soc/devapc.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_MT8192_DEVAPC_H +#define SOC_MEDIATEK_MT8192_DEVAPC_H + +#include <device/mmio.h> +#include <soc/addressmap.h> + +void dapc_init(void); + +#define DEVAPC_AO_MAX 6 + +enum devapc_ao_offset { + MAS_DOM_0 = 0x0900, + MAS_DOM_1 = 0x0904, + MAS_SEC_0 = 0x0A00, + AO_APC_CON = 0x0F00, +}; + +/* INFRA */ +DEFINE_BIT(SCP_SSPM_SEC, 3) +DEFINE_BIT(CPU_EB_SEC, 4) + +DEFINE_BITFIELD(PCIE_DOM, 19, 16) /* 2 */ +DEFINE_BITFIELD(SCP_SSPM_DOM, 3, 0) /* 4 */ +DEFINE_BITFIELD(CPU_EB_DOM, 11, 8) /* 5 */ + +/* PERI */ +DEFINE_BITFIELD(SPM_DOM, 3, 0) /* 0 */ + +enum master_domain { + MAS_DOMAIN_0 = 0, + MAS_DOMAIN_1, + MAS_DOMAIN_2, + MAS_DOMAIN_3, + MAS_DOMAIN_4, + MAS_DOMAIN_5, + MAS_DOMAIN_6, + MAS_DOMAIN_7, + MAS_DOMAIN_8, + MAS_DOMAIN_9, + MAS_DOMAIN_10, + MAS_DOMAIN_11, + MAS_DOMAIN_12, + MAS_DOMAIN_13, + MAS_DOMAIN_14, + MAS_DOMAIN_15, + MAS_DOMAIN_MAX, +}; + + +#endif /* SOC_MEDIATEK_MT8192_DEVAPC_H */ diff --git a/src/soc/mediatek/mt8192/soc.c b/src/soc/mediatek/mt8192/soc.c index 8696f34..883f4dc 100644 --- a/src/soc/mediatek/mt8192/soc.c +++ b/src/soc/mediatek/mt8192/soc.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h> +#include <soc/devapc.h> #include <soc/emi.h> #include <soc/mcupm.h> #include <soc/mmu_operations.h> @@ -16,6 +17,7 @@ static void soc_init(struct device *dev) { mtk_mmu_disable_l2c_sram(); + dapc_init(); mcupm_init(); sspm_init(); ufs_disable_refclk();