06 Feb, 2020

2 commits

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present devres.h is included in all files that include dm.h but few
    make use of it. Also this pulls in linux/compat which adds several more
    headers. Drop the automatic inclusion and require files to include devres
    themselves. This provides a good indication of which files use devres.

    Signed-off-by: Simon Glass
    Reviewed-by: Anatolij Gustschin

    Simon Glass
     

07 Dec, 2019

1 commit


03 Dec, 2019

1 commit


12 Aug, 2019

2 commits


09 Apr, 2019

1 commit


07 Nov, 2018

1 commit

  • Add local size_t variable to crypto_comp_decompress as intermediate
    storage for destination length to avoid memory corruption and incorrect
    results on 64 bit targets.

    This is what linux does for the various lz compression implementations.

    Signed-off-by: Paul Davey
    Cc: Heiko Schocher
    Tested-by: Heiko Schocher

    Paul Davey
     

14 Sep, 2018

1 commit


12 Jul, 2018

1 commit

  • By checking ubifs source code, s_instances parameter is not
    used anymore. So, set this parameter and the associated source
    code under __UBOOT__ compilation.

    Signed-off-by: Christophe Kerello
    Signed-off-by: Patrice Chotard

    Christophe Kerello
     

13 Jun, 2018

1 commit

  • Often during debugging session it's very interesting to see
    what data we were dealing with. For example what we write or read
    to/from memory or peripherals.

    This change introduces functions that allow to dump binary
    data with one simple function invocation like:
    ------------------->8----------------
    print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len);
    ------------------->8----------------

    which gives us the following:
    ------------------->8----------------
    00000000: f2 b7 c9 88 62 61 75 64 72 61 74 65 3d 31 31 35 ....baudrate=115
    00000010: 32 30 30 00 62 6f 6f 74 61 72 67 73 3d 63 6f 6e 200.bootargs=con
    00000020: 73 6f 6c 65 3d 74 74 79 53 33 2c 31 31 35 32 30 sole=ttyS3,11520
    00000030: 30 6e 38 00 62 6f 6f 74 64 65 6c 61 79 3d 33 00 0n8.bootdelay=3.
    00000040: 62 6f 6f 74 66 69 6c 65 3d 75 49 6d 61 67 65 00 bootfile=uImage.
    00000050: 66 64 74 63 6f 6e 74 72 6f 6c 61 64 64 72 3d 39 fdtcontroladdr=9
    00000060: 66 66 62 31 62 61 30 00 6c 6f 61 64 61 64 64 72 ffb1ba0.loadaddr
    00000070: 3d 30 78 38 32 30 30 30 30 30 30 00 73 74 64 65 =0x82000000.stde
    00000080: 72 72 3d 73 65 72 69 61 6c 30 40 65 30 30 32 32 rr=serial0@e0022
    00000090: 30 30 30 00 73 74 64 69 6e 3d 73 65 72 69 61 6c 000.stdin=serial
    000000a0: 30 40 65 30 30 32 32 30 30 30 00 73 74 64 6f 75 0@e0022000.stdou
    000000b0: 74 3d 73 65 72 69 61 6c 30 40 65 30 30 32 32 30 t=serial0@e00220
    000000c0: 30 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00..............
    ...
    ------------------->8----------------

    Source of hexdump.c was copied from Linux kernel v4.7-rc2.

    Signed-off-by: Alexey Brodkin
    Cc: Anatolij Gustschin
    Cc: Mario Six
    Cc: Simon Glass
    Cc: Tom Rini
    Cc: Stefan Roese

    Alexey Brodkin
     

09 May, 2018

1 commit

  • This patch solves assert failed displayed in the console during a boot.
    The root cause is that the ubifs_inode is not already allocated when
    ubifs_printdir and ubifs_finddir functions are called.

    Trace showing the issue:
    feed 'boot.scr.uimg', ino 94, new f_pos 0x17b40ece
    dent->ch.sqnum '7132', creat_sqnum 3886945402880
    UBIFS assert failed in ubifs_finddir at 436
    INODE ALLOCATION: creat_sqnum '7129'
    Found U-Boot script /boot.scr.uimg

    Signed-off-by: Christophe Kerello
    Signed-off-by: Patrice Chotard

    Patrice Chotard
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

11 Apr, 2018

