History log of /rk3399_rockchip-uboot/include/fdt_support.h (Results 1 – 25 of 176)
Revision Date Author Comments
# afc5def0 29-Apr-2024 Xuhui Lin <xuhui.lin@rock-chips.com>

common: spl_fit_tb: Support append sys_bootargs into kernel fdt bootargs

Update:
bee57f9617 common: spl_fit_tb: Support append sys_bootargs into kernel fdt bootargs
fd004d5f65 common: spl_ab: Re-org

common: spl_fit_tb: Support append sys_bootargs into kernel fdt bootargs

Update:
bee57f9617 common: spl_fit_tb: Support append sys_bootargs into kernel fdt bootargs
fd004d5f65 common: spl_ab: Re-organize coding style about appending bootargs

Build from commit id 63cea019a9 under u-boot-tb repo with
additional configs as follows based on rv1106-spi-nor-tb.config:

CONFIG_FIT_SIGNATURE=y
CONFIG_DM_CRYPTO=y
CONFIG_FIT_HW_CRYPTO=y
CONFIG_SPL_FIT_SIGNATURE=y
CONFIG_SPL_FIT_ROLLBACK_PROTECT=y
CONFIG_SPL_AB=y
CONFIG_RSA_N_SIZE=0x200
CONFIG_RSA_E_SIZE=0x10
CONFIG_RSA_C_SIZE=0x20
CONFIG_SPL_OPTEE=y
CONFIG_SPL_GZIP=y

Change-Id: I49096fb506c3e0f7df8b2b930514079ee6f583a3
Signed-off-by: Xuhui Lin <xuhui.lin@rock-chips.com>

show more ...


# 5905ccea 11-Sep-2023 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

UPSTREAM: fdt_support: add optional board_rng_seed() hook

A recurring theme on LKML is the boot process deadlocking due to some
process blocking waiting for random numbers, while the kernel's
Crypto

UPSTREAM: fdt_support: add optional board_rng_seed() hook

A recurring theme on LKML is the boot process deadlocking due to some
process blocking waiting for random numbers, while the kernel's
Cryptographic Random Number Generator (crng) is not initalized yet,
but that very blocking means no activity happens that would generate
the entropy necessary to finalize seeding the crng.

This is not a problem on boards that have a good hwrng (when the
kernel is configured to trust it), whether in the CPU or in a TPM or
elsewhere. However, that's far from all boards out there. Moreover,
there are consumers in the kernel that try to obtain random numbers
very early, before the kernel has had any chance to initialize any
hwrng or other peripherals.

Allow a board to provide a board_rng_seed() function, which is
responsible for providing a value to be put into the rng-seed property
under the /chosen node.

The board code is responsible for how to actually obtain those
bytes.

- One possibility is for the board to load a seed "file" from
somewhere (it need not be a file in a filesystem of course), and
then ensure that that the same seed file does not get used on
subsequent boots.

* One way to do that is to delete the file, or otherwise mark it as
invalid, then rely on userspace to create a new one, and living
with the possibility of not finding a seed file during some boots.

* Another is to use the scheme used by systemd-boot and create a new
seed file immediately, but in a way that the seed passed to the
kernel and the new (i.e. next) seed cannot be deduced from each
other, see the explanation at
https://lore.kernel.org/lkml/20190929090512.GB13049@gardel-login/
and the current code at
https://github.com/systemd/systemd/blob/main/src/boot/efi/random-seed.c

- The board may have an hwrng from which some bytes can be read; while
the kernel can also do that, doing it in U-Boot and providing a seed
ensures that even very early users in the kernel get good random
numbers.

- If the board has a sensor of some sort (temperature, humidity, GPS,
RTC, whatever), mixing in a reading of that doesn't hurt.

- etc. etc.

These can of course be combined.

The rng-seed property is mixed into the pool used by the linux
kernel's CRNG very early during boot. Whether it then actually
contributes towards the kernel considering the CRNG initialized
depends on whether the kernel has been configured with
CONFIG_RANDOM_TRUST_BOOTLOADER (nowadays overridable via the
random.trust_bootloader command line option). But that's for the BSP
developer to ultimately decide.

So, if the board needs to have all that logic, why not also just have
it do the actual population of /chosen/rng-seed in ft_board_setup(),
which is not that many extra lines of code?

I considered that, but decided handling this logically belongs in
fdt_chosen(). Also, apart from saving the board code from the few
lines of boilerplate, doing it in ft_board_setup() is too late for at
least some use cases. For example, I want to allow the board logic to
decide

ok, let's pass back this buffer and use that as seed, but also let's
set random.trust_bootloader=n so no entropy is credited.

