[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