blob: 410ab11e4f91a561b99d5af09a2d1daca89b5c2e [file] [log] [blame]
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"$schema": http://json-schema.org/draft-04/schema#
typeDefs:
bcs-file-name: &bcs_file_name
type: string
build-only-element: true
description: Name of the file located in BCS under the respective bcs-overlay.
deprecated_string: &deprecated_string
type: string
description: A deprecated string property to be removed after migration.
firmware-build-target: &firmware_build_target
type: string
description: Build target that will be considered dirty when building/testing
locally.
# TODO(shapiroc): Migrate to use system-file-v2 instead
system-file: &system_file
type: object
properties:
source:
description: Source of the file relative to the build system.
type: string
destination:
description: Installation path for the file on the system image.
type: string
additionalProperties: false
# V2 exists because system-file targets were poorly named, so they couldn't
# be logically shared for build-time and run-time usage.
# E.g. bluetooth config we want to both install and get the path at runtime
system-file-v2: &system_file_v2
type: object
properties:
build-path:
description: Source of the file relative to the build system.
build-only-element: true
type: string
system-path:
description: Installation path for the file on the system image.
type: string
additionalProperties: false
required:
- build-path
- system-path
firmware-file: &firmware_file
type: object
properties:
source:
description: Source of the file relative to the build system ${FILESDIR}
type: string
destination:
description: Installation path for the file on the system image.
type: string
symlink:
description: Symlink file that will be installed pointing to the destination.
type: string
additionalProperties: false
sku-id: &sku_id
description: "SKU/Board strapping pins configured during board manufacturing."
type: integer
minimum: -1
maximum: 0x7FFFFFFF
whitelabel-tag: &whitelabel_tag
description: "'whitelabel_tag' value set in the VPD, to add Whitelabel branding over an unbranded base model."
type: string
customization-id: &customization_id
description: "'customization_id' value set in the VPD for non-unibuild Zergs and Whitelabels. Deprecated for use in new products since 2017/07/26."
type: string
platform-name: &platform_name
description: "Defines the name that is reported by 'mosys platform name'
This is typically the reference design name with the first letter capitalized"
type: string
stylus-category: &stylus-category
description: "Denotes the category of stylus this device contains."
type: string
enum:
- none
- internal
- external
psu-type: &psu-type
description: |
Type of PSU the device has:
- battery: the device has a battery intended for primary use
- AC_primary: the device has a battery, but it is not intended for primary use
- AC_only: the device has no battery
- no_power: the device does not receive power in any direct manner (e.g., it is virtualized)
type: string
enum:
- battery
- AC_primary
- AC_only
- no_power
display-type: &display-type
description: "Denotes the type of display this device contains."
type: string
enum:
- default
- old
wifi-transmit-power-chain: &wifi-transmit-power-chain
description: "WiFi power chain"
type: object
properties:
limit-2g:
description: "2G band power limit (dBm)"
type: integer
minimum: 0x0
maximum: 0xFF
limit-5g-1:
description: "5G band 1 power limit (dBm)"
type: integer
minimum: 0x0
maximum: 0xFF
limit-5g-2:
description: "5G band 2 power limit (dBm)"
type: integer
minimum: 0x0
maximum: 0xFF
limit-5g-3:
description: "5G band 3 power limit (dBm)"
type: integer
minimum: 0x0
maximum: 0xFF
limit-5g-4:
description: "5G band 4 power limit (dBm)"
type: integer
minimum: 0x0
maximum: 0xFF
type: object
properties:
chromeos:
type: object
properties:
configs:
type: array
items:
type: object
properties:
arc:
type: object
properties:
build-properties:
type: object
properties:
product:
description: Product name to report in 'ro.product.name'.
This may be the device name, or it can be something else, to allow
several devices to be grouped into one product.
type: string
device:
description: Device name to report in 'ro.product.device'. This
is often '{product}_cheets' but it can be something else if
desired.
type: string
oem:
description: Original Equipment Manufacturer for this model. This
generally means the OEM name printed on the device.
type: string
marketing-name:
description: Name of this model as it is called in the
market, reported in 'ro.product.model'. This often starts
with '{oem}'.
type: string
metrics-tag:
description: Tag to use to track metrics for this model.
The tag can be shared across many devices if desired, but
this will result in larger granularity for metrics
reporting. Ideally the metrics system should support
collation of metrics with different tags into groups, but if
this is not supported, this tag can be used to achieve the
same end. This is reported in 'ro.product.metrics.tag'.
type: string
first-api-level:
description: |
The first Android API level that this model shipped with.
type: string
pai-regions:
description: |
(Optional) Comma-separated allow list of region codes
that can be appended to 'ro.oem.key1' for the purpose of
targeting Play Auto Install applications by region. The
value(s) should match the values that would be returned
by `cros_region_data region_code` for the relevant
region(s). If the device's region code is not in the
allow list, or if there is no allow list, 'ro.oem.key1'
will not include the region code. The allow list can
also be a single '*' character to indicate that the
region code should always be appended.
type: string
pattern: "(^([a-zA-Z0-9\\.\\-]+,)*[a-zA-Z0-9\\.\\-]+$)|(^\\*$)"
additionalProperties: false
files:
type: array
build-only-element: true
items: *system_file
additionalProperties: false
audio:
type: object
properties:
main:
type: object
properties:
cras-config-dir:
description: Subdirectory for model-specific configuration.
type: string
disable-profile:
description: Optional --disable_profile parameter for CRAS deamon.
type: string
ucm-suffix:
description: Optional UCM suffix used to determine model specific
config.
type: string
files:
type: array
build-only-element: true
items: *system_file
additionalProperties: false
required:
- cras-config-dir
additionalProperties: false
required:
- main
bluetooth:
type: object
properties:
config: *system_file_v2
flags:
type: object
properties:
enable-suspend-management:
description: Enable powerd suspend management callbacks.
type: boolean
# TODO(abhishekpandit) - Remove once no longer used
stop-on-suspend:
description: Stop the bluetooth adapter on suspend and start it on resume.
type: boolean
reset-on-resume:
description: Expect bluetooth chip to have reset on resume.
type: boolean
additionalProperties: false
additionalProperties: false
required:
- config
wifi:
type: object
properties:
tablet-mode-power-table: *wifi-transmit-power-chain
non-tablet-mode-power-table: *wifi-transmit-power-chain
brand-code:
description: Brand code of the model (also called RLZ code).
type: string
camera:
type: object
properties:
count:
type: integer
description: Specified the number of cameras on the model.
config-path:
type: string
description: Specified the camera configuration file path on the model.
clock:
type: string
description: Specified the camera clock on the model.
enum:
- monotonic
- boottime
additionalProperties: false
fingerprint:
type: object
description: Contains details about the model's fingerprint implementation.
properties:
board:
type: string
description: Specifies the fingerprint board in use.
sensor-location:
description: Specifies the location of the fingerprint sensor.
type: string
enum:
- none # Explicitly not supported.
- power-button-top-left
- keyboard-top-right
- keyboard-bottom-right
fingerprint-sensor-type:
description: Type of FP sensor. Currently describes whether FP
is overlapped on the power button or not.
type: string
enum:
- stand-alone
- on-power-button
additionalProperties: false
firmware:
type: object
properties:
bcs-overlay:
description: BCS overlay path used to determine BCS file path for binary
firmware downloads.
type: string
build-only-element: true
build-targets:
type: object
build-only-element: true
properties:
base:
description: Build target of the base EC firmware for a detachable device,
that will be considered dirty when building/testing
type: string
ec_extras:
type: array
items:
type: string
description: Extra EC build targets to build within chromeos-ec.
coreboot: *firmware_build_target
cr50: *firmware_build_target
depthcharge: *firmware_build_target
ec: *firmware_build_target
ish: *firmware_build_target
libpayload: *firmware_build_target
u-boot: *firmware_build_target
additionalProperties: false
ec-ro-image: *bcs_file_name
pd-ro-image: *bcs_file_name
key-id:
description: Key ID from the signer key set that is used to sign the
given firmware image.
type: string
build-only-element: true
main-ro-image: *bcs_file_name
main-rw-image: *bcs_file_name
name:
description: This is a human-recognizable name used to refer to the firmware.
It will be used when generating the shellball via firmware packer.
Mainly, this is only for compatibility testing with device tree (since DT
allowed firmwares to be named).
type: string
build-only-element: true
image-name:
description: The name of the firmware image used by the
firmware updater. Typically the device name, but can differ
when a device may have two or more different firmware
images.
type: string
build-only-element: false
no-firmware:
description: If present this indicates that this model has no firmware at present.
This means that it will be omitted from the firmware updater
(chromeos-firmware- ebuild) and it will not be included in the signer
instructions file sent to the signer.
This option is often useful when a model is first added,
since it may not have firmware at that point.
type: boolean
build-only-element: true
additionalProperties: false
firmware-signing:
type: object
build-only-element: true
properties:
key-id:
description: Key ID from the signer key set that is used to sign the
given firmware image.
type: string
signature-id:
description: ID used to generate keys/keyblocks in the firmware
signing output. This is also the value provided to mosys platform
signature for the updater4.sh script.
type: string
sig-id-in-customization-id:
description: Indicates that this model cannot be decoded by the mapping table.
Instead the model is stored in the VPD (Vital Product Data) region in the
customization_id property. This allows us to determine the
model to use in the factory during the finalization stage. Note
that if the VPD is wiped then the model will be lost. This may
mean that the device will revert back to a generic model, or
may not work. It is not possible in general to test whether the
model in the VPD is correct at run-time. We simply assume that
it is. The advantage of using this property is that no hardware
changes are needed to change one model into another. For example
we can create 20 different whitelabel boards, all with the same
hardware, just by changing the customization_id that is written
into SPI flash.
type: boolean
required:
- key-id
- signature-id
additionalProperties: false
detachable-base:
type: object
description: "Contains the configuration for the hammerd which
is used to update the detachable base firmware."
properties:
ec-image-name:
description: "The target EC binary name which is placed under
/lib/firmware."
type: string
touch-image-name:
description: "The touchpad binary name which is placed under
/lib/firmware. This is only needed if the detachable base
contains touchpad."
type: string
vendor-id:
description: "The Vendor ID of the detachable base. This
value can be queried by command 'lsusb'.
By taking this as an example:
Bus 001 Device 032: ID 18d1:503c Google Inc.
the vendor-id is 6353(=0x18d1)."
type: integer
product-id:
description: "The Product ID of the detachable base. This
value can be queried by command 'lsusb'.
By taking this as an example:
Bus 001 Device 032: ID 18d1:503c Google Inc.
the product-id is 20540(=0x503c)."
type: integer
usb-path:
description: "Searches and finds the idVendor and idProduct
under sysfs /sys/bus/usb/devices/* which matches the
vendor-id and product-id. By taking this as an example:
'/sys/bus/usb/devices/1-1.1'
The usb-path is '1-1.1'."
type: string
files:
type: array
build-only-element: true
items: *firmware_file
additionalProperties: false
identity:
type: object
description: Defines attributes that are used by cros_config to detect the identity
of the platform and which corresponding config should be used.
This tuple must either contain x86 properties only or ARM properties only.
oneOf:
- properties:
smbios-name-match:
description: "[x86] Firmware name built into the firmware and reflected back
out in the SMBIOS tables."
type: string
sku-id: *sku_id
platform-name: *platform_name
customization-id: *customization_id
whitelabel-tag: *whitelabel_tag
additionalProperties: false
- properties:
device-tree-compatible-match:
description: "[ARM] String pattern (partial) that is matched against the
contents of /proc/device-tree/compatible on ARM devices."
type: string
sku-id: *sku_id
platform-name: *platform_name
customization-id: *customization_id
whitelabel-tag: *whitelabel_tag
additionalProperties: false
name:
type: string
pattern: "^[_a-zA-Z0-9]{3,}"
description: Unique name for the given model.
power:
description: WARNING -- This config contains unvalidated settings, which is not a
correct usage pattern, but this will be used in the interim until a longer term
solution can be put in place where the overall schema can be single sourced
(for the YAML and C++ that uses it); likely though some type of code generation.
SUMMARY -- Contains power_manager device settings. This is the new mechanism used
in lieu of the previous file based implementation (via powerd-prefs).
Power manager will first check for a property in this config, else it will revert
to the file based mechanism (via the powerd-prefs setting).
This provides more flexibility in sharing power settings across different devices
that share the same build overlay.
Any property can be overridden from - src/platform2/power_manager/default_prefs or
src/platform2/power_manager/optional_prefs
For details about each setting property, see -
src/platform2/power_manager/common/power_constants.h
For examples on setting these properties (including multiline examples), see
the power config example in libcros_config/test.yaml
type: object
properties:
touchpad-wakeup:
description: Enable (1) or disable (0) wake from touchpad.
type: string
pattern: "^[01]$"
additionalProperties: true
powerd-prefs:
description: Powerd config that should be used.
type: string
test-label:
description: Test alias (model) label that will be applied in Autotest and
reported for test results.
type: string
thermal:
type: object
properties:
dptf-dv:
description: System image path to the .dv file containing DPTF (Dynamic Platform
and Thermal Framework) settings.
type: string
files:
type: array
build-only-element: true
items: *system_file
additionalProperties: false
required:
- files
touch:
type: object
properties:
present:
description: Whether touch is present or needs to be probed for.
type: string
enum:
# Put these in quotes to avoid them meaning True / False
- "yes"
- "no"
- probe
probe-regex:
description: If probe is set, the regex used to look for touch.
type: string
files:
type: array
build-only-element: true
items: *firmware_file
additionalProperties: false
wallpaper:
description: Base filename of the default wallpaper to show on this device.
type: string
regulatory-label:
description: Base name of the directory containing the regulatory label
files to show on this device.
type: string
ui:
type: object
properties:
power-button:
type: object
properties:
edge:
type: string
enum:
- left
- right
- top
- bottom
position:
type: string
additionalProperties: false
side-volume-button:
description: Defines the position of the side volume button. `region` indicates
whether the button is at the side of the "screen" or "keyboard" of the device.
`side` indicates which edge the button is anchored to while the device in
landscape primary screen orientation. It can be "left", "right", "top",
"bottom".
type: object
properties:
region:
type: string
enum:
- keyboard
- screen
side:
type: string
enum:
- left
- right
- top
- bottom
additionalProperties: false
additionalProperties: false
oem-id:
description: |
Some projects store SKU ID, OEM ID and Board Revision in an
EEPROM and only SKU ID can be updated in the factory and RMA
flow but others should be pre-flashed in the chip level. In
this case, we would like to validate whether oem-id here from
the updated SKU ID matches the one in the EEPROM so we can
prevent this device from being updated to another OEM's devices.
type: string
pattern: "[0-9]+"
modem:
type: object
properties:
firmware-variant:
description: Variant of the modem firmware to be used. This
value is read by modemfwd to match against the variant field
of a firmware entry in a firmware manifest. In most cases,
we simply use the model name as the value.
type: string
additionalProperties: false
hardware-properties:
type: object
description: Contains boolean flags or enums for hardware properties
of this board, for example if it's convertible, has a touchscreen,
has a camera, etc. This information is used to auto-generate C
code that is consumed by the EC build process in order to do
run-time configuration. If a value is defined within a config
file, but not for a specific model, that value will be assumed
to be false for that model. If a value is an enum and is not
specified for a specific model, it will default to "none".
All properties must be booleans or enums. If non-boolean
properties are desired, the generation code in
cros_config_schema.py must be updated to support them.
properties:
is-lid-convertible:
description: Can the lid be rotated 360 degrees.
type: boolean
has-lid-accelerometer:
description: Is there an accelerometer in the lid of the
device.
type: boolean
has-base-accelerometer:
description: Is there an accelerometer in the base of the
device.
type: boolean
has-lid-gyroscope:
description: Is there a gyroscope in the lid of the device.
type: boolean
has-base-gyroscope:
description: Is there a gyroscope in the base of the device.
type: boolean
has-lid-magnetometer:
description: Is there a magnetometer in the lid of the device.
type: boolean
has-base-magnetometer:
description: Is there a magnetometer in the base of the device.
type: boolean
has-base-light-sensor:
description: Is there a light sensor in the base of the device.
type: boolean
has-lid-light-sensor:
description: Is there a light sensor in the lid of the device.
type: boolean
has-touchscreen:
description: Does the device have a touchscreen.
type: boolean
display-type: *display-type
stylus-category: *stylus-category
psu-type: *psu-type
additionalProperties: false
additionalProperties: false
required:
- firmware
- name
additionalProperties: false
required:
- configs