Skip to contentSkip to conversation

sun50i: a64: add support for axp803, musb

PATCH New Jagan Teki 6 participants 40 messages Dec 12, 2017 – Dec 14, 2017

Subsystems (7)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

cover sun50i: a64: add support for axp803, musb

This series deals axp803, musb and related improvements on a64
- axp803 PMIC support used by a64
- a64 musb improvements (rework by Philipp [1])
- musb support for bananapi-m64, a64-olinuxino

[1] https://patchwork.ozlabs.org/patch/729246/

Jagan Teki (11):
power: sunxi: add AXP803 PMIC support
sunxi: adjust usb bases between H3_H5 vs a64
musb-new: sunxi: add common SUNXI_MUSB_BASE
sunxi: usb_phy: Update a64 sunxi_usb_phy base
arm64: allwinner: sync bananapi-m64 usb nodes from Linux
configs: sun50i: add usb-otg support for bananapi-m64
configs: sun50i: enable ums on bananapi-m64
arm64: allwinner: sync a64-olinuxino usb nodes from Linux
configs: sun50i: add usb-otg support for a64-olinuxino
configs: sun50i: enable ums on a64-olinuxino
configs: sun50i: Enable eMMC on a64-olinuxino

Philipp Tomsich (5):
sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)
musb-new: sunxi: a64: add support to select shared phy
musb-new: sunxi: a64: adds support for clearing the SIDDP
usb: sunxi: set up usb_phy_passby only for HCI
sunxi: clock: update a64 usb clock gating and module reset bits

 arch/arm/dts/sun50i-a64-bananapi-m64.dts      |  27 +++
 arch/arm/dts/sun50i-a64-olinuxino.dts         |  19 ++
 arch/arm/include/asm/arch-sunxi/clock_sun6i.h |  16 +-
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h   |   6 +
 arch/arm/include/asm/arch-sunxi/usb_phy.h     |   2 +
 arch/arm/mach-sunxi/Makefile                  |   9 +
 arch/arm/mach-sunxi/pmic_bus.c                |   9 +-
 arch/arm/mach-sunxi/rsb.c                     |   2 +-
 arch/arm/mach-sunxi/usb_phy.c                 |  24 ++-
 board/sunxi/board.c                           |  40 ++++
 configs/a64-olinuxino_defconfig               |   6 +
 configs/bananapi_m64_defconfig                |   4 +
 drivers/power/Kconfig                         |  95 +++++++---
 drivers/power/Makefile                        |   3 +
 drivers/power/axp803.c                        | 260 ++++++++++++++++++++++++++
 drivers/usb/host/ehci-sunxi.c                 |  10 +
 drivers/usb/host/ohci-sunxi.c                 |  10 +
 drivers/usb/musb-new/musb_regs.h              |   3 +-
 drivers/usb/musb-new/sunxi.c                  |  24 ++-
 include/axp803.h                              |  68 +++++++
 include/axp_pmic.h                            |   4 +
 include/configs/sun50i.h                      |   2 +-
 22 files changed, 598 insertions(+), 45 deletions(-)
 create mode 100644 drivers/power/axp803.c
 create mode 100644 include/axp803.h
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/16 power: sunxi: add AXP803 PMIC support

AXP803 another PMIC produced by x-powers and paired with A64 via RSB bus.

unlike other axp chip's support in SPL this is only added for U-Boot proper since SPL on A64 has no space to add anything.

---
 arch/arm/mach-sunxi/Makefile   |   9 ++
 arch/arm/mach-sunxi/pmic_bus.c |   9 +-
 arch/arm/mach-sunxi/rsb.c      |   2 +-
 board/sunxi/board.c            |  40 +++++++
 drivers/power/Kconfig          |  95 ++++++++++-----
 drivers/power/Makefile         |   3 +
 drivers/power/axp803.c         | 260 +++++++++++++++++++++++++++++++++++++++++
 include/axp803.h               |  68 +++++++++++
 include/axp_pmic.h             |   4 +
 9 files changed, 458 insertions(+), 32 deletions(-)
 create mode 100644 drivers/power/axp803.c
 create mode 100644 include/axp803.h
arch/arm/mach-sunxi/Makefile +9 -0
index 2a3c379..aedf22f 100644
@@ -19,9 +19,15 @@ endif
 obj-$(CONFIG_MACH_SUN6I)	+= prcm.o
 obj-$(CONFIG_MACH_SUN8I)	+= prcm.o
 obj-$(CONFIG_MACH_SUN9I)	+= prcm.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_MACH_SUN50I)	+= prcm.o
+endif
 obj-$(CONFIG_MACH_SUN6I)	+= p2wi.o
 obj-$(CONFIG_MACH_SUN8I)	+= rsb.o
 obj-$(CONFIG_MACH_SUN9I)	+= rsb.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_MACH_SUN50I)	+= rsb.o
+endif
 obj-$(CONFIG_MACH_SUN4I)	+= clock_sun4i.o
 obj-$(CONFIG_MACH_SUN5I)	+= clock_sun4i.o
 obj-$(CONFIG_MACH_SUN6I)	+= clock_sun6i.o
@@ -38,6 +44,9 @@ obj-$(CONFIG_AXP152_POWER)	+= pmic_bus.o
 obj-$(CONFIG_AXP209_POWER)	+= pmic_bus.o
 obj-$(CONFIG_AXP221_POWER)	+= pmic_bus.o
 obj-$(CONFIG_AXP809_POWER)	+= pmic_bus.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_AXP803_POWER)	+= pmic_bus.o
+endif
 obj-$(CONFIG_AXP818_POWER)	+= pmic_bus.o
 
 ifdef CONFIG_SPL_BUILD
arch/arm/mach-sunxi/pmic_bus.c +6 -3
index f917c3e..34acd01 100644
@@ -36,7 +36,8 @@ int pmic_bus_init(void)
 	if (!needs_init)
 		return 0;
 
-#if defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
+#if defined CONFIG_AXP221_POWER || defined CONFIG_AXP803_POWER || \
+	defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
 # ifdef CONFIG_MACH_SUN6I
 	p2wi_init();
 	ret = p2wi_change_to_p2wi_mode(AXP221_CHIP_ADDR, AXP221_CTRL_ADDR,
@@ -65,7 +66,8 @@ int pmic_bus_read(u8 reg, u8 *data)
 	return i2c_read(AXP152_I2C_ADDR, reg, 1, data, 1);
 #elif defined CONFIG_AXP209_POWER
 	return i2c_read(AXP209_I2C_ADDR, reg, 1, data, 1);
-#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
+#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP803_POWER || \
+	defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
 # ifdef CONFIG_MACH_SUN6I
 	return p2wi_read(reg, data);
 # elif defined CONFIG_MACH_SUN8I_R40
@@ -82,7 +84,8 @@ int pmic_bus_write(u8 reg, u8 data)
 	return i2c_write(AXP152_I2C_ADDR, reg, 1, &data, 1);
 #elif defined CONFIG_AXP209_POWER
 	return i2c_write(AXP209_I2C_ADDR, reg, 1, &data, 1);
-#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
+#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP803_POWER || \
+	defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
 # ifdef CONFIG_MACH_SUN6I
 	return p2wi_write(reg, data);
 # elif defined CONFIG_MACH_SUN8I_R40
arch/arm/mach-sunxi/rsb.c +1 -1
index 6fd11f1..ea52a6f 100644
@@ -27,7 +27,7 @@ static void rsb_cfg_io(void)
 	sunxi_gpio_set_pull(SUNXI_GPL(1), 1);
 	sunxi_gpio_set_drv(SUNXI_GPL(0), 2);
 	sunxi_gpio_set_drv(SUNXI_GPL(1), 2);
-#elif defined CONFIG_MACH_SUN9I
+#elif defined CONFIG_MACH_SUN9I || defined CONFIG_MACH_SUN50I
 	sunxi_gpio_set_cfgpin(SUNXI_GPN(0), SUN9I_GPN_R_RSB);
 	sunxi_gpio_set_cfgpin(SUNXI_GPN(1), SUN9I_GPN_R_RSB);
 	sunxi_gpio_set_pull(SUNXI_GPN(0), 1);
board/sunxi/board.c +40 -0
index dcacdf3..158282e 100644
@@ -173,6 +173,40 @@ void i2c_init_board(void)
 #endif
 }
 
+#ifdef CONFIG_AXP803_POWER
+static int axp803_init(void)
+{
+	int power_failed = 0;
+
+	power_failed = axp_init();
+
+	power_failed |= axp_set_dcdc1(CONFIG_AXP_DCDC1_VOLT);
+	power_failed |= axp_set_dcdc2(CONFIG_AXP_DCDC2_VOLT);
+	power_failed |= axp_set_dcdc3(CONFIG_AXP_DCDC3_VOLT);
+	power_failed |= axp_set_dcdc4(CONFIG_AXP_DCDC4_VOLT);
+	power_failed |= axp_set_dcdc5(CONFIG_AXP_DCDC5_VOLT);
+	power_failed |= axp_set_dcdc6(CONFIG_AXP_DCDC6_VOLT);
+
+	power_failed |= axp_set_aldo1(CONFIG_AXP_ALDO1_VOLT);
+	power_failed |= axp_set_aldo2(CONFIG_AXP_ALDO2_VOLT);
+	power_failed |= axp_set_aldo3(CONFIG_AXP_ALDO3_VOLT);
+
+	power_failed |= axp_set_dldo(1, CONFIG_AXP_DLDO1_VOLT);
+	power_failed |= axp_set_dldo(2, CONFIG_AXP_DLDO2_VOLT);
+	power_failed |= axp_set_dldo(3, CONFIG_AXP_DLDO3_VOLT);
+	power_failed |= axp_set_dldo(4, CONFIG_AXP_DLDO4_VOLT);
+
+	power_failed |= axp_set_eldo(1, CONFIG_AXP_ELDO1_VOLT);
+	power_failed |= axp_set_eldo(2, CONFIG_AXP_ELDO2_VOLT);
+	power_failed |= axp_set_eldo(3, CONFIG_AXP_ELDO3_VOLT);
+
+	power_failed |= axp_set_fldo(1, CONFIG_AXP_FLDO1_VOLT);
+	power_failed |= axp_set_fldo(2, CONFIG_AXP_FLDO2_VOLT);
+
+	return power_failed;
+}
+#endif
+
 /* add board specific code here */
 int board_init(void)
 {
@@ -209,6 +243,12 @@ int board_init(void)
 	}
 #endif /* !CONFIG_ARM64 */
 
+#ifdef CONFIG_AXP803_POWER
+	ret = axp803_init();
+	if (ret)
+		return ret;
+#endif
+
 	ret = axp_gpio_init();
 	if (ret)
 		return ret;
drivers/power/Kconfig +67 -28

264 lines not on this page · raw message

drivers/power/Makefile +3 -0
index 90a3b00..20cabaa 100644
@@ -9,6 +9,9 @@ obj-$(CONFIG_AXP152_POWER)	+= axp152.o
 obj-$(CONFIG_AXP209_POWER)	+= axp209.o
 obj-$(CONFIG_AXP221_POWER)	+= axp221.o
 obj-$(CONFIG_AXP809_POWER)	+= axp809.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_AXP803_POWER)	+= axp803.o
+endif
 obj-$(CONFIG_AXP818_POWER)	+= axp818.o
 obj-$(CONFIG_EXYNOS_TMU)	+= exynos-tmu.o
 obj-$(CONFIG_FTPMU010_POWER)	+= ftpmu010.o
drivers/power/axp803.c new file +260 -0

260 lines not on this page · raw message

include/axp803.h new file +68 -0

68 lines not on this page · raw message

include/axp_pmic.h +4 -0
index d789ad8..7c17de9 100644
@@ -16,6 +16,9 @@
 #ifdef CONFIG_AXP221_POWER
 #include <axp221.h>
 #endif
+#ifdef CONFIG_AXP803_POWER
+#include <axp803.h>
+#endif
 #ifdef CONFIG_AXP809_POWER
 #include <axp809.h>
 #endif
@@ -28,6 +31,7 @@ int axp_set_dcdc2(unsigned int mvolt);
 int axp_set_dcdc3(unsigned int mvolt);
 int axp_set_dcdc4(unsigned int mvolt);
 int axp_set_dcdc5(unsigned int mvolt);
+int axp_set_dcdc6(unsigned int mvolt);
 int axp_set_aldo1(unsigned int mvolt);
 int axp_set_aldo2(unsigned int mvolt);
 int axp_set_aldo3(unsigned int mvolt);
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 2/16 sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)

In reply to Jagan Teki

From: Philipp Tomsich <[email protected]>

The sun50i platform (e.g. the A64/sun50iw1p1) integrates 2 USB PHYs which are connected as follows:
PHY#0 is shared between the OTG controller (MUSB) [at 01C19000]

        and the USB-OTG-HCI [at 01C1A000]

PHY#1 is dedicated to USB-HCI0 [at 01C1B000] and can be bypassed
when connecting HCI0 to the HSIC interface

Note that all USB PHYs are controlled from within the OTG address space at 01C19000.

X-AffectedPlatforms: A64-uQ7

[jagan: rebased, fixed 80 line warning]
---
 drivers/usb/musb-new/musb_regs.h | 3 ++-
 include/configs/sun50i.h         | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/usb/musb-new/musb_regs.h +2 -1
index a3cc38e..89b5dbc 100644
@@ -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
+#if defined CONFIG_MACH_SUN8I_A33 || defined CONFIG_MACH_SUN8I_A83T \
+	|| defined CONFIG_MACH_SUN50I
 	/* <Sigh> allwinner saves a reg, and we need to hardcode this */
 	return 0xde;
 #else
include/configs/sun50i.h +1 -1
index b7b67a1..9f3a8a6 100644
@@ -16,7 +16,7 @@
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 #endif
 
-#define CONFIG_SUNXI_USB_PHYS	1
+#define CONFIG_SUNXI_USB_PHYS	2
 
 #define GICD_BASE		0x1c81000
 #define GICC_BASE		0x1c82000
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 3/16 sunxi: adjust usb bases between H3_H5 vs a64

In reply to Jagan Teki

A64 doesn't have USB2 and USB3 so defined them only for H3_H5

---
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/arch-sunxi/cpu_sun4i.h +2 -0
index 2419062..98728f9 100644
@@ -66,8 +66,10 @@
 #define SUNXI_USBPHY_BASE		0x01c19000
 #define SUNXI_USB0_BASE			0x01c1a000
 #define SUNXI_USB1_BASE			0x01c1b000
+# if defined(CONFIG_MACH_SUNXI_H3_H5)
 #define SUNXI_USB2_BASE			0x01c1c000
 #define SUNXI_USB3_BASE			0x01c1d000
+# endif
 #else
 #define SUNXI_USB0_BASE			0x01c19000
 #define SUNXI_USB1_BASE			0x01c1a000
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 4/16 musb-new: sunxi: add common SUNXI_MUSB_BASE

In reply to Jagan Teki

MUSB sunxi driver base not always USB0_BASE, on a64 USB0_BASE is USB-OTG-EHCI/OHCI base so add SUNXI_MUSB_BASE and adjust the proper msub base for all sunxi families.

---
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 4 ++++
 drivers/usb/musb-new/sunxi.c                | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-sunxi/cpu_sun4i.h +4 -0
index 98728f9..2035489 100644
@@ -47,6 +47,7 @@
 #define SUNXI_MMC3_BASE			0x01c12000
 #ifdef CONFIG_SUNXI_GEN_SUN4I
 #define SUNXI_USB0_BASE			0x01c13000
+#define SUNXI_MUSB_BASE			SUNXI_USB0_BASE
 #define SUNXI_USB1_BASE			0x01c14000
 #endif
 #define SUNXI_SS_BASE			0x01c15000
@@ -64,14 +65,17 @@
 #ifdef CONFIG_SUNXI_GEN_SUN6I
 #if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I)
 #define SUNXI_USBPHY_BASE		0x01c19000
+#define SUNXI_MUSB_BASE			SUNXI_USBPHY_BASE
 #define SUNXI_USB0_BASE			0x01c1a000
 #define SUNXI_USB1_BASE			0x01c1b000
 # if defined(CONFIG_MACH_SUNXI_H3_H5)
+#define SUNXI_MUSB_BASE			SUNXI_USB0_BASE
 #define SUNXI_USB2_BASE			0x01c1c000
 #define SUNXI_USB3_BASE			0x01c1d000
 # endif
 #else
 #define SUNXI_USB0_BASE			0x01c19000
+#define SUNXI_MUSB_BASE			SUNXI_USB0_BASE
 #define SUNXI_USB1_BASE			0x01c1a000
 #define SUNXI_USB2_BASE			0x01c1b000
 #endif
drivers/usb/musb-new/sunxi.c +2 -2
index 7ee44ea..2e22497 100644
@@ -318,7 +318,7 @@ static int musb_usb_probe(struct udevice *dev)
 
 #ifdef CONFIG_USB_MUSB_HOST
 	host->host = musb_init_controller(&musb_plat, NULL,
-					  (void *)SUNXI_USB0_BASE);
+					  (void *)SUNXI_MUSB_BASE);
 	if (!host->host)
 		return -EIO;
 
@@ -326,7 +326,7 @@ static int musb_usb_probe(struct udevice *dev)
 	if (!ret)
 		printf("Allwinner mUSB OTG (Host)\n");
 #else
-	ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+	ret = musb_register(&musb_plat, NULL, (void *)SUNXI_MUSB_BASE);
 	if (!ret)
 		printf("Allwinner mUSB OTG (Peripheral)\n");
 #endif
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH 5/16 musb-new: sunxi: a64: add support to select shared phy

In reply to Jagan Teki

From: Philipp Tomsich <[email protected]>

Allwinner a64 has a shared PHY for MUSB and USB-OTG-HCI, so add function to select the PHY route.

[jagan: reworked for remove func support]
---
 drivers/usb/musb-new/sunxi.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/usb/musb-new/sunxi.c +19 -0
index 2e22497..45ddf20 100644
@@ -45,6 +45,9 @@
 #define  USBC_REG_o_PHYCTL	0x0404
 #define  USBC_REG_o_PHYBIST	0x0408
 #define  USBC_REG_o_PHYTUNE	0x040c
+#if defined(CONFIG_MACH_SUN50I)
+#define	SUNXI_OTG_PHY_CFG	0x0420
+#endif
 
 #define  USBC_REG_o_VEND0	0x0043
 
@@ -162,6 +165,16 @@ static void USBC_ConfigFIFO_Base(void)
 	writel(reg_value, SUNXI_SRAMC_BASE + 0x04);
 }
 
+#if defined(CONFIG_MACH_SUN50I)
+static void USBC_SelectPhyToDevice(__iomem void *base, bool routePHYtoOTG)
+{
+	/* The OTG and HCI0 controllers share a single PHY in the A64.
+	 * Select either 'to OTG' (1) or 'to HCI' (0).
+	 */
+	clrsetbits_le32(base + SUNXI_OTG_PHY_CFG, 1, routePHYtoOTG ? 1 : 0);
+}
+#endif
+
 /******************************************************************************
  * Needed for the DFU polling magic
  ******************************************************************************/
@@ -267,6 +280,9 @@ static int sunxi_musb_init(struct musb *musb)
 	setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0);
 #endif
 	sunxi_usb_phy_init(0);
+#if defined(CONFIG_MACH_SUN50I)
+	USBC_SelectPhyToDevice(musb->mregs, true);
+#endif
 
 	USBC_ConfigFIFO_Base();
 	USBC_EnableDpDmPullUp(musb->mregs);
@@ -342,6 +358,9 @@ static int musb_usb_remove(struct udevice *dev)
 	musb_stop(host->host);
 
 	sunxi_usb_phy_exit(0);
+#if defined(CONFIG_MACH_SUN50I)
+	USBC_SelectPhyToDevice(host->host->mregs, false);
+#endif
 #ifdef CONFIG_SUNXI_GEN_SUN6I
 	clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0);
 #endif
Signature · 1 line
2.7.4
author
#11 lore raw

PATCH 6/16 musb-new: sunxi: a64: adds support for clearing the SIDDP

In reply to Jagan Teki

From: Philipp Tomsich <[email protected]>

Allwinner a64 needs to clear the SIDDP bit from PHYCTL register once the phy_init done.

[jagan: reworked to fix multi-line comments]
---
 arch/arm/include/asm/arch-sunxi/usb_phy.h |  1 +
 arch/arm/mach-sunxi/usb_phy.c             | 11 +++++++++++
 drivers/usb/host/ehci-sunxi.c             |  8 ++++++++
 drivers/usb/host/ohci-sunxi.c             |  8 ++++++++
 drivers/usb/musb-new/sunxi.c              |  1 +
 5 files changed, 29 insertions(+)
arch/arm/include/asm/arch-sunxi/usb_phy.h +1 -0
index 5a9cacb..f97d415 100644
@@ -19,3 +19,4 @@ void sunxi_usb_phy_power_off(int index);
 int sunxi_usb_phy_vbus_detect(int index);
 int sunxi_usb_phy_id_detect(int index);
 void sunxi_usb_phy_enable_squelch_detect(int index, int enable);
+void sunxi_usb_phy_clear_SIDDP(void *base);
arch/arm/mach-sunxi/usb_phy.c +11 -0
index 2f1cad1..1bfee40 100644
@@ -190,6 +190,17 @@ static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy)
 }
 #endif
 
+#if defined(CONFIG_MACH_SUN50I)
+void sunxi_usb_phy_clear_SIDDP(void *base)
+{
+	/* We pretend that this is always at the same offset (0x410),
+	 * even though it is 0x410 for MUSB/OTG and OHCI, but 0x810
+	 * for EHCI.  The EHCI call site will have to adjust this...
+	 */
+	clrbits_le32(base + SUNXI_USB_CSR, (1 << 1));
+}
+#endif
+
 static void sunxi_usb_phy_passby(struct sunxi_usb_phy *phy, int enable)
 {
 	unsigned long bits = 0;
drivers/usb/host/ehci-sunxi.c +8 -0
index 6ecb7c4..c3432aa 100644
@@ -61,6 +61,14 @@ static int ehci_usb_probe(struct udevice *dev)
 #endif
 
 	sunxi_usb_phy_init(priv->phy_index);
+#if defined(CONFIG_MACH_SUN50I)
+	/*
+	 * For the HCI blocks, the PHYCTL register is at 0x810, so
+	 * it's an extra 0x400 for the EHCI block.  This should go
+	 * away once the PHYs use the driver model.
+	 */
+	sunxi_usb_phy_clear_SIDDP((void *)hccr + 0x400);
+#endif
 	sunxi_usb_phy_power_on(priv->phy_index);
 
 	hcor = (struct ehci_hcor *)((uintptr_t)hccr +
drivers/usb/host/ohci-sunxi.c +8 -0
index 133774f..e9eeb56 100644
@@ -66,6 +66,14 @@ static int ohci_usb_probe(struct udevice *dev)
 #endif
 
 	sunxi_usb_phy_init(priv->phy_index);
+#if defined(CONFIG_MACH_SUN50I)
+	/*
+	 * For the HCI blocks, the PHYCTL register is at 0x810, so it's
+	 * an extra 0x400 for the EHCI block.  This should go away once
+	 * the PHYs use the driver model.
+	 */
+	sunxi_usb_phy_clear_SIDDP(regs);
+#endif
 	sunxi_usb_phy_power_on(priv->phy_index);
 
 	return ohci_register(dev, regs);
drivers/usb/musb-new/sunxi.c +1 -0
index 45ddf20..0d87582 100644
@@ -281,6 +281,7 @@ static int sunxi_musb_init(struct musb *musb)
 #endif
 	sunxi_usb_phy_init(0);
 #if defined(CONFIG_MACH_SUN50I)
+	sunxi_usb_phy_clear_SIDDP(musb->mregs);
 	USBC_SelectPhyToDevice(musb->mregs, true);
 #endif
 
Signature · 1 line
2.7.4
author
#12 lore raw

PATCH 7/16 usb: sunxi: set up usb_phy_passby only for HCI

In reply to Jagan Teki

From: Philipp Tomsich <[email protected]>

sunxi_usb_phy_passby will deal PHY's other than 0 and it not require to use it for MUSB so use directly for HCI.

Also update the function proto type for with index and bool enable for better usability.

[jagan: reowrked on entire patch]
---
 arch/arm/include/asm/arch-sunxi/usb_phy.h | 1 +
 arch/arm/mach-sunxi/usb_phy.c             | 9 ++-------
 drivers/usb/host/ehci-sunxi.c             | 2 ++
 drivers/usb/host/ohci-sunxi.c             | 2 ++
 4 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/include/asm/arch-sunxi/usb_phy.h +1 -0
index f97d415..83ada78 100644
@@ -20,3 +20,4 @@ int sunxi_usb_phy_vbus_detect(int index);
 int sunxi_usb_phy_id_detect(int index);
 void sunxi_usb_phy_enable_squelch_detect(int index, int enable);
 void sunxi_usb_phy_clear_SIDDP(void *base);
+void sunxi_usb_phy_passby(int index, bool enable);
arch/arm/mach-sunxi/usb_phy.c +2 -7
index 1bfee40..4bc47a1 100644
@@ -201,8 +201,9 @@ void sunxi_usb_phy_clear_SIDDP(void *base)
 }
 #endif
 
-static void sunxi_usb_phy_passby(struct sunxi_usb_phy *phy, int enable)
+void sunxi_usb_phy_passby(int index, bool enable)
 {
+	struct sunxi_usb_phy *phy = &sunxi_usb_phy[index];
 	unsigned long bits = 0;
 	void *addr;
 
@@ -250,9 +251,6 @@ void sunxi_usb_phy_init(int index)
 
 	sunxi_usb_phy_config(phy);
 
-	if (phy->id != 0)
-		sunxi_usb_phy_passby(phy, SUNXI_USB_PASSBY_EN);
-
 #ifdef CONFIG_MACH_SUN8I_A83T
 	if (phy->id == 0) {
 		setbits_le32(SUNXI_USB0_BASE + SUNXI_USB_CSR,
@@ -272,9 +270,6 @@ void sunxi_usb_phy_exit(int index)
 	if (phy->init_count != 0)
 		return;
 
-	if (phy->id != 0)
-		sunxi_usb_phy_passby(phy, !SUNXI_USB_PASSBY_EN);
-
 #ifdef CONFIG_MACH_SUN8I_A83T
 	if (phy->id == 0) {
 		setbits_le32(SUNXI_USB0_BASE + SUNXI_USB_CSR,
drivers/usb/host/ehci-sunxi.c +2 -0
index c3432aa..4eef739 100644
@@ -69,6 +69,7 @@ static int ehci_usb_probe(struct udevice *dev)
 	 */
 	sunxi_usb_phy_clear_SIDDP((void *)hccr + 0x400);
 #endif
+	sunxi_usb_phy_passby(priv->phy_index, true);
 	sunxi_usb_phy_power_on(priv->phy_index);
 
 	hcor = (struct ehci_hcor *)((uintptr_t)hccr +
@@ -87,6 +88,7 @@ static int ehci_usb_remove(struct udevice *dev)
 	if (ret)
 		return ret;
 
+	sunxi_usb_phy_passby(priv->phy_index, false);
 	sunxi_usb_phy_exit(priv->phy_index);
 
 #ifdef CONFIG_SUNXI_GEN_SUN6I
drivers/usb/host/ohci-sunxi.c +2 -0
index e9eeb56..cb052d4 100644
@@ -74,6 +74,7 @@ static int ohci_usb_probe(struct udevice *dev)
 	 */
 	sunxi_usb_phy_clear_SIDDP(regs);
 #endif
+	sunxi_usb_phy_passby(priv->phy_index, true);
 	sunxi_usb_phy_power_on(priv->phy_index);
 
 	return ohci_register(dev, regs);
@@ -89,6 +90,7 @@ static int ohci_usb_remove(struct udevice *dev)
 	if (ret)
 		return ret;
 
+	sunxi_usb_phy_passby(priv->phy_index, false);
 	sunxi_usb_phy_exit(priv->phy_index);
 
 #ifdef CONFIG_SUNXI_GEN_SUN6I
Signature · 1 line
2.7.4
author
#13 lore raw

PATCH 8/16 sunxi: clock: update a64 usb clock gating and module reset bits

In reply to Jagan Teki

From: Philipp Tomsich <[email protected]>

clock gating and module reset bits on a64 are different than H3_H5 and other allwinner family SOCs, add them on clock_sun6i.h

[jagan: reowrked on entire patch]
---
 arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-sunxi/clock_sun6i.h +14 -2
index d328df9..7cb9235 100644
@@ -280,12 +280,24 @@ struct sunxi_ccm_reg {
 #define AHB_GATE_OFFSET_USB_EHCI2	27
 #define AHB_GATE_OFFSET_USB_EHCI1	26
 #define AHB_GATE_OFFSET_USB_EHCI0	25
+#elif defined(CONFIG_MACH_SUN50I)
+#define AHB_GATE_OFFSET_USB_OHCI0	29
+#define AHB_GATE_OFFSET_USBOTG_OHCI	28
+#define AHB_GATE_OFFSET_USB_EHCI0	25
+#define AHB_GATE_OFFSET_USBOTG_EHCI	24
+#define AHB_GATE_OFFSET_USBOTG		23
 #else
 #define AHB_GATE_OFFSET_USB_EHCI1	27
 #define AHB_GATE_OFFSET_USB_EHCI0	26
 #endif
-#ifndef CONFIG_MACH_SUN8I_R40
-#define AHB_GATE_OFFSET_USB0		24
+#ifdef CONFIG_MACH_SUN50I
+/*
+ * The musb-new/sunxi.c glue uses AHB_GATE_OFFSET_USB0
+ * for the MUSB OTG block, so we define it to what it expects.
+ */
+# define AHB_GATE_OFFSET_USB0		AHB_GATE_OFFSET_USBOTG
+#elif !defined(CONFIG_MACH_SUN8I_R40)
+# define AHB_GATE_OFFSET_USB0		24
 #else
 #define AHB_GATE_OFFSET_USB0		25
 #define AHB_GATE_OFFSET_SATA		24
Signature · 1 line
2.7.4
author
#15 lore raw

PATCH 9/16 sunxi: usb_phy: Update a64 sunxi_usb_phy base

In reply to Jagan Teki

a64 has shared PHY#0(for OTG and USB-OTG-HCI) which start at 0x01C19000 which different than other allwinner SOC, so update the same for sunxi_usb_phy[0] base.

---
 arch/arm/mach-sunxi/usb_phy.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-sunxi/usb_phy.c +4 -0
index 4bc47a1..cc66446 100644
@@ -63,7 +63,11 @@ static struct sunxi_usb_phy {
 	{
 		.usb_rst_mask = CCM_USB_CTRL_PHY0_RST | CCM_USB_CTRL_PHY0_CLK,
 		.id = 0,
+#ifdef CONFIG_MACH_SUN50I
+		.base = SUNXI_USBPHY_BASE,
+#else
 		.base = SUNXI_USB0_BASE,
+#endif
 	},
 	{
 		.usb_rst_mask = CCM_USB_CTRL_PHY1_RST | CCM_USB_CTRL_PHY1_CLK,
Signature · 1 line
2.7.4
author
#16 lore raw

PATCH 10/16 arm64: allwinner: sync bananapi-m64 usb nodes from Linux

In reply to Jagan Teki

Sync USB-OTG and USB-OTG-HCI nodes from Linux.

---
 arch/arm/dts/sun50i-a64-bananapi-m64.dts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/dts/sun50i-a64-bananapi-m64.dts +27 -0
index 02db114..1b02e09 100644
@@ -68,6 +68,15 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_pins>;
@@ -108,6 +117,14 @@
 	status = "okay";
 };
 
+&ohci0 {
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
@@ -119,3 +136,13 @@
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
 	status = "okay";
 };
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	status = "okay";
+};
Signature · 1 line
2.7.4
author
#18 lore raw

PATCH 11/16 configs: sun50i: add usb-otg support for bananapi-m64

In reply to Jagan Teki

USB-OTG require MUSB driver along with PHY#0 id(PH9) and/or vbus pin through AXP_GPIO driver.

This patch add support for it.

---
 configs/bananapi_m64_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/bananapi_m64_defconfig +3 -0
index 461567f..55feafe 100644
@@ -4,6 +4,8 @@ CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_MMC0_CD_PIN="PH13"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB0_ID_DET="PH9"
+CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
@@ -14,4 +16,5 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
Signature · 1 line
2.7.4
author
#22 lore raw

PATCH 12/16 configs: sun50i: enable ums on bananapi-m64

In reply to Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---
 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/bananapi_m64_defconfig +1 -0
index 55feafe..d4aade5 100644
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
Signature · 1 line
2.7.4
author
#29 lore raw

PATCH 13/16 arm64: allwinner: sync a64-olinuxino usb nodes from Linux

In reply to Jagan Teki

Sync USB-OTG and USB-OTG-HCI nodes from Linux.

---
 arch/arm/dts/sun50i-a64-olinuxino.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/dts/sun50i-a64-olinuxino.dts +19 -0
index 7bd4730..bd56355 100644
@@ -66,6 +66,10 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
@@ -77,8 +81,23 @@
 	status = "okay";
 };
 
+&ohci0 {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	usb0_vbus_det-gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+	status = "okay";
+};
Signature · 1 line
2.7.4
author
#30 lore raw

PATCH 14/16 configs: sun50i: add usb-otg support for a64-olinuxino

In reply to Jagan Teki

USB-OTG require MUSB driver along with PHY#0 id(PH9) and/or vbus pin(PH6) through AXP_GPIO driver.

This patch add support for it.

---
 configs/a64-olinuxino_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/a64-olinuxino_defconfig +4 -0
index 63a0048..4c3fe75 100644
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
+CONFIG_USB0_ID_DET="PH9"
+CONFIG_USB0_VBUS_DET="PH6"
+CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-olinuxino"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
@@ -12,4 +15,5 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
Signature · 1 line
2.7.4
author
#32 lore raw

PATCH 15/16 configs: sun50i: enable ums on a64-olinuxino

In reply to Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---
 configs/a64-olinuxino_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/a64-olinuxino_defconfig +1 -0
index 4c3fe75..c1408bd 100644
@@ -10,6 +10,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-olinuxino"
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
Signature · 1 line
2.7.4
author
#33 lore raw

PATCH 16/16 configs: sun50i: Enable eMMC on a64-olinuxino

In reply to Jagan Teki

a64-olinuxino has 8GiB eMMC, enable it.

---
 configs/a64-olinuxino_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/a64-olinuxino_defconfig +1 -0
index c1408bd..6f26e9e 100644
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_USB0_ID_DET="PH9"
 CONFIG_USB0_VBUS_DET="PH6"
 CONFIG_AXP_GPIO=y
Signature · 1 line
2.7.4
#9 lore raw

PATCH 4/16 musb-new: sunxi: add common SUNXI_MUSB_BASE

In reply to Jagan Teki
Quoted 45 lines · Jagan Teki

MUSB sunxi driver base not always USB0_BASE, on a64 USB0_BASE is USB-OTG-EHCI/OHCI base so add SUNXI_MUSB_BASE and adjust the proper msub base for all sunxi families.

---
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 4 ++++
 drivers/usb/musb-new/sunxi.c                | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-sunxi/cpu_sun4i.h +4 -0
index 98728f9..2035489 100644
@@ -47,6 +47,7 @@
 #define SUNXI_MMC3_BASE                        0x01c12000
 #ifdef CONFIG_SUNXI_GEN_SUN4I
 #define SUNXI_USB0_BASE                        0x01c13000
+#define SUNXI_MUSB_BASE                        SUNXI_USB0_BASE
 #define SUNXI_USB1_BASE                        0x01c14000
 #endif
 #define SUNXI_SS_BASE                  0x01c15000
@@ -64,14 +65,17 @@
 #ifdef CONFIG_SUNXI_GEN_SUN6I
 #if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I)
 #define SUNXI_USBPHY_BASE              0x01c19000
+#define SUNXI_MUSB_BASE                        SUNXI_USBPHY_BASE
 #define SUNXI_USB0_BASE                        0x01c1a000
 #define SUNXI_USB1_BASE                        0x01c1b000
 # if defined(CONFIG_MACH_SUNXI_H3_H5)
+#define SUNXI_MUSB_BASE                        SUNXI_USB0_BASE
 #define SUNXI_USB2_BASE                        0x01c1c000
 #define SUNXI_USB3_BASE                        0x01c1d000
 # endif
 #else
 #define SUNXI_USB0_BASE                        0x01c19000
+#define SUNXI_MUSB_BASE                        SUNXI_USB0_BASE
 #define SUNXI_USB1_BASE                        0x01c1a000
 #define SUNXI_USB2_BASE                        0x01c1b000
 #endif
drivers/usb/musb-new/sunxi.c +0 -0
index 7ee44ea..2e22497 100644

drivers/usb/musb-new/sunxi.c static int musb_usb_probe(struct udevice *dev) · line 321

Quoted 5 lines
drivers/usb/musb-new/sunxi.c +1 -1
@@ -318,7 +318,7 @@ static int musb_usb_probe(struct udevice *dev)
 
 #ifdef CONFIG_USB_MUSB_HOST
        host->host = musb_init_controller(&musb_plat, NULL,
-                                         (void *)SUNXI_USB0_BASE);
+                                         (void *)SUNXI_MUSB_BASE);

This driver is fully DM enabled. See the patch getting the base address from the device tree I just sent.

ChenYu

Quoted 15 lines
drivers/usb/musb-new/sunxi.c +1 -2
        if (!host->host)
                return -EIO;
 
@@ -326,7 +326,7 @@ static int musb_usb_probe(struct udevice *dev)
        if (!ret)
                printf("Allwinner mUSB OTG (Host)\n");
 #else
-       ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+       ret = musb_register(&musb_plat, NULL, (void *)SUNXI_MUSB_BASE);
        if (!ret)
                printf("Allwinner mUSB OTG (Peripheral)\n");
 #endif
--

2.7.4

#2 lore raw

PATCH 1/16 power: sunxi: add AXP803 PMIC support

In reply to Jagan Teki

Hi,

Quoted 5 lines · Jagan Teki

AXP803 another PMIC produced by x-powers and paired with A64 via RSB bus.

unlike other axp chip's support in SPL this is only added for U-Boot proper since SPL on A64 has no space to add anything.

How do you setup the CPU and DRAM regulators then?

Quoted 20 lines
---
 arch/arm/mach-sunxi/Makefile   |   9 ++
 arch/arm/mach-sunxi/pmic_bus.c |   9 +-
 arch/arm/mach-sunxi/rsb.c      |   2 +-
 board/sunxi/board.c            |  40 +++++++
 drivers/power/Kconfig          |  95 ++++++++++-----
 drivers/power/Makefile         |   3 +
 drivers/power/axp803.c         | 260 +++++++++++++++++++++++++++++++++++++++++
 include/axp803.h               |  68 +++++++++++
 include/axp_pmic.h             |   4 +
 9 files changed, 458 insertions(+), 32 deletions(-)
 create mode 100644 drivers/power/axp803.c
 create mode 100644 include/axp803.h
arch/arm/mach-sunxi/Makefile +0 -0
index 2a3c379..aedf22f 100644

arch/arm/mach-sunxi/Makefile endif · line 24

Quoted 6 lines
arch/arm/mach-sunxi/Makefile +3 -0
@@ -19,9 +19,15 @@ endif
 obj-$(CONFIG_MACH_SUN6I)	+= prcm.o
 obj-$(CONFIG_MACH_SUN8I)	+= prcm.o
 obj-$(CONFIG_MACH_SUN9I)	+= prcm.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_MACH_SUN50I)	+= prcm.o
+endif

The number of lines here is starting to be a bit ridiculous, please make a Kconfig option selected by the SoC families.

arch/arm/mach-sunxi/Makefile endif · line 30

Quoted 6 lines
arch/arm/mach-sunxi/Makefile +3 -0
 obj-$(CONFIG_MACH_SUN6I)	+= p2wi.o
 obj-$(CONFIG_MACH_SUN8I)	+= rsb.o
 obj-$(CONFIG_MACH_SUN9I)	+= rsb.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_MACH_SUN50I)	+= rsb.o
+endif

Ditto.

arch/arm/mach-sunxi/Makefile obj-$(CONFIG_AXP152_POWER) += pmic_bus.o · line 49

Quoted 10 lines
arch/arm/mach-sunxi/Makefile +3 -0
 obj-$(CONFIG_MACH_SUN4I)	+= clock_sun4i.o
 obj-$(CONFIG_MACH_SUN5I)	+= clock_sun4i.o
 obj-$(CONFIG_MACH_SUN6I)	+= clock_sun6i.o
@@ -38,6 +44,9 @@ obj-$(CONFIG_AXP152_POWER)	+= pmic_bus.o
 obj-$(CONFIG_AXP209_POWER)	+= pmic_bus.o
 obj-$(CONFIG_AXP221_POWER)	+= pmic_bus.o
 obj-$(CONFIG_AXP809_POWER)	+= pmic_bus.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_AXP803_POWER)	+= pmic_bus.o
+endif

Ditto.

Quoted 8 lines
arch/arm/mach-sunxi/Makefile +0 -0
 obj-$(CONFIG_AXP818_POWER)	+= pmic_bus.o
 
 ifdef CONFIG_SPL_BUILD
arch/arm/mach-sunxi/pmic_bus.c +0 -0
index f917c3e..34acd01 100644

arch/arm/mach-sunxi/pmic_bus.c int pmic_bus_init(void) · line 40

Quoted 6 lines
arch/arm/mach-sunxi/pmic_bus.c +2 -1
@@ -36,7 +36,8 @@ int pmic_bus_init(void)
 	if (!needs_init)
 		return 0;
 
-#if defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
+#if defined CONFIG_AXP221_POWER || defined CONFIG_AXP803_POWER || \
+	defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER

Ditto.

Quoted 135 lines
arch/arm/mach-sunxi/pmic_bus.c +4 -2
 # ifdef CONFIG_MACH_SUN6I
 	p2wi_init();
 	ret = p2wi_change_to_p2wi_mode(AXP221_CHIP_ADDR, AXP221_CTRL_ADDR,
@@ -65,7 +66,8 @@ int pmic_bus_read(u8 reg, u8 *data)
 	return i2c_read(AXP152_I2C_ADDR, reg, 1, data, 1);
 #elif defined CONFIG_AXP209_POWER
 	return i2c_read(AXP209_I2C_ADDR, reg, 1, data, 1);
-#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
+#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP803_POWER || \
+	defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
 # ifdef CONFIG_MACH_SUN6I
 	return p2wi_read(reg, data);
 # elif defined CONFIG_MACH_SUN8I_R40
@@ -82,7 +84,8 @@ int pmic_bus_write(u8 reg, u8 data)
 	return i2c_write(AXP152_I2C_ADDR, reg, 1, &data, 1);
 #elif defined CONFIG_AXP209_POWER
 	return i2c_write(AXP209_I2C_ADDR, reg, 1, &data, 1);
-#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
+#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP803_POWER || \
+	defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER
 # ifdef CONFIG_MACH_SUN6I
 	return p2wi_write(reg, data);
 # elif defined CONFIG_MACH_SUN8I_R40
arch/arm/mach-sunxi/rsb.c +1 -1
index 6fd11f1..ea52a6f 100644
@@ -27,7 +27,7 @@ static void rsb_cfg_io(void)
 	sunxi_gpio_set_pull(SUNXI_GPL(1), 1);
 	sunxi_gpio_set_drv(SUNXI_GPL(0), 2);
 	sunxi_gpio_set_drv(SUNXI_GPL(1), 2);
-#elif defined CONFIG_MACH_SUN9I
+#elif defined CONFIG_MACH_SUN9I || defined CONFIG_MACH_SUN50I
 	sunxi_gpio_set_cfgpin(SUNXI_GPN(0), SUN9I_GPN_R_RSB);
 	sunxi_gpio_set_cfgpin(SUNXI_GPN(1), SUN9I_GPN_R_RSB);
 	sunxi_gpio_set_pull(SUNXI_GPN(0), 1);
board/sunxi/board.c +40 -0
index dcacdf3..158282e 100644
@@ -173,6 +173,40 @@ void i2c_init_board(void)
 #endif
 }
 
+#ifdef CONFIG_AXP803_POWER
+static int axp803_init(void)
+{
+	int power_failed = 0;
+
+	power_failed = axp_init();
+
+	power_failed |= axp_set_dcdc1(CONFIG_AXP_DCDC1_VOLT);
+	power_failed |= axp_set_dcdc2(CONFIG_AXP_DCDC2_VOLT);
+	power_failed |= axp_set_dcdc3(CONFIG_AXP_DCDC3_VOLT);
+	power_failed |= axp_set_dcdc4(CONFIG_AXP_DCDC4_VOLT);
+	power_failed |= axp_set_dcdc5(CONFIG_AXP_DCDC5_VOLT);
+	power_failed |= axp_set_dcdc6(CONFIG_AXP_DCDC6_VOLT);
+
+	power_failed |= axp_set_aldo1(CONFIG_AXP_ALDO1_VOLT);
+	power_failed |= axp_set_aldo2(CONFIG_AXP_ALDO2_VOLT);
+	power_failed |= axp_set_aldo3(CONFIG_AXP_ALDO3_VOLT);
+
+	power_failed |= axp_set_dldo(1, CONFIG_AXP_DLDO1_VOLT);
+	power_failed |= axp_set_dldo(2, CONFIG_AXP_DLDO2_VOLT);
+	power_failed |= axp_set_dldo(3, CONFIG_AXP_DLDO3_VOLT);
+	power_failed |= axp_set_dldo(4, CONFIG_AXP_DLDO4_VOLT);
+
+	power_failed |= axp_set_eldo(1, CONFIG_AXP_ELDO1_VOLT);
+	power_failed |= axp_set_eldo(2, CONFIG_AXP_ELDO2_VOLT);
+	power_failed |= axp_set_eldo(3, CONFIG_AXP_ELDO3_VOLT);
+
+	power_failed |= axp_set_fldo(1, CONFIG_AXP_FLDO1_VOLT);
+	power_failed |= axp_set_fldo(2, CONFIG_AXP_FLDO2_VOLT);
+
+	return power_failed;
+}
+#endif
+
 /* add board specific code here */
 int board_init(void)
 {
@@ -209,6 +243,12 @@ int board_init(void)
 	}
 #endif /* !CONFIG_ARM64 */
 
+#ifdef CONFIG_AXP803_POWER
+	ret = axp803_init();
+	if (ret)
+		return ret;
+#endif
+
 	ret = axp_gpio_init();
 	if (ret)
 		return ret;
drivers/power/Kconfig +11 -3
index d8c107e..6c1e4ff 100644
@@ -11,8 +11,9 @@ choice
 	depends on ARCH_SUNXI
 	default AXP209_POWER if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
 	default AXP221_POWER if MACH_SUN6I || MACH_SUN8I_A23 || MACH_SUN8I_A33 || MACH_SUN8I_R40
+	default AXP803_POWER if MACH_SUN50I
 	default AXP818_POWER if MACH_SUN8I_A83T
-	default SUNXI_NO_PMIC if MACH_SUNXI_H3_H5 || MACH_SUN50I
+	default SUNXI_NO_PMIC if MACH_SUNXI_H3_H5
 
 config SUNXI_NO_PMIC
 	bool "board without a pmic"
@@ -43,6 +44,13 @@ config AXP221_POWER
 	Select this to enable support for the axp221/axp223 pmic found on most
 	A23 and A31 boards.
 
+config AXP803_POWER
+	bool "axp803 pmic support"
+	depends on MACH_SUN50I
+	select CMD_POWEROFF
+	---help---
+	Say y here to enable support for the axp803 pmic found on A64 boards.
+
 config AXP809_POWER
 	bool "axp809 pmic support"
 	depends on MACH_SUN9I
@@ -69,8 +77,8 @@ endchoice
 
 config AXP_DCDC1_VOLT
 	int "axp pmic dcdc1 voltage"
-	depends on AXP221_POWER || AXP809_POWER || AXP818_POWER
-	default 3300 if AXP818_POWER || MACH_SUN8I_R40
+	depends on AXP221_POWER || AXP803_POWER || AXP809_POWER || AXP818_POWER
+	default 3300 if AXP818_POWER || MACH_SUN8I_R40 || MACH_SUN50I
 	default 3000 if MACH_SUN6I || MACH_SUN8I || MACH_SUN9I
 	---help---
 	Set the voltage (mV) to program the axp pmic dcdc1 at, set to 0 to

drivers/power/Kconfig config AXP_DCDC1_VOLT · line 91

Quoted 4 lines
drivers/power/Kconfig +1 -0
@@ -80,14 +88,15 @@ config AXP_DCDC1_VOLT
 	save battery. On A31 devices dcdc1 is also used for VCC-IO. On A83T
 	dcdc1 is used for VCC-IO, nand, usb0, sd , etc. On A80 dcdc1 normally
 	powers some of the pingroups, NAND/eMMC, SD/MMC, and USB OTG.
+	On A64 boards dcdc1 is used for Nand/eMMC/SDMMC/WIFI-IO and should be 3.3V.

These help messages are getting a bit ridiculous as well, since it's essentially something that is board specific, and not SoC specific.

Please drop them.

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/d47a2749/attachment.sig>
#14 lore raw

PATCH 8/16 sunxi: clock: update a64 usb clock gating and module reset bits

In reply to Jagan Teki

Hi,

Quoted 28 lines · Jagan Teki

From: Philipp Tomsich <[email protected]>

clock gating and module reset bits on a64 are different than H3_H5 and other allwinner family SOCs, add them on clock_sun6i.h

[jagan: reowrked on entire patch]
---
 arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-sunxi/clock_sun6i.h +6 -0
index d328df9..7cb9235 100644
@@ -280,12 +280,24 @@ struct sunxi_ccm_reg {
 #define AHB_GATE_OFFSET_USB_EHCI2	27
 #define AHB_GATE_OFFSET_USB_EHCI1	26
 #define AHB_GATE_OFFSET_USB_EHCI0	25
+#elif defined(CONFIG_MACH_SUN50I)
+#define AHB_GATE_OFFSET_USB_OHCI0	29
+#define AHB_GATE_OFFSET_USBOTG_OHCI	28
+#define AHB_GATE_OFFSET_USB_EHCI0	25
+#define AHB_GATE_OFFSET_USBOTG_EHCI	24
+#define AHB_GATE_OFFSET_USBOTG		23
 #else
 #define AHB_GATE_OFFSET_USB_EHCI1	27

arch/arm/include/asm/arch-sunxi/clock_sun6i.h struct sunxi_ccm_reg { · line 298

Quoted 10 lines
arch/arm/include/asm/arch-sunxi/clock_sun6i.h +6 -2
 #define AHB_GATE_OFFSET_USB_EHCI0	26
 #endif
-#ifndef CONFIG_MACH_SUN8I_R40
-#define AHB_GATE_OFFSET_USB0		24
+#ifdef CONFIG_MACH_SUN50I
+/*
+ * The musb-new/sunxi.c glue uses AHB_GATE_OFFSET_USB0
+ * for the MUSB OTG block, so we define it to what it expects.
+ */
+# define AHB_GATE_OFFSET_USB0		AHB_GATE_OFFSET_USBOTG

USB0 *is* USB OTG, why don't you just call it that way?

arch/arm/include/asm/arch-sunxi/clock_sun6i.h struct sunxi_ccm_reg { · line 300

Quoted 2 lines
arch/arm/include/asm/arch-sunxi/clock_sun6i.h +2 -0
+#elif !defined(CONFIG_MACH_SUN8I_R40)
+# define AHB_GATE_OFFSET_USB0		24

Why is this modified?

Thanks,
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/13f77bec/attachment.sig>
#17 lore raw

PATCH 10/16 arm64: allwinner: sync bananapi-m64 usb nodes from Linux

In reply to Jagan Teki

Hi,

Quoted 14 lines · Jagan Teki

Sync USB-OTG and USB-OTG-HCI nodes from Linux.

---
 arch/arm/dts/sun50i-a64-bananapi-m64.dts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/dts/sun50i-a64-bananapi-m64.dts +0 -0
index 02db114..1b02e09 100644
@@ -68,6 +68,15 @@
 	};
 };

arch/arm/dts/sun50i-a64-bananapi-m64.dts line 79

Quoted 10 lines
arch/arm/dts/sun50i-a64-bananapi-m64.dts +9 -0
 
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+

You have multiple blank lines here.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/29c214ce/attachment.sig>
#19 lore raw

PATCH 11/16 configs: sun50i: add usb-otg support for bananapi-m64

In reply to Jagan Teki
Quoted 24 lines · Jagan Teki

USB-OTG require MUSB driver along with PHY#0 id(PH9) and/or vbus pin through AXP_GPIO driver.

This patch add support for it.

---
 configs/bananapi_m64_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/bananapi_m64_defconfig +2 -0
index 461567f..55feafe 100644
@@ -4,6 +4,8 @@ CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_MMC0_CD_PIN="PH13"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB0_ID_DET="PH9"
+CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y

configs/bananapi_m64_defconfig CONFIG_SPL=y · line 19

Quoted 4 lines
configs/bananapi_m64_defconfig +1 -0
@@ -14,4 +16,5 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y

Did you test the host mode as well?

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/43ae8345/attachment.sig>
#34 lore raw

PATCH 16/16 configs: sun50i: Enable eMMC on a64-olinuxino

In reply to Jagan Teki
Quoted 3 lines · Jagan Teki

a64-olinuxino has 8GiB eMMC, enable it.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/e28071de/attachment.sig>
#23 lore raw

PATCH 12/16 configs: sun50i: enable ums on bananapi-m64

In reply to Jagan Teki

Hi,

Quoted 12 lines · Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---
 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/bananapi_m64_defconfig +0 -0
index 55feafe..d4aade5 100644

configs/bananapi_m64_defconfig CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" · line 14

Quoted 4 lines
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_USB_MASS_STORAGE=y

How does that work with the current over-size issue we have on the A64?

And I'd also like to keep the way we did things for several years now, which is to *not* have board-specific options selected besides the hardware-related ones.

If you want to enable a general feature, do it for all the boards so that our users will have a consistent experience across boards, and we will not have to always chase all the defconfigs to provide it.

And I guess the next question would be: what is the targetted use case and why should we enable it for all the boards? We're having binary size issues on the A64, so we really want to provide something meaningful for the majority of our users.

We won't enable something used by only a small fraction, especially when it's so easy to enable it.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/095d7bb6/attachment-0001.sig>
#31 lore raw

PATCH 14/16 configs: sun50i: add usb-otg support for a64-olinuxino

In reply to Jagan Teki

Hi,

Quoted 25 lines · Jagan Teki

USB-OTG require MUSB driver along with PHY#0 id(PH9) and/or vbus pin(PH6) through AXP_GPIO driver.

This patch add support for it.

---
 configs/a64-olinuxino_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/a64-olinuxino_defconfig +3 -0
index 63a0048..4c3fe75 100644
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
+CONFIG_USB0_ID_DET="PH9"
+CONFIG_USB0_VBUS_DET="PH6"
+CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-olinuxino"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y

configs/a64-olinuxino_defconfig CONFIG_SPL=y · line 18

Quoted 4 lines
configs/a64-olinuxino_defconfig +1 -0
@@ -12,4 +15,5 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y

Same question, did you test the host mode?

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171212/ce251d13/attachment.sig>
#35 lore raw

cover sun50i: a64: add support for axp803, musb

In reply to Jagan Teki

Hi,

Quoted 20 lines · Jagan Teki

This series deals axp803, musb and related improvements on a64
- axp803 PMIC support used by a64
- a64 musb improvements (rework by Philipp [1])
- musb support for bananapi-m64, a64-olinuxino

[1] https://patchwork.ozlabs.org/patch/729246/

Jagan Teki (11):
power: sunxi: add AXP803 PMIC support
sunxi: adjust usb bases between H3_H5 vs a64
musb-new: sunxi: add common SUNXI_MUSB_BASE
sunxi: usb_phy: Update a64 sunxi_usb_phy base
arm64: allwinner: sync bananapi-m64 usb nodes from Linux
configs: sun50i: add usb-otg support for bananapi-m64
configs: sun50i: enable ums on bananapi-m64
arm64: allwinner: sync a64-olinuxino usb nodes from Linux
configs: sun50i: add usb-otg support for a64-olinuxino
configs: sun50i: enable ums on a64-olinuxino
configs: sun50i: Enable eMMC on a64-olinuxino

Quoted 6 lines

Philipp Tomsich (5):
sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)
musb-new: sunxi: a64: add support to select shared phy
musb-new: sunxi: a64: adds support for clearing the SIDDP
usb: sunxi: set up usb_phy_passby only for HCI
sunxi: clock: update a64 usb clock gating and module reset bits

FYI I've been working on getting OTG working for the H3. There are quite a few similar things to change, which is where my musb patch came from.

Alas I haven't been able to get it working in peripheral mode yet. I do have EHCI0/OHCI0 working for host mode though.

ChenYu

Quoted 30 lines
 arch/arm/dts/sun50i-a64-bananapi-m64.dts      |  27 +++
 arch/arm/dts/sun50i-a64-olinuxino.dts         |  19 ++
 arch/arm/include/asm/arch-sunxi/clock_sun6i.h |  16 +-
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h   |   6 +
 arch/arm/include/asm/arch-sunxi/usb_phy.h     |   2 +
 arch/arm/mach-sunxi/Makefile                  |   9 +
 arch/arm/mach-sunxi/pmic_bus.c                |   9 +-
 arch/arm/mach-sunxi/rsb.c                     |   2 +-
 arch/arm/mach-sunxi/usb_phy.c                 |  24 ++-
 board/sunxi/board.c                           |  40 ++++
 configs/a64-olinuxino_defconfig               |   6 +
 configs/bananapi_m64_defconfig                |   4 +
 drivers/power/Kconfig                         |  95 +++++++---
 drivers/power/Makefile                        |   3 +
 drivers/power/axp803.c                        | 260 ++++++++++++++++++++++++++
 drivers/usb/host/ehci-sunxi.c                 |  10 +
 drivers/usb/host/ohci-sunxi.c                 |  10 +
 drivers/usb/musb-new/musb_regs.h              |   3 +-
 drivers/usb/musb-new/sunxi.c                  |  24 ++-
 include/axp803.h                              |  68 +++++++
 include/axp_pmic.h                            |   4 +
 include/configs/sun50i.h                      |   2 +-
 22 files changed, 598 insertions(+), 45 deletions(-)
 create mode 100644 drivers/power/axp803.c
 create mode 100644 include/axp803.h

--
2.7.4

#3 lore raw

PATCH 1/16 power: sunxi: add AXP803 PMIC support

In reply to Maxime Ripard
Quoted 26 lines · Maxime Ripard

Hi,

Quoted 5 lines · Jagan Teki

AXP803 another PMIC produced by x-powers and paired with A64 via RSB bus.

unlike other axp chip's support in SPL this is only added for U-Boot proper since SPL on A64 has no space to add anything.

How do you setup the CPU and DRAM regulators then?

Quoted 15 lines
---
 arch/arm/mach-sunxi/Makefile   |   9 ++
 arch/arm/mach-sunxi/pmic_bus.c |   9 +-
 arch/arm/mach-sunxi/rsb.c      |   2 +-
 board/sunxi/board.c            |  40 +++++++
 drivers/power/Kconfig          |  95 ++++++++++-----
 drivers/power/Makefile         |   3 +
 drivers/power/axp803.c         | 260 +++++++++++++++++++++++++++++++++++++++++
 include/axp803.h               |  68 +++++++++++
 include/axp_pmic.h             |   4 +
 9 files changed, 458 insertions(+), 32 deletions(-)
 create mode 100644 drivers/power/axp803.c
 create mode 100644 include/axp803.h
Quoted 14 lines

arch/arm/mach-sunxi/Makefile endif · line 24

Quoted 11 lines
arch/arm/mach-sunxi/Makefile +3 -0
index 2a3c379..aedf22f 100644
@@ -19,9 +19,15 @@ endif
 obj-$(CONFIG_MACH_SUN6I)     += prcm.o
 obj-$(CONFIG_MACH_SUN8I)     += prcm.o
 obj-$(CONFIG_MACH_SUN9I)     += prcm.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_MACH_SUN50I)    += prcm.o
+endif

The number of lines here is starting to be a bit ridiculous, please make a Kconfig option selected by the SoC families.

as of now there was no Kconfig option for prcm, we shouldn't build this for SPL because of size limitation.

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
author
#5 lore raw

PATCH 1/16 power: sunxi: add AXP803 PMIC support

In reply to Maxime Ripard
Quoted 10 lines · Maxime Ripard

Hi,

Quoted 5 lines · Jagan Teki

AXP803 another PMIC produced by x-powers and paired with A64 via RSB bus.

unlike other axp chip's support in SPL this is only added for U-Boot proper since SPL on A64 has no space to add anything.

How do you setup the CPU and DRAM regulators then?

If we need axp for these, then it should be part of SPL and SPL can't fit with this code. as of now PMIC is configured in ATF, I guess that will take care of CPU, DRAM.

Once we have a TPL(only option I have seen as of now) or similar setup that will avoid SPL size limitation, may be we can move this axp803 into SPL.

thanks!

Signature · 4 lines
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#24 lore raw

PATCH 12/16 configs: sun50i: enable ums on bananapi-m64

In reply to Maxime Ripard
Quoted 23 lines · Maxime Ripard

Hi,

Quoted 12 lines · Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---
 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/bananapi_m64_defconfig +0 -0
index 55feafe..d4aade5 100644

configs/bananapi_m64_defconfig CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" · line 14

Quoted 4 lines
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_USB_MASS_STORAGE=y

How does that work with the current over-size issue we have on the A64?

Quoted 7 lines

And I'd also like to keep the way we did things for several years now, which is to *not* have board-specific options selected besides the hardware-related ones.

If you want to enable a general feature, do it for all the boards so that our users will have a consistent experience across boards, and we will not have to always chase all the defconfigs to provide it.

I always believe test-proven even it is general feature there may be changes it may(not) work on all boards. Once the relevant boards have needed it and then it will anyway added.

Quoted 8 lines

And I guess the next question would be: what is the targetted use case and why should we enable it for all the boards? We're having binary size issues on the A64, so we really want to provide something meaningful for the majority of our users.

We won't enable something used by only a small fraction, especially when it's so easy to enable it.

Yes, this was tested on this board and it is working. the use-case I've seen to upgrade the target partitioned-disk directly from host instead of plug-and-play every time and especially with eMMC.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#20 lore raw

PATCH 11/16 configs: sun50i: add usb-otg support for bananapi-m64

In reply to Maxime Ripard
Quoted 23 lines · Maxime Ripard
Quoted 22 lines · Jagan Teki

USB-OTG require MUSB driver along with PHY#0 id(PH9) and/or vbus pin through AXP_GPIO driver.

This patch add support for it.

---
 configs/bananapi_m64_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/bananapi_m64_defconfig +2 -0
index 461567f..55feafe 100644
@@ -4,6 +4,8 @@ CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_MMC0_CD_PIN="PH13"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB0_ID_DET="PH9"
+CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
Quoted 8 lines

configs/bananapi_m64_defconfig CONFIG_SPL=y · line 19

Quoted 6 lines
configs/bananapi_m64_defconfig +1 -0
 CONFIG_SPL=y
@@ -14,4 +16,5 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y

Did you test the host mode as well?

No, I've not tried host mode yet.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#26 lore raw

[U-Boot] [linux-sunxi] Re: [PATCH 12/16] configs: sun50i: enable ums on bananapi-m64

In reply to Maxime Ripard
Quoted 26 lines · 在 2017年12月12日星期二 CST 下午4:12:13,Maxime Ripard 写道:

Hi,

Quoted 13 lines · Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---

 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/configs/bananapi_m64_defconfig index 55feafe..d4aade5 100644

configs/bananapi_m64_defconfig CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" · line 16

Quoted 6 lines
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 
+CONFIG_CMD_USB_MASS_STORAGE=y

How does that work with the current over-size issue we have on the A64?

Quoted 7 lines

And I'd also like to keep the way we did things for several years now, which is to *not* have board-specific options selected besides the hardware-related ones.

If you want to enable a general feature, do it for all the boards so that our users will have a consistent experience across boards, and we will not have to always chase all the defconfigs to provide it.

I think there's a problem on A64 -- the Pine series are all designed to be host-only, and it's the most popular A64 board series.

Quoted 10 lines

And I guess the next question would be: what is the targetted use case and why should we enable it for all the boards? We're having binary size issues on the A64, so we really want to provide something meaningful for the majority of our users.

We won't enable something used by only a small fraction, especially when it's so easy to enable it.

Maxime

#27 lore raw

[U-Boot] [linux-sunxi] Re: [PATCH 12/16] configs: sun50i: enable ums on bananapi-m64

Quoted 32 lines · CET Icenowy Zheng
Quoted 30 lines · 在 2017年12月12日星期二 CST 下午4:12:13,Maxime Ripard 写道:

Hi,

Quoted 13 lines · Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---

 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/configs/bananapi_m64_defconfig index 55feafe..d4aade5 100644

configs/bananapi_m64_defconfig CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" · line 16

Quoted 6 lines
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 
+CONFIG_CMD_USB_MASS_STORAGE=y

How does that work with the current over-size issue we have on the A64?

And I'd also like to keep the way we did things for several years now, which is to *not* have board-specific options selected besides the hardware-related ones.

Quoted 6 lines
Quoted 3 lines

If you want to enable a general feature, do it for all the boards so that our users will have a consistent experience across boards, and we will not have to always chase all the defconfigs to provide it.

I think there's a problem on A64 -- the Pine series are all designed to be host-only, and it's the most popular A64 board series.

No, it just means the *initial* role of the Pine will be Host, but the roles can be swapped using HNP (Host Negotiation Protocol) afterwards, which is pure software.

Regards,

Stefan

Signature · 9 lines
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171213/8d6b7268/attachment.sig>
#28 lore raw

[U-Boot] [linux-sunxi] Re: [PATCH 12/16] configs: sun50i: enable ums on bananapi-m64

Quoted 37 lines · Stefan Brüns
Quoted 36 lines · CET Icenowy Zheng
Quoted 33 lines · 在 2017年12月12日星期二 CST 下午4:12:13,Maxime Ripard 写道:

Hi,

Quoted 13 lines · Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---

 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/configs/bananapi_m64_defconfig index 55feafe..d4aade5 100644

configs/bananapi_m64_defconfig CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" · line 16

Quoted 6 lines
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 
+CONFIG_CMD_USB_MASS_STORAGE=y

How does that work with the current over-size issue we have on the A64?

And I'd also like to keep the way we did things for several years now, which is to *not* have board-specific options selected besides the hardware-related ones.

If you want to enable a general feature, do it for all the boards so that our users will have a consistent experience across boards, and we will not have to always chase all the defconfigs to provide it.

Quoted 6 lines
Quoted 2 lines

I think there's a problem on A64 -- the Pine series are all designed to be host-only, and it's the most popular A64 board series.

No, it just means the *initial* role of the Pine will be Host, but the roles can be swapped using HNP (Host Negotiation Protocol) afterwards, which is pure software.

I don't think we can configure otg in peripheral mode, atleast I couldn't find any info in schematics and it's not working at software level(based on my recent test)

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#4 lore raw

PATCH 1/16 power: sunxi: add AXP803 PMIC support

In reply to Jagan Teki
Quoted 43 lines · Jagan Teki
Quoted 26 lines · Maxime Ripard

Hi,

Quoted 5 lines · Jagan Teki

AXP803 another PMIC produced by x-powers and paired with A64 via RSB bus.

unlike other axp chip's support in SPL this is only added for U-Boot proper since SPL on A64 has no space to add anything.

How do you setup the CPU and DRAM regulators then?

Quoted 15 lines
---
 arch/arm/mach-sunxi/Makefile   |   9 ++
 arch/arm/mach-sunxi/pmic_bus.c |   9 +-
 arch/arm/mach-sunxi/rsb.c      |   2 +-
 board/sunxi/board.c            |  40 +++++++
 drivers/power/Kconfig          |  95 ++++++++++-----
 drivers/power/Makefile         |   3 +
 drivers/power/axp803.c         | 260 +++++++++++++++++++++++++++++++++++++++++
 include/axp803.h               |  68 +++++++++++
 include/axp_pmic.h             |   4 +
 9 files changed, 458 insertions(+), 32 deletions(-)
 create mode 100644 drivers/power/axp803.c
 create mode 100644 include/axp803.h
Quoted 14 lines

arch/arm/mach-sunxi/Makefile endif · line 24

Quoted 11 lines
arch/arm/mach-sunxi/Makefile +3 -0
index 2a3c379..aedf22f 100644
@@ -19,9 +19,15 @@ endif
 obj-$(CONFIG_MACH_SUN6I)     += prcm.o
 obj-$(CONFIG_MACH_SUN8I)     += prcm.o
 obj-$(CONFIG_MACH_SUN9I)     += prcm.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_MACH_SUN50I)    += prcm.o
+endif

The number of lines here is starting to be a bit ridiculous, please make a Kconfig option selected by the SoC families.

Quoted 1 line

as of now there was no Kconfig option for prcm,

This is my point, you should add it :)

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171213/babcdb37/attachment.sig>
#21 lore raw

PATCH 11/16 configs: sun50i: add usb-otg support for bananapi-m64

In reply to Jagan Teki
Quoted 34 lines · Jagan Teki
Quoted 23 lines · Maxime Ripard
Quoted 22 lines · Jagan Teki

USB-OTG require MUSB driver along with PHY#0 id(PH9) and/or vbus pin through AXP_GPIO driver.

This patch add support for it.

---
 configs/bananapi_m64_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/bananapi_m64_defconfig +2 -0
index 461567f..55feafe 100644
@@ -4,6 +4,8 @@ CONFIG_MACH_SUN50I=y
 CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_MMC0_CD_PIN="PH13"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB0_ID_DET="PH9"
+CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
Quoted 8 lines

configs/bananapi_m64_defconfig CONFIG_SPL=y · line 19

Quoted 6 lines
configs/bananapi_m64_defconfig +1 -0
 CONFIG_SPL=y
@@ -14,4 +16,5 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y

Did you test the host mode as well?

Quoted 1 line

No, I've not tried host mode yet.

Then you didn't test that at least the ID pin and the VBUS control was working :)

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171213/18549f74/attachment.sig>
#25 lore raw

PATCH 12/16 configs: sun50i: enable ums on bananapi-m64

In reply to Jagan Teki

Hi,

Quoted 29 lines · Jagan Teki
Quoted 27 lines · Maxime Ripard

Hi,

Quoted 12 lines · Jagan Teki

This patch enable ums through CMD_USB_MASS_STORAGE.

---
 configs/bananapi_m64_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/bananapi_m64_defconfig +0 -0
index 55feafe..d4aade5 100644

configs/bananapi_m64_defconfig CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" · line 14

Quoted 4 lines
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_USB_MASS_STORAGE=y

How does that work with the current over-size issue we have on the A64?

And I'd also like to keep the way we did things for several years now, which is to *not* have board-specific options selected besides the hardware-related ones.

Quoted 7 lines
Quoted 3 lines

If you want to enable a general feature, do it for all the boards so that our users will have a consistent experience across boards, and we will not have to always chase all the defconfigs to provide it.

I always believe test-proven even it is general feature there may be changes it may(not) work on all boards. Once the relevant boards have needed it and then it will anyway added.

And this leads to inconsistencies across boards in the features they support, which in turn lead to downstream users being unable to rely on one particular feature being enabled. And really, this is what we've doing all along.

Quoted 11 lines
Quoted 7 lines

And I guess the next question would be: what is the targetted use case and why should we enable it for all the boards? We're having binary size issues on the A64, so we really want to provide something meaningful for the majority of our users.

We won't enable something used by only a small fraction, especially when it's so easy to enable it.

Yes, this was tested on this board and it is working. the use-case I've seen to upgrade the target partitioned-disk directly from host instead of plug-and-play every time and especially with eMMC.

We already have DFU and fastboot to cover that. Do we really need to have a third option when we already have size issues in our binary?

Really, if someone uses it, then yeah, we should make it as convenient as possible to enable it. But since it's just one option to check, what's the point?

That's also why we have Kconfig after all.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171213/fdea2d2c/attachment.sig>
#36 lore raw

cover sun50i: a64: add support for axp803, musb

In reply to Chen-Yu Tsai
Quoted 30 lines · Chen-Yu Tsai

Hi,

Quoted 20 lines · Jagan Teki

This series deals axp803, musb and related improvements on a64
- axp803 PMIC support used by a64
- a64 musb improvements (rework by Philipp [1])
- musb support for bananapi-m64, a64-olinuxino

[1] https://patchwork.ozlabs.org/patch/729246/

Jagan Teki (11):
power: sunxi: add AXP803 PMIC support
sunxi: adjust usb bases between H3_H5 vs a64
musb-new: sunxi: add common SUNXI_MUSB_BASE
sunxi: usb_phy: Update a64 sunxi_usb_phy base
arm64: allwinner: sync bananapi-m64 usb nodes from Linux
configs: sun50i: add usb-otg support for bananapi-m64
configs: sun50i: enable ums on bananapi-m64
arm64: allwinner: sync a64-olinuxino usb nodes from Linux
configs: sun50i: add usb-otg support for a64-olinuxino
configs: sun50i: enable ums on a64-olinuxino
configs: sun50i: Enable eMMC on a64-olinuxino

