4.19.5 kernel based Debian snapshot image release for HiKey960

How can I produce a new img file? I use make_ext4fs but there is problem. can’t set android permissions.

Use, img2simg for repacking the raw image into Android sparse image format:

$ img2simg image.raw rootfs-linaro-stretch-developer-hikey-20191020-39.img

Hello @Mani,

Are they applicable for HiKey960 also ?

When I try them on Ubuntu-16.04 + gcc-4.9(aarch64-linux-android-gcc), I get the below (my signature) error, after exporting ARCH and CROSS_COMPILE.

Is there a certain gcc version recommended here or which is better older or newer ?

Thanks,
Rajagopal

*rajagopal@ubuntu-rajagopal:~/Workspace/hikey960/upstream-rebase/linux$ make defconfig distro.config
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on ‘defconfig’

configuration written to .config

scripts/kconfig/Makefile:117: *** No configuration exists for this target on this architecture. Stop.
Makefile:547: recipe for target ‘distro.config’ failed
make[1]: *** [distro.config] Error 2
Makefile:526: recipe for target ‘__build_one_by_one’ failed
make: *** [__build_one_by_one] Error 2
*

@Rajagopal

Yes, it should be applicable.

This means, there is no distro.config file in the kernel source. Which tree and branch are you trying?

FYI, the kernel tree used for this release is here: manivannan.sadhasivam/hikey.git - [no description] Branch: master

Thanks,
Mani

I am currently trying branch hikey960-upstream-rebase from [1].

I think there are > 1 repos for HiKey960 and I am tuning into the wrong combination :upside_down_face:

Where can I find build instructions for [1] ?

Thanks, shall give it a try.

Rajagopal

[1] https://github.com/96boards-hikey/linux/tree

You can just use make defconfig and build the kernel. After that, build the boot image using following commands:

cat Image hi3660-hikey960.dtb > Image-dtb
abootimg --create ${OUTPUT_DIR}/boot-uefi.img \
    -k Image-dtb \
    -r ${RAMDISK_FILE} \
    -f bootimg-960.cfg

The bootimg-960.cfg file can be found here: https://github.com/96boards-hikey/l-loader/blob/testing/hikey960_v1.2/bootimg-960.cfg

I had to disable Wifi for this kernel, because half of the times the command “ip addr” gets the board stuck.

&dwmmc2 { /* WIFI /
non-removable;
broken-cd;
cap-power-off-card;
pinctrl-names = “default”;
pinctrl-0 = <&sdio_pmx_func
&sdio_clk_cfg_func
&sdio_cfg_func>;
/
WL_EN */
vmmc-supply = <&wlan_en>;
status = “disable”;

wlcore: wlcore@2 {
	compatible = "ti,wl1837";
	reg = <2>;      /* sdio func num */
	/* WL_IRQ, GPIO_179_WL_WAKEUP_AP */
	interrupt-parent = <&gpio22>;
	interrupts = <3 IRQ_TYPE_EDGE_RISING>;
};

};

@Mani I’m trying to figure out why the Wifi speed is too low (Low speed of wifi interface).
There was
commit 99f996769c588a52ec1b8dad6334ce3c1324ed9a
Author: Manivannan Sadhasivam manivannan.sadhasivam@linaro.org
Date: Fri Dec 7 13:09:23 2018 +0530

    arm64: dts: hisilicon: Force 1 bit mode for Wifi on hikey/hikey960
    
    Wifi only works well with default 1bit mode. Hence, remove the bus-width
    property from dwmmc nodes.

What were exact issues with wifi when bus was 4 bits?

@divis1969 Yeah, there was some issue with 4bit mode (can’t remember what exactly though on top of my head) so I used 1bit mode as a workaround. When we move to new LTS, need to check if the workaround is neeed or not.

I’ve tried to restore “bus-width”. In this case board cannot initialize neither wlcore nor BT, looks like stuck at firmware download.
I read some docs about wl18xx and couple things are looking suspicious in this configuration (I’m not an expert, just thoughts).

  1. Card detection. Device tree uses “broken-cd” attribute. Meantime. integration guide does not mention it. Also, WL1837MOD datasheet, Table 4-1 clearly specify SDIO Data3 pin can be used for card detection. I’m not familiar with details of SDIO and how it should be configured in this case, perhaps it is just ok to use “cd-inverted” attribute (see Documentation/devicetree/bindings/mmc/mmc.txt) as this pin is pulled up on enabling.

  2. SDIO Data 3 and BT vs Wifi interoperability . Datasheet reads (about SDIO Data 3): “Changes state to PU at WL_EN or BT_EN assertion for card detects. Later disabled by software during initialization.” Perhaps both BT and Wifi are trying to initialize almost simultaneously and firmware downloading fails. BTW, this could potentially cause issues reported by @Lucas_Tanure above. I’m also seeing weird init sequence with bus-width = 1, but finally wlcore become initialized in my case (I’m, not using any BT device, only wifi is configured).

I’m going to try few corrections (remove “broken-cd”, use “cd-inverted” and disable BT for test), the only issue is whether I need to make any corrections regarding GPIO config for SDIO 3 (and use “cd-gpios” as well), so any suggestions are welcome.

I’ve tested the changes (diff at the end).
There were several attempts to boot the board and only one was successful (i.e. wlcore is initialized successfully and attached to wifi). Other boots fail the wlcore initialization. Unfortunately this failure is not seen in the log. I’ve found that successful boot contains
wlcore: ERROR timeout waiting for the hardware to complete initialization
whereas failed builds does not.
It looks like wlcore_boot_run_firmware function (where this message is located) can silently exit with error and this cannot be noticed (BTW, it looks like the board starts heating in a failed case).

BTW, I’ve tested the bandwidth with iperf in case of bus width 4. It is increased but only twice (from ~17Mbps to 34, max was ~42).
Status of mmc1:
$ sudo cat /sys/kernel/debug/mmc1/ios
sudo: unable to resolve host hikey960-server
clock: 25000000 Hz
vdd: 7 (1.65 - 1.95 V)
bus mode: 2 (push-pull)
chip select: 0 (don’t care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 0 (legacy)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)

Here are the DTS changes:
diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
index 975b69c8ce7f…1c89c09f2d18 100644
— a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
+++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
@@ -590,7 +590,8 @@
};

 &uart4 {
-       status = "okay";
+       /* status = "okay";  */
+       status = "disabled";

        bluetooth {
                compatible = "ti,wl1837-st";
@@ -637,8 +638,10 @@
 };

 &dwmmc2 { /* WIFI */
+       bus-width = <0x4>;
        non-removable;
-       broken-cd;
+       /* broken-cd; */
+    cd-inverted;
        cap-power-off-card;
        pinctrl-names = "default";
        pinctrl-0 = <&sdio_pmx_func