How can I build latest Linux kernel(not android branch) for hikey960

Hi @leo-yan Do you have any updates for us? Is USB working?

kernel branch 4.9 has working USB
And in my case it is working fine with usb to Ethernet adapter
wifi is also fine
I patched 4.9.0 kernel to latest 4.9.x version from linux repo and I don’t have any problem with my usb ethernet adapter

any update on ubuntu/debian release?

Can you elaborate a little more on how USB is working for you on 4.9? Which patch in particular adds the support for USB in 4.9 branch? Are you talking about the hikey960-v4.9 branch?

here is
hikey linux repo
‘’ https://github.com/96boards-hikey/linux

and use this branch “hikey960-v4.9”
‘’’ https://github.com/96boards-hikey/linux/tree/hikey960-v4.9

at least my usb 2.0 is working file
I just remember that you can’t use both USB 2.0 and USB 3.0 ports

I tried, unfortunately. not working.
Still don’t understand why.

if anyone tried https://github.com/96boards-hikey/linux/tree/hikey960-v4.9 and made the usb working.
Please tell me, I will try again and see what I have done wrong. Thanks.

@Robert Do you maybe have both usb type A and C connected at the same time? If so, remove the C and try again?

Hi vchong,

I only use a type A usb port. When I power the hikey960 board on,

reboot, info I got:

                      GNU GRUB  version 2.02~beta3

/----------------------------------------------------------------------------
|*CE Reference Platform (HiKey960 rpb-wayland) |
| Fastboot |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
----------------------------------------------------------------------------/

  Use the ^ and v keys to select which entry is highlighted.          
  Press enter to boot the selected OS, `e' to edit the commands       
  before booting or `c' for a command-line. ESC to return previous    
  menu.    

Loading driver at 0x000B7942000 EntryPoint=0x000B87B6440
Loading driver at 0x000B7942000 EntryPoint=0x000B87B6440
[ 0.287558] dmi: Firmware registration failed.
[ 0.350549] [USB3][hisi_dwc3_probe]+
[ 0.350644] [USB3][get_phy_param]eye diagram param: 0x1c466e3
[ 0.350649] [USB3][get_phy_param]eye diagram host param: 0x1c466e3
[ 0.350656] [USB3][get_phy_param]usb3_phy_cr_param: 0xb80
[ 0.350661] [USB3][get_phy_param]usb3_phy_host_cr_param: 0x980
[ 0.350667] [USB3][get_phy_param]usb3_phy_tx_vboost_lvl: 5
[ 0.350687] [USB3][get_resource]this is asic platform (fpga flag 0)
[ 0.350692] [USB3][create_attr_file]+
[ 0.350723] [USB3][create_attr_file]-
[ 0.350729] [USB3][hi3660_usb3phy_init]+
[ 0.376244] [USB3][config_femtophy_param]set hs phy param 0x1c466e3 for device
[ 0.376688] [USB3][config_femtophy_param]set ss phy rx equalization 0xb80
[ 0.377567] [USB3][config_femtophy_param]set ss RX_SCOPE_VDCC 0x1
[ 0.377573] [USB3][config_femtophy_param]set ss phy tx vboost lvl 0x5
[ 0.377579] [USB3][set_hisi_dwc3_power_flag]set hisi_dwc3_power_flag 1
[ 0.377584] [USB3][hi3660_usb3phy_init]-
[ 0.378105] dwc3 ff100000.dwc3: dwc3_host_init if otg, otg will do device_add.
[ 0.379460] [USB3][hisi_dwc3_wake_lock]usb otg wake lock
[ 0.379469] [USB3][hisi_dwc3_probe]init state: OFF
[ 0.379474] [USB3][hisi_usb_otg_event]hisi_usb_otg_event in:1
[ 0.379480] [USB3][hisi_usb_otg_event]hisi_usb_otg_event in otg:1
[ 0.379485] [USB3][hisi_usb_otg_event]event: 1
[ 0.379501] [USB3][event_work]+
[ 0.379509] [USB3][handle_event][handle_event] type: 1
[ 0.379544] [USB3][hisi_dwc3_wake_unlock]usb otg wake unlock
[ 0.379554] [USB3][handle_event]hisi usb status: DEVICE → OFF
[ 0.379562] [USB3][event_work]-
[ 0.379576] [USB3][hisi_dwc3_probe]-
[ 0.382460] hi3660_thermal fff30000.tsensor: failed to register thermal sensor0: -19
[ 0.382483] hi3660_thermal fff30000.tsensor: failed to register thermal sensor1: -19
[ 0.382502] hi3660_thermal fff30000.tsensor: failed to register thermal sensor2: -19
[ 0.382520] hi3660_thermal fff30000.tsensor: failed to register thermal sensor3: -19
[ 0.382556] hi3660_thermal fff30000.tsensor: failed to register thermal sensor5: -19
[ 0.400586] ufshcd-hi3660 ff3b0000.ufs: ufshcd_print_pwr_info:[RX, TX]: gear=[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0
[ 0.656552] ufshcd-hi3660 ff3b0000.ufs: ufshcd_print_pwr_info:[RX, TX]: gear=[3, 3], lane[2, 2], pwr[FAST MODE, FAST MODE], rate = 2
[ 0.674060] ufshcd-hi3660 ff3b0000.ufs: ufshcd_find_max_sup_active_icc_level: Regulator capability was not set, actvIccLevel=0
[ 1.567457] [E/hisi_pd] typec_wait_ps_change: typec_wait_ps_change!!!+++++++++++
[ 1.574873] [E/hisi_pd] typec_wait_ps_change: typec_wait_ps_change!!!-----------
[ 1.582277] [E/hisi_pd] typec_unattached_power_entry:!!!+++++++++++
[ 1.638501] [E/hisi_pd] tcpci_disable_vbus_control: !!!++++++++
[ 1.644425] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=0,+++
[ 1.650261] [E/hisi_pd] typec_unattached_power_entry:!!!-----------
[ 1.656535] [E/GPIO_HUB] gpio_hub_switch_to_hub: otg_switch_gpio is err
[ 1.663154] [E/GPIO_HUB] gpio_hub_change_typec_power: typec power gpio is err
[ 1.670294] [E/GPIO_HUB] gpio_hub_power_on: gpio hub hub vbus set err
[ 1.670298] [USB3][hisi_usb_otg_event]hisi_usb_otg_event in:1
[ 1.682488] [USB3][hisi_usb_otg_event]hisi_usb_otg_event in otg:1
[ 1.688585] [USB3][hisi_usb_otg_event]hisi_usb_otg_event in:2
[ 1.694334] [USB3][hisi_usb_otg_event]hisi_usb_otg_event in otg:2
[ 1.700430] [USB3][hisi_usb_otg_event]event: 2
[ 1.772735] [USB3][event_work]+
[ 1.775881] [USB3][handle_event][handle_event] type: 2
[ 1.781027] [USB3][set_vbus_power]set port power 1
[ 1.861182] [USB3][hisi_dwc3_wake_lock]usb otg wake lock
[ 1.866543] [USB3][handle_event]hisi usb_status: OFF → HOST
[ 1.884819] [USB3][event_work]-
[ 2.664961] EXT4-fs (sdd10): couldn’t mount as ext3 due to feature incompatibilities
[ 3.094877] Error: Driver ‘adv7511’ is already registered, aborting…
[ 3.120891] wlcore: ERROR could not get configuration binary ti-connectivity/wl18xx-conf.bin: -2
[ 3.143329] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[ 3.152614] Bluetooth: hci0: download firmware failed, retrying…
[ 3.283268] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[ 3.292554] Bluetooth: hci0: download firmware failed, retrying…
[ 3.427264] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[ 3.436554] Bluetooth: hci0: download firmware failed, retrying…
[ 3.570963] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[ 3.580269] Bluetooth: hci0: download firmware failed, retrying…

Reference-Platform-Build-Wayland 2.2+linaro hikey960 ttyAMA6

hi @xlazom00, could you please attach the config file you used for building your 4.9 kernel on hikey960-v4.9 branch? It would be helpful to compare and see if we’re missing any configs at our end.

hi, I think he is using this:

http://paste.ubuntu.com/24976454/

Trying the same, will update once I test it.

I tried The above config for 4.9 and USB/ethernet isn’t working for me.

Hi @Robert Are you sure @xlazom00 is using the below config ?[quote=“Robert, post:32, topic:2075”]
http://paste.ubuntu.com/24976454/
[/quote]

@vchong Is it possible for you to share the config file used for kernel 4.9 building which has USB/ethernet working?

this is my .config
http://paste.ubuntu.com/25361369/

try make menuconfig to disable stuff that you don’t need
maybe you will need this ddr frequency management patch
http://paste.ubuntu.com/25361370/
or you can disable it with make menuconfig

I was also able to apply linux patch-set for kernel 4.9.x for latest version

this should enable USB on hikey 960
CONFIG_PHY_HI6220_USB=y

Thank you for the response @xlazom00. I will test this configuration and get back here.
In the meanwhile, did you build and load the modules as well?