Difference between revisions of "Creating A devicetree.cb"

From coreboot
Jump to navigation Jump to search
(Outline)
 
(11 intermediate revisions by the same user not shown)
Line 3: Line 3:
== What you will need ==
== What you will need ==


* '''lspci -nvvv''' output
While running GNU/Linux on the vendor BIOS, collect the output from:
 
* '''dmesg'''
* '''lspci -ntvvv'''
* '''cat /proc/ioports'''
 
If you have support for your board in '''serialice''' you may wish to gather its output also.
 
== Reading '''lspci''' output ==
 
The Peripheral Component Interconnect ('''PCI''') is a standerdized local bus for attaching different hardwares to motherboard.
 
The '''lspci''' command reads the bus information and topology, its output format is given by example:
 
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
+------ +----------------------  +--------------------------------------------------------------
^      ^                        ^
|      |                        |
|      |                        Field 3: Name of device attached and its manufactured company name.
|      Field 2: PCI slot name.
Field 1: PCI bus slot number.


== Introduction ==
== Introduction ==
Line 13: Line 33:
When a device in '''devicetree.cb''' is found during the coreboot PCI/system scan process the functions to do customized initialization are called via the '''device_operations''' and the '''chip_operations''' structures. You will find these structures in the devices source files.
When a device in '''devicetree.cb''' is found during the coreboot PCI/system scan process the functions to do customized initialization are called via the '''device_operations''' and the '''chip_operations''' structures. You will find these structures in the devices source files.


== Keywords ==
== Keywords & Symbols ==


..
<source lang="ada">
chip, device, register,on,off,pci,ioapic,pnp,i2c,lapic,cpu_cluster,domain,irq,drq,io,ioapic_irq,inherit,subsystemid,end,=
</source>


== Syntax ==
== Syntax ==


..
* ioapic_irq
<source lang="ada">
ioapic_irq: ioapic_irq number-literal pciint number-literal
</source>
 
rewrite this in BNF notation..


== Grammar ==
== Grammar ==


..
=== Literals ===
Literal values types are defined and thus consumed by the following regular expressions:
 
* Hex
<source lang="reg">
0x[0-9a-fA-F.]+
 
[0-9a-fA-F.]+
</source>
 
* Decimals
<source lang="reg">
[0-9.]+
</source>
 
* PCI Interrupts
<source lang="reg">
INT[A-D]
</source>
 
* Strings
<source lang="reg">
\"[^\"]+\"
 
[^ \n\t]+
</source>
 
== NOTES ==
 
See source  util/sconfig/sconfig.* for devicetree compiler..


== Examples ==
== Examples ==
Line 33: Line 89:
=== Super I/O ===
=== Super I/O ===




{{Cc-by-2.5}}
{{Cc-by-2.5}}

Latest revision as of 13:51, 2 March 2014