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

hisilicon poplar kernel source #39

Closed
mattgorski opened this issue Oct 16, 2016 · 70 comments
Closed

hisilicon poplar kernel source #39

mattgorski opened this issue Oct 16, 2016 · 70 comments

Comments

@mattgorski
Copy link

Could someone here please let me know where to find the kernel source and if possible the vendor binaries and device tree for the new TV platform 96 board linaro hisilicon poplar? Thank you in advance. I'm excited to get my current Android TV builds ported to the poplar.

@fixxxxxxer
Copy link
Collaborator

fixxxxxxer commented Oct 18, 2016

@mattgorski

You can run an image that is already in flash.

We will be pushing out a Poplar Github landing page by the end of the week, until then I would suggest utilizing the resources available by Tocoding:

http://en.tocoding.com/index.php/96boards-poplar/

I will leave this issue open in the mean time.

Thanks!

@mattgorski
Copy link
Author

mattgorski commented Oct 18, 2016

Okay great! Thank you for the reply Robert. I guess we will have to use a
prebuilt kernel for the time being which is not a problem. I can start
work on an AOSP TV device tree and share when ready. I look forward to the
landing page and future updates!

@mattgorski
Copy link
Author

Any updates on the landing page? I didnt see anything up yet for poplar. If there is anything I can do to help please let me know...

@fixxxxxxer
Copy link
Collaborator

@mattgorski

Right now I am still waiting on some key players to begin their contributions to the landing page.

I will do my best to get as much core information up to the 96Boards github this week.

In the mean time, you can find the Poplar repository under my personal github:

www.github.com/sdrobertw/Poplar

Sorry for the inconvenience, I expect things to be coming together soon.

@mattgorski
Copy link
Author

Thank you for the informative response Robert! I apprciate the update and github link.

@mattgorski
Copy link
Author

I've created my own github page for poplar dedicated to Android TV builds. I just got my board in so ill be testing some builds tonight, not even sure if the device tree or vendor blobs/binaries are correct but it's a work inprogress :)

https://github.com/96Boards-AndroidTV

@mattgorski
Copy link
Author

Just a quick question. How do we enter fastboot mode on the poplar the manual isnt too clear? I can understand all jumpers off is default emmc...

The 96Boards Poplar board allows system to boot from the SPI flash, NAND flash, fSD,
eMMC, or SPI NAND flash. Jumper J21 BOOTSEL0, Jumper J20 BOOTSEL1, and Jumper
J19 BOOTSEL2 work together to select the boot mode.

The value of BOOTSEL2, BOOTSEL1, or BOOTSEL0 is as follows:
BOOTSEL2: BOOTSEL1: BOOTSEL0 Boot Mode
000 boot from the SPI NOR flash
001 boot from the NAND flash
Copyright©Tocoding Technologies Co., Ltd. 2011-2016 All rights reserved. 8
010 boot from the fSD
011 boot from the eMMC
100 boot from the SPI NAND flash
other reserved
The value of jumpers is as follows:
J21 CLOSED BOOTSEL2 will be set 0
OPEN(default) BOOTSEL2 will be set 1(default)
J20 CLOSED BOOTSEL1 will be set 0
OPEN(default) BOOTSEL1 will be set 1(default)
J19 CLOSED BOOTSEL0 will be set 1
OPEN(default) BOOTSEL0 will be set 0(default)

@fixxxxxxer
Copy link
Collaborator

@kuscsik

Can you help with this please?

@mattgorski
Copy link
Author

There does seem to be an S1 recovery button but when held down during power does nothing to enter fastboot. Thanks for any pointers 96 team...

@mattgorski
Copy link
Author

Okay I sucessfully got fastboot in bootloader now buy ctrl+c immmediatly at boot but now how to enter fastboot? From my experience the command fastboot enters fastboot usb protocol. Does tocoding use an imx type usb tool for uart flashing? I've been in contact with support and I am awaiting a response on the proceedure.

Here is the correct minicom settings:

sudo minicom -b 115200 -o -D /dev/ttyUSB0

