[PATCH v2 5/5] microblaze: drop remnants of manual reloc

2023-03-11 Thread Ovidiu Panait
Runtime relocation has been made the default for microblaze, so do the following cleanups: - drop all manual reloc codepaths in start.S - drop all STATIC_RELA ifdefs, as it is now enabled unconditionally in Kconfig Reviewed-by: Michal Simek Signed-off-by: Ovidiu Panait --- (no changes since v1

[PATCH v2 4/5] microblaze: drop CONFIG_NEEDS_MANUAL_RELOC

2023-03-11 Thread Ovidiu Panait
op support for CONFIG_NEEDS_MANUAL_RELOC and make runtime relocation the default, as the rest of the architectures do. Reviewed-by: Michal Simek Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/Kconfig | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) di

[PATCH v2 3/5] tools: relocate-rela: add support for handling 32-bit big endian files

2023-03-11 Thread Ovidiu Panait
elf{16,32}_to_cpu() functions. The aarch64 codepath is left untouched. This commit ensures that CI doesn't fail for the next patches which enable runtime relocation by default for microblaze. Reviewed-by: Michal Simek Signed-off-by: Ovidiu Panait --- (no changes since v1) tools/relocate-r

[PATCH v2 2/5] tools: relocate-rela: introduce elf16_to_cpu() and elf32_to_cpu()

2023-03-11 Thread Ovidiu Panait
Add elf16_to_cpu() and elf32_to_cpu() functions that allow to read data in both big-endian and little-endian formats. Reviewed-by: Michal Simek Signed-off-by: Ovidiu Panait --- Changes in v2: Replaced hardcoded 0x1 values with ELFDATA2LSB. tools/relocate-rela.c | 20 1

[PATCH v2 1/5] tools: relocate-rela: adjust le64_to_cpu -> le32_to_cpu in decode_elf32()

2023-03-11 Thread Ovidiu Panait
The sh_addr/sh_offset/sh_size fields in Elf32_Shdr are 32-bits wide, so use le32_to_cpu() instead of the 64-bit variant. Fixes: 5e0e1a86d327 ("tools: relocate-rela: Fix ELF decoding on big-endian hosts") Reviewed-by: Michal Simek Signed-off-by: Ovidiu Panait --- (no changes since v

[PATCH 4/5] microblaze: drop CONFIG_NEEDS_MANUAL_RELOC

2023-03-05 Thread Ovidiu Panait
op support for CONFIG_NEEDS_MANUAL_RELOC and make runtime relocation the default, as the rest of the architectures do. Signed-off-by: Ovidiu Panait --- arch/microblaze/Kconfig | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microbla

[PATCH 5/5] microblaze: drop remnants of manual reloc

2023-03-05 Thread Ovidiu Panait
Runtime relocation has been made the default for microblaze, so do the following cleanups: - drop all manual reloc codepaths in start.S - drop all STATIC_RELA ifdefs, as it is now enabled unconditionally in Kconfig Signed-off-by: Ovidiu Panait --- arch/microblaze/config.mk| 4 arch

[PATCH 3/5] tools: relocate-rela: add support for handling 32-bit big endian files

2023-03-05 Thread Ovidiu Panait
elf{16,32}_to_cpu() functions. The aarch64 codepath is left untouched. This commit ensures that CI doesn't fail for the next patches which enable runtime relocation by default for microblaze. Signed-off-by: Ovidiu Panait --- tools/relocate-rela.c | 32 1

[PATCH 2/5] tools: relocate-rela: introduce elf16_to_cpu() and elf32_to_cpu()

2023-03-05 Thread Ovidiu Panait
Add elf16_to_cpu() and elf32_to_cpu() functions that allow to read data in both big-endian and little-endian formats. Signed-off-by: Ovidiu Panait --- tools/relocate-rela.c | 20 1 file changed, 20 insertions(+) diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c

[PATCH 1/5] tools: relocate-rela: adjust le64_to_cpu -> le32_to_cpu in decode_elf32()

2023-03-05 Thread Ovidiu Panait
The sh_addr/sh_offset/sh_size fields in Elf32_Shdr are 32-bits wide, so use le32_to_cpu() instead of the 64-bit variant. Fixes: 5e0e1a86d327 ("tools: relocate-rela: Fix ELF decoding on big-endian hosts") Signed-off-by: Ovidiu Panait --- tools/relocate-rela.c | 6 +++--- 1 file

[PATCH v2 3/3] microblaze: spl: disable falcon mode by default

2023-01-25 Thread Ovidiu Panait
Drop falcon mode configs from microblaze-generic_defconfig, so that a defconfig build will still boot into u-boot proper. Signed-off-by: Ovidiu Panait --- Changes in v2: New patch. configs/microblaze-generic_defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/configs/microblaze

[PATCH v2 2/3] microblaze: spl: drop boot_linux

2023-01-25 Thread Ovidiu Panait
Drop boot_linux variable as it is not assigned anywhere. Now that there is no variable controlling linux boot in spl_start_uboot(), make this function always return false when falcon mode is enabled. Signed-off-by: Ovidiu Panait --- Changes in v2: New patch. arch/microblaze/cpu/spl.c | 7

[PATCH v2 1/3] microblaze: spl: wrap spl_start_uboot() in SPL_OS_BOOT ifdefs

2023-01-25 Thread Ovidiu Panait
Make spl_start_uboot() available only if CONFIG_SPL_OS_BOOT is enabled, since it is only used for falcon mode. Signed-off-by: Ovidiu Panait --- Changes in v2: New patch. arch/microblaze/cpu/spl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/microblaze/cpu/spl.c

[PATCH] microblaze: spl: drop boot_linux and disable falcon mode by default

2023-01-22 Thread Ovidiu Panait
: Ovidiu Panait --- arch/microblaze/cpu/spl.c| 11 ++- common/spl/Kconfig | 2 ++ configs/microblaze-generic_defconfig | 3 --- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/microblaze/cpu/spl.c b/arch/microblaze/cpu/spl.c index

[PATCH] spl: doc: use correct name in jump_to_image_optee() description

2023-01-22 Thread Ovidiu Panait
The actual function being documented is jump_to_image_optee(), not jump_to_image_linux(). Signed-off-by: Ovidiu Panait --- include/spl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spl.h b/include/spl.h index fb8c279d72..827bd25c88 100644 --- a/include/spl.h

Re: [PATCH 2/3] timer-uclass: relocate ops pointers for CONFIG_NEEDS_MANUAL_RELOC

2022-10-12 Thread Ovidiu Panait
Hi Simon, On 10/12/22 15:59, Simon Glass wrote: On Tue, 11 Oct 2022 at 23:37, Ovidiu Panait wrote: Relocate timer_ops pointers when CONFIG_NEEDS_MANUAL_RELOC is enabled. The (gd->flags & GD_FLG_RELOC) check was added to make sure the reloc_done logic works for drivers t

[PATCH 3/3] timer: xilinx-timer: use timer_conv_64() to fix timer wrap around

2022-10-11 Thread Ovidiu Panait
() to work correctly. Add the missing 64-bit up-conversion to fix random hangs/delays in __udelay(). Fixes: a36d86720f ("microblaze: Convert axi timer to DM driver") Signed-off-by: Ovidiu Panait --- drivers/timer/xilinx-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH 2/3] timer-uclass: relocate ops pointers for CONFIG_NEEDS_MANUAL_RELOC

2022-10-11 Thread Ovidiu Panait
Relocate timer_ops pointers when CONFIG_NEEDS_MANUAL_RELOC is enabled. The (gd->flags & GD_FLG_RELOC) check was added to make sure the reloc_done logic works for drivers that use DM_FLAG_PRE_RELOC. Signed-off-by: Ovidiu Panait --- drivers/timer/timer-uclass.c | 14 ++

[PATCH 1/3] timer-uclass: add timer_get_ops() macro

2022-10-11 Thread Ovidiu Panait
Align timer uclass with the other subsystems and provide a timer_get_ops() convenience macro. Using this instead of the generic device_get_ops() also prevents -Wdiscarded-qualifiers warnings when used with non-const variables. Signed-off-by: Ovidiu Panait --- drivers/timer/timer-uclass.c | 2

[PATCH v2 4/4] common/board_f: drop ifdefs around header includes

2022-09-13 Thread Ovidiu Panait
Drop the remaining ifdef around spl.h include. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Changes in v2: - add "Reviewed-by" tag from Simon common/board_f.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 96458c5151..

[PATCH v2 3/4] common/board_f: introduce arch_setup_dest_addr()

2022-09-13 Thread Ovidiu Panait
. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Changes in v2: - add "Reviewed-by" tag from Simon arch/powerpc/lib/stack.c | 17 + common/board_f.c | 21 +++-- include/init.h | 13 + 3 files changed, 37 inserti

[PATCH v2 2/4] common/board_f: move CONFIG_MACH_TYPE logic to arch/arm/lib/bdinfo.c

2022-09-13 Thread Ovidiu Panait
asm/mach_type.h header and CONFIG_MACH_TYPE macro are arm-specific, so move related bdinfo logic to arch_setup_bdinfo() in arch/arm/lib/bdinfo.c. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Changes in v2: - add "Reviewed-by" tag from Simon arch/arm/lib/bdi

[PATCH v2 1/4] common/board_f: remove XTRN_DECLARE_GLOBAL_DATA_PTR dead code

2022-09-13 Thread Ovidiu Panait
for the GD pointer. Signed-off-by: Ovidiu Panait --- Changes in v2: - update global data documentation with the info provided by Wolfgang arch/powerpc/include/asm/global_data.h | 6 -- common/board_f.c | 11 --- doc/develop/global_data.rst| 5

[PATCH 4/4] common/board_f: drop ifdefs around header includes

2022-09-11 Thread Ovidiu Panait
Drop the remaining ifdef around spl.h include. Signed-off-by: Ovidiu Panait --- common/board_f.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 96458c5151..4db1626c29 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -35,9 +35,7

[PATCH 3/4] common/board_f: introduce arch_setup_dest_addr()

2022-09-11 Thread Ovidiu Panait
. Signed-off-by: Ovidiu Panait --- arch/powerpc/lib/stack.c | 17 + common/board_f.c | 21 +++-- include/init.h | 13 + 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/lib/stack.c b/arch/powerpc/lib/stack.c

[PATCH 1/4] common/board_f: remove XTRN_DECLARE_GLOBAL_DATA_PTR dead code

2022-09-11 Thread Ovidiu Panait
#define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ gd_t *gd #endif Remove all references. Signed-off-by: Ovidiu Panait --- arch/powerpc/include/asm/global_data.h | 6 -- common/board_f.c | 11 --- 2 files changed, 17

[PATCH 2/4] common/board_f: move CONFIG_MACH_TYPE logic to arch/arm/lib/bdinfo.c

2022-09-11 Thread Ovidiu Panait
asm/mach_type.h header and CONFIG_MACH_TYPE macro are arm-specific, so move related bdinfo logic to arch_setup_bdinfo() in arch/arm/lib/bdinfo.c. Signed-off-by: Ovidiu Panait --- arch/arm/lib/bdinfo.c | 12 common/board_f.c | 7 --- 2 files changed, 12 insertions(+), 7

[PATCH v2 4/4] microblaze: add arch_print_bdinfo() implementation

2022-08-29 Thread Ovidiu Panait
erved.cnt = 0x1 reserved[0][0x7e94b8c-0x7ff], 0x0016b474 bytes flags: 0 devicetree = embed icache = 32 KiB icache line = 4 Bytes dcache = 32 KiB dcache line = 4 Bytes Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/lib/Makefile | 1 + arch/micro

[PATCH v2 3/4] cmd: bdinfo: introduce bdinfo_print_size() helper

2022-08-29 Thread Ovidiu Panait
Add bdinfo_print_size() helper to display size variables (such as cache sizes) in bdinfo format. The size is printed as "xxx Bytes", "xxx KiB", "xxx MiB", "xxx GiB", etc as needed; Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Changes i

[PATCH v2 2/4] cpu: microblaze: add error handling in microblaze_cpu_get_desc()

2022-08-29 Thread Ovidiu Panait
croblaze") Signed-off-by: Ovidiu Panait --- Changes in v2: New patch. drivers/cpu/microblaze_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/cpu/microblaze_cpu.c b/drivers/cpu/microblaze_cpu.c index 969a1047e5..b9d0792822 100644 --- a/drivers/cpu/mic

[PATCH v2 1/4] microblaze: drop CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE

2022-08-29 Thread Ovidiu Panait
These macros are not used anymore in microblaze code since commit f113d7d303467 ("Convert CONFIG_SPL_STACK to Kconfig"), so remove them. Fixes: f113d7d303467 ("Convert CONFIG_SPL_STACK to Kconfig") Signed-off-by: Ovidiu Panait --- Changes in v2: Improved commit messag

Re: [PATCH 2/4] cpu: microblaze: remove unused ret variable

2022-08-27 Thread Ovidiu Panait
Hi Michal, On 8/25/22 11:59, Michal Simek wrote: On 8/25/22 08:41, Ovidiu Panait wrote: Drop the unused ret variable from microblaze_cpu_get_desc(). Signed-off-by: Ovidiu Panait ---   drivers/cpu/microblaze_cpu.c | 7 +++   1 file changed, 3 insertions(+), 4 deletions(-) diff --git a

[PATCH 4/4] microblaze: add arch_print_bdinfo() implementation

2022-08-24 Thread Ovidiu Panait
erved.cnt = 0x1 reserved[0][0x7e94b8c-0x7ff], 0x0016b474 bytes flags: 0 devicetree = embed icache = 32 KiB icache line = 4 Bytes dcache = 32 KiB dcache line = 4 Bytes Signed-off-by: Ovidiu Panait --- arch/microblaze/lib/Makefile | 1 + arch/microblaze/lib/bdin

[PATCH 3/4] cmd: bdinfo: introduce bdinfo_print_size() helper

2022-08-24 Thread Ovidiu Panait
Add bdinfo_print_size() helper to display size variables (such as cache sizes) in bdinfo format. The size is printed as "xxx Bytes", "xxx KiB", "xxx MiB", "xxx GiB", etc as needed; Signed-off-by: Ovidiu Panait --- cmd/bdinfo.c | 7 +++ include/in

[PATCH 2/4] cpu: microblaze: remove unused ret variable

2022-08-24 Thread Ovidiu Panait
Drop the unused ret variable from microblaze_cpu_get_desc(). Signed-off-by: Ovidiu Panait --- drivers/cpu/microblaze_cpu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/cpu/microblaze_cpu.c b/drivers/cpu/microblaze_cpu.c index 969a1047e5..4eae06a8a6 100644

[PATCH 1/4] microblaze: drop CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE

2022-08-24 Thread Ovidiu Panait
These macros don't seem to be used by microblaze code anymore, so remove them. Signed-off-by: Ovidiu Panait --- include/configs/microblaze-generic.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h

Re: [PATCH 1/2] microblaze: Convert axi timer to DM driver

2022-06-23 Thread Ovidiu Panait
the timer found on NXP i.MX devices. +config XILINX_TIMER + bool "Xilinx timer support" + depends on TIMER + select REGMAP Tested-by: Ovidiu Panait I think the SPL select should also be added:    select SPL_REGMAP if SPL This will fix the spl l

Re: [PATCH v2 01/14] cmd: cpu: migrate cpu command to U_BOOT_CMD_WITH_SUBCMDS()

2022-06-07 Thread Ovidiu Panait
Hi Michal, On 07.06.2022 11:33, Michal Simek wrote: [Please note: This e-mail is from an EXTERNAL e-mail address] út 31. 5. 2022 v 20:14 odesílatel Ovidiu Panait napsal: Migrate cpu command to use U_BOOT_CMD_WITH_SUBCMDS() helper macro, to reduce duplicated code. This also fixes the cpu

[PATCH v2 14/14] cpu: add CPU driver for microblaze

2022-05-31 Thread Ovidiu Panait
etail 0: cpu@0 MicroBlaze @ 50MHz, Rev: 11.0, FPGA family: zynq7000 ID = 0, freq = 50 MHz: L1 cache, MMU Note: cpu_ver_lookup[] and family_string_lookup[] arrays were imported from linux. Signed-off-by: Ovidiu Panait --- Changes in v2: - Refactored completely. - Fixed v9.X version codes.

[PATCH v2 12/14] microblaze: Kconfig: introduce XILINX_MICROBLAZE0_FPGA_FAMILY option

2022-05-31 Thread Ovidiu Panait
Provide a static Kconfig value for the target FPGA archtitecture, as it is done in Linux. The cpu-uclass driver will cross-check it with the value read from PVR10 register. Signed-off-by: Ovidiu Panait --- Changes in v2: - New patch. board/xilinx/microblaze-generic/Kconfig | 8 1

[PATCH v2 13/14] microblaze: add support for handling PVR data

2022-05-31 Thread Ovidiu Panait
Add helper code for PVR (Processor Version Register) data handling. It will be used by the UCLASS_CPU driver to populate cpuinfo fields at runtime. Signed-off-by: Ovidiu Panait --- Changes in v2: - New patch. arch/microblaze/cpu/Makefile| 1 + arch/microblaze/cpu/pvr.c

[PATCH v2 10/14] microblaze: cache: introduce cpuinfo structure

2022-05-31 Thread Ovidiu Panait
ned-off-by: Ovidiu Panait --- Changes in v2: - New patch. arch/microblaze/cpu/Makefile | 2 +- arch/microblaze/cpu/cache.c | 14 ++--- arch/microblaze/cpu/cpuinfo.c | 20 + arch/microblaze/cpu/start.S | 7 + arch/microblaze/i

[PATCH v2 09/14] microblaze: cache: introduce flush_cache_all()

2022-05-31 Thread Ovidiu Panait
. Signed-off-by: Ovidiu Panait --- Changes in v2: - adjusted for newly added CONFIG_XILINX_MICROBLAZE0_ICACHE_SIZE and CONFIG_XILINX_MICROBLAZE0_DCACHE_SIZE Kconfig symbols arch/microblaze/cpu/cache.c | 20 ++-- arch/microblaze/cpu/start.S | 8 ++-- arch/microblaze

[PATCH v2 08/14] microblaze: cache: introduce Kconfig options for icache/dcache sizes

2022-05-31 Thread Ovidiu Panait
Replace XILINX_DCACHE_BYTE_SIZE macro with two Kconfig symbols for instruction and data caches sizes, respectively: CONFIG_XILINX_MICROBLAZE0_ICACHE_SIZE CONFIG_XILINX_MICROBLAZE0_DCACHE_SIZE Also, get rid of the hardcoded value in icache_disable(). Signed-off-by: Ovidiu Panait --- Changes in

[PATCH v2 11/14] microblaze: cache: introduce flush_dcache_range()

2022-05-31 Thread Ovidiu Panait
Align microblaze with the other architectures and provide an implementation for flush_dcache_range(). Also, remove the microblaze exception in drivers/core/device.c. Signed-off-by: Ovidiu Panait --- Changes in v2: - Added debug message for invalid range. arch/microblaze/cpu/cache.c | 11

[PATCH v2 07/14] microblaze: cache: split flush_cache() function

2022-05-31 Thread Ovidiu Panait
Factor out icache/dcache components from flush_cache() function. Call the newly added __flush_icache()/__flush_dcache() functions inside icache_disable() and dcache_disable(), respectively. There is no need to flush both caches when disabling a particular cache type. Signed-off-by: Ovidiu Panait

[PATCH v2 06/14] microblaze: cache: improve icache Kconfig options

2022-05-31 Thread Ovidiu Panait
Replace CONFIG_ICACHE with a Kconfig option more limited in scope - XILINX_MICROBLAZE0_USE_WIC. It should be enabled if the processor supports the "wic" (Write to Instruction Cache) instruction. It will be used to guard "wic" invocations in microblaze cache code. Signed-o

[PATCH v2 05/14] microblaze: cache: improve dcache Kconfig options

2022-05-31 Thread Ovidiu Panait
s around flush_cache() calls and only keep one CONFIG_IS_ENABLED() guard within flush_cache() itself. Signed-off-by: Ovidiu Panait --- Changes in v2: - added CONFIG_SPL_XILINX_MICROBLAZE0_USE_WDC symbol arch/microblaze/Kconfig | 4 arch/microblaze/cpu/cach

[PATCH v2 03/14] microblaze: start.S: remove unused code

2022-05-31 Thread Ovidiu Panait
in16/out16 routines seem to not be used anywhere in microblaze code, so remove them. Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/cpu/start.S | 33 - 1 file changed, 33 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch

[PATCH v2 04/14] microblaze: cache: replace XILINX_USE_DCACHE -> CONFIG_DCACHE

2022-05-31 Thread Ovidiu Panait
XILINX_USE_DCACHE macro was removed in 7556fa09e0e ("microblaze: Simplify cache handling"), but it was still used in a couple of places. Replace those occurences with CONFIG_DCACHE. Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/cpu/cache.c | 2 +- arch/micr

[PATCH v2 01/14] cmd: cpu: migrate cpu command to U_BOOT_CMD_WITH_SUBCMDS()

2022-05-31 Thread Ovidiu Panait
Migrate cpu command to use U_BOOT_CMD_WITH_SUBCMDS() helper macro, to reduce duplicated code. This also fixes the cpu command on boards that enable CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: Ovidiu Panait --- NOTE: this series depends on the following "events" patch: https://lore.ke

[PATCH v2 02/14] cpu-uclass: relocate ops pointers for CONFIG_NEEDS_MANUAL_RELOC

2022-05-31 Thread Ovidiu Panait
Relocate cpu_ops pointers when CONFIG_NEEDS_MANUAL_RELOC is enabled. The (gd->flags & GD_FLG_RELOC) check was added to make sure the reloc_done logic works for drivers that use DM_FLAG_PRE_RELOC. Signed-off-by: Ovidiu Panait --- Changes in v2: - New patch. drivers/cpu/cpu-uclass

[PATCH 2/2] event: fix static events for CONFIG_NEEDS_MANUAL_RELOC

2022-05-15 Thread Ovidiu Panait
Static events do not currently work post-relocation for boards that enable CONFIG_NEEDS_MANUAL_RELOC. Relocate event handler pointers for all event spies to fix this. Tested on Microblaze. Signed-off-by: Ovidiu Panait --- common/board_r.c | 3 +++ common/event.c | 15

[PATCH 1/2] event: remove CONFIG_EVENT_DYNAMIC check in event_register()

2022-05-15 Thread Ovidiu Panait
The whole event_register() function is wrapped in EVENT_DYNAMIC #ifdef checks, so the inner check is not needed: #if CONFIG_IS_ENABLED(EVENT_DYNAMIC) ... int event_register(...) { ... if (!CONFIG_IS_ENABLED(EVENT_DYNAMIC)) return -ENOSYS; } #endif Signed-off-by: Ovidiu

[PATCH] cmd: dm: migrate dm command to use U_BOOT_CMD_WITH_SUBCMDS()

2022-05-08 Thread Ovidiu Panait
Migrate dm command to use U_BOOT_CMD_WITH_SUBCMDS() helper macro, to reduce duplicated code. We can also drop the CONFIG_NEEDS_MANUAL_RELOC exception, as the command list is updated post relocation in board_r.c initcall initr_manual_reloc_cmdtable(). Signed-off-by: Ovidiu Panait --- cmd/dm.c

[PATCH] board_r: use IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC) in board_init_r()

2022-05-02 Thread Ovidiu Panait
Drop CONFIG_NEEDS_MANUAL_RELOC ifdefs in board_init_r() and use IS_ENABLED() instead. Also, use the MANUAL_RELOC() macro to update the initcall pointers. Signed-off-by: Ovidiu Panait --- common/board_r.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/common

[PATCH 10/10] microblaze: cache: use fdt cache size info if available

2022-04-11 Thread Ovidiu Panait
before dm is ready, the default size of CONFIG_XILINX_MICROBLAZE0_DEFAULT_CACHE_SIZE will be used instead. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/cache.c | 45 + 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/arch/microblaze/cpu

[PATCH 09/10] cpu: microblaze: add driver for CPU

2022-04-11 Thread Ovidiu Panait
Add a basic CPU driver that retrieves information about the microblaze CPU core. At this time, only data related to instruction/data caches is extracted from fdt. Signed-off-by: Ovidiu Panait --- arch/microblaze/include/asm/cache.h | 5 + arch/microblaze/include/asm/microblaze_cpu.h

[PATCH 07/10] microblaze: cache: introduce flush_cache_all()

2022-04-11 Thread Ovidiu Panait
. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/cache.c | 20 ++-- arch/microblaze/cpu/start.S | 8 ++-- arch/microblaze/include/asm/cache.h | 5 + arch/microblaze/lib/bootm.c | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git

[PATCH 08/10] microblaze: cache: introduce flush_dcache_range()

2022-04-11 Thread Ovidiu Panait
Align microblaze with the other architectures and provide an implementation for flush_dcache_range(). Also, remove the microblaze exception in drivers/core/device.c. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/cache.c | 8 drivers/core/device.c | 5 - 2 files

[PATCH 06/10] microblaze: cache: migrate XILINX_DCACHE_BYTE_SIZE to Kconfig

2022-04-11 Thread Ovidiu Panait
Migrate XILINX_DCACHE_BYTE_SIZE to Kconfig and rename it to XILINX_MICROBLAZE0_DEFAULT_CACHE_SIZE. Use it as the default size for both instruction/data caches and get rid of the hardcoded value in icache_disable(). Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/cache.c | 5

[PATCH 05/10] microblaze: cache: split flush_cache() function

2022-04-11 Thread Ovidiu Panait
Factor out icache/dcache components from flush_cache() function. Call the newly added __flush_icache()/__flush_dcache() functions inside icache_disable() and dcache_disable(), respectively. There is no need to flush both caches when disabling a particular cache type. Signed-off-by: Ovidiu Panait

[PATCH 04/10] microblaze: cache: improve icache Kconfig options

2022-04-11 Thread Ovidiu Panait
Replace CONFIG_ICACHE with a Kconfig option more limited in scope - XILINX_MICROBLAZE0_USE_WIC. It should be enabled if the processor supports the "wic" (Write to Instruction Cache) instruction. It will be used to guard "wic" invocations in microblaze cache code. Signed-o

[PATCH 03/10] microblaze: cache: improve dcache Kconfig options

2022-04-11 Thread Ovidiu Panait
s around flush_cache() calls and only keep one CONFIG_IS_ENABLED() guard within flush_cache() itself. Signed-off-by: Ovidiu Panait --- arch/microblaze/Kconfig | 4 arch/microblaze/cpu/cache.c | 15 ++- arch/microblaze/lib/bootm.c |

[PATCH 02/10] microblaze: cache: replace XILINX_USE_DCACHE -> CONFIG_DCACHE

2022-04-11 Thread Ovidiu Panait
XILINX_USE_DCACHE macro was removed in 7556fa09e0e ("microblaze: Simplify cache handling"), but it was still used in a couple of places. Replace those occurences with CONFIG_DCACHE. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/cache.c | 2 +- arch/microblaze/lib/bootm.c

[PATCH 01/10] microblaze: start.S: remove unused code

2022-04-11 Thread Ovidiu Panait
in16/out16 routines seem to not be used anywhere in microblaze code, so remove them. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/start.S | 33 - 1 file changed, 33 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S

Re: [PATCH 7/7] microblaze: exception: drop user exception support

2022-02-17 Thread Ovidiu Panait
Hi Michal, On 2/15/22 14:16, Michal Simek wrote: [Please note: This e-mail is from an EXTERNAL e-mail address] On 2/13/22 09:09, Ovidiu Panait wrote: A user exception is triggered by inserting a bralid/brki jump to "C_BASE_VECTORS+0x8" in the software flow. Because u-boot microb

[PATCH 4/7] microblaze: exception: fix return address for delay slot exceptions

2022-02-13 Thread Ovidiu Panait
s stored in R17. """ Adjust the code to print the proper return address for delay slot exceptions. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/exception.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/microblaze/cpu/exception.c b/a

[PATCH 2/7] microblaze: exception: migrate MICROBLAZE_V5 to Kconfig

2022-02-13 Thread Ovidiu Panait
Also, rename it to XILINX_MICROBLAZE0_DELAY_SLOT_EXCEP, since it only covers delay slot exception support. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/exception.c | 2 +- board/xilinx/microblaze-generic/Kconfig | 9 + include/configs/microblaze-generic.h| 3 --- 3

[PATCH 6/7] microblaze: exception: fix unaligned data access register mask

2022-02-13 Thread Ovidiu Panait
data access exception Unaligned word access Unaligned store access Register R5 Return address from exception 0x7f99dfc ### ERROR ### Please RESET the board ### """ Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/exception.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH 7/7] microblaze: exception: drop user exception support

2022-02-13 Thread Ovidiu Panait
on handler. It seems there is no real usecase for having user exception support in u-boot, so drop the code that installs the nop handler. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/exception.c | 8 - arch/microblaze/cpu/start.S | 40 ++--- bo

[PATCH 3/7] microblaze: exception: fix delay slot exception handling

2022-02-13 Thread Ovidiu Panait
ing before the switch statement (delay slot (DS) bit in Exception Status Register is independent of the exception cause (EC)). Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/exception.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/microblaze/cpu/exce

[PATCH 5/7] microblaze: exception: move unaligned access printfs inside switch case

2022-02-13 Thread Ovidiu Panait
The unaligned access messages are only valid in the case of an unaligned data access exception. Do not print them for other types of hw exceptions. Signed-off-by: Ovidiu Panait --- arch/microblaze/cpu/exception.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch

[PATCH 1/7] microblaze: exception: move privileged instruction exception out of v5 ifdef

2022-02-13 Thread Ovidiu Panait
The privileged instruction exception seems to have been introduced in microblaze v7.00 along with MMU support, so having it wrapped in MICROBLAZE_v5 ifdefs seems incorrect. Move it out of the ifdef, since all recent microblaze versions support it. Signed-off-by: Ovidiu Panait --- arch

[PATCH 1/2] powerpc: mpc8xx: drop CONFIG_SYS_RESET_ADDRESS

2022-01-30 Thread Ovidiu Panait
There are no boards that define CONFIG_SYS_RESET_ADDRESS, so drop the associated mpc8xx code that checks for it. Signed-off-by: Ovidiu Panait --- arch/powerpc/cpu/mpc8xx/cpu.c | 11 ++- scripts/config_whitelist.txt | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git

[PATCH 2/2] common: drop CONFIG_SYS_RESET_ADDR

2022-01-30 Thread Ovidiu Panait
There are no boards that define CONFIG_SYS_RESET_ADDR, so drop the remaining comments referencing it and also the config_whitelist.txt entry. Signed-off-by: Ovidiu Panait --- include/configs/10m50_devboard.h | 9 - include/configs/3c120_devboard.h | 9 - scripts

[PATCH v2 2/7] common: remove bedbug debugger support

2022-01-02 Thread Ovidiu Panait
Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot. Signed-off-by: Ovidiu Panai

[PATCH v2 5/7] common: board_r: move init_addr_map() to init.h

2022-01-01 Thread Ovidiu Panait
. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/arm/include/asm/mmu.h | 8 arch/powerpc/cpu/mpc85xx/tlb.c | 1 + arch/powerpc/include/asm/mmu.h | 4 board/freescale/common/fsl_chain_of_trust.c | 5

[PATCH v2 7/7] common: board_r: drop ifdefs around header includes

2022-01-01 Thread Ovidiu Panait
Drop the remaining ifdefs around header includes, to fix an old TODO. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) common/board_r.c | 9 - 1 file changed, 9 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index be225d8f87..bac386f021

[PATCH v2 1/7] common: spl: move armv7m-specific code to spl_perform_fixups()

2022-01-01 Thread Ovidiu Panait
Factor out armv7m fragment to spl_perform_fixups(), which is an arch/board specific function designed for this purpose. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/arm/cpu/armv7m/cpu.c | 6 ++ common/spl/spl.c | 3 --- 2 files changed, 6

[PATCH v2 6/7] common: board_r: include asm-generic/gpio.h

2022-01-01 Thread Ovidiu Panait
: Ovidiu Panait --- (no changes since v1) common/board_r.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 7c45e494ed..be225d8f87 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -66,9 +66,7 @@ #include #include #include -#if

[PATCH v2 4/7] common: board_r: drop initr_addr_map wrapper

2022-01-01 Thread Ovidiu Panait
Add a return value to init_addr_map and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Reviewed-by: Matthias Brugger Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/arm/include/asm/mmu.h | 2 +- arch/arm/mach

[PATCH v2 3/7] common: board_r: drop initr_kgdb wrapper

2022-01-01 Thread Ovidiu Panait
Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init(). Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Changes in v2: - drop extern and add functi

[RESEND PATCH 1/7] common: spl: move armv7m-specific code to spl_perform_fixups()

2021-12-25 Thread Ovidiu Panait
Factor out armv7m fragment to spl_perform_fixups(), which is an arch/board specific function designed for this purpose. Signed-off-by: Ovidiu Panait --- arch/arm/cpu/armv7m/cpu.c | 6 ++ common/spl/spl.c | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch

[RESEND PATCH 7/7] common: board_r: drop ifdefs around header includes

2021-12-25 Thread Ovidiu Panait
Drop the remaining ifdefs around header includes, to fix an old TODO. Signed-off-by: Ovidiu Panait --- common/board_r.c | 9 - 1 file changed, 9 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 506aa446fc..18a4849420 100644 --- a/common/board_r.c +++ b/common

[RESEND PATCH 5/7] common: board_r: move init_addr_map() to init.h

2021-12-25 Thread Ovidiu Panait
. Signed-off-by: Ovidiu Panait --- arch/arm/include/asm/mmu.h | 8 arch/powerpc/cpu/mpc85xx/tlb.c | 1 + arch/powerpc/include/asm/mmu.h | 4 board/freescale/common/fsl_chain_of_trust.c | 5 + common/board_r.c

[RESEND PATCH 2/7] common: board_r: move bedbug_init() to common code

2021-12-25 Thread Ovidiu Panait
a weak stub for bedbug_init() in board_r.c, so each CPU can provide its own implementation, as explained in the function comment Signed-off-by: Ovidiu Panait --- cmd/bedbug.c | 14 -- common/board_r.c | 10 ++ include/bedbug/type.h | 1 - include/init.h

[RESEND PATCH 4/7] common: board_r: drop initr_addr_map wrapper

2021-12-25 Thread Ovidiu Panait
Add a return value to init_addr_map and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Reviewed-by: Matthias Brugger Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- arch/arm/include/asm/mmu.h | 2 +- arch/arm/mach-bcm283x/init.c | 4

[RESEND PATCH 6/7] common: board_r: include asm-generic/gpio.h

2021-12-25 Thread Ovidiu Panait
Not all architectures define and even on those that do, the header cannot be included for all boards without causing various build failures. Since common/board_r.c only needs gpio_hog_probe_all() declaration, include and drop the associated ifdef. Signed-off-by: Ovidiu Panait --- common

[RESEND PATCH 3/7] common: board_r: drop initr_kgdb wrapper

2021-12-25 Thread Ovidiu Panait
Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init(). Signed-off-by: Ovidiu Panait --- common/board_r.c | 11 +-- common/kgdb.c| 7 +-- incl

[PATCH v3] xilinx: Kconfig: add XILINX_OF_BOARD_DTB_ADDR default value for microblaze

2021-12-02 Thread Ovidiu Panait
The xilinx board_fdt_blob_setup() implementation makes use of XILINX_OF_BOARD_DTB_ADDR, but no default value is currently defined for microblaze. Add one so that microblaze could also work with CONFIG_OF_SEPARATE. Signed-off-by: Ovidiu Panait --- board/xilinx/Kconfig | 1 + 1 file changed, 1

Re: [PATCH v2 01/10] xilinx: Kconfig: add XILINX_OF_BOARD_DTB_ADDR default value for microblaze

2021-12-01 Thread Ovidiu Panait
Hi Michal, On 12/1/21 12:10 PM, Michal Simek wrote: [Please note: This e-mail is from an EXTERNAL e-mail address] On 11/30/21 17:33, Ovidiu Panait wrote: Xilinx board_fdt_blob_setup() implementation makes use of XILINX_OF_BOARD_DTB_ADDR Kconfig option, but no default value is currently

[PATCH v2 07/10] microblaze: migrate CONFIG_SYS_USR_EXCEP to Kconfig

2021-11-30 Thread Ovidiu Panait
Migrate CONFIG_SYS_USR_EXCEP to Kconfig. Also, rename it to XILINX_MICROBLAZE0_USR_EXCEP in order to match the naming convention of microblaze-generic Kconfig options. Signed-off-by: Ovidiu Panait --- Changes in v2: Added Kconfig option description. arch/microblaze/cpu/exception.c | 2

[PATCH v2 09/10] microblaze: start.S: add support for configurable vector base address

2021-11-30 Thread Ovidiu Panait
prologe/epilogue are also updated to save and restore r4. Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/cpu/start.S | 58 - 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze

[PATCH v2 10/10] microblaze: branch to base vector address on reset

2021-11-30 Thread Ovidiu Panait
Current code assumes that the vector base address is always at 0x0. However, this value is configurable for MicroBlaze using the CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR Kconfig option. Update the reset routines to branch to this location instead. Signed-off-by: Ovidiu Panait --- (no changes

[PATCH v2 08/10] microblaze: add Kconfig symbol for the vector base address

2021-11-30 Thread Ovidiu Panait
MicroBlaze vector base address is configurable (hdl C_BASE_VECTORS configuration parameter). Current code assumes that the reset vector location is always 0x0. Add the XILINX_MICROBLAZE0_VECTOR_BASE_ADDR Kconfig option so the user can adjust the reset vector address. Signed-off-by: Ovidiu Panait

[PATCH v2 06/10] microblaze: drop CONFIG_SYS_RESET_ADDRESS macro

2021-11-30 Thread Ovidiu Panait
reset address should really be user-configurable, a new Kconfig option could be added. Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/cpu/start.S | 4 +--- include/configs/microblaze-generic.h | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a

[PATCH v2 03/10] microblaze: spl: add board_boot_order() implementation

2021-11-30 Thread Ovidiu Panait
: Ovidiu Panait --- (no changes since v1) arch/microblaze/cpu/spl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/microblaze/cpu/spl.c b/arch/microblaze/cpu/spl.c index 86522f8447..06d4af99b2 100644 --- a/arch/microblaze/cpu/spl.c +++ b/arch/microblaze/cpu/spl.c

[PATCH v2 05/10] microblaze: start.S: use stack space as scratch memory for endian offset

2021-11-30 Thread Ovidiu Panait
To simpify the code, use stack space as scratch memory for endian offset calculation, rather than saving/restoring the first unused MB vector. Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/cpu/start.S | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v2 04/10] microblaze: Kconfig: SPL dependencies fixup

2021-11-30 Thread Ovidiu Panait
:756: undefined reference to `hang' common/spl/spl.c:740: undefined reference to `memset' Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/microblaze/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 99a1

  1   2   3   4   >