Skip to contentSkip to conversation

arm: rockchip: minor fixes as preparation for mainline dts

PATCH In review Michael Riesch 4 participants 14 messages Nov 11, 2021 – Jan 14, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover arm: rockchip: minor fixes as preparation for mainline dts

Hi all,

These patches fix bugs that are bound to pop up once the mainline device tree for the Rockchip RK356x are pulled into barebox.

Tested on a Pine64 Quartz64 board, further tests on a RK3568 EVB will follow tomorrow.

Best regards,
Michael

Michael Riesch (3):
arm: rockchip: rk3568: fix mmc boot source instances
net: designware: rockchip: remove unnecessary clock pclk_xpcs
pinctrl: rockchip: use alias rather than full of name

 arch/arm/mach-rockchip/rk3568.c    | 4 ++--
 drivers/net/designware_rockchip.c  | 2 --
 drivers/pinctrl/pinctrl-rockchip.c | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/3 arm: rockchip: rk3568: fix mmc boot source instances

The mainline DTS for the RK3568 EVB1 introduces mmc aliases sorted by the addresses of the corresponding controller. This commit fixes the instance number and aligns it with these aliases.

---
 arch/arm/mach-rockchip/rk3568.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/rk3568.c +2 -2
index 234c6d22d..95f462eca 100644
@@ -144,10 +144,10 @@ struct rk_bootsource {
 
 static struct rk_bootsource bootdev_map[] = {
 	[0x1] = { .src = BOOTSOURCE_NAND, .instance = 0 },
-	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 0 },
+	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 1 },
 	[0x3] = { .src = BOOTSOURCE_SPI_NOR, .instance = 0 },
 	[0x4] = { .src = BOOTSOURCE_SPI_NAND, .instance = 0 },
-	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 1 },
+	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 0 },
 	[0xa] = { .src = BOOTSOURCE_USB, .instance = 0 },
 };
 
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH 1/3] arm: rockchip: rk3568: fix mmc boot source instances

Quoted 3 lines · Michael Riesch

The mainline DTS for the RK3568 EVB1 introduces mmc aliases sorted by the addresses of the corresponding controller. This commit fixes the instance number and aligns it with these aliases.

The board dts sorts them differently, but the file is a SoC specific one. We have a problem here.

Sascha

Quoted 32 lines
---
 arch/arm/mach-rockchip/rk3568.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/rk3568.c +2 -2
index 234c6d22d..95f462eca 100644
@@ -144,10 +144,10 @@ struct rk_bootsource {
 
 static struct rk_bootsource bootdev_map[] = {
 	[0x1] = { .src = BOOTSOURCE_NAND, .instance = 0 },
-	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 0 },
+	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 1 },
 	[0x3] = { .src = BOOTSOURCE_SPI_NOR, .instance = 0 },
 	[0x4] = { .src = BOOTSOURCE_SPI_NAND, .instance = 0 },
-	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 1 },
+	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 0 },
 	[0xa] = { .src = BOOTSOURCE_USB, .instance = 0 },
 };
 
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Re: [PATCH 1/3] arm: rockchip: rk3568: fix mmc boot source instances

Quoted 22 lines · Sascha Hauer
Quoted 3 lines · Michael Riesch

The mainline DTS for the RK3568 EVB1 introduces mmc aliases sorted by the addresses of the corresponding controller. This commit fixes the instance number and aligns it with these aliases.

The board dts sorts them differently, but the file is a SoC specific one. We have a problem here.

Sascha

Quoted 12 lines
---
 arch/arm/mach-rockchip/rk3568.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/rk3568.c +0 -0
index 234c6d22d..95f462eca 100644
@@ -144,10 +144,10 @@ struct rk_bootsource {
 
Quoted 8 lines

arch/arm/mach-rockchip/rk3568.c struct rk_bootsource { · line 150

Quoted 8 lines
arch/arm/mach-rockchip/rk3568.c +2 -2
 static struct rk_bootsource bootdev_map[] = {
 	[0x1] = { .src = BOOTSOURCE_NAND, .instance = 0 },
-	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 0 },
+	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 1 },
 	[0x3] = { .src = BOOTSOURCE_SPI_NOR, .instance = 0 },
 	[0x4] = { .src = BOOTSOURCE_SPI_NAND, .instance = 0 },
-	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 1 },
+	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 0 },

