i.MX Processors Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX Processors Knowledge Base

Discussions

Sort by:
This patch made the display no interrupt from uboot to kernel to Android. The IPU and related hardware display interface will only be initialized once in Uboot, the kernel code will skip the IPU initialization.   1. Description     1) Support HDMI, LVDS and LCD output in UBoot.     2) Support UBoot logo keep from uboot to kernel to Android.     3) For HDMI, both 720P and 1080P mode were supported.     4) For LVDS, 1024x768 and 1080P dual channel panels were supported.     5) The logo file is a 32 bpp bmp file. 2. File List -- kernel_imx\0001-Keep-uboot-logo-for-Android-boot-supports-HDMI-LCD-a.patch -- kernel_imx\0002-Bug-fix-for-uboot-logo-keep-patch.patch    Kernel patch to support the logo keep feature. -- uboot-imx\0001-Enable-uboot-logo-for-HDMI-LCD-and-LVDS.patch    Uboot patch to support the logo display. -- logo.bmp    Example 32bpp logo file. -- readme.txt    this file, please refer to it before use the patches 3. Requirement - iMX6 SabreSD board. - Android JB4.2.2_1.1.0-GA UBoot and kernel. 4. How to use -- Copy the two patch files to Android kernel_imx and uboot-imx folder and apply them.     $ cd ~/myandroid/kernel_imx/     $ git apply ./0001-Keep-uboot-logo-for-Android-boot-supports-HDMI-LCD-a.patch     $ cd ~/myandroid/bootable/bootloader/uboot-imx/     $ git apply ./0001-Enable-uboot-logo-for-HDMI-LCD-and-LVDS.patch     $ git apply ./0002-Bug-fix-for-uboot-logo-keep-patch.patch   -- Build the new uboot image:     $ cd ~/myandroid/bootable/bootloader/uboot-imx     $ export CROSS_COMPILE=~/myandroid/prebuilt/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-     $ export ARCH=arm     $ make mx6q_sabresd_android_config     $ make   -- Before build new UBoot image, the display type can be selected from file uboot-imx\include\configs\mx6q_sabresd.h // Select one of the output mode #define IPU_OUTPUT_MODE_HDMI //#define IPU_OUTPUT_MODE_LVDS //#define IPU_OUTPUT_MODE_LCD   -- Build the new kernel image:     $ cd ~/myandroid/kernel_imx     $ export CROSS_COMPILE=~/myandroid/prebuilt/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-     $ export ARCH=arm     $ make imx6_android_defconfig     $ make uImage   -- Before "make uImage", make menuconfig can be used to select the display type.                 System Type  --->                    Freescale MXC Implementations  --->                       MX6 clk setting for smooth UI transtion from bootloader to kernel  --->                           Select Display Interface                              ( )  Smooth UI transtion on LCD, IPU1, DI0                              ( )  Smooth UI transtion on LVDS, IPU1, DI1                              (X)  Smooth UI transtion on HDMI, IPU2, DI0   -- Uboot parameters for video mode    1080P HDMI:       "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 fb0base=0x27b00000 fbmem=28M hdmi_audio_clk=148500000"      720P HDMI:       "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 fb0base=0x27b00000 fbmem=28M hdmi_audio_clk=74250000"      1024x768 LVDS:       "video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666,bpp=32 fb0base=0x27b00000 fbmem=28M"      800x480 LCD:       "video=mxcfb0:dev=lcd,CLAA-WVGA,if=RGB565,bpp=32 fb0base=0x27b00000 fbmem=28M" -- dd the logo.bmp to SD card address 0x100000 and skip the 54 bytes bmp file header.    sudo dd if=logo.bmp of=/dev/sdc bs=1 seek=1048576 skip=54 5. Note     1) The logo.bmp file should be 32bpp or 16bpp, and it should be synced with video mode parameters "bpp=xx",          and uboot config file mx6q_sabresd.h (#define DISPLAY_BPP  xx).       2) The IPU number and DI number are hard coded in kernel file "board-mx6q_sabresd.c". static struct fsl_mxc_hdmi_core_platform_data hdmi_core_data = {   .ipu_id = 1,   .disp_id = 0, }; static struct fsl_mxc_lcd_platform_data lcdif_data = {   .ipu_id = 0,   .disp_id = 0,   .default_ifmt = IPU_PIX_FMT_RGB565, }; static struct fsl_mxc_ldb_platform_data ldb_data = {   .ipu_id = 0,   .disp_id = 1,   .ext_ref = 1,   .mode = LDB_SEP1,   .sec_ipu_id = 0,   .sec_disp_id = 0, };       3) The IPU number and DI number are defined by Macro in Uboot file "include\configs\mx6q_sabresd.h" #define IPU_NUM   2  // 1 for IPU1, 2 for IPU2. #define DI_NUM   0  // 0 for DI0, 1 for DI1.       4) The display type used in uboot and kernel must be same, same type, same IPU number, same DI port and        same resolution.     [2015-06-29 Update]: JB4.2.2_1.1.0_uboot_logo_keep_patch_2015-06-29.zip Fix some LVDS issues for iMX6DL. Also given an example for LVDS0 with DI0. New Uboot patches:      0002-Updated-lvds-clock-source-to-pll2_pfd0.-Same-as-kern.patch      0003-Add-support-for-iMX6DL.patch   New kernel patches      0003-Skip-lvds-re-initialization-for-logo-keep.patch      0004-Add-examlpe-for-LVDS0-logo-keep.patch     [2015-08-07 Update]: JB4.2.2_1.1.0_uboot_logo_keep_patch_2015-08-07.zip Added the new Uboot patch 0004-Correct-the-sequence-to-set-LDB-clock.patch It can correct the LVDS clock set sequence whch is a known issue that caused no LVDS display sometimes.   [2015-09-18 Update]: JB4.3_1.1.1_uboot_logo_keep_patch_2015-09-18.zip Added the patch for Android JB4.3_GA1.1.1 release. Updated clock usecount, after blank the display, the related clock can be gated off correctly. Support LVDS clock from PLL5.   [2015-12-21 Update]: Added 3.10.53_GA1.1.0 patch: L3.10.53_GA1.1.0_uboot_logo_keep_patch_2015-12-21.zip. Verified on iMX6DL/Q SabreSD board. It supports LCD and LVDS panels, HDMI patch will be released later.   [2016-01-04 Update]: Added 3.10.53_GA1.1.0 patch: L3.10.53_GA1.1.0_uboot_logo_keep_patch_2016-01-04.zip. Added HDMI display support. Now it supports LCD, LVDS and HDMI displays. Fixed the video playback issue for boot up.   [2016-05-18 Update]: 0001-Fix-the-split-mode-LVDS-panel-no-TX3-signal-issue.patch An issue was founded, when dual channel 4 lanes LVDS panel was used, in uboot there will be no LVDS TX3 signa on one LVDS port, the attach "0001-Fix-the-split-mode-LVDS-panel-no-TX3-signal-issue.patch" was used to fix this issue, it is based on JB4.3_1.1.1_uboot_logo_keep_patch_2015-09-18.zip, for other BSP, please port it manually.   [2016-08-29 Update]: 0001-After-reset-IPU-in-SRC-Control-Register-wait-for-res.patch On some iMX6 chip, after reset the IPU in SRC Control Register, enable IPU at once will cause system hang up, to avoid such issue, software needs wait for IPU reset done by polling the SRC register. The attach "0001-After-reset-IPU-in-SRC-Control-Register-wait-for-res.patch" was used to fix this issue, it is based on JB4.3_1.1.1_uboot_logo_keep_patch_2015-09-18.zip + "0001-Fix-the-split-mode-LVDS-panel-no-TX3-signal-issue.patch", for other BSP, please port it manually.   [2017-01-06 Update] Added patch for L4.1.15_GA1.2.0 BSP and Android M6.0.1_GA2.1.0 BSP. Files: L4.1.15_GA1.2.0_uboot_logo_keep_patch_2017-01-06.zip; M6.0.1_2.1.0_uboot_logo_keep_patch_2017-01-06.zip
View full article
Here are two patches to support BT656 and BT1120 output for i.MX6 ipuv3. With this patch, the i.MX6 can support the CVBS output on TV encoder. It is useful for a TV box. "L3.0.35_1.1.0_GA_bt656_output_patch.zip" is the patch for Freescale L3.0.35_1.1.0_GA_iMX6DQ BSP. "r13.4.1_bt656_output_patch.zip" is the patch for Freescale Android R13.4.1 BSP. 1. Features supported:     1) Support BT656(8 bits) and BT1120 (16 bits)interlaced output on display port.     2) Support both RGB and YUV frame buffer for BT656/BT1120 output.     3) Support PAL and NTSC mode.     4) Support on the fly switch between PAL and NTSC mode.     5) Support CVBS output based on adv7391 TV encoder. 2. Hardware link between iMX6 and adv7391 TV encoder chip.     IPU1_DI0_DISP_CLK connected to adv7391 CLKIN pin.     IPU1_DISP0_DAT_23~DISP0_DAT_16 connected to adv7391 P7~P0 pins.     IPU1_DI0_PIN2 connected to adv7391 HSYNC pin. (option)     IPU1_DI0_PIN4 connected to adv7391 VSYNC pin. (option)   - Android R13.4.1 kernel. 3. How to use -- Copy the two patch files to kernel folder.     $ git apply ./0001-Support-BT656-and-BT1120-output-for-iMX6-ipuv3.patch     $ git apply ./0002-Support-adv739x-TV-encoder-for-BT656-output.patch -- Select them in kernel config and build the new kernel image:                     Device Drivers  --->                       Graphics support  --->                           [*]   MXC BT656 and BT1120 output                           [*]   ADV7390/7391 TV Output Encoder -- Uboot parameters for video mode    Output BT656 NTSC data to display port with UVYV frame buffer mode:       "video=mxcfb0:dev=bt656,BT656-NTSC,if=BT656,fbpix=UYVY16"    Output BT656 NTSC data to display port with RGB565 frame buffer mode:       "video=mxcfb0:dev=bt656,BT656-NTSC,if=BT656,fbpix=RGB565"    Output BT656 PAL data to display port with RGB24 frame buffer mode:       "video=mxcfb0:dev=bt656,BT656-PAL,if=BT656,fbpix=RGB24"    Output CVBS NTSC signal on adv7391 with UYVY frame buffer mode:       "video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=UYVY16"    Output CVBS PAL signal on adv7391 with RGB565 frame buffer mode:       "video=mxcfb0:dev=adv739x,BT656-PAL,if=BT656,fbpix=RGB565" -- Switch between PAL and NTSC    $ echo D:720x480i-60 > /sys/class/graphics/fb0/mode    $ echo D:720x576i-50 > /sys/class/graphics/fb0/mode 4. Note     1) For 8 bits BT656 interface, the default data pins are "DISP0_DAT_23~DISP0_DAT_16", it can also        be any other continued display data pins, for example if "DISP0_DAT_7~DISP0_DAT_0" are used, the        macro "BT656_IF_DI_MSB" in "kernel_imx/drivers/mxc/ipu3/ipu_disp.c" should be changed from "23"        to "7".     2) For 16 bits BT1120 interface, the default data pins are "DISP0_DAT_23~DISP0_DAT_8", it can also        be any other continued display data pins, the macro "BT656_IF_DI_MSB" should be modified if the        hardware pins are changed.     3) When bt656 interface is the second display for each IPU,1-layer-fb (it can be checked with command        "$ cat /sys/class/graphics/fbx/fsl_disp_propperty"), the frame buffer can only be YUV format. In this        case, the IPU DC channel was used for BT656 display, it has no CSC function, so RGB frame buffer was        not supported. 2013-08-09 updated: The new release package "L3.0.35_1.1.0_GA_bt656_output_patch_2013-08-09.zip" had fixed the BT656 dual display issue on iMX6S/DL. Removed the old release package. 2013-09-04 updated: The new release package "r13.4.1_bt656_output_patch_2013-09-04.zip" had fixed the BT656 dual display issue on iMX6S/DL. For default, the dual display was tested with HDMI + CVBS, HDMI is the main display and adv739x CVBS output is the second display. For iMX6DQ which has two IPUs, please assign dual display to two IPUs, for example adv739x is on IPU1 DI0, it is fixed, because hardware pins used for it is fixed. Then we can assign HDMI or LVDS to another IPU (IPU2). For iMX6S/DL which has only one IPU, since adv739x had used IPU1 DI0, another display should be IPU1 DI1. 2013-09-30 updated: Added patch for L3.0.35_4.1.0_GA BSP, the file is "L3.0.35_4.1.0_GA_bt656_output_patch_2013-09-30.zip". 2014-07-21 updated: Added patch for L3.10.17_1.0.0_GA BSP, the file is "L3.10.17_1.0.0_GA_bt656_output_patch_2014-07-21.zip". 2015-01-26 updated: Updated the IPU microcode for 1080i50 and 1080i60 BT1120 output, the parameters "N" for command BMA is a 8 bits parameters, so its max value is 255, but for 1080i50 and 1080i60 output, it needs more blank data in each line, the "N" will be bigger than 255, the updated IPU microcode can fix this limitation. The updated file is "IPU_Microcode_Update_for_BT1120_1080i_20150126.zip". You can update the macro "DC_MCODE_BT656_xxx"  and function _ipu_dc_setup_bt656_interlaced() to the old patch if you used BT1120 mode to support 1080i display. The verified 1080i display mode is: {    /* 1080I60 Interlaced output */   "BT1120-1080I60", 30, 1920, 1080, 13468,   20, 3,   20, 2,   280, 1,   FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,   FB_MODE_IS_DETAILED,}, {   /* 1080I50 Interlaced output */   "BT1120-1080I50", 25, 1920, 1080, 13468,   20, 3,   20, 2,   720, 1,   FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,   FB_MODE_IS_DETAILED,}, 2016-01-28 updated: Updated IPU microcode to align with BT656.4 specification for NTSC output. For other BSP version with NTSC format support, please reference to ipu_disp_update.c for the final microcode. File "L3.0.35_4.1.0_GA_bt656_output_patch_20160128.zip"., Details, please reference to the readme.txt file in the package. 2016-06-24 update: Added BT656 and BT1120 progressive mode support. File "L3.0.35_4.1.0_GA_bt656_output_patch_20160624.zip". Details, please reference to the readme.txt file in the package. The patch for 3.14.52 GA1.1.0 BSP will be released in next week. 2016-06-27 update: Add BT656 and BT1120 display patch for 3.14.52 BSP. File "L3.14.52_1.1.0_GA_bt656_output_patch_2016-06-27.zip", details, please reference to the readme.txt in the package. 2017-03-10 update: Fixed a hard coding DC macro issue for progressive mode. Added patch "0008-Fixed-a-hard-coding-DC-macro-issue-for-progressive-m.patch" in L3.0.35_4.1.0_GA_bt656_output_patch_2017-03-10.zip. The code in patch "L3.14.52_1.1.0_GA_bt656_output_patch_2016-06-27" is correct.
View full article
Graphics are a big topic in the Android platform, containing java/jni graphic framework and 2d/3d graphic engines (skia, OpenGL-ES, renderscript). This document describes the general Android graphic stack and UI features on Freescale devices. 1. Android Graphic Stacks All Android 3D apps and games have the following graphic stack: Android system UI and all Apps UI follow 2D graphic stack as below, the hardware render will accelerate Android 2D UI with GPU HW OpenGL-ES 2.0 to improve the whole UI performance. Hardware acceleration can be disabled on i.mx6 in device/fsl/imx6/soc/imx6dq.mk USE_OPENGL_RENDERER := false Then rebuild frameworks/base/core/jni, and replace libandroid_runtime.so Surfaceflinger is responsible of all surface layers composition, and  then generate the framebuffer pixmap for display devices. these graphic surface layers are from 2D/3D apps. Hwcomposer is the alternative module of Surfaceflinger with OpenGL-ES. Hwcomposer is used to combine the specific surface layers supported by specific vendor devices. Freescale i.MX6 devices use GPU 2D to combine most surface layers, and the system power can be reduced with GPU 2D instead of GPU 3D. The typical power saving case is video playback. Hwcomposer with GPU 2D can offload GPU 3D task when running game and benchmarks, it is proved to improve the overall system performance about 20%. 2. Performance measurment Show FPS for Android system performance For NFS boot you can set “debug.sf.showfps” to 1 in init.freescale.rc (“setprop debug.sf.showfps 1”) and then reboot the system. For SD or EMMC boot, you can issue command “setprop debug.sf.showfps 1” in console, then find system_server thread by top and kill it to reset the system. Graphic benchmarks for 3D capability measurement Quadrant Full test benchmark cover CPU, Memory, IO, 2D and 3D GLBenchmark http://www.glbenchmark.com/ NenaMark2 https://market.android.com/details?id=se.nena.nenamark2 An3DBench http://www.androidzoom.com/android_applications/tools/an3dbench_hnog.html AnTutu http://www.antutu.com/software.html 3DMark http://www.futuremark.com/benchmarks/3dmark06/introduction/ Browser benchmarks http://www.webkit.org/perf/sunspider/sunspider.html http://v8.googlecode.com/svn/data/benchmarks/current/run.html http://www.craftymind.com/guimark2/ http://www.craftymind.com/factory/guimark/GUIMark_HTML4.html http://themaninblue.com/writing/perspective/2010/03/22/ 3.  Android UI features Dual display with same content This feature is supported in the default image in Android i.MX 6 release package. In this feature, LVDS panel and HDMI output can be supported simultaneously. It is only enabled when the HDMI TV has been connected with the board. Overscan for TV devices Some TVs may miss display the contents in overscan area. To avoid the contents in overscan area being lost, the common implement is by underscanning with an adjustable black border and letitng the viewer adjust the width of the black border. The downscan operation is done by surfaceflinger when it does surface composition through HW OpenGL ES. There is no performance impact since all the work is done by GPU HW. Overscan can be configured in display setting in visual mode: 32 bits color depth 32bpp UI can be supported by adding “bpp=32” in uboot as below: setenv bootargs ‘… video=mxcdi1fb:RGB666,XGA,bpp=32 …’, also can configure it in display setting. Enable 32bpp frame buffer and application surface buffer will be allocate to RGBA8888 format instead of default RGB565 format, that means more system memory is allocated. After enabling 32bpp, if some applications still don't have better UI quality, check to see if  there is hard code to request RGB565 format surface (should request RGBA8888 format to get better quality). Sample code is attached to test for 32bpp (left is on 16bpp, right is on 32bpp) Display Visual Setting The display setting is the add-on feature in FSL Android release, it is very convenient for end-users to change display property, mostly for the following features: Dual display enablement Display color depth setting(16bpp, 32bpp) Overscan adjustment in horizontal and vertical orientation 4. Issue Diagnosis Application Compatibility Some Android applications may not run correctly on some Android releases. It may cause application compatibility, so check the application in other platforms. For example Neocore and Asphalt 5 can run on Eclair, Froyo, and Gingerbread, but will not correctly run on Honeycomb. GPU Compatibility Some game UIs may not correctly display on our Android release. When encountering this kind of issue, the customer can check whether it is caused by the game using an OpenGL extension which our GPU does not support. They can download another data package (for example not extension data package) to have a check. Others Enlarge GPU memory if you encounter UI abnormally displaying after running an application for a while. Some applications need Wifi connections, so monitor the console log to see whether there are any error reports.
View full article
Introduction This guide provides a step by step explanation of what is involved in adding a new WiFi driver and making a new WiFi card work well in a custom Android build. (This guide was written for Android 4.1 but should be applicable to previous Android releases and hopefully future releases.) Contents Understand how Android WiFi works Port WiFi driver. Compile a proper wpa_supplicant in your BoardConfig.mk Modify your wifi.c in HAL. Launch wpa_supplicant and dhcpcd services in init.rc. Several debug tips. Understand How Android WiFi Works As the following figure, Android wireless architecture can be divided into three parts: Java Framework(WifiManager, WifiMonitor etc..), HAL(wifi.c,wpa_supplicant,netd) kernel space modules(wireless stack, wifi drivers) Java Framework communicate with wpa_supplicant using native interface (wifi.c). Wpa_supplicant and netd uses wireless extension or nl80211 to control WiFi drivers. Port WiFi driver Usually WiFi driver is provided as a kernel module. There are mainly two types of Android WiFi architecture:nl80211 and wext. With the implementation of nl80211/cfg80211 many wireless drivers in main line kernel  support nl80211 interface instead of wireless extension. For different vendors’ WiFi drivers, writing one Android.mk to add its compile into Android is what you should do. Here take atheros’s AR6kl as an example: ath6kl_module_file :=drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko $(ATH_ANDROID_SRC_BASE)/$(ath6kl_module_file):$(mod_cleanup) $(TARGET_PREBUILT_KERNEL) $(ACP)         $(MAKE) -C $(ATH_ANDROID_SRC_BASE) O=$(ATH_LINUXPATH) ARCH=arm CROSS_COMPILE=$(ARM_EABI_TOOLCHAIN)/arm-eabi- KLIB=$(ATH_\ LINUXPATH) KLIB_BUILD=$(ATH_LINUXPATH)         $(ACP) -fpt $(ATH_ANDROID_SRC_BASE)/compat/compat.ko $(TARGET_OUT)/lib/modules/         $(ACP) -fpt $(ATH_ANDROID_SRC_BASE)/net/wireless/cfg80211.ko $(TARGET_OUT)/lib/modules/ include $(CLEAR_VARS) LOCAL_MODULE := ath6kl_sdio.ko LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules LOCAL_SRC_FILES := $(ath6kl_module_file) include $(BUILD_PREBUILT) Compile a proper wpa_supplicant in your BoardConfig.mk In Android’s external directory, there are two wpa_supplicant_* projects. For wext-based wifi driver, wpa_supplicant_6 can be used. For nl80211-based WiFi driver, wpa_supplicnat_8 can only be used. But if WiFi vendors supply their own customized wpa_supplicant, it will be much easier to debug the communication between wpa_supplicant and WiFi drivers. No matter which supplicant  you choose, just control their compile in your BoardConfig.mk. Take atheros’s ath6kl as an example: ifeq ($(BOARD_WLAN_VENDOR),ATHEROS) BOARD_WLAN_DEVICE                        := ar6003 BOARD_HAS_ATH_WLAN                      := true WPA_SUPPLICANT_VERSION                  := VER_0_8_ATHEROS WIFI_DRIVER_MODULE_PATH                  := "/system/lib/modules/ath6kl_sdio.ko" WIFI_DRIVER_MODULE_NAME                  := "ath6kl_sdio" WIFI_DRIVER_MODULE_ARG                  := "suspend_mode=3 wow_mode=2 ar6k_clock=26000000 ath6kl_p2p=1" WIFI_DRIVER_P2P_MODULE_ARG              := "suspend_mode=3 wow_mode=2 ar6k_clock=26000000 ath6kl_p2p=1 debug_mask=0x2413" WIFI_SDIO_IF_DRIVER_MODULE_PATH          := "/system/lib/modules/cfg80211.ko" WIFI_SDIO_IF_DRIVER_MODULE_NAME          := "cfg80211" WIFI_SDIO_IF_DRIVER_MODULE_ARG          := "" WIFI_COMPAT_MODULE_PATH                  := "/system/lib/modules/compat.ko" WIFI_COMPAT_MODULE_NAME                  := "compat" WIFI_COMPAT_MODULE_ARG                  := "" endif then you need to provide a proper wpa_supplicant.conf  for your device. wpa_supplicant.conf  is very important because the control socket for android is specified in this file(ctrl_interface=). This file should be copied to /system/etc/wifi. Minimum required config options in wpa_supplicant.conf : There are two different ways in which wpa_supplicant can be configured, one is to use a "private" socket in android namespace, created by socket_local_client_connect() function in wpa_ctrl.c and another is by using a standard UNIX socket. Android private socket ctrl_interface=wlan0 update_config=1 - Unix standard socket ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi update_config=1 Modify your wifi.c in HAL Here what you should do is modifying some codes like wifi_load_driver and wifi_unload_driver. For Broadcom or CSR’s wifi driver, you can directly use the original wifi.c. But for atheros’s ath6kl driver, there are total three  .ko modules to install. So some micro variables and codes need to be changed to adapt it. Launch wpa_supplicant and dhcpcd services in init.rc If you have configured to use android private socket, you should do like this: service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c / data/misc/wifi /wpa_supplicant.conf socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot or if you have configured to use unix standard socket, you should do like this: service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0  -c/data/misc/wifi/wpa_supplicant.conf disabled oneshot If WiFi driver is not “wext” but “nl80211”, you should change it to –Dnl80211. For dhcpcd, you should lunch it like the following: service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL     class late_start     disabled oneshot The parameters “-ABKL” can largely enhance wifi connection speed.  About what “ABKL” stand for, you can refer to dhcpcd’s GNU manual. Several debug tips Incorrect permissions will result in wpa_supplicant not being able to create/open the control socket andlibhardware_legacy/wifi/wifi.c won't connect. Since Google modified wpa_supplicant to run as wifi user/group the directory structure and file ownership should belong to wifi user/group (see os_program_init() function in wpa_supplicant/os_unix.c ). Otherwise errors like: E/WifiHW  (  😞 Unable to open connection to supplicant on "/data/system/wpa_supplicant/wlan0": No such file or directory will appear. Also wpa_supplicant.conf should belong to wifi user/group because wpa_supplicant will want to modify this file. How to Enable debug for wpa_supplicant.               By default wpa_supplicant is set to MSG_INFO that doesn't tell much.                    To enable more messages:                 modify common.c and set wpa_debug_level = MSG_DEBUG                 modify common.h and change #define wpa_printf from if ((level) >= MSG_INFO) to if ((level) >= MSG_DEBUG)         3. WiFi driver’s softmac.               For most vendors’ WiFi driver, the mac address is fixed. We should add one softmac rule to let WiFi driver’s mac is unique for each board.
View full article
Android Power Debug and Optimization Introduction Android Power Management on i.MX Overview How to do power optimization for Android on i.MX How to check high power consumption on i.MX How to debug suspend/resume problems on i.MX Introduction This document describes i.MX Android power issues debug and power consumption optimization. Android Power Management on i.MX Overview What Power Manager introduced by Android • Early Suspend    It is allow drivers like LCD, keypad backlight, touch-screen, gsensor, to be notified when user-space writes to /sys/power/request_state to indicate that the user visible sleep state should change. These drivers will act as like Linux stand suspend() to let these devices entry in suspend for better battery life. •Late Resume    Late resume is matching with early suspend. It will resume the devices suspended during early suspend after the Stand Linux resume finished •Wake Locks     Wake locks are used by applications, services, kernel drivers to request CPU resources. A locked wakelock, depending on its type, prevents the system from entering suspend or other low-power states. It as a core member in android power management architecture from framework to kernel What introduced by i.MX to enhance the power framework BusFreq Support High bus, Low power audio bus and Low bus totally 3 system bus working points. Switching between these 3 bus mode according clock flags automatically. DDR running frequency will change according bus mode changing (highest 528/400MHz and lowest at 24MHz for MX6DQ/DL). CPUFreq The CPU frequency scaling device driver allows the clock speed of the CPUs to be changed on the fly. Once the CPU frequency is changed, the GP voltage will be changed to the voltage value. Enhance the default interactive governor for better performance on SDHC/GPU etc. System Power Profile Service and App (just for MX6DQ/DL) Support 3 profiles currently: Normal mode, Power Saving Mode and Performance Mode to get much better balance between performance and power consumption. Profiles can be customized according customers’ HW /MD design, including: CPU running max freq, trigger temperature, CPU running minimal freq, running cpu LDO bypass mode           i.MX6X has built-in LDO module, but also allows you to use external LDO suppliers. SW will provide the configuration using external LDO or internal LDO. How to do power optimization for Android on i.MX Suspend Mode All devices enter in suspend or low power Config GPIO PADs as High Z or input mode (depending on HW design,FSL provide Ref code) Cut off LDOs which no modules need (depending on HW design, FSL provide Ref code) DDR enter in self-refresh mode (FSL done) Config DDR IO Float pin to reduce the DDR IO consumption (FSL done) ARM core entry stop mode (WFI) (FSL done) All PLLs will cut off, just 32KHZ sleep clock living (FSL done) Notify the PMIC entry in standby to save some power (FSL done) User Idle Mode Optimization on device driver for WiFi, 3G, BT, screen brightness modules, etc., to save some power Let some device/GPIOs entry in suspend mode/low power mode Active power saving profile to reduce some system power loading. GPU 2D/3D auto entry in Stop/Standby mode if no activity needs update. (FSL done) Enable CPUFreq reduce ARM CORE power consumption (FSL done) Busfreq scanning to let system work at lower Freq to save power (FSL done) Audio/Video Playback Mode Optimization on device driver for WiFi, 3G, BT, screen brightness modules, etc., to save some power Let some device/GPIOs entry in suspend mode/low power mode Disable HW 3D acceleration for some Apps such as System UI, Music Player, etc., to save some power when System in IDLE or music playing mode. Enable CPUFreq and SOC WAIT mode, decrease CPU Freq/Voltage to save power for ARM CORE when no there is no task need cpu to handle(FSL done) Busfreq scanning will set bus work at low power audio bus mode to save some power (FSL done for audio case) DDR enter in self-refresh mode (FSL done for audio case) Reduce the screen brightness will save some power (for video case) VPU clock auto-gating to save power on SOC domain (for video case, FSL done) GPU 2D/3D auto-gating to save some power on SOC domain (FSL done) Try VDOA+IPU to bypass GPU in video playback(not comment for Android platform, pure Linux environment using this method, for it has some limitation such as the input/output size limit), this can save some power on DDR domain. How to check high power consumption on i.MX Idle Audio/Video Playback high power consumption Check the CPUFreq and  Bus_freq is enabled           cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor           cat /sys/devices/platform/imx_busfreq.0/enable Check whether the system bus working poing   For MX6Q:           cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/periph_clk/mmdc_ch0_axi_clk/rate   For MX6DL/SL:           cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/pll2_pfd_400M/periph_clk/mmdc_ch0_axi_clk/rate Check CPU Loading and Interrupt(cat /proc/interrupts) Check clock tree carefully to see which clocks arenot gated off  but no any modules need them.            powerdebug –d  -c SUSPEND MODE high power consumption Make sure all device entries are in suspend mode Make sure the system entry in DSM(measure the voltage &current of VDDARM_CAP, VDDSOC_CAP,DDR_1V5, VDD_HIGH…)      Some tips help to locate the problems Add debug message in device drivers which may lead high power consumption Enable PM debug in kernel Catch the waveform from these modules which may impact the high power consumption Remove devices from the board or do H/W rework to exclude some H/W problems How to debug suspend/resume problems on i.MX System could not entry in suspend mode Check below settings has been disabled: GPS has been disabled Don't connect USB cable to the board (adb will hold a wake lock) RIL will hold a wake lock if RIL failed to initialize (logcat -b radio) Setting->Application->Developer options->stay awake (stay awake not set) Check all wake locks which holed by kernel have been released          echo 15 > /sys/module/wakelock/parameters/debug_mask Check all user wake locks have been releaed          echo 15 > /sys/module/userwakelock/parameters/debug_mask System hang when resume or suspend Enable PM debug system to get more info about PM in kernel     make menuconfig  enable the PM debug sys [*] Power Management support                                                           [*]   Power Management Debug Support                                                           [*]     Verbose Power Management debugging Add no_console_suspend to the boot option for kernel         This makes the system print more useful info before entry in suspend Check the PMIC_STBY_REQ signal. Measure the VDDARM_IN Using Trace32 or ICE to locate the problem. Using RAMCONSOLE to dump the kernel log after reboot. Kernel resume back from suspend  but Android not    This is usually because of the wrong key layout file Use tool to get power key scan code        getevent  Correct the Keylayout         system/usr/keylayout/****.kl Correct the scandcode with your power key report value to Match the POWE key
View full article
                                                                                         Watch the Freescale i.MX team boot up Android 5.0 Lollipop in i.mx6 application processors—在线播放—优酷网,视频高清在线观看 The Freescale i.MX Android team has booted up Android 5.0 Lollipop in the SABRE platform for i.mx6 series. Google pushed all of the latest source for its Android release to AOSP on Nov. 5, and the Freescale Android Team started their work. With the previous 6 days to boot Android Lollipop up, the Freescale i.MX Android team enabled the basic features like connectivity, audio/video playback, sensors, inputs and display on day 7! You can see the some changes in the demo video at the beginning of the post. The Freescale i.MX Android team has closely followed almost every version of Android since it is released by AOSP and has good experience on it. Below are some snapshots and pictures for the Android Lollipop.
