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 28b9f193bf1ccac4030b6aee460b3d9996088d99..2d0e30f39844047b4bf68858c849c36cfbe5b081 100644 --- a/model/audio/Makefile +++ b/model/audio/Makefile @@ -66,6 +66,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 +111,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/vendor/Makefile b/model/network/wifi/vendor/Makefile index 9c44aba5d711323aa5eeddb95470aa26b954b295..87ac3c82e2a60ad4b155a083a81f1fd2b76c8813 100644 --- a/model/network/wifi/vendor/Makefile +++ b/model/network/wifi/vendor/Makefile @@ -18,7 +18,24 @@ 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 + +ccflags-$(CONFIG_DRIVERS_HDF_WIFI) += \ + $(HDF_FRAMEWORKS_INC) \ + $(HDF_WIFI_FRAMEWORKS_INC) \ + $(HDF_WIFI_ADAPTER_INC) \ + $(HDF_WIFI_VENDOR_INC) \ + $(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/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/network/src/net_device_adapter.c b/network/src/net_device_adapter.c index ebf278e169594250e2318e16f86a84bcb66f40c8..a3a4e7fb05c9af2b21062855afed83423bdda523 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 5047d4aeff8e6450b222b14cebcf98c58e26f331..fb19bcaf3b1ac70069f05d99041237c32ce33eed 100644 --- a/platform/Kconfig +++ b/platform/Kconfig @@ -107,6 +107,27 @@ config DRIVERS_HDF_PLATFORM_ADC help Answer Y to enable HDF platform adc 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. + config DRIVERS_HDF_PLATFORM_TRACE bool "Enable HDF platform trace driver" default n 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..a1f9e8552eea0e341b754fff86ca076eda6e2d56 --- /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 +#include