From: Yao Zi <me@ziyao.cc>
To: Eric Chung <eric.chung@riscstar.com>,
u-boot-spacemit@groups.io, u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Peng Fan <peng.fan@nxp.com>,
Huan Zhou <pericycle.cc@gmail.com>,
Raymond Mao <raymond.mao@riscstar.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Bhimeswararao Matsa <bhimeswararao.matsa@gmail.com>,
Tanmay Kathpalia <tanmay.kathpalia@altera.com>,
Kaustabh Chakraborty <kauschluss@disroot.org>,
Han Xu <han.xu@nxp.com>, Yanir Levin <yanir.levin@tandemg.com>,
Christoph Stoidner <c.stoidner@phytec.de>,
Balsundar Ponnusamy <balsundar.ponnusamy@altera.com>,
Daniel Palmer <daniel@thingy.jp>, Anshul Dalal <anshuld@ti.com>,
Bastien Curutchet <bastien.curutchet@bootlin.com>,
Angelo Dureghello <angelo@kernel-space.org>,
Johan Jonker <jbx6244@gmail.com>, Rick Chen <rick@andestech.com>,
Leo <ycliang@andestech.com>,
Sam Protsenko <semen.protsenko@linaro.org>,
Guodong Xu <guodong.xu@riscstar.com>,
Tim Ouyang <tim609@andestech.com>,
Leo Liang <leo.liang@sifive.com>, Yao Zi <me@ziyao.cc>
Subject: Re: [PATCH v4 02/10] pinctrl: k1: add IO power domain configuration support
Date: Sun, 19 Jul 2026 17:01:25 +0000 [thread overview]
Message-ID: <al0C5dYG7SaWZHYo@pie> (raw)
In-Reply-To: <20260707-m4-v4-2-dbd01185f911@riscstar.com>
On Tue, Jul 07, 2026 at 11:21:43PM +0800, Eric Chung wrote:
> Dual-voltage GPIO banks default to 3.3V, but when externally supplied
> with 1.8V the internal logic must be explicitly reconfigured to match.
>
> Add the ability to program IO power domain control registers through the
> APBC block. These registers require unlocking the AIB Secure Access
> Register (ASAR) before every read/write, since configuring a 1.8V domain
> while 3.3V is externally supplied can cause back-powering and pin damage.
>
> Signed-off-by: Eric Chung <eric.chung@riscstar.com>
>
> ---
> v3:
> - Add SYSCON dependency in Kconfig.
> - Fix not sorted issue in the driver.
> ---
> drivers/pinctrl/spacemit/Kconfig | 2 +-
> drivers/pinctrl/spacemit/pinctrl-k1.c | 83 ++++++++++++++++++++++++++++++++++-
> 2 files changed, 82 insertions(+), 3 deletions(-)
...
> diff --git a/drivers/pinctrl/spacemit/pinctrl-k1.c b/drivers/pinctrl/spacemit/pinctrl-k1.c
> index 3ebc397213b..95344f4ec72 100644
> --- a/drivers/pinctrl/spacemit/pinctrl-k1.c
> +++ b/drivers/pinctrl/spacemit/pinctrl-k1.c
> @@ -12,6 +12,8 @@
> #include <linux/bitops.h>
> #include <linux/errno.h>
> #include <linux/io.h>
> +#include <regmap.h>
> +#include <syscon.h>
>
> /*
> * +---------+----------+-----------+--------+--------+----------+--------+
> @@ -34,8 +36,23 @@
> #define PAD_PULLUP BIT(14)
> #define PAD_PULL_EN BIT(15)
>
> -#define PIN_POWER_STATE_1V8 1800
> -#define PIN_POWER_STATE_3V3 3300
> +#define IO_PWR_DOMAIN_OFFSET 0x800
> +
> +#define IO_PWR_DOMAIN_GPIO2_Kx 0x0c
> +#define IO_PWR_DOMAIN_GPIO3_K1 0x10
> +#define IO_PWR_DOMAIN_MMC_Kx 0x1c
> +#define IO_PWR_DOMAIN_QSPI_K1 0x20
> +
> +#define IO_PWR_DOMAIN_V18EN BIT(2)
> +
> +#define APBC_ASFAR 0x50
> +#define APBC_ASSAR 0x54
> +
> +#define APBC_ASFAR_AKEY 0xbaba
> +#define APBC_ASSAR_AKEY 0xeb10
> +
> +#define PIN_POWER_STATE_1V8 1800
> +#define PIN_POWER_STATE_3V3 3300
Space and TABs are both used to separate the identifiers with the
values, please choose a unified style.
With this fixed,
Reviewed-by: Yao Zi <me@ziyao.cc>
Best regards,
Yao Zi
next prev parent reply other threads:[~2026-07-19 17:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 15:21 [PATCH v4 00/10] spacemit mmc driver Eric Chung
2026-07-07 15:21 ` [PATCH v4 01/10] spacemit: k1: select boot device via config registers Eric Chung
2026-07-19 16:55 ` Yao Zi
2026-07-07 15:21 ` [PATCH v4 02/10] pinctrl: k1: add IO power domain configuration support Eric Chung
2026-07-19 17:01 ` Yao Zi [this message]
2026-07-07 15:21 ` [PATCH v4 03/10] mmc: enable CMD23 for multi-block transfers Eric Chung
2026-07-19 17:12 ` Yao Zi
2026-07-20 10:42 ` Eric Chung
2026-07-20 10:44 ` Eric Chung
2026-07-20 11:54 ` Kathpalia, Tanmay
2026-07-07 15:21 ` [PATCH v4 04/10] mmc: k1: add sdhci platform driver Eric Chung
2026-07-19 17:46 ` Yao Zi
2026-07-07 15:21 ` [PATCH v4 05/10] dts: k1: add SD card support in u-boot overlay Eric Chung
2026-07-19 17:53 ` Yao Zi
2026-07-07 15:21 ` [PATCH v4 06/10] configs: k1: enable SD and eMMC support Eric Chung
2026-07-07 15:21 ` [PATCH v4 07/10] MAINTAINER: update Spacemit K1 entry Eric Chung
2026-07-07 15:21 ` [PATCH v4 08/10] doc: spacemit: flash on K1 SoC based boards Eric Chung
2026-07-07 15:21 ` [PATCH v4 09/10] config: k1: enable ENV support for eMMC Eric Chung
2026-07-07 15:21 ` [PATCH v4 10/10] spacemit: k1: load product name from environment variable Eric Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=al0C5dYG7SaWZHYo@pie \
--to=me@ziyao.cc \
--cc=angelo@kernel-space.org \
--cc=anshuld@ti.com \
--cc=balsundar.ponnusamy@altera.com \
--cc=bastien.curutchet@bootlin.com \
--cc=bhimeswararao.matsa@gmail.com \
--cc=c.stoidner@phytec.de \
--cc=daniel@thingy.jp \
--cc=eric.chung@riscstar.com \
--cc=guodong.xu@riscstar.com \
--cc=han.xu@nxp.com \
--cc=jbx6244@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=kauschluss@disroot.org \
--cc=leo.liang@sifive.com \
--cc=peng.fan@nxp.com \
--cc=pericycle.cc@gmail.com \
--cc=raymond.mao@riscstar.com \
--cc=rick@andestech.com \
--cc=semen.protsenko@linaro.org \
--cc=tanmay.kathpalia@altera.com \
--cc=tim609@andestech.com \
--cc=trini@konsulko.com \
--cc=u-boot-spacemit@groups.io \
--cc=u-boot@lists.denx.de \
--cc=yanir.levin@tandemg.com \
--cc=ycliang@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox