27 Nov, 2015

2 commits


25 Nov, 2015

3 commits


24 Nov, 2015

7 commits

  • serial_init() reads global_data, since global_data is not yet
    initialized, this can cause unwanted behaviour leading to QSPI XIP boot
    hang. Also, since serial_init() is anyways called later from
    boar_init_f(), it does not make sense to do the same in s_init().

    Tested on AM437x IDK EVM with QSPI XIP boot.

    Signed-off-by: Vignesh R
    Reviewed-by: Simon Glass

    Vignesh R
     
  • If the ext3 journal gets out of sync with what is written on disk, for
    example because of an unexpected power cut, ext4fs_read_file can
    return an all-zero directory entry. In that case, ext4fs_iterate_dir
    would infinite loop.

    This patch detects when a directory entry's direntlen member is 0 and
    returns a failure status, which breaks out of the infinite loop. As a
    result, U-Boot will not find files that may subsequently be recovered
    when the journal is replayed.

    This is better behaviour than hanging in an infinite loop, but as a
    further improvement maybe U-Boot could interpret the ext3 journal and
    actually find the unsynced entries.

    Signed-off-by: Thomas Fitzsimmons
    Reviewed-by: Stefan Roese

    Thomas Fitzsimmons
     
  • The address range check may overflow if the memory region is located at
    the top of the 32-bit address space. This can e.g. be seen on TK1 if
    using the E1000 gigabit Ethernet driver where start and size are both
    0x80000000 leading to the following messages:

    Apalis TK1 # tftpboot $loadaddr test_file
    Using e1000#0 device
    TFTP from server 192.168.10.1; our IP address is 192.168.10.2
    Filename 'test_file'.
    Load address: 0x80408000
    Loading: pci_hose_phys_to_bus: invalid physical address

    This patch fixes this by changing the order of the addition vs.
    subtraction in the range check just like already done in
    __pci_hose_bus_to_phys().

    Reported-by: Ivan Mercier
    Signed-off-by: Marcel Ziswiler
    Reviewed-by: Bin Meng
    Reviewed-by: Stephen Warren
    Acked-by: Simon Glass

    Marcel Ziswiler
     
  • The optional parameter bootable is added in gpt command to set the
    partition attribute flag "Legacy BIOS bootable"

    This flag is used in extlinux and so in with distro to select
    the boot partition where is located the configuration file
    (please check out doc/README.distro for details).

    With this parameter, U-Boot can be used to create the boot partition
    needed for device using distro.

    example of use:

    setenv partitions "name=u-boot,size=60MiB;name=boot,size=60Mib,bootable;\
    name=rootfs,size=0"

    > gpt write mmc 0 $partitions

    > part list mmc 0

    Partition Map for MMC device 0 -- Partition Type: EFI

    Part Start LBA End LBA Name
    Attributes
    Type GUID
    Partition GUID
    1 0x00000022 0x0001e021 "u-boot"
    attrs: 0x0000000000000000
    type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    guid: cceb0b18-39cb-d547-9db7-03b405fa77d4
    2 0x0001e022 0x0003c021 "boot"
    attrs: 0x0000000000000004
    type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    guid: d4981a2b-0478-544e-9607-7fd3c651068d
    3 0x0003c022 0x003a9fde "rootfs"
    attrs: 0x0000000000000000
    type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    guid: 6d6c9a36-e919-264d-a9ee-bd00379686c7

    > part list mmc 0 -bootable devplist

    > printenv devplist

    devplist=2

    Then the distro scripts will search extlinux in partition 2
    and not in the first partition.

    Signed-off-by: Patrick Delaunay

    Patrick Delaunay
     
  • This commit adds support for "gpt verify" command, which verifies
    correctness of on-board stored GPT partition table.
    As the optional parameter one can provide '$partitons' environment variable
    to check if partition data (size, offset, name) is correct.

    This command should be regarded as complementary one to "gpt restore".

    Signed-off-by: Lukasz Majewski
    Reviewed-by: Tom Rini
    Reviewed-by: Przemyslaw Marczak

    Lukasz Majewski
     
  • This commit provides definition and declaration of GPT verification
    functions - namely gpt_verify_headers() and gpt_verify_partitions().
    The former is used to only check CRC32 of GPT's header and PTEs.
    The latter examines each partition entry and compare attributes such as:
    name, start offset and size with ones provided at '$partitions' env
    variable.

    Signed-off-by: Lukasz Majewski
    Reviewed-by: Tom Rini
    Reviewed-by: Przemyslaw Marczak

    Lukasz Majewski
     
  • Signed-off-by: Lukasz Majewski
    Reviewed-by: Tom Rini

    Lukasz Majewski
     