View full article
There is a very quick way to find out which line cause the crash in logcat, Generally, if some native service crashes, look in the crash log in logcat like this: I/DEBUG ( 2253): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 2253): Build fingerprint: 'freescale/sabresd_6dq/sabresd_6dq:4.0.4/R13.3-rc3/eng.b18293.20120710.124535:user/test-keys' I/DEBUG ( 2253): pid: 3043, tid: 3080 >>> /system/bin/mediaserver <<< I/DEBUG ( 2253): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad I/DEBUG ( 2253): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000 I/DEBUG ( 2253): r4 00000000 r5 00000027 r6 00bfd370 r7 40c1ef18 I/DEBUG ( 2253): r8 00004349 r9 00000000 10 000003f5 fp 00000000 I/DEBUG ( 2253): ip ffffffff sp 418876a0 lr 400ff1b5 pc 400fb91c cpsr 60000030 I/DEBUG   ( 2253):  ip ffffffff  sp 418876a0  lr 400ff1b5  pc 400fb91c  cpsr 60000030 We can see it’s possibly related to some code that we debugged, but don’t know exactly where or which line of code, Android has a tool to convert this log to a more precise log. As a quick example, if you got this crash in logcat: F/libc ( 3043): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) I/DEBUG ( 2253): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 2253): Build fingerprint: 'freescale/sabresd_6dq/sabresd_6dq:4.0.4/R13.3-rc3/eng.b18293.20120710.124535:user/test-keys' I/DEBUG ( 2253): pid: 3043, tid: 3080 >>> /system/bin/mediaserver <<< I/DEBUG ( 2253): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad I/DEBUG ( 2253): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000 I/DEBUG ( 2253): r4 00000000 r5 00000027 r6 00bfd370 r7 40c1ef18 I/DEBUG ( 2253): r8 00004349 r9 00000000 10 000003f5 fp 00000000 I/DEBUG ( 2253): ip ffffffff sp 418876a0 lr 400ff1b5 pc 400fb91c cpsr 60000030 I/DEBUG ( 2253): d0 3e4ccccd00000000 d1 7e37e43c3e4ccccd I/DEBUG ( 2253): d2 0000004042000000 d3 4200000000000000 I/DEBUG ( 2253): d4 3ff0000000000000 d5 3ff0000000000000 I/DEBUG ( 2253): d6 4220000041300000 d7 3e4ccccd3e4ccccd I/DEBUG ( 2253): d8 000000000000685d d9 00000000010bee7c I/DEBUG ( 2253): d10 0000000000000000 d11 0000000000000000 I/DEBUG ( 2253): d12 0000000000000000 d13 0000000000000000 I/DEBUG ( 2253): d14 0000000000000000 d15 0000000000000000 I/DEBUG ( 2253): d16 0000000000000000 d17 3ff0000000000000 I/DEBUG ( 2253): d18 7e37e43c8800759c d19 0000000000000000 I/DEBUG ( 2253): d20 bfe0000000000000 d21 405443dab91ed79f I/DEBUG ( 2253): d22 0000000000000000 d23 3f40624dd2f1a9fc I/DEBUG ( 2253): d24 7fff80007fff0000 d25 3f6328e1cb8c85e0 I/DEBUG ( 2253): d26 0000000000000000 d27 0000000000000000 I/DEBUG ( 2253): d28 0000000000000000 d29 0000000000000000 I/DEBUG ( 2253): d30 0000000000000000 d31 0000000000000000 I/DEBUG ( 2253): scr 28000010 I/DEBUG ( 2253): I/DEBUG ( 2253): #00 pc 0001791c /system/lib/libc.so I/DEBUG ( 2253): #01 pc 00003f3e /system/lib/libcutils.so (__android_log_assert) I/DEBUG ( 2253): #02 pc 0006c436 /system/lib/libstagefright.so (_ZN7android8OMXCodec16drainInputBufferEPNS0_10BufferInfoE) I/DEBUG ( 2253): #03 pc 0006cbc2 /system/lib/libstagefright.so (_ZN7android8OMXCodec17drainInputBuffersEv) I/DEBUG ( 2253): #04 pc 0006f570 /system/lib/libstagefright.so (_ZN7android8OMXCodec4readEPPNS_11MediaBufferEPKNS_11MediaSource11ReadOpti onsE) I/DEBUG ( 2253): #05 pc 00051aba /system/lib/libstagefright.so (_ZN7android11AudioPlayer5startEb) I/DEBUG ( 2253): #06 pc 0005411e /system/lib/libstagefright.so (_ZN7android13AwesomePlayer18startAudioPlayer_lEb) I/DEBUG ( 2253): #07 pc 0005554a /system/lib/libstagefright.so (_ZN7android13AwesomePlayer6play_lEv) I/DEBUG ( 2253): #08 pc 000558e0 /system/lib/libstagefright.so (_ZN7android13AwesomePlayer4playEv) I/DEBUG ( 2253): #09 pc 00027f4e /system/lib/libmediaplayerservice.so (_ZN7android17StagefrightPlayer5startEv) I/DEBUG ( 2253): #10 pc 00024dda /system/lib/libmediaplayerservice.so (_ZN7android18MediaPlayerService6decodeEixxPjPiS2_) I/DEBUG ( 2253): I/DEBUG ( 2253): code around pc: I/DEBUG ( 2253): 400fb8fc 4623b15c 2c006824 e026d1fb b12368db \.#F$h.,..&..h#. I/DEBUG ( 2253): 400fb90c 21014a17 6011447a 48124798 24002527 .J.!zD.`.G.H'%.$ I/DEBUG ( 2253): 400fb91c f7f47005 2106ee22 eebef7f5 f04fa901 .p.."..!......O. I/DEBUG ( 2253): 400fb92c 460a5380 93032006 94029401 ea7af7f5 .S.F. ........z. I/DEBUG ( 2253): 400fb93c 4622a905 f7f52002 f7f4ea84 2106ee0e .."F. .........! I/DEBUG ( 2253): I/DEBUG ( 2253): code around lr: I/DEBUG ( 2253): 400ff194 41f0e92d 4c0c4680 447c2600 68a56824 -..A.F.L.&|D$h.h I/DEBUG ( 2253): 400ff1a4 e0076867 300cf9b5 dd022b00 47c04628 gh.....0.+..(F.G I/DEBUG ( 2253): 400ff1b4 35544306 37fff117 6824d5f4 d1ee2c00 .CT5...7..$h.,.. I/DEBUG ( 2253): 400ff1c4 e8bd4630 bf0081f0 00028346 41f0e92d 0F......F...-..A I/DEBUG ( 2253): 400ff1d4 9004b086 f602fb01 460c461f 46154814 .........F.F.H.F I/DEBUG ( 2253): I/DEBUG ( 2253): memory map around addr deadbaad: I/DEBUG ( 2253): becef000-bed10000 [stack] I/DEBUG ( 2253): (no map for address) I/DEBUG ( 2253): ffff0000-ffff1000 [vectors] I/DEBUG ( 2253): You can see it’s related to which lib, but don’t know which line. So, let’s go to your source code, for example: mydroid; after do $. build/envsetup.sh$ lunch sabresd_6dp-eng $ development/scripts/stack Then you have a prompt: Reading native crash info from stdin The you just copy all the crash log in above to this prompt. And then Key in EOF (CTRL+D) in this prompt. You will get output like this: Reading symbols from /home/b33651/proj/ics/out/target/product/sabresd_6dq/symbols pid: 3043, tid: 3080 >>> /system/bin/mediaserver <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad   r0 deadbaad r1 00000001 r2 a0000000 r3 00000000   r4 00000000 r5 00000027 r6 00bfd370 r7 40c1ef18   r8 00004349 r9 00000000 10 000003f5 fp 00000000   ip ffffffff sp 418876a0 lr 400ff1b5 pc 400fb91c Stack Trace:   RELADDR FUNCTION FILE:LINE   0001791c __libc_android_abort+92 /home/b33651/proj/ics/bionic/libc/unistd/abort.c:82   00003f3e __android_log_assert+94 /home/b33651/proj/ics/system/core/liblog/logd_write.c:246   0006c436 android::OMXCodec::drainInputBuffer(android::OMXCodec::BufferInfo*)+138 /home/b33651/proj/ics/frameworks/base/media/libstagefright/OMXCodec.cpp:3181   0006cbc2 android::OMXCodec::drainInputBuffers()+102 /home/b33651/proj/ics/frameworks/base/media/libstagefright/OMXCodec.cpp:3125   0006f570 android::OMXCodec::read(android::MediaBuffer**, android::MediaSource::ReadOptions const*)+136 /home/b33651/proj/ics/frameworks/base/media/libstagefright/OMXCodec.cpp:4020   00051aba android::AudioPlayer::start(bool)+134 /home/b33651/proj/ics/frameworks/base/media/libstagefright/AudioPlayer.cpp:93   0005411e android::AwesomePlayer::startAudioPlayer_l(bool)+70 /home/b33651/proj/ics/frameworks/base/media/libstagefright/AwesomePlayer.cpp:953   0005554a android::AwesomePlayer::play_l()+202 /home/b33651/proj/ics/frameworks/base/media/libstagefright/AwesomePlayer.cpp:888   000558e0 android::AwesomePlayer::play()+20 /home/b33651/proj/ics/frameworks/base/media/libstagefright/AwesomePlayer.cpp:837   00027f4e android::StagefrightPlayer::start()+6 /home/b33651/proj/ics/frameworks/base/media/libmediaplayerservice/StagefrightPlayer.cpp:90   00024dda android::MediaPlayerService::decode(int, long long, long long, unsigned int*, int*, int*)+206 /home/b33651/proj/ics/frameworks/base/media/libmediaplayerservice/MediaPlayerService.cpp:1428 So, you get more reason logs. Note: The Android directory must have built once. The crash log better aligns with your Android build environment.
View full article
  Just sharing some experiences during the development and studying.   Although, it appears some hardwares, it focuses on software to speed up your developing on your  hardware.     杂记共享一下在开发和学习过程中的经验。    虽然涉及一些硬件,但其本身关注软件,希望这些能加速您在自己硬件上的开发。   02/07/2024 i.MX8X security overview and AHAB deep dive i.MX8X security overview and AHAB deep dive - NXP Community   11/23/2023 “Standalone” Compile Device Tree https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Standalone-Compile-Device-Tree/ta-p/1762373     10/26/2023 Linux Dynamic Debug https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Linux-Dynamic-Debug/ta-p/1746611   08/10/2023 u-boot environment preset for sdcard mirror u-boot environment preset for sdcard mirror - NXP Community   06/06/2023 all(bootloader, device tree, Linux kernel, rootfs) in spi nor demo imx8qxpc0 mek all(bootloader, device tree, Linux kernel, rootfs)... - NXP Community     09/26/2022 parseIVT - a script to help i.MX6 Code Signing parseIVT - a script to help i.MX6 Code Signing - NXP Community   Provide  run under windows   09/16/2022   create sdcard mirror under windows create sdcard mirror under windows - NXP Community     08/03/2022   i.MX8MM SDCARD Secondary Boot Demo https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MM-SDCARD-Secondary-Boot-Demo/ta-p/1500011     02/16/2022 mx8_ddr_stress_test without UI   https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/mx8-ddr-stress-test-without-UI/ta-p/1414090   12/23/2021 i.MX8 i.MX8X Board Reset https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8-i-MX8X-Board-Reset/ta-p/1391130       12/21/2021 regulator userspace-consumer https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/regulator-userspace-consumer/ta-p/1389948     11/24/2021 crypto af_alg blackkey demo crypto af_alg blackkey demo - NXP Community   09/28/2021 u-boot runtime modify Linux device tree(dtb) u-boot runtime modify Linux device tree(dtb) - NXP Community     08/17/2021 gpio-poweroff demo https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/gpio-poweroff-demo/ta-p/1324306         08/04/2021 How to use gpio-hog demo https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-use-gpio-hog-demo/ta-p/1317709       07/14/2021 SWUpdate OTA i.MX8MM EVK / i.MX8QXP MEK https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/SWUpdate-OTA-i-MX8MM-EVK-i-MX8QXP-MEK/ta-p/1307416     04/07/2021 i.MX8QXP eMMC Secondary Boot https://community.nxp.com/t5/i-MX-Community-Articles/i-MX8QXP-eMMC-Secondary-Boot/ba-p/1257704#M45       03/25/2021 sc_misc_board_ioctl to access the M4 partition from A core side sc_misc_board_ioctl to access the M4 partition fr... - NXP Community     03/17/2021 How to Changei.MX8X MEK+Base Board  Linux Debug UART https://community.nxp.com/t5/i-MX-Community-Articles/How-to-Change-i-MX8X-MEK-Base-Board-Linux-Debug-UART/ba-p/1246779#M43     03/16/2021 How to Change i.MX8MM evk Linux Debug UART https://community.nxp.com/t5/i-MX-Community-Articles/How-to-Change-i-MX8MM-evk-Linux-Debug-UART/ba-p/1243938#M40       05/06/2020 Linux fw_printenv fw_setenv to access U-Boot's environment variables Linux fw_printenv fw_setenv to access U-Boot's env... - NXP Community     03/30/2020 i.MX6 DDR calibration/stress for Mass Production https://community.nxp.com/docs/DOC-346065     03/25/2020 parseIVT - a script to help i.MX6 Code Signing https://community.nxp.com/docs/DOC-345998     02/17/2020 Start your machine learning journey from tensorflow playground Start your machine learning journey from tensorflow playground      01/15/2020 How to add  iMX8QXP PAD(GPIO) Wakeup How to add iMX8QXP PAD(GPIO) Wakeup    01/09/2020 Understand iMX8QX Hardware Partitioning By Making M4 Hello world Running Correctly https://community.nxp.com/docs/DOC-345359   09/29/2019 Docker On i.MX6UL With Ubuntu16.04 https://community.nxp.com/docs/DOC-344462   09/25/2019 Docker On i.MX8MM With Ubuntu https://community.nxp.com/docs/DOC-344473 Docker On i.MX8QXP With Ubuntu https://community.nxp.com/docs/DOC-344474     08/28/2019 eMMC5.0 vs eMMC5.1 https://community.nxp.com/docs/DOC-344265     05/24/2019 How to upgrade  Linux Kernel and dtb on eMMC without UUU How to upgrade Linux Kernel and dtb on eMMC without UUU     04/12/2019 eMMC RPMB Enhance and GP https://community.nxp.com/docs/DOC-343116   04/04/2019 How to Dump a GPT SDCard Mirror(Android O SDCard Mirror) https://community.nxp.com/docs/DOC-343079   04/04/2019 i.MX Create Android SDCard Mirror https://community.nxp.com/docs/DOC-343078   04/02/2019: i.MX Linux Binary_Demo Files Tips  https://community.nxp.com/docs/DOC-343075   04/02/2019:       Update Set fast boot        eMMC_RPMB_Enhance_and_GP.pdf   02/28/2019: imx_builder --- standalone build without Yocto https://community.nxp.com/docs/DOC-342702   08/10/2018: i.MX6SX M4 MPU Settings For RPMSG update    Update slide CMA Arrangement Consideration i.MX6SX_M4_MPU_Settings_For_RPMSG_08102018.pdf   07/26/2018 Understand ML With Simplest Code https://community.nxp.com/docs/DOC-341099     04/23/2018:     i.MX8M Standalone Build     i.MX8M Standalone Build.pdf     04/13/2018:      i.MX6SX M4 MPU Settings For RPMSG  update            Add slide CMA Arrangement  Consideration     i.MX6SX_M4_MPU_Settings_For_RPMSG_04132018.pdf   09/05/2017:       Update eMMC RPMB, Enhance  and GP       eMMC_RPMB_Enhance_and_GP.pdf 09/01/2017:       eMMC RPMB, Enhance  and GP       eMMC_RPMB_Enhance_and_GP.pdf 08/30/2017:     Dual LVDS for High Resolution Display(For i.MX6DQ/DLS)     Dual LVDS for High Resolution Display.pdf 08/27/2017:  L3.14.28 Ottbox Porting Notes:         L3.14.28_Ottbox_Porting_Notes-20150805-2.pdf MFGTool Uboot Share With the Normal Run One:        MFGTool_Uboot_share_with_NormalRun_sourceCode.pdf Mass Production with programmer        Mass_Production_with_NAND_programmer.pdf        Mass_Production_with_emmc_programmer.pdf AndroidSDCARDMirrorCreator https://community.nxp.com/docs/DOC-329596 L3.10.53 PianoPI Porting Note        L3.10.53_PianoPI_PortingNote_151102.pdf Audio Codec WM8960 Porting L3.10.53 PianoPI        AudioCodec_WM8960_Porting_L3.10.53_PianoPI_151012.pdf TouchScreen PianoPI Porting Note         TouchScreen_PianoPI_PortingNote_151103.pdf Accessing GPIO From UserSpace        Accessing_GPIO_From_UserSpace.pdf        https://community.nxp.com/docs/DOC-343344 FreeRTOS for i.MX6SX        FreeRTOS for i.MX6SX.pdf i.MX6SX M4 fastup        i.MX6SX M4 fastup.pdf i.MX6 SDCARD Secondary Boot Demo        i.MX6_SDCARD_Secondary_Boot_Demo.pdf i.MX6SX M4 MPU Settings For RPMSG        i.MX6SX_M4_MPU_Settings_For_RPMSG_10082016.pdf Security        Security03172017.pdf    NOT related to i.MX, only a short memo
View full article
Overview The purpose of this document is to demonstrate how to enable USB Bluetooth Dongle based on i.MX6 Android ICS. Hardware i.MX6Dual/Quad or i.MX6DualLite SabreSD board USB Bluetooth Dongle Software i.MX6DQ/MX6DL Android ICS R13.4 or R13.4.1 Release Changes 0001-enable-usb-dongle-BT.patch: Update bluedroid to disable RFKILL and enable HCIATTACH property for USB Bluetooth Dongle. diff --git a/bluedroid/Android.mk b/bluedroid/Android.mk index 17df49b..569be44 100644 --- a/bluedroid/Android.mk +++ b/bluedroid/Android.mk @@ -5,6 +5,13 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +ifeq ($(BOARD_BLUETOOTH_DOES_NOT_USE_RFKILL),true) +  LOCAL_CFLAGS := $(LOCAL_CFLAGS) -DBLUETOOTH_DOES_NOT_USE_RFKILL +endif + +ifeq ($(BOARD_BLUETOOTH_USES_HCIATTACH_PROPERTY),true) +  LOCAL_CFLAGS := $(LOCAL_CFLAGS) -DBLUETOOTH_HCIATTACH_USING_PROPERTY +endif LOCAL_SRC_FILES := \   bluetooth.c diff --git a/bluedroid/bluetooth.c b/bluedroid/bluetooth.c index 4cc9204..2636942 100644 --- a/bluedroid/bluetooth.c +++ b/bluedroid/bluetooth.c @@ -44,7 +44,7 @@ static int rfkill_id = -1; static char *rfkill_state_path = NULL; - +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL static int init_rfkill() {      char path[64];      char buf[16]; @@ -135,6 +135,7 @@ out:      if (fd >= 0) close(fd);      return ret; } +#endif static inline int create_hci_sock() {      int sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); @@ -151,13 +152,20 @@ int bt_enable() {      int ret = -1;      int hci_sock = -1;      int attempt; - +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL      if (set_bluetooth_power(1) < 0) goto out; - +#endif +#ifndef BLUETOOTH_HCIATTACH_USING_PROPERTY      LOGI("Starting hciattach daemon"); -    if (property_set("ctl.start", "hciattach") < 0) { +    if (property_set("ctl.start", "hciattach") < 0) +#else +    if (property_set("bluetooth.hciattach", "true") < 0) +#endif +    {          LOGE("Failed to start hciattach"); +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL          set_bluetooth_power(0); +#endif          goto out;      } @@ -186,14 +194,18 @@ int bt_enable() {          if (property_set("ctl.stop", "hciattach") < 0) {              LOGE("Error stopping hciattach");          } +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL          set_bluetooth_power(0); +#endif          goto out;      }      LOGI("Starting bluetoothd deamon");      if (property_set("ctl.start", "bluetoothd") < 0) {          LOGE("Failed to start bluetoothd"); +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL          set_bluetooth_power(0); +#endif          goto out;      } @@ -222,14 +234,20 @@ int bt_disable() {      ioctl(hci_sock, HCIDEVDOWN, HCI_DEV_ID);      LOGI("Stopping hciattach deamon"); -    if (property_set("ctl.stop", "hciattach") < 0) { +#ifndef BLUETOOTH_HCIATTACH_USING_PROPERTY +    if (property_set("ctl.stop", "hciattach") < 0) +#else +   if (property_set("bluetooth.hciattach", "false") < 0) +#endif +   {          LOGE("Error stopping hciattach");          goto out;      } - +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL      if (set_bluetooth_power(0) < 0) {          goto out;      } +#endif      ret = 0; out: @@ -246,9 +264,10 @@ int bt_is_enabled() {      // Check power first +#ifndef BLUETOOTH_DOES_NOT_USE_RFKILL      ret = check_bluetooth_power();      if (ret == -1 || ret == 0) goto out; - +#endif      ret = -1;      // Power is on, now check if the HCI interface is up 0002-usb_dongle-on-SabreSD.patch: Update MX6 board configuration files to enable USB Bluetooth dongle feature. diff --git a/imx6/imx6.mk b/imx6/imx6.mk @@ -63,6 +63,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \   audio.tinyalsa.freescale   \   audio.legacy.freescale    \ +        audio.a2dp.default                      \   alsa_aplay                \   alsa_arecord    \   alsa_amixer        \ diff --git a/imx6/sabresd/SabreSDBoardConfigComm.mk b/imx6/sabresd/SabreSDBoardConfigComm.mk index 03d8ce5..1a8a6bd 100755 --- a/imx6/sabresd/SabreSDBoardConfigComm.mk +++ b/imx6/sabresd/SabreSDBoardConfigComm.mk -# atheros 3k BT -BOARD_USE_AR3K_BLUETOOTH := true +# Default use USB BT dongle for imx6, so should enable below +BOARD_BLUETOOTH_DOES_NOT_USE_RFKILL := true +BOARD_BLUETOOTH_USES_HCIATTACH_PROPERTY := true + USE_ION_ALLOCATOR := false USE_GPU_ALLOCATOR := true diff --git a/imx6/sabresd/init.rc b/imx6/sabresd/init.rc index ff9f0ff..f127177 100755 --- a/imx6/sabresd/init.rc +++ b/imx6/sabresd/init.rc @@ -84,9 +84,12 @@ on boot      # No bluetooth hardware present      setprop hw.bluetooth 0      setprop wlan.interface wlan0 +    setprop hw.bluetooth 1 diff --git a/imx6/sabresd/required_hardware.xml b/imx6/sabresd/required_hardware.xml index c9a2271..f7db37b 100644 --- a/imx6/sabresd/required_hardware.xml +++ b/imx6/sabresd/required_hardware.xml @@ -22,6 +22,7 @@      <feature name="android.hardware.camera.flash" />      <feature name="android.hardware.camera.front" />      <feature name="android.hardware.location" /> +    <feature name="android.hardware.bluetooth" />      <feature name="android.hardware.location.network" />      <feature name="android.hardware.location.gps" />      <feature name="android.hardware.telephony" />
View full article
Hi All, The new Android JB4.2.2_1.0.0-GA release is now available on www.freescale.com ·         Files available Name Description IMX6_JB422_100_ANDROID_DOCS i.MX 6Quad, i.MX 6Dual, and   i.MX 6DualLite Android jb4.2.2_1.0.0 BSP Documentation. Includes Release   Notes, User's Guide, QSG and FAQ Sheet. IMX6_JB422_100_ANDROID_SOURCE i.MX 6Quad, i.MX 6Dual, and   i.MX 6DualLite Android jb4.2.2_1.0.0 BSP, Documentation and Source Code for   BSP and Codecs. IMX6_JB422_100_ANDROID_DEMO i.MX 6Quad, i.MX 6Dual, and   i.MX 6DualLite Android jb4.2.2_1.0.0 BSP Binary Demo Files ·         Target HW boards o   i.MX6DL  SABRE SD board o   i.MX6Q  SABRE SD board o   i.MX6DQ SABRE AI board o   i.MX6DL SABRE AI board ·         Release Description i.MX Android jb4.2.2_1.0.0-ga is GA release for Android 4.2.2 Jelly Bean(JB) on i.MX6Q SABRE SD, i.MX6DL SABRE SD and i.MX6Q/DL SABRE AI platform with key features integrated. i.MX Android jb4.2.2_1.0.0-ga release includes all necessary codes, documents and tools to assist users in building and running Android 4.2.2 on i.MX6Q and i.MX6DL hardware board from the scratch. The prebuilt images are also included for a quick trial on Freescale i.MX6Q, i.MX6DL SABRE SD and i.MX6Q/DL SABRE AI boards. Most of deliveries in this release are provided in source code with the exception of some proprietary modules/libraries from third parties. ·         Features Feature i.MX6Q   SABRE SD i.MX6DL   SABRE SD i.MX6   SABRE AI Comments Linux 3.0.35  kernel Y Y Y Based on Linux BSP   L3.0.35_4.0.0 GA release Google JellyBean   4.2.2 release Y Y Y Based on   android-4.2.2_r1 release Bootup with Android Y Y Y Boot source eMMC& External SD eMMC& External SD SD&Nand Default Nand chip   been support is Micron MT29F8G08ABABAWP Splash Screen for   LVDS Y Y N UI (input) Multi-touch on LVDS   panel Multi-touch on LVDS panel Multi-touch on LVDS   panel UI (display) LVDS panel, HDMI   display LVDS panel, HDMI   display LVDS panel, HDMI   display UI (dual display,   LVDS+HDMI, UI mirror displayed on second device) Y Y Y UI (brightness   control) Y Y Y UI (LiveWallpaper) Y Y Y Storage - External   Media Y Y Y SD, External SD and   UDisk Storage - MTP   (Media Transfer Protocol) Y Y Y Connectivity -   Ethernet Y Y Y Connectivity - BT     Y Y     N Hardware: ·           Atheros AR3001 ·           Atheros AR3002 Profiles: ·           A2DP ·           HID ·           OPP ·           PBAP Connectivity - WiFi Y Y     Y Hardware: ·           Atheros AR6103 SDIO card Features: ·           AP mode ·           Wake on Wireless Connectivity -   3G Y Y   N Hardware: ·           HUAWEI EM770W modem ·           Infinion Amazon 1 modem ·           ZTE FM210 modem Connectivity -   GPS Y Y N Connectivity - USB Tethering Y Y Y Support WIFI and   Ethernet as upstream Internet - SIP   voice call N N N Internet - VPN Y Y Y Power - Battery   status report Y Y N/A Known limitations   about the accuracy in some use cases Power - CPU Freq Y Y Y Power - Bus Freq Y Y Y Media - Music Play Y Y Y Media - Sound Record Y Y Y Media - Video Play Y Y Y Media - Camera Y Y N Media - TVIN N/A N/A Y PAL/NTSC Media - Dual Camera Y Y Y Hardware for SABRE SD: ·           Front Camera: OV5642 CSI camera ·           Rear Camera: OV5640 MIPI camera Hardware   for SABRE AI: ·           Front Camera: UVC camera ·           Rear Camera: TV IN Media - Camcorder Y Y N Media - USB Camera Y Y Y Logitech: ·           C250 ·           E3500 Media - USB Micro Y Y Y Media - Movie   Studio Y Y Y Media - HDMI audio output Y Y Y Graphic - HW 3D   acceleration Y Y Y OpenGLES 1.1/2.0   via GC2000 or GC800 3D core Graphic - HW   accelerated UI surface composition Y Y Y Misc - ADB over USB Y Y Y Misc - Fastboot   utility Y Y Y Misc - SW update   and factory reset Y Y Y Sensor - Magmatic Y Y N Sensor -   Accelerometer Y Y N Sensor - Light Y Y N NTFS-3G File System Y Y Y For external   Storage NAND N N Y Tested NAND chip: - Micro 29F8G08ABABA ·         Change List The below section lists the big changes in JellyBean which need the user’s attention when comparing to Freescale ICS version: o   Default Android multiple display implementation in JellyBean o   Display resolution change in Setting is not been supported o   New camera hal implementation based on JellyBean libcamera2 o   Add NTFS file system support for external storage ·         Known issues For known issues and limitations please consult the release notes
View full article
To build Android version earlier than Lollipop from source code, you need the Sun's 1.6 SDK to be installed for ubuntu as the link Initializing a Build Environment | Android Developers. You may still cannot get the Sun's JDK  with below instruction: $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" $ sudo apt-get update $ sudo apt-get install sun-java6-jdk    There are below options to help install the Sun's JDK  if you cannot find a valid source through apt-get commands: $ wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin $ chmod u+x jdk-6u45-linux-x64.bin $ ./jdk-6u45-linux-x64.bin $ sudo mv jdk1.6.0_45 /opt $ sudo update-alternatives --install /usr/bin/java java /opt/java/64/jdk1.6.0_45/bin/java 1 $ sudo update-alternatives --install /usr/bin/javac javac /opt/java/64/jdk1.6.0_45/bin/javac 1 $ sudo update-alternatives --install /usr/bin/jar jar /opt/java/64/jdk1.6.0_45/bin/jar 1 # if you have already install some other version of JDK, please export the JAVA_HOME env before your android build every time $ export JAVA_HOME=/opt/jdk1.6.0_45/ #or you can directly link the java binary to the sdk version you need as below: sudo ln -s /opt/java/64/jdk1.6.0_45/bin/jar /bin/jar sudo ln -s/opt/java/64/jdk1.6.0_45/java /bin/java sudo ln -s/opt/java/64/jdk1.6.0_45/javac /bin/javac sudo ln -s/opt/java/64/jdk1.6.0_45/javah /bin/javah sudo ln -s/opt/java/64/jdk1.6.0_45/javadoc /bin/javadoc sudo ln -s/opt/java/64/jdk1.6.0_45/javaws /bin/javaws    To built the Android version Lollipop and Marshmallow from source code, you need the OpenJDK 7 to be installed for ubuntu as the link Initializing a Build Environment | Android Developers. $ sudo apt-get update $ sudo apt-get install openjdk-7-jdk You may have both openjdk7 and SUN JDK 1.6 intalled in your ubuntu to build different Android version. If you have default java SDK to be Sun's JDK 1.6, you can just use below commands to make android build system use the openjdk7 for Lollipop built $ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ $ cd myandroid $ . ./build/envsetup.sh           //be sure to resetup the envsetup, and pick the platform to be built $ lunch
View full article
Some customers often use LVDS LCD with low resolution on i.MX6 platform, such as 320x240, but by defualt , linux bsp doesn't support low frequency pixel clock for LVDS module input. Question:     When we port LVDS LCD with 320x240 resolution to android4.2.2, we found pixel clock is not correct, it always output 38.9MHz, it is no probem for big resolution , for example 1024x768, but the clock we need for 320x240 LCD is 6.4MHz.     According to the quesiton, Let us check IPU & LDB clock in i.MX6 datasheet at first : From above table, if ldb clock is from IPU, we will not get 6.4MHz pixel clock, so we will have to adjust its source clock: The following steps are procedure that ports LVDS LCD with 320x240 resolution to i.MX6Q. 1. Adding LVDS LCD timing structure to ldb.c static struct fb_videomode ldb_modedb[] = { {       "LDB-XGA", 60, 320, 240, 155914,       38, 20,       15, 4,       30, 3,       0,       FB_VMODE_NONINTERLACED,       FB_MODE_IS_DETAILED, }, {      "LDB-1080P60", 60, 1920, 1080, 7692,      100, 40,      30, 3,      10, 2,      0,      FB_VMODE_NONINTERLACED,      FB_MODE_IS_DETAILED,}, }; 2.Modifying clock source of ldb module Checking /arch/arm/mach-mx6/clock.c, we can find there are 3 ldb's clock source : &pll5_video_main_clk, &pll2_pfd_352M, &pll2_pfd_400M, static int _clk_ldb_di1_set_parent(struct clk *clk, struct clk *parent) {        u32 reg, mux;        int rev = mx6q_revision();        reg = __raw_readl(MXC_CCM_CS2CDR)               & ~MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK;        mux = _get_mux6(parent, &pll5_video_main_clk,               &pll2_pfd_352M, &pll2_pfd_400M,               (rev == IMX_CHIP_REVISION_1_0) ?                &pll3_pfd_540M :       /* MX6Q TO1.0 */                &mmdc_ch1_axi_clk[0],     /* MX6Q TO1.1 and MX6DL */               &pll3_usb_otg_main_clk, NULL);        reg |= (mux << MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET);        __raw_writel(reg, MXC_CCM_CS2CDR);        return 0; } By default, pll2_pfd_352M is configured as the clock source of ldb: clk_set_parent(&ldb_di0_clk, &pll2_pfd_352M);        clk_set_parent(&ldb_di1_clk, &pll2_pfd_352M); We should change the clock source to be pll5_video_main_clk clk_set_parent(&ldb_di0_clk, &pll5_video_main_clk,);        clk_set_parent(&ldb_di1_clk, &pll5_video_main_clk,); 3. Configuring initial clock in board-mx6q_sabresd.c static struct ipuv3_fb_platform_data sabresd_fb_data[] = {        { /*fb0*/        .disp_dev = "ldb",        .interface_pix_fmt = IPU_PIX_FMT_RGB666,        .mode_str = "LDB-XGA",        .default_bpp = 16,        .int_clk = false,        .late_init = false, } int_clk=false means LDB clock is from PLL2_PFD_352 or pll5_video_main_clk; int_clk=true mean LDB clock if from IPU. OK, after doing above steps, LVDS LCD with low resolution should normally work. Freescale TICS team Weidong.sun 2015-08-18
View full article
Introduction Disk encryption on Android is based on dm-crypt, which is a kernel feature that works at the block device layer. Therefore, it is not usable with YAFFS, which talks directly to a raw nand flash chip, but does work with emmc and similar flash devices which present themselves to the kernel as a block device. The current preferred filesystem to use on these devices is ext4, though that is independent of whether encryption is used or not. [1] Let's encrypt! I will show the whole process first, and then point out the issue I noticed on i.MX6. To use this feature, go to settings and security as below: Encrypted phones need to set the numeric PIN, so click Screen lock to set password: Choose PIN: After setting up PIN code, the Screen lock is showed "Secured with PIN" as below: We can then click Encrypt phone to start: Note the words on this page, it needs start with a charged battery and the charger needs to be on. Click Encrypt phone button and it will ask PIN code setup before: Enter the PIN code and then has the confirmed page: Click Encrypt phone, it will reset framework and starting to encrypt: After running 100%: It then reset the device. When it boots, it will ask you enter the PIN to enter system. Check Setting -> Security again: The status showed Encrypted under Encrypt phone. Errors While Doing Encryption on i.MX6 In the following, I list the error I met and the way to fix. Orig filesystem overlaps crypto footer region.  Cannot encrypt in place It needs to make sure the filesystem doesn't extend into the last 16 Kbytes of the partition where the crypto footer is kept. The encryption in place and get_fs_size() in system/vold/cryptfs.c will check it, so needs to re-make data partition. sudo mke2fs -t ext4 /dev/sde7 1034000 -Ldata The original size is larger than 103400, so I used this value to reserved 16 Kbytes for crypto footer. device-mapper: table: 254:0: crypt: Error creating IV E/Cryptfs ( 2221): Cannot load dm-crypt mapping table. The actual encryption used for the filesystem for first release is 128 AES with CBC and ESSIV:SHA256. The master key is encrypted with 128 bit AES via calls to the openssl library. This is done by enable CONFIG_CRYPTO_SHA256 in kernel. Enable post_fs_data_done Vold sets the property vold.post_fs_data_done to "0", and then sets vold.decrypt to "trigger_post_fs_dat". This causes init.rc to run the post-fs-data commands in init.rc and init..rc. They will create any necessary directories, links, et al, and then set vold.post_fs_data_done to "1". Vold waits until it sees the "1" in that property. Finally, vold sets the property vold.decrypt to "trigger_restart_framework" which causes init.rc to start services in class main again, and also start services in class late_start for the first time since boot. This is done by: diff --git a/imx6/etc/init.rc b/imx6/etc/init.rc index 17cbd4c..f2823f2 100644 --- a/imx6/etc/init.rc +++ b/imx6/etc/init.rc @@ -203,7 +203,7 @@ on post-fs-data      # must uncomment this line, otherwise encrypted filesystems      # won't work.      # Set indication (checked by vold) that we have finished this action -    #setprop vold.post_fs_data_done 1 +    setprop vold.post_fs_data_done 1 Don't unmount data partition when cryptfs_restart After the steps above, it can finish encryption. But I found Android will crash after encryption and reboot. When data partition is encrypted, Android's init to mount /data will fail. The cryptfs.c here to try unmount will fail since the data partition isn't mounted before. diff --git a/cryptfs.c b/cryptfs.c index 052c033..fd05259 100644 --- a/cryptfs.c +++ b/cryptfs.c @@ -694,7 +694,7 @@ int cryptfs_restart(void)      if (! get_orig_mount_parms(DATA_MNT_POINT, fs_type, real_blkdev, &mnt_flags, fs_options)) {          SLOGD("Just got orig mount parms\n"); -        if (! (rc = wait_and_unmount(DATA_MNT_POINT)) ) { +        //if (! (rc = wait_and_unmount(DATA_MNT_POINT)) ) {              /* If that succeeded, then mount the decrypted filesystem */              mount(crypto_blkdev, DATA_MNT_POINT, fs_type, mnt_flags, fs_options); @@ -710,7 +710,7 @@ int cryptfs_restart(void)              /* Give it a few moments to get started */              sleep(1); -        } +        //}      } References: [1]: Notes on the implementation of encryption in Android 3.0 | Android Open Source
View full article
Overview The purpose of this doument is to introduce how to enable PCIe WiFi into i.MX6 Android release. Environment Setup Hardware: i.MX6 SABRE-SD board Software: Android Jelly Bean 4.2 Software Configurations The source codes of Intel PCIe WiFi have been integrated for i.MX6 SABRE-SD board into i.MX6 Android release. However it's disabled by default. To enable it for i.MX6 SABRE-SD board, you can do the following: Change BOARD_WLAN_VENDOR to INTEL in device/fsl board configuration files. For example, diff --git a/sabresd_6dq/BoardConfig.mk b/sabresd_6dq/BoardConfig.mk index 9c8a32d..912e752 100755 --- a/sabresd_6dq/BoardConfig.mk +++ b/sabresd_6dq/BoardConfig.mk @@ -11,7 +11,7 @@ TARGET_BOOTLOADER_BOARD_NAME := SABRESD PRODUCT_MODEL := SABRESD-MX6DQ # Wifi -BOARD_WLAN_VENDOR                       := ATHEROS +BOARD_WLAN_VENDOR                       := INTEL # for atheros vendor ifeq ($(BOARD_WLAN_VENDOR),ATHEROS) BOARD_WLAN_DEVICE                       := ar6003 @@ -30,6 +30,7 @@ WIFI_COMPAT_MODULE_ARG                         := "" endif #for intel vendor ifeq ($(BOARD_WLAN_VENDOR),INTEL) +BOARD_WLAN_DEVICE                       := INTEL BOARD_HOSTAPD_PRIVATE_LIB               ?= private_lib_driver_cmd BOARD_WPA_SUPPLICANT_PRIVATE_LIB        ?= private_lib_driver_cmd WPA_SUPPLICANT_VERSION                  := VER_0_8_X After changing BOARD_WLAN_VENDOR as "INTEL", the following files will be compiled for intel WiFi: device/fsl-proprietary/pcie-wifi/ external/wpa_supplicant_8 hardware/imx/wlan/intel/ hardware/libhardware_legacy/wifi/wifi_intel.c Enable PCIe WiFi driver in kernel_imx by running "make menuconfig" command: Select "System Type -> Freescale MXC Implementations -> PCI Express support" as "*" Select "Networking support -> Wireless ->  cfg80211 - wireless configuration API" as "*". Then select "Networking support -> Wireless -> Generic IEEE 802.11 Networking Stack (mac80211)" as "*" Select "Device Drivers ->  Network device support -> Wireless LAN -> Intel Wireless WiFi 4965AGN (iwl4965)" as "*" Then run "make" command to build kernel. The followings are the dependencies files to enable above configuration: Kernel configuration: * -> System Type -> Freescale MXC Implementations Select the PCI Express support. Then config intel WIFI driver: Generic IEEE 802.11 Networking Stack (mac80211) used by WIFI devices Symbol: MAC80211 [=y] Type : tristate Prompt: Generic IEEE 802.11 Networking Stack (mac80211) Defined at net/mac80211/Kconfig:1 Depends on: NET [=y] && WIRELESS [=y] && CFG80211 [=y] Location: -> Networking support (NET [=y]) -> Wireless (WIRELESS [=y]) Intel iwl4965 or iwl6300 card driver Symbol: IWL4965 [=y] Type : tristate Prompt: Intel Wireless WiFi 4965AGN (iwl4965) Defined at drivers/net/wireless/iwlegacy/Kconfig:65 Depends on: NETDEVICES [=y] && WLAN [=y] && PCI [=y] && MAC80211 [=y] Location: -> Device Drivers -> Network device support (NETDEVICES [=y]) Then you can follow up the instructions into Android User guide to build Android image. Known Limitation PCIe low power mode is not supported according to BSP release note. So when building in PCIe, the system suspend/resume should be disabled now.
View full article
Setting up your machine Exporting variables Edit your ~/.bashrc and add these 2 lines export ARCH=arm export CROSS_COMPILE=/opt/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi- To build and debug android you will need to install some packages and services in the host machine,this how-to assumes that you are using Ubuntu 9.04 or greater. Installing packages sudo apt-get install nfs-kernel-server patch g++ rpm zlib1g-dev m4 bison libncurses5-dev gettext build-essential tcl intltool libxml2-dev minicom tftpd  xinetd For a complete list, depending on system type, refer to Installing required packages Set serial port Setting TFTP Setting NFS Compile Android Download the SDK from our internal repository cd /opt wget http://android.maxtrack.com.br/imx-android-r6.tar.gz tar xvfz imx-android-r6.tar.gz cd imx-android-r6/code tar xzvf R6.tar.gz cd ~ mkdir myandroid cd myandroid curl http://android.git.kernel.org/repo > ./repo chmod a+x ./repo ./repo init -u git://android.git.kernel.org/platform/manifest.git -b donut * If you are behind a firewall or proxy try this one:./repo init -u http://android.git.kernel.org/platform/manifest.git -b donut cp /opt/imx-android-r6/code/R6/default.xml .repo/manifests/default.xml ./repo sync Preparing cross compiling tools cd /opt/imx-android-r6/tool tar xzvf gcc-4.1.2-glibc-2.5-nptl-3.tar.gz -C /opt export ARCH=arm export CROSS_COMPILE=/opt/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi- Download the kernel source git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.28.y.git kernel_imx Download U-Boot cd bootable/bootloader git clone git://git.denx.de/u-boot.git uboot-imx       Patching the environment Previously we decompressed the SDK at "/opt/imx-android-r6/code/R6" there we can find all the patches needed to iMX51 cd ~/myandroid . /opt/imx-android-r6/code/R6/and_patch.sh c_patch /opt/imx-android-r6/code/R6 imx_R6 Build Uboot cd ~/myandroid/bootable/bootloader/uboot-imx make mx51_bbg_android_config make Build Android cd ~/myandroid make PRODUCT-imx51_BBG-eng 2>&1 | tee build_imx51_BBG_android.log For i.MX51 BBG build, it will generate the compiled environment under myandroid/out/target/product/imx51_BBG. These 4 folders can be used to create your Android file system for NFS mounting, i.e., "root/" -> "/", "system/" -> "/system", "data/" -> "/data" root/ : root file system (including init, init.rc, etc). Will be mounted at "/" system/:  Android system binary/libraries. Will be mounted at "/system" data/: Android data area. Will be mounted at "/data" recovery/: root file system when booting in "recovery" mode. Not directly used. Image files to use with SD cards ramdisk.img: Ramdisk image generated from "root/". Not directly used. system.img: EXT3 image generated from "system/". Can be programmed to "SYSTEM" partition on SD card with "dd" userdata.img: EXT3 image generated from "data/". recovery.img: EXT3 image generated from "recovery/". Can be programmed to "RECOVERY" partition on SD card with "dd" Build uRamdisk Assuming that you had already built uboot, "mkimage" was generated under myandroid//bootable/bootloader/uboot-imx/tools/ cd ~/myandroid/out/target/product/imx51_BBG ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T ramdisk -C none -a 0x90308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img Build Kernel Image If you want to run Android via NFS or from SD, you can build kernel with default configuration now: cd ~/myandroid/kernel_imx       make imx51_android_defconfig      make uImage After compiling the image can be found at ~/myandroid/kernel_imx/arch/arm/boot/uImage. Since we are using Uboot we will need to do this step: cd myandroid/kernel_imx/arch/arm/boot ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T kernel -C none -a 0x90008000 -e 0x90008000 -n "Android Linux Kernel" -d ./zImage ./uImage Boot FS from SDcard Partioning the SD Card Insert your SD card/cardreader to the Linux PC (you need root privileges for programming SD), you can use dmesg to check the SD device, in our how-to we will consider that the sdcard is detected as /dev/sdb, so be careful to not mess up your own file system. To boot the entire FS from SDcard you must follow this partition schema: File:Pt.png To achieve this, we are going to use fdisk to create the partition table: # sudo fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x1787490d. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Listing the partition talbe (in our example the SDcard does not have a partition schema): Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytesDisk identifier: 0x1787490d    Device Boot      Start         End      Blocks   Id  System If you have any previous partition, please delete it using the "d" command. Pay attention that each sdcard block has 3872768 bytes (this size usually changes for each type of sdcard) so the first step is to jump at least 8 MB to store uboot, kernel and ramdisk ( as shown in the partition schema ) With that advice in mind, create a 10 MB primary partition that will store the media (/sdcards): Command (m for help): nCommand action    e   extended    p   primary partition (1-4) pPartition number (1-4): 1First cylinder (1-1023, default 1): +8MLast cylinder, +cylinders or +size{K,M,G} (2-1023, default 1023): +10M List the partition table to check if the partition was correctly created: Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Disk identifier: 0x1787490d     Device Boot      Start         End      Blocks   Id  System /dev/sdb1               2           5       15128   83  Linux Note that the first partition does not start in the first cylinder; the first cylinder and the second one will store uboot, kernel and ramdisk. Now we need to change the partition label to vfat: Command (m for help): tSelected partition 1 Hex code (type L to list codes): bChanged system type of partition 1 to b (W95 FAT32) Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Disk identifier: 0x1787490d     Device Boot      Start         End      Blocks   Id  System /dev/sdb1               2           5       15128    b  W95 FAT32 Create another 80 MB primary partition with 80 MB storage capacity; this partition will store the system's files. This partition must start in the cylinder that follows the last cylinder of the former partition. Command (m for help): nCommand action    e   extended    p   primary partition (1-4) p Partition number (1-4): 2First cylinder (1-1023, default 1): 6Last cylinder, +cylinders or +size{K,M,G} (6-1023, default 1023): +80M Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Disk identifier: 0x1787490d    Device Boot      Start         End      Blocks   Id  System /dev/sdb1               2           5       15128    b  W95 FAT32 /dev/sdb2               6          28       86986   83  Linux Now you must create an extended partition big enough to store other 2 logic partitions ( DATA partition with 20 MegaBytes and CACHE partition with 10 MB): Command (m for help): nCommand action    e   extended    p   primary partition (1-4) ePartition number (1-4): 3First cylinder (1-1023, default 1): 29Last cylinder, +cylinders or +size{K,M,G} (29-1023, default 1023): +30M Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Disk identifier: 0x1787490d     Device Boot      Start         End      Blocks   Id  System /dev/sdb1               2           5       15128    b  W95 FAT32 /dev/sdb2               6          28       86986   83  Linux /dev/sdb3              29          37       34038    5  Extended Now create the logic partitions: Command (m for help): nCommand action    l   logical (5 or over)    p   primary partition (1-4) lFirst cylinder (29-37, default 29): Using default value 29 Last cylinder, +cylinders or +size{K,M,G} (29-37, default 37): +20M Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Disk identifier: 0x1787490d     Device Boot      Start         End      Blocks   Id  System /dev/sdb1               2           5       15128    b  W95 FAT32 /dev/sdb2               6          28       86986   83  Linux /dev/sdb3              29          37       34038    5  Extended /dev/sdb5              29          34       22661   83  Linux Command (m for help): nCommand action    l   logical (5 or over)    p   primary partition (1-4) lFirst cylinder (35-37, default 35): Using default value 35 Last cylinder, +cylinders or +size{K,M,G} (35-37, default 37): Using default value 37 At last, you must create a primary partition to store the /recovery: Command (m for help): nCommand action    l   logical (5 or over)    p   primary partition (1-4) pSelected partition 4 First cylinder (1-1023, default 1): 38 Last cylinder, +cylinders or +size{K,M,G} (38-1023, default 1023): +10M Command (m for help): p Disk /dev/sdb: 3965 MB, 3965190144 bytes 122 heads, 62 sectors/track, 1023 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Disk identifier: 0x1787490d     Device Boot      Start         End      Blocks   Id  System /dev/sdb1               2           5       15128    b  W95 FAT32 /dev/sdb2               6          28       86986   83  Linux /dev/sdb3              29          37       34038    5  Extended /dev/sdb4              38          41       15128   83  Linux /dev/sdb5              29          34       22661   83  Linux /dev/sdb6              35          37       11315   83  Linux Saving the partition table: Command (m for help): wThe partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. Syncing disks. Now you are ready to start flashing the SDcard: Flashing SDcard Flashing Uboot cd ~/myandroid/bootable/bootloader/uboot-imx sudo dd if=your_bootloader_binfile of=/dev/sdb bs=1K seek=1 Usually we use this no-padding uboot image in SD card, i.e. program this no-padding uboot image into 1KB offset of SD card so that we will NOT overwrite the MBR (including partition table) within 1st 512B on SD card. Formatting the SD Do not copy and paste the commands; wait for the complete output. sudo mkfs.vfat /dev/sdb1 sudo mkfs.ext3 /dev/sdb2 sudo mkfs.ext3 /dev/sdb4 sudo mkfs.ext3 /dev/sdb5 sudo mkfs.ext3 /dev/sdb6 Flashing Kernel cd ~/myandroid/kernel_imx/arch/arm/boot sudo dd if=uImage of=/dev/sdb bs=1M seek=1 Flashing FS cd ~/myandroid/out/target/product/imx51_BBG sudo dd if=uramdisk.img of=/dev/sdb bs=4M seek=1 sudo dd if=system.img of=/dev/sdb2  (Program system.img into SYSTEM partition which will be mounted as "/system") sudo dd if=recovery.img of=/dev/sdb4 (Program recovery.img into RECOVERY partition which will mounted as "/" in recovery mode) Configure Uboot After inserting the SD card in the board (the slot is located at the inferior portion of the board), plugging in the serial cable and start a configured minicom session, you should turn on the iMX51 board and see in your console something like this: U-Boot 2009.08-00046-gf91e287 (Jan 18 2010 - 12:32:32) CPU:   Freescale i.MX51 family 2.5V at 400 MHz mx51 pll1: 800MHz mx51 pll2: 665MHz mx51 pll3: 216MHz ipg clock     : 66500000Hz ipg per clock : 665000000Hz uart clock    : 66500000Hz cspi clock    : 54000000Hz Board: MX51 BABBAGE 3.0 [POR] Boot Device: MMC DRAM:  512 MB MMC:   FSL_ESDHC: 0 In:    serial Out:   serial Err:   serial Press home + power to enter recovery mode ... Net:   FEC0 [PRIME] Hit any key to stop autoboot:  0 BBG U-Boot > Copy and paste these configurations, line by line: setenv bootcmd 'run bootcmd_SD1 bootcmd_SD2' setenv bootcmd_SD1 'run bootargs_base bootargs_android bootargs_SD' setenv bootcmd_SD2 'mmc read 0 ${loadaddr} 0x800 0x1280;mmc read 0 ${rd_loadaddr} 0x2000 0x258;bootm ${loadaddr} ${rd_loadaddr}' setenv bootargs_base 'setenv bootargs console=ttymxc0,115200' setenv bootargs_SD 'setenv bootargs ${bootargs}' setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 wvga calibration' setenv loadaddr 0x90800000 setenv rd_loadaddr 0x90B00000 saveenv Reboot the board: reset Additional Resources All Board Android ADB All Board Android Getevent All Board Android logcat All Board Android Without Ramdisk All Boards Debugging Android [Android] Fatal exception happens when preview size does not match video snapshot size Android Data Partition Encryption on i.MX6 Android GDB for Native Code Android Graphic UI with GPU hardware acceleration Android HTML5 Video Android Memory Usage Tool: Procrank Build Android 4.0 ICS under Ubuntu 11.10 Build Linphone Android for i.MX6 How to find the crash point: Android Native crash How to debug memory leakage in media server in Android How to Enable LDO Bypass Based on i.MX6 Android ICS How to Enable PCIe WiFi into i.MX6 Android Release? How to Install Android on SD Card How to play a file with 2 audio tracks: DTS &amp; AC3 on i.MX6/Android How to play a media file/stream from console in Android How to port new audio codec into Android.docx How to Print Function Caller Stack in Android Log File How to Support New WiFi Card in Android How to Use Proxy to Access Network in Android i.MX6 Android 13.4.1.03 Patch Release i.MX6 Android R13.4.1.04 patch release i.MX6 D/Q and i.MX6 DL/S Android JB4.2.2_1.0.0-GA release iMX6QD How to Add 24-bit LVDS Support in Android i.MX6 Android R13.4-GA.03 patch release IoT Solutions: Cloud Connector for Android Memory Management on i.MX6 Android New Android SD Card Demo Image for the i.MX6Q SABRE Board for Smart Devices New Android SD Card Demo Image for the i.MX6Q SABRE Platform for Smart Devices Sabre-l Setup Memo Video - Bye-Bye Standby Power - Ubiquitous QuickBoot with Android on NetWalker Video - Efika MX Smartbook Android Flash
View full article
by b47504 Overview This document is intended to introduce debug tips about i.MX power management based on i.MX Android software. The following topics are involved in this document: How to debug suspend/resume issues How to do power optimization How to debug suspend/resume issues General method: Capture more PM  debug message Enable PM debug system to get more info about PM in kernel and debug interface Power management options  ---> [*] Power Management Debug Support                                     [*]   Extra PM attributes in sysfs for low-level debugging/testing Enable wakelock debug_mask to capture more message about wakelock root@android:/ # echo 15 > /sys/module/wakelock/parameters/debug_mask root@android:/ # echo 15 > /sys/module/userwakelock/parameters/debug_mask Enable earlysuspend debug_mask to capture more message about early suspend and late resume. root@sabresd_6dq:/ # echo 15 > /sys/module/earlysuspend/parameters/debug_mask Add no_console_suspend=1 to the boot option for kernel This makes the system print more useful info before entry in suspend Eg: --- a/sabresd_6dq/BoardConfig.mk +++ b/sabresd_6dq/BoardConfig.mk -BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale +BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale no_console_suspend=1 System cannot enter suspend mode Check below setting items have been disabled: §  Whether the usb cable has been removed(usb gadget will hold a wake lock) §  Setting->Display->Sleep, check whether the inactivity timeout period setting is longer than your expected time. §  Setting->System->Developer options->stay awake(stay awake not be set), check whether the option is disabled Check if all wake locks have been released(You can see which wake lock is held, and then debug into the specific module): root@sabresd_6dq:/ # cat /sys/power/wake_lock System could not resume from suspend/System crash when resume or suspend Check the PMIC_STBY_REQ signal. System use PMIC_STBY_REQ signal to notify power management IC to change voltage from standby voltage to functional voltage and vice versa. In general, pmic_stby_req pin is connected to pmic standby pin. So measure the pin to check whether the  de-assert signal is triggered. If the signal is not triggered, we may consider whether wake-up sources are correctly setup. If the signal is triggered, we may double-check whether the pmic supply power normally. And not limited to the two points, we should also double-check everything we doubt according to the system log and hardware measured waves.  Using Trace32 or ICE to locate the problem. Please view trace32 website to get more details. Track from mx6_suspend_enter in arch/arm/mach-mx6 .                Track "state" value and try to map to different the low power mode via function mxc_cpu_lp_set.                Check "mx6_suspend.S" which conduct the detailed operations in suspend: "MEM" is mapped to "dormant" mode. So goto "dormant" symbol and try to dump different operations to narrow down suspend/resume failure If this failure maybe related to DDR operation, try to dummy DDR IO relative low power operation. Using ram console to dump kernel log after reboot. Ram console will keep one kernel log copy into one certain memory space. You can use the following command to check last time kernel log, if memory power was not cut off during the reboot process. Eg(if it is the first time boot, you cannot find the /proc/last_kmsg file): root@sabresd_6dq:/ # cat /proc/last_kmsg Kernel resume back from suspend but android not This is usually introduced by the wrong key layout file Use getevent/sendevent tool to get power key scan code #getevent  Correct the Keylayout file    system/usr/keylayout/****.kl Correct the scandcode with your power key report value to Match the POWE key Suspend/Resume consume too much time: We can print the specific module name and time consume details, if the module's suspend/resume time consume more than the threshold parameter by read/write /sys/power/device_suspend_time_threshold file. By default, the parameter is setup to 0, via disabled the function. We can enable it by the following command: Eg: root@android:/ # echo 10  > /sys/power/device_suspend_time_threshold This command means that if the module's suspend/resume time consume more than 10 us, the system will print the module's detail out. If you want to know the more details how to implement it on kernel, please check kernel/power/main.c Notes: Can use the shell command to enter different system level low power modes for debug (For more details: you can check Linux_6DQ_RM.pdf): #echo mem > /sys/power/state #echo standby > /sys/power/state How to do power optimization Runtime Mode Check whether CPUFreq and  Bus_freq scale are enabled root@android:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor root@android:/ # cat /sys/devices/platform/imx_busfreq.0/enable More details about this, please refer to "Documentation/cpu-freq/ governors.txt” . Check whether the system bus is working on your expected frequency. For MX6Q: root@android:/ #  cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/periph_clk/mmdc_ch0_axi_clk/rate Check CPU Loading and Interrupt(cat /proc/interrupts)                root@android:/ #  cat /proc/interrupts                Through this command you can check whether some module will trigger interrupt frequently.  And consider that whether we have some chances to reduce the interrupt count. Check clock tree carefully to see which clocks are not gated off  but no any modules need them. root@android:/ # powerdebug -d -c Reduce GPU frequency.GPU also offered interface to modify the frequency. According to your own product, you can reduce the gpu frequency. Default gpu3DMaxClock is set to 64 in init.rc file, we can tuning a suitable value by ourselves. diff --git a/imx6/etc/init.rc b/imx6/etc/init.rc index 8c420b5..eb11ffe 100755 --- a/imx6/etc/init.rc +++ b/imx6/etc/init.rc @@ -397,6 +397,9 @@ on boot #  Set GPU 3D minimum clock to 3/64     write /sys/module/galcore/parameters/gpu3DMinClock 3 +#  Set GPU 3D maximum clock to 64/64 +   write /sys/module/galcore/parameters/gpu3DMaxClock 64 + Suspend Mode Check whether all devices enter suspend mode or low power mode: Add debug message into devices drivers to check whether all devices driver suspend interface are called Use oscilloscope to measure the related signal (depend on specific device datasheet and custom hw design) to check whether every device enter low power mode Remove devices from the board(or rmmod the device driver) , and do hardware rework to exclude some hardware module if needed. Then we can figure out which module introduced the high consumption, and debug into the specific module. Add debug message in device drivers which may lead high power consumption, catch the waveform from these modules which may impact the high power consumption Check whether DDR enter in self-refresh mode(Please check the DDR datasheet to figure out which pin indicate self-refresh state, and check it with oscilloscope) Config GPIO PADs as output zero or input mode (depending to HW design) Cut off LDOs/DCDCs which no modules need (depending to HW design) Check all PLLs will cut off, just 32KHZ sleep clock living
View full article
Print caller stack may help you to analyze the program and find out the caller stack more easily. You can write your code like this: Java:      Exception e = new Exception();      Log.e(TAG,"xxx",e); C++ file:       #include <utils/Callstack.h>      android::CallStack stack;      stack.update(1,30);      stacn.dump("xxx"); Then you can see the function's caller stack in Android main log file. C file: #include <corkscrew/backtrace.h> #define MAX_DEPTH 31 #define MAX_BACKTRACE_LINE_LENGTH 800 static backtrace_frame_t mStack[MAX_DEPTH]; static size_t mCount; void csupdate(int32_t ignoreDepth, int32_t maxDepth) {     if (maxDepth > MAX_DEPTH) {         maxDepth = MAX_DEPTH;     }     ssize_t count = unwind_backtrace(mStack, ignoreDepth + 1, maxDepth);     mCount = count > 0 ? count : 0; } void csdump(const char* prefix)\ { size_t i = 0;     backtrace_symbol_t symbols[MAX_DEPTH];     get_backtrace_symbols(mStack, mCount, symbols);     for (i = 0; i < mCount; i++) {         char line[MAX_BACKTRACE_LINE_LENGTH];         format_backtrace_line(i, &mStack[i], &symbols[i],                 line, MAX_BACKTRACE_LINE_LENGTH);         ALOGE("%s%s", prefix, line);     }     free_backtrace_symbols(symbols, mCount); } void myFunc() {      csupdate(1, 30);      csdump("myprefix"); } In Android.mk, add libcorkscrew, as below LOCAL_SHARED_LIBRARIES := libxxx libyyy libcorkscrew
View full article
The i.MX Android O8.0.0_1.0.0 GA release is now available from IMX_SW page. Overview -> BSP Updates and Releases -> Android 8.0.0 Oreo (O8.0.0_1.0.0, 4.9 kernel)   Files available: # Name Description 1 android_O8.0.0_1.0.0_docs.tar.gz i.MX Android O8.0.0_1.0.0 BSP Documentation 2 imx-o8.0.0_1.0.0_ga.tar.gz i.MX Android O8.0.0_1.0.0 proprietary surce code for i.MX 6QuadPlus, i.MX 6Quad, i.MX 6DualPlus, i.MX 6Dual, i.MX 6DualLite, i.MX 6Solo  i.MX 6Sololite, i.MX6SX and i.MX7D 3 android_O8.0.0_1.0.0_image_6dqpsabreauto.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE for Automotive Infotainment based on i.MX 6QuadPlus, i.MX 6Quad, and i.MX 6DualLite 4 android_O8.0.0_1.0.0_image_6dqpsabresd.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE Platform and SABRE Board based on i.MX 6QuadPlus, i.MX 6Quad and i.MX 6DualLite. 5 android_O8.0.0_1.0.0_image_6slevk.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - i.MX 6Sololite evaluation kit. 6 android_O8.0.0_1.0.0_image_6sxsabresd.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE Board based on i.MX 6SoloX 7 android_O8.0.0_1.0.0_image_6sxsabreauto.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE for Automotive infotainment based on i.MX 6SoloX 8 android_O8.0.0_1.0.0_image_7dsabresd.tar.gz Binary Demo Files of Android O8.0.0_1.0.0 BSP - SABRE Board based on i.MX 7Dual 9 fsl_aacp_dec_O8.0.0_1.0.0.tar.gz AAC Plus Codec for O8.0.0_1.0.0 10 android_O8.0.0_1.0.0_tools.tar.gz Manufacturing Toolkit and VivanteVTK for O8.0.0_1.0.0   Supported Hardware SoC/Boards: i.MX 6Quad, i.MX 6QuadPlus, and i.MX 6DualLite SABRE-SD board and platform i.MX 6Quad, i.MX 6QuadPlus, and i.MX 6DualLite SABRE-AI board and platform i.MX 6SoloLite EVK platform i.MX 6SoloX SABRE-SD board and platforms i.MX 6SoloX SABRE-AI board and platforms i.MX 7Dual SABRE-SD board and platform   Changes: Compared to the N7.1.2_2.0.0 release, this release has the following major changes: Upgraded the Android code base from android-7.1.2_r9 to android-8.0.0_r25. Removed the device partition and added the vendor partition. Enabled ION-based gralloc and EGL. Feature: For features please consult the release notes.   Known issues For known issues and more details please consult the Release Notes.
View full article
Description about VPU & IPU usage in Android R13.4 GA release for i.MX6DQ
View full article
The attached patch enables HDMI overscan for Android JB, and tested by MX6Q SabreSD with Android_4.2.2_1.0.0-ga. The bootargs includes "video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off".
View full article