Skip to content

Conversation

@annerajb
Copy link
Contributor

@annerajb annerajb commented Aug 11, 2023

Summary

Added the basics for nsh shell to work

Got GPIO and leds in a different branch but those will be added separately

Impact

With this PR, PinePhone Pro boots successfully to nsh (via microSD Card) and runs console apps.

We select PinePhone Pro through the new Board Configuration pinephonepro:nsh:

./tools/configure.sh -l pinephonepro:nsh
There is no impact on the existing implementation of QEMU for Armv8-A (qemu-armv8a) or any other.

Testing

We tested by booting PinePhone Pro with a microSD Card that contains NuttX after booting with towboot as SPL
Afterwards it loads from the sdcard the Image.gz

Log of the shell booting and accepting shell input usleep:

In:    serial
Out:   serial
Err:   serial
Model: Pine64 PinePhonePro
Net:   No ethernet found.
starting USB...
Bus usb@fe380000: ehci_generic usb@fe380000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3a0000: USB OHCI 1.0
Bus usb@fe3c0000: ehci_generic usb@fe3c0000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3e0000: USB OHCI 1.0
scanning bus usb@fe3a0000 for devices... 1 USB Device(s) found
scanning bus usb@fe3e0000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Please press [ESCAPE] or [CTRL+C] to enter the boot menu.
off
off
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
788 bytes read in 9 ms (85 KiB/s)
## Executing script at 00500000
Bad data crc
SCRIPT FAILED: continuing...
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
U-Boot menu
1:Mobian GNU/Linux 6.1-rockchip
Enter choice: 1:Mobian GNU/Linux 6.1-rockchip
Retrieving file: /Image.gz
Retrieving file: /rk3399-pinephone-pro.dtb
   Uncompressing Kernel Image
## Flattened Device Tree blob at 01f00000
   Booting using the fdt blob at 0x1f00000
   Loading Device Tree to 00000000f4ed2000, end 00000000f4ee62fb ... OK

Starting kernel ...

- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
nsh: mkfatfs: command not found

