CONFIG_DRIVERS_HDF=y CONFIG_HDF_SUPPORT_LEVEL=2 CONFIG_DRIVERS_HDF_PLATFORM=y CONFIG_DRIVERS_HDF_PLATFORM_MIPI_DSI=y CONFIG_DRIVERS_HDF_PLATFORM_GPIO=y CONFIG_DRIVERS_HDF_PLATFORM_I2C=y CONFIG_DRIVERS_HDF_PLATFORM_WATCHDOG=y CONFIG_PWM_HI35XX=y CONFIG_DRIVERS_HDF_PLATFORM_PWM=y CONFIG_DRIVERS_HDF_PLATFORM_UART=y # CONFIG_DRIVERS_HDF_PLATFORM_SDIO is not set # CONFIG_DRIVERS_HDF_PLATFORM_EMMC is not set CONFIG_DRIVERS_HDF_PLATFORM_MMC=y CONFIG_DRIVERS_HDF_PLATFORM_SPI=y CONFIG_DRIVERS_HDF_PLATFORM_RTC=y CONFIG_DRIVERS_HDF_TEST=y CONFIG_DRIVERS_HDF_DISP=y # CONFIG_DRIVERS_HDF_LCDKIT is not set CONFIG_DRIVERS_HDF_LCD_ICN9700=y # CONFIG_DRIVERS_HDF_LCD_ST7789 is not set CONFIG_DRIVERS_HDF_INPUT=y CONFIG_DRIVERS_HDF_TP_5P5_GT911=y CONFIG_DRIVERS_HDF_TP_2P35_FT6236=y # CONFIG_DRIVERS_HDF_WIFI is not set # CONFIG_DRIVERS_HDF_BT is not set CONFIG_DRIVERS_HDF_SENSOR=y # CONFIG_DRIVERS_HDF_SENSOR_ACCEL is not set # CONFIG_DRIVERS_HDF_SENSOR_GYRO is not set # CONFIG_DRIVERS_HDF_SENSOR_BAROMETER is not set # CONFIG_DRIVERS_HDF_SENSOR_HALL is not set CONFIG_DRIVERS_HDF_STORAGE=y # CONFIG_DRIVERS_HDF_USB_PNP_NOTIFY is not set # CONFIG_DRIVERS_HDF_USB_F_GENERIC is not set # CONFIG_DRIVERS_HDF_AUDIO is not set CONFIG_DRIVERS_HDF_VIBRATOR=y CONFIG_DRIVERS_HDF_VIBRATOR_LINEAR=y # CONFIG_DRIVERS_HDF_DSOFTBUS is not set # end of Device Drivers [*] Enable HDF linux test 是需要设置的,如果没有设置CONFIG_DRIVERS_HDF_TEST,目录结构就出问题了,会报这样的错误。
复制 drivers/hdf/khdf/Makefile:22: PRODUCT_PATH=vendor/raspberrypi/RPI4B scripts/Makefile.build:44: drivers/hdf/khdf/../../../../vendor/raspberrypi/RPI4B/hdf_config/Makefile: No such file or directory make[5]: *** No rule to make target 'drivers/hdf/khdf/../../../../vendor/raspberrypi/RPI4B/hdf_config/Makefile'. Stop. CC [M] drivers/net/wireless/mac80211_hwsim.o make[4]: *** [scripts/Makefile.build:497: drivers/hdf/khdf/../../../../vendor/raspberrypi/RPI4B/hdf_config] Error 2 make[3]: *** [scripts/Makefile.build:497: drivers/hdf/khdf] Error 2 make[2]: *** [scripts/Makefile.build:497: drivers/hdf] Error 2 make[2]: *** Waiting for unfinished jobs.... 下面3个选项要关闭,不然会报下面的错误。
[ ] Enable HDF platform sdio driver
[ ] Enable HDF platform emmc driver
[ ] Enable HDF wifi
复制 drivers/../../../../../../drivers/adapter/khdf/linux/platform/sdio/sdio_adapter.o: In function `Hi35xxLinuxSdioRescan': sdio_adapter.c:(.text+0x20): undefined reference to `hisi_sdio_rescan' sdio_adapter.c:(.text+0x34): undefined reference to `himci_get_mmc_host' drivers/../../../../../../drivers/adapter/khdf/linux/platform/sdio/sdio_adapter.o: In function `Hi35xxLinuxSdioFindFunc': sdio_adapter.c:(.text+0xc84): undefined reference to `himci_get_mmc_host' sdio_adapter.c:(.text+0xc9c): undefined reference to `himci_get_mmc_host' sdio_adapter.c:(.text+0xcb4): undefined reference to `himci_get_mmc_host' drivers/../../../../../../drivers/adapter/khdf/linux/platform/emmc/emmc_adapter.o: In function `Hi35xxLinuxEmmcBind': emmc_adapter.c:(.text+0x214): undefined reference to `himci_get_mmc_host' drivers/../../../../../../device/hisilicon/drivers/wifi/driver/hi3881/oal/oal_sdio_host.o: In function `sdio_card_detect_change': oal_sdio_host.c:(.text+0x2ce8): undefined reference to `hisi_sdio_rescan' make[1]: *** [Makefile:1179: vmlinux] Error 1 make[1]: Leaving directory '/home/liangzili/ohos/out/KERNEL_OBJ/kernel/src_tmp/linux-5.10' make: *** [kernel.mk:80: /home/liangzili/ohos/out/KERNEL_OBJ/kernel/src_tmp/linux-5.10/arch/arm/boot/zImage] Error 2 ninja: build stopped: subcommand failed. 编译过程 为了方便测试可以单独进行内核编译,比如我的编译命令是这样的。 可以分析下HDF这部分的编译过程。
# 这里有条注释指明了*.hcs配置文件的存放路径 # for L2+, hcs config should in vendor/product_company/product_name/config/khdf ifeq ($(SUPPORT_LEVEL_STD_H), true) SUB_DIR:=khdf/ endif