10 Oct, 2014

1 commit

  • Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc
    earlier than initr_unlock_ram_in_cache. This causes issue on T4240.
    It may be related to locked L1 d-cache and unlocked L2 cache. D-
    cache could and should be unlock earlier for normal operation.

    This patch moves initr_unlock_ram_in_cache before initr_malloc. It
    has been verified on the following boards, in which only T4240QDS
    suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS,
    P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

    Signed-off-by: York Sun
    CC: Scott Wood
    CC: Simon Glass
    Acked-by: Simon Glass

    York Sun
     

14 Sep, 2014

1 commit


11 Sep, 2014

2 commits

  • For some boards board_init() will change GPIOs, so we need to have driver
    model available before then. Adjust the board init to arrange this, but
    enable it for driver model only, just to be safe.

    This does create additional #ifdef logic, but it is safer than trying to
    make a pervasive change which may cause some boards to break.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Since driver model registers itself with the stdio subsystem, and we
    want to avoid delayed registration and other complexity associated with
    the current serial console, move the stdio subsystem init earlier when
    driver model is used for serial.

    This simplifies the implementation. Should there be any problems with
    this approach they can be dealt with as boards are converted over to
    use driver model for serial.

    Signed-off-by: Simon Glass

    Simon Glass
     

09 Sep, 2014

1 commit


24 Aug, 2014

1 commit


09 Aug, 2014

1 commit


23 Jul, 2014

3 commits

  • 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: Simon Glass

    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: Simon Glass

    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: Simon Glass

    Simon Glass
     

22 Jul, 2014

1 commit

  • This has been disabled for ARM in initr_scsi since that function was
    introduced. However it works fine for me on Cubieboard and Cubietruck (with the
    upcoming AHCI glue patch).

    I also tested on two random ARM platforms which seem to define CONFIG_CMD_SCSI:
    - highbank worked fine (on midway hardware)
    - omap5_uevm built OK and I confirmed using objdump that things were as
    expected (i.e. the default weak scsi_init nop was used).

    While there remove the mismatched comment from the #endif (omitting the comment
    seems to be the prevailing style in this file).

    Signed-off-by: Ian Campbell
    Acked-by: Simon Glass

    Ian Campbell
     

30 May, 2014

1 commit


18 Apr, 2014

1 commit

  • The show_model_r function should return an int but didn't. Return 0 to
    indicate inevitable success and avoid the following if it is used:

    common/board_r.c: In function 'show_model_r':
    common/board_r.c:531:1: warning: no return statement in function returning non-void [-Wreturn-type]
    }
    ^

    Cc: Simon Glass
    Signed-off-by: Paul Burton
    Acked-by: Simon Glass

    Paul Burton
     

05 Mar, 2014

1 commit


27 Feb, 2014

1 commit


27 Jan, 2014

1 commit

  • This is only required for "PIC" relocation and doesn't apply to modern
    "PIE" relocation which does data relocation as well as code.

    "init_sequence_r" is just an array that consists of compile-time
    adresses of init functions. Since this is basically an array of integers
    (pointers to "void" to be more precise) it won't be modified during
    relocation - it will be just copied to new location as it is.

    As a consequence on execution after relocation "initcall_run_list" will
    be jumping to pre-relocation addresses. As long as we don't overwrite
    pre-relocation memory area init calls are executed correctly. But still
    it is dangerous because after relocation we don't expect initially used
    memory to stay untouched.

    Cc: Tom Rini
    Cc: Masahiro Yamada
    Cc: Doug Anderson
    Cc: Thomas Langer
    Cc: Albert ARIBAUD
    Acked-by: Simon Glass
    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     

24 Jul, 2013

1 commit


26 Jun, 2013

1 commit

  • 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: Simon Glass

    Simon Glass
     

08 Jun, 2013

1 commit

  • 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: Masahiro Yamada
    Cc: Simon Glass

    Masahiro Yamada
     

14 May, 2013

1 commit


01 May, 2013

1 commit


16 Apr, 2013

1 commit

  • Currently x86 has its own means of managing the global data and board data
    (bd_t), and this code resides in start.S. With generic board, we need to
    ensure that we leave this alone - i.e. don't clear it as we do on other
    archs.

    This fixes a problem where the memory init data is cleared which causes
    the video driver to operate very slowly.

    Signed-off-by: Simon Glass

    Simon Glass
     

16 Mar, 2013

4 commits