From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Tue, 28 Apr 2020 23:01:12 +0800 Subject: [PATCH v2 3/3] kbuild: SPL/TPL: generate separate asm-offsets.h for SPL and TPL In-Reply-To: <20200428144629.GX4468@bill-the-cat> References: <20200417072137.801234-1-masahiroy@kernel.org> <20200417072137.801234-4-masahiroy@kernel.org> <20200427133658.GT4555@bill-the-cat> <20200428144629.GX4468@bill-the-cat> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, On Tue, Apr 28, 2020 at 10:46 PM Tom Rini wrote: > > On Mon, Apr 27, 2020 at 10:50:48PM +0800, Bin Meng wrote: > > Hi Tom, > > > > On Mon, Apr 27, 2020 at 9:37 PM Tom Rini wrote: > > > > > > On Mon, Apr 27, 2020 at 09:37:28AM +0800, Bin Meng wrote: > > > > Hi Tom, > > > > > > > > On Sat, Apr 18, 2020 at 8:37 PM Bin Meng wrote: > > > > > > > > > > On Fri, Apr 17, 2020 at 3:22 PM Masahiro Yamada wrote: > > > > > > > > > > > > Currently generic-asm-offsets.h and asm-offsets.h are generated based > > > > > > on U-Boot proper config options. The same asm-offsets headers are used > > > > > > for building U-Boot SPL/TPL, which causes potential offset mismatch if > > > > > > U-Boot proper has different config options from U-Boot SPL/TPL. > > > > > > > > > > > > This commit adds: > > > > > > spl/include/generated/(generic-)asm-offsets.h > > > > > > tpl/include/generated/(generic-)asm-offsets.h > > > > > > > > > > > > spl/include/generated/(generic-)asm-offsets.h is generated if > > > > > > CONFIG_SPL=y, and included when building SPL. > > > > > > > > > > > > tpl/include/generated/(generic-)asm-offsets.h is generated if > > > > > > CONFIG_TPL=y, and included when building TPL. > > > > > > > > > > > > They are created before Kbuild descends into SPL/TPL object directories > > > > > > and builds $(obj)/dts/dt-platdata.o because $(obj)/dts/dt-platdata.c > > > > > > includes a bunch of headers. > > > > > > > > > > > > Prepend -I$(obj)/include to $(UBOOTINCLUDE) so (generic-)asm-offsets.h > > > > > > is searched in {spl,tpl}/include/generated/. > > > > > > > > > > > > Requested-by: Bin Meng > > > > > > Signed-off-by: Masahiro Yamada > > > > > > --- > > > > > > > > > > > > Changes in v2: None > > > > > > > > > > > > Kbuild | 4 ++-- > > > > > > scripts/Makefile.spl | 10 ++++++++-- > > > > > > 2 files changed, 10 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > It works like a charm. Thanks! > > > > > > > > > > Tested-by: Bin Meng > > > > > > > > It looks only patch 1 and 2 in this series were applied. This patch was missed. > > > > > > So, I was going to ask and forgot, sorry. Why do we need to have these > > > differ between TPL/SPL/U-Boot itself, and then why is that good? I > > > > Because currently the offsets > > {spl,tpl}/include/generated/(generic-)asm-offsets.h are generated per > > the U-Boot config options. But SPL and TPL are not guaranteed to have > > the same config options. > > > > For example it's possible to have SPL/TPL turned on > > {SPL,TPL}_CONFIG_XXX but U-Boot to turn off CONFIG_XXX, or vice verse. > > > > To me this is more like a bug fix other than a feature. > > Ah, OK. But shouldn't we make sure that asm-offsets are consistent > between SPL/TPL/U-Boot? Or is there a use-case where it makes sense for > them to differ intentionally? I don't know other boards, but for now RISC-V does turn on SPL_SMP in SPL, but does not turn on SMP in U-Boot S-mode. U-Boot M-mode can still turn on SMP. Regards, Bin