This requires the rng-seed handling to happen before bootargs
handling. For example, during the very first boot, the board might not
have a proper seed file, but the board could still return (a hash of)
some CPU serial# or whatnot, so that at least no two boards ever get
the same seed - the kernel always mixes in the value passed in
rng-seed, but if it is not "trusted", the kernel would still go
through the same motions as it would if no rng-seed was passed before
considering its CRNG initialized. I.e., by returning that
unique-to-this-board value and setting random.trust_bootloader=n, the
board would be no worse off than if board_rng_seed() returned nothing
at all.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
(cherry picked from commit 6dca1d9ad38de9b7f9a44d2c6eaa6acf9be6c2c0)
Change-Id: I9838bccc384ff6d52505ed48815f8e599f0a7ee1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>

show more ...


# 4e7cb295 05-Nov-2021 Joseph Chen <chenjh@rock-chips.com>

lib: bootm-fdt: fix compile error when not set CONFIG_ARCH_FIXUP_FDT_MEMORY

Showing memory banks is helpful.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I07aa5ae727d52b22e6034c193

lib: bootm-fdt: fix compile error when not set CONFIG_ARCH_FIXUP_FDT_MEMORY

Showing memory banks is helpful.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I07aa5ae727d52b22e6034c1935f133d3b9fd9b71

show more ...


# 6aa9b52e 10-Sep-2021 Joseph Chen <chenjh@rock-chips.com>

common: fdt_support: export fdt_setprop_uxx()

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iea72c5bf19bf15daf3e41fe417c8b31968aed765


# f26d9e52 06-Sep-2021 Joseph Chen <chenjh@rock-chips.com>

BACKPORT: fdt_support.c: Allow late kernel cmdline modification

By declaring board-specific board_fdt_chosen_bootargs() the kernel
command line arguments can be adjusted before injecting to flat dt

BACKPORT: fdt_support.c: Allow late kernel cmdline modification

By declaring board-specific board_fdt_chosen_bootargs() the kernel
command line arguments can be adjusted before injecting to flat dt
chosen node.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie6fd81686ff8df87dc7f40e275e01fad1093955f
(cherry-picked from f0b21ebd417cfe75f266b4dc16318bb3581783b9)

show more ...


# fb5b9138 02-Jul-2021 Jason Zhu <jason.zhu@rock-chips.com>

common: fdt_support: add fdt_bootargs_append_ab()

Support append data to bootargs.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Idb0f1a953ab4e3e330727044d62fdc48d1e1f034


# f536dcca 24-May-2021 Jason Zhu <jason.zhu@rock-chips.com>

common: fdt_support: add fdt_bootargs_append_ab()

Support append data to bootargs, like ab info.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I326a84122423fabba09555787e63742e0f2c

common: fdt_support: add fdt_bootargs_append_ab()

Support append data to bootargs, like ab info.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I326a84122423fabba09555787e63742e0f2c3267

show more ...


# 0e00a84c 04-Mar-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>

Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt header

UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>

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.h

and replaces include directives:
#include <libfdt.h> -> #include <linux/libfdt.h>
#include <libfdt_env.h> -> #include <linux/libfdt_env.h>

Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

show more ...


# 3a39dbf8 22-Feb-2018 Kever Yang <kever.yang@rock-chips.com>

fdt_support: add fdt_update_reserved_memory()

Add API for rockchip pass uboot logo memory info to kernel.

Change-Id: Ib3bfadc381efae21359a43654493e8e0f4e67dd0
Signed-off-by: Kever Yang <kever.yang@

fdt_support: add fdt_update_reserved_memory()

Add API for rockchip pass uboot logo memory info to kernel.

Change-Id: Ib3bfadc381efae21359a43654493e8e0f4e67dd0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

show more ...


# ce176305 23-Nov-2017 Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>

UPSTREAM: arm: Add support of updating dts before fix-up

"ethernet" node fix-up for device tree happens before Linux boot.

There can be requirement of updating "ethernet" node even before
fix-up. S

UPSTREAM: arm: Add support of updating dts before fix-up

"ethernet" node fix-up for device tree happens before Linux boot.

There can be requirement of updating "ethernet" node even before
fix-up. So, add support of updating "ethernet" node.

Change-Id: I5fcde8776f7f0f5c7323b1340c69d346c9c01833
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6bedf44714a145e09fddb8c5a03ada210b812ec9)

show more ...


# 8118cce3 24-Nov-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

UPSTREAM: spl: fit: add SPL_FIT_IMAGE_TINY config to reduce code-size

A minor code-size increase from the changes for tracking the os-type
of FIT images and from infrastructure for recording the loa

UPSTREAM: spl: fit: add SPL_FIT_IMAGE_TINY config to reduce code-size

A minor code-size increase from the changes for tracking the os-type
of FIT images and from infrastructure for recording the loadables into
the the loaded FDT, broke the builds for sun50i and some OMAP2+ devices.

This change adds a new config option (enabled by default for
MACH_SUN50I, MACH_SUN50I_H5 and ARCH_OMAP2PLUS) that does skips these
processing steps (bringing code size down to below the limit
again). The os-type is not evaluated, but assumed to be IH_OS_UBOOT
(i.e. taking the code-paths intended for backward-compatibility).

Note that enabling this config option precludes any useful downstream
processing, such as utilising a special calling convention for ATF or
OPTEE, based on the os-type of the loadables.

Change-Id: I32036975208be6e9d9d2ad3b5376444efd693f25
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 337bbb6297775e8e9d664e96e96004f00d1d8c02)

show more ...


# e265ab89 13-Sep-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

UPSTREAM: spl: fit: implement fdt_record_loadable

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

UPSTREAM: spl: fit: implement fdt_record_loadable

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.

Change-Id: I9d6dcd3cb7863a558ebde7c68bcfe45eaadcc76f
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9f45aeb937275960405de0f2abca8c665dbb03d4)

show more ...


# 0939009d 04-Sep-2017 Pantelis Antoniou <pantelis.antoniou@konsulko.com>

UPSTREAM: fdt: Introduce helper method fdt_overlay_apply_verbose()

Introduce fdt_overlay_apply_verbose, a method that applies an
overlay but in the case of an error produces a helpful message.

In a

UPSTREAM: fdt: Introduce helper method fdt_overlay_apply_verbose()

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.

Change-Id: I22cc210c6a7bb0aaa9655197c859f54677532099
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit fc7c31891c40dd1aac2e71e9d1546727ca2b3556)

show more ...


# eed36609 19-May-2017 Simon Glass <sjg@chromium.org>

fdt: Rename a few functions in fdt_support

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_cells

fdt: Rename a few functions in fdt_support

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_cells

Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# ec002119 19-May-2017 Simon Glass <sjg@chromium.org>

fdt: Update fdt_get_base_address() to use const

This function does not change the device tree so adjust it to use const
for this parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 73eed452 04-Dec-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://www.denx.de/git/u-boot-dm


# 63c09417 26-Nov-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY

Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option")
allows us to skip memory setup of DTB, but a problem for ARM is that
spi

libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY

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 <yamada.masahiro@socionext.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Simon Glass <sjg@chromium.org>
Fixed build error for x86:
Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# 4504062b 14-Oct-2016 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-fdt


# ef476836 20-Sep-2016 Hannes Schmelzer <hannes.schmelzer@br-automation.com>

cmd/fdt: add possibilty to have 'extrasize' on fdt resize

Sometimes devicetree nodes and or properties are added out of the u-boot
console, maybe through some script or manual interaction.

The devi

cmd/fdt: add possibilty to have 'extrasize' on fdt resize

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 <hannes.schmelzer@br-automation.com>

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Acked-by: Simon Glass <sjg@chromium.org>

show more ...


# fe4ba689 01-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-usb

Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
include/configs/dra7xx_evm.h


# a5c289b9 16-Sep-2016 Sriram Dash <sriram.dash@nxp.com>

usb: fsl: Rename fdt_fixup_dr_usb

The function fdt_fixup_dr_usb is specific to fsl/nxp. So,
make the function name explicit and rename fdt_fixup_dr_usb
into fsl_fdt_fixup_dr_usb.

Signed-off-by: Sri

usb: fsl: Rename fdt_fixup_dr_usb

The function fdt_fixup_dr_usb is specific to fsl/nxp. So,
make the function name explicit and rename fdt_fixup_dr_usb
into fsl_fdt_fixup_dr_usb.

Signed-off-by: Sriram Dash <sriram.dash@nxp.com>

show more ...


# f4b0df18 12-Aug-2016 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-dm


# 11e44fc6 05-Aug-2016 Stephen Warren <swarren@nvidia.com>

fdt_support: fdt_translate_address() blob const correctness

The next patch will call fdt_translate_address() from somewhere with a
"const void *blob" rather than a "void *blob", so fdt_translate_add

fdt_support: fdt_translate_address() blob const correctness

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 <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Squashed in build fix from Stephen:
Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# 4711e7f7 28-Jul-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://www.denx.de/git/u-boot-imx


# f4ae23a7 12-Jul-2016 Christopher Spinrath <christopher.spinrath@rwth-aachen.de>

fdt_support: define stub for fdt_fixup_mtdparts

Define an inline stub for fdt_fixup_mtdparts in the case that
CONFIG_FDT_FIXUP_PARTITIONS is not defined. This avoids the need
to guard every call to

fdt_support: define stub for fdt_fixup_mtdparts

Define an inline stub for fdt_fixup_mtdparts in the case that
CONFIG_FDT_FIXUP_PARTITIONS is not defined. This avoids the need
to guard every call to this function by a proper #ifdef in board
files.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Igor Grinberg <grinberg@compulab.co.il>

show more ...


12345678