On 2020/2/18 17:05, Heiko Schocher <[email protected]<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 <[email protected]<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(-) > > diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c > 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? > @@ -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); > > #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); > > +/** > + * 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. > + */ remove or keep pio_map[5] in uboot dts, which is better? > + > +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. > + { /* 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) > + .flags = DM_FLAG_PRE_RELOC, > +#endif > +}; > +#endif > diff --git a/include/fsl_qe.h b/include/fsl_qe.h index d4eba82436..cb5c91bdf1 > 100644 > --- a/include/fsl_qe.h > +++ b/include/fsl_qe.h > @@ -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__ */ I don’t find this function is called anywhere. > -- > 2.24.1 Best Regards Qiang Zhao

