From patchwork Sat Sep 9 09:33:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Massimo Pegorer X-Patchwork-Id: 1831790 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=VbW1fps8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RjSTW2Lwhz1yfm for ; Sat, 9 Sep 2023 19:33:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9659B86564; Sat, 9 Sep 2023 11:33:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VbW1fps8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8181F86564; Sat, 9 Sep 2023 11:33:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (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 F2EF886552 for ; Sat, 9 Sep 2023 11:33:28 +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=massimo.pegorer+oss@gmail.com Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-401c90ed2ecso29950735e9.0 for ; Sat, 09 Sep 2023 02:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694252008; x=1694856808; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=nt1skYGfyuCnjKgVTjYoAKKorPWX04bcFrut3/581Fw=; b=VbW1fps8P1BpJ5x+ds/QhWEqCcSKtA1TdjONbkx9ImZfvqrzq8ooaaW24qsCNXclX+ k6DVVtL3WDXSQHqRP6lZ+eykB5z+kdG1u5jS9pLyoMRgluRCvOVN7jBJDFVDWBP66a+u A9eQC6Op9W1lugZrhvhQJ/9Q0oh857DTR9nv/up7zkrrsDRPrERVzYtcrG2c/6lm33+N 3VXOjxW73DNFj/UNIYRxJzod7OYnyVI+iVDhdoglVdWeD8SEnq3M+5Nkdp8t12ECsbwh lTLP19Chv3bU/5gi1IsoZp3WdJYd1krv9r9FGgj4h7dp31GA4fIG9VWdfddqcvotgZp/ Sspw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694252008; x=1694856808; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nt1skYGfyuCnjKgVTjYoAKKorPWX04bcFrut3/581Fw=; b=b71jgeGhiFfx+AWi2O8CA8W+kTaVq24eIQojVHVG/aLqNQKoeUmLLWuRVtHoQfxWQe yoz9o22djs4CR8g6kNfUxwK5x90ifkNQOh+DdrUsUjEHgB9bTWnfgdKS5e9dxzxx7E6R viPQMdxPlDq/B3ZjcIwzekaaV+59LZCVsqj9Xt219GNYylOO+7a9raPWg9JBLbQEJpAw nQqTGIOuDELDeRnFoT3l8h3f9RMzvBukaG8IvZtwwCOsL8Zjsd0mZgZfFSUcKgxd6cy6 MmWRtVM7IXr7Lk8pIZWSlq5YTHaydxNVRq3j+DizMrEQ1KN4JHAVycukNhZFgRECAVA3 EgXQ== X-Gm-Message-State: AOJu0YzHlloT6RLDpdLA1er1d/heCsZfmT11mUc5oVDBLBgYaA0VBH7N ORImuau/IV14cvagHVq4oArqp7BuHXvBhw== X-Google-Smtp-Source: AGHT+IF6lsJlCtr2TKHEJHbCjWz2kwPgEPf8Xoxpbcf6KWSkoHMhUYXajB0IxsSxAy8IsqEZuvxnmg== X-Received: by 2002:a05:600c:ad3:b0:401:bcd9:4871 with SMTP id c19-20020a05600c0ad300b00401bcd94871mr4205829wmr.21.1694252008117; Sat, 09 Sep 2023 02:33:28 -0700 (PDT) Received: from pegmas-T15.fritz.box ([151.51.159.106]) by smtp.gmail.com with ESMTPSA id n21-20020a1c7215000000b003fc16ee2864sm4058206wmc.48.2023.09.09.02.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Sep 2023 02:33:27 -0700 (PDT) From: Massimo Pegorer To: u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Jonas Karlman , Jagan Teki , FUKAUMI Naoki , Johan Jonker Cc: Massimo Pegorer Subject: [PATCH v2 1/2] rockchip: Kconfig: Enable external TPL binary for rk3308 Date: Sat, 9 Sep 2023 11:33:24 +0200 Message-Id: <20230909093324.11954-1-massimo.pegorer+oss@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 There is no support to initialize DRAM on rk3308 SoC using U-Boot TPL or SPL, and therefore an external TPL binary must be used to package a bootable u-boot-rockchip.bin image. Default ROCKCHIP_EXTERNAL_TPL to yes if ROCKCHIP_RK3308. Remove useless TPL_SERIAL. Signed-off-by: Massimo Pegorer Tested-by: FUKAUMI Naoki Reviewed-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index a279582f4f..3b044269bd 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -166,7 +166,6 @@ config ROCKCHIP_RK3308 imply SPL_SYSCON imply SPL_RAM imply SPL_SERIAL - imply TPL_SERIAL imply SPL_SEPARATE_BSS help The Rockchip RK3308 is a ARM-based Soc which embedded with quad @@ -436,7 +435,7 @@ config TPL_ROCKCHIP_COMMON_BOARD config ROCKCHIP_EXTERNAL_TPL bool "Use external TPL binary" - default y if ROCKCHIP_RK3568 || ROCKCHIP_RK3588 + default y if ROCKCHIP_RK3308 || ROCKCHIP_RK3568 || ROCKCHIP_RK3588 help Some Rockchip SoCs require an external TPL to initialize DRAM. Enable this option and build with ROCKCHIP_TPL=/path/to/ddr.bin to From patchwork Sat Sep 9 09:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Massimo Pegorer X-Patchwork-Id: 1831791 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=D5jWTQbq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RjSTk1k3Fz1yfm for ; Sat, 9 Sep 2023 19:33:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EBF6F86537; Sat, 9 Sep 2023 11:33:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D5jWTQbq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A4E7685DFA; Sat, 9 Sep 2023 11:33:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,TVD_PH_SUBJ_META1,WEIRD_QUOTING autolearn=no autolearn_force=no version=3.4.2 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (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 73CAA86940 for ; Sat, 9 Sep 2023 11:33:38 +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=massimo.pegorer+oss@gmail.com Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-401d80f4ef8so29836575e9.1 for ; Sat, 09 Sep 2023 02:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694252018; x=1694856818; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=nJ2fNPtQTXZZWlrYuaTV3q56Q3LcE0/hov+j21wXvrU=; b=D5jWTQbq3runUFZCPha5CCtVQizOZEuq3faqmfb2SAGlXc+iIefvzE+qeoVgU8wzTI w4/vPPPbt3Zku+7R1dn6NddBp8JsWP2nthyy5Abgm5990Qw0cy7s282ro8bAWMM5Pe9X Kf3rqks9BldaC2mU1aTcMfEgvgWGExMWOUDJdL86/OOaqSMFJh0QeXjeS1QWxKLlnxYN fvkno32NAcPAdBp2oAgHdxOuRQb9yXzDu1/Ju4+QFOW1naxzkkzeYawUGwv1Xtw5aifs 1aa5G3LJSIdABaMxYJu50vPKHAFxilbdICXCyPBo+lOq3zemu4RkT+//ZB9Bw15hWynL 6CeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694252018; x=1694856818; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nJ2fNPtQTXZZWlrYuaTV3q56Q3LcE0/hov+j21wXvrU=; b=gJ8ee3WiilOPRF22xj8StWihrzwftYQcQ8w0lSADzglhVVJIJPJx0Eoj9iFATVr4vY 11u3nzkq7r893STVTDb/K6W7wnsJW1pzBpIqXlNXae/LPFNR59e/+ySYBSuWkVyb3Cm+ UDeUTrnBEqJsRU2n5P1wW6aO11mCbwrH7cL617l8tYvL8deUeJNm7zeM2vCvGp/LKk4k 3hlPnH903vz1/JWywrX55TJTwqvIukHW8pH7m4AD6mBdGv26Ofm1Vv1h5/TmF0UAlzSl g7Erlqc1aqaQgS54ocAa7jY5JADMiy/2JiYuNJfV9ChQ0zFvzGSOXzGwfbwHEG+9lZX0 m+Ow== X-Gm-Message-State: AOJu0Yw7ZNwZLOSumL3ykXJCJN1LABi3cdVwSDsnHEQ91XKkMzudrCqy Fw8wuYdqroWkHacA4mCg1eproogI5XJbpQ== X-Google-Smtp-Source: AGHT+IEdK//c8ExDiHXNzPC5A3dJhGU4PiFI7+nBw2OqnQbMDtEsFrjsLyndioDwYxZL1bPSMr3SGA== X-Received: by 2002:a05:600c:1e14:b0:401:d1a3:d7f7 with SMTP id ay20-20020a05600c1e1400b00401d1a3d7f7mr3822144wmb.30.1694252017544; Sat, 09 Sep 2023 02:33:37 -0700 (PDT) Received: from pegmas-T15.fritz.box ([151.51.159.106]) by smtp.gmail.com with ESMTPSA id 2-20020a05600c22c200b003fefca26c72sm4160515wmg.23.2023.09.09.02.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Sep 2023 02:33:37 -0700 (PDT) From: Massimo Pegorer To: u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Jonas Karlman , Jagan Teki , FUKAUMI Naoki , Johan Jonker Cc: Massimo Pegorer Subject: [PATCH v2 2/2] doc: rockchip: Update and improve info on rk3308, TPL and TF-A Date: Sat, 9 Sep 2023 11:33:33 +0200 Message-Id: <20230909093333.11976-1-massimo.pegorer+oss@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 Update and improve documentation about build steps for SoCs that require using TF-A and TPL binaries provided by Rockchip, such as rk3308. Add rk3308 boards case to rST document. Add ROCK Pi S in the list of supported boards. Minor page format improvements. Signed-off-by: Massimo Pegorer Reviewed-by: Kever Yang --- doc/README.rockchip | 10 +------- doc/board/rockchip/rockchip.rst | 43 +++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/doc/README.rockchip b/doc/README.rockchip index 52b5140eca..84caff8a24 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -38,16 +38,8 @@ Building (or you can use another cross compiler if you prefer) 2. To build RK3308 board: - - Get the rkbin - => git clone https://github.com/rockchip-linux/rkbin.git - - Compile U-Boot - => cd /path/to/u-boot - => export BL31=/path/to/rkbin/bin/rk33/rk3308_bl31_v2.22.elf - => make roc-cc-rk3308_defconfig - => make CROSS_COMPILE=aarch64-linux-gnu- all - => ./tools/mkimage -n rk3308 -T rksd -d /path/to/rkbin/bin/rk33/rk3308_ddr_589MHz_uart2_m0_v1.26.bin idbloader.img - => cat spl/u-boot-spl.bin >> idbloader.img + See doc/board/rockchip/rockchip.rst 3. To build RK3399 board: diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst index de9fe8e642..d0fa7a9c8f 100644 --- a/doc/board/rockchip/rockchip.rst +++ b/doc/board/rockchip/rockchip.rst @@ -53,6 +53,7 @@ List of mainline supported Rockchip boards: - Google Speedy (chromebook_speedy) - Amarula Vyasa-RK3288 (vyasa-rk3288) * rk3308 + - Radxa ROCK Pi S (rock-pi-s-rk3308) - Rockchip Evb-RK3308 (evb-rk3308) - Roc-cc-RK3308 (roc-cc-rk3308) * rk3326 @@ -142,6 +143,19 @@ To build TF-A: Specify the PLAT= with desired Rockchip platform to build TF-A for. +For SoCs whose TF-A code is not available as open source, use BL31 binary provided by Rockchip: + +.. code-block:: bash + + git clone --depth 1 https://github.com/rockchip-linux/rkbin + +TPL +^^^ + +For some SoCs U-Boot sources lack of support to inizialize DRAM. +In these cases, to get a fully functional image following :ref:`PackageWithTPLandSPL`, use DDR binary provided by Rockchip rkbin repository as ROCKCHIP_TPL when building U-Boot. +Otherwise, follow :ref:`PackageWithRockchipMiniloader`. + U-Boot ^^^^^^ @@ -172,6 +186,15 @@ To build rk3288 boards: make evb-rk3288_defconfig make CROSS_COMPILE=arm-linux-gnueabihf- +To build rk3308 boards: + +.. code-block:: bash + + export BL31=../rkbin/bin/rk33/rk3308_bl31_v2.26.elf + export ROCKCHIP_TPL=../rkbin/bin/rk33/rk3308_ddr_589MHz_uartX_mY_v2.07.bin + make evb-rk3308_defconfig + make CROSS_COMPILE=aarch64-linux-gnu- + To build rk3328 boards: .. code-block:: bash @@ -218,11 +241,13 @@ To build rk3588 boards: Flashing -------- +.. _`PackageWithTPLandSPL`: + 1. Package the image with U-Boot TPL/SPL ------------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SD Card -^^^^^^^ +""""""" All Rockchip platforms (except rk3128 which doesn't use SPL) are now supporting a single boot image using binman. @@ -235,7 +260,7 @@ To write an image that boots from a SD card (assumed to be /dev/sda): sync eMMC -^^^^ +"""" eMMC flash would probe on mmc0 in most of the Rockchip platforms. @@ -274,7 +299,7 @@ For Rockchip 32-bit platforms the U-Boot proper image is u-boot-dtb.img SPI -^^^ +""" Write u-boot-rockchip-spi.bin to offset 0 of SPI flash. @@ -286,8 +311,10 @@ Copy u-boot-rockchip-spi.bin into SD card and boot from SD: load mmc 1:1 $kernel_addr_r u-boot-rockchip-spi.bin sf update $fileaddr 0 $filesize +.. _`PackageWithRockchipMiniloader`: + 2. Package the image with Rockchip miniloader ---------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Image package with Rockchip miniloader requires rkbin [1]. @@ -327,14 +354,14 @@ Note: 2. 0x200000 is a load address and is an option for some platforms. 3. Package the RK3066 image with U-Boot TPL/SPL on NAND -------------------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unlike later SoC models the rk3066 BootROM doesn't have SDMMC support. If all other boot options fail then it enters into a BootROM mode on the USB OTG port. This method loads TPL/SPL on NAND with U-Boot and kernel on SD card. SD Card -^^^^^^^ +""""""" U-Boot expects a GPT partition map and a boot directory structure with files on the SD card. @@ -369,7 +396,7 @@ To write a U-Boot image to the SD card (assumed to be /dev/sda): sync NAND -^^^^ +"""" Bring device in BootROM mode: