From 7b2e5e6550aed4f79461919c6a59e00741eb4b11 Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Tue, 11 Jul 2023 23:55:02 +0200 Subject: [PATCH] package/esp-hosted: add package This patch adds esp-hosted package that allows to build the Linux Kernel Driver for Espressif Esp32-* SoCs, that once programmed with the corresponding firmware behave like a normal Wi-Fi module. Both SDIO and SPI busses are supported and selectable. Cc: Jesse Taube Signed-off-by: Giulio Benetti Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 1 + package/Config.in | 1 + package/esp-hosted/Config.in | 29 +++++++++++++++++++++++++++++ package/esp-hosted/esp-hosted.hash | 3 +++ package/esp-hosted/esp-hosted.mk | 29 +++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+) create mode 100644 package/esp-hosted/Config.in create mode 100644 package/esp-hosted/esp-hosted.hash create mode 100644 package/esp-hosted/esp-hosted.mk diff --git a/DEVELOPERS b/DEVELOPERS index 05a8d26988..a1f1cad5e6 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1174,6 +1174,7 @@ F: package/at/ F: package/binutils/ F: package/cryptsetup/ F: package/erlang-jiffy/ +F: package/esp-hosted/ F: package/gcc/ F: package/harfbuzz/ F: package/libfuse3/ diff --git a/package/Config.in b/package/Config.in index 1d30465434..5b65ed588f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -496,6 +496,7 @@ endmenu source "package/edid-decode/Config.in" source "package/edk2-non-osi/Config.in" source "package/edk2-platforms/Config.in" + source "package/esp-hosted/Config.in" source "package/eudev/Config.in" source "package/ev3dev-linux-drivers/Config.in" source "package/evemu/Config.in" diff --git a/package/esp-hosted/Config.in b/package/esp-hosted/Config.in new file mode 100644 index 0000000000..43c802fa44 --- /dev/null +++ b/package/esp-hosted/Config.in @@ -0,0 +1,29 @@ +comment "esp-hosted needs a Linux kernel to be built" + depends on !BR2_LINUX_KERNEL + +config BR2_PACKAGE_ESP_HOSTED + bool "esp-hosted" + depends on BR2_LINUX_KERNEL + help + This package builds and installs the Linux kernel driver for + the Esp32-* Linux Wi-Fi driver. It supports both SDIO and SPI + busses that is selectable. It is compatible with recent Linux + kernels (>= 5.4). + +if BR2_PACKAGE_ESP_HOSTED + +choice + prompt "HW interface" + default BR2_PACKAGE_ESP_HOSTED_SDIO + help + Select which bus type esp is attached to + +config BR2_PACKAGE_ESP_HOSTED_SDIO + bool "SDIO" + +config BR2_PACKAGE_ESP_HOSTED_SPI + bool "SPI" + +endchoice + +endif diff --git a/package/esp-hosted/esp-hosted.hash b/package/esp-hosted/esp-hosted.hash new file mode 100644 index 0000000000..c17fe262a1 --- /dev/null +++ b/package/esp-hosted/esp-hosted.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 3310845b2324bda5774b91bcdd3f47621126f4a0011a0f61e31b0ad4a44db2f5 esp-hosted-11e90f185a5a9922343e73e44032816a0e3ddedb.tar.gz +sha256 ed57d96d27be775b22f9571d3724ef84e0d0b8f24b805ec7f87a32189de19a9c LICENSE diff --git a/package/esp-hosted/esp-hosted.mk b/package/esp-hosted/esp-hosted.mk new file mode 100644 index 0000000000..dcb0b3bd70 --- /dev/null +++ b/package/esp-hosted/esp-hosted.mk @@ -0,0 +1,29 @@ +################################################################################ +# +# esp-hosted +# +################################################################################ + +ESP_HOSTED_VERSION = 11e90f185a5a9922343e73e44032816a0e3ddedb +ESP_HOSTED_SITE = $(call github,espressif,esp-hosted,$(ESP_HOSTED_VERSION)) +ESP_HOSTED_DEPENDENCIES = linux +ESP_HOSTED_LICENSE = GPL-2.0 +ESP_HOSTED_LICENSE_FILE = LICENSE +ESP_HOSTED_MODULE_SUBDIRS = esp_hosted_ng/host + +define ESP_HOSTED_LINUX_CONFIG_FIXUPS + $(call KCONFIG_ENABLE_OPT,CONFIG_NET) + $(call KCONFIG_ENABLE_OPT,CONFIG_WIRELESS) + $(call KCONFIG_ENABLE_OPT,CONFIG_CFG80211) + $(call KCONFIG_ENABLE_OPT,CONFIG_MAC80211) + $(call KCONFIG_ENABLE_OPT,CONFIG_BT) +endef + +ifeq ($(BR2_PACKAGE_ESP_HOSTED_SPI),y) +ESP_HOSTED_MODULE_MAKE_OPTS = target=spi +else +ESP_HOSTED_MODULE_MAKE_OPTS = target=sdio +endif + +$(eval $(kernel-module)) +$(eval $(generic-package))