06 Dec, 2019
1 commit
-
Add support for setting linux,usable-memory property in the memory
node of device tree for the kernel [1].This property holds a base address and size, describing a
limited region in which memory may be considered available for use by
the kernel. Memory outside of this range is not available for use.[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt
Signed-off-by: Igor Opaniuk
Signed-off-by: Sanchayan Maity
Signed-off-by: Stefan Agner
Reviewed-by: Oleksandr Suvorov
28 Oct, 2019
1 commit
-
The FDT specification [0] gives a requirement of aligning properties on
32-bits. Make sure that the compiler is aware of this constraint when
accessing 64-bits properties.[0]: https://github.com/devicetree-org/devicetree-specification/blob/master/source/flattened-format.rst
Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Simon Glass
12 Aug, 2019
1 commit
-
Move env_get() over to the new header file.
Acked-by: Joe Hershberger
Signed-off-by: Simon Glass
25 Jul, 2019
2 commits
-
The fdt_pci_dma_ranges() cannot work on e.g. ARM, since the DT entries
endianness is not adjusted at all. Fix this.Signed-off-by: Marek Vasut
Cc: Tom Rini -
Currently, fdt_get_base_address() returns 0 if the "reg" property is
missing. Since 0 is a valid value, it is not suitable for the error
handling. Return OF_BAD_ADDR instead.Signed-off-by: Masahiro Yamada
Reviewed-by: Bin Meng
22 Jul, 2019
1 commit
-
Add the following functions to translate DMA address to CPU address:
- dev_translate_dma_address()
- ofnode_translate_dma_address()
- of_translate_dma_address()
- fdt_translate_dma_address()
These functions work the same way as xxx_translate_address(), with the
difference that the translation relies on the "dma-ranges" property
instead of the "ranges" property.Add related test. Test report:
=> ut dm fdt_translation
Test: dm_test_fdt_translation: test-fdt.c
Test: dm_test_fdt_translation: test-fdt.c (flat tree)
Failures: 0Signed-off-by: Fabien Dessenne
22 May, 2019
1 commit
-
When using fdt_fixup_mtdparts() offset and length cell sizes
are limited to 4 bytes (1 cell). However if the mtd device is
bigger then 4GiB, then #address-cells and #size-cells are
8 bytes (2 cells) [1].This patch read #size-cells and uses either fdt32_t or
fdt64_t cell size. The default is fdt32_t.[1] Documentation/devicetree/bindings/mtd/partition.txt
Signed-off-by: Stefan Mavrodiev
Reviewed-by: Simon Glass
10 May, 2019
1 commit
-
This function merely relocates the fdt blob, so don't let it alter
it by adding reservations that didn't exist before.Instead, if the memory used for the fdt blob has been reserved
before calling this function, ensure the relocated memory is
marked as reserved instead.Reported-by: Keerthy
Reported-by: Lokesh Vutla
Signed-off-by: Simon Goldschmidt
Reviewed-by: Lokesh Vutla
12 Apr, 2019
1 commit
-
Commit 6d29cc7dcf2d ("fdt: Fixup only valid memory banks") ended up
being merged twice, first as:commit 6d29cc7dcf2d35966aa0b6119fd1cbca0d21d5e6
Author: Thierry Reding
AuthorDate: Tue Jan 30 11:34:17 2018 +0100
Commit: Simon Glass
CommitDate: Sun Feb 18 12:53:38 2018 -0700fdt: Fixup only valid memory banks
Memory banks with address 0 and size 0 are empty and should not be
passed to the OS via device tree.Signed-off-by: Thierry Reding
Acked-by: Stephen Warrenand later again, though this time it was v2:
commit ed5af03f9bb8905f1e94d68ab49f22d7f061d75f
Author: Thierry Reding
AuthorDate: Thu Feb 15 19:05:59 2018 +0100
Commit: Tom Rini
CommitDate: Fri Feb 23 10:40:50 2018 -0500fdt: Fixup only valid memory banks
Memory banks with address 0 and size 0 are empty and should not be
passed to the OS via device tree.Acked-by: Stephen Warren
Signed-off-by: Thierry RedingThe second version was slightly different, so the main hunk of the patch
was applied twice. This isn't harmful because the code is idempotent,
but it's wasteful to run the same code twice.Signed-off-by: Thierry Reding
Reviewed-by: Simon Glass
15 Jan, 2019
1 commit
-
We usually deal with hexadecimal addresses and sizes in
device-tree. Its much easier if debug logs print hexadecimal
values too.Reviewed-by: Simon Glass
Signed-off-by: Sekhar Nori
Reviewed-by: Lokesh Vutla
Reviewed-by: Tom Rini
03 Dec, 2018
1 commit
-
On the sandbox the memory addresses in the device tree refer to the virtual
address space of the sandbox. This implies that the memory reservations for
the fdt also have to be converted to this address space.Signed-off-by: Heinrich Schuchardt
Signed-off-by: Alexander Graf
11 Sep, 2018
1 commit
-
In int-ll64.h, we always use the following typedefs:
typedef unsigned int u32;
typedef unsigned long uintptr_t;
typedef unsigned long long u64;This does not need to match to the compiler's .
Do not include it.The use of PRI* makes the code super-ugly. You can simply use
"l" for printing uintptr_t, "ll" for u64, and no modifier for u32.Signed-off-by: Masahiro Yamada
17 Aug, 2018
1 commit
-
If CONFIG_NR_DRAM_BANKS is bigger than the default
value (4) define MEMORY_BANKS_MAX as CONFIG_NR_DRAM_BANKS.Fixes: 2a1f4f1758b5 ("Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS if defined"")
Signed-off-by: Ramon Fried
07 Aug, 2018
1 commit
-
These functions are only called in this file that's why make them static
to keep static analysers happy.Signed-off-by: Michal Simek
Reviewed-by: Simon Glass
28 Jul, 2018
1 commit
-
This reverts commit 5e5745465c94605720295fab942eacbdd215db90.
The reverted commit didn't support the scenario where there are less
DRAM banks in U-Boot than in Linux.
Also, it didn't introduce any new functionality, only limitaion.
User could just increase MEMORY_BANKS_MAX if it's too small.
Reviewed-by: Simon Glass
25 Jul, 2018
1 commit
-
The second argument of fdt_fixup_mtdparts() is an opaque pointer,
'void *node_info', hence callers can pass any pointer.Obviously, fdt_fixup_mtdparts() expects 'struct node_info *'
otherwise, it crashes run-time.Change the prototype so that it is compile-time checked.
Also, add 'const' qualifier to it so that callers can constify
the struct node_info arrays.Signed-off-by: Masahiro Yamada
Reviewed-by: Simon Glass
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
05 Mar, 2018
1 commit
-
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.This commit moves the header code:
include/libfdt.h -> include/linux/libfdt.h
include/libfdt_env.h -> include/linux/libfdt_env.hand replaces include directives:
#include -> #include
#include -> #includeReported-by: Thomas Petazzoni
Signed-off-by: Masahiro Yamada
23 Feb, 2018
1 commit
-
Memory banks with address 0 and size 0 are empty and should not be
passed to the OS via device tree.Acked-by: Stephen Warren
Signed-off-by: Thierry Reding
19 Feb, 2018
1 commit
-
Memory banks with address 0 and size 0 are empty and should not be
passed to the OS via device tree.Signed-off-by: Thierry Reding
Acked-by: Stephen Warren
13 Feb, 2018
1 commit
-
The fdt_record_loadable()-function was wedged between other functions
that were guarded by ARCH_FIXUP_FDT_MEMORY. This could lead to linker
errors on some configurations.With this change, fdt_record_loadable() is moved out of the
ARCH_FIXUP_FDT_MEMORY guard (plus I tried to retain alphabetical
ordering for functions by placing it appropriately).References: 9f45aeb ("spl: fit: implement fdt_record_loadable")
Signed-off-by: Philipp Tomsich
Reported-by: Michal Simek
Tested-by: Michal Simek
25 Dec, 2017
1 commit
-
The MAC addresses get fixed in the device tree for "ethernet" nodes
is by using trailing number behind "ethernet" found in "/aliases".
It may not be necessary for the "ethernet" nodes to be sequential.
There can be gaps in between or any node disabledSo provide a support to fetch MAC addr sequentially from env
and apply them to "ethernet" nodes in the order they appear in
device tree only if "ethernet" is not "disabled"Signed-off-by: Prabhakar Kushwaha
Reviewed-by: York Sun
26 Nov, 2017
1 commit
-
During the loading of more complex FIT images (e.g. when the invoked
next stage needs to find additional firmware for a power-management
core... or if there are multiple images for different privilege levels
started in parallel), it is helpful to create a record of what images
are loaded where: if a FDT is loaded for one of the next stages, it
can be used to convey the status and location of loadables.This adds a fdt_record_loadable() function that can be invoked to
record the status of each loadable below the /fit-images path.Signed-off-by: Philipp Tomsich
Reviewed-by: Simon Glass
15 Sep, 2017
1 commit
-
Introduce fdt_overlay_apply_verbose, a method that applies an
overlay but in the case of an error produces a helpful message.In addition if a base tree is found to be missing the __symbols__
node the message will point out that the probable reason is that
the base tree was miscompiled without the -@ option.Signed-off-by: Pantelis Antoniou
Acked-by: Simon Glass
16 Aug, 2017
1 commit
-
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass
01 Aug, 2017
1 commit
-
This function appears to obtain the value of the 'ranges' property rather
than 'reg'. As such it does not behave as documented or expected.In addition it picks up the second field of the property which is the size
(with prop += naddr) rather than the first which is the address.Fix it.
Signed-off-by: Simon Glass
04 Jul, 2017
1 commit
-
There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.Signed-off-by: Heiko Schocher
01 Jun, 2017
2 commits
-
These two functions have an of_ prefix which conflicts with naming used
in of_addr. Rename them:fdt_read_number
fdt_support_bus_default_count_cellsSigned-off-by: Simon Glass
-
This function does not change the device tree so adjust it to use const
for this parameter.Signed-off-by: Simon Glass
26 Mar, 2017
1 commit
-
The Raspberry Pi device tree files since Linux v4.9 have a "ethernet"
alias pointing to the on-board Ethernet device node. However,
U-Boot's fdt_fixup_ethernet() only looks at ethernet aliases ending
in digits.As the spec doesn't mandate that aliases must end in numbers and there
have been much older uses of an "ethernet" aliases in the wild
(according to Tom Rini), change the code to accept "ethernet" as well.Without this Linux isn't told of the MAC address provided by the
RPI firmware and the ethernet interface is always assigned a random MAC
address.Signed-off-by: Tuomas Tynkkynen
Reviewed-by: Tom Rini
Acked-by: Joe Hershberger
10 Feb, 2017
1 commit
08 Feb, 2017
2 commits
-
fdt_fixup_mtdparts currently does nothing when partition info is
runtime-generated or compiled-in defaults are used.Signed-off-by: Ladislav Michl
Fix nits in commit message:
Signed-off-by: Simon Glass -
Commit 674bb249825a ("net: cosmetic: Replace magic numbers in arp.c with
constants") introduced a nice define to replace the magic value 6 for
the ethernet hardware address. Replace more hardcoded instances of 6
which really reference the ARP_HLEN (iow the MAC/Hardware/Ethernet
address).Signed-off-by: Olliver Schinagl
Acked-by: Joe Hershberger
03 Dec, 2016
1 commit
-
Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option")
allows us to skip memory setup of DTB, but a problem for ARM is that
spin_table_update_dt() and psci_update_dt() are skipped as well if
CONFIG_ARCH_FIXUP_FDT is disabled.This commit allows us to skip only fdt_fixup_memory_banks() instead
of the whole of arch_fixup_fdt(). It will be useful when we want to
use a memory node from a kernel DTB as is, but need some fixups for
Spin-Table/PSCI.Signed-off-by: Masahiro Yamada
Acked-by: Alexey Brodkin
Acked-by: Simon Glass
Fixed build error for x86:
Signed-off-by: Simon Glass
14 Oct, 2016
1 commit
-
Sometimes devicetree nodes and or properties are added out of the u-boot
console, maybe through some script or manual interaction.The devicetree as loaded or embedded is quite small, so the devicetree
has to be resized to take up those new nodes/properties.In original the devicetree was only extended by effective
4 * add_mem_rsv.With this commit we can add an argument to the "fdt resize" command,
which takes the extrasize to be added.Signed-off-by: Hannes Schmelzer
Signed-off-by: Hannes Schmelzer
Acked-by: Simon Glass
12 Aug, 2016
1 commit
-
The next patch will call fdt_translate_address() from somewhere with a
"const void *blob" rather than a "void *blob", so fdt_translate_address()
must accept a const pointer too. Constify the minimum number of function
parameters to achieve this.Signed-off-by: Stephen Warren
Acked-by: Simon Glass
Squashed in build fix from Stephen:
Signed-off-by: Simon Glass
26 May, 2016
2 commits
-
Provide some documentation for the fields of struct of_bus, for
consistency with that provided for the new match field.Signed-off-by: Paul Burton
Reviewed-by: Simon Glass -
Support ISA busses in much the same way as Linux does. This allows for
ISA bus addresses to be translated, and only if CONFIG_OF_ISA_BUS is
selected in order to avoid including the code in builds which won't need
it.Signed-off-by: Paul Burton
Reviewed-by: Simon Glass
04 May, 2016
1 commit
-
For multiple ethernet interfaces the FDT offset of '/aliases' will change as we
are adding MAC addresses to the FDT.
Therefore only the first interface ('ethernet0') will get properly updated in
the FDT, with the rest getting FDT errors when we try to set their MAC address.Signed-off-by: Lev Iserovich
Acked-by: Joe Hershberger
18 Mar, 2016
1 commit
-
This reverts commit 71105f50fedddfa5b0535d102c3d5078671721ad.
The reverted commit was applied for a temporary to unbreak
few Exynos boards on the release.After the discussion about the change, this commit should be avoided.
Fixed device-tree for Exynos, allows reverting it without any issues.Signed-off-by: Przemyslaw Marczak
Cc: Stefan Roese
Cc: Tom Rini
Cc: Simon Glass
Cc: Stephen Warren
Cc: Stephen Warren
Tested-by: Simon Glass
Acked-by: Simon Glass