Skip to content
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

Add support for Bananapi M5 / M2P #4251

Merged
merged 2 commits into from
Oct 4, 2022
Merged

Add support for Bananapi M5 / M2P #4251

merged 2 commits into from
Oct 4, 2022

Conversation

igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Sep 30, 2022

Description

Jira reference number AR-1362

How Has This Been Tested?

  • Boot test with basic functions checked
  • Install and boot from eMMC

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@lanefu
Copy link
Member

lanefu commented Oct 2, 2022

@igorpecovnik

FYI

Based on what I ran into yesterday with radxa zero when updating uboot to v22.07/22.10-rc5 this patch needed to be removed

https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-meson64/0003-mmc-meson-gx-change-clock-phase-value-on-axg-SoCs.patch

@igorpecovnik
Copy link
Member Author

igorpecovnik commented Oct 2, 2022

Hmm. I just just successfully installed it to eMMC as is. For this MR in particular, not needed, but let @adeepn tells more.

@igorpecovnik igorpecovnik requested review from adeepn and removed request for adeepn October 2, 2022 18:01
@igorpecovnik igorpecovnik added the Ready to merge Reviewed, tested and ready for merge label Oct 2, 2022
@igorpecovnik
Copy link
Member Author

Another problem - after installed to eMMC, it always boot from there first. This would probably be good to change?

@adeepn
Copy link
Member

adeepn commented Oct 3, 2022

Based on what I ran into yesterday with radxa zero when updating uboot to v22.07/22.10-rc5 this patch needed to be removed

https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-meson64/0003-mmc-meson-gx-change-clock-phase-value-on-axg-SoCs.patch

Can you explain whats'wrong?

This patch only affects to axg AmLogic CPU (A113X/A113D)

@adeepn
Copy link
Member

adeepn commented Oct 3, 2022

Another problem - after installed to eMMC, it always boot from there first. This would probably be good to change?

You cannot change this behavior. The SoC chooses the boot order via jumpers on selected lines.

@igorpecovnik
Copy link
Member Author

You cannot change this behavior.

But u-boot on eMMC could search for boot.scr on the other media and boot from there. Just - do we want this?

@igorpecovnik igorpecovnik changed the title Add initial support for Bananapi M5 / M2P Add support for Bananapi M5 / M2P Oct 3, 2022
@lanefu
Copy link
Member

lanefu commented Oct 3, 2022

Can you explain whats'wrong?

This patch only affects to axg AmLogic CPU (A113X/A113D)

with patch enabled.. the following on radxa zero

U-Boot 2022.07-armbian (Oct 01 2022 - 21:33:42 +0000) radxa-zero

Model: Radxa Zero
SoC:   Amlogic Meson G12A (S905Y2) Revision 28:b (30:2)
DRAM:  2 GiB
Core:  383 devices, 23 uclasses, devicetree: separate
MMC:   sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
unable to select a mode : -5

With patch removed

=> version
U-Boot 2022.07-armbian (Oct 01 2022 - 22:01:17 +0000) radxa-zero

aarch64-linux-gnu-gcc (Ubuntu 11.2.0-17ubuntu1) 11.2.0
GNU ld (GNU Binutils for Ubuntu) 2.38
=> mmc list
sd@ffe03000: 0
sd@ffe05000: 1
mmc@ffe07000: 2
=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device
=> mmc info
Device: mmc@ffe07000
Manufacturer ID: 70
OEM: 0
Name: T22708
Bus Speed: 24000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 7.1 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7.1 GiB
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected

@igorpecovnik
Copy link
Member Author

For this banana this patch have no effect.

@lanefu
Copy link
Member

lanefu commented Oct 3, 2022

For this banana this patch have no effect.

correct, but this PR's moving meson64 u-boot to v22.07 will have an effect..... i'm offering the corrective action for the inevitable regress for that :)

@adeepn
Copy link
Member

adeepn commented Oct 3, 2022

For this banana this patch have no effect.

correct, but this PR's moving meson64 u-boot to v22.07 will have an effect..... i'm offering the corrective action for the inevitable regress for that :)

I propose split this PR to

  • u-boot version update.
  • support M5

P.S. u-boot v2022.07 has strange bug on AmLogic https://lore.kernel.org/all/258575a1-8c55-3229-f27a-d608a7aad0ec@baylibre.com/ it need to be tested on all devices.

@adeepn
Copy link
Member

adeepn commented Oct 3, 2022

For this banana this patch have no effect.

correct, but this PR's moving meson64 u-boot to v22.07 will have an effect..... i'm offering the corrective action for the inevitable regress for that :)

This very strange. Patch only fixes PHASE parameter on AXG in meson-gx-mmc driver. For SM1 this PHASE value is already changed to CLK_CO_PHASE_270. Can you test your device with CLK_CO_PHASE_180 value in meson_gx_mmc.c?

@igorpecovnik
Copy link
Member Author

igorpecovnik commented Oct 3, 2022

I propose split this PR to

Yes. Banana is done, please review / approval.

u-boot version update.

Yes and start with testings after that.

@adeepn
Copy link
Member

adeepn commented Oct 4, 2022

I propose split this PR to

Yes. Banana is done, please review / approval.

u-boot version update.

Yes and start with testings after that.

Ok. I don't see anything else against approving.

@igorpecovnik igorpecovnik merged commit 15cab81 into master Oct 4, 2022
@igorpecovnik igorpecovnik deleted the AR-1362 branch October 4, 2022 08:50
@rpardini
Copy link
Member

rpardini commented Oct 26, 2022

This PR bumped u-boot to 2022.07 for all meson64
That broke VIM3L/2Gb at least. 2022.10 does not fix it. 2022.04 works.
I didn't test the Zero's yet, but all my other 4Gb meson64's work with 2022.07+ inclusive 2022.10.

This unrelated to @adeepn's 0003-mmc-meson-gx-change-clock-phase-value-on-axg-SoCs.patch (I tried both with and without).

@igorpecovnik I suggest we temporarily add a separate var like BOOTBRANCH_BOARD as default to meson64's BOOTBRANCH so to allow us to use 2022.04 for VIM3L. Going that way in armbian-next first.

Here's the versions tested

U-Boot 2021.07 (Sep 28 2022 - 14:55:14 +0800) khadas-vim3l [OK, Khadas]
U-Boot 2022.01-armbian (Oct 26 2022 - 18:47:27 +0000) khadas-vim3l [OK!]
U-Boot 2022.04-armbian (Oct 26 2022 - 19:42:51 +0000) khadas-vim3l [OK!]
U-Boot 2022.10-armbian (Oct 26 2022 - 20:07:51 +0000) khadas-vim3l [NOT OK!]
U-Boot 2022.07-armbian (Oct 26 2022 - 21:39:49 +0000) khadas-vim3l [NOT OK!]

When it fails:

U-Boot 2022.07-armbian (Oct 26 2022 - 21:39:49 +0000) khadas-vim3l

Model: Khadas VIM3L
SoC:   Amlogic Meson SM1 (S905D3) Revision 2b:c (4:2)
DRAM:  2 GiB
Core:  398 devices, 33 uclasses, devicetree: separate
MMC:   sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@ff3f0000
Hit any key to stop autoboot:  0
Card did not respond to voltage select! : -110
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
8147 bytes read in 3 ms (2.6 MiB/s)
## Executing script at 08000000
U-boot default fdtfile: amlogic/meson-sm1-khadas-vim3l.dtb
Current variant:
157 bytes read in 2 ms (76.2 KiB/s)
Current fdtfile after armbianEnv: amlogic/meson-sm1-khadas-vim3l.dtb
Mainline bootargs: root=UUID=06a566de-4a63-4654-9f28-953837005de5 rootwait rootfstype=ext4 splash=verbose console=ttyAML0,115200 consoleblank=0 coherent_pool=2M loglevel=7 ubootpart=cf212ae0-01 libata.force=noncq usb-storage.quirks=    cgroup_enable=memory swapaccount=1
26106055 bytes read in 1152 ms (21.6 MiB/s)
27349504 bytes read in 1203 ms (21.7 MiB/s)
75815 bytes read in 8 ms (9 MiB/s)
232 bytes read in 3 ms (75.2 KiB/s)
Applying kernel provided DT fixup script (meson-fixup.scr)
## Executing script at 32000000
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    26105991 Bytes = 24.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 04080000
   Booting using the fdt blob at 0x4080000
   Loading Ramdisk to 7a634000, end 7bf19887 ... OK
   Loading Device Tree to 000000007a5b9000, end 000000007a633fff ... OK
