From 60ea7fa3df9a734448a3e0252e1dcbda801ad1ac Mon Sep 17 00:00:00 2001 From: Eric Lee Date: Wed, 10 Apr 2019 18:33:17 +0800 Subject: [PATCH] Embedian Android Oreo O8.1.0_r14 patch support for SMARC-iMX8M --- .gitignore | 3 + MODULE_LICENSE_APACHE2 | 0 NOTICE | 192 ++++++++++++ common/EmbPathConfig.mk | 8 + imx8/AndroidProducts.mk | 31 ++ imx8/etc/ota.conf | 3 + imx8/init.recovery.freescale.rc | 24 ++ imx8/smarc_mx8m.mk | 183 +++++++++++ imx8/smarc_mx8m_drm.mk | 58 ++++ imx8/vendorsetup.sh | 4 + scripts/install.sh | 160 ++++++++++ scripts/platform/bt/vnd_smarc_mx8m.txt | 9 + ...le-avoid-referring-PRODUCT_MANUFACTURER-i.patch | 36 +++ .../0001-fix-i2c-tools-build-with-Android.patch | 25 ++ .../0001-smarc-imx8m-add-preliminary-support.patch | 34 +++ ...001-embedian-added-support-sgtl5000-codec.patch | 111 +++++++ scripts/sh/smarc-mksdcard.sh | 336 +++++++++++++++++++++ smarc_mx8m/AndroidBoard.mk | 6 + smarc_mx8m/AndroidTee.mk | 13 + smarc_mx8m/AndroidUboot.mk | 20 ++ smarc_mx8m/BoardConfig.mk | 137 +++++++++ smarc_mx8m/app_whitelist.xml | 36 +++ smarc_mx8m/audio_effects.conf | 130 ++++++++ smarc_mx8m/audio_policy_configuration.xml | 87 ++++++ smarc_mx8m/audio_policy_configuration_drm.xml | 93 ++++++ smarc_mx8m/bluetooth/bdroid_buildcfg.h | 33 ++ smarc_mx8m/build_id.mk | 22 ++ smarc_mx8m/compatibility_matrix.xml | 62 ++++ smarc_mx8m/fstab-f2fs.freescale | 16 + smarc_mx8m/fstab.freescale | 11 + smarc_mx8m/init.freescale.emmc.rc | 7 + smarc_mx8m/init.freescale.sd.rc | 7 + smarc_mx8m/init.imx8mq.drm.rc | 25 ++ smarc_mx8m/init.imx8mq.rc | 62 ++++ smarc_mx8m/init.rc | 250 +++++++++++++++ smarc_mx8m/init.usb.rc | 118 ++++++++ smarc_mx8m/manifest.xml | 202 +++++++++++++ .../res/res/drawable-nodpi/default_wallpaper.png | Bin 0 -> 3549991 bytes .../drawable-sw600dp-nodpi/default_wallpaper.png | Bin 0 -> 3549991 bytes .../drawable-sw720dp-nodpi/default_wallpaper.png | Bin 0 -> 3549991 bytes .../frameworks/base/core/res/res/values/config.xml | 195 ++++++++++++ .../base/core/res/res/xml/power_profile.xml | 61 ++++ .../SettingsProvider/res/values/defaults.xml | 26 ++ .../base/packages/SystemUI/res/values/dimens.xml | 4 + .../packages/apps/Settings/res/values/bools.xml | 19 ++ .../packages/apps/Settings/res/values/config.xml | 21 ++ .../packages/apps/Settings/res/values/strings.xml | 22 ++ smarc_mx8m/required_hardware.xml | 29 ++ smarc_mx8m/seccomp/mediacodec-seccomp.policy | 1 + smarc_mx8m/seccomp/mediaextractor-seccomp.policy | 5 + smarc_mx8m/sepolicy/file_contexts | 32 ++ smarc_mx8m/sepolicy_drm/mediadrmserver.te | 3 + smarc_mx8m/sepolicy_drm/netd.te | 4 + smarc_mx8m/sepolicy_drm/shell.te | 4 + smarc_mx8m/sepolicy_drm/tee.te | 19 ++ smarc_mx8m/ueventd.freescale.rc | 37 +++ 56 files changed, 3036 insertions(+) create mode 100644 .gitignore create mode 100644 MODULE_LICENSE_APACHE2 create mode 100644 NOTICE create mode 100644 common/EmbPathConfig.mk create mode 100644 imx8/AndroidProducts.mk create mode 100644 imx8/etc/ota.conf create mode 100644 imx8/init.recovery.freescale.rc create mode 100644 imx8/smarc_mx8m.mk create mode 100644 imx8/smarc_mx8m_drm.mk create mode 100644 imx8/vendorsetup.sh create mode 100755 scripts/install.sh create mode 100644 scripts/platform/bt/vnd_smarc_mx8m.txt create mode 100644 scripts/platform/build/make.git/0001-core-Makefile-avoid-referring-PRODUCT_MANUFACTURER-i.patch create mode 100644 scripts/platform/vendor/embedian/i2c-tools.git/0001-fix-i2c-tools-build-with-Android.patch create mode 100644 scripts/platform/vendor/embedian/imx-mkimage.git/0001-smarc-imx8m-add-preliminary-support.patch create mode 100644 scripts/platform/vendor/nxp-opensource/imx.git/0001-embedian-added-support-sgtl5000-codec.patch create mode 100644 scripts/sh/smarc-mksdcard.sh create mode 100644 smarc_mx8m/AndroidBoard.mk create mode 100644 smarc_mx8m/AndroidTee.mk create mode 100644 smarc_mx8m/AndroidUboot.mk create mode 100644 smarc_mx8m/BoardConfig.mk create mode 100644 smarc_mx8m/app_whitelist.xml create mode 100644 smarc_mx8m/audio_effects.conf create mode 100644 smarc_mx8m/audio_policy_configuration.xml create mode 100644 smarc_mx8m/audio_policy_configuration_drm.xml create mode 100644 smarc_mx8m/bluetooth/bdroid_buildcfg.h create mode 100644 smarc_mx8m/build_id.mk create mode 100644 smarc_mx8m/compatibility_matrix.xml create mode 100644 smarc_mx8m/fstab-f2fs.freescale create mode 100644 smarc_mx8m/fstab.freescale create mode 100644 smarc_mx8m/init.freescale.emmc.rc create mode 100644 smarc_mx8m/init.freescale.sd.rc create mode 100644 smarc_mx8m/init.imx8mq.drm.rc create mode 100755 smarc_mx8m/init.imx8mq.rc create mode 100644 smarc_mx8m/init.rc create mode 100644 smarc_mx8m/init.usb.rc create mode 100644 smarc_mx8m/manifest.xml create mode 100644 smarc_mx8m/overlay/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.png create mode 100644 smarc_mx8m/overlay/frameworks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.png create mode 100644 smarc_mx8m/overlay/frameworks/base/core/res/res/drawable-sw720dp-nodpi/default_wallpaper.png create mode 100644 smarc_mx8m/overlay/frameworks/base/core/res/res/values/config.xml create mode 100644 smarc_mx8m/overlay/frameworks/base/core/res/res/xml/power_profile.xml create mode 100644 smarc_mx8m/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml create mode 100644 smarc_mx8m/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml create mode 100644 smarc_mx8m/overlay/packages/apps/Settings/res/values/bools.xml create mode 100644 smarc_mx8m/overlay/packages/apps/Settings/res/values/config.xml create mode 100644 smarc_mx8m/overlay/packages/apps/Settings/res/values/strings.xml create mode 100644 smarc_mx8m/required_hardware.xml create mode 100644 smarc_mx8m/seccomp/mediacodec-seccomp.policy create mode 100644 smarc_mx8m/seccomp/mediaextractor-seccomp.policy create mode 100644 smarc_mx8m/sepolicy/file_contexts create mode 100644 smarc_mx8m/sepolicy_drm/mediadrmserver.te create mode 100644 smarc_mx8m/sepolicy_drm/netd.te create mode 100644 smarc_mx8m/sepolicy_drm/shell.te create mode 100644 smarc_mx8m/sepolicy_drm/tee.te create mode 100644 smarc_mx8m/ueventd.freescale.rc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7ed387 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.* +!.gitignore +*.o diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2 new file mode 100644 index 0000000..e69de29 diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..1150272 --- /dev/null +++ b/NOTICE @@ -0,0 +1,192 @@ + + Copyright (C) 2008-2015 The Android Open Source Project + Copyright (C) 2011-2016 Freescale Semiconductor, Inc. + Copyright 2017-2018 NXP + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/common/EmbPathConfig.mk b/common/EmbPathConfig.mk new file mode 100644 index 0000000..c3657bd --- /dev/null +++ b/common/EmbPathConfig.mk @@ -0,0 +1,8 @@ +# config.mk +# +# Product-specific compile-time definitions. +# + +IMX_MKIMAGE_PATH := vendor/embedian +KERNEL_IMX_PATH := vendor/embedian +UBOOT_IMX_PATH := vendor/embedian diff --git a/imx8/AndroidProducts.mk b/imx8/AndroidProducts.mk new file mode 100644 index 0000000..5767235 --- /dev/null +++ b/imx8/AndroidProducts.mk @@ -0,0 +1,31 @@ +#Copyright (C) 2008 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# This file should set PRODUCT_MAKEFILES to a list of product makefiles +# to expose to the build system. LOCAL_DIR will already be set to +# the directory containing this file. +# +# This file may not rely on the value of any variable other than +# LOCAL_DIR; do not use any conditionals, and do not look up the +# value of any variable that isn't set in this file or in a file that +# it includes. +# + +# Copied from build/target/product/AndroidProducts.mk + +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/smarc_mx8m.mk \ + $(LOCAL_DIR)/smarc_mx8m_drm.mk \ diff --git a/imx8/etc/ota.conf b/imx8/etc/ota.conf new file mode 100644 index 0000000..1517286 --- /dev/null +++ b/imx8/etc/ota.conf @@ -0,0 +1,3 @@ +server=10.192.224.178 +port=10888 +ota_folder_suffix=oreo diff --git a/imx8/init.recovery.freescale.rc b/imx8/init.recovery.freescale.rc new file mode 100644 index 0000000..23e1b8b --- /dev/null +++ b/imx8/init.recovery.freescale.rc @@ -0,0 +1,24 @@ +import init.${ro.hardware}.${ro.boot.storage_type}.rc +on init + # disable cursor blink for fbcon, if no splash screen support + write /sys/class/graphics/fbcon/cursor_blink 0 + + mkdir /config 0500 root root + # mount the configfs on /config + mount configfs none /config mode=0755 + mkdir /config/usb_gadget/g1 + write /config/usb_gadget/g1/idProduct 0x4ee7 + write /config/usb_gadget/g1/idVendor 0x18d1 + mkdir /config/usb_gadget/g1/configs/b.1 + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" + mkdir /config/usb_gadget/g1/functions/ffs.adb + mkdir /config/usb_gadget/g1/strings/0x409 + write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} + write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} + write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} + +on property:sys.usb.ffs.ready=1 + rm /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 + write /config/usb_gadget/g1/UDC "ci_hdrc.0" diff --git a/imx8/smarc_mx8m.mk b/imx8/smarc_mx8m.mk new file mode 100644 index 0000000..5e45342 --- /dev/null +++ b/imx8/smarc_mx8m.mk @@ -0,0 +1,183 @@ +# This is a Embedian Android Reference Design platform based on SMARC-iMX8M Modules +# It will inherit from FSL core product which in turn inherit from Google generic + +-include device/fsl/common/imx_path/ImxPathConfig.mk +-include device/embedian/common/EmbPathConfig.mk +$(call inherit-product, device/fsl/imx8/imx8.mk) + +ifneq ($(wildcard device/embeian/smarc_mx8m/fstab_nand.freescale),) +$(shell touch device/embedian/smarc_mx8m/fstab_nand.freescale) +endif + +ifneq ($(wildcard device/embedian/smarc_mx8m/fstab.freescale),) +$(shell touch device/embedian/smarc_mx8m/fstab.freescale) +endif + +# Overrides +TARGET_KERNEL_DEFCONF := smarcimx8m_android_defconfig +PRODUCT_MANUFACTURER := embedian +PRODUCT_NAME := smarc_mx8m +PRODUCT_DEVICE := smarc_mx8m + +PRODUCT_FULL_TREBLE_OVERRIDE := true + +PRODUCT_COPY_FILES += \ + device/embedian/smarc_mx8m/init.rc:root/init.freescale.rc \ + device/embedian/smarc_mx8m/init.imx8mq.rc:root/init.freescale.imx8mq.rc \ + device/embedian/smarc_mx8m/init.usb.rc:root/init.freescale.usb.rc + +# Audio +USE_XML_AUDIO_POLICY_CONF := 1 +PRODUCT_COPY_FILES += \ + device/embedian/smarc_mx8m/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.conf \ + device/embedian/smarc_mx8m/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ + +# GPU files + +PRODUCT_COPY_FILES += device/embedian/smarc_mx8m/init.freescale.sd.rc:root/init.freescale.sd.rc +PRODUCT_COPY_FILES += device/embedian/smarc_mx8m/init.freescale.emmc.rc:root/init.freescale.emmc.rc + +DEVICE_PACKAGE_OVERLAYS := device/embedian/smarc_mx8m/overlay + +PRODUCT_CHARACTERISTICS := tablet + +PRODUCT_AAPT_CONFIG += xlarge large tvdpi hdpi xhdpi + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.audio.output.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.output.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \ + frameworks/native/data/etc/android.hardware.screen.portrait.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.portrait.xml \ + frameworks/native/data/etc/android.hardware.screen.landscape.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.screen.landscape.xml \ + frameworks/native/data/etc/android.software.app_widgets.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.app_widgets.xml \ + frameworks/native/data/etc/android.software.voice_recognizers.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.voice_recognizers.xml \ + frameworks/native/data/etc/android.software.backup.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.backup.xml \ + frameworks/native/data/etc/android.software.print.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.print.xml \ + frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml \ + frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml \ + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \ + frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \ + frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ + frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \ + frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version-1_0_3.xml \ + frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level-0.xml \ + frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \ + device/embedian/smarc_mx8m/required_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/required_hardware.xml \ + +PRODUCT_COPY_FILES += \ + $(FSL_PROPRIETARY_PATH)/fsl-proprietary/gpu-viv/lib64/egl/egl.cfg:$(TARGET_COPY_OUT_VENDOR)/lib64/egl/egl.cfg \ + $(FSL_PROPRIETARY_PATH)/fsl-proprietary/gpu-viv/lib/egl/egl.cfg:$(TARGET_COPY_OUT_VENDOR)/lib/egl/egl.cfg + +# HWC2 HAL +PRODUCT_PACKAGES += \ + android.hardware.graphics.composer@2.1-impl \ + android.hardware.graphics.composer@2.1-service + +# Gralloc HAL +PRODUCT_PACKAGES += \ + android.hardware.graphics.mapper@2.0-impl \ + android.hardware.graphics.allocator@2.0-impl \ + android.hardware.graphics.allocator@2.0-service + +# RenderScript HAL +PRODUCT_PACKAGES += \ + android.hardware.renderscript@1.0-impl + +PRODUCT_PACKAGES += \ + libEGL_VIVANTE \ + libGLESv1_CM_VIVANTE \ + libGLESv2_VIVANTE \ + gralloc_viv.imx8 \ + libGAL \ + libGLSLC \ + libVSC \ + libg2d \ + libgpuhelper \ + libSPIRV_viv \ + libvulkan_VIVANTE \ + vulkan.imx8 \ + gatekeeper.imx8 + +PRODUCT_PACKAGES += \ + Launcher3 + +PRODUCT_PACKAGES += \ + android.hardware.audio@2.0-impl \ + android.hardware.audio@2.0-service \ + android.hardware.audio.effect@2.0-impl \ + android.hardware.power@1.0-impl \ + android.hardware.power@1.0-service \ + android.hardware.light@2.0-impl \ + android.hardware.light@2.0-service + +# imx8 sensor HAL libs. +#PRODUCT_PACKAGES += \ +# android.hardware.sensors@1.0-impl \ +# android.hardware.sensors@1.0-service \ +# sensors.imx8 + +# Usb HAL +PRODUCT_PACKAGES += \ + android.hardware.usb@1.1-service.imx + +# Bluetooth HAL +PRODUCT_PACKAGES += \ + android.hardware.bluetooth@1.0-impl \ + android.hardware.bluetooth@1.0-service + +# WiFi HAL +PRODUCT_PACKAGES += \ + android.hardware.wifi@1.0-service \ + wifilogd \ + wificond + +# Qcom WiFi Firmware +PRODUCT_COPY_FILES += \ + external/qca-linux/1CQ/nvm_tlv_3.2.bin:vendor/firmware/nvm_tlv_3.2.bin \ + external/qca-linux/1CQ/board.bin:vendor/firmware/ath10k/QCA6174/hw3.0/board.bin \ + external/linux-firmware/qca/rampatch_00130302.bin:vendor/firmware/rampatch_tlv_3.2.tlv \ + external/linux-firmware/ath10k/QCA6174/hw3.0/board.bin:vendor/firmware/ath10k/QCA6174/hw3.0/board.bin \ + external/linux-firmware/ath10k/QCA6174/hw3.0/board-2.bin:vendor/firmware/ath10k/QCA6174/hw3.0/board-2.bin \ + external/linux-firmware/ath10k/QCA6174/hw3.0/firmware-4.bin:vendor/firmware/ath10k/QCA6174/hw3.0/firmware-4.bin + +# Keymaster HAL +PRODUCT_PACKAGES += \ + android.hardware.keymaster@3.0-impl \ + android.hardware.keymaster@3.0-service + +# DRM HAL +TARGET_ENABLE_MEDIADRM_64 := true +PRODUCT_PACKAGES += \ + android.hardware.drm@1.0-impl \ + android.hardware.drm@1.0-service + +# new gatekeeper HAL +PRODUCT_PACKAGES += \ + android.hardware.gatekeeper@1.0-impl \ + android.hardware.gatekeeper@1.0-service + +ifneq ($(BUILD_TARGET_FS),ubifs) +PRODUCT_PROPERTY_OVERRIDES += \ + ro.internel.storage_size=/sys/block/mmcblk0/size \ + ro.frp.pst=/dev/block/by-name/presistdata +endif + +# ro.product.first_api_level indicates the first api level the device has commercially launched on. +PRODUCT_PROPERTY_OVERRIDES += \ + ro.product.first_api_level=26 + +PRODUCT_PACKAGES += \ + libg1 \ + libhantro \ + libcodec + diff --git a/imx8/smarc_mx8m_drm.mk b/imx8/smarc_mx8m_drm.mk new file mode 100644 index 0000000..936c944 --- /dev/null +++ b/imx8/smarc_mx8m_drm.mk @@ -0,0 +1,58 @@ +# This is a FSL Android Reference Design platform based on i.MX8MQ board +# It will inherit from FSL core product which in turn inherit from Google generic + +PRODUCT_IMX_DRM := true + +# copy drm specific files before inherit smarc_mx8m.mk, otherwise copy is ignored +PRODUCT_COPY_FILES += \ + device/embedian/smarc_mx8m/audio_policy_configuration_drm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + device/embedian/smarc_mx8m/init.imx8mq.rc:root/init.freescale.imx8mq.main.rc \ + device/embedian/smarc_mx8m/init.imx8mq.drm.rc:root/init.freescale.imx8mq.rc \ + + +$(call inherit-product, $(TOPDIR)device/fsl/imx8/optee-packages.mk) +$(call inherit-product, $(TOPDIR)device/embedian/imx8/smarc_mx8m.mk) + +# Overrides +TARGET_KERNEL_DEFCONF := smarcimx8m_android_drm_defconfig +PRODUCT_NAME := smarc_mx8m_drm +PRODUCT_MANUFACTURER := embedian +PRODUCT_DEVICE := smarc_mx8m + +CFG_SECURE_DATA_PATH ?= y +CFG_TEE_SDP_MEM_BASE := 0xcc000000 +CFG_TEE_SDP_MEM_SIZE := 0x02000000 +DECRYPTED_BUFFER_START := $(CFG_TEE_SDP_MEM_BASE) +DECRYPTED_BUFFER_LEN := $(CFG_TEE_SDP_MEM_SIZE) +DECODED_BUFFER_START := 0xCE000000 +DECODED_BUFFER_LEN := 0x30000000 + +# Exoplayer +PRODUCT_PACKAGES += \ + exoplayer \ + +# Playready +PRODUCT_COPY_FILES += \ + vendor/nxp/drm_artifacts/playready/Samples/devcert.dat:$(TARGET_COPY_OUT_VENDOR)/playready/devcert.dat \ + vendor/nxp/drm_artifacts/playready/Samples/priv.dat:$(TARGET_COPY_OUT_VENDOR)/playready/priv.dat \ + vendor/nxp/drm_artifacts/playready/ta/82dbae9c-9ce0-47e0-a1cb4048cfdb84aa.ta:$(TARGET_OUT)/system/lib/optee_armtz/82dbae9c-9ce0-47e0-a1cb4048cfdb84aa.ta \ + vendor/nxp/drm_artifacts/playready/bgroupcert.dat:$(TARGET_COPY_OUT_VENDOR)/playready/bgroupcert.dat \ + vendor/nxp/drm_artifacts/playready/zgpriv_protected.dat:$(TARGET_COPY_OUT_VENDOR)/playready/zgpriv_protected.dat \ + vendor/nxp/drm_artifacts/playready/optee_playready_test:$(TARGET_OUT)/system/bin/optee_playready_test + +ifneq ($(CFG_BUILD_DRM_FROM_SOURCES),y) +PRODUCT_COPY_FILES += \ + vendor/nxp/drm_artifacts/playready/libdrmplayreadyplugin.so:$(TARGET_OUT)/vendor/lib64/mediadrm/libdrmplayreadyplugin.so +endif + +ifneq ($(CFG_BUILD_DRM_FROM_SOURCES),y) +# Widevine +PRODUCT_COPY_FILES += \ + vendor/nxp/drm_artifacts/widevine/lib/liboemcrypto.so:$(TARGET_COPY_OUT_VENDOR)/lib/liboemcrypto.so \ + vendor/nxp/drm_artifacts/widevine/lib/libwvdrmengine.so:$(TARGET_COPY_OUT_VENDOR)/lib/mediadrm/libwvdrmengine.so \ + vendor/nxp/drm_artifacts/widevine/lib/libvtswidevine.so:$(TARGET_COPY_OUT_VENDOR)/lib/drm-vts-test-libs/libvtswidevine.so \ + vendor/nxp/drm_artifacts/widevine/lib64/liboemcrypto.so:$(TARGET_COPY_OUT_VENDOR)/lib64/liboemcrypto.so \ + vendor/nxp/drm_artifacts/widevine/lib64/libwvdrmengine.so:$(TARGET_COPY_OUT_VENDOR)/lib64/mediadrm/libwvdrmengine.so \ + vendor/nxp/drm_artifacts/widevine/lib64/libvtswidevine.so:$(TARGET_COPY_OUT_VENDOR)/lib64/drm-vts-test-libs/libvtswidevine.so \ + vendor/nxp/drm_artifacts/widevine/ta/706f6574-7765-6469-77656e6942656665.ta:$(TARGET_OUT)/system/lib/optee_armtz/706f6574-7765-6469-77656e6942656665.ta +endif diff --git a/imx8/vendorsetup.sh b/imx8/vendorsetup.sh new file mode 100644 index 0000000..6c359d5 --- /dev/null +++ b/imx8/vendorsetup.sh @@ -0,0 +1,4 @@ +add_lunch_combo smarc_mx8m-eng +add_lunch_combo smarc_mx8m-userdebug +add_lunch_combo smarc_mx8m_drm-eng +add_lunch_combo smarc_mx8m_drm-userdebug diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..84f6f77 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,160 @@ +#!/bin/bash +# +# install +# +# This script must be run from the Android main directory. +# embedian/install must be at ~/o810_130_8m_build +# +# Embedian SMARC-iMX8M patches for Android 8.1.0 1.3.0 8M + +set -e +#set -x + +SCRIPT_NAME=${0##*/} +readonly SCRIPT_VERSION="0.1" + +#### Exports Variables #### +#### global variables #### +readonly ABSOLUTE_FILENAME=$(readlink -e "$0") +readonly ABSOLUTE_DIRECTORY=$(dirname ${ABSOLUTE_FILENAME}) +readonly SCRIPT_POINT=${ABSOLUTE_DIRECTORY} +readonly SCRIPT_START_DATE=$(date +%Y%m%d) +readonly ANDROID_DIR="${SCRIPT_POINT}/../../.." + +readonly BASE_BRANCH_NAME="base_o8.1.0_1.3.0_8m" + +## git variables get from base script! +readonly _EXTPARAM_BRANCH="o8.1.0_1.3.0_8m-ga-smarc01" + +## dirs ## +readonly EMBEDIAN_PATCHS_DIR="${SCRIPT_POINT}/platform" +readonly EMBEDIAN_SH_DIR="${SCRIPT_POINT}/sh" +VENDOR_BASE_DIR=${ANDROID_DIR}/vendor/embedian + + +# print error message +# p1 - printing string +function pr_error() { + echo ${2} "E: $1" +} + +# print warning message +# p1 - printing string +function pr_warning() { + echo ${2} "W: $1" +} + +# print info message +# p1 - printing string +function pr_info() { + echo ${2} "I: $1" +} + +# print debug message +# p1 - printing string +function pr_debug() { + echo ${2} "D: $1" +} + +# test existing brang in git repo +# p1 - git folder +# p2 - branch name +function is_branch_exist() +{ + local D="${1}" + local B="${2}" + local B_found + local HERE + + if [ \( ! -d "${D}" \) -o \( -z "${B}" \) ]; then + echo false + return + fi + + HERE=${PWD} + cd "${D}" > /dev/null + + # Check branch + git branch 2>&1 > /dev/null + if [ ${?} -ne 0 ]; then + echo false + cd ${HERE} > /dev/null + return + fi + B_found=$(git branch | grep -w "${B}") + if [ -z "${B_found}" ]; then + echo false + else + echo true + fi + + cd ${HERE} > /dev/null + return +} + +############### main code ############## +pr_info "Script version ${SCRIPT_VERSION} (g:20160527)" + +# disable NXP kernel Android.mk +cd ${ANDROID_DIR} > /dev/null +mv vendor/nxp-opensource/kernel_imx/drivers/staging/greybus/tools/Android.mk vendor/nxp-opensource/kernel_imx/drivers/staging/greybus/tools/Android.mk__ + +# make a copy of NXP imx-mkimage +cp -r vendor/nxp-opensource/imx-mkimage ${VENDOR_BASE_DIR} + +pr_info "###############################" +pr_info "# Misc. external repositories #" +pr_info "###############################" + +pr_info "clone ${VENDOR_BASE_DIR}/can-utils" +git clone https://github.com/linux-can/can-utils.git ${VENDOR_BASE_DIR}/can-utils +cd ${VENDOR_BASE_DIR}/can-utils > /dev/null +git checkout 791890542ac1ce99131f36435e72af5635afc2fa -b ${BASE_BRANCH_NAME} + +pr_info "clone ${VENDOR_BASE_DIR}/i2c-tools" +git clone https://github.com/Hashcode/i2c-tools.git ${VENDOR_BASE_DIR}/i2c-tools +cd ${VENDOR_BASE_DIR}/i2c-tools > /dev/null +git checkout 4aea42526b73eed33f811ce4b894df5d545e4d57 -b ${BASE_BRANCH_NAME} + +pr_info "###########################" +pr_info "# Apply framework patches #" +pr_info "###########################" +cd ${EMBEDIAN_PATCHS_DIR} > /dev/null +git_array=$(find * -type d | grep '.git') +cd - > /dev/null + +for _ddd in ${git_array} +do + _git_p=$(echo ${_ddd} | sed 's/.git//g') + cd ${ANDROID_DIR}/${_git_p}/ > /dev/null + + pr_info "Apply patches for this git: \"${_git_p}/\"" + + git checkout -b ${_EXTPARAM_BRANCH} || { + pr_warning "Branch ${_EXTPARAM_BRANCH} is present!" + }; + + git am ${EMBEDIAN_PATCHS_DIR}/${_ddd}/* + + cd - > /dev/null +done + +pr_info "#######################" +pr_info "# Copy bluetooth vendor file #" +pr_info "#######################" +cp ${EMBEDIAN_PATCHS_DIR}/bt/vnd_smarc_mx8m.txt ${ANDROID_DIR}/hardware/qcom/bt/msm8992/libbt-vendor/include/ + +pr_info "#####################" +pr_info "# Done #" +pr_info "#####################" + +pr_info "#######################" +pr_info "# Copy shell utilites #" +pr_info "#######################" +cp -r ${EMBEDIAN_SH_DIR}/* ${ANDROID_DIR}/ + +pr_info "#####################" +pr_info "# Done #" +pr_info "#####################" + +exit 0 diff --git a/scripts/platform/bt/vnd_smarc_mx8m.txt b/scripts/platform/bt/vnd_smarc_mx8m.txt new file mode 100644 index 0000000..c87d0f0 --- /dev/null +++ b/scripts/platform/bt/vnd_smarc_mx8m.txt @@ -0,0 +1,9 @@ +BT_HS_UART_DEVICE = "/dev/ttymxc2" +FW_PATCHFILE_LOCATION = "/vendor/firmware/" +BT_WAKE_VIA_USERIAL_IOCTL = TRUE +LPM_IDLE_TIMEOUT_MULTIPLE = 5 +SCO_USE_I2S_INTERFACE = TRUE +BTVND_DBG = FALSE +BTHW_DBG = TRUE +VNDUSERIAL_DBG = FALSE +UPIO_DBG = FALSE diff --git a/scripts/platform/build/make.git/0001-core-Makefile-avoid-referring-PRODUCT_MANUFACTURER-i.patch b/scripts/platform/build/make.git/0001-core-Makefile-avoid-referring-PRODUCT_MANUFACTURER-i.patch new file mode 100644 index 0000000..0ac2819 --- /dev/null +++ b/scripts/platform/build/make.git/0001-core-Makefile-avoid-referring-PRODUCT_MANUFACTURER-i.patch @@ -0,0 +1,36 @@ +From d69372943135c2fc4d8394956a58533e36ac59c3 Mon Sep 17 00:00:00 2001 +From: Eric Lee +Date: Mon, 7 May 2018 11:21:39 +0200 +Subject: [PATCH] avoid referring PRODUCT_MANUFACTURER in emmc/sd init + +--- + core/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/core/Makefile b/core/Makefile +index 16654dd..d21ddd2 100644 +--- a/core/Makefile ++++ b/core/Makefile +@@ -1236,8 +1236,8 @@ define build-recoveryimage-target + $(hide) rm -f $(TARGET_RECOVERY_ROOT_OUT)/init*.rc + $(hide) cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/ + $(hide) cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. +- $(hide) cp $(TARGET_ROOT_OUT)/init.$(PRODUCT_MANUFACTURER).sd.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. +- $(hide) cp $(TARGET_ROOT_OUT)/init.$(PRODUCT_MANUFACTURER).emmc.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. ++ $(hide) cp $(TARGET_ROOT_OUT)/init.*.sd.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. ++ $(hide) cp $(TARGET_ROOT_OUT)/init.*.emmc.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist. + $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res + $(hide) rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/* + $(hide) cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res +@@ -1423,7 +1423,7 @@ $(TARGET_KERNEL_CONFIGURE): $(KERNEL_IMX_PATH)/kernel_imx/arch/$(TARGET_ARCH)/co + install -D $(KERNEL_CONFIGURE) $(TARGET_KERNEL_CONFIGURE) + + ifeq ($(TARGET_ARCH),arm64) +-DTS_ADDITIONAL_PATH := freescale ++DTS_ADDITIONAL_PATH := $(PRODUCT_MANUFACTURER) + else + DTS_ADDITIONAL_PATH := + endif +-- +2.7.4 + diff --git a/scripts/platform/vendor/embedian/i2c-tools.git/0001-fix-i2c-tools-build-with-Android.patch b/scripts/platform/vendor/embedian/i2c-tools.git/0001-fix-i2c-tools-build-with-Android.patch new file mode 100644 index 0000000..ff52016 --- /dev/null +++ b/scripts/platform/vendor/embedian/i2c-tools.git/0001-fix-i2c-tools-build-with-Android.patch @@ -0,0 +1,25 @@ +From 55898b2da24a1f81d0f2e443309e63b565b1c873 Mon Sep 17 00:00:00 2001 +From: Eric Lee +Date: Mon, 22 Apr 2017 14:04:28 +0200 +Subject: [PATCH] fix i2c-tools build with Android + +--- + Android.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Android.mk b/Android.mk +index 090f6c0..bb44211 100644 +--- a/Android.mk ++++ b/Android.mk +@@ -4,7 +4,7 @@ include $(CLEAR_VARS) + + LOCAL_MODULE_TAGS := eng + LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/include +-LOCAL_SRC_FILES := tools/i2cbusses.c tools/util.c ++LOCAL_SRC_FILES := tools/i2cbusses.c tools/util.c lib/smbus.c + LOCAL_MODULE := i2c-tools + include $(BUILD_STATIC_LIBRARY) + +-- +2.7.4 + diff --git a/scripts/platform/vendor/embedian/imx-mkimage.git/0001-smarc-imx8m-add-preliminary-support.patch b/scripts/platform/vendor/embedian/imx-mkimage.git/0001-smarc-imx8m-add-preliminary-support.patch new file mode 100644 index 0000000..bb67590 --- /dev/null +++ b/scripts/platform/vendor/embedian/imx-mkimage.git/0001-smarc-imx8m-add-preliminary-support.patch @@ -0,0 +1,34 @@ +From dc60556b7da19349712efe0ba570dbf7c511a537 Mon Sep 17 00:00:00 2001 +From: Eric Lee +Date: Mon, 7 May 2018 11:38:16 +0200 +Subject: [PATCH] smarc-imx8m: add preliminary support + +--- + iMX8M/soc.mak | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak +index e3003de..5c6efec 100644 +--- a/iMX8M/soc.mak ++++ b/iMX8M/soc.mak +@@ -58,7 +58,7 @@ u-boot-atf-tee.bin: u-boot.bin bl31.bin tee.bin + clean: + @rm -f $(MKIMG) $(DCD_CFG) .imx8mq_dcd.cfg.cfgtmp.d 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 $(OUTIMG) + +-dtbs = fsl-imx8mq-evk.dtb ++dtbs = fsl-smarcimx8mq.dtb + u-boot.itb: $(dtbs) + ./mkimage_fit_atf.sh $(dtbs) > u-boot.its + ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot.itb +@@ -107,7 +107,7 @@ nightly : + @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/bl31-imx8mq.bin -O bl31.bin + @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/u-boot-spl.bin-imx8mqevk-sd -O u-boot-spl.bin + @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/u-boot-nodtb.bin -O u-boot-nodtb.bin +- @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/fsl-imx8mq-evk.dtb -O fsl-imx8mq-evk.dtb ++ @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/fsl-smarcimx8mq.dtb -O fsl-smarcimx8mq.dtb + @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/signed_hdmi_imx8m.bin -O signed_hdmi_imx8m.bin + @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/mkimage_uboot -O mkimage_uboot + +-- +2.7.4 + diff --git a/scripts/platform/vendor/nxp-opensource/imx.git/0001-embedian-added-support-sgtl5000-codec.patch b/scripts/platform/vendor/nxp-opensource/imx.git/0001-embedian-added-support-sgtl5000-codec.patch new file mode 100644 index 0000000..8a1f245 --- /dev/null +++ b/scripts/platform/vendor/nxp-opensource/imx.git/0001-embedian-added-support-sgtl5000-codec.patch @@ -0,0 +1,111 @@ +From 0e4082bc6a6a8b30d02cae4f5102f9a2855b7f0a Mon Sep 17 00:00:00 2001 +From: Eric Lee +Date: Tue, 26 Mar 2019 18:01:31 +0800 +Subject: [PATCH] Add SGTL5000 Android Config + +--- + alsa/config_sgtl5000.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ + alsa/tinyalsa_hal.c | 3 +++ + 2 files changed, 66 insertions(+) + create mode 100644 alsa/config_sgtl5000.h + +diff --git a/alsa/config_sgtl5000.h b/alsa/config_sgtl5000.h +new file mode 100644 +index 0000000..799a005 +--- /dev/null ++++ b/alsa/config_sgtl5000.h +@@ -0,0 +1,63 @@ ++/* ++ * Copyright (C) 2011 The Android Open Source Project ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++/* Copyright (C) 2012 Freescale Semiconductor, Inc. */ ++ ++#ifndef ANDROID_INCLUDE_IMX_CONFIG_SGTL5000_H ++#define ANDROID_INCLUDE_IMX_CONFIG_SGTL5000_H ++ ++#include "audio_hardware.h" ++ ++/* ALSA cards for IMX, these must be defined according different board / kernel config*/ ++static struct audio_card sgtl5000_card = { ++ .name = "sgtl5000-audio", ++ .driver_name = "sgtl5000-audio", ++ .supported_out_devices = (AUDIO_DEVICE_OUT_EARPIECE | ++ AUDIO_DEVICE_OUT_SPEAKER | ++ AUDIO_DEVICE_OUT_WIRED_HEADSET | ++ AUDIO_DEVICE_OUT_WIRED_HEADPHONE | ++ AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | ++ AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | ++ AUDIO_DEVICE_OUT_ALL_SCO | ++ AUDIO_DEVICE_OUT_DEFAULT), ++ .supported_in_devices = ( ++ AUDIO_DEVICE_IN_COMMUNICATION | ++ AUDIO_DEVICE_IN_AMBIENT | ++ AUDIO_DEVICE_IN_BUILTIN_MIC | ++ AUDIO_DEVICE_IN_WIRED_HEADSET | ++ AUDIO_DEVICE_IN_BACK_MIC | ++ AUDIO_DEVICE_IN_ALL_SCO | ++ AUDIO_DEVICE_IN_DEFAULT), ++ .defaults = NULL, ++ .bt_output = NULL, ++ .speaker_output = NULL, ++ .hs_output = NULL, ++ .earpiece_output = NULL, ++ .vx_hs_mic_input = NULL, ++ .mm_main_mic_input = NULL, ++ .vx_main_mic_input = NULL, ++ .mm_hs_mic_input = NULL, ++ .vx_bt_mic_input = NULL, ++ .mm_bt_mic_input = NULL, ++ .card = 0, ++ .out_rate = 0, ++ .out_channels = 0, ++ .out_format = 0, ++ .in_rate = 0, ++ .in_channels = 0, ++ .in_format = 0, ++}; ++ ++#endif /* ANDROID_INCLUDE_IMX_CONFIG_HDMI_H */ +diff --git a/alsa/tinyalsa_hal.c b/alsa/tinyalsa_hal.c +index 5db4f72..b59470a 100644 +--- a/alsa/tinyalsa_hal.c ++++ b/alsa/tinyalsa_hal.c +@@ -53,6 +53,7 @@ + #include "config_cdnhdmi.h" + #include "config_ak4458.h" + #include "config_ak5558.h" ++#include "config_sgtl5000.h" + #include "control.h" + #include "pcm_ext.h" + #include "config_xtor.h" +@@ -105,6 +106,7 @@ + #define PRODUCT_DEVICE_IMX "imx" + #define PRODUCT_DEVICE_AUTO "sabreauto" + #define SUPPORT_CARD_NUM 14 ++#define SUPPORT_CARD_NUM 15 + + /*"null_card" must be in the end of this array*/ + struct audio_card *audio_card_list[SUPPORT_CARD_NUM] = { +@@ -116,6 +118,7 @@ struct audio_card *audio_card_list[SUPPORT_CARD_NUM] = { + &cs42888_card, + &wm8960_card, + &sii902x_card, ++ &sgtl5000_card, + &rpmsg_card, + &wm8524_card, + &cdnhdmi_card, +-- +2.7.4 + diff --git a/scripts/sh/smarc-mksdcard.sh b/scripts/sh/smarc-mksdcard.sh new file mode 100644 index 0000000..398d70a --- /dev/null +++ b/scripts/sh/smarc-mksdcard.sh @@ -0,0 +1,336 @@ +#!/bin/bash +# Meant to be called by install_android.sh +set -e + +blue_underlined_bold_echo() +{ + echo -e "\e[34m\e[4m\e[1m$@\e[0m" +} + +blue_bold_echo() +{ + echo -e "\e[34m\e[1m$@\e[0m" +} + +red_bold_echo() +{ + echo -e "\e[31m\e[1m$@\e[0m" +} + +# Partition sizes in MiB +BOOTLOAD_RESERVE=8 +BOOT_ROM_SIZE=32 +SYSTEM_ROM_SIZE=1536 +MISC_SIZE=4 +METADATA_SIZE=2 +PRESISTDATA_SIZE=1 +VENDOR_ROM_SIZE=112 +FBMISC_SIZE=1 +VBMETA_SIZE=1 + +help() { + + bn=`basename $0` + echo " usage $bn