[PATCH v3] elf: add 64 bits elf loading support

2019-09-01 Thread Clement Leger
From: Clement Leger This patch add elf64 loading support to the elf loader. Since elf32 and elf64 uses completely different types, to avoid copying all the code and simply replace elf32 with elf64, use a macro which will return the appropriate field for each type of header. This macro generates

[PATCH v4 2/2] mips: bootm: Cast elf entry into unsigned long

2019-09-04 Thread Clement Leger
Since elf entry type is now a u64 to accomodate both type of elf files (64 and 32 bits), we need to cast it to the pointer length before casting it to the pointer type. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 1/2] elf: add 64 bits elf loading support

2019-09-04 Thread Clement Leger
From: Clement Leger This patch add elf64 loading support to the elf loader. Since elf32 and elf64 uses completely different types, to avoid copying all the code and simply replace elf32 with elf64, use a macro which will return the appropriate field for each type of header. This macro generates

[PATCH] mtd: spi-nor: Add support for is25lp01g

2019-11-22 Thread Clement Leger
Add ISSI 128Mb nor flash. --- drivers/mtd/spi-nor/spi-nor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index b25103598..1e1b69626 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -677,6

[PATCH] mtd: spi-nor: Add support for is25lp01g

2019-11-22 Thread Clement Leger
Add ISSI 128Mb nor flash. Signed-off-by: Clement Leger --- - Add missing Signed-off-by drivers/mtd/spi-nor/spi-nor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index b25103598..1e1b69626 100644 --- a/drivers/mtd/spi-nor

[PATCH 4/5] clocksource: k1c: Add k1c clocksource support

2020-01-15 Thread Clement Leger
Add a clocksource for k1c architecture based on core performance counter. This performance counter is configured to count cycles and as such can be used to be a clocksource. Signed-off-by: Clement Leger --- arch/k1c/configs/generic_defconfig | 1 + drivers/clocksource/Kconfig| 4

[PATCH 1/5] k1c: Initial Kalray Coolidge (k1c) architecture support

2020-01-15 Thread Clement Leger
Add kalray coolidge arch/ support. Signed-off-by: Clement Leger --- arch/k1c/Kconfig | 45 ++ arch/k1c/Makefile | 36 arch/k1c/boards/generic/Makefile | 0 arch/k1c/configs/generic_defconfig | 9 ++ arch/k1c/cpu/Makefile

[PATCH 5/5] watchdog: k1c: Add k1c watchdog support

2020-01-15 Thread Clement Leger
Add a watchdog for k1c architecture based on core watchdog. Signed-off-by: Clement Leger --- arch/k1c/configs/generic_defconfig | 3 + drivers/watchdog/Kconfig | 7 +++ drivers/watchdog/Makefile | 1 + drivers/watchdog/k1c_wdt.c | 126

[PATCH 0/5] Add support for Kalray k1c core

2020-01-15 Thread Clement Leger
. k1c support for clocksource and watchdog is also part of this port. In order to build a usable toolchain, build scripts are provided at the following address: https://github.com/kalray/build-scripts. Kalray uses FOSS which is available at https://github.com/kalray Clement Leger (5): k1c

[PATCH 3/5] k1c: Add support for device tree

2020-01-15 Thread Clement Leger
Add dts folder with minimal device tree for kalray K200 board. Signed-off-by: Clement Leger --- arch/k1c/Kconfig | 20 ++ arch/k1c/Makefile | 1 + arch/k1c/dts/Makefile | 13 +++ arch/k1c/dts/k200.dts | 105 ++ 4 files

[PATCH] pinctrl-single: Handle "pinctrl-single, function-mask" dt property

2020-01-14 Thread Clement Leger
From: Siméon Marijon Implement linux behavior regarding "pinctrl-single,function-mask" and "pinctrl-single,bits". It allows multiple pins control per register. (linux sha1: 4e7e8017a80e1810100c9b416b86e3baef900285) Signed-off-by: Simeon Marijon --- drivers/pinctrl/pinctrl-single.c | 81

[PATCH] Documentation: kvx: add first documentation

2020-04-21 Thread Clement Leger
Add documentation on kvx architecture and kalray k200 board. Signed-off-by: Clement Leger --- Documentation/boards/kvx.rst | 98 Documentation/boards/kvx/kalray-k200.rst | 11 +++ 2 files changed, 109 insertions(+) create mode 100644 Documentation/boards

[PATCH 0/2] Allow parsing more than one memory node

2020-03-16 Thread Clement Leger
y has been modified to allow being called multiple times and correctly add all memory banks. Clement Leger (2): of: base: parse all available memory nodes of: base: allow of_add_memory to be called multiple times drivers/of/base.c | 42 +++--- 1 file c

[PATCH 1/2] of: base: parse all available memory nodes

2020-03-16 Thread Clement Leger
then it will only be added once. Signed-off-by: Clement Leger --- drivers/of/base.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 9ede05227..b1a96ee8f 100644 --- a/drivers/of/base.c +++ b/driver

[PATCH 2/2] of: base: allow of_add_memory to be called multiple times

2020-03-16 Thread Clement Leger
to store the current memory bank number in order to be preserved from one call to another. Signed-off-by: Clement Leger --- drivers/of/base.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index b1a96ee8f..12c58bfb6 100644

[PATCH v2 5/6] clocksource: kvx: Add kvx clocksource support

2020-04-04 Thread Clement Leger
Add a clocksource for kvx architecture based on core performance counter. This performance counter is configured to count cycles and as such can be used to be a clocksource. Signed-off-by: Clement Leger --- arch/kvx/configs/generic_defconfig | 1 + drivers/clocksource/Kconfig| 4

[PATCH v2 1/6] kvx: Initial Kalray Coolidge (kv3) architecture support

2020-04-04 Thread Clement Leger
Add kalray coolidge arch/ support. Signed-off-by: Clement Leger --- arch/kvx/Kconfig | 33 + arch/kvx/Makefile | 36 ++ arch/kvx/configs/generic_defconfig | 9 ++ arch/kvx/cpu/Makefile | 7 ++ arch/kvx/cpu/barebox.lds.S | 95

[PATCH v2 6/6] watchdog: kvx: Add kvx watchdog support

2020-04-04 Thread Clement Leger
Add a watchdog for kvx architecture based on core watchdog. Signed-off-by: Clement Leger --- arch/kvx/configs/generic_defconfig | 3 + drivers/watchdog/Kconfig | 6 ++ drivers/watchdog/Makefile | 1 + drivers/watchdog/kvx_wdt.c | 94

[PATCH v2 4/6] kvx: Implement reset source and reset

2020-04-04 Thread Clement Leger
Implement reset and reset source handling using ftu. This support uses regmap to access the ftu easily using "kalray,kvx-syscon" compatible. Signed-off-by: Clement Leger --- arch/kvx/Kconfig | 2 + arch/kvx/configs/generic_defconfig | 1 + arch/kvx/cp

[PATCH v2 3/6] kvx: Add support for device tree

2020-04-04 Thread Clement Leger
Add dts folder with minimal device tree for kalray K200 board. Signed-off-by: Clement Leger --- arch/kvx/Kconfig | 20 arch/kvx/Makefile | 1 + arch/kvx/dts/Makefile | 13 + arch/kvx/dts/k200.dts | 110 ++ 4 files changed, 144

[PATCH v2 0/6] Add support for Kalray VLIW family (kvx)

2020-04-04 Thread Clement Leger
number is present - Remove dead code from watchdog - Add patch for reset source and enable CMD_RESET - Rebase on master branch Clement Leger (6): kvx: Initial Kalray Coolidge (kv3) architecture support kvx: Add processor definitions kvx: Add support for device tree kvx: Implement reset

[PATCH v2 0/2] Allow parsing more than one memory node