"Synchronous Abort" handler, esr 0x96000004
elr: 0000000001072cac lr : 00000000010625b8 (reloc)
elr: 000000007dfa6cac lr : 000000007df965b8
x0 : 9e1a8f53c677a5a8 x1 : 000000007dfae958
x2 : 0000000000000010 x3 : 000000007bf433e0
x4 : 0000000000000000 x5 : 9e1a8f53c677a5a8
x6 : 0000000005000000 x7 : 0000000000000007
x8 : 0000000000000000 x9 : 0000000000000008
x10: 00000000000001ac x11: 000000007bf1d7fc
x12: 0000000000000098 x13: 000000007bf1d7b8
x14: 000000007a5b9000 x15: 0000000000000020
x16: 000000007df3e264 x17: 0000000000000000
x18: 000000007bf31da0 x19: 000000007af1d040
x20: 000000007df34b18 x21: 000000007dfae958
x22: 0000000000000300 x23: 000000007bf43330
x24: 000000007dfd3ce8 x25: 0000000000300000
x26: 0000000005000000 x27: 0000000000000000
x28: 0000000000000300 x29: 000000007bf1d7c0

Code: eb04005f 54000061 52800000 14000006 (386468a3)
Resetting CPU ...

resetting ...
bl31 reboot reason: 0xd
bl31 reboot reason: 0x0
system cmd  1.
SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;CHK:1F;SD?:0;SD:0;READ:0;0.0;CHK:0;

... and loops...

@igorpecovnik
Copy link
Member Author

I didn't test the Zero's yet

I don't have those but I have been asking people to test devices I don't have. This is first problem I am seeing.

@igorpecovnik
Copy link
Member Author

igorpecovnik commented Oct 27, 2022

Odroid N2 seems to need 2022.07
https://forum.armbian.com/topic/20206-odroid-n2-issues-with-recent-firmware-and-emmc-modules/#comment-152280

Nothing unusual but ordinary mess :)

@adeepn
Copy link
Member

adeepn commented Oct 27, 2022

P.S. u-boot v2022.07 has strange bug on AmLogic https://lore.kernel.org/all/258575a1-8c55-3229-f27a-d608a7aad0ec@baylibre.com/ it need to be tested on all devices.

Problem with EFI part of u-boot. If you disable it in config - all working (without efi, of course)

This PR bumped u-boot to 2022.07 for all meson64 That broke VIM3L/2Gb at least. 2022.10 does not fix it. 2022.04 works. I didn't test the Zero's yet, but all my other 4Gb meson64's work with 2022.07+ inclusive 2022.10.

This unrelated to @adeepn's 0003-mmc-meson-gx-change-clock-phase-value-on-axg-SoCs.patch (I tried both with and without).

"Synchronous Abort" handler, esr 0x96000004
elr: 0000000001072cac lr : 00000000010625b8 (reloc)
elr: 000000007dfa6cac lr : 000000007df965b8
x0 : 9e1a8f53c677a5a8 x1 : 000000007dfae958
x2 : 0000000000000010 x3 : 000000007bf433e0
x4 : 0000000000000000 x5 : 9e1a8f53c677a5a8
x6 : 0000000005000000 x7 : 0000000000000007
x8 : 0000000000000000 x9 : 0000000000000008
x10: 00000000000001ac x11: 000000007bf1d7fc
x12: 0000000000000098 x13: 000000007bf1d7b8
x14: 000000007a5b9000 x15: 0000000000000020
x16: 000000007df3e264 x17: 0000000000000000
x18: 000000007bf31da0 x19: 000000007af1d040
x20: 000000007df34b18 x21: 000000007dfae958
x22: 0000000000000300 x23: 000000007bf43330
x24: 000000007dfd3ce8 x25: 0000000000300000
x26: 0000000005000000 x27: 0000000000000000
x28: 0000000000000300 x29: 000000007bf1d7c0

Code: eb04005f 54000061 52800000 14000006 (386468a3)
Resetting CPU ...

resetting ...
bl31 reboot reason: 0xd
bl31 reboot reason: 0x0
system cmd 1.
SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;CHK:1F;SD?:0;SD:0;READ:0;0.0;CHK:0;

... and loops...

igorpecovnik added a commit that referenced this pull request Oct 27, 2022
* Go back to latest stable u-boot with VIM3L

#4251

* Revert "Go back to latest stable u-boot with VIM3L"

This reverts commit 0b24056.

* meson64: allow board-specific `BOOTBRANCH`; `khadas-vim3l`: `BOOTBRANCH_BOARD=tag:v2022.04`

Co-authored-by: Ricardo Pardini <ricardo@pardini.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge Reviewed, tested and ready for merge
Development

Successfully merging this pull request may close these issues.

None yet

4 participants