NuttShell (NSH) NuttX-12.2.1
nsh> 52;164Rhelphelp
help usage:  help [-v] [<cmd>]

    .           cd          env         kill        pwd         true        
    [           cp          exec        ls          rm          truncate    
    ?           cmp         exit        mkdir       rmdir       uname       
    alias       dirname     false       mkrd        set         umount      
    unalias     dd          fdinfo      mount       sleep       unset       
    basename    df          free        mv          source      uptime      
    break       dmesg       help        printf      test        usleep      
    cat         echo        hexdump     ps          time        xd          

Builtin Apps:
    sh          getprime    ostest      nsh         hello       leds        
nsh> esleeusleep 1000
nsh> Ausleep 1000Dusleep 1000Dusleep 1000Dusleep 1000BBusleep 3000
nsh> Ausleep 30000
nsh> 6~Ausleep 300000
nsh> 

@annerajb annerajb marked this pull request as draft August 11, 2023 13:13
@acassis
Copy link
Contributor

acassis commented Aug 11, 2023

Very nice @annerajb !!!

Please fix the check style issues reported by the CI.

You can run this command to confirm everything is fine before push the commit:

$ ./tools/checkpatch.sh -f arch/arm64/src/common/arm64_mmu.c

And since you will create a new commit, only to fix the issue, you need to squash them:

https://nuttx.apache.org/docs/latest/contributing/making-changes.html#how-to-include-the-suggestions-on-your-pull-request

@lupyuen
Copy link
Member

lupyuen commented Aug 12, 2023

Hi @annerajb: Thank you so much for porting NuttX to PinePhone Pro! As Alan mentioned, we need to tidy up the code, here are some tips...

I wrote a guide on submitting a NuttX PR, it might be helpful:

To support PinePhone Pro we'll need to add a new NuttX Arch (SoC) and NuttX Board:

  • NuttX Arch: arch/arm64/src/rk3399

  • NuttX Board: boards/arm64/rk3399/pinephonepro

The steps are explained here:

But that's for RISC-V. For Arm64 we can follow this PR (but probably better to split into one PR for Arch and another PR for Board):

We might be able to reuse the NuttX 16550 UART Driver:

Remember to enable 16550_WAIT_LCR. And set 16550_REGINCR to 4. (I think)

@annerajb annerajb marked this pull request as ready for review August 21, 2023 14:29
@annerajb
Copy link
Contributor Author

Removing draft so I can get the CI to start running the check.
Open to any feedback on whatever I pushed :D
will write up a longer description with logs and what not tonight

@annerajb annerajb changed the title Draft: Pinephone Pro Port Pinephone Pro port just nsh Aug 21, 2023
@xiaoxiang781216
Copy link
Contributor

Removing draft so I can get the CI to start running the check. Open to any feedback on whatever I pushed :D will write up a longer description with logs and what not tonight

please squash your change into one patch.

@annerajb
Copy link
Contributor Author

Removing draft so I can get the CI to start running the check. Open to any feedback on whatever I pushed :D will write up a longer description with logs and what not tonight

please squash your change into one patch.

Done lmk what CI reports I also took care (or tried) as many style checks as I saw

Copy link
Member

@lupyuen lupyuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@lupyuen
Copy link
Member

lupyuen commented Aug 21, 2023

@annerajb Maybe you could Rebase with Master, to force the rebuild: https://lupyuen.github.io/articles/pr#submit-the-pull-request

Normally when the build fails, I take a peek at other recent PRs. If they didn't fail the build, then it's probably OK to Rebase with Master to force the Rebuild. Thanks!

@annerajb
Copy link
Contributor Author

@annerajb Maybe you could Rebase with Master, to force the rebuild: https://lupyuen.github.io/articles/pr#submit-the-pull-request

Normally when the build fails, I take a peek at other recent PRs. If they didn't fail the build, then it's probably OK to Rebase with Master to force the Rebuild. Thanks!

It says it's waiting on approval from a mantainer to start running the workflows / pipelines

@lupyuen
Copy link
Member

lupyuen commented Aug 22, 2023

@annerajb Something seems incorrect in our PinePhone Pro Build Config, tools/configure.sh pinephonepro/nsh is failing. Lemme check why...

→ git clone https://github.com/annerajb/nuttx
→ git clone https://github.com/apache/nuttx-apps apps
→ cd nuttx
→ tools/configure.sh pinephonepro/nsh
  Copy files
  Select CONFIG_HOST_MACOS=y
  Refreshing...
CP: arch/dummy/Kconfig to /private/tmp/nuttx/nuttx/arch/dummy/dummy_kconfig
CP: boards/dummy/Kconfig to /private/tmp/nuttx/nuttx/boards/dummy/dummy_kconfig
LN: platform/board to /private/tmp/nuttx/apps/platform/dummy
LN: include/arch to arch/arm64/include
LN: include/arch/board to /private/tmp/nuttx/nuttx/boards/arm64/rk3399/pinephonepro/include
No directory at /private/tmp/nuttx/nuttx/boards/arm64/rk3399/pinephonepro/include
make[1]: *** [tools/Unix.mk:285: include/arch/board] Error 1
make: *** [tools/Unix.mk:679: olddefconfig] Error 2
ERROR: failed to refresh

@lupyuen
Copy link
Member

lupyuen commented Aug 22, 2023

@annerajb Found the problem, the boards/arm64/rk3399/pinephonepro/include directory is missing. Could you follow the same convention as PinePhone and create the missing files board.h and board_memorymap.h?

Then try doing a fresh new build from scratch, hope that it works. Thanks!

https://github.com/apache/nuttx/tree/master/boards/arm64/a64/pinephone/include

→ ls boards/arm64/a64/pinephone/include
board.h           board_memorymap.h

Update: I see a ccache error, do you have the same problem when rebuilding from scratch?

→ make
Create version.h
LN: platform/board to /private/tmp/nuttx/apps/platform/dummy
Register: hello
Register: leds
Register: nsh
Register: sh
Register: getprime
Register: ostest
CC:  clock/clock.c /bin/bash: ccache: command not found
make[1]: *** [Makefile:60: clock.o] Error 127
make: *** [tools/LibTargets.mk:65: sched/libsched.a] Error 2

Update 2: Sorry could we update the PR Summary, Impact and Testing? I believe we have a screenshot of NuttX booting on PinePhone Pro, that would be perfect for the Testing section. Thanks!

Here's how we did it for PinePhone: #7692

Copy link
Member

@lupyuen lupyuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks tools/configure.sh pinephonepro/nsh works OK now. I'm not sure what's this ccache error, maybe it's my old macOS?

→ make
Create version.h
LN: platform/board to /private/tmp/nuttx/apps/platform/dummy
Register: hello
Register: leds
Register: nsh
Register: sh
Register: getprime
Register: ostest
CC:  clock/clock.c /bin/bash: ccache: command not found
make[1]: *** [Makefile:60: clock.o] Error 127
make: *** [tools/LibTargets.mk:65: sched/libsched.a] Error 2

@annerajb
Copy link
Contributor Author

No it's my default config I enabled ccache to make it build faster and left it enabled on the default nsh config.
I am working on removing it from the default config.

@hartmannathan
Copy link
Contributor

It says it's waiting on approval from a mantainer to start running the workflows / pipelines

I approved the workflows to run.

@annerajb annerajb force-pushed the master branch 2 times, most recently from 87d5233 to a72fdce Compare August 22, 2023 14:22
@annerajb
Copy link
Contributor Author

@lupyuen
fixed the default config removed, reset + ccache requirement and added includes

@hartmannathan
can you re approve pipeline since after the new squashed push is waiting again for mantainer approval.

@acassis
Copy link
Contributor

acassis commented Aug 22, 2023

@lupyuen fixed the default config removed, reset + ccache requirement and added includes

@hartmannathan can you re approve pipeline since after the new squashed push is waiting again for mantainer approval.

I just approved it. Once again: nice work @annerajb

@annerajb
Copy link
Contributor Author

Hmm riscv failed and caused canncelation of all other targets <_<

2023-08-22T14:54:39.9558447Z /usr/bin/bash: line 1: riscv64-unknown-elf-gcc: command not found
2023-08-22T14:54:39.9598922Z expr: syntax error: unexpected argument '12'

@hartmannathan
Copy link
Contributor

Hmm riscv failed and caused canncelation of all other targets <_<


2023-08-22T14:54:39.9558447Z /usr/bin/bash: line 1: riscv64-unknown-elf-gcc: command not found

2023-08-22T14:54:39.9598922Z expr: syntax error: unexpected argument '12'

Toolchain is not installed in this buildbot?

@xiaoxiang781216
Copy link
Contributor

Fixed here: #10348

@lupyuen
Copy link
Member

lupyuen commented Aug 23, 2023

Hmmm seems to be a problem with the common queue.h, not due to our PR...

libuv/src/uv-common.c: In function 'uv_walk':
Error: libuv/src/queue.h:68:19: error: storing the address of local variable 'queue' in '((void * (**)[2])MEM[(void *[2] * *)loop_13(D) + 8B])[1]' [-Werror=dangling-pointer=]
   68 |     QUEUE_PREV(q) = (n);                                                      \
      |                   ^
libuv/src/queue.h:78:7: note: in expansion of macro 'QUEUE_SPLIT'
   78 |       QUEUE_SPLIT(h, q, n);                                                   \
      |       ^~~~~~~~~~~
libuv/src/uv-common.c:492:3: note: in expansion of macro 'QUEUE_MOVE'
  492 |   QUEUE_MOVE(&loop->handle_queue, &queue);
      |   ^~~~~~~~~~

@annerajb
Copy link
Contributor Author

Hmmm seems to be a problem with the common queue.h, not due to our PR...

libuv/src/uv-common.c: In function 'uv_walk':
Error: libuv/src/queue.h:68:19: error: storing the address of local variable 'queue' in '((void * (**)[2])MEM[(void *[2] * *)loop_13(D) + 8B])[1]' [-Werror=dangling-pointer=]
   68 |     QUEUE_PREV(q) = (n);                                                      \
      |                   ^
libuv/src/queue.h:78:7: note: in expansion of macro 'QUEUE_SPLIT'
   78 |       QUEUE_SPLIT(h, q, n);                                                   \
      |       ^~~~~~~~~~~
libuv/src/uv-common.c:492:3: note: in expansion of macro 'QUEUE_MOVE'
  492 |   QUEUE_MOVE(&loop->handle_queue, &queue);
      |   ^~~~~~~~~~

Yup master never built and failed the same way 10 hours ago
81118db

@lupyuen
Copy link
Member

lupyuen commented Aug 23, 2023

@annerajb Very sorry about this, other PRs are also failing with the same issue: https://github.com/apache/nuttx/pulls

We might need to wait for this to be fixed, then rebase with master and rebuild 🙏

@xiaoxiang781216
Copy link
Contributor

@annerajb please rebase your patch, the break should be fixed by #10370 and apache/nuttx-apps#1990.

Pinephone Pro port just nsh

Status:
booting till GICD / IRQ issue

style cleanups

start to fix style checks

revert offset

whitespaces

revert a64 bringup file

prob last cleanup

more cleanups

remove dts

move changes from a64 hardware specific folders to rk3399

undo common changes (except head.s)

revert gitignore

missing irq.h and rk3399_serial.c need to finish cleaning them up

WIP

add source for load address

make debug print hex again add board include

Pinephone Pro port just nsh

Status:
booting till GICD / IRQ issue

style cleanups

start to fix style checks

revert offset

whitespaces

revert a64 bringup file

prob last cleanup

more cleanups

remove dts

move changes from a64 hardware specific folders to rk3399

undo common changes (except head.s)

revert gitignore

missing irq.h and rk3399_serial.c need to finish cleaning them up

WIP

add source for load address

remove ccache, add board memory map

remove board reset
@annerajb
Copy link
Contributor Author

@annerajb please rebase your patch, the break should be fixed by #10370 and apache/nuttx-apps#1990.

Done Can you approve the build / check?

@annerajb
Copy link
Contributor Author

or @hartmannathan
(or any other mantainer :P )

@hartmannathan
Copy link
Contributor

or @hartmannathan

(or any other mantainer :P )

Someone got there faster than me :-)

