[Ingenic] Add T30 OSDRV (#657)

pull/658/head
Dmitry Ermakov 2023-03-05 07:49:31 +03:00 committed by GitHub
parent cbc925dd4b
commit e686f246de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
129 changed files with 2351 additions and 2 deletions

View File

@ -244,6 +244,8 @@ jobs:
release: lite
- platform: t21
release: lite
- platform: t30
release: lite
- platform: xm510
release: lite
- platform: xm530

View File

@ -1,6 +1,7 @@
source "$BR2_EXTERNAL_INGENIC_PATH/linux/Config.ext.in"
source "$BR2_EXTERNAL_INGENIC_PATH/package/ingenic-osdrv-t20/Config.in"
source "$BR2_EXTERNAL_INGENIC_PATH/package/ingenic-osdrv-t21/Config.in"
source "$BR2_EXTERNAL_INGENIC_PATH/package/ingenic-osdrv-t30/Config.in"
source "$BR2_EXTERNAL_INGENIC_PATH/package/ingenic-osdrv-t31/Config.in"
source "$BR2_EXTERNAL_INGENIC_PATH/package/ingenic_patcher/Config.in"
source "$BR2_EXTERNAL_INGENIC_PATH/package/aura-httpd/Config.in"

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.10.14"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_INGENIC_PATH)/board/t31/kernel/t30.generic.config"
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_INGENIC_PATH)/board/t30/kernel/t30.generic.config"
BR2_LINUX_KERNEL_UIMAGE=y
BR2_LINUX_KERNEL_LZMA=y
BR2_LINUX_KERNEL_EXT_INGENIC_PATCHER=y
@ -54,7 +54,7 @@ BR2_PACKAGE_BUSYBOX_CONFIG="$(TOPDIR)/../general/package/busybox/busybox.config"
BR2_PACKAGE_DROPBEAR_OPENIPC=y
# BR2_PACKAGE_FDK_AAC_OPENIPC is not set
BR2_PACKAGE_FWPRINTENV_OPENIPC=y
# BR2_PACKAGE_INGENIC_OSDRV_T30=y
BR2_PACKAGE_INGENIC_OSDRV_T30=y
BR2_PACKAGE_HASERL=y
# BR2_PACKAGE_HISI_GPIO is not set
BR2_PACKAGE_IPCTOOL=y

View File

@ -0,0 +1 @@
../../general/package/ingenic-osdrv-t30

View File

@ -0,0 +1,6 @@
config BR2_PACKAGE_INGENIC_OSDRV_T30
bool "ingenic-osdrv-t30"
help
ingenic-osdrv-t30 - Ingenic kernel modules and libs
https://openipc.org

View File

@ -0,0 +1,86 @@
#!/bin/sh
DAEMON="majestic"
PIDFILE="/var/run/$DAEMON.pid"
DAEMON_ARGS="-s"
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
load_majestic() {
printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting
[ -f /etc/coredump.conf ] && . /etc/coredump.conf
if [ "$coredump_enabled" ]; then
[ "$(yaml-cli -i /etc/majestic.yaml -g .watchdog.timeout)" -lt "30" ] && yaml-cli -i /etc/majestic.yaml -s .watchdog.timeout 30
ulimit -c unlimited && echo "|/usr/sbin/sendcoredump.sh" >/proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
# The daemon does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one.
start() {
logger -s -p daemon.info -t ingenic "Check MAC for Ingenic devices"
if [ "$(fw_printenv -n ethaddr)" = "00:00:23:34:45:66" ]; then
logger -s -p daemon.info -t ingenic "The eth0 interface has a lousy MAC, please change it.."
else
logger -s -p daemon.info -t ingenic "The eth0 interface has a correct MAC - $(fw_printenv -n ethaddr)"
fi
#
logger -s -p daemon.info -t ingenic "Loading of kernel modules and initialization of the video system has started"
export TZ=$(cat /etc/TZ)
load_ingenic
#
#
# export SENSOR=$(fw_printenv -n sensor)
export SENSOR=$(cat /proc/jz/sinfo/info | sed -e 's/.*://')
SENSOR=$(cat /proc/jz/sinfo/info | sed -e 's/.*://')
if [ "sensor not found" = "$SENSOR" ]; then
unset SENSOR
else
export SENSOR=$SENSOR
fi
load_majestic
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
start-stop-daemon -K -q -p "$PIDFILE"
status=$?
if [ "$status" -eq 0 ]; then
rm -f "$PIDFILE"
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
sleep 1
reload
}
reload() {
load_majestic
}
case "$1" in
start|stop|restart|reload)
"$1";;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

View File

@ -0,0 +1,77 @@
#!/bin/sh
KMOD_PATH=/lib/modules/3.10.14__isvp_monkey_1.0__/ingenic
echo 1 >/proc/sys/vm/overcommit_memory
check_return() {
if [ $? -ne 0 ]; then
echo err: $1
echo exit
exit
fi
}
lsmod | grep "sinfo" >/dev/null
if [ $? -ne 0 ]; then
insmod ${KMOD_PATH/%\//}/sinfo.ko
check_return "insmod sinfo"
fi
echo 1 >/proc/jz/sinfo/info
check_return "start sinfo"
if fw_printenv -n sensor >/dev/null; then
export SENSOR=$(fw_printenv -n sensor)
logger -s -p daemon.info -t ingenic "Get data from environment and set SENSOR as ${SENSOR}"
else
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
logger -s -p daemon.info -t ingenic "Get data from sinfo and set SENSOR as ${SENSOR}"
fw_setenv sensor $SENSOR && logger -s -p daemon.info -t ingenic "Write detected ${SENSOR} to U-Boot ENV"
fi
fi
case ${SENSOR} in
*)
ISP_PARAM=""
SENSOR_PARAM=""
break
;;
esac
echo --------------------
echo "ISP_PARAM: ${ISP_PARAM}"
echo "SENSOR: ${SENSOR}"
echo "SENSOR_PARAM: ${SENSOR_PARAM}"
echo --------------------
lsmod | grep "tx_isp" >/dev/null
if [ $? -ne 0 ]; then
insmod ${KMOD_PATH/%\//}/tx-isp-t30.ko ${ISP_PARAM}
check_return "insmod isp drv"
fi
lsmod | grep "audio" >/dev/null
if [ $? -ne 0 ]; then
insmod ${KMOD_PATH/%\//}/audio.ko
check_return "insmod audio"
fi
lsmod | grep ${SENSOR} >/dev/null
if [ $? -ne 0 ]; then
insmod ${KMOD_PATH/%\//}/sensor_${SENSOR}_t30.ko ${SENSOR_PARAM}
check_return "insmod sensor drv"
fi
#
# Need for claim gpio 57,58 on HICHIP (CamHi/Xin) boards
insmod ${KMOD_PATH/%\//}/gpio.ko
echo $(yaml-cli -i /etc/majestic.yaml -g .nightMode.irCutPin1) >/proc/jz/claim/gpio
echo $(yaml-cli -i /etc/majestic.yaml -g .nightMode.irCutPin2) >/proc/jz/claim/gpio
# echo $(yaml-cli -i /etc/majestic.yaml -g .nightMode.irSensorPin) >/proc/jz/claim/gpio
#

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: gc4653
address: 0x29
width: 2560
height: 1440
bus: i2c

View File

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

View File

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

View File

@ -0,0 +1,6 @@
sensor:
name: jxf22
address: 0x40
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: jxf37
address: 0x40
width: 1920
height: 1080
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: jxh42
address: 0x30
width: 1280
height: 720
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: jxh62
address: 0x30
width: 1280
height: 720
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: jxq03
address: 0x40
width: 2304
height: 1296
bus: i2c

View File

@ -0,0 +1,6 @@
sensor:
name: jxq03p
address: 0x40
width: 2304
height: 1296
bus: i2c

View File

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

View File

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

View File

@ -0,0 +1,6 @@
sensor:
name: ov4689
address: 0x36
width: 2048
height: 1520
bus: i2c

Some files were not shown because too many files have changed in this diff Show More