From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A417C4338F for ; Fri, 30 Jul 2021 17:27:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D0D196023F for ; Fri, 30 Jul 2021 17:27:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D0D196023F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A142A80FBE; Fri, 30 Jul 2021 19:27:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="tMF61/yx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B355A82903; Fri, 30 Jul 2021 19:26:59 +0200 (CEST) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 A5B70800C1 for ; Fri, 30 Jul 2021 19:26:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72f.google.com with SMTP id c18so10149094qke.2 for ; Fri, 30 Jul 2021 10:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Qj2JqLDGsLm4B+et1xgi87UF0s8W1CJkY4NIMKyliiM=; b=tMF61/yx75vfEXh9ZIikmgxx5s4sy4J6e2Wov6r0VR/Lk1fDXgvDyOK1s1vT5Xd3qI lhJelwlDcqBZIZCJj/vG01RMcc642UWNMdvQYLMU+YwfU38r0rckPcUeymwNoREFvave 5ui2DNw8/g0VjLCGq1eJEvwyK6sNniHyp8B5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Qj2JqLDGsLm4B+et1xgi87UF0s8W1CJkY4NIMKyliiM=; b=pp8cRxuSl1L2Q4btD7B2wbG3rTXjTMcuTjnT6y6KyilMrrQ+Js/JHZd3QIMopXqG+p 5RWzL5ywmTdLyeaU2BWKzkCK0SipzHNq4Zk7DTLl0YKmmjUiS2z6oLP8+S3Bc4em7K2q 6UrfwpBzT6GI2j0ckgA7PleccnXkXHbWWjH58dvmbh9rVq+waHw/vWmlS1I6a4FUi2sr P46CPpY2LSyhD+Jr9QOFQHEdxrxeYTNUru/Wp/BHC12V8k4J5QcwskZeiGrwsrkYSl1g sYaJyzQI7zRJPGHAa7dF4NahLpgQ7+xEAwH8gdLCwmJOziqqrG491GFUaLpzCz//de4L aRAw== X-Gm-Message-State: AOAM53200PnYnLy2+792v18bdZyHpgk9G4rD5X3ANq4MVJgjkShSIK+9 Ix+34TdpW6PdkGg8Yl/3x2kMyA== X-Google-Smtp-Source: ABdhPJzXU37LiJRNdxPlcXvAWg5tusGjLmw2AjR3gAPgVmeGVVhuJtVLMgI273g5Jp0ZLwEB4P2+yw== X-Received: by 2002:ae9:ef54:: with SMTP id d81mr3312607qkg.234.1627666014353; Fri, 30 Jul 2021 10:26:54 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-21f8-31e9-a342-f65d.res6.spectrum.com. [2603:6081:7b01:cbda:21f8:31e9:a342:f65d]) by smtp.gmail.com with ESMTPSA id m17sm902147qtu.34.2021.07.30.10.26.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jul 2021 10:26:53 -0700 (PDT) Date: Fri, 30 Jul 2021 13:26:51 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List Subject: Re: Debugging dtoc? Message-ID: <20210730172651.GD9379@bill-the-cat> References: <20210725211033.GH9379@bill-the-cat> <20210729132209.GN9379@bill-the-cat> <20210730151031.GC9379@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oEsFAYDPGdiJLi6v" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --oEsFAYDPGdiJLi6v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 30, 2021 at 10:59:22AM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Fri, 30 Jul 2021 at 09:10, Tom Rini wrote: > > > > On Fri, Jul 30, 2021 at 08:44:29AM -0600, Simon Glass wrote: > > > Hi Tom, > > > > > > On Thu, 29 Jul 2021 at 07:22, Tom Rini wrote: > > > > > > > > On Wed, Jul 28, 2021 at 07:27:08PM -0600, Simon Glass wrote: > > > > > Hi Tom, > > > > > > > > > > On Wed, 28 Jul 2021 at 17:28, Simon Glass wrot= e: > > > > > > > > > > > > Hi again, > > > > > > > > > > > > On Mon, 26 Jul 2021 at 08:06, Simon Glass wr= ote: > > > > > > > > > > > > > > Hi Tom, > > > > > > > > > > > > > > On Sun, 25 Jul 2021 at 15:10, Tom Rini w= rote: > > > > > > > > > > > > > > > > So, I'm trying to fix the problem on am335x_evm (and some f= amily > > > > > > > > configs) with needing SPL_OF_CONTROL enabled. This is most= ly fine just > > > > > > > > enabling the option, except on am335x_evm itself, which is = the > > > > > > > > kitchen-sink config and overflows memory. I've gone with s= witching to > > > > > > > > SPL_OF_PLATDATA there as am335x in general has all of the U= _BOOT_DRVINFO > > > > > > > > entries it needs I believe. But, with the following patch: > > > > > > > > > > > > > > > > diff --git a/arch/arm/dts/am335x-evm-u-boot.dtsi b/arch/arm= /dts/am335x-evm-u-boot.dtsi > > > > > > > > index 4cf5f9928d58..514f682cac99 100644 > > > > > > > > --- a/arch/arm/dts/am335x-evm-u-boot.dtsi > > > > > > > > +++ b/arch/arm/dts/am335x-evm-u-boot.dtsi > > > > > > > > @@ -8,6 +8,7 @@ > > > > > > > > &l4_per { > > > > > > > > > > > > > > > > segment@300000 { > > > > > > > > + u-boot,dm-pre-reloc; > > > > > > > > > > > > > > > > target-module@e000 { > > > > > > > > u-boot,dm-pre-reloc; > > > > > > > > diff --git a/configs/am335x_boneblack_vboot_defconfig b/con= figs/am335x_boneblack_vboot_defconfig > > > > > > > > index a0baeec79edd..ffeefd1a0087 100644 > > > > > > > > --- a/configs/am335x_boneblack_vboot_defconfig > > > > > > > > +++ b/configs/am335x_boneblack_vboot_defconfig > > > > > > > > @@ -31,6 +31,7 @@ CONFIG_CMD_SPL=3Dy > > > > > > > > # CONFIG_CMD_SETEXPR is not set > > > > > > > > CONFIG_BOOTP_DNS2=3Dy > > > > > > > > CONFIG_OF_CONTROL=3Dy > > > > > > > > +CONFIG_SPL_OF_CONTROL=3Dy > > > > > > > > CONFIG_ENV_OVERWRITE=3Dy > > > > > > > > CONFIG_ENV_IS_IN_MMC=3Dy > > > > > > > > CONFIG_SYS_REDUNDAND_ENVIRONMENT=3Dy > > > > > > > > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_= evm_defconfig > > > > > > > > index a33efff42a74..f35b2a02f56b 100644 > > > > > > > > --- a/configs/am335x_evm_defconfig > > > > > > > > +++ b/configs/am335x_evm_defconfig > > > > > > > > @@ -37,13 +37,16 @@ CONFIG_MTDIDS_DEFAULT=3D"nand0=3Dnand.0" > > > > > > > > CONFIG_MTDPARTS_DEFAULT=3D"mtdparts=3Dnand.0:128k(NAND.SPL= ),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k= (NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot= -env.backup1),8m(NAND.kernel),-(NAND.file-system)" > > > > > > > > # CONFIG_SPL_EFI_PARTITION is not set > > > > > > > > CONFIG_OF_CONTROL=3Dy > > > > > > > > +CONFIG_SPL_OF_CONTROL=3Dy > > > > > > > > CONFIG_OF_LIST=3D"am335x-evm am335x-bone am335x-boneblack = am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle" > > > > > > > > +CONFIG_SPL_OF_PLATDATA=3Dy > > > > > > > > CONFIG_ENV_OVERWRITE=3Dy > > > > > > > > CONFIG_SYS_RELOC_GD_ENV_ADDR=3Dy > > > > > > > > CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=3Dy > > > > > > > > CONFIG_SPL_ENV_IS_NOWHERE=3Dy > > > > > > > > CONFIG_VERSION_VARIABLE=3Dy > > > > > > > > CONFIG_BOOTP_SEND_HOSTNAME=3Dy > > > > > > > > +# CONFIG_SPL_SIMPLE_BUS is not set > > > > > > > > CONFIG_BOOTCOUNT_LIMIT=3Dy > > > > > > > > CONFIG_CLK=3Dy > > > > > > > > CONFIG_CLK_CDCE9XX=3Dy > > > > > > > > diff --git a/configs/am335x_evm_spiboot_defconfig b/configs= /am335x_evm_spiboot_defconfig > > > > > > > > index 8f0c330674a9..4a2a56a9af9e 100644 > > > > > > > > --- a/configs/am335x_evm_spiboot_defconfig > > > > > > > > +++ b/configs/am335x_evm_spiboot_defconfig > > > > > > > > @@ -32,6 +32,7 @@ CONFIG_BOOTP_DNS2=3Dy > > > > > > > > CONFIG_CMD_MTDPARTS=3Dy > > > > > > > > # CONFIG_SPL_EFI_PARTITION is not set > > > > > > > > CONFIG_OF_CONTROL=3Dy > > > > > > > > +CONFIG_SPL_OF_CONTROL=3Dy > > > > > > > > CONFIG_OF_LIST=3D"am335x-evm am335x-bone am335x-boneblack = am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle" > > > > > > > > CONFIG_ENV_OVERWRITE=3Dy > > > > > > > > # CONFIG_ENV_IS_IN_FAT is not set > > > > > > > > > > > > > > > > I get the following failure and I don't see how to debug th= is: > > > > > > > > DTOC spl/dts/dt-plat.c > > > > > > > > Traceback (most recent call last): > > > > > > > > File "./tools/dtoc/dtoc", line 115, in > > > > > > > > args.phase, instantiate=3Dargs.instantiate) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 1223, in run_steps > > > > > > > > outfile.method(plat) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 1081, in generate_plat > > > > > > > > self.output_node_plat(node) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 1023, in output_node_plat > > > > > > > > self._output_values(node) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 812, in _output_values > > > > > > > > self._output_prop(node, node.props[pname]) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 798, in _output_prop > > > > > > > > self._output_list(node, prop) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 628, in _output_list > > > > > > > > vals.append(get_value(prop.type, val)) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/d= tb_platdata.py", line 126, in get_value > > > > > > > > val =3D '%#x' % fdt_util.fdt32_to_cpu(value) > > > > > > > > File "/home/trini/work/u-boot/u-boot/tools/dtoc/../dtoc/f= dt_util.py", line 28, in fdt32_to_cpu > > > > > > > > return struct.unpack('>I', val)[0] > > > > > > > > TypeError: a bytes-like object is required, not 'bool' > > > > > > > > scripts/Makefile.spl:352: recipe for target 'spl/dts/dt-pla= t.c' failed > > > > > > > > make[1]: *** [spl/dts/dt-plat.c] Error 1 > > > > > > > > make[1]: *** Deleting file 'spl/dts/dt-plat.c' > > > > > > > > Makefile:1999: recipe for target 'spl/u-boot-spl' failed > > > > > > > > make: *** [spl/u-boot-spl] Error 2 > > > > > > > > > > > > > > That seems like a bug, where perhaps it is seeing a property = with no > > > > > > > value so it thinks it is a bool, but then somehow tries to ge= ts its > > > > > > > int value. > > > > > > > > > > > > > > I added a print to _output_list() > > > > > > > > > > > > > > else: > > > > > > > print('node', node.path, prop.name) > > > > > > > for val in prop.value: > > > > > > > vals.append(get_value(prop.type, val)) > > > > > > > > > > > > > > and see that it is the 'ranges' property. Definitely seems li= ke a bug > > > > > > > but I'll have to dig into it I think. The Prop() class select= s a bool > > > > > > > type when the value is empty, but somehow that isn't happenin= g. > > > > > > > > > > > > This is actually a little tricky, but I'm looking at it. > > > > > > > > > > OK I think I have figured this out. I sent a series. > > > > > > > > That gets everything building, thanks! It also shows that some par= ts of > > > > the kitchen-sink config there depend on OF_CONTROL features, really. > > > > What I'm going to prove out next (but will require a little bit of = time > > > > due to having to set up lab stuff and dig out notes) is that for th= is > > > > case, we can just go with however ROM configured the PHY. We were = also > > > > still over SRAM space, with PLATDATA enabled too. > > > > > > OK good. I think more users would help reduce the number of rough edg= es . > > > > > > Can you please point me to the tree with before/after? I would like to > > > look at SRAM space just in case I can see something. > > > > With SPL_OF_CONTROL, we're 4900 bytes over (and it's just adding > > SPL_OF_CONTROL to the current config). PLATDATA isn't an option since > > both omap_hsmmc.c and drivers/net/ti/cpsw.c need gpio by name/etc >=20 > Actually we can handle this - see for example how > clk_get_by_driver_info() works. >=20 > > functionality. The mmc case could be kludged (assume card is writable > > if needed) but cpsw is harder at first glance. >=20 > I think we should figure out how to enable of-platdata on this board. The MMC case can be fixed a few ways. It's "find the GPIO for card-change or write-protect" and just leaving that in the state ROM has it, is fine here. The driver can really just be built with this off. The network driver seems a bit more complex. drivers/net/ti/cpsw-common.c::ti_cm_get_macid_addr() and similar need to workout with PLATDATA instead. For that case where we can use one SPL and one DTB to boot a platform (or, family of platforms), something could be worked out so that we figure it all out at build-time what path will be taken. But the CPSW driver is an example of something that fairly mirrors the linux kernel driver and does as much via the DT as possible. I'm not sure how we rework this. --=20 Tom --oEsFAYDPGdiJLi6v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEENlEACgkQFHw5/5Y0 tyyxEwv/a8GahBwrKqFO13XyVbnSMWsRo/3mRISPx5Gz1LqlrfbnqDhqtRcP5Ssx 09l4o+rrh9taTkv4GHUhjua/gJFt6eF7WD76ZKBfFEc0TYZ+3BaBzDBktwMjuBAx Yh8/5SS2/+SexaWO/cUqEaeu8Io1fr+1S+OI44h4x/JWCLIf/0vp2w1BwjGIoWZM N1DH+yXT3Twq/OQWKSdXNfyt/kuUg1ImqcAPNbnQ7ZbaHB6CaxIvDzcOuOJduEWT sBlPGktCMMD6PLZQqC/O4OKN+YQIe60OdibJV3LhES5gJOIdbAYWb1QbPE6ZIKq+ ae+ZCmKD0kLPd+LlGHvwG7ZxzEwX8Vhw1QBdAVJkGUoJpjLUWPQfReH18glDTtNv U7SbqqPTNA+HncRykhrQ+BXrRUbL6tAZh3nRrYF6Oc1SmnnC3+s27T+6vx0htdHF 0K+ljgv9ziWge8cvozNVgv0UoFNl/MYFjh9xidXHipIbDsWHs8/UVpJK+Fr3RHDT R7eSH0xZ =Fi4y -----END PGP SIGNATURE----- --oEsFAYDPGdiJLi6v--