CMOS.layout guide

From coreboot
Jump to navigation Jump to search

The wiki is being retired!

Documentation is now handled by the same processes we use for code: Add something to the Documentation/ directory in the coreboot repo, and it will be rendered to https://doc.coreboot.org/. Contributions welcome!

CMOS layout

This page explain the workings of the CMOS layout file. The CMOS layout file can be linked into a board specific environment. By creating the cmos.layout file in the board directory. and set the HAVE_OPTION_TABLE in the Kconfig file of the board.

The CMOS layout file must contain the following sections;

  • entries
  • enumerations
  • checksums

The hash (#) character is the comment prefix, all characters until the end of line are treated as comment.

  • Page 0: 0 - 1024 128 Bytes
    • position bit 0 - bit 112 : RTC clock data
  • Page 1: 1025 - 2048 128 Bytes
    • user free space, not always available.


entries section

This section defined all the variables used within coreboot. Each line consists out of the following parameters;

 <start-bit> <bit-length> <config> <config-id> <parameter-name>

The parameter <start-bit> is the start position is bit position where the parameter get stored.

The parameter <bit-length> is the length in bits of the parameter.

The parameter <config> indicates the type of parameter, currently there are three known types;

    • r = register
    • e = enumeration
    • h = ? hide ?

The parameter <config-id> is used when the <config> is set to 'e', than there must be at least one item in the enumeration section. The <config-id> does not have to be unique, a <config-id> in the enumeration section can be used for different entries.

The parameter <parameter-name> is the name the coreboot retrieval and storage functions will refer to.

Example:

 0          384       r       0        reserved_memory
 384          3       e       5        baud_rate
 487          1       e       1        power_on_after_fail

enumerations section

Each line in the the enumerations section is contructed as follows;

 <config-id>  <value>  <label>

The parameter <config-id> is the same value as the <config-id> from the entries section.

The parameter <value> is the value that get stored at the bit location defined in the entries section, where that config-id is being used.

The parameter <label> is the label for displaying in the the presentation layer.

Example;

 1     0     Disable
 1     1     Enable
 5     0     115200
 5     1     57600
 5     2     38400
 5     3     19200
 5     4     9600
 5     5     4800
 5     6     2400
 5     7     1200

checksums section

The checksums section has one variable with three parameters;

 checksum <startbit> <endbit> <start-of-checksumbit>

The <startbit> parameter is the bit position where the calculation of the checksum starts from.

The <endbit> parameter is the bit position there the calculation of the checksum starts on.

The <start-of-checksumbit> parameter is the bit position there the checksum will be stored, there must be space for 16 bits of checksum data.

Example;

 checksum 392 983 984

Example cmos.layout file

 entries
 
 # <start-bit> <bit-length> <config> <config-id> <parameter-name>
 0             384          r        0           reserved_memory
 384           1            e        4           boot_option
 385           1            e        4           last_boot
 386           1            e        1           ECC_memory
 388           4            r        0           reboot_bits
 392           3            e        5           baud_rate
 395           1            e        1           hw_scrubber
 396           1            e        1           interleave_chip_selects
 397           2            e        8           max_mem_clock
 399           1            e        2           multi_core
 400           1            e        1           power_on_after_fail
 412           4            e        6           debug_level
 416           4            e        7           boot_first
 420           4            e        7           boot_second
 424           4            e        7           boot_third
 428           4            h        0           boot_index
 432           8            h        0           boot_countdown
 440           4            e        9           slow_cpu
 444           1            e        1           nmi
 445           1            e        1           iommu
 728         256            h        0           user_data
 984          16            h        0           check_sum
 # Reserve the extended AMD configuration registers
 1000         24            r        0           amd_reserved
 
 enumerations
 
 #<config-id>  <value>  <label>
 # for ECC_memory, hw_scrubber, interleave_chip_selects, power_on_after_fail, nmi, iommu
 1             0        Disable
 1             1        Enable
 # multi_core
 2             0        Enable
 2             1        Disable
 # boot_option, last_boot 
 4             0        Fallback
 4             1        Normal
 # baud_rate
 5             0        115200
 5             1        57600
 5             2        38400
 5             3        19200
 5             4        9600
 5             5        4800
 5             6        2400
 5             7        1200
 # debug_level
 6             6        Notice
 6             7        Info
 6             8        Debug
 6             9        Spew
 # boot_first,  boot_second, boot_third
 7             0        Network
 7             1        HDD
 7             2        Floppy
 7             8        Fallback_Network
 7             9        Fallback_HDD
 7             10       Fallback_Floppy
 7             3        ROM
 # max_mem_clock
 8             0        DDR400
 8             1        DDR333
 8             2        DDR266
 8             3        DDR200
 # slow_cpu
 9             0        off
 9             1        87.5%
 9             2        75.0%
 9             3        62.5%
 9             4        50.0%
 9             5        37.5%
 9             6        25.0%
 9             7        12.5%
 
 checksums
 #        <startbit> <endbit> <start-of-checksumbit>
 checksum 392        983      984