Ingenic: initial support for T23 (#1853)

pull/1854/head
viktorxda 2025-08-09 13:13:52 +02:00 committed by GitHub
parent 73a5abf520
commit 006ba82bdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 2255 additions and 6 deletions

View File

@ -48,6 +48,9 @@ jobs:
- t21_lite
- t30_lite
# Ingenic [T23]
- t23_lite
# Ingenic [T31]
- t31_lite

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_SOC_VENDOR)-t31.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t31.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t10.generic.config"
BR2_LINUX_KERNEL_LZMA=y

View File

@ -17,7 +17,7 @@ BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_SOC_VENDOR)-t31.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t31.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t20.generic.config"
BR2_LINUX_KERNEL_LZMA=y

View File

@ -17,7 +17,7 @@ BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_SOC_VENDOR)-t31.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t31.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t20.generic.config"
BR2_LINUX_KERNEL_LZMA=y

View File

@ -17,7 +17,7 @@ BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_SOC_VENDOR)-t31.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t31.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t21.generic.config"
BR2_LINUX_KERNEL_LZMA=y

View File

@ -17,7 +17,7 @@ BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_SOC_VENDOR)-t31.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t31.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t21.generic.config"
BR2_LINUX_KERNEL_LZMA=y

View File

@ -0,0 +1,70 @@
# Architecture
BR2_mipsel=y
BR2_mips_xburst=y
# BR2_MIPS_SOFT_FLOAT is not set
BR2_MIPS_FP32_MODE_32=y
# Toolchain
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/toolchain/toolchain.ingenic-t31.tgz"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="mipsel-openipc-linux-musl"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t23.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t23.generic.config"
BR2_LINUX_KERNEL_LZMA=y
# Filesystem
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config"
BR2_PACKAGE_UBOOT_TOOLS=y
BR2_PACKAGE_ZLIB=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
# OpenIPC
BR2_OPENIPC_SOC_VENDOR="ingenic"
BR2_OPENIPC_SOC_MODEL="t23"
BR2_OPENIPC_SOC_FAMILY="t23"
BR2_OPENIPC_VARIANT="lite"
BR2_OPENIPC_FLASH_SIZE="8"
# Packages
BR2_PACKAGE_ATBM_WIFI=y
BR2_PACKAGE_DROPBEAR_OPENIPC=y
BR2_PACKAGE_INGENIC_OSDRV_T23=y
BR2_PACKAGE_IPCTOOL=y
BR2_PACKAGE_JSONFILTER=y
BR2_PACKAGE_LIBCURL_OPENIPC=y
BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y
# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set
BR2_PACKAGE_LIBEVENT_OPENIPC=y
BR2_PACKAGE_LIBOGG_OPENIPC=y
BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC=y
BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_MEDIATEK_MT7601U=y
BR2_PACKAGE_MAJESTIC_FONTS=y
BR2_PACKAGE_MAJESTIC_WEBUI=y
BR2_PACKAGE_MAJESTIC=y
BR2_PACKAGE_MBEDTLS_OPENIPC=y
BR2_PACKAGE_MOTORS=y
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
BR2_PACKAGE_VTUND_OPENIPC=y
BR2_PACKAGE_YAML_CLI=y

View File

@ -17,7 +17,7 @@ BR2_TOOLCHAIN_EXTERNAL_CXX=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_SOC_VENDOR)-t31.tar.gz"
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/ingenic-t31.tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/t30.generic.config"
BR2_LINUX_KERNEL_LZMA=y

View File

@ -38,6 +38,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/i2c-telemetry/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-opensdk/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-osdrv-t20/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-osdrv-t21/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-osdrv-t23/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-osdrv-t30/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-osdrv-t31/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/ingenic-osdrv-t40/Config.in"

View File

@ -0,0 +1,6 @@
config BR2_PACKAGE_INGENIC_OSDRV_T23
bool "ingenic-osdrv-t23"
select BR2_PACKAGE_INGENIC_OPENSDK
help
Ingenic T23 kernel modules and libraries
https://openipc.org

View File

@ -0,0 +1,85 @@
#!/bin/sh
KMOD_PATH=/lib/modules/$(uname -r)/ingenic
vendor=$(ipcinfo -v)
if [ ! -f /usr/sbin/sensor_cli ]; then
ln -s /usr/sbin/extutils /usr/sbin/sensor_cli
fi
echo 1 > /proc/sys/vm/overcommit_memory
log_vendor() {
logger -s -p daemon.info -t ${vendor} "$1"
}
check_return() {
if [ $? -ne 0 ]; then
echo err: $1
echo exit
exit
fi
}
lsmod | grep -q "sinfo"
if [ $? -ne 0 ]; then
modprobe sinfo.ko
check_return "modprobe sinfo"
fi
SENSOR=$(fw_printenv -n sensor)
if [ -n "$SENSOR" ]; then
export ${SENSOR}
log_vendor "Get data from environment and set SENSOR as ${SENSOR}"
else
echo 1 >/proc/jz/sinfo/info
check_return "start sinfo"
SENSOR_INFO=$(cat /proc/jz/sinfo/info)
check_return "get sensor type"
SENSOR=${SENSOR_INFO#*:}
if [ "sensor not found" = "$SENSOR" ]; then
unset SENSOR
fw_setenv sensor
else
log_vendor "Get data from sinfo and set SENSOR as ${SENSOR}"
fw_setenv sensor $SENSOR && log_vendor "Write detected ${SENSOR} to U-Boot ENV"
fi
fi
case ${SENSOR} in
"imx307"|"sc2135"|"sc2232")
ISP_PARAM="isp_clk=200000000"
;;
"gc2053"|"jxf23")
ISP_PARAM="isp_clk=200000000"
SENSOR_PARAM="sensor_max_fps=25 data_interface=1"
;;
*)
ISP_PARAM="isp_clk=125000000"
;;
esac
echo --------------------
echo "ISP_PARAM: ${ISP_PARAM}"
echo "SENSOR: ${SENSOR}"
echo "SENSOR_PARAM: ${SENSOR_PARAM}"
echo --------------------
lsmod | grep -q "tx_isp"
if [ $? -ne 0 ]; then
modprobe tx-isp-t23 ${ISP_PARAM}
check_return "modprobe isp drv"
fi
lsmod | grep -q ${SENSOR}
if [ $? -ne 0 ]; then
modprobe sensor_${SENSOR}_t23 ${SENSOR_PARAM}
check_return "modprobe sensor drv"
fi
lsmod | grep -q "audio"
if [ $? -ne 0 ]; then
modprobe audio spk_gpio=-1
check_return "modprobe audio"
fi

View File

@ -0,0 +1,6 @@
sensor:
name: gc2053
address: 0x37
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: imx327
address: 0x1a
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: jxf23
address: 0x40
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: sc200ai
address: 0x30
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: sc2310
address: 0x30
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: sc2331
address: 0x30
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: sc301IoT
address: 0x30
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,24 @@
################################################################################
#
# ingenic-osdrv-t23
#
################################################################################
INGENIC_OSDRV_T23_VERSION =
INGENIC_OSDRV_T23_SITE =
INGENIC_OSDRV_T23_LICENSE = MIT
INGENIC_OSDRV_T23_LICENSE_FILES = LICENSE
define INGENIC_OSDRV_T23_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/sensor
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensor $(INGENIC_OSDRV_T23_PKGDIR)/files/sensor/*.yaml
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensor $(INGENIC_OSDRV_T23_PKGDIR)/files/sensor/params/*.bin
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(INGENIC_OSDRV_T23_PKGDIR)/files/script/*
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/lib
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib/ $(INGENIC_OSDRV_T23_PKGDIR)/files/lib/*
endef
$(eval $(generic-package))