Skip to content
Snippets Groups Projects
  1. Feb 16, 2017
  2. Apr 04, 2016
  3. Jan 20, 2016
    • Alessandro Rubini's avatar
      tool/wrpc-dump: change the access mode, to avoid "gcc -m32" · 1a18111c
      Alessandro Rubini authored
      
      Accessing data structures in the host to get target fields is broken:
      we may have different data size or alignment, or whatever. The hack
      of using "-m32" to be able to access lm32 fields from x86-64 is not
      clean (we imply the i386 and target have the same size/alignment).
      Even worse, not everybody has an x86-64 cross-compiler for i386.
      
      Thus, we use OFFSET_OF in the target, with the lm32 cross compiler,
      to build a binary table that is then accessed by the host.
      
      In order to link the data structure in the host we use the assembler
      instead of objcopy. With objcopy we'd need to spell out the bfd name
      of the host, and we'd get horrible names like
         struct dump_info _binary_dump_info_host_bin_start[];
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      1a18111c
    • Alessandro Rubini's avatar
      1abb1e2c
    • Alessandro Rubini's avatar
      tools: build wrpc-dump with "-m32" flag (well, we assume PC host) · b607fb06
      Alessandro Rubini authored
      
      This fixes the problem with data sizes when building on a 64-bit host.
      Now the dump of ppi makes sense, besides endianness.
      
      Please note how this requires a cross-compile environment for i386
      when you build on x86-64. Later on this requirement is lifted.
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      b607fb06
    • Alessandro Rubini's avatar
      tools: initial wrpc-dump, still bugged · f3dafc70
      Alessandro Rubini authored
      
      The tool is meant to print internal data structures of the wrpc,
      by running either on a dump file or a live system.
      
      The code is an edited copy of wr-switch-sw/userspace/tools/wrs_dump_shmem.c,
      so the data-dumping mechanism is from there.
      
      bugs at this point:
         - all endianness stuff is bad (in wrs it was local, here we cross-dump)
         - data sizes are wrong (see next commit)
         - we miss checks for consistency
         - we can't open /dev/mem (for spec for example) or a elf file
         - docs are missing too
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      f3dafc70
  4. Jan 15, 2016
  5. Oct 13, 2015
    • Alessandro Rubini's avatar
      tools/pfilter-builder: completed · d52fdb87
      Alessandro Rubini authored
      
      This changes pfilter-builder.c so it really build in user space, but removing
      register setting and creating output files instead.
      
      Running this program creates 3 files, that correspond to the previous
      three #ifdef conditions.  The files are:
      
            rules-plain.bin    this is used for the no-etherbone configuration
            rules-ebone.bin    etherbone setup
            rules-e+nic.bin    etherbon plus 7solution's wr-nic packet filter
      
      The files begin with a magix 0x11223344 word, that allows the soft-core
      to fix any endianness difference (so no hairy mishaps are expected when
      switching to a different soft-core). Then the 40-bit command words are
      saved as 64-bit vaules, LSB-first. The output file is thus an odd number
      of words and no 64-bit alignment is required.
      
      The first three instructions of the packet filter are used to compare
      the destination mac address of the frame.  We now use a fake mac address,
      and the LM32 code will change it while programming the binary.
      
      Please look at this commit while ignoring white-space, as it changes
      indentation while turning #ifdef/#else into if()/else .
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      d52fdb87
  6. Sep 28, 2015
  7. Jan 06, 2015
  8. Nov 14, 2013
  9. Oct 25, 2013
  10. May 20, 2013
    • Alessandro Rubini's avatar
    • Alessandro Rubini's avatar
      tools/wrpc-w1-read.c: read w1 eeprom from user space · ae81022b
      Alessandro Rubini authored
      This reads to stdout, in binary format. With "-v" it prints text and
      scans the bus too. The examples here below use the same card (and same
      data) as in commit "d44ace7e
      
       w1: complete eeprom low-level support".
      
         spusa.root# ./tools/wrpc-w1-read -b 2 0 5 | od -t u1 -Ax -w1
         000000  40
         000001  41
         000002  42
         000003 243
         000004 244
      
         spusa.root# ./tools/wrpc-w1-read -v -b 2 30 6
         ./ohwr/wrpc-sw/tools/wrpc-w1-read: found device 10dc:018d: 0000:02:00.0
         ./ohwr/wrpc-sw/tools/wrpc-w1-read: found device 10dc:018d: 0000:04:00.0
         device 0: 68000801dce56910
         device 1: 5b0000036c567628
         device 2: f70000001eda8242
         device 3: 5f00000040e50143
         Reading device on bus 2: offset 30 (0x1e), len 6
         offset   30 (0x01e):  11 (0x0b)
         offset   31 (0x01f):  22 (0x16)
         offset   32 (0x020):  33 (0x21)
         offset   33 (0x021):  44 (0x2c)
         offset   34 (0x022):  55 (0x37)
         offset   35 (0x023):  66 (0x42)
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      ae81022b
  11. Apr 09, 2013
  12. Apr 04, 2013
  13. Apr 03, 2013
  14. Mar 05, 2013
  15. Oct 05, 2012
    • Alessandro Rubini's avatar
      Remove all spaces at end-of-line · 1d24ecfb
      Alessandro Rubini authored
      If you find this patch with "git blame" please use "git blame -w"
      to have all white-space ignored while associating lines to commits.
      
      This commit has no practical effect but cleanup. I made it
      with sed like this:
      
        git grep -l '[ \t]$' | xargs sed -i 's/[ \t]*$//'
      
      However, I had to manually restore doc/wrpc_mon.png after the fact.
      Similarly, I restored the include/hw/*regs.h files, as they
      are (most likely) auto-generated.
      1d24ecfb
  16. Jun 28, 2012
  17. Jun 13, 2012
  18. Jan 18, 2012
  19. Nov 06, 2011
  20. Aug 22, 2011
  21. Apr 08, 2011