Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5185316pxj; Wed, 9 Jun 2021 11:07:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRDDMKhjeRkpZYEJab1Etn/zGn0t8Wk1eJmhBOyJhrFg7cD17CBPcaK39tj+psZGcYwZFc X-Received: by 2002:a05:6402:1458:: with SMTP id d24mr658230edx.85.1623262030868; Wed, 09 Jun 2021 11:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623262030; cv=none; d=google.com; s=arc-20160816; b=Q+eYeBYZlLTngB3DLe9Q28P0ih6MRs8mSqKldFYclrAZyA1RtHqh9Br6YuR8N73oQ6 iO3xSQ78pZTnQ7DUA4sT1w1fFpoeDwvqvRWombT2Vg7OM19uan+AbvXqHSsnl7+740A0 uLyABn8ENGoCrJojXziOv5s2gQ46henUdNxd5WVl/Qy8wdzp1iWNPjMOafFR3lzuenF6 uruWdUYYxWNjojlACs4eYB/qQnhH/Ez3JMBMGWOLtODUW8dUl4PpRjcGwJTWU6U3P0jf g+NiKLJb37V5M8e80zBpFOUs/ns7erHAwyrgSrxkDP9vcXw9UfrTXGl2pWsJ5xu+Li0c GkdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aBTN9nJMcjuczcYEKzyMHwRihscHxKS/kDo9+PJCmN4=; b=uXgMy4nlmeoAH2X4hCf0xq1ePDowJhISycWDUkX0ZQKjkEfFnr1pyB8/US0Sy0uC0I DXe+AOt9tLqq9p+KO11MorZo3+HM8oZq19M0tSquuVtwtu6Sr3kbybjHUz5i5Dl3Lu6M yEV0u7UQP41t4X4u566eoVSalbAIEe20uWYCXae3pXCKEB5Ro8YH6fuOMWKxbsvAeJ3x nePXk9QiALGJN9m35UGBblpSoaNXFSc2YjV6i9iqQ0jiwvLyeZOfmZoUYdJmMuOvzKfU UExjISgvNehVaB1X4XQIV1P4UI2sedvudyNMTV8De6PhsNEtgZ6KwVvx+cEhYBNzi5d5 UA1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ms5C9nDO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si434107eje.21.2021.06.09.11.06.40; Wed, 09 Jun 2021 11:07:10 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ms5C9nDO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236874AbhFIPw5 (ORCPT + 99 others); Wed, 9 Jun 2021 11:52:57 -0400 Received: from mail-yb1-f172.google.com ([209.85.219.172]:33690 "EHLO mail-yb1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235827AbhFIPwz (ORCPT ); Wed, 9 Jun 2021 11:52:55 -0400 Received: by mail-yb1-f172.google.com with SMTP id f84so36218583ybg.0; Wed, 09 Jun 2021 08:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aBTN9nJMcjuczcYEKzyMHwRihscHxKS/kDo9+PJCmN4=; b=ms5C9nDO22l6b82s4qeFr0cb0SJcO5eHC60T8kui+Dd57hCUfr0CDSqt24AliiLEpd BeoldJeG+yuqBDfHZYSJ8BG5U3Bk29hd8XmdTZ0blOOYvBP6dJveoUfEMbbXATMY4Mx+ OdUjHYuLznMpzbiw+5g4mMdoomZbXTPSx86iVLEFjjwsPYUywMzbQWDsi/vO7u1bd9Vx eGhkD25LkM1UIsaoef92MQlQLoqV4AlQ6UaTYqBxhpuD/TelmGCkQEZLpLTrQu9eczUt Pmu5sFbdnYxiX14buLaBbfGgGF50zh8TKGW3jkB51X6KP7CiIaeulyNckyS5NhnGfsQH cQiQ== 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=aBTN9nJMcjuczcYEKzyMHwRihscHxKS/kDo9+PJCmN4=; b=V2KfjvSnrdO44DQ/n+lIwVy5DDkxivtadqdizV56WwFlAWAlREso2pKOWnwUeKxy70 L5UIcn7+O+pELYAKGCCLobQJpT5NInNFkxGU6dGyzH1QT5Rt4wOVy6LymMeVQvVbWsgD 6hFfizpV3ntKpxhCc2tFbZcNBLZdsK5ebeXz2m4WifMT1pA6Q+2wCoI1R68ovonVYAeJ +DWIqFORQIzA5XZVULtwaWu5/W7qseDoWZMcdq9dp6rzD0zDaJ6ZyCPm6OIqlvoKBUT8 NZ2/+g0wICV7dihIc++3QkWXimn8or/gzEOW7T6EVQ5MUyUFgqq5qQDnarQZ/muOGw5b joCA== X-Gm-Message-State: AOAM531NJLNBXb8awZ4djujZwaRih0/1q43Da6AkTOZBPu7WhCbmgAxG jSHNRlhxNu3ED9rDueT48vEj5oasrHIMfNeVp9GVjwxdzt0= X-Received: by 2002:a25:743:: with SMTP id 64mr905819ybh.426.1623253800926; Wed, 09 Jun 2021 08:50:00 -0700 (PDT) MIME-Version: 1.0 References: <20210604180933.16754-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20210604180933.16754-3-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Wed, 9 Jun 2021 16:49:34 +0100 Message-ID: Subject: Re: [PATCH 2/3] soc: renesas: Add support to read LSI DEVID register of RZ/G2{L,LC} SoC's To: Geert Uytterhoeven Cc: Lad Prabhakar , Magnus Damm , Rob Herring , Linux-Renesas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Biju Das Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, Thank you for the review. On Wed, Jun 9, 2021 at 8:27 AM Geert Uytterhoeven wrote: > > Hi Prabhakar, > > On Fri, Jun 4, 2021 at 8:09 PM Lad Prabhakar > wrote: > > Add support for reading the LSI DEVID register which is present in > > SYSC block of RZ/G2{L,LC} SoC's. > > > > Signed-off-by: Lad Prabhakar > > Reviewed-by: Biju Das > > Thanks for your patch! > > > --- a/drivers/soc/renesas/renesas-soc.c > > +++ b/drivers/soc/renesas/renesas-soc.c > > @@ -56,6 +56,11 @@ static const struct renesas_family fam_rzg2 __initconst __maybe_unused = { > > .reg = 0xfff00044, /* PRR (Product Register) */ > > }; > > > > +static const struct renesas_family fam_rzg2l __initconst __maybe_unused = { > > + .name = "RZ/G2L", > > + .reg = 0x11020a04, > > Please don't add hardcoded register addresses for new SoCs (i.e. drop > ".reg"). The "renesas,r9a07g044-sysc" is always present. > And if it were missing, the hardcoded fallback would lead into the > classic CCCR/PRR scheme, which is not correct for RZ/G2L... > I wanted to avoid iomap for the entire sysc block for just a single register. > > @@ -348,6 +361,25 @@ static int __init renesas_soc_init(void) > > goto done; > > } > > > > + np = of_find_compatible_node(NULL, NULL, "renesas,r9a07g044-sysc"); > > + if (np) { > > + of_node_put(np); > > + chipid = ioremap(family->reg, 4); > > Just use of_iomap(np, 0)... > will do. > > + > > + if (chipid) { > > + product = readl(chipid); > > ... and add the DEVID offset within the SYSC block here. > will do. Cheers, Prabhakar > > + iounmap(chipid); > > + > > + if (soc->id && (product & 0xfffffff) != soc->id) { > > + pr_warn("SoC mismatch (product = 0x%x)\n", > > + product); > > + return -ENODEV; > > + } > > + } > > + > > + goto done; > > + } > > + > > /* Try PRR first, then hardcoded fallback */ > > np = of_find_compatible_node(NULL, NULL, "renesas,prr"); > > if (np) { > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds