npcm7xx-igps: Make it possible to set HOST_IF
Some platforms want to use eSPI instead of LPC, make it possible to
change this value.
Tested: Verified that the build output of LPC systems reflects the LPC
value and eSPI the eSPI value.
Google-Bug-Id: 344688999
Change-Id: Ia95f76455fa909c85b0a02f76a73484428f02b5a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native/customizations.patch b/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native/customizations.patch
index 3ede39f..b7281c3 100644
--- a/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native/customizations.patch
+++ b/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native/customizations.patch
@@ -1,5 +1,5 @@
diff --git a/ImageGeneration/references/BootBlockAndHeader_EB.xml b/ImageGeneration/references/BootBlockAndHeader_EB.xml
-index 06ced21..576bf33 100644
+index 06ced21..b7426f3 100644
--- a/ImageGeneration/references/BootBlockAndHeader_EB.xml
+++ b/ImageGeneration/references/BootBlockAndHeader_EB.xml
@@ -71,7 +71,7 @@
@@ -20,6 +20,15 @@
</BinField>
<BinField>
+@@ -159,7 +159,7 @@
+ <offset>0x157</offset>
+ <size>0x1</size>
+ </config>
+- <content format='32bit'>0x00</content>
++ <content format='32bit'>@HOST_IF@</content>
+ </BinField>
+
+ <BinField>
diff --git a/ImageGeneration/references/UbootHeader_EB.xml b/ImageGeneration/references/UbootHeader_EB.xml
index 1e72e22..1904898 100644
--- a/ImageGeneration/references/UbootHeader_EB.xml
diff --git a/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native_02.01.18.bbappend b/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native_02.01.18.bbappend
index e5a8ec4..061fb74 100644
--- a/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native_02.01.18.bbappend
+++ b/dynamic-layers/nuvoton-layer/recipes-bsp/images/npcm7xx-igps-native_02.01.18.bbappend
@@ -3,6 +3,8 @@
require recipes-bsp/gbmc-bsp-common/gbmc-bsp-common.inc
+NPCM_HOST_IF ??= "LPC"
+
# Original values taken from ImageGeneration/references/BootBlockAndHeader_EB.xml
NPCM_AHB_MHZ = "200"
NPCM_FIU0_DRD_BB = "0x030011BB"
@@ -14,6 +16,13 @@
python () {
if int(d.getVar('NPCM_AHB_MHZ'))/int(d.getVar('NPCM_FIU0_DIV')) != int(d.getVar('GBMC_BOOT_SPI_MHZ')):
bb.error('Invalid GBMC_BOOT_SPI_MHZ or NPCM_FIU0_DIV')
+ hostif = d.getVar('NPCM_HOST_IF')
+ if hostif == 'LPC':
+ d.setVar('NPCM_HOST_IF_I', '0')
+ elif hostif == 'eSPI':
+ d.setVar('NPCM_HOST_IF_I', '1')
+ else:
+ bb.error('Invalid NPCM_HOST_IF')
}
# Remove our old upstream patch so we can transition away
@@ -25,7 +34,7 @@
SRC_URI:append = " file://customizations.patch"
do_install:append() {
- sed -i 's,@FIU_DRD_CFG@,${NPCM_FIU0_DRD_BB},g; s,@FIU_CLK_DIV@,${NPCM_FIU0_DIV},g' \
+ sed -i 's,@FIU_DRD_CFG@,${NPCM_FIU0_DRD_BB},g; s,@FIU_CLK_DIV@,${NPCM_FIU0_DIV},g; s,@HOST_IF@,${NPCM_HOST_IF_I},g' \
${DEST}/BootBlockAndHeader_${IGPS_MACHINE}.xml
sed -i 's,@FIU_DRD_CFG@,${NPCM_FIU0_DRD_UB},g; s,@FIU_CLK_DIV@,${NPCM_FIU0_DIV},g' \
${DEST}/UbootHeader_${IGPS_MACHINE}.xml