Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5148336pxj; Wed, 9 Jun 2021 10:12:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMUDJJRLwZEfiaduG0mUb2kKk1g9f6GZftnyxRicQvGIIw7zmG5a9F5v948d31UBh1G7lu X-Received: by 2002:a17:906:1c49:: with SMTP id l9mr869652ejg.39.1623258740672; Wed, 09 Jun 2021 10:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258740; cv=none; d=google.com; s=arc-20160816; b=aW9CQdbegHs9uQKOlNSdsvIEh5I9DfR2GIRGeT1N8FDUaRfaSfHLScF++VVXZnF9P3 Tp4Rg5fm7zUHaeIj5c1hi0vH8hOhZrSJ4737Xl72GmlcGIlt2nWJTT7vaQfBnupJX0NB DBacTxa7Ri4fICM8EVZPPPQTA1updS37ChGDS48ESq8C7yRytg8Mmc/vapOvaDgSssbq JP7z6/q/eP4cIDoPE40zE59bsEo0yNlqHSdC3mKHh9jol4G9/CMnCOLn/o/E5ljpU1gX eEoOWpgtCT7DhSUDaZCALK5wGA9J9zFDuv53yke+abyl309Dd8Kg16ijAzagst1oOy++ mQmQ== 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; bh=nWNpzXGRyCGRE/T+VmaA6oH+l9WqaV/Ah1VoOoi8rDk=; b=U2AAmG1tvFrFFL3HNttJmGRk/Jzlp2RCrvn6ebOJEyyR3pvWnZBLtf3AnyOy5dWbqV dXzS6nxCd2bbPZg3oaMjxSctqAwodRrT7Vx1I5pCorVw3Kj1sFKO+cokVDUU+ToPiMR5 AJith96AHh9fxVERkD0ENMGVWAGZF+KOm5cZ1bVX74sQPpoUeAEWSrQaR5xseTpvKYkL Fi5CWXsLSbCFW0wMggSdGVrOe18F8sfiLZ5+JpdT4qRido1dvKjNbostoX8/rrhckbOJ humI2+yaoNbcukjn2MgAV3YECMcU/ZsBXB+AOwQ6Pqq9Ev7JkBQ96UNf/HboTtO23eK/ CMRA== 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 i8si215427edv.287.2021.06.09.10.11.56; Wed, 09 Jun 2021 10:12:20 -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; 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 S237160AbhFIH31 (ORCPT + 99 others); Wed, 9 Jun 2021 03:29:27 -0400 Received: from mail-vs1-f51.google.com ([209.85.217.51]:38895 "EHLO mail-vs1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbhFIH3Y (ORCPT ); Wed, 9 Jun 2021 03:29:24 -0400 Received: by mail-vs1-f51.google.com with SMTP id x8so12353492vso.5; Wed, 09 Jun 2021 00:27:17 -0700 (PDT) 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=nWNpzXGRyCGRE/T+VmaA6oH+l9WqaV/Ah1VoOoi8rDk=; b=OM7/mwsLDWu9Bi3GDZiXBCo90xdVImQGQLQF7dH3HKWKufMpkZFeoEWT/eMRJVvZXB 5oPK+cOSaEQ0Uh8sMMZxfwwvWYd/YBX3S0Gs4d5957LaRxItNMA7pjeYvXTTSkcRJqzN lAysbIWNU1BlHZK71RnRk26+q4It0QDZyE2hVjw/3Qw7vPDqIoP1QCJLUItpQmusvXJD vzZN8+Nna0CrRWgjoszJdOewH8hJxPp+yEGjIodxT/GDKWqE4F0XS73gWi0NRr3PPxvz r/alPK5Tx2JzMFUgq4+KgFDsyUanT+Jy9Ek2T+SNv5Oo3uOSgxaiE+1hq2aklkxdgKMr 4ddg== X-Gm-Message-State: AOAM5313Gt902dbZM/lQ43C0gomUJ6HUZKLH9RfZK2iIP5b1MmnDGyFL 9Nm9vsAUL05dpp54cqgVRwkPJBic0XH2dr/16E6nvzNi526MBw== X-Received: by 2002:a05:6102:2011:: with SMTP id p17mr3979601vsr.40.1623223636944; Wed, 09 Jun 2021 00:27:16 -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: <20210604180933.16754-3-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Geert Uytterhoeven Date: Wed, 9 Jun 2021 09:27:05 +0200 Message-ID: Subject: Re: [PATCH 2/3] soc: renesas: Add support to read LSI DEVID register of RZ/G2{L,LC} SoC's To: Lad Prabhakar Cc: Magnus Damm , Rob Herring , Linux-Renesas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Prabhakar , Biju Das Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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... > @@ -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)... > + > + if (chipid) { > + product = readl(chipid); ... and add the DEVID offset within the SYSC block here. > + 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