From c985210668484c03b3c3a923df7544cf9e56e72d Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@openairinterface.org>
Date: Thu, 11 Aug 2022 15:44:47 +0200
Subject: [PATCH] Update SA b200 Quectel config to 20 MHz

---
 ... => gnb.sa.band78.fr1.51PRB.usrpb210.conf} | 85 +++----------------
 .../yaml_files/sa_b200_gnb/docker-compose.yml |  2 +-
 docker/scripts/generateTemplate.py            |  2 +-
 docker/scripts/gnb_parameters.yaml            |  2 +-
 4 files changed, 16 insertions(+), 75 deletions(-)
 rename ci-scripts/conf_files/{gnb.sa.band78.fr1.106PRB.usrpb210.conf => gnb.sa.band78.fr1.51PRB.usrpb210.conf} (79%)

diff --git a/ci-scripts/conf_files/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.sa.band78.fr1.51PRB.usrpb210.conf
similarity index 79%
rename from ci-scripts/conf_files/gnb.sa.band78.fr1.106PRB.usrpb210.conf
rename to ci-scripts/conf_files/gnb.sa.band78.fr1.51PRB.usrpb210.conf
index b82944805a..6080ac58aa 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.fr1.106PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.fr1.51PRB.usrpb210.conf
@@ -17,9 +17,8 @@ gNBs =
 
     ////////// Physical parameters:
 
-    min_rxtxtime                                              = 2;
-    do_CSIRS                                                  = 1;
-    do_SRS                                                    = 1;
+    do_CSIRS                                                  = 0;
+    do_SRS                                                    = 0;
 
      pdcch_ConfigSIB1 = (
       {
@@ -36,21 +35,21 @@ gNBs =
 
 #  downlinkConfigCommon
     #frequencyInfoDL
-      # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
-      absoluteFrequencySSB                                             = 641280;
+      # this is 3300.30 MHz + (19 PRBs + 10 SCs)@30kHz SCS (GSCN: 7715)
+      absoluteFrequencySSB                                             = 620736;
       dl_frequencyBand                                                 = 78;
-      # this is 3600 MHz
-      dl_absoluteFrequencyPointA                                       = 640008;
+      # this is 3300.30 MHz
+      dl_absoluteFrequencyPointA                                       = 620020;
       #scs-SpecificCarrierList
         dl_offstToCarrier                                              = 0;
 # subcarrierSpacing
 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
         dl_subcarrierSpacing                                           = 1;
-        dl_carrierBandwidth                                            = 106;
+        dl_carrierBandwidth                                            = 51;
      #initialDownlinkBWP
       #genericParameters
         # this is RBstart=27,L=48 (275*(L-1))+RBstart
-        initialDLBWPlocationAndBandwidth                               = 28875; # 6366 12925 12956 28875 12952
+        initialDLBWPlocationAndBandwidth                               = 13750;
 # subcarrierSpacing
 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
         initialDLBWPsubcarrierSpacing                                   = 1;
@@ -66,11 +65,11 @@ gNBs =
 # subcarrierSpacing
 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
       ul_subcarrierSpacing                                          = 1;
-      ul_carrierBandwidth                                           = 106;
+      ul_carrierBandwidth                                           = 51;
       pMax                                                          = 20;
      #initialUplinkBWP
       #genericParameters
-        initialULBWPlocationAndBandwidth                            = 28875;
+        initialULBWPlocationAndBandwidth                            = 13750;
 # subcarrierSpacing
 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
         initialULBWPsubcarrierSpacing                               = 1;
@@ -156,65 +155,6 @@ gNBs =
 
   );
 
-# Dedicated Serving Cell Configuration
-servingCellConfigDedicated = ({
-  # BWP-Downlink
-    # BWP 1 Configuration
-      dl_bwp-Id_1 = 1;
-      dl_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW)
-      # subcarrierSpacing
-      # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
-      dl_bwp1_subcarrierSpacing = 1;
-
-    # BWP 2 Configuration
-      dl_bwp-Id_2 = 2;
-      dl_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW)
-      # subcarrierSpacing
-      # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
-      dl_bwp2_subcarrierSpacing = 1;
-
-    # BWP 3 Configuration
-      dl_bwp-Id_3 = 3;
-      dl_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW)
-      # subcarrierSpacing
-      # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
-      dl_bwp3_subcarrierSpacing = 1;
-
-    firstActiveDownlinkBWP-Id = 1;  #BWP-Id
-    defaultDownlinkBWP-Id     = 1;  #BWP-Id
-
-    # bwp-InactivityTimer                 ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30,
-    #                                                ms40,ms50, ms60, ms80,ms100, ms200,ms300, ms500,
-    #                                                ms750, ms1280, ms1920, ms2560, spare10, spare9, spare8,
-    #                                                spare7, spare6, spare5, spare4, spare3, spare2, spare1 }
-
-  # UplinkConfig
-    # BWP-Uplink
-      # BWP 1 Configuration
-        ul_bwp-Id_1 = 1;
-        ul_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW)
-        # subcarrierSpacing
-        # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
-        ul_bwp1_subcarrierSpacing = 1;
-
-      # BWP 2 Configuration
-        ul_bwp-Id_2 = 2;
-        ul_bwp2_locationAndBandwidth = 13750; // RBstart=0, L=51 (20 MHz BW)
-        # subcarrierSpacing
-        # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
-        ul_bwp2_subcarrierSpacing = 1;
-
-      # BWP 3 Configuration
-        ul_bwp-Id_3 = 3;
-        ul_bwp3_locationAndBandwidth = 6325; // RBstart=0, L=24 (10 MHz BW)
-        # subcarrierSpacing
-        # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
-        ul_bwp3_subcarrierSpacing = 1;
-
-      firstActiveUplinkBWP-Id = 1;  #BWP-Id
-  }
-);
-
     # ------- SCTP definitions
     SCTP :
     {
@@ -252,6 +192,7 @@ MACRLCs = (
   tr_n_preference             = "local_RRC";
   pusch_TargetSNRx10          = 200;
   pucch_TargetSNRx10          = 200;
+  ul_prbblack_SNR_threshold   = 10;
   ulsch_max_frame_inactivity  = 0;
 }
 );
