Repository navigation
Conversation
hujun260
requested review from
GUIDINGLI,
Ouss4,
acassis,
adamfeuer,
anchao,
btashton,
gustavonihei,
hartmannathan,
jerpelea,
masayuki2009,
raiden00pl,
simbit18,
xiaoxiang781216 and
yf13
as code owners
December 3, 2026 07:48
|
hujun260
force-pushed
the
apache_20261202_1
branch
from
December 4, 2026 02:29
1f3b8c7 to
5785ef7
Compare
GUIDINGLI
previously approved these changes
Dec 4, 2026
hujun260
force-pushed
the
apache_20261202_1
branch
from
December 4, 2026 03:42
5785ef7 to
941998e
Compare
hujun260
force-pushed
the
apache_20261202_1
branch
from
December 4, 2026 07:51
941998e to
63bed40
Compare
Contributor
Author
|
open |
Rename CONFIG_ARMV7A_HAVE_GTM to CONFIG_ARM_HAVE_GTM and move its Kconfig definition from arch/arm/src/armv7-a/Kconfig to the top-level arch/arm/Kconfig, making the Global Timer (GTM) option available to all ARM A/R profile architectures. Update all chip-level Kconfig selections and gtm.h references to use the renamed config symbol accordingly. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The Snoop Control Unit (SCU) driver was duplicated across armv7-a, armv7-r, and armv8-r directories with nearly identical implementations. Consolidate them into the common arm_a_r directory to eliminate code duplication. Update CMakeLists.txt and Make.defs for all affected architectures to build arm_scu.c from its new shared location. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The SCU (Snoop Control Unit) header was duplicated across armv7-a, armv7-r, and armv8-r directories. Consolidate them into the common arm_a_r directory using the most complete version from armv7-r, adding missing SNSAC register and port0 control bit definitions. Remove the redundant copies from armv7-a and armv8-r directories. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The SMP inter-processor call handler (arm_smpcall.c) was duplicated across armv7-a, armv7-r, and armv8-r directories with identical implementations. Consolidate them into the common arm_a_r directory and remove the redundant copies. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The SMP CPU startup code (arm_cpustart.c) was duplicated across armv7-a, armv7-r, and armv8-r directories. Move it into the common arm_a_r directory and update CONFIG_SMP_NCPUS/this_cpu() to the preferred CONFIG_NCPUS/up_cpu_index() APIs. Remove the redundant copies from armv7-r and armv8-r, and update CMakeLists.txt and Make.defs for all affected architectures. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The cpuinfo procfs implementation was duplicated across armv7-a, armv7-r, and armv8-r directories. Consolidate them into the common arm_a_r directory, using CONFIG_ARCH_ARMV8R to select the correct architecture version string for the model name output. Remove the redundant copies from armv7-r and armv8-r, and update CMakeLists.txt and Make.defs for all affected architectures. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The CP15 cache operations implementation (cp15_cacheops.c) was duplicated across armv7-a, armv7-r, and armv8-r directories with identical content. Consolidate them into the common arm_a_r directory to eliminate code duplication. Remove the redundant copies from armv7-r and armv8-r, and update CMakeLists.txt and Make.defs for all affected architectures. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Remove the dup and align the CFI declare. Signed-off-by: buxiasen <buxiasen@xiaomi.com> Signed-off-by: hujun5 <hujun5@xiaomi.com>
The save user context assembly (arm_saveusercontext.S) was duplicated across arm, armv7-a, armv7-r, and armv8-r directories. Consolidate them into the common arm_a_r directory to eliminate redundancy, since all ARM A/R profiles share the same context save/restore logic. Remove the standalone copies from arm, armv7-r, and armv8-r, and update CMakeLists.txt and Make.defs for all affected architectures. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Consolidate the exception vector table (arm_vectortab.S) from arm, armv7-a, armv7-r, and armv8-r directories into the common arm_a_r directory. Unify the vector start symbol name to _vector_start across all architectures and conditionally include the hyp_vectors section only when CONFIG_ARCH_ARMV8R is defined. Update linker scripts, arm_head.S, and arm_cpuhead.S references to use the renamed _vector_start symbol accordingly. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The FPU configuration and comparison files (arm_fpuconfig.S and arm_fpucmp.c) were duplicated across armv7-a, armv7-r, and armv8-r directories with identical implementations. Consolidate them into the common arm_a_r directory to eliminate code duplication. Remove the redundant copies from armv7-r and armv8-r, and update CMakeLists.txt and Make.defs for all affected architectures. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The L2 cache controller headers (l2cc.h and l2cc_pl310.h) were duplicated across armv7-a, armv7-r, and armv8-r directories with identical content. Consolidate them into the common arm_a_r directory to eliminate code duplication. Remove the redundant copies from armv7-a, armv7-r, and armv8-r directories and update include guards to reflect the new location. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Move arm_l2cc_pl310.c from armv7-a into the shared arm_a_r directory and relocate L2CC-related Kconfig options from armv7-a/armv7-r/armv8-r Kconfig files to the top-level arch/arm/Kconfig. Rename config symbols from ARMV7A_* prefix to ARM_* to reflect their architecture-neutral scope. Update all chip Kconfig selections, defconfigs, and board references to use the renamed ARM_HAVE_L2CC_PL310 and ARM_L2CC_PL310 symbols. ARMv8-R only needs a Make-side removal: its CMake list had no local PL310 entry. Both build systems now select PL310 in arm_a_r. [skip-cmake-parity] Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace the architecture-specific ARMV7R_HAVE_DECODEFIQ and ARMV8R_HAVE_DECODEFIQ Kconfig options with the common ARCH_HAVE_HIPRI_INTERRUPT symbol. This removes duplicated FIQ handler configuration from armv7-r and armv8-r Kconfig files and updates all references in tms570, qemu-cortexr52, and fvp-armv8r platform code to use the unified symbol, making high-priority interrupt support consistent across ARM-R profile chips. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The armv7-a, armv7-r and armv8-r architectures each had their own copy of cp15_cacheops.h with nearly identical content. The armv7-a and armv7-r copies contained a bug where cache maintenance assembly macros incorrectly used MRC (read) instead of MCR (write) for CP15 operations such as ICIALLUIS, DCIMVAC, DCCMVAC, etc. Unify these into a single file under arch/arm/src/arm_a_r/ based on the correct armv8-r version which properly uses MCR, and remove the redundant per-architecture copies. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Remove the redundant ARMV7R_MEMINIT and ARMV8R_MEMINIT Kconfig symbols which were just architecture-specific aliases for BOOT_SDRAM_DATA. Use BOOT_SDRAM_DATA directly in arm_head.S, tms570_boot.c and the TMS570 Kconfig selection. Also add the missing BOOT_SDRAM_DATA guard around arm_data_initialize() in armv8-r arm_head.S, which previously called it unconditionally even when RAM was not yet ready. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace the per-architecture ARMV7A_ALIGNMENT_TRAP, ARMV7R_ALIGNMENT_TRAP and ARMV8R_ALIGNMENT_TRAP Kconfig options with a single ARM_ALIGNMENT_TRAP symbol defined in the top-level arch/arm/Kconfig. Update all arm_head.S and arm_cpuhead.S files across armv7-a, armv7-r and armv8-r to reference the unified config, eliminating duplicated Kconfig definitions that had identical semantics. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace the per-architecture ARM_CACHE_ROUND_ROBIN, ARMV7A_CACHE_ROUND_ROBIN, ARMV7R_CACHE_ROUND_ROBIN and ARMV8R_CACHE_ROUND_ROBIN Kconfig options with a single ARM_CACHE_ROUND_ROBIN symbol in the top-level arch/arm/Kconfig. Update all arm_head.S and arm_cpuhead.S references across arm, armv7-a, armv7-r and armv8-r to use the unified config, removing duplicated definitions that had identical semantics. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace the per-architecture ARM_DCACHE_DISABLE, ARMV7A_DCACHE_DISABLE, ARMV7R_DCACHE_DISABLE and ARMV8R_DCACHE_DISABLE Kconfig options with a single ARM_DCACHE_DISABLE symbol in the top-level arch/arm/Kconfig. Update all arm_head.S, arm_cpuhead.S and imx6 Kconfig references across arm, armv7-a, armv7-r and armv8-r to use the unified config, removing duplicated definitions with identical semantics. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace the per-architecture ARM_ICACHE_DISABLE, ARMV7A_ICACHE_DISABLE, ARMV7R_ICACHE_DISABLE and ARMV8R_ICACHE_DISABLE Kconfig options with a single ARM_ICACHE_DISABLE symbol in the top-level arch/arm/Kconfig. Update all arm_head.S and arm_cpuhead.S references across arm, armv7-a, armv7-r and armv8-r to use the unified config, removing duplicated definitions with identical semantics. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Move duplicated SCTLR-related Kconfig options from armv7-r/Kconfig and armv8-r/Kconfig into the common arch/arm/Kconfig. Rename the config symbols from ARMV7R_/ARMV8R_ prefix to a shared ARM_ prefix, including CCP15BEN, BACKGROUND_REGION, DIV0_FAULT, FAST_INTERRUPT, IMPL_VECTORS and NONMASKABLE_FIQ, and update all references in arm_head.S and arm_cpuhead.S for both architectures accordingly. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Refactor exception_entry/exception_exit macros to maximize code sharing
between ARMv7+ and ARMv5/v6 paths. The shared code (stmdb/ldmia for
register save/restore, FPU save/restore, stack frame layout) is written
once, with minimal #if __ARM_ARCH guards only around instructions that
differ:
- srsdb/cpsid vs msr cpsr_c (mode switch and LR+SPSR save)
- cps vs msr cpsr_c + manual spsr restore (exception exit)
- rfeia vs ldmia {r15}^ (exception return)
Also fix nested preprocessor indentation style per review feedback.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Enable normal optimization while retaining debug symbols for the NSH configurations on the i.MX95 EVK and MR-NAVQ95B. Signed-off-by: hujun5 <hujun5@xiaomi.com>
The kernel data and BSS use 6168 bytes of the 6 KiB kernel SRAM region before accounting for the 1 KiB IDLE stack. Allocate libc temporary buffers on demand and preallocate two messages each for thread and IRQ context. With GNU EABI the kernel now uses 4744 bytes, leaving 376 bytes between the top of the IDLE stack and user SRAM. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Beforefix, cpu-n tls init by cpu0 nx_start tls_init_info, but when nx_smp_start, tls will overwrite by CONFIG_STACK_COLORATION. We should call stack_color in .C to avoid this. Signed-off-by: buxiasen <buxiasen@xiaomi.com> Signed-off-by: hujun5 <hujun5@xiaomi.com>
Keep the buckboost image within the 64 KiB flash limit while retaining the interactive shell and the smps command. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Keep the Clang-built image within the 128 KiB flash limit while retaining the interactive shell and FAT filesystem commands. Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260
dismissed stale reviews from GUIDINGLI and xiaoxiang781216
via
December 6, 2026 02:40
d1564c0
hujun260
force-pushed
the
apache_20261202_1
branch
from
December 6, 2026 02:40
7582df7 to
d1564c0
Compare
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.
arch/arm: consolidate A/R interrupt, cache and SMP support and preserve classic ARM vectors
Summary
ARMv7-A, ARMv7-R and ARMv8-R maintained separate copies of interrupt, cache and CPU support code. Move the common implementations to
arch/arm/src/arm_a_rso fixes can be made once. Share the exception vectors with classic ARM without assuming that an ARM926EJ-S can execute the newer exception entry and return instructions.BOOT_SDRAM_DATAin place of the ARMv7-R/ARMv8-RMEMINIToptions. Unify the profile-specific alignment trap, cache policy, I-cache/D-cache disable and SCTLR options used during startup.Impact
The shared assembly preserves two exception-frame layouts. Classic ARM uses banked exception registers and keeps its normal vector table in
.textin the architecture library. Newer A/R profiles retain their SRS/RFE path and directly linked vector table. The internalARCH_ARM_CLASSICselector is derived from the CPU selection; boards do not need to set it explicitly. Both Make and CMake select the shared sources.Out-of-tree configurations that explicitly set the old profile-specific symbols should migrate to the corresponding common options. Examples include
CONFIG_ARM_GICV2_LEGACY_IRQ,CONFIG_ARM_L2CC_PL310,CONFIG_ARM_ALIGNMENT_TRAP,CONFIG_ARM_ICACHE_DISABLEandCONFIG_ARM_DCACHE_DISABLE.The series also explicitly enables
CONFIG_DEBUG_FULLOPTinquickfeather:nsh. That board configuration change is separate from the A/R consolidation.Testing
Targeted Linux Make builds used
tools/configure.sh -l <board>:<config>followed bymake -j20 EXTRAFLAGS='-Wno-cpp -Werror'. The linked ELF and vector-table object were inspected witharm-none-eabi-nmandarm-none-eabi-objdump -h.ntosd-dm320:nettest(ARM926EJ-S).text, with no.hyp_vectorssection.qemu-armv7a:smp(Cortex-A7).vectors; the object retained its separate.hyp_vectorssection.These checks cover the classic and ARMv7-A build paths, not every configuration in the series. The full 13-shard ARM CI run was stopped before completion. No full-matrix pass, ARMv7-R/ARMv8-R runtime result, or on-hardware validation is claimed.
Related to #21984