Skip to content

Evaluate use of devicetree #545

@crawfxrd

Description

@crawfxrd

Note: This refers to the devicetree specification, not coreboot devicetree.

Evaluate use of devicetree for declaring available/used hardware resources.

Determine if code generation can be done efficiently for MCS-51. Assembly output from SDCC must be inspected, not just any tool-generated C code. For example:

  • Avoiding pointer indirection and call depth due to limited stack space (<256 bytes)
  • Minimizing generated number of instructions due to limited code space (64 KiB without banking)

Would the fully generated DTS or DTB be useful to export? e.g. for:

  • Host tooling for configuring and validating boards
  • A board-specific UEFI driver for configuring the EC

Example

Because vendors make up their own 8051-based controllers and put most functionality in external registers, is it even worth adding architecture-level (8051/8052) devicetrees?

The EC/SoC would declare available resources and details on how to configure them in an include file (.dtsi).

// XXX: Use preprocessor so register names can be used instead of redeclaring the addresses?
//#include <registers.h>

/ {
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    soc {
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        pwm0: pwm@1802 {
            compatibile = "ite,it557x-pwm";
            reg = <0x1802 1     /* DCR */
                   0x180A 1     /* PWMPOL */
                   0x180C 1     /* PCSSG */
                   0x180F 1>;   /* PCSG */
            channel = <0>;
            status = "disabled";
        };
    };
};

The board would declare the full devicetree (.dts) by including relevant files and overriding resources (by alias) as needed.

/dts-v1/;

// XXX: Use C-style includes for preprocessor tool to generate path?
/include "../path/to/soc/ite/it5571.dtsi"

/ {
    model = "system76,darp10";
    compatible = "system76,darp10";
};

&pwm0 {
    // Keyboard brightness
    status = "okay";
};

What would generated code for this look like?

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions