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 C4344C636D7 for ; Sat, 18 Feb 2023 04:43:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2AD71855D9; Sat, 18 Feb 2023 05:43:39 +0100 (CET) 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="qPWI1HCo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4306285677; Sat, 18 Feb 2023 05:43:37 +0100 (CET) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 AC16F8552C for ; Sat, 18 Feb 2023 05:43:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-wr1-x432.google.com with SMTP id bt27so2628635wrb.3 for ; Fri, 17 Feb 2023 20:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eoMlzBrJxCFmh/GDm4zAVlwHEQmhiA2qnJuTqZOIkWI=; b=qPWI1HCo6GN913ILvw5z0pVuf5li844YMeTBKY6vk11TH38gdquhjcL4CuB8NtU6i5 QblBwgKGcCqSu9sHqRO2xz5e28Gojc5ix/rACor7reH+HCs7OpJsYcejflj3Sn4TKAGT RAskGmhkn54imFxRJrc5fgQEB+CVDGlEAqvQMSFYqRdnV8qSGNOn6IEfLaKaIOYBRPYV caZKI4QfmpBg4SnCHdlA6yISXbbHI3rb+LEUYIrT9BGgTk4QBJ6JMdsSdARc9/dB5JGl AGmLWNKCEiYeUnIr76JttXrT8cdGPvNamMp0r3thPevnio1OaaJt/u0PUxJW244UOWxM q86g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eoMlzBrJxCFmh/GDm4zAVlwHEQmhiA2qnJuTqZOIkWI=; b=jdYbuONyYkKUh/4tea/rxOfvOFGpXeNbPJfeQDz3KILAXx0K4aEoIDksV6b5wI4V6A 6bN+3fmrCw//rMa053ar3tnc+MWUvSktvTpLHSDXcElz41qmB4MHpznG9PlNrWTsB1nU ajr0A6piO6rPIN7P9aKQSUMAv+1zDrD3WVD38DCXG2rq70GwlR2fav0vxd5QAyPipNG7 L24Z/d5ZBi86X7KDOhqIchBml8Nx+4jjuzRG7rED3lhEFhYyLd81P8el9eYJsO083QIT PokP0lXkff7EOIBkC+9oMasI2hKeJ+yb8+xt1Fvs3JNb0a+2oAsVRfqLqC+V7tJl+5JA XV2A== X-Gm-Message-State: AO0yUKUhHhHWhwsCui1uJOyJFrTy90p2GnJQ5a36Qvl+rSDMiKwg1lpE 1EzhDLFlW+OhriJsylMxOTs= X-Google-Smtp-Source: AK7set/nyjTMwihOvOXaCt5TZPqUnm1JcVylXYY7PCwE8Ng88V3HiIASJQ1cH0l4dEtf6e8Lqx62lQ== X-Received: by 2002:a5d:6a06:0:b0:2c5:5331:5516 with SMTP id m6-20020a5d6a06000000b002c553315516mr609504wru.51.1676695413981; Fri, 17 Feb 2023 20:43:33 -0800 (PST) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id j13-20020a056000124d00b002c54e26bca5sm6011094wrx.49.2023.02.17.20.43.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Feb 2023 20:43:33 -0800 (PST) Message-ID: <68feadb7-5446-9f0d-0dd7-96b49a98cdc1@gmail.com> Date: Sat, 18 Feb 2023 05:43:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v3 4/5] rockchip: mkimage: Update init size limit To: Jonas Karlman , Simon Glass , Philipp Tomsich , Kever Yang , Joseph Chen , Alper Nebi Yasak Cc: Quentin Schulz , Jagan Teki , Heinrich Schuchardt , u-boot@lists.denx.de References: <20230217205247.3402473-1-jonas@kwiboo.se> <20230217205247.3402473-5-jonas@kwiboo.se> Content-Language: en-US From: Johan Jonker In-Reply-To: <20230217205247.3402473-5-jonas@kwiboo.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 Hi Jonas, On 2/17/23 21:52, Jonas Karlman wrote: > Sync init size limit from vendor u-boot: This sync might not be correct. Please recheck with each SoC or limit your change to the rk3328 SoC if prove fails. Could Kever disclose SoC details here? Johan > > px30: 12KiB (+2KiB) > rk3066: 32KiB (+2KiB) On the rk3066 the limitation depends on the bootrom logic and the tpl location it is loaded in memory: //SPL flash_boot_size = idb_buf[0].flash_boot_size; size = flash_boot_size - 5; if ( size >= 32763 ) flash_boot_size = 10; //TPL flash_data_size = idb_buf[0].flash_data_size; if (flash_data_size - 4 >= 61 || flash_boot_size < flash_data_size || flash_data_size & 3) { flash_data_size = 4; } offset = idb_buf[0].boot_code1_offset + start; === CONFIG_TPL_TEXT_BASE=0x10080C00 TPL/SPL truncated to 2048 = 4 sectors of 512bytes per NAND page. Header size = 4 x 512bytes limit1: flash_data_size - 4 >= 61 limit2: flash_boot_size < flash_data_size === usFlashDataSec = (ALIGN(dwLoaderDataSize, 2048)) / SECTOR_SIZE; usFlashBootSec = (ALIGN(dwLoaderSize, 2048)) / SECTOR_SIZE; dwSectorNum = 4 + usFlashDataSec + usFlashBootSec; pSec0->usBootDataSize = usFlashDataSec; pSec0->usBootCodeSize = usFlashDataSec + usFlashBootSec; > rk3328: 30KiB (+2KiB) > rk3568: 60KiB (-16KiB) > > This makes it possible to use latest vendor TPL with RK3328 without > getting a size limit error running the mkimage command. > > Signed-off-by: Jonas Karlman > --- > v3: > - Sync with vendor u-boot as-is > - Update commit message to include size changes > > v2: > - New patch > > tools/rkcommon.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/rkcommon.c b/tools/rkcommon.c > index 1f1eaa16752b..630e54b1a54d 100644 > --- a/tools/rkcommon.c > +++ b/tools/rkcommon.c > @@ -121,20 +121,20 @@ struct spl_info { > }; > > static struct spl_info spl_infos[] = { > - { "px30", "RK33", 0x2800, false, RK_HEADER_V1 }, > + { "px30", "RK33", 0x4000 - 0x1000, false, RK_HEADER_V1 }, > { "rk3036", "RK30", 0x1000, false, RK_HEADER_V1 }, > - { "rk3066", "RK30", 0x8000 - 0x800, true, RK_HEADER_V1 }, This is OK. > - { "rk3128", "RK31", 0x1800, false, RK_HEADER_V1 }, > + { "rk3066", "RK30", 0x8000, true, RK_HEADER_V1 }, This wrong. printf "%d\n" $(((0x8000 - 0x800 ) / 512)) 60 sectors of size 512 > + { "rk3128", "RK31", 0x2000 - 0x800, false, RK_HEADER_V1 }, > { "rk3188", "RK31", 0x8000 - 0x800, true, RK_HEADER_V1 }, > { "rk322x", "RK32", 0x8000 - 0x1000, false, RK_HEADER_V1 }, > { "rk3288", "RK32", 0x8000, false, RK_HEADER_V1 }, > { "rk3308", "RK33", 0x40000 - 0x1000, false, RK_HEADER_V1 }, > - { "rk3328", "RK32", 0x8000 - 0x1000, false, RK_HEADER_V1 }, > + { "rk3328", "RK32", 0x8000 - 0x800, false, RK_HEADER_V1 }, > { "rk3368", "RK33", 0x8000 - 0x1000, false, RK_HEADER_V1 }, > { "rk3399", "RK33", 0x30000 - 0x2000, false, RK_HEADER_V1 }, > { "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 }, > { "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 }, > - { "rk3568", "RK35", 0x14000 - 0x1000, false, RK_HEADER_V2 }, > + { "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 }, > }; > > /**