How to use Oled on hikey960?



I recently porting OLED on hikey960
This document describes how to use OLED on hikey

Hardware preparation:

96Boards Sensors

Grove系列-OLED Display 1.12"

Let’s talk about the details of the drive:

In aosp\hikey-linaro\arch\arm64\boot\dts\hisilicon\hi3660.dtsi
Add information about OLED in dts like below:
i2c0: i2c@FFD71000 {
compatible = “snps,designware-i2c”;
reg = <0x0 0xFFD71000 0x0 0x1000>;
interrupts = <0 118 4>;
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <400000>;
clocks = <&crg_ctrl HI3660_CLK_GATE_I2C0>;
resets = <&iomcu_rst HI3660_RST_I2C0>;
pinctrl-names = “default”;
pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>;
status = “ok”;

		oled:oled@0x3c {
			compatible = "grove,oled";
			reg = <0x3c>;
			status = "ok";

Put the code under the aosp\hikey-linaro\drivers directory, and then configure the kconfig and Makefile in this directory like below:

Added in Kconfig:
source “drivers/oled/Kconfig”

Added in Makefile:
obj-y += oled/

Finally, add macros to the file in \aosp\hikey-linaro\arch\arm64\configs\hikey960_defconfig

The next step is to compile and compile the tutorial. First compile kernel, then rename the image.gz and DTB files and put them into AOSP, and finally complete the aosp. After compiling, burn image.

If the boot is normal, you can see the logo as shown

Finally, give the code to everyone


Great post. I do like to see success stories on the forums as well as what isn’t working ;-).