Skip to content
Snippets Groups Projects
  1. Nov 23, 2014
  2. Nov 07, 2014
  3. Oct 27, 2014
    • Simon Glass's avatar
      test: Add a simple test to detected warnings with uint64_t, uintptr_t · b01495e6
      Simon Glass authored
      
      These types are problematic because they are typically declared in a
      non-standard way in U-Boot. For example, U-Boot uses 'long long' for
      int64_t even on a 64-bit machine whereas stdint.h uses 'long'.
      Similarly, U-Boot always uses 'long' for intptr_t whereas stdint.h mostly
      uses 'int'.
      
      This simple test script runs a few toolchains on a few archs to check for
      warnings.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      b01495e6
    • Simon Glass's avatar
      cli: hush: Adjust 'run' command to run each line of the env var · 87b6398b
      Simon Glass authored
      
      The run command treats each argument an an environment variable. It gets the
      value of each variable and executes it as a command. If an environment
      variable contains a newline and the hush cli is used, it is supposed to
      execute each line one after the other.
      
      Normally a newline signals to hush to exit - this is used in normal command
      line entry - after a command is entered we want to return to allow the user
      to enter the next one. But environment variables obviously need to execute
      to completion.
      
      Add a special case for the execution of environment variables which
      continues when a newline is seen, and add a few tests to check this
      behaviour.
      
      Note: it's not impossible that this may cause regressions in other areas.
      I can't think of a case but with any change of behaviour with limited test
      coverage there is always a risk. From what I can tell this behaviour has
      been around since at least U-Boot 2011.03, although this pre-dates sandbox
      and I have not tested it on real hardware.
      
      Reported-by: default avatarWolfgang Denk <wd@denx.de>
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      87b6398b
  4. Oct 24, 2014
  5. Oct 22, 2014
  6. Sep 24, 2014
  7. Aug 28, 2014
    • Simon Glass's avatar
      Correct sandbox filesystem commands in FIT image test · dfe6f4d6
      Simon Glass authored
      
      The host filesystem name has changed, so update the tests. The tests now
      run again correctly:
      
      $ make O=b/sandbox sandbox_defconfig all
      ...
      $ test/image/test-fit.py -u b/sandbox/u-boot
      FIT Tests
      
      =========
      Kernel load
      Kernel + FDT load
      Kernel + FDT + Ramdisk load
      
      Tests passed
      Caveat: this is only a sanity check - test coverage is poor
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      dfe6f4d6
  8. Aug 20, 2014
  9. Aug 09, 2014
  10. Jul 23, 2014
    • Simon Glass's avatar
      dm: Add child_pre_probe() and child_post_remove() methods · a327dee0
      Simon Glass authored
      
      Some devices (particularly bus devices) must track their children, knowing
      when a new child is added so that it can be set up for communication on the
      bus.
      
      Add a child_pre_probe() method to provide this feature, and a corresponding
      child_post_remove() method.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      a327dee0
    • Simon Glass's avatar
      dm: Introduce per-child data for devices · e59f458d
      Simon Glass authored
      
      Some device types can have child devices and want to store information
      about them. For example a USB flash stick attached to a USB host
      controller would likely use this space. The controller can hold
      information about the USB state of each of its children.
      
      The data is stored attached to the child device in the 'parent_priv'
      member. It can be auto-allocated by dm when the child is probed. To
      do this, add a per_child_auto_alloc_size value to the parent driver.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      e59f458d
    • Simon Glass's avatar
      dm: Add functions to access a device's children · 997c87bb
      Simon Glass authored
      
      Devices can have childen that can be addressed by a simple index, the
      sequence number or a device tree offset. Add functions to access a child
      in each of these ways.
      
      The index is typically used as a fallback when the sequence number is not
      available. For example we may use a serial UART with sequence number 0 as
      the console, but if no UART has sequence number 0, then we can fall back
      to just using the first UART (index 0).
      
      The device tree offset function is useful for buses, where they want to
      locate one of their children. The device tree can be scanned to find the
      offset of each child, and that offset can then find the device.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      997c87bb
    • Simon Glass's avatar
      dm: Provide a function to scan child FDT nodes · 1ca7e206
      Simon Glass authored
      
      At present only root nodes in the device tree are scanned for devices.
      But some devices can have children. For example a SPI bus may have
      several children for each of its chip selects.
      
      Add a function which scans subnodes and binds devices for each one. This
      can be used for the root node scan also, so change it.
      
      A device can call this function in its bind() or probe() methods to bind
      its children.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      1ca7e206
    • Simon Glass's avatar
      dm: Avoid accessing uclasses before they are ready · c910e2e2
      Simon Glass authored
      
      Don't allow access to uclasses before they have been initialised.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      c910e2e2
    • Simon Glass's avatar
      dm: Allow a device to be found by its FDT offset · f4cdead2
      Simon Glass authored
      
      Each device that was bound from a device tree has an node that caused it to
      be bound. Add functions that find and return a device based on a device tree
      offset.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      f4cdead2
    • Simon Glass's avatar
      dm: Display the sequence number for each device · b7d66570
      Simon Glass authored
      
      Add this information to 'dm tree' and 'dm uclass' commands.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      b7d66570
    • Simon Glass's avatar
      dm: Introduce device sequence numbering · 5a66a8ff
      Simon Glass authored
      
      In U-Boot it is pretty common to number devices from 0 and access them
      on the command line using this numbering. While it may come to pass that
      we will move away from this numbering, the possibility seems remote at
      present.
      
      Given that devices within a uclass will have an implied numbering, it
      makes sense to build this into driver model as a core feature. The cost
      is fairly small in terms of code and data space.
      
      With each uclass having numbered devices we can ask for SPI port 0 or
      serial port 1 and receive a single device.
      
      Devices typically request a sequence number using aliases in the device
      tree. These are resolved when the device is probed, to deal with conflicts.
      Sequence numbers need not be sequential and holes are permitted.
      
      At present there is no support for sequence numbers using static platform
      data. It could easily be added to 'struct driver_info' if needed, but it
      seems better to add features as we find a use for them, and the use of -1
      to mean 'no sequence' makes the default value somewhat painful.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      5a66a8ff
    • Simon Glass's avatar
      dm: Avoid activating devices in 'dm uclass' command · 4e8bc211
      Simon Glass authored
      
      This command currently activates devices as it lists them. This is not
      desirable since it changes the system state. Fix it and avoid printing
      a newline if there are no devices in a uclass.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      4e8bc211
    • Simon Glass's avatar
      dm: Move device display into its own function · fffa24d7
      Simon Glass authored
      
      The device display for 'dm tree' and 'dm uclass' is mostly the same, so
      move it into a common function.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      fffa24d7
    • Simon Glass's avatar
      dm: Allow drivers to be marked 'before relocation' · 00606d7e
      Simon Glass authored
      
      Driver model currently only operates after relocation is complete. In this
      state U-Boot typically has a small amount of memory available. In adding
      support for driver model prior to relocation we must try to use as little
      memory as possible.
      
      In addition, on some machines the memory has not be inited and/or the CPU
      is not running at full speed or the data cache is off. These can reduce
      execution performance, so the less initialisation that is done before
      relocation the better.
      
      An immediately-obvious improvement is to only initialise drivers which are
      actually going to be used before relocation. On many boards the only such
      driver is a serial UART, so this provides a very large potential benefit.
      
      Allow drivers to mark themselves as 'pre-reloc' which means that they will
      be initialised prior to relocation. This can be done either with a driver
      flag or with a 'dm,pre-reloc' device tree property.
      
      To support this, the various dm scanning function now take a 'pre_reloc_only'
      parameter which indicates that only drivers marked pre-reloc should be
      bound.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      00606d7e
    • Simon Glass's avatar
      dm: Make sure that the root device is probed · 7497812d
      Simon Glass authored
      
      The root device should be probed just like any other device. The effect of
      this is to mark the device as activated, so that it can be removed (along
      with its children) if required.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Acked-by: default avatarMarek Vasut <marex@denx.de>
      7497812d
    • Simon Glass's avatar
      dm: Use an explicit expect value in core tests · eb9ef5fe
      Simon Glass authored
      
      Rather than reusing the 'reg' property, use an explicit property for the
      expected ping value used in testing.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      eb9ef5fe
  11. Jun 23, 2014
    • Stephen Warren's avatar
      sandbox: restore ability to access host fs through standard commands · 4d907025
      Stephen Warren authored and Simon Glass's avatar Simon Glass committed
      
      Commit 95fac6ab "sandbox: Use os functions to read host device tree"
      removed the ability for get_device_and_partition() to handle the "host"
      device type, and redirect accesses to it to the host filesystem. This
      broke some unit tests that use this feature. So, revert that change. The
      code added back by this patch is slightly different to pacify checkpatch.
      
      However, we're then left with "host" being both:
      - A pseudo device that accesses the hosts real filesystem.
      - An emulated block device, which accesses "sectors" inside a file stored
        on the host.
      
      In order to resolve this discrepancy, rename the pseudo device from host
      to hostfs, and adjust the unit-tests for this change.
      
      The "help sb" output is modified to reflect this rename, and state where
      the host and hostfs devices should be used.
      
      Signed-off-by: Stephen Warren's avatarStephen Warren <swarren@nvidia.com>
      Tested-by: default avatarJosh Wu <josh.wu@atmel.com>
      Acked-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Tested-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      4d907025
  12. Jun 21, 2014
  13. Jun 20, 2014
Loading