lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2022

  • 2 participants
  • 1343 discussions
Change in osmo-ttcn3-hacks[master]: BTS_Tests: add TC_ipa_crcx_ack_addr reproducing OS#5242
by laforge 03 May '22

03 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27995 ) Change subject: BTS_Tests: add TC_ipa_crcx_ack_addr reproducing OS#5242 ...................................................................... BTS_Tests: add TC_ipa_crcx_ack_addr reproducing OS#5242 Change-Id: Ic85904c967238555a6243a3df2d9225b957d5a5c Related: OS#5242 --- M bts/BTS_Tests.ttcn 1 file changed, 34 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index c2de538..5837a03 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -5036,6 +5036,39 @@ vc_conn.done; } +/* Make sure that CRCX ACK contains a valid listen address (see OS#5242) */ +private function f_TC_ipa_crcx_ack_addr(charstring id) runs on ConnHdlr { + var OCT4 bind_ip := f_inet_addr("192.168.1.1"); + var PortNumber bind_port := 16811; + var RSL_Message crcx_ack; + + crcx_ack := f_rsl_transceive_ret(ts_RSL_IPA_CRCX(g_chan_nr, bind_ip, bind_port), + tr_RSL_IPA_CRCX_ACK(g_chan_nr, ?, ?, ?), + "IPA CRCX ACK"); + var HostName bts_bind_ip := f_inet_ntoa(crcx_ack.ies[2].body.ipa_local_ip); + if (match(bts_bind_ip, "0.0.0.0")) { + setverdict(fail, "CRCX ACK indicates nonsense addr ", bts_bind_ip); + } + + var uint16_t conn_id := crcx_ack.ies[1].body.ipa_conn_id; + f_rsl_transceive(ts_RSL_IPA_DLCX(g_chan_nr, conn_id), + tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?), + "IPA DLCX ACK"); +} +testcase TC_ipa_crcx_ack_addr() runs on test_CT { + var ConnHdlrPars pars; + var ConnHdlr vc_conn; + f_init(); + + pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM1))); + vc_conn := f_start_handler(refers(f_TC_ipa_crcx_ack_addr), pars); + vc_conn.done; + + pars := valueof(t_Pars(ts_RslChanNr_Lm(5, 0), ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM1))); + vc_conn := f_start_handler(refers(f_TC_ipa_crcx_ack_addr), pars); + vc_conn.done; +} + /*********************************************************************** * PCU Socket related tests @@ -8558,6 +8591,7 @@ execute( TC_ipa_crcx_mdcx_dlcx_not_active() ); execute( TC_ipa_crcx_mdcx_mdcx_dlcx_not_active() ); execute( TC_ipa_crcx_sdcch_not_active() ); + execute( TC_ipa_crcx_ack_addr() ); if (mp_pcu_socket != "") { execute( TC_paging_imsi_200percent_with_ps() ); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic85904c967238555a6243a3df2d9225b957d5a5c Gerrit-Change-Number: 27995 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX
by laforge 03 May '22

