[VOL-4627] Add COMBO pon configuration and NNI speed flag

Change-Id: Ic321601634f850102dcd3082938082898abe4ffb
diff --git a/bbsim/Chart.yaml b/bbsim/Chart.yaml
index c870561..389f00b 100644
--- a/bbsim/Chart.yaml
+++ b/bbsim/Chart.yaml
@@ -16,5 +16,5 @@
 description: Broadband Simulator
 icon: https://guide.opencord.org/logos/cord.svg
 apiVersion: v1
-version: 4.6.0
-appVersion: 1.10.0
+version: 4.7.0
+appVersion: 1.11.0
diff --git a/bbsim/templates/configmap-pon.yaml b/bbsim/templates/configmap-pon.yaml
new file mode 100644
index 0000000..750e8ce
--- /dev/null
+++ b/bbsim/templates/configmap-pon.yaml
@@ -0,0 +1,23 @@
+---
+# Copyright 2022-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This configmap mounts a yaml file in the container to describe the pon ports configuration
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: bbsim-pon-ports-{{ .Values.olt_id }}
+data:
+  bbsimPonPortsConfig: |
+{{ toYaml .Values.ponPortsConfig | indent 4 }}
diff --git a/bbsim/templates/deployment.yaml b/bbsim/templates/deployment.yaml
index 4e1cfe4..aaa57f2 100644
--- a/bbsim/templates/deployment.yaml
+++ b/bbsim/templates/deployment.yaml
@@ -12,7 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-{{- $log_level := tpl .Values.log_level . }}
+{{- $log_level := tpl .Values.log_level . | lower }}
 
 apiVersion: apps/v1
 kind: Deployment
@@ -76,6 +76,7 @@
             "-dmi_server_address", ":{{ .Values.bbsim_dmi_port}}",
             "-olt_id", "{{ .Values.olt_id }}",
             "-nni", "{{ .Values.nni }}",
+            "-nni_speed", "{{ .Values.nni_speed }}",
             "-pon", "{{ .Values.pon }}",
             "-onu", "{{ .Values.onu }}",
             "-uni", "{{ .Values.uni }}",
@@ -85,6 +86,9 @@
             "-logLevel", "{{ $log_level }}",
             "-delay", "{{ .Values.delay }}",
             "-services", "configs/services.yaml",
+            {{ if .Values.ponPortsConfig -}}
+            "-pon_port_config_file", "configs/pon-config.yaml",
+            {{ end -}}
             "-rest_api_address", ":{{ .Values.bbsim_rest_port }}",
             "-ca", "{{ .Values.controlledActivation }}",
             "-omci_response_rate", "{{ .Values.omci_response_rate }}",
@@ -134,6 +138,9 @@
             - name: bbsim-services-config
               mountPath: /app/configs/services.yaml
               subPath: services.yaml
+            - name: bbsim-pon-ports-config
+              mountPath: /app/configs/pon-config.yaml
+              subPath: pon-config.yaml
       volumes:
         - name: bbsim-services-config
           configMap:
@@ -141,6 +148,12 @@
             items:
               - key: bbsimServicesConfig
                 path: services.yaml
+        - name: bbsim-pon-ports-config
+          configMap:
+            name: bbsim-pon-ports-{{ .Values.olt_id }}
+            items:
+              - key: bbsimPonPortsConfig
+                path: pon-config.yaml
     {{- with .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml . | indent 8 }}
diff --git a/bbsim/values.yaml b/bbsim/values.yaml
index 4983744..8d589ed 100644
--- a/bbsim/values.yaml
+++ b/bbsim/values.yaml
@@ -25,6 +25,7 @@
 # CLI switches passed to bbsim
 olt_id: 0
 nni: 1
+nni_speed: 10000 # in Mbps (= 1Gbps)
 pon: 1
 onu: 1
 uni: 4
diff --git a/examples/pon-interfaces-config.yaml b/examples/pon-interfaces-config.yaml
new file mode 100644
index 0000000..9f0e02a
--- /dev/null
+++ b/examples/pon-interfaces-config.yaml
@@ -0,0 +1,36 @@
+---
+
+# Copyright 2022-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file shows how to pass a custom pon configuration
+# with `-f examples/pon-interfaces-config.yaml`
+
+ponPortsConfig:
+  num_pon_ports: 1
+  ranges:
+    -
+      pon_id_range:
+        start: 0
+        end: 0
+      tech: "XGS-PON"
+      onu_id_range:
+        start: 1
+        end: 1
+      alloc_id_range:
+        start: 1024
+        end: 1028
+      gemport_id_range:
+        start: 1024
+        end: 1056
\ No newline at end of file