* [PATCH 0/4] i.MX6 Riotboard related patches
@ 2026-01-05 10:44 Sascha Hauer
2026-01-05 10:44 ` [PATCH 1/4] ARM: i.MX6: Riotboard: ungate peripheral clocks Sascha Hauer
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-05 10:44 UTC (permalink / raw)
To: BAREBOX
These are patches I came up with while using the i.MX6 Riotboard.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (4):
ARM: i.MX6: Riotboard: ungate peripheral clocks
ARM: i.MX6: Riotboard: Add hint how to enable DEBUG_LL
gpio: Fix GPIOD_ASIS flag
ARM: boards: remove #define DEBUG in board files
arch/arm/boards/duckbill/lowlevel.c | 1 -
arch/arm/boards/element14-warp7/lowlevel.c | 1 -
arch/arm/boards/embest-riotboard/lowlevel.c | 5 +++++
arch/arm/boards/freescale-mx28-evk/lowlevel.c | 1 -
arch/arm/boards/karo-tx28/lowlevel.c | 1 -
arch/arm/boards/phytec-phycore-imx7/lowlevel.c | 1 -
drivers/gpio/gpiolib.c | 15 +++++++++------
include/gpio.h | 2 ++
include/linux/gpio/consumer.h | 2 +-
9 files changed, 17 insertions(+), 12 deletions(-)
---
base-commit: f4e96a91debc5fadc5d6280505dea72dbdafe257
change-id: 20260105-riotboard-ce9f0d411558
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] ARM: i.MX6: Riotboard: ungate peripheral clocks
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
@ 2026-01-05 10:44 ` Sascha Hauer
2026-01-05 10:44 ` [PATCH 2/4] ARM: i.MX6: Riotboard: Add hint how to enable DEBUG_LL Sascha Hauer
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-05 10:44 UTC (permalink / raw)
To: BAREBOX
Without it the DEBUG_LL console doesn't work when starting from USB.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/embest-riotboard/lowlevel.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boards/embest-riotboard/lowlevel.c b/arch/arm/boards/embest-riotboard/lowlevel.c
index 9ea92f50910d4ed3fd5a085b0e2f92b3bbf147f9..3aae39f75f70601a0da7b061a5bd2b922a3e1cea 100644
--- a/arch/arm/boards/embest-riotboard/lowlevel.c
+++ b/arch/arm/boards/embest-riotboard/lowlevel.c
@@ -22,6 +22,7 @@ ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2)
if (IS_ENABLED(CONFIG_DEBUG_LL)) {
writel(0x4, 0x020e016c);
+ imx6_ungate_all_peripherals();
imx6_uart_setup_ll();
putc_ll('a');
}
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/4] ARM: i.MX6: Riotboard: Add hint how to enable DEBUG_LL
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
2026-01-05 10:44 ` [PATCH 1/4] ARM: i.MX6: Riotboard: ungate peripheral clocks Sascha Hauer
@ 2026-01-05 10:44 ` Sascha Hauer
2026-01-05 10:45 ` [PATCH 3/4] gpio: Fix GPIOD_ASIS flag Sascha Hauer
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-05 10:44 UTC (permalink / raw)
To: BAREBOX
It's not obvious which UART to chose when trying to get DEBUG_LL output
from a board. Start improving the situation by adding a comment
describing which options to enable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/embest-riotboard/lowlevel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boards/embest-riotboard/lowlevel.c b/arch/arm/boards/embest-riotboard/lowlevel.c
index 3aae39f75f70601a0da7b061a5bd2b922a3e1cea..f1b37c2aa00d44ad8a2091abf21584ca531b7794 100644
--- a/arch/arm/boards/embest-riotboard/lowlevel.c
+++ b/arch/arm/boards/embest-riotboard/lowlevel.c
@@ -21,6 +21,10 @@ ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2)
imx6_cpu_lowlevel_init();
if (IS_ENABLED(CONFIG_DEBUG_LL)) {
+ /*
+ * CONFIG_DEBUG_IMX6Q_UART=y
+ * CONFIG_DEBUG_IMX_UART_PORT=2
+ */
writel(0x4, 0x020e016c);
imx6_ungate_all_peripherals();
imx6_uart_setup_ll();
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/4] gpio: Fix GPIOD_ASIS flag
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
2026-01-05 10:44 ` [PATCH 1/4] ARM: i.MX6: Riotboard: ungate peripheral clocks Sascha Hauer
2026-01-05 10:44 ` [PATCH 2/4] ARM: i.MX6: Riotboard: Add hint how to enable DEBUG_LL Sascha Hauer
@ 2026-01-05 10:45 ` Sascha Hauer
2026-01-05 10:45 ` [PATCH 4/4] ARM: boards: remove #define DEBUG in board files Sascha Hauer
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-05 10:45 UTC (permalink / raw)
To: BAREBOX
GPIOs can be requested with GPIOD_ASIS and with this the GPIO should be
kept in its current state. This doesn't work currently as GPIOD_ASIS is
defined as 0 and the flags are then interpreted as GPIOF_INIT_LOW (also
0).
To fix this set GPIOD_ASIS to a bit value which makes it a flag which
can be explicitly tested for.
Note this is different than in Linux. Linux defines GPIOD_ASIS to 0 just
like barebox did, but in Linux the other GPIOD_* flags have an explicit
"change this setting" flag which we don't have in barebox. Introducing
these flags in barebox would mean we have to add the "change this
setting" flags in various other places, like for example
gpiod_request_one().
Motivation for this patch is the only current user of GPIOD_ASIS, the
fixed regulator driver. Without this patch regulators will already be
enabled in the fixed regulator drivers probe function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/gpio/gpiolib.c | 15 +++++++++------
include/gpio.h | 2 ++
include/linux/gpio/consumer.h | 2 +-
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index ec4d8e889bb1e7671f844c5c158188b7b9a23888..e1493ffb6640bc417996f81c45197c32441a8d69 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -622,6 +622,7 @@ static int gpiodesc_request_one(struct gpio_desc *desc, unsigned long lflags,
const bool logical = (dflags & GPIOF_LOGICAL) == GPIOF_LOGICAL;
const bool init_active = (dflags & GPIOF_INIT_ACTIVE) == GPIOF_INIT_ACTIVE;
const bool init_high = (dflags & GPIOF_INIT_HIGH) == GPIOF_INIT_HIGH;
+ const bool set = (dflags & GPIOF_ASIS) == GPIOF_ASIS;
err = gpiodesc_request(desc, label);
if (err)
@@ -631,12 +632,14 @@ static int gpiodesc_request_one(struct gpio_desc *desc, unsigned long lflags,
if (active_low)
desc->flags |= OF_GPIO_ACTIVE_LOW;
- if (dir_in)
- err = gpiod_direction_input(desc);
- else if (logical)
- err = gpiod_direction_output(desc, init_active);
- else
- err = gpiod_direction_output_raw(desc, init_high);
+ if (!set) {
+ if (dir_in)
+ err = gpiod_direction_input(desc);
+ else if (logical)
+ err = gpiod_direction_output(desc, init_active);
+ else
+ err = gpiod_direction_output_raw(desc, init_high);
+ }
if (err)
gpiodesc_free(desc);
diff --git a/include/gpio.h b/include/gpio.h
index 92fd27b2b996eed8777e9321b4f34e245ceca480..2264d0c495a4439f0f8b23e023e28f7472c90889 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -114,6 +114,8 @@ static inline int gpio_is_valid(int gpio)
#define GPIOF_OUT_INIT_ACTIVE (GPIOF_DIR_OUT | GPIOF_INIT_ACTIVE)
#define GPIOF_OUT_INIT_INACTIVE (GPIOF_DIR_OUT | GPIOF_INIT_INACTIVE)
+#define GPIOF_ASIS BIT(4)
+
/**
* struct gpio - a structure describing a GPIO with configuration
* @gpio: the GPIO number
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index c461f3f3108bd9e31777df2a37ffb469fafb36bd..a425145351b0da1476e9327dfebb2e13801488f3 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -13,7 +13,7 @@
* and output value. These values cannot be OR'd.
*/
enum gpiod_flags {
- GPIOD_ASIS = 0,
+ GPIOD_ASIS = GPIOF_ASIS,
GPIOD_IN = GPIOF_IN,
/*
* To change this later to a different logic level (i.e. taking
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] ARM: boards: remove #define DEBUG in board files
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
` (2 preceding siblings ...)
2026-01-05 10:45 ` [PATCH 3/4] gpio: Fix GPIOD_ASIS flag Sascha Hauer
@ 2026-01-05 10:45 ` Sascha Hauer
2026-01-06 7:46 ` (subset) [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
2026-01-06 7:46 ` Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-05 10:45 UTC (permalink / raw)
To: BAREBOX
DEBUG should be defined on demand when actually debugging, not by
default. Remove these in the board files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/duckbill/lowlevel.c | 1 -
arch/arm/boards/element14-warp7/lowlevel.c | 1 -
arch/arm/boards/freescale-mx28-evk/lowlevel.c | 1 -
arch/arm/boards/karo-tx28/lowlevel.c | 1 -
arch/arm/boards/phytec-phycore-imx7/lowlevel.c | 1 -
5 files changed, 5 deletions(-)
diff --git a/arch/arm/boards/duckbill/lowlevel.c b/arch/arm/boards/duckbill/lowlevel.c
index 71862ec4b71dc4d7ee99a3e01d776a5c74794d1e..e94c58308580e945332637f8bd32bde6811b59b9 100644
--- a/arch/arm/boards/duckbill/lowlevel.c
+++ b/arch/arm/boards/duckbill/lowlevel.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#define pr_fmt(fmt) "I2SE Duckbill: " fmt
-#define DEBUG
#include <common.h>
#include <linux/sizes.h>
diff --git a/arch/arm/boards/element14-warp7/lowlevel.c b/arch/arm/boards/element14-warp7/lowlevel.c
index c6ddfea5a4dd51b4b3be819209b667a0141fe298..3d5e24967b2f4a996b365533943d385af2124f26 100644
--- a/arch/arm/boards/element14-warp7/lowlevel.c
+++ b/arch/arm/boards/element14-warp7/lowlevel.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-#define DEBUG
#include <io.h>
#include <common.h>
#include <linux/sizes.h>
diff --git a/arch/arm/boards/freescale-mx28-evk/lowlevel.c b/arch/arm/boards/freescale-mx28-evk/lowlevel.c
index 42ac33fbbd9b8709f6031dc0dafaeff74fd8af3c..53a7b7582b6d4b39737d49f688b9c2c18374dc6f 100644
--- a/arch/arm/boards/freescale-mx28-evk/lowlevel.c
+++ b/arch/arm/boards/freescale-mx28-evk/lowlevel.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#define pr_fmt(fmt) "Freescale MX28evk: " fmt
-#define DEBUG
#include <common.h>
#include <linux/sizes.h>
diff --git a/arch/arm/boards/karo-tx28/lowlevel.c b/arch/arm/boards/karo-tx28/lowlevel.c
index e423d5ecab9252db007d9e1d781a7f5db8b2a24d..25e72f2cf70168306057298a1848b022903e29fc 100644
--- a/arch/arm/boards/karo-tx28/lowlevel.c
+++ b/arch/arm/boards/karo-tx28/lowlevel.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#define pr_fmt(fmt) "KARO TX28: " fmt
-#define DEBUG
#include <common.h>
#include <linux/sizes.h>
diff --git a/arch/arm/boards/phytec-phycore-imx7/lowlevel.c b/arch/arm/boards/phytec-phycore-imx7/lowlevel.c
index 1f3c08ac62bd90c9bdec2f53ae587282e2b16cd0..79128b964cf41e1a157050ec8ae1c53037c3ad29 100644
--- a/arch/arm/boards/phytec-phycore-imx7/lowlevel.c
+++ b/arch/arm/boards/phytec-phycore-imx7/lowlevel.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-#define DEBUG
#include <io.h>
#include <common.h>
#include <linux/sizes.h>
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (subset) [PATCH 0/4] i.MX6 Riotboard related patches
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
` (3 preceding siblings ...)
2026-01-05 10:45 ` [PATCH 4/4] ARM: boards: remove #define DEBUG in board files Sascha Hauer
@ 2026-01-06 7:46 ` Sascha Hauer
2026-01-06 7:46 ` Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-06 7:46 UTC (permalink / raw)
To: BAREBOX, Sascha Hauer
On Mon, 05 Jan 2026 11:44:57 +0100, Sascha Hauer wrote:
> These are patches I came up with while using the i.MX6 Riotboard.
>
>
Applied, thanks!
[1/4] ARM: i.MX6: Riotboard: ungate peripheral clocks
https://git.pengutronix.de/cgit/barebox/commit/?id=945278538eac (link may not be stable)
[2/4] ARM: i.MX6: Riotboard: Add hint how to enable DEBUG_LL
https://git.pengutronix.de/cgit/barebox/commit/?id=31407a627d9f (link may not be stable)
[4/4] ARM: boards: remove #define DEBUG in board files
https://git.pengutronix.de/cgit/barebox/commit/?id=32318cb2783e (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (subset) [PATCH 0/4] i.MX6 Riotboard related patches
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
` (4 preceding siblings ...)
2026-01-06 7:46 ` (subset) [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
@ 2026-01-06 7:46 ` Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-01-06 7:46 UTC (permalink / raw)
To: BAREBOX, Sascha Hauer
On Mon, 05 Jan 2026 11:44:57 +0100, Sascha Hauer wrote:
> These are patches I came up with while using the i.MX6 Riotboard.
>
>
Applied, thanks!
[3/4] gpio: Fix GPIOD_ASIS flag
https://git.pengutronix.de/cgit/barebox/commit/?id=6436a1dc83dd (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-06 7:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 10:44 [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
2026-01-05 10:44 ` [PATCH 1/4] ARM: i.MX6: Riotboard: ungate peripheral clocks Sascha Hauer
2026-01-05 10:44 ` [PATCH 2/4] ARM: i.MX6: Riotboard: Add hint how to enable DEBUG_LL Sascha Hauer
2026-01-05 10:45 ` [PATCH 3/4] gpio: Fix GPIOD_ASIS flag Sascha Hauer
2026-01-05 10:45 ` [PATCH 4/4] ARM: boards: remove #define DEBUG in board files Sascha Hauer
2026-01-06 7:46 ` (subset) [PATCH 0/4] i.MX6 Riotboard related patches Sascha Hauer
2026-01-06 7:46 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox