Re: pardon me

2023-07-07 Thread Peter J. Philipp
On Fri, Jul 07, 2023 at 03:36:22PM +0200, Mark Kettenis wrote:
> > Date: Fri, 7 Jul 2023 15:30:37 +0200
> > From: "Peter J. Philipp" 
> > 
> > I'm looking into considering adding pins for the mango pi SBC (riscv64) and
> > noticed this little file that has no license:
> > 
> > --->
> > riscv64# head /sys/dev/fdt/sxipio_pins.h
> > /* Public Domain */
> > 
> > 
> > const struct sxipio_pin sun4i_a10_pins[] = {
> > { SXIPIO_PIN(A, 0), {
> > { "gpio_in", 0 },
> > { "gpio_out", 1 },
> > { "emac", 2 },
> > { "spi1", 3 },
> > { "uart2", 4 },
> > <---
> > 
> > Where does this file come from?  how is it generated?
> 
> https://github.com/kettenis/sxipins
> 
> > If anyone also knows the pins for the mango pi D1 in form of
> > documentation anywhere (perhaps you're working on it or not) and
> > wants to share I'd be grateful.
> 
> The docs for the allwinner SoCs tends to be publically available and
> contain the information about the pins.
> 

Hi Mark,

Thank you!  That is great, do you prefer a pull request or just a diff?  I took
the information from 6.4.2 kernel and tied it in with your sources with minor
changes.  Inline is the diff in case you want to see the changes without
pull request:

Best Regards,
-peter

-- 
Over thirty years experience on Unix-like Operating Systems starting with QNX.


diff --git a/Makefile b/Makefile
index fca3aab..2dcca97 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,8 @@ SRCS=   sxipins.c \
pinctrl-sun8i-h3-r.c pinctrl-sun8i-h3.c \
pinctrl-sun8i-a33.c \
pinctrl-sun5i.c \
-   pinctrl-sun4i-a10.c
+   pinctrl-sun4i-a10.c \
+   pinctrl-sun20i-d1.c
 
 CPPFLAGS+= -I${.CURDIR}
 
diff --git a/pinctrl-sunxi.h b/pinctrl-sunxi.h
index e340d2a..01bba46 100644
--- a/pinctrl-sunxi.h
+++ b/pinctrl-sunxi.h
@@ -91,6 +91,10 @@
 #define PINCTRL_SUN7I_A20  BIT(7)
 #define PINCTRL_SUN8I_R40  BIT(8)
 
+/* Variants below here have an updated register layout. */
+#define PINCTRL_SUN20I_D1  BIT(11)
+
+
 struct sunxi_desc_function {
unsigned long   variant;
const char  *name;
diff --git a/sxipins.c b/sxipins.c
index 6d459ec..ff13195 100644
--- a/sxipins.c
+++ b/sxipins.c
@@ -86,6 +86,9 @@ driver_register(struct platform_driver *driver, const char 
*name)
case PINCTRL_SUN8I_R40:
pdev.name = "sun8i_r40_pinctrl_driver";
break;
+   case PINCTRL_SUN20I_D1:
+   pdev.name = "sun20i_d1_pinctrl_driver";
+   break;
default:
pdev.name = name;
break;



Re: pardon me

2023-07-07 Thread Mark Kettenis
> Date: Fri, 7 Jul 2023 15:30:37 +0200
> From: "Peter J. Philipp" 
> 
> I'm looking into considering adding pins for the mango pi SBC (riscv64) and
> noticed this little file that has no license:
> 
> --->
> riscv64# head /sys/dev/fdt/sxipio_pins.h
> /* Public Domain */
> 
> 
> const struct sxipio_pin sun4i_a10_pins[] = {
> { SXIPIO_PIN(A, 0), {
> { "gpio_in", 0 },
> { "gpio_out", 1 },
> { "emac", 2 },
> { "spi1", 3 },
> { "uart2", 4 },
> <---
> 
> Where does this file come from?  how is it generated?

https://github.com/kettenis/sxipins

> If anyone also knows the pins for the mango pi D1 in form of
> documentation anywhere (perhaps you're working on it or not) and
> wants to share I'd be grateful.

The docs for the allwinner SoCs tends to be publically available and
contain the information about the pins.



pardon me

2023-07-07 Thread Peter J. Philipp
I'm looking into considering adding pins for the mango pi SBC (riscv64) and
noticed this little file that has no license:

--->
riscv64# head /sys/dev/fdt/sxipio_pins.h
/* Public Domain */


const struct sxipio_pin sun4i_a10_pins[] = {
{ SXIPIO_PIN(A, 0), {
{ "gpio_in", 0 },
{ "gpio_out", 1 },
{ "emac", 2 },
{ "spi1", 3 },
{ "uart2", 4 },
<---

Where does this file come from?  how is it generated?  If anyone also knows
the pins for the mango pi D1 in form of documentation anywhere (perhaps you're
working on it or not) and wants to share I'd be grateful.

Best Regards,
-peter

-- 
Over thirty years experience on Unix-like Operating Systems starting with QNX.