VOL-4268: Migration to BAL3.4.9.9 for voltha master and 2.8 branch

Change-Id: I66c77149524f2592fb018a3bc00dc9c8a8f94153
diff --git a/.gitignore b/.gitignore
index 56dc8a3..5200942 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,3 +44,6 @@
 agent/src/read_rxtx_power
 agent/read_rxtx_power
 eeprom.bin
+
+# downloaded Accton patch files and BAL packages
+agent/download/*
diff --git a/VERSION b/VERSION
index c1aee2f..d5c0c99 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.5.1-dev
+3.5.1
diff --git a/agent/Makefile.in b/agent/Makefile.in
index b467589..9a92dcb 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -35,12 +35,11 @@
 # Version of Open Network Linux (ONL).
 ONL_KERN_VER_MAJOR = 4.19
 else
-BAL_REV_B_VER = 6
-DEV_VER = 202012040101
+BAL_REV_B_VER = 9
+DEV_VER = 202107300101
 ONL_KERN_VER_MAJOR = 4.14
 endif
-BAL_API_REV_B_VER = 6
-BAL_API_VER = $(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_A_VER).$(BAL_API_REV_B_VER)
+BAL_API_VER = $(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_A_VER).$(BAL_REV_B_VER)
 BAL_VER = $(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_A_VER).$(BAL_REV_B_VER)
 SDK_VER = 6.5.13
 
@@ -186,6 +185,7 @@
 PATCH_FILE = PHOENIX_BAL_$(BAL_VER)_V$(DEV_VER).patch
 else
 PATCH_FILE = ACCTON_BAL_$(BAL_VER)-V$(DEV_VER).patch
+BAL_IP_PATCH_FILE = ACCTON_BAL_$(BAL_VER)-V$(DEV_VER)-BROADCOM-IP.patch
 endif
 BAL_DIR = $(BUILD_DIR)/$(OPENOLTDEVICE)-bal
 BCM_SDK = $(BAL_DIR)/switch_sdk/$(SDK_VER)
@@ -217,6 +217,7 @@
 	cp download/$(SDK_ZIP) $(BCM_SDK)
 	chmod -R 744 $(BAL_DIR)
 	cat download/$(PATCH_FILE) | patch -p1 -d $(BAL_DIR)
+	cat download/$(BAL_IP_PATCH_FILE) | patch -p1 -d $(BAL_DIR)
 ifeq ("$(strip $(OPENOLTDEVICE))","asfvolt16")
 	echo "setenv port_speed_for_100 $(PORT_100G_SPEED)" > $(PORT_SPEED_FILE)
 else ifeq ("$(strip $(OPENOLTDEVICE))","asgvolt64")
@@ -403,6 +404,7 @@
 	@rm -rf device/$(OPENOLTDEVICE)/mkdebian/debian/tmp/
 	@rm -f device/$(OPENOLTDEVICE)/$(OPENOLTDEVICE)_$(BAL_VER)+edgecore-V$(DEV_VER)_amd64.changes
 	@rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/$(RXTX_POWER_EXE)
+	@rm -rf device/$(OPENOLTDEVICE)/mkdebian/debian/watchdog/
 
 inband-onl-cleanup:
 	@rm -f $(ONL_DIR)/OpenNetworkLinux/*.patch
diff --git a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
index 59175c0..908ff90 100644
--- a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
+++ b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
@@ -17,7 +17,7 @@
 
 rm -rf /opt/bcm68620
 rm -rf /broadcom
-tar zxf /tmp/release_asfvolt16_V3.4.9.6.202012040101.tar.gz -C / 2>&1 > /dev/null
+tar zxf /tmp/release_asfvolt16_V3.4.9.9.202107300101.tar.gz -C / 2>&1 > /dev/null
 grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
 rm -f /run/bcm68620
 mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
diff --git a/agent/device/asfvolt16/mkdebian/debian/changelog b/agent/device/asfvolt16/mkdebian/debian/changelog
index 988f58d..e41b18e 100644
--- a/agent/device/asfvolt16/mkdebian/debian/changelog
+++ b/agent/device/asfvolt16/mkdebian/debian/changelog
@@ -1,6 +1,6 @@
-asfvolt16 (3.4.9.6+edgecore-V202012040101) stable; urgency=high
+asfvolt16 (3.4.9.9+edgecore-V202107300101) stable; urgency=high
 
-    * Based on code from SW-BCM686OLT_3_4_9_6.tgz.
-    * Merged the Accton's fixed to ACCTON_BAL_3.4.9.6-V202012040101.patch.
+    * Based on code from SW-BCM686OLT_3.4.9.9.tgz.
+    * Merged the Accton's fixed to ACCTON_BAL_3.4.9.9-V202107300101.patch.
 
  -- Jason Huang <jasonsc_huang@edge-core.com>  Mon, 30 NOV 2020 01:01:03 +0800
diff --git a/agent/device/asfvolt16/mkdebian/debian/control b/agent/device/asfvolt16/mkdebian/debian/control
index d7cc78d..66defdd 100644
--- a/agent/device/asfvolt16/mkdebian/debian/control
+++ b/agent/device/asfvolt16/mkdebian/debian/control
@@ -9,5 +9,5 @@
 Architecture: amd64
 Depends: ${shlibs:Depends}
 Description: Broadcom OLT drivers,CLI
-  ported from Broadcom SDK-3.4.9.6 package
+  ported from Broadcom SDK-3.4.9.9 package
 
diff --git a/agent/device/asfvolt16/mkdebian/debian/files b/agent/device/asfvolt16/mkdebian/debian/files
index 728e1ce..39b81d8 100644
--- a/agent/device/asfvolt16/mkdebian/debian/files
+++ b/agent/device/asfvolt16/mkdebian/debian/files
@@ -1 +1 @@
-asfvolt16_3.4.9.6+edgecore-V202012040101_amd64.deb misc optional
+asfvolt16_3.4.9.9+edgecore-V202107300101_amd64.deb misc optional
diff --git a/agent/device/asfvolt16/mkdebian/debian/rules b/agent/device/asfvolt16/mkdebian/debian/rules
index d3dedf0..ede3cfa 100755
--- a/agent/device/asfvolt16/mkdebian/debian/rules
+++ b/agent/device/asfvolt16/mkdebian/debian/rules
@@ -26,7 +26,7 @@
 
 override_dh_auto_install:
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asfvolt16_V3.4.9.6.202012040101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asfvolt16_V3.4.9.9.202107300101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libz.so.1 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libstdc++.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libbal_host_api.so $(DEB_DH_INSTALL_SOURCEDIR)/tmp
diff --git a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
index 2c97375..0ec400d 100644
--- a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
+++ b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
@@ -17,7 +17,7 @@
 
 rm -rf /opt/bcm68620
 rm -rf /broadcom
-tar zxf /tmp/release_asgvolt64_V3.4.9.6.202012040101.tar.gz -C / 2>&1 > /dev/null
+tar zxf /tmp/release_asgvolt64_V3.4.9.9.202107300101.tar.gz -C / 2>&1 > /dev/null
 grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
 rm -f /run/bcm68620
 mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
diff --git a/agent/device/asgvolt64/mkdebian/debian/changelog b/agent/device/asgvolt64/mkdebian/debian/changelog
index 5282661..0565235 100644
--- a/agent/device/asgvolt64/mkdebian/debian/changelog
+++ b/agent/device/asgvolt64/mkdebian/debian/changelog
@@ -1,6 +1,6 @@
-asgvolt64 (3.4.9.6+edgecore-V202012040101) stable; urgency=high
+asgvolt64 (3.4.9.9+edgecore-V202107300101) stable; urgency=high
 
-    * Based on code from SW-BCM686OLT_3_4_9_6.tgz.
-    * Merged the Accton's fixed to ACCTON_BAL_3.4.9.6-V202012040101.patch.
+    * Based on code from SW-BCM686OLT_3.4.9.9.tgz.
+    * Merged the Accton's fixed to ACCTON_BAL_3.4.9.9-V202107300101.patch.
 
  -- Jason Huang <jasonsc_huang@edge-core.com>  Mon, 30 NOV 2020 01:01:03 +0800
diff --git a/agent/device/asgvolt64/mkdebian/debian/control b/agent/device/asgvolt64/mkdebian/debian/control
index 721b2d7..71d2075 100644
--- a/agent/device/asgvolt64/mkdebian/debian/control
+++ b/agent/device/asgvolt64/mkdebian/debian/control
@@ -9,5 +9,5 @@
 Architecture: amd64
 Depends: ${shlibs:Depends}
 Description: Broadcom OLT drivers,CLI
-  ported from Broadcom SDK-3.4.9.6 package
+  ported from Broadcom SDK-3.4.9.9 package
 
diff --git a/agent/device/asgvolt64/mkdebian/debian/files b/agent/device/asgvolt64/mkdebian/debian/files
index 3617d2b..4030926 100644
--- a/agent/device/asgvolt64/mkdebian/debian/files
+++ b/agent/device/asgvolt64/mkdebian/debian/files
@@ -1 +1 @@
-asgvolt64_3.4.9.6+edgecore-V202012040101_amd64.deb misc optional
+asgvolt64_3.4.9.9+edgecore-V202107300101_amd64.deb misc optional
diff --git a/agent/device/asgvolt64/mkdebian/debian/rules b/agent/device/asgvolt64/mkdebian/debian/rules
index b047c30..3fa5527 100755
--- a/agent/device/asgvolt64/mkdebian/debian/rules
+++ b/agent/device/asgvolt64/mkdebian/debian/rules
@@ -26,7 +26,7 @@
 
 override_dh_auto_install:
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asgvolt64_V3.4.9.6.202012040101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asgvolt64_V3.4.9.9.202107300101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libz.so.1 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libstdc++.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libbal_host_api.so $(DEB_DH_INSTALL_SOURCEDIR)/tmp
diff --git a/agent/test/Makefile b/agent/test/Makefile
index a6e983d..24a4382 100644
--- a/agent/test/Makefile
+++ b/agent/test/Makefile
@@ -41,7 +41,7 @@
 
 export CXX CXXFLAGS OPENOLT_PROTO_VER
 
-BAL_API_VER ?= bal-api-3.4.9.6
+BAL_API_VER ?= bal-api-3.4.9.9
 BAL_API_DIR=$(BAL_API_VER)
 BALLIBNAME=bcm_host_api_stubs
 BALLIBDIR=$(BAL_API_DIR)/stubs