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=-18.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 5B769C4338F for ; Fri, 13 Aug 2021 12:20:57 +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 D2EB9600CC for ; Fri, 13 Aug 2021 12:20:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2EB9600CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 5412482E7D; Fri, 13 Aug 2021 14:20:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="MX3ZTULt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B4F7582DBC; Fri, 13 Aug 2021 12:07:43 +0200 (CEST) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 60E5D82C2D for ; Fri, 13 Aug 2021 12:07:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=paul.liu@linaro.org Received: by mail-yb1-xb2d.google.com with SMTP id z18so17784028ybg.8 for ; Fri, 13 Aug 2021 03:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G7XBZB1ZIKegY4RIQyZ9qvAhyWEuXQAiMU4F7Hoz6RA=; b=MX3ZTULttDXJj0DFxlByTXq3ZtnU1PvqBlhvh8KvKYPfmdQ1eJzOLnxO4wU1FIJpgj g3NIbJZOirFIvEPDFLOpyrjxhaLpIXzrBpiwEMZxIdP+vjCTNcseOT3jwNXUWE+InJlu p4GW3sIqiYEUWKerjPId6CvxAC7dtcgDtVQtc1ON9cwFM1T+vIPXyAtM/3BVwb8+Uo1P SQvTaqFBEoTgjgAq6hAy0rLabFsXcG/gZi8xebw10X5Fm6Mybt2qKZBzczsgbxllcWDS lKFIH7nDYlDQ2VveICg99vd45+NUMyqp93gF9so6tBfwhQYfi6IxZY4+Fe69/Snt7jcQ JZbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G7XBZB1ZIKegY4RIQyZ9qvAhyWEuXQAiMU4F7Hoz6RA=; b=NdG0Vs/lJ5qasBxY08auAYxHn7CkYeofChROQQucuEV/vZqh9fqKW8rP6OGt4jHBOh 0weKaAMeGDlUsKKrGbJ/pvB3/S6+23LiY7WFpxx7bCdwy6E0+u8NEE2Q7lc3naYkyTA2 1rsT39AJkDP+dYKGWBEJA2opL8NyzqgVpafZ65mgug/Br/Hf4/+wfgVYGorwFi2c5uMM HE1p2romd1jJ2bWBX99F39S3rFXmrl6pGbPv4Dk5ReBSjXDapzMTREl9Ftq5NAWgKqCO Th5aQoWxPsQEBaRu5ZGlThDl8GXWLx0hVxty8xfl66nDrMSAY9pY4/e3FD3DRd8vSnZL Tk7w== X-Gm-Message-State: AOAM532tyxOTtv4EBoh1JVo4pioBlk5b8QoEzu1cFLAv7uMteHhUoD+4 MwfXSapY551iw5lF98HdxncrYOAd6xL/FFtkShOz/w== X-Google-Smtp-Source: ABdhPJxPV/TfE6oppUVajeFRtTN81K/z8caDm11aDUmlDqIv/PiCFYdpEkwQ5JyFx6LNDUPp9WXvqchfbg6ygn98ELw= X-Received: by 2002:a25:ba05:: with SMTP id t5mr1845510ybg.120.1628849256125; Fri, 13 Aug 2021 03:07:36 -0700 (PDT) MIME-Version: 1.0 References: <20210813005901.16839-1-festevam@denx.de> <20210813005901.16839-2-festevam@denx.de> In-Reply-To: <20210813005901.16839-2-festevam@denx.de> From: Paul Liu Date: Fri, 13 Aug 2021 18:07:25 +0800 Message-ID: Subject: Re: [PATCH 2/2] imx8mm-cl-iot-gate: Add documentation To: Fabio Estevam Cc: sbabic@denx.de, Kirill Kapranov , Uri Mashiach , Valentin Raevsky , U-Boot-Denx X-Mailman-Approved-At: Fri, 13 Aug 2021 14:19:30 +0200 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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 Hi Fabio, Did you use the boot partition? I mean, why don't we use "mmc partconf 0 0 1 0" So that we can flash u-boot to partition 1 and leave partition 0 for distro install. The following sequence should work. init setup 1. mmc dev 2 2. mmc partconf 0 0 1 0 flash u-boot 1. tftp ${loadaddr} flash.bin 2. setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 3. mmc dev 2 1 4. mmc write $loadaddr 0x42 $blkcnt 5. tftp ${loadaddr} u-boot.itb 6. setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 7. mmc dev 2 1 8. mmc write $loadaddr 0x300 $blkcnt Yours, Paul On Fri, 13 Aug 2021 at 08:59, Fabio Estevam wrote: > Add documentation for building and flashing mainline U-Boot > in the IOT-GATE-iMX8 board. > > Signed-off-by: Fabio Estevam > --- > doc/board/compulab/imx8mm-cl-iot-gate.rst | 84 +++++++++++++++++++++++ > doc/board/index.rst | 1 + > 2 files changed, 85 insertions(+) > create mode 100644 doc/board/compulab/imx8mm-cl-iot-gate.rst > > diff --git a/doc/board/compulab/imx8mm-cl-iot-gate.rst > b/doc/board/compulab/imx8mm-cl-iot-gate.rst > new file mode 100644 > index 000000000000..b63b8d61f13f > --- /dev/null > +++ b/doc/board/compulab/imx8mm-cl-iot-gate.rst > @@ -0,0 +1,83 @@ > +.. SPDX-License-Identifier: GPL-2.0+ > + > +IOT-GATE-iMX8 > +============= > + > +U-Boot for Compulab i.MX8MM IoT Gateway board. > + > +Quick Start > +----------- > + > +- Build the ARM Trusted firmware binary > +- Get the DDR firmwares > +- Build U-Boot > +- Flash U-Boot into the eMMC > + > +Get and build the ARM Trusted firmware > +-------------------------------------- > + > +Note: builddir is U-Boot build directory (source directory for in-tree > builds). > + > +Get mainline ATF: > + > +.. code-block:: bash > + > + $ git clone https://github.com/ARM-software/arm-trusted-firmware.git > + $ cd arm-trusted-firmware > + $ git checkout v2.5 > + > +Generate the bl31.bin ATF binary: > + > +.. code-block:: bash > + > + $ export CROSS_COMPILE=aarch64-poky-linux- > + $ make PLAT=imx8mm IMX_BOOT_UART_BASE=0x30880000 bl31 > + $ cp build/imx8mm/release/bl31.bin $(builddir) > + > +Get the DDR firmwares > +--------------------- > + > +.. code-block:: bash > + > + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.9.bin > + $ chmod +x firmware-imx-8.9.bin > + $ ./firmware-imx-8.9 > + $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir) > + > +Build U-Boot > +------------ > + > +.. code-block:: bash > + > + $ export CROSS_COMPILE=aarch64-poky-linux- > + $ make imx8mm-cl-iot-gate_defconfig > + $ export ATF_LOAD_ADDR=0x920000 > + $ make > + > +This will result in two binaries: flash.bin and u-boot.itb. > + > +Flash U-Boot into the eMMC > +-------------------------- > + > +Make sure to have access to the IOTG-ACC-M2SD adapter to recover > +the board in case something goes wrong. More details at: > + > https://mediawiki.compulab.com/w/index.php?title=IOT-GATE-iMX8_and_SBC-IOT-iMX8:_U-Boot:_Recovery > + > +The flash.bin and u-boot.itb binaries need to be flashed into the eMMC at > +offset 33K and 384K, respectively. > + > +These binaries can be transferred from the host PC to the board running > +U-Boot via TFTP: > + > +.. code-block:: bash > + > + => mmc dev 2 > + => mmc partconf 2 1 7 0 (This is only needed to be done for the first > time) > + > + => tftp $loadaddr flash.bin > + => setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 > + => mmc write $loadaddr 0x42 $blkcnt > + > + => tftp $loadaddr u-boot.itb > + => setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 > + => mmc write $loadaddr 0x300 $blkcnt > diff --git a/doc/board/index.rst b/doc/board/index.rst > index 9e9097889161..5c5420f3d75a 100644 > --- a/doc/board/index.rst > +++ b/doc/board/index.rst > @@ -11,6 +11,7 @@ Board-specific doc > AndesTech/index > amlogic/index > atmel/index > + compulab/index > congatec/index > coreboot/index > emulation/index > -- > 2.25.1 > >