[PATCH] common: board_r: Initialize interrupts before watchdog

2025-02-18 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" On some platforms, initializing the watchdog driver enables a timer interrupt. This of course requires the interrupt handlers to be properly initialized, otherwise U-Boot may crash or run the timer interrupt handler of a previous bootloader stage. To account for such system

[PATCH] serial: ns16550: Fix pointer type mismatch

2025-02-18 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" serial_out_dynamic() takes a u8* addr and uses it for 8-bit or 32-bit accesses, depending on the value of plat->reg_width. This results in a pointer type mismatch that the compiler may even turn into an error: drivers/serial/ns16550.c: In function ‘serial_out_dynamic’: driv

[PATCH 0/2] PowerPC MPC8xxx compile-time checks

2025-02-17 Thread J . Neuschäfer via B4 Relay
This series happens entirely in the C preprocessor, catching some kinds of bugs a bit earlier than they otherwise would. Everything has been compile-tested, and there should be no change to runtime behavior. Signed-off-by: J. Neuschäfer --- J. Neuschäfer (2): powerpc: mpc83xx: Check the siz

[PATCH 2/2] powerpc: mpc8xxx_spi: Catch bad chip variants earlier

2025-02-17 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Currently, enabling the MPC8xxx SPI driver on an unexpected SoC results in a wall of errors because spi8xxx_t isn't defined. This is quite a bad experience, so let's catch this kind of issue in mpc8xxx_spi.h. Signed-off-by: J. Neuschäfer --- arch/powerpc/include/asm/mpc8x

[PATCH 1/2] powerpc: mpc83xx: Check the size of peripheral structs

2025-02-17 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Peripheral registers on MPC83xx-series chips are declared in immap_83xx.h as a set of structs that ultimately fill the entire MMIO space of 1 MiB. This patch introduces a compile-time check of the size of each peripheral struct. The purpose of these checks is two-fold: 1. T

[PATCH] gpio: 74x146: depend on DM_SPI

2025-02-17 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Currently, Kconfig allows building CONFIG_DM_74X164 without CONFIG_DM_SPI, which results in linker errors because this driver actually uses dm_spi_* functions: drivers/gpio/74x164_gpio.o: in function `gen_74x164_write_conf': undefined reference to `dm_spi_claim_bus' und

[PATCH 1/2] net: tsec: Reorder tsec_recv and tsec_free_pkt

2025-02-16 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" This is necessary for the following patch. No functional change. Signed-off-by: J. Neuschäfer --- drivers/net/tsec.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 6

[PATCH 2/2] net: tsec: Re-arm packet buffer in error case

2025-02-16 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" When an error is detected in the TSEC receive path, the driver currently prints an error message, but leaves the corresponding packet descriptor in its old state (i.e. owned by the CPU side). As a result, the packet queue can be starved of available buffers if enough errors

[PATCH 0/2] net: tsec: Improve receive error path

2025-02-16 Thread J . Neuschäfer via B4 Relay
Currently, errors in the receive path of the TSEC Ethernet driver result in an exhaustion of packet buffer descriptors. This series fixes it. Signed-off-by: J. Neuschäfer --- J. Neuschäfer (2): net: tsec: Reorder tsec_recv and tsec_free_pkt net: tsec: Re-arm packet buffer in error cas

[PATCH v2 2/4] powerpc: mpc83xx: Allow including initreg.h into multiple files

2024-12-20 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Globals defined in headers can result in multiple-definition errors while linking, if they are visible beyond the current translation unit. This hasn't been a problem for initreg.h so far, but would become a problem in the next patch, where I use a constant from initreg.h i

[PATCH v2 4/4] gpio: mpc8xxx: Preserve pre-init state of outputs

2024-12-20 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" The mpc8xxx_gpio driver contains a workaround for certain chips where the previously written state of outputs cannot be read back from the GPIO data (GPDAT) register (MPC8572/MPC8536). This workaround consists of tracking the state of GPDAT in a "shadow register" (i.e. a sof

[PATCH v2 1/4] powerpc: mpc83xx: Fix timer value calculation

2024-12-20 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" TBU and TBL are specified as two 32-bit registers that form a 64-bit value, but the calculation only shifted TBU by 16 bits. Fix this by actually shifting 32 bits. Reviewed-by: Sinan Akman Signed-off-by: J. Neuschäfer --- drivers/timer/mpc83xx_timer.c | 2 +- 1 file cha

[PATCH v2 3/4] powerpc: mpc83xx: Use defined constant for SPCR[TBEN]

2024-12-20 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" To increase readability, use the defined constant instead of specifying SPCR[TBEN] as a number. Reviewed-by: Sinan Akman Signed-off-by: J. Neuschäfer --- arch/powerpc/cpu/mpc83xx/interrupts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powe

[PATCH v2 0/4] Misc. PowerPC MPC83xx fixes/cleanups

2024-12-20 Thread J . Neuschäfer via B4 Relay
This patchset contains a few small fixes/cleanups for the MPC83xx platform. Signed-off-by: J. Neuschäfer --- Changes in v2: - Address feedback from Sinan Akman by clarifying some commit messages - Link to v1: https://lore.kernel.org/r/20241215-mpc83xx-misc-v1-0-8cd6daae4...@posteo.net --- J. Ne

[PATCH] doc: fit: Format image tree source example

2024-12-15 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" The example in kernel_fdt.rst is inconsistently indented, making it difficult to read. Indent the example with the same standard as the other examples: Four spaces for the ReST code block and for every nesting level. Signed-off-by: J. Neuschäfer --- doc/usage/fit/kernel_

[PATCH 0/4] Misc. PowerPC MPC83xx fixes/cleanups

2024-12-15 Thread J . Neuschäfer via B4 Relay
This patchset contains a few small fixes/cleanups for the MPC83xx platform. Signed-off-by: J. Neuschäfer --- J. Neuschäfer (4): powerpc: mpc83xx: Fix timer value calculation powerpc: mpc83xx: Allow including initreg.h into multiple files powerpc: mpc83xx: Use defined constant fo

[PATCH 1/4] powerpc: mpc83xx: Fix timer value calculation

2024-12-15 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" TBU and TBL are specified as two 32-bit registers that form a 64-bit value, but the calculation only shifted TBU by 16 bits. Fix this by actually shifting 32 bits. Signed-off-by: J. Neuschäfer --- drivers/timer/mpc83xx_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 4/4] gpio: mpc8xxx: Preserve pre-init state of outputs

2024-12-15 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" The mpc8xxx_gpio driver contains a workaround for certain chips where the previously written state of outputs cannot be read back from the GPIO data (GPDAT) register (MPC8572/MPC8536). This workaround consists of tracking the state of GPDAT in a "shadow register" (i.e. a sof

[PATCH 3/4] powerpc: mpc83xx: Use defined constant for SPCR[TBEN]

2024-12-15 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" To increase readability, use the defined constant instead of specifying SPCR[TBEN] as a number. Signed-off-by: J. Neuschäfer --- arch/powerpc/cpu/mpc83xx/interrupts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/cpu/mpc83xx/interrupts

[PATCH 2/4] powerpc: mpc83xx: Allow including initreg.h into multiple files

2024-12-15 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Globals defined in headers can result in multiple-definition errors while linking, if they are visible beyond the current translation unit. Signed-off-by: J. Neuschäfer --- arch/powerpc/cpu/mpc83xx/initreg/initreg.h | 8 1 file changed, 4 insertions(+), 4 deletio

[PATCH 1/2] powerpc: Fix 0 vs. r0 confusion in X/D-form instructions

2024-12-12 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Instructions such as dcbi are in the X-form; they have RA and RB fields and the effective address (EA) is computed as (RA|0)+(RB). In words, this means that if RA is zero, the left-hand side of the addition is zero, otherwise the corresponding GPR is used. r0 can never be us

[PATCH 2/2] powerpc: Introduce and enforce assembler checks on GPR usage

2024-12-12 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" PowerPC general-purpose registers are historically specified as plain numbers (0-31), which makes them hard to distinguish from immediates. For this reason, include/ppc_asm.tmpl defines aliases named r0-r31. This can still lead to uncaught mistakes if a register is used in p

[PATCH 0/2] powerpc: Fix and enforce distinction between immediates and registers

2024-12-12 Thread J . Neuschäfer via B4 Relay
This patchset changes the definition r0 etc. to %r0, so that the assembler can check that registers are only used where expected, and fixes the fallout. Signed-off-by: J. Neuschäfer --- J. Neuschäfer (2): powerpc: Fix 0 vs. r0 confusion in X/D-form instructions powerpc: Introduce and

[PATCH v2 3/3] cmd: ufetch: Show CPU architecture under "CPU"

2024-12-11 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" When looking at ufetch output it isn't immediately obvious which CPU architecture the presented board has. This patch therefore adds the CPU architecture string (for example "powerpc") to the "CPU:" line. The new format is: CPU: powerpc (1 cores, 1 in use) Signed-o

