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 A9BC5C433F5 for ; Sat, 16 Apr 2022 15:18:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2B3983DAA; Sat, 16 Apr 2022 17:18:42 +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=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="IiAQWndC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D9E8F83DAA; Sat, 16 Apr 2022 17:18:39 +0200 (CEST) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 854F983E53 for ; Sat, 16 Apr 2022 17:10:10 +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=jbx6244@gmail.com Received: by mail-ej1-x630.google.com with SMTP id s18so20058202ejr.0 for ; Sat, 16 Apr 2022 08:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dhfhEr347LcnYggVL+12KxTcJ8AyXZWimIBjdPgau74=; b=IiAQWndCiUlsxUbazI2MzSQBHY27Rh6dfyxi8rie7L25Z3325SukoaDkco0et/5XJk sWMXY78lEy8xPLe4lTgDAH9aorSXqV5c5dwZAnvAQzRyImfnofVua9LBPJr+pWceM3Rx 8YziAQa1JdnKy0AnmRUuTLdpxtpfV7n2f/G/J8y1Bly3vschd4G7d4uid5owPHvzufhA hwXeku5Z2ROHSb2oxxw9dtO00qAa03++txrpy49GMHJBGV0h0F/2XI8awVxkGqVXmdEy hGFK0MuCWELcaeoajFWg3njeW4zbQfnnHgRG27lwdw1IJQglyEGezq4I6jWb468q77+R 8goQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dhfhEr347LcnYggVL+12KxTcJ8AyXZWimIBjdPgau74=; b=XWP2YQhNbwwqlspdMDz0Qnl+vIntvnVrJGjc6tMafzkOT/zCwLt7vbvy22zEwndUxC 1bmx/N1je+93TPaVQjSz1LqLJ+HCfWQUf0VSponVf7+QJ4aztum1NXWVhX6JUNJpnTvN 62xCApFFliHmAn+tmQv2wp9kmryyhDhLIi3lVodW9B/esYR10jnE9F7RkqXZ6/fJlmS0 IUFIGj6CN+Lc3AdRtmmV29QbKiPO4SK9q8q1XtiZwqnjvhuz2uucKqD1wz7eqWcbBimF 93RPTNACHJUnLnH0mF9u4XLWAv0NyvxXBx0mmQ7V9noFrv1We4J/MX+qLPtr29Fe2JyA /iTw== X-Gm-Message-State: AOAM532i1gSyCWgcD/IlO+SiQKX83wLA1OsOHalWbBH3jL2qJP1WrwPi B1CrZwR8p4H6i/1eJQ1yS4A= X-Google-Smtp-Source: ABdhPJymnvP+yXDNZFg5P+ml0YQA7eIB3kPdo+HDHfCnlNGrYSiKOj1gS58yRiX5PwgSbHlgim0s8A== X-Received: by 2002:a17:906:7056:b0:6d6:dd99:f2a4 with SMTP id r22-20020a170906705600b006d6dd99f2a4mr2892651ejj.43.1650121810069; Sat, 16 Apr 2022 08:10:10 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id l3-20020aa7cac3000000b00422c961c8c9sm2152510edt.78.2022.04.16.08.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Apr 2022 08:10:09 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, lukma@denx.de, seanga2@gmail.com, u-boot@lists.denx.de Subject: [PATCH v11 14/16] doc: rockchip: restyle rockchip.rst Date: Sat, 16 Apr 2022 17:09:50 +0200 Message-Id: <20220416150952.18758-15-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220416150952.18758-1-jbx6244@gmail.com> References: <20220416150952.18758-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean With more text coming to the rockchip.rst document, give it a restyle first. Changed: sort build examples alphabetically add git clone example fix bash examples fix phrases (grammer) fix typos Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- Changed V11: add # to bash example --- doc/board/rockchip/rockchip.rst | 140 ++++++++++++++++++++------------ 1 file changed, 89 insertions(+), 51 deletions(-) diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst index a75e60b9fa..1a4de7ff1e 100644 --- a/doc/board/rockchip/rockchip.rst +++ b/doc/board/rockchip/rockchip.rst @@ -13,7 +13,7 @@ and it's usage steps. Rockchip boards --------------- -Rockchip is SoC solutions provider for tablets & PCs, streaming media +Rockchip is a SoC solutions provider for tablets & PCs, streaming media TV boxes, AI audio & vision, IoT hardware. A wide range of Rockchip SoCs with associated boards are supported in @@ -85,42 +85,58 @@ Building TF-A ^^^^ -TF-A would require to build for ARM64 Rockchip SoCs platforms. +TF-A is required when building ARM64 Rockchip SoCs images. -To build TF-A:: +To build TF-A: - git clone https://github.com/ARM-software/arm-trusted-firmware.git +.. code-block:: bash + + git clone --depth 1 https://github.com/ARM-software/arm-trusted-firmware.git cd arm-trusted-firmware make realclean make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 + cd .. Specify the PLAT= with desired Rockchip platform to build TF-A for. U-Boot ^^^^^^ -To build rk3328 boards:: +.. code-block:: bash - export BL31=/path/to/arm-trusted-firmware/to/bl31.elf - make evb-rk3328_defconfig - make + git clone --depth 1 https://source.denx.de/u-boot/u-boot.git + cd u-boot + +To build rk3288 boards: -To build rk3288 boards:: +.. code-block:: bash make evb-rk3288_defconfig - make + make CROSS_COMPILE=arm-linux-gnueabihf- + +To build rk3328 boards: + +.. code-block:: bash + + export BL31=../arm-trusted-firmware/build/rk3328/release/bl31/bl31.elf + make evb-rk3328_defconfig + make CROSS_COMPILE=aarch64-linux-gnu- + +To build rk3368 boards: -To build rk3368 boards:: +.. code-block:: bash - export BL31=/path/to/arm-trusted-firmware/to/bl31.elf + export BL31=../arm-trusted-firmware/build/rk3368/release/bl31/bl31.elf make evb-px5_defconfig - make + make CROSS_COMPILE=aarch64-linux-gnu- + +To build rk3399 boards: -To build rk3399 boards:: +.. code-block:: bash - export BL31=/path/to/arm-trusted-firmware/to/bl31.elf + export BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf make evb-rk3399_defconfig - make + make CROSS_COMPILE=aarch64-linux-gnu- Flashing -------- @@ -131,10 +147,12 @@ Flashing SD Card ^^^^^^^ -All Rockchip platforms, except rk3128 (which doesn't use SPL) are now -supporting single boot image using binman and pad_cat. +All Rockchip platforms (except rk3128 which doesn't use SPL) are now +supporting a single boot image using binman and pad_cat. -To write an image that boots from an SD card (assumed to be /dev/sda):: +To write an image that boots from a SD card (assumed to be /dev/sda): + +.. code-block:: bash sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64 sync @@ -144,45 +162,60 @@ eMMC eMMC flash would probe on mmc0 in most of the Rockchip platforms. -Create GPT partition layout as defined in configurations:: +Create GPT partition layout as defined in $partitions: + +.. code-block:: bash mmc dev 0 gpt write mmc 0 $partitions -Connect the USB-OTG cable between host and target device. +Connect the USB-OTG cable between the host and a target device. + +Launch fastboot on the target with: -Launch fastboot at target:: +.. code-block:: bash fastboot 0 -Upon successful gadget connection,host show the USB device like:: +Upon a successful gadget connection the host shows the USB device with: + +.. code-block:: bash lsusb - Bus 001 Device 020: ID 2207:330c Fuzhou Rockchip Electronics Company RK3399 in Mask ROM mode + # Bus 001 Device 020: ID 2207:330c Fuzhou Rockchip Electronics Company RK3399 in Mask ROM mode + +Program the flash with: -Program the flash:: +.. code-block:: bash sudo fastboot -i 0x2207 flash loader1 idbloader.img sudo fastboot -i 0x2207 flash loader2 u-boot.itb -Note: for Rockchip 32-bit platforms the U-Boot proper image +Note: + +For Rockchip 32-bit platforms the U-Boot proper image is u-boot-dtb.img SPI ^^^ -Generating idbloader for SPI boot would require to input a multi image -image format to mkimage tool instead of concerting (like for MMC boot). +The SPI boot method requires the generation of idbloader.img with help of the mkimage tool. + +SPL-alone SPI boot image: -SPL-alone SPI boot image:: +.. code-block:: bash ./tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin idbloader.img -TPL+SPL SPI boot image:: +TPL+SPL SPI boot image: + +.. code-block:: bash ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img -Copy SPI boot images into SD card and boot from SD:: +Copy SPI boot images into SD card and boot from SD: + +.. code-block:: bash sf probe load mmc 1:1 $kernel_addr_r idbloader.img @@ -195,35 +228,42 @@ Copy SPI boot images into SD card and boot from SD:: 2. Package the image with Rockchip miniloader --------------------------------------------- -Image package with Rockchip miniloader requires robin [1]. +Image package with Rockchip miniloader requires rkbin [1]. + +.. code-block:: bash + + cd .. + git clone --depth 1 https://github.com/rockchip-linux/rkbin -Create idbloader.img +Create idbloader.img: -.. code-block:: none +.. code-block:: bash - cd u-boot - ./tools/mkimage -n px30 -T rksd -d rkbin/bin/rk33/px30_ddr_333MHz_v1.15.bin idbloader.img - cat rkbin/bin/rk33/px30_miniloader_v1.22.bin >> idbloader.img - sudo dd if=idbloader.img of=/dev/sda seek=64 + cd u-boot + ./tools/mkimage -n px30 -T rksd -d ../rkbin/bin/rk33/px30_ddr_333MHz_v1.16.bin idbloader.img + cat ../rkbin/bin/rk33/px30_miniloader_v1.31.bin >> idbloader.img + sudo dd if=idbloader.img of=/dev/sda seek=64 -Create trust.img +Create trust.img: -.. code-block:: none +.. code-block:: bash - cd rkbin - ./tools/trust_merger RKTRUST/PX30TRUST.ini - sudo dd if=trust.img of=/dev/sda seek=24576 + cd ../rkbin + ./tools/trust_merger RKTRUST/PX30TRUST.ini + sudo dd if=trust.img of=/dev/sda seek=24576 -Create uboot.img +Create uboot.img [2]: -.. code-block:: none +.. code-block:: bash - rbink/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x200000 - sudo dd if=uboot.img of=/dev/sda seek=16384 + cd ../u-boot + ../rkbin/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x200000 + sudo dd if=uboot.img of=/dev/sda seek=16384 Note: -1. 0x200000 is load address and it's an optional in some platforms. -2. rkbin binaries are kept on updating, so would recommend to use the latest versions. + +1. rkbin binaries are regularly updated, so it would be recommended to use the latest version. +2. 0x200000 is a load address and is an option for some platforms. TODO ---- @@ -233,7 +273,5 @@ TODO - Document SPI flash boot - Add missing SoC's with it boards list -[1] https://github.com/rockchip-linux/rkbin - .. Jagan Teki .. Wednesday 28 October 2020 06:47:26 PM IST -- 2.20.1