Commit Graph

17 Commits

Author SHA1 Message Date
Heinrich Schuchardt 0e2111e12c libfdt: fix SPDX license identifiers
License identifiers should be machine readable.

According to the SPDX v2.3.0 specification annex E parentheses are not
used in the SPDX identifier field when specifying multiple licenses [1].

[1] https://spdx.github.io/spdx-spec/v2.3/using-SPDX-short-identifiers-in-source-files/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
2023-07-31 11:40:49 +05:30
Xiang W 4e3353057a lib: sbi: Remove unnecessary semicolon
We have redundant semicolon at quite a few places so let's remove it.

Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
2023-05-11 12:31:34 +05:30
Rahul Pathak b224ddb41f include: types: Add typedefs for endianness
If any variable/memory-location follows certain
endianness then its important to annotate it properly
so that proper conversion can be done before read/write
from that variable/memory.

Also, use these new typedefs in libfdt_env.h for deriving
its own custom fdtX_t types

Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
2023-02-08 18:24:13 +05:30
Rahul Pathak 680bea02bf lib: utils/fdt: Use byteorder conversion functions in libfdt_env.h
FDT follows big-endian and CPU can be little or big
endian as per the implementation.
libfdt_env.h defines function for conversion between
fdt and cpu byteorder according to the endianness.

Currently, libfdt_env.h defines custom byte swapping
macros and then undefines them. Instead, use the generic
endianness conversion functions

Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
2023-02-08 18:17:42 +05:30
Anup Patel 68d7b85ec7 lib: utils/fdt: Use kconfig for enabling/disabling
We update FDT support makefile to use kconfig for enabling/disabling.
To avoid compilation errors, we also enable FDT for each platform.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Tested-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Atish Patra <atishp@rivosinc.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
2022-08-08 09:34:08 +05:30
Bin Meng eb90e0a16c lib: utils/libfdt: Upgrade to v1.6.1 release
Sync with libfdt v1.6.1 release source codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-06-22 17:42:29 +05:30
Daniel Schaefer c9ef2bc7e4 lib: utils: Add strncpy macro to libfdt_env.h
we want to use sbi_strncpy as strncpy in the OpenSBI implementation for
libfdt.

Just like 2845d2d2cf

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-05-19 17:33:33 +05:30
Marouene Boubakri bfc85c70e7 include: headers: Replace __ASSEMBLY__ with __ASSEMBLER__
GCC has already a predefined macro __ASSEMBLER__ therefore, it can be
used without the need to define a new flag with -D__ASSEMBLY__.
This is useful when adding the library to projects having a build
system such one can build without the need to make changes.
THe build system does not use the Makefile in the sources tree.

Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
2021-03-22 16:02:48 +05:30
Dimitri John Ledkov e7da0b4204 lib: utils/libfdt: Upgrade to v1.6.0 release
Sync with libfdt v1.6.0 release source codes.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-12-13 09:52:25 +05:30
Abner Chang 2845d2d2cf lib: utils: Add a macro in libfdt_env.h for strncmp
This commit add a macro to replace strncmp with sbi_strncmp.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-07-29 12:06:15 +05:30
Bin Meng dce88467af libfdt: Compile fdt_addresses.c
Pull fdt_addresses.o in for fdt_address_cells() & fdt_size_cells().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-03-18 09:08:33 +05:30
Bin Meng baac7e066d libfdt: Upgrade to v1.5.1 release
Sync with latest libfdt v1.5.1 release source codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-03-13 10:28:11 +05:30
Bin Meng 0cfe49ad63 libfdt: Add INT32_MAX and UINT32_MAX in libfdt_env.h
Add two macros in preparation to sync libfdt codes to latest v1.5.1
release from upstream.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-03-13 10:23:31 +05:30
Bin Meng 2abc55bb39 lib: Sort build objects in alphabetical order
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-03-10 10:02:48 +05:30
Atish Patra b2d0caf86b platform: Enable all drivers by default.
The drivers and libfdt are built as libsbiutils.a
instead of libplatsbi.a.

libsbiutils.a are not built per platform specific. Thus,
enable all drivers by default.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Anup Patel <anup.patel@wdc.com>
2019-06-19 09:49:05 +05:30
Atish Patra 200ed7c1bd lib: Rename string.x to sbi_string.x
All string functions are part of libsbi. It makes more sense
to rename them to sbi_string.x as the libsbi can be linked
with external libraries that can have similar implementation.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Anup Patel <anup.patel@wdc.com>
2019-06-19 09:48:59 +05:30
Atish Patra 793e5e1184 platform: Move platform common to lib/utils.
Currently, platform/common contains platform/non-platform specific
common minimal drivers and libraries. This is helpful is all platforms
are built within opensbi framework.

Move them to lib/utils so that any external platform code also can
reuse the minimalistic drivers or other common libraries.

This patch doesn't introduce any functional changes.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Anup Patel <anup.patel@wdc.com>
2019-06-19 09:48:56 +05:30