Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp505659pxb; Tue, 9 Feb 2021 06:03:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyG/l77aVs5PszgB/Vf2G6VtQeAWDA4fuCw4jVMEu+hgq0uP9nY4YhoYpx1mhRYiAsru2QZ X-Received: by 2002:a17:906:7253:: with SMTP id n19mr22595735ejk.543.1612879432765; Tue, 09 Feb 2021 06:03:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612879432; cv=none; d=google.com; s=arc-20160816; b=GuTQzi2BJRdGxK4XtH/Weitl3na+1zQpmpCNmH6Y4MkzWzAPunZSvJJWgBnctLWbX8 9ikr6E9HeoznEjarfakGAsl8sQ7xReshgLZaZ3CyrRIjlK5zWfM4/6yosjcy3jLgN9Z3 nONunMHjIHkA3r3MnRLcsetDPisHXTBw6UZoU37kcsHiS/FY5RwFa3fncWDXUELlwsb/ //P5ZbIymWsG8wl5w9EY0baoUBVF+GKmhpx83TzkNHse8fSHgzVeFH1kNCx1FBmrl7QK xtr//Y6myxObLP1VXQqFW/pPGqWhzZFgzOnaj1C7BZtIfQuNB07624WneOqPzN3AmJJY K/lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id; bh=8652pRdQZemuAUmWR7jAJ3pG+PENwTngFpegjL38fUs=; b=RGmPPKi6BCzgPm/UEt6LEhvibGx96V5av4MpaOHd/FHY14AfjZKRA1hFataIyKdXoU NjypYMMrpckeCLtdspxm6qjZAVgO6eRidjnKfLM0hi/2+fd3zweQ5G6fI8T35t3o2V+2 Zbjwyxkp5VQEieMqAFp3UdhlfHtSEEsxJ3lyhqYtNVRIjoEAgLFtCg8w3oN9+LfHdEVF l986h6Xs7I7gNOKHiDVi9ZRDMO0a+i0+PoGGVQ4bjSAsjhReiNtZCQtFv0M14bV8KWJh knERf+sEbhaxSnn2ldyLEeZWCJZZNGpTx7dbNHwwZgJbJOhegRWh4LJl4HM/9b6DT8gN YLhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re9si7479101ejb.135.2021.02.09.06.03.26; Tue, 09 Feb 2021 06:03:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231347AbhBIOBu (ORCPT + 99 others); Tue, 9 Feb 2021 09:01:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:59208 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbhBIOBD (ORCPT ); Tue, 9 Feb 2021 09:01:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DA66EAFE2; Tue, 9 Feb 2021 14:00:19 +0000 (UTC) Message-ID: <56e237a8d0646c03d4ff44e439d1b0f81c800a9b.camel@suse.de> Subject: Re: [RFC/PATCH v2 09/16] soc: bcm: bcm2835-power: Add support for BCM2711's Argon ASB From: Nicolas Saenz Julienne To: Phil Elwell Cc: Florian Fainelli , linux-kernel@vger.kernel.org, Ray Jui , Scott Branden , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , wahrenst@gmx.net, linux-arm-kernel@lists.infradead.org, mripard@kernel.org, eric@anholt.net Date: Tue, 09 Feb 2021 15:00:18 +0100 In-Reply-To: References: <20210209125912.3398-1-nsaenzjulienne@suse.de> <20210209125912.3398-10-nsaenzjulienne@suse.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-vLmExgH5XDAroXW33oQ4" User-Agent: Evolution 3.38.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-vLmExgH5XDAroXW33oQ4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2021-02-09 at 13:19 +0000, Phil Elwell wrote: > Hi Nicolas, >=20 > On Tue, 9 Feb 2021 at 13:00, Nicolas Saenz Julienne > wrote: > >=20 > > In BCM2711 the new ARGON ASB took over V3D. The old ASB is still presen= t > > with the ISP and H264 bits, and V3D is in the same place in the new ASB > > as the old one. > >=20 > > Use the fact that 'pm->argon_asb' is populated as a hint that we're on > > BCM2711. On top of that introduce the macro ASB_BASE() which will selec= t > > the correct ASB register base, based on whether we're trying to access > > V3D and which platform we're on. >=20 > Please don't refer to this block as ARGON - it is the IP of Raspberry > Pi Trading and it's name is RPiVid. OK, sorry for that. I, again, mixed both ASB names. I'll rename the Argon A= SB to RPiVid. How should I call the one present in older RPis? > > Signed-off-by: Nicolas Saenz Julienne > >=20 > > --- > >=20 > > Changes since v1: > > =C2=A0- Correct names > >=20 > > =C2=A0drivers/soc/bcm/bcm2835-power.c | 68 ++++++++++++++++++++--------= ----- > > =C2=A01 file changed, 42 insertions(+), 26 deletions(-) > >=20 > > diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-= power.c > > index 59b8abfc5617..42e105758b47 100644 > > --- a/drivers/soc/bcm/bcm2835-power.c [...] > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case BCM2835_POWER_DOMA= IN_USB: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0PM_WRITE(PM_USB, 0); > > @@ -626,13 +633,22 @@ static int bcm2835_power_probe(struct platform_de= vice *pdev) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0power->dev =3D dev; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0power->base =3D pm->bas= e; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0power->rpivid_asb =3D p= m->rpivid_asb; > > + power->argon_asb =3D pm->argon_asb; > >=20 > > - id =3D ASB_READ(ASB_AXI_BRDG_ID); > > + id =3D ASB_READ(ASB_AXI_BRDG_ID, false); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (id !=3D 0x62726467 = /* "BRDG" */) { > > - dev_err(dev, "ASB register ID returned 0x%08x\n", id); > > + dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n"= , id); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return -ENODEV; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > >=20 > > + if (pm->argon_asb) { > > + id =3D ASB_READ(ASB_AXI_BRDG_ID, true); > > + if (id !=3D 0x62726467 /* "BRDG" */) { > > + dev_err(dev, "Argon ASB register ID returned 0x= %08x\n", id); > > + return -ENODEV; > > + } > > + } > > + > > Surely these are the same register. Is this the result of a bad merge? AFAIU There are two ASBs the old one at 0x7e00a000 and the new RPiVid one a= t 0x7ec11000. They both can be checked for valid IDs. Note the new argument i= n ASB_READ(). Regards, Nicolas --=-vLmExgH5XDAroXW33oQ4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAmAilXIACgkQlfZmHno8 x/4YiQf+IWndOxKAscGGPf/kslh7HScKXnZucnff76qyQ3qV4RdHObcPRF9xgDoY B3SFOOxIxcmRLHBDt7ze2OWr/hpC1JxDIcHEsAgQe91zC6TD/53HXdS3aX0nAO56 4XFP0VS1zvr7iJPbOsxrDdM13Jv6bU0K20O0AraVvoiDUGMs0ZniH7/7AgpmtZDe yEFSun6M9UmmVY9uYRzHkk8XPRhXpECxnMewrEHfm1IUFId6Kmw7I4HwPArvTPf9 kDOi+rSofxS9ZIUgxFpWV3tRxxYAjxSx8mEHEbiF2cQZ08Vy0U4559tKS6flGh44 D1Mo6eq/KrsBsJ88VRcpKB6NcmWWug== =PFPS -----END PGP SIGNATURE----- --=-vLmExgH5XDAroXW33oQ4--