From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E2AC433E0 for ; Tue, 9 Feb 2021 16:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1318D64EB4 for ; Tue, 9 Feb 2021 16:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232965AbhBIQj4 (ORCPT ); Tue, 9 Feb 2021 11:39:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232953AbhBIQjg (ORCPT ); Tue, 9 Feb 2021 11:39:36 -0500 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B8EC061574 for ; Tue, 9 Feb 2021 08:38:55 -0800 (PST) Received: by mail-oi1-x22f.google.com with SMTP id k204so18491082oih.3 for ; Tue, 09 Feb 2021 08:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D1W20Sq6TDjaUrVZvwmz75ySVD0FOUb+UxbG/t0eOoA=; b=sSkdzcMRmGDjsifSGK/jX2Vc8A6gs87kgs/VT4JncpFc2NXQXZ7Wo/pv2KcoUztrGr hc9oJHfpEpTVNeXYPgQzZf/qOk0MiXscFUGsyp36ZxxcwGhOCJo+9eJ5Gr6rZCFbYkFB rnjOz+PosFlEzlSxO/arOu9Oc+2xgFyg/cgqRYfrDIXU15v4amvidtEyktIpUJNq05hl hEFuvxFfdP+bnoLVWJfYp3zECWr+vKhZlkWEaBCSIOZVAmTxPBwuMJ/MIy67BaYHWn97 3D4W6sAXDMwXfxDq0H8xnyMoLYth9IMbarJZOQY4uB2XcZkM5Hla2th7sTwro69JCAEE R1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D1W20Sq6TDjaUrVZvwmz75ySVD0FOUb+UxbG/t0eOoA=; b=lQJhA6cTotMY4eG4H0GpfPe/9/lBUJ9FpcB+EfmKryGhjimcjnBaEHJhKB9UrfqRzr l8ms/ONHxTnaUDIJESu1y8CknrVG/9J9Uu/JQLlAFzxcG6eNO9bUR4xCbrgQaC3yMtRP JJgSmYahMy7LiZZEJBAUYRIWEmk37eVdOi3iabM0p0JWU0GNgR3p1QPSpcdO9BCZKteV tnA9Ho1pgv+0zoXn+vBSPdLRvErsMnZO2j7icUmPjp570YCUORJp4cKByCuHdBKdxcgD mxawWcRbrxS7Hc0otu2lPxSlwP9An8ojSc6m8s+AbZSP4q45AhLZagwFndjErFbPEsj0 a6wQ== X-Gm-Message-State: AOAM5315g5tnDN8s9UHBKEFGSZLr0dQnYXBxIprkLlTbRQSTWJKRDjzl o3roghb0In6gZB0IPj6biBclucE8yg6qLVi3VN72SYU+rG8= X-Google-Smtp-Source: ABdhPJzrYrvRsCx/SaVSQEfLelG+EocEdczfs1JYffxGBzLnGbfxqcWY6RCs0/Lc4X1xz1BwlT/ukEE2l1kzxS52vgw= X-Received: by 2002:aca:5a57:: with SMTP id o84mr3034936oib.0.1612888735437; Tue, 09 Feb 2021 08:38:55 -0800 (PST) MIME-Version: 1.0 References: <20210209125912.3398-1-nsaenzjulienne@suse.de> <20210209125912.3398-10-nsaenzjulienne@suse.de> <56e237a8d0646c03d4ff44e439d1b0f81c800a9b.camel@suse.de> In-Reply-To: <56e237a8d0646c03d4ff44e439d1b0f81c800a9b.camel@suse.de> From: Phil Elwell Date: Tue, 9 Feb 2021 16:38:45 +0000 Message-ID: Subject: Re: [RFC/PATCH v2 09/16] soc: bcm: bcm2835-power: Add support for BCM2711's Argon ASB To: Nicolas Saenz Julienne 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nicolas, On Tue, 9 Feb 2021 at 14:00, Nicolas Saenz Julienne wrote: > > On Tue, 2021-02-09 at 13:19 +0000, Phil Elwell wrote: > > Hi Nicolas, > > > > On Tue, 9 Feb 2021 at 13:00, Nicolas Saenz Julienne > > wrote: > > > > > > In BCM2711 the new ARGON ASB took over V3D. The old ASB is still present > > > with the ISP and H264 bits, and V3D is in the same place in the new ASB > > > as the old one. > > > > > > 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 select > > > the correct ASB register base, based on whether we're trying to access > > > V3D and which platform we're on. > > > > 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 ASB > to RPiVid. How should I call the one present in older RPis? It can keep its unqualified name of ASB_*. > > > > Signed-off-by: Nicolas Saenz Julienne > > > > > > --- > > > > > > Changes since v1: > > > - Correct names > > > > > > drivers/soc/bcm/bcm2835-power.c | 68 ++++++++++++++++++++------------- > > > 1 file changed, 42 insertions(+), 26 deletions(-) > > > > > > 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 > > [...] > > > > case BCM2835_POWER_DOMAIN_USB: > > > PM_WRITE(PM_USB, 0); > > > @@ -626,13 +633,22 @@ static int bcm2835_power_probe(struct platform_device *pdev) > > > power->dev = dev; > > > power->base = pm->base; > > > power->rpivid_asb = pm->rpivid_asb; > > > + power->argon_asb = pm->argon_asb; > > > > > > - id = ASB_READ(ASB_AXI_BRDG_ID); > > > + id = ASB_READ(ASB_AXI_BRDG_ID, false); > > > if (id != 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); > > > return -ENODEV; > > > } > > > > > > + if (pm->argon_asb) { > > > + id = ASB_READ(ASB_AXI_BRDG_ID, true); > > > + if (id != 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 at > 0x7ec11000. They both can be checked for valid IDs. Note the new argument in > ASB_READ(). You're right - I'd missed the parameter. Apologies. Phil From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58ACEC433E0 for ; Tue, 9 Feb 2021 16:40:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F184C64DA1 for ; Tue, 9 Feb 2021 16:40:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F184C64DA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=raspberrypi.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RbUe44QPUeuoi/ouAgZDe2oguy/sLUPhk6UU+iB5bg8=; b=SFhwoOx2HbpMWh38iqk8rkYuO tXkQcC4y2MpLFjg02lK0oI5BfiSAu+iMGxvZQspUSOAvobP7du4BliAsRmaEIM2zk5tqHLoJ276nb Zp6Zs5EgYpJfvMoz56e1X0XW9gBe0sGLSyv5N+b8frKriMt0z0eoyprxGKOYaIg9zGHDZshv8JO2E 6OkmVMK/HEq39oC8xBNFYm3/lgwqNuwwHKwk4MKgngkHkDQM8mIrojYXVkTrcy2Vi27aPGHvrLtCB ihUL5o8Rr8c3e16gY1sXcLwmA9ThnLTzPAHotI4GNxnpVpyWmn4kOSdJPTNKtIoNlAACyN7x4SZrz zkmEKsqRg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9W2X-0000oD-3D; Tue, 09 Feb 2021 16:39:01 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9W2T-0000nV-FR for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 16:38:58 +0000 Received: by mail-oi1-x233.google.com with SMTP id m7so20024277oiw.12 for ; Tue, 09 Feb 2021 08:38:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D1W20Sq6TDjaUrVZvwmz75ySVD0FOUb+UxbG/t0eOoA=; b=sSkdzcMRmGDjsifSGK/jX2Vc8A6gs87kgs/VT4JncpFc2NXQXZ7Wo/pv2KcoUztrGr hc9oJHfpEpTVNeXYPgQzZf/qOk0MiXscFUGsyp36ZxxcwGhOCJo+9eJ5Gr6rZCFbYkFB rnjOz+PosFlEzlSxO/arOu9Oc+2xgFyg/cgqRYfrDIXU15v4amvidtEyktIpUJNq05hl hEFuvxFfdP+bnoLVWJfYp3zECWr+vKhZlkWEaBCSIOZVAmTxPBwuMJ/MIy67BaYHWn97 3D4W6sAXDMwXfxDq0H8xnyMoLYth9IMbarJZOQY4uB2XcZkM5Hla2th7sTwro69JCAEE R1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D1W20Sq6TDjaUrVZvwmz75ySVD0FOUb+UxbG/t0eOoA=; b=A5OyGkI+BO9CQSrxzElsn2G0Iq8KwvG0XzHoRMheS7UPiX0Ian5UbaH0locQadg+WB T7JzV6wRRdAA+W3rAQDmIAVf/vTQAblAqffFIVZKsRWHrpiGGnDvKCy3r35otPgy48kD +W31ON+CuNLHLFnoLBE80DK+r8IZ3pVGoejYY+gWlFu/YQbfSybFvdzeqjHdWooDZF6h QyeOdfIA3SP4D2WkqqBS/DV7Bx5jCHmzaq2rfp3xqFkBHDk70TOo9xDNHGGCvIF5Wcli 45zzaMiV4Vu6mohRFJctDGvajquD1s+5kPoQG8WuYFjQ4omcNWtfAigFg1IHFi86Yr+N 5ltA== X-Gm-Message-State: AOAM5338qryhN1m5BL3c6MYclO1qtcuYy77t4l6YDqyqhRbJ7QLmu4/t 0MRNB3XoN5CHoCbtnkYK6wjnLBHO7J8Azyuz2Ogrcg== X-Google-Smtp-Source: ABdhPJzrYrvRsCx/SaVSQEfLelG+EocEdczfs1JYffxGBzLnGbfxqcWY6RCs0/Lc4X1xz1BwlT/ukEE2l1kzxS52vgw= X-Received: by 2002:aca:5a57:: with SMTP id o84mr3034936oib.0.1612888735437; Tue, 09 Feb 2021 08:38:55 -0800 (PST) MIME-Version: 1.0 References: <20210209125912.3398-1-nsaenzjulienne@suse.de> <20210209125912.3398-10-nsaenzjulienne@suse.de> <56e237a8d0646c03d4ff44e439d1b0f81c800a9b.camel@suse.de> In-Reply-To: <56e237a8d0646c03d4ff44e439d1b0f81c800a9b.camel@suse.de> From: Phil Elwell Date: Tue, 9 Feb 2021 16:38:45 +0000 Message-ID: Subject: Re: [RFC/PATCH v2 09/16] soc: bcm: bcm2835-power: Add support for BCM2711's Argon ASB To: Nicolas Saenz Julienne X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_113857_754571_3548671D X-CRM114-Status: GOOD ( 24.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, mripard@kernel.org, eric@anholt.net, "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , linux-arm-kernel@lists.infradead.org, wahrenst@gmx.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Nicolas, On Tue, 9 Feb 2021 at 14:00, Nicolas Saenz Julienne wrote: > > On Tue, 2021-02-09 at 13:19 +0000, Phil Elwell wrote: > > Hi Nicolas, > > > > On Tue, 9 Feb 2021 at 13:00, Nicolas Saenz Julienne > > wrote: > > > > > > In BCM2711 the new ARGON ASB took over V3D. The old ASB is still present > > > with the ISP and H264 bits, and V3D is in the same place in the new ASB > > > as the old one. > > > > > > 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 select > > > the correct ASB register base, based on whether we're trying to access > > > V3D and which platform we're on. > > > > 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 ASB > to RPiVid. How should I call the one present in older RPis? It can keep its unqualified name of ASB_*. > > > > Signed-off-by: Nicolas Saenz Julienne > > > > > > --- > > > > > > Changes since v1: > > > - Correct names > > > > > > drivers/soc/bcm/bcm2835-power.c | 68 ++++++++++++++++++++------------- > > > 1 file changed, 42 insertions(+), 26 deletions(-) > > > > > > 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 > > [...] > > > > case BCM2835_POWER_DOMAIN_USB: > > > PM_WRITE(PM_USB, 0); > > > @@ -626,13 +633,22 @@ static int bcm2835_power_probe(struct platform_device *pdev) > > > power->dev = dev; > > > power->base = pm->base; > > > power->rpivid_asb = pm->rpivid_asb; > > > + power->argon_asb = pm->argon_asb; > > > > > > - id = ASB_READ(ASB_AXI_BRDG_ID); > > > + id = ASB_READ(ASB_AXI_BRDG_ID, false); > > > if (id != 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); > > > return -ENODEV; > > > } > > > > > > + if (pm->argon_asb) { > > > + id = ASB_READ(ASB_AXI_BRDG_ID, true); > > > + if (id != 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 at > 0x7ec11000. They both can be checked for valid IDs. Note the new argument in > ASB_READ(). You're right - I'd missed the parameter. Apologies. Phil _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel