Commit 7bd79ad8b55b5b6b475c6d4dbfcac7746f5a02fb

Authored by Eric Lee
0 parents

Android 10.0 patch for SMARC-iMX8M, initial release

Showing 80 changed files with 4170 additions and 0 deletions Side-by-side Diff

... ... @@ -0,0 +1,3 @@
  1 +.*
  2 +!.gitignore
  3 +*.o
... ... @@ -0,0 +1,192 @@
  1 +
  2 + Copyright (C) 2008-2015 The Android Open Source Project
  3 + Copyright (C) 2011-2016 Freescale Semiconductor, Inc.
  4 + Copyright 2017-2018 NXP
  5 +
  6 + Licensed under the Apache License, Version 2.0 (the "License");
  7 + you may not use this file except in compliance with the License.
  8 +
  9 + Unless required by applicable law or agreed to in writing, software
  10 + distributed under the License is distributed on an "AS IS" BASIS,
  11 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 + See the License for the specific language governing permissions and
  13 + limitations under the License.
  14 +
  15 +
  16 + Apache License
  17 + Version 2.0, January 2004
  18 + http://www.apache.org/licenses/
  19 +
  20 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  21 +
  22 + 1. Definitions.
  23 +
  24 + "License" shall mean the terms and conditions for use, reproduction,
  25 + and distribution as defined by Sections 1 through 9 of this document.
  26 +
  27 + "Licensor" shall mean the copyright owner or entity authorized by
  28 + the copyright owner that is granting the License.
  29 +
  30 + "Legal Entity" shall mean the union of the acting entity and all
  31 + other entities that control, are controlled by, or are under common
  32 + control with that entity. For the purposes of this definition,
  33 + "control" means (i) the power, direct or indirect, to cause the
  34 + direction or management of such entity, whether by contract or
  35 + otherwise, or (ii) ownership of fifty percent (50%) or more of the
  36 + outstanding shares, or (iii) beneficial ownership of such entity.
  37 +
  38 + "You" (or "Your") shall mean an individual or Legal Entity
  39 + exercising permissions granted by this License.
  40 +
  41 + "Source" form shall mean the preferred form for making modifications,
  42 + including but not limited to software source code, documentation
  43 + source, and configuration files.
  44 +
  45 + "Object" form shall mean any form resulting from mechanical
  46 + transformation or translation of a Source form, including but
  47 + not limited to compiled object code, generated documentation,
  48 + and conversions to other media types.
  49 +
  50 + "Work" shall mean the work of authorship, whether in Source or
  51 + Object form, made available under the License, as indicated by a
  52 + copyright notice that is included in or attached to the work
  53 + (an example is provided in the Appendix below).
  54 +
  55 + "Derivative Works" shall mean any work, whether in Source or Object
  56 + form, that is based on (or derived from) the Work and for which the
  57 + editorial revisions, annotations, elaborations, or other modifications
  58 + represent, as a whole, an original work of authorship. For the purposes
  59 + of this License, Derivative Works shall not include works that remain
  60 + separable from, or merely link (or bind by name) to the interfaces of,
  61 + the Work and Derivative Works thereof.
  62 +
  63 + "Contribution" shall mean any work of authorship, including
  64 + the original version of the Work and any modifications or additions
  65 + to that Work or Derivative Works thereof, that is intentionally
  66 + submitted to Licensor for inclusion in the Work by the copyright owner
  67 + or by an individual or Legal Entity authorized to submit on behalf of
  68 + the copyright owner. For the purposes of this definition, "submitted"
  69 + means any form of electronic, verbal, or written communication sent
  70 + to the Licensor or its representatives, including but not limited to
  71 + communication on electronic mailing lists, source code control systems,
  72 + and issue tracking systems that are managed by, or on behalf of, the
  73 + Licensor for the purpose of discussing and improving the Work, but
  74 + excluding communication that is conspicuously marked or otherwise
  75 + designated in writing by the copyright owner as "Not a Contribution."
  76 +
  77 + "Contributor" shall mean Licensor and any individual or Legal Entity
  78 + on behalf of whom a Contribution has been received by Licensor and
  79 + subsequently incorporated within the Work.
  80 +
  81 + 2. Grant of Copyright License. Subject to the terms and conditions of
  82 + this License, each Contributor hereby grants to You a perpetual,
  83 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  84 + copyright license to reproduce, prepare Derivative Works of,
  85 + publicly display, publicly perform, sublicense, and distribute the
  86 + Work and such Derivative Works in Source or Object form.
  87 +
  88 + 3. Grant of Patent License. Subject to the terms and conditions of
  89 + this License, each Contributor hereby grants to You a perpetual,
  90 + worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  91 + (except as stated in this section) patent license to make, have made,
  92 + use, offer to sell, sell, import, and otherwise transfer the Work,
  93 + where such license applies only to those patent claims licensable
  94 + by such Contributor that are necessarily infringed by their
  95 + Contribution(s) alone or by combination of their Contribution(s)
  96 + with the Work to which such Contribution(s) was submitted. If You
  97 + institute patent litigation against any entity (including a
  98 + cross-claim or counterclaim in a lawsuit) alleging that the Work
  99 + or a Contribution incorporated within the Work constitutes direct
  100 + or contributory patent infringement, then any patent licenses
  101 + granted to You under this License for that Work shall terminate
  102 + as of the date such litigation is filed.
  103 +
  104 + 4. Redistribution. You may reproduce and distribute copies of the
  105 + Work or Derivative Works thereof in any medium, with or without
  106 + modifications, and in Source or Object form, provided that You
  107 + meet the following conditions:
  108 +
  109 + (a) You must give any other recipients of the Work or
  110 + Derivative Works a copy of this License; and
  111 +
  112 + (b) You must cause any modified files to carry prominent notices
  113 + stating that You changed the files; and
  114 +
  115 + (c) You must retain, in the Source form of any Derivative Works
  116 + that You distribute, all copyright, patent, trademark, and
  117 + attribution notices from the Source form of the Work,
  118 + excluding those notices that do not pertain to any part of
  119 + the Derivative Works; and
  120 +
  121 + (d) If the Work includes a "NOTICE" text file as part of its
  122 + distribution, then any Derivative Works that You distribute must
  123 + include a readable copy of the attribution notices contained
  124 + within such NOTICE file, excluding those notices that do not
  125 + pertain to any part of the Derivative Works, in at least one
  126 + of the following places: within a NOTICE text file distributed
  127 + as part of the Derivative Works; within the Source form or
  128 + documentation, if provided along with the Derivative Works; or,
  129 + within a display generated by the Derivative Works, if and
  130 + wherever such third-party notices normally appear. The contents
  131 + of the NOTICE file are for informational purposes only and
  132 + do not modify the License. You may add Your own attribution
  133 + notices within Derivative Works that You distribute, alongside
  134 + or as an addendum to the NOTICE text from the Work, provided
  135 + that such additional attribution notices cannot be construed
  136 + as modifying the License.
  137 +
  138 + You may add Your own copyright statement to Your modifications and
  139 + may provide additional or different license terms and conditions
  140 + for use, reproduction, or distribution of Your modifications, or
  141 + for any such Derivative Works as a whole, provided Your use,
  142 + reproduction, and distribution of the Work otherwise complies with
  143 + the conditions stated in this License.
  144 +
  145 + 5. Submission of Contributions. Unless You explicitly state otherwise,
  146 + any Contribution intentionally submitted for inclusion in the Work
  147 + by You to the Licensor shall be under the terms and conditions of
  148 + this License, without any additional terms or conditions.
  149 + Notwithstanding the above, nothing herein shall supersede or modify
  150 + the terms of any separate license agreement you may have executed
  151 + with Licensor regarding such Contributions.
  152 +
  153 + 6. Trademarks. This License does not grant permission to use the trade
  154 + names, trademarks, service marks, or product names of the Licensor,
  155 + except as required for reasonable and customary use in describing the
  156 + origin of the Work and reproducing the content of the NOTICE file.
  157 +
  158 + 7. Disclaimer of Warranty. Unless required by applicable law or
  159 + agreed to in writing, Licensor provides the Work (and each
  160 + Contributor provides its Contributions) on an "AS IS" BASIS,
  161 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  162 + implied, including, without limitation, any warranties or conditions
  163 + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  164 + PARTICULAR PURPOSE. You are solely responsible for determining the
  165 + appropriateness of using or redistributing the Work and assume any
  166 + risks associated with Your exercise of permissions under this License.
  167 +
  168 + 8. Limitation of Liability. In no event and under no legal theory,
  169 + whether in tort (including negligence), contract, or otherwise,
  170 + unless required by applicable law (such as deliberate and grossly
  171 + negligent acts) or agreed to in writing, shall any Contributor be
  172 + liable to You for damages, including any direct, indirect, special,
  173 + incidental, or consequential damages of any character arising as a
  174 + result of this License or out of the use or inability to use the
  175 + Work (including but not limited to damages for loss of goodwill,
  176 + work stoppage, computer failure or malfunction, or any and all
  177 + other commercial damages or losses), even if such Contributor
  178 + has been advised of the possibility of such damages.
  179 +
  180 + 9. Accepting Warranty or Additional Liability. While redistributing
  181 + the Work or Derivative Works thereof, You may choose to offer,
  182 + and charge a fee for, acceptance of support, warranty, indemnity,
  183 + or other liability obligations and/or rights consistent with this
  184 + License. However, in accepting such obligations, You may act only
  185 + on Your own behalf and on Your sole responsibility, not on behalf
  186 + of any other Contributor, and only if You agree to indemnify,
  187 + defend, and hold each Contributor harmless for any liability
  188 + incurred by, or claims asserted against, such Contributor by reason
  189 + of your accepting any such warranty or additional liability.
  190 +
  191 + END OF TERMS AND CONDITIONS
  192 +
common/EmbPathConfig.mk
... ... @@ -0,0 +1,13 @@
  1 +# config.mk
  2 +#
  3 +# Product-specific compile-time definitions.
  4 +#
  5 +
  6 +KERNEL_IMX_PATH := vendor/embedian
  7 +UBOOT_IMX_PATH := vendor/embedian
  8 +IMX_MKIMAGE_PATH := vendor/nxp-opensource
  9 +FSL_PROPRIETARY_PATH := vendor/nxp
  10 +IMX_PATH := vendor/nxp-opensource
  11 +LINUX_FIRMWARE_IMX_PATH := vendor/nxp
  12 +FSL_IMX_OMX_PATH := vendor/nxp
  13 +IMX_LIB_PATH := vendor/nxp-opensource
imx8m/AndroidProducts.mk
... ... @@ -0,0 +1,37 @@
  1 +#Copyright (C) 2008 The Android Open Source Project
  2 +#
  3 +# Licensed under the Apache License, Version 2.0 (the "License");
  4 +# you may not use this file except in compliance with the License.
  5 +# You may obtain a copy of the License at
  6 +#
  7 +# http://www.apache.org/licenses/LICENSE-2.0
  8 +#
  9 +# Unless required by applicable law or agreed to in writing, software
  10 +# distributed under the License is distributed on an "AS IS" BASIS,
  11 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 +# See the License for the specific language governing permissions and
  13 +# limitations under the License.
  14 +#
  15 +
  16 +#
  17 +# This file should set PRODUCT_MAKEFILES to a list of product makefiles
  18 +# to expose to the build system. LOCAL_DIR will already be set to
  19 +# the directory containing this file.
  20 +#
  21 +# This file may not rely on the value of any variable other than
  22 +# LOCAL_DIR; do not use any conditionals, and do not look up the
  23 +# value of any variable that isn't set in this file or in a file that
  24 +# it includes.
  25 +#
  26 +
  27 +# Copied from build/target/product/AndroidProducts.mk
  28 +
  29 +PRODUCT_MAKEFILES := \
  30 + $(LOCAL_DIR)/smarc_mx8mq/smarc_mx8mq.mk \
  31 + $(LOCAL_DIR)/smarc_mx8mq/smarc_mx8mq_drm.mk
  32 +
  33 +COMMON_LUNCH_CHOICES := \
  34 + smarc_mx8mq-user \
  35 + smarc_mx8mq-userdebug \
  36 + smarc_mx8mq_drm-user \
  37 + smarc_mx8mq_drm-userdebug
imx8m/UbootKernelCommonConfig.mk
... ... @@ -0,0 +1,2 @@
  1 +TARGET_UBOOT_ARCH := arm64
  2 +
imx8m/com.example.android.systemupdatersample.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!--
  3 + ~ Copyright (C) 2019 The Android Open Source Project
  4 + ~ Copyright 2019 NXP
  5 + ~
  6 + ~ Licensed under the Apache License, Version 2.0 (the "License");
  7 + ~ you may not use this file except in compliance with the License.
  8 + ~ You may obtain a copy of the License at
  9 + ~
  10 + ~ http://www.apache.org/licenses/LICENSE-2.0
  11 + ~
  12 + ~ Unless required by applicable law or agreed to in writing, software
  13 + ~ distributed under the License is distributed on an "AS IS" BASIS,
  14 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 + ~ See the License for the specific language governing permissions and
  16 + ~ limitations under the License
  17 + -->
  18 +<permissions>
  19 + <privapp-permissions package="com.example.android.systemupdatersample">
  20 + <permission name="android.permission.ACCESS_CACHE_FILESYSTEM"/>
  21 + </privapp-permissions>
  22 +</permissions>
imx8m/init.recovery.freescale.rc
... ... @@ -0,0 +1,5 @@
  1 +on init
  2 + # disable cursor blink for fbcon, if no splash screen support
  3 + write /sys/class/graphics/fbcon/cursor_blink 0
  4 +
  5 + setprop sys.usb.configfs 1
imx8m/optee-packages.mk
... ... @@ -0,0 +1,70 @@
  1 +OPTEE_PLATFORM ?= imx
  2 +ifeq ($(TARGET_PRODUCT),$(filter $(TARGET_PRODUCT),smarc_mx8mm smarc_mx8mm_drm))
  3 +OPTEE_PLATFORM_FLAVOR ?= smarc_mx8mm
  4 +else
  5 +ifeq ($(TARGET_PRODUCT),$(filter $(TARGET_PRODUCT),smarc_mx8mq smarc_mx8mq_drm))
  6 +OPTEE_PLATFORM_FLAVOR ?= smarc_mx8mq
  7 +else
  8 +$(error Invalid platform $(TARGET_PRODUCT))
  9 +endif
  10 +endif
  11 +OPTEE_CFG_ARM64_CORE ?= y
  12 +OPTEE_TA_TARGETS ?= ta_arm64
  13 +CFG_SECSTOR_TA_MGMT_PTA ?= y
  14 +#Force CFG_TA_DYNLINK=y to fix optee_test build
  15 +#https://github.com/OP-TEE/optee_test/issues/275
  16 +CFG_TA_DYNLINK := y
  17 +#OPTEE_TA_TARGETS ?= ta_arm32
  18 +OPTEE_OS_DIR ?= optee/optee_os
  19 +OPTEE_EXTRA_FLAGS ?= CFG_TEE_CORE_LOG_LEVEL=1 CFG_TEE_TA_LOG_LEVEL=1 DEBUG=0
  20 +ifeq ($(CFG_DRM_SECURE_DATA_PATH), y)
  21 +OPTEE_EXTRA_FLAGS += CFG_IMXCRYPT=y
  22 +OPTEE_EXTRA_FLAGS += CFG_DRM_SECURE_DATA_PATH=y
  23 +OPTEE_EXTRA_FLAGS += CFG_SECURE_DATA_PATH=y
  24 +OPTEE_EXTRA_FLAGS += CFG_TEE_SDP_MEM_BASE=$(CFG_TEE_SDP_MEM_BASE)
  25 +OPTEE_EXTRA_FLAGS += CFG_TEE_SDP_MEM_SIZE=$(CFG_TEE_SDP_MEM_SIZE)
  26 +OPTEE_EXTRA_FLAGS += CFG_TEE_SDP_NONCACHE=y
  27 +ifeq ($(CFG_RDC_SECURE_DATA_PATH),y)
  28 +OPTEE_EXTRA_FLAGS += CFG_RDC_SECURE_DATA_PATH=y
  29 +OPTEE_EXTRA_FLAGS += CFG_RDC_DECODED_BUFFER=$(DECODED_BUFFER_START)
  30 +endif
  31 +else
  32 +OPTEE_EXTRA_FLAGS += CFG_SECURE_DATA_PATH=n
  33 +endif
  34 +
  35 +BUILD_OPTEE_MK := $(OPTEE_OS_DIR)/mk/aosp_optee.mk
  36 +
  37 +# OP TEE client library and service
  38 +PRODUCT_PACKAGES += libteec \
  39 + tee-supplicant \
  40 +
  41 +# optee_test and TA
  42 +PRODUCT_PACKAGES += xtest
  43 +# os_test
  44 +PRODUCT_PACKAGES += 5b9e0e40-2636-11e1-ad9e-0002a5d5c51b.ta
  45 +# concurrent_large
  46 +PRODUCT_PACKAGES += 5ce0c432-0ab0-40e5-a056-782ca0e6aba2.ta
  47 +# sha_perf
  48 +PRODUCT_PACKAGES += 614789f2-39c0-4ebf-b235-92b32ac107ed.ta
  49 +# storage2
  50 +PRODUCT_PACKAGES += 731e279e-aafb-4575-a771-38caa6f0cca6.ta
  51 +# storage
  52 +PRODUCT_PACKAGES += b689f2a7-8adf-477a-9f99-32e90c0ad0a2.ta
  53 +# create_fail_test
  54 +PRODUCT_PACKAGES += c3f6e2c0-3548-11e1-b86c-0800200c9a66.ta
  55 +# crypt
  56 +PRODUCT_PACKAGES += cb3e5ba0-adf1-11e0-998b-0002a5d5c51b.ta
  57 +# rpc_test
  58 +PRODUCT_PACKAGES += d17f73a0-36ef-11e1-984a-0002a5d5c51b.ta
  59 +# concurrent
  60 +PRODUCT_PACKAGES += e13010e0-2ae1-11e5-896a-0002a5d5c51b.ta
  61 +# aes_perf
  62 +PRODUCT_PACKAGES += e626662e-c0e2-485c-b8c8-09fbce6edf3d.ta
  63 +# sims
  64 +PRODUCT_PACKAGES += e6a33ed4-562b-463a-bb7e-ff5e15a493c8.ta
  65 +# storage_benchmark
  66 +PRODUCT_PACKAGES += f157cda0-550c-11e5-a6fa-0002a5d5c51b.ta
  67 +# socket
  68 +PRODUCT_PACKAGES += 873bcd08-c2c3-11e6-a937-d0bf9c45c61c.ta
  69 +# sdp-basic
  70 +PRODUCT_PACKAGES += 12345678-5b69-11e4-9dbb-101f74f00099.ta
imx8m/smarc_mx8mq/AndroidBoard.mk
... ... @@ -0,0 +1,8 @@
  1 +LOCAL_PATH := $(call my-dir)
  2 +
  3 +include device/embedian/common/EmbPathConfig.mk
  4 +include device/fsl/common/build/dtbo.mk
  5 +include device/fsl/common/build/imx-recovery.mk
  6 +include device/fsl/common/build/gpt.mk
  7 +include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/media-profile/media-profile.mk
  8 +include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/sensor/fsl-sensor.mk
imx8m/smarc_mx8mq/AndroidTee.mk
... ... @@ -0,0 +1,12 @@
  1 +# uboot.imx in android combine scfw.bin and uboot.bin
  2 +MAKE += SHELL=/bin/bash
  3 +
  4 +define build_uboot_w_tee
  5 + $(MAKE) -C bootable/bootloader/arm-trusted-firmware/ -B CROSS_COMPILE=aarch64-linux-android- PLAT=imx8mq V=1 SPD=opteed DECRYPTED_BUFFER_START=$(DECRYPTED_BUFFER_START) DECRYPTED_BUFFER_LEN=$(DECRYPTED_BUFFER_LEN) DECODED_BUFFER_START=$(DECODED_BUFFER_START) DECODED_BUFFER_LEN=$(DECODED_BUFFER_LEN) bl31; \
  6 + cp bootable/bootloader/arm-trusted-firmware/build/imx8mq/release/bl31.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.;\
  7 + aarch64-linux-android-objcopy -O binary out/target/product/smarc_mx8mq/optee/arm-plat-imx/core/tee.elf $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/tee.bin; \
  8 + $(MAKE) -C $(IMX_MKIMAGE_PATH)/imx-mkimage/ clean; \
  9 + $(MAKE) -C $(IMX_MKIMAGE_PATH)/imx-mkimage/ SOC=iMX8M flash_hdmi_spl_uboot; \
  10 + cp $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/flash.bin $(PRODUCT_OUT)/u-boot-$(strip $(2)).imx;
  11 +endef
  12 +
imx8m/smarc_mx8mq/AndroidUboot.mk
... ... @@ -0,0 +1,37 @@
  1 +# uboot.imx in android combine scfw.bin and uboot.bin
  2 +MAKE += SHELL=/bin/bash
  3 +
  4 +ATF_TOOLCHAIN_ABS := $(realpath prebuilts/gcc/$(HOST_PREBUILT_TAG)/aarch64/aarch64-linux-android-4.9/bin)
  5 +ATF_CROSS_COMPILE := $(ATF_TOOLCHAIN_ABS)/aarch64-linux-androidkernel-
  6 +IMX_DEVICE_PATH := device/embedian/imx8m/smarc_mx8mq
  7 +
  8 +define build_imx_uboot
  9 + $(hide) echo Building i.MX U-Boot with firmware; \
  10 + cp $(UBOOT_OUT)/u-boot-nodtb.$(strip $(1)) $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  11 + cp $(UBOOT_OUT)/spl/u-boot-spl.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  12 + cp $(UBOOT_OUT)/tools/mkimage $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/mkimage_uboot; \
  13 + cp $(FSL_PROPRIETARY_PATH)/linux-firmware-imx/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  14 + cp $(UBOOT_OUT)/arch/arm/dts/fsl-smarcimx8mq.dtb $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  15 + cp $(FSL_PROPRIETARY_PATH)/fsl-proprietary/uboot-firmware/imx8m/signed_hdmi_imx8m.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  16 + cp $(FSL_PROPRIETARY_PATH)/linux-firmware-imx/firmware/ddr/synopsys/lpddr4_pmu_train* $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  17 + $(MAKE) -C $(IMX_PATH)/arm-trusted-firmware/ PLAT=`echo $(2) | cut -d '-' -f1` clean; \
  18 + if [ `echo $(2) | cut -d '-' -f2` = "trusty" ] && [ `echo $(2) | rev | cut -d '-' -f1` != "uuu" ]; then \
  19 + cp $(FSL_PROPRIETARY_PATH)/fsl-proprietary/uboot-firmware/imx8m/tee-imx8mq.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/tee.bin; \
  20 + $(MAKE) -C $(IMX_PATH)/arm-trusted-firmware/ CROSS_COMPILE="$(ATF_CROSS_COMPILE)" PLAT=`echo $(2) | cut -d '-' -f1` bl31 -B SPD=trusty 1>/dev/null || exit 1; \
  21 + else \
  22 + if [ -f $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/tee.bin ] ; then \
  23 + rm -rf $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/tee.bin; \
  24 + fi; \
  25 + $(MAKE) -C $(IMX_PATH)/arm-trusted-firmware/ CROSS_COMPILE="$(ATF_CROSS_COMPILE)" PLAT=`echo $(2) | cut -d '-' -f1` bl31 -B 1>/dev/null || exit 1; \
  26 + fi; \
  27 + cp $(IMX_PATH)/arm-trusted-firmware/build/`echo $(2) | cut -d '-' -f1`/release/bl31.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/bl31.bin; \
  28 + $(MAKE) -C $(IMX_MKIMAGE_PATH)/imx-mkimage/ clean; \
  29 + $(MAKE) -C $(IMX_MKIMAGE_PATH)/imx-mkimage/ SOC=iMX8M flash_hdmi_spl_uboot 1>/dev/null || exit 1; \
  30 + $(MAKE) -C $(IMX_MKIMAGE_PATH)/imx-mkimage/ SOC=iMX8M print_fit_hab || exit 1; \
  31 + cp $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/flash.bin $(UBOOT_COLLECTION)/u-boot-$(strip $(2)).imx; \
  32 + cp $(IMX_DEVICE_PATH)/signed_dp_imx8m.bin $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/.; \
  33 + $(MAKE) -C $(IMX_MKIMAGE_PATH)/imx-mkimage/ SOC=iMX8M flash_dp_spl_uboot 1>/dev/null || exit 1; \
  34 + cp $(IMX_MKIMAGE_PATH)/imx-mkimage/iMX8M/flash.bin $(UBOOT_COLLECTION)/u-boot-$(strip $(2))-dp.imx;
  35 +endef
  36 +
  37 +
