* [PATCH 2/5] sunxi: A523: add LPDDR3 DRAM support
2026-12-05 15:15 [PATCH 0/5] sunxi: A523: add LPDDR3 DRAM support and Teclast P85T board Mikhail Kalashnikov
2026-12-05 15:15 ` [PATCH 1/5] sunxi: A523: add missing DDR4 bits Mikhail Kalashnikov
@ 2026-12-05 15:15 ` Mikhail Kalashnikov
2026-12-05 15:15 ` [PATCH 3/5] arm64: dts: allwinner: add Teclast P85T Mikhail Kalashnikov
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Mikhail Kalashnikov @ 2026-12-05 15:15 UTC (permalink / raw)
To: u-boot
Cc: Andre Przywara, Jernej Skrabec, Tom Rini, Ilias Apalodimas,
Hans de Goede
Add LPDDR3 support for the A523 DRAM controller. The PHY ODT,
CA delay, mode register sequence, ODT map/timing and DRAM type
selection are based on the vendor boot0.
The LPDDR3 timing file uses safe fallback values and reduced clock
rates for the Teclast P85T, the only known A523 LPDDR3 board. It is
marked with a FIXME and should be replaced with vendor-derived or
JEDEC timings.
The MSTR rank mask is set to the stock four-rank value until rank
auto-detection can handle four ranks. MSTR[27:24] is a four-bit
active-rank mask, not a two-bit field, so extend MSTR_ACTIVE_RANKS()
to describe the full mask. For one and two ranks the resulting
values are unchanged.
As a result, the driver currently exposes 2 GiB of the P85T's 4 GiB;
this is a known limitation and will be addressed separately.
Signed-off-by: Mikhail Kalashnikov <iuncuim@gmail.com>
---
.../include/asm/arch-sunxi/dram_sun55i_a523.h | 3 +-
arch/arm/mach-sunxi/Kconfig | 8 ++
arch/arm/mach-sunxi/dram_sun55i_a523.c | 90 ++++++++++++++++---
arch/arm/mach-sunxi/dram_timings/Makefile | 1 +
.../arm/mach-sunxi/dram_timings/a523_lpddr3.c | 82 +++++++++++++++++
5 files changed, 170 insertions(+), 14 deletions(-)
create mode 100644 arch/arm/mach-sunxi/dram_timings/a523_lpddr3.c
diff --git a/arch/arm/include/asm/arch-sunxi/dram_sun55i_a523.h b/arch/arm/include/asm/arch-sunxi/dram_sun55i_a523.h
index 08bfe462856..069c3f72744 100644
--- a/arch/arm/include/asm/arch-sunxi/dram_sun55i_a523.h
+++ b/arch/arm/include/asm/arch-sunxi/dram_sun55i_a523.h
@@ -106,7 +106,8 @@ check_member(sunxi_mctl_ctl_reg, unk_0x4240, 0x4240);
#define MSTR_2TMODE BIT(10)
#define MSTR_BUSWIDTH_FULL (0 << 12)
#define MSTR_BUSWIDTH_HALF (1 << 12)
-#define MSTR_ACTIVE_RANKS(x) ((((x) == 2) ? 3 : 1) << 24)
+/* MSTR[27:24] is the active-rank mask. */
+#define MSTR_ACTIVE_RANKS(x) ((BIT(x) - 1) << 24)
#define MSTR_BURST_LENGTH(x) (((x) >> 1) << 16)
#define TPR10_CA_BIT_DELAY 0xffff0000
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index b7ee14c6678..f580f54f8ae 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -713,6 +713,14 @@ config SUNXI_DRAM_A523_DDR3
This option is the DDR3 timing used by the stock boot0 by
Allwinner.
+config SUNXI_DRAM_A523_LPDDR3
+ bool "LPDDR3 DRAM chips on the A523/T527 DRAM controller"
+ select SUNXI_DRAM_LPDDR3
+ depends on DRAM_SUN55I_A523
+ help
+ This option is the LPDDR3 timing used by the stock boot0 by
+ Allwinner.
+
config SUNXI_DRAM_A523_LPDDR4
bool "LPDDR4 DRAM chips on the A523/T527 DRAM controller"
select SUNXI_DRAM_LPDDR4
diff --git a/arch/arm/mach-sunxi/dram_sun55i_a523.c b/arch/arm/mach-sunxi/dram_sun55i_a523.c
index e175fac4008..c8e287a259f 100644
--- a/arch/arm/mach-sunxi/dram_sun55i_a523.c
+++ b/arch/arm/mach-sunxi/dram_sun55i_a523.c
@@ -2,7 +2,7 @@
/*
* sun55i A523/A527/T527/H728 platform DRAM controller driver
*
- * This driver supports DDR3 and LPDDR4 memory.
+ * This driver supports DDR3, LPDDR3 and LPDDR4 memory.
*
* (C) Copyright 2024 Jernej Skrabec <jernej.skrabec@gmail.com>
*
@@ -180,14 +180,29 @@ static void mctl_phy_configure_odt(const struct dram_para *para)
val_hi = para->dx_odt;
val_lo = (para->type == SUNXI_DRAM_TYPE_LPDDR4) ? 0 : para->dx_odt;
- clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x304, 0x00001f1f,
- (MASK_BYTE(val_hi, 0) << 8) | MASK_BYTE(val_lo, 0));
- clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x484, 0x00001f1f,
- (MASK_BYTE(val_hi, 1) << 8) | MASK_BYTE(val_lo, 1));
- clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x604, 0x00001f1f,
- (MASK_BYTE(val_hi, 2) << 8) | MASK_BYTE(val_lo, 2));
- clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x784, 0x00001f1f,
- (MASK_BYTE(val_hi, 3) << 8) | MASK_BYTE(val_lo, 3));
+ if (para->type == SUNXI_DRAM_TYPE_LPDDR3) {
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x304, 0x00001f1f,
+ MASK_BYTE(val_lo, 0));
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x484, 0x00001f1f,
+ MASK_BYTE(val_lo, 1));
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x604, 0x00001f1f,
+ MASK_BYTE(val_lo, 2));
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x784, 0x00001f1f,
+ MASK_BYTE(val_lo, 3));
+ } else {
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x304, 0x00001f1f,
+ (MASK_BYTE(val_hi, 0) << 8) |
+ MASK_BYTE(val_lo, 0));
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x484, 0x00001f1f,
+ (MASK_BYTE(val_hi, 1) << 8) |
+ MASK_BYTE(val_lo, 1));
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x604, 0x00001f1f,
+ (MASK_BYTE(val_hi, 2) << 8) |
+ MASK_BYTE(val_lo, 2));
+ clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x784, 0x00001f1f,
+ (MASK_BYTE(val_hi, 3) << 8) |
+ MASK_BYTE(val_lo, 3));
+ }
}
static bool mctl_phy_write_leveling(const struct dram_para *para,
@@ -937,6 +952,10 @@ static bool mctl_phy_init(const struct dram_para *para,
val = 0xf00;
else
val = 0x300;
+
+ if (para->type == SUNXI_DRAM_TYPE_LPDDR3)
+ val |= 0x100000;
+
clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x00, 0xf00, val);
switch (para->type) {
@@ -1187,6 +1206,23 @@ static bool mctl_phy_init(const struct dram_para *para,
writel(0x800030f0, &mctl_ctl->mrctrl0);
mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0);
break;
+ case SUNXI_DRAM_TYPE_LPDDR3:
+ writel(0x183, &mctl_ctl->mrctrl1);
+ writel(0x800000f0, &mctl_ctl->mrctrl0);
+ mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0);
+
+ writel(0x21c, &mctl_ctl->mrctrl1);
+ writel(0x800000f0, &mctl_ctl->mrctrl0);
+ mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0);
+
+ writel(0x301, &mctl_ctl->mrctrl1);
+ writel(0x800000f0, &mctl_ctl->mrctrl0);
+ mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0);
+
+ writel(0xb00, &mctl_ctl->mrctrl1);
+ writel(0x800000f0, &mctl_ctl->mrctrl0);
+ mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0);
+ break;
case SUNXI_DRAM_TYPE_LPDDR4:
if (config->clk <= 936) {
mr1 = 0x34;
@@ -1323,6 +1359,16 @@ static bool mctl_ctrl_init(const struct dram_para *para,
case SUNXI_DRAM_TYPE_DDR4:
reg_val |= MSTR_BURST_LENGTH(8) | MSTR_DEVICETYPE_DDR4 | MSTR_2TMODE;
break;
+ case SUNXI_DRAM_TYPE_LPDDR3:
+ /*
+ * FIXME: rank auto-detection only tests up to two ranks,
+ * but the P85T stock boot0 configures four ranks and uses
+ * the 0xf mask. Override the initial mask here; drop this
+ * assignment once four-rank detection is implemented.
+ */
+ reg_val = MSTR_ACTIVE_RANKS(4) | MSTR_BURST_LENGTH(8) |
+ MSTR_DEVICETYPE_LPDDR3;
+ break;
case SUNXI_DRAM_TYPE_LPDDR4:
reg_val |= MSTR_BURST_LENGTH(16) | MSTR_DEVICETYPE_LPDDR4;
break;
@@ -1335,15 +1381,25 @@ static bool mctl_ctrl_init(const struct dram_para *para,
reg_val |= MSTR_BUSWIDTH_HALF;
writel(BIT(31) | BIT(30) | reg_val, &mctl_ctl->mstr);
- if (config->ranks == 2)
- writel(0x0303, &mctl_ctl->odtmap);
- else
- writel(0x0201, &mctl_ctl->odtmap);
+ if (para->type == SUNXI_DRAM_TYPE_LPDDR3) {
+ writel(0x0f0f0f0f, &mctl_ctl->odtmap);
+ } else {
+ if (config->ranks == 2)
+ writel(0x0303, &mctl_ctl->odtmap);
+ else
+ writel(0x0201, &mctl_ctl->odtmap);
+ }
switch (para->type) {
case SUNXI_DRAM_TYPE_DDR3:
reg_val = 0x06000400;
break;
+ case SUNXI_DRAM_TYPE_LPDDR3:
+ if (config->clk < 400)
+ reg_val = 0x08020400;
+ else
+ reg_val = 0x09020400;
+ break;
case SUNXI_DRAM_TYPE_LPDDR4:
reg_val = 0x04000400;
break;
@@ -1403,6 +1459,8 @@ bool mctl_core_init(const struct dram_para *para,
static const struct dram_para para = {
#ifdef CONFIG_SUNXI_DRAM_A523_DDR3
.type = SUNXI_DRAM_TYPE_DDR3,
+#elif defined(CONFIG_SUNXI_DRAM_A523_LPDDR3)
+ .type = SUNXI_DRAM_TYPE_LPDDR3,
#elif defined(CONFIG_SUNXI_DRAM_A523_LPDDR4)
.type = SUNXI_DRAM_TYPE_LPDDR4,
#endif
@@ -1491,6 +1549,12 @@ unsigned long sunxi_dram_init(void)
config.tpr12 = 0x0e0d0a0c;
config.tpr14 = 0x48484848;
break;
+ case SUNXI_DRAM_TYPE_LPDDR3:
+ config.odt_en = 0x68686868;
+ config.tpr11 = 0x68686868;
+ config.tpr12 = 0xc0b0a0d;
+ config.tpr14 = 0x50505050;
+ break;
case SUNXI_DRAM_TYPE_LPDDR4:
config.odt_en = 0x84848484;
config.tpr11 = 0x9a9a9a9a;
diff --git a/arch/arm/mach-sunxi/dram_timings/Makefile b/arch/arm/mach-sunxi/dram_timings/Makefile
index 5de9fd5aab4..577fe023f6f 100644
--- a/arch/arm/mach-sunxi/dram_timings/Makefile
+++ b/arch/arm/mach-sunxi/dram_timings/Makefile
@@ -9,4 +9,5 @@ obj-$(CONFIG_SUNXI_DRAM_H616_LPDDR4) += h616_lpddr4_2133.o
obj-$(CONFIG_SUNXI_DRAM_A133_DDR4) += a133_ddr4.o
obj-$(CONFIG_SUNXI_DRAM_A133_LPDDR4) += a133_lpddr4.o
obj-$(CONFIG_SUNXI_DRAM_A523_DDR3) += a523_ddr3.o
+obj-$(CONFIG_SUNXI_DRAM_A523_LPDDR3) += a523_lpddr3.o
obj-$(CONFIG_SUNXI_DRAM_A523_LPDDR4) += a523_lpddr4.o
diff --git a/arch/arm/mach-sunxi/dram_timings/a523_lpddr3.c b/arch/arm/mach-sunxi/dram_timings/a523_lpddr3.c
new file mode 100644
index 00000000000..76efa5a0b65
--- /dev/null
+++ b/arch/arm/mach-sunxi/dram_timings/a523_lpddr3.c
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * sun55i A523 LPDDR3 timings
+ *
+ * (C) Copyright 2026 Mikhail Kalashnikov <iuncuim@gmail.com>
+ *
+ * FIXME: These are not the correct LPDDR3 timings. They are a working
+ * "safe" fallback that allows the Teclast P85T, currently the only known
+ * A523 board with LPDDR3, to boot. They only work with reduced DRAM
+ * clock rates and are neither derived from the vendor boot0 programming
+ * nor fully JEDEC-compliant. Replace this file with proper vendor-derived
+ * or JEDEC timings as soon as they are available.
+ */
+
+#include <asm/arch/dram.h>
+#include <asm/arch/cpu.h>
+
+void mctl_set_timing_params(u32 clk)
+{
+ struct sunxi_mctl_ctl_reg * const mctl_ctl =
+ (struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
+ u8 tccd = 2;
+ u8 tfaw = max(ns_to_t(50, clk), 4);
+ u8 trrd = max(ns_to_t(10, clk), 1);
+ u8 trcd = max(ns_to_t(24, clk), 2);
+ u8 trc = ns_to_t(70, clk);
+ u8 txp = max(ns_to_t(8, clk), 2);
+ u8 trp = ns_to_t(27, clk);
+ u8 tras = ns_to_t(42, clk);
+ u16 trefi = ns_to_t(3900, clk) / 32;
+ u16 trfc = ns_to_t(210, clk);
+ u16 txsr = ns_to_t(220, clk);
+
+ u8 tmrw = 5;
+ u8 tmrd = 5;
+ u8 tmod = max(ns_to_t(15, clk), 12);
+ u8 txs = 4;
+ u8 txsdll = 16;
+ u8 txsabort = 4;
+ u8 txsfast = 4;
+ u8 tcl = 7;
+ u8 tcwl = 4;
+ u8 twr2rd = txp + 9;
+
+ /* set DRAM timing */
+ writel((0x10 << 24) | (tfaw << 16) | (0x18 << 8) | tras,
+ &mctl_ctl->dramtmg[0]);
+ writel((txp << 16) | (txp << 8) | trc, &mctl_ctl->dramtmg[1]);
+ writel((tcwl << 24) | (tcl << 16) | (0x0d << 8) | twr2rd,
+ &mctl_ctl->dramtmg[2]);
+ writel((tmrw << 20) | (tmrd << 12) | tmod, &mctl_ctl->dramtmg[3]);
+ writel((trcd << 24) | (tccd << 16) | (trrd << 8) | trp,
+ &mctl_ctl->dramtmg[4]);
+ writel(0x05050503, &mctl_ctl->dramtmg[5]);
+ writel((txp + 2) | 0x02020000, &mctl_ctl->dramtmg[6]);
+ writel((txsfast << 24) | (txsabort << 16) | (txsdll << 8) | txs,
+ &mctl_ctl->dramtmg[8]);
+ writel(0x00020208, &mctl_ctl->dramtmg[9]);
+ writel(0xE0C05, &mctl_ctl->dramtmg[10]);
+ writel(0x440C021C, &mctl_ctl->dramtmg[11]);
+ writel(8, &mctl_ctl->dramtmg[12]);
+ writel(0xA100002, &mctl_ctl->dramtmg[13]);
+ writel(txsr, &mctl_ctl->dramtmg[14]);
+
+ writel(0x00890156, &mctl_ctl->init[0]);
+ writel(0x01f20000, &mctl_ctl->init[1]);
+ writel(0x00001705, &mctl_ctl->init[2]);
+ writel(0, &mctl_ctl->dfimisc);
+ writel(0x0083001c, &mctl_ctl->init[3]);
+ writel(0x00010000, &mctl_ctl->init[4]);
+ writel(0, &mctl_ctl->init[6]);
+ writel(0, &mctl_ctl->init[7]);
+
+ clrsetbits_le32(&mctl_ctl->rankctl, 0xff0, 0x660);
+
+ /* Configure DFI timing */
+ writel(0x028c8006, &mctl_ctl->dfitmg0);
+ writel(0x100202, &mctl_ctl->dfitmg1);
+
+ /* set refresh timing */
+ writel((trefi << 16) | trfc, &mctl_ctl->rfshtmg);
+}
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/5] arm64: dts: allwinner: add Teclast P85T
2026-12-05 15:15 [PATCH 0/5] sunxi: A523: add LPDDR3 DRAM support and Teclast P85T board Mikhail Kalashnikov
2026-12-05 15:15 ` [PATCH 1/5] sunxi: A523: add missing DDR4 bits Mikhail Kalashnikov
2026-12-05 15:15 ` [PATCH 2/5] sunxi: A523: add LPDDR3 DRAM support Mikhail Kalashnikov
@ 2026-12-05 15:15 ` Mikhail Kalashnikov
2026-12-05 15:15 ` [PATCH 4/5] [HACK] arm64: dts: allwinner: sun55i-a523-teclast-p85t: keep backlight on Mikhail Kalashnikov
2026-12-05 15:26 ` [PATCH 5/5] sunxi: add Teclast P85T defconfig Mikhail Kalashnikov
4 siblings, 0 replies; 6+ messages in thread
From: Mikhail Kalashnikov @ 2026-12-05 15:15 UTC (permalink / raw)
To: u-boot
Cc: Andre Przywara, Jernej Skrabec, Tom Rini, Ilias Apalodimas,
Hans de Goede
Add a device tree for the Teclast P85T tablet, based on the A523
SoC. The board has 4 GiB LPDDR3, 64 GiB eMMC, an 8-inch 1280x800
panel, WiFi/BT, touchscreen, accelerometer and AXP717/AXP323 PMICs.
The I2C0/I2C1 pin groups are kept in the board DTS until the
corresponding SoC dtsi changes are merged.
Signed-off-by: Mikhail Kalashnikov <iuncuim@gmail.com>
---
arch/arm/dts/Makefile | 2 +
arch/arm/dts/sun55i-a523-teclast-p85t.dts | 410 ++++++++++++++++++++++
2 files changed, 412 insertions(+)
create mode 100644 arch/arm/dts/sun55i-a523-teclast-p85t.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 22f10c8ecc5..36966d78f3f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -657,6 +657,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \
sun50i-a64-pinetab.dtb \
sun50i-a64-sopine-baseboard.dtb \
sun50i-a64-teres-i.dtb
+dtb-$(CONFIG_MACH_SUN55I_A523) += \
+ sun55i-a523-teclast-p85t.dtb
dtb-$(CONFIG_MACH_SUN9I) += \
sun9i-a80-cx-a99.dtb
diff --git a/arch/arm/dts/sun55i-a523-teclast-p85t.dts b/arch/arm/dts/sun55i-a523-teclast-p85t.dts
new file mode 100644
index 00000000000..98950bb4fa8
--- /dev/null
+++ b/arch/arm/dts/sun55i-a523-teclast-p85t.dts
@@ -0,0 +1,410 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (C) 2026 Mikhail Kalashnikov <iuncuim@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "sun55i-a523.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+ model = "Teclast P85T";
+ compatible = "teclast,p85t", "allwinner,sun55i-a523";
+ chassis-type = "tablet";
+
+ aliases {
+ serial0 = &uart0;
+ };
+
+ battery: battery {
+ compatible = "simple-battery";
+ constant-charge-current-max-microamp = <800000>;
+ voltage-max-design-microvolt = <4400000>;
+ charge-full-design-microamp-hours = <5000000>;
+ energy-full-design-microwatt-hours = <19250000>;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ ext_osc32k: ext-osc32k-clk {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ clock-output-names = "ext_osc32k";
+ };
+
+ wifi_pwrseq: pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 1 1 GPIO_ACTIVE_LOW>; /* PM1 */
+ post-power-on-delay-ms = <200>;
+ };
+
+ reg_vcc5v: vcc5v {
+ /* board wide 5V supply from the USB-C connector */
+ compatible = "regulator-fixed";
+ regulator-name = "vcc-5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+
+ reg_vmmc1: vmmc1 {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc-wifi";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <®_aldo3>;
+ gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
+ enable-active-high;
+ };
+};
+
+&gpu {
+ mali-supply = <®_dcdc2>;
+ status = "okay";
+};
+
+&i2c0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c0_pins>;
+ clock-frequency = <400000>;
+ status = "okay";
+
+ touchscreen@40 {
+ compatible = "silead,gsl1680";
+ reg = <0x40>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 9 IRQ_TYPE_EDGE_FALLING>; /* PH9 */
+ power-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
+ firmware-name = "gsl1680-teclast-p85t.fw";
+ touchscreen-size-x = <1792>;
+ touchscreen-size-y = <1152>;
+ touchscreen-inverted-y;
+ touchscreen-swapped-x-y;
+ silead,max-fingers = <5>;
+ avdd-supply = <®_cldo2>;
+ };
+};
+
+&i2c1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins>;
+ status = "okay";
+
+ accelerometer@26 {
+ compatible = "miramems,da280";
+ reg = <0x26>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 11 IRQ_TYPE_LEVEL_LOW>; /* PH11 */
+ };
+};
+
+&mmc0 {
+ vmmc-supply = <®_cldo3>;
+ cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */
+ bus-width = <4>;
+ status = "okay";
+};
+
+&mmc1 {
+ vmmc-supply = <®_vmmc1>;
+ vqmmc-supply = <®_bldo1>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+
+ wifi@1 {
+ reg = <1>;
+ interrupt-parent = <&r_pio>;
+ interrupts = <1 0 IRQ_TYPE_LEVEL_LOW>; /* PM0 */
+ interrupt-names = "host-wake";
+ };
+};
+
+&mmc2 {
+ vmmc-supply = <®_cldo3>;
+ vqmmc-supply = <®_cldo1>;
+ bus-width = <8>;
+ non-removable;
+ cap-mmc-hw-reset;
+ mmc-ddr-1_8v;
+ mmc-hs200-1_8v;
+ status = "okay";
+};
+
+&mmc2_pins {
+ drive-strength = <40>;
+};
+
+&pio {
+ vcc-pb-supply = <®_cldo3>;
+ vcc-pc-supply = <®_cldo1>;
+ vcc-pf-supply = <®_cldo3>;
+ vcc-pg-supply = <®_bldo1>;
+ vcc-ph-supply = <®_cldo3>;
+
+ i2c0_pins: i2c0-pins {
+ pins = "PH0", "PH1";
+ function = "i2c0";
+ };
+
+ i2c1_pins: i2c1-pins {
+ pins = "PH2", "PH3";
+ function = "i2c1";
+ };
+};
+
+&i2c0_pins {
+ drive-strength = <10>;
+ bias-pull-up;
+};
+
+&i2c1_pins {
+ drive-strength = <10>;
+ bias-pull-up;
+};
+
+&r_i2c0 {
+ status = "okay";
+
+ axp717: pmic@34 {
+ compatible = "x-powers,axp717";
+ reg = <0x34>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ interrupts-extended = <&nmi_intc 0 IRQ_TYPE_LEVEL_LOW>;
+ vin1-supply = <®_vcc5v>;
+ vin2-supply = <®_vcc5v>;
+ vin3-supply = <®_vcc5v>;
+ vin4-supply = <®_vcc5v>;
+ aldoin-supply = <®_vcc5v>;
+ bldoin-supply = <®_vcc5v>;
+ cldoin-supply = <®_vcc5v>;
+
+ adc {
+ compatible = "x-powers,axp717-adc";
+ #io-channel-cells = <1>;
+ };
+
+ battery-power {
+ compatible = "x-powers,axp717-battery-power-supply";
+ monitored-battery = <&battery>;
+ };
+
+ regulators {
+ /* Supplies the "little" cluster (1.4 GHz cores) */
+ reg_dcdc1: dcdc1 {
+ regulator-always-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1160000>;
+ regulator-name = "vdd-cpul";
+ };
+
+ reg_dcdc2: dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <920000>;
+ regulator-max-microvolt = <920000>;
+ regulator-name = "vdd-gpu-sys";
+ };
+
+ reg_dcdc3: dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt = <1260000>;
+ regulator-max-microvolt = <1260000>;
+ regulator-name = "vdd-dram";
+ };
+
+ reg_aldo1: aldo1 {
+ /* camera sensor AVDD */
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-name = "avdd-csi";
+ };
+
+ reg_aldo2: aldo2 {
+ /* camera sensor IOVDD */
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "iovdd-csi";
+ };
+
+ reg_aldo3: aldo3 {
+ /*
+ * supplies the I2C pins for this PMIC
+ * and the WiFi module
+ */
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-pl-pm";
+ };
+
+ reg_aldo4: aldo4 {
+ regulator-always-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc-pll-dxco-avcc";
+ };
+
+ reg_bldo1: bldo1 {
+ /* WiFi module 1.8V */
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc-wifi-1v8";
+ };
+
+ reg_bldo2: bldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc-dram-1v8";
+ };
+
+ reg_bldo3: bldo3 {
+ /* camera sensor DVDD/cameravdd */
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-name = "vcc-csi";
+ };
+
+ reg_bldo4: bldo4 {
+ /* camera sensor DVDD */
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-name = "dvdd-csi";
+ };
+
+ reg_cldo1: cldo1 {
+ /* codec CPVIN, SD/eMMC 1.8V IO */
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc-codec-mmc";
+ };
+
+ reg_cldo2: cldo2 {
+ /* touch panel supply */
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-ctp";
+ };
+
+ reg_cldo3: cldo3 {
+ /* SD/eMMC VMMC, codec VDD, UART0, g-sensor */
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-io-mmc";
+ };
+
+ reg_cldo4: cldo4 {
+ /* LCD panel supply */
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-lcd";
+ };
+
+ reg_cpusldo: cpusldo {
+ /* supplies the management core */
+ regulator-always-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ regulator-name = "vdd-cpus";
+ };
+ };
+
+ usb-power {
+ compatible = "x-powers,axp717-usb-power-supply";
+ input-current-limit-microamp = <1750000>;
+ };
+ };
+
+ axp323: pmic@36 {
+ compatible = "x-powers,axp323";
+ reg = <0x36>;
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ vin1-supply = <®_vcc5v>;
+ vin2-supply = <®_vcc5v>;
+ vin3-supply = <®_vcc5v>;
+
+ regulators {
+ aldo1 {
+ /* not connected */
+ };
+
+ dldo1 {
+ /* not connected */
+ };
+
+ /* Supplies the "big" cluster (1.8 GHz cores) */
+ reg_dcdc1_323: dcdc1 {
+ regulator-always-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1160000>;
+ regulator-name = "vdd-cpub";
+ };
+
+ /* DCDC2 is polyphased with DCDC1 */
+
+ /* Some RISC-V management core related voltage */
+ reg_dcdc3_323: dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ regulator-name = "vdd-dnr";
+ };
+ };
+ };
+};
+
+&r_pio {
+/*
+ * Specifying the supply would create a circular dependency.
+ *
+ * vcc-pl-supply = <®_aldo3>;
+ */
+ vcc-pm-supply = <®_aldo3>;
+};
+
+&rtc {
+ clocks = <&r_ccu CLK_BUS_R_RTC>, <&osc24M>,
+ <&r_ccu CLK_R_AHB>, <&ext_osc32k>;
+ clock-names = "bus", "hosc", "ahb", "ext-osc32k";
+ assigned-clocks = <&rtc CLK_OSC32K>;
+ assigned-clock-rates = <32768>;
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
+ status = "okay";
+};
+
+&uart1 {
+ /* Bluetooth HCI, 4-wire with RTS/CTS */
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ uart-has-rtscts;
+ status = "okay";
+};
+
+&usb_otg {
+ /*
+ * The USB-C port is the primary power supply; VBUS control is not
+ * wired in mainline (AXP717 has no drivevbus), so the port can only
+ * act as a USB device powered from the host side.
+ */
+ dr_mode = "peripheral";
+ status = "okay";
+};
+
+&usbphy {
+ usb0_vbus_det-gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */
+ status = "okay";
+};
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread