[Sigmastar] update infinit6e sensor handling

pull/730/head
Viktor 2023-04-19 16:32:14 +02:00 committed by viktorxda
parent a5f1f0de1e
commit 0feaa8f0b3
18 changed files with 49 additions and 79 deletions

View File

@ -79,7 +79,6 @@ BR2_PACKAGE_MICROBE_WEB=y
BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E=y BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E=y
BR2_PACKAGE_SIGMASTAR_OSDRV_SENSOR="imx415"
BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
BR2_PACKAGE_EXFAT_OPENIPC=y BR2_PACKAGE_EXFAT_OPENIPC=y

View File

@ -2,8 +2,3 @@ config BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E
bool "sigmastar-osdrv-infinity6e" bool "sigmastar-osdrv-infinity6e"
help help
sigmastar-osdrv-infinity6e - SigmaStar kernel modules and libs sigmastar-osdrv-infinity6e - SigmaStar kernel modules and libs
config BR2_PACKAGE_SIGMASTAR_OSDRV_SENSOR
depends on BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E
string "Camera sensor"
default "imx415"

View File

@ -1,17 +1,17 @@
#!/bin/sh #!/bin/sh
# #
# OpenIPC.org | 2023.03.01 # OpenIPC.org | 2023.04.01
# #
# Usage: load_sigmastar [-r|-i|-a] # Usage: load_sigmastar [ -r | -i ]
# -r : remove all modules # -r : remove all modules
# -i : insert all modules # -i : insert all modules
# default : remove and insert all modules # default : insert all modules
PATH_MODULE=/lib/modules/4.9.84/sigmastar PATH_MODULE=/lib/modules/4.9.84/sigmastar
PATH_FIRMWARE=/etc/sensors/venc_fw/chagall.bin PATH_FIRMWARE=/etc/sensors/venc_fw/chagall.bin
# Sensor # Sensor
sensor= sensor=$(fw_printenv -n sensor)
# Watchdog # Watchdog
watchdog -t 10 /dev/watchdog watchdog -t 10 /dev/watchdog
@ -27,36 +27,16 @@ insert_ko() {
insmod ${PATH_MODULE}/mi_mipitx.ko insmod ${PATH_MODULE}/mi_mipitx.ko
insmod ${PATH_MODULE}/mi_sensor.ko insmod ${PATH_MODULE}/mi_sensor.ko
insmod ${PATH_MODULE}/mi_shadow.ko insmod ${PATH_MODULE}/mi_shadow.ko
insmod ${PATH_MODULE}/mi_divp.ko thread_priority=98 insmod ${PATH_MODULE}/mi_divp.ko
insmod ${PATH_MODULE}/mi_vif.ko thread_priority=98 insmod ${PATH_MODULE}/mi_vif.ko
insmod ${PATH_MODULE}/mi_vpe.ko thread_priority=98 insmod ${PATH_MODULE}/mi_vpe.ko
insmod ${PATH_MODULE}/mi_venc.ko fw_path=${PATH_FIRMWARE}
insmod ${PATH_MODULE}/sensor_${sensor}_mipi.ko chmap=1
case $sensor in major=$(awk '$2=="mi_poll" {print $1}' /proc/devices)
imx415)
insmod ${PATH_MODULE}/mi_venc.ko fw_path=${PATH_FIRMWARE};
;;
*)
echo -e "\n\e[1;31mAn UNSUPPORTED sensor type is specified - ${sensor}\e[0m\n" | logger -s -t OpenIPC;
;;
esac
if [ ! -e /dev/mi_poll ]; then
major=$(awk '$2=="mi_poll" {print $1}' /proc/devices | head -n 1)
mknod /dev/mi_poll c $major 0 mknod /dev/mi_poll c $major 0
fi
# Change iqfile folder
echo isproot /etc/sensors/iqfile > /dev/ispmid echo isproot /etc/sensors/iqfile > /dev/ispmid
case $sensor in
imx415)
insmod ${PATH_MODULE}/sensor_${sensor}_mipi.ko chmap=1;
;;
*)
echo -e "\n\e[1;31mAn UNSUPPORTED sensor type is specified - ${sensor}\e[0m\n" | logger -s -t OpenIPC;
;;
esac
mdev -s mdev -s
} }
@ -80,6 +60,8 @@ remove_ko() {
if [ -z ${sensor} ]; then if [ -z ${sensor} ]; then
echo -e "\n\e[1;31mThe sensor parameter is MISSING\e[0m\n" | logger -s -t OpenIPC echo -e "\n\e[1;31mThe sensor parameter is MISSING\e[0m\n" | logger -s -t OpenIPC
echo -e "\n\e[1;33mUsage: fw_setenv sensor imx415\e[0m\n" | logger -s -t OpenIPC
echo -e "\n\e[1;33m load_sigmastar\e[0m\n" | logger -s -t OpenIPC
exit 1 exit 1
else else
echo -e "\n\e[1;32mThe sensor is assigned - ${sensor}\e[0m\n" | logger -s -t OpenIPC echo -e "\n\e[1;32mThe sensor is assigned - ${sensor}\e[0m\n" | logger -s -t OpenIPC
@ -93,8 +75,7 @@ if [ "$1" = "-r" ]; then
remove_ko remove_ko
fi fi
if [ $# -eq 0 ] || [ "$1" = "-a" ]; then if [ $# -eq 0 ]; then
remove_ko
insert_ko insert_ko
fi fi

View File

@ -10,7 +10,6 @@ SIGMASTAR_OSDRV_INFINITY6E_LICENSE = MIT
SIGMASTAR_OSDRV_INFINITY6E_LICENSE_FILES = LICENSE SIGMASTAR_OSDRV_INFINITY6E_LICENSE_FILES = LICENSE
SIGMASTAR_OSDRV_INFINITY6E_PATH = $(SIGMASTAR_OSDRV_INFINITY6E_PKGDIR)/files SIGMASTAR_OSDRV_INFINITY6E_PATH = $(SIGMASTAR_OSDRV_INFINITY6E_PKGDIR)/files
SIGMASTAR_OSDRV_INFINITY6E_SENSOR = $(call qstrip,$(BR2_PACKAGE_SIGMASTAR_OSDRV_SENSOR))
define SIGMASTAR_OSDRV_INFINITY6E_INSTALL_TARGET_CMDS define SIGMASTAR_OSDRV_INFINITY6E_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
@ -21,17 +20,13 @@ define SIGMASTAR_OSDRV_INFINITY6E_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/4.9.84/sigmastar
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/kmod/*.ko $(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/kmod/*.ko
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/sensor/$(SIGMASTAR_OSDRV_INFINITY6E_SENSOR)/*.ko $(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/sensor/kmod/*.ko
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/sensors/iqfile $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/sensors/iqfile
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensors/iqfile $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/sensor/$(SIGMASTAR_OSDRV_INFINITY6E_SENSOR)/$(SIGMASTAR_OSDRV_INFINITY6E_SENSOR)_iqfile.bin $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensors/iqfile $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/sensor/iqfile/iqfile0.bin
ln -sf $(SIGMASTAR_OSDRV_INFINITY6E_SENSOR)_iqfile.bin $(TARGET_DIR)/etc/sensors/iqfile/iqfile0.bin
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/sensors/venc_fw $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/sensors/venc_fw
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensors/venc_fw $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/sensor/venc_fw/chagall.bin $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensors/venc_fw $(SIGMASTAR_OSDRV_INFINITY6E_PATH)/sensor/venc_fw/chagall.bin
# Set sensor for insmod
sed -i "s/sensor=/sensor=$(SIGMASTAR_OSDRV_INFINITY6E_SENSOR)/g" $(TARGET_DIR)/usr/bin/load_sigmastar
endef endef
$(eval $(generic-package)) $(eval $(generic-package))