03 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27993 ) Change subject: library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX ...................................................................... library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX Change-Id: I7c36c3de1716968bccb07b03d2141d9abb3c175f Related: OS#5242 --- M library/RSL_Types.ttcn 1 file changed, 36 insertions(+), 7 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index ccd43e6..b04a13a 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -2092,6 +2092,39 @@ /* Abis/IP specific messages */ + private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr, + template (omit) OCT4 remote_ip, + template (omit) uint16_t remote_port) + return RSL_IE_List { + var RSL_IE_List ies; + + /* Channel Number is a mandatory IE */ + ies := { + valueof(RSL_IE:{ + iei := RSL_IE_CHAN_NR, + body := { chan_nr := chan_nr } + }) + }; + /* Remote IP / Port are optional IEs */ + if (not istemplatekind(remote_ip, "omit")) { + ies := ies & { + valueof(RSL_IE:{ + iei := RSL_IE_IPAC_REMOTE_IP, + body := { ipa_remote_ip := remote_ip } + }) + }; + } + if (not istemplatekind(remote_port, "omit")) { + ies := ies & { + valueof(RSL_IE:{ + iei := RSL_IE_IPAC_REMOTE_PORT, + body := { ipa_remote_port := remote_port } + }) + }; + } + + return ies; + } template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := { msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), msg_type := RSL_MT_IPAC_CRCX, @@ -2102,15 +2135,11 @@ } template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr, - template (value) OCT4 remote_ip := '7F000001'O, - template (value) uint16_t remote_port := 6766) := { + template (omit) OCT4 remote_ip := omit, + template (omit) uint16_t remote_port := omit) := { msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), msg_type := RSL_MT_IPAC_CRCX, - ies := { - t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), - t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}), - t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}) - } + ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port) } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I7c36c3de1716968bccb07b03d2141d9abb3c175f Gerrit-Change-Number: 27993 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: BTS_Tests: workaround addr='0.0.0.0' in f_rtpem_activate()
by laforge 03 May '22

03 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27994 ) Change subject: BTS_Tests: workaround addr='0.0.0.0' in f_rtpem_activate() ...................................................................... BTS_Tests: workaround addr='0.0.0.0' in f_rtpem_activate() If a CRXC message contains optional remote IP and port IEs, the CRCX ACK received from the BTS is expected to contain its listen address and port. In some cases osmo-bts may indicate nonsense addr='0.0.0.0', and indeed the RTP_Emulation component is not gonna like this. This makes both BTS_Tests.TC_speech_rtp_tch[fh] test cases fail whenever executed in Docker: Connection refused (unexpected) Let's work this around by sending the remote IP and port IEs in additional MDCX message and omitting them in CRCX. This mimics osmo-bsc's behavior and makes both test cases pass. Change-Id: I03453e72f62819989dfe6aa12d8bd889fced1046 Related: OS#5242 --- M bts/BTS_Tests.ttcn 1 file changed, 19 insertions(+), 7 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 06fe43b..c2de538 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -2532,16 +2532,28 @@ var PortNumber rtpem_bind_port := mp_rtpem_bind_port; f_rtpem_bind(RTPEM_CTRL, mp_rtpem_bind_ip, rtpem_bind_port); - /* Step 3: send CRCX with the configured address/port to the IUT */ - var RSL_Message rsl_pdu := f_rsl_transceive_ret( - ts_RSL_IPA_CRCX(g_chan_nr, f_inet_addr(mp_rtpem_bind_ip), rtpem_bind_port), + /* Step 3a: send CRCX to create an RTP connection at the IUT */ + var RSL_Message crcx_ack := f_rsl_transceive_ret( + /* FIXME (OS#5242): do not include Remote IP/Port IEs because + * osmo-bts would respond with nonsense listen addr='0.0.0.0'. */ + ts_RSL_IPA_CRCX(g_chan_nr, omit, omit), tr_RSL_IPA_CRCX_ACK(g_chan_nr, ?, ?, ?), "IPA CRCX ACK"); + var uint16_t conn_id := crcx_ack.ies[1].body.ipa_conn_id; - /* Step 4: connect to the IUT's address/port parsed from CRCX ACK */ - var HostName local_addr := f_inet_ntoa(rsl_pdu.ies[2].body.ipa_local_ip); - var PortNumber local_port := rsl_pdu.ies[3].body.ipa_local_port; - f_rtpem_connect(RTPEM_CTRL, local_addr, local_port); + /* Step 3b: send MDCX with the configured address/port to the IUT */ + var RSL_Message mdcx_ack := f_rsl_transceive_ret( + ts_RSL_IPA_MDCX(g_chan_nr, conn_id, + remote_ip := f_inet_addr(mp_rtpem_bind_ip), + remote_port := rtpem_bind_port, + rtp_pt2 := 0), + tr_RSL_IPA_MDCX_ACK(g_chan_nr, conn_id, ?, ?, ?), + "IPA MDCX ACK"); + + /* Step 4: connect to the IUT's address/port parsed from MDCX ACK */ + var HostName bts_bind_ip := f_inet_ntoa(mdcx_ack.ies[2].body.ipa_local_ip); + var PortNumber bts_bind_port := mdcx_ack.ies[3].body.ipa_local_port; + f_rtpem_connect(RTPEM_CTRL, bts_bind_ip, bts_bind_port); /* Step 5: set the given RTP emulation mode */ f_rtpem_mode(RTPEM_CTRL, mode); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I03453e72f62819989dfe6aa12d8bd889fced1046 Gerrit-Change-Number: 27994 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: BTS_Tests: add TC_ipa_crcx_ack_addr reproducing OS#5242
by laforge 03 May '22

