FORUMS
Remove All Ads from XDA

[DEV][Info] BoardConfig.mk for kernel developer and AOSP (platform) developer

232 posts
Thanks Meter: 396
 
By UnknownzD, Senior Member on 2nd May 2012, 08:09 AM
Post Reply Email Thread
So this is a major news for devs, if you found your AOSP / CM build doesn't work, make sure that you have the following line enabled if you are using TARGET_ARCH_VARIANT := armv7-a :
TARGET_ARCH_VARIANT_FPU := vfpv3-d16

This is due to a bug in armv7-a.mk in CM repo that automatically set FPU to neno for no reason. (btw, I have already reported the bug, so lets see it get patched or not later)
btw DO NOT change the line of TARGET_ARCH_VARIANT_FPU to vfpv3, otherwise your CM / AOSP build will not boot @ all.

The following BoardConfig.mk is used for compiling CWM on my kernels. And it is working for compiling CWM on my machine. You can edit the line such as USE_CAMERA_STUB, TARGET_NO_RADIOIMAGE or TARGET_PREBUILT_KERNEL on your own. However do not edit the line since TARGET_CPU_ABI to BOARD_FLASH_BLOCK_SIZE as they are vital and already right for our I9103.
Code:
LOCAL_PATH := $(call my-dir)
#USE_CAMERA_STUB := true

# inherit from the proprietary version
-include vendor/samsung/I9103/BoardConfigVendor.mk

TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a
TARGET_ARCH_VARIANT_CPU := cortex-a9
# DO NOT change the following line to vfpv3 as it is not really supported on our device!
TARGET_ARCH_VARIANT_FPU := vfpv3-d16
TARGET_CPU_SMP := true
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_HAVE_TEGRA_ERRATA_657451 := true
TARGET_BOARD_PLATFORM := tegra
TARGET_BOARD_PLATFORM_GPU := tegra # Useless for CM7 build
TARGET_BOOTLOADER_BOARD_NAME := n1
TARGET_USERIMAGES_USE_EXT4 := true

BOARD_KERNEL_CMDLINE := 
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048

# fix this up by examining /proc/mtd on a running device
# Boot image size is 16384 x 512 bytes = 8388608
# You can double check it with fdisk -l /dev/block/mmcblk0p8
BOARD_BOOTIMAGE_PARTITION_SIZE     := 0x00800000
# Recovery image size is 10240 x 512 bytes = 5242880
# You can double check it with fdisk -l /dev/block/mmcblk0p8
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000
# System image size is 1228800 x 512 bytes = 629145600
# You can double check it with fdisk -l /dev/block/mmcblk0p2
BOARD_SYSTEMIMAGE_PARTITION_SIZE   := 0x25800000
# User data image size is 4194304 x 512 bytes = 2147483648
# You can double check it with fdisk -l /dev/block/mmcblk0p6
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x80000000
BOARD_FLASH_BLOCK_SIZE := 2048

TARGET_PREBUILT_KERNEL := device/samsung/I9103/kernel

TARGET_NO_KERNEL := false
TARGET_NO_RECOVERY := false
TARGET_NO_BOOTLOADER := true
TARGET_NO_RADIOIMAGE := true

BOARD_HAS_NO_SELECT_BUTTON := true
# Use this flag if the board has a ext4 partition larger than 2gb
BOARD_HAS_LARGE_FILESYSTEM := true
btw I have an updated version of armv7-a.mk so that it should work on any device using armv7-a even when FPU is not defined. If your toolchain is complaing errors like the switch -mcpu is not working with -march, just remove the -mcpu switch on your own.
Code:
# Configuration for Linux on ARM.
# Generating binaries for the ARMv7-a architecture and higher
#
ARCH_ARM_HAVE_THUMB_SUPPORT     := true
ARCH_ARM_HAVE_FAST_INTERWORKING := true
ARCH_ARM_HAVE_64BIT_DATA        := true
ARCH_ARM_HAVE_HALFWORD_MULTIPLY := true
ARCH_ARM_HAVE_CLZ               := true
ARCH_ARM_HAVE_FFS               := true
ARCH_ARM_HAVE_ARMV7A            := true