imx8m/smarc_mx8mq/BoardConfig.mk
... ... @@ -0,0 +1,146 @@
  1 +#
  2 +# SoC-specific compile-time definitions.
  3 +#
  4 +
  5 +BOARD_SOC_TYPE := IMX8MQ
  6 +BOARD_TYPE := SMARC-IMX8MQ
  7 +BOARD_HAVE_VPU := true
  8 +BOARD_VPU_TYPE := hantro
  9 +HAVE_FSL_IMX_GPU2D := false
  10 +HAVE_FSL_IMX_GPU3D := true
  11 +HAVE_FSL_IMX_IPU := false
  12 +HAVE_FSL_IMX_PXP := false
  13 +BOARD_KERNEL_BASE := 0x40400000
  14 +TARGET_GRALLOC_VERSION := v3
  15 +TARGET_HIGH_PERFORMANCE := true
  16 +TARGET_USES_HWC2 := true
  17 +TARGET_HWCOMPOSER_VERSION := v2.0
  18 +USE_OPENGL_RENDERER := true
  19 +TARGET_HAVE_VULKAN := true
  20 +ENABLE_CFI=false
  21 +
  22 +SOONG_CONFIG_IMXPLUGIN += \
  23 + BOARD_HAVE_VPU \
  24 + BOARD_VPU_TYPE
  25 +
  26 +SOONG_CONFIG_IMXPLUGIN_BOARD_SOC_TYPE = IMX8MQ
  27 +SOONG_CONFIG_IMXPLUGIN_BOARD_HAVE_VPU = true
  28 +SOONG_CONFIG_IMXPLUGIN_BOARD_VPU_TYPE = hantro
  29 +
  30 +#
  31 +# Product-specific compile-time definitions.
  32 +#
  33 +
  34 +IMX_DEVICE_PATH := device/embedian/imx8m/smarc_mx8mq
  35 +
  36 +include device/fsl/imx8m/BoardConfigCommon.mk
  37 +ifeq ($(PREBUILT_FSL_IMX_CODEC),true)
  38 +-include $(FSL_CODEC_PATH)/fsl-codec/fsl-codec.mk
  39 +endif
  40 +
  41 +BUILD_TARGET_FS ?= ext4
  42 +TARGET_USERIMAGES_USE_EXT4 := true
  43 +
  44 +TARGET_RECOVERY_FSTAB = $(IMX_DEVICE_PATH)/fstab.freescale
  45 +
  46 +# Support gpt
  47 +ifeq ($(IMX_NO_PRODUCT_PARTITION),true)
  48 +BOARD_BPT_INPUT_FILES += device/fsl/common/partition/device-partitions-13GB-ab-no-product.bpt
  49 +ADDITION_BPT_PARTITION = partition-table-28GB:device/fsl/common/partition/device-partitions-28GB-ab-no-product.bpt \
  50 + partition-table-dual:device/fsl/common/partition/device-partitions-13GB-ab-dual-bootloader-no-product.bpt \
  51 + partition-table-28GB-dual:device/fsl/common/partition/device-partitions-28GB-ab-dual-bootloader-no-product.bpt
  52 +else
  53 +BOARD_BPT_INPUT_FILES += device/fsl/common/partition/device-partitions-13GB-ab.bpt
  54 +ADDITION_BPT_PARTITION = partition-table-28GB:device/fsl/common/partition/device-partitions-28GB-ab.bpt \
  55 + partition-table-dual:device/fsl/common/partition/device-partitions-13GB-ab-dual-bootloader.bpt \
  56 + partition-table-28GB-dual:device/fsl/common/partition/device-partitions-28GB-ab-dual-bootloader.bpt
  57 +endif
  58 +
  59 +# Vendor Interface manifest and compatibility
  60 +DEVICE_MANIFEST_FILE := $(IMX_DEVICE_PATH)/manifest.xml
  61 +DEVICE_MATRIX_FILE := $(IMX_DEVICE_PATH)/compatibility_matrix.xml
  62 +
  63 +TARGET_BOOTLOADER_BOARD_NAME := SMARC
  64 +
  65 +USE_OPENGL_RENDERER := true
  66 +
  67 +BOARD_WLAN_DEVICE := bcmdhd
  68 +WPA_SUPPLICANT_VERSION := VER_0_8_X
  69 +BOARD_WPA_SUPPLICANT_DRIVER := NL80211
  70 +BOARD_HOSTAPD_DRIVER := NL80211
  71 +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
  72 +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
  73 +
  74 +WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/brcmfmac/parameters/alternative_fw_path"
  75 +
  76 +#WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
  77 +
  78 +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(IMX_DEVICE_PATH)/bluetooth
  79 +
  80 +# BCM 1CX BT
  81 +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(IMX_DEVICE_PATH)/bluetooth
  82 +BOARD_CUSTOM_BT_CONFIG := $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR)/vnd_config.txt
  83 +BOARD_HAVE_BLUETOOTH_BCM := true
  84 +
  85 +BOARD_USE_SENSOR_FUSION := true
  86 +
  87 +# we don't support sparse image.
  88 +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
  89 +
  90 +BOARD_HAVE_USB_CAMERA := true
  91 +
  92 +USE_ION_ALLOCATOR := true
  93 +USE_GPU_ALLOCATOR := false
  94 +
  95 +BOARD_AVB_ENABLE := true
  96 +TARGET_USES_MKE2FS := true
  97 +BOARD_AVB_ALGORITHM := SHA256_RSA4096
  98 +# The testkey_rsa4096.pem is copied from external/avb/test/data/testkey_rsa4096.pem
  99 +BOARD_AVB_KEY_PATH := device/fsl/common/security/testkey_rsa4096.pem
  100 +
  101 +# define frame buffer count
  102 +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
  103 +
  104 +ifeq ($(PRODUCT_IMX_DRM),true)
  105 +CMASIZE=736M
  106 +else
  107 +CMASIZE=1280M
  108 +endif
  109 +
  110 +BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 earlycon=imxuart,0x30860000,115200 init=/init androidboot.gui_resolution=1080p androidboot.console=ttymxc0 androidboot.hardware=freescale androidboot.fbTileSupport=enable cma=$(CMASIZE) androidboot.primary_display=imx-drm firmware_class.path=/vendor/firmware transparent_hugepage=never loop.max_part=7
  111 +
  112 +# Set the density to 213 tvdpi to match CDD.
  113 +BOARD_KERNEL_CMDLINE += androidboot.lcd_density=213
  114 +
  115 +# Default wificountrycode
  116 +BOARD_KERNEL_CMDLINE += androidboot.wificountrycode=CN
  117 +
  118 +ifeq ($(TARGET_USERIMAGES_USE_UBIFS),true)
  119 +ifeq ($(TARGET_USERIMAGES_USE_EXT4),true)
  120 +$(error "TARGET_USERIMAGES_USE_UBIFS and TARGET_USERIMAGES_USE_EXT4 config open in same time, please only choose one target file system image")
  121 +endif
  122 +endif
  123 +
  124 +BOARD_PREBUILT_DTBOIMAGE := out/target/product/smarc_mx8mq/dtbo-smarcimx8mq-hdmi.img
  125 +TARGET_BOARD_DTS_CONFIG := \
  126 + smarcimx8mq-dcss-lvds:fsl-smarcimx8mq-dcss-lvds.dtb \
  127 + smarcimx8mq-dp:fsl-smarcimx8mq-dp.dtb \
  128 + smarcimx8mq:fsl-smarcimx8mq.dtb \
  129 + smarcimx8mq-dual-display:fsl-smarcimx8mq-dual-display.dtb \
  130 + smarcimx8mq-edp:fsl-smarcimx8mq-edp.dtb \
  131 + smarcimx8mq-hdmi:fsl-smarcimx8mq-hdmi.dtb \
  132 + smarcimx8mq-lcdif-lvds:fsl-smarcimx8mq-lcdif-lvds.dtb
  133 +
  134 +BOARD_SEPOLICY_DIRS := \
  135 + device/fsl/imx8m/sepolicy \
  136 + $(IMX_DEVICE_PATH)/sepolicy
  137 +
  138 +ifeq ($(PRODUCT_IMX_DRM),true)
  139 +BOARD_SEPOLICY_DIRS += \
  140 + $(IMX_DEVICE_PATH)/sepolicy_drm
  141 +endif
  142 +
  143 +TARGET_BOARD_KERNEL_HEADERS := device/fsl/common/kernel-headers
  144 +
  145 +ALL_DEFAULT_INSTALLED_MODULES += $(BOARD_VENDOR_KERNEL_MODULES)
  146 +
imx8m/smarc_mx8mq/SharedBoardConfig.mk
... ... @@ -0,0 +1,13 @@
  1 +KERNEL_NAME := Image
  2 +TARGET_KERNEL_ARCH := arm64
  3 +
  4 +#Enable this to include trusty support
  5 +PRODUCT_IMX_TRUSTY := true
  6 +
  7 +#Enable this to disable product partition build.
  8 +#IMX_NO_PRODUCT_PARTITION := true
  9 +
  10 +# BCM fmac wifi driver module
  11 +BOARD_VENDOR_KERNEL_MODULES += \
  12 + $(KERNEL_OUT)/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko \
  13 + $(KERNEL_OUT)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
imx8m/smarc_mx8mq/UbootKernelBoardConfig.mk
... ... @@ -0,0 +1,20 @@
  1 +TARGET_BOOTLOADER_POSTFIX := bin
  2 +UBOOT_POST_PROCESS := true
  3 +
  4 +TARGET_BOOTLOADER_CONFIG := \
  5 + imx8mq-smarcimx8mq_2g:smarcimx8mq_2g_ser3_android_defconfig \
  6 + imx8mq-smarcimx8mq_4g:smarcimx8mq_4g_ser3_android_defconfig \
  7 + imx8mq-smarcimx8mq_2g_uuu:smarcimx8mq_2g_ser3_android_uuu_defconfig \
  8 + imx8mq-smarcimx8mq_4g_uuu:smarcimx8mq_4g_ser3_android_uuu_defconfig
  9 +
  10 +# imx8mq kernel defconfig
  11 +TARGET_KERNEL_DEFCONFIG := smarcimx8m_android_defconfig
  12 +# TARGET_KERNEL_ADDITION_DEFCONF ?= android_addition_defconfig
  13 +
  14 +
  15 +# absolute path is used, not the same as relative path used in AOSP make
  16 +TARGET_DEVICE_DIR := $(patsubst %/, %, $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
  17 +
  18 +# define bootloader rollback index
  19 +BOOTLOADER_RBINDEX ?= 0
  20 +
imx8m/smarc_mx8mq/app_whitelist.xml
... ... @@ -0,0 +1,36 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  2 +
  3 +<!--
  4 +/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
  5 + *
  6 + * Redistribution and use in source and binary forms, with or without
  7 + * modification, are permitted provided that the following conditions are
  8 + * met:
  9 + * * Redistributions of source code must retain the above copyright
  10 + * notice, this list of conditions and the following disclaimer.
  11 + * * Redistributions in binary form must reproduce the above
  12 + * copyright notice, this list of conditions and the following
  13 + * disclaimer in the documentation and/or other materials provided
  14 + * with the distribution.
  15 + * * Neither the name of The Linux Foundation nor the names of its
  16 + * contributors may be used to endorse or promote products derived
  17 + * from this software without specific prior written permission.
  18 + *
  19 + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  20 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  21 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  22 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  23 + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  26 + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  27 + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  28 + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  29 + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30 + */
  31 +-->
  32 +
  33 +<config>
  34 + <!-- deskclock need to freely run in the background -->
  35 + <allow-in-power-save package="com.android.deskclock" />
  36 +</config>
imx8m/smarc_mx8mq/audio_effects.xml
... ... @@ -0,0 +1,26 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<audio_effects_conf version="2.0" xmlns="http://schemas.android.com/audio/audio_effects_conf/v2_0">
  3 + <libraries>
  4 + <library name="bundle" path="libbundlewrapper.so"/>
  5 + <library name="reverb" path="libreverbwrapper.so"/>
  6 + <library name="visualizer" path="libvisualizer.so"/>
  7 + <library name="downmix" path="libdownmix.so"/>
  8 + <library name="loudness_enhancer" path="libldnhncr.so"/>
  9 + <library name="dynamics_processing" path="libdynproc.so"/>
  10 + </libraries>
  11 +
  12 + <effects>
  13 + <effect name="bassboost" library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
  14 + <effect name="virtualizer" library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
  15 + <effect name="equalizer" library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
  16 + <effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
  17 + <effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
  18 + <effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
  19 + <effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
  20 + <effect name="reverb_pre_ins" library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
  21 + <effect name="visualizer" library="visualizer" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
  22 + <effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
  23 + <effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
  24 + <effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
  25 + </effects>
  26 +</audio_effects_conf>
imx8m/smarc_mx8mq/audio_policy_configuration.xml
... ... @@ -0,0 +1,99 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2 +<!-- Copyright (C) 2017 The Android Open Source Project
  3 +
  4 + Licensed under the Apache License, Version 2.0 (the "License");
  5 + you may not use this file except in compliance with the License.
  6 + You may obtain a copy of the License at
  7 +
  8 + http://www.apache.org/licenses/LICENSE-2.0
  9 +
  10 + Unless required by applicable law or agreed to in writing, software
  11 + distributed under the License is distributed on an "AS IS" BASIS,
  12 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + See the License for the specific language governing permissions and
  14 + limitations under the License.
  15 +-->
  16 +
  17 +<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
  18 + <globalConfiguration speaker_drc_enabled="true"/>
  19 +
  20 + <modules>
  21 + <module name="primary" halVersion="2.0">
  22 + <attachedDevices>
  23 + <item>Speaker</item>
  24 + <item>Built-In Mic</item>
  25 + </attachedDevices>
  26 + <defaultOutputDevice>Speaker</defaultOutputDevice>
  27 + <mixPorts>
  28 + <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY">
  29 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  30 + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
  31 + </mixPort>
  32 + <mixPort name="hdmi output" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT">
  33 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  34 + samplingRates="32000,44100,48000,88200,96000,176400,192000" channelMasks="AUDIO_CHANNEL_NONE"/>
  35 + </mixPort>
  36 + <mixPort name="esai output" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_HW_AV_SYNC">
  37 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  38 + samplingRates="48000,96000,192000,384000,768000"
  39 + channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
  40 + <profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
  41 + samplingRates="48000,96000,192000,384000,768000"
  42 + channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
  43 + </mixPort>
  44 + <mixPort name="dsd output" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD">
  45 + <profile name="" format="AUDIO_FORMAT_DSD"
  46 + samplingRates="2822400,5644800,11289600,22579200" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
  47 + </mixPort>
  48 + <mixPort name="primary input" role="sink">
  49 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  50 + samplingRates="8000,11025,16000,22050,24000,32000,44100,48000"
  51 + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
  52 + </mixPort>
  53 + </mixPorts>
  54 + <devicePorts>
  55 + <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink" >
  56 + </devicePort>
  57 + <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
  58 + </devicePort>
  59 + <devicePort tagName="HDMI Out" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
  60 + </devicePort>
  61 + <devicePort tagName="Line-Out" type="AUDIO_DEVICE_OUT_LINE" role="sink">
  62 + </devicePort>
  63 +
  64 + <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
  65 + </devicePort>
  66 + <devicePort tagName="Line-In" type="AUDIO_DEVICE_IN_AUX_DIGITAL" role="source">
  67 + </devicePort>
  68 + </devicePorts>
  69 + <routes>
  70 + <route type="mix" sink="Speaker"
  71 + sources="primary output"/>
  72 + <route type="mix" sink="Wired Headphones"
  73 + sources="dsd output,esai output,primary output"/>
  74 + <route type="mix" sink="HDMI Out"
  75 + sources="hdmi output,primary output"/>
  76 + <route type="mix" sink="Line-Out"
  77 + sources="dsd output,esai output,primary output"/>
  78 +
  79 + <route type="mix" sink="primary input"
  80 + sources="Built-In Mic,Line-In"/>
  81 + </routes>
  82 + </module>
  83 +
  84 + <!-- A2dp Audio HAL -->
  85 + <xi:include href="a2dp_audio_policy_configuration.xml"/>
  86 +
  87 + <!-- Usb Audio HAL -->
  88 + <xi:include href="usb_audio_policy_configuration.xml"/>
  89 +
  90 + <!-- Remote Submix Audio HAL -->
  91 + <xi:include href="r_submix_audio_policy_configuration.xml"/>
  92 +
  93 + </modules>
  94 +
  95 + <!-- Volume section -->
  96 + <xi:include href="audio_policy_volumes.xml"/>
  97 + <xi:include href="default_volume_tables.xml"/>
  98 +
  99 +</audioPolicyConfiguration>
imx8m/smarc_mx8mq/audio_policy_configuration_drm.xml
... ... @@ -0,0 +1,93 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2 +<!-- Copyright (C) 2017 The Android Open Source Project
  3 +
  4 + Licensed under the Apache License, Version 2.0 (the "License");
  5 + you may not use this file except in compliance with the License.
  6 + You may obtain a copy of the License at
  7 +
  8 + http://www.apache.org/licenses/LICENSE-2.0
  9 +
  10 + Unless required by applicable law or agreed to in writing, software
  11 + distributed under the License is distributed on an "AS IS" BASIS,
  12 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + See the License for the specific language governing permissions and
  14 + limitations under the License.
  15 +-->
  16 +
  17 +<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
  18 + <globalConfiguration speaker_drc_enabled="true"/>
  19 +
  20 + <modules>
  21 + <module name="primary" halVersion="2.0">
  22 + <attachedDevices>
  23 + <item>HDMI Out</item>
  24 + <item>Built-In Mic</item>
  25 + </attachedDevices>
  26 + <defaultOutputDevice>HDMI Out</defaultOutputDevice>
  27 + <mixPorts>
  28 + <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY">
  29 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  30 + samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
  31 + </mixPort>
  32 + <mixPort name="hdmi output" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT">
  33 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  34 + samplingRates="32000,44100,48000,88200,96000,176400,192000" channelMasks="AUDIO_CHANNEL_NONE"/>
  35 + </mixPort>
  36 + <mixPort name="esai output" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT">
  37 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  38 + samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
  39 + </mixPort>
  40 + <mixPort name="primary input" role="sink">
  41 + <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
  42 + samplingRates="8000,11025,16000,22050,24000,32000,44100,48000"
  43 + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
  44 + </mixPort>
  45 + </mixPorts>
  46 + <devicePorts>
  47 + <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink" >
  48 + </devicePort>
  49 + <devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink">
  50 + </devicePort>
  51 + <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink">
  52 + </devicePort>
  53 + <devicePort tagName="HDMI Out" type="AUDIO_DEVICE_OUT_AUX_DIGITAL" role="sink">
  54 + </devicePort>
  55 +
  56 + <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source">
  57 + </devicePort>
  58 + <devicePort tagName="Wired Headset Mic" type="AUDIO_DEVICE_IN_WIRED_HEADSET" role="source">
  59 + </devicePort>
  60 + <devicePort tagName="Spdif-In" type="AUDIO_DEVICE_IN_AUX_DIGITAL" role="source">
  61 + </devicePort>
  62 + </devicePorts>
  63 + <routes>
  64 + <route type="mix" sink="Speaker"
  65 + sources="esai output,primary output"/>
  66 + <route type="mix" sink="Wired Headset"
  67 + sources="primary output"/>
  68 + <route type="mix" sink="Wired Headphones"
  69 + sources="primary output"/>
  70 + <route type="mix" sink="HDMI Out"
  71 + sources="hdmi output,primary output"/>
  72 +
  73 + <route type="mix" sink="primary input"
  74 + sources="Built-In Mic,Wired Headset Mic,Spdif-In"/>
  75 + </routes>
  76 + </module>
  77 +
  78 + <!-- A2dp Audio HAL -->
  79 + <xi:include href="a2dp_audio_policy_configuration.xml"/>
  80 +
  81 + <!-- Usb Audio HAL -->
  82 + <xi:include href="usb_audio_policy_configuration.xml"/>
  83 +
  84 + <!-- Remote Submix Audio HAL -->
  85 + <xi:include href="r_submix_audio_policy_configuration.xml"/>
  86 +
  87 + </modules>
  88 +
  89 + <!-- Volume section -->
  90 + <xi:include href="audio_policy_volumes.xml"/>
  91 + <xi:include href="default_volume_tables.xml"/>
  92 +
  93 +</audioPolicyConfiguration>
imx8m/smarc_mx8mq/bluetooth/bdroid_buildcfg.h
... ... @@ -0,0 +1,37 @@
  1 +/*
  2 + * Copyright (C) 2012 The Android Open Source Project
  3 + * Copyright (C) 2020 Variscite Ltd
  4 + *
  5 + * Licensed under the Apache License, Version 2.0 (the "License");
  6 + * you may not use this file except in compliance with the License.
  7 + * You may obtain a copy of the License at
  8 + *
  9 + * http://www.apache.org/licenses/LICENSE-2.0
  10 + *
  11 + * Unless required by applicable law or agreed to in writing, software
  12 + * distributed under the License is distributed on an "AS IS" BASIS,
  13 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + * See the License for the specific language governing permissions and
  15 + * limitations under the License.
  16 + */
  17 +
  18 +#ifndef _BDROID_BUILDCFG_H
  19 +#define _BDROID_BUILDCFG_H
  20 +
  21 +#define BTM_DEF_LOCAL_NAME "SMARC-MX8M"
  22 +
  23 +// Wide-band speech support
  24 +#define BTM_WBS_INCLUDED TRUE
  25 +#define BTIF_HF_WBS_PREFERRED TRUE
  26 +
  27 +// Disables Interleave scan
  28 +#define BTA_HOST_INTERLEAVE_SEARCH FALSE
  29 +// skips conn update at conn completion
  30 +#define BTA_BLE_SKIP_CONN_UPD TRUE
  31 +// Disables read remote device feature
  32 +#define BTA_SKIP_BLE_READ_REMOTE_FEAT TRUE
  33 +
  34 +//Enable A2DPSink AVRCPController
  35 +#define BTA_AV_SINK_INCLUDED TRUE
  36 +
  37 +#endif
imx8m/smarc_mx8mq/bluetooth/bt_vendor.conf
... ... @@ -0,0 +1,2 @@
  1 +# UART device port where Bluetooth controller is attached
  2 +UartPort = /dev/ttymxc2
imx8m/smarc_mx8mq/bluetooth/vnd_config.txt
... ... @@ -0,0 +1,10 @@
  1 +BLUETOOTH_UART_DEVICE_PORT = "/dev/ttymxc2"
  2 +FW_PATCHFILE_LOCATION = "/vendor/firmware/"
  3 +LPM_IDLE_TIMEOUT_MULTIPLE = 5
  4 +SCO_USE_I2S_INTERFACE = FALSE
  5 +BTVND_DBG = TRUE
  6 +BTHW_DBG = TRUE
  7 +VNDUSERIAL_DBG = TRUE
  8 +UPIO_DBG = TRUE
  9 +LPM_SLEEP_MODE = 0
  10 +UART_TARGET_BAUD_RATE = 3000000
imx8m/smarc_mx8mq/camera_config_imx8mq.json
... ... @@ -0,0 +1,56 @@
  1 +{
  2 + "__readme": [
  3 + "Basic Camera HAL v3 configuration."
  4 + ],
  5 +
  6 + "hal_version": "3",
  7 + "cam_blit_copy": "GPU_3D",
  8 + "cam_blit_csc": "GPU_3D",
  9 +
  10 + "camera_metadata": [
  11 + {
  12 + "camera_type": "back",
  13 + "camera_name": "mx6s-csi",
  14 + "orientation": "0",
  15 + "buffer_type": "mmap",
  16 + "ActiveArrayWidth": "2592",
  17 + "ActiveArrayHeight": "1944",
  18 + "PixelArrayWidth": "2592",
  19 + "PixelArrayHeight": "1944",
  20 + "PhysicalWidth": "3.6288",
  21 + "PhysicalHeight": "2.7216",
  22 + "FocalLength": "3.37",
  23 + "MaxJpegSize": "8388608",
  24 + "MinFrameDuration": "33331760",
  25 + "MaxFrameDuration": "300000000",
  26 + "OmitFrame": [
  27 + {
  28 + "width": "2592",
  29 + "height": "1944",
  30 + "omit_num": "3"
  31 + },
  32 + {
  33 + "width": "1920",
  34 + "height": "1080",
  35 + "omit_num": "2"
  36 + }
  37 + ]
  38 + },
  39 + {
  40 + "camera_type": "front",
  41 + "camera_name": "uvc",
  42 + "orientation": "0",
  43 + "buffer_type": "dma",
  44 + "ActiveArrayWidth": "1920",
  45 + "ActiveArrayHeight": "1080",
  46 + "PixelArrayWidth": "1920",
  47 + "PixelArrayHeight": "1080",
  48 + "PhysicalWidth": "2.688",
  49 + "PhysicalHeight": "1.512",
  50 + "FocalLength": "3.42",
  51 + "MaxJpegSize": "4194304",
  52 + "MinFrameDuration": "33331760",
  53 + "MaxFrameDuration": "300000000"
  54 + }
  55 + ]
  56 +}
imx8m/smarc_mx8mq/compatibility_matrix.xml
... ... @@ -0,0 +1,62 @@
  1 +<compatibility-matrix version="1.0" type="device">
  2 + <hal format="hidl" optional="false">
  3 + <name>android.frameworks.schedulerservice</name>
  4 + <version>1.0</version>
  5 + <interface>
  6 + <name>ISchedulingPolicyService</name>
  7 + <instance>default</instance>
  8 + </interface>
  9 + </hal>
  10 + <hal format="hidl" optional="false">
  11 + <name>android.frameworks.sensorservice</name>
  12 + <version>1.0</version>
  13 + <interface>
  14 + <name>ISensorManager</name>
  15 + <instance>default</instance>
  16 + </interface>
  17 + </hal>
  18 + <hal format="hidl" optional="false">
  19 + <name>android.hidl.allocator</name>
  20 + <version>1.0</version>
  21 + <interface>
  22 + <name>IAllocator</name>
  23 + <instance>ashmem</instance>
  24 + </interface>
  25 + </hal>
  26 + <hal format="hidl" optional="false">
  27 + <name>android.hidl.manager</name>
  28 + <version>1.0</version>
  29 + <interface>
  30 + <name>IServiceManager</name>
  31 + <instance>default</instance>
  32 + </interface>
  33 + </hal>
  34 + <hal format="hidl" optional="false">
  35 + <name>android.hidl.memory</name>
  36 + <version>1.0</version>
  37 + <interface>
  38 + <name>IMapper</name>
  39 + <instance>ashmem</instance>
  40 + </interface>
  41 + </hal>
  42 + <hal format="hidl" optional="false">
  43 + <name>android.hidl.token</name>
  44 + <version>1.0</version>
  45 + <interface>
  46 + <name>ITokenManager</name>
  47 + <instance>default</instance>
  48 + </interface>
  49 + </hal>
  50 + <hal format="hidl" optional="false">
  51 + <name>android.system.wifi.keystore</name>
  52 + <version>1.0</version>
  53 + <interface>
  54 + <name>IKeystore</name>
  55 + <instance>default</instance>
  56 + </interface>
  57 + </hal>
  58 + <hal format="native" optional="false">
  59 + <name>netutils-wrapper</name>
  60 + <version>1.0</version>
  61 + </hal>
  62 +</compatibility-matrix>
imx8m/smarc_mx8mq/early.init.cfg
... ... @@ -0,0 +1,3 @@
  1 +insmod vendor/lib/modules/brcmutil.ko
  2 +insmod vendor/lib/modules/brcmfmac.ko
  3 +insmod vendor/lib/modules/wlan.ko
imx8m/smarc_mx8mq/fstab.freescale
... ... @@ -0,0 +1,16 @@
  1 +# Android fstab file.
  2 +#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
  3 +# The filesystem that contains the filesystem checker binary (typically /system) cannot
  4 +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
  5 +
  6 +/devices/platform/usb@38100000/38100000.dwc3/* auto auto defaults voldmanaged=usb:auto
  7 +/devices/platform/usb@38200000/38200000.dwc3/* auto auto defaults voldmanaged=usb:auto
  8 +
  9 +/devices/platform/38200000.usb/xhci-hcd.0.auto/* auto auto defaults voldmanaged=usb:auto
  10 +/devices/platform/38100000.usb/xhci-hcd.1.auto/* auto auto defaults voldmanaged=usb:auto
  11 +
  12 +/dev/block/by-name/system / ext4 ro,barrier=1 wait,slotselect
  13 +/dev/block/by-name/userdata /data ext4 nosuid,nodev,nodiratime,noatime,nomblk_io_submit,noauto_da_alloc,errors=panic wait,formattable,quota,fileencryption=software,reservedsize=128M
  14 +/dev/block/by-name/misc /misc emmc defaults defaults
  15 +/dev/block/zram0 none swap defaults zramsize=629145600
  16 +
imx8m/smarc_mx8mq/init.imx8mq.drm.rc
... ... @@ -0,0 +1,20 @@
  1 +import /vendor/etc/init/hw/init.${ro.hardware}.${ro.boot.soc_type}.main.rc
  2 +
  3 +on property:init.svc.mediadrm=running
  4 + mkdir /data/vendor/mediadrm 0770 media mediadrm
  5 +
  6 +on post-fs-data
  7 + # create for OP-TEE test
  8 + mkdir /data/vendor/tee 0660 media media
  9 + mkdir /data/vendor/tee/optee_armtz 0660 media media
  10 + restorecon_recursive /data/vendor/tee
  11 +
  12 +
  13 +on boot
  14 + # optee device
  15 + chmod 0660 /dev/tee0
  16 + chown media media /dev/tee0
  17 +
  18 + chmod 0660 /dev/teepriv0
  19 + chown media media /dev/teepriv0
  20 +
imx8m/smarc_mx8mq/init.imx8mq.rc
... ... @@ -0,0 +1,41 @@
  1 +on early-boot
  2 +
  3 + # Set OpenGLES version
  4 + setprop ro.opengles.version 196609
  5 +
  6 + # Set GPU 3D minimum clock to 3/64
  7 + write /sys/bus/platform/drivers/galcore/gpu3DMinClock 3
  8 +
  9 + # change for FSL specific service
  10 + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  11 + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  12 + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  13 + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  14 + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  15 + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  16 + chown root system /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
  17 + chmod 0440 /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
  18 + chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
  19 +
  20 +on property:sys.boot_completed=1
  21 + # Set default CPU frequency governor
  22 + # configure governor settings for little cluster
  23 + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "schedutil"
  24 + write /sys/devices/system/cpu/cpufreq/schedutil/up_rate_limit_us 500
  25 + write /sys/devices/system/cpu/cpufreq/schedutil/down_rate_limit_us 2000
  26 +
  27 +on property:sys.boot_completed=1
  28 + # update cpuset now that processors are up
  29 + write /dev/cpuset/foreground/cpus 0-3
  30 +
  31 + # top-app gets all cpus
  32 + write /dev/cpuset/top-app/cpus 0-3
  33 +
  34 + #background contains a small subset (generally one little core)
  35 + write /dev/cpuset/background/cpus 0
  36 +
  37 + # add system-background cpuset, a new cpuset for system services
  38 + # that should not run on larger cores
  39 + # system-background is for system tasks that should only run on
  40 + # little cores, not on bigs to be used only by init
  41 + write /dev/cpuset/system-background/cpus 0-2
imx8m/smarc_mx8mq/init.rc
... ... @@ -0,0 +1,285 @@
  1 +import /vendor/etc/init/hw/init.${ro.hardware}.usb.rc
  2 +import /vendor/etc/init/hw/init.${ro.hardware}.${ro.boot.soc_type}.rc
  3 +
  4 +on early-init
  5 + # mount the debugfs
  6 + mount debugfs none /sys/kernel/debug/ mode=0755
  7 +
  8 +on early-init
  9 + start early_init_sh
  10 +
  11 + # Due keymaster start very early so set prop here
  12 + # Also gatekeeper share same role for keymaster
  13 + setprop ro.hardware.keystore ${ro.boot.keystore}
  14 + setprop ro.hardware.gatekeeper ${ro.boot.keystore}
  15 + setprop vendor.storageproxyd ${ro.boot.keystore}
  16 +
  17 +on init
  18 + start watchdogd
  19 +
  20 + # Support legacy paths
  21 + symlink /sdcard /mnt/sdcard
  22 + symlink /sdcard /storage/sdcard0
  23 +
  24 + # setup the global environment
  25 + export CORE_REGISTER_FILE /vendor/etc/core_register
  26 + export COMPONENT_REGISTER_FILE /vendor/etc/component_register
  27 + export CONTENTPIPE_REGISTER_FILE /vendor/etc/contentpipe_register
  28 +
  29 + # disable cursor blink for fbcon, if no splash screen support
  30 + write /sys/class/graphics/fbcon/cursor_blink 0
  31 +
  32 + # deattch the fbcon as hdmi hotplug conflict with fbcon
  33 + write /sys/class/vtconsole/vtcon1/bind 0
  34 +
  35 + chown system system /dev/stune/top-app/schedtune.boost
  36 + chmod 664 /dev/stune/top-app/schedtune.boost
  37 + chown system system /dev/stune/top-app/schedtune.prefer_idle
  38 + chmod 664 /dev/stune/top-app/schedtune.prefer_idle
  39 + chown system system /dev/stune/foreground/schedtune.boost
  40 + chmod 664 /dev/stune/foreground/schedtune.boost
  41 + chown system system /dev/stune/foreground/schedtune.prefer_idle
  42 + chmod 664 /dev/stune/foreground/schedtune.prefer_idle
  43 + chown system system /dev/stune/schedtune.boost
  44 + chmod 664 /dev/stune/schedtune.boost
  45 +
  46 + # set default schedTune value for foreground/top-app (only affects EAS)
  47 + write /dev/stune/foreground/schedtune.boost 10
  48 + write /dev/stune/foreground/schedtune.prefer_idle 1
  49 + write /dev/stune/top-app/schedtune.boost 40
  50 + write /dev/stune/top-app/schedtune.prefer_idle 1
  51 + write /dev/stune/rt/schedtune.boost 50
  52 + write /dev/stune/rt/schedtune.prefer_idle 1
  53 +
  54 + # force USB2514 autosuspend
  55 + write /sys/devices/platform/usb@38200000/38200000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.5/power/control auto
  56 +
  57 +on late-fs
  58 + # Start keymaster service
  59 + start vendor.keymaster-3-0-${ro.boot.keystore}
  60 + setprop vendor.powerhal.init 1
  61 +
  62 +on late-fs && property:vendor.storageproxyd=trusty
  63 + start vendor.oemlock-1-0
  64 +
  65 +on early-boot
  66 + # For evk_8mq, when swap used about 400M, upgrade the level.
  67 + setprop ro.lmk.upgrade_pressure 87
  68 + setprop ro.lmk.downgrade_pressure 95
  69 + setprop ro.lmk.critical_upgrade true
  70 +
  71 + # Set the host name which used in console
  72 + export HOSTNAME smarc-imx8mq
  73 +
  74 + # Set permission for IIM node
  75 + symlink /dev/mxs_viim /dev/mxc_mem
  76 +
  77 + # Enable Tethering in the Settings
  78 + setprop ro.tether.denied false
  79 +
  80 + setprop sys.hwc.disable 1
  81 + setprop vendor.2d.composition 0
  82 + setprop hwc.stretch.filter 1
  83 +
  84 + #viv sdk dir
  85 + setprop VIVANTE_SDK_DIR /vendor/etc/viv_sdk
  86 +
  87 + # fsl omx graphic manager media framework property
  88 + setprop rw.VIDEO_RENDER_NAME video_render.surface
  89 + setprop media.fsl_codec.flag 7
  90 + setprop debug.stagefright.ccodec 0
  91 +
  92 + setprop camera.disable_zsl_mode 1
  93 +
  94 + # Tweak the mmc device read ahead buffer size
  95 + write /sys/block/mmcblk0/queue/read_ahead_kb 2048
  96 + write /sys/block/mmcblk1/queue/read_ahead_kb 2048
  97 +
  98 + # Set period_us for usb audio
  99 + setprop ro.audio.usb.period_us 20000
  100 +
  101 + # Prepare for wifi
  102 + setprop wifi.interface wlan0
  103 +
  104 + setprop persist.service.bdroid.bdaddr 22:22:67:C6:69:73
  105 +
  106 + # Prepare for bluetooth
  107 + chmod 665 /sys/class/rfkill/rfkill0/state
  108 + chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
  109 + write /sys/class/rfkill/rfkill0/state 0
  110 +
  111 + # Prepare for RIL
  112 + setprop ro.ril.wake_lock_timeout 300
  113 +
  114 + # Use ro.boot.lcd_density to override ro.sf.lcd_density
  115 + setprop ro.sf.lcd_density ${ro.boot.lcd_density}
  116 +
  117 + # Disable surfaceflinger back pressure propagate
  118 + setprop debug.sf.disable_backpressure 1
  119 +
  120 + # Set tracefs permission to 755
  121 + chmod 0755 /sys/kernel/debug/tracing
  122 +
  123 + # Set sw_sync group to graphics and set permission to 664
  124 + chown root graphics /sys/kernel/debug/sync/sw_sync
  125 + chmod 0664 /sys/kernel/debug/sync/sw_sync
  126 +
  127 + # Default backlight device
  128 + setprop hw.backlight.dev "backlight"
  129 + # Chmod/chown FSL specific sys entry
  130 + chown system system /sys/class/backlight/backlight/brightness
  131 + chmod 0660 /sys/class/backlight/backlight/brightness
  132 +
  133 + # Set light sensor sysfs path and light sensor threshold lux value
  134 + setprop ro.hardware.lightsensor "/sys/class/i2c-dev/i2c-0/device/0-0044/"
  135 + setprop ro.lightsensor.threshold 20
  136 +
  137 + # Dectect DSF streams when scanning media
  138 + setprop ro.FSL_DSF_PARSER 1
  139 +
  140 + # Allow DSD file(duration larger than 10s) can play
  141 + setprop audio.offload.min.duration.secs 10
  142 +
  143 + # Enlarge limition of audio buffer allocation
  144 + setprop ro.af.client_heap_size_kbyte 32768
  145 +
  146 + # enlarge media max memory size to 3G.
  147 + setprop ro.media.maxmem 3221225471
  148 +
  149 + setprop wlan.interface wlan0
  150 + start vendor.wifi_hal_legacy
  151 +
  152 +on boot
  153 + start audioserver
  154 + start mediadrm
  155 + start media
  156 + start drm
  157 +
  158 +service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
  159 + -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 \
  160 + -g@android:wpa_wlan0
  161 + interface android.hardware.wifi.supplicant@1.0::ISupplicant default
  162 + interface android.hardware.wifi.supplicant@1.1::ISupplicant default
  163 + interface android.hardware.wifi.supplicant@1.2::ISupplicant default
  164 + class main
  165 + socket wpa_wlan0 dgram 660 wifi wifi
  166 + disabled
  167 + oneshot
  168 +
  169 +service sensor_fusion /vendor/bin/fsl_sensor_fusion
  170 + class late_start
  171 + seclabel u:r:sensors:s0
  172 + user system
  173 + group input
  174 + oneshot
  175 +
  176 +# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
  177 +service watchdogd /sbin/watchdogd 10 20
  178 + class core
  179 + seclabel u:r:watchdogd:s0
  180 +
  181 +service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
  182 + class main
  183 + disabled
  184 + oneshot
  185 +
  186 +service dhcpcd_p2p /system/bin/dhcpcd -aABKL
  187 + class main
  188 + disabled
  189 + oneshot
  190 +
  191 +service dhcpcd_eth0 /system/bin/dhcpcd -ABKL eth0
  192 + class main
  193 + disabled
  194 + oneshot
  195 +
  196 +service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
  197 + class main
  198 + disabled
  199 + oneshot
  200 +
  201 +service iprenew_wlan0 /system/bin/dhcpcd -n
  202 + class main
  203 + disabled
  204 + oneshot
  205 +
  206 +service iprenew_p2p /system/bin/dhcpcd -n
  207 + class main
  208 + disabled
  209 + oneshot
  210 +
  211 +service iprenew_eth0 /system/bin/dhcpcd -n eth0
  212 + class main
  213 + disabled
  214 + oneshot
  215 +
  216 +service iprenew_bt-pan /system/bin/dhcpcd -n
  217 + class main
  218 + disabled
  219 + oneshot
  220 +
  221 +# bugreport is triggered by holding down volume down, volume up and power
  222 +service bugreport /system/bin/dumpstate -d -p -B -z \
  223 + -o /data/user_de/0/com.android.shell/files/bugreports/bugreport
  224 + class main
  225 + disabled
  226 + oneshot
  227 + keycodes 114 115 116
  228 +
  229 +on fs
  230 +# mount ext4 partitions
  231 + mount_all /vendor/etc/fstab.freescale
  232 +
  233 + # Adjust parameters for dm-verity device
  234 + write /sys/block/dm-0/queue/read_ahead_kb 4096
  235 +
  236 + # Update dm-verity state and set partition.*.verified properties
  237 + verity_update_state
  238 +
  239 +on verity-logging
  240 + exec u:r:slideshow:s0 -- /sbin/slideshow warning/verity_red_1 warning/verity_red_2
  241 +
  242 +on post-fs
  243 + # Set netd memlock rlimit to 8MB
  244 + setrlimit 8 8388608 8388608
  245 +
  246 + # Turn on swap
  247 + swapon_all /vendor/etc/fstab.freescale
  248 +
  249 + # Swap in only 1 page at a time
  250 + write /proc/sys/vm/page-cluster 0
  251 +
  252 +on post-fs-data
  253 + setprop vold.post_fs_data_done 1
  254 + # create temp node for secure storage proxy
  255 + mkdir /data/vendor/ss 0700 system system
  256 +
  257 + # tmp dir for opencl Compiler
  258 + setprop TMPDIR /data/vendor/.opencl-cache
  259 + mkdir /data/vendor/.opencl-cache 0771 camera camera
  260 +
  261 +on zygote-start
  262 + # Create the directories used by the Wireless subsystem
  263 + mkdir /data/misc/wifi 0770 wifi wifi
  264 + mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
  265 + mkdir /data/vendor/wifi 0771 wifi wifi
  266 + mkdir /data/vendor/wifi/wpa 0770 wifi wifi
  267 + mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
  268 + mkdir /data/misc/dhcp 0770 dhcp dhcp
  269 + chown dhcp dhcp /data/misc/dhcp
  270 +
  271 +service early_init_sh /vendor/bin/init.insmod.sh /vendor/etc/early.init.cfg sys.all.early_init.ready
  272 + class main
  273 + user root
  274 + group root system
  275 + disabled
  276 + oneshot
  277 +
  278 +on property:sys.boot_completed=1 && property:vendor.storageproxyd=trusty
  279 + start storageproxyd
  280 +
  281 +service storageproxyd /vendor/bin/storageproxyd -p /data/vendor/ss -r /dev/mmcblk0rpmb -d /dev/trusty-ipc-dev0
  282 + group system
  283 +
  284 +on property:ro.boot.vendor.sysrq=1
  285 + write /proc/sys/kernel/sysrq 1
imx8m/smarc_mx8mq/init.usb.rc
... ... @@ -0,0 +1,52 @@
  1 +#
  2 +# Copyright (C) 2016 The Android Open-Source Project
  3 +# Copyright 2018 NXP
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +on early-boot
  18 + mount configfs none /config
  19 + mkdir /config/usb_gadget/g1 0770
  20 + mkdir /config/usb_gadget/g1/strings/0x409 0770
  21 + write /config/usb_gadget/g1/bcdUSB 0x0200
  22 + write /config/usb_gadget/g1/idVendor 0x18d1
  23 + write /config/usb_gadget/g1/bcdDevice 0x0440
  24 + write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
  25 + write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
  26 + write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
  27 + mkdir /config/usb_gadget/g1/functions/mass_storage.0
  28 + mkdir /config/usb_gadget/g1/functions/accessory.gs2
  29 + mkdir /config/usb_gadget/g1/functions/audio_source.gs3
  30 + mkdir /config/usb_gadget/g1/functions/rndis.gs4
  31 + mkdir /config/usb_gadget/g1/functions/midi.gs5
  32 + mkdir /config/usb_gadget/g1/functions/ffs.adb
  33 + mkdir /config/usb_gadget/g1/functions/ffs.mtp
  34 + mkdir /config/usb_gadget/g1/functions/ffs.ptp
  35 + mkdir /config/usb_gadget/g1/configs/b.1 0770
  36 + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770
  37 + write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
  38 + write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
  39 + mkdir /dev/usb-ffs 0775 shell shell
  40 + mkdir /dev/usb-ffs/adb 0770 shell shell
  41 + mount functionfs adb /dev/usb-ffs/adb rmode=0770,fmode=0660,uid=2000,gid=2000
  42 + mkdir /dev/usb-ffs/mtp 0770 mtp mtp
  43 + mkdir /dev/usb-ffs/ptp 0770 mtp mtp
  44 + mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
  45 + mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
  46 + setprop sys.usb.mtp.device_type 3
  47 + setprop vendor.usb.config "38100000.usb"
  48 + write /sys/module/libcomposite/parameters/disable_l1_for_hs "y"
  49 + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
  50 +
  51 +on boot
  52 + setprop sys.usb.configfs 2
imx8m/smarc_mx8mq/input-port-associations.xml
... ... @@ -0,0 +1,22 @@
  1 +<!-- Use below commands to get display port number:
  2 +# dumpsys SurfaceFlinger - -display-id
  3 +Display 4692921138614785 (HWC display 1): port=1 pnpId=DEL displayName="DELL S2740L"
  4 +Display 4693505326422272 (HWC display 0): port=0 pnpId=DEL displayName="DELL P2314T"
  5 +
  6 +Use below commands to get touch input location:
  7 +# getevent -i | grep location
  8 +location: "usb-xhci-hcd.0.auto-1.1.4/input0"
  9 +location: "usb-xhci-hcd.0.auto-1.2.4/input0"
  10 +
  11 +Then bind the display port and input location with below table. This table need
  12 +to modify according to actual connection.
  13 +One display can link with multi-input.
  14 +-->
  15 +<ports>
  16 + <port display="0" input="usb-xhci-hcd.1.auto-1.1.4/input0" />
  17 + <port display="1" input="usb-xhci-hcd.1.auto-1.2.4/input0" />
  18 + <port display="0" input="usb-xhci-hcd.0.auto-1.1.4/input0" />
  19 + <port display="1" input="usb-xhci-hcd.0.auto-1.2.4/input0" />
  20 + <port display="0" input="usb-xhci-hcd.0.auto-1.4/input0" />
  21 + <port display="1" input="usb-xhci-hcd.1.auto-1.4/input0" />
  22 +</ports>
imx8m/smarc_mx8mq/manifest.xml
... ... @@ -0,0 +1,249 @@
  1 +<manifest version="1.0" type="device" target-level="4">
  2 + <hal format="hidl">
  3 + <name>android.hardware.graphics.allocator</name>
  4 + <transport>hwbinder</transport>
  5 + <impl level="generic"></impl>
  6 + <version>2.0</version>
  7 + <interface>
  8 + <name>IAllocator</name>
  9 + <instance>default</instance>
  10 + </interface>
  11 + </hal>
  12 + <hal format="hidl">
  13 + <name>android.hardware.graphics.composer</name>
  14 + <transport>hwbinder</transport>
  15 + <version>2.3</version>
  16 + <interface>
  17 + <name>IComposer</name>
  18 + <instance>default</instance>
  19 + </interface>
  20 + </hal>
  21 + <hal format="hidl">
  22 + <name>android.hardware.keymaster</name>
  23 + <transport>hwbinder</transport>
  24 + <version>3.0</version>
  25 + <interface>
  26 + <name>IKeymasterDevice</name>
  27 + <instance>default</instance>
  28 + </interface>
  29 + </hal>
  30 + <hal format="hidl">
  31 + <name>android.hardware.drm</name>
  32 + <transport>hwbinder</transport>
  33 + <version>1.0</version>
  34 + <interface>
  35 + <name>ICryptoFactory</name>
  36 + <instance>default</instance>
  37 + </interface>
  38 + <interface>
  39 + <name>IDrmFactory</name>
  40 + <instance>default</instance>
  41 + </interface>
  42 + <fqname>@1.2::ICryptoFactory/clearkey</fqname>
  43 + <fqname>@1.2::IDrmFactory/clearkey</fqname>
  44 + </hal>
  45 + <hal format="hidl">
  46 + <name>android.hardware.gatekeeper</name>
  47 + <transport>hwbinder</transport>
  48 + <version>1.0</version>
  49 + <interface>
  50 + <name>IGatekeeper</name>
  51 + <instance>default</instance>
  52 + </interface>
  53 + </hal>
  54 + <hal format="hidl">
  55 + <name>android.hardware.graphics.mapper</name>
  56 + <transport arch="32+64">passthrough</transport>
  57 + <impl level="generic"></impl>
  58 + <version>2.1</version>
  59 + <interface>
  60 + <name>IMapper</name>
  61 + <instance>default</instance>
  62 + </interface>
  63 + </hal>
  64 + <hal format="hidl">
  65 + <name>android.hardware.renderscript</name>
  66 + <transport arch="32+64">passthrough</transport>
  67 + <version>1.0</version>
  68 + <interface>
  69 + <name>IDevice</name>
  70 + <instance>default</instance>
  71 + </interface>
  72 + </hal>
  73 + <hal format="hidl">
  74 + <name>android.hardware.configstore</name>
  75 + <transport>hwbinder</transport>
  76 + <version>1.1</version>
  77 + <interface>
  78 + <name>ISurfaceFlingerConfigs</name>
  79 + <instance>default</instance>
  80 + </interface>
  81 + </hal>
  82 + <hal format="hidl">
  83 + <name>android.hardware.media.omx</name>
  84 + <transport>hwbinder</transport>
  85 + <version>1.0</version>
  86 + <interface>
  87 + <name>IOmx</name>
  88 + <instance>default</instance>
  89 + </interface>
  90 + <interface>
  91 + <name>IOmxStore</name>
  92 + <instance>default</instance>
  93 + </interface>
  94 + </hal>
  95 + <hal format="hidl">
  96 + <name>android.hardware.wifi</name>
  97 + <transport>hwbinder</transport>
  98 + <version>1.3</version>
  99 + <interface>
  100 + <name>IWifi</name>
  101 + <instance>default</instance>
  102 + </interface>
  103 + </hal>
  104 + <hal format="hidl">
  105 + <name>android.hardware.wifi.supplicant</name>
  106 + <transport>hwbinder</transport>
  107 + <version>1.2</version>
  108 + <interface>
  109 + <name>ISupplicant</name>
  110 + <instance>default</instance>
  111 + </interface>
  112 + </hal>
  113 + <hal format="hidl">
  114 + <name>android.hardware.wifi.hostapd</name>
  115 + <transport>hwbinder</transport>
  116 + <version>1.1</version>
  117 + <interface>
  118 + <name>IHostapd</name>
  119 + <instance>default</instance>
  120 + </interface>
  121 + </hal>
  122 + <hal format="hidl">
  123 + <name>android.hardware.camera.provider</name>
  124 + <transport>hwbinder</transport>
  125 + <impl level="generic"></impl>
  126 + <version>2.4</version>
  127 + <interface>
  128 + <name>ICameraProvider</name>
  129 + <instance>legacy/0</instance>
  130 + </interface>
  131 + </hal>
  132 + <hal format="hidl">
  133 + <name>android.hardware.light</name>
  134 + <transport>hwbinder</transport>
  135 + <version>2.0</version>
  136 + <interface>
  137 + <name>ILight</name>
  138 + <instance>default</instance>
  139 + </interface>
  140 + </hal>
  141 + <hal format="hidl">
  142 + <name>android.hardware.memtrack</name>
  143 + <transport>hwbinder</transport>
  144 + <version>1.0</version>
  145 + <interface>
  146 + <name>IMemtrack</name>
  147 + <instance>default</instance>
  148 + </interface>
  149 + </hal>
  150 + <hal format="hidl">
  151 + <name>android.hardware.audio</name>
  152 + <transport>hwbinder</transport>
  153 + <version>5.0</version>
  154 + <interface>
  155 + <name>IDevicesFactory</name>
  156 + <instance>default</instance>
  157 + </interface>
  158 + </hal>
  159 + <hal format="hidl">
  160 + <name>android.hardware.audio.effect</name>
  161 + <transport>hwbinder</transport>
  162 + <version>5.0</version>
  163 + <interface>
  164 + <name>IEffectsFactory</name>
  165 + <instance>default</instance>
  166 + </interface>
  167 + </hal>
  168 + <hal format="hidl">
  169 + <name>android.hardware.usb</name>
  170 + <transport>hwbinder</transport>
  171 + <version>1.1</version>
  172 + <interface>
  173 + <name>IUsb</name>
  174 + <instance>default</instance>
  175 + </interface>
  176 + </hal>
  177 + <hal format="hidl">
  178 + <name>android.hardware.usb.gadget</name>
  179 + <transport>hwbinder</transport>
  180 + <version>1.0</version>
  181 + <interface>
  182 + <name>IUsbGadget</name>
  183 + <instance>default</instance>
  184 + </interface>
  185 + </hal>
  186 + <hal format="hidl">
  187 + <name>android.hardware.bluetooth</name>
  188 + <transport>hwbinder</transport>
  189 + <version>1.0</version>
  190 + <interface>
  191 + <name>IBluetoothHci</name>
  192 + <instance>default</instance>
  193 + </interface>
  194 + </hal>
  195 + <hal format="hidl">
  196 + <name>android.hardware.boot</name>
  197 + <transport>hwbinder</transport>
  198 + <version>1.0</version>
  199 + <interface>
  200 + <name>IBootControl</name>
  201 + <instance>default</instance>
  202 + </interface>
  203 + </hal>
  204 + <hal format="hidl">
  205 + <name>android.hardware.dumpstate</name>
  206 + <transport>hwbinder</transport>
  207 + <version>1.0</version>
  208 + <interface>
  209 + <name>IDumpstateDevice</name>
  210 + <instance>default</instance>
  211 + </interface>
  212 + </hal>
  213 + <hal format="hidl">
  214 + <name>android.hardware.oemlock</name>
  215 + <transport>hwbinder</transport>
  216 + <version>1.0</version>
  217 + <interface>
  218 + <name>IOemLock</name>
  219 + <instance>default</instance>
  220 + </interface>
  221 + </hal>
  222 + <hal format="hidl">
  223 + <name>android.hardware.health</name>
  224 + <transport>hwbinder</transport>
  225 + <version>2.0</version>
  226 + <interface>
  227 + <name>IHealth</name>
  228 + <instance>default</instance>
  229 + </interface>
  230 + </hal>
  231 + <hal format="hidl">
  232 + <name>nxp.hardware.display</name>
  233 + <transport>hwbinder</transport>
  234 + <version>1.0</version>
  235 + <interface>
  236 + <name>IDisplay</name>
  237 + <instance>default</instance>
  238 + </interface>
  239 + </hal>
  240 + <hal format="hidl">
  241 + <name>android.hardware.neuralnetworks</name>
  242 + <transport>hwbinder</transport>
  243 + <version>1.2</version>
  244 + <interface>
  245 + <name>IDevice</name>
  246 + <instance>vsi-npu</instance>
  247 + </interface>
  248 + </hal>
  249 +</manifest>
imx8m/smarc_mx8mq/overlay/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.png

3.39 MB

imx8m/smarc_mx8mq/overlay/frameworks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.png

3.39 MB

imx8m/smarc_mx8mq/overlay/frameworks/base/core/res/res/drawable-sw720dp-nodpi/default_wallpaper.png

3.39 MB

imx8m/smarc_mx8mq/overlay/frameworks/base/core/res/res/values/config.xml
... ... @@ -0,0 +1,199 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!--
  3 +/*
  4 +** Copyright 2011, The Android Open Source Project
  5 +**
  6 +** Licensed under the Apache License, Version 2.0 (the "License");
  7 +** you may not use this file except in compliance with the License.
  8 +** You may obtain a copy of the License at
  9 +**
  10 +** http://www.apache.org/licenses/LICENSE-2.0
  11 +**
  12 +** Unless required by applicable law or agreed to in writing, software
  13 +** distributed under the License is distributed on an "AS IS" BASIS,
  14 +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 +** See the License for the specific language governing permissions and
  16 +** limitations under the License.
  17 +*/
  18 +-->
  19 +
  20 +<!-- These resources are around just to allow their values to be customized
  21 + for different hardware and product builds. -->
  22 +<resources>
  23 +
  24 + <!--For Android we support eth0 now -->
  25 + <string translatable="false" name="config_ethernet_iface_regex">eth0</string>
  26 +
  27 + <!-- List of regexpressions describing the interface (if any) that represent tetherable
  28 + USB interfaces. If the device doesn't want to support tething over USB this should
  29 + be empty. An example would be "usb.*" -->
  30 + <string-array translatable="false" name="config_tether_usb_regexs">
  31 + <item>usb0</item>
  32 + </string-array>
  33 +
  34 + <!-- List of regexpressions describing the interface (if any) that represent tetherable
  35 + Wifi interfaces. If the device doesn't want to support tethering over Wifi this
  36 + should be empty. An example would be "softap.*" -->
  37 + <string-array translatable="false" name="config_tether_wifi_regexs">
  38 + <item>"wlan0"</item>
  39 + </string-array>
  40 +
  41 + <!-- List of regexpressions describing the interface (if any) that represent tetherable
  42 + bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
  43 + should be empty. -->
  44 + <string-array translatable="false" name="config_tether_bluetooth_regexs">
  45 + <item>"bt-pan"</item>
  46 + </string-array>
  47 +
  48 + <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
  49 + <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
  50 + <!== [0,1,5,7,9] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI, TYPE_BLUETOOTH and TYPE_ETHERNET -->
  51 + <integer-array translatable="false" name="config_tether_upstream_types">
  52 + <item>0</item>
  53 + <item>1</item>
  54 + <item>5</item>
  55 + <item>7</item>
  56 + <item>9</item>
  57 + </integer-array>
  58 +
  59 + <!-- Flag indicating whether we should enable the automatic brightness in Settings.
  60 + config_hardware_automatic_brightness_available is not set, so we will use software implementation -->
  61 + <bool name="config_automatic_brightness_available">true</bool>
  62 +
  63 + <!-- An Array of "[ConnectivityManager connectionType],
  64 + [# simultaneous connection types]" -->
  65 + <string-array translatable="false" name="radioAttributes">
  66 + <item>"1,1"</item>
  67 + <item>"7,1"</item>
  68 + <item>"9,1"</item>
  69 + </string-array>
  70 +
  71 + <!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
  72 + [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
  73 + <!-- the 5th element "resore-time" indicates the number of milliseconds to delay
  74 + before automatically restore the default connection. Set -1 if the connection
  75 + does not require auto-restore. -->
  76 + <!-- the 6th element indicates boot-time dependency-met value. -->
  77 + <string-array translatable="false" name="networkAttributes">
  78 + <item>"wifi,1,1,1,-1,true"</item>
  79 + <item>"wifi_p2p,13,1,0,-1,true"</item>
  80 + <item>"bluetooth,7,7,0,-1,true"</item>
  81 + <item>"ethernet,9,9,2,-1,true"</item>
  82 + </string-array>
  83 +
  84 + <!-- Array of light sensor LUX values to define our levels for auto backlight brightness support.
  85 + The N entries of this array define N + 1 zones as follows:
  86 +
  87 + Zone 0: 0 <= LUX < array[0]
  88 + Zone 1: array[0] <= LUX < array[1]
  89 + ...
  90 + Zone N: array[N - 1] <= LUX < array[N]
  91 + Zone N + 1: array[N] <= LUX < infinity
  92 +
  93 + Must be overridden in platform specific overlays -->
  94 + <integer-array name="config_autoBrightnessLevels">
  95 + <item>5</item>
  96 + <item>15</item>
  97 + <item>50</item>
  98 + <item>100</item>
  99 + <item>200</item>
  100 + <item>400</item>
  101 + <item>1000</item>
  102 + <item>2000</item>
  103 + <item>3000</item>
  104 + <item>5000</item>
  105 + <item>10000</item>
  106 + <item>30000</item>
  107 + </integer-array>
  108 +
  109 + <!-- Array of output values for LCD backlight corresponding to the LUX values
  110 + in the config_autoBrightnessLevels array. This array should have size one greater
  111 + than the size of the config_autoBrightnessLevels array.
  112 + This must be overridden in platform specific overlays -->
  113 + <integer-array name="config_autoBrightnessLcdBacklightValues">
  114 + <item>5</item> <!-- 0-5 -->
  115 + <item>20</item> <!-- 5-15 -->
  116 + <item>30</item> <!-- 15-50 -->
  117 + <item>40</item> <!-- 50-100 -->
  118 + <item>50</item> <!-- 100-200 -->
  119 + <item>60</item> <!-- 200-400 -->
  120 + <item>70</item> <!-- 400-1000 -->
  121 + <item>80</item> <!-- 1000-2000 -->
  122 + <item>130</item> <!-- 2000-3000 -->
  123 + <item>180</item> <!-- 3000-5000 -->
  124 + <item>255</item> <!-- 5000-10000 -->
  125 + <item>255</item> <!-- 10000-30000 -->
  126 + <item>255</item> <!-- 30000+ -->
  127 + </integer-array>
  128 +
  129 + <!-- Array of output values for button backlight corresponding to the LUX values
  130 + in the config_autoBrightnessLevels array. This array should have size one greater
  131 + than the size of the config_autoBrightnessLevels array.
  132 + This must be overridden in platform specific overlays -->
  133 + <integer-array name="config_autoBrightnessButtonBacklightValues">
  134 + <item>0</item>
  135 + <item>0</item>
  136 + <item>0</item>
  137 + <item>0</item>
  138 + <item>0</item>
  139 + <item>0</item>
  140 + <item>0</item>
  141 + <item>0</item>
  142 + <item>0</item>
  143 + <item>0</item>
  144 + <item>0</item>
  145 + <item>0</item>
  146 + <item>0</item>
  147 + <item>0</item>
  148 + <item>0</item>
  149 + <item>0</item>
  150 + <item>0</item>
  151 + </integer-array>
  152 +
  153 + <!-- Array of output values for keyboard backlight corresponding to the LUX values
  154 + in the config_autoBrightnessLevels array. This array should have size one greater
  155 + than the size of the config_autoBrightnessLevels array.
  156 + This must be overridden in platform specific overlays -->
  157 + <integer-array name="config_autoBrightnessKeyboardBacklightValues">
  158 + <item>0</item>
  159 + <item>0</item>
  160 + <item>0</item>
  161 + <item>0</item>
  162 + <item>0</item>
  163 + <item>0</item>
  164 + <item>0</item>
  165 + <item>0</item>
  166 + <item>0</item>
  167 + <item>0</item>
  168 + <item>0</item>
  169 + <item>0</item>
  170 + <item>0</item>
  171 + <item>0</item>
  172 + <item>0</item>
  173 + <item>0</item>
  174 + <item>0</item>
  175 + </integer-array>
  176 +
  177 + <integer name="config_screenBrightnessDim">5</integer>
  178 +
  179 + <!-- Maximum number of supported users -->
  180 + <integer name="config_multiuserMaximumUsers">8</integer>
  181 + <!-- Whether Multiuser UI should be shown -->
  182 + <bool name="config_enableMultiUserUI">true</bool>
  183 +
  184 + <!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
  185 + autodetected from the Configuration. -->
  186 + <bool name="config_showNavigationBar">true</bool>
  187 +
  188 + <bool name="config_navBarCanMove">true</bool>
  189 +
  190 + <!-- This device is not "voice capable"; it's data-only. -->
  191 + <bool name="config_voice_capable">false</bool>
  192 +
  193 + <!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
  194 + <bool translatable="false" name="config_wifi_dual_band_support">true</bool>
  195 +
  196 + <!-- Boolean indicating whether system support sustained performance mode. -->
  197 + <bool name="config_sustainedPerformanceModeSupported">true</bool>
  198 +
  199 +</resources>
imx8m/smarc_mx8mq/overlay/frameworks/base/core/res/res/xml/power_profile.xml
... ... @@ -0,0 +1,25 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!--
  3 +**
  4 +** Copyright 2009, The Android Open Source Project
  5 +* Copyright (C) 2016 Freescale Semiconductor, Inc.
  6 +**
  7 +** Licensed under the Apache License, Version 2.0 (the "License")
  8 +** you may not use this file except in compliance with the License.
  9 +** You may obtain a copy of the License at
  10 +**
  11 +** http://www.apache.org/licenses/LICENSE-2.0
  12 +**
  13 +** Unless required by applicable law or agreed to in writing, software
  14 +** distributed under the License is distributed on an "AS IS" BASIS,
  15 +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16 +** See the License for the specific language governing permissions and
  17 +** limitations under the License.
  18 +*/
  19 +-->
  20 +
  21 +<device name="Android">
  22 + <array name="cpu.active">
  23 + <value>0.1</value>
  24 + </array>
  25 +</device>
imx8m/smarc_mx8mq/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
... ... @@ -0,0 +1,24 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!--
  3 +/**
  4 + * Copyright (c) 2009, The Android Open Source Project
  5 + *
  6 + * Licensed under the Apache License, Version 2.0 (the "License");
  7 + * you may not use this file except in compliance with the License.
  8 + * You may obtain a copy of the License at
  9 + *
  10 + * http://www.apache.org/licenses/LICENSE-2.0
  11 + *
  12 + * Unless required by applicable law or agreed to in writing, software
  13 + * distributed under the License is distributed on an "AS IS" BASIS,
  14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 + * See the License for the specific language governing permissions and
  16 + * limitations under the License.
  17 + */
  18 +-->
  19 +<resources>
  20 + <!-- Default for Settings.Secure.USER_SETUP_COMPLETE -->
  21 + <bool name="def_user_setup_complete">true</bool>
  22 + <bool name="def_bluetooth_on">false</bool>
  23 + <bool name="def_stay_on_while_plugged_in">true</bool>
  24 +</resources>
imx8m/smarc_mx8mq/overlay/packages/apps/Settings/res/values/bools.xml
... ... @@ -0,0 +1,19 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!-- Copyright (C) 2009 The Android Open Source Project
  3 +
  4 + Licensed under the Apache License, Version 2.0 (the "License");
  5 + you may not use this file except in compliance with the License.
  6 + You may obtain a copy of the License at
  7 +
  8 + http://www.apache.org/licenses/LICENSE-2.0
  9 +
  10 + Unless required by applicable law or agreed to in writing, software
  11 + distributed under the License is distributed on an "AS IS" BASIS,
  12 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + See the License for the specific language governing permissions and
  14 + limitations under the License.
  15 +-->
  16 +
  17 +<resources>
  18 + <bool name="config_additional_system_update_setting_enable">true</bool>
  19 +</resources>
imx8m/smarc_mx8mq/overlay/packages/apps/Settings/res/values/config.xml
... ... @@ -0,0 +1,22 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!-- Copyright (C) 2007 The Android Open Source Project
  3 +
  4 + Licensed under the Apache License, Version 2.0 (the "License");
  5 + you may not use this file except in compliance with the License.
  6 + You may obtain a copy of the License at
  7 +
  8 + http://www.apache.org/licenses/LICENSE-2.0
  9 +
  10 + Unless required by applicable law or agreed to in writing, software
  11 + distributed under the License is distributed on an "AS IS" BASIS,
  12 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + See the License for the specific language governing permissions and
  14 + limitations under the License.
  15 +-->
  16 +
  17 +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  18 + <string name="additional_system_update" translatable="false">com.example.android.systemupdatersample</string>
  19 + <string name="additional_system_update_menu" translatable="false">com.example.android.systemupdatersample.ui.MainActivity</string>
  20 + <string name="config_work_policy_info_intent_action" translatable="false">com.google.android.settings.privacy.ACTION_SHOW_WORK_POLICY_INFO</string>
  21 +
  22 +</resources>
imx8m/smarc_mx8mq/powerhint_imx8mq.json
... ... @@ -0,0 +1,190 @@
  1 +{
  2 + "Nodes": [
  3 + {
  4 + "Name": "CPULittleClusterMaxFreq",
  5 + "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
  6 + "Values": [
  7 + "1500000",
  8 + "1300000",
  9 + "1000000",
  10 + "800000"
  11 + ],
  12 + "DefaultIndex": 0,
  13 + "ResetOnInit": true
  14 + },
  15 + {
  16 + "Name": "CPULittleClusterMinFreq",
  17 + "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
  18 + "Values": [
  19 + "1500000",
  20 + "1300000",
  21 + "1000000",
  22 + "800000"
  23 + ],
  24 + "ResetOnInit": true
  25 + },
  26 + {
  27 + "Name": "TASchedtuneBoost",
  28 + "Path": "/dev/stune/top-app/schedtune.boost",
  29 + "Values": [
  30 + "60",
  31 + "10"
  32 + ],
  33 + "DefaultIndex": 1,
  34 + "ResetOnInit": true
  35 + },
  36 + {
  37 + "Name": "PMQoSCpuDmaLatency",
  38 + "Path": "/dev/cpu_dma_latency",
  39 + "Values": [
  40 + "0",
  41 + "3000"
  42 + ],
  43 + "DefaultIndex": 1,
  44 + "HoldFd": true
  45 + },
  46 + {
  47 + "Name": "PowerHALMainState",
  48 + "Path": "vendor.powerhal.camera",
  49 + "Values": [
  50 + "CAMERA_STREAMING",
  51 + ""
  52 + ],
  53 + "Type": "Property"
  54 + },
  55 + {
  56 + "Name": "PowerHALAudioState",
  57 + "Path": "vendor.powerhal.audio",
  58 + "Values": [
  59 + "AUDIO_LOW_LATENCY",
  60 + ""
  61 + ],
  62 + "Type": "Property"
  63 + },
  64 + {
  65 + "Name": "PowerHALRenderingState",
  66 + "Path": "vendor.powerhal.rendering",
  67 + "Values": [
  68 + "EXPENSIVE_RENDERING",
  69 + ""
  70 + ],
  71 + "Type": "Property"
  72 + }
  73 + ],
  74 + "Actions": [
  75 + {
  76 + "PowerHint": "SUSTAINED_PERFORMANCE",
  77 + "Node": "CPULittleClusterMaxFreq",
  78 + "Duration": 0,
  79 + "Value": "1000000"
  80 + },
  81 + {
  82 + "PowerHint": "INTERACTION",
  83 + "Node": "CPULittleClusterMinFreq",
  84 + "Duration": 0,
  85 + "Value": "1300000"
  86 + },
  87 + {
  88 + "PowerHint": "INTERACTION",
  89 + "Node": "TASchedtuneBoost",
  90 + "Duration": 0,
  91 + "Value": "60"
  92 + },
  93 + {
  94 + "PowerHint": "LAUNCH",
  95 + "Node": "CPULittleClusterMinFreq",
  96 + "Duration": 5000,
  97 + "Value": "1500000"
  98 + },
  99 + {
  100 + "PowerHint": "LAUNCH",
  101 + "Node": "CPULittleClusterMaxFreq",
  102 + "Duration": 5000,
  103 + "Value": "1500000"
  104 + },
  105 + {
  106 + "PowerHint": "LAUNCH",
  107 + "Node": "PMQoSCpuDmaLatency",
  108 + "Duration": 5000,
  109 + "Value": "0"
  110 + },
  111 + {
  112 + "PowerHint": "CAMERA_LAUNCH",
  113 + "Node": "CPULittleClusterMinFreq",
  114 + "Duration": 1000,
  115 + "Value": "1500000"
  116 + },
  117 + {
  118 + "PowerHint": "CAMERA_LAUNCH",
  119 + "Node": "CPULittleClusterMaxFreq",
  120 + "Duration": 1000,
  121 + "Value": "1500000"
  122 + },
  123 + {
  124 + "PowerHint": "CAMERA_LAUNCH",
  125 + "Node": "PMQoSCpuDmaLatency",
  126 + "Duration": 1000,
  127 + "Value": "0"
  128 + },
  129 + {
  130 + "PowerHint": "CAMERA_STREAMING",
  131 + "Node": "PowerHALMainState",
  132 + "Duration": 0,
  133 + "Value": "CAMERA_STREAMING"
  134 + },
  135 + {
  136 + "PowerHint": "CAMERA_STREAMING",
  137 + "Node": "CPULittleClusterMaxFreq",
  138 + "Duration": 0,
  139 + "Value": "1300000"
  140 + },
  141 + {
  142 + "PowerHint": "CAMERA_SHOT",
  143 + "Node": "CPULittleClusterMinFreq",
  144 + "Duration": 1000,
  145 + "Value": "1500000"
  146 + },
  147 + {
  148 + "PowerHint": "CAMERA_SHOT",
  149 + "Node": "CPULittleClusterMaxFreq",
  150 + "Duration": 1000,
  151 + "Value": "1500000"
  152 + },
  153 + {
  154 + "PowerHint": "CAMERA_SHOT",
  155 + "Node": "PMQoSCpuDmaLatency",
  156 + "Duration": 1000,
  157 + "Value": "0"
  158 + },
  159 + {
  160 + "PowerHint": "LOW_POWER",
  161 + "Node": "CPULittleClusterMinFreq",
  162 + "Duration": 0,
  163 + "Value": "800000"
  164 + },
  165 + {
  166 + "PowerHint": "LOW_POWER",
  167 + "Node": "CPULittleClusterMaxFreq",
  168 + "Duration": 0,
  169 + "Value": "1300000"
  170 + },
  171 + {
  172 + "PowerHint": "AUDIO_STREAMING",
  173 + "Node": "PMQoSCpuDmaLatency",
  174 + "Duration": 2000,
  175 + "Value": "0"
  176 + },
  177 + {
  178 + "PowerHint": "AUDIO_LOW_LATENCY",
  179 + "Node": "PowerHALAudioState",
  180 + "Duration": 0,
  181 + "Value": "AUDIO_LOW_LATENCY"
  182 + },
  183 + {
  184 + "PowerHint": "AUDIO_LOW_LATENCY",
  185 + "Node": "PMQoSCpuDmaLatency",
  186 + "Duration": 0,
  187 + "Value": "0"
  188 + }
  189 + ]
  190 +}
imx8m/smarc_mx8mq/required_hardware.xml
... ... @@ -0,0 +1,33 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<!-- Copyright (C) 2009 The Android Open Source Project
  3 + Copyright 2018 NXP
  4 +
  5 + Licensed under the Apache License, Version 2.0 (the "License");
  6 + you may not use this file except in compliance with the License.
  7 + You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 +-->
  17 +
  18 +<!-- These are the hardware components that are included in i.MX reference board
  19 +-->
  20 +<permissions>
  21 + <!-- This is Android and fully CTS compatible. Basically this is for CTS tests to use. -->
  22 + <feature name="android.software.cts" />
  23 + <feature name="android.hardware.camera.any" />
  24 + <feature name="android.software.home_screen" />
  25 + <feature name="android.software.input_methods" />
  26 + <feature name="android.software.cant_save_state" />
  27 + <feature name="android.hardware.location" />
  28 + <feature name="android.hardware.location.network" />
  29 + <feature name="android.hardware.bluetooth" />
  30 + <feature name="android.software.companion_device_setup" />
  31 + <feature name="android.software.autofill" />
  32 + <feature name="android.software.secure_lock_screen" />
  33 +</permissions>
imx8m/smarc_mx8mq/seccomp/mediacodec-seccomp.policy
... ... @@ -0,0 +1 @@
  1 +select: 1
imx8m/smarc_mx8mq/seccomp/mediaextractor-seccomp.policy
... ... @@ -0,0 +1,5 @@
  1 +uname: 1
  2 +fchmodat: 1
  3 +ftruncate64: 1
  4 +readlinkat: 1
  5 +pread64: 1
imx8m/smarc_mx8mq/sepolicy/audioserver.te
... ... @@ -0,0 +1 @@
  1 +allow audioserver bootanim:binder call;
imx8m/smarc_mx8mq/sepolicy/device.te
... ... @@ -0,0 +1 @@
  1 +type sysfs_rfkill, sysfs_type, fs_type;
imx8m/smarc_mx8mq/sepolicy/file_contexts
... ... @@ -0,0 +1,39 @@
  1 +#sd boot
  2 +/dev/block/platform/30b50000\.usdhc/by-name/dtbo_[ab] u:object_r:dtbo_block_device:s0
  3 +/dev/block/platform/30b50000\.usdhc/by-name/boot_[ab] u:object_r:boot_block_device:s0
  4 +/dev/block/platform/30b50000\.usdhc/by-name/system_[ab] u:object_r:system_block_device:s0
  5 +/dev/block/platform/30b50000\.usdhc/by-name/vendor_[ab] u:object_r:system_block_device:s0
  6 +/dev/block/platform/30b50000\.usdhc/by-name/product_[ab] u:object_r:system_block_device:s0
  7 +/dev/block/platform/30b50000\.usdhc/by-name/misc u:object_r:misc_block_device:s0
  8 +/dev/block/platform/30b50000\.usdhc/by-name/metadata u:object_r:metadata_block_device:s0
  9 +/dev/block/platform/30b50000\.usdhc/by-name/presistdata u:object_r:frp_block_device:s0
  10 +/dev/block/platform/30b50000\.usdhc/by-name/userdata u:object_r:userdata_block_device:s0
  11 +/dev/block/platform/30b50000\.usdhc/by-name/vbmeta_[ab] u:object_r:vbmeta_block_device:s0
  12 +
  13 +#emmc boot
  14 +/dev/block/platform/30b40000\.usdhc/by-name/dtbo_[ab] u:object_r:dtbo_block_device:s0
  15 +/dev/block/platform/30b40000\.usdhc/by-name/boot_[ab] u:object_r:boot_block_device:s0
  16 +/dev/block/platform/30b40000\.usdhc/by-name/system_[ab] u:object_r:system_block_device:s0
  17 +/dev/block/platform/30b40000\.usdhc/by-name/vendor_[ab] u:object_r:system_block_device:s0
  18 +/dev/block/platform/30b40000\.usdhc/by-name/product_[ab] u:object_r:system_block_device:s0
  19 +/dev/block/platform/30b40000\.usdhc/by-name/misc u:object_r:misc_block_device:s0
  20 +/dev/block/platform/30b40000\.usdhc/by-name/metadata u:object_r:metadata_block_device:s0
  21 +/dev/block/platform/30b40000\.usdhc/by-name/presistdata u:object_r:frp_block_device:s0
  22 +/dev/block/platform/30b40000\.usdhc/by-name/userdata u:object_r:userdata_block_device:s0
  23 +/dev/block/platform/30b40000\.usdhc/by-name/vbmeta_[ab] u:object_r:vbmeta_block_device:s0
  24 +
  25 +#peripheral
  26 +/vendor/bin/magd u:object_r:sensors_exec:s0
  27 +/vendor/bin/fsl_sensor_fusion u:object_r:sensors_exec:s0
  28 +/dev/mma8x5x u:object_r:sensors_device:s0
  29 +/dev/ttymxc[0-9]* u:object_r:tty_device:s0
  30 +/dev/FreescaleAccelerometer u:object_r:sensors_device:s0
  31 +/dev/FreescaleMagnetometer u:object_r:sensors_device:s0
  32 +/dev/FreescaleGyroscope u:object_r:sensors_device:s0
  33 +/dev/sda[0-8]* u:object_r:fuse:s0
  34 +
  35 +#Neural Network HAL service
  36 +/vendor/bin/hw/android\.hardware\.neuralnetworks@1\.2-service-vsi-npu-server u:object_r:hal_neuralnetworks_imx_exec:s0
  37 +
  38 +#Thermal HAL service
  39 +/vendor/bin/hw/android\.hardware\.thermal@2\.0-service.imx u:object_r:hal_thermal_default_exec:s0
imx8m/smarc_mx8mq/sepolicy/genfs_contexts
... ... @@ -0,0 +1,11 @@
  1 +genfscon sysfs /devices/platform/30b40000.usdhc/mmc_host/mmc0/mmc0:0001/block/mmcblk0 u:object_r:sysfs_block_devices:s0
  2 +genfscon sysfs /devices/platform/30b50000.usdhc/mmc_host/mmc1/mmc1:aaaa/block/mmcblk1 u:object_r:sysfs_block_devices:s0
  3 +genfscon sysfs /devices/platform/backlight/backlight/backlight u:object_r:sysfs_leds:s0
  4 +genfscon sysfs /devices/platform/bt_rfkill/rfkill/rfkill0 u:object_r:sysfs_rfkill:s0
  5 +genfscon sysfs /devices/platform/30be0000.ethernet/net u:object_r:sysfs_net:s0
  6 +
  7 +#8mq bcm 1CX wifi
  8 +genfscon sysfs /devices/platform/hsio/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net u:object_r:sysfs_net:s0
  9 +
  10 +# RTC on SMARC-iMX8MQ
  11 +genfscon sysfs /devices/platform/30a20000.i2c/i2c-1/1-0030/rtc u:object_r:sysfs_rtc:s0
imx8m/smarc_mx8mq/sepolicy/hal_bluetooth_default.te
... ... @@ -0,0 +1,4 @@
  1 +allow hal_bluetooth_default system_file:file read;
  2 +allow hal_bluetooth_default system_file:file open;
  3 +allow hal_bluetooth_default system_file:file getattr;
  4 +allow hal_bluetooth_default sysfs_rfkill:file write;
imx8m/smarc_mx8mq/sepolicy/hal_health_default.te
... ... @@ -0,0 +1 @@
  1 +allow hal_health_default sysfs:file { getattr open read };
imx8m/smarc_mx8mq/sepolicy/hal_usb_impl.te
... ... @@ -0,0 +1,5 @@
  1 +allow hal_usb_impl ffs_prop:file map;
  2 +allow hal_usb_impl ffs_prop:file read;
  3 +allow hal_usb_impl ffs_prop:file open;
  4 +allow hal_usb_impl ffs_prop:file getattr;
  5 +allow hal_usb_impl ffs_prop:property_service set;
imx8m/smarc_mx8mq/sepolicy/property.te
... ... @@ -0,0 +1 @@
  1 +type public_vendor_system_prop, property_type;
imx8m/smarc_mx8mq/sepolicy/property_contexts
... ... @@ -0,0 +1,8 @@
  1 +# public_vendor_system_prop
  2 +# They are public_vendor_system_props for vendor-specific extension.
  3 +sys.brcm.wifibt.completed u:object_r:public_vendor_system_prop:s0
  4 +ro.boot.board u:object_r:exported_default_prop:s0 exact string
  5 +ro.boot.bt_sdio u:object_r:exported_default_prop:s0 exact string
  6 +ro.boot.bt_firmware u:object_r:exported_default_prop:s0 exact string
  7 +ro.boot.bt_uart u:object_r:exported_default_prop:s0 exact string
  8 +ro.boot.bt_sdio_id u:object_r:exported_default_prop:s0 exact string
imx8m/smarc_mx8mq/sepolicy/system_server.te
... ... @@ -0,0 +1 @@
  1 +allow system_server nfc:file write;
imx8m/smarc_mx8mq/sepolicy_drm/file_contexts
... ... @@ -0,0 +1,7 @@
  1 +/vendor/bin/tee-supplicant u:object_r:tee_exec:s0
  2 +/vendor/bin/xtest u:object_r:tee_exec:s0
  3 +
  4 +/dev/teepriv[0-9]* u:object_r:tee_device:s0
  5 +/dev/tee[0-9]* u:object_r:tee_device:s0
  6 +/data/vendor/tee(/.*)? u:object_r:tee_data_file:s0
  7 +
imx8m/smarc_mx8mq/sepolicy_drm/hal_drm_default.te
... ... @@ -0,0 +1,2 @@
  1 +allow hal_drm_default vendor_data_file:dir { create add_name search write };
  2 +allow hal_drm_default vendor_data_file:file { create lock open read write getattr };
imx8m/smarc_mx8mq/sepolicy_drm/mediadrmserver.te
... ... @@ -0,0 +1,3 @@
  1 +allow mediadrmserver ion_device:chr_file { open read ioctl };
  2 +allow mediadrmserver vendor_file:file { read getattr };
  3 +allow mediadrmserver vendor_file:dir { read };
imx8m/smarc_mx8mq/sepolicy_drm/netd.te
... ... @@ -0,0 +1,4 @@
  1 +# Rules on netd domain for optee xtest 200x tests
  2 +allow netd tee:tcp_socket { read write getopt setopt };
  3 +allow netd tee:udp_socket { read write getopt setopt };
  4 +allow netd tee:fd { use };
imx8m/smarc_mx8mq/sepolicy_drm/shell.te
... ... @@ -0,0 +1,4 @@
  1 +allow shell tee_exec:file { getattr execute read open execute_no_trans };
  2 +allow shell tee_data_file:file { create write open getattr unlink read };
  3 +allow shell tee_data_file:dir { write add_name remove_name rename search };
  4 +allow shell tee_data_file:chr_file { read write open ioctl };
imx8m/smarc_mx8mq/sepolicy_drm/tee.te
... ... @@ -0,0 +1,18 @@
  1 +# allow run xtest as shell
  2 +domain_auto_trans(shell, tee_exec, tee);
  3 +allow tee console_device:chr_file { getattr read write ioctl };
  4 +allow tee shell:fd { use };
  5 +
  6 +allow tee tee_data_file:dir { create rmdir rename };
  7 +allow tee vendor_data_file:dir { write remove_name };
  8 +
  9 +# For xtest 200x tests
  10 +allow tee tee:tcp_socket { create connect read write getopt setopt };
  11 +allow tee tee:udp_socket { create connect read write getopt getattr };
  12 +allow tee tee:capability { net_raw };
  13 +allow tee fwmarkd_socket:sock_file { write };
  14 +allow tee port:tcp_socket { name_connect };
  15 +
  16 +# For tee-supplicant
  17 +allow tee system_data_file:dir getattr;
  18 +allow tee vendor_data_file:dir { write create add_name };
imx8m/smarc_mx8mq/signed_dp_imx8m.bin
No preview for this file type
imx8m/smarc_mx8mq/smarc_mx8mq.mk
... ... @@ -0,0 +1,326 @@
  1 +# This is an Embedian Android Reference Design platform based on SMARC-iMX8MQ CPU Modules
  2 +# It will inherit from FSL core product which in turn inherit from Google generic
  3 +
  4 +IMX_DEVICE_PATH := device/embedian/imx8m/smarc_mx8mq
  5 +
  6 +# configs shared between uboot, kernel and Android rootfs
  7 +include $(IMX_DEVICE_PATH)/SharedBoardConfig.mk
  8 +
  9 +-include device/fsl/common/imx_path/ImxPathConfig.mk
  10 +$(call inherit-product, device/fsl/imx8m/ProductConfigCommon.mk)
  11 +
  12 +ifneq ($(wildcard $(IMX_DEVICE_PATH)/fstab_nand.freescale),)
  13 +$(shell touch $(IMX_DEVICE_PATH)/fstab_nand.freescale)
  14 +endif
  15 +
  16 +ifneq ($(wildcard $(IMX_DEVICE_PATH)/fstab.freescale),)
  17 +$(shell touch $(IMX_DEVICE_PATH)/fstab.freescale)
  18 +endif
  19 +
  20 +# Overrides
  21 +PRODUCT_NAME := smarc_mx8mq
  22 +PRODUCT_DEVICE := smarc_mx8mq
  23 +PRODUCT_MODEL := smarc_mx8mq
  24 +
  25 +PRODUCT_FULL_TREBLE_OVERRIDE := true
  26 +
  27 +#Enable this to choose 32 bit user space build
  28 +#IMX8_BUILD_32BIT_ROOTFS := true
  29 +
  30 +# Include keystore attestation keys and certificates.
  31 +ifeq ($(PRODUCT_IMX_TRUSTY),true)
  32 +-include $(IMX_SECURITY_PATH)/attestation/imx_attestation.mk
  33 +endif
  34 +
  35 +# Copy device related config and binary to board
  36 +PRODUCT_COPY_FILES += \
  37 + $(IMX_DEVICE_PATH)/app_whitelist.xml:system/etc/sysconfig/app_whitelist.xml \
  38 + $(IMX_DEVICE_PATH)/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
  39 + $(IMX_DEVICE_PATH)/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
  40 + $(IMX_DEVICE_PATH)/input-port-associations.xml:$(TARGET_COPY_OUT_VENDOR)/etc/input-port-associations.xml \
  41 + $(IMX_DEVICE_PATH)/fstab.freescale:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.freescale \
  42 + $(IMX_DEVICE_PATH)/init.imx8mq.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.freescale.imx8mq.rc \
  43 + $(IMX_DEVICE_PATH)/early.init.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/early.init.cfg \
  44 + $(IMX_DEVICE_PATH)/init.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.freescale.rc \
  45 + $(IMX_DEVICE_PATH)/init.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.freescale.usb.rc \
  46 + $(IMX_DEVICE_PATH)/required_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/required_hardware.xml \
  47 + $(IMX_DEVICE_PATH)/ueventd.freescale.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
  48 + $(LINUX_FIRMWARE_IMX_PATH)/linux-firmware-imx/firmware/sdma/sdma-imx7d.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/imx/sdma/sdma-imx7d.bin \
  49 + device/fsl/common/init/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \
  50 + device/fsl/common/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \
  51 + device/fsl/common/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
  52 +
  53 +ifeq ($(PRODUCT_IMX_TRUSTY),true)
  54 +PRODUCT_COPY_FILES += \
  55 + device/fsl/common/security/rpmb_key_test.bin:rpmb_key_test.bin \
  56 + device/fsl/common/security/testkey_public_rsa4096.bin:testkey_public_rsa4096.bin
  57 +endif
  58 +
  59 +# ONLY devices that meet the CDD's requirements may declare these features
  60 +PRODUCT_COPY_FILES += \
  61 + frameworks/native/data/etc/android.hardware.audio.output.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.output.xml \
  62 + frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
  63 + frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
  64 + frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \
  65 + frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \
  66 + frameworks/native/data/etc/android.hardware.screen.landscape.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.landscape.xml \
  67 + frameworks/native/data/etc/android.hardware.screen.portrait.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.portrait.xml \
  68 + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \
  69 + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.xml \
  70 + frameworks/native/data/etc/android.hardware.touchscreen.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.xml \
  71 + frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
  72 + frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
  73 + frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level-0.xml \
  74 + frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version-1_1.xml \
  75 + frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
  76 + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
  77 + frameworks/native/data/etc/android.software.app_widgets.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.app_widgets.xml \
  78 + frameworks/native/data/etc/android.software.backup.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.backup.xml \
  79 + frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml \
  80 + frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml \
  81 + frameworks/native/data/etc/android.software.print.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.print.xml \
  82 + frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
  83 + frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml \
  84 + frameworks/native/data/etc/android.software.voice_recognizers.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.voice_recognizers.xml \
  85 + frameworks/native/data/etc/android.software.activities_on_secondary_displays.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.activities_on_secondary_displays.xml \
  86 + frameworks/native/data/etc/android.software.picture_in_picture.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.picture_in_picture.xml
  87 +
  88 +# Vendor seccomp policy files for media components:
  89 +PRODUCT_COPY_FILES += \
  90 + $(IMX_DEVICE_PATH)/seccomp/mediacodec-seccomp.policy:vendor/etc/seccomp_policy/mediacodec.policy \
  91 + $(IMX_DEVICE_PATH)/seccomp/mediaextractor-seccomp.policy:vendor/etc/seccomp_policy/mediaextractor.policy
  92 +
  93 +PRODUCT_COPY_FILES += \
  94 + device/fsl/imx8m/evk_8mq/powerhint_imx8mq.json:$(TARGET_COPY_OUT_VENDOR)/etc/configs/powerhint_imx8mq.json
  95 +
  96 +# fastboot_imx_flashall scripts, fsl-sdcard-partition script and uuu_imx_android_flash scripts
  97 +PRODUCT_COPY_FILES += \
  98 + $(IMX_DEVICE_PATH)/uuu/uuu-android-smarc-mx8mq-emmc.lst:uuu-android-smarc-mx8mq-emmc.lst \
  99 + $(IMX_DEVICE_PATH)/uuu/uuu-android-smarc-mx8mq-sd.lst:uuu-android-smarc-mx8mq-sd.lst \
  100 + device/embedian/scripts/sh/smarc-mkemmc.sh:smarc-mkemmc.sh \
  101 + device/embedian/scripts/sh/smarc-mksdcard.sh:smarc-mksdcard.sh \
  102 + device/fsl/common/tools/fastboot_imx_flashall.bat:fastboot_imx_flashall.bat \
  103 + device/fsl/common/tools/fastboot_imx_flashall.sh:fastboot_imx_flashall.sh \
  104 + device/fsl/common/tools/uuu_imx_android_flash.bat:uuu_imx_android_flash.bat \
  105 + device/fsl/common/tools/uuu_imx_android_flash.sh:uuu_imx_android_flash.sh
  106 +
  107 +USE_XML_AUDIO_POLICY_CONF := 1
  108 +
  109 +DEVICE_PACKAGE_OVERLAYS := $(IMX_DEVICE_PATH)/overlay
  110 +
  111 +PRODUCT_CHARACTERISTICS := tablet
  112 +
  113 +PRODUCT_AAPT_CONFIG += xlarge large tvdpi hdpi xhdpi
  114 +
  115 +# GPU openCL g2d
  116 +PRODUCT_COPY_FILES += \
  117 + $(IMX_PATH)/imx/opencl-2d/cl_g2d.cl:$(TARGET_COPY_OUT_VENDOR)/etc/cl_g2d.cl
  118 +
  119 +# GPU openCL SDK header file
  120 +-include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/include/CL/cl_sdk.mk
  121 +
  122 +# GPU openVX SDK header file
  123 +-include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/include/nnxc_kernels/nnxc_kernels.mk
  124 +
  125 +# GPU openCL icdloader config file
  126 +-include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/gpu-viv/icdloader/icdloader.mk
  127 +
  128 +# HWC2 HAL
  129 +PRODUCT_PACKAGES += \
  130 + android.hardware.graphics.composer@2.3-service
  131 +
  132 +# Gralloc HAL
  133 +PRODUCT_PACKAGES += \
  134 + android.hardware.graphics.mapper@2.0-impl-2.1 \
  135 + android.hardware.graphics.allocator@2.0-impl \
  136 + android.hardware.graphics.allocator@2.0-service
  137 +
  138 +# RenderScript HAL
  139 +PRODUCT_PACKAGES += \
  140 + android.hardware.renderscript@1.0-impl
  141 +
  142 +PRODUCT_PACKAGES += \
  143 + libEGL_VIVANTE \
  144 + libGLESv1_CM_VIVANTE \
  145 + libGLESv2_VIVANTE \
  146 + gralloc_viv.imx8 \
  147 + libGAL \
  148 + libGLSLC \
  149 + libVSC \
  150 + libgpuhelper \
  151 + libSPIRV_viv \
  152 + libvulkan_VIVANTE \
  153 + vulkan.imx8 \
  154 + libCLC \
  155 + libLLVM_viv \
  156 + libOpenCL \
  157 + libg2d-opencl \
  158 + libg2d-viv \
  159 + libOpenVX \
  160 + libOpenVXU \
  161 + libNNVXCBinary-evis \
  162 + libNNVXCBinary-lite \
  163 + libOvx12VXCBinary-evis \
  164 + libOvx12VXCBinary-lite \
  165 + libNNGPUBinary-evis \
  166 + libNNGPUBinary-lite \
  167 + gatekeeper.imx8
  168 +
  169 +PRODUCT_PACKAGES += \
  170 + android.hardware.audio@5.0-impl:32 \
  171 + android.hardware.audio@2.0-service \
  172 + android.hardware.audio.effect@5.0-impl:32 \
  173 + android.hardware.power@1.3-service.imx \
  174 + android.hardware.light@2.0-impl \
  175 + android.hardware.light@2.0-service \
  176 + android.hardware.configstore@1.1-service \
  177 + configstore@1.1.policy
  178 +
  179 +# Thermal HAL
  180 +PRODUCT_PACKAGES += \
  181 + android.hardware.thermal@2.0-service.imx
  182 +PRODUCT_COPY_FILES += \
  183 + device/fsl/imx8m/evk_8mq/thermal_info_config_imx8mq.json:$(TARGET_COPY_OUT_VENDOR)/etc/configs/thermal_info_config_imx8mq.json
  184 +
  185 +# Neural Network HAL and lib
  186 +PRODUCT_PACKAGES += \
  187 + libovxlib \
  188 + libnnrt \
  189 + android.hardware.neuralnetworks@1.2-service-vsi-npu-server
  190 +
  191 +# Usb HAL
  192 +PRODUCT_PACKAGES += \
  193 + android.hardware.usb@1.1-service.imx
  194 +
  195 +# Bluetooth HAL
  196 +PRODUCT_PACKAGES += \
  197 + android.hardware.bluetooth@1.0-impl \
  198 + android.hardware.bluetooth@1.0-service
  199 +
  200 +# WiFi HAL
  201 +PRODUCT_PACKAGES += \
  202 + android.hardware.wifi@1.0-service \
  203 + wifilogd \
  204 + wificond
  205 +
  206 +# BCM Bluetooth vendor config
  207 +PRODUCT_PACKAGES += \
  208 + bt_vendor.conf
  209 +
  210 +# BCM 1CX Bluetooth Firmware
  211 +PRODUCT_COPY_FILES += \
  212 + vendor/nxp/imx-firmware/cyw-wifi-bt/1CX_CYW4356/BCM4354A2.1CX.hcd:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/CYW4354A2.1CX.hcd
  213 +
  214 +# BCM 1CX Wifi Firmware
  215 +PRODUCT_COPY_FILES += \
  216 + vendor/nxp/imx-firmware/cyw-wifi-bt/1CX_CYW4356/brcmfmac4356-pcie.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac4356-pcie.bin \
  217 + vendor/nxp/imx-firmware/cyw-wifi-bt/1CX_CYW4356/brcmfmac4356-pcie.clm_blob:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac4356-pcie.clm_blob \
  218 + vendor/nxp/imx-firmware/cyw-wifi-bt/1CX_CYW4356/brcmfmac4356-pcie.txt:$(TARGET_COPY_OUT_VENDOR)/firmware/brcm/brcmfmac4356-pcie.txt
  219 +
  220 +# hardware backed keymaster service
  221 +ifeq ($(PRODUCT_IMX_TRUSTY),true)
  222 +PRODUCT_PACKAGES += \
  223 + android.hardware.keymaster@3.0-service.trusty
  224 +endif
  225 +
  226 +PRODUCT_COPY_FILES += \
  227 + $(IMX_DEVICE_PATH)/camera_config_imx8mq.json:$(TARGET_COPY_OUT_VENDOR)/etc/configs/camera_config_imx8mq.json
  228 +
  229 +# Keymaster HAL
  230 +PRODUCT_PACKAGES += \
  231 + android.hardware.keymaster@3.0-impl \
  232 + android.hardware.keymaster@3.0-service
  233 +
  234 +# DRM HAL
  235 +TARGET_ENABLE_MEDIADRM_64 := true
  236 +PRODUCT_PACKAGES += \
  237 + android.hardware.drm@1.0-impl \
  238 + android.hardware.drm@1.0-service
  239 +
  240 +# new gatekeeper HAL
  241 +PRODUCT_PACKAGES += \
  242 + android.hardware.gatekeeper@1.0-impl \
  243 + android.hardware.gatekeeper@1.0-service
  244 +
  245 +# Add Trusty OS backed gatekeeper and secure storage proxy
  246 +ifeq ($(PRODUCT_IMX_TRUSTY),true)
  247 +PRODUCT_PACKAGES += \
  248 + gatekeeper.trusty \
  249 + storageproxyd
  250 +endif
  251 +
  252 +#Dumpstate HAL 1.0 support
  253 +PRODUCT_PACKAGES += \
  254 + android.hardware.dumpstate@1.0-service.imx
  255 +
  256 +ifeq ($(PRODUCT_IMX_TRUSTY),true)
  257 +#Oemlock HAL 1.0 support
  258 +PRODUCT_PACKAGES += \
  259 + android.hardware.oemlock@1.0-service.imx
  260 +endif
  261 +
  262 +ifneq ($(BUILD_TARGET_FS),ubifs)
  263 +PRODUCT_PROPERTY_OVERRIDES += \
  264 + ro.internel.storage_size=/sys/block/mmcblk0/size \
  265 + ro.frp.pst=/dev/block/by-name/presistdata
  266 +endif
  267 +
  268 +# ro.product.first_api_level indicates the first api level the device has commercially launched on.
  269 +PRODUCT_PROPERTY_OVERRIDES += \
  270 + ro.product.first_api_level=28 \
  271 + vendor.typec.legacy=true
  272 +
  273 +PRODUCT_PACKAGES += \
  274 + libg1 \
  275 + libhantro \
  276 + libcodec
  277 +
  278 +# CANbus tools
  279 +PRODUCT_PACKAGES += \
  280 + candump \
  281 + cansend \
  282 + cangen \
  283 + canfdtest \
  284 + cangw \
  285 + canplayer \
  286 + cansniffer \
  287 + isotprecv \
  288 + isotpsend \
  289 + isotpserver
  290 +
  291 +# Add oem unlocking option in settings.
  292 +PRODUCT_PROPERTY_OVERRIDES += ro.frp.pst=/dev/block/by-name/presistdata
  293 +PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
  294 +
  295 +# Tensorflow lite camera demo
  296 +PRODUCT_PACKAGES += \
  297 + tflitecamerademo
  298 +
  299 +# Multi-Display launcher
  300 +PRODUCT_PACKAGES += \
  301 + MultiDisplay
  302 +
  303 +# Specify rollback index for bootloader and for AVB
  304 +ifneq ($(AVB_RBINDEX),)
  305 +BOARD_AVB_ROLLBACK_INDEX := $(AVB_RBINDEX)
  306 +else
  307 +BOARD_AVB_ROLLBACK_INDEX := 0
  308 +endif
  309 +
  310 +#DRM Widevine 1.2 L3 support
  311 +PRODUCT_PACKAGES += \
  312 + android.hardware.drm@1.0-impl \
  313 + android.hardware.drm@1.0-service \
  314 + android.hardware.drm@1.2-service.widevine \
  315 + android.hardware.drm@1.2-service.clearkey \
  316 + libwvdrmcryptoplugin \
  317 + libwvhidl \
  318 + libwvdrmengine \
  319 +
  320 +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
  321 +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_keys.mk)
  322 +PRODUCT_PACKAGES += \
  323 + adb_debug.prop
  324 +endif
  325 +
  326 +IMX-DEFAULT-G2D-LIB := libg2d-viv
imx8m/smarc_mx8mq/smarc_mx8mq_drm.mk
... ... @@ -0,0 +1,77 @@
  1 +# This is a FSL Android Reference Design platform based on i.MX8MQ board
  2 +# It will inherit from FSL core product which in turn inherit from Google generic
  3 +
  4 +IMX_DEVICE_PATH := device/embedian/imx8m/smarc_mx8mq
  5 +
  6 +PRODUCT_IMX_DRM := true
  7 +
  8 +# copy drm specific files before inherit smarc_mx8mq.mk, otherwise copy is ignored
  9 +PRODUCT_COPY_FILES += \
  10 + $(IMX_DEVICE_PATH)/audio_policy_configuration_drm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
  11 + $(IMX_DEVICE_PATH)/init.imx8mq.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.freescale.imx8mq.main.rc \
  12 + $(IMX_DEVICE_PATH)/init.imx8mq.drm.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.freescale.imx8mq.rc \
  13 + $(TOPDIR)device/fsl/imx8m/tee-supplicant.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/tee-supplicant.rc \
  14 +
  15 +
  16 +$(call inherit-product, $(TOPDIR)device/embedian/imx8m/optee-packages.mk)
  17 +$(call inherit-product, $(TOPDIR)$(IMX_DEVICE_PATH)/smarc_mx8mq.mk)
  18 +
  19 +TARGET_KERNEL_DEFCONFIG := smarcimx8m_android_defconfig
  20 +
  21 +
  22 +# Overrides
  23 +PRODUCT_NAME := smarc_mx8mq_drm
  24 +
  25 +CFG_DRM_SECURE_DATA_PATH ?= y
  26 +CFG_RDC_SECURE_DATA_PATH ?= y
  27 +
  28 +ifeq ($(CFG_DRM_SECURE_DATA_PATH),y)
  29 +CFG_SECURE_DATA_PATH := y
  30 +CFG_TEE_SDP_MEM_BASE := 0xcc000000
  31 +CFG_TEE_SDP_MEM_SIZE := 0x02000000
  32 +ifeq ($(CFG_RDC_SECURE_DATA_PATH),y)
  33 +DECRYPTED_BUFFER_START := $(CFG_TEE_SDP_MEM_BASE)
  34 +DECRYPTED_BUFFER_LEN := $(CFG_TEE_SDP_MEM_SIZE)
  35 +DECODED_BUFFER_START := 0xCE000000
  36 +DECODED_BUFFER_LEN := 0x30000000
  37 +endif
  38 +endif
  39 +
  40 +TARGET_BOARD_DTS_CONFIG := \
  41 + smarcimx8mq-dcss-lvds:fsl-smarcimx8mq-dcss-lvds.dtb \
  42 + smarcimx8mq-dp:fsl-smarcimx8mq-dp.dtb \
  43 + smarcimx8mq:fsl-smarcimx8mq-drm.dtb \
  44 + smarcimx8mq-dual-display:fsl-smarcimx8mq-dual-display.dtb \
  45 + smarcimx8mq-edp:fsl-smarcimx8mq-edp.dtb \
  46 + smarcimx8mq-lcdif-lvds:fsl-smarcimx8mq-lcdif-lvds.dtb \
  47 + smarcimx8mq-hdmi:fsl-smarcimx8mq-hdmi.dtb
  48 +
  49 +# Exoplayer
  50 +PRODUCT_PACKAGES += \
  51 + exoplayer \
  52 +
  53 +# Playready
  54 +PRODUCT_COPY_FILES += \
  55 + vendor/nxp/drm_artifacts/playready/Samples/devcert.dat:$(TARGET_COPY_OUT_VENDOR)/playready/devcert.dat \
  56 + vendor/nxp/drm_artifacts/playready/Samples/priv.dat:$(TARGET_COPY_OUT_VENDOR)/playready/priv.dat \
  57 + vendor/nxp/drm_artifacts/playready/bgroupcert.dat:$(TARGET_COPY_OUT_VENDOR)/playready/bgroupcert.dat \
  58 + vendor/nxp/drm_artifacts/playready/zgpriv_protected.dat:$(TARGET_COPY_OUT_VENDOR)/playready/zgpriv_protected.dat \
  59 +
  60 +ifneq ($(CFG_BUILD_DRM_FROM_SOURCES),y)
  61 +PRODUCT_COPY_FILES += \
  62 + vendor/nxp/drm_artifacts/playready/ta/82dbae9c-9ce0-47e0-a1cb4048cfdb84aa.ta:$(TARGET_COPY_OUT_VENDOR)/lib/optee_armtz/82dbae9c-9ce0-47e0-a1cb4048cfdb84aa.ta \
  63 + vendor/nxp/drm_artifacts/playready/libdrmplayreadyplugin.so:$(TARGET_COPY_OUT_VENDOR)/lib64/mediadrm/libdrmplayreadyplugin.so \
  64 + vendor/nxp/drm_artifacts/playready/optee_playready_test:$(TARGET_COPY_OUT_VENDOR)/bin/optee_playready_test
  65 +endif
  66 +
  67 +ifneq ($(CFG_BUILD_DRM_FROM_SOURCES),y)
  68 +# Widevine
  69 +PRODUCT_COPY_FILES += \
  70 + vendor/nxp/drm_artifacts/widevine/lib/liboemcrypto.so:$(TARGET_COPY_OUT_VENDOR)/lib/liboemcrypto.so \
  71 + vendor/nxp/drm_artifacts/widevine/lib/libwvdrmengine.so:$(TARGET_COPY_OUT_VENDOR)/lib/mediadrm/libwvdrmengine.so \
  72 + vendor/nxp/drm_artifacts/widevine/lib/libvtswidevine.so:$(TARGET_COPY_OUT_VENDOR)/lib/drm-vts-test-libs/libvtswidevine.so \
  73 + vendor/nxp/drm_artifacts/widevine/lib64/liboemcrypto.so:$(TARGET_COPY_OUT_VENDOR)/lib64/liboemcrypto.so \
  74 + vendor/nxp/drm_artifacts/widevine/lib64/libwvdrmengine.so:$(TARGET_COPY_OUT_VENDOR)/lib64/mediadrm/libwvdrmengine.so \
  75 + vendor/nxp/drm_artifacts/widevine/lib64/libvtswidevine.so:$(TARGET_COPY_OUT_VENDOR)/lib64/drm-vts-test-libs/libvtswidevine.so \
  76 + vendor/nxp/drm_artifacts/widevine/ta/706f6574-7765-6469-77656e6942656665.ta:$(TARGET_COPY_OUT_VENDOR)/lib/optee_armtz/706f6574-7765-6469-77656e6942656665.ta
  77 +endif
imx8m/smarc_mx8mq/thermal_info_config_imx8mq.json
... ... @@ -0,0 +1,55 @@
  1 +{
  2 + "Sensors":[
  3 + {
  4 + "Name":"cpu-thermal",
  5 + "Type":"CPU",
  6 + "HotThreshold":[
  7 + "NAN",
  8 + "NAN",
  9 + "NAN",
  10 + 85.0,
  11 + 95.0,
  12 + "NAN",
  13 + "NAN"
  14 + ],
  15 + "HotHysteresis":[
  16 + 2.0,
  17 + 2.0,
  18 + 2.0,
  19 + 2.0,
  20 + 2.0,
  21 + 2.0,
  22 + 2.0
  23 + ],
  24 + "VrThreshold":"NAN",
  25 + "Multiplier":0.001,
  26 + "Monitor":true
  27 + },
  28 + {
  29 + "Name":"battery",
  30 + "Type":"BATTERY",
  31 + "HotThreshold":[
  32 + "NAN",
  33 + "NAN",
  34 + "NAN",
  35 + "NAN",
  36 + "NAN",
  37 + "NAN",
  38 + "NAN"
  39 + ],
  40 + "VrThreshold":"NAN",
  41 + "Multiplier":0.001,
  42 + "Monitor":true
  43 + }
  44 + ],
  45 + "CoolingDevices":[
  46 + {
  47 + "Name":"thermal-devfreq-0",
  48 + "Type":"GPU"
  49 + },
  50 + {
  51 + "Name":"thermal-cpufreq-0",
  52 + "Type":"CPU"
  53 + }
  54 + ]
  55 +}
imx8m/smarc_mx8mq/ueventd.freescale.rc
... ... @@ -0,0 +1,21 @@
  1 +/dev/block/platform/30b50000\.usdhc/by-name/presistdata 0600 system system
  2 +/dev/block/platform/30b40000\.usdhc/by-name/presistdata 0600 system system
  3 +/dev/ttymxc* 0660 system system
  4 +/dev/ttymxc2 0660 bluetooth bluetooth
  5 +/dev/snd/* 0660 system audio
  6 +/dev/video* 0660 system camera
  7 +/dev/mxc_hantro 0660 media drmrpc
  8 +/dev/imxdpu 0660 media drmrpc
  9 +/dev/uinput 0660 system bluetooth
  10 +/dev/ion 0666 media drmrpc
  11 +/dev/galcore 0666 system graphics
  12 +/dev/graphics/fb0 0660 system graphics
  13 +/dev/watchdog 0660 system root
  14 +/dev/mmcblk0rpmb 0600 system system
  15 +/dev/trusty-ipc-dev0 0660 system drmrpc
  16 +
  17 +/sys/devices/virtual/thermal/thermal_zone* trip_point_0_temp 0660 system system
  18 +/sys/devices/virtual/thermal/thermal_zone* trip_point_1_temp 0660 system system
  19 +
  20 +/sys/devices/virtual/thermal/thermal_zone* trip_point_0_hyst 0660 system system
  21 +/sys/devices/virtual/thermal/thermal_zone* trip_point_1_hyst 0660 system system
imx8m/smarc_mx8mq/uuu/uuu-android-smarc-mx8mq-emmc.lst
... ... @@ -0,0 +1,46 @@
  1 +uuu_version 1.1.81
  2 +# uuu scripts for imx8mq Android imx_pi9.0 eMMC
  3 +SDP: boot -f u-boot-imx8mq-smarcimx8mq_4g_uuu.imx
  4 +# This command will be run when use SPL
  5 +SDPU: delay 1000
  6 +SDPU: write -f u-boot-imx8mq-smarcimx8mq_4g_uuu.imx -offset 0x57c00
  7 +SDPU: jump
  8 +
  9 +# This command will be run when use SDPV
  10 +SDPV: delay 1000
  11 +SDPV: write -f u-boot-imx8mq-smarcimx8mq_4g_uuu.imx -offset 0x57c00
  12 +SDPV: jump
  13 +
  14 +# This command will be run when ROM support stream mode
  15 +SDPS: boot -f u-boot-imx8mq-smarcimx8mq_4g.imx
  16 +
  17 +FB: ucmd setenv fastboot_dev mmc
  18 +FB: ucmd setenv mmcdev 0
  19 +FB: ucmd mmc dev 0
  20 +FB: flash bootloader0 u-boot-imx8mq-smarcimx8mq_4g.imx
  21 +FB[-t 600000]: flash gpt partition-table.img
  22 +
  23 +# erase environment variables of uboot
  24 +FB: ucmd mmc dev 0 0
  25 +FB: ucmd mmc erase 0x2000 8
  26 +
  27 +FB: ucmd mmc partconf 0 0 1 0
  28 +
  29 +FB: flash boot_a boot.img
  30 +FB: flash boot_b boot.img
  31 +FB[-t 100000]: flash system_a system.img
  32 +FB[-t 100000]: flash system_b system.img
  33 +FB: flash vbmeta_a vbmeta-smarcimx8mq-hdmi.img
  34 +FB: flash vbmeta_b vbmeta-smarcimx8mq-hdmi.img
  35 +FB: flash vendor_a vendor.img
  36 +FB: flash vendor_b vendor.img
  37 +FB: flash dtbo_a dtbo-smarcimx8mq-hdmi.img
  38 +FB: flash dtbo_b dtbo-smarcimx8mq-hdmi.img
  39 +
  40 +# erase userdata and misc partition
  41 +FB[-t 600000]: ERASE userdata
  42 +FB: ERASE misc
  43 +FB[-t 100000]: ERASE presistdata
  44 +FB[-t 100000]: ERASE fbmisc
  45 +
  46 +FB: done
imx8m/smarc_mx8mq/uuu/uuu-android-smarc-mx8mq-sd.lst
... ... @@ -0,0 +1,46 @@
  1 +uuu_version 1.1.81
  2 +# uuu scripts for imx8mq Android imx_pi9.0 eMMC
  3 +SDP: boot -f u-boot-imx8mq-smarcimx8mq_4g_uuu.imx
  4 +# This command will be run when use SPL
  5 +SDPU: delay 1000
  6 +SDPU: write -f u-boot-imx8mq-smarcimx8mq_4g_uuu.imx -offset 0x57c00
  7 +SDPU: jump
  8 +
  9 +# This command will be run when use SDPV
  10 +SDPV: delay 1000
  11 +SDPV: write -f u-boot-imx8mq-smarcimx8mq_4g_uuu.imx -offset 0x57c00
  12 +SDPV: jump
  13 +
  14 +# This command will be run when ROM support stream mode
  15 +SDPS: boot -f u-boot-imx8mq-smarcimx8mq_4g.imx
  16 +
  17 +FB: ucmd setenv fastboot_dev mmc
  18 +FB: ucmd setenv mmcdev 1
  19 +FB: ucmd mmc dev 1
  20 +FB: flash bootloader0 u-boot-imx8mq-smarcimx8mq_4g.imx
  21 +FB[-t 600000]: flash gpt partition-table.img
  22 +
  23 +# erase environment variables of uboot
  24 +FB: ucmd mmc dev 1
  25 +FB: ucmd mmc erase 0x2000 8
  26 +
  27 +FB: ucmd mmc partconf 1 0 1 0
  28 +
  29 +FB: flash boot_a boot.img
  30 +FB: flash boot_b boot.img
  31 +FB[-t 100000]: flash system_a system.img
  32 +FB[-t 100000]: flash system_b system.img
  33 +FB: flash vbmeta_a vbmeta-smarcimx8mq-hdmi.img
  34 +FB: flash vbmeta_b vbmeta-smarcimx8mq-hdmi.img
  35 +FB: flash vendor_a vendor.img
  36 +FB: flash vendor_b vendor.img
  37 +FB: flash dtbo_a dtbo-smarcimx8mq-hdmi.img
  38 +FB: flash dtbo_b dtbo-smarcimx8mq-hdmi.img
  39 +
  40 +# erase userdata and misc partition
  41 +FB[-t 600000]: ERASE userdata
  42 +FB: ERASE misc
  43 +FB[-t 100000]: ERASE presistdata
  44 +FB[-t 100000]: ERASE fbmisc
  45 +
  46 +FB: done
... ... @@ -0,0 +1,145 @@
  1 +#!/bin/bash
  2 +#
  3 +# install
  4 +#
  5 +# This script must be run from the Android main directory.
  6 +# embedian/install must be at ~/q1000_100_build
  7 +#
  8 +# Embedian SMARC-MX8M patches for Android 10.0.0 1.0.0
  9 +
  10 +set -e
  11 +#set -x
  12 +
  13 +SCRIPT_NAME=${0##*/}
  14 +readonly SCRIPT_VERSION="0.1"
  15 +
  16 +#### Exports Variables ####
  17 +#### global variables ####
  18 +readonly ABSOLUTE_FILENAME=$(readlink -e "$0")
  19 +readonly ABSOLUTE_DIRECTORY=$(dirname ${ABSOLUTE_FILENAME})
  20 +readonly SCRIPT_POINT=${ABSOLUTE_DIRECTORY}
  21 +readonly SCRIPT_START_DATE=$(date +%Y%m%d)
  22 +readonly ANDROID_DIR="${SCRIPT_POINT}/../../.."
  23 +
  24 +readonly BASE_BRANCH_NAME="base_q10.0.0_1.0.0"
  25 +
  26 +## git variables get from base script!
  27 +readonly _EXTPARAM_BRANCH="smarc-8mq-q10.0.0_1.0.0-ga"
  28 +
  29 +## dirs ##
  30 +readonly EMBEDIAN_PATCHS_DIR="${SCRIPT_POINT}/platform"
  31 +readonly EMBEDIAN_SH_DIR="${SCRIPT_POINT}/sh"
  32 +VENDOR_BASE_DIR=${ANDROID_DIR}/vendor/embedian
  33 +
  34 +
  35 +# print error message
  36 +# p1 - printing string
  37 +function pr_error() {
  38 + echo ${2} "E: $1"
  39 +}
  40 +
  41 +# print warning message
  42 +# p1 - printing string
  43 +function pr_warning() {
  44 + echo ${2} "W: $1"
  45 +}
  46 +
  47 +# print info message
  48 +# p1 - printing string
  49 +function pr_info() {
  50 + echo ${2} "I: $1"
  51 +}
  52 +
  53 +# print debug message
  54 +# p1 - printing string
  55 +function pr_debug() {
  56 + echo ${2} "D: $1"
  57 +}
  58 +
  59 +# test existing brang in git repo
  60 +# p1 - git folder
  61 +# p2 - branch name
  62 +function is_branch_exist()
  63 +{
  64 + local D="${1}"
  65 + local B="${2}"
  66 + local B_found
  67 + local HERE
  68 +
  69 + if [ \( ! -d "${D}" \) -o \( -z "${B}" \) ]; then
  70 + echo false
  71 + return
  72 + fi
  73 +
  74 + HERE=${PWD}
  75 + cd "${D}" > /dev/null
  76 +
  77 + # Check branch
  78 + git branch 2>&1 > /dev/null
  79 + if [ ${?} -ne 0 ]; then
  80 + echo false
  81 + cd ${HERE} > /dev/null
  82 + return
  83 + fi
  84 + B_found=$(git branch | grep -w "${B}")
  85 + if [ -z "${B_found}" ]; then
  86 + echo false
  87 + else
  88 + echo true
  89 + fi
  90 +
  91 + cd ${HERE} > /dev/null
  92 + return
  93 +}
  94 +
  95 +############### main code ##############
  96 +pr_info "Script version ${SCRIPT_VERSION} (g:20200401)"
  97 +
  98 +# disable NXP kernel Android.mk
  99 +cd ${ANDROID_DIR} > /dev/null
  100 +mv vendor/nxp-opensource/kernel_imx/drivers/staging/greybus/tools/Android.mk vendor/nxp-opensource/kernel_imx/drivers/staging/greybus/tools/Android.mk__
  101 +
  102 +cd ${ANDROID_DIR} > /dev/null
  103 +######## extended create repositories #######
  104 +pr_info "###############################"
  105 +pr_info "# Misc. external repositories #"
  106 +pr_info "###############################"
  107 +
  108 +pr_info "clone ${VENDOR_BASE_DIR}/can-utils"
  109 +git clone https://github.com/linux-can/can-utils.git ${VENDOR_BASE_DIR}/can-utils
  110 +cd ${VENDOR_BASE_DIR}/can-utils > /dev/null
  111 +git checkout 791890542ac1ce99131f36435e72af5635afc2fa -b ${BASE_BRANCH_NAME}
  112 +
  113 +pr_info "###########################"
  114 +pr_info "# Apply framework patches #"
  115 +pr_info "###########################"
  116 +cd ${EMBEDIAN_PATCHS_DIR} > /dev/null
  117 +git_array=$(find * -type d | grep '.git')
  118 +cd - > /dev/null
  119 +
  120 +for _ddd in ${git_array}
  121 +do
  122 + _git_p=$(echo ${_ddd} | sed 's/.git//g')
  123 + cd ${ANDROID_DIR}/${_git_p}/ > /dev/null
  124 +
  125 + pr_info "Apply patches for this git: \"${_git_p}/\""
  126 +
  127 + git checkout -b ${_EXTPARAM_BRANCH} || {
  128 + pr_warning "Branch ${_EXTPARAM_BRANCH} is present!"
  129 + };
  130 +
  131 + git am ${EMBEDIAN_PATCHS_DIR}/${_ddd}/*
  132 +
  133 + cd - > /dev/null
  134 +done
  135 +
  136 +pr_info "#######################"
  137 +pr_info "# Copy shell utilites #"
  138 +pr_info "#######################"
  139 +cp -r ${EMBEDIAN_SH_DIR}/* ${ANDROID_DIR}/
  140 +
  141 +pr_info "#####################"
  142 +pr_info "# Done #"
  143 +pr_info "#####################"
  144 +
  145 +exit 0
scripts/platform/device/fsl.git/0001-smarc-imx8mq-Changes-required-to-compile-Android-1.patch
... ... @@ -0,0 +1,89 @@
  1 +From 46169c5395e1ea51ee27b5647d8debc0e5ccccb6 Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Wed, 27 May 2020 12:00:59 -0700
  4 +Subject: [PATCH] smarc-imx8mq: Changes required to compile Android 10 for
  5 + device/embedian.
  6 +
  7 +---
  8 + common/build/dtbo.mk | 2 ++
  9 + common/build/Makefile | 9 ++++++---
  10 + common/imx_path/ImxPathConfig.mk | 2 ++
  11 + common/tools/imx-make.sh | 4 ++--
  12 + 4 files changed, 12 insertions(+), 5 deletions(-)
  13 +
  14 +diff --git a/common/build/dtbo.mk b/common/build/dtbo.mk
  15 +index 6641b3f..34e7bfb 100644
  16 +--- a/common/build/dtbo.mk
  17 ++++ b/common/build/dtbo.mk
  18 +@@ -22,7 +22,7 @@ KERNEL_SRC_ARCH := arm
  19 + DTS_ADDITIONAL_PATH :=
  20 + else ifeq ($(TARGET_KERNEL_ARCH), arm64)
  21 + KERNEL_SRC_ARCH := arm64
  22 +-DTS_ADDITIONAL_PATH := freescale
  23 ++DTS_ADDITIONAL_PATH := embedian
  24 + else
  25 + $(error kernel arch not supported at present)
  26 + endif
  27 +
  28 +diff --git a/common/build/Makefile b/common/build/Makefile
  29 +index 5cf9b6b2..7142865e 100644
  30 +--- a/common/build/Makefile
  31 ++++ b/common/build/Makefile
  32 +@@ -23,13 +23,16 @@ HOST_PREBUILT_TAG := $(HOST_OS)-${HOST_PREBUILT_ARCH}
  33 +
  34 + # firstly to include UbootKernelCommonConfig.mk, then SharedBoardConfig.mk, finally UbootKernelBoardConfig.mk
  35 +
  36 +-include ${fsl_git_path}/common/imx_path/ImxPathConfig.mk
  37 ++-include ${fsl_git_path}/../fsl/common/imx_path/ImxPathConfig.mk
  38 ++include ${fsl_git_path}/common/EmbPathConfig.mk
  39 + include ${soc_path}/UbootKernelCommonConfig.mk
  40 + include ${product_path}/SharedBoardConfig.mk
  41 + include ${product_path}/UbootKernelBoardConfig.mk
  42 +
  43 +-include ${fsl_git_path}/common/build/kernel.mk
  44 +-include ${fsl_git_path}/common/build/uboot.mk
  45 ++-include ${fsl_git_path}/../fsl/common/build/kernel.mk
  46 ++-include ${fsl_git_path}/../fsl/common/build/uboot.mk
  47 ++include ${fsl_git_path}/../fsl/common/build/kernel.mk
  48 ++include ${fsl_git_path}/../fsl/common/build/uboot.mk
  49 + -include ${product_path}/AndroidUboot.mk
  50 + -include ${product_path}/AndroidTee.mk
  51 +
  52 +diff --git a/common/imx_path/ImxPathConfig.mk b/common/imx_path/ImxPathConfig.mk
  53 +index e0693010..0d3a4adf 100644
  54 +--- a/common/imx_path/ImxPathConfig.mk
  55 ++++ b/common/imx_path/ImxPathConfig.mk
  56 +@@ -21,6 +21,8 @@ IMX_SECURITY_PATH := vendor/nxp-private/security
  57 +
  58 + KERNEL_IMX_PATH := vendor/nxp-opensource
  59 + UBOOT_IMX_PATH := vendor/nxp-opensource
  60 ++#KERNEL_IMX_PATH := vendor/embedian
  61 ++#UBOOT_IMX_PATH := vendor/embedian
  62 + IMX_LIB_PATH := vendor/nxp-opensource
  63 + IMX_MKIMAGE_PATH := vendor/nxp-opensource
  64 + IMX_PATH := vendor/nxp-opensource
  65 +diff --git a/common/tools/imx-make.sh b/common/tools/imx-make.sh
  66 +index ebd8a2e1..47fe9f9b 100755
  67 +--- a/common/tools/imx-make.sh
  68 ++++ b/common/tools/imx-make.sh
  69 +@@ -103,7 +103,7 @@ if [ ${build_bootloader_kernel_flag} -eq 0 ] && [ ${build_android_flag} -eq 0 ];
  70 + build_android_flag=1
  71 + fi
  72 +
  73 +-product_makefile=`pwd`/`find device/fsl -maxdepth 4 -name "${TARGET_PRODUCT}.mk"`;
  74 ++product_makefile=`pwd`/`find device/embedian -maxdepth 4 -name "${TARGET_PRODUCT}.mk"`;
  75 + product_path=${product_makefile%/*}
  76 + soc_path=${product_path%/*}
  77 + fsl_git_path=${soc_path%/*}
  78 +@@ -115,7 +115,7 @@ fi
  79 +
  80 + # redirect standard input to /dev/null to avoid manually input in kernel configuration stage
  81 + soc_path=${soc_path} product_path=${product_path} fsl_git_path=${fsl_git_path} clean_build=${clean_build} \
  82 +- make -C ./ -f ${fsl_git_path}/common/build/Makefile ${parallel_option} \
  83 ++ make -C ./ -f ${fsl_git_path}/../fsl/common/build/Makefile ${parallel_option} \
  84 + ${build_bootloader} ${build_kernel} </dev/null || exit
  85 +
  86 + if [ ${build_android_flag} -eq 1 ]; then
  87 +--
  88 +2.25.0
  89 +
scripts/platform/packages/apps/Camera2.git/0001-Fixed-crash-when-going-to-video-record-mode.patch
... ... @@ -0,0 +1,86 @@
  1 +From 5fc7cb0f1a69b4aa0db7b4b4474a1725a2de47d8 Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Tue, 24 Apr 2018 22:08:10 -0700
  4 +Subject: [PATCH] Fixed crash when going to video record mode
  5 +
  6 +Signed-off-by: Eric Lee <eric.lee@embedian.com>
  7 +---
  8 + res/drawable-anydpi-v21/ic_capture_video.png | Bin 0 -> 516 bytes
  9 + res/drawable-anydpi-v21/ic_capture_video_disabled.png | Bin 0 -> 474 bytes
  10 + res/drawable-nodpi/ic_capture_video.png | Bin 0 -> 516 bytes
  11 + res/drawable-nodpi/ic_capture_video_disabled.png | Bin 0 -> 474 bytes
  12 + 4 files changed, 0 insertions(+), 0 deletions(-)
  13 + create mode 100644 res/drawable-anydpi-v21/ic_capture_video.png
  14 + create mode 100644 res/drawable-anydpi-v21/ic_capture_video_disabled.png
  15 + create mode 100644 res/drawable-nodpi/ic_capture_video.png
  16 + create mode 100644 res/drawable-nodpi/ic_capture_video_disabled.png
  17 +
  18 +diff --git a/res/drawable-anydpi-v21/ic_capture_video.png b/res/drawable-anydpi-v21/ic_capture_video.png
  19 +new file mode 100644
  20 +index 0000000000000000000000000000000000000000..dc3d0267976620d7a5618fa805819ed81baf9a61
  21 +GIT binary patch
  22 +literal 516
  23 +zcmeAS@N?(olHy`uVBq!ia0vp^bs)^a1|%OTFYN$QoCO|{#S9Drb3m9;?W~mvP*AeO
  24 +zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkD0|VnkPZ!6Kid%2)94u^d5NUXL
  25 +zmCJ|SQ*{R4rN(8OGT5gz%w57_ec(7x`y8biFLd_2pI>RtXZ^cZ!(h{^UF$UBwLd&y
  26 +zjU#{#a_>2S8|7_TSKvE)hS{>!CASiL?LPjG*}u{E>F=_>n|>Dml%KKu`~K|H-OobB
  27 +zl7)Bdo~^#0{o!;&z5F@9<O|-pA6_qV|0;a9-}=Rah0X1Ja#j^U#_qoLudM!+GVPMK
  28 +z;BK@(_GZ}|(;uk^{O@IdcyO?ponOwT0-0g2xIJg`q4U2Kdyj9be=YFY@_1{re;2=<
  29 +zrrnPvKORhegy7^oxN|@H%=eDR-;Um2;(k?3-_3(_zogm9l@fc~_e_y|{?y%*nV(Ql
  30 +ku*%^JiUY61!Wr2Z*19e}f27kR3K)Y7p00i_>zopr0Oe}xFaQ7m
  31 +
  32 +literal 0
  33 +HcmV?d00001
  34 +
  35 +diff --git a/res/drawable-anydpi-v21/ic_capture_video_disabled.png b/res/drawable-anydpi-v21/ic_capture_video_disabled.png
  36 +new file mode 100644
  37 +index 0000000000000000000000000000000000000000..e7548964cc931b190bb2026a2967a185cb09deec
  38 +GIT binary patch
  39 +literal 474
  40 +zcmeAS@N?(olHy`uVBq!ia0vp^bs)^a1|%OTFYN$QoCO|{#S9Drb3m9;?W~mvP*AeO
  41 +zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkD0|R5ar;B4q#jQ7Ytho*a2sm8)
  42 +zv9hJ%0UOJ~zw6xv?ldSwXnNE%icI^+{@LjHp%TqWGI6U6Hm`dv^)#DJZqEU3{K%%F
  43 +zQ5-i4Z~f41wA(26LV1~PvCe0P|F^$2UX1_9pC7YduekFI!{-M5t!p0~*m8J!rqAq$
  44 +z+}9fByRDx1;&z8Q|G)ZHSN8cLvNb^^A3QG}R7c|cp7v&+)BP(|pZ)%nf8a&6od23+
  45 +zP23ORiXRUiHn;Q3*})k<cHGT6*8gLA?*5VmZAUr2oBP%6cq<vUu%<0fv<s&voALM!
  46 +kCiQ_y|HG^_e?~S2?RKj@?aQ_7fbqiM>FVdQ&MBb@04XEKfB*mh
  47 +
  48 +literal 0
  49 +HcmV?d00001
  50 +
  51 +diff --git a/res/drawable-nodpi/ic_capture_video.png b/res/drawable-nodpi/ic_capture_video.png
  52 +new file mode 100644
  53 +index 0000000000000000000000000000000000000000..dc3d0267976620d7a5618fa805819ed81baf9a61
  54 +GIT binary patch
  55 +literal 516
  56 +zcmeAS@N?(olHy`uVBq!ia0vp^bs)^a1|%OTFYN$QoCO|{#S9Drb3m9;?W~mvP*AeO
  57 +zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkD0|VnkPZ!6Kid%2)94u^d5NUXL
  58 +zmCJ|SQ*{R4rN(8OGT5gz%w57_ec(7x`y8biFLd_2pI>RtXZ^cZ!(h{^UF$UBwLd&y
  59 +zjU#{#a_>2S8|7_TSKvE)hS{>!CASiL?LPjG*}u{E>F=_>n|>Dml%KKu`~K|H-OobB
  60 +zl7)Bdo~^#0{o!;&z5F@9<O|-pA6_qV|0;a9-}=Rah0X1Ja#j^U#_qoLudM!+GVPMK
  61 +z;BK@(_GZ}|(;uk^{O@IdcyO?ponOwT0-0g2xIJg`q4U2Kdyj9be=YFY@_1{re;2=<
  62 +zrrnPvKORhegy7^oxN|@H%=eDR-;Um2;(k?3-_3(_zogm9l@fc~_e_y|{?y%*nV(Ql
  63 +ku*%^JiUY61!Wr2Z*19e}f27kR3K)Y7p00i_>zopr0Oe}xFaQ7m
  64 +
  65 +literal 0
  66 +HcmV?d00001
  67 +
  68 +diff --git a/res/drawable-nodpi/ic_capture_video_disabled.png b/res/drawable-nodpi/ic_capture_video_disabled.png
  69 +new file mode 100644
  70 +index 0000000000000000000000000000000000000000..e7548964cc931b190bb2026a2967a185cb09deec
  71 +GIT binary patch
  72 +literal 474
  73 +zcmeAS@N?(olHy`uVBq!ia0vp^bs)^a1|%OTFYN$QoCO|{#S9Drb3m9;?W~mvP*AeO
  74 +zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkD0|R5ar;B4q#jQ7Ytho*a2sm8)
  75 +zv9hJ%0UOJ~zw6xv?ldSwXnNE%icI^+{@LjHp%TqWGI6U6Hm`dv^)#DJZqEU3{K%%F
  76 +zQ5-i4Z~f41wA(26LV1~PvCe0P|F^$2UX1_9pC7YduekFI!{-M5t!p0~*m8J!rqAq$
  77 +z+}9fByRDx1;&z8Q|G)ZHSN8cLvNb^^A3QG}R7c|cp7v&+)BP(|pZ)%nf8a&6od23+
  78 +zP23ORiXRUiHn;Q3*})k<cHGT6*8gLA?*5VmZAUr2oBP%6cq<vUu%<0fv<s&voALM!
  79 +kCiQ_y|HG^_e?~S2?RKj@?aQ_7fbqiM>FVdQ&MBb@04XEKfB*mh
  80 +
  81 +literal 0
  82 +HcmV?d00001
  83 +
  84 +--
  85 +2.7.4
  86 +
scripts/platform/system/core.git/0001-smarc-imx8mqwq-Allow-parsing-additional-board-specif.patch
... ... @@ -0,0 +1,29 @@
  1 +From cb2cd41426a7575be9e032721f31c6c0cf9d135c Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Wed, 27 May 2020 14:25:59 -0700
  4 +Subject: [PATCH] smarc-imx8mq: Allow parsing additional board specific
  5 + permissions.
  6 +
  7 +---
  8 + init/ueventd.cpp | 3 ++-
  9 + 1 file changed, 2 insertions(+), 1 deletion(-)
  10 +
  11 +diff --git a/init/ueventd.cpp b/init/ueventd.cpp
  12 +index 399ea4c5c..f42c4c28d 100644
  13 +--- a/init/ueventd.cpp
  14 ++++ b/init/ueventd.cpp
  15 +@@ -238,9 +238,10 @@ int ueventd_main(int argc, char** argv) {
  16 + // allow it to override everything.
  17 + // TODO: cleanup platform ueventd.rc to remove vendor specific device node entries (b/34968103)
  18 + auto hardware = android::base::GetProperty("ro.hardware", "");
  19 ++ auto board = android::base::GetProperty("ro.boot.board", "");
  20 +
  21 + auto ueventd_configuration = ParseConfig({"/ueventd.rc", "/vendor/ueventd.rc",
  22 +- "/odm/ueventd.rc", "/ueventd." + hardware + ".rc"});
  23 ++ "/odm/ueventd.rc", "/ueventd." + hardware + ".rc", "/vendor/ueventd."+ board + ".rc" });
  24 +
  25 + uevent_handlers.emplace_back(std::make_unique<DeviceHandler>(
  26 + std::move(ueventd_configuration.dev_permissions),
  27 +--
  28 +2.25.0
  29 +
scripts/platform/system/sepolicy.git/0001-sysfs-sepolicy-allow-full-access-capabilities.patch
... ... @@ -0,0 +1,42 @@
  1 +From 48010e06461827dc28c2714f3b7749b35954467d Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Sun, 17 Mar 2019 11:40:53 +0100
  4 +Subject: [PATCH] sysfs sepolicy: allow full access capabilities
  5 +
  6 +Managing GPIOs using sysfs requires full access to:
  7 +- write
  8 +- read
  9 +- create folders (when exporting GPIO id)
  10 +- remove folders (when unexporting GPIO id)
  11 +---
  12 + prebuilts/api/28.0/public/domain.te | 1 -
  13 + public/domain.te | 1 -
  14 + 2 files changed, 2 deletions(-)
  15 +
  16 +diff --git a/prebuilts/api/28.0/public/domain.te b/prebuilts/api/28.0/public/domain.te
  17 +index 158eef78..da66fd20 100644
  18 +--- a/prebuilts/api/28.0/public/domain.te
  19 ++++ b/prebuilts/api/28.0/public/domain.te
  20 +@@ -1378,7 +1378,6 @@ neverallow { domain -traced_probes } self:capability dac_read_search;
  21 + # to do so should never be granted.
  22 + neverallow domain {
  23 + proc_type
  24 +- sysfs_type
  25 + }:dir { add_name create link remove_name rename reparent rmdir write };
  26 +
  27 + # cgroupfs directories can be created, but not files within them.
  28 +diff --git a/public/domain.te b/public/domain.te
  29 +index 158eef78..da66fd20 100644
  30 +--- a/public/domain.te
  31 ++++ b/public/domain.te
  32 +@@ -1378,7 +1378,6 @@ neverallow { domain -traced_probes } self:capability dac_read_search;
  33 + # to do so should never be granted.
  34 + neverallow domain {
  35 + proc_type
  36 +- sysfs_type
  37 + }:dir { add_name create link remove_name rename reparent rmdir write };
  38 +
  39 + # cgroupfs directories can be created, but not files within them.
  40 +--
  41 +2.17.1
  42 +
scripts/platform/system/sepolicy.git/0002-sysfs-sepolicy-allow-sysfs-and-domain-access.patch
... ... @@ -0,0 +1,48 @@
  1 +From a89cc4f328c7f1e3ebb470365c8a73290e2efbfe Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Wed, 27 May 2020 14:16:47 -0700
  4 +Subject: [PATCH] sysfs sepolicy: allow sysfs and domain access.
  5 +
  6 +- It is required for bt_vendor.conf
  7 +---
  8 + prebuilts/api/29.0/public/domain.te | 3 +--
  9 + public/domain.te | 2 +-
  10 + 2 files changed, 2 insertions(+), 3 deletions(-)
  11 +
  12 +diff --git a/prebuilts/api/29.0/public/domain.te b/prebuilts/api/29.0/public/domain.te
  13 +index 98fcc63d8..5914ac1eb 100644
  14 +--- a/prebuilts/api/29.0/public/domain.te
  15 ++++ b/prebuilts/api/29.0/public/domain.te
  16 +@@ -1035,7 +1035,7 @@ full_treble_only(`
  17 + # Do not allow vendor components access to /system files except for the
  18 + # ones whitelisted here.
  19 + neverallow {
  20 +- domain
  21 ++ -domain
  22 + -appdomain
  23 + -coredomain
  24 + -vendor_executes_system_violators
  25 +@@ -1348,7 +1348,6 @@ full_treble_only(`
  26 + # to do so should never be granted.
  27 + neverallow domain {
  28 + proc_type
  29 +- sysfs_type
  30 + }:dir { add_name create link remove_name rename reparent rmdir write };
  31 +
  32 + # cgroupfs directories can be created, but not files within them.
  33 +diff --git a/public/domain.te b/public/domain.te
  34 +index fea62ee7c..5914ac1eb 100644
  35 +--- a/public/domain.te
  36 ++++ b/public/domain.te
  37 +@@ -1035,7 +1035,7 @@ full_treble_only(`
  38 + # Do not allow vendor components access to /system files except for the
  39 + # ones whitelisted here.
  40 + neverallow {
  41 +- domain
  42 ++ -domain
  43 + -appdomain
  44 + -coredomain
  45 + -vendor_executes_system_violators
  46 +--
  47 +2.25.0
  48 +
scripts/platform/system/sepolicy.git/0003-usbhal-sepolicy-whitelist-ffs_prop-read-write-ffs-pr.patch
... ... @@ -0,0 +1,54 @@
  1 +From 6af55fb118a005b48cfc111e8cf7695247b0296a Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Fri, 22 May 2020 11:25:36 -0700
  4 +Subject: [PATCH] usbhal sepolicy: whitelist ffs_prop read / write ffs property
  5 +
  6 +- Fixes avc denied required by USB HAL
  7 +---
  8 + prebuilts/api/29.0/public/property.te | 2 ++
  9 + public/property.te | 2 ++
  10 + 2 files changed, 4 insertions(+)
  11 +
  12 +diff --git a/prebuilts/api/29.0/public/property.te b/prebuilts/api/29.0/public/property.te
  13 +index e166c000e..3e28fcce3 100644
  14 +--- a/prebuilts/api/29.0/public/property.te
  15 ++++ b/prebuilts/api/29.0/public/property.te
  16 +@@ -214,6 +214,7 @@ compatible_property_only(`
  17 + -nfc_prop
  18 + -powerctl_prop
  19 + -radio_prop
  20 ++ -ffs_prop
  21 + }:property_service set;
  22 +
  23 + neverallow {
  24 +@@ -306,6 +307,7 @@ compatible_property_only(`
  25 + -nfc_prop
  26 + -powerctl_prop
  27 + -radio_prop
  28 ++ -ffs_prop
  29 + }:file no_rw_file_perms;
  30 +
  31 + neverallow {
  32 +diff --git a/public/property.te b/public/property.te
  33 +index e166c000e..3e28fcce3 100644
  34 +--- a/public/property.te
  35 ++++ b/public/property.te
  36 +@@ -214,6 +214,7 @@ compatible_property_only(`
  37 + -nfc_prop
  38 + -powerctl_prop
  39 + -radio_prop
  40 ++ -ffs_prop
  41 + }:property_service set;
  42 +
  43 + neverallow {
  44 +@@ -306,6 +307,7 @@ compatible_property_only(`
  45 + -nfc_prop
  46 + -powerctl_prop
  47 + -radio_prop
  48 ++ -ffs_prop
  49 + }:file no_rw_file_perms;
  50 +
  51 + neverallow {
  52 +--
  53 +2.25.0
  54 +
scripts/platform/vendor/nxp-opensource/arm-trusted-firmware.git/0001-imx-atf-Fix-i.MX8M-i.MX8MM-DRAM-timwqing-structure-to-.patch
... ... @@ -0,0 +1,29 @@
  1 +From a1924d7fb2a84d35dca8fe64115f84472aef679a Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Wed, 11 Dec 2019 12:51:14 +0100
  4 +Subject: [PATCH 1/1] imx-atf: Fix i.MX8M/i.MX8MM DRAM timing structure to
  5 + match u-boot
  6 +
  7 +The DRAM timing structure was modified in u-boot. Since u-boot
  8 +copies it for later use by ATF, the ATF definition should match
  9 +the u-boot one. This fixes broken suspend/resume sequence.
  10 +---
  11 + plat/imx/common/include/dram.h | 2 ++
  12 + 1 file changed, 2 insertions(+)
  13 +
  14 +diff --git a/plat/imx/common/include/dram.h b/plat/imx/common/include/dram.h
  15 +index bf0b38489..8b5f90c11 100644
  16 +--- a/plat/imx/common/include/dram.h
  17 ++++ b/plat/imx/common/include/dram.h
  18 +@@ -41,6 +41,8 @@ struct dram_cfg_param {
  19 + };
  20 +
  21 + struct dram_timing_info {
  22 ++ /* ddrphy firmware offset */
  23 ++ unsigned int ddrphy_fw_offset;
  24 + /* umctl2 config */
  25 + struct dram_cfg_param *ddrc_cfg;
  26 + unsigned int ddrc_cfg_num;
  27 +--
  28 +2.17.1
  29 +
scripts/platform/vendor/nxp-opensource/imx-mkimage.git/0001-imx-boot-Add-support-for-smarc-imx8mq.patch
... ... @@ -0,0 +1,25 @@
  1 +From 6b1aff9759185ac64c4593ada82901a972e6db00 Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Tue, 9 Jun 2020 15:59:33 +0800
  4 +Subject: [PATCH] imx-boot: Add support for SMARC-iMX8MQ
  5 +
  6 +---
  7 + iMX8M/soc.mak | 2 +-
  8 + 1 file changed, 1 insertion(+), 1 deletion(-)
  9 +
  10 +diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak
  11 +index d714259..bd5d47f 100644
  12 +--- a/iMX8M/soc.mak
  13 ++++ b/iMX8M/soc.mak
  14 +@@ -111,7 +111,7 @@ u-boot-atf-tee.bin: u-boot.bin bl31.bin tee.bin
  15 + clean:
  16 + @rm -f $(MKIMG) u-boot-atf.bin u-boot-atf-tee.bin u-boot-spl-ddr.bin u-boot.itb u-boot.its u-boot-ddr3l.itb u-boot-ddr3l.its u-boot-spl-ddr3l.bin u-boot-ddr4.itb u-boot-ddr4.its u-boot-spl-ddr4.bin u-boot-ddr4-evk.itb u-boot-ivt.itb u-boot-ddr4-evk.its $(OUTIMG)
  17 +
  18 +-dtbs = fsl-$(PLAT)-evk.dtb
  19 ++dtbs = fsl-smarcimx8mq.dtb
  20 + u-boot.itb: $(dtbs)
  21 + ./$(PAD_IMAGE) bl31.bin
  22 + ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtbs)
  23 +--
  24 +2.17.1
  25 +
scripts/platform/vendor/nxp-opensource/imx.git/0001-libcamera3-use-camera-orientation-to-pass-to-fwk.patch
... ... @@ -0,0 +1,30 @@
  1 +From 9ea9662af4e1d8646a4a1811ff614f4958b3e19e Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Mon, 19 Aug 2019 17:58:18 -0700
  4 +Subject: [PATCH] libcamera3: use camera orientation to pass to fwk
  5 +
  6 +This fixes the camera orientation bug
  7 +
  8 +back camera : setprop back_camera_orient to 0 or 90
  9 +front camera : setprop front_camera_orient to 0 or 90
  10 +
  11 +Signed-off-by: Eric Lee <eric.lee@embedian.com>
  12 +---
  13 + libcamera3/Metadata.cpp | 1 +
  14 + 1 file changed, 1 insertion(+)
  15 +
  16 +diff --git a/libcamera3/Metadata.cpp b/libcamera3/Metadata.cpp
  17 +index 1a2738b..d1cbfb9 100644
  18 +--- a/libcamera3/Metadata.cpp
  19 ++++ b/libcamera3/Metadata.cpp
  20 +@@ -318,6 +318,7 @@ camera_metadata_t* Metadata::createStaticInfo(SensorData& sensor, camera_info &c
  21 + android_sensor_info_pixel_array_size);
  22 +
  23 + int32_t android_sensor_orientation[] = {0};
  24 ++ android_sensor_orientation[0] = camInfo.orientation;
  25 + m.addInt32(ANDROID_SENSOR_ORIENTATION,
  26 + ARRAY_SIZE(android_sensor_orientation),
  27 + android_sensor_orientation);
  28 +--
  29 +2.21.0.4.g36eb1cb
  30 +
scripts/platform/vendor/nxp-opensource/imx.git/0002-usb-hal-Use-vendor.typec.legacy-property-for-legacy-.patch
... ... @@ -0,0 +1,45 @@
  1 +From d45681495a63e4d945f11f865a553bdb45151ce6 Mon Sep 17 00:00:00 2001
  2 +From: Eric Lee <eric.lee@embedian.com>
  3 +Date: Tue, 19 May 2020 19:49:35 -0700
  4 +Subject: [PATCH] usb hal: Use vendor.typec.legacy property for legacy type c
  5 +
  6 +- For some boards that doesn't have Type C PD option, use property to
  7 +fix the role and pd option.
  8 +
  9 +Signed-off-by: Eric Lee <eric.lee@embedian.com>
  10 +---
  11 + usb/Usb.cpp | 5 +++++
  12 + usb/Usb.h | 1 +
  13 + 2 files changed, 6 insertions(+)
  14 +
  15 +diff --git a/usb/Usb.cpp b/usb/Usb.cpp
  16 +index 677a255..0aa311f 100644
  17 +--- a/usb/Usb.cpp
  18 ++++ b/usb/Usb.cpp
  19 +@@ -380,6 +380,11 @@ Status getCurrentRoleHelper(const std::string &portName, bool connected,
  20 +
  21 + Status getTypeCPortNamesHelper(std::unordered_map<std::string, bool> *names) {
  22 + DIR *dp;
  23 ++ /* Enable Typ USB Legacy Support via vendor.typec.legacy property */
  24 ++ if (property_get_bool("vendor.typec.legacy", false)) {
  25 ++ ALOGE("Force Legacy device enabled");
  26 ++ return Status::ERROR;
  27 ++ }
  28 +
  29 + dp = opendir("/sys/class/typec");
  30 + if (dp != NULL) {
  31 +diff --git a/usb/Usb.h b/usb/Usb.h
  32 +index 24d7e95..0cb10e4 100644
  33 +--- a/usb/Usb.h
  34 ++++ b/usb/Usb.h
  35 +@@ -23,6 +23,7 @@
  36 + #include <android/hardware/usb/1.1/IUsb.h>
  37 + #include <android/hardware/usb/1.1/types.h>
  38 + #include <android/hardware/usb/1.1/IUsbCallback.h>
  39 ++#include <cutils/properties.h>
  40 + #include <hidl/Status.h>
  41 + #include <utils/Log.h>
  42 +
  43 +--
  44 +2.25.0
  45 +
scripts/sh/smarc-mkemmc.sh
... ... @@ -0,0 +1,330 @@
  1 +#!/bin/bash -e
  2 +
  3 +help() {
  4 +
  5 +bn=`basename $0`
  6 +cat << EOF
  7 +
  8 +Version: 1.5
  9 +Last change: support flash product.img and dual bootloader condition
  10 +V1.4 change: add support imx8mn chips
  11 +
  12 +Usage: $bn <option> device_node
  13 +
  14 +options:
  15 + -h displays this help message
  16 + -s only get partition size
  17 + -np not partition.
  18 + -f soc_name flash android image file with soc_name. Below table lists soc_name values and bootloader offset.
  19 + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  20 + โ”‚ soc_name โ”‚ offset โ”‚
  21 + โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  22 + โ”‚ imx6dl/imx6q/imx6qp โ”‚ 1k โ”‚
  23 + โ”‚ imx6sx/imx7d/imx7ulp โ”‚ โ”‚
  24 + โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  25 + โ”‚ imx8mm/imx8mq โ”‚ 33k โ”‚
  26 + โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  27 + โ”‚ imx8qm/imx8qxp/imx8mn โ”‚ 32k โ”‚
  28 + โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  29 + -a only flash image to slot_a
  30 + -b only flash image to slot_b
  31 + -c card_size optional setting: 7 / 14 / 28
  32 + If not set, use partition-table.img (default)
  33 + If set to 7, use partition-table-7GB.img for 8GB SD card
  34 + If set to 14, use partition-table-14GB.img for 16GB SD card
  35 + If set to 28, use partition-table-28GB.img for 32GB SD card
  36 + Make sure the corresponding file exist for your platform.
  37 + -u uboot_feature flash uboot or spl&bootloader image files with "uboot_feature" in their names.
  38 + -d dtb_feature flash dtbo, recovery and vbmeta image files with "dtb_feature" in their names.
  39 + -e lpddr4_deature specify the LPDDR4 memory size. 2g or 4g
  40 + -D directory specify the directory which contains the images to be flashed.
  41 + -m flash mcu image
  42 + -o force_offset force set uboot offset
  43 +EOF
  44 +
  45 +}
  46 +
  47 +# parse command line
  48 +moreoptions=1
  49 +node="na"
  50 +soc_name=""
  51 +force_offset=""
  52 +cal_only=0
  53 +card_size=0
  54 +bootloader_offset=1
  55 +mcu_image_offset=5120
  56 +vaild_gpt_size=17
  57 +not_partition=0
  58 +slot=""
  59 +systemimage_file="system.img"
  60 +vendor_file="vendor.img"
  61 +product_file="product.img"
  62 +partition_file="partition-table.img"
  63 +g_sizes=0
  64 +support_dtbo=0
  65 +flash_mcu=0
  66 +RED='\033[0;31m'
  67 +STD='\033[0;0m'
  68 +
  69 +image_directory=""
  70 +dtb_feature=""
  71 +uboot_feature=""
  72 +lpddr4_feature=""
  73 +support_dual_bootloader=0
  74 +
  75 +
  76 +while [ "$moreoptions" = 1 -a $# -gt 0 ]; do
  77 + case $1 in
  78 + -h) help; exit ;;
  79 + -s) cal_only=1 ;;
  80 + -f) soc_name=$2; shift;;
  81 + -c) card_size=$2; shift;;
  82 + -np) not_partition=1 ;;
  83 + -a) slot="_a" ;;
  84 + -b) slot="_b" ;;
  85 + -m) flash_mcu=1 ;;
  86 + -o) force_offset=$2; shift;;
  87 + -u) uboot_feature=-$2; shift;;
  88 + -e) lpddr4_feature=$2; shift;;
  89 + -d) dtb_feature=$2; shift;;
  90 + -D) image_directory=$2; shift;;
  91 + *) moreoptions=0; node=$1 ;;
  92 + esac
  93 + [ "$moreoptions" = 0 ] && [ $# -gt 1 ] && help && exit
  94 + [ "$moreoptions" = 1 ] && shift
  95 +done
  96 +
  97 +# check required applications are installed
  98 +#command -v simg2img >/dev/null 2>&1 || { echo -e >&2 "${RED}Missing simg2img app. Please run: sudo apt-get install android-tools-fsutils${STD}" ; exit 1 ; }
  99 +command -v hdparm >/dev/null 2>&1 || { echo -e >&2 "${RED}Missing hdparm app. Please make sure it is installed. Exiting.${STD}" ; exit 1 ; }
  100 +command -v gdisk >/dev/null 2>&1 || { echo -e >&2 "${RED}Missing gdisk app. Please make sure it is installed. Exiting.${STD}" ; exit 1 ; }
  101 +
  102 +if [ ${card_size} -ne 0 ] && [ ${card_size} -ne 7 ] && [ ${card_size} -ne 14 ] && [ ${card_size} -ne 28 ]; then
  103 + help; exit 1;
  104 +fi
  105 +
  106 +# imx8qxp RevB0 chips, imx8qm RevB0 chips and imx8mn chips, bootloader offset is 32KB on SD card
  107 +if [ "${soc_name}" = "imx8qxp" -o "${soc_name}" = "imx8qm" -o "${soc_name}" = "imx8mn" ]; then
  108 + bootloader_offset=32
  109 +fi
  110 +
  111 +# imx8mq chips and imx8mm chips, bootloader offset is 33KB on SD card
  112 +if [[ "${soc_name}" = *"mx8mq"* ]]; then
  113 + bootloader_offset=33
  114 + if [[ "${soc_name}" = *"dp"* ]]; then
  115 + bootloader_file="u-boot-imx8mq-smarcimx8mq_${lpddr4_feature}${uboot_feature}-dp.imx"
  116 + else
  117 + bootloader_file="u-boot-imx8mq-smarcimx8mq_${lpddr4_feature}${uboot_feature}.imx"
  118 + fi
  119 +fi
  120 +
  121 +if [ "${force_offset}" != "" ]; then
  122 + bootloader_offset=${force_offset}
  123 +fi
  124 +
  125 +# exit if the block device file specified by ${node} doesn't exist
  126 +if [ ! -e ${node} ]; then
  127 + help
  128 + exit 1
  129 +fi
  130 +
  131 +# Process of the uboot_feature parameter
  132 +if [[ "${uboot_feature}" = *"trusty"* ]] || [[ "${uboot_feature}" = *"secure"* ]]; then
  133 + echo -e >&2 ${RED}Do not flash the image with Trusty OS to SD card${STD}
  134 + help
  135 + exit 1
  136 +fi
  137 +if [[ "${uboot_feature}" = *"dual"* ]]; then
  138 + support_dual_bootloader=1;
  139 +fi
  140 +
  141 +
  142 +# dual bootloader support will use different gpt. Android Automative only boot from eMMC, judgement here is complete
  143 +if [ ${support_dual_bootloader} -eq 1 ]; then
  144 + if [ ${card_size} -gt 0 ]; then
  145 + partition_file="partition-table-${card_size}GB-dual.img";
  146 + else
  147 + partition_file="partition-table-dual.img";
  148 + fi
  149 +else
  150 + if [ ${card_size} -gt 0 ]; then
  151 + partition_file="partition-table-${card_size}GB.img";
  152 + else
  153 + partition_file="partition-table.img";
  154 + fi
  155 +fi
  156 +
  157 +if [ ! -f "${image_directory}${partition_file}" ]; then
  158 + echo -e >&2 "${RED}File ${partition_file} not found. Please check. Exiting${STD}"
  159 + return 1
  160 +fi
  161 +
  162 +
  163 +# to be discussed
  164 +# echo "${soc_name} bootloader offset is: ${bootloader_offset}"
  165 +
  166 +# for specified directory, make sure there is a slash at the end
  167 +if [[ "${image_directory}" != "" ]]; then
  168 + image_directory="${image_directory%/}/";
  169 +fi
  170 +
  171 +
  172 +
  173 +# dump partitions
  174 +if [ "${cal_only}" -eq "1" ]; then
  175 + gdisk -l ${node} 2>/dev/null | grep -A 20 "Number "
  176 + exit 0
  177 +fi
  178 +
  179 +function get_partition_size
  180 +{
  181 + start_sector=`gdisk -l ${node} | grep -w $1 | awk '{print $2}'`
  182 + end_sector=`gdisk -l ${node} | grep -w $1 | awk '{print $3}'`
  183 + # 1 sector = 512 bytes. This will change unit from sector to MBytes.
  184 + let "g_sizes=($end_sector - $start_sector + 1) / 2048"
  185 +}
  186 +
  187 +function format_partition
  188 +{
  189 + num=`gdisk -l ${node} | grep -w $1 | awk '{print $1}'`
  190 + if [ ${num} -gt 0 ] 2>/dev/null; then
  191 + echo "format_partition: $1:${node}p${num} ext4"
  192 + mkfs.ext4 -F ${node}p${num} -L$1
  193 + fi
  194 +}
  195 +
  196 +function erase_partition
  197 +{
  198 + num=`gdisk -l ${node} | grep -w $1 | awk '{print $1}'`
  199 + if [ ${num} -gt 0 ] 2>/dev/null; then
  200 + get_partition_size $1
  201 + echo "erase_partition: $1 : ${node}p${num} ${g_sizes}M"
  202 + dd if=/dev/zero of=${node}p${num} bs=1048576 conv=fsync count=$g_sizes
  203 + fi
  204 +}
  205 +
  206 +function flash_partition
  207 +{
  208 + for num in `gdisk -l ${node} | grep -E -w "$1|$1_a|$1_b" | awk '{print $1}'`
  209 + do
  210 + if [ $? -eq 0 ]; then
  211 + if [ "$(echo ${1} | grep "bootloader_")" != "" ]; then
  212 + img_name=${uboot_proper_file}
  213 + elif [ "$(echo ${1} | grep "system")" != "" ]; then
  214 + img_name=${systemimage_file}
  215 + elif [ "$(echo ${1} | grep "vendor")" != "" ]; then
  216 + img_name=${vendor_file}
  217 + elif [ "$(echo ${1} | grep "product")" != "" ]; then
  218 + img_name=${product_file}
  219 + elif [ ${support_dtbo} -eq 1 ] && [ $(echo ${1} | grep "boot") != "" ] 2>/dev/null; then
  220 + img_name="boot.img"
  221 + elif [ "$(echo ${1} | grep -E "dtbo|vbmeta|recovery")" != "" -a "${dtb_feature}" != "" ]; then
  222 + img_name="${1%_*}-${soc_name}-${dtb_feature}.img"
  223 + else
  224 + img_name="${1%_*}-${soc_name}.img"
  225 + fi
  226 + # check whether the image files to be flashed exist or not
  227 + if [ ! -f "${image_directory}${img_name}" ]; then
  228 + echo -e >&2 "${RED}File ${img_name} not found. Please check. Exiting${STD}"
  229 + return 1
  230 + fi
  231 + echo "flash_partition: ${img_name} ---> ${node}p${num}"
  232 +
  233 + if [ "$(echo ${1} | grep "system")" != "" ] || [ "$(echo ${1} | grep "vendor")" != "" ] || [ "$(echo ${1} | grep "product")" != "" ]; then
  234 + #simg2img ${image_directory}${img_name} ${node}${num}
  235 + else
  236 + dd if=${image_directory}${img_name} of=${node}p${num} bs=10M conv=fsync
  237 + fi
  238 + fi
  239 + done
  240 +}
  241 +
  242 +function format_android
  243 +{
  244 + echo "formating android images"
  245 + format_partition userdata
  246 + format_partition cache
  247 + erase_partition presistdata
  248 + erase_partition fbmisc
  249 + erase_partition misc
  250 +}
  251 +
  252 +function make_partition
  253 +{
  254 + echo "make gpt partition for android: ${partition_file}"
  255 + dd if=${image_directory}${partition_file} of=${node} bs=1k count=${vaild_gpt_size} conv=fsync
  256 +}
  257 +
  258 +function flash_android
  259 +{
  260 + boot_partition="boot"${slot}
  261 + recovery_partition="recovery"${slot}
  262 + system_partition="system"${slot}
  263 + vendor_partition="vendor"${slot}
  264 + product_partition="product"${slot}
  265 + vbmeta_partition="vbmeta"${slot}
  266 + dtbo_partition="dtbo"${slot}
  267 + gdisk -l ${node} 2>/dev/null | grep -q "dtbo" && support_dtbo=1
  268 +
  269 + if [ "${support_dtbo}" -eq "1" ] ; then
  270 + flash_partition ${dtbo_partition} || exit 1
  271 + fi
  272 + flash_partition ${boot_partition} || exit 1
  273 + flash_partition ${recovery_partition} || exit 1
  274 + flash_partition ${system_partition} || exit 1
  275 + flash_partition ${vendor_partition} || exit 1
  276 + flash_partition ${product_partition} || exit 1
  277 + flash_partition ${vbmeta_partition} || exit 1
  278 + echo "erase_partition: uboot : ${node}"
  279 + echo "flash_partition: ${bootloader_file} ---> ${node}"
  280 + first_partition_offset=`gdisk -l ${node} | grep ' 1 ' | awk '{print $2}'`
  281 + # the unit of first_partition_offset is sector size which is 512 Byte.
  282 + count_bootloader=`expr ${first_partition_offset} / 2 - ${bootloader_offset}`
  283 + echo "the bootloader partition size: ${count_bootloader}"
  284 + dd if=/dev/zero of=${node} bs=1k seek=${bootloader_offset} conv=fsync count=${count_bootloader}
  285 + dd if=${image_directory}${bootloader_file} of=${node} bs=1k seek=${bootloader_offset} conv=fsync
  286 + if [ "${flash_mcu}" -eq "1" ] ; then
  287 + if [ "${soc_name}" = "imx7ulp" ]; then
  288 + echo -e >&2 "${RED}Caution:${STD}"
  289 + echo -e >&2 " mcu image for imx7ulp_evk is in SPI flash on board, not in SD card, use uboot commands to flash it."
  290 + else
  291 + mcu_image=${soc_name#*-}"_mcu_demo.img"
  292 + echo "flash_partition: ${mcu_image} ---> ${node}"
  293 + dd if=${image_directory}${mcu_image} of=${node} bs=1k seek=${mcu_image_offset} conv=fsync
  294 + fi
  295 + fi
  296 +}
  297 +
  298 +if [ "${not_partition}" -ne "1" ] ; then
  299 + # invoke make_partition to write first 17KB in partition table image to sdcard start
  300 + make_partition || exit 1
  301 + # unmount partitions and then force to re-read the partition table of the specified device
  302 + sleep 3
  303 + for i in `cat /proc/mounts | grep "${node}" | awk '{print $2}'`; do umount $i; done
  304 + hdparm -z ${node}
  305 + # backup the GPT table to last LBA for sd card. execute "gdisk ${node}" with the input characters
  306 + # redirect standard OUTPUT to /dev/null to reduce some ouput
  307 + echo -e 'r\ne\nY\nw\nY\nY' | gdisk ${node} 1>/dev/null
  308 + format_android
  309 +fi
  310 +
  311 +flash_android || exit 1
  312 +
  313 +if [ "${slot}" = "_b" ]; then
  314 + echo -e >&2 "${RED}Caution:${STD}"
  315 + echo -e >&2 " This script can't generate metadata to directly boot from b slot, fastboot command may need to be used to boot from b slot."
  316 +fi
  317 +
  318 +echo
  319 +echo ">>>>>>>>>>>>>> Flashing successfully completed <<<<<<<<<<<<<<"
  320 +
  321 +exit 0
  322 +
  323 +# For MFGTool Notes:
  324 +# MFGTool use mksdcard-android.tar store this script
  325 +# if you want change it.
  326 +# do following:
  327 +# tar xf mksdcard-android.sh.tar
  328 +# vi mksdcard-android.sh
  329 +# [ edit want you want to change ]
  330 +# rm mksdcard-android.sh.tar; tar cf mksdcard-android.sh.tar mksdcard-android.sh
scripts/sh/smarc-mksdcard.sh
... ... @@ -0,0 +1,330 @@
  1 +#!/bin/bash -e
  2 +
  3 +help() {
  4 +
  5 +bn=`basename $0`
  6 +cat << EOF
  7 +
  8 +Version: 1.5
  9 +Last change: support flash product.img and dual bootloader condition
  10 +V1.4 change: add support imx8mn chips
  11 +
  12 +Usage: $bn <option> device_node
  13 +
  14 +options:
  15 + -h displays this help message
  16 + -s only get partition size
  17 + -np not partition.
  18 + -f soc_name flash android image file with soc_name. Below table lists soc_name values and bootloader offset.
  19 + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  20 + โ”‚ soc_name โ”‚ offset โ”‚
  21 + โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  22 + โ”‚ imx6dl/imx6q/imx6qp โ”‚ 1k โ”‚
  23 + โ”‚ imx6sx/imx7d/imx7ulp โ”‚ โ”‚
  24 + โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  25 + โ”‚ imx8mm/imx8mq โ”‚ 33k โ”‚
  26 + โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  27 + โ”‚ imx8qm/imx8qxp/imx8mn โ”‚ 32k โ”‚
  28 + โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  29 + -a only flash image to slot_a
  30 + -b only flash image to slot_b
  31 + -c card_size optional setting: 7 / 14 / 28
  32 + If not set, use partition-table.img (default)
  33 + If set to 7, use partition-table-7GB.img for 8GB SD card
  34 + If set to 14, use partition-table-14GB.img for 16GB SD card
  35 + If set to 28, use partition-table-28GB.img for 32GB SD card
  36 + Make sure the corresponding file exist for your platform.
  37 + -u uboot_feature flash uboot or spl&bootloader image files with "uboot_feature" in their names.
  38 + -d dtb_feature flash dtbo, recovery and vbmeta image files with "dtb_feature" in their names.
  39 + -e lpddr4_deature specify the LPDDR4 memory size. 2g or 4g
  40 + -D directory specify the directory which contains the images to be flashed.
  41 + -m flash mcu image
  42 + -o force_offset force set uboot offset
  43 +EOF
  44 +
  45 +}
  46 +
  47 +# parse command line
  48 +moreoptions=1
  49 +node="na"
  50 +soc_name=""
  51 +force_offset=""
  52 +cal_only=0
  53 +card_size=0
  54 +bootloader_offset=1
  55 +mcu_image_offset=5120
  56 +vaild_gpt_size=17
  57 +not_partition=0
  58 +slot=""
  59 +systemimage_file="system.img"
  60 +vendor_file="vendor.img"
  61 +product_file="product.img"
  62 +partition_file="partition-table.img"
  63 +g_sizes=0
  64 +support_dtbo=0
  65 +flash_mcu=0
  66 +RED='\033[0;31m'
  67 +STD='\033[0;0m'
  68 +
  69 +image_directory=""
  70 +dtb_feature=""
  71 +uboot_feature=""
  72 +lpddr4_feature=""
  73 +support_dual_bootloader=0
  74 +
  75 +
  76 +while [ "$moreoptions" = 1 -a $# -gt 0 ]; do
  77 + case $1 in
  78 + -h) help; exit ;;
  79 + -s) cal_only=1 ;;
  80 + -f) soc_name=$2; shift;;
  81 + -c) card_size=$2; shift;;
  82 + -np) not_partition=1 ;;
  83 + -a) slot="_a" ;;
  84 + -b) slot="_b" ;;
  85 + -m) flash_mcu=1 ;;
  86 + -o) force_offset=$2; shift;;
  87 + -u) uboot_feature=-$2; shift;;
  88 + -e) lpddr4_feature=$2; shift;;
  89 + -d) dtb_feature=$2; shift;;
  90 + -D) image_directory=$2; shift;;
  91 + *) moreoptions=0; node=$1 ;;
  92 + esac
  93 + [ "$moreoptions" = 0 ] && [ $# -gt 1 ] && help && exit
  94 + [ "$moreoptions" = 1 ] && shift
  95 +done
  96 +
  97 +# check required applications are installed
  98 +command -v simg2img >/dev/null 2>&1 || { echo -e >&2 "${RED}Missing simg2img app. Please run: sudo apt-get install android-tools-fsutils${STD}" ; exit 1 ; }
  99 +command -v hdparm >/dev/null 2>&1 || { echo -e >&2 "${RED}Missing hdparm app. Please make sure it is installed. Exiting.${STD}" ; exit 1 ; }
  100 +command -v gdisk >/dev/null 2>&1 || { echo -e >&2 "${RED}Missing gdisk app. Please make sure it is installed. Exiting.${STD}" ; exit 1 ; }
  101 +
  102 +if [ ${card_size} -ne 0 ] && [ ${card_size} -ne 7 ] && [ ${card_size} -ne 14 ] && [ ${card_size} -ne 28 ]; then
  103 + help; exit 1;
  104 +fi
  105 +
  106 +# imx8qxp RevB0 chips, imx8qm RevB0 chips and imx8mn chips, bootloader offset is 32KB on SD card
  107 +if [ "${soc_name}" = "imx8qxp" -o "${soc_name}" = "imx8qm" -o "${soc_name}" = "imx8mn" ]; then
  108 + bootloader_offset=32
  109 +fi
  110 +
  111 +# imx8mq chips and imx8mm chips, bootloader offset is 33KB on SD card
  112 +if [[ "${soc_name}" = *"mx8mq"* ]]; then
  113 + bootloader_offset=33
  114 + if [[ "${soc_name}" = *"dp"* ]]; then
  115 + bootloader_file="u-boot-imx8mq-smarcimx8mq_${lpddr4_feature}${uboot_feature}-dp.imx"
  116 + else
  117 + bootloader_file="u-boot-imx8mq-smarcimx8mq_${lpddr4_feature}${uboot_feature}.imx"
  118 + fi
  119 +fi
  120 +
  121 +if [ "${force_offset}" != "" ]; then
  122 + bootloader_offset=${force_offset}
  123 +fi
  124 +
  125 +# exit if the block device file specified by ${node} doesn't exist
  126 +if [ ! -e ${node} ]; then
  127 + help
  128 + exit 1
  129 +fi
  130 +
  131 +# Process of the uboot_feature parameter
  132 +if [[ "${uboot_feature}" = *"trusty"* ]] || [[ "${uboot_feature}" = *"secure"* ]]; then
  133 + echo -e >&2 ${RED}Do not flash the image with Trusty OS to SD card${STD}
  134 + help
  135 + exit 1
  136 +fi
  137 +if [[ "${uboot_feature}" = *"dual"* ]]; then
  138 + support_dual_bootloader=1;
  139 +fi
  140 +
  141 +
  142 +# dual bootloader support will use different gpt. Android Automative only boot from eMMC, judgement here is complete
  143 +if [ ${support_dual_bootloader} -eq 1 ]; then
  144 + if [ ${card_size} -gt 0 ]; then
  145 + partition_file="partition-table-${card_size}GB-dual.img";
  146 + else
  147 + partition_file="partition-table-dual.img";
  148 + fi
  149 +else
  150 + if [ ${card_size} -gt 0 ]; then
  151 + partition_file="partition-table-${card_size}GB.img";
  152 + else
  153 + partition_file="partition-table.img";
  154 + fi
  155 +fi
  156 +
  157 +if [ ! -f "${image_directory}${partition_file}" ]; then
  158 + echo -e >&2 "${RED}File ${partition_file} not found. Please check. Exiting${STD}"
  159 + return 1
  160 +fi
  161 +
  162 +
  163 +# to be discussed
  164 +# echo "${soc_name} bootloader offset is: ${bootloader_offset}"
  165 +
  166 +# for specified directory, make sure there is a slash at the end
  167 +if [[ "${image_directory}" != "" ]]; then
  168 + image_directory="${image_directory%/}/";
  169 +fi
  170 +
  171 +
  172 +
  173 +# dump partitions
  174 +if [ "${cal_only}" -eq "1" ]; then
  175 + gdisk -l ${node} 2>/dev/null | grep -A 20 "Number "
  176 + exit 0
  177 +fi
  178 +
  179 +function get_partition_size
  180 +{
  181 + start_sector=`gdisk -l ${node} | grep -w $1 | awk '{print $2}'`
  182 + end_sector=`gdisk -l ${node} | grep -w $1 | awk '{print $3}'`
  183 + # 1 sector = 512 bytes. This will change unit from sector to MBytes.
  184 + let "g_sizes=($end_sector - $start_sector + 1) / 2048"
  185 +}
  186 +
  187 +function format_partition
  188 +{
  189 + num=`gdisk -l ${node} | grep -w $1 | awk '{print $1}'`
  190 + if [ ${num} -gt 0 ] 2>/dev/null; then
  191 + echo "format_partition: $1:${node}${num} ext4"
  192 + mkfs.ext4 -F ${node}${num} -L$1
  193 + fi
  194 +}
  195 +
  196 +function erase_partition
  197 +{
  198 + num=`gdisk -l ${node} | grep -w $1 | awk '{print $1}'`
  199 + if [ ${num} -gt 0 ] 2>/dev/null; then
  200 + get_partition_size $1
  201 + echo "erase_partition: $1 : ${node}${num} ${g_sizes}M"
  202 + dd if=/dev/zero of=${node}${num} bs=1048576 conv=fsync count=$g_sizes
  203 + fi
  204 +}
  205 +
  206 +function flash_partition
  207 +{
  208 + for num in `gdisk -l ${node} | grep -E -w "$1|$1_a|$1_b" | awk '{print $1}'`
  209 + do
  210 + if [ $? -eq 0 ]; then
  211 + if [ "$(echo ${1} | grep "bootloader_")" != "" ]; then
  212 + img_name=${uboot_proper_file}
  213 + elif [ "$(echo ${1} | grep "system")" != "" ]; then
  214 + img_name=${systemimage_file}
  215 + elif [ "$(echo ${1} | grep "vendor")" != "" ]; then
  216 + img_name=${vendor_file}
  217 + elif [ "$(echo ${1} | grep "product")" != "" ]; then
  218 + img_name=${product_file}
  219 + elif [ ${support_dtbo} -eq 1 ] && [ $(echo ${1} | grep "boot") != "" ] 2>/dev/null; then
  220 + img_name="boot.img"
  221 + elif [ "$(echo ${1} | grep -E "dtbo|vbmeta|recovery")" != "" -a "${dtb_feature}" != "" ]; then
  222 + img_name="${1%_*}-${soc_name}-${dtb_feature}.img"
  223 + else
  224 + img_name="${1%_*}-${soc_name}.img"
  225 + fi
  226 + # check whether the image files to be flashed exist or not
  227 + if [ ! -f "${image_directory}${img_name}" ]; then
  228 + echo -e >&2 "${RED}File ${img_name} not found. Please check. Exiting${STD}"
  229 + return 1
  230 + fi
  231 + echo "flash_partition: ${img_name} ---> ${node}${num}"
  232 +
  233 + if [ "$(echo ${1} | grep "system")" != "" ] || [ "$(echo ${1} | grep "vendor")" != "" ] || [ "$(echo ${1} | grep "product")" != "" ]; then
  234 + simg2img ${image_directory}${img_name} ${node}${num}
  235 + else
  236 + dd if=${image_directory}${img_name} of=${node}${num} bs=10M conv=fsync
  237 + fi
  238 + fi
  239 + done
  240 +}
  241 +
  242 +function format_android
  243 +{
  244 + echo "formating android images"
  245 + format_partition userdata
  246 + format_partition cache
  247 + erase_partition presistdata
  248 + erase_partition fbmisc
  249 + erase_partition misc
  250 +}
  251 +
  252 +function make_partition
  253 +{
  254 + echo "make gpt partition for android: ${partition_file}"
  255 + dd if=${image_directory}${partition_file} of=${node} bs=1k count=${vaild_gpt_size} conv=fsync
  256 +}
  257 +
  258 +function flash_android
  259 +{
  260 + boot_partition="boot"${slot}
  261 + recovery_partition="recovery"${slot}
  262 + system_partition="system"${slot}
  263 + vendor_partition="vendor"${slot}
  264 + product_partition="product"${slot}
  265 + vbmeta_partition="vbmeta"${slot}
  266 + dtbo_partition="dtbo"${slot}
  267 + gdisk -l ${node} 2>/dev/null | grep -q "dtbo" && support_dtbo=1
  268 +
  269 + if [ "${support_dtbo}" -eq "1" ] ; then
  270 + flash_partition ${dtbo_partition} || exit 1
  271 + fi
  272 + flash_partition ${boot_partition} || exit 1
  273 + flash_partition ${recovery_partition} || exit 1
  274 + flash_partition ${system_partition} || exit 1
  275 + flash_partition ${vendor_partition} || exit 1
  276 + flash_partition ${product_partition} || exit 1
  277 + flash_partition ${vbmeta_partition} || exit 1
  278 + echo "erase_partition: uboot : ${node}"
  279 + echo "flash_partition: ${bootloader_file} ---> ${node}"
  280 + first_partition_offset=`gdisk -l ${node} | grep ' 1 ' | awk '{print $2}'`
  281 + # the unit of first_partition_offset is sector size which is 512 Byte.
  282 + count_bootloader=`expr ${first_partition_offset} / 2 - ${bootloader_offset}`
  283 + echo "the bootloader partition size: ${count_bootloader}"
  284 + dd if=/dev/zero of=${node} bs=1k seek=${bootloader_offset} conv=fsync count=${count_bootloader}
  285 + dd if=${image_directory}${bootloader_file} of=${node} bs=1k seek=${bootloader_offset} conv=fsync
  286 + if [ "${flash_mcu}" -eq "1" ] ; then
  287 + if [ "${soc_name}" = "imx7ulp" ]; then
  288 + echo -e >&2 "${RED}Caution:${STD}"
  289 + echo -e >&2 " mcu image for imx7ulp_evk is in SPI flash on board, not in SD card, use uboot commands to flash it."
  290 + else
  291 + mcu_image=${soc_name#*-}"_mcu_demo.img"
  292 + echo "flash_partition: ${mcu_image} ---> ${node}"
  293 + dd if=${image_directory}${mcu_image} of=${node} bs=1k seek=${mcu_image_offset} conv=fsync
  294 + fi
  295 + fi
  296 +}
  297 +
  298 +if [ "${not_partition}" -ne "1" ] ; then
  299 + # invoke make_partition to write first 17KB in partition table image to sdcard start
  300 + make_partition || exit 1
  301 + # unmount partitions and then force to re-read the partition table of the specified device
  302 + sleep 3
  303 + for i in `cat /proc/mounts | grep "${node}" | awk '{print $2}'`; do umount $i; done
  304 + hdparm -z ${node}
  305 + # backup the GPT table to last LBA for sd card. execute "gdisk ${node}" with the input characters
  306 + # redirect standard OUTPUT to /dev/null to reduce some ouput
  307 + echo -e 'r\ne\nY\nw\nY\nY' | gdisk ${node} 1>/dev/null
  308 + format_android
  309 +fi
  310 +
  311 +flash_android || exit 1
  312 +
  313 +if [ "${slot}" = "_b" ]; then
  314 + echo -e >&2 "${RED}Caution:${STD}"
  315 + echo -e >&2 " This script can't generate metadata to directly boot from b slot, fastboot command may need to be used to boot from b slot."
  316 +fi
  317 +
  318 +echo
  319 +echo ">>>>>>>>>>>>>> Flashing successfully completed <<<<<<<<<<<<<<"
  320 +
  321 +exit 0
  322 +
  323 +# For MFGTool Notes:
  324 +# MFGTool use mksdcard-android.tar store this script
  325 +# if you want change it.
  326 +# do following:
  327 +# tar xf mksdcard-android.sh.tar
  328 +# vi mksdcard-android.sh
  329 +# [ edit want you want to change ]
  330 +# rm mksdcard-android.sh.tar; tar cf mksdcard-android.sh.tar mksdcard-android.sh