1. 23 7月, 2014 13 次提交
    • 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
  2. 22 7月, 2014 27 次提交