Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F56EC7618E for ; Mon, 24 Apr 2023 12:02:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F0EC860B4; Mon, 24 Apr 2023 14:01:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qZG4RdYa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A1A186061; Mon, 24 Apr 2023 13:22:11 +0200 (CEST) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 230C086040 for ; Mon, 24 Apr 2023 13:22:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=noname.nuno@gmail.com Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-3ee339e8c2fso19521481cf.0 for ; Mon, 24 Apr 2023 04:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682335327; x=1684927327; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=De6YAQAqF7ZStiqn2Ok6vXF+Yo81xbB5+xIDh6m59RY=; b=qZG4RdYaxAYB7AWqolUB/79eyJOJsA81yjg0lGYjvzdstKT3gK8NHUyHPE/Hlr8DxN i16Ic0BzMzK0/WiHeTfzsN1t1IGYz8cMgx3fq/Nfo3D7HlzusEnxZks2b57oLBjyAdf2 NYFTv/4MvqWQDFiAgt+k7uh7JsH8gYLhLhgkRgPwRSzEGQnAetYZHTCiI9yEQdSBT5VX Pw/Hwiqs56IDAqZIKs4f2cpNmdEL6+nXSOYJH685F4o5NgeeXsrY9dSTWTf1xqoxvWKD dX8uYIpdUTZFzoORETNPoM1fKtZ5gR1ziSObZo7RtMpNOMOskJHbai/X+ZJ+QgQomCCt 5GFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682335327; x=1684927327; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=De6YAQAqF7ZStiqn2Ok6vXF+Yo81xbB5+xIDh6m59RY=; b=DkzZYij8hJwdFYxS7KleXqsQfQyAIg7z2wi2sEAO/P8XfwR6TFSt5LaDmbjP3v+bCw Gb1KtJ82bY6FoZMn7G7UhbHvOsV+Rfa9rGWRmj0XPUp9iu/sbaKYY/l426NIY3DEk8Ao ogBh6D/cRR+wGRWqAVdRECcKaifiZJ8h5JLNYkRlu/mUuvuK00pttBEE1QPxL1cY/QXJ 4QDSNZxn4TiFLvZiHju/ghGQf7jUIw0XwCmgcnAr9oi/MydpQyaXhrqHsMA9ahNlIgmI +iSvY3d1jjOi+4iNYINRj1virBc/3yq7VOQ/bzPw2mwYgNTzDSJl1pkhVJUEPXToZCsu yDjg== X-Gm-Message-State: AAQBX9dmqWKQTobXfdde2FhCZu7aVGbIiP8rTkzAQ/kj0XwQjDrdzt/g DCx8uj+p8lBzZETwcxwmJ4U= X-Google-Smtp-Source: AKy350YXxXftS1NmpmcJxbOY2cKiD5d8761KGkrmGzYxSgH4KTM2dKeOcuPiKwK3TgslnHgJ+oKeVg== X-Received: by 2002:a05:622a:178b:b0:3ef:4a9b:5dca with SMTP id s11-20020a05622a178b00b003ef4a9b5dcamr21964455qtk.29.1682335326822; Mon, 24 Apr 2023 04:22:06 -0700 (PDT) Received: from ?IPv6:2003:f6:ef05:8700:853c:3ba5:d710:3c1d? (p200300f6ef058700853c3ba5d7103c1d.dip0.t-ipconnect.de. [2003:f6:ef05:8700:853c:3ba5:d710:3c1d]) by smtp.gmail.com with ESMTPSA id ov13-20020a05620a628d00b0071f0d0aaef7sm3456375qkn.80.2023.04.24.04.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 04:22:06 -0700 (PDT) Message-ID: <164f197d5c3f282be892fe7a97264f47cb12c916.camel@gmail.com> Subject: Re: [PATCH v2 1/2] mtd: cfi: respect reg address length From: Nuno =?ISO-8859-1?Q?S=E1?= To: Stefan Roese , Nuno =?ISO-8859-1?Q?S=E1?= , u-boot@lists.denx.de Date: Mon, 24 Apr 2023 13:22:45 +0200 In-Reply-To: <0153a680-c1be-7523-681b-08ff3e913658@denx.de> References: <20230418130728.1456056-1-nuno.sa@analog.com> <45920b00-f93b-913c-28cd-ef1dbe9aa990@denx.de> <2e91426339b0ab83dbc60fcdb0048d34f0d85caa.camel@gmail.com> <0153a680-c1be-7523-681b-08ff3e913658@denx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 24 Apr 2023 14:01:51 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Mon, 2023-04-24 at 09:36 +0200, Stefan Roese wrote: > On 4/24/23 09:13, Nuno S=C3=A1 wrote: > > On Mon, 2023-04-24 at 08:54 +0200, Stefan Roese wrote: > >=20 > > Hi Stefan, > >=20 > >=20 > > > Hi Nuno S=C3=A1 > > >=20 > > > On 4/18/23 15:07, Nuno S=C3=A1 wrote: > > > > flash_get_size() will get the flash size from the device itself and= go > > > > through all erase regions to read protection status. However, the d= evice > > > > mappable region (eg: devicetree reg property) might be lower than t= he > > > > device full size which means that the above cycle will result in a = data > > > > bus exception. This change fixes it by reading the 'addr_size' duri= ng > > > > probe() and also use that as one possible upper limit. > > > >=20 > > > > Signed-off-by: Nuno S=C3=A1 > > > > --- > > > > v2: > > > > =C2=A0=C2=A0 * Fix compilation when CONFIG_CFI_FLASH is not set. Do= ne by > > > > redefining > > > > cfi_flash_bank_size() when CONFIG_CFI_FLASH is set (by returning dt= s > > > > size). > > >=20 > > > Unfortunately this does not work. Build fails on multiple targets. > > > Here an example: > > >=20 > > > $ make qemu_arm64_defconfig > > > $ make -sj > > > drivers/mtd/cfi_flash.c:120:13: error: conflicting types for > > > 'cfi_flash_bank_size'; have 'phys_size_t(int)' {aka 'long long unsign= ed > > > int(int)'} > > > =C2=A0=C2=A0=C2=A0 120 | phys_size_t cfi_flash_bank_size(int i) > > > =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=A0=C2=A0=C2=A0=C2=A0 ^~~~~~~~~~~~~~~~~~~ > > > In file included from drivers/mtd/cfi_flash.c:36: > > > include/mtd/cfi_flash.h:178:15: note: previous declaration of > > > 'cfi_flash_bank_size' with type 'long unsigned int(int)' > > > =C2=A0=C2=A0=C2=A0 178 | unsigned long cfi_flash_bank_size(int i); > > > =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=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~~~~~~~~~~~= ~~~~~ > > >=20 > > > Please run a world build next before sending out the next patchset > > > version. > > >=20 > >=20 > > Arghh, sorry for this! > >=20 > > I did run it for micoblaze_defconfig and integratorcp_cm926ejs_defconfi= g. > > Should > > I build it with V1 or something? Or is there somewhere where I can push= my > > patchset to trigger some CI and look for these kind of things myself be= fore > > sending v3? >=20 > I'm testing with a world build on Azure, Gitlab provides a similar > infrastructure. Some docs should be available for this. >=20 I see, I just cloned the tree from https://source.denx.de/u-boot/u-boot.git= . I will fork from github and trigger those builds. - Nuno S=C3=A1