Quoted 6 lines

Philipp Tomsich (5):
sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)
musb-new: sunxi: a64: add support to select shared phy
musb-new: sunxi: a64: adds support for clearing the SIDDP
usb: sunxi: set up usb_phy_passby only for HCI
sunxi: clock: update a64 usb clock gating and module reset bits

Quoted 3 lines

FYI I've been working on getting OTG working for the H3. There are quite a few similar things to change, which is where my musb patch came from.

OK, are these changes on ML yet? I think H5 also similar like H3. I'm trying for that as well.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#37 lore raw

cover sun50i: a64: add support for axp803, musb

Quoted 31 lines · Jagan Teki
Quoted 30 lines · Chen-Yu Tsai

Hi,

Quoted 26 lines · Jagan Teki

This series deals axp803, musb and related improvements on a64
- axp803 PMIC support used by a64
- a64 musb improvements (rework by Philipp [1])
- musb support for bananapi-m64, a64-olinuxino

[1] https://patchwork.ozlabs.org/patch/729246/

Jagan Teki (11):
power: sunxi: add AXP803 PMIC support
sunxi: adjust usb bases between H3_H5 vs a64
musb-new: sunxi: add common SUNXI_MUSB_BASE
sunxi: usb_phy: Update a64 sunxi_usb_phy base
arm64: allwinner: sync bananapi-m64 usb nodes from Linux
configs: sun50i: add usb-otg support for bananapi-m64
configs: sun50i: enable ums on bananapi-m64
arm64: allwinner: sync a64-olinuxino usb nodes from Linux
configs: sun50i: add usb-otg support for a64-olinuxino
configs: sun50i: enable ums on a64-olinuxino
configs: sun50i: Enable eMMC on a64-olinuxino

Philipp Tomsich (5):
sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)
musb-new: sunxi: a64: add support to select shared phy
musb-new: sunxi: a64: adds support for clearing the SIDDP
usb: sunxi: set up usb_phy_passby only for HCI
sunxi: clock: update a64 usb clock gating and module reset bits

Quoted 6 lines
Quoted 3 lines

FYI I've been working on getting OTG working for the H3. There are quite a few similar things to change, which is where my musb patch came from.

OK, are these changes on ML yet? I think H5 also similar like H3. I'm trying for that as well.

Not yet. I haven't been able to get it working in peripheral mode. The changes for host mode are here:

https://github.com/wens/u-boot-sunxi/commits/libretech-cc

ChenYu

#38 lore raw

cover sun50i: a64: add support for axp803, musb

Quoted 36 lines · Chen-Yu Tsai
Quoted 35 lines · Jagan Teki
Quoted 33 lines · Chen-Yu Tsai

Hi,

Quoted 20 lines · Jagan Teki

This series deals axp803, musb and related improvements on a64
- axp803 PMIC support used by a64
- a64 musb improvements (rework by Philipp [1])
- musb support for bananapi-m64, a64-olinuxino

[1] https://patchwork.ozlabs.org/patch/729246/

Jagan Teki (11):
power: sunxi: add AXP803 PMIC support
sunxi: adjust usb bases between H3_H5 vs a64
musb-new: sunxi: add common SUNXI_MUSB_BASE
sunxi: usb_phy: Update a64 sunxi_usb_phy base
arm64: allwinner: sync bananapi-m64 usb nodes from Linux
configs: sun50i: add usb-otg support for bananapi-m64
configs: sun50i: enable ums on bananapi-m64
arm64: allwinner: sync a64-olinuxino usb nodes from Linux
configs: sun50i: add usb-otg support for a64-olinuxino
configs: sun50i: enable ums on a64-olinuxino
configs: sun50i: Enable eMMC on a64-olinuxino

Quoted 6 lines

Philipp Tomsich (5):
sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)
musb-new: sunxi: a64: add support to select shared phy
musb-new: sunxi: a64: adds support for clearing the SIDDP
usb: sunxi: set up usb_phy_passby only for HCI
sunxi: clock: update a64 usb clock gating and module reset bits

FYI I've been working on getting OTG working for the H3. There are quite a few similar things to change, which is where my musb patch came from.

Quoted 5 lines
Quoted 2 lines

OK, are these changes on ML yet? I think H5 also similar like H3. I'm trying for that as well.

Not yet. I haven't been able to get it working in peripheral mode. The changes for host mode are here:

Ok, do you have phy data-sheet? I couldn't find it anywhere.

#39 lore raw

cover sun50i: a64: add support for axp803, musb

Quoted 37 lines · Jagan Teki
Quoted 36 lines · Chen-Yu Tsai
Quoted 35 lines · Jagan Teki
Quoted 33 lines · Chen-Yu Tsai

Hi,

Quoted 20 lines · Jagan Teki

This series deals axp803, musb and related improvements on a64
- axp803 PMIC support used by a64
- a64 musb improvements (rework by Philipp [1])
- musb support for bananapi-m64, a64-olinuxino

[1] https://patchwork.ozlabs.org/patch/729246/

Jagan Teki (11):
power: sunxi: add AXP803 PMIC support
sunxi: adjust usb bases between H3_H5 vs a64
musb-new: sunxi: add common SUNXI_MUSB_BASE
sunxi: usb_phy: Update a64 sunxi_usb_phy base
arm64: allwinner: sync bananapi-m64 usb nodes from Linux
configs: sun50i: add usb-otg support for bananapi-m64
configs: sun50i: enable ums on bananapi-m64
arm64: allwinner: sync a64-olinuxino usb nodes from Linux
configs: sun50i: add usb-otg support for a64-olinuxino
configs: sun50i: enable ums on a64-olinuxino
configs: sun50i: Enable eMMC on a64-olinuxino

Quoted 6 lines

Philipp Tomsich (5):
sunxi (sun50i): Set CONFIG_SUNXI_USB_PHYS to 2 (the A64 has 2 PHYs)
musb-new: sunxi: a64: add support to select shared phy
musb-new: sunxi: a64: adds support for clearing the SIDDP
usb: sunxi: set up usb_phy_passby only for HCI
sunxi: clock: update a64 usb clock gating and module reset bits

FYI I've been working on getting OTG working for the H3. There are quite a few similar things to change, which is where my musb patch came from.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

OK, are these changes on ML yet? I think H5 also similar like H3. I'm trying for that as well.

Not yet. I haven't been able to get it working in peripheral mode. The changes for host mode are here:

Ok, do you have phy data-sheet? I couldn't find it anywhere.

No. The only thing we have to go on is the BSP kernel code.

ChenYu