1. 28 7月, 2014 1 次提交
    • S
      buildman: Add -C option to force a reconfigure for each commit · 97e91526
      Simon Glass 提交于
      Normally buildman wil try to configure U-Boot for a particular board on the
      first commit that it builds in a series. Subsequent commits are built
      without reconfiguring which normally works. Where it doesn't, buildman
      automatically reconfigures and retries.
      
      To fully emulate the way MAKEALL works, we should have an option to disable
      this optimisation.
      
      Add a -C option to cause buildman to always reconfigure on each commit.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      97e91526
  2. 26 7月, 2014 1 次提交
  3. 24 7月, 2014 1 次提交
  4. 23 7月, 2014 37 次提交
    • S
      buildman: Avoid retrying a build if it definitely failed · 21fe8ec3
      Simon Glass 提交于
      After a build fails buildman will reconfigure and try again, if it did not
      reconfigure before the build. However it doesn't actually keep track of
      whether it did reconfigure on the previous attempt.
      
      Fix that logic to avoid a pointless rebuild. This speeds things up quite a
      bit for failing builds. Previously they would always be built twice.
      
      Change-Id: Ib37f21320baa7c60bed98f4042c0b7ed7c0dc85e
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      21fe8ec3
    • S
      buildman: Add -F flag to retry failed builds · 4266dc28
      Simon Glass 提交于
      Generally a build failure with a particular commit cannot be fixed except
      by changing that commit. Changing the commit will automatically cause
      buildman to retry when you run it again: buildman sees that the commit
      hash is different and that it has no previous build result for the new
      commit hash.
      
      However sometimes the build failure is due to a toolchain issue or some
      other environment problem. In that case, retrying failed builds may yield
      a different result.
      
      Add a flag to retry failed builds. This differs from the force rebuild
      flag (-f) in that it will not rebuild commits which are already marked as
      succeeded.
      
      Series-to: u-boot
      
      Change-Id: Iac4306df499d65ff0888b1c60f06fc162a6faad8
      4266dc28
    • S
      dm: Give the demo uclass a name · 74f96dad
      Simon Glass 提交于
      Uclasses should be named, so add a name for the demo uclass.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      74f96dad
    • S
      dm: Add dm_scan_other() to locate board-specific devices · bb58503d
      Simon Glass 提交于
      Some boards will have devices which are not in the device tree and do not
      have platform data. They may be programnatically created, for example.
      Add a hook which boards can use to bind those devices early in boot.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      bb58503d
    • S
      dm: Improve errors and warnings in lists_bind_fdt() · 9b0ba067
      Simon Glass 提交于
      Add a debug message for when a device tree node has no driver. Also reword
      the warning when a device fails to bind, which was misleading.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      9b0ba067
    • S
      dm: Add child_pre_probe() and child_post_remove() methods · a327dee0
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      a327dee0
    • S
      dm: Introduce per-child data for devices · e59f458d
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      e59f458d
    • S
      dm: Add functions to access a device's children · 997c87bb
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      997c87bb
    • S
      dm: Provide a function to scan child FDT nodes · 1ca7e206
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      1ca7e206
    • S
      dm: Tidy up some header file comments · 0040b944
      Simon Glass 提交于
      Fix up the style of a few comments and add/clarify a few others.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      0040b944
    • S
      fdt: Add a function to get the node offset of an alias · 3234aa4b
      Simon Glass 提交于
      This simple function returns the node offset of a named alias.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      3234aa4b
    • S
      dm: Avoid accessing uclasses before they are ready · c910e2e2
      Simon Glass 提交于
      Don't allow access to uclasses before they have been initialised.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      c910e2e2
    • S
      dm: Allow a device to be found by its FDT offset · f4cdead2
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      f4cdead2
    • S
      dm: Display the sequence number for each device · b7d66570
      Simon Glass 提交于
      Add this information to 'dm tree' and 'dm uclass' commands.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      b7d66570
    • S
      dm: Introduce device sequence numbering · 5a66a8ff
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      5a66a8ff
    • S
      dm: Avoid activating devices in 'dm uclass' command · 4e8bc211
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      4e8bc211
    • S
      dm: Move device display into its own function · fffa24d7
      Simon Glass 提交于
      The device display for 'dm tree' and 'dm uclass' is mostly the same, so
      move it into a common function.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      fffa24d7
    • S
      fdt: Add a function to get the alias sequence of a node · 5c33c9fd
      Simon Glass 提交于
      Aliases are used to provide U-Boot's numbering of devices, such as:
      
      aliases {
      	spi0 = "/spi@12330000";
      }
      
      spi@12330000 {
      	...
      }
      
      This tells us that the SPI controller at 12330000 is considered to be the
      first SPI controller (SPI 0). So we have a numbering for the SPI node.
      
      Add a function that returns the numbering for a node assume that it exists
      in the list of aliases.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      5c33c9fd
    • S
      dm: Move uclass error checking/probing into a function · 9ca296a1
      Simon Glass 提交于
      Several functions will use this same pattern, so bring it into a function.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      9ca296a1
    • S
      Add a flag indicating when the serial console is ready · 093f79ab
      Simon Glass 提交于
      For sandbox we have a fallback console which is used very early in
      U-Boot, before serial drivers are available. Rather than try to guess
      when to switch to the real console, add a flag so we can be sure. This
      makes sure that sandbox can always output a panic() message, for example,
      and avoids silent failure (which is very annoying in sandbox).
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      093f79ab
    • S
      console: Remove vprintf() optimisation for sandbox · 7793ac96
      Simon Glass 提交于
      If the console is not present, we try to reduce overhead by stopping any
      output in vprintf(), before it gets to putc(). This is of dubious merit
      in general, but in the case of sandbox it is incorrect since we have a
      fallback console which reports errors very early in U-Boot. If this is
      defeated U-Boot can hang or exit with no indication of what is wrong.
      
      Remove the optimisation for sandbox.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      7793ac96
    • S
      stdio: Provide functions to add/remove devices using stdio_dev · d97143a6
      Simon Glass 提交于
      The current functions for adding and removing devices require a device name.
      This is not convenient for driver model, which wants to store a pointer to
      the relevant device. Add new functions which provide this feature and adjust
      the old ones to call these.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      d97143a6
    • S
      dm: Support driver model prior to relocation · ab7cd627
      Simon Glass 提交于
      Initialise devices marked 'pre-reloc' and make them available prior to
      relocation. Note that this requires pre-reloc malloc() to be available.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      ab7cd627
    • S
      dm: Allow drivers to be marked 'before relocation' · 00606d7e
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      00606d7e
    • S
      sandbox: Remove all drivers before exit · 61336833
      Simon Glass 提交于
      Drivers are supposed to be able to close down cleanly. To set a good example,
      make sandbox shut down its driver model drivers and remove them before exit.
      
      It may be desirable to do the same more generally once driver model is more
      widely-used. This could be done during bootm, before U-Boot jumps to the OS.
      It seems far too early to make this change.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      61336833
    • S
      dm: Provide a way to shut down driver model · 9adbd7a1
      Simon Glass 提交于
      Add a new method which removes and unbinds all drivers.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Acked-by: NMarek Vasut <marex@denx.de>
      9adbd7a1
    • S
      dm: Make sure that the root device is probed · 7497812d
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      Acked-by: NMarek Vasut <marex@denx.de>
      7497812d
    • S
      stdio: Pass device pointer to stdio methods · 709ea543
      Simon Glass 提交于
      At present stdio device functions do not get any clue as to which stdio
      device is being acted on. Some implementations go to great lengths to work
      around this, such as defining a whole separate set of functions for each
      possible device.
      
      For driver model we need to associate a stdio_dev with a device. It doesn't
      seem possible to continue with this work-around approach.
      
      Instead, add a stdio_dev pointer to each of the stdio member functions.
      
      Note: The serial drivers have the same problem, but it is not strictly
      necessary to fix that to get driver model running. Also, if we convert
      serial over to driver model the problem will go away.
      
      Code size increases by 244 bytes for Thumb2 and 428 for PowerPC.
      
      22: stdio: Pass device pointer to stdio methods
             arm: (for 2/2 boards)  all +244.0  bss -4.0  text +248.0
         powerpc: (for 1/1 boards)  all +428.0  text +428.0
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Acked-by: NMarek Vasut <marex@denx.de>
      Reviewed-by: NMarek Vasut <marex@denx.de>
      709ea543
    • S
      stdio: Remove redundant code around stdio_register() calls · 91d0be1d
      Simon Glass 提交于
      There is no point in setting a structure's memory to NULL when it has
      already been zeroed with memset().
      
      Also, there is no need to create a stub function for stdio to call - if the
      function is NULL it will not be called.
      
      This is a clean-up, with no change in functionality.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Acked-by: NMarek Vasut <marex@denx.de>
      91d0be1d
    • S
      dm: Use an explicit expect value in core tests · eb9ef5fe
      Simon Glass 提交于
      Rather than reusing the 'reg' property, use an explicit property for the
      expected ping value used in testing.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      eb9ef5fe
    • S
      dm: gpio: Don't use the driver model uclass for SPL · 5b9765c7
      Simon Glass 提交于
      Driver model does not support SPL yet, so we should not use the GPIO
      uclass for SPL.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      5b9765c7
    • S
      sandbox: Always enable malloc debug · 6d7601e7
      Simon Glass 提交于
      Tun on DEBUG in malloc(). This adds code space and slows things down but
      for sandbox this is acceptable. We gain the ability to check for memory
      leaks in tests.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      6d7601e7
    • S
      sandbox: config: Enable pre-relocation malloc() · b53e94b1
      Simon Glass 提交于
      Enable this for sandbox so that we will be able to use driver model before
      relocation.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      b53e94b1
    • S
      sandbox: Support pre-relocation malloc() · 29afe9e6
      Simon Glass 提交于
      Set up and zero global data before board_init_f() is called so that we can
      remove the need for CONFIG_SYS_GENERIC_GLOBAL_DATA.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      29afe9e6
    • S
      Add a simple malloc() implementation for pre-relocation · d59476b6
      Simon Glass 提交于
      If we are to have driver model before relocation we need to support some
      way of calling memory allocation routines.
      
      The standard malloc() is pretty complicated:
      
      1. It uses some BSS memory for its state, and BSS is not available before
      relocation
      
      2. It supports algorithms for reducing memory fragmentation and improving
      performace of free(). Before relocation we could happily just not support
      free().
      
      3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since
      this has been loaded anyway this is not really a problem.
      
      The simplest way to support pre-relocation malloc() is to reserve an area
      of memory and allocate it in increasing blocks as needed. This
      implementation does this.
      
      To enable it, you need to define the size of the malloc() pool as described
      in the README. It will be located above the pre-relocation stack on
      supported architectures.
      
      Note that this implementation is only useful on machines which have some
      memory available before dram_init() is called - this includes those that
      do no DRAM init (like tegra) and those that do it in SPL (quite a few
      boards). Enabling driver model preior to relocation for the rest of the
      boards is left for a later exercise.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      d59476b6
    • S
      sandbox: Set up global data before board_init_f() · 4d94dfa0
      Simon Glass 提交于
      At present sandbox defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that
      the global_data pointer is set up in board_init_f().
      
      If we set up and zero the global data before calling board_init_f() then we
      don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA.
      
      Make this change to simplify the init process.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      4d94dfa0
    • S
      Remove form-feeds from dlmalloc.c · d93041a4
      Simon Glass 提交于
      These don't really serve any purpose in the modern age. On the other hand
      they show up as annoying control characters in my editor, which then happily
      removes them.
      
      I believe we can drop these characters from the file.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      d93041a4