Archive for the OMAP4 Category

Note: OMAP4 Binary type Proximity sensor

Posted in android, OMAP4 on 2012 年 09 月 26 日 by Kun-Yi

Kernel driver

./drivers/input/misc/sfh7741.c (through platform_data to read data)
./arch/arm/mach-omap2/board-blaze-sensors.c (platform_data source, to check/modify platform GPIO
#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO184
#define OMAP4_SFH7741_ENABLE_GPIO188

Android HAL

./device/ti/blaze_tablet/libsensors/ProximitySensor.*
to update “sSensorList"  in ./device/ti/blaze_tablet/libsensors/Sensors.cpp files

廣告

Note: Porting a new board for Android ICS, clone blaze_tablet

Posted in android, OMAP4 on 2012 年 06 月 05 日 by Kun-Yi
  1. create a new vendor directory under device, there is ‘kunyi’
  2. create a board folder under ‘kunyi’, let me assign it is ‘myboard’
  3. copy all files into myboard from ./device/ti/blaze_tablet
  4. rename blaze_tablet.mk to full_myboard.mk
  5. edit Android.mk
    diff --git a/kunyi/myboard/Android.mk b/ti/blaze_tablet/Android.mk
    index 8992b28..d00e65a 100644
    --- a/kunyi/myboard/Android.mk
    +++ b/ti/blaze_tablet/Android.mk
    @@ -17,10 +17,10 @@ LOCAL_PATH := $(call my-dir)
     # protect makefile from other boards
     # if some modules are built directly from this directory (not subdirectories),
     # their rules should be written here.
    -ifeq ($(TARGET_DEVICE),myboard)
    +ifeq ($(TARGET_DEVICE),blaze_tablet)
     include $(CLEAR_VARS)
    
    -LOCAL_MODULE := myboard_hdcp_keys
    +LOCAL_MODULE := blaze_tablet_hdcp_keys
     LOCAL_MODULE_TAGS := optional
     LOCAL_MODULE_CLASS := FAKE
     LOCAL_MODULE_SUFFIX := -timestamp
    
    
  6. edit AndroidProducts.mk
    diff --git a/kunyi/myboard/AndroidProducts.mk b/ti/blaze_tablet/AndroidProducts
    index 295dafd..f6d0ed4 100644
    --- a/kunyi/myboard/AndroidProducts.mk
    +++ b/ti/blaze_tablet/AndroidProducts.mk
    @@ -26,5 +26,5 @@
     #
    
     PRODUCT_MAKEFILES := \
    -    $(LOCAL_DIR)/full_myboard.mk
    +    $(LOCAL_DIR)/full_blaze_tablet.mk
    
    
  7. edit BoardConfig.mk
    diff --git a/kunyi/myboard/BoardConfig.mk b/ti/blaze_tablet/BoardConfig.mk
    index 52fc74c..fd21c91 100644
    --- a/kunyi/myboard/BoardConfig.mk
    +++ b/ti/blaze_tablet/BoardConfig.mk
    @@ -14,8 +14,6 @@
     # limitations under the License.
     #
    
    -MYDEV_DIR := device
    -
     # These two variables are set first, so they can be overridden
     # by BoardConfigVendor.mk
     BOARD_USES_GENERIC_AUDIO := false
    @@ -41,9 +39,9 @@ BOARD_KERNEL_BASE := 0x80000000
    
     TARGET_NO_RADIOIMAGE := true
     TARGET_BOARD_PLATFORM := omap4
    -TARGET_BOOTLOADER_BOARD_NAME := myboard
    +TARGET_BOOTLOADER_BOARD_NAME := blaze_tablet
    
    -BOARD_EGL_CFG := $(MYDEV_DIR)/kunyi/myboard/egl.cfg
    +BOARD_EGL_CFG := device/ti/blaze_tablet/egl.cfg
    
     #BOARD_USES_HGL := true
     #BOARD_USES_OVERLAY := true
    @@ -51,9 +49,9 @@ USE_OPENGL_RENDERER := true
    
     # Recovery
     TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
    -TARGET_RECOVERY_UI_LIB := librecovery_ui_myboard
    +TARGET_RECOVERY_UI_LIB := librecovery_ui_blaze_tablet
     # device-specific extensions to the updater binary
    -TARGET_RELEASETOOLS_EXTENSIONS := $(MYDEV_DIR)/kunyi/myboard
    +TARGET_RELEASETOOLS_EXTENSIONS := device/ti/blaze_tablet
    
     BOARD_USES_SECURE_SERVICES := true
    
    @@ -92,7 +90,7 @@ endif
     #Set 32 byte cache line to true
     ARCH_ARM_HAVE_32_BYTE_CACHE_LINES := true
    
    -BOARD_LIB_DUMPSTATE := libdumpstate.myboard
    +BOARD_LIB_DUMPSTATE := libdumpstate.blaze_tablet
    
     BOARD_VENDOR_TI_GPS_HARDWARE := omap4
     BOARD_GPS_LIBRARIES := libgps
    
    
  8. edit board-info.txt
    diff --git a/kunyi/myboard/board-info.txt b/ti/blaze_tablet/board-info.txt
    index 688ffa9..4b74db7 100644
    --- a/kunyi/myboard/board-info.txt
    +++ b/ti/blaze_tablet/board-info.txt
    @@ -1,2 +1,2 @@
    -require board=MyBoard
    +require board=Blaze_Tablet
    
  9. edit device.mk
    
    diff --git a/kunyi/myboard/device.mk b/ti/blaze_tablet/device.mk
    index 4260b64..bd1a228 100644
    --- a/kunyi/myboard/device.mk
    +++ b/ti/blaze_tablet/device.mk
    @@ -14,9 +14,7 @@
     # limitations under the License.
     #
    
    -MYDEV_DIR := device
    -
    -DEVICE_PACKAGE_OVERLAYS := $(MYDEV_DIR)/kunyi/myboard/overlay
    +DEVICE_PACKAGE_OVERLAYS := device/ti/blaze_tablet/overlay
    
     PRODUCT_PACKAGES := \
         ti_omap4_ducati_bins \
    @@ -46,7 +44,7 @@ PRODUCT_PACKAGES += \
         VTCTestApp
    
     ifeq ($(TARGET_PREBUILT_KERNEL),)
    -LOCAL_KERNEL := $(MYDEV_DIR)/kunyi/myboard/boot/zImage
    +LOCAL_KERNEL := device/ti/blaze_tablet/boot/zImage
     else
     LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
     endif
    @@ -54,31 +52,31 @@ endif
     #Need to revisit the fastboot copy files
     PRODUCT_COPY_FILES := \
            $(LOCAL_KERNEL):kernel \
    -       $(MYDEV_DIR)/kunyi/myboard/init.omap4blazeboard.rc:root/init.omap4blaze
    -       $(MYDEV_DIR)/kunyi/myboard/init.omap4blazeboard.usb.rc:root/init.omap4b
    -       $(MYDEV_DIR)/kunyi/myboard/ueventd.omap4blazeboard.rc:root/ueventd.omap
    -       $(MYDEV_DIR)/kunyi/myboard/media_profiles.xml:system/etc/media_profiles
    +       device/ti/blaze_tablet/init.omap4blazeboard.rc:root/init.omap4blazeboar
    +       device/ti/blaze_tablet/init.omap4blazeboard.usb.rc:root/init.omap4blaze
    +       device/ti/blaze_tablet/ueventd.omap4blazeboard.rc:root/ueventd.omap4bla
    +       device/ti/blaze_tablet/media_profiles.xml:system/etc/media_profiles.xml
            frameworks/base/data/etc/android.hardware.telephony.gsm.xml:system/etc/
            frameworks/base/data/etc/android.hardware.usb.host.xml:system/etc/permi
            frameworks/base/data/etc/android.hardware.usb.accessory.xml:system/etc/
            frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissio
            frameworks/base/data/etc/android.hardware.wifi.direct.xml:system/etc/pe
    -       $(MYDEV_DIR)/kunyi/myboard/android.hardware.bluetooth.xml:system/etc/pe
    -       $(MYDEV_DIR)/kunyi/myboard/twl6030_pwrbutton.kl:system/usr/keylayout/tw
    -       $(MYDEV_DIR)/kunyi/myboard/qtouch-touchscreen.idc:system/usr/idc/qtouch
    -        $(MYDEV_DIR)/kunyi/myboard/gpio-keys.kl:system/usr/keylayout/gpio-keys
    -       $(MYDEV_DIR)/kunyi/myboard/bootanimation.zip:/system/media/bootanimatio
    +       device/ti/blaze_tablet/android.hardware.bluetooth.xml:system/etc/permis
    +       device/ti/blaze_tablet/twl6030_pwrbutton.kl:system/usr/keylayout/twl603
    +       device/ti/blaze_tablet/qtouch-touchscreen.idc:system/usr/idc/qtouch-tou
    +        device/ti/blaze_tablet/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl
    +       device/ti/blaze_tablet/bootanimation.zip:/system/media/bootanimation.zi
    
     # to mount the external storage (sdcard)
     PRODUCT_COPY_FILES += \
    -        $(MYDEV_DIR)/kunyi/myboard/vold.fstab:system/etc/vold.fstab
    +        device/ti/blaze_tablet/vold.fstab:system/etc/vold.fstab
    
     PRODUCT_PACKAGES += \
    -       lights.myboard
    +       lights.blaze_tablet
    
     #Remove this as it freezes at boot. Will re-enable once fixed
     PRODUCT_PACKAGES += \
    -       sensors.myboard \
    +       sensors.blaze_tablet \
            sensor.test
    
     PRODUCT_PACKAGES += \
    @@ -141,7 +139,7 @@ PRODUCT_PACKAGES += \
            setup_fs
    
     # Audio HAL module
    -PRODUCT_PACKAGES += audio.primary.myboard
    +PRODUCT_PACKAGES += audio.primary.blaze_tablet
    
     # Audioout libs
     PRODUCT_PACKAGES += libaudioutils
    @@ -194,7 +192,7 @@ PRODUCT_PACKAGES += \
             tfctrl
    
     PRODUCT_PACKAGES += \
    -       myboard_hdcp_keys
    +       blaze_tablet_hdcp_keys
    
     $(call inherit-product, frameworks/base/build/tablet-dalvik-heap.mk)
     $(call inherit-product, hardware/ti/omap4xxx/omap4.mk)
    
    
  10. Edit full-myboard.mk
    
    diff --git a/kunyi/myboard/full_myboard.mk b/ti/blaze_tablet/full_blaze_tablet.
    index 08f8f49..0055c39 100644
    --- a/kunyi/myboard/full_myboard.mk
    +++ b/ti/blaze_tablet/full_blaze_tablet.mk
    @@ -23,13 +23,13 @@
    
     # Inherit from those products. Most specific first.
     $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
    -$(call inherit-product, device/kunyi/myboard/device.mk)
    +$(call inherit-product, device/ti/blaze_tablet/device.mk)
     $(call inherit-product-if-exists, vendor/ti/proprietary/omap4/ti-omap4-vendor.
    
     # Discard inherited values and use our own instead.
    -PRODUCT_NAME := full_myboard
    -PRODUCT_DEVICE := myboard
    +PRODUCT_NAME := blaze_tablet
    +PRODUCT_DEVICE := blaze_tablet
     PRODUCT_BRAND := Android
    -PRODUCT_MODEL := MyBoard
    -PRODUCT_MANUFACTURER := Learn_KunYi
    
result in the below
————————————————————————————————————————————————–
including device/kunyi/myboard/vendorsetup.sh
including device/moto/stingray/vendorsetup.sh
including device/moto/wingray/vendorsetup.sh
including device/samsung/crespo4g/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/samsung/toro/vendorsetup.sh
including device/samsung/tuna/vendorsetup.sh
including device/ti/blaze_tablet/vendorsetup.sh
including device/ti/blaze/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=full_myboard
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
and you can move ./device/kunyi/myboard to ./vendor/kunyi/myboard, but need modify some path in .mk

Note: Build patch for OMAP4 4AI.1.3 on Ubuntu 12.04 x64 machine

Posted in android, ARM, OMAP4 on 2012 年 05 月 28 日 by Kun-Yi

follow http://www.omappedia.org/wiki/4AI.1.4_OMAP4_Icecream_Sandwich_Release_Notes to setup my build machine for Android platform development now
but change Host to Ubuntu 12.04 with Sun-Java6-JDK (1.6.0_32).

the Host default use GCC 4.6.x compiler, not GCC 4.4.x, so need to patch some files to fix build error

1. The patch fixed “failure while building obbtool"

diff –git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index 5ae4972..7df2893 100644
— a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -53,6 +53,6 @@ HOST_GLOBAL_CFLAGS += \
-include $(call select-android-config-h,linux-x86)

# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

HOST_NO_UNDEFINED_LDFLAGS := -Wl,–no-undefined

2. the patch fixed “failure external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type"

diff –git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/
index 5559ab4..1c1d119 100644
— a/include/gtest/internal/gtest-param-util.h
+++ b/include/gtest/internal/gtest-param-util.h
@@ -34,6 +34,7 @@
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

+#include <cstddef>
#include <iterator>
#include <utility>
#include <vector>

3. the patch fixed “failure /external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock’
collect2: ld returned 1 exit status"

diff –git a/llvm-host-build.mk b/llvm-host-build.mk
index 5219efd..6f8f44d 100644
— a/llvm-host-build.mk
+++ b/llvm-host-build.mk
@@ -59,3 +59,5 @@ $(hide) $(TBLGEN) \
-gen-$(strip $(1)) \
-o $@ $<
endef
+
+LOCAL_LDLIBS := -lpthread -ldl

4. the patch fixed “failure with: make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1″

diff –git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index f8b6962..683b446 100644
— a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -64,6 +64,7 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
#include <cstdlib>
+#include <cstddef>
#include <cstdio>
#include <cstdarg>
#include <climits>

5. the patch fixed “failure external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]"

diff –git a/libpp/format_output.h b/libpp/format_output.h
index b6c4592..8e527d5 100644
— a/libpp/format_output.h
+++ b/libpp/format_output.h
@@ -91,7 +91,7 @@ protected:
symbol_entry const & symbol;
sample_entry const & sample;
size_t pclass;
– mutable counts_t & counts;
+ counts_t & counts;
extra_images const & extra;
double diff;
};

6.the patch workaround “frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]"

diff –git a/Android.mk b/Android.mk
index a783ba9..75bd55e 100644
— a/Android.mk
+++ b/Android.mk
@@ -19,7 +19,7 @@ ifeq ($(TARGET_BUILD_APPS),)

LOCAL_PATH := $(call my-dir)

-local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
+local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
ifneq ($(TARGET_BUILD_VARIANT),eng)
local_cflags_for_slang += -D__DISABLE_ASSERTS
endif

Note: Build U-boot for Panda board

Posted in ARM, OMAP4, uboot on 2011 年 02 月 14 日 by Kun-Yi

Sourcery G++ Lite 2010.09-50 (gcc 4.5.1)去 build u-boot, 會發現console顯示的記憶體大小都為零, 追了一下code, 發現問題出現在 int dram_init(void)/omap4.c 內, 當程式設定 gd->bd->bi_dram[0] 都無正確的結果, 但是取address是正確的,

之後用cast pointer去寫值驗證是成功, 但是用 gd->bd->bi_dram[0] 將會不正常, 推測是 u-boot用的optimazation 的技巧(keyword: DECLARE_GLOBAL_DATA_PTR ), 在新的gcc 4.5.1上產生了問題, 這問題, 基本上可以用 objdump 去double check, 但是懶的查, 就換了成舊的 Sourcery G++ Lite 2009q1-203 (gcc 4.3.3), 換成該版是因為很多人說 gcc 4.4的版本問題也很多

  • make distclean  # clean all objects
  • make CROSS_COMPILER=arm-none-linux-gnueabi- omap4430panda_config # setting config file for Pandaboard
  • make CROSS_COMPILER=arm-none-linux-gnueabi- # build u-boot.bin

然後在u-boot目錄內執行上述指令就可以得到 u-boot.bin

使用的 u-boot repository 是 git://git.omapzoom.org/repo/u-boot.git

目前Ti 正在implement from EFI Partitions load OS image, 所以這邊待修正

Note: Build x-loader for Panda board

Posted in OMAP4, XLoader on 2011 年 02 月 07 日 by Kun-Yi

See omappedia.org/wiki/Bootloader_Project from clone git respository step,  the below add ‘omap4_dev’ branch name

git clone  git://git.omapzoom.org/repo/x-loader.git -b omap4_dev

Download cross compiler from CodeSourcery, currently version is 2010.09 and install to your host computer (my host is ubuntu 10.10 AMD64)

x-loader codebase support omap4430panda_config, Now!

cd <path_to_x-boot>
make distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- omap4430panda_config
make CROSS_COMPILE=arm-none-linux-gnueabi- ift

Note: SignGP Tool, OMAP3/4 for MMC boot

Posted in ARM, OMAP3, OMAP4, XLoader on 2011 年 02 月 03 日 by Kun-Yi

SignGP tool, just attached a header to x-loader.bin for OMAP3/4 MMC/SD booting

Currently, I know have two verision header

1. original version , just added image length and a default start address(0x40200800) of memory

2. 2nd version, attached a configuration header for SDRAM setting in original version

SignGP  x-loader.bin

will generation a  x-loader.bin.ift file, rename it to MLO and copy into SD/MMC card.