All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@codeconstruct.com.au>
To: "Cédric Le Goater" <clg@kaod.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Steven Lee	 <steven_lee@aspeedtech.com>,
	Troy Lee <leetroy@gmail.com>,
	Jamin Lin	 <jamin_lin@aspeedtech.com>,
	Kane Chen <kane_chen@aspeedtech.com>,
	Joel Stanley	 <joel@jms.id.au>,
	qemu-arm@nongnu.org
Subject: Re: [PATCH] hw/misc/aspeed_scu: Set both AST2600 protection key registers on reset
Date: Wed, 19 Aug 2026 09:32:57 +0930	[thread overview]
Message-ID: <6531a80710d4b2163605b7d44747189a7ab58dbf.camel@codeconstruct.com.au> (raw)
In-Reply-To: <98572f2f-cb08-45c5-aaf6-749db2a2611b@kaod.org>

On Tue, 2026-08-18 at 23:20 +0200, Cédric Le Goater wrote:
> On 8/18/26 03:43, Andrew Jeffery wrote:
> > Currently, booting Linux on the ast2600-evb machine via -kernel results
> > in a lot of warnings about failing to apply pinmux configuration when
> > binding drivers:
> > 
> >      [    7.339307][    T1] Creating 5 MTD partitions on "bmc":
> >      [    7.340402][    T1] 0x000000000000-0x0000000e0000 : "u-boot"
> >      [    7.513755][    T1] 0x0000000e0000-0x000000100000 : "u-boot-env"
> >      [    7.664219][    T1] 0x000000100000-0x000000a00000 : "kernel"
> >      [    7.826974][    T1] 0x000000a00000-0x000002a00000 : "rofs"
> >      [    8.026666][    T1] 0x000002a00000-0x000004000000 : "rwfs"
> >      [    8.201612][    T1] spi-aspeed-smc 1e630000.spi: error -EPERM: Error applying setting, reverse things back
> >      [    8.370835][    T1] spi-aspeed-smc 1e630000.spi: Calibration area too uniform, using low speed
> >      [    8.371131][    T1] spi-aspeed-smc 1e630000.spi: Force to dts configuration 100000kHz.
> >      [    8.371500][    T1] spi-aspeed-smc 1e630000.spi: CE0 read buswidth:4 [0x406c0741]
> >      [    8.766797][    T1] mdio-aspeed 1e650000.mdio: error -EPERM: Error applying setting, reverse things back
> >      [    8.906008][    T1] mdio-aspeed 1e650008.mdio: error -EPERM: Error applying setting, reverse things back
> >      [    9.039240][    T1] mdio-aspeed 1e650010.mdio: error -EPERM: Error applying setting, reverse things back
> >      [    9.147942][    T1] mdio-aspeed 1e650018.mdio: error -EPERM: Error applying setting, reverse things back
> > 
> > The pinmux configuration fails because the SCU is not unlocked.
> > 
> > Set both SCU protection keys for the AST2600. Further, set them
> > such that they behave accordance with the read value documented
> > by the datasheet. The new arrangement now upholds the comment in
> > hw/arm/aspeed.c regarding passing -kernel on the qemu command-line.
> > 
> >      [    7.568170][    T1] Creating 5 MTD partitions on "bmc":
> >      [    7.569330][    T1] 0x000000000000-0x0000000e0000 : "u-boot"
> >      [    7.740372][    T1] 0x0000000e0000-0x000000100000 : "u-boot-env"
> >      [    7.883570][    T1] 0x000000100000-0x000000a00000 : "kernel"
> >      [    8.041004][    T1] 0x000000a00000-0x000002a00000 : "rofs"
> >      [    8.196824][    T1] 0x000002a00000-0x000004000000 : "rwfs"
> >      [    8.547037][    T1] spi-aspeed-smc 1e630000.spi: Calibration area too uniform, using low speed
> >      [    8.547320][    T1] spi-aspeed-smc 1e630000.spi: Force to dts configuration 100000kHz.
> >      [    8.547642][    T1] spi-aspeed-smc 1e630000.spi: CE0 read buswidth:4 [0x406c0741]
> >      [    9.494235][    T1] ftgmac100 1e660000.ethernet: Read MAC address 52:54:00:12:34:56 from chip
> >      [    9.531186][    T1] RTL8211E Gigabit Ethernet 1e650000.mdio-1:00: attached PHY driver (mii_bus:phy_addr=1e650000.mdio-1:00,
> > 
> > Fixes: e09cf36321f6 ("hw: aspeed_scu: Add AST2600 support")
> > Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
> > ---
> > I ran into this issue while improving test coverage in my patch review
> > process.
> > ---
> >   hw/misc/aspeed_scu.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
> > index ca93c3699d81..1e3db6d03f91 100644
> > --- a/hw/misc/aspeed_scu.c
> > +++ b/hw/misc/aspeed_scu.c
> > @@ -821,7 +821,8 @@ static void aspeed_ast2600_scu_reset_hold(Object *obj, ResetType type)
> >       s->regs[AST2600_SILICON_REV2] = s->silicon_rev;
> >       s->regs[AST2600_HW_STRAP1] = s->hw_strap1;
> >       s->regs[AST2600_HW_STRAP2] = s->hw_strap2;
> > -    s->regs[PROT_KEY] = s->hw_prot_key;
> > +    s->regs[AST2600_PROT_KEY] = s->hw_prot_key == ASPEED_SCU_PROT_KEY;
> > +    s->regs[AST2600_PROT_KEY2] = s->hw_prot_key == ASPEED_SCU_PROT_KEY;
> >   }
> >   
> >   static void aspeed_2600_scu_class_init(ObjectClass *klass, const void *data)
> > 
> > ---
> > base-commit: 9696bf5dc5a5bf0b4a9d05b6cdfe5f13990f97aa
> > change-id: 20260818-dev-ast2600-hw-prot-key-reset-e68eb9f49ee9
> > 
> > Best regards,
> > --
> > Andrew Jeffery <andrew@codeconstruct.com.au>
> > 
> 
> Applied to
> 
>      https://github.com/legoater/qemu aspeed-next
> 
> Thanks,
> 
> C.

Thanks Cédric!


  reply	other threads:[~2026-08-19  0:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  1:43 [PATCH] hw/misc/aspeed_scu: Set both AST2600 protection key registers on reset Andrew Jeffery
2026-08-18  6:05 ` Jamin Lin
2026-08-18 21:20 ` Cédric Le Goater
2026-08-19  0:02   ` Andrew Jeffery [this message]
2026-08-19  0:06 ` Philippe Mathieu-Daudé
2026-08-19  7:17   ` Cédric Le Goater
2026-08-19  9:43     ` Philippe Mathieu-Daudé

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=6531a80710d4b2163605b7d44747189a7ab58dbf.camel@codeconstruct.com.au \
    --to=andrew@codeconstruct.com.au \
    --cc=clg@kaod.org \
    --cc=jamin_lin@aspeedtech.com \
    --cc=joel@jms.id.au \
    --cc=kane_chen@aspeedtech.com \
    --cc=leetroy@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven_lee@aspeedtech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.