summaryrefslogtreecommitdiffstats
path: root/util/intelp2m/description.md
diff options
context:
space:
mode:
authorMaxim Polyakov <max.senia.poliak@gmail.com>2020-09-30 16:46:11 +0300
committerPatrick Georgi <pgeorgi@google.com>2020-10-12 08:43:14 +0000
commit726282b44f15904b06f86f3d1d6b4d5d93bba76d (patch)
tree2d604a1ebddcb9e8f00dfdfce10723ca8cbbf29c /util/intelp2m/description.md
parentf2f53c447aaac242f45eaaa2e9af7e3c76047baa (diff)
downloadcoreboot-726282b44f15904b06f86f3d1d6b4d5d93bba76d.tar.gz
coreboot-726282b44f15904b06f86f3d1d6b4d5d93bba76d.tar.bz2
coreboot-726282b44f15904b06f86f3d1d6b4d5d93bba76d.zip
util/intelp2m: Update output information format in the comments
Update the information format in the comments above the macros in the generated gpio.h file: PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), /* LPSS_UART0_TXD */ -->(i) /* GPIO_39 - LPSS_UART0_TXD */ --> (ii) /* DW0: 0x44000400, DW1: 0x00003100 */ --> (ii) /* DW0 : PAD_TRIG(OFF) - IGNORED */ --> (iii) /* _PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP) | PAD_TRIG(OFF), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)), */ --> (iiii) PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), Also, in the case of field macros: /* GPIO_39 - LPSS_UART0_TXD */ --> (ii) /* DW0: 0x44000400, DW1: 0x00003100 */ --> (ii) /* DW0 : PAD_TRIG(OFF) - IGNORED */ --> (iii) /* PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), */ --> (iiii) PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP) | PAD_TRIG(OFF), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)), By default, if do not use the -i... option, then additional information in comments will not be generated. TEST: git clone https://github.com/maxpoliak/inteltool-examples.git test ./intelp2m -n -file test/inteltool-asrock-h110m-stx.log ./intelp2m -fld cb -file test/inteltool-asrock-h110m-stx.log ./intelp2m -fld fsp -file test/inteltool-asrock-h110m-stx.log ./intelp2m -fld raw -file test/inteltool-asrock-h110m-stx.log Before and after (now with -i key) the patch, gpio.h is no different. Change-Id: I760f4aadece786ea455fb7569f42e06fefce2b61 Signed-off-by: Maxim Polyakov <max.senia.poliak@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45168 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/intelp2m/description.md')
-rw-r--r--util/intelp2m/description.md108
1 files changed, 41 insertions, 67 deletions
diff --git a/util/intelp2m/description.md b/util/intelp2m/description.md
index add9c2cf88af..9ca56b979e4b 100644
--- a/util/intelp2m/description.md
+++ b/util/intelp2m/description.md
@@ -16,7 +16,6 @@ It is possible to use templates for parsing files of excellent inteltool.log.
To specify such a pattern, use the option -t <template number>. For example,
using template type # 1, you can parse gpio.h from an already added board in
the coreboot project.
-
```bash
(shell)$ ./intelp2m -h
-t
@@ -30,7 +29,6 @@ You can also add add a template to 'parser/template.go' for your file type with
the configuration of the pads.
platform type is set using the -p option (Sunrise by default):
-
```bash
-p string
set up a platform
@@ -56,7 +54,6 @@ Use the -fld=cb option to only generate a sequence of bit fields in a new macro:
```bash
(shell)$ ./intelp2m -fld cb -p apl -file ../apollo-inteltool.log
```
-
```c
_PAD_CFG_STRUCT(GPIO_37, PAD_FUNC(NF1) | PAD_TRIG(OFF) | PAD_TRIG(OFF), PAD_PULL(DN_20K)), /* LPSS_UART0_TXD */
```
@@ -69,96 +66,73 @@ to use the -fld=raw option:
```bash
(shell)$ ./intelp2m -fld raw -file /path/to/inteltool.log
```
-
```c
-_PAD_CFG_STRUCT(GPP_A10, 0x44000500, 0x00000000), /* CLKOUT_LPC1 */
+_PAD_CFG_STRUCT(GPP_A10, 0x44000500, 0x00000000),
```
```bash
(shell)$ ./intelp2m -iiii -fld raw -file /path/to/inteltool.log
```
-
```c
-/* GPP_A10 - CLKOUT_LPC1 DW0: 0x44000500, DW1: 0x00000000 */
+/* GPP_A10 - CLKOUT_LPC1 */
+/* DW0: 0x44000500, DW1: 0x00000000 */
+/* DW0: 0x04000100 - IGNORED */
/* PAD_CFG_NF(GPP_A10, NONE, DEEP, NF1), */
-/* DW0 : 0x04000100 - IGNORED */
_PAD_CFG_STRUCT(GPP_A10, 0x44000500, 0x00000000),
```
-### FSP-style macro
-
-The utility allows to generate macros that include fsp/edk2-palforms style bitfields:
-
-```bash
-(shell)$ ./intelp2m -fld fsp -p lbg -file ../crb-inteltool.log
-```
-
-```c
-{ GPIO_SKL_H_GPP_A12, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInvOut, GpioOutLow, GpioIntSci | GpioIntLvlEdgDis, GpioResetNormal, GpioTermNone, GpioPadConfigLock }, /* GPIO */
-```
-
-```bash
-(shell)$ ./intelp2m -iiii -fld fsp -p lbg -file ../crb-inteltool.log
-```
-
-```c
-/* GPP_A12 - GPIO DW0: 0x80880102, DW1: 0x00000000 */
-/* PAD_CFG_GPI_SCI(GPP_A12, NONE, PLTRST, LEVEL, INVERT), */
-{ GPIO_SKL_H_GPP_A12, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInvOut, GpioOutLow, GpioIntSci | GpioIntLvlEdgDis, GpioResetNormal, GpioTermNone, GpioPadConfigLock },
-```
-
### Macro Check
After generating the macro, the utility checks all used
fields of the configuration registers. If some field has been
ignored, the utility generates field macros. To not check
macros, use the -n option:
-
```bash
(shell)$ ./intelp2m -n -file /path/to/inteltool.log
```
In this case, some fields of the configuration registers
DW0 will be ignored.
-
```c
-PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_38, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_UART0_RXD */
-PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), /* LPSS_UART0_TXD */
+PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_38, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD),
+PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD),
```
### Information level
The utility can generate additional information about the bit
-fields of the DW0 and DW1 configuration registers:
+fields of the DW0 and DW1 configuration registers. Using the
+options -i, -ii, -iii, -iiii you can set the info level from
+1 to 4:
+```bash
+(shell)$./intelp2m -i -file /path/to/inteltool.log
+```
```c
-/* GPIO_39 - LPSS_UART0_TXD (DW0: 0x44000400, DW1: 0x00003100) */ --> (2)
-/* PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), */ --> (3)
-/* DW0 : PAD_TRIG(OFF) - IGNORED */ --> (4)
-_PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP) | PAD_TRIG(OFF), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)),
+_PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP) | PAD_TRIG(OFF), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)), /* LPSS_UART0_TXD */
```
-Using the options -i, -ii, -iii, -iiii you can set the info level
-from (1) to (4):
-
```bash
-(shell)$./intelp2m -i -file /path/to/inteltool.log
(shell)$./intelp2m -ii -file /path/to/inteltool.log
(shell)$./intelp2m -iii -file /path/to/inteltool.log
(shell)$./intelp2m -iiii -file /path/to/inteltool.log
```
-(1) : print /* GPIO_39 - LPSS_UART0_TXD */
-
-(2) : print initial raw values of configuration registers from
-inteltool dump
-DW0: 0x44000400, DW1: 0x00003100
+```c
+/* GPIO_39 - LPSS_UART0_TXD */
+/* DW0: 0x44000400, DW1: 0x00003100 */ --> (ii)
+/* DW0 : PAD_TRIG(OFF) - IGNORED */ --> (iii)
+/* PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), */ --> (iiii)
+_PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP) | PAD_TRIG(OFF), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)),
+```
-(3) : print the target macro that will generate if you use the
--n option
+If the -n switch was used and macros was generated without checking:
+```c
+/* GPIO_39 - LPSS_UART0_TXD */ --> (i)
+/* DW0: 0x44000400, DW1: 0x00003100 */ --> (ii)
+/* DW0: PAD_TRIG(OFF) - IGNORED */ --> (iii)
+/* _PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP) | PAD_TRIG(OFF), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)), */ --> (iiii)
PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD),
-
-(4) : print decoded fields from (3) as macros
-DW0 : PAD_TRIG(OFF) - IGNORED
+```
### Ignoring Fields
@@ -168,35 +142,35 @@ from it that are not in the corresponding PAD_CFG_*() macro:
```bash
(shell)$ ./intelp2m -iiii -fld cb -ign -file /path/to/inteltool.log
```
-
```c
-/* GPIO_39 - LPSS_UART0_TXD DW0: 0x44000400, DW1: 0x00003100 */
+/* GPIO_39 - LPSS_UART0_TXD */
+/* DW0: 0x44000400, DW1: 0x00003100 */
+/* DW0: PAD_TRIG(OFF) - IGNORED */
/* PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), */
-/* DW0 : PAD_TRIG(OFF) - IGNORED */
_PAD_CFG_STRUCT(GPIO_39, PAD_FUNC(NF1) | PAD_RESET(DEEP), PAD_PULL(UP_20K) | PAD_IOSTERM(DISPUPD)),
```
-If you generate macros without checking, you can see bit fields that
-were ignored:
+### FSP-style macro
+
+The utility allows to generate macros that include fsp/edk2-palforms style bitfields:
```bash
-(shell)$ ./intelp2m -iiii -n -file /path/to/inteltool.log
+(shell)$ ./intelp2m -i -fld fsp -p lbg -file ../crb-inteltool.log
```
-
```c
-/* GPIO_39 - LPSS_UART0_TXD DW0: 0x44000400, DW1: 0x00003100 */
-PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD),
-/* DW0 : PAD_TRIG(OFF) - IGNORED */
+{ GPIO_SKL_H_GPP_A12, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInvOut, GpioOutLow, GpioIntSci | GpioIntLvlEdgDis, GpioResetNormal, GpioTermNone, GpioPadConfigLock }, /* GPIO */
```
```bash
-(shell)$ ./intelp2m -n -file /path/to/inteltool.log
+(shell)$ ./intelp2m -iiii -fld fsp -p lbg -file ../crb-inteltool.log
```
-
```c
-/* GPIO_39 - LPSS_UART0_TXD */
-PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_39, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD),
+/* GPP_A12 - GPIO */
+/* DW0: 0x80880102, DW1: 0x00000000 */
+/* PAD_CFG_GPI_SCI(GPP_A12, NONE, PLTRST, LEVEL, INVERT), */
+{ GPIO_SKL_H_GPP_A12, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInvOut, GpioOutLow, GpioIntSci | GpioIntLvlEdgDis, GpioResetNormal, GpioTermNone, GpioPadConfigLock },
```
+
### Supports Chipsets
Sunrise PCH, Lewisburg PCH, Apollo Lake SoC, CannonLake-LP SoCs