SoC c3 : Addd sensor type [1/1]
PD#SWPL-173723
Problem:
RTOS sensor init fail
Solution:
Add sensor type
Verify:
N/A
Change-Id: I631f89273fe7cd3a7a2b9ff68b1f6b2d01489820
Signed-off-by: yongbing.he <yongbing.he@amlogic.com>
diff --git a/c3_fastboot.sh b/c3_fastboot.sh
index 92b0927..c8faad0 100755
--- a/c3_fastboot.sh
+++ b/c3_fastboot.sh
@@ -23,6 +23,10 @@
BOARD_TYPE=$3
if [ $4 ] && [[ "$4" =~ ^0x.* ]]; then
RTOS_TARGET_ADDRESS=$4
+
+ fi
+ if [ $5 ] && [[ "$5" =~ ^SENSOR=.* ]]; then
+ SENSOR_TYPE=${5#SENSOR=}
fi
fi
@@ -57,6 +61,17 @@
exit 0
fi
+if [ -z $SENSOR_TYPE ]; then
+ case $BOARD_TYPE_MAPPING in
+ 'c3_aw402')
+ SENSOR_TYPE=SC301IOT
+ ;;
+ *)
+ SENSOR_TYPE=IMX290
+ ;;
+ esac
+fi
+
#Get the rtos target address (The configuration needs to be consistent with the lscript.h file)
if [ -z $RTOS_TARGET_ADDRESS ]; then
case $BOARD_TYPE_MAPPING in
@@ -124,6 +139,13 @@
sed -i '/.*#define CONFIG_SCATTER_LOAD_ADDRESS*/c\#define CONFIG_SCATTER_LOAD_ADDRESS '${RTOS2_TARGET_ADDRESS}'' $CONFIG_FILE
}
+function sensor_config_choose() {
+ sed -i '/CONFIG_SENSOR_SC401AI/d' $RTOS_BASE_DIR/boards/$ARCH/$BOARD/defconfig
+ if [ "${SENSOR_TYPE}" == "SC401AI" ]; then
+ sed -i '$ a CONFIG_SENSOR_SC401AI=y' $RTOS_BASE_DIR/boards/$ARCH/$BOARD/defconfig
+ fi
+}
+
function lz4_rtos() {
pushd $RTOS_BASE_DIR/lib/utilities/lz4
cp $RTOS_IMAGE_A .
@@ -193,6 +215,8 @@
if [ $4 ] && [[ "$4" =~ ^0x.* ]]; then
rtos_config_prepare
fi
+#choose sensor
+sensor_config_choose
#Compile toolchain preparation
toolchain_prepare
#compile the rtos image