Skip to contentSkip to conversation

powerpc, qe: add DTS support for parallel I/O ports

RFC PATCH New Heiko Schocher 2 participants 6 messages Feb 18, 2020 – Apr 15, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 powerpc, qe: add DTS support for parallel I/O ports

add DM support for parallel I/O ports on QUICC Engine Block

---
Travis build:

https://travis-ci.org/hsdenx/u-boot-test/builds/651400509

Open questions / discussion:

- may we should move this part to drivers/pinctrl ?

- I let the old none DM based implementation in code so boards should work with old implementation.

This should be removed if all boards are converted to DM/DTS.

- Unfortunately linux DTS does not use "pinctrl-"
properties, instead "pio-handle" properties.

Even worser old U-Boot code initializes all pins defined in "const qe_iop_conf_t qe_iop_conf_tab[]" table in board code. As linux does the same I decided to also scan through all subnodes containing "pio-map" property and initialize them too.

The proper solution would be to check for "pio-handle" when a device is probed.

 arch/powerpc/cpu/mpc83xx/cpu_init.c |   8 ++
 arch/powerpc/cpu/mpc83xx/qe_io.c    | 193 +++++++++++++++++++++++++++-
 include/fsl_qe.h                    |   3 +
 3 files changed, 201 insertions(+), 3 deletions(-)
arch/powerpc/cpu/mpc83xx/cpu_init.c +8 -0
index af8facad53..cfcc16607c 100644
@@ -11,6 +11,9 @@
 #ifdef CONFIG_USB_EHCI_FSL
 #include <usb/ehci-ci.h>
 #endif
+#ifdef CONFIG_QE
+#include <fsl_qe.h>
+#endif
 
 #include "lblaw/lblaw.h"
 #include "elbc/elbc.h"
@@ -27,6 +30,7 @@ extern void qe_config_iopin(u8 port, u8 pin, int dir,
 extern void qe_init(uint qe_base);
 extern void qe_reset(void);
 
+#if !defined(CONFIG_PINCTRL)
 static void config_qe_ioports(void)
 {
 	u8	port, pin;
@@ -43,6 +47,7 @@ static void config_qe_ioports(void)
 	}
 }
 #endif
+#endif
 
 /*
  * Breathe some life into the CPU...
@@ -189,10 +194,13 @@ void cpu_init_f (volatile immap_t * im)
 	__raw_writel(CONFIG_SYS_OBIR, &im->sysconf.obir);
 #endif
 
+#if !defined(CONFIG_PINCTRL)
 #ifdef CONFIG_QE
 	/* Config QE ioports */
 	config_qe_ioports();
 #endif
+#endif
+
 	/* Set up preliminary BR/OR regs */
 	init_early_memctl_regs();
 
arch/powerpc/cpu/mpc83xx/qe_io.c +190 -3

209 lines not on this page · raw message

include/fsl_qe.h +3 -0
index d4eba82436..cb5c91bdf1 100644
@@ -295,4 +295,7 @@ int u_qe_firmware_resume(const struct qe_firmware *firmware,
 			 qe_map_t *qe_immrr);
 #endif
 
+#if defined(CONFIG_PINCTRL)
+int par_io_of_config(struct udevice *dev);
+#endif
 #endif /* __QE_H__ */
Signature · 1 line
2.24.1
#1 lore raw

RFC PATCH 1/1 powerpc, qe: add DTS support for parallel I/O ports

Hello Priyanka,

Am 18.02.2020 um 10:05 schrieb Heiko Schocher:

Quoted 27 lines

add DM support for parallel I/O ports on QUICC Engine Block

---
Travis build:

https://travis-ci.org/hsdenx/u-boot-test/builds/651400509

Open questions / discussion:

- may we should move this part to drivers/pinctrl ?

- I let the old none DM based implementation in code so boards should work with old implementation.

This should be removed if all boards are converted to DM/DTS.

- Unfortunately linux DTS does not use "pinctrl-"
properties, instead "pio-handle" properties.

Even worser old U-Boot code initializes all pins defined in "const qe_iop_conf_t qe_iop_conf_tab[]" table in board code. As linux does the same I decided to also scan through all subnodes containing "pio-map" property and initialize them too.

Quoted 8 lines

