meta-google: treewide: Parameterize NCSI channel

Most platforms want to use 1 as has been the implicit standard. However,
this is not required and might be changed for some machines. This makes
it easy to change via a machine configuration variable.

Change-Id: I5dff5dfb1c97bab531042fd364114f320d3ebe42
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb b/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb
index 193db14..25e89df 100644
--- a/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb
+++ b/meta-google/recipes-google/ipmi/google-ipmi-sys_git.bb
@@ -34,5 +34,7 @@
 
 EXTRA_OEMESON += "-Dtests=disabled"
 
+GBMC_NCSI_IPMI_CHANNEL ??= "1"
+
 CXXFLAGS:append:gbmc = '${@"" if not d.getVar("GBMC_NCSI_IF_NAME") else \
-  " -DNCSI_IPMI_CHANNEL=1 -DNCSI_IF_NAME=" + d.getVar("GBMC_NCSI_IF_NAME")}'
+  " -DNCSI_IPMI_CHANNEL=" + d.getVar("GBMC_NCSI_IPMI_CHANNEL") + " -DNCSI_IF_NAME=" + d.getVar("GBMC_NCSI_IF_NAME")}'
diff --git a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
index 1afe115..121562a 100644
--- a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
+++ b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
@@ -8,6 +8,7 @@
 DEPENDS:append:gbmc = " jq-native"
 
 GBMCBR_IPMI_CHANNEL ?= "11"
+GBMC_NCSI_IPMI_CHANNEL ??= "1"
 
 ENTITY_MAPPING ?= "default"
 
@@ -43,7 +44,7 @@
   fi
   gbmc_add_channel ${GBMCBR_IPMI_CHANNEL} gbmcbr
   if [ -n "${GBMC_NCSI_IF_NAME}" ]; then
-    gbmc_add_channel 1 ${GBMC_NCSI_IF_NAME}
+    gbmc_add_channel ${GBMC_NCSI_IPMI_CHANNEL} ${GBMC_NCSI_IF_NAME}
   fi
 
   # Set entity-map.json to empty json for gBMC by default.