[PATCH v2 2/3] cmd: Allow building ufetch without CONFIG_BLK

2024-12-11 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" The ufetch command is still quite useful on systems without block device support; remove the CONFIG_BLK dependency and make sure the code compiles/works with and without CONFIG_BLK. Reviewed-by: Caleb Connolly Signed-off-by: J. Neuschäfer --- v2: - Add parentheses to avo

[PATCH v2 0/3] cmd: ufetch improvements

2024-12-11 Thread J . Neuschäfer via B4 Relay
Following the recent addition of the "ufetch" command, this patchset improves it in a few ways. Signed-off-by: J. Neuschäfer --- Changes in v2: - Address comments and add R-b tags from Caleb - Link to v1: https://lore.kernel.org/r/20241205-ufetch-v1-0-df861318b...@posteo.net --- J. Neuschäfer (

[PATCH v2 1/3] cmd: ufetch: Fix type mismatch on 32-bit

2024-12-11 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" On 32-bit architectures, LAST_LINE (_LAST_LINE - 1UL) is 64 bits long, but size_t (from ARRAY_SIZE(...)) is 32 bits. This results in a warning because the max() macro expects the same type on both sides: cmd/ufetch.c: In function ‘do_ufetch’: include/linux/kernel.h:179:24:

[PATCH 1/3] cmd: ufetch: Fix type mismatch on 32-bit

2024-12-05 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" On 32-bit architectures, LAST_LINE (_LAST_LINE - 1UL) is 64 bits long, but size_t (from ARRAY_SIZE(...)) is 32 bits. This results in a warning because the max() macro expects the same type on both sides: cmd/ufetch.c: In function ‘do_ufetch’: include/linux/kernel.h:179:24:

[PATCH 2/3] cmd: Allow building ufetch without CONFIG_BLK

2024-12-05 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" The ufetch command is still quite useful on systems without block device support; remove the CONFIG_BLK dependency and make sure the code compiles/works with and without CONFIG_BLK. Signed-off-by: J. Neuschäfer --- cmd/Kconfig | 1 - cmd/ufetch.c | 10 +++--- 2 file

[PATCH 0/3] cmd: ufetch improvements

2024-12-05 Thread J . Neuschäfer via B4 Relay
Following the recent addition of the "ufetch" command, this patchset improves it in a few ways. Signed-off-by: J. Neuschäfer --- J. Neuschäfer (3): cmd: ufetch: Fix type mismatch on 32-bit cmd: Allow building ufetch without CONFIG_BLK cmd: ufetch: Show CPU architecture under "CP

[PATCH 3/3] cmd: ufetch: Show CPU architecture under "CPU"

2024-12-05 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" When looking at ufetch output it isn't immediately obvious which CPU architecture the presented board has. This patch therefore adds the CPU architecture string (for example "powerpc") to the "CPU:" line. Signed-off-by: J. Neuschäfer --- cmd/ufetch.c | 2 +- 1 file change

[PATCH] powerpc: Support using upstream devicetrees

2024-12-05 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" For new PowerPC developments, it will be useful to borrow devicetrees from Linux. This patch makes it possible. Signed-off-by: J. Neuschäfer --- This may seem hypothetical, but I'm working on a new U-Boot port for a PowerPC board. --- dts/upstream/src/powerpc/Makefile | 6

[PATCH 2/2] doc: sending_patches: Fix spelling of "its"

2024-11-29 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Although it has historically been different, the current standard spelling of the neutral singular possessive pronoun is "its". Signed-off-by: J. Neuschäfer --- doc/develop/sending_patches.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/develop

[PATCH 1/2] clk: mpc83xx: Fix typo in "Coherent System Bus"

2024-11-29 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Cosmetic change. Signed-off-by: J. Neuschäfer --- drivers/clk/mpc83xx_clk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/mpc83xx_clk.h b/drivers/clk/mpc83xx_clk.h index c06a51ecd43a426e8ecd4e99a3f8ff3e902f9106..6b74fc5f16b613cec4fbc6546

[PATCH 0/2] Minor typo fixes

2024-11-29 Thread J . Neuschäfer via B4 Relay
This patchset includes two small typo fixes. Signed-off-by: J. Neuschäfer --- J. Neuschäfer (2): clk: mpc83xx: Fix typo in "Coherent System Bus" doc: sending_patches: Fix spelling of "its" doc/develop/sending_patches.rst | 2 +- drivers/clk/mpc83xx_clk.h | 2 +- 2 files change