ifeq ($(strip $(TARGET_ARCH_VARIANT_FPU)),)
ARCH_ARM_HAVE_VFP               := false
else
ARCH_ARM_HAVE_VFP               := true
endif

ifeq ($(strip $(TARGET_ARCH_VARIANT_FPU)),neon)
ARCH_ARM_HAVE_NEON              := true
endif

ifeq ($(strip $(TARGET_CPU_SMP)),true)
ARCH_ARM_HAVE_TLS_REGISTER      := true
endif

arch_variant_cflags := \
    -march=armv7-a \
    -mtune=$(strip $(TARGET_ARCH_VARIANT_CPU)) \
    -mcpu=$(strip $(TARGET_ARCH_VARIANT_CPU)) \
    -D__ARM_ARCH_7__ \
    -D__ARM_ARCH_7A__

ifeq ($(strip $(ARCH_ARM_HAVE_VFP)),true)
ifeq ($(strip $(ARCH_ARM_HAVE_NEON)),true)
arch_variant_cflags += -D__ARM_NEON__ -D__ARM_HAVE_NEON
else
arch_variant_cflags += -D__VFP_FP__ -D__ARM_HAVE_VFP
endif
arch_variant_cflags += -mfloat-abi=softfp -mfpu=$(strip $(TARGET_ARCH_VARIANT_FPU))
else
arch_variant_cflags += -mfloat-abi=soft
endif

ifeq ($(strip $(TARGET_ARCH_VARIANT_CPU)),cortex-a8)
arch_variant_ldflags := \
	-Wl,--fix-cortex-a8
else
arch_variant_ldflags :=
endif
In addition, please look at the required errata for building stuffs on our device.
As our device is using an epic old ARM cpu, it means that it may have errata inside. Errata means errors on the hardware that cannot be fixed, however can be bypassed with errata patch.

In conjunction with finding the required errata patch, this is our cpuinfo
cat /proc/cpuinfo
Processor : ARMv7 Processor rev 0 (v7l)
processor : 0
BogoMIPS : 999.42

processor : 1
BogoMIPS : 999.42

Features : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x1
CPU part : 0xc09
CPU revision : 0

Hardware : n1
Revision : 000d
Serial : 304d11d0943807ae

So next time when you try to make a custom kernel or port a kernel to this device, keep an eye on those errata please. Nvidia git sometimes made patch for those erratas as well.

For example, TARGET_HAVE_TEGRA_ERRATA_657451 is a config value telling that the src code to enable errata #657451 patch for our device. (And I have enabled that in our BoardConfig.mk already.)
The Following 11 Users Say Thank You to UnknownzD For This Useful Post: [ View ] Gift UnknownzD Ad-Free
 
 
2nd May 2012, 08:49 AM |#2  
'cooleagle''s Avatar
Retired Forum Moderator
Thanks Meter: 1,146
 
More
Now though it sounds sad it works, but in that case does LG O2X's ARM also belong to our family of devices ?
2nd May 2012, 09:49 AM |#3  
.....that just kinda destroyed my hopes

This was sent from a Galaxy Ace. Problem?
2nd May 2012, 11:02 AM |#4  
Senior Member
Flag New Delhi
Thanks Meter: 39
 
More
Quote:
Originally Posted by 'cooleagle'

Now though it sounds sad it works, but in that case does LG O2X's ARM also belong to our family of devices ?

its got the same AP20H tegra 2 processor i think
2nd May 2012, 11:46 AM |#5  
mj.vikram's Avatar
Senior Member
Flag XDA 24 X 7
Thanks Meter: 2,432
 
More
Because of this is it difficult to get ics .....

How its going to effect us......

according to Google policy company should provide s/w updates atleast for 16 months ....... So samy should provide ics update for us at that time they should correct the algorithms .... i am totally disturbed after seeing this.......

Sent from my GT-I9103 using XDA
2nd May 2012, 12:45 PM |#6  
'cooleagle''s Avatar
Retired Forum Moderator
Thanks Meter: 1,146
 
More
Quote:
Originally Posted by mj.vikram

Because of this is it difficult to get ics .....

How its going to effect us......

according to Google policy company should provide s/w updates atleast for 16 months ....... So samy should provide ics update for us at that time they should correct the algorithms .... i am totally disturbed after seeing this.......

Sent from my GT-I9103 using XDA

Don't lose sleep over it. S2's design was also started in 2010.

We'll get ICS as LG O2X which has the same SOC is going to get it, moreover Samsung India has confirmed that this device is capable of being upgraded to ICS so sit tight till it arrives.
The Following User Says Thank You to 'cooleagle' For This Useful Post: [ View ] Gift 'cooleagle' Ad-Free
2nd May 2012, 01:09 PM |#7  
OP Senior Member
Thanks Meter: 396
 
More
Please check the first topic again, it includes a specific change to BoardConfig.mk that allows anyone to build AOSP / CM for our board. Otherwise your CM7 won't boot from that.
The Following 5 Users Say Thank You to UnknownzD For This Useful Post: [ View ] Gift UnknownzD Ad-Free
2nd May 2012, 01:37 PM |#8  
Senior Member
Thanks Meter: 199
 
More
Quote:
Originally Posted by UnknownzD

Please check the first topic again, it includes a specific change to BoardConfig.mk that allows anyone to build AOSP / CM for our board. Otherwise your CM7 won't boot from that.

Damn! you're good!

Where have you been all this time!

Thanks for all this good info!
2nd May 2012, 02:39 PM |#9  
'cooleagle''s Avatar
Retired Forum Moderator
Thanks Meter: 1,146
 
More
UnknownzD you are Rolling in the Deep !

Hope to hear lots of goods news & info from you in near future man, keep them coming buddy . . . !

Cheers ! :beer:
2nd May 2012, 02:45 PM |#10  
OP Senior Member
Thanks Meter: 396
 
More
Quote:
Originally Posted by FranzJesus

Damn! you're good!

Where have you been all this time!

Thanks for all this good info!

In case your build still doesn't work, create a armv7-a-test.mk file under /build/core/combo/arch/arm/ and then place the following lines into it. This is the working one that I can built CWM on top of it.

---------------------------------------------------------------------------
# Configuration for Linux on ARM.
# Generating binaries for the ARMv5TE architecture and higher
#
ARCH_ARM_HAVE_THUMB_SUPPORT := true
ARCH_ARM_HAVE_FAST_INTERWORKING := true
ARCH_ARM_HAVE_64BIT_DATA := true
ARCH_ARM_HAVE_HALFWORD_MULTIPLY := true
ARCH_ARM_HAVE_CLZ := true
ARCH_ARM_HAVE_FFS := true
ARCH_ARM_HAVE_ARMV7A := true
#ARCH_ARM_HAVE_VFP := true

# Note: Hard coding the 'tune' value here is probably not ideal,
# and a better solution should be found in the future.
#
arch_variant_cflags := \
-march=armv7-a \
-mtune=$(strip $(TARGET_ARCH_VARIANT_CPU)) \
-mcpu=$(strip $(TARGET_ARCH_VARIANT_CPU)) \
# -mfloat-abi=softfp \
# -mfpu=$(strip $(TARGET_ARCH_VARIANT_FPU)) \
-D__ARM_ARCH_7__ \
-D__ARM_ARCH_7A__
# -D__ARM_ARCH_5__ \
# -D__ARM_ARCH_5T__ \
# -D__ARM_ARCH_5E__ \
# -D__ARM_ARCH_5TE__
---------------------------------------------------------------------------

btw, you have to put the the first 2 lines into your BoardConfig.mk in order to enable it. The third line is optional unless you want enable the vfp calculation (which should be the one causing problem).
TARGET_ARCH_VARIANT := armv7-a-test
TARGET_ARCH_VARIANT_CPU := cortex-a9
TARGET_ARCH_VARIANT_FPU := vfpv3

I am still testing on what caused the problem. Seems like the vfp (floating point calculation) has a strong relationship to the halt problem.

Edited : Okay I have confirmed, the VFP part should be the one causing issue. You may want to disable it first and I will work that out later (to find where the bug is).
The Following 2 Users Say Thank You to UnknownzD For This Useful Post: [ View ] Gift UnknownzD Ad-Free
2nd May 2012, 03:09 PM |#11  
F3niX's Avatar
Senior Member
Flag Hyderabad
Thanks Meter: 326
 
More
Where have you been Mate?? Awesome Work!! Continue!!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes