02 Feb, 2016

25 commits

  • Commit df48b23428e9 (".mailmap: Add all the mail alias for Ricardo
    Ribalda") assigned two different proper names for the email address
    "ricardo.ribalda@uam.es". This is a completely wrong usage as the
    mailmap feature exists for coalescing together commits by the same
    person whose name is sometimes spelled differently.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • This is a follow-up patch to e92029c0f4 and adds a prototype for
    the weak mmc_get_env_dev function.

    Cc: Tom Rini
    Cc: Stephen Warren

    Signed-off-by: Clemens Gruber
    Reviewed-by: Tom Rini
    Reviewed-by: Peng Fan

    Clemens Gruber
     
  • Use of memalign can trigger fragmentation issues such as:

    // Internally, this needs to find a free block quite bit larger than s.
    // Once the free region is found, any unaligned "padding" immediately
    // before and after the block is marked free, so that the allocation
    // takes only s bytes (plus malloc header overhead).
    p = memalign(a, s);
    // If there's little fragmentation so far, this allocation is likely
    // located immediately after p.
    p2 = malloc(x);
    free(p);
    // In theory, this should return the same value for p. However, the hole
    // left by the free() call is only s in size (plus malloc header overhead)
    // whereas memalign searches for a larger block in order to guarantee it
    // can adjust the returned pointer to the alignment requirements. Hence,
    // the pointer returned, if any, won't be p. If there's little or no space
    // left after p2, this allocation will fail.
    p = memalign(a, s);

    In practice, this issue occurs when running the "dfu" command repeatedly
    on NVIDIA Tegra boards, since DFU allocates a large 32M data buffer, and
    then initializes the USB controller. If this is the first time USB has
    been used in the U-Boot session, this causes a probe of the USB driver,
    which causes various allocations, including a strdup() of a GPIO name
    when requesting the VBUS GPIO. When DFU is torn down, the USB driver
    is left probed, and hence its memory is left allocated. If "dfu" is
    executed again, allocation of the 32M data buffer fails as described
    above.

    In practice, there is a memory hole exactly large enough to hold the 32M
    data buffer than DFU needs. However, memalign() can't know that in a
    general way. Given that, it's particularly annoying that the allocation
    fails!

    The issue is that memalign() tries to allocate something larger to
    guarantee the ability to align the returned pointer. This patch modifies
    memalign() so that if the "general case" over-sized allocation fails,
    another allocation is attempted, of the exact size the user desired. If
    that allocation just happens to be aligned in the way the user wants,
    (and in the case described above, it will be, since the free memory
    region is located where a previous identical allocation was located),
    the pointer can be returned.

    This patch is somewhat related to 806bd245b1ab "dfu: don't keep
    freeing/reallocating". That patch worked around the issue by removing
    repeated free/memalign within a single execution of "dfu". However,
    the same technique can't be applied across multiple invocations, since
    there's no reason to keep the DFU buffer allocated while DFU isn't
    running. This patch addresses the root-cause a bit more directly.

    This problem highlights some of the disadvantages of dynamic allocation
    and deferred probing of devices.

    This patch isn't checkpatch-clean, since it conforms to the existing
    coding style in dlmalloc.c, which is different to the rest of U-Boot.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini
    Acked-by: Lukasz Majewski

    Stephen Warren
     
  • - install using addons.apt
    - remove MAKEALL
    - split mpc85xx boards
    - remove TEST_CONFIG_CMD, just info
    - fetch mips toolchain via buildman
    - remove --list-error-boards param
    - conditional script
    - use TOOLCHAIN instead of INSTALL_TOOLCHAIN
    - add aarch64
    - enable notifications via email

    Signed-off-by: Roger Meier
    Cc: Wolfgang Denk
    Cc: Heiko Schocher
    Cc: Tom Rini
    Cc: Daniel Schwierzeck
    Cc: Andreas Färber
    Tested-by: Daniel Schwierzeck
    Acked-by: Heiko Schocher

    Roger Meier
     
  • Tom Rini
     
  • This adds ethernet, TFTP support for PIC32MZ[DA] Starter Kit. Also
    custom environment variables/scripts are added to help boot from network.

    Signed-off-by: Purna Chandra Mandal

    Purna Chandra Mandal
     
  • This driver implements MAC and MII layer of the ethernet controller.
    Network data transfer is handled by controller internal DMA engine.
    Ethernet controller is configurable through device-tree file.

    Signed-off-by: Purna Chandra Mandal

    Purna Chandra Mandal
     
  • Add SMSC LAN8740 Phy support required for PIC32MZDA devices.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Tom Rini
    Reviewed-by: Daniel Schwierzeck
    Acked-by: Joe Hershberger

    Purna Chandra Mandal
     
  • Enable MMC, SDHCI, FAT_FS support for PIC32MZ[DA] StarterKit.
    Also add custom scripts, rules to boot Linux from microSD card.

    Signed-off-by: Purna Chandra Mandal

    Purna Chandra Mandal
     
  • This driver implements platform specific glue and fixups for
    PIC32 internal SDHCI controller.

    Signed-off-by: Andrei Pistirica
    Signed-off-by: Sandeep Sheriker Mallikarjun
    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Tom Rini
    Reviewed-by: Daniel Schwierzeck

    Andrei Pistirica
     
  • This adds support for Microchip PIC32MZ[DA] StarterKit board
    based on a PIC32MZ[DA] family of microcontroller.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Daniel Schwierzeck

    Purna Chandra Mandal
     
  • Add Microchip PIC32MZ[DA] SoC family support.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Daniel Schwierzeck

    Purna Chandra Mandal
     
  • This driver initializes PIC32 DDR2 SDRAM controller and internal DDR2 Phy module.
    DDR2 controller operates in half-rate mode (upto 533MHZ frequency).

    Signed-off-by: Paul Thacker
    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Daniel Schwierzeck
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass

    Purna Chandra Mandal
     
  • This adds PIC32 UART controller support based on driver model.

    Signed-off-by: Paul Thacker
    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Daniel Schwierzeck
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass

    Paul Thacker
     
  • In PIC32 GPIO controller is part of PIC32 pin controller.
    PIC32 has ten independently programmable ports and each with multiple pins.
    Each of these pins can be configured and used as GPIO, provided they
    are not in use for other peripherals.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass
    Reviewed-by: Daniel Schwierzeck

    Purna Chandra Mandal
     
  • In PIC32 pin-controller is a combined gpio-controller, pin-mux and
    pin-config module. Remappable peripherals are assigned pins through
    per-pin based muxing logic. And pin configuration are performed on
    specific port registers which are shared along with gpio controller.
    Note, non-remappable peripherals have default pins assigned thus
    require no muxing.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Tom Rini
    Reviewed-by: Daniel Schwierzeck
    Reviewed-by: Simon Glass

    Purna Chandra Mandal
     
  • PIC32 clock module consists of multiple oscillators, PLLs, mutiplexers
    and dividers capable of supplying clock to various controllers
    on or off-chip.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Simon Glass
    Reviewed-by: Daniel Schwierzeck

    Purna Chandra Mandal
     
  • Create initial directory, Kconfigs needed for PIC32 architecture
    support. Also add PIC32 specific register definition required for drivers.

    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Daniel Schwierzeck
    Reviewed-by: Tom Rini

    Purna Chandra Mandal
     
  • Rather than passing the I/O port base address to the Super I/O code,
    switch it to using outb such that it makes use of the I/O port base
    address automatically.

    Drop the extern keyword to satisfy checkpatch whilst here.

    Signed-off-by: Paul Burton

    Paul Burton
     
  • Set the I/O port base earlier, from board_early_init_f, in preparation
    for it being used by the serial driver.

    Signed-off-by: Paul Burton

    Paul Burton
     
  • The existing mips_io_port_base variable isn't suitable for use early
    during boot since it will be stored in the .data section which may not
    be writable pre-relocation. Fix this by moving the I/O port base address
    into struct arch_global_data. In order to avoid adding this field for
    all targets, make this dependant upon a new Kconfig entry
    CONFIG_DYNAMIC_IO_PORT_BASE. Malta is the only board which sets a
    non-zero I/O port base, so select this option only for Malta.

    Signed-off-by: Paul Burton

    Paul Burton
     
  • CONF_SLOWDOWN_IO is never set for any target, so remove the dead code in
    the SLOW_DOWN_IO macro. This is done in preparation for changes to
    mips_io_port_base which can be avoided in this path by removing it
    entirely.

    Signed-off-by: Paul Burton

    Paul Burton
     
  • This patch makes sure that the flush/invalidate_dcache_range() functions
    can handle corner-case calls like this -- invalidate_dcache_range(0, 0, 0);
    This call is valid and is happily produced by USB EHCI code for example.
    The expected behavior of the cache function(s) in this case is that they
    will do no operation, since the size is zero.

    The current implementation though has a problem where such invocation will
    result in a hard CPU hang. This is because under such conditions, where the
    start_addr = 0 and stop = 0, the addr = 0 and aend = 0xffffffe0 . The loop
    will then try to iterate over the entire address space, which in itself is
    wrong. But iterating over the entire address space might also hit some odd
    address which will cause bus hang. The later happens on the Atheros MIPS.

    Signed-off-by: Marek Vasut
    Cc: Daniel Schwierzeck
    Cc: Hans de Goede

    Marek Vasut
     
  • Fix 32 vs 64 bit load/store instructions. Access CP0_WATCHHI as
    32 Bit register. Use 64 Bit register access for clearing gd_data
    and copying U-Boot.

    Signed-off-by: Daniel Schwierzeck

    Daniel Schwierzeck
     
  • Argument boot_flags of board_init_f() should be set to 0 as
    $a0 may be utilized in lowlevel_init() or mips_cache_reset()
    or previous stage boot-loader.

    Signed-off-by: Purna Chandra Mandal
    Signed-off-by: Daniel Schwierzeck

    Purna Chandra Mandal
     

31 Jan, 2016

7 commits

  • On Novena, the DRAM SPD is connected to i2c1 while the Utility EEPROM
    is connected to i2c3. Now that the EEPROM handling in U-Boot is fixed,
    also fix this bit on Novena.

    Signed-off-by: Marek Vasut
    Cc: Sean Cross
    Cc: Stefano Babic

    Marek Vasut
     
  • Android's tool chain enable the -mandroid at default.
    This option will enable the -fpic, which cause uboot compilation
    failure:
    "
    LD u-boot
    u-boot contains unexpected relocations: R_ARM_ABS32
    R_ARM_RELATIVE
    "

    In my testcase, arm-linux-androideabi-gcc-4.9 internally
    enables '-fpic', so when compiling code, there will be
    relocation entries using type R_ARM_GOT_BREL and .got
    section. When linking all the built-in.o using ld, there
    will be R_ARM_ABS32 relocation entry and .got section
    in the final u-boot elf image. This can not be handled
    by u-boot, since u-boot only expects R_ARM_RELATIVE
    relocation entry.
    arm-poky-linux-gnueabi-gcc-4.9 default does not enable '-fpic',
    so there is not .got section and R_ARM_GOT_BREL in built-in.o.
    And in the final u-boot elf image, all relocation entries are
    R_ARM_RELATIVE.

    we can pass '-fno-pic' to xxx-gcc to disable pic. whether
    the toolchain internally enables or disables pic, '-fno-pic'
    can work well.

    Signed-off-by: Peng Fan
    Cc: Albert Aribaud
    Reviewed-by: Tom Rini

    Peng Fan
     
  • "DISCARD" will remove ._secure.text relocate, but PSCI framework
    has already used some absolute address those need to relocate.

    Use readelf -t -r u-boot show us:
    .__secure_start addr: 601408e4
    .__secure_end addr: 60141460

    60141140 00000017 R_ARM_RELATIVE
    46 _secure_monitor:
    47 #ifdef CONFIG_ARMV7_PSCI
    48 ldr r5, =_psci_vectors

    60141194 00000017 R_ARM_RELATIVE
    6014119c 00000017 R_ARM_RELATIVE
    601411a4 00000017 R_ARM_RELATIVE
    601411ac 00000017 R_ARM_RELATIVE
    64 _psci_table:
    66 .word psci_cpu_suspend
    ...
    72 .word psci_migrate

    60141344 00000017 R_ARM_RELATIVE
    6014145c 00000017 R_ARM_RELATIVE
    202 ldr r5, =psci_text_end

    Solutions:
    1. Change absolute address to RelAdr.
    Based on LDR (immediate, ARM), we only have 4K offset to jump.
    Now PSCI code size is close to 4K size that is LDR limit jump size,
    so even if the LDR is based on the current instruction address,
    there is also have a risk for RelAdr. If we use two jump steps I
    think we can fix this issue, but looks too hack, so give up this way.

    2. Enable "DISCARD" only for CONFIG_ARMV7_SECURE_BASE has defined.
    If CONFIG_ARMV7_SECURE_BASE is defined in platform, all of secure
    will in the BASE address that is absolute.

    Signed-off-by: Wang Dongsheng
    Reviewed-by: Tom Rini

    Wang Dongsheng
     
  • Add code to aid tracking down cache alignment issues.
    In case DEBUG is defined in the cache.c, this code will
    check alignment of each attempt to flush/invalidate data
    cache and print a warning if the alignment is incorrect.
    If DEBUG is not defined, this code is optimized out.

    Signed-off-by: Marek Vasut
    Cc: Dinh Nguyen
    Cc: Albert Aribaud
    Cc: Tom Rini

    Marek Vasut
     
  • Some armv7 targets are missing a cache line size declaration.
    In preparation for "arm: cache: Implement cache range check for v7"
    patch, add these declarations with the appropriate value for
    the target's SoC or CPU.

    Signed-off-by: Albert ARIBAUD
    Reviewed-by: Tom Rini

    Albert ARIBAUD
     
  • Restore the old behavior of the MMU section entries configuration,
    which is without the S-bit.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Cc: Albert Aribaud
    Cc: Simon Glass

    Marek Vasut
     
  • The arch/arm/lib/cache-cp15.c checks for CONFIG_ARMV7 and if this macro is
    set, it configures TTBR0 register. This register must be configured for the
    cache on ARMv7 to operate correctly.

    The problem is that noone actually sets the CONFIG_ARMV7 macro and thus the
    TTBR0 is not configured at all. On SoCFPGA, this produces all sorts of minor
    issues which are hard to replicate, for example certain USB sticks are not
    detected or QSPI NOR sometimes fails to write pages completely.

    The solution is to replace CONFIG_ARMV7 test with CONFIG_CPU_V7 one. This is
    correct because the code which added the test(s) for CONFIG_ARMV7 was added
    shortly after CONFIG_ARMV7 was replaced by CONFIG_CPU_V7 and this code was
    not adjusted correctly to reflect that change.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Cc: Albert Aribaud
    Cc: Simon Glass

    Marek Vasut
     

30 Jan, 2016

8 commits