From patchwork Fri Feb 22 19:05:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1047065 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 445gmJ42Lkz9sBL for ; Sat, 23 Feb 2019 06:06:08 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id CC93CC21F4A; Fri, 22 Feb 2019 19:06:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AACABC21E77; Fri, 22 Feb 2019 19:06:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E78D3C21E77; Fri, 22 Feb 2019 19:06:00 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 1AF94C21E76 for ; Fri, 22 Feb 2019 19:05:59 +0000 (UTC) Received: from hades.home (unknown [IPv6:2a00:23c5:58d:db00:68bb:47d:d5ca:9abd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 73EFE27D664; Fri, 22 Feb 2019 19:05:58 +0000 (GMT) From: Martyn Welch To: Tom Rini Date: Fri, 22 Feb 2019 19:05:48 +0000 Message-Id: <20190222190548.4934-1-martyn.welch@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Martyn Welch , u-boot@lists.denx.de, Troy Kisky Subject: [U-Boot] [PATCH] imx: mx6qsabrelite: Update the SabreLite README X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The information in the SabreLite README is inaccurate and sparse. The upstream U-Boot can boot the SabreLite from SPI-NOR. Additionally, the freely available imx_loader tool can be easily used to boot a board with a corrupted SPI, the official Freescale/NXP manufacturing tools are not required. Reformat the document, adding a description of how to boot from SPI-NOR and adding a brief description of how to recover the board should the SPI-NOR be corrupted using imx_loader. Signed-off-by: Martyn Welch Acked-by: Troy Kisky --- .../boundary/nitrogen6x/README.mx6qsabrelite | 119 ++++++++++++------ 1 file changed, 83 insertions(+), 36 deletions(-) diff --git a/board/boundary/nitrogen6x/README.mx6qsabrelite b/board/boundary/nitrogen6x/README.mx6qsabrelite index 12a9c856cf..6283c9575e 100644 --- a/board/boundary/nitrogen6x/README.mx6qsabrelite +++ b/board/boundary/nitrogen6x/README.mx6qsabrelite @@ -1,72 +1,119 @@ U-Boot for the Freescale i.MX6q SabreLite board +=============================================== This file contains information for the port of U-Boot to the Freescale i.MX6q SabreLite board. -1. Boot source, boot from SD card ---------------------------------- -The recent mainline U-Boot for the Freescale i.MX6q SabreLite board supports -boot from SD card only. However, by default, the SabreLite -boards boot from the SPI NOR flash. These boards need to be reflashed with -a small SD card loader to support boot from SD card. This small SD card loader -will be flashed into the SPI NOR. The board will still boot from SPI NOR, but -the loader will in turn request the BootROM to load the U-Boot from SD card. +1. Build +-------- + +To build U-Boot for the SabreLite board: + + make mx6qsabrelite_config + make + + +2. Boot from SD card +-------------------- + +The SabreLite boards boot from the SPI NOR flash. These boards need their SPI +to be reflashed with a small SD card loader to support boot from SD card. The +board will still boot from SPI NOR, but the loader will in turn request the +BootROM to load the U-Boot from SD card. The SD card loader is available from https://wiki.linaro.org/Boards/MX6QSabreLite -under a open-source 3-clause BSD license. +This is provided under a open-source 3-clause BSD license. -To update the SPI-NOR on the SabreLite board without the Freescale -manufacturing tool use the following procedure: +To following procedure can be used to update the SPI-NOR on the SabreLite +board: 1. Write this SD card loader onto a large SD card using: - sudo dd if=iMX6DQ_SPI_to_uSDHC3.bin of=/dev/sXx + sudo dd if=iMX6DQ_SPI_to_uSDHC3.bin of=/dev/sXx -Note: Replace sXx with the device representing the SD card in your system. + Note: Replace sXx with the device representing the SD card in your system. -Note: This writes SD card loader at address 0 + Note: This writes SD card loader at address 0 2. Put this SD card into the slot for the large SD card (SD3 on the bottom of -the board). Make sure SW1 switch is at position "00", so that it can boot -from the fuses. + the board). Make sure SW1 switch is at position "00", so that it can boot + from the fuses. 3. Power-up the SabreLite, press 'space' to enter command mode in the U-Boot -(the default one the board is shipped with, starting from the SPI NOR) and -enter the following commands: + (the default one the board is shipped with, starting from the SPI NOR) and + enter the following commands: + + MX6Q SABRELITE U-Boot > mmc dev 0 + MX6Q SABRELITE U-Boot > mmc read 0x10800000 0 200 + MX6Q SABRELITE U-Boot > sf probe + MX6Q SABRELITE U-Boot > sf erase 0 0x40000 + MX6Q SABRELITE U-Boot > sf write 0x10800000 0 0x40000 - MX6Q SABRELITE U-Boot > mmc dev 0 - MX6Q SABRELITE U-Boot > mmc read 0x10800000 0 200 - MX6Q SABRELITE U-Boot > sf probe - MX6Q SABRELITE U-Boot > sf erase 0 0x40000 - MX6Q SABRELITE U-Boot > sf write 0x10800000 0 0x40000 +4. Write the u-boot.imx produced during the U-Boot build to the SD card: -4. done. + sudo dd if=u-boot.imx of=/dev/sXx bs=512 seek=2 && sudo sync -In case you somehow do not succeed with this procedure you will have to use -the Freescale manufacturing tool in order to reflash the SPI-NOR. + Note: Replace sXx with the device representing the SD card in your system. + +5. Re-insert the SD card back in the slot for the large SD card and power-cycle + the board. Note: The board now boots from full size SD3 on the bottom of the board. NOT the micro SD4/BOOT slot on the top of the board. I.e. you have to use full size SD cards. -This information is taken from +This information originally taken from: -https://wiki.linaro.org/Boards/MX6QSabreLite + https://wiki.linaro.org/Boards/MX6QSabreLite -2. Build --------- -To build U-Boot for the SabreLite board: +3. Boot from SPI NOR +-------------------- - make mx6qsabrelite_config - make +The SabreLite board can also boot U-Boot directly from the SPI NOR flash: + +1. Power-up the SabreLite, press 'space' to enter command mode in the U-Boot + and enter the following commands: + + => mmc dev 0 + => mmc read 0x10800000 0x400 0x80000 + => sf probe 0 + => sf erase 0 0xc0000 + => sf write 0x10800000 0x400 0x80000 + +Note: This procedure assumes you have booted using the desired U-Boot from an + SD card as prepared in the previous section. Alternative mechanisms, such + as using tftpboot to copy an alternative U-Boot image into memory can + also be used. + + +4. Recovering SPI-NOR +--------------------- + +In case you somehow do not succeed with this procedure you can upload U-Boot +via USB: + +1. Download and install the imx_loader following the instructions provided: + + https://github.com/boundarydevices/imx_usb_loader + +2. Connect the board to USB via the USB OTG port. + +3. Make sure SW1 switch is at position "01", so that it can boot from USB OTG. + +4. Power-up the SabreLite and run the imx_loader to upload the U-Boot image: + + sudo imx_usb u-boot.imx + +Note: This will upload and run the U-Boot image in memory, the SPI will not be + reprogrammed and this procedure will need to be repeated if the board is + reset. -To copy the resulting u-boot.imx to the SD card: +5. Use one of previous descriptions to re-flash the SPI-NOR as required. - sudo dd if=u-boot.imx of=/dev/sXx bs=512 seek=2&&sudo sync +6. Ensure SW1 is returned to "00" to boot from the fuses once done. -Note: Replace sXx with the device representing the SD card in your system.