board: samsung: Add support for E850-96 board

Add support for WinLink E850-96 board [1]. It's based on Exynos850 SoC
and follows 96boards specification, so it's compatible with 96boards
mezzanine boards [2]. This patch enables next features:

  * Serial console
  * USI
  * PMU (muxing AP UART path)
  * Pinctrl
  * Clocks
  * Timer (ARMv8 architected)
  * Reset control

It's quite a minimal enablement. Features like MMC, USB and Ethernet
will be enabled later.

The rationale for config values is as follows:

  * TEXT_BASE = 0xf8800000

    That's where BL2 loads the U-Boot payload, so TEXT_BASE must be
    exactly this value. Overall the memory map is designed in a way to
    keep the bootloader in the upper 128 MiB area of RAM, which is
    0xf8000000..0xffffffff. That includes bootloader's code, stack,
    data, heap, MMU tables, etc. All the memory below that 128 MiB chunk
    can be used for storing boot images (0x80000000..0xf8000000).

  * CUSTOM_SYS_INIT_SP_ADDR = 0xf8c00000

    Just 4 MiB above the TEXT_BASE address, to leave enough space for
    U-Boot code and stack itself (grows downwards).

  * SYS_LOAD_ADDR = 0x80000000

    The beginning of RAM. That's where Linux kernel image must be
    loaded.

  * SYS_MALLOC_LEN = 0x81f000

    8 MiB for malloc() + ENV_SIZE (128 KiB)

  * SYS_MALLOC_F_LEN = 0x4000

    Increase malloc() pool size available before relocation from 8 KiB
    (default) to 16 KiB. Otherwise "alloc space exhausted" message
    appears in U-Boot log during board_init_f() stage. There are next
    reasons for doing so:

      1. Having "bootph-all" flags in some dts nodes leads to binding
         those during pre-relocation stage, and binding (DM) uses
         dynamic memory allocation
      2. clk-exynos850 driver uses CCF clocks, which in turn use dynamic
         memory allocation

Device tree file was imported from Linux kernel. All nodes and boot
phase flags added in exynos850-e850-96-u-boot.dtsi are only needed to
enable serial console:

  * oscclk -> cmu_top -> cmu_peri: generate UART/USI clocks
  * pinctrl_alive and uart1_pins: needed to mux UART pins
  * pmu_system_controller: configures AP UART path to uart1_pins
  * usi_uart: configures USI block to operate as a UART protocol
  * serial_0: enables serial console (UART)

[1] https://www.96boards.org/product/e850-96b/
[2] https://www.96boards.org/products/mezzanine/

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
Sam Protsenko
2024-01-10 21:09:08 -06:00
committed by Minkyu Kang
parent e6e300d5ef
commit 3d80ec5265
13 changed files with 1786 additions and 1 deletions

View File

@@ -0,0 +1,87 @@
.. SPDX-License-Identifier: GPL-2.0+
.. sectionauthor:: Sam Protsenko <semen.protsenko@linaro.org>
WinLink E850-96 board
=====================
Overview
--------
WinLink's E850-96 board [1]_ is based on Samsung Exynos850 SoC and follows
96Boards Consumer Edition specification [2]_. That makes it possible to use
96Boards mezzanine boards [3]_ along with it. It's an open-hardware board and
the hardware design files [4]_ were published, along with the supported
software [5]_ and related documentation.
U-Boot can be used on E850-96 instead of the original Samsung LittleKernel based
bootloader [6]_. Because FWBL1 [7]_ doesn't verify bootloader's signature, there
is no need to sign a U-Boot binary. That means U-Boot binary can be flashed into
``bootloader`` partition (instead of LittleKernel bootloader) and it will just
work.
Because BL2 bootloader already sets up DRAM and runs the final bootloader
(U-Boot) from DRAM, there is no need in U-Boot SPL. It's enough to have only
U-Boot proper (``u-boot.bin``).
Boot Flow
---------
The boot path for Exynos850 is shown on the figure below.
.. image:: img/exynos850-boot-architecture.svg
:alt: Exynos850 SoC boot flow
Legend:
* ``BL0``: Boot ROM code
* ``BL1``: Software part of Boot ROM
* ``EPBL``: Exynos Primary Boot Loader
* ``BL2``: Initializes CMU and DRAM and runs the final bootloader
* ``Bootloader``: Final bootloader (e.g. U-Boot); also called BL33 in terms of
ARM boot flow
* ``EL3_MON``: EL3 monitor (trusted firmware, handles SMC calls); also called
BL31 in terms of ARM boot flow
* ``LDFW``: Loadable Firmware
Build Procedure
---------------
.. warning::
At the moment both eMMC and USB features are not enabled in U-Boot. Flashing
U-Boot binary **WILL** effectively brick your board. The ``dltool`` [8]_ can
be used then to perform USB boot and flash LittleKernel bootloader binary [7]_
to unbrick and revive the board. Flashing U-Boot binary might be helpful for
developers or anybody who want to check current state of U-Boot enablement on
E850-96 (which is mostly serial console and related blocks).
Build U-Boot binary from source code (using AArch64 baremetal GCC toolchain):
.. prompt:: bash $
export PATH=<toolchain path>/bin:$PATH
export CROSS_COMPILE=<toolchain prefix>
make e850-96_defconfig
make
Boot E850-96 board into fastboot mode as described in board software doc [9]_,
and flash U-Boot binary into ``bootloader`` eMMC partition:
.. prompt:: bash $
fastboot flash bootloader u-boot.bin
fastboot reboot
U-Boot will boot up to the shell.
References
----------
.. [1] https://www.96boards.org/product/e850-96b/
.. [2] https://www.96boards.org/products/ce/
.. [3] https://www.96boards.org/products/mezzanine/
.. [4] https://www.96boards.org/documentation/consumer/e850-96b/hardware-docs/
.. [5] https://gitlab.com/Linaro/96boards/e850-96/
.. [6] https://gitlab.com/Linaro/96boards/e850-96/lk
.. [7] https://gitlab.com/Linaro/96boards/e850-96/images
.. [8] https://gitlab.com/Linaro/96boards/e850-96/tools/dltool
.. [9] https://gitlab.com/Linaro/96boards/e850-96/doc

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -7,3 +7,4 @@ Samsung
:maxdepth: 2
axy17lte
e850-96