Instead of storing the .src and .instance directly here we could store the base address of the peripheral here. Then search in the device tree for the node with that address and get the corresponding alias.

We would then have to translate this into our BOOTSOURCE_ defines and instance numbers. Or maybe it was a bad idea to have defines for these and we should have used strings for the bootsources in the first place.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

Re: [PATCH 1/3] arm: rockchip: rk3568: fix mmc boot source instances

Hello Sascha,

Quoted 8 lines · Sascha Hauer
Quoted 7 lines · Sascha Hauer
Quoted 3 lines · Michael Riesch

The mainline DTS for the RK3568 EVB1 introduces mmc aliases sorted by the addresses of the corresponding controller. This commit fixes the instance number and aligns it with these aliases.

The board dts sorts them differently, but the file is a SoC specific one. We have a problem here.

Indeed. FWIW Ahmad and I had a discussion about this topic in which having the mmc aliases in the SoC dtsi file was suggested as nice solution. However, the ARM SoC community is about to move the aliases to the board files and the corresponding patch was declined [0]. Hence, currently we rely on the board dts files to be consistent. At the moment this is the case, but I take it that you are not too fond of this approach.
BTW if I am not mistaken, this is an issue on other platforms as well, e.g., on the ZynqMP machines.

Quoted 14 lines
Quoted 14 lines

Sascha

Quoted 12 lines
---
 arch/arm/mach-rockchip/rk3568.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/rk3568.c +0 -0
index 234c6d22d..95f462eca 100644
@@ -144,10 +144,10 @@ struct rk_bootsource {
 
Quoted 12 lines
Quoted 8 lines

arch/arm/mach-rockchip/rk3568.c struct rk_bootsource { · line 150

Quoted 8 lines
arch/arm/mach-rockchip/rk3568.c +2 -2
 static struct rk_bootsource bootdev_map[] = {
 	[0x1] = { .src = BOOTSOURCE_NAND, .instance = 0 },
-	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 0 },
+	[0x2] = { .src = BOOTSOURCE_MMC, .instance = 1 },
 	[0x3] = { .src = BOOTSOURCE_SPI_NOR, .instance = 0 },
 	[0x4] = { .src = BOOTSOURCE_SPI_NAND, .instance = 0 },
-	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 1 },
+	[0x5] = { .src = BOOTSOURCE_MMC, .instance = 0 },

Instead of storing the .src and .instance directly here we could store the base address of the peripheral here. Then search in the device tree for the node with that address and get the corresponding alias.

Sounds good to me.

Quoted 3 lines

We would then have to translate this into our BOOTSOURCE_ defines and instance numbers. Or maybe it was a bad idea to have defines for these and we should have used strings for the bootsources in the first place.

AFAIC having a clear classification of the boot sources with enums is helpful, and it is just the link to the actual device that might need a revision.

I might give this a spin and come up with something.

Best regards,
Michael

[0]
https://lore.kernel.org/all/[email protected]/

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw

RFC PATCH 1/1 bootsource: add helper to set instance by name

Instance numbers should be related to device tree aliases, which may be board-specific. In order to establish a board-independent link between the boot source and the actual alias, introduce a helper that sets the instance by the OF name.

---
 common/bootsource.c  | 74 ++++++++++++++++++++++++++++----------------
 include/bootsource.h |  1 +
 2 files changed, 48 insertions(+), 27 deletions(-)
common/bootsource.c +47 -27
index 1f8d053a8..1b45956a5 100644
@@ -9,6 +9,7 @@
 #include <environment.h>
 #include <magicvar.h>
 #include <init.h>
+#include <of.h>
 
 static const char *bootsource_str[] = {
 	[BOOTSOURCE_UNKNOWN] = "unknown",
@@ -33,31 +34,8 @@ static enum bootsource bootsource = BOOTSOURCE_UNKNOWN;
 static int bootsource_instance = BOOTSOURCE_INSTANCE_UNKNOWN;
 const char *bootsource_alias_name = NULL;
 
-/**
- * bootsource_get_alias_name() - Get the name of the bootsource alias
- *
- * This function will return newly allocated string containing name of
- * the alias that is expected to point to DTB node corresponding to
- * detected bootsource
- *
- * NOTE: Caller is expected to free() the string allocated by this
- * function
- */
-char *bootsource_get_alias_name(void)
+static const char *bootsource_get_of_stem(void)
 {
-	const char *stem;
-
-	/*
-	 * If alias name was overridden via
-	 * bootsource_set_alias_name() return that value without
-	 * asking any questions.
-	 *
-	 * Note that we have to strdup() the result to make it
-	 * free-able.
-	 */
-	if (bootsource_alias_name)
-		return strdup(bootsource_alias_name);
-
 	switch (bootsource) {
 		/*
 		 * For I2C and SPI EEPROMs we set the stem to be 'i2c'
@@ -69,22 +47,50 @@ char *bootsource_get_alias_name(void)
 		 * controller
 		 */
 	case BOOTSOURCE_I2C_EEPROM:
-		stem = bootsource_str[BOOTSOURCE_I2C];
+		return bootsource_str[BOOTSOURCE_I2C];
 		break;
 	case BOOTSOURCE_SPI_EEPROM:
 	case BOOTSOURCE_SPI_NOR:
-		stem = bootsource_str[BOOTSOURCE_SPI];
+		return bootsource_str[BOOTSOURCE_SPI];
 		break;
 	case BOOTSOURCE_SERIAL:	/* FALLTHROUGH */
 	case BOOTSOURCE_I2C:	/* FALLTHROUGH */
 	case BOOTSOURCE_MMC:	/* FALLTHROUGH */
 	case BOOTSOURCE_SPI:	/* FALLTHROUGH */
 	case BOOTSOURCE_CAN:
-		stem = bootsource_str[bootsource];
+		return bootsource_str[bootsource];
 		break;
 	default:
 		return NULL;
 	}
+}
+
+/**
+ * bootsource_get_alias_name() - Get the name of the bootsource alias
+ *
+ * This function will return newly allocated string containing name of
+ * the alias that is expected to point to DTB node corresponding to
+ * detected bootsource
+ *
+ * NOTE: Caller is expected to free() the string allocated by this
+ * function
+ */
+char *bootsource_get_alias_name(void)
+{
+	const char *stem;
+
+	/*
+	 * If alias name was overridden via
+	 * bootsource_set_alias_name() return that value without
+	 * asking any questions.
+	 *
+	 * Note that we have to strdup() the result to make it
+	 * free-able.
+	 */
+	if (bootsource_alias_name)
+		return strdup(bootsource_alias_name);
+
+	stem = bootsource_get_of_stem();
 
 	/*
 	 * We expect SoC specific bootsource detection code to properly
@@ -125,6 +131,20 @@ void bootsource_set_instance(int instance)
 	setenv("bootsource_instance", buf);
 }
 
+void bootsource_set_instance_by_of_name(const char *name)
+{
+	int instance = BOOTSOURCE_UNKNOWN;
+	struct device_node *node;
+
+	node = of_find_node_by_name(of_get_root_node(), name);
+	if (node) {
+		instance = of_alias_get_id(node, bootsource_get_of_stem());
+		if (instance < 0)
+			instance = BOOTSOURCE_UNKNOWN;
+	}
+	bootsource_set_instance(instance);
+}
+
 enum bootsource bootsource_get(void)
 {
 	return bootsource;
include/bootsource.h +1 -0
index 646b0e91c..4dcb969ac 100644
@@ -28,6 +28,7 @@ enum bootsource bootsource_get(void);
 int bootsource_get_instance(void);
 void bootsource_set(enum bootsource src);
 void bootsource_set_instance(int instance);
+void bootsource_set_instance_by_of_name(const char *name);
 void bootsource_set_alias_name(const char *name);
 char *bootsource_get_alias_name(void);
 
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

Re: [RFC PATCH] bootsource: add helper to set instance by name

Hi Sascha and Ahmad,

Quoted 4 lines · Michael Riesch

Instance numbers should be related to device tree aliases, which may be board-specific. In order to establish a board-independent link between the boot source and the actual alias, introduce a helper that sets the instance by the OF name.

Gentle ping here. A rough indication whether or not this is the correct path would be great.

Since patch 2/3 has just been cherry-picked, I could prepare a v2 of the remaining two patches as next step.

Best regards,
Michael

Quoted 132 lines
---
 common/bootsource.c  | 74 ++++++++++++++++++++++++++++----------------
 include/bootsource.h |  1 +
 2 files changed, 48 insertions(+), 27 deletions(-)
common/bootsource.c +47 -27
index 1f8d053a8..1b45956a5 100644
@@ -9,6 +9,7 @@
 #include <environment.h>
 #include <magicvar.h>
 #include <init.h>
+#include <of.h>
 
 static const char *bootsource_str[] = {
 	[BOOTSOURCE_UNKNOWN] = "unknown",
@@ -33,31 +34,8 @@ static enum bootsource bootsource = BOOTSOURCE_UNKNOWN;
 static int bootsource_instance = BOOTSOURCE_INSTANCE_UNKNOWN;
 const char *bootsource_alias_name = NULL;
 
-/**
- * bootsource_get_alias_name() - Get the name of the bootsource alias
- *
- * This function will return newly allocated string containing name of
- * the alias that is expected to point to DTB node corresponding to
- * detected bootsource
- *
- * NOTE: Caller is expected to free() the string allocated by this
- * function
- */
-char *bootsource_get_alias_name(void)
+static const char *bootsource_get_of_stem(void)
 {
-	const char *stem;
-
-	/*
-	 * If alias name was overridden via
-	 * bootsource_set_alias_name() return that value without
-	 * asking any questions.
-	 *
-	 * Note that we have to strdup() the result to make it
-	 * free-able.
-	 */
-	if (bootsource_alias_name)
-		return strdup(bootsource_alias_name);
-
 	switch (bootsource) {
 		/*
 		 * For I2C and SPI EEPROMs we set the stem to be 'i2c'
@@ -69,22 +47,50 @@ char *bootsource_get_alias_name(void)
 		 * controller
 		 */
 	case BOOTSOURCE_I2C_EEPROM:
-		stem = bootsource_str[BOOTSOURCE_I2C];
+		return bootsource_str[BOOTSOURCE_I2C];
 		break;
 	case BOOTSOURCE_SPI_EEPROM:
 	case BOOTSOURCE_SPI_NOR:
-		stem = bootsource_str[BOOTSOURCE_SPI];
+		return bootsource_str[BOOTSOURCE_SPI];
 		break;
 	case BOOTSOURCE_SERIAL:	/* FALLTHROUGH */
 	case BOOTSOURCE_I2C:	/* FALLTHROUGH */
 	case BOOTSOURCE_MMC:	/* FALLTHROUGH */
 	case BOOTSOURCE_SPI:	/* FALLTHROUGH */
 	case BOOTSOURCE_CAN:
-		stem = bootsource_str[bootsource];
+		return bootsource_str[bootsource];
 		break;
 	default:
 		return NULL;
 	}
+}
+
+/**
+ * bootsource_get_alias_name() - Get the name of the bootsource alias
+ *
+ * This function will return newly allocated string containing name of
+ * the alias that is expected to point to DTB node corresponding to
+ * detected bootsource
+ *
+ * NOTE: Caller is expected to free() the string allocated by this
+ * function
+ */
+char *bootsource_get_alias_name(void)
+{
+	const char *stem;
+
+	/*
+	 * If alias name was overridden via
+	 * bootsource_set_alias_name() return that value without
+	 * asking any questions.
+	 *
+	 * Note that we have to strdup() the result to make it
+	 * free-able.
+	 */
+	if (bootsource_alias_name)
+		return strdup(bootsource_alias_name);
+
+	stem = bootsource_get_of_stem();
 
 	/*
 	 * We expect SoC specific bootsource detection code to properly
@@ -125,6 +131,20 @@ void bootsource_set_instance(int instance)
 	setenv("bootsource_instance", buf);
 }
 
+void bootsource_set_instance_by_of_name(const char *name)
+{
+	int instance = BOOTSOURCE_UNKNOWN;
+	struct device_node *node;
+
+	node = of_find_node_by_name(of_get_root_node(), name);
+	if (node) {
+		instance = of_alias_get_id(node, bootsource_get_of_stem());
+		if (instance < 0)
+			instance = BOOTSOURCE_UNKNOWN;
+	}
+	bootsource_set_instance(instance);
+}
+
 enum bootsource bootsource_get(void)
 {
 	return bootsource;
include/bootsource.h +0 -0
index 646b0e91c..4dcb969ac 100644

include/bootsource.h enum bootsource bootsource_get(void); · line 34

Quoted 7 lines
include/bootsource.h +1 -0
@@ -28,6 +28,7 @@ enum bootsource bootsource_get(void);
 int bootsource_get_instance(void);
 void bootsource_set(enum bootsource src);
 void bootsource_set_instance(int instance);
+void bootsource_set_instance_by_of_name(const char *name);
 void bootsource_set_alias_name(const char *name);
 char *bootsource_get_alias_name(void);
 

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#7 lore raw

Re: [RFC PATCH] bootsource: add helper to set instance by name

In reply to Michael Riesch
Quoted 2 lines · Michael Riesch

Instance numbers should be related to device tree aliases, which may be board-specific.

When instance numbers were introduced they were meant to be SoC specific, i.e. they should correspond to the numbers in the manual. When starting with device tree aliases the alias numbers were assumed to match the numbers in the manual. On i.MX this is still mostly true, but on (most?) other SoCs it is not. In barebox we have several users of bootsource_get_instance() which rely on the instance being the hardware instance number, so we can't just change that.

If we have to keep track of both hardware numbers and alias numbers we have to store both separately and not change the meaning of the existing instance number.

Thinking this further I don't think the alias is worth anything because it may differ between the barebox internal device tree and the one the kernel is booted with. We should rather store the device node providing the bootsource. From that we can retrieve the alias matching a given device tree if we still need it.

That said, I don't know a good way how we get there from our existing codebase.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 2/3 net: designware: rockchip: remove unnecessary clock pclk_xpcs

In reply to Michael Riesch

The pclk_xpcs clock is not used in the mainline Linux driver and only rarely specified in the mainline dts files. Drop it in order to avoid errors when the mainline dts files are used.

---
 drivers/net/designware_rockchip.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/designware_rockchip.c +0 -2
index e4f74f646..7acbd723b 100644
@@ -44,7 +44,6 @@ enum {
 	CLK_MAC_PCLK,
 	CLK_MAC_SPEED,
 	CLK_PTP_REF,
-	CLK_XPCS_PCLK,
 };
 
 static const struct clk_bulk_data rk_gmac_clks[] = {
@@ -56,7 +55,6 @@ static const struct clk_bulk_data rk_gmac_clks[] = {
 	[CLK_MAC_PCLK]    = { .id = "pclk_mac" },
 	[CLK_MAC_SPEED]   = { .id = "clk_mac_speed" },
 	[CLK_PTP_REF]     = { .id = "ptp_ref" },
-	[CLK_XPCS_PCLK]   = { .id = "pclk_xpcs" },
 };
 
 static inline struct eqos_rk_gmac *to_rk_gmac(struct eqos *eqos)
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

Re: [PATCH 2/3] net: designware: rockchip: remove unnecessary clock pclk_xpcs

Hello Sascha,

Quoted 5 lines · Michael Riesch

The pclk_xpcs clock is not used in the mainline Linux driver and only rarely specified in the mainline dts files. Drop it in order to avoid errors when the mainline dts files are used.

Can you cherry-pick this one patch? I have code depending on it.

Quoted 25 lines
---
 drivers/net/designware_rockchip.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/designware_rockchip.c +0 -2
index e4f74f646..7acbd723b 100644
@@ -44,7 +44,6 @@ enum {
 	CLK_MAC_PCLK,
 	CLK_MAC_SPEED,
 	CLK_PTP_REF,
-	CLK_XPCS_PCLK,
 };
 
 static const struct clk_bulk_data rk_gmac_clks[] = {
@@ -56,7 +55,6 @@ static const struct clk_bulk_data rk_gmac_clks[] = {
 	[CLK_MAC_PCLK]    = { .id = "pclk_mac" },
 	[CLK_MAC_SPEED]   = { .id = "clk_mac_speed" },
 	[CLK_PTP_REF]     = { .id = "ptp_ref" },
-	[CLK_XPCS_PCLK]   = { .id = "pclk_xpcs" },
 };
 
 static inline struct eqos_rk_gmac *to_rk_gmac(struct eqos *eqos)
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

Re: [PATCH 2/3] net: designware: rockchip: remove unnecessary clock pclk_xpcs

Quoted 10 lines · Ahmad Fatoum

Hello Sascha,

Quoted 5 lines · Michael Riesch

The pclk_xpcs clock is not used in the mainline Linux driver and only rarely specified in the mainline dts files. Drop it in order to avoid errors when the mainline dts files are used.

Can you cherry-pick this one patch? I have code depending on it.

Did that.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

PATCH 3/3 pinctrl: rockchip: use alias rather than full of name

In reply to Michael Riesch

Do not rely on GPIO controllers being named "gpioX". Instead, use the alias to match the controllers to the GPIO banks.

---
 drivers/pinctrl/pinctrl-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-rockchip.c +1 -1
index 1fdb9a913..0e706c51d 100644
@@ -888,7 +888,7 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
 		bank = ctrl->pin_banks;
 		for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
 			name = bank->name;
-			if (!strncmp(name, np->name, strlen(name))) {
+			if (!strncmp(name, of_alias_get(np), strlen(name))) {
 				bank->of_node = np;
 				if (!rockchip_get_bank_data(bank, dev))
 					bank->valid = true;
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

Re: [PATCH 3/3] pinctrl: rockchip: use alias rather than full of name

Quoted 13 lines · Michael Riesch

Do not rely on GPIO controllers being named "gpioX". Instead, use the alias to match the controllers to the GPIO banks.

---
 drivers/pinctrl/pinctrl-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-rockchip.c +0 -0
index 1fdb9a913..0e706c51d 100644

drivers/pinctrl/pinctrl-rockchip.c static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( · line 891

Quoted 5 lines
drivers/pinctrl/pinctrl-rockchip.c +1 -1
@@ -888,7 +888,7 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
 		bank = ctrl->pin_banks;
 		for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
 			name = bank->name;
-			if (!strncmp(name, np->name, strlen(name))) {
+			if (!strncmp(name, of_alias_get(np), strlen(name))) {

Please use of_alias_get_id(np, "gpio");

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#13 lore raw

Re: [PATCH 3/3] pinctrl: rockchip: use alias rather than full of name

Hello Sascha,

Quoted 9 lines · Sascha Hauer
Quoted 8 lines · Michael Riesch

Do not rely on GPIO controllers being named "gpioX". Instead, use the alias to match the controllers to the GPIO banks.

---
  drivers/pinctrl/pinctrl-rockchip.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/pinctrl/pinctrl-rockchip.c static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( · line 891

Quoted 10 lines
drivers/pinctrl/pinctrl-rockchip.c +1 -1
index 1fdb9a913..0e706c51d 100644
@@ -888,7 +888,7 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
  		bank = ctrl->pin_banks;
  		for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
  			name = bank->name;
-			if (!strncmp(name, np->name, strlen(name))) {
+			if (!strncmp(name, of_alias_get(np), strlen(name))) {

Please use of_alias_get_id(np, "gpio");

OK! v2 in preparation.

Best regards,
Michael

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox