Android Nougat 7.1.2 Guide

Android Nougat 7.1.2 Guide

 

1. How to get the source code.

Please contact Nexell FAE to get the BSP source code.

 

2. Build

2.1. ENVIRONMENT

We recommend using Ubuntu-14.04 LTS.
Set up environment guided by https://source.android.com/source/initializing

 

2.2. Run Build

build script usage:

nougat-nexell$ ./device/nexell/{BOARD}/build.sh [-s chip-name] [-t build_target] [-T android-build-tag] [-d result-dir] [-V build-version] [-h]
option description
-s <optional> specify chip-name, if board supports two chip types(ex> avn_ref), you must specify -s {chip-name}
-t <optional> specify build-target, add if you want to partial build.
Available build-target
* bl1
* u-boot
* secure
* kernel
* module
* Android
* dist
-d <optional> specify build result directory. If not given, result -{chipname}-{boardname}-{builddate} directory used.
-V <optional> specify build version. If given, resultdir-{build-version} is used by result directory.
-T <optional> specify android-build-tag. Available value is like below.
* user: release build(impossible to adb root), use building release image
* userdebug: debug build(possible to adb root), use building develop image
* eng: non enforce sepolicy, not recommend
Default value is userdebug.

example1) Build entire target (default usage)

$ ./device/nexell/{BOARD}/build.sh

example2) Partial Build kernel

$ ./device/nexell/{BOARD}/build.sh -t kernel

example3) Partial Build u-boot and specify result dir, build version

$ ./device/nexell/{BOARD}/build.sh -t u-boot -d result-my-android -V 1st

 

 

3. BOARD DOWNLOAD

3.1. FIRST DOWNLOAD ON NEW BOARD

If you have nothing on your board, or you have any other kind of platform installed, such as Android or Window, you should do this step 1~3

step 1) First change the jumper setting of your board to USB download mode.
step 2) Push to reset button.
step 3) Connect a serial console to the target board and run a terminal program like below.

$ minicom -D /dev/tty{x}

setp 4) execute script in ubuntu host terminal.

$ cd {result-directory}
$ ./boot_by_usb.sh

step 5) stop u-boot mode after step 3 and typing below command in serial terminal.

# fastboot 0

step 6) run update command in ubuntu host terminal.

# cd {result-directory}
# ./update.sh

3.2. FASTBOOT DOWNLOAD

This is the same as step 5 above.

$ cd {result-directory}
$ ./update.sh

3.3. PARTIAL DOWNLOAD

{result-directory}/update.sh script can fuse images partially.
To fuse image partially, run command like below
./update.sh {image-name}

examples>

$ ./update.sh bl1-emmdboot.bin
$ ./update.sh bootloader.img
...

※ If you want to know detailed process of update.sh, see the code of update.sh script.

 

 

4. Android Porting Guide

4.1. Android Nougat BSP Structure

 

You must define your board name. Here, I will use ‘new_bd’ as a board name. This board name is used at bl1, u-boot, kernel, and Android base porting.

 

4.2. Android Base Porting

4.2.1. s5p6818

4.2.1.1 copy and make target board directory

Make a directory for your board under device/nexell, Follow below command

$ ./device/nexell/tools/copy_dir.sh avn_ref new_bd

It will copy /device/nexell/avn_ref directory to device/nexell/new_bd directory.

 

4.2.1.2 change board names at script files

find and change board names from ‘navi_ref’ to ‘new_bd’ at all files under device/nexell/new_bd directory

4.2.1.3. board related changes

you should changes some board related at /device/nexell/new_bd/build_s5p6818.sh

Select Boot Device port

...
build_bl1 ${BL1_DIR}/bl1-${TARGET_SOC} new_bd 2
...
 gen_third ${TARGET_SOC} \
 ${OPTEE_DIR}/optee_build/result/fip-loader.bin \
 0x7fcc0000 0x7fd00800 ${OPTEE_DIR}/optee_build/result/fip-loader-emmc.img \
 "-k 3 -m 0x60200 -b 3 -p 2 -m 0x1E0200 -b 3 -p 2"

 

Select serial debug port number

OPTEE_BUILD_OPT="PLAT_DRAM_SIZE=2048 PLAT_UART_BASE=0xc00a1000 SECURE_ON=0 SUPPORT_ANDROID=1"
.
.
.
UBOOT_BOOTARGS="console=ttySAC0,115200n8 loglevel=7 printk.time=1 androidboot.hardware=jyc_ref androidboot.console=ttySAC0 androidboot.serialno=0123456789abcdef quiet"

serial debug port 
channel base address useage
 0 0xc00a1000 PLAT_UART_BASE=0xc00a1000
1 0xc00a0000 PLAT_UART_BASE=0xc00a0000
2  0xc00a2000 PLAT_UART_BASE=0xc00a2000
3 0xc00a3000 PLAT_UART_BASE=0xc00a3000
4 0xc00d0000 PLAT_UART_BASE=0xc00d0000

 

Select eMMC storage size

OPTEE_BUILD_OPT="PLAT_DRAM_SIZE=2048 PLAT_UART_BASE=0xc00a1000 SECURE_ON=0 SUPPORT_ANDROID=1"

※ if you want to use 1GB DDR with s5p6818, you should build with 32bit.

 

4.2.2. S5P4418

4.2.2.1 COPY AND MAKE TARGET BOARD DIRECTORY

Make a directory for your board under device/nexell, Follow below command

$ ./device/nexell/tools/copy_dir.sh navi_ref new_bd

It will copy /device/nexell/avn_ref directory to device/nexell/new_bd directory.

 

4.2.2.2 CHANGE BOARD NAMES AT SCRIPT FILES

find and change board names from ‘navi_ref’ to ‘new_bd’ at all files under device/nexell/new_bd directory

 

4.2.2.3. BOARD RELATED CHANGES

you should changes some board related at /device/nexell/new_bd/build.sh

Select Boot Device port

...
DEV_PORTNUM=0
...
build_bl1_s5p4418 ${BL1_DIR}/bl1-${TARGET_SOC} nxp4330 navi 0
...

 

Select serial debug port number

...
UBOOT_BOOTARGS="console=ttySAC0,115200n8 loglevel=7 printk.time=1 androidboot.hardware=jyc_ref androidboot.console=ttySAC0 androidboot.serialno=0123456789abcdef quiet"
...

 

 

4.2. BL1 Porting

BL1 source for s5p6818 is located at device/nexell/bl1/bl1-s5p6818.
BL1 source for s5p4418 is located at device/nexell/bl1/bl1-s5p4418.
BL1 Porting Guide is described at [BL1 Porting Guide for s5p6818 / s5p4418 ]
Booting Sequence is described at [S5P6818 Booting Sequence]

 

4.3. Secure Porting

Secure source code is located at device/nexell/secure.
Secure Porting Guide is described at [Secure Porting Guide for s5p6818 / s5p4418]

 

4.4. u-boot Porting

u-boot source is located at device/nexell/u-boot/u-boot-2016.01
U-boot Porting Guide is described at [u-boot-2016.01]

 

4.5. Kernel Porting

kernel source is located at device/nexell/kernel/kernel-4.4.x
Kernel 4.4 Porting Guide is described at [KERNEL 4.4.x]

 

Print Friendly, PDF & Email