1 commit

  • The mutex lock and unlock functions are stubbed out and mutex_is_locked
    was 0. This caused asserts to fail in ubifs code when checking that the
    mutex was locked. For example,

    UBIFS assert failed in ubifs_change_lp at 540
    UBIFS assert failed in ubifs_release_lprops at 278

    Assume that the "mutex" is locked since that is the normal case when it
    is checked in the ubifs code.

    Signed-off-by: Bradley Bolen

    Bradley Bolen
     

24 Mar, 2018

2 commits

  • Introduce another difference from upstream (kernel) source in
    fs/ubifs/super.c: adding preprocessor condition as y variable in
    mount_ubifs() depends on CONFIG_UBIFS_SILENCE_MSG:
    fs/ubifs/super.c:1337:15: error: variable ?y? set but not used [-Werror=unused-but-set-variable]
    long long x, y;

    Not setting CONFIG_UBIFS_SILENCE_MSG in am335x_igep003x_defconfig and
    igep0032_defconfig. Although it was defined in their config headers, it
    depends on CMD_UBIFS which is not set for them.

    Signed-off-by: Petr Vorel
    Cc: Joe Hershberger
    Cc: Heiko Schocher

    Petr Vorel
     
  • Use of CONFIG_UBIFS_SILENCE_MSG was added in
    147162dac6 ("ubi: ubifs: Turn off verbose prints")

    Then it was removed in
    ff94bc40af ("mtd, ubi, ubifs: resync with Linux-3.14")

    Cc: Joe Hershberger
    Cc: Heiko Schocher
    Signed-off-by: Petr Vorel

    Petr Vorel
     

20 Nov, 2017

1 commit


24 Oct, 2017

1 commit

  • All users of this macro have been converted. Remove MTDDEBUG and
    related CONFIG options.

    ubifs_dbg_msg_key() is kept. It is silent unless DEBUG is defined.

    I am not touching scripts/config_whitelist.txt. The deprecated options
    will be dropped by the next resync.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

16 Aug, 2017

1 commit


06 Jun, 2017

1 commit

  • This patch fixes the below warning by typecasting it properly
    fs/ubifs/ubifs.c: In function 'ubifs_load':
    fs/ubifs/ubifs.c:942:29: warning: cast to pointer from integer
    of different size [-Wint-to-pointer-cast]
    err = ubifs_read(filename, (void *)addr, 0, size, &actread);

    Signed-off-by: Siva Durga Prasad Paladugu
    Signed-off-by: Michal Simek
    Reviewed-by: Heiko Schocher

    Siva Durga Prasad Paladugu
     

31 Oct, 2016

1 commit


22 Apr, 2016

1 commit

  • In list "super_blocks" ubifs collects allocated super_block
    structs. U-Boot frees on unmount the allocated struct,
    so the pointer stored in this list is free after the umount.
    On a new ubifs mount, the new allocated super_block struct
    get inserted into the super_blocks list ... which contains
    now a freed pointer, and the list_add_tail() corrupts the
    freed memory ...

    2 solutions are possible:
    - remove the super_block from the super_blocks list
    on umount

    - as U-Boot does not use the super_blocks list ...
    remove it complete for U-Boot.

    Both solutions should not introduce problems for porting
    to newer linux version, so this patch removes the unused
    super_blocks list, as it saves code size and execution
    time.

    Signed-off-by: Heiko Schocher

    Heiko Schocher
     

15 Mar, 2016

2 commits


25 Jan, 2016

1 commit

  • BUILD_BUG_* macros have been defined in several headers. It would
    be nice to collect them in include/linux/bug.h like Linux.

    This commit is cherry-picking useful macros from include/linux/bug.h
    of Linux 4.4.

    I did not import BUILD_BUG_ON_MSG() because it would not work if it
    is used with include/common.h in U-Boot. I'd like to postpone it
    until the root cause (the "error()" macro in include/common.h causes
    the name conflict with "__attribute__((error()))") is fixed.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Tom Rini

    Masahiro Yamada
     

19 Jan, 2016

1 commit

  • In a number of places we had wordings of the GPL (or LGPL in a few
    cases) license text that were split in such a way that it wasn't caught
    previously. Convert all of these to the correct SPDX-License-Identifier
    tag.

    Signed-off-by: Tom Rini

    Tom Rini
     

06 Nov, 2015

1 commit


26 Oct, 2015

