Commit 85103e50a72799269bdf4dbbe74863052f497741

Authored by Eric Lee
1 parent 60ea7fa3df

re-write mksdcard script

Showing 2 changed files with 163 additions and 281 deletions Inline Diff

scripts/sh/smarc-mksdcard.sh
1 #!/bin/bash 1 #!/bin/bash
2 # Meant to be called by install_android.sh
3 set -e
4 2
5 blue_underlined_bold_echo() 3 # android-tools-fsutils should be installed as
6 { 4 # "sudo apt-get install android-tools-fsutils"
7 echo -e "\e[34m\e[4m\e[1m$@\e[0m"
8 }
9 5
10 blue_bold_echo() 6 help() {
11 {
12 echo -e "\e[34m\e[1m$@\e[0m"
13 }
14 7
15 red_bold_echo() 8 bn=`basename $0`
16 { 9 cat << EOF
17 echo -e "\e[31m\e[1m$@\e[0m" 10 usage $bn <option> device_node
18 }
19 11
20 # Partition sizes in MiB 12 options:
21 BOOTLOAD_RESERVE=8 13 -h displays this help message
22 BOOT_ROM_SIZE=32 14 -s only get partition size
23 SYSTEM_ROM_SIZE=1536 15 -np not partition.
24 MISC_SIZE=4 16 -f soc_name flash android image file with soc_name
25 METADATA_SIZE=2 17 -F soc_name determine the device_node's offset to flash bootloader and flash default android image file
26 PRESISTDATA_SIZE=1 18 soc offset(KB)
27 VENDOR_ROM_SIZE=112 19 default 1
28 FBMISC_SIZE=1 20 imx8dv 16
29 VBMETA_SIZE=1 21 imx8qm/imx8qxp/imx8mq 33
22 -a only flash image to slot_a
23 -b only flash image to slot_b
24 -c card_size optional setting: 7 / 14 / 28
25 If not set, use partition-table.img
26 If set to 7, use partition-table-7GB.img for 7GB SD card
27 EOF
30 28
31 help() {
32
33 bn=`basename $0`
34 echo " usage $bn <option> device_node"
35 echo
36 echo " options:"
37 echo " -h displays this help message"
38 echo " -s only get partition size"
39 echo " -f soc_name flash android image."
40 } 29 }
41 30
42 # Parse command line 31 # parse command line
43 moreoptions=1 32 moreoptions=1
44 node="na" 33 node="na"
45 soc_name="showoptions" 34 soc_name=""
46 cal_only=0 35 cal_only=0
47 36 card_size=0
37 bootloader_offset=1
38 vaild_gpt_size=17
39 not_partition=0
40 not_format_fs=0
41 slot=""
42 systemimage_file="system.img"
43 systemimage_raw_file="system_raw.img"
44 vendor_file="vendor.img"
45 vendor_raw_file="vendor_raw.img"
46 partition_file="partition-table.img"
47 g_sizes=0
48 append_soc_name=0
48 while [ "$moreoptions" = 1 -a $# -gt 0 ]; do 49 while [ "$moreoptions" = 1 -a $# -gt 0 ]; do
49 case $1 in 50 case $1 in
50 -h) help; exit ;; 51 -h) help; exit ;;
51 -s) cal_only=1 ;; 52 -s) cal_only=1 ;;
52 -f) soc_name=$2; shift;; 53 -f) append_soc_name=1 ; soc_name=$2; shift;;
53 *) moreoptions=0; node=$1 ;; 54 -F) soc_name=$2; shift;;
55 -c) card_size=$2; shift;;
56 -np) not_partition=1 ;;
57 -nf) not_format_fs=1 ;;
58 -a) slot="_a" ;;
59 -b) slot="_b" ;;
60 *) moreoptions=0; node=$1 ;;
54 esac 61 esac
55 [ "$moreoptions" = 0 ] && [ $# -gt 2 ] && help && exit 62 [ "$moreoptions" = 0 ] && [ $# -gt 1 ] && help && exit
56 [ "$moreoptions" = 1 ] && shift 63 [ "$moreoptions" = 1 ] && shift
57 done 64 done
58 65
59 imagesdir="out/target/product/smarc_mx8m" 66 if [ ${card_size} -ne 0 ] && [ ${card_size} -ne 7 ] && [ ${card_size} -ne 14 ] && [ ${card_size} -ne 28 ]; then
60 67 help; exit;
61 img_prefix="boot-"
62 img_search_str="ls ${imagesdir}/${img_prefix}* | grep sd"
63 img_list=()
64
65 # generate options list
66 for img in $(eval $img_search_str)
67 do
68 img=$(basename $img .img)
69 img=${img#${img_prefix}}
70 img_list+=($img)
71 done
72
73 # check for dtb
74 if [[ $soc_name != "showoptions" ]] && [[ ! ${img_list[@]} =~ $soc_name ]] ; then
75 echo; red_bold_echo "ERROR: invalid dtb $soc_name"
76 soc_name=showoptions
77 fi 68 fi
78 69
79 if [[ $soc_name == "showoptions" ]] ; then 70 if [ "${soc_name}" = "imx8dv" ]; then
80 PS3='Please choose your configuration: ' 71 bootloader_offset=16
81 select opt in "${img_list[@]}"
82 do
83 if [[ -z "$opt" ]] ; then
84 echo invalid option
85 continue
86 else
87 soc_name=$opt
88 break
89 fi
90 done
91 fi 72 fi
92 73
93 bootimage_file="boot-${soc_name}.img"
94 vbmeta_file="vbmeta-${soc_name}.img"
95 systemimage_file="system.img"
96 systemimage_raw_file="system_raw.img"
97 vendorimage_file="vendor.img"
98 vendorimage_raw_file="vendor_raw.img"
99 74
100 block=`basename $node` 75 if [ "${soc_name}" = "imx8qm" -o "${soc_name}" = "imx8qxp" -o "${soc_name}" = "imx8mq" -o "${soc_name}" = "fsl-smarcimx8mq" -o "${soc_name}" = "fsl-smarcimx8mq-hdmi" -o "${soc_name}" = "fsl-smarcimx8mq-hdmi-4k" -o "${soc_name}" = "fsl-smarcimx8mq-lcdif-lvds" -o "${soc_name}" = "fsl-smarcimx8mq-dcss-lvds" -o "${soc_name}" = "fsl-smarcimx8mq-dual-display" ]; then
101 part="" 76 bootloader_offset=33
102 if [[ $block == mmcblk* ]] ; then
103 part="p"
104 fi 77 fi
105 78
106 if [[ "${soc_name}" = *"mx8m"* ]]; then
107 bootloader_offset=33
108 bootloader_file="boot-fsl-smarcimx8mq.imx"
109 fi
110
111 echo "${soc_name} bootloader offset is: ${bootloader_offset}" 79 echo "${soc_name} bootloader offset is: ${bootloader_offset}"
112 echo "${soc_name} bootloader is: ${bootloader_file}"
113 80
114 # Get total device size 81 if [ "${soc_name}" != "" ] && [ "${append_soc_name}" -eq 1 ]; then
115 seprate=100 82 soc_name="-${soc_name}"
116 total_size=`sfdisk -s ${node}` 83 else
117 total_size=`expr ${total_size} \/ 1024` 84 soc_name=""
118 boot_rom_sizeb=`expr ${BOOTLOAD_RESERVE} + ${BOOT_ROM_SIZE} \* 2` 85 fi
119 extend_size=`expr ${SYSTEM_ROM_SIZE} \* 2 + ${MISC_SIZE} + ${METADATA_SIZE} + ${PRESISTDATA_SIZE} + ${VENDOR_ROM_SIZE} \* 2 + ${FBMISC_SIZE} + ${VBMETA_SIZE} \* 2 + ${seprate}`
120 data_size=`expr ${total_size} - ${boot_rom_sizeb} - ${extend_size}`
121 86
122 # Echo partitions 87 if [ ! -e ${node} ]; then
123 cat << EOF 88 help
124 TOTAL : ${total_size} MiB 89 exit
125 U-BOOT (on eMMC) : ${BOOTLOAD_RESERVE} MiB 90 fi
126 BOOT_A : ${BOOT_ROM_SIZE} MiB
127 BOOT_B : ${BOOT_ROM_SIZE} MiB
128 SYSTEM_A : ${SYSTEM_ROM_SIZE} MiB
129 SYSTEM_B : ${SYSTEM_ROM_SIZE} MiB
130 MISC : ${MISC_SIZE} MiB
131 METADATA : ${METADATA_SIZE} MiB
132 PRESISTDATA : ${PRESISTDATA_SIZE} MiB
133 VENDOR_A : ${VENDOR_ROM_SIZE} MiB
134 VENDOR_B : ${VENDOR_ROM_SIZE} MiB
135 USERDATA : ${data_size} MiB
136 FBMISC : ${FBMISC_SIZE} MiB
137 VBMETA_A : ${VBMETA_SIZE} MiB
138 VBMETA_B : ${VBMETA_SIZE} MiB
139 EOF
140 91
141 echo
142 92
143 if [[ $cal_only == 1 ]] ; then 93 # dump partitions
144 exit 0 94 if [ "${cal_only}" -eq "1" ]; then
95 gdisk -l ${node} 2>/dev/null | grep -A 20 "Number "
96 exit
145 fi 97 fi
146 98
147 function check_images 99 function get_partition_size
148 { 100 {
149 if [[ ! -b $node ]] ; then 101 start_sector=`gdisk -l ${node} | grep -w $1 | awk '{print $2}'`
150 red_bold_echo "ERROR: \"$node\" is not a block device" 102 end_sector=`gdisk -l ${node} | grep -w $1 | awk '{print $3}'`
151 exit 1 103 # 1 sector = 512 bytes. This will change unit from sector to MBytes.
152 fi 104 let "g_sizes=($end_sector - $start_sector + 1) / 2048"
153
154 if [[ ! -f ${imagesdir}/${bootloader_file} ]] ; then
155 red_bold_echo "ERROR: U-Boot image does not exist"
156 exit 1
157 fi
158
159 if [[ ! -f ${imagesdir}/${bootimage_file} ]] ; then
160 red_bold_echo "ERROR: boot image does not exist"
161 exit 1
162 fi
163
164 if [[ ! -f ${imagesdir}/${systemimage_file} ]] ; then
165 red_bold_echo "ERROR: system image does not exist"
166 exit 1
167 fi
168
169 if [[ ! -f ${imagesdir}/${vendorimage_file} ]] ; then
170 red_bold_echo "ERROR: vendor image does not exist"
171 exit 1
172 fi
173
174 if [[ ! -f ${imagesdir}/${vbmeta_file} ]] ; then
175 red_bold_echo "ERROR: vbmeta image does not exist"
176 exit 1
177 fi
178 } 105 }
179 106
180 function delete_device 107 function format_partition
181 { 108 {
182 echo 109 num=`gdisk -l ${node} | grep -w $1 | awk '{print $1}'`
183 blue_underlined_bold_echo "Deleting current partitions" 110 if [ ${num} -gt 0 ] 2>/dev/null; then
184 for partition in ${node}* 111 echo "format_partition: $1:${node}${num} ext4"
185 do 112 mkfs.ext4 -F ${node}${num} -L$1
186 if [[ ${partition} = ${node} ]] ; then 113 fi
187 # skip base node
188 continue
189 fi
190 if [[ ! -b ${partition} ]] ; then
191 red_bold_echo "ERROR: \"${partition}\" is not a block device"
192 exit 1
193 fi
194 dd if=/dev/zero of=${partition} bs=1M count=1 2> /dev/null || true
195 done
196 sync
197
198 ((echo d; echo 1; echo d; echo 2; echo d; echo 3; echo d; echo w) | fdisk $node &> /dev/null) || true
199 sync
200
201 sgdisk -Z $node
202 sync
203
204 dd if=/dev/zero of=$node bs=1M count=8
205 sync; sleep 1
206 } 114 }
207 115
208 function create_parts 116 function erase_partition
209 { 117 {
210 echo 118 num=`gdisk -l ${node} | grep -w $1 | awk '{print $1}'`
211 blue_underlined_bold_echo "Creating Android partitions" 119 if [ ${num} -gt 0 ] 2>/dev/null; then
212 120 get_partition_size $1
213 sgdisk -n 1:${BOOTLOAD_RESERVE}M:+${BOOT_ROM_SIZE}M -c 1:"boot_a" -t 1:8300 $node 121 echo "erase_partition: $1 : ${node}${num} ${g_sizes}M"
214 sgdisk -n 2:0:+${BOOT_ROM_SIZE}M -c 2:"boot_b" -t 2:8300 $node 122 dd if=/dev/zero of=${node}${num} bs=1048576 conv=fsync count=$g_sizes
215 sgdisk -n 3:0:+${SYSTEM_ROM_SIZE}M -c 3:"system_a" -t 3:8300 $node 123 fi
216 sgdisk -n 4:0:+${SYSTEM_ROM_SIZE}M -c 4:"system_b" -t 4:8300 $node
217 sgdisk -n 5:0:+${MISC_SIZE}M -c 5:"misc" -t 5:8300 $node
218 sgdisk -n 6:0:+${METADATA_SIZE}M -c 6:"metadata" -t 6:8300 $node
219 sgdisk -n 7:0:+${PRESISTDATA_SIZE}M -c 7:"presistdata" -t 7:8300 $node
220 sgdisk -n 8:0:+${VENDOR_ROM_SIZE}M -c 8:"vendor_a" -t 8:8300 $node
221 sgdisk -n 9:0:+${VENDOR_ROM_SIZE}M -c 9:"vendor_b" -t 9:8300 $node
222 sgdisk -n 10:0:+${data_size}M -c 10:"userdata" -t 10:8300 $node
223 sgdisk -n 11:0:+${FBMISC_SIZE}M -c 11:"fbmisc" -t 11:8300 $node
224 sgdisk -n 12:0:+${VBMETA_SIZE}M -c 12:"vbmeta_a" -t 12:8300 $node
225 sgdisk -n 13:0:+${VBMETA_SIZE}M -c 13:"vbmeta_b" -t 13:8300 $node
226
227 sync; sleep 2
228
229 for i in `cat /proc/mounts | grep "${node}" | awk '{print $2}'`; do umount $i; done
230 hdparm -z $node
231 sync; sleep 3
232
233 # backup the GPT table to last LBA.
234 echo -e 'r\ne\nY\nw\nY\nY' | gdisk $node
235 sync; sleep 1
236 sgdisk -p $node
237 } 124 }
238 125
239 function install_bootloader 126 function flash_partition
240 { 127 {
241 echo 128 for num in `gdisk -l ${node} | grep -E -w "$1|$1_a|$1_b" | awk '{print $1}'`
242 blue_underlined_bold_echo "Installing booloader" 129 do
243 130 if [ $? -eq 0 ]; then
244 dd if=${imagesdir}/${bootloader_file} of=$node bs=1k seek=${bootloader_offset}; sync 131 if [ $(echo ${1} | grep "system") != "" ] 2>/dev/null; then
132 img_name=${systemimage_raw_file}
133 elif [ $(echo ${1} | grep "vendor") != "" ] 2>/dev/null; then
134 img_name=${vendor_raw_file}
135 else
136 img_name="${1%_*}${soc_name}.img"
137 fi
138 echo "flash_partition: ${img_name} ---> ${node}${num}"
139 dd if=${img_name} of=${node}${num} bs=10M conv=fsync
140 fi
141 done
245 } 142 }
246 143
247 function format_android 144 function format_android
248 { 145 {
249 echo 146 echo "formating android images"
250 blue_underlined_bold_echo "Erasing presistdata partition" 147 format_partition userdata
251 dd if=/dev/zero of=${node}${part}7 bs=1M count=${PRESISTDATA_SIZE} conv=fsync 148 format_partition cache
252 blue_underlined_bold_echo "Erasing fbmisc partition" 149 erase_partition presistdata
253 dd if=/dev/zero of=${node}${part}11 bs=1M count=${FBMISC_SIZE} conv=fsync 150 erase_partition fbmisc
254 blue_underlined_bold_echo "Erasing misc partition" 151 erase_partition misc
255 dd if=/dev/zero of=${node}${part}5 bs=1M count=${MISC_SIZE} conv=fsync
256 blue_underlined_bold_echo "Erasing metadata partition"
257 dd if=/dev/zero of=${node}${part}6 bs=1M count=${METADATA_SIZE} conv=fsync
258 blue_underlined_bold_echo "Formating userdata partition"
259 mkfs.ext4 -F ${node}${part}10 -Ldata
260 sync; sleep 1
261 } 152 }
262 153
263 function install_android 154 function make_partition
264 { 155 {
265 echo 156 if [ ${card_size} -gt 0 ]; then
266 blue_underlined_bold_echo "Installing Android boot image: $bootimage_file" 157 partition_file="partition-table-${card_size}GB.img"
267 dd if=${imagesdir}/${bootimage_file} of=${node}${part}1 158 fi
268 dd if=${imagesdir}/${bootimage_file} of=${node}${part}2 159 echo "make gpt partition for android: ${partition_file}"
269 sync 160 dd if=${partition_file} of=${node} bs=1k count=${vaild_gpt_size} conv=fsync
270
271 echo
272 blue_underlined_bold_echo "Installing Android system image: $systemimage_file"
273 if [[ -f ${imagesdir}/${systemimage_raw_file} ]] ; then
274 rm ${imagesdir}/${systemimage_raw_file} 2> /dev/null
275 fi
276 out/host/linux-x86/bin/simg2img ${imagesdir}/${systemimage_file} ${imagesdir}/${systemimage_raw_file}
277 dd if=${imagesdir}/${systemimage_raw_file} of=${node}${part}3
278 dd if=${imagesdir}/${systemimage_raw_file} of=${node}${part}4
279 sync;
280
281 echo
282 blue_underlined_bold_echo "Installing Android vendor image: $vendorimage_file"
283 if [[ -f ${imagesdir}/${vendorimage_raw_file} ]] ; then
284 rm ${imagesdir}/${vendorimage_raw_file} 2> /dev/null
285 fi
286 out/host/linux-x86/bin/simg2img ${imagesdir}/${vendorimage_file} ${imagesdir}/${vendorimage_raw_file}
287 dd if=${imagesdir}/${vendorimage_raw_file} of=${node}${part}8
288 dd if=${imagesdir}/${vendorimage_raw_file} of=${node}${part}9
289 sync;
290
291 echo
292 blue_underlined_bold_echo "Installing Android vbmeta image: $vbmeta_file"
293 dd if=${imagesdir}/${vbmeta_file} of=${node}${part}12
294 dd if=${imagesdir}/${vbmeta_file} of=${node}${part}13
295 sync;
296
297 sleep 1
298 } 161 }
299 162
300 function finish 163 function flash_android
301 { 164 {
smarc_mx8m/BoardConfig.mk
1 # 1 #
2 # Product-specific compile-time definitions. 2 # Product-specific compile-time definitions.
3 # 3 #
4 4
5 include device/fsl/imx8/soc/imx8mq.mk 5 include device/fsl/imx8/soc/imx8mq.mk
6 include device/embedian/smarc_mx8m/build_id.mk 6 include device/embedian/smarc_mx8m/build_id.mk
7 include device/fsl/imx8/BoardConfigCommon.mk 7 include device/fsl/imx8/BoardConfigCommon.mk
8 ifeq ($(PREBUILT_FSL_IMX_CODEC),true) 8 ifeq ($(PREBUILT_FSL_IMX_CODEC),true)
9 -include $(FSL_CODEC_PATH)/fsl-codec/fsl-codec.mk 9 -include $(FSL_CODEC_PATH)/fsl-codec/fsl-codec.mk
10 endif 10 endif
11 # sabreauto_6dq default target for EXT4 11 # sabreauto_6dq default target for EXT4
12 BUILD_TARGET_FS ?= ext4 12 BUILD_TARGET_FS ?= ext4
13 include device/fsl/imx8/imx8_target_fs.mk 13 include device/fsl/imx8/imx8_target_fs.mk
14 14
15 ifneq ($(BUILD_TARGET_FS),f2fs) 15 ifneq ($(BUILD_TARGET_FS),f2fs)
16 TARGET_RECOVERY_FSTAB = device/embedian/smarc_mx8m/fstab.freescale 16 TARGET_RECOVERY_FSTAB = device/embedian/smarc_mx8m/fstab.freescale
17 # build for ext4 17 # build for ext4
18 PRODUCT_COPY_FILES += \ 18 PRODUCT_COPY_FILES += \
19 device/embedian/smarc_mx8m/fstab.freescale:root/fstab.freescale 19 device/embedian/smarc_mx8m/fstab.freescale:root/fstab.freescale
20 else 20 else
21 TARGET_RECOVERY_FSTAB = device/embedian/smarc_mx8m/fstab-f2fs.freescale 21 TARGET_RECOVERY_FSTAB = device/embedian/smarc_mx8m/fstab-f2fs.freescale
22 # build for f2fs 22 # build for f2fs
23 PRODUCT_COPY_FILES += \ 23 PRODUCT_COPY_FILES += \
24 device/embedian/smarc_mx8m/fstab-f2fs.freescale:root/fstab.freescale 24 device/embedian/smarc_mx8m/fstab-f2fs.freescale:root/fstab.freescale
25 endif # BUILD_TARGET_FS 25 endif # BUILD_TARGET_FS
26 26
27 # Support gpt 27 # Support gpt
28 BOARD_BPT_INPUT_FILES += device/fsl/common/partition/device-partitions-13GB-ab.bpt 28 BOARD_BPT_INPUT_FILES += device/fsl/common/partition/device-partitions-13GB-ab.bpt
29 ADDITION_BPT_PARTITION = partition-table-7GB:device/fsl/common/partition/device-partitions-7GB-ab.bpt \ 29 ADDITION_BPT_PARTITION = partition-table-7GB:device/fsl/common/partition/device-partitions-7GB-ab.bpt \
30 partition-table-28GB:device/fsl/common/partition/device-partitions-28GB-ab.bpt 30 partition-table-28GB:device/fsl/common/partition/device-partitions-28GB-ab.bpt
31 31
32 32
33 # Vendor Interface manifest and compatibility 33 # Vendor Interface manifest and compatibility
34 DEVICE_MANIFEST_FILE := device/embedian/smarc_mx8m/manifest.xml 34 DEVICE_MANIFEST_FILE := device/embedian/smarc_mx8m/manifest.xml
35 DEVICE_MATRIX_FILE := device/embedian/smarc_mx8m/compatibility_matrix.xml 35 DEVICE_MATRIX_FILE := device/embedian/smarc_mx8m/compatibility_matrix.xml
36 36
37 TARGET_BOOTLOADER_BOARD_NAME := SMARC 37 TARGET_BOOTLOADER_BOARD_NAME := SMARC
38 38
39 PRODUCT_MODEL := SMARC_MX8MQ 39 PRODUCT_MODEL := SMARC_MX8MQ
40 40
41 TARGET_BOOTLOADER_POSTFIX := bin 41 TARGET_BOOTLOADER_POSTFIX := bin
42 42
43 USE_OPENGL_RENDERER := true 43 USE_OPENGL_RENDERER := true
44 TARGET_CPU_SMP := true 44 TARGET_CPU_SMP := true
45 45
46 TARGET_RELEASETOOLS_EXTENSIONS := device/fsl/imx8 46 TARGET_RELEASETOOLS_EXTENSIONS := device/fsl/imx8
47 BOARD_WLAN_DEVICE := qcwcn 47 BOARD_WLAN_DEVICE := qcwcn
48 WPA_SUPPLICANT_VERSION := VER_0_8_X 48 WPA_SUPPLICANT_VERSION := VER_0_8_X
49 BOARD_WPA_SUPPLICANT_DRIVER := NL80211 49 BOARD_WPA_SUPPLICANT_DRIVER := NL80211
50 BOARD_HOSTAPD_DRIVER := NL80211 50 BOARD_HOSTAPD_DRIVER := NL80211
51 51
52 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) 52 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
53 BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) 53 BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
54 54
55 BOARD_VENDOR_KERNEL_MODULES += \ 55 BOARD_VENDOR_KERNEL_MODULES += \
56 $(KERNEL_OUT)/drivers/net/wireless/ath/ath.ko \ 56 $(KERNEL_OUT)/drivers/net/wireless/ath/ath.ko \
57 $(KERNEL_OUT)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ 57 $(KERNEL_OUT)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
58 $(KERNEL_OUT)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko 58 $(KERNEL_OUT)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
59 59
60 BOARD_USE_SENSOR_FUSION := true 60 BOARD_USE_SENSOR_FUSION := true
61 61
62 # for recovery service 62 # for recovery service
63 TARGET_SELECT_KEY := 28 63 TARGET_SELECT_KEY := 28
64 # we don't support sparse image. 64 # we don't support sparse image.
65 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false 65 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
66 66
67 UBOOT_POST_PROCESS := true 67 UBOOT_POST_PROCESS := true
68 68
69 # camera hal v3 69 # camera hal v3
70 IMX_CAMERA_HAL_V3 := true 70 IMX_CAMERA_HAL_V3 := true
71 71
72 BOARD_HAVE_USB_CAMERA := true 72 BOARD_HAVE_USB_CAMERA := true
73 73
74 USE_ION_ALLOCATOR := true 74 USE_ION_ALLOCATOR := true
75 USE_GPU_ALLOCATOR := false 75 USE_GPU_ALLOCATOR := false
76 76
77 PRODUCT_COPY_FILES += \ 77 PRODUCT_COPY_FILES += \
78 device/embedian/smarc_mx8m/ueventd.freescale.rc:root/ueventd.freescale.rc 78 device/embedian/smarc_mx8m/ueventd.freescale.rc:root/ueventd.freescale.rc
79 79
80 BOARD_AVB_ENABLE := true 80 BOARD_AVB_ENABLE := true
81 81
82 # define frame buffer count 82 # define frame buffer count
83 NUM_FRAMEBUFFER_SURFACE_BUFFERS := 5 83 NUM_FRAMEBUFFER_SURFACE_BUFFERS := 5
84 84
85 ifeq ($(PRODUCT_IMX_DRM),true) 85 ifeq ($(PRODUCT_IMX_DRM),true)
86 CMASIZE=736M 86 CMASIZE=736M
87 else 87 else
88 CMASIZE=1536M 88 # if 4GB LPDDR4
89 # CMASIZE=1536M
90 # if 2GB LPDDR4
91 CMASIZE=736M
89 endif 92 endif
90 93
91 BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 earlycon=imxuart,0x30860000,115200 init=/init video=HDMI-A-1:1920x1080-32@60 androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale androidboot.fbTileSupport=enable cma=$(CMASIZE) androidboot.primary_display=imx-drm firmware_class.path=/vendor/firmware 94 BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 earlycon=imxuart,0x30860000,115200 init=/init video=HDMI-A-1:1920x1080-32@60 androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale androidboot.fbTileSupport=enable cma=$(CMASIZE) androidboot.primary_display=imx-drm firmware_class.path=/vendor/firmware
92 95
93 # Qcom 1CQ(QCA6174) BT 96 # Qcom 1CQ(QCA6174) BT
94 BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/embedian/smarc_mx8m/bluetooth 97 BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/embedian/smarc_mx8m/bluetooth
95 BOARD_HAVE_BLUETOOTH_QCOM := true 98 BOARD_HAVE_BLUETOOTH_QCOM := true
96 BOARD_HAS_QCA_BT_ROME := true 99 BOARD_HAS_QCA_BT_ROME := true
97 BOARD_HAVE_BLUETOOTH_BLUEZ := false 100 BOARD_HAVE_BLUETOOTH_BLUEZ := false
98 QCOM_BT_USE_SIBS := true 101 QCOM_BT_USE_SIBS := true
99 ifeq ($(QCOM_BT_USE_SIBS), true) 102 ifeq ($(QCOM_BT_USE_SIBS), true)
100 WCNSS_FILTER_USES_SIBS := true 103 WCNSS_FILTER_USES_SIBS := true
101 endif 104 endif
102 105
103 ifeq ($(TARGET_USERIMAGES_USE_UBIFS),true) 106 ifeq ($(TARGET_USERIMAGES_USE_UBIFS),true)
104 ifeq ($(TARGET_USERIMAGES_USE_EXT4),true) 107 ifeq ($(TARGET_USERIMAGES_USE_EXT4),true)
105 $(error "TARGET_USERIMAGES_USE_UBIFS and TARGET_USERIMAGES_USE_EXT4 config open in same time, please only choose one target file system image") 108 $(error "TARGET_USERIMAGES_USE_UBIFS and TARGET_USERIMAGES_USE_EXT4 config open in same time, please only choose one target file system image")
106 endif 109 endif
107 endif 110 endif
108 111
109 TARGET_BOARD_DTS_CONFIG := \ 112 TARGET_BOARD_DTS_CONFIG := \
110 fsl-smarcimx8mq:fsl-smarcimx8mq.dtb \ 113 fsl-smarcimx8mq:fsl-smarcimx8mq.dtb \
111 fsl-smarcimx8mq-dcss-lvds:fsl-smarcimx8mq-dcss-lvds.dtb \ 114 fsl-smarcimx8mq-dcss-lvds:fsl-smarcimx8mq-dcss-lvds.dtb \
112 fsl-smarcimx8mq-lcdif-lvds:fsl-smarcimx8mq-lcdif-lvds.dtb \ 115 fsl-smarcimx8mq-lcdif-lvds:fsl-smarcimx8mq-lcdif-lvds.dtb \
113 fsl-smarcimx8mq-hdmi:fsl-smarcimx8mq-hdmi.dtb \ 116 fsl-smarcimx8mq-hdmi:fsl-smarcimx8mq-hdmi.dtb \
114 fsl-smarcimx8mq-dual-display:fsl-smarcimx8mq-dual-display.dtb \ 117 fsl-smarcimx8mq-dual-display:fsl-smarcimx8mq-dual-display.dtb \
115 fsl-smarcimx8mq-hdmi-4k:fsl-smarcimx8mq-hdmi-4k.dtb 118 fsl-smarcimx8mq-hdmi-4k:fsl-smarcimx8mq-hdmi-4k.dtb
116 119
117 TARGET_BOOTLOADER_CONFIG := smarcimx8mq_2g:smarcimx8mq_2g_ser3_android_defconfig 120 TARGET_BOOTLOADER_CONFIG := smarcimx8mq_2g:smarcimx8mq_2g_ser3_android_defconfig
118 121
119 BOARD_SEPOLICY_DIRS := \ 122 BOARD_SEPOLICY_DIRS := \
120 device/fsl/imx8/sepolicy \ 123 device/fsl/imx8/sepolicy \
121 device/embedian/smarc_mx8m/sepolicy 124 device/embedian/smarc_mx8m/sepolicy
122 125
123 ifeq ($(PRODUCT_IMX_DRM),true) 126 ifeq ($(PRODUCT_IMX_DRM),true)
124 BOARD_SEPOLICY_DIRS += \ 127 BOARD_SEPOLICY_DIRS += \
125 device/fsl/imx8/sepolicy_drm \ 128 device/fsl/imx8/sepolicy_drm \
126 device/embedian/smarc_mx8m/sepolicy_drm 129 device/embedian/smarc_mx8m/sepolicy_drm
127 endif 130 endif
128 131
129 # Vendor seccomp policy files for media components: 132 # Vendor seccomp policy files for media components:
130 PRODUCT_COPY_FILES += \ 133 PRODUCT_COPY_FILES += \
131 device/embedian/smarc_mx8m/seccomp/mediacodec-seccomp.policy:vendor/etc/seccomp_policy/mediacodec.policy \ 134 device/embedian/smarc_mx8m/seccomp/mediacodec-seccomp.policy:vendor/etc/seccomp_policy/mediacodec.policy \
132 device/embedian/smarc_mx8m/seccomp/mediaextractor-seccomp.policy:vendor/etc/seccomp_policy/mediaextractor.policy 135 device/embedian/smarc_mx8m/seccomp/mediaextractor-seccomp.policy:vendor/etc/seccomp_policy/mediaextractor.policy
133 136
134 PRODUCT_COPY_FILES += \ 137 PRODUCT_COPY_FILES += \
135 device/embedian/smarc_mx8m/app_whitelist.xml:system/etc/sysconfig/app_whitelist.xml 138 device/embedian/smarc_mx8m/app_whitelist.xml:system/etc/sysconfig/app_whitelist.xml
136 139
137 TARGET_BOARD_KERNEL_HEADERS := device/fsl/common/kernel-headers 140 TARGET_BOARD_KERNEL_HEADERS := device/fsl/common/kernel-headers
138 141