2020-03-25 Thread Clement Leger
y has been modified to allow being called multiple times and correctly add all memory banks. Changes v1 -> v2 - Reorder patches - Remove legacy "memory" node handling Clement Leger (2): of: base: allow of_add_memory to be called multiple times of: base: parse all available

[PATCH v2 1/2] of: base: allow of_add_memory to be called multiple times

2020-03-25 Thread Clement Leger
to store the current memory bank number in order to be preserved from one call to another. Signed-off-by: Clement Leger --- drivers/of/base.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 9ede05227..2ea8d7516 100644

[PATCH v2 2/2] of: base: parse all available memory nodes

2020-03-25 Thread Clement Leger
rrectly parsed by Linux kernel. In order to fix that, add of_probe_memory function which loop over all available memory nodes matching device_type == "memory". Signed-off-by: Clement Leger --- drivers/of/base.c | 22 -- 1 file changed, 16 insertions(+), 6 deleti

[PATCH v2 5/6] common: bootm: add support for elf file loading

2020-04-23 Thread Clement Leger
This will allows elf loader to directly have an elf file available. Thus filetype_elf bootm handlers will be able to use this elf file directly. Signed-off-by: Clement Leger --- common/Kconfig | 8 common/bootm.c | 30 ++ include/bootm.h | 3 +++ 3 files

[PATCH v2 6/6] mips: lib: bootm: use new data->elf member

2020-04-23 Thread Clement Leger
Now that the elf file is loaded by the bootm core, use this field directly instead of manually loading the elf file. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib

[PATCH v2 2/6] common: elf: fix warning on 32 bits architectures

2020-04-23 Thread Clement Leger
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger --- common/elf.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 6/6] mips: lib: bootm: use bootm elf loading capabilities

2020-04-23 Thread Clement Leger
Now that the elf file is loaded by the bootm core, there is no need for elf pointer anymore. Thus all elf related fields can be removed. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/arch

[PATCH v2 0/6] elf: add better bootm support

2020-04-23 Thread Clement Leger
_get_mem_size function to avoid computing elf size in bootm.c - Use xmalloc and read_full in elf_open instead of xzalloc/read - Fix data->elf NULL reset - Remove elf struct entirely from mips bootm code Clement Leger (6): common: elf: add computation of elf boundaries common: elf: fix wa

[PATCH v2 1/6] common: elf: add computation of elf boundaries

2020-04-23 Thread Clement Leger
In order to correctly load an initrd or a device tree after an elf file, we need to know its boundaries. This commit adds support for that and allow the bootm implementations to use it for memory loading. Signed-off-by: Clement Leger --- common/elf.c | 7 +++ include/elf.h | 7 +++ 2

[PATCH v2 3/6] common: elf: split init to be reused from other function

2020-04-23 Thread Clement Leger
New elf_open function will also need to initialize an elf file. Split this to avoid missing members initialization. Signed-off-by: Clement Leger --- common/elf.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common/elf.c b/common/elf.c index 55f5bc645

[PATCH 2/6] common: elf: fix warning on 32 bits architectures

2020-04-22 Thread Clement Leger
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger --- common/elf.c | 2 +- 1 file changed, 1 insertion

[PATCH 1/6] common: elf: add computation of elf boundaries

2020-04-22 Thread Clement Leger
In order to correctly load an initrd or a device tree after an elf file, we need to know its boundaries. This commit adds support for that and allow the bootm implementations to use it for memory loading. Signed-off-by: Clement Leger --- common/elf.c | 7 +++ include/elf.h | 2 ++ 2 files

[PATCH 5/6] common: bootm: add support for elf file loading

2020-04-22 Thread Clement Leger
This will allows elf loader to directly have an elf file available. Thus filetype_elf bootm handlers will be able to use this elf file directly. Signed-off-by: Clement Leger --- common/bootm.c | 27 +++ include/bootm.h | 3 +++ 2 files changed, 30 insertions(+) diff

[PATCH 3/6] common: elf: split init to be reused from other function

