tree: 16f650fe9fd9a222137f0d66cfa5783961ee0029 [path history] [tgz]
  1. README.md
  2. bindings/
  3. brand_config.star
  4. build_target.star
  5. component.star
  6. config_bundle.star
  7. design.star
  8. device_brand.star
  9. docgen/
  10. generate.star
  11. hw_topology.star
  12. partner.star
  13. program.star
  14. sw_config.star
util/README.md

Config API Reference

Updating this Reference

This reference is automatically generated based on Starlark docstrings. If you change a Starlark util function, run util/docgen/generate.sh to regenerate. A few tips:

  • Templating is based on Go‘s text/template package. Usually, the contents this template file won’t need to be changed in order to regenerate.

  • Generation is based on docstrings, not the actual Starlark signatures. Thus, an “Args” section needs to be specified in the docstring in order for args to be picked up. Similarly, a “Returns” section needs to be specified in the docstring for returns to get picked up.

  • Specify “Required.” after an argument to make it a required argument in the generated documentation.

//config/util/brand_config.star

brand_config.create

Builds a BrandConfig proto.

brand_config.create(device_brand_id, wallpaper = None, whitelabel_tag = None)

Arguments

Returns

A BrandConfig proto.

//config/util/build_target.star

build_target.create

Builds a BuildTarget proto.

build_target.create(
    # Required arguments.
    name,

    # Optional arguments.
    overlay_name = None,
    arc_device = None,
    first_api_level = None,
)

Arguments

  • name: Name of the build target, e.g. “galaxy”. Required.
  • overlay_name: Name of the Portage overlay, e.g. “overlay-galaxy-private”. If not specified, “name” is used.
  • arc_device: Device name to report in ‘ro.product.device’. If not specified, “name”_cheets is used.
  • first_api_level: The first Android API level that this build shipped with.

Returns

A BuildTarget proto.

//config/util/component.star

comp.create_soc_family

Builds a Component.Soc.Family proto.

comp.create_soc_family()

comp.create_soc_model

Builds a Component proto for an Soc.

comp.create_soc_model()

comp.create_bt

Builds a Component proto for Bluetooth.

comp.create_bt()

comp.create_display_panel

Builds a Component.DisplayPanel proto for touchscreen.

comp.create_display_panel()

comp.create_touchscreen

Builds a Component.Touch proto for touchscreen.

comp.create_touchscreen()

comp.create_touchpad

Builds a Component.Touch proto for touchpad.

comp.create_touchpad()

comp.create_wifi

Builds a Component proto for Wifi.

comp.create_wifi()

comp.create_qual

Builds a Component.Qualification proto.

comp.create_qual()

comp.create_quals

Builds a Component.Qualification proto for each of component_ids.

comp.create_quals()

comp.create_usb

Builds a Interface.Usb proto.

comp.create_usb()

comp.create_pci

Builds a Interface.Pci proto.

comp.create_pci()

comp.append_display_panel

comp.append_display_panel()

comp.append_touchpad

comp.append_touchpad()

comp.append_touchscreen

comp.append_touchscreen()

//config/util/config_bundle.star

config_bundle.create

Builds a ConfigBundle proto.

config_bundle.create()

//config/util/design.star

design.append_configs

Creates and appends new SW and HW configs.

Create new Software and Hardware Design Configuration with the specified properties and then append them to the sw_configs and hw_configs arrays respectively. This ensures that all IDs are consistent.

design.append_configs()

design.create_constraint

Builds a Design.Config.Constraint proto.

design.create_constraint()

design.create_constraints

Builds a Design.Config.Constrain proto for each of hw_features.

design.create_constraints()

design.create_design_id

Builds a DesignId proto.

design.create_design_id()

design.create_design

Builds a Design proto.

design.create_design()

design.create_design_list

Builds a DesignList proto.

design.create_design_list()

design.generate

Serializes a ConfigBundle to a file.

A json proto is written. Note that there is some post processing done by the gen_config script to convert this json output into a json output that uses ints for encoding enums.

design.generate()

//config/util/device_brand.star

device_brand.create

Builds a DeviceBrand proto.

device_brand.create()

device_brand.create_list

Builds a DeviceBrandList proto.

device_brand.create_list()

//config/util/hw_topology.star

hw_topo.create_design_features

Builds a HardwareFeatures proto with form_factor.

hw_topo.create_design_features()

hw_topo.create_features

Builds a HardwareFeatures proto for each of form_factors.

hw_topo.create_features()

hw_topo.create_screen

Builds a Topology proto for a screen.

hw_topo.create_screen()

hw_topo.create_form_factor

Builds a Topology proto for a form factor.

hw_topo.create_form_factor(
    # Required arguments.
    form_factor,

    # Optional arguments.
    fw_configs = None,
    id = None,
    description = None,
)

Arguments

  • form_factor: A FormFactorType enum. Required.
  • fw_configs: A list of FirmwareConfiguration protos for the form factor.
  • id: A string identifier for the Topology. If not passed, a default is provided based on form_factor.
  • description: An English description for the Topology. If not passed, a default is provided based on form_factor.

hw_topo.create_audio

Builds a Topology proto for audio.

hw_topo.create_audio()

hw_topo.create_stylus

Builds a Topology proto for a stylus.

hw_topo.create_stylus()

hw_topo.create_keyboard

Builds a Topology proto for a keyboard.

hw_topo.create_keyboard(
    # Required arguments.
    backlight,
    pwr_btn_present,
    kb_type,

    # Optional arguments.
    fw_configs = None,
    id = None,
    description = None,
)

Arguments

  • backlight: True if a backlight is present. Required.
  • pwr_btn_present: True if a power button is present. Required.
  • kb_type: A KeyboardType enum. Required.
  • fw_configs: A list of FirmwareConfiguration protos for the form factor.
  • id: A string identifier for the Topology. If not passed, a default is provided.
  • description: An English description for the Topology. If not passed, a default is provided.

hw_topo.create_thermal

Builds a Topology proto for thermal.

hw_topo.create_thermal()

hw_topo.create_camera

Builds a Topology proto for a camera.

hw_topo.create_camera()

hw_topo.create_sensor

Builds a Topology proto for accelerometer/gyroscrope/magnometer sensors.

hw_topo.create_sensor()

hw_topo.create_fingerprint

Builds a Topology proto for a fingerprint reader.

hw_topo.create_fingerprint()

hw_topo.create_proximity_sensor

Builds a Topology proto for a proximity sensor.

hw_topo.create_proximity_sensor()

hw_topo.create_daughter_board

Builds a Topology proto for a daughter board.

hw_topo.create_daughter_board()

hw_topo.create_non_volatile_storage

Builds a Topology proto for non-volatile storage.

hw_topo.create_non_volatile_storage()

hw_topo.create_ram

Builds a Topology proto for RAM.

hw_topo.create_ram()

hw_topo.create_wifi

Builds a Topology proto for a WiFi chip.

hw_topo.create_wifi()

hw_topo.create_lte_board

Builds a Topology proto for a LTE board.

hw_topo.create_lte_board()

hw_topo.create_sd_reader

Builds a Topology proto for a SD reader.

hw_topo.create_sd_reader()

hw_topo.create_motherboard_usb

Builds a Topology proto for a motherboard.

hw_topo.create_motherboard_usb()

hw_topo.create_bluetooth

Builds a Topology proto for bluetooth.

hw_topo.create_bluetooth()

hw_topo.create_barreljack

Builds a Topology proto for barreljack.

hw_topo.create_barreljack()

hw_topo.create_hardware_topology

Builds a HardwareTopology proto from Topology protos.

hw_topo.create_hardware_topology()

hw_topo.create_power_button

Builds a Topology proto for a power button.

hw_topo.create_power_button(
    # Required arguments.
    region,
    edge,
    position,

    # Optional arguments.
    id = None,
    description = None,
)

Arguments

  • region: A HardwareFeatures.Button.Region enum. Required.
  • edge: A HardwareFeatures.Button.Edge enum. Required.
  • position: The percentage for button center position to the display‘s width/height in primary landscape screen orientation. If edge is LEFT or RIGHT, specifies the button’s center position as a fraction of region's height relative to the top of region. For TOP and BOTTOM, specifies the position as a fraction of region width relative to the left side of region. Must be in the range [0.0, 1.0]. Required.
  • id: A string identifier for the Topology. If not passed, a default is provided.
  • description: An English description for the Topology. If not passed, a default is provided.

hw_topo.create_volume_button

Builds a Topology proto for a volume button.

hw_topo.create_volume_button(
    # Required arguments.
    region,
    edge,
    position,

    # Optional arguments.
    id = None,
    description = None,
)

Arguments

  • region: A HardwareFeatures.Button.Region enum. Required.
  • edge: A HardwareFeatures.Button.Edge enum. Required.
  • position: The percentage for button center position to the display‘s width/height in primary landscape screen orientation. If edge is LEFT or RIGHT, specifies the button’s center position as a fraction of region's height relative to the top of region. For TOP and BOTTOM, specifies the position as a fraction of region width relative to the left side of region. Must be in the range [0.0, 1.0]. Required.
  • id: A string identifier for the Topology. If not passed, a default is provided.
  • description: An English description for the Topology. If not passed, a default is provided.

hw_topo.convert_to_hw_features

Converts a HardwareTopology proto to a HardwareFeatures proto.

hw_topo.convert_to_hw_features()

hw_topo.make_fw_config

Builds a HardwareFeatures.FirmwareConfiguration proto.

Takes a 32-bit mask for the field and an id. Shifts the id into the mask region and checks that the value fits within the bit mask.

hw_topo.make_fw_config()

//config/util/partner.star

partner.create

Builds a Partner proto.

partner.create()

partner.create_list

Builds a PartnerList proto.

partner.create_list()

//config/util/program.star

program.create

Builds a Program proto.

program.create()

program.create_list

Builds a ProgramList proto.

program.create_list()

program.create_firmware_configuration_segment

Builds a FirmwareConfigurationSegment proto.

program.create_firmware_configuration_segment()

program.create_design_config_id_segment

Builds a DesignConfigIdSegment proto.

program.create_design_config_id_segment()

program.create_signer_config

Builds a DeviceSignerConfig proto.

program.create_signer_config()

program.create_signer_config_by_brand

program.create_signer_config_by_brand()

program.create_signer_configs_by_brand

program.create_signer_configs_by_brand()

program.create_signer_config_by_design

program.create_signer_config_by_design()

program.create_signer_configs_by_design

program.create_signer_configs_by_design()

program.generate

Serializes a ConfigBundle to a file.

A json proto is written. Note that there is some post processing done by the gen_config script to convert this json output into a json output that uses ints for encoding enums.

program.generate()

//config/util/sw_config.star

sw_config.create

Deprecated. Use append_configs instead.

sw_config.create()

sw_config.create_audio

Builds an AudioConfig proto.

sw_config.create_audio()

sw_config.create_bluetooth

Builds a BluetoothConfig proto.

sw_config.create_bluetooth()

sw_config.create_x86_id_scan

Deprecated. Use design.append_configs

sw_config.create_x86_id_scan()

sw_config.create_arm_id_scan

Deprecated. Use design.append_configs

sw_config.create_arm_id_scan()

sw_config.create_fw_version

Builds a firmware Version proto.

If major_version is not specified, None is returned.

sw_config.create_fw_version()

sw_config.create_fw_payload

Builds a FirmwarePayload proto.

sw_config.create_fw_payload()

sw_config.create_fw_config

Builds a FirmwareConfig proto.

sw_config.create_fw_config()

sw_config.create_fw_payloads_by_names

Builds a FirmwareConfig proto using common naming patterns.

sw_config.create_fw_payloads_by_names()

sw_config.create_fw_build_config

Builds a FirmwareBuildConfig proto.

sw_config.create_fw_build_config()

sw_config.create_fw_build_config_by_names

Builds a FirmwareBuildConfig proto using common naming patterns.

Build targets are set to be coreboot_name unless they are otherwise specified, e.g. depthcharge is set to coreboot_name unless depthcharge_name is specified. This function is provided as a convenience, as different firmware build targets often share the same name.

sw_config.create_fw_build_config_by_names()

sw_config.create_fw_build_targets

Builds a FirmwareBuildConfig.BuildTargets proto.

sw_config.create_fw_build_targets()

sw_config.create_power

Builds a PowerConfig proto.

sw_config.create_power()