ctrl+A the Z then O select serial port settings.

Software flow: ON
Hardware flow: OFF

One other side note I wasnt aware that they are only selling 1GB RAM version on Ali. Hopfully they will stock the 2GB version also because 1GB isnt very adequate. Might want to change the specs on 96 boards poplar page.

"DRAM DDR3/3L/4 SDRAM interface, maximum 32-bit data width 2 GB on board"

@mattgorski
Copy link
Author

Still have not heard a thing from tocoding on how to flash thru UART. I'd love to try some of my custom builds or even a repacked system image but no idea how to reflash in fastboot. My poor poplar is just collecting dust now...

@fixxxxxxer
Copy link
Collaborator

@mattgorski I am very sorry, I am really trying to find someone to help with this. Unfortunately I do not own a Poplar nor do I have an experience with it.

I have been hunting down people who can help since this issue started.

Sorry for the inconvenience.

-Robert W.

@afaerber
Copy link

In addition to lack of documentation of the current state, is there any "proper" bootloader in the works by Linaro, such as Tianocore or U-Boot? It's disappointing to see Poplar regress compared to HiKey.

@kuscsik
Copy link

kuscsik commented Nov 17, 2016

Hi @mattgorski,

to enter fastboot you need to hit Ctrl-c on the serial line during the first seconds of the boot.
You can download the images over TFTP after setting the network parameters:

   setenv serverip xxx.xxx.xxx.xxx
    setenv ipaddr xxx.xxx.xxx.xxx
    setenv gatewayip xxx.xxx.xxx.xxx
    setenv ethaddr 00:xx:xx:xx:xx:xx
    setenv netmask 255.255.xxx.0

To download the boot image:


        mw.b 1000000 ff 80000                       //Write 0xff to 0x1000000. 0x80000 space is used.
        tftp 1000000 fastboot-burn.bin              //Download fastboot-burn.bin to 0x1000000.
        nand erase 0 100000                         //Erase the 0x100000 flash space after the 0x0 address.
        nand write 1000000 0 80000                  //Write fastboot-burn.bin (starting from 0x1000000 with the size of 0x80000) to 0x0 of the NAND flash.

To download the Linux image:

        mw.b 1000000 ff 400000
        tftp 1000000 hi_kernel.bin
        nand erase 100000 400000
        nand write 1000000 100000 400000

File system image:

        mw.b 1000000 ff 6000000
        tftp 1000000 rootfs.yaffs
        nand erase 500000 6000000
        nand write.yaffs 1000000 500000 $(filesize)     //Write rootfs.yaffs (starting from 0x1000000 with the size of $(filesize)) to 0x500000 of the NAND flash.

Kernel Source is still not available for the board, we are trying to speed up the process so it gets released ASAP.

@fixxxxxxer
Copy link
Collaborator

@mattgorski did this help? I would like to close this issue until more Poplar information is available.

Please get back to me.

Thank you.

Robert Wolff - www.96board.org/openhours
robert.wolff@linaro.org

@afaerber
Copy link

@sdrobertw The title says "kernel source" - and without sources we have no hi_kernel.bin to flash. Nor does it tell us how a Linux arch/arm64/boot/Image relates to this hi_kernel.bin.

FTR playing with the above instructions shows that "Fastboot 3.3.0" is in fact a U-Boot fork (whose sources will be needed, too), unrelated to Android's fastboot protocol/tool.

To speed up the process of getting all those sources, have you considered taking down the "Buy Poplar Board" link from 96boards.org until the products sold comply with the GPL? You don't show any on the Latest Boards and Enterprise Edition overview pages, but on the Poplar product page there is one. Isn't release of schematics and sources a compliance criteria for your specification?

@mattgorski
Copy link
Author

Great to see all the detailed responses. I really have had no time to do any custom flashes yet, will be much easier when we have the kernel source and vendor binaries. One thing that is disappointing to see on the poplar is the deinterlacing with Mali. Almost unusable as an Android TV device due to this. I really hope this is fixable with some codec configs and upgraded mali gl binaries.