2020-04-22 Thread Clement Leger
New elf_open function will also need to initialize an elf file. Split this to avoid missing members initialization. Signed-off-by: Clement Leger --- common/elf.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common/elf.c b/common/elf.c index 55f5bc645

[PATCH 0/6] elf: add better bootm support

2020-04-22 Thread Clement Leger
handling for the elf file is also added in bootm data to allow using directly the elf file structure. Finally the mips bootm is modified to use this new elf member. Clement Leger (6): common: elf: add computation of elf boundaries common: elf: fix warning on 32 bits architectures common: elf

[PATCH 4/6] common: elf: add elf_open and elf_close

2020-04-22 Thread Clement Leger
When loading an elf file from a mtd device, this allows to parse the header and load only the needed data according to the elf size. Without that support, loading a elf file from a /dev/mtd would try to read the entire partition. Signed-off-by: Clement Leger --- common/elf.c | 87

[PATCH 6/6] mips: lib: bootm: use new data->elf member

2020-04-22 Thread Clement Leger
Now that the elf file is loaded by the bootm core, use this field directly instead of manually loading the elf file. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib

[PATCH v2 4/6] common: elf: add elf_open and elf_close

2020-04-23 Thread Clement Leger
When loading an elf file from a mtd device, this allows to parse the header and load only the needed data according to the elf size. Without that support, loading a elf file from a /dev/mtd would try to read the entire partition. Signed-off-by: Clement Leger --- common/elf.c | 83

[PATCH v3 5/7] common: bootm: add support for elf file loading

2020-04-28 Thread Clement Leger
This will allows elf loader to directly have an elf file available. Thus filetype_elf bootm handlers will be able to use this elf file directly. Signed-off-by: Clement Leger --- common/Kconfig | 8 common/bootm.c | 33 + include/bootm.h | 3 +++ 3

[PATCH v3 1/7] common: elf: add computation of elf boundaries

2020-04-28 Thread Clement Leger
In order to correctly load an initrd or a device tree after an elf file, we need to know its boundaries. This commit adds support for that and allow the bootm implementations to use it for memory loading. Signed-off-by: Clement Leger --- common/elf.c | 7 +++ include/elf.h | 7 +++ 2

[PATCH v3 2/7] common: elf: fix warning on 32 bits architectures

2020-04-28 Thread Clement Leger
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger --- common/elf.c | 2 +- 1 file changed, 1 insertion

[PATCH v3 7/7] common: elf: remove elf_load_image/elf_release_image

2020-04-28 Thread Clement Leger
Since elf loading has been integrated in bootm using elf_open/elf_close, remove these two functions which are now unused. Signed-off-by: Clement Leger --- common/elf.c | 39 +-- include/elf.h | 3 --- 2 files changed, 5 insertions(+), 37 deletions(-) diff

[PATCH v3 6/7] mips: lib: bootm: use bootm elf loading capabilities

2020-04-28 Thread Clement Leger
Now that the elf file is loaded by the bootm core, there is no need for elf pointer anymore. Thus all elf related fields can be removed and bootm_load_os can be used. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 31 +++ 1 file changed, 11 insertions

[PATCH v3 4/7] common: elf: add elf_open, elf_close and elf_load

2020-04-28 Thread Clement Leger
separately when using bootm_load_os. Signed-off-by: Clement Leger --- common/elf.c | 92 +++ include/elf.h | 8 + 2 files changed, 100 insertions(+) diff --git a/common/elf.c b/common/elf.c index 5534632b2..9edd2742f 100644 --- a/common

[PATCH v3 0/7] elf: add better bootm support

2020-04-28 Thread Clement Leger
elf_open instead of xzalloc/read - Fix data->elf NULL reset - Remove elf struct entirely from mips bootm code Clement Leger (7): common: elf: add computation of elf boundaries common: elf: fix warning on 32 bits architectures common: elf: split init to be reused from other function common

[PATCH v3 3/7] common: elf: split init to be reused from other function

