[linux-sunxi] Re: [PATCH] usb: musb-new: Extend Allwinner quirk to newer SoCs

2021-04-26 Thread Marek Vasut

On 4/27/21 2:03 AM, Andre Przywara wrote:

As the comment in musb_regs.h describes, Allwinner saves the
MUSB_CONFIGDATA register, which always return 0 on those SoCs.

This is also true for the H6 and H616, so extend the quirk to those
controllers as well.

This fixes USB peripheral mode on H6 and H616 boards.

Signed-off-by: Andre Przywara 
---
  drivers/usb/musb-new/musb_regs.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb-new/musb_regs.h b/drivers/usb/musb-new/musb_regs.h
index c4d7203b851..bee1b715a95 100644
--- a/drivers/usb/musb-new/musb_regs.h
+++ b/drivers/usb/musb-new/musb_regs.h
@@ -432,7 +432,8 @@ static inline u8 musb_read_ulpi_buscontrol(void __iomem 
*mbase)
  static inline u8 musb_read_configdata(void __iomem *mbase)
  {
  #if defined CONFIG_MACH_SUN8I_A33 || defined CONFIG_MACH_SUN8I_A83T || \
-   defined CONFIG_MACH_SUNXI_H3_H5 || defined CONFIG_MACH_SUN50I
+   defined CONFIG_MACH_SUNXI_H3_H5 || defined CONFIG_MACH_SUN50I || \
+   defined CONFIG_SUN50I_GEN_H6


Isn't there some better solution then ever-growing list of macros to 
check, like e.g. a single CONFIG_MACH_SUNXI ?


--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/fece3df8-b2d5-ab42-13b6-94d4f04bfc4a%40denx.de.


[linux-sunxi] [PATCH] usb: musb-new: Extend Allwinner quirk to newer SoCs

2021-04-26 Thread Andre Przywara
As the comment in musb_regs.h describes, Allwinner saves the
MUSB_CONFIGDATA register, which always return 0 on those SoCs.

This is also true for the H6 and H616, so extend the quirk to those
controllers as well.

This fixes USB peripheral mode on H6 and H616 boards.

Signed-off-by: Andre Przywara 
---
 drivers/usb/musb-new/musb_regs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb-new/musb_regs.h b/drivers/usb/musb-new/musb_regs.h
index c4d7203b851..bee1b715a95 100644
--- a/drivers/usb/musb-new/musb_regs.h
+++ b/drivers/usb/musb-new/musb_regs.h
@@ -432,7 +432,8 @@ static inline u8 musb_read_ulpi_buscontrol(void __iomem 
*mbase)
 static inline u8 musb_read_configdata(void __iomem *mbase)
 {
 #if defined CONFIG_MACH_SUN8I_A33 || defined CONFIG_MACH_SUN8I_A83T || \
-   defined CONFIG_MACH_SUNXI_H3_H5 || defined CONFIG_MACH_SUN50I
+   defined CONFIG_MACH_SUNXI_H3_H5 || defined CONFIG_MACH_SUN50I || \
+   defined CONFIG_SUN50I_GEN_H6
/*  allwinner saves a reg, and we need to hardcode this */
return 0xde;
 #else
-- 
2.17.5

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210427000323.18285-1-andre.przywara%40arm.com.


Re: [linux-sunxi] [PATCH] sunxi: board: Add H616 MMC2 pins

2021-04-26 Thread Jernej Škrabec
Dne ponedeljek, 26. april 2021 ob 14:14:46 CEST je Andre Przywara napisal(a):
> We hardcode the pinctrl setting for the MMC controllers in boards.c,
> since we need them also in the SPL, where there is no DT yet.
> 
> Add the respective setting for the H616 SoC, to enable eMMC on boards
> with this SoC as well.
> Also to make diagnosing this problem easier, print a warning if a board
> tries to setup MMC2 pins without a respective SoC setting being defined.
> 
> Signed-off-by: Andre Przywara 

Reviewed-by: Jernej Skrabec 

Best regards,
Jernej



-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/3812926.Gie0PPOfKQ%40kista.


[linux-sunxi] Re: [GIT PULL] sunxi: Remaining v2021.07 merge window changes

2021-04-26 Thread Tom Rini
On Mon, Apr 26, 2021 at 11:50:58AM +0100, Andre Przywara wrote:

> 
> Hi Tom,
> 
> please pull this branch, containing the late part of the 2021.07 changes.
> 
> This fixes the broken H5 Ethernet and updates the R40 and A64 DT files,
> so nothing really critical.
> 
> Build-tested for all 156 sunxi boards, and boot tested on a A64, R40, H5
> and H616 board. USB, SD card, eMMC, HDMI and Ethernet all work there
> (where applicable).
> 
> Thanks,
> Andre
> 
> =
> The following changes since commit 4dda435131251a94b29afd52f010cf1ec5a7ceb2:
> 
>   Merge tag 'mips-pull-2021-04-24' of 
> https://source.denx.de/u-boot/custodians/u-boot-mips (2021-04-24 19:39:14 
> -0400)
> 
> are available in the Git repository at:
> 
>   https://source.denx.de/u-boot/custodians/u-boot-sunxi.git master
> 
> for you to fetch changes up to 647b392bf20614006917d5fcd3390347a668eee5:
> 
>   sunxi: DT: A64: Update devicetree files from Linux 5.12 (2021-04-26 
> 10:12:35 +0100)
> 

Applied to u-boot/master, thanks!

-- 
Tom

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210426150357.GG17669%40bill-the-cat.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH] sunxi: board: Add H616 MMC2 pins

2021-04-26 Thread Jagan Teki
On Mon, Apr 26, 2021 at 5:45 PM Andre Przywara  wrote:
>
> We hardcode the pinctrl setting for the MMC controllers in boards.c,
> since we need them also in the SPL, where there is no DT yet.
>
> Add the respective setting for the H616 SoC, to enable eMMC on boards
> with this SoC as well.
> Also to make diagnosing this problem easier, print a warning if a board
> tries to setup MMC2 pins without a respective SoC setting being defined.
>
> Signed-off-by: Andre Przywara 
> ---

Reviewed-by: Jagan Teki 

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAMty3ZC8nEDZjsmigoSDCzqpJFwrQR30xHXnm9aUve2jROQ32A%40mail.gmail.com.


[linux-sunxi] Re: [PATCH] sunxi: Bring back SD card as MMC device 0

2021-04-26 Thread Jagan Teki
On Mon, Apr 26, 2021 at 4:57 PM Andre Przywara  wrote:
>
> On Sun, 25 Apr 2021 18:03:05 +0530
> Jagan Teki  wrote:
>
> Hi Jagan,
>
> thanks for your input!
>
> > On Sun, Apr 25, 2021 at 3:30 PM Andre Przywara  
> > wrote:
> > >
> > > On Fri, 16 Apr 2021 12:08:09 +0100
> > > Andre Przywara  wrote:
> > >
> > > Hi,
> > >
> > > > Commit 2243d19e5618 ("mmc: mmc-uclass: Use dev_seq() to read aliases
> > > > node's index") now actually enforces U-Boot's device enumeration policy,
> > > > where explicitly named devices come first, then any other non-named
> > > > devices follow, without filling gaps.
> > > >
> > > > For quite a while we have had an "mmc1 = " alias in our
> > > > sunxi-u-boot.dtsi, which now leads to the problem that the SD card
> > > > (which was always mmc device 0) now gets to be number 2.
> > > > I guess this breaks quite some boot scripts, and is confusing at least.
> > > >
> > > > Just add an explicit mmc0 alias in the very same file to fix this and
> > > > restore the old behaviour.
> > >
> > > Can someone please say if this is the right solution?
> > > I think the SD card has always been mmc device 0 in U-Boot, so I think
> > > it's worth keeping that. Just not sure if this is the right way of
> > > fixing that?
> >
> > Playing with aliases always gets confused and might get a different
> > behavior, IMHO.
>
> I am not so sure about that, since aliases force a fixed numbering, so
> it should be less confusing. We have the same problem in the kernel
> now, and Samuel sent some patches to have aliases in the mainline DTs
> as well [1].

Okay.

>
> > Detect the dev number by U-Boot itself and look at
> > traverse bootenv by all possible dev numbers in sunxi-common.h, but
>
> OK, I will have a look at how the automatic distro boot behaves with
> this change. My concern was more the interactive user, who is used to
> have the SD card at device 0 (I certainly am).
>
> > this has one slide effect that we mark mmc2 as devnum 1 for the sake
> > of fastboot so if we mark fastboot number for specific board properly
> > (by static or runtime) then explicit aliases wouldn't required.
>
> Ah, good point, thanks for the heads up. I guess this is the actual
> reason for the alias in our -u-boot.dtsi? Maybe we find a different way
> to let fastboot find the eMMC? Then we can drop the extra mmc1 alias,
> get our numbering back, and can cope with the incoming aliases from the
> mainline DTs as well?

Agreed.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAMty3ZAtOcbDZQc50OykhATDTTuNLaQFEg8ja5XQJvk5FO1eqQ%40mail.gmail.com.


[linux-sunxi] [PATCH] sunxi: board: Add H616 MMC2 pins

2021-04-26 Thread Andre Przywara
We hardcode the pinctrl setting for the MMC controllers in boards.c,
since we need them also in the SPL, where there is no DT yet.

Add the respective setting for the H616 SoC, to enable eMMC on boards
with this SoC as well.
Also to make diagnosing this problem easier, print a warning if a board
tries to setup MMC2 pins without a respective SoC setting being defined.

Signed-off-by: Andre Przywara 
---
 board/sunxi/board.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index b97ca578f7f..f825dfd7ce8 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -555,6 +555,17 @@ static void mmc_pinmux_setup(int sdc)
sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
sunxi_gpio_set_drv(pin, 2);
}
+#elif defined(CONFIG_MACH_SUN50I_H616)
+   /* SDC2: PC0-PC1, PC5-PC6, PC8-PC11, PC13-PC16 */
+   for (pin = SUNXI_GPC(0); pin <= SUNXI_GPC(16); pin++) {
+   if (pin > SUNXI_GPC(1) && pin < SUNXI_GPC(5))
+   continue;
+   if (pin == SUNXI_GPC(7) || pin == SUNXI_GPC(12))
+   continue;
+   sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
+   sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
+   sunxi_gpio_set_drv(pin, 2);
+   }
 #elif defined(CONFIG_MACH_SUN9I)
/* SDC2: PC6-PC16 */
for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(16); pin++) {
@@ -562,6 +573,8 @@ static void mmc_pinmux_setup(int sdc)
sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
sunxi_gpio_set_drv(pin, 2);
}
+#else
+   puts("ERROR: No pinmux setup defined for MMC2!\n");
 #endif
break;
 
-- 
2.17.5

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210426121446.8013-1-andre.przywara%40arm.com.


[linux-sunxi] Re: [PATCH] sunxi: Bring back SD card as MMC device 0

2021-04-26 Thread Andre Przywara
On Sun, 25 Apr 2021 18:03:05 +0530
Jagan Teki  wrote:

Hi Jagan,

thanks for your input!

> On Sun, Apr 25, 2021 at 3:30 PM Andre Przywara  wrote:
> >
> > On Fri, 16 Apr 2021 12:08:09 +0100
> > Andre Przywara  wrote:
> >
> > Hi,
> >  
> > > Commit 2243d19e5618 ("mmc: mmc-uclass: Use dev_seq() to read aliases
> > > node's index") now actually enforces U-Boot's device enumeration policy,
> > > where explicitly named devices come first, then any other non-named
> > > devices follow, without filling gaps.
> > >
> > > For quite a while we have had an "mmc1 = " alias in our
> > > sunxi-u-boot.dtsi, which now leads to the problem that the SD card
> > > (which was always mmc device 0) now gets to be number 2.
> > > I guess this breaks quite some boot scripts, and is confusing at least.
> > >
> > > Just add an explicit mmc0 alias in the very same file to fix this and
> > > restore the old behaviour.  
> >
> > Can someone please say if this is the right solution?
> > I think the SD card has always been mmc device 0 in U-Boot, so I think
> > it's worth keeping that. Just not sure if this is the right way of
> > fixing that?  
> 
> Playing with aliases always gets confused and might get a different
> behavior, IMHO.

I am not so sure about that, since aliases force a fixed numbering, so
it should be less confusing. We have the same problem in the kernel
now, and Samuel sent some patches to have aliases in the mainline DTs
as well [1].

> Detect the dev number by U-Boot itself and look at
> traverse bootenv by all possible dev numbers in sunxi-common.h, but

OK, I will have a look at how the automatic distro boot behaves with
this change. My concern was more the interactive user, who is used to
have the SD card at device 0 (I certainly am).

> this has one slide effect that we mark mmc2 as devnum 1 for the sake
> of fastboot so if we mark fastboot number for specific board properly
> (by static or runtime) then explicit aliases wouldn't required.

Ah, good point, thanks for the heads up. I guess this is the actual
reason for the alias in our -u-boot.dtsi? Maybe we find a different way
to let fastboot find the eMMC? Then we can drop the extra mmc1 alias,
get our numbering back, and can cope with the incoming aliases from the
mainline DTs as well?

Cheers,
Andre

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2021-April/652946.html

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210426122705.41904045%40slackpad.fritz.box.


[linux-sunxi] [GIT PULL] sunxi: Remaining v2021.07 merge window changes

2021-04-26 Thread Andre Przywara


Hi Tom,

please pull this branch, containing the late part of the 2021.07 changes.

This fixes the broken H5 Ethernet and updates the R40 and A64 DT files,
so nothing really critical.

Build-tested for all 156 sunxi boards, and boot tested on a A64, R40, H5
and H616 board. USB, SD card, eMMC, HDMI and Ethernet all work there
(where applicable).

Thanks,
Andre

=
The following changes since commit 4dda435131251a94b29afd52f010cf1ec5a7ceb2:

  Merge tag 'mips-pull-2021-04-24' of 
https://source.denx.de/u-boot/custodians/u-boot-mips (2021-04-24 19:39:14 -0400)

are available in the Git repository at:

  https://source.denx.de/u-boot/custodians/u-boot-sunxi.git master

for you to fetch changes up to 647b392bf20614006917d5fcd3390347a668eee5:

  sunxi: DT: A64: Update devicetree files from Linux 5.12 (2021-04-26 10:12:35 
+0100)


Andre Przywara (2):
  net: sun8i-emac: Fix pinmux setup for Allwinner H5
  sunxi: DT: A64: Update devicetree files from Linux 5.12

Ivan Uvarov (1):
  sunxi: DT: R40: Update device tree files from Linux 5.12

 arch/arm/dts/sun50i-a64-bananapi-m64.dts   |  16 +-
 arch/arm/dts/sun50i-a64-nanopi-a64.dts |   2 +-
 arch/arm/dts/sun50i-a64-orangepi-win.dts   |  10 +-
 arch/arm/dts/sun50i-a64-pine64-lts.dts |  15 +
 arch/arm/dts/sun50i-a64-pine64-plus.dts|   2 +-
 arch/arm/dts/sun50i-a64-pine64.dts |   8 +-
 arch/arm/dts/sun50i-a64-pinebook.dts   |  13 +-
 arch/arm/dts/sun50i-a64-pinephone-1.0.dts  |   7 +-
 arch/arm/dts/sun50i-a64-pinephone-1.1.dts  |   7 +-
 arch/arm/dts/sun50i-a64-pinephone-1.2.dts  |  16 +-
 arch/arm/dts/sun50i-a64-pinephone.dtsi |  90 -
 arch/arm/dts/sun50i-a64-pinetab-early-adopter.dts  |  26 ++
 arch/arm/dts/sun50i-a64-pinetab.dts|  13 +-
 arch/arm/dts/sun50i-a64-sopine-baseboard.dts   |  11 +-
 arch/arm/dts/sun50i-a64-sopine.dtsi|   3 +-
 arch/arm/dts/sun50i-a64-teres-i.dts|  12 +-
 arch/arm/dts/sun50i-a64.dtsi   |  40 ++-
 arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts   |  23 +-
 arch/arm/dts/sun8i-r40.dtsi| 375 +++--
 arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts   |  12 +-
 drivers/net/sun8i_emac.c   |   8 +-
 include/dt-bindings/clock/sun8i-r40-ccu.h  |   6 +-
 include/dt-bindings/interrupt-controller/arm-gic.h |   5 +-
 include/dt-bindings/thermal/thermal.h  |   3 +-
 24 files changed, 596 insertions(+), 127 deletions(-)
 create mode 100644 arch/arm/dts/sun50i-a64-pinetab-early-adopter.dts

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210426105058.6237-1-andre.przywara%40arm.com.