@lupyuen
Copy link
Member

lupyuen commented Aug 23, 2023

@annerajb Great job! We're ready to merge into NuttX Mainline, could we tidy up the PR Title and Impact? Maybe like this: #7692 Thanks!

@annerajb annerajb changed the title Pinephone Pro port just nsh arch/arm64: Add support for PINE64 PinePhone Pro Aug 24, 2023
@annerajb
Copy link
Contributor Author

@annerajb Great job! We're ready to merge into NuttX Mainline, could we tidy up the PR Title and Impact? Maybe like this: #7692 Thanks!

Done

@lupyuen
Copy link
Member

lupyuen commented Aug 24, 2023

Looks great to me, approved. Thank you so much for contributing the PinePhone Pro port! :-)

@xiaoxiang781216 xiaoxiang781216 merged commit 24e45d0 into apache:master Aug 24, 2023
@masayuki2009
Copy link
Contributor

@annerajb

Please remove unnecessary comments in the commit log next time.

commit 24e45d071e6c56611ba866620a47af59b1e604e7
Author: Anner J. Bonilla <abonilla@soteradigital.com>
Date:   Fri Aug 11 09:12:26 2023 -0400

    Pinephone Pro port just nsh

    Pinephone Pro port just nsh

    Status:
    booting till GICD / IRQ issue

    style cleanups

    start to fix style checks

    revert offset

    whitespaces

    revert a64 bringup file

    prob last cleanup

    more cleanups

    remove dts

    move changes from a64 hardware specific folders to rk3399

    undo common changes (except head.s)

    revert gitignore

    missing irq.h and rk3399_serial.c need to finish cleaning them up

    WIP

    add source for load address

    make debug print hex again add board include

    Pinephone Pro port just nsh

    Status:
    booting till GICD / IRQ issue

    style cleanups

    start to fix style checks

    revert offset

    whitespaces

    revert a64 bringup file


    prob last cleanup

    more cleanups

    remove dts

    move changes from a64 hardware specific folders to rk3399

    undo common changes (except head.s)

    revert gitignore

    missing irq.h and rk3399_serial.c need to finish cleaning them up

    WIP

    add source for load address

    remove ccache, add board memory map

    remove board reset

@lupyuen
Copy link
Member

lupyuen commented Aug 24, 2023

@annerajb Thanks again for porting NuttX to PinePhone Pro, your contribution is super valuable for learning the Internals of a Modern Smartphone! I have some suggestions for the next steps:

  1. PinePhone's UART Driver has an issue with the numbering of unused Serial Ports /dev/ttySn, I think it affects PinePhone Pro too. One way to fix this: Switch to the NuttX 16550 UART Driver

  2. Would be good to rename pinephone_bringup to pinephonepro_bringup, in case of name conflicts.

  3. If we're building Mainline NuttX Daily for PinePhone Pro, check out this GitHub Actions Workflow. (I haven't figured out how to do daily Automated Testing)

  4. I understand that we're working on the I2C Driver. Which is great, because we can then use the NuttX Touch Panel Driver for GT917S

  5. For the Display Driver, maybe take a look at the VOP Driver for Tow Boot. See if we can reimplement a simpler driver for NuttX.

  6. Use our new MIPI DSI Driver

  7. There's plenty to be done, maybe we can get the Community involved? Lemme know if I should broadcast this on the Pine64 Forum.

As always, lemme know if you need any help :-)

Update 10 Sep 2023: Now adding RK3399 GPIO

@annerajb
Copy link
Contributor Author

