1. 29 Jul, 2016 5 commits
  2. 18 May, 2016 1 commit
    • Alessandro Rubini's avatar
      network: prepare for network latency tests · c0a76804
      Alessandro Rubini authored
      This commit adds the Kconfig mechanism and the pfilter rules.
      The latency test socket transmists frames of a specific ether type;
      the receiver must receive all such frames.  To minimize the load on the
      packet filter, this adds a single rule: we already accept all PTPv2
      frames, so we now "OR" to this the new ethernet type.   If the feature
      is configured off, the rule uses the same PTPv2 ethertye, thus
      turning in practice into a NOP.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
  3. 04 Apr, 2016 9 commits
    • Alessandro Rubini's avatar
      syslog: report over-temperature situations and recover · 002aa4ca
      Alessandro Rubini authored
      The threshold and the repeat interval is set by Kconfig.
      The temperatures are read using the temperature framework.
      Tested in host environment:
         wrc# faketemp 90 80 10
         wrc# faketemp 90 40 20
         wrc# faketemp 20 30 40
         Jan  1 10:32:09 Temperature high: \
                                        roof:90.0000 core:80.0000 case:10.0000
         Jan  1 10:33:09 Temperature high: \
                                        roof:90.0000 core:40.0000 case:20.0000
         Jan  1 10:33:18 Temperature ok: \
                                        roof:20.0000 core:30.0000 case:40.0000
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      Kconfig: fix uart for host builds · 367c4e79
      Alessandro Rubini authored
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      Support for host builds. · cf33ae1d
      Alessandro Rubini authored
      This commit is not breaking the current status, but adds the
      ability to build on the host, to simulate and (mainly) to help
      me hack the networking code in a simpler/faster environment.
      Missing features:
      	- ptp
      	- build in i386 (currently x86-64 is hardwired)
      Also, this commit requires a change in ppsi, that I'm not going to
      commit now: we must get rid of the main function (most of that
      stuff is done win wrc_ptp.c, which we must replicate  in a unix-compatible
      This is the ppsi change
         --- a/arch-unix/Makefile
         +++ b/arch-unix/Makefile
         @@ -4,7 +4,7 @@ A := arch-$(ARCH)
          CFLAGS += -Itools
         -OBJ-y += $A/unix-startup.o \
         +OBJ-y += \
                 $A/main-loop.o \
                 $A/unix-io.o \
                 $A/unix-conf.o \
      Local changes in this commit:
            - adding CONFIG_HOST_PROCESS and the auto-generated opposites:
            - make some config option depend on !HOST_PROCESS
            - Makefile: some dependencies on HOST_PROCESS and the opposite
            - */*.mk: some dev and shell objects depend on
            CONFIG_EMBEDDED_NODE instead of CONFIG_WR_NODE (i.e.: both a
            node and an lm32)
            - new host/ subdir where some placeholders are placed
            - no sdb support on the host
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      temperature: add a fake temperature-set to show how to use it · c58702a0
      Alessandro Rubini authored
      We have three temperatures, called "roof", "core", "case"
      (yess rubi like word same lengt, s/he most love four).
      There is a "faketemp" command that can set one two or all of them.
      This allows to test negative temperatures in printouts (White Rabbit
      in Siberia does it, but we southish can't test easily).
      All temperatures are initialized to invalid. Example:
         wrc# faketemp -10 -2.5
         wrc# faketemp
         fff60000 fffd8003 80000000
         wrc# temp
         pcb:84.7500 roof:-10.0000 core:-2.4999 case:INVALID
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      temperature: add a temperature framework · e2e7d59a
      Alessandro Rubini authored
      This commit adds data structures, methods and a process to manage
      temperature.  Currently the only temperature being read is the onewire
      thermometer, so there is no difference with what we had before.
      The cost is 1.1 kB in binary size.
      Well, there is a difference: only the stat engine was reading
      temperature, while now the thermometer is read continuously (every 15
      seconds, or another Kconfig-urable interval).  This takes quite some
      CPU time (18.5ms per polling loop, but allows any user to read
      temperature (using the API we now provide) without re-reading the
      onewire bus.
      The real aim of this is monitoring a board-specific set of sensors,
      as implemented and show in the next commit.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      add pfilter_verbose, selected by Kconfig (developer mode) · dd612fb9
      Alessandro Rubini authored
      Also, this changes how to mac address is retrieved in patching pfilter
      rules. I'd better use format_mac(get_mac) for the verbose message,
      so get_mac is also the source for patching the rules.
      register and get_mac/set_mac are guaranteed to be in-sync.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      vlan: route 2 vlan numbers to Etherbone and 1 to streamer/nic · 29b77fb9
      Alessandro Rubini authored
      These numbers are only available at build time; there is no run-time
      command to change them as yet.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      shell: optionally define a build-time init command · ce0af021
      Alessandro Rubini authored
      This commit adds the possibility to build an init command in the
      binary.  It can be useful to install a number of nodes with a special
      configuration, without the need to reach the shell and/or eeprom of
      each one.
      This is useful, for example, to pass syslog configuration
      or the (yet to be implemented) definition of multiple vlans for
      etherbone and the wr fabric (frame classes 7 and 6 f the packet
      filter). Moreover, I personally love to load a master or slave node
      for testing without interacting with the node (or changing the flash
      over and over).
      This commit also makes reading of commands from storage an optional
      feature, but only in the advanced/developer options. Thus, you can
      build a wrpc that uses the build-time init commands, or the
      flash-stored init commands, both or none of them.
      Size effects:
           * no effect if you keep the defaults (no build-time init, flash init)
           * +248 bytes (+ the command itself) if you enable build-time init
           * -1696 bytes if you remove flash-based init (discouraged)
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      vlan: add one VLAN in Kconfig as an option · a444be3e
      Alessandro Rubini authored
      WARNING: wr_switch_defconfig doesn't build, this is fixed in next commit
      Unfortunately this commit makes the internal communication between
      minic and lan asymmetric: on receive the tag is discarded (and the
      longer header falls into the payload) while on transmit it must be
      provided by lan.c.
      The reason is that on receive we can trim 4 bytes from the payload,
      but on send we can't add 4 bytes without a memmove.  The functions
      receive pointers to two different header structures, so hopefully
      user errors will be signalled by the compiler.
      Still, users interact with net.c, which hides vlan completely from
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
  4. 15 Feb, 2016 1 commit
  5. 20 Jan, 2016 6 commits
    • Alessandro Rubini's avatar
      pfilter: simplify the rule-set and make it stronger. Use one set only. · e35610a6
      Alessandro Rubini authored
      This changes the pfilter rule-set, to make it ready for vlan addition.
      Moreover, it removes the choice between three rule-sets and uses one
      that works for everyone (we'll add the vlan option later on).
      Moreover, we prepare for the option of peer-delay PTP and UDP-based PTP.
      As a side effect, one Kconfig option is removed.
      We know for sure that what goes to the "streamer" protocol
      is re-checked, so the streamer can get some "everything else", exactly
      like the 7S wr-nic (that sends to the host everything unused).
      This is the current rule set:
           - everything tagged is dropped
           - CPU: arp broadcast, not unicast (i.e. requests only).
           - CPU: PTP ethtype. Any mac address.
           - CPU: ICMP unicast, not broadcast.
           - CPU: UDP (uni/multicast), ports  bootpc, ptp-event, ptp-general.
           - Etherbone (class 7): UDP (uni/multicast) and port 0xebd0
           - Other fabric (class 6): anything not Etherbone (inverted class 7 bit)
      This counts up to 28 rules. We have 4 more rules available and we may
      add options, either at build time or run time to add udp ports or
      other ethertypes.  Or not...
      2 caveats:
        - frames for the CPU will have class bits 0x41 instead of 0x01, because
        everything not etherbone will receive bit 6. This is not a problem, as
        the CPU is not checking the class bits.
        - the wr-nic gateware, when using this new sw code base, must be
        changed to use classes 6 and 7 like everybody else, not classes 7
        and 5.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      general: remove TRACE_DEV (and shrink binary) · c24326a8
      Alessandro Rubini authored
      This removes TRACE_DEV(), turning it into pll_verbose() and wrc_verbose().
      The functions are enabled and disabled by kconfig, with defaults matching
      the previous behaviour.
      So nothing changes, but the binary is smaller because the previous
      wrc_debug_printf() was silent because of a run-time conditional
      (though hardwired false at build time). The condional is now at build
      time.  We save around 2k, between strings and calling code, in
      all wrc builds (nothing is saved in wrs, which is verbose by default,
      nor in devel_build_test_defconfig where all verbose options are on)).
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      devel_build_test_defconfig: enable all verbose options
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
    • Alessandro Rubini's avatar
      config: rename CONFIG_ETHERBONE to CONFIG_IP · 53ac0936
      Alessandro Rubini authored
      Actually, Etherbone is in gateware, and this option only enables Internet
      Protocol in the software.  This fixes a long-standing misunderstanding.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      softpll: make "fifo log" optional and better. · 68ebc2e8
      Alessandro Rubini authored
      If the Kconfig option is not set, there's no effect on code size.
      If set, .bss increases by 256 bytes (the buffer) and .text by
      another 200 bytes.
      This adds timestamping support, so we know the duration of the
      interrupt (because we found it's an important thing when problems
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    • Alessandro Rubini's avatar
      config: fix wrnic/nic_pfilter · c31bcc0b
      Alessandro Rubini authored
      CONFIG_WRNIC was not used, so it is now removed.
      CONFIG_NIC_PFILTER does it all
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
  6. 08 Sep, 2015 1 commit
  7. 23 Jul, 2015 2 commits
  8. 30 Jun, 2015 1 commit
    • Adam Wujek's avatar
      wrs_main: check for stack overflow and detect reset · da3da2d9
      Adam Wujek authored
      Add checking stack overflow and detecting reset to wrs. Code common for wrpc
      and wrs is placed in system_checks.c and .h. Work is based on following
      commits in wrc_main.c:
      1704a668 main: check for stack overflow
      7836c39e Optionally detect reset and print a stack trace
      --update Kconfig to have a possibility to select CHECK_RESET also for switch,
        not only for node as before
      --and _endram to ram-wrs.ld
      When "stack overflow" occurs then message is printed once every second.
      When reset occours then LM32 will print stack trace and reset once more.
      NOTE: I couldn't get spll to work after reset, for sure problem is in
            ad9516 init function, but not only there.
      Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
  9. 08 Jan, 2015 1 commit
  10. 18 Nov, 2014 3 commits
  11. 08 Oct, 2014 1 commit
  12. 11 Feb, 2014 2 commits
  13. 06 Feb, 2014 1 commit
    • Miguel Jimenez Lopez's avatar
      dev/ep_pfilter: Updated filter rules for wr-nic (with etherbone) project. · 8accf456
      Miguel Jimenez Lopez authored
      	- Added the NIC_PFILTER configuration option in Kconfig to decide which filter rules will be used.
      	- Updated the dev/ep_pfilter.c file by using the CONFIG_NIC_PFILTER macro. This is done because packet filter does
      	not work correctly if we write all rules in the CONFIG_ETHERBONE section.
      	- We do not use the DROP instruction because all other packets go to NIC core.
      	- The filter rules to the wr-nic do not have the DROP instruction because all traffic
      	does not go to the LM32/Etherbone is re-direct to the NIC by default.
      	- The NIC_PFILTER configuration option depends on ETHERBONE one.
      	- Magic number of Etherbone packets is not checked due to the number of rules. (The packet filter is not able to classify correctly)
  14. 17 Jan, 2014 1 commit
    • Miguel Jimenez Lopez's avatar
      dev/ep_pfilter: Updated filter rules for wr-nic repository. · a5d3db16
      Miguel Jimenez Lopez authored
      - Added CONFIG_WRNIC in Kconfig to decide which filter rules will be use.
      - Updated ep_pfilter using CONFIG_WRNIC.
      - We do not use drop because all other packet goes to NIC core.
      Note: filter rules to wr-nic do not have DROP instruction because all traffic
      does not go to LM32/Etherbone is re-direct to NIC by default.
  15. 13 Nov, 2013 2 commits
  16. 17 Oct, 2013 2 commits
  17. 24 Sep, 2013 1 commit