03 May '22
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27995 ) Change subject: BTS_Tests: add TC_ipa_crcx_ack_addr reproducing OS#5242 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic85904c967238555a6243a3df2d9225b957d5a5c Gerrit-Change-Number: 27995 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 12:52:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: BTS_Tests: workaround addr='0.0.0.0' in f_rtpem_activate()
by laforge 03 May '22

03 May '22
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27994 ) Change subject: BTS_Tests: workaround addr='0.0.0.0' in f_rtpem_activate() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I03453e72f62819989dfe6aa12d8bd889fced1046 Gerrit-Change-Number: 27994 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 12:52:30 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX
by laforge 03 May '22

03 May '22
Attention is currently required from: fixeria, pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27993 ) Change subject: library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I7c36c3de1716968bccb07b03d2141d9abb3c175f Gerrit-Change-Number: 27993 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 12:51:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq
by laforge 03 May '22

03 May '22
Attention is currently required from: osmith, neels, pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28007 ) Change subject: bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ibbd9168f3ac2c1cd4f4577644d75499d49c2823f Gerrit-Change-Number: 28007 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 12:50:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-e1-hardware[master]: gateware/icE1usb: Use custom I2C core by default rather than SB_I2C
by laforge 03 May '22

03 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28013 ) Change subject: gateware/icE1usb: Use custom I2C core by default rather than SB_I2C ...................................................................... gateware/icE1usb: Use custom I2C core by default rather than SB_I2C SB_I2C is apparently just a pain to use and buggy and such, so use our custom one. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I1596ccbf03dd4450f519fe9b54a7fece125a7fbc --- M gateware/icE1usb/rtl/top.v 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/gateware/icE1usb/rtl/top.v b/gateware/icE1usb/rtl/top.v index 7762fb0..a2b8979 100644 --- a/gateware/icE1usb/rtl/top.v +++ b/gateware/icE1usb/rtl/top.v @@ -12,8 +12,8 @@ `default_nettype none // `define WITH_SINGLE_CHANNEL -`define WITH_SB_I2C -// `define WITH_CUSTOM_I2C +// `define WITH_SB_I2C +`define WITH_CUSTOM_I2C module top ( // E1 PHY -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28013 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I1596ccbf03dd4450f519fe9b54a7fece125a7fbc Gerrit-Change-Number: 28013 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-e1-hardware[master]: firmware: Remove a couple of questionable debug puts()
by laforge 03 May '22

