-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch/arm64: Add support for PINE64 PinePhone #7692
Conversation
This PR adds support for PINE64 PinePhone and the Allwinner A64 SoC (based on Arm Cortex-A53). With this PR, PinePhone boots successfully to nsh (via microSD Card) and runs console apps. - `arch/arm64/Kconfig`: Added Allwinner A64 SoC - `boards/Kconfig`: Added PINE64 PinePhone - `arch/arm64/src/a64/Kconfig`: New Kconfig for Allwinner A64 SoC - `boards/arm64/a64/pinephone/Kconfig`: New Kconfig for PINE64 PinePhone - `src/a64/a64_boot.c`, `a64_boot.h`: Boot functions for Allwinner A64 - `src/a64/a64_lowputc.S`: Low-level console output - `src/a64/a64_serial.c`, `a64_serial.h`: A64 Serial Driver - `src/a64/chip.h`: A64 SoC Definitions - `include/a64/chip.h`: A64 Memory Map, Generic Interrupt Controller - `include/a64/irq.h`: A64 Interrupts - `src/a64/Make.defs`: Source files for A64 - `configs/nsh/defconfig`: Board Configuration for `pinephone:nsh` - `src/pinephone_appinit.c`: Init PinePhone - `src/pinephone_boardinit.c`: Init PinePhone - `src/pinephone_bringup.c`: Start PinePhone Drivers - `src/pinephone.h`: PinePhone Declarations - `include/board_memorymap.h`: PinePhone Memory Map - `scripts/dramboot.ld`: PinePhone Linker Script - `scripts/Make.defs`: Source files for PinePhone - `src/Makefile`: PinePhone Makefile - `platforms/arm/a64/boards/pinephone/index.rst`: Building and booting NuttX on PinePhone - `platforms/arm/a64/index.rst`: Overview of Allwinner A64 - `introduction/supported_platforms.rst`: Added Allwinner A64 - `introduction/detailed_support.rst`: Added Allwinner A64
after two month of long trip from Germany, my Pinephone arrived last week, your PR is just in time! |
@zouboan Very cool thanks! Remember to get the PinePhone Serial Debug Cable too :-) |
Co-authored-by: hartmannathan <59230071+hartmannathan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Lup,thanks very much for your remind, i bought a PinePhone serial debug cable from TaoBao, now i'm testing it.
I have a little query, from your great porting tutorial, NuttX Header we should change PinePhone Image load offset from 0x48 0000 to 0x0 in arch/arm64/src/common/arm64_head.S
but now I don't find this modification in this PR, it mean that it can work without this change as well, or we should create a arm64_head.S specifically for A64?
@zouboan Yep I also thought I had to change the Image Load Offset in the Linux Kernel Header Another thing I discovered: Previously the Vector Base Address Register for EL1 was set incorrectly. The new code doesn't have this problem. I wonder if it might be due to the Image Load Offset? |
@lupyuen Got it ! thanks for your explaining, now NuttX runs successfully on my Pinephone, you did a really magic works! |
Summary
This PR adds support for PINE64 PinePhone and the Allwinner A64 SoC (based on Arm Cortex-A53).
With this PR, PinePhone boots successfully to nsh (via microSD Card) and runs console apps.
Changes to Kconfig
arch/arm64/Kconfig
: Added Allwinner A64 SoCboards/Kconfig
: Added PINE64 PinePhonearch/arm64/src/a64/Kconfig
: New Kconfig for Allwinner A64 SoCboards/arm64/a64/pinephone/Kconfig
: New Kconfig for PINE64 PinePhoneAdditions to arch/arm64
src/a64/a64_boot.c
,a64_boot.h
: Boot functions for Allwinner A64src/a64/a64_lowputc.S
: Low-level console outputsrc/a64/a64_serial.c
,a64_serial.h
: A64 Serial Driversrc/a64/chip.h
: A64 SoC Definitionsinclude/a64/chip.h
: A64 Memory Map, Generic Interrupt Controllerinclude/a64/irq.h
: A64 Interruptssrc/a64/Make.defs
: Source files for A64Additions to boards/arm64/a64/pinephone
configs/nsh/defconfig
: Board Configuration forpinephone:nsh
src/pinephone_appinit.c
: Init PinePhonesrc/pinephone_boardinit.c
: Init PinePhonesrc/pinephone_bringup.c
: Start PinePhone Driverssrc/pinephone.h
: PinePhone Declarationsinclude/board_memorymap.h
: PinePhone Memory Mapscripts/dramboot.ld
: PinePhone Linker Scriptscripts/Make.defs
: Source files for PinePhonesrc/Makefile
: PinePhone MakefileChanges to Documentation
platforms/arm/a64/boards/pinephone/index.rst
: Building and booting NuttX on PinePhoneplatforms/arm/a64/index.rst
: Overview of Allwinner A64introduction/supported_platforms.rst
: Added Allwinner A64introduction/detailed_support.rst
: Added Allwinner A64Impact
With this PR, PinePhone boots successfully to nsh (via microSD Card) and runs console apps.
We select PinePhone through the new Board Configuration
pinephone:nsh
:There is no impact on the existing implementation of QEMU for Armv8-A (
qemu-armv8a
).Testing
We tested by booting PinePhone with a microSD Card that contains NuttX:
When we insert the microSD Card into PinePhone and power it up, PinePhone boots successfully to nsh and runs console apps:
Two lines of messages appear garbled because two tasks were printing messages simultaneously: "nsh: sysinit: fopen failed: 2" and "nsh: mkfatfs: command not found"
This will be fixed in a later PR.