diff --git a/Kconfig b/Kconfig index ff129ec26968fd761e8227d741f8cea76533d0bb..4fe34bfb212663d0c75116291f9355a8fe4f39b5 100644 --- a/Kconfig +++ b/Kconfig @@ -28,5 +28,6 @@ source "drivers/hdf/khdf/model/audio/Kconfig" source "drivers/hdf/khdf/model/misc/vibrator/Kconfig" source "drivers/hdf/khdf/model/misc/dsoftbus/Kconfig" source "drivers/hdf/khdf/model/misc/light/Kconfig" +source "drivers/hdf/framework/model/input/driver/touchscreen/Kconfig" endif diff --git a/model/audio/Kconfig b/model/audio/Kconfig index e1beac5dd46ff2d0b3a9aff77c06ecbac92679a8..66063cb2b4cf4b3d2a697f042a0cedd951702aa4 100644 --- a/model/audio/Kconfig +++ b/model/audio/Kconfig @@ -27,6 +27,13 @@ config DRIVERS_HDF_AUDIO_ANA_HEADSET support hook interrupt mode. support hook adc mode. +config DRIVERS_HDF_AUDIO_IMX8MM + bool "Enable HDF Audio Codec driver" + default n + depends on DRIVERS_HDF_AUDIO + help + Answer Y to choice HDF Audio Codec driver. + config DRIVERS_HDF_AUDIO_TEST bool "Enable HDF Audio driver Test" default n diff --git a/model/audio/Makefile b/model/audio/Makefile index 901164fdcd675ba9812879bf86097957b0e1b92a..ec39eb2d175c589e39b9a5857d503c13710bf557 100644 --- a/model/audio/Makefile +++ b/model/audio/Makefile @@ -19,6 +19,8 @@ KHDF_AUDIO_HI3516DV300_DIR = $(KHDF_AUDIO_BASE_ROOT_DIR)/drivers/peripheral/audi KHDF_AUDIO_HI3516DV300_INC_DIR = drivers/hdf/framework/../peripheral/audio/chipsets/hi3516dv300 KHDF_AUDIO_RK3568_DIR = $(KHDF_AUDIO_BASE_ROOT_DIR)/device/board/hihope/rk3568/audio_drivers KHDF_AUDIO_RK3568_INC_DIR = drivers/hdf/framework/../../device/board/hihope/rk3568/audio_drivers +KHDF_AUDIO_CODEC_DIR = $(KHDF_AUDIO_BASE_ROOT_DIR)/drivers/peripheral/audio/chipsets +KHDF_AUDIO_CODEC_INC_DIR = drivers/hdf/framework/../peripheral/audio/chipsets obj-$(CONFIG_DRIVERS_HDF_AUDIO) += \ $(KHDF_AUDIO_ROOT_DIR)/core/src/audio_core.o \ @@ -66,6 +68,17 @@ obj-$(CONFIG_DRIVERS_HDF_AUDIO_ANA_HEADSET) += \ $(KHDF_AUDIO_RK3568_DIR)/headset_monitor/src/analog_headset_gpio.o \ $(KHDF_AUDIO_RK3568_DIR)/headset_monitor/src/analog_headset_adc.o +obj-$(CONFIG_DRIVERS_HDF_AUDIO_IMX8MM) += \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/soc/src/sai_driver.o \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/soc/src/dma_driver.o \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/soc/src/imx8mm_platform_ops.o \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/soc/src/imx8mm_dai_adapter.o \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/soc/src/imx8mm_platform_adapter.o \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/dsp/src/dsp_adapter.o \ + $(KHDF_AUDIO_CODEC_DIR)/imx8mm/dsp/src/dsp_ops.o \ + $(KHDF_AUDIO_CODEC_DIR)/wm8904/codec/src/wm8904.o \ + $(KHDF_AUDIO_CODEC_DIR)/wm8904/codec/src/wm8904_impl.o + ccflags-$(CONFIG_DRIVERS_HDF_AUDIO) += -lm -lc -lgcc -std=gnu99 -Werror\ -I$(srctree)/$(KHDF_AUDIO_KHDF_ROOT_DIR)/osal/include \ -I$(srctree)/$(KHDF_FRAMEWORK_ROOT_DIR)/include/core \ @@ -100,3 +113,9 @@ ccflags-$(CONFIG_DRIVERS_HDF_AUDIO_ANA_HEADSET) += \ -I$(srctree)/$(KHDF_FRAMEWORK_ROOT_DIR)/model/input/driver \ -I$(srctree)/drivers/hdf/evdev \ -I$(srctree)/$(KHDF_AUDIO_RK3568_INC_DIR)/headset_monitor/include + +ccflags-$(CONFIG_DRIVERS_HDF_AUDIO_IMX8MM) += \ + -I$(srctree)/$(KHDF_AUDIO_CODEC_INC_DIR)/wm8904/codec/include \ + -I$(srctree)/$(KHDF_AUDIO_CODEC_INC_DIR)/imx8mm/soc/include \ + -I$(srctree)/$(KHDF_AUDIO_CODEC_INC_DIR)/imx8mm/dsp/include \ + -I$(srctree)/$(KHDF_AUDIO_CODEC_INC_DIR)/imx8mm/include \ No newline at end of file diff --git a/model/input/Makefile b/model/input/Makefile index 52eae07c4a55e134d49033724e65a166139b8cd4..42157aecf2347cfa34a16be4b6012b948664e34b 100644 --- a/model/input/Makefile +++ b/model/input/Makefile @@ -25,6 +25,8 @@ obj-$(CONFIG_DRIVERS_HDF_INPUT) += \ obj-$(CONFIG_DRIVERS_HDF_TP_5P5_GT911) += \ $(INPUT_ROOT_DIR)/touchscreen/touch_gt911.o +obj-$(CONFIG_ARCH_NXP_TOUCH) += \ + $(INPUT_ROOT_DIR)/touchscreen/touch_ft5x06.o obj-$(CONFIG_DRIVERS_HDF_TP_2P35_FT6236) += \ $(INPUT_ROOT_DIR)/touchscreen/touch_ft6336.o diff --git a/model/network/wifi/Kconfig b/model/network/wifi/Kconfig index 7d893dd41803e9613070373140d0c4d8f28161ea..fd9a5ea1479c022639119f5223a245d3d191d823 100644 --- a/model/network/wifi/Kconfig +++ b/model/network/wifi/Kconfig @@ -29,3 +29,10 @@ config AP6XXX_WIFI6_HDF This driver supports wifi6 for ap6xxx HDF chipset. This driver uses the kernel's wireless extensions subsystem. If you choose to build a module, it'll be called dhd. Say M if unsure. + +config DRIVERS_AP6212 + bool "Enable ap6212" + default n + depends on DRIVERS_HDF_WIFI + help + Answer Y to enable ap6212 wifi chip driver. diff --git a/model/network/wifi/hdfwifi.mk b/model/network/wifi/hdfwifi.mk index 221c8fc493d9440f83f82db16816adf5e254f95b..e7945e9031c995765b50a5b736cc22169a99b346 100755 --- a/model/network/wifi/hdfwifi.mk +++ b/model/network/wifi/hdfwifi.mk @@ -14,7 +14,6 @@ HDF_WIFI_FRAMEWORKS_ROOT = $(HDF_DIR_PREFIX)/framework/model/network/wifi HDF_WIFI_KHDF_FRAMEWORKS_ROOT = $(HDF_DIR_PREFIX)/adapter/khdf/linux/model/network/wifi -HDF_WIFI_VENDOR_ROOT = $(HDF_VENDOR_PREFIX)/device/soc/hisilicon/common/platform/wifi/hi3881v100 HDF_FRAMEWORKS_INC := \ -I$(srctree)/drivers/hdf/framework/core/common/include/host \ -I$(srctree)/drivers/hdf/framework/core/host/include \ diff --git a/model/network/wifi/vendor/Makefile b/model/network/wifi/vendor/Makefile index fa87955cef0ec790f9c73a948ea0a22e764101e9..87ac3c82e2a60ad4b155a083a81f1fd2b76c8813 100644 --- a/model/network/wifi/vendor/Makefile +++ b/model/network/wifi/vendor/Makefile @@ -18,6 +18,12 @@ HDF_VENDOR_PREFIX := ../../../../../../../../ include drivers/hdf/khdf/model/network/wifi/hdfwifi.mk +ifneq ($(CONFIG_DRIVERS_AP6212),) +HDF_WIFI_VENDOR_ROOT = $(HDF_VENDOR_PREFIX)/device/board/nxp/imx8mm/wifi +else +HDF_WIFI_VENDOR_ROOT = $(HDF_VENDOR_PREFIX)/device/soc/hisilicon/common/platform/wifi/hi3881v100 +endif + obj-$(CONFIG_DRIVERS_HDF_WIFI) += $(MODULE_NAME).o $(MODULE_NAME)-objs := $(HDF_WIFI_VENDOR_ROOT)/adapter/hdf_wlan_sdio_adapt.o @@ -29,6 +35,7 @@ ccflags-$(CONFIG_DRIVERS_HDF_WIFI) += \ $(SECURE_LIB_INC) obj-$(CONFIG_DRIVERS_HI3881) += hi3881/ +obj-$(CONFIG_DRIVERS_AP6212) += ap6212/ ifneq ($(CONFIG_AP6XXX_WIFI6_HDF),) RKWIFI_PATH := $(HDF_VENDOR_PREFIX)/device/$(product_company)/$(product_device)/wifi diff --git a/model/network/wifi/vendor/ap6212/Makefile b/model/network/wifi/vendor/ap6212/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..9a2ba2a021eb2efb3fb62750c81f4dfd7e95b35f --- /dev/null +++ b/model/network/wifi/vendor/ap6212/Makefile @@ -0,0 +1,13 @@ +MODULE_NAME := ap6212 + +HDF_VENDOR_PREFIX := ../../../../../../../../../ + +include drivers/hdf/khdf/model/network/wifi/hdfwifi.mk + +INC_TOP_PATH := $(PROJECT_ROOT) +VENDOR_WIFI_PATH := device/board/nxp/imx8mm/wifi +WIFI_DRIVER_DIR := ap6212 + +obj-y += $(HDF_VENDOR_PREFIX)/device/board/nxp/imx8mm/ethernet/adapter/ +ccflags-y += -Idrivers/net/ethernet/freescale/ +obj-y += $(HDF_VENDOR_PREFIX)/device/board/nxp/imx8mm/wifi/ap6212/ \ No newline at end of file diff --git a/model/network/wifi/vendor/hi3881/Makefile b/model/network/wifi/vendor/hi3881/Makefile index dd5d23c57369a7e8de0eadc2b19e9d36ec64e03d..feb2b2b56d0b16a2b5350a177f525d786474c274 100755 --- a/model/network/wifi/vendor/hi3881/Makefile +++ b/model/network/wifi/vendor/hi3881/Makefile @@ -21,6 +21,7 @@ include drivers/hdf/khdf/model/network/wifi/hdfwifi.mk INC_TOP_PATH := drivers/hdf/wifi/hi3881v100/ VENDOR_WIFI_PATH := device/soc/hisilicon/common/platform/wifi/hi3881v100 WIFI_DRIVER_DIR := driver +HDF_WIFI_VENDOR_ROOT = $(HDF_VENDOR_PREFIX)/device/soc/hisilicon/common/platform/wifi/hi3881v100 ##################path of compile file :start############### #####wifi##### diff --git a/model/storage/Kconfig b/model/storage/Kconfig index 08059de3357f165ac69099c04627cdf112a95bbd..1792cd68ec3570ab34e5dc31741fa72226639a74 100644 --- a/model/storage/Kconfig +++ b/model/storage/Kconfig @@ -15,3 +15,10 @@ config DRIVERS_HDF_STORAGE depends on DRIVERS_HDF help Answer Y to enable HDF storage driver. + +config IMX8MM_SDIO_TEST + bool "Enable imx8mm sdio test" + default n + depends on DRIVERS_HDF + help + Answer Y to enable imx8mm sdio test. \ No newline at end of file diff --git a/model/storage/Makefile b/model/storage/Makefile index 5ef96899ab11143df3305c817de877590367bf13..b321b30a74b1d252a2bf2ba8feeca44324c79ae3 100644 --- a/model/storage/Makefile +++ b/model/storage/Makefile @@ -45,7 +45,12 @@ obj-y += $(STORAGE_ROOT_DIR)/src/mmc/emmc_if.o \ ifeq ($(CONFIG_ARCH_HI3516DV300), y) obj-y += \ ./vendor_adapter/hi35xx_mmc_adapter.o +else +ifeq ($(CONFIG_IMX8MM_EMMC), y) + obj-y += \ + ./vendor_adapter/imx8mm_mmc_adapter.o else obj-y += \ ./mmc_adapter.o +endif endif \ No newline at end of file diff --git a/model/storage/vendor_adapter/imx8mm_mmc_adapter.c b/model/storage/vendor_adapter/imx8mm_mmc_adapter.c new file mode 100644 index 0000000000000000000000000000000000000000..3b2b60291dee5af0fb6e07576fdd76d488bb09ec --- /dev/null +++ b/model/storage/vendor_adapter/imx8mm_mmc_adapter.c @@ -0,0 +1,38 @@ +/* + * hi35xx_mmc_adapter.c + * + * hi35xx linux mmc driver implement. + * + * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include "hdf_base.h" +#include "hdf_log.h" + +#define HDF_LOG_TAG imx8mm_mmc_adapter_c + +struct mmc_host *sdhci_esdhc_get_mmc_host(int slot); +void sdhci_esdhc_sdio_rescan(int slot); + +struct mmc_host *GetMmcHost(int32_t slot) +{ + HDF_LOGD("imx8mm GetMmcHost entry"); + return sdhci_esdhc_get_mmc_host(slot); +} + +void SdioRescan(int slot) +{ + HDF_LOGD("imx8mm SdioRescan entry"); + sdhci_esdhc_sdio_rescan(slot); +} diff --git a/network/src/net_device_adapter.c b/network/src/net_device_adapter.c index ebf278e169594250e2318e16f86a84bcb66f40c8..3abe6f2f633e22f3d843bba4be52721086154117 100644 --- a/network/src/net_device_adapter.c +++ b/network/src/net_device_adapter.c @@ -20,12 +20,17 @@ #include #include #include +#include #include "net_device.h" #include "net_device_impl.h" #include "osal_mem.h" #include "securec.h" #define HDF_LOG_TAG NetDeviceFull +extern struct phy_device *of_phy_connect(struct net_device *dev, + struct device_node *phy_np, + void (*hndlr)(struct net_device *), u32 flags, + phy_interface_t iface); static int32_t NetDevXmitCheck(struct sk_buff *skb, struct net_device *dev) { @@ -230,6 +235,87 @@ static int32_t NetDevDelete(struct NetDeviceImpl *impl) return HDF_SUCCESS; } +void NetDevApiAdd(struct NetDeviceImpl *impl, struct napi_struct *napi, + int (*poll)(struct napi_struct *, int), int weight) +{ + struct net_device *dev = GetDevFromDevImpl(impl); + + netif_napi_add(dev, napi, poll, 64); +} + +struct netdev_queue *NetDevGetTxQueue(struct NetDeviceImpl *impl, unsigned int queue) +{ + struct net_device *dev = GetDevFromDevImpl(impl); + struct netdev_queue *nq; + + nq = netdev_get_tx_queue(dev, queue); + + return nq; +} + +__be16 NetDevTypeTrans(struct NetDeviceImpl *impl, struct sk_buff *skb) +{ + __be16 ret; + struct net_device *dev = GetDevFromDevImpl(impl); + + ret = eth_type_trans(skb, dev); + + + return ret; +} + +struct sk_buff *NetDevAllocBuf(struct NetDeviceImpl *impl, uint32_t length) +{ + struct sk_buff *skb = NULL; + struct net_device *dev = GetDevFromDevImpl(impl); + + skb = netdev_alloc_skb(dev, length); + return skb; +} + +void NetDevStartQueue(struct NetDeviceImpl *impl) +{ + struct net_device *dev = GetDevFromDevImpl(impl); + struct netdev_queue *nq; + + nq = netdev_get_tx_queue(dev, 1); + netif_tx_start_queue(nq); +} + +void NetDevDisableTx(struct NetDeviceImpl *impl) +{ + struct net_device *dev = GetDevFromDevImpl(impl); + + netif_tx_disable(dev); +} + +void NetDevSetDev(struct NetDeviceImpl *impl, struct device *dev) +{ + struct net_device *ndev = GetDevFromDevImpl(impl); + + SET_NETDEV_DEV(ndev,dev); +} + +void NetDevWakeQueue(struct NetDeviceImpl *impl) +{ + struct net_device *dev = GetDevFromDevImpl(impl); + struct netdev_queue *nq; + + nq = netdev_get_tx_queue(dev, 1); + netif_tx_wake_queue(nq); +} + +struct phy_device *NetDevOfPhyConnect(struct NetDeviceImpl *impl, + struct device_node *phy_np, + void (*hndlr)(struct net_device *), u32 flags, + phy_interface_t iface) +{ + struct phy_device *phy = NULL; + struct net_device *ndev = GetDevFromDevImpl(impl); + phy = of_phy_connect(ndev, phy_np, hndlr, 0, iface); + return phy; +} + static int32_t NetDevSetStatus(struct NetDeviceImpl *impl, NetIfStatus status) { @@ -316,6 +402,15 @@ static struct NetDeviceImplOp g_ndImplOps = { .setStatus = NetDevSetStatus, .receive = NetDevReceive, .changeMacAddr = NetDevChangeMacAddr, + .netif_napi_add = NetDevApiAdd, + .get_tx_queue = NetDevGetTxQueue, + .type_trans = NetDevTypeTrans, + .alloc_buf = NetDevAllocBuf, + .start_queue = NetDevStartQueue, + .disable_tx = NetDevDisableTx, + .set_dev = NetDevSetDev, + .wake_queue = NetDevWakeQueue, + .of_phyconnect = NetDevOfPhyConnect, }; int32_t RegisterNetDeviceImpl(struct NetDeviceImpl *ndImpl) diff --git a/platform/Kconfig b/platform/Kconfig index 8cb37bed6de349e4d92d3d0aba1def7d163f71dd..a25e5756f7c50c6564eca3c738019f246e74069a 100644 --- a/platform/Kconfig +++ b/platform/Kconfig @@ -98,4 +98,25 @@ config DRIVERS_HDF_PLATFORM_REGULATOR default n depends on DRIVERS_HDF_PLATFORM help - Answer Y to enable HDF platform regulator driver. \ No newline at end of file + Answer Y to enable HDF platform regulator driver. + +config IMX8MM_EMMC + bool "Enable HDF imx8mm emmc driver" + default n + depends on DRIVERS_HDF + help + Answer Y to enable HDF imx8mm emmc driver. + +config IMX8MM_SDIO + bool "Enable HDF imx8mm sdio driver" + default n + depends on DRIVERS_HDF + help + Answer Y to enable HDF imx8mm sdio driver. + +config DRIVERS_HDF_PLATFORM_IMX8MM_MIPI_DSI + bool "Enable HDF platform imx8mm mipi_dsi driver" + default n + depends on DRIVERS_HDF_PLATFORM + help + Answer Y to enable HDF platform imx8mm mipi_dsi driver. \ No newline at end of file diff --git a/platform/mipi_dsi/Makefile b/platform/mipi_dsi/Makefile index 337a1b32064efb061b6be71104209863fae5a85d..fe62f73b6377802b938b86e8bf2809e631230bb2 100644 --- a/platform/mipi_dsi/Makefile +++ b/platform/mipi_dsi/Makefile @@ -16,9 +16,14 @@ include drivers/hdf/khdf/platform/platform.mk obj-y += $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/mipi/mipi_dsi_core.o \ $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/mipi/mipi_dsi_if.o + +ifeq ($(CONFIG_DRIVERS_HDF_PLATFORM_IMX8MM_MIPI_DSI), y) +obj-$(CONFIG_DRM_MIPI_DSI) += mipi_drm_imx8mm.o +else obj-$(CONFIG_DRM_MIPI_DSI) += mipi_drm_adapter.o obj-y += mipi_tx_dev.o \ mipi_tx_hi35xx.o +endif EXTRA_CFLAGS += -Wno-error=date-time diff --git a/platform/mipi_dsi/mipi_drm_imx8mm.c b/platform/mipi_dsi/mipi_drm_imx8mm.c new file mode 100644 index 0000000000000000000000000000000000000000..231039aa798cc9c9e980990b4e6d1bfa87731a68 --- /dev/null +++ b/platform/mipi_dsi/mipi_drm_imx8mm.c @@ -0,0 +1,209 @@ +/* + * mipi_drm_adapter.c + * + * Mipi drm adapter driver. + * + * Copyright (c) 2021 Huawei Device Co., Ltd. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include "hdf_base.h" +#include +#include