How to add customised ATAG variable in U-Boot and Linux kernel?

前端 未结 3 1056
没有蜡笔的小新
没有蜡笔的小新 2020-12-25 08:36

I want to add customized atag variable in U-Boot and Linux kernel.
How can i achieve this?
Is there any procedure to add an ATAG variable i

3条回答
  •  抹茶落季
    2020-12-25 09:11

    The latest Linux kernel is attempting to obsolete ATAGS with device trees. However, the setup.h file defines the different ATAG values and structures. To parse these, you need to add them with something like,

    static int __init parse_tag_custom(const struct tag *tag)
    {
        if (tag->hdr.size > CUSTOM_SIZE) {
             /* Use, storing or acting on passed values */ 
             tag->u.custom;
        }
        return 0;
    }
    
    __tagtable(ATAG_CUSTOM, parse_tag_custom);
    

    as found in atags_parse.c. Of course, you need to add these to the values in setup.h.

    u-boot is probably less defined as for the most part, it passes arguments via the kernel command line as this is not ARM specific. A command argument or device trees is probably the preferred method. If you gave an example of what type of configuration you need, someone could probably give better guidance.

提交回复
热议问题