2020-04-28 Thread Clement Leger
New elf_open function will also need to initialize an elf file. Split this to avoid missing members initialization. Signed-off-by: Clement Leger --- common/elf.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common/elf.c b/common/elf.c index 55f5bc645

[PATCH] clocksource: kvx: remove unused variable np.

2020-05-15 Thread Clement Leger
Remove unused variable np from probe function. Signed-off-by: Clement Leger --- drivers/clocksource/kvx_timer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/clocksource/kvx_timer.c b/drivers/clocksource/kvx_timer.c index f16d77b9d..4125ddbee 100644 --- a/drivers/clocksource

[PATCH] common: oftree: trim leading spaces from bootargs

2020-03-20 Thread Clement Leger
skip_spaces to trim leading spaces and then check if the string is empty. If so, simply returns and don't patch device tree bootargs. Signed-off-by: Clement Leger --- common/oftree.c | 4 1 file changed, 4 insertions(+) diff --git a/common/oftree.c b/common/oftree.c index 09cb66021..36906e86f 100644

[PATCH v4 2/7] common: elf: fix warning on 32 bits architectures

2020-05-08 Thread Clement Leger
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger --- common/elf.c | 2 +- 1 file changed, 1 insertion

[PATCH v4 4/7] common: elf: add elf_open, elf_close and elf_load

2020-05-08 Thread Clement Leger
separately when using bootm_load_os. Signed-off-by: Clement Leger --- common/elf.c | 104 -- include/elf.h | 8 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/common/elf.c b/common/elf.c index 5534632b2..949e953b0 100644

[PATCH v4 5/7] common: bootm: add support for elf file loading

2020-05-08 Thread Clement Leger
This will allows elf loader to directly have an elf file available. Thus filetype_elf bootm handlers will be able to use this elf file directly. Signed-off-by: Clement Leger --- common/Kconfig | 8 common/bootm.c | 33 + include/bootm.h | 3 +++ 3

[PATCH v4 7/7] common: elf: remove elf_load_image/elf_release_image

2020-05-08 Thread Clement Leger
Since elf loading has been integrated in bootm using elf_open/elf_close, remove these two functions which are now unused. Fix comment style during this modification. Signed-off-by: Clement Leger --- common/elf.c | 41 +++-- include/elf.h | 3 --- 2 files

[PATCH v4 6/7] mips: lib: bootm: use bootm elf loading capabilities

2020-05-08 Thread Clement Leger
Now that the elf file is loaded by the bootm core, there is no need for elf pointer anymore. Thus all elf related fields can be removed and bootm_load_os can be used. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 31 +++ 1 file changed, 11 insertions

[PATCH v4 1/7] common: elf: add computation of elf boundaries

2020-05-08 Thread Clement Leger
In order to correctly load an initrd or a device tree after an elf file, we need to know its boundaries. This commit adds support for that and allow the bootm implementations to use it for memory loading. Signed-off-by: Clement Leger --- common/elf.c | 7 +++ include/elf.h | 7 +++ 2

[PATCH v4 0/7] elf: add better bootm support

2020-05-08 Thread Clement Leger
avoid computing elf size in bootm.c - Use xmalloc and read_full in elf_open instead of xzalloc/read - Fix data->elf NULL reset - Remove elf struct entirely from mips bootm code Clement Leger (7): common: elf: add computation of elf boundaries common: elf: fix warning on 32 bits archi

[PATCH v4 3/7] common: elf: split init to be reused from other function

2020-05-08 Thread Clement Leger
New elf_open function will also need to initialize an elf file. Split this to avoid missing members initialization. Signed-off-by: Clement Leger --- common/elf.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common/elf.c b/common/elf.c index 55f5bc645

[PATCH] kvx: remove duplicated dtb symbols

2020-06-30 Thread Clement Leger
dtb symbols (__dtb_start, __dtb_end) are already defined using RO_DATA_SECTION. This duplicated dtb section is a leftover used by Kalray internal tools to patch the dtb when loading the elf on a target. Remove it to keep only one symbol definition. Signed-off-by: Clement Leger --- arch/kvx/cpu

[PATCH v3 2/4] common: Kconfig: remove MIPS dependency for ELF

2020-06-30 Thread Clement Leger
There is no reason anymore to limit the use of elf on mips since there is no elf specific support needed in architectures. Drop the MIPS dependency. Signed-off-by: Clement Leger --- common/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/common/Kconfig b/common/Kconfig index f150092af

[PATCH v3 0/4] kvx: add elf bootm support

2020-06-30 Thread Clement Leger
v1 -> v2: - Remove D-cache invalidation - Reword first patch commit message Clement Leger (4): common: bootm: allow building with an undefined IH_ARCH common: Kconfig: remove MIPS dependency for ELF kvx: add I-cache and D-cache synchronisation kvx: add support for elf loading using

[PATCH v3 1/4] common: bootm: allow building with an undefined IH_ARCH

2020-06-30 Thread Clement Leger
Some architectures might not want to support uImage. To do so, allow IH_ARCH to be let undefined which will make it possible to compile boot support. Signed-off-by: Clement Leger --- common/bootm.c | 2 +- include/image.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v3 4/4] kvx: add support for elf loading using bootm

2020-06-30 Thread Clement Leger
From: Clement Leger In order to boot elfs files, add bootm command support for kvx. This support can boot elf files using bootm elf support. initrd and device-tree handling is also included and loads them after the elf file load address. Signed-off-by: Clement Leger --- arch/kvx/Kconfig

[PATCH v3 3/4] kvx: add I-cache and D-cache synchronisation

2020-06-30 Thread Clement Leger
from memory. Signed-off-by: Clement Leger --- arch/kvx/include/asm/cache.h | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 arch/kvx/include/asm/cache.h diff --git a/arch/kvx/include/asm/cache.h b/arch/kvx/include/asm/cache.h new file mode 100644 index 0

[PATCH] kvx: exclude dtb from malloc zone

2020-07-09 Thread Clement Leger
. To avoid that, exclude the dtb from the malloc zone by checking if it overlaps it. If so, determine the largest zone for the allocation and modify the memory area to use that. Signed-off-by: Clement Leger --- arch/kvx/lib/board.c | 43 +-- 1 file changed, 41

[PATCH] kbuild: fix typo in --no-whole-archive flag

2020-06-23 Thread Clement Leger
"whole" was replaced with "while" during a previous patch. Fix this flag to allow building correctly. Fixes 0a78b33954 ("kbuild: switch over to thin archive") Signed-off-by: Clement Leger --- arch/kvx/Makefile | 2 +- arch/mips/pbl/Makefile | 2 +- 2 fil

[PATCH 1/4] common: bootm: allow letting IH_ARCH undefined

2020-06-23 Thread Clement Leger
Some architecture might not want to support uImage. To do so, allow IH_ARCH to be let undefined. Signed-off-by: Clement Leger --- common/bootm.c | 2 +- include/image.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index 4110d8d6e

[PATCH 4/4] kvx: add support for elf loading using bootm

2020-06-23 Thread Clement Leger
From: Clement Leger In order to boot elfs files, add bootm command support for kvx. This support can boot elf files using bootm elf support. initrd and device-tree handling is also included and loads them after the elf file load address. Signed-off-by: Clement Leger --- arch/kvx/Kconfig

[PATCH 3/4] kvx: add D-cache inval and I-cache sync

2020-06-23 Thread Clement Leger
from memory. Moreover add a D-cache invalidation routine to cleanup cache before booting. Signed-off-by: Clement Leger --- arch/kvx/include/asm/cache.h | 24 1 file changed, 24 insertions(+) create mode 100644 arch/kvx/include/asm/cache.h diff --git a/arch/kvx/include/asm

[PATCH 0/4] kvx: add elf bootm support

2020-06-23 Thread Clement Leger
This serie adds support for elf bootm support on KVX architecture. First patches are allowing to build elf support for KVX and then bootm support is added to KVX. Clement Leger (4): common: bootm: allow letting IH_ARCH undefined common: Kconfig: remove MIPS dependency kvx: add D-cache inval

[PATCH 2/4] common: Kconfig: remove MIPS dependency

2020-06-23 Thread Clement Leger
There is no reason anymore to limit the use of elf on mips since there is no elf specific support needed in architectures. Remove this dependency and drop COMPILE_TEST config. Signed-off-by: Clement Leger --- common/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH v2 0/4] kvx: add elf bootm support

2020-06-28 Thread Clement Leger
This serie adds support for elf bootm support on KVX architecture. First patches are allowing to build elf support for KVX and then bootm support is added to KVX. Changes from v1 -> v2: - Remove D-cache invalidation - Reword first patch commit message Clement Leger (4): common: bootm: al

[PATCH v2 4/4] kvx: add support for elf loading using bootm

2020-06-28 Thread Clement Leger
From: Clement Leger In order to boot elfs files, add bootm command support for kvx. This support can boot elf files using bootm elf support. initrd and device-tree handling is also included and loads them after the elf file load address. Signed-off-by: Clement Leger --- arch/kvx/Kconfig

[PATCH v2 1/4] common: bootm: allow building using undefined IH_ARCH

2020-06-28 Thread Clement Leger
Some architectures might not want to support uImage. To do so, allow IH_ARCH to be let undefined which will make it possible to compile boot support. Signed-off-by: Clement Leger --- common/bootm.c | 2 +- include/image.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2 3/4] kvx: add I-cache and D-cache synchronisation

2020-06-28 Thread Clement Leger
from memory. Signed-off-by: Clement Leger --- arch/kvx/include/asm/cache.h | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 arch/kvx/include/asm/cache.h diff --git a/arch/kvx/include/asm/cache.h b/arch/kvx/include/asm/cache.h new file mode 100644 index 0

[PATCH v2 2/4] common: Kconfig: remove MIPS dependency

2020-06-28 Thread Clement Leger
There is no reason anymore to limit the use of elf on mips since there is no elf specific support needed in architectures. Remove this dependency and drop COMPILE_TEST config. Signed-off-by: Clement Leger --- common/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH v5 5/7] common: elf: add elf_open, elf_close and elf_load

2020-06-11 Thread Clement Leger
In order to integrate elf loading into bootm command, split elf opening from elf loading. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 8 ++-- common/elf.c | 20 +++- include/elf.h | 5 +++-- 3 files changed, 16 insertions(+), 17 deletions

[PATCH v5 0/7] elf: add better bootm support

2020-06-11 Thread Clement Leger
bootm.c - Use xmalloc and read_full in elf_open instead of xzalloc/read - Fix data->elf NULL reset - Remove elf struct entirely from mips bootm code Clement Leger (7): common: elf: fix warning on 32 bits architectures common: elf: use calloc instead of xzalloc common: elf: check numb

[PATCH v5 7/7] mips: lib: bootm: use bootm elf loading capabilities

2020-06-11 Thread Clement Leger
Now that the elf file is loaded by the bootm core, there is no need for elf pointer anymore. Thus all elf related fields can be removed and bootm_load_os can be used. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions

[PATCH v5 6/7] common: bootm: add support for elf file loading

2020-06-11 Thread Clement Leger
This will allows elf loader to directly have an elf file available. Thus filetype_elf bootm handlers will be able to use standard bootm functions and data. Signed-off-by: Clement Leger --- common/Kconfig | 8 common/bootm.c | 33 + include/bootm.h

[PATCH v5 3/7] common: elf: check number of elf program headers

2020-06-11 Thread Clement Leger
An elf file without program headers should not be loaded. Add a check for such cases. Signed-off-by: Clement Leger --- common/elf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/common/elf.c b/common/elf.c index 0e92661e1..bd97858c8 100644 --- a/common/elf.c +++ b/common/elf.c

[PATCH v5 4/7] common: elf: load elf directly from file

2020-06-11 Thread Clement Leger
to load the elf data from the file without copying it in an intermediate buffer. Elf segments are first parsed into a list and are then loaded from the file in a second time. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 9 +- common/elf.c | 220

[PATCH v5 1/7] common: elf: fix warning on 32 bits architectures

2020-06-11 Thread Clement Leger
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger --- common/elf.c | 2 +- 1 file changed, 1 insertion

[PATCH v5 2/7] common: elf: use calloc instead of xzalloc

2020-06-11 Thread Clement Leger
This failure can be handled grecefully, use standard calloc. Signed-off-by: Clement Leger --- common/elf.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/elf.c b/common/elf.c index 55f5bc645..0e92661e1 100644 --- a/common/elf.c +++ b/common/elf.c @@ -19,7 +19,10

[PATCH v6 5/8] common: elf: load elf directly from file

2020-06-12 Thread Clement Leger
to load the elf data from the file without copying it in an intermediate buffer. Elf segments are first parsed into a list and are then loaded from the file in a second time. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 9 +- common/elf.c | 220

[PATCH v6 8/8] mips: lib: bootm: use bootm elf loading capabilities

2020-06-12 Thread Clement Leger
Now that the elf file is loaded by the bootm core, there is no need for elf pointer anymore. Thus all elf related fields can be removed and bootm_load_os can be used. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions

[PATCH v6 0/8] elf: add better bootm support

2020-06-12 Thread Clement Leger
add checks in code - Add an elf_get_mem_size function to avoid computing elf size in bootm.c - Use xmalloc and read_full in elf_open instead of xzalloc/read - Fix data->elf NULL reset - Remove elf struct entirely from mips bootm code Clement Leger (8): common: elf: add computation of elf boundaries co

[PATCH v6 4/8] common: elf: check number of elf program headers

2020-06-12 Thread Clement Leger
An elf file without program headers should not be loaded. Add a check for such cases. Signed-off-by: Clement Leger --- common/elf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/common/elf.c b/common/elf.c index 0e92661e1..bd97858c8 100644 --- a/common/elf.c +++ b/common/elf.c

[PATCH v6 3/8] common: elf: use calloc instead of xzalloc

2020-06-12 Thread Clement Leger
This failure can be handled grecefully, use standard calloc. Signed-off-by: Clement Leger --- common/elf.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/elf.c b/common/elf.c index 55f5bc645..0e92661e1 100644 --- a/common/elf.c +++ b/common/elf.c @@ -19,7 +19,10

[PATCH v6 6/8] common: elf: add elf_open, elf_close and elf_load

2020-06-12 Thread Clement Leger
In order to integrate elf loading into bootm command, split elf opening from elf loading. Signed-off-by: Clement Leger --- arch/mips/lib/bootm.c | 8 ++-- common/elf.c | 20 +++- include/elf.h | 5 +++-- 3 files changed, 16 insertions(+), 17 deletions

[PATCH v6 2/8] common: elf: fix warning on 32 bits architectures

2020-06-12 Thread Clement Leger
When pointers are 32 bits wide and we cast a potentially 64 bits value in it, the compiler will yield an error. Cast that value first into a phys_addr_t to match the architecture pointer size and then in a void *. Signed-off-by: Clement Leger --- common/elf.c | 2 +- 1 file changed, 1 insertion

[PATCH v6 7/8] common: bootm: add support for elf file loading

2020-06-12 Thread Clement Leger
This will allows elf loader to directly have an elf file available. Thus filetype_elf bootm handlers will be able to use standard bootm functions and data. Signed-off-by: Clement Leger --- common/Kconfig | 8 common/bootm.c | 33 + include/bootm.h

[PATCH v6 1/8] common: elf: add computation of elf boundaries

2020-06-12 Thread Clement Leger
In order to correctly load an initrd or a device tree after an elf file, we need to know its boundaries. This commit adds support for that and allow the bootm implementations to use it for memory loading. Signed-off-by: Clement Leger --- common/elf.c | 7 +++ include/elf.h | 7 +++ 2