forked from Fishwaldo/sophgo-sg200x-debian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
314 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
$(BUILDDIR)/sensor-config-package-stamp: | ||
@echo "$(COLOUR_GREEN)Packaging sensor-config for $(BOARD)$(END_COLOUR)" | ||
@mkdir -p $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION) | ||
@cp -r /builder/deb/sensor-config/* $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/ | ||
@mkdir -pv $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/etc/init.d/ | ||
@cp -a addons/sensor-config/sensor-config.sh $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/etc/init.d/ | ||
@chmod +x $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/etc/init.d/sensor-config.sh | ||
@mkdir -pv $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/etc/systemd/system/ | ||
@cp -a addons/sensor-config/sensor-config*.service $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/etc/systemd/system/ | ||
@mkdir -pv $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/cfg/param/ | ||
@rsync -avpPxH addons/sensor-config/overlay/mnt/cfg/param/ $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/cfg/param/ | ||
@rm -f $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/cfg/param/cvi_sdr_bin | ||
@mkdir -pv $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/data/ | ||
@rsync -avpPxH addons/sensor-config/overlay/mnt/data/ $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/data/ | ||
@rm -f $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/data/sensor_cfg.ini | ||
@sed -i 's/Version: 1.0.0/Version: $(MIDDLEWAREVERSION)/' $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/DEBIAN/control | ||
@sed -i 's/Package: sensor-config/Package: sensor-config-$(BOARD)/' $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/DEBIAN/control | ||
@cd $(BUILDDIR)/package/ && dpkg-deb --build sensor-config-$(BOARD)-$(MIDDLEWAREVERSION) sensor-config-$(BOARD)_$(MIDDLEWAREVERSION)_$(DEB_ARCH).deb | ||
@cp $(BUILDDIR)/package/sensor-config-$(BOARD)_$(MIDDLEWAREVERSION)_$(DEB_ARCH).deb /output/ | ||
@mkdir -p /rootfs/tmp/install/ | ||
@cp /output/sensor-config-*.deb /rootfs/tmp/install/ | ||
@touch $@ | ||
|
||
$(BUILDDIR)/sensor-config-stamp: $(BUILDDIR)/sensor-config-package-stamp | ||
@echo "$(COLOUR_GREEN)Installing sensor-config for $(BOARD)$(END_COLOUR)" | ||
@mkdir -pv /rootfs/boot/ | ||
@[ "$(BOARD)" = "licheervnano" ] || @touch /rootfs/boot/epsilon | ||
@mkdir -pv /rootfs/mnt/cfg/param/ | ||
@mkdir -pv /rootfs/mnt/data/ | ||
@if [ "$(BOARD)" = "licheervnano" ]; then \ | ||
cp -p addons/sensor-config/overlay/mnt/cfg/param/sipeed_gc4653_30fps_202403261356.bin /rootfs/mnt/cfg/param/cvi_sdr_bin ; \ | ||
elif [ "$(BOARD)" = "duo256" ]; then \ | ||
cp -p addons/sensor-config/overlay/mnt/cfg/param/cvi_sdr_bin_GC2083 /rootfs/mnt/cfg/param/cvi_sdr_bin && \ | ||
cp -p addons/sensor-config/overlay/mnt/data/sensor_cfg_GC2083.ini /rootfs/mnt/data/sensor_cfg.ini ; \ | ||
fi | ||
@mkdir -p /rootfs/tmp/install/ | ||
@echo " sensor-config" >> /rootfs/tmp/install/systemd-enable | ||
@touch $@ |
Binary file added
BIN
+214 KB
scripts/addons/sensor-config/overlay/mnt/cfg/param/cvi_sdr_bin.os04a10
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+224 KB
scripts/addons/sensor-config/overlay/mnt/cfg/param/cvi_sdr_bin_OV5647.bin
Binary file not shown.
Binary file added
BIN
+217 KB
scripts/addons/sensor-config/overlay/mnt/cfg/param/sipeed_gc4653_30fps_202403261356.bin
Binary file not shown.
34 changes: 34 additions & 0 deletions
34
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg.ini.LT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[source] | ||
|
||
;type = SOURCE_USER_FE | ||
|
||
dev_num = 1 | ||
|
||
; section for sensor | ||
|
||
[sensor] | ||
|
||
; sensor name | ||
name = LONTIUM_LT6911_2M_60FPS_8BIT | ||
|
||
bus_id = 4 | ||
|
||
sns_i2c_addr = ff | ||
|
||
mipi_dev = 0 | ||
|
||
lane_id = 2, 4, 3, 1, 0 | ||
|
||
pn_swap = 0, 0, 0, 0, 0 | ||
|
||
mclk_en = 0 | ||
|
||
mclk = 0 | ||
|
||
;port = 0 | ||
|
||
;pin = 2 | ||
|
||
;pol = 1 | ||
|
||
fps = 60 |
34 changes: 34 additions & 0 deletions
34
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg.ini.OA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[source] | ||
|
||
;type = SOURCE_USER_FE | ||
|
||
dev_num = 1 | ||
|
||
; section for sensor | ||
|
||
[sensor] | ||
|
||
; sensor name | ||
name = OV_OS04A10_MIPI_4M_1440P_30FPS_12BIT | ||
|
||
bus_id = 4 | ||
|
||
sns_i2c_addr = 36 | ||
|
||
mipi_dev = 0 | ||
|
||
lane_id = 2, 1, 3, 0, 4 | ||
|
||
pn_swap = 0, 0, 0, 0, 0 | ||
|
||
mclk_en = 0 | ||
|
||
mclk = 0 | ||
|
||
;port = 0 | ||
|
||
;pin = 2 | ||
|
||
;pol = 1 | ||
|
||
;fps = 30 |
34 changes: 34 additions & 0 deletions
34
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg.ini.SC035
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[source] | ||
|
||
;type = SOURCE_USER_FE | ||
|
||
dev_num = 1 | ||
|
||
; section for sensor | ||
|
||
[sensor] | ||
|
||
; sensor name | ||
name = SMS_SC035GS_MIPI_480P_120FPS_12BIT | ||
|
||
bus_id = 4 | ||
|
||
sns_i2c_addr = 30 | ||
|
||
mipi_dev = 0 | ||
|
||
lane_id = 4, 3, 2, -1, -1 | ||
|
||
pn_swap = 0, 0, 0, 0, 0 | ||
|
||
mclk_en = 1 | ||
|
||
mclk = 1 | ||
|
||
;port = 0 | ||
|
||
;pin = 2 | ||
|
||
;pol = 1 | ||
|
||
;fps = 30 |
34 changes: 34 additions & 0 deletions
34
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg.ini.alpha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[source] | ||
|
||
;type = SOURCE_USER_FE | ||
|
||
dev_num = 1 | ||
|
||
; section for sensor | ||
|
||
[sensor] | ||
|
||
; sensor name | ||
name = GCORE_GC4653_MIPI_4M_30FPS_10BIT | ||
|
||
bus_id = 4 | ||
|
||
sns_i2c_addr = 29 | ||
|
||
mipi_dev = 0 | ||
|
||
lane_id = 2, 1, 0, -1, -1 | ||
|
||
pn_swap = 0, 0, 0, 0, 0 | ||
|
||
mclk_en = 1 | ||
|
||
mclk = 0 | ||
|
||
;port = 0 | ||
|
||
;pin = 2 | ||
|
||
;pol = 1 | ||
|
||
;fps = 30 |
34 changes: 34 additions & 0 deletions
34
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg.ini.beta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[source] | ||
|
||
;type = SOURCE_USER_FE | ||
|
||
dev_num = 1 | ||
|
||
; section for sensor | ||
|
||
[sensor] | ||
|
||
; sensor name | ||
name = GCORE_GC4653_MIPI_4M_30FPS_10BIT | ||
|
||
bus_id = 4 | ||
|
||
sns_i2c_addr = 29 | ||
|
||
mipi_dev = 0 | ||
|
||
lane_id = 4, 3, 2, -1, -1 | ||
|
||
pn_swap = 0, 0, 0, 0, 0 | ||
|
||
mclk_en = 1 | ||
|
||
mclk = 1 | ||
|
||
;port = 0 | ||
|
||
;pin = 2 | ||
|
||
;pol = 1 | ||
|
||
;fps = 30 |
14 changes: 14 additions & 0 deletions
14
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg_GC2083.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
;section for source | ||
[source] | ||
;type = SOURCE_USER_FE | ||
dev_num = 1 | ||
;section for sensor | ||
[sensor] | ||
;sensor name | ||
name = GCORE_GC2083_MIPI_2M_30FPS_10BIT | ||
;bus/i2c dev number | ||
bus_id = 2 | ||
sns_i2c_addr = 37 | ||
mipi_dev = 0 | ||
lane_id = 1, 0, 2, -1, -1 | ||
pn_swap = 0, 0, 0, 0, 0 |
14 changes: 14 additions & 0 deletions
14
scripts/addons/sensor-config/overlay/mnt/data/sensor_cfg_OV5647.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
;section for source | ||
[source] | ||
;type = SOURCE_USER_FE | ||
dev_num = 1 | ||
;section for sensor | ||
[sensor] | ||
;sensor name | ||
name = OV_OV5647_MIPI_2M_30FPS_10BIT | ||
;bus/i2c dev number | ||
bus_id = 2 | ||
sns_i2c_addr = 36 | ||
mipi_dev = 0 | ||
lane_id = 1, 0, 2, -1, -1 | ||
pn_swap = 0, 0, 0, 0, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Configure Sensor | ||
After=load-systemko.service | ||
Before=device-key.service | ||
Before=network.target | ||
StartLimitIntervalSec=0 | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=busybox sh /etc/init.d/sensor-config.sh start | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/sh | ||
|
||
if [ "$1" = "start" ] | ||
then | ||
. /etc/profile | ||
printf "copy sensor config file: " | ||
if [ -e /boot/alpha ] | ||
then | ||
if [ ! -e /mnt/data/sensor_cfg.ini ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.alpha /mnt/data/sensor_cfg.ini | ||
fi | ||
if [ $(cat /mnt/data/sensor_cfg.ini | wc -l) -eq 0 ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.beta /mnt/data/sensor_cfg.ini | ||
fi | ||
# MIPI RX 4N PINMUX MCLK0 | ||
devmem 0x0300116C 32 0x5 | ||
# MIPI RX 0N PINMUX MIPIP RX 0N | ||
devmem 0x0300118C 32 0x3 | ||
echo " alpha " | ||
elif [ -e /boot/epsilon ] | ||
then | ||
if [ ! -e /mnt/data/sensor_cfg.ini ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.alpha /mnt/data/sensor_cfg.ini | ||
fi | ||
if [ $(cat /mnt/data/sensor_cfg.ini | wc -l) -eq 0 ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.beta /mnt/data/sensor_cfg.ini | ||
fi | ||
# MIPI RX 4N PINMUX no change | ||
# | ||
# MIPI RX 0N PINMUX no change | ||
# | ||
echo " epsilon " | ||
else | ||
if [ ! -e /mnt/data/sensor_cfg.ini ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.beta /mnt/data/sensor_cfg.ini | ||
fi | ||
if [ $(cat /mnt/data/sensor_cfg.ini | wc -l) -eq 0 ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.beta /mnt/data/sensor_cfg.ini | ||
fi | ||
# MIPI RX 4N PINMUX MIPI RX 4N | ||
devmem 0x0300116C 32 0x3 | ||
# MIPI RX 0N PINMUX MCLK1 | ||
devmem 0x0300118C 32 0x5 | ||
echo -n " beta " | ||
fi | ||
if [ -e /boot/kvmtest ] | ||
then | ||
cp /mnt/data/sensor_cfg.ini.LT /mnt/data/sensor_cfg.ini | ||
fi | ||
echo "OK" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Package: sensor-config | ||
Architecture: riscv64 | ||
Maintainer: @scpcom | ||
Priority: optional | ||
Version: 1.0.0 | ||
Description: sensor-config for the CV18xx and SG200X series of RISC-V SoC's |