Jump to content

Trying to boot NanoPi-K2


martinayotte

Recommended Posts

Ah ok, libretech-cc is Le Potato, S905X, I think you need to use gxb-200  gxb_p201_v1 to start, and probably look at friendlyArm's code to see if their config can just be moved over and adjusted.  Let me take a quick look around.

 

[edit]

 

Can anyone attest to the FriendlyArm Elec u-boot having or not having proper EXT4 support?  if it can handle the EXT4, then just use their repo https://github.com/friendlyarm/u-boot/tree/nanopi-k2-v2015.01

 

Commit where they added the board

 

[edit 2]

 

Try this and show me where it fails.  If it doesn't fail I'm buying lottery tickets.  Also remember you need a boot script with the right device tree, I'm sure meson_gxbb_p201.dtb in mainline would work.

 

u-boot-k2.tar.gz

Link to comment
Share on other sites

For my image write to SD, try to use this option. File u-boot.bin is generally used to write to eMMC, to record on the SD card need u-boot.bin.sd.bin

 

dd if=u-boot.bin.sd.bin of=your_SD  conv=fsync bs=1 count=442

dd if=u-boot.bin.sd.bin of=yor_SD conv=fsync bs=512 skip=1 seek=1

Link to comment
Share on other sites

I've also tried balbes today's image, fused the newly compiled u-boot, tweak image/ramdisk to match its filenames accordingly, booted but still stop at "starting kernel" ...

 

