Change in osmo-ccid-firmware[master]: switch UART debug to SIM7

2019-02-27 Thread Kévin Redon
Kévin Redon has abandoned this change. ( https://gerrit.osmocom.org/13053 )

Change subject: switch UART debug to SIM7
..


Abandoned

SERCOM7 will be used as UART debug for now (R&D) and can be replaced in the 
future with SWO
--
To view, visit https://gerrit.osmocom.org/13053
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Idfbd067b4b0e2034337732da2ff5b7cfef8fe4ae
Gerrit-Change-Number: 13053
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ccid-firmware[master]: switch UART debug to SIM7

2019-02-26 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/13053


Change subject: switch UART debug to SIM7
..

switch UART debug to SIM7

SERCOM7 will mainly be used for the SIM7 interface.
only if SIM7 is not present, the UART can be remapped to
UART_debug.

Change-Id: Idfbd067b4b0e2034337732da2ff5b7cfef8fe4ae
---
M sysmoOCTSIM/atmel_start_config.atstart
M sysmoOCTSIM/atmel_start_pins.h
M sysmoOCTSIM/config/hpl_sercom_config.h
M sysmoOCTSIM/driver_init.c
M sysmoOCTSIM/driver_init.h
M sysmoOCTSIM/examples/driver_examples.c
M sysmoOCTSIM/examples/driver_examples.h
M sysmoOCTSIM/main.c
8 files changed, 149 insertions(+), 190 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/53/13053/1

diff --git a/sysmoOCTSIM/atmel_start_config.atstart 
b/sysmoOCTSIM/atmel_start_config.atstart
index a301385..4590623 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -1274,9 +1274,9 @@
 configuration:
   core_gclk_selection: Generic clock generator 2
   slow_gclk_selection: Generic clock generator 3
-  UART_debug:
-user_label: UART_debug
-definition: 
Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::SERCOM7::driver_config_definition::UART::HAL:Driver:USART.Async
+  SIM7:
+user_label: SIM7
+definition: 
Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::SERCOM7::driver_config_definition::USART.with.ISO7816::HAL:Driver:USART.Async
 functionality: USART
 api: HAL:Driver:USART_Async
 configuration:
@@ -1285,30 +1285,28 @@
   usart_arch_cloden: false
   usart_arch_dbgstop: Keep running
   usart_arch_dord: LSB is transmitted first
-  usart_arch_enc: No encoding
-  usart_arch_fractional: 0
   usart_arch_ibon: false
-  usart_arch_lin_slave_enable: Disable
   usart_arch_runstdby: false
-  usart_arch_sampa: 7-8-9 (3-4-5 8-bit over-sampling)
-  usart_arch_sampr: 16x arithmetic
   usart_arch_sfde: false
-  usart_baud_rate: 921600
+  usart_baud_rate: 9600
   usart_character_size: 8 bits
-  usart_parity: No parity
+  usart_dsnack: The successive receive NACK is disable.
+  usart_gtime: 2-bit times
+  usart_inack: NACK is transmitted when a parity error is received.
+  usart_inverse_enabled: false
+  usart_iso7816_type: T=0
+  usart_maxiter: 7
+  usart_parity: Even parity
   usart_rx_enable: true
   usart_stop_bit: One stop bit
   usart_tx_enable: true
 optional_signals: []
 variant:
-  specification: TXPO=0, RXPO=1, CMODE=0
+  specification: TXPO=2, RXPO=0
   required_signals:
   - name: SERCOM7/PAD/0
-pad: PB30
-label: TX
-  - name: SERCOM7/PAD/1
-pad: PB31
-label: RX
+pad: PB21
+label: RX/TX
 clocks:
   domain_group:
 nodes:
@@ -1503,6 +1501,12 @@
 mode: Peripheral IO
 user_label: SIM3_IO
 configuration: null
+  SIM7_IO:
+name: PB21
+definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB21
+mode: Peripheral IO
+user_label: SIM7_IO
+configuration: null
   VB0:
 name: PA20
 definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA20
@@ -1557,18 +1561,6 @@
 mode: Digital output
 user_label: SDA4
 configuration: null
-  UART_TX:
-name: PB30
-definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB30
-mode: Peripheral IO
-user_label: UART_TX
-configuration: null
-  UART_RX:
-name: PB31
-definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB31
-mode: Peripheral IO
-user_label: UART_RX
-configuration: null
   SCL2:
 name: PB02
 definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB02
diff --git a/sysmoOCTSIM/atmel_start_pins.h b/sysmoOCTSIM/atmel_start_pins.h
index 60b70bb..c877d5e 100644
--- a/sysmoOCTSIM/atmel_start_pins.h
+++ b/sysmoOCTSIM/atmel_start_pins.h
@@ -50,8 +50,7 @@
 #define SDA1 GPIO(GPIO_PORTB, 15)
 #define SIM5_IO GPIO(GPIO_PORTB, 16)
 #define SIM3_IO GPIO(GPIO_PORTB, 20)
-#define UART_TX GPIO(GPIO_PORTB, 30)
-#define UART_RX GPIO(GPIO_PORTB, 31)
+#define SIM7_IO GPIO(GPIO_PORTB, 21)
 #define SIM0_INT GPIO(GPIO_PORTC, 0)
 #define SIM1_INT GPIO(GPIO_PORTC, 1)
 #define SIM2_INT GPIO(GPIO_PORTC, 2)
diff --git a/sysmoOCTSIM/config/hpl_sercom_config.h 
b/sysmoOCTSIM/config/hpl_sercom_config.h
index 735fdc2..64607bb 100644
--- a/sysmoOCTSIM/config/hpl_sercom_config.h
+++ b/sysmoOCTSIM/config/hpl_sercom_config.h
@@ -1931,13 +1931,11 @@
 #endif

 //  Frame parity
-// <0x0=>No parity
 // <0x1=>Even parity
-// <0x2=>Odd parity
 //  Parity bit mode for USART frame
 //  usart_parity
 #ifndef CONF_SERCOM_7_USART_PARITY
-#define CONF_SERCOM_7_USART_PARITY 0x0
+#define CONF_SERCOM_7_USART_PARITY 1
 #endif

 //  Character Size
@@ -1961,11 +1959,75 @@
 #define CONF_SERCOM_7_USART_SBMODE 0
 #endif

-//  Baud ra