@fixxxxxxer
Copy link
Collaborator

@afaerber : The current status on Poplar source is out of our hands, though we do have control over the website and your recommendations make a lot of sense, it is a very legitimate observation, one that I will surely pass up the line asap. Thank you very much for your contribution to this thread, once again I am very sorry for the inconvenience.

@mattgorski : I am going to keep this issue active, we appreciate your contributions and hope to help get these issues resolved asap. We will continue to push for answers and provide them to you as we become informed.

Thanks,

R.W.

@mattgorski
Copy link
Author

mattgorski commented Nov 29, 2016

Thanks again for everything @sdrobertw and all who contributed to this issue (a big thanks to @kuscsik for the tftp flash instructions), I am sure we have gotten the wheels rolling faster with more interest.

I will make some time to try the device tree with prebuilt kernel I made awhile back (https://github.com/96Boards-AndroidTV). At least we can get some testing done on some modified system images repacked and built with tv permissions in mind not tablet ;)

@mattgorski
Copy link
Author

mattgorski commented Dec 9, 2016

@kuscsik would it be possible to get the u-boot includes/config for poplar so we can implement the android fastboot sparse image format so we can use the USB OTG interface for flashing images? I've implemented fastboot on a couple non Android devices so I can lend a hand...

EDIT: Actually can OTG ADB/Fastboot even be used on poplar? It uses the front otg port with the FTDI USB converter not the standard OTG usb port. Might be able to use a standard USB port with a male-to-male USB cable...

@mattgorski
Copy link
Author

mattgorski commented Dec 9, 2016

I am attempting to flash a new system image today and I noticed in the tftp instructions that the rootfs you are flashing is yaffs (android 4.x) yet the tocoding flash package has a system.ext4 which i am also building for. So do i convert to yaffs or substitute ext4 for yaffs? Kinda confused again here I just wish we could fastboot flash and be done..

TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
TARGET_USERIMAGES_USE_EXT4 := true

        mw.b 1000000 ff 6000000
        tftp 1000000 system.ext4
        nand erase 500000 6000000
        nand write.ext4 1000000 500000 $(filesize)     //Write system.ext4 (starting from 0x1000000 with the size of $(filesize)) to 0x500000 of the NAND flash.

Guess the ol poplar goes back into hiding again until we can flash a system.img :(

@mattgorski
Copy link
Author

mattgorski commented Dec 9, 2016

Okay different approach. @kuscsik What is the hex offset for recovery flashing?

I'll just get a TWRP recovery built and we can bypass the uboot/fastboot until we can build a proper android u-boot.

One other thing is the flash package comes with an xml config for flashing so how do we implement this? Nvidia uses a similar protocol with the nvflash APX recovery. There must be a hidden function we are unaware of....

example:

./nvflash --bct flash_pm358_792.cfg --setbct --configfile Hi3798CV200-emmc.xml --dtbfile golfish.dtb --create --bl u-boot.bin --odmdata 0x6209C000 --go

Hi3798CV200-emmc.xml

<?xml version="1.0" encoding="GB2312" ?> <Partition_Info> <Part Sel="1" PartitionName="fastboot" FlashType="emmc" FileSystem="none" Start="0" Length="1M" SelectFile="fastboot.bin"/> <Part Sel="1" PartitionName="bootargs" FlashType="emmc" FileSystem="none" Start="1M" Length="1M" SelectFile="bootargs.bin"/> <Part Sel="1" PartitionName="recovery" FlashType="emmc" FileSystem="none" Start="2M" Length="10M" SelectFile="recovery.img"/> <Part Sel="0" PartitionName="deviceinfo" FlashType="emmc" FileSystem="none" Start="12M" Length="2M" SelectFile=""/> <Part Sel="1" PartitionName="baseparam" FlashType="emmc" FileSystem="none" Start="14M" Length="8M" SelectFile="baseparam.img"/> <Part Sel="1" PartitionName="pqparam" FlashType="emmc" FileSystem="none" Start="22M" Length="8M" SelectFile="pq_param.bin"/> <Part Sel="1" PartitionName="logo" FlashType="emmc" FileSystem="none" Start="30M" Length="20M" SelectFile="logo.img"/> <Part Sel="0" PartitionName="logobak" FlashType="emmc" FileSystem="none" Start="50M" Length="20M" SelectFile=""/> <Part Sel="0" PartitionName="fastplay" FlashType="emmc" FileSystem="none" Start="70M" Length="40M" SelectFile=""/> <Part Sel="0" PartitionName="fastplaybak" FlashType="emmc" FileSystem="none" Start="110M" Length="40M" SelectFile=""/> <Part Sel="1" PartitionName="kernel" FlashType="emmc" FileSystem="none" Start="150M" Length="40M" SelectFile="kernel.img"/> <Part Sel="0" PartitionName="misc" FlashType="emmc" FileSystem="none" Start="190M" Length="20M" SelectFile=""/> <Part Sel="1" PartitionName="qbboot" FlashType="emmc" FileSystem="none" Start="210M" Length="1M" SelectFile="qbboot.bin"/> <Part Sel="1" PartitionName="qbdata" FlashType="emmc" FileSystem="none" Start="211M" Length="300M" SelectFile=""/> <Part Sel="1" PartitionName="trustedcore" FlashType="emmc" FileSystem="none" Start="511M" Length="40M" SelectFile="trustedcore.img"/> <Part Sel="1" PartitionName="system" FlashType="emmc" FileSystem="ext3/4" Start="551M" Length="800M" SelectFile="system.ext4"/> <Part Sel="1" PartitionName="cache" FlashType="emmc" FileSystem="ext3/4" Start="1351M" Length="800M" SelectFile="cache.ext4"/> <Part Sel="1" PartitionName="userdata" FlashType="emmc" FileSystem="ext3/4" Start="2151M" Length="-" SelectFile="userdata.ext4"/> </Partition_Info>

@mattgorski
Copy link
Author

mattgorski commented Dec 9, 2016

Not getting the tftp to work. I have followed the basic tftp guide here setting server ip:

http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot

And get this error:

fastboot# tftp 1000000 system.ext4
ETH0: PHY(phyaddr=255, mii) not link!
ETH1: PHY(phyaddr=3, rgmii) not link!
higmac init fail!

I must not have my network params correct.

ipaddr=192.168.1.10 - poplar ip addess set in u-boot/fastboot
netmask=255.255.255.0 - mask
serverip=192.168.1.109 - tftp server ip
ethaddr=00:16:8e:62:66:xx - mac of poplar

Tried multiple settings.... i know my tftp server is running. Is there any other way to flash??? This mysterious Hi3798CV200-emmc.xml was definitely made to be the easy way to flash but WHERE ARE THE INSTRUCTIONS???

@Graphicscore
Copy link

Any news on this ? Will we be able to compile AOSP 7.0 for the Poplar aswell ? I'm interested in this board but only if I can compile up to date android versions for it.

@mattgorski
Copy link
Author

mattgorski commented Dec 19, 2016

Looks like we will have sources at least after next week. For 6.0/7.0/7.1 we will have to wait and see how caught up to mainline google the kernel is for selinux and such. Here is the latest word from tocoding as of this morning:

Issue pertaining to no fastboot instructions in flash package:
http://en.tocoding.com/index.php/96boards-poplar/
https://app.box.com/s/kxsqbp6qq067y9aifnrzgcbo042xr1qc

Hisilicon was working on this issue, you will get the source after next week, the package will provide a tool what you can flash in fastboot. Thanks for your understanding.

@mattgorski
Copy link
Author

Just got the word from tocoding that they have released the sources to Linaro 2 weeks ago. So any update on the sources guys :)

@lecotex
Copy link

lecotex commented Feb 28, 2017

FYI, I just got answer on my 2 months old request regarding creation of Poplar subforum on Linaro's 96Borad. Not as speedy as needed, but anyway ...

Also I finally finished firmware for 3716cv100 so I'm moving to Poplar.
If I find something usefull, I drop msg.

@tonyho
Copy link

tonyho commented Apr 27, 2017

It's near the end of the April 2017, Is the AOSP released now? Any one knows?

If the sources/resources are released, I want to buy some Polar boards.

@lecotex

@mattgorski
Copy link
Author

I would love to know myself if anyone has even built an android build and if so how did they even flash with no flash tools.... Been over 6 months and this board has zero love.

@Stephen-Neal
Copy link

Any news on the 25th Feb posting? It's now gone past the end of April.

@tonyho
Copy link

tonyho commented May 3, 2017

From the Status of Android “AOSP” TV – BUD17-118 presentation at Linaro Connect BUD17: http://connect.linaro.org/resource/bud17/bud17-118/ , it seems that "migrate to 96Boards " is the last item of the Next 6 month plan (See the PPT, Page 8).

Also, here, hikey appears, no polar. I guess maybe resources wouldn't be released in near future.?

Below is the page 8 from PPT:

AOSP TV Project -Tasks Planned : Next 6 Months
Secure media playback with Widevine / Playready DRM
○ Integrating OPTEE with Android N, Kernel 4.9.
○ Secure buffer allocation : Pass the xtest sdp_perf testing
○ Handling ION buffer descriptor
○ Widevine validation with device key. (May 2017)
○ Implement and support Playready DRM playback.
TVIF (initial development on Hikey)
○ Identify USB Antenna or USB Video-In module with open Linux drivers
support and implement TVIF service and HALs.
Create LHG M-LCR for AOSP TV (Begin releases from May 2017)
Migrate to Android O
Migrate to 96boards TV platform

@afaerber
Copy link

afaerber commented May 8, 2017

Initial U-Boot patches have arrived on u-boot mailing list on Thursday, along with a README for flashing.

@sbambrough
Copy link

Hello all,

For several months now, Linaro has been working together with HiSilicon to provide the community with access to source code for the Poplar board. This week an initial drop of source code for the Poplar board, along with flashing tools and some documentation will be made available on GitHub.

The initial code drop will include source for ARM Trusted Firmware, U-Boot, and a 4.11 based upstream kernel along with documentation on how to build the software and tools to flash it to the Poplar board.

This release of source code, tools and documentation provides:

  • The ability to boot in 64-bit mode.
  • Console functionality via the micro USB port.
  • Network via ethernet.
  • All cores enabled.
  • USB device support (disk & network adapter)
  • The ability to flash the board via USB flash drive.
  • Documentation

This drop of source code is just a start. This code allows us to boot to a console using the source code and tools provided. We have begun to upstream this source and will continue to add features and update the repositories on a more regular basis. The team's goal is to release source as functionality is completed, tested and passes an internal IP review.

There is still more more to do with the bootloaders and partitioning of the eMMC which we will work on over the next couple of months. Kernel features due for release in the next month are HDMI support, and keyboard/mouse support.

We are also planning to provide a branch in the kernel tree that will be based on the Android 4.9 common kernel. This won’t be upstream based, but will be more feature complete than our mainline branch. This will be used to support AOSP running on the Poplar board.

As we push topics and changes to the GitHub repositories, we will post a message to the forums to update people here. I will provide another update on our overall progress and plans in early June.

Scott Bambrough
Technical Director, Linaro Services Group

@sbambrough sbambrough reopened this May 8, 2017
@mattgorski
Copy link
Author

mattgorski commented May 9, 2017 via email

@afaerber
Copy link

afaerber commented May 9, 2017

Matt, he said "will be", not "has been". (which I see you've edited in the meantime)

@mattgorski
Copy link
Author

I would guess the source will eventually pop here with a manifest ;) Can't wait for the next update.

The u-boot commit can be found here: https://www.mail-archive.com/u-boot@lists.denx.de/msg247981.html

@sbambrough
Copy link

sbambrough commented May 9, 2017 via email

@gvalante
Copy link

Hello all,

The initial source code drop for the Poplar board is now available on GitHub.com/Linaro.

This drop includes source for ARM Trusted Firmware, U-Boot, and a 4.11 based upstream kernel along with documentation on how to build the software and tools to flash it to the Poplar board.

This release of source code, tools and documentation provides:

  • The ability to boot in 64-bit mode.
  • Console functionality via the micro USB port.
  • Network via ethernet.
  • All cores enabled.
  • The ability to flash the board via USB flash drive.
  • Documentation

To start, please review the README for pointers to the instructions for downloading. ( https://github.com/Linaro/poplar-tools/blob/latest/README ).

This public drop is the first of many and the team plans on providing updates as we receive feedback and functionality becomes available. For follow-on drop announcements, questions or to provide feedback, see the 96Boards Poplar forum. Bugs can also be submitted at the soon to be available bugs.96boards.org (Product: Poplar).

Thanks;

Glen Valante
Program Manager, Linaro Services Group

@afaerber
Copy link

Has anyone tried this yet? On my board there is neither a scriptaddr environment variable defined nor is there a source command available to run the install.scr script...

@ldts
Copy link

ldts commented May 25, 2017

can you make it to the u-boot shell?

@afaerber
Copy link

afaerber commented May 25, 2017

Yes, I can make it to the first mmc write command in the install.scr script by using 0x01000000 in place of ${scriptaddr} and manually copying commands. It seems to expect the device number (0) instead of the address.

@ldts
Copy link

ldts commented May 25, 2017

@afaerber does your uboot shell gives you a #poplar prompt or are you booting in the old #fastboot? I suspect you might not be booting into the new uboot. Could you confirm that you are following this README please ? https://github.com/ldts/poplar-u-boot/blob/upstream/board/hisilicon/poplar/README

@afaerber
Copy link

Confirming that by inserting the missing 0 flashing worked, and it boots, too.

For anyone lazy, I've packaged my bootloader binaries here: https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:Poplar
U-Boot is openSUSE's v2017.05 plus the v4 Poplar patchset.

In order to use an openSUSE .tbz rootfs instead of Debian .tar.gz I had to patch the shell script, and I also noticed a bug in the cleanup patch that I'll send a pull for.

@ldts
Copy link

ldts commented May 25, 2017

yep that contains more detail; I was just concerned that you might not be using the new uboot since scriptaddr is already set to 0x32000000.

@afaerber
Copy link

The newly built and flashed U-Boot has a poplar# prompt, scriptaddr=0x32000000, a source command and an mmc write command with only three parameters: mmc write addr blk# cnt

The original Poplar U-Boot, from which I and others here need to install the new U-Boot, has fastboot#, no scriptaddr variable, no source command, and an mmc write command with four parameters: mmc write <device num> addr blk# cnt

I.e., the documented installation steps and the generated install.scr might work on the new U-Boot, but they are unsuited for users updating from the originally shipping U-Boot.

@ldts
Copy link

ldts commented May 25, 2017

@afaerber

yes to upgrade from the original poplar u-boot the easiest way is to write the new one in a USB stick and boot from it (I tried to document that in the u-boot README).

Also you should get this change below:
https://github.com/ldts/poplar-u-boot/blob/upstream/board/hisilicon/poplar/poplar.c#L57

It carves the memory needed by ATF (PSCI).

I'll submit it in v5.

@afaerber
Copy link

With Jorge's help we've figured out that the documentation misses to mention that one should press the USB_BOOT button (S3) on power up, so that it uses the new instead of the old U-Boot.

@gvalante
Copy link

Hello;
I was trying the same thing and knew about the button, but didn't see it in the directions. Fixing it now.

Thanks,

@ldts
Copy link

ldts commented May 25, 2017

@gvalante I pinged Robert in IRC about it as well.

@afaerber
Copy link

@sdrobertw Given Glen's announcement and the fixed poplar-tools build instructions, I think you can close this issue now.

@fixxxxxxer
Copy link
Collaborator

Thanks, @afaerber

I will close the issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests