blob: dff67fec5644c7115d10314dd04b1ddc098b9d7f [file] [log] [blame]
How to add new profile for a subtarget
========================================
There are serveral subtargets in the target/linux/mmp (pxa1826, asr1802s, asr1803...).
Here we take 1826 (i.e. Nezha3) as a sample, others are similar.
Basically a new profile is created for a new hardware board or a new product model.
Steps needed:
----------------------------------------------------------------------------
1. Add a new profile entry in: "target/linux/mmp/pxa1826/profiles/marvell.mk"
For example:
"define Profile/NEZHA305
NAME:=NEZHA3-DKB Type A with Nand Flash
endef
$(eval $(call Profile,NEZHA305))
$(eval $(call Model,NEZHA305,pxa1826p305))
"
where NEZHA305 is your <profile_name>
2. Create a defconfig file in "config/" with desired configuration.
Meanwhile, create specific obm and uboot codes.
The typical steps are
~$ make distclean
~$ ./scripts/feeds update -a
~$ ./scripts/feeds install -a
~$ vi package/boot/obm-mmp/Makefile //need to add profile specific obm
~$ <add specific obm code and build instruction in Loader/Platforms/NZA3/DKB/make_loader_NZA3_LINUX.sh when necessary>
~$ vi package/boot/uboot-mmp/Makefile //need to add profile specific board type in uboot if a new one used here
~$ <add specific uboot code in uboot/board/Marvell/ and uboot/include/configs, also update board config in marvell/uboot/boards.cfg>
~$ cp config/defconfig_pxa1826 .config
~$ make menuconfig // choose the proper profile, bootloaders, pakcages,etc. then exit and save
~$ cp .config config/defconfig_<ARCH_PROFILE>
3. In "target/linux/mmp/image/Makefile":
Add new line: Image/BuildKernel/Profile/<profile_name>=$(call Image/Build/DTB,<dts_filename>)
and put it in:
"ifeq ($(CONFIG_TARGET_mmp_pxa1826),y)
Image/BuildKernel/Profile/NEZHA301=$(call Image/Build/DTB,pxa1826-dkb)
... ...
Image/BuildKernel/Profile/NEZHA305=$(call Image/Build/DTB,pxa1826-p305)
Image/BuildKernel/Profile/<profile_name>=$(call Image/Build/DTB,<dts_filename>)
endif"
4. In "rules.mk"
Add:
"ifeq ($(CONFIG_TARGET_mmp_pxa1826_<profile_name>),y)
export ARCH_PROFILE:=<profile_bin_dir_name>
export KERNEL_CONFIG_FILE_NAME_APPENDIX:=
#you can insert here any profile specific variables and use it in the openwrt makefiles
endif"
5. Add dts file for the board.
Create <dts_filename>.dts and put in /marvell/linux/arch/arm/boot/dts.
Next, in arch/arm/boot/dts/Makefile, add "<dts_filename>.dtb" to create dtb file:
"dtb-$(CONFIG_CPU_PXA1826) += pxa1826-dkb.dtb \
<dts_filename>.dtb"
6. Create the BLF files for under swd/NZA3/ for software download and OTA upgrade
7. Create profile sepcific setting files and telephony images at locations below,
~$ package/network/services/lte-telephony/files/nvm/<ARCH_PROFILE> //add fixed NV setting files, can't upgrade via OTA
~$ package/network/services/lte-telephony/files/tel-<if>.config //add telephony config file and update its Makefile
~$ <target/linux/mmp/files/mrd/> //add changeable NV setting files, which can be upgraded via OTA
~$ <target/linux/mmp/pxa1826/oem_fs/> //OEM can also put upgradeable NV settings files here if there is OEM partition
~$ <marvell/lte-telephony/cp/> //add new CP images if required
8. build the profile images and fix any error during the building process
==============================================================================================
Additonal steps (optional):
1. If you want to be able to identify your board from the console (e.g. TeraTerm),
Then, in file: "target/linux/mmp/base-files/lib/mmp.sh"
Function: mmp_board_detect()
You need to add a case for your board (profile).
==============================================================================================
Note:
On v2102 branch, the proman.sh script can help on
the step 1 to 4 above(i.e. only cover top repo changes) use existing profile as template,
Syntax: ./scripts/proman.sh add <template_profile> <chip> <name> <code>
e.g., ./scripts/proman.sh add asr1803p401 asr1828 KAGU 801
Affected files: rules.mk target/linux/mmp/Makefile target/linux/mmp/$CHIP config/defconfig_${CHIP}p$CODE
Limitations: obm-mmp, uboot-mmp and telephony packages need manual update.