(I will take a break now, since I'm pulling too many of my hairs)

Link to comment
Share on other sites

Check out what dtb use. Usually when this message cause stay in the not correct dtb file. You need to try all the files from the image with the name gxbb*. Yet there may be no output to the console UART, if you use the script s905_autoscript with no proper setting on the console at the command prompt. For the core 4.x need ttyAML0 for kernel 3.14 - ttyS0.

Link to comment
Share on other sites

Thanks @balbes150 for the hint !

It was really using the ttyS0 instead of the ttyAML0 ...

At the prompt of this u-boot compiled with https://github.com/friendlyarm/u-boot/tree/nanopi-k2-v2015.01  , I've manually changed it and see that it booted further.

I've than noticed that the kernel didn't succeeded to mount the ROOTFS, so I've added "rootwait rootfstype=ext4" to my manual command.

For a permanent change of ttyAML0, I've done it in board/amlogic/configs/nanopi-k2.h, but it seems to be overwritten and keep getting back to ttyS0, although a "strings fip/u-boot.bin.sd.bin" reveal that my change is actually present.

Any hints ?

Also, is that u-boot is the same as Mainline where it should execute a boot.scr ? I'm not seeing any on the current image.

 

Link to comment
Share on other sites

For the sake of completeness, here is the u-boot SD bin to try.  If we're going to start supporting Amlogic boards, we're going to have to figure out how to group them bootloader wise, right now it's anarchy.  Since Armbian uses EXT4 and bootscripts, and none of the vendor images do, it makes U-boot that much bigger of an issue.

 

u-boot.bin.sd.tar.gz

 

This image (if it works) expects /boot/boot.scr to exist and tell it about the bootargs, the dtb, etc just like the "le potato" image I linked earlier.  It also expects an EXT4 filesystem.

 

I had to use rootwait as well, and between 3.x and 4.x the SD/EMMC numbers switched in the kernel, so the boot parameters had to be adjusted accordingly.

Link to comment
Share on other sites

@TonyMac32 , I will try you u-boot tomorrow and find what are behaviour differences ...

Initially, I wished to have Armbian nanopi-k2.wip working as I did few months ago for OPiPC2 with the help of André and Zador with their patches for FIT/ATF, but the AmLogic u-boot looks really different ... Is FIP almost equivalent to FIT ?

So, I doubt I will be able to automate nanopi-k2.wip builds soon, since I even have to manually issued u-boot command, but at least I've got this kernel booted ...

 

Link to comment
Share on other sites

Cool, let me know.  I didn't really do anything different with the blob you have than is in the one for "Le Potato", so honestly, with all the device numbers/dtb's/ and boot scripts sorted out it should be possible once the first couple hurdles are cleared.

 

Now, I haven't spent much time with it, however the Odroid-C2 is more or less the same basic board.  By swapping out the "bl" files you should be able to do a mainline build with it. (hypothetical on my part, but I'd be surprised if it wasn't being worked on already)

 

 

Link to comment
Share on other sites

17 hours ago, martinayotte said:

For a permanent change of ttyAML0, I've done it in board/amlogic/configs/nanopi-k2.h, but it seems to be overwritten and keep getting back to ttyS0, although a "strings fip/u-boot.bin.sd.bin" reveal that my change is actually present.

Any hints ?

Answering to myself : stupid me ! the u-boot default args are overwritten by "saved" args, so I've done them manually again but I had to "saveenv" to keep them ...

Link to comment
Share on other sites

17 hours ago, TonyMac32 said:

This image (if it works) expects /boot/boot.scr to exist and tell it about the bootargs, the dtb, etc just like the "le potato" image I linked earlier.  It also expects an EXT4 filesystem.

 

@TonyMac32 This one is working too, after creating a boot.scr.

The only strange thing I seen is that "saveenv" isn't working, but it is not a big issue, since boot.scr is doing all the things.

gxb_p201_v1#saveenv
Saving Environment to aml-storage...
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
emmc/sd response timeout, cmd1, status=0x3ff2800
MMC init failed

 

Link to comment
Share on other sites

Cool.  I did not change anything else besides adding the script to see if it would work.  I will have a K2 on the way shortly so we can possibly sort this out more cleanly.  Now, to understand why the S905 likes the SD image blob and the S905X will work from the eMMC blob...

Link to comment
Share on other sites

I wished to have the AP6212 WiFi working on my NanoPi-K2 !

BTW, it is a AP6212 Non-A ...

So, at first it didn't work. After investigation and few tries, I figured out that a another firmware was needed :

 

as discuss by Hans back in June https://patchwork.kernel.org/patch/9791523/

 

http://jwrdegoede.danny.cz/brcm-firmware/brcmfmac43430a0-sdio.bin.7.10.1.244.ucode940.1020

 to be rename as brcmfmac43430a0-sdio.bin

http://jwrdegoede.danny.cz/brcm-firmware/brcmfmac43430a0-sdio.txt.jumper-ezpad-mini3

 to be rename as brcmfmac43430a0-sdio.txt

 

Hans patch is already merged in 4.13...

 

Link to comment
Share on other sites

On 22.8.2017 at 4:46 PM, martinayotte said:

(It will return in the drawer to collect dust :angry:)

It is fun to look back how the community didn't let you to give up. And now you have a running SBC more to play with :D and not even Allwinner

Link to comment
Share on other sites

8 hours ago, martinayotte said:

 

And the question is: BroadPwn fixed or not?

 

Are you able to play with the files from http://kaiser-edv.de/tmp/NumpU4/brcmfmac43430-sdio-broadpwn-fix.tar with your AP6212 rev0 and report back?

Link to comment
Share on other sites

Unfortunately, the http://kaiser-edv.de/tmp/NumpU4/brcmfmac43430-sdio-broadpwn-fix.tar files don't seems to work.

 

I'm getting timeout and refuse to register its interface :

[   15.660083] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430a0-sdio.bin for chip 0x00a9a6(43430) rev 0x000000
[   16.840982] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[   17.868309] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[   18.872331] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

Replacing back the old A0 firmware files, and it works again :

[    7.900828] brcmfmac: F1 signature read @0x18000000=0x1530a9a6
[    7.903201] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430a0-sdio.bin for chip 0x00a9a6(43430) rev 0x000000
[    7.903368] usbcore: registered new interface driver brcmfmac
[    8.180503] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Jul  1 2016 18:02:40 version 7.10.1 (A0 Station/P2P feature) FWID 01-bae8afee

 

Link to comment
Share on other sites

Followed Balbes150's advice using u-boot.bin.sd.bin for my blob source, and switched the dd commands.  @martinayotte you should be able to build a booting Armbian right from the build script.  I've also added the K2 to the u-boot repo I'm keeping.  

 

So far Mainline (4.14) isn't giving me an HDMI display for the K2 I'll check my kernel config.  3.14 has "static", I assume this has to do with not shutting off the other framebuffer and I'll work with that later, as well as build a 4.13 "next" image. (More heavily patched).  

 

Very much WIP

 

[edit]  The Mainline device tree for the K2 is very skeletal, we just need to flesh out the things we know, drivers exist for the hardware already.

 

[edit] Added HDMI to nanopi-k2 dts, also seeing static like on 3.14, however functional desktop otherwise.

Link to comment
Share on other sites

UPDATE

 

Mainline NanoPi K2 desktop is for show only.  It kernel panics at the earliest opportunity after reaching desktop.  I haven't pulled logs yet, just wanted to make sure you knew what you were in for if you built a "next" or "dev" image with desktop environment. Fixed via the ATF fix brought to our attention by @Neil Armstrong.  This apparently affects GXL and  GX built with newer u-boot builds from Amlogic.

Link to comment
Share on other sites

[UPDATE]

 

Turns out the NanoPi K2 was also affected by the Amlogic ATF allocation issue, I patched the device tree to rectify the issue.  Not well tested, but I could kill it in a matter of seconds before, it does not fail under any memory-intensive test I could throw at it quickly.

Link to comment
Share on other sites

Hey I don't follow Armbian threads much as once my boards are up I tend to leave them. Does the user still need help getting the latest S905XX build to load? I've been running it for a few days.

 

Please let me know so I can give you an updated patch. I'd love to see armbian images for this device tho.

Link to comment
Share on other sites

2 minutes ago, TonyMac32 said:

Hi @kicker22004, if you have the Armbian build system set up, you can build a 4.14 desktop image and try it out.  I currently don't have the wifi up and running, this hasn't been my priority board. At this point really it's just board support for peripherals and testing.

 

No I don't have a build box going i'm just using this image. Armbian_5.34_S9xxx_Ubuntu_xenial_3.14.29_server_20171104.img. Do you have a newer image available to work with?

Link to comment
Share on other sites

2 minutes ago, kicker22004 said:

Armbian_5.34_S9xxx_Ubuntu_xenial_3.14.29_server_20171104.img

That will be a Balbes150 Image, for the ones I work with see https://www.armbian.com/nanopi-k2/, however, the current WIP is not yet a nightly image.  With the new kernel 4.14 NEXT images you'll have something to look at.  The currently available 4.13 image has a RAM bug involving the location of the ARM trusted Firmware.

 

Link to comment
Share on other sites

K2 images built with kernel 4.14, test away:

 

https://dl.armbian.com/nanopik2/archive/

 

Build includes the workaround for the memory allocation issue that would crash the system previously.

 

WiFi is not yet working out of the box, it should be as simple as adding the firmware.    It works, @martinayotte

Edited by TonyMac32
Wifi Works!
Link to comment
Share on other sites

On 12.12.2017 at 7:06 PM, TonyMac32 said:

K2 images built with kernel 4.14, test away:

 

https://dl.armbian.com/nanopik2/archive/

 

Build includes the workaround for the memory allocation issue that would crash the system previously.

 

WiFi is not yet working out of the box, it should be as simple as adding the firmware.    It works, @martinayotte

 

Hi. Thanks for link.  Mounted this image. Wi-Fi and ethernet works fine. But bluetooth not working and I can't apply language settings, it loaded but not activated on reboot. 

Link to comment
Share on other sites

To be honest WiFi working was "magic", I didn't do anything to accomplish that, I'm assuming the Bluetooth is either DT entry missing/incorrect or firmware.  

 

For language settings I'm afraid I'm useless.

 

I'm "out of office" until sometime during the first week of January, so I'm afraid I'll not be able to look into anything in the meantime.

Link to comment
Share on other sites

Аnyone knows, where is 2GB of RAM on K2 with Armbian_5.37_Nanopik2_Ubuntu_xenial_next_4.14.5_desktop images ??:o Device is very slow !

MB values 

aev@nanopik2:~$ free -m

                      total        used        free      shared  buff/cache   available
Memory:         844         552          75          43         215         154
Swap:             422         204         217
 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines