diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
index 82cb37e..851dd11 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
@@ -58,6 +58,8 @@
     MulticastDistributionSetData
 import time
 import binascii
+from argparse import ArgumentParser, ArgumentError
+import shlex
 
 ASFVOLT_NNI_PORT = 129
 # ASFVOLT_NNI_PORT needs to be other than pon port value.
@@ -163,6 +165,12 @@
             freq_override = False)
         return pm_config
 
+class MyArgumentParser(ArgumentParser):
+    # Must override the exit command to prevent it from
+    # calling sys.exit().  Return exception instead.
+    def exit(self, status=0, message=None):
+        raise Exception(message)
+
 class Asfvolt16Handler(OltDeviceHandler):
 
     def __init__(self, adapter, device_id):
@@ -189,6 +197,7 @@
         self.heartbeat_interval = 5
         self.heartbeat_failed_limit = 1
         self.is_heartbeat_started = 0
+        self.transceiver_type = bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_7226_PC;
 
     def __del__(self):
         super(Asfvolt16Handler, self).__del__()
@@ -317,6 +326,17 @@
             self.adapter_agent.update_device(device)
             return
 
+        # Parse extra command line options
+        if device.extra_args is not None and len(device.extra_args) > 0:
+            try:
+                self.parse_provisioning_options(device.extra_args)
+            except Exception as e:
+                self.log.exception('parse-provisioning-options', e=e)
+                device.oper_status = OperStatus.FAILED
+                device.reason = 'Invalid extra options provided'
+                self.adapter_agent.update_device(device)
+                return
+
         self.bal.connect_olt(device.host_and_port, self.device_id)
 
         if self.logical_device_id is None:
@@ -977,8 +997,25 @@
             self.log.exception('', exc=str(e))
         return
 
+    def hex_format(self, regid):
+        ascii_regid = map(ord, regid)
+        size=len(ascii_regid)
+        if size > 36:
+            del ascii_regid[36:]
+        else:
+            ascii_regid += (36-size) * [0]
+        return ''.join('{:02x}'.format(e) for e in ascii_regid)
+
+    def get_registration_id(self, data):
+        if data.data.expected_registration_id is not None and \
+            len(data.data.expected_registration_id) > 0:
+            return self.hex_format(data.data.expected_registration_id)
+        # default reg id
+        return '202020202020202020202020202020202020202020202020202020202020202020202020'
+
     def handle_v_ont_ani_config(self, data):
         serial_number = data.data.expected_serial_number
+        registration_id = self.get_registration_id(data)
         child_device = self.adapter_agent.get_child_device(
             self.device_id,
             serial_number=serial_number)
@@ -995,6 +1032,7 @@
             onu_info['onu_id'] = child_device.proxy_address.onu_id
             onu_info['vendor'] = child_device.vendor_id
             onu_info['vendor_specific'] = serial_number[4:]
+            onu_info['reg_id'] = registration_id
             self.bal.activate_onu(onu_info)
         else:
             self.log.info('Invalid-ONU-state-to-activate',
@@ -1003,6 +1041,7 @@
 
     def delete_v_ont_ani(self, data):
         serial_number = data.data.expected_serial_number
+        registration_id = self.get_registration_id(data)
         child_device = self.adapter_agent.get_child_device(
             self.device_id,
             serial_number=serial_number)
@@ -1019,6 +1058,7 @@
             onu_info['onu_id'] = child_device.proxy_address.onu_id
             onu_info['vendor'] = child_device.vendor_id
             onu_info['vendor_specific'] = serial_number[4:]
+            onu_info['reg_id'] = registration_id
             self.bal.deactivate_onu(onu_info)
         else:
             self.log.info('Invalid-ONU-state-to-deactivate',
@@ -1058,7 +1098,8 @@
                 self.add_port(port_no=data.data.xgs_ponid,
                               port_type=Port.PON_OLT,
                               label=data.name)
-                self.bal.activate_pon_port(self.olt_id, data.data.xgs_ponid)
+                self.bal.activate_pon_port(self.olt_id, data.data.xgs_ponid,
+                                           self.transceiver_type)
                 if data.name in self.channel_terminations:
                     self.log.info('Channel-termination-already-present',
                                   channel_termination=data)
@@ -1128,7 +1169,8 @@
                     self.del_port(label=data.name,
                                   port_type=Port.PON_OLT,
                                   port_no=data.data.xgs_ponid)
-                    self.bal.deactivate_pon_port(self.olt_id, data.data.xgs_ponid)
+                    self.bal.deactivate_pon_port(self.olt_id, data.data.xgs_ponid,
+                                                 self.transceiver_type)
                     del self.channel_terminations[data.name]
             if isinstance(data, VOntaniConfig):
                 if data.name in self.v_ont_anis:
@@ -1904,3 +1946,39 @@
                                flow_id=uplink_flow_id,
                                onu_id=onu_device.proxy_address.onu_id,
                                intf_id=onu_device.proxy_address.channel_id)
+
+    def parse_provisioning_options(self, extra_args):
+        parser = MyArgumentParser(add_help=False)
+        parser.add_argument('--transceiver', '-x', action='store',
+                            choices=['gpon_sps_43_48',
+                                     'gpon_sps_sog_4321',
+                                     'gpon_lte_3680_m',
+                                     'gpon_source_photonics',
+                                     'gpon_lte_3680_p',
+                                     'xgpon_lth_7222_pc',
+                                     'xgpon_lth_7226_pc',
+                                     'xgpon_lth_5302_pc',
+                                     'xgpon_lth_7226_a_pc_plus'],
+                            default='xgpon_lth_7226_pc')
+        try:
+            args = parser.parse_args(shlex.split(extra_args))
+            self.log.debug('parsing-extra-arguments', args=args)
+
+            self.transceiver_type = {
+                'gpon_sps_43_48': bal_model_types_pb2.BAL_TRX_TYPE_GPON_SPS_43_48,
+                'gpon_sps_sog_4321': bal_model_types_pb2.BAL_TRX_TYPE_GPON_SPS_SOG_4321,
+                'gpon_lte_3680_m': bal_model_types_pb2.BAL_TRX_TYPE_GPON_LTE_3680_M,
+                'gpon_source_photonics': bal_model_types_pb2.BAL_TRX_TYPE_GPON_SOURCE_PHOTONICS,
+                'gpon_lte_3680_p': bal_model_types_pb2.BAL_TRX_TYPE_GPON_LTE_3680_P,
+                'xgpon_lth_7222_pc': bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_7222_PC,
+                'xgpon_lth_7226_pc': bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_7226_PC,
+                'xgpon_lth_5302_pc': bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_5302_PC,
+                'xgpon_lth_7226_a_pc_plus': bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_7226_A_PC_PLUS,
+            }[args.transceiver]
+
+        except ArgumentError as e:
+            raise Exception('invalid-arguments: {}'.format(e.message))
+
+        except Exception as e:
+            raise Exception('option-parsing-error: {}'.format(e.message))
+
diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py b/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
index 47c9554..1f4c8b1 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
@@ -33,7 +33,7 @@
                                                device_handler_class=Asfvolt16Handler,
                                                name='asfvolt16_olt',
                                                vendor='Edgecore',
-                                               version='0.95',
+                                               version='0.96',
                                                device_type='asfvolt16_olt')
         # register for adapter messages
         self.port = 60001
