1. 05 Aug, 2015 1 commit
  2. 21 Jul, 2015 1 commit
    • Simon Glass's avatar
      dm: spl: Allow device tree/driver model in board_init_f() · 070d00b8
      Simon Glass authored
      
      
      Add an spl_init() function that does basic init such that board_init_f() can
      use simple malloc(), device tree and driver model. Each one is set up only
      if enabled for SPL.
      
      Note: We really should refactor SPL such that there is a single
      board_init_f() and rename the existing weak board_init_f() functions
      provided by boards, calling them from the single board_init_f().
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      070d00b8
  3. 15 Jul, 2015 1 commit
  4. 30 Jan, 2015 1 commit
    • Martin Dorwig's avatar
      Export redesign · 49cad547
      Martin Dorwig authored
      
      
      this is an atempt to make the export of functions typesafe.
      I replaced the jumptable void ** by a struct (jt_funcs) with function pointers.
      The EXPORT_FUNC macro now has 3 fixed parameters and one
      variadic parameter
      The first is the name of the exported function,
      the rest of the parameters are used to format a functionpointer
      in the jumptable,
      
      the EXPORT_FUNC macros are expanded three times,
      1. to declare the members of the struct
      2. to initialize the structmember pointers
      3. to call the functions in stubs.c
      Signed-off-by: default avatarMartin Dorwig <dorwig@tetronik.com>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      (resending to the list since my tweaks are not quite trivial)
      49cad547
  5. 13 Jan, 2015 1 commit
    • Bin Meng's avatar
      pci: Make pci apis usable before relocation · 8f9052fd
      Bin Meng authored
      
      
      Introduce a gd->hose to save the pci hose in the early phase so that
      apis in drivers/pci/pci.c can be used before relocation. Architecture
      codes need assign a valid gd->hose in the early phase.
      
      Some variables are declared as static so change them to be either
      stack variable or global data member so that they can be used before
      relocation, except the 'indent' used by CONFIG_PCI_SCAN_SHOW which
      just affects some print format.
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      8f9052fd
  6. 21 Nov, 2014 2 commits
    • Simon Glass's avatar
      dm: Split the simple malloc() implementation into its own file · c9356be3
      Simon Glass authored
      
      
      The simple malloc() implementation is used when memory is tight. It provides
      a simple buffer with an incrementing pointer.
      
      At present the implementation is inside dlmalloc. Move it into its own file
      so that it is easier to find.
      
      Rather than using relocation as a signal that the full malloc() is
      available, add a special GD_FLG_FULL_MALLOC_INIT flag. This signals that the
      simple malloc() should no longer be used.
      
      In some cases, such as SPL, even the code space used by the full malloc() is
      wasteful. Add a CONFIG_SYS_MALLOC_SIMPLE option to provide only the simple
      malloc. In this case the full malloc is not available at all. It saves about
      1KB of code space and about 0.5KB of data on Thumb 2.
      Acked-by: default avatarTom Rini <trini@ti.com>
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      c9356be3
    • Simon Glass's avatar
      dm: serial: Move current serial port pointer to global_data · 469a579d
      Simon Glass authored
      
      
      In general we can't store things in the data section until we have inited
      SDRAM. Some platforms allow this (e.g. those with SPL) but some don't. Move
      the pointer to global_data so that it will work on all platforms.
      
      Without this fix the serial port will not work prior to relocation with
      driver model on some platforms.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      469a579d
  7. 23 Jul, 2014 3 commits
    • Simon Glass's avatar
      Add a flag indicating when the serial console is ready · 093f79ab
      Simon Glass authored
      
      
      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: default avatarSimon Glass <sjg@chromium.org>
      093f79ab
    • Simon Glass's avatar
      dm: Support driver model prior to relocation · ab7cd627
      Simon Glass authored
      
      
      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: default avatarSimon Glass <sjg@chromium.org>
      ab7cd627
    • Simon Glass's avatar
      Add a simple malloc() implementation for pre-relocation · d59476b6
      Simon Glass authored
      
      
      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: default avatarSimon Glass <sjg@chromium.org>
      d59476b6
  8. 27 May, 2014 1 commit
    • Heiko Schocher's avatar
      dm: rename device struct to udevice · 54c5d08a
      Heiko Schocher authored
      
      
      using UBI and DM together leads in compiler error, as
      both define a "struct device", so rename "struct device"
      in include/dm/device.h to "struct udevice", as we use
      linux code (MTD/UBI/UBIFS some USB code,...) and cannot
      change the linux "struct device"
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Marek Vasut <marex@denx.de>
      54c5d08a
  9. 29 Apr, 2014 1 commit
  10. 04 Mar, 2014 1 commit
  11. 04 Nov, 2013 1 commit
    • Rob Herring's avatar
      Introduce common timer functions · 8dfafdde
      Rob Herring authored
      
      
      Many platforms duplicate pretty much the same timer code yet they all have
      a 32-bit freerunning counter register. Create a common implementation that
      minimally requires 2 or 3 defines to add timer support:
      
      CONFIG_SYS_TIMER_RATE - Clock rate of the timer counter
      CONFIG_SYS_TIMER_COUNTER - Address of 32-bit counter
      CONFIG_SYS_TIMER_COUNTS_DOWN - Define if counter counts down
      
      All functions are weak or ifdef'ed so they can still be overriden by any
      platform.
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      8dfafdde
  12. 24 Jul, 2013 1 commit
  13. 23 Jul, 2013 1 commit
  14. 26 Jun, 2013 1 commit
    • Simon Glass's avatar
      Add trace support to generic board · 71c52dba
      Simon Glass authored
      
      
      Add hooks for tracing to generic board, including:
      
      - allow early tracing to start early as possible in U-Boot
      - reserve memory for trace buffer
      - copy early trace buffer to main trace buffer after relocation
      - setup full tracing support after relocation
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      71c52dba
  15. 07 Jun, 2013 1 commit
    • Masahiro Yamada's avatar
      generic_board: reduce the redundancy of gd_t struct members · a0ba279a
      Masahiro Yamada authored
      
      
      This commit refactors common/board_f.c and common/board_r.c
      in order to delete the dest_addr and dest_addr_sp from
      gd_t struct.
      
      As mentioned as follows in include/asm-generic/global_data.h,
      
        /* TODO: is this the same as relocaddr, or something else? */
        unsigned long dest_addr;        /* Post-relocation address of U-Boot */
      
      dest_addr is the same as relocaddr.
      Likewise, dest_addr_sp is the same as start_addr_sp.
      
      It seemed dest_addr/dest_addr_sp was used only as a scratch variable
      to calculate relocaddr/start_addr_sp, respectively.
      
      With a little refactoring, we can delete dest_addr and dest_addr_sp.
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Cc: Simon Glass <sjg@chromium.org>
      a0ba279a
  16. 15 Mar, 2013 2 commits
  17. 04 Feb, 2013 1 commit