Change in osmo-ccid-firmware[master]: add RMII clock output

2019-02-27 Thread Kévin Redon
Kévin Redon has posted comments on this change. ( 
https://gerrit.osmocom.org/13054 )

Change subject: add RMII clock output
..


Patch Set 1:

> I don't see how this could work without a hardware bugfix, see
 > https://projects.sysmocom.de/issues/4482

right. I also noticed this issue because the clock was already configured to 
output 20 MHz, but forgot about it again.


--
To view, visit https://gerrit.osmocom.org/13054
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id8409779d2835b56bbae7db2e962034c82fa3b62
Gerrit-Change-Number: 13054
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 
Gerrit-Comment-Date: Wed, 27 Feb 2019 13:02:52 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ccid-firmware[master]: add RMII clock output

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

Change subject: add RMII clock output
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/13054
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: Id8409779d2835b56bbae7db2e962034c82fa3b62
Gerrit-Change-Number: 13054
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 


Change in osmo-ccid-firmware[master]: add RMII clock output

2019-02-26 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13054 )

Change subject: add RMII clock output
..


Patch Set 1: Code-Review-1

I don't see how this could work without a hardware bugfix, see 
https://projects.sysmocom.de/issues/4482


--
To view, visit https://gerrit.osmocom.org/13054
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id8409779d2835b56bbae7db2e962034c82fa3b62
Gerrit-Change-Number: 13054
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 26 Feb 2019 22:45:47 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: add RMII clock output

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


Change subject: add RMII clock output
..

add RMII clock output

The TLK106 Ethernet PHY requires a 50 MHz input on XI in RMII mode.
RMII_CLOCK is connected on the micro-controller on PA14 and PB11.
PA14, with note "GTXCR" on the schematic, cannot be use to provide
the 50 MHz clock since this is the clock output for GLK[0], which
is reserved for the CPU running at 120 MHz.
PB11 is the clock output pin for GCLK[5], which now divides DPLL1
at 100 MHz to the required 50 MHz.
WARNING: I did not test if the output clock signal matches the
requirement of the input clock signal.

Change-Id: Id8409779d2835b56bbae7db2e962034c82fa3b62
---
M sysmoOCTSIM/atmel_start_config.atstart
M sysmoOCTSIM/atmel_start_pins.h
M sysmoOCTSIM/config/hpl_gclk_config.h
M sysmoOCTSIM/driver_init.c
4 files changed, 52 insertions(+), 2 deletions(-)



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

diff --git a/sysmoOCTSIM/atmel_start_config.atstart 
b/sysmoOCTSIM/atmel_start_config.atstart
index 4590623..29ec468 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -734,7 +734,7 @@
   gclk_gen_4_div: 1
   gclk_gen_4_div_sel: false
   gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
-  gclk_gen_5_div: 5
+  gclk_gen_5_div: 2
   gclk_gen_5_div_sel: false
   gclk_gen_5_oscillator: Digital Phase Locked Loop (DPLL1)
   gclk_gen_6_div: 1
@@ -1453,6 +1453,16 @@
   pad_function: M
   pad_initial_level: Low
   pad_pull_config: 'Off'
+  RMII_CLOCK:
+name: PB11
+definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB11
+mode: Advanced
+user_label: RMII_CLOCK
+configuration:
+  pad_direction: Out
+  pad_function: M
+  pad_initial_level: Low
+  pad_pull_config: 'Off'
   SCL1:
 name: PB14
 definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB14
diff --git a/sysmoOCTSIM/atmel_start_pins.h b/sysmoOCTSIM/atmel_start_pins.h
index c877d5e..18a55fa 100644
--- a/sysmoOCTSIM/atmel_start_pins.h
+++ b/sysmoOCTSIM/atmel_start_pins.h
@@ -46,6 +46,7 @@
 #define SCL3 GPIO(GPIO_PORTB, 6)
 #define SDA3 GPIO(GPIO_PORTB, 7)
 #define SIM4_IO GPIO(GPIO_PORTB, 8)
+#define RMII_CLOCK GPIO(GPIO_PORTB, 11)
 #define SCL1 GPIO(GPIO_PORTB, 14)
 #define SDA1 GPIO(GPIO_PORTB, 15)
 #define SIM5_IO GPIO(GPIO_PORTB, 16)
diff --git a/sysmoOCTSIM/config/hpl_gclk_config.h 
b/sysmoOCTSIM/config/hpl_gclk_config.h
index 6b7586c..8c0beee 100644
--- a/sysmoOCTSIM/config/hpl_gclk_config.h
+++ b/sysmoOCTSIM/config/hpl_gclk_config.h
@@ -454,7 +454,7 @@
 // Generic clock generator 5 division <0x-0x>
 //  gclk_gen_5_div
 #ifndef CONF_GCLK_GEN_5_DIV
-#define CONF_GCLK_GEN_5_DIV 5
+#define CONF_GCLK_GEN_5_DIV 2
 #endif
 // 
 // 
diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c
index e56ba0d..ef9c56b 100644
--- a/sysmoOCTSIM/driver_init.c
+++ b/sysmoOCTSIM/driver_init.c
@@ -691,6 +691,45 @@

gpio_set_pin_function(SDA3, GPIO_PIN_FUNCTION_OFF);

+   // GPIO on PB11
+
+   gpio_set_pin_direction(RMII_CLOCK,
+  //  Pin direction
+  //  pad_direction
+  //  Off
+  //  In
+  //  Out
+  GPIO_DIRECTION_OUT);
+
+   gpio_set_pin_level(RMII_CLOCK,
+  //  Initial level
+  //  pad_initial_level
+  //  Low
+  //  High
+  false);
+
+   gpio_set_pin_function(RMII_CLOCK,
+ //  Pin function
+ //  pad_function
+ //  Auto : use driver pinmux if signal is 
imported by driver, else turn off function
+ //  Auto
+ //  Off
+ //  A
+ //  B
+ //  C
+ //  D
+ //  E
+ //  F
+ //  G
+ //  H
+ //  I
+ //  J
+ //  K
+ //  L
+ //  M
+ //  N
+ GPIO_PIN_FUNCTION_M);
+
// GPIO on PB14

gpio_set_pin_level(SCL1,

--
To view, visit https://gerrit.osmocom.org/13054
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: