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 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 77A3FC54EAA for ; Thu, 26 Jan 2023 19:03:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46EB98554E; Thu, 26 Jan 2023 20:03:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="fYiIEr25"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05F9B8560A; Thu, 26 Jan 2023 20:03:36 +0100 (CET) Received: from xtrwsqbh.outbound-mail.sendgrid.net (xtrwsqbh.outbound-mail.sendgrid.net [167.89.100.176]) (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 D6A1A85528 for ; Thu, 26 Jan 2023 20:03:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=mime-version:subject:references:from:in-reply-to:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=VH6iLcPmMGLraX86RP6YOv9L73jTFdikaUdPb0AmPkE=; b=fYiIEr25tWm2MSZD1lL8Vin0lF/HeXRyUXCWisupuwzVrDQlaJuDLAmFFBoZf5gIQckA ZBRfyeciSD0S2Qr/8Qr+F6lp0sGaccVz925pJ+EiMhGjqMDdoCggJ5XsaEetev2DSCQI77 szqTL5Legz3GzirP0FuMCRDOT3PGYLRyujFNHFLoZKAroPc6ahK3UayRpgvRApBsIEmweW g7aLZho6JYyfgUhgrq3n0+bn4AWjY+XuiAaEzro5ZO5iHzHeDI9AV6sZuPJ5dbwxg7wO6I k6FV6C+xoh2z3kjrVWWADdberE/Qflm4EbITosmXXEaGXMil6NXqDlMIG3eACQ5g== Received: by filterdrecv-6c4ccfbdd8-br42k with SMTP id filterdrecv-6c4ccfbdd8-br42k-1-63D2CE80-49 2023-01-26 19:03:28.380596546 +0000 UTC m=+6033473.916985684 Received: from [192.168.1.50] (unknown) by geopod-ismtpd-3-2 (SG) with ESMTP id a1hrpTfBRCiRBsxwoCOw2A Thu, 26 Jan 2023 19:03:27.891 +0000 (UTC) Message-ID: <516c84b9-4867-b2ea-46ad-30decc62194a@kwiboo.se> Date: Thu, 26 Jan 2023 19:03:28 +0000 (UTC) MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RFC PATCH 00/16] arm: Add Rockchip RK3588 support Content-Language: en-US References: <20230125222741.303259-1-jagan@edgeble.ai> <2efd56b6-4dc9-cd77-3792-e60142faa6ae@kwiboo.se> <64443c40-03b1-bfe2-23fe-ad61236d7dde@kwiboo.se> From: Jonas Karlman In-Reply-To: X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hzoCiI39=2FVoiSHBd3?= =?us-ascii?Q?NwQP7sFBZxD+gWf6K7ylB=2FkM=2Fd1DjF3=2FWB6kIAU?= =?us-ascii?Q?81L0tlNEa06I=2FLFFBqd1gMPrSHQZ4=2Frhn96l5xZ?= =?us-ascii?Q?+J1GGMRFpz+ZuluKOuTiETegXUIDM3j1Ew=2F85T6?= =?us-ascii?Q?3XJXLXnddWIJkOXmQp0h=2FgwadCqsBAYC=2F3AiGd?= To: Jagan Teki , Simon Glass Cc: Kever Yang , Philipp Tomsich , fatorangecat@189.cn, u-boot@lists.denx.de X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean On 2023-01-26 19:26, Jagan Teki wrote: > Hi Simon, > > On Thu, 26 Jan 2023 at 23:34, Simon Glass wrote: >> >> Hi Jagan, >> >> On Thu, 26 Jan 2023 at 10:42, Jagan Teki wrote: >>> >>> On Thu, 26 Jan 2023 at 22:28, Jonas Karlman wrote: >>>> >>>> Hi Jagan, >>>> On 2023-01-26 17:51, Jagan Teki wrote: >>>>> Hi Jonas, >>>>> >>>>> On Thu, 26 Jan 2023 at 04:17, Jonas Karlman wrote: >>>>>> >>>>>> Hi Jagan, >>>>>> >>>>>> On 2023-01-25 23:27, Jagan Teki wrote: >>>>>>> This series support Rockchip RK3588. All the device tree files are >>>>>>> synced from linux-next with the proper SHA1 mentioned in the commit >>>>>>> messages. >>>>>>> >>>>>>> Unfortunately, the BL31 from rkbin is not compatible with U-Boot so >>>>>>> it is failing to load ATF entry from SPL and hang. >>>>>>> >>>>>>> Verified below BL31 versions, >>>>>>> bl31-v1.15 >>>>>>> bl31-v1.21 >>>>>>> bl31-v1.22 >>>>>>> bl31-v1.23 >>>>>>> bl31-v1.24 >>>>>>> bl31-v1.25 >>>>>>> bl31-v1.26 >>>>>>> >>>>>>> Rever-engineered with respect to rockchip u-boot by using the same >>>>>>> FIT_GENERATOR being used in Mainline, rockchip u-boot is booting but >>>>>>> mainline showing the same issue. >>>>>>> >>>>>>> Log: >>>>>>> >>>>>>> LPDDR4X, 2112MHz01-00642-g6bdfd31756-dirty (Jan 26 2023 ���3:44:34 +0530) >>>>>>> channel[0] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB >>>>>>> channel[1] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB >>>>>>> channel[2] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB >>>>>>> channel[3] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB >>>>>>> change to F1: 528MHz >>>>>>> change to F2: 1068MHz >>>>>>> change to F3: 1560MHz >>>>>>> change to F0: 2112MHz >>>>>>> out >>>>>>> >>>>>>> U-Boot SPL 2023.01-00642-g6bdfd31756-dirty (Jan 26 2023 - 03:44:34 +0530) >>>>>>> Trying to boot from MMC1 >>>>>>> bl31_entry: atf_entry start >>>>>>> << hang >> >>>>>>> >>>>>>> Any information on BL31 for RK3588 please share. >>>>>> >>>>>> I had a similar strange booing issue with RK3568 and mainline U-Boot, >>>>>> turned out to be related to all parts of ATF not being properly loaded >>>>>> into PMU SRAM. >>>>>> >>>>>> Using my series at [1] I managed to get ATF to be fully loaded into >>>>>> PMU SRAM. Using CONFIG_SPL_FIT_SIGNATURE=y helped me finding out that >>>>>> the segment being loaded ended up corrupted. >>>>>> >>>>>> The use of 512 bytes alignment of the FIT helped mitigate that issue. >>>>>> Vendor U-Boot use a bounce buffer for all parts that is written into >>>>>> SRAM (anything loaded outside the gd->ram_base to gd->ram_top range). >>>>>> >>>>>> You can also find newer bl31 at [2], up to version v1.32. >>>>>> >>>>>> [1] https://patchwork.ozlabs.org/project/uboot/list/?series=337891 [2] https://gitlab.com/rk3588_linux/rk/rkbin/-/tree/linux-5.10-gen-rkr3.5/bin/rk35>>>>>> Thanks for the details. I did apply this set on the master. No change >>>>> in the behavior, used BL31 and ddr from [2] as well as in >>>>> rkbin/master. >>>> >>>> I did some tests on my Radxa ROCK 3 Model B with CONFIG_SPL_FIT_SIGNATURE=y >>>> and it looked like it failed to read data into memory, see below. >>>> >>>> It also looks like the sdhci compatible is not supported by the driver. >>>> Something that may need to be added to driver to properly read data? >>>> >>>> >>>> DDR V1.09 a930779e06 typ 22/11/21-17:50:56 >>>> LPDDR4X, 2112MHz >>>> channel[0] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB >>>> channel[1] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB >>>> channel[2] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB >>>> channel[3] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB >>>> Manufacturer ID:0x6 >>>> CH0 RX Vref:31.7%, TX Vref:21.8%,20.8% >>>> CH1 RX Vref:31.7%, TX Vref:21.8%,21.8% >>>> CH2 RX Vref:32.7%, TX Vref:22.8%,21.8% >>>> CH3 RX Vref:32.7%, TX Vref:21.8%,20.8% >>>> change to F1: 528MHz >>>> change to F2: 1068MHz >>>> change to F3: 1560MHz >>>> change to F0: 2112MHz >>>> out >>>> >>>> U-Boot SPL 2023.01 (Jan 26 2023 - 00:24:53 +0000) >>>> Trying to boot from MMC1 >>>> ## Checking hash(es) for config config_1 ... OK >>>> ## Checking hash(es) for Image atf_1 ... sha256 error! >>>> Bad hash value for 'hash' hash node in 'atf_1' image node >>>> mmc_load_image_raw_sector: mmc block read error >>>> Trying to boot from MMC1 >>>> ## Checking hash(es) for config config_1 ... OK >>>> ## Checking hash(es) for Image atf_1 ... sha256 error! >>>> Bad hash value for 'hash' hash node in 'atf_1' image node >>> >>> Look like this is something wrong with your patch series or master >>> changes on binman, not with the driver. I have observed the same if I >>> enable CONFIG_SPL_FIT_SIGNATURE. >> >> There are some more changes in dm/master that I'm about to pull in. >> One of them from Jonas Karlman adds hash nodes so may be involved. > > I found the same issue on the dm/master > > U-Boot SPL 2023.01-00176-gb21fb7a9c0 (Jan 26 2023 - 23:55:11 +0530) > Trying to boot from MMC1 > ## Checking hash(es) for config config-1 ... OK > ## Checking hash(es) for Image atf-1 ... sha256 error! > Bad hash value for 'hash' hash node in 'atf-1' image node > mmc_load_image_raw_sector: mmc block read error > SPL: failed to boot from all boot devices > ### ERROR ### Please RESET the board ### On my RK3568 ROCK 3A board this is working correctly, see below. This was using u-boot master 17e8e58fe62c019b2cc26af221b6defc3368229f with a few patches on top, see [1]. ------------- U-Boot SPL 2023.01 (Jan 26 2023 - 18:29:56 +0000) Trying to boot from MMC1 ## Checking hash(es) for config config-1 ... OK ## Checking hash(es) for Image atf-1 ... sha256+ OK ## Checking hash(es) for Image u-boot ... sha256+ OK ## Checking hash(es) for Image fdt-1 ... sha256+ OK ## Checking hash(es) for Image atf-2 ... sha256+ OK ## Checking hash(es) for Image atf-3 ... sha256+ OK ## Checking hash(es) for Image atf-4 ... sha256+ OK ## Checking hash(es) for Image atf-5 ... sha256+ OK ## Checking hash(es) for Image atf-6 ... sha256+ OK INFO: Preloader serial: 2 NOTICE: BL31: v2.3():v2.3-460-g2c8be93f9:huan.he NOTICE: BL31: Built : 19:45:17, Nov 8 2022 INFO: GICv3 without legacy support detected. INFO: ARM GICv3 driver initialized in EL3 INFO: pmu v1 is valid 220114 INFO: dfs DDR fsp_param[0].freq_mhz= 1560MHz INFO: dfs DDR fsp_param[1].freq_mhz= 324MHz INFO: dfs DDR fsp_param[2].freq_mhz= 528MHz INFO: dfs DDR fsp_param[3].freq_mhz= 780MHz INFO: Using opteed sec cpu_context! INFO: boot cpu mask: 0 INFO: BL31: Initializing runtime services WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK ERROR: Error initializing runtime service opteed_fast INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0xa00000 INFO: SPSR = 0x3c9 U-Boot 2023.01 (Jan 26 2023 - 18:29:56 +0000) Model: Rockchip RK3568 EVB1 DDR4 V10 Board DRAM: 8 GiB (effective 7.7 GiB) Core: 58 devices, 17 uclasses, devicetree: separate MMC: mmc@fe2b0000: 1, mmc@fe310000: 0 ... ------------- However, on my RK3588 ROCK 5B device I get a similar error you get. Seems to be the mmc reading that times out all of sudden. It can read the FIP and config, and then some mmc command/transfer times out. See below for details with LOG_DEBUG defined at top of include/log.h This was trying to boot from a SD-card, trying to use eMMC fails earlier. Because there is no driver for emmc compatible, SPL only tries to boot from SD-card. I believe this is related to your << hang >>, reading atf from mmc fails in the background and there is no error message. That is why I suggested trying with CONFIG_SPL_FIT_SIGNATURE=y, to see if there is any hidden issue trying to load ATF. ------------- Trying to boot from MMC1 ## Checking hash(es) for config config-1 ... OK mmc_load_image_raw_sector: mmc block read error Trying to boot from MMC1 mmc_load_image_raw_sector: mmc block read error SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### ------------- Trying to boot from MMC1 0 - 0 'mmc@fe2c0000' - found blk_find_device: uclass_id=67, devnum=0: mmc@fe2c0000.blk, 67, 0 clock is disabled (0Hz) Buswidth = 0, clock: 0 Buswidth = 1, clock: 0 clock is enabled (400000Hz) Buswidth = 1, clock: 400000 Sending CMD0 Sending CMD8 Sending CMD55 Sending CMD41 Sending CMD55 Sending CMD41 Sending CMD2 Sending CMD3 Sending CMD9 Sending CMD7 Sending CMD55 Sending CMD51 Sending CMD6 Sending CMD55 Sending CMD6 Buswidth = 4, clock: 400000 Sending CMD6 clock is enabled (50000000Hz) Buswidth = 4, clock: 50000000 clk_set_rate(clk=500000, rate=50000000) rockchip_dwmmc_get_mmc_clk: err=-2 spl: mmc boot mode: raw blk_find_device: uclass_id=67, devnum=0: mmc@fe2c0000.blk, 67, 0 Sending CMD16 Sending CMD17 hdr read sector 4000, count=1 Found FIT size=a00, ptr=ac0, limit=100000: aligned to 5000c0 blk_find_device: uclass_id=67, devnum=0: mmc@fe2c0000.blk, 67, 0 Sending CMD16 Sending CMD18 Sending CMD12 fit read sector 4000, sectors=5, dst=5000c0, count=5, size=0xa00 Selecting default config 'rk3588-evb.dtb' ## Checking hash(es) for config config-1 ... fit_config_verify_required_keys: No signature node found: FDT_ERR_NOTFOUND OK firmware: 'atf-1' blk_find_device: uclass_id=67, devnum=0: mmc@fe2c0000.blk, 67, 0 Sending CMD16 Sending CMD18 dwmci_data_transfer: Timeout waiting for data! mmc_load_image_raw_sector: mmc block read error spl: mmc boot mode: fs Trying to boot from MMC1 0 - 0 'mmc@fe2c0000' - found blk_find_device: uclass_id=67, devnum=0: mmc@fe2c0000.blk, 67, 0 spl: mmc boot mode: raw blk_find_device: uclass_id=67, devnum=0: mmc@fe2c0000.blk, 67, 0 Sending CMD16 dwmci_send_cmd: Response Timeout. hdr read sector 4000, count=0 mmc_load_image_raw_sector: mmc block read error spl: mmc boot mode: fs SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### ------------- [1] https://github.com/Kwiboo/u-boot-rockchip/compare/17e8e58fe62c019b2cc26af221b6defc3368229f...123bee8cb2229ebae35810371827d2b73b71248b Regards, Jonas > > Jagan.