avafinger / bananapi-m64-kodi

BananaPi M64 with KODI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test Image not available???

spikerguy opened this issue · comments

Hey Avafinger,
I see you have done alot of work on A64 Devices NanoPi, BananaPi and Pine64.
I have received my M64 for testing. I would like to test the 5.3.0 kernel with Kodi.

Can you share the uboot & kernel source if you have it open sourced?

Thanks & sorry for creating an issue here, As IDK where to find you.

I would like to test the 5.3.0 kernel with Kodi.

I am releasing Kernel 5.3.8 where you can run Kodi. As far as i remember 5.3.0 had some issues with H264 (freeze), this has been fixed. The limitation is HEVC 10-bit.

U-boot source: https://gitlab.denx.de/u-boot/u-boot/tree/v2019.10
Kernel source: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.8.tar.xz
Kodi Patch: https://github.com/avafinger/nanopi-a64-kodi/tree/master/patch

Some patch from sunxi-linux may be needed, cedrus and mali are from bootlin's work.

Be aware that u-boot has some issues with USB on BPI-M64 , i am not sure it has been fixed on latest version. DON'T use USB hub, or you get some instability issues.

Image is here: https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.1
You need a linux box to burn the sd card.

After you flash the 5.2, do some tests, then you can apply the new kernel.

Thanks for the quick response. I will try the 5.2 version
Are you available on any Chat room?

Usually not. I am not allowed to chat from the office.

@spikerguy

Can you try this kernel 5.3.8 and report back?

https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.2

Please, report the board hw version.

I just tested u-boot 2020.01-rc1 and the instability with USB still remain.
No feedback, closing.

Hey,
Sorry for the delay in response. I have been busy today with work. I will try to test it tomorrow night for sure.

Thanks for the updated image. You can tag me anytime you need me to test any updated image.
Great work.

U-boot source: https://gitlab.denx.de/u-boot/u-boot/tree/v2019.10
Kernel source: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.8.tar.xz
Kodi Patch: https://github.com/avafinger/nanopi-a64-kodi/tree/master/patch

Some patch from sunxi-linux may be needed, cedrus and mali are from bootlin's work.

The Kernel is mainline and without any device specific patch. As mentioned patches from sunxi-linux, Where can I find this?

Just tried 5.3.1 but it failed. Also I see that boot partition doesn't have the directory structure as the normal BPI devices.
U-Boot SPL 2019.07-rc3-00112-g6d277fb-dirty (Jul 05 2019 - 20:10:09 -0300) DRAM: 2048 MiB Trying to boot from MMC1 NOTICE: BL31: v2.0(release):v2.0-944-gaf38167-dirty NOTICE: BL31: Built : 11:38:28, Apr 14 2019 NOTICE: BL31: Detected Allwinner A64/H64/R18 SoC (1689) NOTICE: BL31: Found U-Boot DTB at 0x4096c68, model: BananaPi-M64 NOTICE: BL31: PMIC: Detected AXP803 on RSB.

U-Boot SPL 2019.07-rc3-00112-g6d277fb-dirty (Jul 05 2019 - 20:10:09 -0300) DRAM: 2048 MiB Trying to boot from MMC1 NOTICE: BL31: v2.0(release):v2.0-944-gaf38167-dirty NOTICE: BL31: Built : 11:38:28, Apr 14 2019 NOTICE: BL31: Detected Allwinner A64/H64/R18 SoC (1689) NOTICE: BL31: Found U-Boot DTB at 0x4096c68, model: BananaPi-M64

Here is the UART Log. I followed the scripts and everything from the script ran just fine.

Where is the complete log?

Your HW revision is...?

This is what it runs in loop. It says V1.2 on the hardware.

Do you have anything attached to USB? describe.

Do you have anything attached to USB? describe.

Only a keyboard.

I even tried to put the Boot files as per the BPI boot structure.
/boot/bananapi/bpi-m64/linux/dtb/bpi-m64.dtb
and the Image & initrd to /boot/bananapi/bpi-m64/linux
Still it is the same.

Hmm, ok. Not enough info from your log.

Just for the curiosity, can you try this: https://github.com/avafinger/bpi-m64-firmware-v2
And report if it works?

I even tried to put the Boot files as per the BPI boot structure.
/boot/bananapi/bpi-m64/linux/dtb/bpi-m64.dtb
and the Image & initrd to /boot/bananapi/bpi-m64/linux

This will not work, it is dependant on the u-boot version.

Sure. I will try this in sometime. I use Manjaro Arch Linux as host to run your scripts.
I hope that is not an issue as I see it is just the bash script.

There should be no problem...

Ok cloning that repo and will flash it on the sd and report back in sometime.

There is also a kernel 4.4 here: https://mega.nz/#F!wXwlRRZR!0BCmUo2F2hg7rG4Ax69bkw

But your board has a new eMMC version and i think eMMC will not be recognized.
But you can take BPI kernel 4.4 that has the patch for the new eMMC and rebuilds the rootfs with manjaro and with this new Kernel.

I have the Older version, I have Tested anarsoul's Arch Img for Pine64 A64+ and it worked fine out of the box, with almost everything working.
But I am not able to get the kernel sources. Like I have to download a complete img and use the pre-compiled kernel. Instead I am looking for source so I can compile with some addition features like touchscreen which is not from BPI. I have got this board just for test and development. My aim right now is to build Manjaro for this device which would be quite easy once I can find a way to patch mainline or fine someone who is maintaining A64 Kernel with patches. Its hard to find the later.

Thanks for your support & response. I am flashing the older version firmware and get back to you with update.

I am looking for source so I can compile with some addition features like touchscreen which is not from BP

The way to go is to get BPI Kernel 4.4 that have support for new eMMC and possible touch screen.

What is your LCD and touchscreen?

I have Khadas TS050.
I found script error in format script.
`bpi-m64-firmware-v2]$ sudo ./format_sd.sh /dev/mmcblk0
INFO: Umounting /dev/mmcblk0, please wait...
INFO: Formating sd card /dev/mmcblk0 ...
INFO: Zeroing mbr on /dev/mmcblk0 ...
20+0 records in
20+0 records out
20971520 bytes (21 MB, 20 MiB) copied, 2.95158 s, 7.1 MB/s
INFO: Creating partition on /dev/mmcblk0 ...

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xefeeb8c7.

Command (m for help): Created a new DOS disklabel with disk identifier 0xc5facada.

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-31116287, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (40960-31116287, default 31116287):
Created a new partition 1 of type 'Linux' and of size 80 MiB.

Command (m for help): Selected partition 1
Hex code (type L to list all codes): Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-31116287, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (204800-31116287, default 31116287):
Created a new partition 2 of type 'Linux' and of size 14.8 GiB.

Command (m for help): Partition number (1,2, default 2): Hex code (type L to list all codes):
Changed type of partition 'Linux' to 'Linux'.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

/dev/mmcblk0: msdos partitions 1 2
WARN: Formating /dev/mmcblk0 ...
80+0 records in
80+0 records out
83886080 bytes (84 MB, 80 MiB) copied, 0.0410549 s, 2.0 GB/s
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mke2fs 1.45.4 (23-Sep-2019)
The file /dev/mmcblk02 does not exist and no size was specified.`

I will follow the commands manually and try.
This error is in the firmware V2 so as that script is quite old. I will replace it with the updated script and check the difference.

Look for: INFO: Creating partition on /dev/mmcblk0 ..
And fix the command that creates the partition.

What is Anarsoul's u-boot version?

I used format_sd_mainline.sh instead and it works fine.

Mainline and BSP have a different layout, don't think will work.

Updated the script and made pr for it.
here is the log for this v2 boot.
bpi-m64-firmware-v2 error log https://pastebin.com/63Mk8vY4
bananapi-m64-kod error log https://pastebin.com/TBHYDBfP

Did you try 4.4 also?

No didn't try 4.4 will try that in sometime.

Ok, if you try the 4.4 please post the log. Check if eth0 works also.

Can you post the complete log from the 4.4 and also from the anarsoul kernel?

I will have to look into anarsouls version. But I have already tested his Arch XFCE Image and it works fine. I have pulled the previous img of 4.4 and can only test tomorrow night.

Will update you once I get to test it. Thanks

See if you can find the sources for the Arch u-boot and BL31 (arm), so it is possible to compare.
Anarsoul is one of the kernel contributors.

Don't know what you mean by "works fine", running a Pine64+ image on the BPI-M64 should have problems with Wifi, BT and possible eth0.

Can you please try this new u-boot and see if it boots?
It is for the mainline 5.3.8
https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.3

But it cannot detect my I2C

ls /dev/i2c-*
/dev/i2c-0 /dev/i2c-1

i2c--1 is available. Can you give me more details?

Initial Image to Burn: https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.0
u-boot for the board hw revision 1.2: https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.3

Trying this, I replaced the uboot file to v1.2 version inside the flash script. This uboot failed, it gets in boot loop with just uboot Will try 4.4 now.

@spikerguy
Something wrong here, @azrin1972 seems to have v1.2 and it is working.

Anyway, i2c is not working, can't write to i2c1.

@azrin1972 Can you confirm how did you try this ? I am using a 16gb SD Card.

@spikerguy
Please, try kernel 4.4 and see if it boots. There is problems with eMMC but this can be fixed, i just need to know if it can get past u-boot and start the kernel.

@avafinger Flashing is now. Its big file.

I see boot partition is ext? How is that possible? This is in format_sd_mainline
Screenshot_20191104_181332

4.4 worked fine with H6 as Uboot Logo. eth0 was present with MAC but it didn't get any IP from DHCP. WIFI was not working. Bluetooth worked also eMMC was visible. I will try 5.2 with fat as boot partition

I get error on extracting boot file.

tar -xvpzf boot_5.2-m64.tar.gz -C ./eboot  --numeric-ow
./
./boot.scr
./Image_5.2.0-m64
./dtb
tar: ./dtb: Cannot create symlink to ‘m64.dtb_5.2.0-m64’: Operation not permitted
./lost+found/
./Image
tar: ./Image: Cannot create symlink to ‘Image_5.2.0-m64’: Operation not permitted
./m64.dtb_5.2.0-m64
./initrd.img
./boot.cmd
tar: Exiting with failure status due to previous errors

OK vfat was a bad idea. and also I corrected the format script. The Partition argument is not correct
# Create boot file system (ext4) dd if=/dev/zero bs=1M count=${boot_size} of=${out}1 << the 1 ??

After many tries I thing this typo made all the issue with the 1 instead is should be "${part}1" after mmcblk

Tried everything from the script but still no luck with booting.
Both uboot fails 2019 as well as 2020
Log here >>https://pastebin.com/r0sE5HMq

Please, clarify, kernel 4.4 botted or not?

@avafinger Hi,

Yes 4.4 booted fine and I think It's the smooth Aarch64 OS I have used so far. It is very smooth looks like it have full GPU/VPU support as even the browser was not taking much of CPU.
I will flash it again and use it more.

For 5.2 and v1.3 I tried everything but it didnt boot past uboot. The Log in my previous post.
I corrected the parition typo in the format_sd_mainline script, still no luck.

Yeah, 4.4 works nicely here on my board. Everything works, eth0, wlan0, BT and eMMC. But the board v1.2 has new eMMC and new DRAM. Unfortunately what i thought could be the fix did not happen.

I will push the new 4.4 but for this, i need to know what is working on your v1.2, can you tick what is working?

    [ ] eMMC
    [ ] BT
    [ ] wlan
    [ ] eth

I will fix the script also, thanks.

sure.

I will update it in few hours. I tried my best to get 5.2 to work but its the same issue.

PS, when i refer to board v1.2 i mean the board version printed on the board...

yes. I have the board with 1.2 printed will upload image is you want.

There is also a BPI 5.3.y Image, can you grab a complete log from this Image?

I can only see 5.2 complete img. while 5.3 is only kernel update.

please point me to the 5.3 complete img.

thanks

yes I have this file but didn't get interested in it much. but if you want I can try it and get details from there.

It is just for the u-boot signature and log. The problem is the u-boot and they have it right.

But 4.4 u-boot worked fine. I am flashing the 4.4 img again and will report back what all works.

u-boot for 4.4 does not work for mainline....

Oh ok So you mean you don't have working u-boot for v1.2 on mainline. Ok I will try to flash it today or maybe tomorrow.

Tested 4.4
[X] eMMC - Works - I see mmcblk0 which is 8GB
[X] Audio Over HDMI - Works
[ ] BT - Not able to fine adapter
[ ] wlan - No wifi
[ ] eth - I can see eth0 but dont have lan at home to test.

It reboots when I try to connect my phone for teathering, Internet worked from it for sometime then it rebooted. It reboots when I use USB Hub which is a known issue.

Anything else you want me to test then please advice.

It reboots when I use USB Hub which is a known issue.

That is a known issue for the mainline.

Can you grab a complete boot log?
As far as i know, my Wifi is A0 chip, maybe your board is A1 chip, that would explain no Wifi and BT.
The boot log will tell us.

The new kernel has updates for eth, eMMC

which new kernel? i can get you log tomorrow its midnight here. thanks for the response

The one i am working out. :)

hey please advice what all data you need?

i will get dmesg logs anything else?

Please, grab the complete log from the BPI mainline, let's see if we can infer something from the signature.

BPI Mainline failed to boot.
Log here. https://pastebin.com/306Fz1uc

This is something similar to what it does on your mainline.

Yeap!
What about Arch? Is it Mainline Kernel?
I just build the new kernel and will give it a try... If i get it right you can test it.

arch is old build on 4.4 by anarsoul.

I see.
The old u-boot is able to detect and adjust DRAM settings...

The new kernel has some tweaks on eth0 , it might work on v1.2

Would you share the source?

I can try and help you maintain and test it.

also let me know once updated kernel is ready to test on v1.2

Thanks

You can help now doing a full build from BPI BSP github and hand over the following file:
out/tulip-m64/image/sunxi.dtb

This directory is the final temporary directory and files when the building ends. I can't remember it it is cleaned up when the building completes. If the build removes it you have to find the script that removes it and "comment out" that part.

We will need this file, and i cannot build it in my box here.

@avafinger
They release Uboot 2019 with Grub support today.
https://github.com/BPI-SINOVOIP/BPI-Mainline-uboot

The latest 2019 image doesn't seem to work either. They adviced me to use dc power and I did but still it didn't work.

Can you find the grub source code?

No. I have looking for the same 🗡️ I see the grub and efi directory in boot for the img i flashed. But no source code.

Using Micro USB for power with 2.1Amp this works on 4.4 kernel. But not on mainline.

This board needs a DC Power in. To be able to power it with MicroUSB you would need a battery attached.

All your problems are related to powering the board with nicro USB.

I tried with the DC Power 5v 2Am and still the same issue with boot loop.

Not sure this information is correct, but take a look: https://bananapi.gitbooks.io/bpi-m64/content/en/bpi-m64dcpowerinterface.html

This is a diagram of the DC Connector. I already soldered the DC Connector with a bigger barrel connector and used my 5v 2amp adaptor to power on the M64 and still its the same boot loop.

Did you remove the one which came with the board with your own DC connector? Triple check the soldering. I think you need to find someone else with a v1.2. Maybe @azrin1972 can give some input?

No I didnt remove the existing connector. I just soldered the cable and used it on a Female DC Connector. It powers the board fine but still bootloop. I am sure that my soldering is fine and also I am using the correct Power Adapter needed for this board. I hope there is nothing much from the Power side to boot mainline. This is the board BPI sent to me for testing and they didn't send a power supply knowing that the DC Connector is not a standard one :(

Thank You but I am sure its nothing to do with power. Even though I am using M64 with Power Adaptor from the DC Custom Barrel Connector.

but I am sure its nothing to do with power.

I hope @azrin1972 can tell us about his experience.
Ca you build and get the sunxi.dtb? Try to get one for 1080P, one for LCD 10" or 7".

Not now. As I dont have BPI LCD. The LCD I have is from Khadas and once they make their patch public for Linux Kernel then I will try to build the dtb with LCD Support.

Just build the file... for reference.

Ok please advice which One you want me to build?
BPI BSP ? I will follow this and this config

Please let me know if this is correct. I will do it at night.

BPI BSP.
In root type in shell:

./build.sh BPI-M64-720P
* choose 1

See other options.

I was planning to make arch package but the script is too complex for me to quickly make a package.

I will just follow the script and the step you mentioned. Thanks.

INSTALL include/asm (36 files)
make[1]: Leaving directory '/home/furkan/Desktop/Manjaro/Manjaro-PKG/M64/BPI-M64-bsp-4.4/linux-sunxi'
scripts/install_kernel_headers.sh: line 52: cpio: command not found
make: *** [Makefile:36: kernel] Error 127

Build success!

I am not sure this was build correctly. But there were some errors and warning.
The dtb are in /BPI-M64-bsp-4.4/linux-sunxi/arch/arm64/boot/dts/sunxi/ I am still confused on where did the script dumb the files. I will share sun50iw1p1-tulip-m64.dtb if this is the file you're looking for.

@avafinger Here is the dtb

The file is this one: out/tulip-m64/image/sunxi.dtb
The message says it all: cpio: command not found

You need a complete build!

I’ve tried this one with v1.2 and it detects my EMMC. this is the version that I’m using right now. But it cannot detect my I2C Azrin Aris

On Nov 3, 2019, at 9:37 PM, avafinger @.***> wrote: Hmm, ok. Not enough info from your log. Just for the curiosity, can you try this: https://github.com/avafinger/bpi-m64-firmware-v2 And report if it works? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

@azrin1972
I2c1 fix is here: https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.4

Hello Dear,
Ayufans Pine64 A64+ image works fine on my BPI-M64 Device.
Here is the link
I will share the uart log for this. Hope this will help us understand why my device wont boot with your mainline releases.

https://pastebin.com/1ZZZmiCb
here is the log for running anarsouls pin64a64+ arch linux.

Try this: https://github.com/avafinger/bananapi-m64-kodi/releases/tag/v1.5

Hope this will work.
Grab the log...

Flash the 5.2 and write this u-boot! before you try to boot.

can i just replace the uboot in 5.2 flash file with this one?

normally i rename the uboot with v1-2 and for this one i will rename v1-5 and change the uboot file name in the script so it will be completed in 1 script.

it should be ok right?

can i just replace the uboot in 5.2 flash file with this one?

yes

ok will try this in few hours.

Hello @avafinger
This one booted but starting kernel failed.

U-Boot SPL 2019.01 (Nov 07 2019 - 13:50:47 -0300)                                                             
DRAM: 2048 MiB                                                                                                
Trying to boot from MMC1                                                                                      
NOTICE:  BL31: v2.1(release):v2.1-817-gcf9319f                                                                
NOTICE:  BL31: Built : 20:06:28, Oct 14 2019                                                                  
NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC (1689)                                                      
NOTICE:  BL31: Found U-Boot DTB at 0x4080ac0, model: Pine64+                                                  
NOTICE:  BL31: PMIC: Detected AXP803 on RSB.                                                                  
                                                                                                              
                                                                                                              
U-Boot 2019.01 (Nov 07 2019 - 13:50:47 -0300) Allwinner Technology                                            
                                                                                                              
CPU:   Allwinner A64 (SUN50I)                                                                                 
Model: Pine64+                                                                                                
DRAM:  2 GiB                                                                                                  
MMC:   SUNXI SD/MMC: 0                                                                                        
Loading Environment from FAT... Unable to use mmc 0:1... In:    serial                                        
Out:   serial                                                                                                 
Err:   serial                                                                                                 
Net:   phy interface7                                                                                         
eth0: ethernet@1c30000                                                                                        
starting USB...                                                                                               
USB0:   USB EHCI 1.00                                                                                         
USB1:   USB OHCI 1.0                                                                                          
USB2:   USB EHCI 1.00                                                                                         
USB3:   USB OHCI 1.0                                                                                          
scanning bus 0 for devices... 1 USB Device(s) found                                                           
scanning bus 2 for devices... EHCI timed out on TD - token=0x80008c80                                         
2 USB Device(s) found                                                                                         
       scanning usb for storage devices... 0 Storage Device(s) found                                          
Hit any key to stop autoboot:  0                                                                              
switch to partitions #0, OK                                                                                   
mmc0 is current device                                                                                        
Scanning mmc 0:1...                                                                                           
Found U-Boot script /boot.scr                                                                                 
963 bytes read in 3 ms (313.5 KiB/s)                                                                          
## Executing script at 4fc00000                                                                               
11923464 bytes read in 547 ms (20.8 MiB/s)                                                                    
1105188 bytes read in 54 ms (19.5 MiB/s)                                                                      
27348 bytes read in 9 ms (2.9 MiB/s)                                                                          
## Flattened Device Tree blob at 4fa00000                                                                     
   Booting using the fdt blob at 0x4fa00000                                                                   
EHCI failed to shut down host controller.                                                                     
EHCI failed to shut down host controller.                                                                     
   Loading Ramdisk to 49ef2000, end 49fffd24 ... OK                                                           
   Loading Device Tree to 0000000049ee8000, end 0000000049ef1ad3 ... OK                                       
                                                                                                              
Starting kernel ...                            

The issue seems to be ARM trusted firmware.

I will give another shot with different BL31... cross your fingers.

ok let me know.. i am awake for sometime then off to bed.

Thanks for the support.