@annerajb Thanks again for porting NuttX to PinePhone Pro, your contribution is super valuable for learning the Internals of a Modern Smartphone! I have some suggestions for the next steps:

  1. PinePhone's UART Driver has an issue with the numbering of unused Serial Ports /dev/ttySn, I think it affects PinePhone Pro too. One way to fix this: Switch to the NuttX 16550 UART Driver
  2. Would be good to rename pinephone_bringup to pinephonepro_bringup, in case of name conflicts.
  3. If we're building Mainline NuttX Daily for PinePhone Pro, check out this GitHub Actions Workflow. (I haven't figured out how to do daily Automated Testing)
  4. I understand that we're working on the I2C Driver. Which is great, because we can then use the NuttX Touch Panel Driver for GT917S
  5. For the Display Driver, maybe take a look at the VOP Driver for Tow Boot. See if we can reimplement a simpler driver for NuttX.
  6. Use our new MIPI DSI Driver
  7. There's plenty to be done, maybe we can get the Community involved? Lemme know if I should broadcast this on the Pine64 Forum.

As always, lemme know if you need any help :-)
Thanks,

Feel free to broadcast on the forum my roadmap is i2c, touch (mostly to confirm i2c is all good)
At that point which suspect will be a week reassess what is the most value-added next step based on if anybody else has contributed anything.

I have a new PR planned for the board reset support will rename the bring up file on that one.

@lupyuen
Copy link
Member

lupyuen commented Aug 25, 2023

Thanks @annerajb I have announced the project on Pine64 Forum. I hope NuttX on PinePhone Pro will become a Daily Driver. Or maybe we can teach it in schools! :-)

@Throwaway8
Copy link

Throwaway8 commented Sep 10, 2023

@annerajb whats the correct way to build, you flash onto a micro sd card with tow boot installed and it should boot? Is there any way to format the memory card because just using the basic build commands it doesn't seem to be able to detect a partition table on the memory card

git clone https://github.com/apache/nuttx.git
cd nuttx/
./tools/configure.sh pinephonepro/nsh
make
cp nuttx.bin Image
gzip Image

and the .gz image is what I flash with balena etcher to sd card, seems to be latest

Tow-Boot TPL 2022.07
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

Tow-Boot SPL 2022.07
Trying to boot from SPI
NOTICE: BL31: v2.6(release):
NOTICE: BL31: Built : 00:00:00, Jan 1 1980

Tow-Boot 2022.07 006 [variant: spi]

SoC: Rockchip rk3399
Reset cause: POR
Model: Pine64 PinePhonePro
DRAM: 3.9 GiB
Initializing Pinephone Pro charger
PMIC: RK8180 (on=0x40, off=0x08)
Core: 324 devices, 34 uclasses, devicetree: separate
MMC: mmc@fe310000: 3, mmc@fe320000: 1, mmc@fe330000: 0
Loading Environment from SPIFlash... SF: Detected gd25lq128e with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Model: Pine64 PinePhonePro
Net: No ethernet found.
starting USB...
Bus usb@fe380000: ehci_generic usb@fe380000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3a0000: USB OHCI 1.0
Bus usb@fe3c0000: ehci_generic usb@fe3c0000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3e0000: USB OHCI 1.0
scanning bus usb@fe3a0000 for devices... 1 USB Device(s) found
scanning bus usb@fe3e0000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Please press [ESCAPE] or [CTRL+C] to enter the boot menu.
off
off
switch to partitions #0, OK
mmc0(part 0) is current device
** Invalid partition 1 **
Couldn't find partition mmc 0:1
switch to partitions #0, OK
mmc1 is current device
** No partition table - mmc 1 **
Couldn't find partition mmc 1:1

Device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
Retrieving file: pxelinux.cfg/000000
No ethernet found.
Retrieving file: pxelinux.cfg/00000
No ethernet found.
Retrieving file: pxelinux.cfg/0000
No ethernet found.
Retrieving file: pxelinux.cfg/000
No ethernet found.
Retrieving file: pxelinux.cfg/00
No ethernet found.
Retrieving file: pxelinux.cfg/0
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-rk3399-pinephone-pro-rk3399
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-rk3399
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
No ethernet found.
SF: Detected gd25lq128e with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0xffe000, size 0x2000
SF: 8192 bytes @ 0xffe000 Read: OK

Executing script at 00500000

Wrong image format for "source" command
SCRIPT FAILED: continuing...

ERROR: Could not boot anything from distro_bootcmd.

@annerajb
Copy link
Contributor Author

@annerajb whats the correct way to build, you flash onto a micro sd card with tow boot installed and it should boot? Is there any way to format the memory card because just using the basic build commands it doesn't seem to be able to detect a partition table on the memory card

git clone https://github.com/apache/nuttx.git
cd nuttx/
./tools/configure.sh pinephonepro/nsh
make
cp nuttx.bin Image
gzip Image

and the .gz image is what I flash with balena etcher to sd card, seems to be latest

Tow-Boot TPL 2022.07
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

Tow-Boot SPL 2022.07
Trying to boot from SPI
NOTICE: BL31: v2.6(release):
NOTICE: BL31: Built : 00:00:00, Jan 1 1980

Tow-Boot 2022.07 006 [variant: spi]

SoC: Rockchip rk3399
Reset cause: POR
Model: Pine64 PinePhonePro
DRAM: 3.9 GiB
Initializing Pinephone Pro charger
PMIC: RK8180 (on=0x40, off=0x08)
Core: 324 devices, 34 uclasses, devicetree: separate
MMC: mmc@fe310000: 3, mmc@fe320000: 1, mmc@fe330000: 0
Loading Environment from SPIFlash... SF: Detected gd25lq128e with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Model: Pine64 PinePhonePro
Net: No ethernet found.
starting USB...
Bus usb@fe380000: ehci_generic usb@fe380000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3a0000: USB OHCI 1.0
Bus usb@fe3c0000: ehci_generic usb@fe3c0000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3e0000: USB OHCI 1.0
scanning bus usb@fe3a0000 for devices... 1 USB Device(s) found
scanning bus usb@fe3e0000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Please press [ESCAPE] or [CTRL+C] to enter the boot menu.
off
off
switch to partitions #0, OK
mmc0(part 0) is current device
** Invalid partition 1 **
Couldn't find partition mmc 0:1
switch to partitions #0, OK
mmc1 is current device
** No partition table - mmc 1 **
Couldn't find partition mmc 1:1

