All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Liu <paul.liu@linaro.org>
To: Fabio Estevam <festevam@denx.de>
Cc: sbabic@denx.de, Kirill Kapranov <kirill.kapranov@compulab.co.il>,
	 Uri Mashiach <uri.mashiach@compulab.co.il>,
	Valentin Raevsky <valentin@compulab.co.il>,
	 U-Boot-Denx <u-boot@lists.denx.de>
Subject: Re: [PATCH 2/2] imx8mm-cl-iot-gate: Add documentation
Date: Fri, 13 Aug 2021 18:07:25 +0800	[thread overview]
Message-ID: <CALG-KHzYdcT5+Z42JwsRZsyv1b2H4Bw4B3AC-zuCBpswyc9X=Q@mail.gmail.com> (raw)
In-Reply-To: <20210813005901.16839-2-festevam@denx.de>

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 <festevam@denx.de> wrote:

> Add documentation for building and flashing mainline U-Boot
> in the IOT-GATE-iMX8 board.
>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>  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
>
>

  reply	other threads:[~2021-08-13 12:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  0:59 [PATCH 1/2] imx8mm-cl-iot-gate: Do not build fip.bin by default Fabio Estevam
2021-08-13  0:59 ` [PATCH 2/2] imx8mm-cl-iot-gate: Add documentation Fabio Estevam
2021-08-13 10:07   ` Paul Liu [this message]
2021-08-13  9:59 ` [PATCH 1/2] imx8mm-cl-iot-gate: Do not build fip.bin by default Paul Liu
2021-08-13 12:15   ` Fabio Estevam
2021-08-15 19:26     ` Paul Liu
2021-08-16 21:09       ` Fabio Estevam
2021-08-16 21:29         ` Tom Rini
2021-08-16 22:41         ` Fabio Estevam
2021-08-17  0:50           ` Paul Liu
2021-08-17 18:32             ` Fabio Estevam
2021-08-18  0:08               ` Paul Liu
2021-08-18 12:24                 ` Fabio Estevam
2021-08-18 21:32                   ` Paul Liu
2021-08-18 21:39                     ` Fabio Estevam
2021-08-19  0:27                       ` Fabio Estevam
2021-08-19  7:14                         ` Frieder Schrempf
2021-08-19 20:51                           ` Paul Liu
2021-08-20  2:06                             ` Paul Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALG-KHzYdcT5+Z42JwsRZsyv1b2H4Bw4B3AC-zuCBpswyc9X=Q@mail.gmail.com' \
    --to=paul.liu@linaro.org \
    --cc=festevam@denx.de \
    --cc=kirill.kapranov@compulab.co.il \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uri.mashiach@compulab.co.il \
    --cc=valentin@compulab.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.