1. 程式人生 > >Add a new module at fortuna source code.

Add a new module at fortuna source code.

pts gin search cto AD compile img describe 技術

This article describes how to add a new module at the fortuna source code.

  1. Change the makefile file at the topdir directory to add a new module compile option :

    技術分享圖片

    model variable describe the new module name(eg M2400), zebos variable describe the zebos version which the new module used.

  2. Add the board/M2400/kernel directory and following files:

    技術分享圖片

    Default.dts : describe the device tree which need to be loaded when the kernel boot up, include cpu, i2c, gpio, clock,when we add the new module, we need change this file。

    Defconfig : kernel default config file。

Ds_rules.make : the rule file for kernel, describe the cross compile options, include the build path, core jobs ..,when add the new module, need change this file.

  1. Add the board/M2400/kernel directory and following files:

    技術分享圖片

    Binary : when make the rootfs file system ,the makefile will copy the bin/sbin, scripts file from this directory, when add/delete a new command, we should change this directory.

    Rule402_MPLS.make : the rule.make file for zebos, the zebos related feature options is controlled at this file.

    Default_Rule.make : the rule.make file for ramdisk, the ramdisk compile option is controlled at this file.

    Makefile :mainly defined how to install the file when make the rootfs.

  2. Add the board/M2400/Rule.make,this file describe which directory is needed to be compile at the topdir:

    技術分享圖片

    Add board/M2400/ Makefile.switchconfig, this file descript the switch feature options.(ignore this step.)

    Add board/M2400/ Makefile.config, this file describe the check options before make config-ramdisk, mainly build some soft links for kernel, zebos, and cpu arch. When add a new module, we should change like below to build soft link for zebos rule.make.

    技術分享圖片

  3. Add M2400/bcmsdk directory and following files:

    技術分享圖片

    Makefile.config: this file describe the version and environment for sdk compile,different module need change this part。

    技術分享圖片

    Other files is sdk makefile and config file copied from related sdk.

  4. Under the kernel/drivers/dslib directory, include some peripheral device control method, when add a new module, we should search M2400_SFU_ID at this directory and add related new module.

    技術分享圖片

  5. Add M2400_peripheral.c file, the file is drive for slot part.:

    技術分享圖片

  6. Add port map file for new module:

    技術分享圖片

Add a new module at fortuna source code.