The proper solution would be to check for "pio-handle" when a device is probed.

  arch/powerpc/cpu/mpc83xx/cpu_init.c |   8 ++
  arch/powerpc/cpu/mpc83xx/qe_io.c    | 193 +++++++++++++++++++++++++++-
  include/fsl_qe.h                    |   3 +
  3 files changed, 201 insertions(+), 3 deletions(-)

Any comments?

Thanks!

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#2 lore raw

RFC PATCH 1/1 powerpc, qe: add DTS support for parallel I/O ports

In reply to Heiko Schocher
Quoted 44 lines · On 2020/2/18 17:05, Heiko Schocher <hs at denx.de<mailto:[email protected]>> wrote:

-----Original Message-----

From: Heiko Schocher <[email protected]>

Sent: 2020?2?18? 17:05

To: U-Boot Mailing List <[email protected]>

Cc Heiko Schocher <[email protected]>; Holger Brunck

<[email protected]>; Mario Six <[email protected]>; Qiang Zhao

<[email protected]>; Wolfgang Denk <[email protected]>

Subject: [RFC PATCH] powerpc, qe: add DTS support for parallel I/O ports

add DM support for parallel I/O ports on QUICC Engine Block

Signed-off-by Heiko Schocher <hs at denx.de<mailto:[email protected]>>

---

 arch/powerpc/cpu/mpc83xx/cpu_init.c |   8 ++
 arch/powerpc/cpu/mpc83xx/qe_io.c    | 193

+++++++++++++++++++++++++++-

 include/fsl_qe.h                    |   3 +
 3 files changed, 201 insertions(+), 3 deletions(-)
(quoted diff) +0 -0
Quoted 7 lines

b/arch/powerpc/cpu/mpc83xx/cpu_init.c

index af8facad53..cfcc16607c 100644

--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c

+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c

How about mpc85xx?

arch/powerpc/cpu/mpc83xx/cpu_init.c

Quoted 13 lines
arch/powerpc/cpu/mpc83xx/cpu_init.c +3 -0
@@ -11,6 +11,9 @@
 
 #ifdef CONFIG_USB_EHCI_FSL
 
 #include <usb/ehci-ci.h>
 
 #endif
 
+#ifdef CONFIG_QE
 
+#include <fsl_qe.h>
 
+#endif

If include this headfile, the function declaration for qe_init and qe_reset in this file should be removed as below:

extern void qe_init(uint qe_base);

extern void qe_reset(void);

Quoted 53 lines

#include "lblaw/lblaw.h"

#include "elbc/elbc.h"

(quoted diff) +21 -0
@@ -27,6 +30,7 @@ extern void qe_config_iopin(u8 port, u8 pin, int dir,
 
 extern void qe_init(uint qe_base);  extern void qe_reset(void);
 
 
 
+/**
 
+ * par_io_of_config_node  config
 
+ * @dev:     pointer to pinctrl device
 
+ * @pio:      ofnode of pinconfig property
 
+ */
 
+static int par_io_of_config_node(struct udevice *dev, ofnode pio) {
 
+   struct qe_io_platdata      *plat = dev->platdata;
 
+   volatile qepio83xx_t        *par_io = plat->base;
 
+   const unsigned int *pio_map;
 
+   int pio_map_len;
 
+
 
+   pio_map = ofnode_get_property(pio, "pio-map", &pio_map_len);
 
+   if (pio_map == NULL)
 
+            return -ENOENT;
 
+
 
+   pio_map_len /= sizeof(unsigned int);
 
+   if ((pio_map_len % 6) != 0) {
 
+            printk(KERN_ERR "pio-map format wrong!\n");
 
+            return -EINVAL;
 
+   }
 
+

Review extern void qe_config_iopin(u8 port, u8 pin, int dir,

Quoted 10 lines
(quoted diff) +5 -0
 
+   while (pio_map_len > 0) {
 
+            /*
 
+            * column pio_map[5] from linux (has_irq) not
 
+            * supported in u-boot yet.
 
+            */

remove or keep pio_map[5] in uboot dts, which is better?

Review

Quoted 11 lines
(quoted diff) +6 -0
+
 
+const struct pinctrl_ops par_io_pinctrl_ops = {
 
+   .set_state = par_io_pinctrl_set_state, };
 
+
 
+static const struct udevice_id par_io_pinctrl_match[] = {
 
+   { .compatible = "fsl,mpc8360-par_io"},

Why is fsl,mpc8360-par_io, maybe fsl,qe-par-io are more better.

Quoted 47 lines
(quoted diff) +12 -0
+   { /* sentinel */ }
 
+};
 
+
 
+U_BOOT_DRIVER(par_io_pinctrl) = {
 
+   .name = "par-io-pinctrl",
 
+   .id = UCLASS_PINCTRL,
 
+   .of_match = of_match_ptr(par_io_pinctrl_match),
 
+   .probe = par_io_pinctrl_probe,
 
+   .ofdata_to_platdata = qe_io_ofdata_to_platdata,
 
+   .platdata_auto_alloc_size = sizeof(struct qe_io_platdata),
 
+   .ops = &par_io_pinctrl_ops,
 
+#if CONFIG_IS_ENABLED(OF_CONTROL)

&& !CONFIG_IS_ENABLED(OF_PLATDATA)

arch/powerpc/cpu/mpc83xx/qe_io.c +4 -0
+   .flags        = DM_FLAG_PRE_RELOC,
 
+#endif
 
+};
 
+#endif
include/fsl_qe.h index d4eba82436..cb5c91bdf1 renamed from include/fsl_qe.h +0 -0

100644

--- a/include/fsl_qe.h

+++ b/include/fsl_qe.h

include/fsl_qe.h index d4eba82436..cb5c91bdf1 renamed from include/fsl_qe.h +0 -0
@@ -295,4 +295,7 @@ int u_qe_firmware_resume(const struct qe_firmware
 
 *firmware,
 
                     qe_map_t *qe_immrr);

include/fsl_qe.h index d4eba82436..cb5c91bdf1 int u_qe_firmware_resume(const struct qe_firmware

Quoted 10 lines
include/fsl_qe.h index d4eba82436..cb5c91bdf1 renamed from include/fsl_qe.h +2 -0
 
 #endif
 
 
 
+#if defined(CONFIG_PINCTRL)
 
+int par_io_of_config(struct udevice *dev); #endif
 
 #endif /* __QE_H__ */

I don?t find this function is called anywhere.

Quoted 3 lines

--

2.24.1

Best Regards

Qiang Zhao

#3 lore raw

RFC PATCH 1/1 powerpc, qe: add DTS support for parallel I/O ports

Hello Qiang Zhao,

Am 09.04.2020 um 08:58 schrieb Qiang Zhao:

Quoted 50 lines · On 2020/2/18 17:05, Heiko Schocher <hs at denx.de <mailto:[email protected]>> wrote:
Quoted 48 lines

-----Original Message-----

From: Heiko Schocher <[email protected]>

Sent: 2020?2?18?17:05

To: U-Boot Mailing List <[email protected]>

Cc Heiko Schocher <[email protected]>; Holger Brunck

<[email protected]>; Mario Six <[email protected]>; Qiang Zhao

<[email protected]>; Wolfgang Denk <[email protected]>

Subject: [RFC PATCH] powerpc, qe: add DTS support for parallel I/O ports

add DM support for parallel I/O ports on QUICC Engine Block

Signed-off-by Heiko Schocher <hs at denx.de <mailto:[email protected]>>

---

?arch/powerpc/cpu/mpc83xx/cpu_init.c |?? 8 ++

?arch/powerpc/cpu/mpc83xx/qe_io.c??? | 193

+++++++++++++++++++++++++++-

?include/fsl_qe.h??????????????????? |?? 3 +

?3 files changed, 201 insertions(+), 3 deletions(-)

(quoted diff) +0 -0

b/arch/powerpc/cpu/mpc83xx/cpu_init.c

index af8facad53..cfcc16607c 100644

Quoted 7 lines
Quoted 3 lines

--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c

+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c

*//*

How about mpc85xx?

Yes, this is a Todo (one reason why this patch is RFC). I currently have reworked this for the mpc83xx based keymile (now abb) boards (which are locally running with complete DM/DTS support now).

I have one mpx85xx based board I can try, but may others are working on this support, so I wanted to post my patches very early, so we can work together on it...

As my first question in patch comment is:

may we should move this part to drivers/pinctrl ?

Quoted 14 lines

arch/powerpc/cpu/mpc83xx/cpu_init.c

Quoted 13 lines
(quoted diff) +0 -0
@@ -11,6 +11,9 @@
 

?#ifdef CONFIG_USB_EHCI_FSL

?#include <usb/ehci-ci.h>

?#endif

arch/powerpc/cpu/mpc83xx/cpu_init.c +3 -0
+#ifdef CONFIG_QE
 
+#include <fsl_qe.h>
 
+#endif
Quoted 8 lines

*//*

If include this headfile, the function declaration for qe_init and qe_reset in this file should be removed as below:

extern void qe_init(uint qe_base);

extern void qe_reset(void);

Yes, of course! But this part of code I did not touch... may this needs a cleanup at all.

Quoted 61 lines
Quoted 60 lines

?#include "lblaw/lblaw.h"

?#include "elbc/elbc.h"

(quoted diff) +24 -0
@@ -27,6 +30,7 @@ extern void qe_config_iopin(u8 port, u8 pin, int dir,
 
 extern void qe_init(uint qe_base);? extern void qe_reset(void);
 
 
 
+/**
 
+ * par_io_of_config_node? config
 
+ * @dev:???? pointer to pinctrl device
 
+ * @pio:????? ofnode of pinconfig property
 
+ */
 
+static int par_io_of_config_node(struct udevice *dev, ofnode pio) {
 
+?? struct qe_io_platdata????? *plat = dev->platdata;
 
+?? volatile qepio83xx_t??????? *par_io = plat->base;
 
+?? const unsigned int *pio_map;
 
+?? int pio_map_len;
 
+
 
+?? pio_map = ofnode_get_property(pio, "pio-map", &pio_map_len);
 
+?? if (pio_map == NULL)
 
+??????????? return -ENOENT;
 
+
 
+?? pio_map_len /= sizeof(unsigned int);
 
+?? if ((pio_map_len % 6) != 0) {
 
+??????????? printk(KERN_ERR "pio-map format wrong!\n");
 
+??????????? return -EINVAL;
 
+?? }
 
+
 
+?? while (pio_map_len > 0) {
 
+??????????? /*
 
+??????????? * column pio_map[5] from linux (has_irq) not
Quoted 7 lines
Quoted 3 lines

+??????????? * supported in u-boot yet.

+??????????? */

*//*

remove or keep pio_map[5] in uboot dts, which is better?

I think we keep it as it is in linux dts. We simply ignore it (yet) in U-Boot.

Quoted 9 lines
Quoted 8 lines
(quoted diff) +4 -0
+
 
+const struct pinctrl_ops par_io_pinctrl_ops = {
 
+?? .set_state = par_io_pinctrl_set_state, };
 
+
Quoted 7 lines
Quoted 3 lines

+static const struct udevice_id par_io_pinctrl_match[] = {

+?? { .compatible = "fsl,mpc8360-par_io"},

*//*

Why is*//*fsl,mpc8360-par_io, maybe fsl,qe-par-io are more better.*//*

Yes, more common, but in Linux is already:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/dts/kmeter1.dts#n133

or
compatible = "fsl,mpc8323-qe-pario";

for board
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/dts/mpc832x_rdb.dts#n163

Unfortunately, it is more or less a mess in linux, as each board scans in board code for the node *name* not compatible entry ! See as an example:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/platforms/83xx/mpc832x_rdb.c#n198

So may we are free here, to add here a new compatible entry "fsl,qe-par-io" ? (But I want to be compatible with linux and accept the same compatible strings as linux has.)

Quoted 63 lines
Quoted 57 lines

+?? { /* sentinel */ }

(quoted diff) +11 -0
+};
 
+
 
+U_BOOT_DRIVER(par_io_pinctrl) = {
 
+?? .name = "par-io-pinctrl",
 
+?? .id = UCLASS_PINCTRL,
 
+?? .of_match = of_match_ptr(par_io_pinctrl_match),
 
+?? .probe = par_io_pinctrl_probe,
 
+?? .ofdata_to_platdata = qe_io_ofdata_to_platdata,
 
+?? .platdata_auto_alloc_size = sizeof(struct qe_io_platdata),
 
+?? .ops = &par_io_pinctrl_ops,
 
+#if CONFIG_IS_ENABLED(OF_CONTROL)

&& !CONFIG_IS_ENABLED(OF_PLATDATA)

+?? .flags??????? = DM_FLAG_PRE_RELOC,

arch/powerpc/cpu/mpc83xx/qe_io.c +3 -0
+#endif
 
+};
 
+#endif
include/fsl_qe.h index d4eba82436..cb5c91bdf1 renamed from include/fsl_qe.h +0 -0

100644

--- a/include/fsl_qe.h

+++ b/include/fsl_qe.h

include/fsl_qe.h index d4eba82436..cb5c91bdf1 renamed from include/fsl_qe.h +0 -0
@@ -295,4 +295,7 @@ int u_qe_firmware_resume(const struct qe_firmware
 
 *firmware,
 
 ??????????????????? ?qe_map_t *qe_immrr);

?#endif

include/fsl_qe.h index d4eba82436..cb5c91bdf1 renamed from include/fsl_qe.h +2 -0
+#if defined(CONFIG_PINCTRL)
 
+int par_io_of_config(struct udevice *dev); #endif
Quoted 1 line

?#endif /* __QE_H__ */

*//*

I don?t find this function is called anywhere.

Quoted 8 lines
Quoted 3 lines

--

2.24.1

Best Regards

Qiang Zhao

Thanks for your comments

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#4 lore raw

RFC PATCH 1/1 powerpc, qe: add DTS support for parallel I/O ports

On 2020/4/15 12:46 Heiko Schocher <[email protected]>

Quoted 71 lines

-----Original Message-----
From: Heiko Schocher <[email protected]>
Sent: 2020?4?15? 12:46
To: Qiang Zhao <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Holger Brunck <[email protected]>; Mario Six <[email protected]>; Wolfgang Denk <[email protected]>; Holger Brunck <[email protected]>
Subject: Re: [RFC PATCH] powerpc, qe: add DTS support for parallel I/O ports

Hello Qiang Zhao,

Am 09.04.2020 um 08:58 schrieb Qiang Zhao:

Quoted 1 line

On 2020/2/18 17:05, Heiko Schocher <hs at denx.de <mailto:[email protected]>>

Quoted 57 lines · wrote:
Quoted 47 lines

-----Original Message-----

From: Heiko Schocher <[email protected]>

Sent: 2020?2?18?17:05

To: U-Boot Mailing List <[email protected]>

Cc Heiko Schocher <[email protected]>; Holger Brunck

<[email protected]>; Mario Six <[email protected]>; Qiang Zhao

<[email protected]>; Wolfgang Denk <[email protected]>

Subject: [RFC PATCH] powerpc, qe: add DTS support for parallel I/O ports

add DM support for parallel I/O ports on QUICC Engine Block

Signed-off-by Heiko Schocher <hs at denx.de <mailto:[email protected]>>

---

?arch/powerpc/cpu/mpc83xx/cpu_init.c |?? 8 ++

?arch/powerpc/cpu/mpc83xx/qe_io.c??? | 193

+++++++++++++++++++++++++++-

?include/fsl_qe.h??????????????????? |?? 3 +

?3 files changed, 201 insertions(+), 3 deletions(-)

(quoted diff) +0 -0
Quoted 7 lines

b/arch/powerpc/cpu/mpc83xx/cpu_init.c

index af8facad53..cfcc16607c 100644

--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c

+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c

*//*

Quoted 5 lines
Quoted 1 line

How about mpc85xx?

Yes, this is a Todo (one reason why this patch is RFC). I currently have reworked this for the mpc83xx based keymile (now abb) boards (which are locally running with complete DM/DTS support now).

You mean you have tested RFC patch on your side? That's great! Would you like to push the dts patch too?

Quoted 8 lines

I have one mpx85xx based board I can try, but may others are working on this support, so I wanted to post my patches very early, so we can work together on it...

As my first question in patch comment is:

may we should move this part to drivers/pinctrl ?

Yes, it is more better to move to drivers/pinctrl.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
(quoted diff) +0 -0
@@ -11,6 +11,9 @@
 

?#ifdef CONFIG_USB_EHCI_FSL

?#include <usb/ehci-ci.h>

?#endif

arch/powerpc/cpu/mpc83xx/cpu_init.c

Quoted 5 lines
arch/powerpc/cpu/mpc83xx/cpu_init.c +3 -0
+#ifdef CONFIG_QE
 
+#include <fsl_qe.h>
 
+#endif

*//*

If include this headfile, the function declaration for qe_init and qe_reset in this file should be removed as below:

Quoted 6 lines
Quoted 3 lines

extern void qe_init(uint qe_base);

extern void qe_reset(void);

Yes, of course! But this part of code I did not touch... may this needs a cleanup at all.

Just two lines extern declaration in this file.

Quoted 65 lines
Quoted 65 lines
Quoted 64 lines

?#include "lblaw/lblaw.h"

?#include "elbc/elbc.h"

(quoted diff) +25 -0
@@ -27,6 +30,7 @@ extern void qe_config_iopin(u8 port, u8 pin, int
 dir,
 
 extern void qe_init(uint qe_base);? extern void qe_reset(void);
 
 
 
+/**
 
+ * par_io_of_config_node? config
 
+ * @dev:???? pointer to pinctrl device
 
+ * @pio:????? ofnode of pinconfig property
 
+ */
 
+static int par_io_of_config_node(struct udevice *dev, ofnode pio) {
 
+?? struct qe_io_platdata????? *plat = dev->platdata;
 
+?? volatile qepio83xx_t??????? *par_io = plat->base;
 
+?? const unsigned int *pio_map;
 
+?? int pio_map_len;
 
+
 
+?? pio_map = ofnode_get_property(pio, "pio-map", &pio_map_len);
 
+?? if (pio_map == NULL)
 
+??????????? return -ENOENT;
 
+
 
+?? pio_map_len /= sizeof(unsigned int);
 
+?? if ((pio_map_len % 6) != 0) {
 
+??????????? printk(KERN_ERR "pio-map format wrong!\n");
 
+??????????? return -EINVAL;
 
+?? }
 
+
 
+?? while (pio_map_len > 0) {
 
+??????????? /*
 
+??????????? * column pio_map[5] from linux (has_irq) not
 
+??????????? * supported in u-boot yet.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

+??????????? */

*//*

remove or keep pio_map[5] in uboot dts, which is better?

I think we keep it as it is in linux dts. We simply ignore it (yet) in U-Boot.

That's OK.

Quoted 51 lines
Quoted 10 lines
Quoted 9 lines
(quoted diff) +4 -0
+
 
+const struct pinctrl_ops par_io_pinctrl_ops = {
 
+?? .set_state = par_io_pinctrl_set_state, };
 
+
Quoted 7 lines
Quoted 3 lines

+static const struct udevice_id par_io_pinctrl_match[] = {

+?? { .compatible = "fsl,mpc8360-par_io"},

*//*

Why is*//*fsl,mpc8360-par_io, maybe fsl,qe-par-io are more better.*//*

Yes, more common, but in Linux is already:

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kerne
l.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree %2Farch%2Fpowerpc%2Fboot%2Fdts%2Fkmeter1.dts%23n133&amp;data=02% 7C01%7Cqiang.zhao%40nxp.com%7C783271f84fe043eaf21708d7e0f7df46%7 C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637225227517025151 &amp;sdata=5VZsJPI2QwZBnS5bgSDC1cTF1lKh%2BGQXHpP%2FF4jGzCU%3D& amp;reserved=0

or
compatible = "fsl,mpc8323-qe-pario";

for board
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kerne
l.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree %2Farch%2Fpowerpc%2Fboot%2Fdts%2Fmpc832x_rdb.dts%23n163&amp;data =02%7C01%7Cqiang.zhao%40nxp.com%7C783271f84fe043eaf21708d7e0f7df4 6%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637225227517025 151&amp;sdata=AwMW4NtqID9GwbM9RnZcqqDQVZ7RvuaRw5U6LFC3VWA% 3D&amp;reserved=0

Unfortunately, it is more or less a mess in linux, as each board scans in board code for the node *name* not compatible entry ! See as an example:

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kerne
l.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree %2Farch%2Fpowerpc%2Fplatforms%2F83xx%2Fmpc832x_rdb.c%23n198&amp ;data=02%7C01%7Cqiang.zhao%40nxp.com%7C783271f84fe043eaf21708d7e0 f7df46%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6372252275 17025151&amp;sdata=RG2pIeiGMFZwL16CLjRHWrvC12YBEDDi5H7kNoZXz0A %3D&amp;reserved=0

Quoted 3 lines

So may we are free here, to add here a new compatible entry "fsl,qe-par-io" ? (But I want to be compatible with linux and accept the same compatible strings as linux has.)

OK!

Best Regards
Qiang Zhao

#5 lore raw

RFC PATCH 1/1 powerpc, qe: add DTS support for parallel I/O ports

Hello Qiang Zhao,

Am 15.04.2020 um 10:10 schrieb Qiang Zhao:

Quoted 73 lines

On 2020/4/15 12:46 Heiko Schocher <[email protected]>

Quoted 71 lines

-----Original Message-----
From: Heiko Schocher <[email protected]>
Sent: 2020?4?15? 12:46
To: Qiang Zhao <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Holger Brunck <[email protected]>; Mario Six <[email protected]>; Wolfgang Denk <[email protected]>; Holger Brunck <[email protected]>
Subject: Re: [RFC PATCH] powerpc, qe: add DTS support for parallel I/O ports

Hello Qiang Zhao,

Am 09.04.2020 um 08:58 schrieb Qiang Zhao:

Quoted 1 line

On 2020/2/18 17:05, Heiko Schocher <hs at denx.de <mailto:[email protected]>>

Quoted 57 lines · wrote:
Quoted 47 lines

-----Original Message-----

From: Heiko Schocher <[email protected]>

Sent: 2020?2?18?17:05

To: U-Boot Mailing List <[email protected]>

Cc Heiko Schocher <[email protected]>; Holger Brunck

<[email protected]>; Mario Six <[email protected]>; Qiang Zhao

<[email protected]>; Wolfgang Denk <[email protected]>

Subject: [RFC PATCH] powerpc, qe: add DTS support for parallel I/O ports

add DM support for parallel I/O ports on QUICC Engine Block

Signed-off-by Heiko Schocher <hs at denx.de <mailto:[email protected]>>

---

?arch/powerpc/cpu/mpc83xx/cpu_init.c |?? 8 ++

 ?arch/powerpc/cpu/mpc83xx/qe_io.c??? | 193

+++++++++++++++++++++++++++-

?include/fsl_qe.h??????????????????? |?? 3 +

?3 files changed, 201 insertions(+), 3 deletions(-)

(quoted diff) +0 -0
Quoted 7 lines

b/arch/powerpc/cpu/mpc83xx/cpu_init.c

index af8facad53..cfcc16607c 100644

--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c

+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c

*//*

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

How about mpc85xx?

Yes, this is a Todo (one reason why this patch is RFC). I currently have reworked this for the mpc83xx based keymile (now abb) boards (which are locally running with complete DM/DTS support now).

You mean you have tested RFC patch on your side? That's great!

Yes, on the following boards:

"kmcoge5ne tuxx1 kmopti2 kmtegr1 tuge1 kmsupx5"

Not all in mainline (yet)

@Holger: should/could we mainline the missing ones?

This boards work with full DM/DTS support now, and have no compiletime warnign like:

===================== WARNING ====================== This board does not use CONFIG_DM_ETH (Driver Model

anymore...

Quoted 1 line

Would you like to push the dts patch too?

Yes, but give me some time, until I can test the changed patchset again.

Quoted 9 lines
Quoted 7 lines

I have one mpx85xx based board I can try, but may others are working on this support, so I wanted to post my patches very early, so we can work together on it...

As my first question in patch comment is:

may we should move this part to drivers/pinctrl ?

Yes, it is more better to move to drivers/pinctrl.

Ok, I must look into it.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 5 lines
(quoted diff) +0 -0
@@ -11,6 +11,9 @@
 
 ?#ifdef CONFIG_USB_EHCI_FSL

Review

Quoted 10 lines
(quoted diff) +3 -0
 
 ?#include <usb/ehci-ci.h>
 
 ?#endif
 
+#ifdef CONFIG_QE
 
+#include <fsl_qe.h>
 
+#endif

*//*

If include this headfile, the function declaration for qe_init and qe_reset in this file should be removed as below:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

extern void qe_init(uint qe_base);

extern void qe_reset(void);

Yes, of course! But this part of code I did not touch... may this needs a cleanup at all.

Just two lines extern declaration in this file.

I remove them in seperate patch.

Quoted 127 lines
Quoted 66 lines
Quoted 66 lines
Quoted 65 lines

?#include "lblaw/lblaw.h"

?#include "elbc/elbc.h"

(quoted diff) +25 -0
@@ -27,6 +30,7 @@ extern void qe_config_iopin(u8 port, u8 pin, int
 dir,
 
 extern void qe_init(uint qe_base);? extern void qe_reset(void);
 
 
 
+/**
 
+ * par_io_of_config_node? config
 
+ * @dev:???? pointer to pinctrl device
 
+ * @pio:????? ofnode of pinconfig property
 
+ */
 
+static int par_io_of_config_node(struct udevice *dev, ofnode pio) {
 
+?? struct qe_io_platdata????? *plat = dev->platdata;
 
+?? volatile qepio83xx_t??????? *par_io = plat->base;
 
+?? const unsigned int *pio_map;
 
+?? int pio_map_len;
 
+
 
+?? pio_map = ofnode_get_property(pio, "pio-map", &pio_map_len);
 
+?? if (pio_map == NULL)
 
+??????????? return -ENOENT;
 
+
 
+?? pio_map_len /= sizeof(unsigned int);
 
+?? if ((pio_map_len % 6) != 0) {
 
+??????????? printk(KERN_ERR "pio-map format wrong!\n");
 
+??????????? return -EINVAL;
 
+?? }
 
+
 
+?? while (pio_map_len > 0) {
 
+??????????? /*
 
+??????????? * column pio_map[5] from linux (has_irq) not
 
+??????????? * supported in u-boot yet.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

+??????????? */

*//*

remove or keep pio_map[5] in uboot dts, which is better?

I think we keep it as it is in linux dts. We simply ignore it (yet) in U-Boot.

That's OK.

Quoted 51 lines
Quoted 10 lines
Quoted 9 lines
(quoted diff) +4 -0
+
 
+const struct pinctrl_ops par_io_pinctrl_ops = {
 
+?? .set_state = par_io_pinctrl_set_state, };
 
+
Quoted 7 lines
Quoted 3 lines

+static const struct udevice_id par_io_pinctrl_match[] = {

+?? { .compatible = "fsl,mpc8360-par_io"},

*//*

Why is*//*fsl,mpc8360-par_io, maybe fsl,qe-par-io are more better.*//*

Yes, more common, but in Linux is already:

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kerne
l.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree %2Farch%2Fpowerpc%2Fboot%2Fdts%2Fkmeter1.dts%23n133&amp;data=02% 7C01%7Cqiang.zhao%40nxp.com%7C783271f84fe043eaf21708d7e0f7df46%7 C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637225227517025151 &amp;sdata=5VZsJPI2QwZBnS5bgSDC1cTF1lKh%2BGQXHpP%2FF4jGzCU%3D& amp;reserved=0

or
compatible = "fsl,mpc8323-qe-pario";

for board
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kerne
l.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree %2Farch%2Fpowerpc%2Fboot%2Fdts%2Fmpc832x_rdb.dts%23n163&amp;data =02%7C01%7Cqiang.zhao%40nxp.com%7C783271f84fe043eaf21708d7e0f7df4 6%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637225227517025 151&amp;sdata=AwMW4NtqID9GwbM9RnZcqqDQVZ7RvuaRw5U6LFC3VWA% 3D&amp;reserved=0

Unfortunately, it is more or less a mess in linux, as each board scans in board code for the node *name* not compatible entry ! See as an example:

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kerne
l.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Ftree %2Farch%2Fpowerpc%2Fplatforms%2F83xx%2Fmpc832x_rdb.c%23n198&amp ;data=02%7C01%7Cqiang.zhao%40nxp.com%7C783271f84fe043eaf21708d7e0 f7df46%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6372252275 17025151&amp;sdata=RG2pIeiGMFZwL16CLjRHWrvC12YBEDDi5H7kNoZXz0A %3D&amp;reserved=0

Quoted 9 lines
Quoted 3 lines

So may we are free here, to add here a new compatible entry "fsl,qe-par-io" ? (But I want to be compatible with linux and accept the same compatible strings as linux has.)

OK!

Best Regards
Qiang Zhao

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de