Hikey960 debian: /proc/device-tree does not show mali

I installed Debian on HiKey 960 board as described here

After that I tried to Enable OpenCL support on Debian as described below

But the following test command does not show mali in the device tree

sudo dtc -I fs /proc/device-tree | grep mali

Documentation says - In case mali gpu node isn’t present then either check

  1. if you are using latest edk2/UEFI build image
  2. update devicetree with appropriate mali gpu node.

How to do items #1 and #2 above?

Please fetch updated hi3660-hikey960.dtb with gpu node and edit grub menu to use this devicetree as:
devicetree /boot/hi3660-hikey960.dtb

BTW, hopefully once this PR is merged we will have this change included in next fip.bin image snapshot.

Ok, that is what I did to make it work

  1. run the following on your dev x86 box
git clone https://git.linaro.org/people/manivannan.sadhasivam/hikey.git/
  1. install required packages
apt-get install -y libssl-dev bc flex bison \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
  1. Build hikey
cd hikey
make defconfig ARCH=arm64
make dtbs ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

# you should get hi3660-hikey960.dtb file
ls -la arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb
  1. copy arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb to HiKey960

  2. ssh to HiKey960

  3. put new hi3660-hikey960.dtb to /boot/ and to /usr/lib/linux-image-4.19.5-hikey/hisilicon/

sudo cp hi3660-hikey960.dtb /boot/
sudo cp hi3660-hikey960.dtb /usr/lib/linux-image-4.19.5-hikey/hisilicon/
  1. HDMI port does not work if you use HiKey960 + Debian. (only ssh works)
    So, we can not interact with grub at boot time and we need to edit /boot/grub/grub.cfg and add devicetree line

  2. Edit /boot/grub/grub.cfg

sudo chmod 644 /boot/grub/grub.cfg
sudo vi /boot/grub/grub.cfg

# Add "devicetree /boot/hi3660-hikey960.dtb" before "echo	'Loading Linux 4.19.5-hikey ...'"
# in all menuentry blocks
# You should get the following

	...
	devicetree /boot/hi3660-hikey960.dtb
	echo	'Loading Linux 4.19.5-hikey ...'
	linux	/boot/vmlinuz-4.19.5-hikey root=UUID=51edd3ac-2b58-4d25-b9af-a64969e4bd6b ro
	...
  1. Save /boot/grub/grub.cfg and reboot
sudo reboot
  1. ssh to the device in 1 min and check if device tree has mali
sudo apt install device-tree-compiler

sudo dtc -I fs /proc/device-tree | grep mali

#you should see
	mali@E82C0000 {
		compatible = "arm,malit6xx", "arm,mali-midgard";

How to allow linaro user to use OpenCL device? Currently my OpenCL program works only with sudo

Nah. You can edit grub config via serial also!

Not sure how to do it. I have just the board and usb A-to-C cable

Oops. Sorry, I thought that you have access to serial console. I’d recommend using any of the following mezzanine boards to have serial console access:


Thanks,
Mani