Skip to content
Snippets Groups Projects
  1. Jan 29, 2019
    • Brian Bosak's avatar
      [ddk][api] Add API to get length of device metadata · 064e4d27
      Brian Bosak authored
      This patch adds a new method (device_get_metadata_size) to the DDK API, which allows
      the retrieval of the size of a given metadata key on a device.
      
      Test: runtests -t driver-test
      Change-Id: Ib2535b17e3e2b6b9bc225835d6ac27e288aadd52
      064e4d27
    • George Kulakowski's avatar
      [devmgr] Clean up a small TODO in fshost.h · a7e10c8e
      George Kulakowski authored
      Test: booted with qemu arm under asan
      Change-Id: Ia758a685c1ad031e090e8d2e16294ff06ef765a8
      a7e10c8e
    • George Kulakowski's avatar
      [userboot] Add MAINTAINERS · f52b0dfb
      George Kulakowski authored
      Test: no functional change
      Change-Id: Ia9f47f89e010fa8449326a6a3ff0c2070e03f713
      f52b0dfb
    • Bruce Mitchener's avatar
      [kernel][public] Comment typo fixes. · e60c3af1
      Bruce Mitchener authored
      TEST: No behavior change
      Change-Id: I4b5a065db7e616c63710076b576872390af6cbb0
      e60c3af1
    • Venkatesh Srinivas's avatar
      [virtio] scsi: Correct loop conditions for target/LUN scan · 04724ae7
      Venkatesh Srinivas authored
      1) Remove support for scanning non-zero channels.
         virtio-scsi's config space has a field for 'max_channels',
         but the device can only encode channel 0 targets. Remove
         the max_channel loop since we can't use non-zero channels.
      
      2) Use <= (rather than <) for max_target/max_lun comparison.
         QEMU and GCE's hypervisor disagree on the definition of the
         max_target and max_lun fields. The virtio spec is ambiguous
         as to which definition is correct. Use <= conservatively to
         not skip targets.
      
      ZX-2314
      
      Tested:
      1) QEMU: finds target 0:1:1
      ./scripts/run-zircon-x64 -- -drive if=none,id=hd,file=/tmp/blk.img \
          -device virtio-scsi-pci,id=scsi  -device scsi-hd,drive=hd,scsi-id=1,lun=1
      
      2) GCE -- finds target 1:0.
      
      Change-Id: I684d67b8fc7449c72b14290ce88f226e00def672
      04724ae7
    • Roland McGrath's avatar
      [scripts] Fix download-prebuilt --no-cipd for qemu case · ebaf2460
      Roland McGrath authored
      The script got out of synch when the CIPD package for qemu
      started using the third_party/ prefix on the package name.
      Fix it up.
      
      Test: ./scripts/download-prebuilt --no-cipd succeeds and prebuilts/downloads/qemu is current
      Change-Id: I90dafd26a443318e671ba25b3fb9679c9735713f
      ebaf2460
    • Venkatesh Srinivas's avatar
      [virtio] scsi: Correctly handle command completion · 2e169c4b
      Venkatesh Srinivas authored
      Correct a bug in how ExecuteCommandSync called IrqRingUpdate that would
      cause the scan worker thread to wait forever.
      
      virtio ring::IrqRingUpdate will invoke a passed-in functor on descriptor
      chains completed by the device. However if no descriptor chains were
      completed, it would not call the functor. (I had assumed at first skim
      that it would have waited instead).
      
      Modify ExecuteCommandSync to keep invoking IrqRingUpdate with 5 mS steps
      until the command completes with either an error or success. Later we will
      wire up interrupt mode support, to avoid this 5 mS polling looping.
      
      ZX-2314
      
      Tested:
      1) Booted on GCE, dm dump displayed the virtio-scsi target at 1-0.
      
      2) Still boots on QEMU (qemu masked the error by synchronously processing
         control commands).
      
                  [00:02.0] pid=2006 /boot/driver/bus-pci.so
                     <00:02.0> pid=2884 /boot/driver/bus-pci.proxy.so
                        [virtio-scsi] pid=2884 /boot/driver/virtio.so
                           [scsi-disk-1-1] pid=2884 /boot/driver/virtio.so
      
      Both QEMU and GCE tests need the LUN encoding fix included (see 239313) for
      tests to work.
      
      Change-Id: I9a0d8f5860f11cf1f4b900ebe3c5c4cf76a060cd
      2e169c4b
    • Gianfranco Valentino's avatar
      [zxtest] Fix unused and format warning. · 4a44daee
      Gianfranco Valentino authored
      TEST=zxtest-test,zxtest-integration-test
      
      Change-Id: I4e99d431431c3d5a09b5e640a9ec4a49a435ed1b
      4a44daee
    • Venkatesh Srinivas's avatar
      [virtio] scsi: Unit test encoding of LUNs · e8841a0a
      Venkatesh Srinivas authored
      virtio-scsi must encode targets/LUNs into a single level LUN structure.
      Originally we had a bug in the logic that did so (neglected to set
      ADDRESS METHOD field). The parent commit to this one fixed the bug; add a
      unit test to ensure it stays fixed.
      
      ZX-2314
      
      Tested: Built, run unit tests
      
      Change-Id: I2e7468ecb7511890acba8bc17bcb854d75ca6fde
      e8841a0a
    • Venkatesh Srinivas's avatar
      [virtio] scsi: Fix encoding of LUNs · 8e9c6a63
      Venkatesh Srinivas authored
      virtio-scsi requires Target/LUN pairs be encoded into an 8-byte buffer
      in a particular format --
      
      1. First byte set to 1
      2. Second byte set to target
      3. Third and fourth byte representing a 'single level LUN structure'
      
      Per the SCSI Architecture Manual, the single-level format we should
      be using is the flat addressing method (table 6, SAM-3 T10/02-119r0) or
      (tabel 9, Flat space addressing, SAM-3 T10/02-119r0).
      
      Bits 7-6 of the low byte should be '01'. Then we should pack the 6 MSBs
      of the LUN into the low byte and the 8 LSBs into the high byte.
      
      The prior version of this code did not set the address method (implicit
      Peripheral device address method) and incorrectly mashed the LUN for
      that mode.
      
      ZX-2314
      
      Tested: With the correct loop condition CR, booted on GCE and QEMU.
      Tested that expected LUNs were found and bound to virtio.so
      
      Change-Id: I6b4a53ea16dec0962233d143660744edd012dfc8
      8e9c6a63
    • John Bauman's avatar
      [bus][platform] Don't bind platform bus proxy for platform-proto devices · 3c682900
      John Bauman authored
      platform-bus.proxy.so is being bound instead of sysmem.proxy.so
      (probably because it's enumerated first).
      
      Test: boot on VIM2
      Change-Id: Ib656525fe4dca8b7821d34b7773c268c760aa03a
      3c682900
    • Jocelyn Dang's avatar
      [usb-bus] Opt out of USB callbacks part 1 · 99ed3be3
      Jocelyn Dang authored
      Handles the simple case where all requests complete successfully.
      
      Remove old batch_cb API.
      
      Also modifies testing so we can specify when we want to set or expect
      a callback. Currently those fields are equal in the tests, but will
      not necessarily be when we start testing with set_error=true.
      
      Part 2 will track queued / silently completed requests and handle
      callbacks for the error cases.
      
      ZX-932 #comment
      
      TEST= plug in FX3 and run: fx shell usb-fwloader && runtests -t usb-test
      
      Change-Id: I596c18b3e0edac25638214977e3668b4efccbe38
      99ed3be3
    • Cristián Donoso's avatar
      [zx_system_get_features] Added HW debug registers info. · 4b1dfd3f
      Cristián Donoso authored
      This permits userspace to query about how many debug registers
      the system has.
      
      This also removes a hack used in arm64 to pass the information to the
      debugger.
      
      ZX-3038  # Done
      
      TEST=manual
      
      Change-Id: I2d020b17a146b470a2f76fb97205b6516bc85cad
      4b1dfd3f
  2. Jan 28, 2019
    • Andres Oportus's avatar
      [mt8167][gpio] Move binding to use file for unit testing · 8ef8f00c
      Andres Oportus authored
      In order to use mt8167-gpio.cpp in unit tests, the binding for the
      regular devmgr needs to be done in a different file.
      
      Test: Boot on MT8167 ref board.
      Change-Id: I3fe3aa05bfae11c707199b2b970fbe1f526f5a1e
      8ef8f00c
    • Mike Voydanoff's avatar
      [dev][gpio-test] Rewrite in C++ · 104d10be
      Mike Voydanoff authored
      Also removed unnecessary thread and some dead code
      
      TEST: LED blinking and GPIO interrupt from button press on VIM2
      
      Change-Id: I139b3dbc4edcb5aeeaf8483c71936086a3312ff3
      104d10be
    • George Kulakowski's avatar
      [cxx][docs] Change a reference from fbl to ktl, and remove an "eventually" · 2630d7e3
      George Kulakowski authored
      Bug: ZX-3357 #comment
      Test: no functional change
      Change-Id: I042ab4263ec2bf0c155838d7ada13b17e4514224
      2630d7e3
    • rvargas's avatar
      [nand-loader] Add option to create empty ram-nand · 1483ea67
      rvargas authored
      Test: nand-loader --num-blocks 128
      Change-Id: Iecca7dd201dc57674d08034b4411dd069f13eb3e
      1483ea67
    • Travis Geiselbrecht's avatar
      [travis-ci] remove the old .travis.yml file · 49decbbf
      Travis Geiselbrecht authored
      Hasn't been used in forever.
      
      Change-Id: I2c0ffa8265c6bc5103ec332799b44607e2b7a3e1
      Tested: build zircon
      49decbbf
    • Adrian Danis's avatar
      [kernel][brwlock] Disable reader policy · a69f6cc7
      Adrian Danis authored
      Using the reader policy right now through `Guard` will allow for silently violating the
      thread analysis.
      
      ZX-3085
      
      Test: Kernel compiles, no functional changes
      
      Change-Id: I727a87b16127413383dc2c50ea5fc83dea176344
      a69f6cc7
    • Gianfranco Valentino's avatar
      [zxtest] Add base macros [3/3] · 6c68955d
      Gianfranco Valentino authored
      Added ASSERT_*/EXPECT_* macros.
      Added extended version to allows ASSERT*(..., fmt, args) so test errors
      can capture information about the local variables that might give some
      insight.
      C allows EQ for comparing primitive types and ptrs.
      C++ allows EQ for anything with operator== defined.
      
      C has  no extension for printing structs. This is, custom types are
      dumped as hex, primitive types (ptrs included) contents are dumped.
      
      In C++ an overload or specialization can be provided to display custom
      types of zxtest::PrintValue.
      
      Added test for ASSERT_/EXPECT_ both in C and C++.
      
      TEST=zxtest-test
      
      Change-Id: I11230d0adb3d66b4c9f570604b4032441ab78fcc
      6c68955d
    • David Pursell's avatar
      [socket] unify data and control plane functions · 19c2c3cf
      David Pursell authored
      It makes the syscall wrapper simpler to have SocketDispatcher use a
      parameter to select between data and control plane operations rather
      than separate functions.
      
      Test: `runtests -t socket-test`
      Change-Id: I9050bd50fe36173a38964b10e533c0ec9a687bc8
      19c2c3cf
    • Sean Klein's avatar
      [ramdisk] Remove flaky test · d7fb5156
      Sean Klein authored
      "RamdiskTestReleaseDuringFifoAccess" attempt to test that
      the ramdisk behaves properly during termination. This behavior
      is inherentely racy, as observing the test between "unbind" and
      "release" or "after release" will have different results.
      
      Rather than relying on significant implementation detail of the
      ramdisk server, delete the test.
      
      FLK-34 #done
      Test: /boot/test/sys/ramdisk-test
      
      Change-Id: I08193b929e38e092d8a0810ac1c39c82384d112f
      d7fb5156
    • Yifei Teng's avatar
      [fidl][llcpp] Unit-testing non-simple FIDL messages · 1af5c2c5
      Yifei Teng authored
      Since the llcpp server implementation is not yet ready, for this patch,
      a simple manual server is written that takes advantage of the raw llcpp
      APIs and acts as the testing harness for llcpp client code.
      
      The garnet CL used to generate the binding code is at:
      https://fuchsia-review.googlesource.com/c/garnet/+/239196
      
      TEST: /boot/test/sys/fidl-llcpp-interop
      Change-Id: I960a3282b9f74506f2a5ffafaa3ece6fa6377c69
      1af5c2c5
    • Mike Voydanoff's avatar
      [fidl][light] Add FIDL API for light drivers · d618cc58
      Mike Voydanoff authored
      This API will be used to support hardware lights such as indicator LEDs.
      The lights are identifiable by a board specific name.
      A light device may implement one or more physical lights,
      allowing for an array of LEDs grouped together
      (for example, the LED ring on the Nexus Q music player).
      Lights may be simple on/off, support a brightness value, or an RGB value.
      
      Bug: ZX-3349
      
      TEST: compiles when included in astro board driver.
      Change-Id: Ib1b19dd27a6cf12f7171debd4a4c8715cdbe2460
      d618cc58
    • Yifei Teng's avatar
      [fidl][llcpp] Foundations for non-simple objects · 2d60441e
      Yifei Teng authored
      Notable optimizations:
      - In the callee-allocating flavor, automatically stack allocate when
      message size is < 512. Otherwise use C++ new. No VLAs.
      - No call to fidl_linearize when a type is completely inline.
      - No call to fidl_encode when the request type is inline and has no
      handles. (boring type)
      - No call to fidl_decode when the response type is inline and has no
      handles. (boring type)
      - No reference to coding table for boring types. In the future we could
      stop generating those coding tables altogether, reducing binary size.
      - All empty/zero-arg requests/responses share the same struct
      definition, which is essentially a fidl_message_header_t.
      
      Also added a script to easily regenerate all the llcpp binding code.
      
      The garnet CL used to generate the binding code is at:
      https://fuchsia-review.googlesource.com/c/garnet/+/239196
      
      TEST: /boot/test/sys/fidl-llcpp-interop
      Change-Id: I4a31fe56d25504f3f76ea77c30b88a2f581a39df
      2d60441e
    • George Kulakowski's avatar
      [hikey] Migrate from fbl to std::atomic · 035a86e2
      George Kulakowski authored
      fbl::atomic is being removed in lieu of std::atomic.
      
      The underlying implementations are identical builtins, so there should
      be no behavior change.
      
      Bug: ZX-3357 #comment
      Test: no functional change
      Change-Id: I0538862012c3abb50e4e15e03f0a68564889091e
      035a86e2
    • Mike Voydanoff's avatar
      [dev][lib][usb] Add std::move() support to USB request queues · 0d1fa63c
      Mike Voydanoff authored
      TEST: Added unit test to usb test driver
      Change-Id: I95aaf3fad2dffc89ba536c40c355992978a5b7b2
      0d1fa63c
    • Jake Ehrlich's avatar
      [scripts] Replace old clang-format script · af46711b
      Jake Ehrlich authored
      Test: ./scripts/clang-fmt <some file> and ./scripts/clang-fmt --version
      Change-Id: Ic8c8a830e3914dc0eba9b05abf4d9a8d5dac2e12
      af46711b
    • Mike Voydanoff's avatar
      [dev][usb-bus] Rewrite driver in C++ · e0aa0705
      Mike Voydanoff authored
      TEST: manual testing on NUC and VIM2. Tested USB audio, input and storage.
            lsusb works.
      
      Change-Id: Ia5fea91385f3eb74191fd9a67bbec3242c45bcad
      e0aa0705
    • Pascal Perez's avatar
      [fidlc] Revert: Deferring Type Construction Post Raw to Flat Conversion · 52604578
      Pascal Perez authored
      This reverts commit 68817767.
      
      Test: revert
      Change-Id: I5a54da75422f863d431db1580bd9dddafcc1fabc
      52604578
    • Suraj Malhotra's avatar
      [ddk][pci] Remove map_bar API. · 4b32cd57
      Suraj Malhotra authored
      All clients have been migrated to pci_map_bar_buffer.
      
      Tested: Compiles.
      Change-Id: Ide14ba02c112e47f05ec3960a074ac4f1cd2f8fc
      4b32cd57
    • Gianfranco Valentino's avatar
      [zxtest]: Add host lib. · eafd1120
      Gianfranco Valentino authored
      Unittest library should also work for hosts.
      Added both host lib and equivalent host tests.
      
      The only dependency we had was zx::time, which is only used for
      timer purposes. On host we fallback to std C gettimeofday.
      
      TEST=zxtest-test,zxtest-integration
      
      Change-Id: I937f958dc81eaab7c51b4f0bd6955517730c4139
      eafd1120
    • Bruce Mitchener's avatar
      [dispatcher-pool] Comment typo fixes. · ff7c09cb
      Bruce Mitchener authored
      TEST: No behavior change
      Change-Id: I34fcc6d9b297ebe9633555a82d0584340b094927
      ff7c09cb
    • David Pursell's avatar
      [socket] add support for socket peek · fb7489af
      David Pursell authored
      Adds peek option to zx_socket_read() for both standard and control-plane
      messages.
      
      Socket benchmark tests don't show any significant change in speed.
      
      ZX-769 # done
      
      Test: `runtests -t socket-test`
      Test: '/pkgfs/packages/zircon_benchmarks/0/test/zircon_benchmarks -p \
                --runs 1000000 --filter Socket'
      
      Change-Id: Id312eb4889e7c2f052719980c86c75a2a1937ac4
      fb7489af
    • Sean Klein's avatar
      [ramdisk] Deprecate ioctl interface · 045340aa
      Sean Klein authored
      Test: /boot/test/sys/ramdisk-test
      ZX-2674 #done
      
      Change-Id: I6ff9c767d30b4eb0a51faca1b7acc2424886f4db
      045340aa
  3. Jan 27, 2019
    • Sean Klein's avatar
      [ramdisk][fidl] Convert ramdisk IOCTLs to FIDL · d84a57a6
      Sean Klein authored
      Additionally, convert all clients within Zircon.
      
      Test: /boot/test/sys/ramdisk-test
      ZX-2674 #comment In Progress
      ZX-2866 #done
      
      Change-Id: Iff7751579a2a2aa496cc71da57ec002f39f15792
      d84a57a6
    • Sean Klein's avatar
      [ramdisk] Avoid usage of 'block' interface for accessing Ramdisk ioctls · 9eba95a2
      Sean Klein authored
      Additionally, redirects all usage of "ramdisk_ioctl" interfaces through
      the ramdisk library (currently located within ulib/fs-management,
      pending relocation). This will make it easier to convert the ioctl
      interfaces to FIDL without modifying client code.
      
      Test: /boot/test/sys/ramdisk-test
      ZX-2674 #comment In Progress
      
      Change-Id: Ia24192df10b2cb3bb5ee2a95f0b6ef647d515d69
      9eba95a2
    • Pascal Perez's avatar
      [fidlc] Deferring Type Construction Post Raw to Flat Conversion · 68817767
      Pascal Perez authored
      Introducing a generic representation named TypeConstructor to capture
      all areas where we reference types. This makes it possible to have a
      single representation, share code around it, and most importantly, defer
      type construction to a later stage in the compiler, once all constants
      have been resolved.
      
      For instance, with the example:
      
          const uint32 MAX_SIZE = 1024;
          struct MyStruct {
            string:MAX_SIZE desc;
            string:1024 other_desc;
          };
      
      We must first resolve the MAX_SIZE constant to understand that the type
      for both desc field, and other_desc field are the same.
      
      Type constructors create types using type templates, which are looked up
      by name. So for instance, the name "uint32" looks up a type template,
      which is an instance of PrimitiveTypeTemplate, and which knows how to
      instantiate a PrimitiveType representing a uint32.
      
      All this machinery moves us closer to 1. canonicalizing types (because
      their creation is now centralized, and soon easy to memoize), and 2.
      introducing user-defined templates such as
      
          struct pair<L, R> { ....
      
      Which would get materialized dynamically.
      
      This also makes it natural to extend type aliasing to use any types, not
      just primitives.
      
      Test: make tools -j12 HOST_USE_ASAN=true && ./build-x64/host_tests/fidl-compiler-test
      Change-Id: Id97c6751b8944b5ee04ff813d2cd0dcc47711f17
      68817767
    • Mike Voydanoff's avatar
      [dev][light-sensor] Move system/dev/light to system/dev/light-sensor · bca77f6b
      Mike Voydanoff authored
      So we can use system/dev/light for light drivers
      
      TEST: still builds
      Change-Id: Ia7a6684c704390d26cedee8209f076125e7a6fec
      bca77f6b
  4. Jan 26, 2019
    • Jocelyn Dang's avatar
      [dev][usb-tester] Add option to specify num packets. · 8ee09ae4
      Jocelyn Dang authored
      This will make it easier to add the cb_on_error_only tests,
      where we'll want to pass in which requests we want callbacks / errors on.
      
      TEST= plugged in FX3 and ran usb-fwloader && runtests -t usb-test
      
      Change-Id: I6078180c520ea8f61574f04316ff5801e809ece0
      8ee09ae4
Loading