This is an simple tool that help add/edit data from datasheets in such coreboot utils as msrtool, superiotool, etc... It consists from two parts: small *.c files, which do export of already exists C code into xml definitions file, and main module - generate.py, which produce *.c files and patches for C code from xml data definitions. Also it contain simple gui module, written on PyQt4, which allow easy add/edit data to/from xml definitions.
Exporting already exist data in *.c files
- copy export_msr.c into mrstool directory
- compile it: "gcc -s -o export_msr export_msr.c"
- run: "./export_msr"
- copy all *.msr.xml files somewhere you want
- copy export_sio.c into superiotool directory
- because in superiotool we have identical names for different superio vendors *.c files we need produce export version for each file separately:
- gcc -s -o export_sio_ali -DALI export_sio.c
- gcc -s -o export_sio_ite -DITE export_sio.c
- then run all utilities: "./export_sio_*"
- copy all *.sio.xml files somewhere you want
Producing C code from xml definitions
All definitions must be in <project_dir>/data in each section:
- for msr - in /data/msr/*.msr.xml
- for superio - in /data/sio/*.sio.xml
Then you need start python3 generate.py
It generates C files and put them in "../msrtool" , "../superiotool" After generation you need check C code for consistency and then compile