From: Marek Vasut Date: Wed, 16 Sep 2020 16:02:48 +0200 Subject: [PATCH 3/4] arm: rmobile: Add RZ/G2M SoC In-Reply-To: <20200915143630.7678-4-biju.das.jz@bp.renesas.com> References: <20200915143630.7678-1-biju.das.jz@bp.renesas.com> <20200915143630.7678-4-biju.das.jz@bp.renesas.com> Message-ID: <527712ee-12ba-ac35-f0dd-bb55747baf4f@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/15/20 4:36 PM, Biju Das wrote: [...] > static int rmobile_cpuinfo_idx(void) > { > int i = 0; > u32 cpu_type = rmobile_get_cpu_type(); > + const struct udevice_id *match = of_soc_match_compatible(); > > for (; i < ARRAY_SIZE(rmobile_cpuinfo); i++) > - if (rmobile_cpuinfo[i].cpu_type == cpu_type) > - break; > + if (rmobile_cpuinfo[i].cpu_type == cpu_type) { > + if (match && > + rmobile_cpuinfo[i].family_type == match->data) > + break; > + else if (!match && > + rmobile_cpuinfo[i].family_type != SOC_RZG2) > + break; > + } Can you please add some comment on how this loop works now. It really isn't obvious, so a detailed comment would help greatly. I think it does some discerning between the RCar and RZG, right ?