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
-
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
07 Dec, 2019
1 commit
-
linux_compat.c is the best place for kmemdup(), which is currenly used
only in ubifs.c, but will also be used when other kernel files
(in my case, lib/crypto/x509_cert_parser.c and pkcs7_parser.c) will be
imported. So just move it.Signed-off-by: AKASHI Takahiro
Reviewed-by: Heinrich Schuchardt
03 Dec, 2019
1 commit
-
Drop inclusion of crc.h in common.h and use the correct header directly
instead.With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini
12 Aug, 2019
2 commits
-
Move env_set_hex() over to the new header file along with env_set_addr()
which uses it.Signed-off-by: Simon Glass
Acked-by: Joe Hershberger -
As part of the effort to remove things from common.h, create a new header
for the gzip functions. Move the function declarations to it and add
missing documentation.Signed-off-by: Simon Glass
Reviewed-by: Simon Goldschmidt
09 Apr, 2019
1 commit
-
Before printk.h was introduced and MTDDEBUG was removed,
pr_crit() was calling MTDDEBUG(), which was since then
replaced by the current pr_debug().pr_debug is more appropriate here.
Signed-off-by: Eran Matityahu
Reviewed-by: Heiko Schocher
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
14 Sep, 2018
1 commit
-
I just stumbled over some cluttered UBIFS messages. It seems some
newline chars are missing in the current U-Boot UBI source.Signed-off-by: Stefan Roese
Cc: Heiko Schocher
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
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
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.uimgSigned-off-by: Christophe Kerello
Signed-off-by: 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
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 278Assume that the "mutex" is locked since that is the normal case when it
is checked in the ubifs code.Signed-off-by: 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 -
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
20 Nov, 2017
1 commit
-
kfree() calls free.
free() checks if the parameter is NULL.Signed-off-by: Heinrich Schuchardt
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
16 Aug, 2017
1 commit
-
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass
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
31 Oct, 2016
1 commit
-
Signed-off-by: Vagrant Cascadian
Reviewed-by: Simon Glass
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
15 Mar, 2016
2 commits
-
Rename this function to blk_get_device_part_str(). This is a better name
because it makes it clear that the function returns a block device and
parses a string.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren -
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long
and causes 80-column violations, rename it to struct blk_desc.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren
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
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
06 Nov, 2015
1 commit
-
Use the is_power_of_2() definition from log2.h to align with the
kernel implementation.Signed-off-by: Fabio Estevam
Reviewed-by: Tom Rini
Reviewed-by: Heiko Schocher
Reviewed-by: Jagan Teki
26 Oct, 2015
1 commit
-
sync with linux v4.2
commit 64291f7db5bd8150a74ad2036f1037e6a0428df2
Author: Linus Torvalds
Date: Sun Aug 30 11:34:09 2015 -0700Linux 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
25 Oct, 2015
2 commits
-
Implement the necessary functions for implementing generic fs support
for ubifs.Signed-off-by: Hans de Goede
Reviewed-by: Heiko Schocher -
Modify the ubifs u-boot wrapper function prototypes for generic fs use,
and give them their own header file.This is a preparation patch for adding ubifs support to the generic fs
code from fs/fs.c.Signed-off-by: Hans de Goede
Reviewed-by: Heiko Schocher
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
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 - 0x1f7f1108Signed-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
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
28 Jan, 2015
1 commit
-
This commit is a preperation for a subsequent UBIFS commit
which needs atomic_long operations.Therefor "include/asm-generic/atomic-long.h" is imported
from 1860e37 Linux 3.15Signed-off-by: Anton Habegger
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
25 Sep, 2014
1 commit
-
This would be useful to start moving various config options.
Signed-off-by: Masahiro Yamada
Acked-by: Simon Glass
Tested-by: Simon Glass
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 ]
#endifis 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
26 Aug, 2014
3 commits
-
snyc with linux v3.15:
commit 1860e379875dfe7271c649058aeddffe5afd9d0d
Author: Linus Torvalds
Date: Sun Jun 8 11:19:54 2014 -0700Linux 3.15
Signed-off-by: Heiko Schocher
Cc: Scott Wood
Cc: Tom Rini -
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 functionsSigned-off-by: Heiko Schocher
Cc: Scott Wood
Cc: Tom Rini -
resync ubi subsystem with linux:
commit 455c6fdbd219161bd09b1165f11699d6d73de11c
Author: Linus Torvalds
Date: Sun Mar 30 20:40:15 2014 -0700Linux 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