You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/25 01:05:10 UTC
[GitHub] [incubator-nuttx] lupyuen opened a new pull request, #7692: arch/arm64: Add support for PINE64 PinePhone
lupyuen opened a new pull request, #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692
# 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 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
## Additions to arch/arm64
- `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
## Additions to boards/arm64/a64/pinephone
- `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
## Changes to Documentation
- `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
# Impact
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`:
```bash
./tools/configure.sh -l 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:
```bash
## Configure and build NuttX
./tools/configure.sh -l pinephone:nsh
make
## Compress the NuttX Image
cp nuttx.bin Image
rm -f Image.gz
gzip Image
## Copy to PinePhone Jumpdrive microSD Card
## https://lupyuen.github.io/articles/uboot#pinephone-jumpdrive
cp Image.gz "/Volumes/NO NAME"
```
When we insert the microSD Card into PinePhone and power it up, PinePhone boots successfully to nsh and runs console apps:
- [NuttX PinePhone Log](https://gist.github.com/lupyuen/e49a22a9e39b7c024b984bea40377712)
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.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zouboan commented on pull request #7692: arch/arm64: Add support for PINE64 PinePhone
Posted by GitBox <gi...@apache.org>.
zouboan commented on PR #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692#issuecomment-1326961921
after two month of long trip from Germany, my Pinephone arrived last week, your PR is just in timeļ¼
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7692: arch/arm64: Add support for PINE64 PinePhone
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zouboan commented on pull request #7692: arch/arm64: Add support for PINE64 PinePhone
Posted by GitBox <gi...@apache.org>.
zouboan commented on PR #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692#issuecomment-1327167259
@lupyuen Got it ! thanks for your explaining, now NuttX runs successfully on my Pinephone, you did a really magic works!
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] lupyuen commented on pull request #7692: arch/arm64: Add support for PINE64 PinePhone
Posted by GitBox <gi...@apache.org>.
lupyuen commented on PR #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692#issuecomment-1326963914
@zouboan Very cool thanks! Remember to get the [PinePhone Serial Debug Cable](https://wiki.pine64.org/index.php/PinePhone#Serial_console) too :-)
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] lupyuen commented on pull request #7692: arch/arm64: Add support for PINE64 PinePhone
Posted by GitBox <gi...@apache.org>.
lupyuen commented on PR #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692#issuecomment-1327103980
@zouboan Yep I also thought I had to change the [Image Load Offset](https://lupyuen.github.io/articles/uboot#nuttx-header) in the Linux Kernel Header `arch/arm64/src/common/arm64_head.S` to match the actual load address. Then I discovered that NuttX boots OK without changing the Image Load Offset. So it seems the Image Load Offset is not actually used by the U-Boot Bootloader?
Another thing I discovered: Previously the Vector Base Address Register for EL1 [was set incorrectly](https://lupyuen.github.io/articles/interrupt#arm64-vector-table-is-wrong). The new code doesn't have this problem. I wonder if it might be due to the Image Load Offset?
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] hartmannathan commented on a diff in pull request #7692: arch/arm64: Add support for PINE64 PinePhone
Posted by GitBox <gi...@apache.org>.
hartmannathan commented on code in PR #7692:
URL: https://github.com/apache/incubator-nuttx/pull/7692#discussion_r1031985497
##########
boards/arm64/a64/pinephone/src/pinephone_boardinit.c:
##########
@@ -0,0 +1,105 @@
+/****************************************************************************
+ * boards/arm64/a64/pinephone/src/pinephone_boardinit.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdint.h>
+#include <nuttx/board.h>
+#include "pinephone.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: a64_memory_initialize
+ *
+ * Description:
+ * All A64 architectures must provide the following entry point. This
+ * entry point is called early in the initialization before memory has
+ * been configured. This board-specific function is responsible for
+ * configuring any on-board memories.
+ *
+ * Logic in a64_memory_initialize must be careful to avoid using any
+ * global variables because those will be uninitialized at the time this
+ * function is called.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void a64_memory_initialize(void)
+{
+ /* SDRAM was initialized by a bootloader in the supported configurations. */
+}
+
+/****************************************************************************
+ * Name: a64_board_initialize
+ *
+ * Description:
+ * All A64 architectures must provide the following entry point. This
+ * entry point is called in the initialization phase -- after
+ * a64_memory_initialize and after all memory has been configured and
+ * mapped but before any devices have been initialized.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void a64_board_initialize(void)
+{
+#ifdef CONFIG_ARCH_LEDS
+ /* Configure on-board LEDs if LED support has been selected. */
+
+#endif
+}
+
+/****************************************************************************
+ * Name: board_late_initialize
+ *
+ * Description:
+ * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
+ * initialization call will be performed in the boot-up sequence to a
+ * function called board_late_initialize(). board_late_initialize() will be
+ * called immediately after up_intitialize() is called and just before the
Review Comment:
```suggestion
* called immediately after up_initialize() is called and just before the
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org