23 Nov, 2015

7 commits

  • ./doc/README.gpt entry has been updated to explain usage of "gpt verify"
    command.

    Signed-off-by: Lukasz Majewski
    Reviewed-by: Tom Rini

    Lukasz Majewski
     
  • Exactly the same check is performed in set_gpt_info() function executed
    just after this check.

    Signed-off-by: Lukasz Majewski
    Reviewed-by: Tom Rini

    Lukasz Majewski
     
  • With this patch now, the tiny printf() function also supports numbers
    bigger than 0xffff. Additionally the code is simplified a bit and
    some static variables are moved to function parameters. Also the
    upper case hex variable output support is removed, as its not really
    needed in this simple printf version. And removing it reduces the
    complexity and the code size again a bit.

    Here the new numbers, again on the db-mv784mp-gp (Armada XP):

    Without this patch:
    56542 18536 1956 77034 12cea ./spl/u-boot-spl

    With this patch:
    56446 18536 1936 76918 12c76 ./spl/u-boot-spl

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Cc: Hans de Goede
    Cc: Tom Rini
    Cc: Albert Aribaud

    Stefan Roese
     
  • This patch adds a small printf() version that supports all basic formats.
    Its intented to be used in U-Boot SPL versions on platforms with very
    limited internal RAM sizes.

    To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
    will result in the SPL using this tiny function and the main U-Boot
    still using the full-blown printf() function.

    This code was copied from:
    http://www.sparetimelabs.com/printfrevisited
    With mostly only coding style related changes so that its checkpatch
    clean.

    The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
    (Marvell AXP) SPL:

    Without this patch:
    58963 18536 1928 79427 13643 ./spl/u-boot-spl

    With this patch:
    56542 18536 1956 77034 12cea ./spl/u-boot-spl

    Note:
    To make it possible to compile tiny-printf.c instead of vsprintf.c when
    CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
    moved from common/console.c into vsprintf.c in this patch.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Cc: Hans de Goede
    Cc: Tom Rini
    Cc: Albert Aribaud

    Stefan Roese
     
  • Change some comments to match the U-Boot coding style rules.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Acked-by: Simon Glass

    Stefan Roese
     
  • As done in commit da229e4e [sandbox: Drop special-case sandbox console code],
    this patch drops the sandbox special-case code in vprintf() that was
    missed by Simon at that time.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Acked-by: Simon Glass

    Stefan Roese
     
  • compiling U-Boot for avr32 boards shows since
    commit 3d1957f0ea01 "dm: i2c: Add support for multiplexed I2C buses"
    this warning:

    Building current source for 4 boards (4 threads, 8 jobs per thread)
    avr32: + atstk1002
    +(atstk1002) drivers/i2c/built-in.o: warning: input is not relaxable
    avr32: + grasshopper
    +(grasshopper) drivers/i2c/built-in.o: warning: input is not relaxable
    avr32: + atngw100
    +(atngw100) drivers/i2c/built-in.o: warning: input is not relaxable
    avr32: + atngw100mkii
    +(atngw100mkii) drivers/i2c/built-in.o: warning: input is not relaxable
    0 4 0 /4 0:00:16 : atngw100mkii

    Fix it.

    Signed-off-by: Heiko Schocher
    Reviewed-by: Roger Meier
    Reviewed-by: Simon Glass
    Reviewed-by: Andreas Bießmann

    Heiko Schocher
     

22 Nov, 2015

21 commits

  • After introduction of CONFIG_SYS_NS16550 these defconfig files were
    added and need to be updated.

    Signed-off-by: Tom Rini

    Tom Rini
     
  • Tom Rini
     
  • The lamobo-r1 board, sometimes called the BPI-R1 but not labelled as such
    on the PCB, is meant as a A20 based router board. As such the board comes
    with a built-in switch chip giving it 5 gigabit ethernet ports, and it
    has a large empty area on the pcb with mounting holes which will fit a
    2.5 inch harddisk. To complete its networking features it has a
    Realtek RTL8192CU for WiFi 802.11 b/g/n.

    The dts file is identical to the one submitted upstream.

    Signed-off-by: Jelle de Jong
    Reviewed-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Jelle de Jong
     
  • Add defconfig files for the Orangepi Plus and Orangepi PC.

    Signed-off-by: Hans de Goede

    Hans de Goede
     
  • These files are based on the current latest upstream kernel work. The
    bus_gates bindings may still change, but for u-boot that does not matter
    as we do not (yet) use any clock info from devicetree for sunxi u-boot.

    Signed-off-by: Hans de Goede

    Hans de Goede
     
  • The 3.4 kernel from the Allwinner SDK is clocking AHB1 at 200MHz
    on Allwinner H3 and using PLL6 as the clock source (PLL6/3).
    This can be verified by reading the value of the AHB1_APB1_CFG_REG
    register via /dev/mem. It always reads as 0x3180 regardless of
    the current cpufreq operating point. So this configuration should
    be safe for use in U-Boot too.

    PLL6 also needs to be configured before it is used as the clock
    source, according to the "CCU / Programming Guidelines" section
    of the Allwinner manual.

    The current low AHB1 clock speed is limiting the USB transfer
    speed when booting via FEL. This patch can increase the FEL USB
    transfer speed from ~510 KB/s to ~950 KB/s.

    Signed-off-by: Siarhei Siamashka
    Reviewed-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Siarhei Siamashka
     
  • Based on existing A23/A33 code and the original H3 boot0.

    Signed-off-by: Jens Kuske
    Reviewed-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Jens Kuske
     
  • Add initial sun8i H3 support, only uart + mmc are supported for now.

    Signed-off-by: Jens Kuske
    Reviewed-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Jens Kuske
     
  • This is necessary to distinguish between the "dfu-util --detach" and
    the "dfu-util --reset" requests.

    The default weak implementation of dfu_usb_get_reset() unconditionally
    reboots the device, but we want to be able to continue the boot.scr
    execution after writing the kernel, fdt and ramdisk to RAM via DFU.

    Signed-off-by: Siarhei Siamashka
    Reviewed-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Siarhei Siamashka
     
  • The DFU protocol implementation in U-Boot is much faster than the
    FEL protocol implementation in the boot ROM on Allwinner devices.
    Using DFU instead of FEL improves the USB transfer speed from
    500-900 KB/s to 3.2-3.7 MB/s. This is particularly useful for
    reducing the time needed for booting systems with large initrd
    images.

    FEL is still useful for loading the U-Boot bootloader and a boot
    script, which may then activate DFU in the following way:

    setenv dfu_alt_info ${dfu_alt_info_ram}
    dfu 0 ram 0
    bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

    The rest of the files can be transferred to the device using the
    "dfu-util" tool.

    Signed-off-by: Siarhei Siamashka
    Reviewed-by: Hans de Goede
    Signed-off-by: Hans de Goede

    Siarhei Siamashka
     
  • Add support for storing the environment in CFI NOR flash on Juno and FVP
    models.

    I also removed some config values that are not used by CFI flash parts.

    Juno has 1 flash part with 259 sectors. The first 255 sectors are
    0x40000 (256kb) and are followed by 4 sectors of 0x10000 (64KB).

    FVP models simulate a 64MB NOR flash part at base address 0x0FFC0000.
    This part has 256 x 256kb sectors. We use the last sector to store the
    environment.

    To save the NOR flash to a file, the following parameters should be
    passed to the model:

    -C bp.flashloader1.fname=${FILENAME}
    -C bp.flashloader1.fnameWrite=${FILENAME}

    Foundation models don't simulate the NOR flash, but having NOR support
    in the u-boot binary does not harm: attempting to write to the NOR will
    fail gracefully.

    Signed-off-by: Ryan Harkin
    Acked-by: Linus Walleij

    Ryan Harkin
     
  • This patch allows vexpress64 targets to be compiled when
    CONFIG_SYS_FLASH_CFI is enabled.

    I considered using #warning instead of #error, but this just clutters up
    the build output and hides real warnings.

    Without this patch, you see errors during compilation like this:

    include/configs/vexpress_aemv8a.h:42:2: error: #error "Unknown board
    variant"
    #error "Unknown board variant"
    include/configs/vexpress_aemv8a.h:115:2: error: #error "Unknown board
    variant"
    #error "Unknown board variant"
    include/configs/vexpress_aemv8a.h:280:2: error: #error "Unknown board
    variant"
    #error "Unknown board variant"
    make[1]: *** [tools/envcrc.o] Error 1
    make: *** [tools] Error 2
    In file included from include/config.h:5:0,
    from tools/envcrc.c:19:

    Signed-off-by: Ryan Harkin
    Acked-by: Linus Walleij

    Ryan Harkin
     
  • This patch makes the 2nd DRAM bank available on Juno only and not on
    other vexpress64 targets, eg. the FVP models.

    The commit below added a 2nd bank of NOR flash for Juno, but also for
    all vexpress64 targets:

    commit 2d0cee1ca2b9d977fa3214896bb2e30cfec77059
    Author: Liviu Dudau
    Date: Mon Oct 19 11:08:31 2015 +0100

    vexpress64: Juno: Declare all 8GB of RAM and make them visible to the kernel.

    Juno comes with 8GB RAM, but U-Boot only passes 2GB to the kernel.
    Declare a secondary memory bank and set the sizes correctly.

    Signed-off-by: Liviu Dudau
    Reviewed-by: Linus Walleij
    Reviewed-by: Ryan Harkin
    Tested-by: Ryan Harkin

    Unfortunately, I only fully tested on Juno R0, R1 and the FVP Foundation
    model. Whilst FVP Base AEMV8 models run U-Boot OK, they fail to boot
    the kernel.

    Signed-off-by: Ryan Harkin
    Acked-by: Liviu Dudau
    Reviewed-by: Linus Walleij

    Ryan Harkin
     
  • Only compile in PCIe support if the board really uses it. Provide
    a __weak stub for the init function if e.g. FVP is being built.

    Signed-off-by: Ryan Harkin
    Acked-by: Linus Walleij

    Ryan Harkin
     
  • On a Juno r1 the PCI controller init routine outputs the rather boring
    ATR entry information.
    Do this only with DEBUG defined to avoid cluttering the user's
    terminal.

    Signed-off-by: Andre Przywara
    Acked-by: Ryan Harkin

    Andre Przywara
     
  • Cosmetic fixes to the file, make it checkpatch clean.

    Signed-off-by: Marek Vasut
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Heiko Schocher
    Reviewed-by: Heiko Schocher

    Marek Vasut
     
  • Add additional parameter into the eeprom command to select
    the I2C bus on which the eeprom resides.

    Signed-off-by: Marek Vasut
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Heiko Schocher
    Reviewed-by: Heiko Schocher

    Marek Vasut
     
  • Add bus argument to eeprom_init(), so that it can select
    the I2C bus number on which the eeprom resides. Any negative
    value of the $bus argument will preserve the old behavior.
    This is in place so that old code does not randomly break.

    Signed-off-by: Marek Vasut
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Heiko Schocher
    Reviewed-by: Heiko Schocher
    [trini: Wrap i2c_set_bus_num() call with CONFIG_SYS_I2C test]
    Signed-off-by: Tom Rini

    Marek Vasut
     
  • Unify the code for doing read/write into single function, since the
    code for both the read and write is almost identical. This again
    trims down the code duplication.

    Signed-off-by: Marek Vasut
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Heiko Schocher
    Reviewed-by: Heiko Schocher

    Marek Vasut
     
  • Pull out the code which computes the length of the transfer
    into separate code and clean it up a little. This again trims
    down the code duplication.

    Signed-off-by: Marek Vasut
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Heiko Schocher
    Reviewed-by: Heiko Schocher

    Marek Vasut
     
  • Implement default value of 8 for this macro and pull out all of
    this macro out of the code. The default value of 8 actually does
    implement exactly the same behavior as the previous code which
    was in the #else clause of the ifdef.

    Signed-off-by: Marek Vasut
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Heiko Schocher
    Reviewed-by: Heiko Schocher

    Marek Vasut