diff --git a/voltha/adapters/asfvolt16_olt/bal.py b/voltha/adapters/asfvolt16_olt/bal.py
index 99b2ffd..9237ee4 100644
--- a/voltha/adapters/asfvolt16_olt/bal.py
+++ b/voltha/adapters/asfvolt16_olt/bal.py
@@ -91,7 +91,7 @@
         yield self.stub.BalCfgSet(obj, timeout=GRPC_TIMEOUT)
 
     @inlineCallbacks
-    def activate_pon_port(self, olt_no, pon_port):
+    def activate_pon_port(self, olt_no, pon_port, transceiver_type):
         try:
             obj = bal_pb2.BalCfg()
             #            Fill Header details
@@ -101,18 +101,18 @@
             obj.interface.key.intf_id = pon_port
             obj.interface.key.intf_type = bal_model_types_pb2.BAL_INTF_TYPE_PON
             obj.interface.data.admin_state = bal_model_types_pb2.BAL_STATE_UP
-            obj.interface.data.transceiver_type = \
-                bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_7226_PC
+            obj.interface.data.transceiver_type = transceiver_type
             self.log.info('activating-pon-port-in-olt',
                           olt=olt_no, pon_port=pon_port,
-                          pon_port_details=obj)
+                          pon_port_details=obj,
+                          transceiver_type=transceiver_type)
             yield self.stub.BalCfgSet(obj, timeout=GRPC_TIMEOUT)
         except Exception as e:
             self.log.info('activating-pon-port-in-olt-exception', exc=str(e))
         return
 
     @inlineCallbacks
-    def deactivate_pon_port(self, olt_no, pon_port):
+    def deactivate_pon_port(self, olt_no, pon_port, transceiver_type):
         try:
             obj = bal_pb2.BalCfg()
             #            Fill Header details
@@ -122,11 +122,11 @@
             obj.interface.key.intf_id = pon_port
             obj.interface.key.intf_type = bal_model_types_pb2.BAL_INTF_TYPE_PON
             obj.interface.data.admin_state = bal_model_types_pb2.BAL_STATE_DOWN
-            obj.interface.data.transceiver_type = \
-                bal_model_types_pb2.BAL_TRX_TYPE_XGPON_LTH_7226_PC
+            obj.interface.data.transceiver_type = transceiver_type
             self.log.info('deactivating-pon-port-in-olt',
                           olt=olt_no, pon_port=pon_port,
-                          pon_port_details=obj)
+                          pon_port_details=obj,
+                          transceiver_type=transceiver_type)
         except Exception as e:
             self.log.info('deactivating-pon-port in olt-exception', exc=str(e))
         return
@@ -168,8 +168,7 @@
             obj.terminal.data.serial_number.vendor_id = onu_info['vendor']
             obj.terminal.data.serial_number.vendor_specific = \
                 onu_info['vendor_specific']
-            obj.terminal.data.registration_id = \
-                '202020202020202020202020202020202020202020202020202020202020202020202020'
+            obj.terminal.data.registration_id = onu_info['reg_id']
             self.log.info('activating-ONU-in-olt',
                           onu_details=obj)
             yield self.stub.BalCfgSet(obj, timeout=GRPC_TIMEOUT)
@@ -434,8 +433,7 @@
             obj.terminal.data.serial_number.vendor_id = onu_info['vendor']
             obj.terminal.data.serial_number.vendor_specific = \
                 onu_info['vendor_specific']
-            obj.terminal.data.registration_id = \
-                '202020202020202020202020202020202020202020202020202020202020202020202020'
+            obj.terminal.data.registration_id = onu_info['reg_id']
             self.log.info('deactivating-ONU-in-olt',
                           onu_details=obj)
             yield self.stub.BalCfgSet(obj, timeout=GRPC_TIMEOUT)