1 commit

  • sync with linux v4.2

    commit 64291f7db5bd8150a74ad2036f1037e6a0428df2
    Author: Linus Torvalds
    Date: Sun Aug 30 11:34:09 2015 -0700

    Linux 4.2

    This update is needed, as it turned out, that fastmap
    was in experimental/broken state in kernel v3.15, which
    was the last base for U-Boot.

    Signed-off-by: Heiko Schocher
    Tested-by: Ezequiel Garcia

    Heiko Schocher
     

25 Oct, 2015

2 commits


12 Sep, 2015

1 commit

  • At present malloc.h is included everywhere since it recently was added to
    common.h in this commit:

    4519668 mtd/nand/ubi: assortment of alignment fixes

    This seems wasteful and unnecessary. We have been trying to trim down
    common.h and put separate functions into separate header files and that
    change goes in the opposite direction.

    Move malloc_cache_aligned() to a new header so that this can be avoided.
    The header would perhaps be better named as alignmem.h but it needs to be
    included after common.h and people might be confused by this. With the name
    memalign.h it fits nicely after malloc() in most cases.

    Signed-off-by: Simon Glass
    Acked-by: Marcel Ziswiler

    Simon Glass
     

29 Aug, 2015

1 commit

  • Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer
    alignment into account which led to failures of the following form:

    ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108
    ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108

    Signed-off-by: Marcel Ziswiler
    Reviewed-by: Simon Glass
    Acked-by: Scott Wood
    [trini: Add __UBOOT__ hunk to lib/zlib/zutil.c due to malloc.h in common.h]
    Signed-off-by: Tom Rini

    Marcel Ziswiler
     

29 Jan, 2015

1 commit

  • Enable ubifs_replay_journal during mount_ubifs, which was
    disabled before.

    This commit fix an issue with unrecoverable ubifs volumes
    after power cut.

    Therefor the gc.c is imported now from 1860e37 Linux 3.15

    hs: added SPDX-License-Identifier for fs/ubifs/gc.c

    Signed-off-by: Anton Habegger

    Anton Habegger
     

28 Jan, 2015

1 commit


21 Nov, 2014

1 commit

  • U-Boot has imported various utility macros from Linux
    scattering them to various places without consistency.

    In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
    container_of, DIV_ROUND_UP, etc.
    In include/linux/compat.h are min_t, max_t, round_up, round_down,
    etc.
    We also have duplicated defines of min_t in some *.c files.

    Moreover, we are suffering from too cluttered include/common.h.

    This commit moves various macros that originate in
    include/linux/kernel.h of Linux to their original position.

    Note:
    This commit simply moves the macros; the macros roundup,
    min, max, min2, max3, ARRAY_SIZE are different
    from those of Linux at this point.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

25 Sep, 2014

1 commit


17 Sep, 2014

1 commit

  • U-Boot has imported various source files from other projects,
    mostly Linux.

    Something like

    #ifdef __UBOOT__
    [ modification for U-Boot ]
    #else
    [ original code ]
    #endif

    is an often used strategy for clarification of adjusted parts,
    that is, easier re-sync in future.

    Instead of defining __UBOOT__ in each source file,
    passing it from the top Makefile would be easier.

    Signed-off-by: Masahiro Yamada
    Acked-by: Marek Vasut
    Acked-by: Heiko Schocher

    Masahiro Yamada
     

26 Aug, 2014

3 commits

  • snyc with linux v3.15:

    commit 1860e379875dfe7271c649058aeddffe5afd9d0d
    Author: Linus Torvalds
    Date: Sun Jun 8 11:19:54 2014 -0700

    Linux 3.15

    Signed-off-by: Heiko Schocher
    Cc: Scott Wood
    Cc: Tom Rini

    Heiko Schocher
     
  • while playing with the new mtd/ubi/ubifs sync, found some
    small updates for it:

    - add del_mtd_partition() to include/linux/mtd/mtd
    - mtd: add a debug_printf
    - remove some not used functions

    Signed-off-by: Heiko Schocher
    Cc: Scott Wood
    Cc: Tom Rini

    Heiko Schocher
     
  • resync ubi subsystem with linux:

    commit 455c6fdbd219161bd09b1165f11699d6d73de11c
    Author: Linus Torvalds
    Date: Sun Mar 30 20:40:15 2014 -0700

    Linux 3.14

    A nice side effect of this, is we introduce UBI Fastmap support
    to U-Boot.

    Signed-off-by: Heiko Schocher
    Signed-off-by: Tom Rini
    Cc: Marek Vasut
    Cc: Sergey Lapin
    Cc: Scott Wood
    Cc: Joerg Krause

    Heiko Schocher