Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script/dts: Generate Extended Device Tree database #9876

Closed
wants to merge 27 commits into from

Commits on Oct 25, 2018

  1. dts/bindings: Add yaml field 'type' for generic zephyr type

    Add new 'type' field in dts yaml bindings. It is meant to
    provide zephyr generic device type (i2c, spi, ...).
    This information could be used for various operations that
    require to have information on the generic type of a device
    or a compatible (CI triage, board documentation, ...)
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    4cff225 View commit details
    Browse the repository at this point in the history
  2. scripts/dts: Introduce edts.json generation

    Introduce python class for extended device tree database generation
    and extraction.
    Extended device tree database is a json formatted database.
    It contains python like dict representation of device tree information
    amended with zephyr yaml bindings.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    43c8aa5 View commit details
    Browse the repository at this point in the history
  3. scripts: extract_dts_includes.py: create EDTS database for codegen

    Create extended DTS database to be used by codegen and others.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    b0661 authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    63244bb View commit details
    Browse the repository at this point in the history
  4. scripts: extract_dts_includes.py: extract compatible to EDTS database

    Get compatible info available by EDTS.
    This way the compatible info of all activated devices can be used in
    drivers.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    ea8b4a5 View commit details
    Browse the repository at this point in the history
  5. scripts: edts: Add api to get device_ids based on compat

    Added get_device_ids_by_compatible to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    d901a41 View commit details
    Browse the repository at this point in the history
  6. scripts: extract_dts_includes.py: extract reg to EDTS database

    Extend reg directive handling to fill the EDTS datanbase.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    b0661 authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    15a768e View commit details
    Browse the repository at this point in the history
  7. scripts: extract_dts_includes.py: extract interrupts to EDTS database

    Extend interrupts directive handling to fill the EDTS database.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    b0661 authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    e17748b View commit details
    Browse the repository at this point in the history
  8. scripts: extract_dts_includes.py: default extract to EDTS database

    Extend default directive handling to fill the EDTS database.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    b0661 authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    83998ee View commit details
    Browse the repository at this point in the history
  9. scripts: edts: Add api to get device_id based on label

    Added get_device_id_by_label to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    45205b1 View commit details
    Browse the repository at this point in the history
  10. scripts: extract_dts_includes.py: extract clocks to EDTS database

    Extend clocks directive handling to fill the EDTS database.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    b0661 authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    d8d0c81 View commit details
    Browse the repository at this point in the history
  11. scripts: extract_dts_includes.py: extract heuristics to EDTS database

    Extend directive handling to use heuristics to fill the EDTS database.
    
    heuristics was called when treating 'compatible' property
    on the assumption it is mandatory.
    Actually some nodes (children) don't have 'compatible', so
    move heuristics out or properties parsing and process them
    just before node properties treatment.
    
    Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    363bd47 View commit details
    Browse the repository at this point in the history
  12. scripts: extract_dts_includes: extract gpios to EDTS database

    Extract gpio property for injection in EDTS.
    Cleanup no more needed function from extract_dts_includes script
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    30a0c21 View commit details
    Browse the repository at this point in the history
  13. scripts: edts: Add api to get list of compatiables

    Added get_compatibles to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    499cde0 View commit details
    Browse the repository at this point in the history
  14. scrpits/dts: edts: add alias treatment for edts generation

    Add an 'aliases' dict within generated edts.json and
    fill in alias information when required in device-struct.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    08e0f55 View commit details
    Browse the repository at this point in the history
  15. scripts: edts: Add api to get list of aliases

    Added get_aliases to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    a834556 View commit details
    Browse the repository at this point in the history
  16. scripts/dts: edts: insert chosen to edts database

    Add chosen structure ti edts database
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    6a4642a View commit details
    Browse the repository at this point in the history
  17. scripts: edts: Add api to get list of chosen

    Added get_chosen to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    a147b26 View commit details
    Browse the repository at this point in the history
  18. scripts/dts: edts: insert 'status' node property

    Add 'status' in edts devices struct when available.
    This operation is done as part of default class and called
    before usual properties parsing since 'status' property
    doesn't have binding.
    Default class is modified in order not to generate #define
    if def_label is set to None (hence limited to edts injection).
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    f01fd32 View commit details
    Browse the repository at this point in the history
  19. scripts/edts: inject device-type in edts database.

    Extract and inject zephyr generic device-type in edts database.
    This information is extracted from dts yaml bindings 'type' field.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    fb36ebe View commit details
    Browse the repository at this point in the history
  20. scripts: edts: Add api to get list of device types

    Added get_device_types to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    fc93e18 View commit details
    Browse the repository at this point in the history
  21. scripts: edts: Fill-in 'controllers' views

    Fill-in controllers hierarchy in edts database.
    Aim is to provide a per controller complete hierarchized view
    of the various controller types.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    14250f3 View commit details
    Browse the repository at this point in the history
  22. scripts: edts: Add api to get list of controllers

    Added get_controllers to EDTSConsumerMixin
    
    Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
    galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    4c095e1 View commit details
    Browse the repository at this point in the history
  23. scripts/dts: edts: Get children at their parent's

    Nodes without compatible are children of ancestor node.
    We want to inject these node in a children dict of parent node.
    In order to detect them more easily split get_compat function
    into get_node_compat and get_parent_compat.
    Then, function generate_node_definitions in extract_dts_includes
    script is modified to parse parents first then children so parents
    are injected in edts first and ready to welcome their children.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    cdc92ea View commit details
    Browse the repository at this point in the history
  24. scripts/dts: edts: generate a unique id for each device

    Generate a unique_id with the following format for each device:
    <PARENT>_<COMPAT_PARENT>_<ADDRESS_NODE>_<COMPAT_NODE_ADDRESS>
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    b334f55 View commit details
    Browse the repository at this point in the history
  25. dts: bindings: Add basic bindings dedicated to dts validation

    Add 'refsoc' yaml dts bindings.
    These bindings will be used in a refboard dts file which will
    be the reference for dts/edts sanity checks.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    b3a4bd9 View commit details
    Browse the repository at this point in the history
  26. boards: Add refboard dummy board

    Aim of this board is to provide a reference device tree that
    will be used for dts/edts scripts sanity check.
    While in theory this board does not use ARM architecture and should
    have its own 'ref' arch, it is set under arm/ right now in order
    to avoid providing a dedicated dummy arch.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    51b1f07 View commit details
    Browse the repository at this point in the history
  27. scripts/dts: provide edts sanity check scripts

    Validate generated etds.json against a reference edts file.
    Script first checks edts structure then content of various elements
    and finally devices parameters values.
    This last step is done using a specific method for ref_edts
    parameter extraction so we can verify behavior of
    edtsdatabase class extraction function.
    
    Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
    erwango authored and galak committed Oct 25, 2018
    Configuration menu
    Copy the full SHA
    88155ce View commit details
    Browse the repository at this point in the history