Skip to content

Commit 0af4a0e

Browse files
committed
tate: add specific camera dcc files + provisioning
Change-Id: I9ee815b2f04e8448c68e5cc16c4d938f2d2accce
1 parent 72088b4 commit 0af4a0e

File tree

58 files changed

+402
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+402
-2
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/system/bin/sh
2+
3+
calsourcefile=/efs/cal/camera/camera.cal
4+
caltargetfile=/data/misc/camera/R01_MVEN002_LD0_ND0_IR0_SH0_FL0_SVEN002_DCCID46/camera.cal
5+
dccsourcefolder=/system/vendor/camera/R01_MVEN002_LD0_ND0_IR0_SH0_FL0_SVEN002_DCCID46
6+
dcctargetfolder=/data/misc/camera/R01_MVEN002_LD0_ND0_IR0_SH0_FL0_SVEN002_DCCID46
7+
dcccheckfile=/data/misc/camera/R01_MVEN002_LD0_ND0_IR0_SH0_FL0_SVEN002_DCCID46/cid44_OV9726_alg_3a_ae_dcc.bin
8+
statusfile=/efs/cal/camera/camera_status
9+
10+
if [ -e $caltargetfile ] && [ -e $dcccheckfile ]
11+
then
12+
exit 0
13+
fi
14+
15+
if [ ! -e $dcctargetfolder ]
16+
then
17+
mkdir -p $dcctargetfolder
18+
fi
19+
20+
if [ ! -e $caltargetfile ]
21+
then
22+
if [ -e $calsourcefile ]
23+
then
24+
ln -s $calsourcefile $caltargetfile
25+
fi
26+
fi
27+
28+
if [ ! -e $dcccheckfile ]
29+
then
30+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_ae_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_ae_dcc.bin
31+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_cfai_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_cfai_dcc.bin
32+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_ae_mms2_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_ae_mms2_dcc.bin
33+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_cgs_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_cgs_dcc.bin
34+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_ae_ti2_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_ae_ti2_dcc.bin
35+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_dpc_lut_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_dpc_lut_dcc.bin
36+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_affw_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_affw_dcc.bin
37+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_dpc_otf.bin $dcctargetfolder/cid44_OV9726_ipipe_dpc_otf.bin
38+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_affw_dcc_tuning.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_affw_dcc_tuning.bin
39+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_ee_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_ee_dcc.bin
40+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_caf_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_caf_dcc.bin
41+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_gbce_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_gbce_dcc.bin
42+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_caf_dcc_tuning.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_caf_dcc_tuning.bin
43+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_gic_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_gic_dcc.bin
44+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_hllc_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_hllc_dcc.bin
45+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_lsc_poly_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_lsc_poly_dcc.bin
46+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_hllc_dcc_tuning.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_hllc_dcc_tuning.bin
47+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_nf1_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_nf1_dcc.bin
48+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_saf_dcc.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_saf_dcc.bin
49+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_nf2_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_nf2_dcc.bin
50+
ln -s $dccsourcefolder/cid44_OV9726_alg_3a_af_saf_dcc_tuning.bin $dcctargetfolder/cid44_OV9726_alg_3a_af_saf_dcc_tuning.bin
51+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_rgb2rgb_1_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_rgb2rgb_1_dcc.bin
52+
ln -s $dccsourcefolder/cid44_OV9726_alg_adjust_rgb2rgb_dcc.bin $dcctargetfolder/cid44_OV9726_alg_adjust_rgb2rgb_dcc.bin
53+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_rgb2rgb_2_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_rgb2rgb_2_dcc.bin
54+
ln -s $dccsourcefolder/cid44_OV9726_awb_alg_ti3_gains_adjust.bin $dcctargetfolder/cid44_OV9726_awb_alg_ti3_gains_adjust.bin
55+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_rgb2yuv_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_rgb2yuv_dcc.bin
56+
ln -s $dccsourcefolder/cid44_OV9726_awb_alg_ti3_tuning.bin $dcctargetfolder/cid44_OV9726_awb_alg_ti3_tuning.bin
57+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_rsz_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_rsz_dcc.bin
58+
ln -s $dccsourcefolder/cid44_OV9726_capabilities.bin $dcctargetfolder/cid44_OV9726_capabilities.bin
59+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_yuv444_to_yuv422_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_yuv444_to_yuv422_dcc.bin
60+
ln -s $dccsourcefolder/cid44_OV9726_ducati_awb_ti2_tun.bin $dcctargetfolder/cid44_OV9726_ducati_awb_ti2_tun.bin
61+
ln -s $dccsourcefolder/cid44_OV9726_isif_clamp_dcc.bin $dcctargetfolder/cid44_OV9726_isif_clamp_dcc.bin
62+
ln -s $dccsourcefolder/cid44_OV9726_ducati_eff_tun.bin $dcctargetfolder/cid44_OV9726_ducati_eff_tun.bin
63+
ln -s $dccsourcefolder/cid44_OV9726_isif_csc_dcc.bin $dcctargetfolder/cid44_OV9726_isif_csc_dcc.bin
64+
ln -s $dccsourcefolder/cid44_OV9726_ducati_gamma.bin $dcctargetfolder/cid44_OV9726_ducati_gamma.bin
65+
ln -s $dccsourcefolder/cid44_OV9726_iss_glbce3_dcc.bin $dcctargetfolder/cid44_OV9726_iss_glbce3_dcc.bin
66+
ln -s $dccsourcefolder/cid44_OV9726_ducati_lsc_2d.bin $dcctargetfolder/cid44_OV9726_ducati_lsc_2d.bin
67+
ln -s $dccsourcefolder/cid44_OV9726_iss_lbce_dcc.bin $dcctargetfolder/cid44_OV9726_iss_lbce_dcc.bin
68+
ln -s $dccsourcefolder/cid44_OV9726_ducati_nsf_ldc.bin $dcctargetfolder/cid44_OV9726_ducati_nsf_ldc.bin
69+
ln -s $dccsourcefolder/cid44_OV9726_iss_scene_modes_dcc.bin $dcctargetfolder/cid44_OV9726_iss_scene_modes_dcc.bin
70+
ln -s $dccsourcefolder/cid44_OV9726_face_detect_dcc.bin $dcctargetfolder/cid44_OV9726_face_detect_dcc.bin
71+
ln -s $dccsourcefolder/cid44_ov9726_iss_vstab_dcc.bin $dcctargetfolder/cid44_ov9726_iss_vstab_dcc.bin
72+
ln -s $dccsourcefolder/cid44_OV9726_face_tracking_dcc.bin $dcctargetfolder/cid44_OV9726_face_tracking_dcc.bin
73+
ln -s $dccsourcefolder/cid44_OV9726_ldc_cac_cfg_dcc.bin $dcctargetfolder/cid44_OV9726_ldc_cac_cfg_dcc.bin
74+
ln -s $dccsourcefolder/cid44_OV9726_gbce_sw1_dcc.bin $dcctargetfolder/cid44_OV9726_gbce_sw1_dcc.bin
75+
ln -s $dccsourcefolder/cid44_OV9726_ldc_cfg_dcc.bin $dcctargetfolder/cid44_OV9726_ldc_cfg_dcc.bin
76+
ln -s $dccsourcefolder/cid44_OV9726_h3a_aewb_dcc.bin $dcctargetfolder/cid44_OV9726_h3a_aewb_dcc.bin
77+
ln -s $dccsourcefolder/cid44_OV9726_lsc_interp.bin $dcctargetfolder/cid44_OV9726_lsc_interp.bin
78+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_3d_lut_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_3d_lut_dcc.bin
79+
ln -s $dccsourcefolder/cid44_OV9726_vnf_cfg_dcc.bin $dcctargetfolder/cid44_OV9726_vnf_cfg_dcc.bin
80+
ln -s $dccsourcefolder/cid44_OV9726_ipipe_car_dcc.bin $dcctargetfolder/cid44_OV9726_ipipe_car_dcc.bin
81+
ln -s $dccsourcefolder/cid44_OV9726_current_module_calibration.bin $dcctargetfolder/cid44_OV9726_current_module_calibration.bin
82+
ln -s $dccsourcefolder/cid44_OV9726_golden_module_calibration.bin $dcctargetfolder/cid44_OV9726_golden_module_calibration.bin
83+
ln -s $dccsourcefolder/cid65535_kgen_dcc_preflash.bin $dcctargetfolder/cid65535_kgen_dcc_preflash.bin
84+
fi
85+
86+
if [ -e $caltargetfile ]
87+
then
88+
camcalstatus="PASS"
89+
else
90+
camcalstatus="FAILED"
91+
fi
92+
93+
if [ -e $dcccheckfile ]
94+
then
95+
camdccstatus="PASS"
96+
else
97+
camdccstatus="FAILED"
98+
fi
99+
100+
if [ -e $statusfile ]
101+
then
102+
rm $statusfile
103+
fi
104+
105+
echo "CAMERACAL:$camcalstatus" >> $statusfile
106+
echo "CAMERADCC:$camdccstatus" >> $statusfile
107+
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
#!/system/bin/sh
2+
3+
logfile=/efs/provisioning_log
4+
statusfile=/efs/provisioning_status
5+
6+
PROVISION_FAILED_PPM=/system/vendor/data/images/provisioning_failed.ppm
7+
FB_PATH=/dev/graphics/fb0
8+
FAIL_FLAG=/efs/failed_provisioning
9+
ALWAYS_BLOCK=0
10+
11+
block_Screen(){
12+
13+
# Give a chance to let other process related to DSS and FB satble
14+
/system/bin/sleep 5
15+
16+
while [ true ]
17+
do
18+
/system/bin/touch $FAIL_FLAG
19+
/system/bin/stop
20+
/system/bin/cat $PROVISION_FAILED_PPM > $FB_PATH
21+
/system/bin/sleep 5
22+
done
23+
}
24+
25+
# block screen if ALWAYS_BLOCK enabled
26+
if [ $ALWAYS_BLOCK -eq 1 ]
27+
then
28+
if [ -e $FAIL_FLAG ]
29+
then
30+
block_Screen
31+
fi
32+
fi
33+
34+
if [ -e /vendor/etc/provisioning/provisioning_forced ] || [ -e /efs/provisioning/provisioning_forced ]
35+
then
36+
/system/bin/rm /efs/provisioning_complete*
37+
fi
38+
39+
if [ -e /efs/provisioning_complete ] || [ -e /efs/provisioning_complete_20120512 ] || [ -e /efs/provisioning_complete_20120730 ] || [ -e /efs/provisioning_complete_20120731 ]
40+
then
41+
echo device already provisioned
42+
exit 0
43+
fi
44+
45+
/system/bin/sleep 2
46+
47+
device=`cat /proc/product_name`
48+
49+
if [ "$device" = "Tate PreEVT2.1" ]
50+
then
51+
platform=tate
52+
playready_type=test
53+
playready_wrap=dummy
54+
keys=dummy
55+
else
56+
platform=tate
57+
playready_type=production
58+
playready_wrap=production
59+
fi
60+
61+
if [ -e "/efs/provisioning/"$playready_type"_wrapped_in_"$playready_wrap ]
62+
then
63+
playready="/efs/provisioning/"$playready_type"_wrapped_in_"$playready_wrap
64+
else
65+
playready="/vendor/etc/provisioning/"$playready_type"_wrapped_in_"$playready_wrap
66+
fi
67+
68+
hdcp="/efs/provisioning/hdcp"
69+
70+
71+
if [ ! -e $hdcp ] && [ ! -e $playready ] && [ "$device" != "Tate PreEVT2.1" ]
72+
then
73+
echo "Provisioning aborted. No provisioning directories"
74+
block_Screen
75+
fi
76+
77+
echo PROVISIONING STARTED > $logfile
78+
79+
echo platform=$platform >> $logfile
80+
echo playready=$playready >> $logfile
81+
82+
/system/bin/mkdir -p /efs/smc
83+
/system/bin/mkdir -p /efs/hdcp
84+
85+
pekfile=`ls $playready/*pek_wrapped_TL*`
86+
87+
if [ -e $pekfile ]
88+
then
89+
90+
/system/bin/rm -R /efs/smc/*
91+
92+
provisioning_client wipeAll 2>&1 >> $logfile
93+
wipeALL=$?
94+
echo wipeALL returned $wipeALL >> $logfile
95+
96+
provisioning_client setPEK $pekfile 2>&1 >> $logfile
97+
setPEK=$?
98+
echo setPEK returned $setPEK >> $logfile
99+
fi
100+
101+
modelcertfile=`ls $playready/*playready_model_certificate*`
102+
if [ -e $modelcertfile ]
103+
then
104+
provisioning_client setModelCert $modelcertfile 2>&1 >> $logfile
105+
setModelCert=$?
106+
echo setModelCert returned $setModelCert >> $logfile
107+
fi
108+
109+
modelkeyfile=`ls $playready/*playready_model_key*`
110+
if [ -e $modelkeyfile ]
111+
then
112+
provisioning_client setModelKey $modelkeyfile 2>&1 >> $logfile
113+
setModelKey=$?
114+
echo setModelKey=$setModelKey >> $logfile
115+
fi
116+
117+
oplfile=`ls $playready/*playready_opl*`
118+
if [ -e $oplfile ]
119+
then
120+
provisioning_client setOPLFromFile $oplfile 2>&1 >> $logfile
121+
setOPLFromFile=$?
122+
echo setOPLFromFile returned $setOPLFromFile >> $logfile
123+
fi
124+
125+
wmdrmmodelcertfile=`ls $playready/*wmdrm_model_certificate*`
126+
if [ -e $wmdrmmodelcertfile ]
127+
then
128+
provisioning_client setWModelCert $wmdrmmodelcertfile 2>&1 >> $logfile
129+
setWModelCert=$?
130+
echo setWModelCert returned $setWModelCert >> $logfile
131+
fi
132+
133+
wmdrmmodelkeyfile=`ls $playready/*wmdrm_model_key*`
134+
if [ -e $wmdrmmodelkeyfile ]
135+
then
136+
provisioning_client setWModelKey $wmdrmmodelkeyfile 2>&1 >> $logfile
137+
setWModelKey=$?
138+
echo setWModelKey returned $setWModelKey >> $logfile
139+
echo
140+
fi
141+
142+
if [[ "$setModelKey" == "0" && "$setOPLFromFile" == "0" && "$setWModelCert" == "0" && "$setWModelKey" == "0" ]]
143+
then
144+
provisioning_client initialize 2>&1 >> $logfile
145+
initialize=$?
146+
echo initialize returned $initialize >> $logfile
147+
else
148+
initialize=1
149+
echo not initialized due to failure of provisioning >> $logfile
150+
fi
151+
152+
if [ $initialize == 0 ]
153+
then
154+
playreadystatus="Pass"
155+
else
156+
playreadystatus="Fail"
157+
provisioning_client wipeAll 2>&1 >> $logfile
158+
echo provisioning failed and wipe all the files >> $logfile
159+
fi
160+
161+
pek=`ls $playready/*pek_wrapped_TI.bin`
162+
hdcpkey=`ls $hdcp/batch*key*.bin`
163+
164+
if [ ! -e $pek ]
165+
then
166+
echo "error: pek_wrapped_TI.bin file does not exists!" >> $logfile
167+
fi
168+
169+
if [ ! -e $hdcpkey ]
170+
then
171+
echo "error: batch*key*.bin file does not exists!" >> $logfile
172+
fi
173+
174+
hdcpprov=1
175+
176+
/system/bin/mkdir -p /efs/hdcp
177+
178+
if [ -e /efs/hdcp/hdcp.kek.wrapped ] && [ -e /efs/hdcp/pek.kek.wrapped ]
179+
then
180+
hdcpprov=0
181+
hdcpkey="PROVISIONED"
182+
else
183+
if [ -e $pek ] && [ -e $hdcpkey ] && [ ! -e /efs/hdcp/hdcp.kek.wrapped ] && [ ! -e /efs/hdcp/pek.kek.wrapped ]
184+
then
185+
hdcpprov=1
186+
retryloop=3
187+
188+
while [ $hdcpprov -ne 0 ] && [ $retryloop -gt 0 ]
189+
do
190+
/system/bin/hdcp-prov $pek $hdcpkey /efs/hdcp/hdcp.kek.wrapped /efs/hdcp/pek.kek.wrapped 2>&1 >> $logfile
191+
hdcpprov=$?
192+
echo hdcp-prov returned $hdcpprov >> $logfile
193+
retryloop=$((retryloop -1))
194+
done
195+
else
196+
echo error: Unable to call hdcp-prov due to missing input files >> $logfile
197+
fi
198+
fi
199+
200+
if [ $hdcpprov == 0 ]
201+
then
202+
hdcpstatus="Pass"
203+
else
204+
hdcpstatus="Fail"
205+
fi
206+
207+
if [ ! -e /efs/hdcp/hdcp.kek.wrapped ] || [ ! -e /efs/hdcp/pek.kek.wrapped ]
208+
then
209+
hdcpstatus="Fail"
210+
fi
211+
212+
echo "Provisioning Status:" > $statusfile
213+
echo "PlayReady:$playreadystatus" >> $statusfile
214+
echo "HDCP:$hdcpstatus" >> $statusfile
215+
echo "hdcpkey:$hdcpkey" >> $statusfile
216+
217+
if [ "$device" != "Tate PreEVT2.1" ]
218+
then
219+
if [ "$hdcpstatus" != "Pass" ] || \
220+
[ "$playreadystatus" != "Pass" ]
221+
then
222+
block_Screen
223+
fi
224+
fi
225+
226+
/system/bin/rm -R /efs/provisioning 2>&1 > /dev/null
227+
/system/bin/rm /efs/provisioning_complete* /efs/provisioning_sense* /efs/failed_provisioning 2>&1 > /dev/null
228+
229+
/system/bin/touch /efs/provisioning_complete_20120512
230+
/system/bin/touch /efs/provisioning_complete_20120730
231+
/system/bin/touch /efs/provisioning_complete_20120731
232+
233+
/system/bin/touch /efs/provisioning_complete
234+
235+
/system/bin/sync
236+
14.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)