@@ -271,8 +212,8 @@ RUs = (
   local_rf       = "yes"
   nb_tx          = 1
   nb_rx          = 1
-  att_tx         = 10;
-  att_rx         = 10;
+  att_tx         = 14;
+  att_rx         = 14;
   bands          = [78];
   max_pdschReferenceSignalPower = -27;
   max_rxgain                    = 114;
diff --git a/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml
index 9ea52c1247..36426746c0 100644
--- a/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml
+++ b/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml
@@ -20,7 +20,7 @@ services:
             GNB_NGA_IP_ADDRESS: 192.168.68.194
             GNB_NGU_IF_NAME: eth0
             GNB_NGU_IP_ADDRESS: 192.168.68.194
-            USE_ADDITIONAL_OPTIONS: --sa -E -q --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function
+            USE_ADDITIONAL_OPTIONS: --sa -q --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function
         volumes:
             - /dev:/dev
         networks:
diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py
index 1d5dbb5cb5..9ad4f3c5e6 100644
--- a/docker/scripts/generateTemplate.py
+++ b/docker/scripts/generateTemplate.py
@@ -60,7 +60,7 @@ def main():
                              "rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
                              "gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
                              "gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
-                             "gnb.sa.band78.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+                             "gnb.sa.band78.fr1.51PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
                              "gnb.sa.band66.fr1.106PRB.usrpn300.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
                              "gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
                              "gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
diff --git a/docker/scripts/gnb_parameters.yaml b/docker/scripts/gnb_parameters.yaml
index 524c6fbb42..0d1a02974b 100644
--- a/docker/scripts/gnb_parameters.yaml
+++ b/docker/scripts/gnb_parameters.yaml
@@ -109,7 +109,7 @@
     - key: parallel_config
       env: "@THREAD_PARALLEL_CONFIG@"
 
-  - filePrefix: gnb.sa.band78.fr1.106PRB.usrpb210.conf
+  - filePrefix: gnb.sa.band78.fr1.51PRB.usrpb210.conf
     outputfilename: "gnb.sa.tdd.b2xx.conf"
     config:
     - key: gNB_ID
-- 
2.26.2