2
0
Fork 0
mirror of https://github.com/AsahiLinux/u-boot synced 2024-12-28 22:13:08 +00:00
u-boot/board/synopsys/hsdk
Simon Glass 1e94b46f73 common: Drop linux/printk.h from common header
This old patch was marked as deferred. Bring it back to life, to continue
towards the removal of common.h

Move this out of the common header and include it only where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-24 09:54:57 -04:00
..
clk-lib.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
clk-lib.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
config.mk ARC: HSDK-4xD: fix headerize script for HSDK-4xD compatibility 2020-04-27 11:20:26 +03:00
env-lib.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
env-lib.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
headerize-hsdk.py Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
hsdk.c global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
Kconfig ARC: HSDK-4xD: use separate config file 2020-04-27 11:20:27 +03:00
MAINTAINERS ARC: HSDK-4xD: use separate config file 2020-04-27 11:20:27 +03:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
README hsdk: readme: Suggest getting pyelftools with pip 2019-03-28 10:50:32 +03:00

================================================================================
Useful notes on bulding and using of U-Boot on ARC HS Development Kit (AKA HSDK)
================================================================================

   BOARD OVERVIEW

   The DesignWare ARC HS Development Kit is a ready-to-use platform for rapid
   software development on the ARC HS3x family of processors.

   For more information please visit:
   https://www.synopsys.com/dw/ipdir.php?ds=arc-hs-development-kit

   User guide is availalble here:
   https://github.com/foss-for-synopsys-dwc-arc-processors/ARC-Development-Systems-Forum/wiki/docs/ARC_HSDK_User_Guide.pdf

   It has the following features useful for U-Boot:
    * On-board 2-channel FTDI TTL-to-USB converter
      - The first channel is used for serial debug port (which makes it possible
        to use a serial connection on pretty much any host machine be it
        Windows, Linux or Mac).
        On Linux machine typucally FTDI serial port would be /dev/ttyUSB0.
        There's no HW flow-control and baud-rate is 115200.

      - The second channel is used for built-in Digilent USB JTAG probe.
        That means no extra hardware is required to access ARC core from a
        debugger on development host. Both proprietary MetaWare debugger and
        open source OpenOCD + GDB client are supported.

      - Also with help of this FTDI chip it is possible to reset entire
        board with help of a special `rff-ftdi-reset` utility, see:
        https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset

    * Micro SD-card slot
      - U-Boot expects to see the very first partition on the card formatted as
        FAT file-system and uses it for keeping its environment in `uboot.env`
        file. Note uboot.env is not just a text file but it is auto-generated
        file created by U-Boot on invocation of `saveenv` command.
        It contains a checksum which makes this saved environment invalid in
        case of maual modification.

      - There might be more useful files on that first FAT partition like
        Linux kernl image in form of uImage (with or without built-in
        initramfs), device tree blob (.dtb) etc.

      - Except FAT partition there might be others following the first FAT one
        like Ext file-system with rootfs etc.

    * 1 Gb Ethernet socket
      - U-Boot might get payload from TFTP server. This might be uImage, rootfs
        image and anything else.

    * 2 MiB of SPI-flash
      - SPI-flahs is used as a storage for image of an application auto-executed
        by bootROM on power-on. Typically U-Boot gets programmed there but
        there might be other uses. But note bootROM expects to find a special
        header preceeding application image itself so before flashing anything
        make sure required image is prepended. In case of U-Boot this is done
        by invocation of `headerize-hsdk.py` with `make bsp-generate` command.


   BUILDING U-BOOT

   1. Configure U-Boot:
      ------------------------->8----------------------
      make hsdk_defconfig
      ------------------------->8----------------------

   2. To build Elf file (for example to be used with host debugger via JTAG
      connection to the target board):
      ------------------------->8----------------------
      make mdbtrick
      ------------------------->8----------------------

      This will produce `u-boot` Elf file.

   3. To build artifacts required for U-Boot update in n-board SPI-flash:
      ------------------------->8----------------------
      make bsp-generate
      ------------------------->8----------------------

      This will produce `u-boot.head` and `u-boot-update.scr` which should
      be put on the first FAT partition of micro SD-card to be inserted in the
      HSDK board.

      Note that Python3 script is used for generation of a header, thus
      to get that done it's required to have Python3 with "pyelftools" installed.

      "pyelftools" could be installed with help of "pip" even w/o root rights:
      ------------------------->8----------------------
      python3 -m pip install --user pyelftools
      ------------------------->8----------------------

   EXECUTING U-BOOT

   1. The HSDK board is supposed to auto-start U-Boot image stored in on-board
      SPI-flash on power-on. For that make sure DIP-switches in the corner of
      the board are in their default positions: BIM in 1:off, 2:on state
      while both BMC and BCS should be in 1:on, 2:on state.

   2. Though it is possible to load U-Boot as a simple Elf file via JTAG right
      in DDR and start it from the debugger.

      2.1. In case of proprietary MetaWare debugger run:
      ------------------------->8----------------------
      mdb -digilent -run -cl u-boot
      ------------------------->8----------------------


   UPDATION U-BOOT IMAGE IN ON-BOARD SPI-FLASH

   1. Create `u-boot.head` and `u-boot-update.scr` as discribed above with
      `make bsp-generate` command.

   2. Copy `u-boot.head` and `u-boot-update.scr` to the first FAT partition
      of micro SD-card.

   3. Connect USB cable from the HSDK board to the developemnt host and
      fire-up serial terminal.

   3. Insert prepared micro SD-card in the HSDK board, press reset button
      and stop auto-execution of existing `bootcmd` pressing any key in serial
      terminal and enter the following command:
      ------------------------->8----------------------
      mmc rescan && fatload mmc 0:1 ${loadaddr} u-boot-update.scr && source ${loadaddr}
      ------------------------->8----------------------
      Wait before you see "u-boot update: OK" message.

   4. Press RESET button and enjoy updated U-Boot version.