Skip to content

Commit 6201c8c

Browse files
committed
linux-fitimage: Update script
Signed-off-by: Yuya Hamamachi <yuya.hamamachi.sx@renesas.com>
1 parent d229943 commit 6201c8c

1 file changed

Lines changed: 28 additions & 13 deletions

File tree

  • recipes-kernel/linux/linux-fitimage

recipes-kernel/linux/linux-fitimage/boot.cmd

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,42 @@ setenv imx708_read_id '
99
setexpr chip_id ${id_high} * 0x100
1010
setexpr chip_id ${chip_id} + ${id_low}
1111
'
12-
13-
# Check J1
12+
echo ''
13+
echo --- Check J1 ---;
1414
i2c dev 1
15-
if i2c probe 0x10; then setenv j1_conf '#j1-imx219'; fi
15+
if i2c probe 0x10; then
16+
echo IMX219 is detected;
17+
setenv j1_conf '#j1-imx219';
18+
fi
1619
if i2c probe 0x1a; then
1720
run imx708_read_id
1821
if test 0x${chip_id} -eq 0x0708; then
1922
echo IMX708 is detected;
2023
setenv j1_conf '#j1-imx708'
2124
else
22-
echo Fallback to IMX477;
23-
setenv j1_conf '#j1-imx477'
25+
echo Fallback to IMX462;
26+
setenv j1_conf '#j1-imx462'
2427
fi
2528
fi
2629

27-
# Check J2
30+
echo --- Check J2 ---;
2831
i2c dev 2
29-
if i2c probe 0x10; then setenv j2_conf '#j2-imx219'; fi
32+
if i2c probe 0x10; then
33+
echo IMX219 is detected;
34+
setenv j2_conf '#j2-imx219';
35+
fi
3036
if i2c probe 0x1a; then
3137
run imx708_read_id
3238
if test 0x${chip_id} -eq 0x0708; then
3339
echo IMX708 is detected;
3440
setenv j2_conf '#j2-imx708'
3541
else
36-
echo Fallback to IMX477;
37-
setenv j2_conf '#j2-imx477'
42+
echo Fallback to IMX462;
43+
setenv j2_conf '#j2-imx462'
3844
fi
3945
fi
4046

41-
# Check J4
47+
echo --- Check J4 ---;
4248
i2c dev 0 && i2c mw 0x71 0x0 0x7 && i2c speed 100000
4349
if i2c probe 0x45; then
4450
# Power on I2C display
@@ -65,14 +71,23 @@ if i2c probe 0x45; then
6571
fi
6672

6773

74+
echo --- Check Boot device ---;
75+
# extract boot device from bootargs
76+
setenv bootdev ${bootargs}
77+
setexpr bootdev gsub ".*root=/dev/" ""
78+
setexpr bootdev gsub "[0-9].*" ""
79+
6880
# Check whether initramfs is needed or not
6981
setenv initramfs_conf '#default'
70-
if test "${bootargs}" != *root=/dev/mmcblk*; then
82+
if itest.s "${bootdev}" != "mmcblk"; then
83+
echo Boot device is not MMC, so initramfs is used.
7184
setenv initramfs_conf '#initramfs'
85+
else
86+
echo Boot device is MMC.
7287
fi
7388

74-
# Generate conf and boot
89+
echo --- Booting ---;
7590
setenv conf "${initramfs_conf}${j1_conf}${j2_conf}${j4_conf}"
76-
echo ${conf}
91+
echo bootcmd: bootm ${loadaddr}${conf}
7792
bootm ${loadaddr}${conf}
7893

0 commit comments

Comments
 (0)