hujun260 opened a new pull request, #21739:
URL: https://github.com/apache/nuttx/pull/21739

   # NuttX PR Description
   
   ## Title
   
   arch/arm64/goldfish: align chip.h definitions with QEMU chip.h
   
   ## Description
   
   This PR aligns the ARM64 Goldfish chip definitions with the QEMU ARM64 memory
   layout definitions required by the shared `dramboot_armv8a.ld` linker script.
   
   ## Problem
   
   The Goldfish ARM64 board uses:
   
   ```text
   CONFIG_ARCH_CHIP_GOLDFISH_ARM64
   ```
   
   while the shared linker script includes the QEMU architecture chip header:
   
   ```text
   <arch/qemu/chip.h>
   ```
   
   The QEMU header guards its memory definitions with the QEMU-specific chip
   configuration. As a result, the Goldfish build did not receive definitions 
for
   `CONFIG_LOAD_BASE` and `CONFIG_SHMEM_BASEADDR`, causing
   `goldfish-arm64-v8a-ap_test` to fail at link time.
   
   ## Changes
   
   Add the missing memory layout definitions to
   `arch/arm64/include/goldfish/chip.h`:
   
   - `CONFIG_SHMEM_BASEADDR`
   - `CONFIG_SHMEM_SIZE`
   - `CONFIG_QEMU_DRAM_BASE`
   - `CONFIG_SECURE_MEM_BASEADDR`
   - `CONFIG_SECURE_MEM_SIZE`
   - `CONFIG_RAMBANK1_ADDR`
   - `CONFIG_RAMBANK1_SIZE`
   - `CONFIG_LOAD_BASE`
   
   The `CONFIG_LOAD_BASE` selection now supports both secure and non-secure
   TrustZone boot configurations while preserving the Goldfish ARM64 memory
   layout.
   
   ## Motivation
   
   Ensure that Goldfish ARM64 uses the same memory-region definitions expected 
by
   the shared QEMU ARMv8-A linker scripts. This restores linkability for the
   Goldfish AP test configuration and keeps secure/non-secure memory layouts
   consistent.
   
   ## Runtime and Build Testing
   
   ### Goldfish ARM64 build
   
   The affected Goldfish ARM64 AP test configuration was built with the updated
   chip definitions. The previous link-time failure caused by missing
   `CONFIG_LOAD_BASE` and `CONFIG_SHMEM_BASEADDR` definitions is resolved.
   
   ```text
   Configuration/Tool: goldfish-arm64-v8a-ap_test
   Cleaning...
   Configuring...
   Building NuttX...
   Linking final_nuttx
   Build completed successfully
   ```
   
   ### Goldfish ARM64 QEMU startup
   
   ```text
   NOTICE:  Booting Trusted Firmware
   NOTICE:  BL1: Loading BL2
   NOTICE:  BL2: Doing platform setup
   NOTICE:  BL31: Initializing runtime services
   INFO:    Entry point address = 0x40280000
   NuttX  12.7.2 arm64 goldfish
   nsh>
   ```
   
   ### `ostest`
   
   ```text
   nsh> ostest
   ...
   user_main: smp call test
   cpu_call_test: Test start
   cpu_call_test: Call multi cpu, wait
   cpu_call_test: Test success
   
   user_main: Exiting
   ostest_main: Exiting with status 0
   nsh>
   ```
   
   ## Testing Status
   
   - [x] Goldfish ARM64 AP test configuration links successfully
   - [x] Goldfish ARM64 image boots under QEMU
   - [x] `ostest_main: Exiting with status 0`
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to