Device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
Retrieving file: pxelinux.cfg/000000
No ethernet found.
Retrieving file: pxelinux.cfg/00000
No ethernet found.
Retrieving file: pxelinux.cfg/0000
No ethernet found.
Retrieving file: pxelinux.cfg/000
No ethernet found.
Retrieving file: pxelinux.cfg/00
No ethernet found.
Retrieving file: pxelinux.cfg/0
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-rk3399-pinephone-pro-rk3399
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-rk3399
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
No ethernet found.
SF: Detected gd25lq128e with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0xffe000, size 0x2000
SF: 8192 bytes @ 0xffe000 Read: OK

Executing script at 00500000

Wrong image format for "source" command
SCRIPT FAILED: continuing...

ERROR: Could not boot anything from distro_bootcmd.

No I flashed a random pinephone pro image that didn't use a uefi boot and modified the .conf file from grub to specify the copied over image.gz

Will paste a example later today and try to find what's the distro I flashed with balena

@annerajb
Copy link
Contributor Author

https://github.com/webOS-ports/meta-pine64-luneos/releases/tag/20211220-v1

then I deleted the boot.scr and created a extlinux folder where I copied the following extlinux.conf

## /boot/extlinux/extlinux.conf
##
## IMPORTANT WARNING
##
## The configuration of this file is generated automatically.
## Do not edit this file manually, use: u-boot-update

default l0
menu title U-Boot menu
prompt 1
timeout 1


label l0
	menu label Mobian GNU/Linux 6.1-rockchip
	kernel /Image.gz
	fdt /rk3399-pinephone-pro.dtb

copied the Image.gz to the root of the sdcard after using balena
I also added the device tree rk3399-pinephonepro.dtb from another image (I can't remember which one) not even sure if it matters since uboot has it's own dtsi and nuttx is not using it.. but the uboot extlinux.conf wanted to have a fdt line

rk3399-pinephone-pro.zip

@Throwaway8
Copy link

Throwaway8 commented Sep 11, 2023

https://github.com/webOS-ports/meta-pine64-luneos/releases/tag/20211220-v1

then I deleted the boot.scr and created a extlinux folder where I copied the following extlinux.conf

## /boot/extlinux/extlinux.conf
##
## IMPORTANT WARNING
##
## The configuration of this file is generated automatically.
## Do not edit this file manually, use: u-boot-update

default l0
menu title U-Boot menu
prompt 1
timeout 1


label l0
	menu label Mobian GNU/Linux 6.1-rockchip
	kernel /Image.gz
	fdt /rk3399-pinephone-pro.dtb

copied the Image.gz to the root of the sdcard after using balena I also added the device tree rk3399-pinephonepro.dtb from another image (I can't remember which one) not even sure if it matters since uboot has it's own dtsi and nuttx is not using it.. but the uboot extlinux.conf wanted to have a fdt line

rk3399-pinephone-pro.zip

Great thank you for sharing I will go through this and give it a try soon.. makes sense I wasn't sure if you were using the image.gz file directly

JianyuWang0623 added a commit to JianyuWang0623/nuttx that referenced this pull request Sep 12, 2023
JianyuWang0623 added a commit to JianyuWang0623/nuttx that referenced this pull request Sep 12, 2023
JianyuWang0623 added a commit to JianyuWang0623/nuttx that referenced this pull request Sep 16, 2023
JianyuWang0623 added a commit to JianyuWang0623/nuttx that referenced this pull request Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants