public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Michal Simek <michal.simek@amd.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Simon Glass <sjg@chromium.org>,
	Sumit Garg <sumit.garg@linaro.org>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 8/8] board: add support for Qualcomm SA8155P-ADP board
Date: Mon, 4 Mar 2024 14:38:59 +0100	[thread overview]
Message-ID: <ZeXO8wOAi7az0kgN@gerhold.net> (raw)
In-Reply-To: <20240229142043.1263690-9-volodymyr_babchuk@epam.com>

On Thu, Feb 29, 2024 at 02:21:09PM +0000, Volodymyr Babchuk wrote:
> SA8155P Automotive Development Platform is Qualcomm SA8155-based board
> for developers. The nice thing that it has unlocked loaders with test
> keys support, which means that U-Boot for this platform can be
> launched at earlier stages.
> 
> This patch adds basic board support with only serial port and
> networking operation. I am using U-Boot to ease up Xen porting onto
> this board, so I am mostly interesting in booting U-Boot in EL2. But
> more conventional setup with Android boot image is supported as well.
> 
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> 
> ---
> 
>  arch/arm/dts/sa8155p-adp-u-boot.dtsi     | 30 ++++++++
>  arch/arm/mach-snapdragon/Kconfig         | 14 ++++
>  arch/arm/mach-snapdragon/Makefile        |  2 +
>  arch/arm/mach-snapdragon/init_sa8155p.c  | 30 ++++++++
>  arch/arm/mach-snapdragon/sysmap-sm8150.c | 31 ++++++++
>  board/qualcomm/sa8155p-adp/Kconfig       | 12 +++
>  board/qualcomm/sa8155p-adp/MAINTAINERS   |  6 ++
>  configs/sa8155p_adp_defconfig            | 33 +++++++++
>  doc/board/qualcomm/index.rst             |  1 +
>  doc/board/qualcomm/sa8155p-adp.rst       | 94 ++++++++++++++++++++++++
>  include/configs/sa8155p_adp.h            | 25 +++++++
>  11 files changed, 278 insertions(+)
>  create mode 100644 arch/arm/dts/sa8155p-adp-u-boot.dtsi
>  create mode 100644 arch/arm/mach-snapdragon/init_sa8155p.c
>  create mode 100644 arch/arm/mach-snapdragon/sysmap-sm8150.c
>  create mode 100644 board/qualcomm/sa8155p-adp/Kconfig
>  create mode 100644 board/qualcomm/sa8155p-adp/MAINTAINERS
>  create mode 100644 configs/sa8155p_adp_defconfig
>  create mode 100644 doc/board/qualcomm/sa8155p-adp.rst
>  create mode 100644 include/configs/sa8155p_adp.h
> 
> [...]
> diff --git a/doc/board/qualcomm/sa8155p-adp.rst b/doc/board/qualcomm/sa8155p-adp.rst
> new file mode 100644
> index 0000000000..cff68cd55f
> --- /dev/null
> +++ b/doc/board/qualcomm/sa8155p-adp.rst
> @@ -0,0 +1,94 @@
> +.. SPDX-License-Identifier: BSD-3-Clause
> +.. sectionauthor:: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> +
> +SA8155P Automotive Development Platform
> +=======================================
> +
> +About
> +-----
> +This document describes the information about SA8155P Automotive
> +Development Platform aka SA8155P-ADP.
> +
> +Currently U-Boot can be booted either as Android boot image, or in EL2
> +mode, instead of hypervisor image. In the latter case it is possible
> +to use U-Boot to either boot Linux with KVM support or to boot Xen
> +Hypervisor on this board.
> +
> +Supported HW modules
> +^^^^^^^^^^^^^^^^^^^^
> +Port for this board is in early development state. Right now U-Boot
> +supports serial console and networking. No USB/fastboot or UFS support
> +yet. So it is not possible to save environment variables as
> +well. Nevertheless this is enough for development as user can download
> +all required images via TFTP.
> +
> +Installation
> +------------
> +Build
> +^^^^^
> +Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board::
> +
> +	$ export CROSS_COMPILE=<aarch64 toolchain prefix>
> +	$ make sa8155p_adp_defconfig
> +	$ make
> +
> +This will build ``u-boot.bin`` in the configured output directory.
> +
> +Boot in EL1 mode instead of Android boot image
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Create a dummy ramdisk image:::
> +
> +	$ echo "This is not a ramdisk" > ramdisk.img
> +
> +Compress u-boot binary:::
> +
> +	$ gzip -c u-boot.bin > u-boot.bin.gz
> +
> +Append DTB again (binary we use already have DTB embedded in, but
> +Android boot image format requires another DTB at the end of the
> +archive):::
> +
> +	$ cat u-boot.bin.gz u-boot.dtb > u-boot.bin.gz-dtb
> +
> +Now we've got everything to build android boot image:::
> +
> +	$ mkbootimg --kernel u-boot.bin.gz-dtb \
> +	--ramdisk ramdisk.img --pagesize 4096 \
> +	--base 0x80000000 -o boot.img
> +
> +Finally you can flash new boot image with fastboot:::
> +
> +	$ fastboot flash boot boot.img
> +
> +Or just boot U-Boot without flashing anything:::
> +
> +	$ fastboot boot boot.img
> +
> +Boot in EL2 mode instead of Qualcomm's hypervisor stub
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +This approach ensures that U-Boot is booted in EL2 and it is possible
> +to run virtualization software (like Xen or KVM) on the board. You
> +must understand that this approach breaks Qualcomm's boot chain. You
> +will not be able to call all subsequent loaders, so you will not be
> +able to use fastboot for example. Use this approach only if you want
> +to experiment with virtualization on SA8155P-ADP.
> +
> +We need to create ELF file from the u-boot binary. We can't use
> +existing U-Boot ELF, because it does not include appended DTB
> +file. Easiest way to do this is to use ``create_elf.py`` from the
> +following repository: `qtestsign(lorc)
> +<https://github.com/lorc/qtestsign/tree/create_elf>`_: ::
> +
> +	$ python ../qtestsign/create_elf.py u-boot.bin 0x85710000 u-boot.mbn
> +

Have you tried using CONFIG_REMAKE_ELF in U-Boot? That should
effectively do the same (build a new ELF based on u-boot.bin with the
appended device tree). The Qualcomm DragonBoard 410c port is using that
option to solve the same problem.

But I'm glad to see that the ELF abstractions in qtestsign worked well
for your purpose. :-)

Thanks,
Stephan

  reply	other threads:[~2024-03-04 13:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 14:21 [PATCH 0/8] Add support for Qualcomm SA8155-ADP board Volodymyr Babchuk
2024-02-29 14:21 ` [PATCH 1/8] clk: qcom: clear div mask before assigning new divider Volodymyr Babchuk
2024-03-01 16:04   ` Caleb Connolly
2024-02-29 14:21 ` [PATCH 3/8] net: dw_eth_qos: add support for Qualcomm SM8150 SoC Volodymyr Babchuk
2024-03-05  6:49   ` Sumit Garg
2024-02-29 14:21 ` [PATCH 2/8] dts: qcom: import device trees and bindings for SA8155P-ADP Volodymyr Babchuk
2024-02-29 20:45   ` Krzysztof Kozlowski
2024-02-29 14:21 ` [PATCH 4/8] clk: qcom: add support for power domains uclass Volodymyr Babchuk
2024-02-29 14:49   ` Dan Carpenter
2024-03-02  0:05   ` Konrad Dybcio
2024-02-29 14:21 ` [PATCH 6/8] pinctr: qcom: pass pin number to get_function_mux callback Volodymyr Babchuk
2024-03-01 16:28   ` Caleb Connolly
2024-02-29 14:21 ` [PATCH 5/8] clk: qcom: add driver for SM8150 SoC Volodymyr Babchuk
2024-03-01 17:16   ` Caleb Connolly
2024-03-01 18:45     ` Volodymyr Babchuk
2024-03-01 19:31       ` Caleb Connolly
2024-02-29 14:21 ` [PATCH 8/8] board: add support for Qualcomm SA8155P-ADP board Volodymyr Babchuk
2024-03-04 13:38   ` Stephan Gerhold [this message]
2024-03-04 15:55     ` Volodymyr Babchuk
2024-02-29 14:21 ` [PATCH 7/8] pinctrl: qcom: add driver for SM8150 SoC Volodymyr Babchuk
2024-03-01 16:25 ` [PATCH 0/8] Add support for Qualcomm SA8155-ADP board Caleb Connolly
2024-03-01 18:25   ` Volodymyr Babchuk
2024-03-01 18:49     ` Caleb Connolly
2024-03-04 13:34     ` Stephan Gerhold
2024-03-04 15:51       ` Volodymyr Babchuk
2024-03-04 16:50         ` Caleb Connolly
2024-03-04 17:43         ` Konrad Dybcio

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=ZeXO8wOAi7az0kgN@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=caleb.connolly@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox