arch/tricore: mpu iLLD drop and per-set flags refactor - #20016
Open
zhangyu-duck wants to merge 2 commits into
Open
arch/tricore: mpu iLLD drop and per-set flags refactor#20016zhangyu-duck wants to merge 2 commits into
zhangyu-duck wants to merge 2 commits into
Conversation
Refactor kflags/uflags into a per-set flags[] array indexed by set number, and add a cpuset field to filter regions per CPU. Rewrite mpu_initialize to loop over all protection sets. Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
zhangyu-duck
requested review from
anchao,
jerpelea and
wangchdo
as code owners
August 31, 2026 03:38
Replace iLD union types and __mfcr/__mtcr intrinsics with uint32_t and tricore_mfcr/tricore_mtcr. Replace the iLD-specific to HW full capacity (8 sets / 24 data / 16 code regions). Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
xiaoxiang781216
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two commits on the TriCore MPU subsystem:
mpu: per-set flags array and cpuset in mpu_region_s — refactor
kflags/uflagsinto a per-setflags[]array indexed by set number, add acpusetfield to filter regions per CPU, and rewritempu_initializeto loop over all protection sets.drop mpu iLLD dependency and use raw register access — replace iLD union types and
__mfcr/__mtcrintrinsics withuint32_tandtricore_mfcr/tricore_mtcr(fromarch/tricore/include/arch.h); replace#ifndef CONFIG_ARCH_CHIP_TC3XXguards with per-case#if CONFIG_ARCH_MPU_NSETS > N/CONFIG_ARCH_MPU_DATA_NREGIONS > N/CONFIG_ARCH_MPU_CODE_NREGIONS > Nguards; bump Kconfig defaults to HW full capacity (8 sets / 24 data regions / 16 code regions).Impact
arch/tricore(TC3xx / TC4xx)struct mpu_region_slayout changes (callers must update initializers — none in tree currently)Testing
build_all.sh/make)mpu_initializelogic reviewed:cpusetfilter, per-set loop viampu_modify_region(set, region, 0, 0, flags[set])(relies onsize==0skipping base/size update), andelse continueguard against staleregionvalue when type bits are invalidmpu_control(CORECON.PROTEN = bit 1),mpu_get_active_set/mpu_set_active_set(PSW.PRS2 = bit 15, PSW.PRS = bits 12-13)Signed-off-by: zhangyu117 zhangyu117@xiaomi.com