blob: dff67fec5644c7115d10314dd04b1ddc098b9d7f [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001How to add new profile for a subtarget
2========================================
3There are serveral subtargets in the target/linux/mmp (pxa1826, asr1802s, asr1803...).
4Here we take 1826 (i.e. Nezha3) as a sample, others are similar.
5
6Basically a new profile is created for a new hardware board or a new product model.
7
8Steps needed:
9----------------------------------------------------------------------------
101. Add a new profile entry in: "target/linux/mmp/pxa1826/profiles/marvell.mk"
11 For example:
12
13 "define Profile/NEZHA305
14 NAME:=NEZHA3-DKB Type A with Nand Flash
15 endef
16 $(eval $(call Profile,NEZHA305))
17 $(eval $(call Model,NEZHA305,pxa1826p305))
18 "
19
20 where NEZHA305 is your <profile_name>
21
222. Create a defconfig file in "config/" with desired configuration.
23 Meanwhile, create specific obm and uboot codes.
24
25 The typical steps are
26 ~$ make distclean
27 ~$ ./scripts/feeds update -a
28 ~$ ./scripts/feeds install -a
29 ~$ vi package/boot/obm-mmp/Makefile //need to add profile specific obm
30 ~$ <add specific obm code and build instruction in Loader/Platforms/NZA3/DKB/make_loader_NZA3_LINUX.sh when necessary>
31 ~$ vi package/boot/uboot-mmp/Makefile //need to add profile specific board type in uboot if a new one used here
32 ~$ <add specific uboot code in uboot/board/Marvell/ and uboot/include/configs, also update board config in marvell/uboot/boards.cfg>
33 ~$ cp config/defconfig_pxa1826 .config
34 ~$ make menuconfig // choose the proper profile, bootloaders, pakcages,etc. then exit and save
35 ~$ cp .config config/defconfig_<ARCH_PROFILE>
36
37
383. In "target/linux/mmp/image/Makefile":
39 Add new line: Image/BuildKernel/Profile/<profile_name>=$(call Image/Build/DTB,<dts_filename>)
40
41 and put it in:
42 "ifeq ($(CONFIG_TARGET_mmp_pxa1826),y)
43 Image/BuildKernel/Profile/NEZHA301=$(call Image/Build/DTB,pxa1826-dkb)
44 ... ...
45 Image/BuildKernel/Profile/NEZHA305=$(call Image/Build/DTB,pxa1826-p305)
46 Image/BuildKernel/Profile/<profile_name>=$(call Image/Build/DTB,<dts_filename>)
47 endif"
48
494. In "rules.mk"
50 Add:
51 "ifeq ($(CONFIG_TARGET_mmp_pxa1826_<profile_name>),y)
52 export ARCH_PROFILE:=<profile_bin_dir_name>
53 export KERNEL_CONFIG_FILE_NAME_APPENDIX:=
54 #you can insert here any profile specific variables and use it in the openwrt makefiles
55 endif"
56
575. Add dts file for the board.
58
59 Create <dts_filename>.dts and put in /marvell/linux/arch/arm/boot/dts.
60
61 Next, in arch/arm/boot/dts/Makefile, add "<dts_filename>.dtb" to create dtb file:
62
63 "dtb-$(CONFIG_CPU_PXA1826) += pxa1826-dkb.dtb \
64 <dts_filename>.dtb"
65
666. Create the BLF files for under swd/NZA3/ for software download and OTA upgrade
67
68
697. Create profile sepcific setting files and telephony images at locations below,
70
71 ~$ package/network/services/lte-telephony/files/nvm/<ARCH_PROFILE> //add fixed NV setting files, can't upgrade via OTA
72 ~$ package/network/services/lte-telephony/files/tel-<if>.config //add telephony config file and update its Makefile
73 ~$ <target/linux/mmp/files/mrd/> //add changeable NV setting files, which can be upgraded via OTA
74 ~$ <target/linux/mmp/pxa1826/oem_fs/> //OEM can also put upgradeable NV settings files here if there is OEM partition
75 ~$ <marvell/lte-telephony/cp/> //add new CP images if required
76
778. build the profile images and fix any error during the building process
78
79==============================================================================================
80Additonal steps (optional):
81
821. If you want to be able to identify your board from the console (e.g. TeraTerm),
83 Then, in file: "target/linux/mmp/base-files/lib/mmp.sh"
84 Function: mmp_board_detect()
85 You need to add a case for your board (profile).
86==============================================================================================
87Note:
88 On v2102 branch, the proman.sh script can help on
89 the step 1 to 4 above(i.e. only cover top repo changes) use existing profile as template,
90
91 Syntax: ./scripts/proman.sh add <template_profile> <chip> <name> <code>
92
93 e.g., ./scripts/proman.sh add asr1803p401 asr1828 KAGU 801
94
95 Affected files: rules.mk target/linux/mmp/Makefile target/linux/mmp/$CHIP config/defconfig_${CHIP}p$CODE
96
97 Limitations: obm-mmp, uboot-mmp and telephony packages need manual update.