03 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28014 ) Change subject: firmware: Remove a couple of questionable debug puts() ...................................................................... firmware: Remove a couple of questionable debug puts() Those were low level debug meant to be temporary and somehow ended up committed. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ie1b802f347b0de9ea82edb61faaba6094b8f4dfa --- M firmware/ice40-riscv/e1-tracer/fw_app.c M firmware/ice40-riscv/icE1usb/usb_e1.c 2 files changed, 0 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/firmware/ice40-riscv/e1-tracer/fw_app.c b/firmware/ice40-riscv/e1-tracer/fw_app.c index 3ddbf50..7db941e 100644 --- a/firmware/ice40-riscv/e1-tracer/fw_app.c +++ b/firmware/ice40-riscv/e1-tracer/fw_app.c @@ -165,8 +165,6 @@ /* SPI */ spi_init(); - puts("XXX\n"); - /* Enable USB directly */ serial_no_init(); usb_init(&app_stack_desc); diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 6fdaa91..4e52408 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -200,10 +200,6 @@ /* Next BDI */ bdi ^= 1; usb_e1->out_bdi = bdi; - - static int x = 0; - if ((x++ & 0xff) == 0xff) - puts("."); } /* Feedback endpoint */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28014 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: Ie1b802f347b0de9ea82edb61faaba6094b8f4dfa Gerrit-Change-Number: 28014 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-e1-hardware[master]: gateware/icE1usb: Replace local I2C core with no2misc one
by laforge 03 May '22

03 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28011 ) Change subject: gateware/icE1usb: Replace local I2C core with no2misc one ...................................................................... gateware/icE1usb: Replace local I2C core with no2misc one This core has been merged (and improved) upstream, so update the submodule, remove local copy and make the required tweaks. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I79fca561fee32bbaec94882b4f65c7ecaa44be11 --- M gateware/cores/no2misc M gateware/icE1usb/Makefile D gateware/icE1usb/rtl/i2c_master.v D gateware/icE1usb/rtl/i2c_master_wb.v M gateware/icE1usb/rtl/top.v 5 files changed, 7 insertions(+), 313 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/gateware/cores/no2misc b/gateware/cores/no2misc index 16103ac..f9d1d47 160000 --- a/gateware/cores/no2misc +++ b/gateware/cores/no2misc @@ -1 +1 @@ -Subproject commit 16103ac61c8f11e63e043229a0a7a085bc38bde0 +Subproject commit f9d1d47620ce81e9545287c585a5e8f0873b1661 diff --git a/gateware/icE1usb/Makefile b/gateware/icE1usb/Makefile index 790a1cb..8c3f49a 100644 --- a/gateware/icE1usb/Makefile +++ b/gateware/icE1usb/Makefile @@ -3,8 +3,6 @@ PROJ_DEPS := no2e1 no2ice40 no2misc no2usb PROJ_RTL_SRCS := $(addprefix rtl/, \ - i2c_master.v \ - i2c_master_wb.v \ led_blinker.v \ misc.v \ sr_btn_if.v \ diff --git a/gateware/icE1usb/rtl/i2c_master.v b/gateware/icE1usb/rtl/i2c_master.v deleted file mode 100644 index 16e7555..0000000 --- a/gateware/icE1usb/rtl/i2c_master.v +++ /dev/null @@ -1,192 +0,0 @@ -/* - * i2c_master.v - * - * vim: ts=4 sw=4 - * - * Copyright (C) 2019-2020 Sylvain Munaut <tnt(a)246tNt.com> - * SPDX-License-Identifier: CERN-OHL-P-2.0 - */ - -`default_nettype none - -module i2c_master #( - parameter integer DW = 3 -)( - // IOs - output reg scl_oe, - output reg sda_oe, - input wire sda_i, - - // Control - input wire [7:0] data_in, - input wire ack_in, - input wire [1:0] cmd, - input wire stb, - - output wire [7:0] data_out, - output wire ack_out, - - output wire ready, - - // Clock / Reset - input wire clk, - input wire rst -); - - // Commands - localparam [2:0] CMD_START = 3'b00; - localparam [2:0] CMD_STOP = 3'b01; - localparam [2:0] CMD_WRITE = 3'b10; - localparam [2:0] CMD_READ = 3'b11; - - // FSM states - localparam - ST_IDLE = 0, - ST_LOWER_SCL = 1, - ST_LOW_CYCLE = 2, - ST_RISE_SCL = 3, - ST_HIGH_CYCLE = 4; - - - // Signals - // ------- - - reg [2:0] state; - reg [2:0] state_nxt; - - reg [1:0] cmd_cur; - - reg [DW:0] cyc_cnt; - wire cyc_now; - - reg [3:0] bit_cnt; - wire bit_last; - - reg [8:0] data_reg; - - - // State Machine - // ------------- - - always @(posedge clk) - if (rst) - state <= ST_IDLE; - else - state <= state_nxt; - - always @(*) - begin - // Default is to stay put - state_nxt = state; - - // Act depending on current state - case (state) - ST_IDLE: - if (stb) - state_nxt = ST_LOW_CYCLE; - - ST_LOW_CYCLE: - if (cyc_now) - state_nxt = ST_RISE_SCL; - - ST_RISE_SCL: - if (cyc_now) - state_nxt = ST_HIGH_CYCLE; - - ST_HIGH_CYCLE: - if (cyc_now) - state_nxt = (cmd_cur == 2'b01) ? ST_IDLE : ST_LOWER_SCL; - - ST_LOWER_SCL: - if (cyc_now) - state_nxt = bit_last ? ST_IDLE : ST_LOW_CYCLE; - endcase - end - - // Misc control - // ------------ - - always @(posedge clk) - if (stb) - cmd_cur <= cmd; - - - // Baud Rate generator - // ------------------- - - always @(posedge clk) - if (state == ST_IDLE) - cyc_cnt <= 0; - else - cyc_cnt <= cyc_cnt[DW] ? 0 : (cyc_cnt + 1); - - assign cyc_now = cyc_cnt[DW]; - - - // Bit count - // --------- - - always @(posedge clk) - if ((state == ST_LOWER_SCL) && cyc_now) - bit_cnt <= bit_cnt + 1; - else if (stb) - case (cmd) - 2'b00: bit_cnt <= 4'h8; // START - 2'b01: bit_cnt <= 4'h8; // STOP - 2'b10: bit_cnt <= 4'h0; // Write - 2'b11: bit_cnt <= 4'h0; // Read - default: bit_cnt <= 4'hx; - endcase - - assign bit_last = bit_cnt[3]; - - - // Data register - // ------------- - - always @(posedge clk) - if ((state == ST_HIGH_CYCLE) && cyc_now) - data_reg <= { data_reg[7:0], sda_i }; - else if (stb) - // Only handle Write / Read. START & STOP is handled in IO mux - data_reg <= cmd[0] ? { 8'b11111111, ack_in } : { data_in, 1'b1 }; - - - // IO - // -- - - always @(posedge clk) - if (rst) - scl_oe <= 1'b0; - else if (cyc_now) begin - if (state == ST_LOWER_SCL) - scl_oe <= 1'b1; - else if (state == ST_RISE_SCL) - scl_oe <= 1'b0; - end - - always @(posedge clk) - if (rst) - sda_oe <= 1'b0; - else if (cyc_now) begin - if (~cmd_cur[1]) begin - if (state == ST_LOW_CYCLE) - sda_oe <= cmd_cur[0]; - else if (state == ST_HIGH_CYCLE) - sda_oe <= ~cmd_cur[0]; - end else begin - if (state == ST_LOW_CYCLE) - sda_oe <= ~data_reg[8]; - end - end - - - // User IF - // ------- - - assign data_out = data_reg[8:1]; - assign ack_out = data_reg[0]; - - assign ready = (state == ST_IDLE); - -endmodule diff --git a/gateware/icE1usb/rtl/i2c_master_wb.v b/gateware/icE1usb/rtl/i2c_master_wb.v deleted file mode 100644 index 0a54971..0000000 --- a/gateware/icE1usb/rtl/i2c_master_wb.v +++ /dev/null @@ -1,102 +0,0 @@ -/* - * i2c_master_wb.v - * - * vim: ts=4 sw=4 - * - * Wishbone wrapper with optional buffering for i2c_master core - * - * Copyright (C) 2019-2020 Sylvain Munaut <tnt(a)246tNt.com> - * SPDX-License-Identifier: CERN-OHL-P-2.0 - */ - -`default_nettype none - -module i2c_master_wb #( - parameter integer DW = 3, - parameter integer FIFO_DEPTH = 0 -)( - // IOs - output wire scl_oe, - output wire sda_oe, - input wire sda_i, - - // Wishbone - output wire [31:0] wb_rdata, - input wire [31:0] wb_wdata, - input wire wb_we, - input wire wb_cyc, - output wire wb_ack, - - output wire ready, - - // Clock / Reset - input wire clk, - input wire rst -); - - // Signals - // ------- - - wire [7:0] data_in; - wire ack_in; - wire [1:0] cmd; - wire stb; - wire [7:0] data_out; - wire ack_out; - - - // Core - // ---- - - i2c_master #( - .DW(DW) - ) core_I ( - .scl_oe (scl_oe), - .sda_oe (sda_oe), - .sda_i (sda_i), - .data_in (data_in), - .ack_in (ack_in), - .cmd (cmd), - .stb (stb), - .data_out(data_out), - .ack_out (ack_out), - .ready (ready), - .clk (clk), - .rst (rst) - ); - - - // Bus interface (no buffer) - // ------------- - - if (FIFO_DEPTH == 0) begin - // No buffer - assign wb_rdata = wb_cyc ? { ready, 22'd0, ack_out, data_out } : 32'h00000000; - - assign cmd = wb_wdata[13:12]; - assign ack_in = wb_wdata[8]; - assign data_in = wb_wdata[7:0]; - - assign stb = wb_cyc & wb_we; - - assign wb_ack = wb_cyc; - end - - - // Bus interface (FIFO) - // ------------- - - if (FIFO_DEPTH > 0) begin - - // Signals - // ------- - - - // FIFOs - // ----- - - - - end - -endmodule diff --git a/gateware/icE1usb/rtl/top.v b/gateware/icE1usb/rtl/top.v index b38f97a..fdf75a1 100644 --- a/gateware/icE1usb/rtl/top.v +++ b/gateware/icE1usb/rtl/top.v @@ -105,6 +105,7 @@ // I2C wire i2c_scl_oe; + wire i2c_scl_i; wire i2c_sda_oe; wire i2c_sda_i; @@ -319,6 +320,7 @@ .FIFO_DEPTH(0) ) i2c_I ( .scl_oe (i2c_scl_oe), + .scl_i (i2c_scl_i), .sda_oe (i2c_sda_oe), .sda_i (i2c_sda_i), .wb_rdata(wb_rdata[2]), @@ -326,34 +328,22 @@ .wb_we (wb_we), .wb_cyc (wb_cyc[2]), .wb_ack (wb_ack[2]), - .ready (), .clk (clk_sys), .rst (rst_sys) ); // IOBs SB_IO #( - .PIN_TYPE(6'b110101), - .PULLUP(1'b1), - .IO_STANDARD("SB_LVCMOS") - ) i2c_scl_iob_I ( - .PACKAGE_PIN (i2c_scl), - .OUTPUT_CLK (clk_sys), - .OUTPUT_ENABLE(i2c_scl_oe), - .D_OUT_0 (1'b0) - ); - - SB_IO #( .PIN_TYPE(6'b110100), .PULLUP(1'b1), .IO_STANDARD("SB_LVCMOS") - ) i2c_sda_iob_I ( - .PACKAGE_PIN (i2c_sda), + ) i2c_iob_I[1:0] ( + .PACKAGE_PIN ({i2c_scl, i2c_sda}), .INPUT_CLK (clk_sys), .OUTPUT_CLK (clk_sys), - .OUTPUT_ENABLE(i2c_sda_oe), + .OUTPUT_ENABLE({i2c_scl_oe, i2c_sda_oe}), .D_OUT_0 (1'b0), - .D_IN_0 (i2c_sda_i) + .D_IN_0 ({i2c_scl_i, i2c_sda_i}) ); `else -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28011 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I79fca561fee32bbaec94882b4f65c7ecaa44be11 Gerrit-Change-Number: 28011 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • ...
  • 135
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.