All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rick Chen <rickchen36@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 00/11] SPL support for RISC-V
Date: Thu, 8 Aug 2019 17:49:06 +0800	[thread overview]
Message-ID: <CAN5B=eKuF30T=ZoPq6Z2R_2OMWvjXiwNBBZ3zdysery2MyYFow@mail.gmail.com> (raw)
In-Reply-To: <a2ec0ac91ddbc0bfa5979ff7e87773f89bafd2a6.camel@aisec.fraunhofer.de>

Hi Lukas and Anup

>
> Hi Rick,
>
> On Fri, 2019-08-02 at 14:18 +0530, Anup Patel wrote:
> > On Fri, Aug 2, 2019 at 2:11 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > Hi Lukas
> > >
> > > > Hi Rick,
> > > >
> > > > On Thu, 2019-08-01 at 11:32 +0800, Rick Chen wrote:
> > > > > Hi Lukas
> > > > >
> > > > > > > From: Lukas Auer [mailto:lukas.auer at aisec.fraunhofer.de]
> > > > > > > Sent: Sunday, July 28, 2019 11:57 PM
> > > > > > > To: u-boot at lists.denx.de
> > > > > > > Cc: Atish Patra; Rick Jian-Zhi Chen(陳建志); Bin Meng; Sagar Kadam; Alistair
> > > > > > > Francis; Anup Patel; Troy Benjegerdes; Lukas Auer; Abel Vesa; Alex Kiernan;
> > > > > > > Alex Marginean; Alexander Graf; Andreas Dannenberg; Andrew F. Davis; Anup
> > > > > > > Patel; Anup Patel; Atish Patra; Chris Packham; Eugeniu Rosca; Heiko Schocher;
> > > > > > > Heinrich Schuchardt; Jagan Teki; Jean-Jacques Hiblot; Jens Wiklander; Joe
> > > > > > > Hershberger; Kever Yang; Lokesh Vutla; Lukasz Majewski; Marek Vasut; Marek
> > > > > > > Vasut; Marek Vasut; Markus Klotzbuecher; Michal Simek; Paul Burton; Peng
> > > > > > > Fan; Philipp Tomsich; Philippe Reynes; Ryder Lee; Shawn Guo; Simon Glass;
> > > > > > > Simon Goldschmidt; Stefan Roese; Stefano Babic; Tien Fong Chee; Vignesh R;
> > > > > > > Weijie Gao; Ye Li
> > > > > > > Subject: [PATCH v2 00/11] SPL support for RISC-V
> > > > > > >
> > > > > > > This series adds support for SPL to RISC-V U-Boot. Images can be booted via
> > > > > > > OpenSBI (FW_DYNAMIC firmware) or by directly jumping to them. In the
> > > > > > > former case, OpenSBI and U-Boot proper are bundled as a FIT image and made
> > > > > > > available to U-Boot SPL. Currently, only the QEMU board enables U-Boot SPL
> > > > > > > with a dedicated configuration. It uses RAM as SPL boot device.
> > > > > > >
> > > > > > > On many RISC-V CPUs, the device tree is provided to U-Boot by the first stage
> > > > > > > bootloader. This requires changes to U-Boot SPL (patches 1,
> > > > > > > 2 and 3), which modify the behavior on other boards as well.
> > > > > > >
> > > > > > > To test this series, OpenSBI has to be compiled first. The fw_dynamic.bin
> > > > > > > binary must be copied into the U-Boot root directory.
> > > > > > > Alternatively, the location of the binary can be specified with the OPENSBI
> > > > > > > environment variable. U-Boot can then be build as normal using the
> > > > > > > configuration qemu-riscv64_spl_defconfig for 64-bit builds or
> > > > > > > qemu-riscv32_spl_defconfig for 32-bit builds. The outputs from the build
> > > > > > > process are the U-Boot SPL binary (spl/u-boot-spl.bin) and the U-Boot FIT
> > > > > > > image (u-boot.itb) containing U-Boot proper and OpenSBI.
> > > > > > >
> > > > > > > U-Boot can be run in QEMU with the following command.
> > > > > > >
> > > > > > > qemu-system-riscv64 -nographic -machine virt -kernel spl/u-boot-spl \
> > > > > > >       -device loader,file=u-boot.itb,addr=0x80200000
> > > > > > >
> > > > >
> > > > > Great job !
> > > > >
> > > >
> > > > Thank you!
> > > >
> > > > > I also try to run the spl flow on ax25-ae350 platform.
> > > > > But encounter some problems. I am still debugging.
> > > > >
> > > > > Following is the error message:
> > > > > :
> > > > > U-Boot SPL 2019.07-10574-ge6ef7ec-dirty (Aug 01 2019 - 10:09:45 +0800)
> > > > > Trying to boot from RAM
> > > > >
> > > > > U-Boot 2019.07-10574-ge6ef7ec-dirty (Aug 01 2019 - 10:09:45 +0800)
> > > > >
> > > > > DRAM:  exception code: 5 , Load access fault , epc 1212654 , ra 1200ffe
> > > > > ### ERROR ### Please RESET the board ###
> > > > >
> > > > > Do you have some comments ?
> > > > >
> > > >
> > > > It is difficult to judge without the exact configuration. Is your
> > > > current git tree available somewhere?
> > >
> > > No, it is not available yet.
> > > And you don't have the ax25-ae350 board, it is still in vain if the
> > > git tree is available.
> > >
> > > > The error is quite strange, because it already booted U-Boot proper. So
> > > > the error does not happen in code, which has been directly modified by
> > > > this series. Perhaps it is trying to initialize something twice (once
> > > > in SPL and again in U-Boot proper)? Can you check at what location the
> > > > error occurs?
> > >
> > > I found that the exception occurred in get_ram_size() of ax25-ae350.c
> > > when it try to load the memory address 0x10000.
> > > But the access of 0x20000 is ok.
> > >
> > > I try to mark the get_ram_size() and do not execute it, U-Boot proper
> > > can boot successfully as below:
> > >
> > > U-Boot SPL 2019.07-10574-ge6ef7ec-dirty (Aug 02 2019 - 16:07:54 +0800)
> > > Trying to boot from RAM
> > >
> > > U-Boot 2019.07-10574-ge6ef7ec-dirty (Aug 02 2019 - 16:07:54 +0800)
> > > DRAM:  1 GiB
> > > Flash: 64 MiB
> > > MMC:   mmc at f0e00000: 0
> > > Loading Environment from SPI Flash... SF: Detected mx25u1635e with
> > > page size 256 Bytes, erase size 4 KiB, total 2 MiB
> > > *** Warning - bad CRC, using default environment
> > > In:    serial at f0300000
> > > Out:   serial at f0300000
> > > Err:   serial at f0300000
> > > Net:   no alias for ethernet0
> > > Warning: mac at e0100000 (eth0) using random MAC address - 36:13:4d:06:b8:fd
> > > eth0: mac at e0100000
> > > Hit any key to stop autoboot:  0
> > > RISC-V #
> > >
> > > So I tried to trace openSBI and found the BANNER of openSBI was not printed.
> > > Is it correct ?
> >
> > Yes, U-Boot SPL is passing SBI_SCRATCH_NO_BOOT_PRINTS option to
> > OpenSBI due to which you don't see any prints. Although, error prints from
> > OpenSBI will be still available.
> >
>
> If you want to enable the OpenSBI banner, you can remove the option in
> common/spl/spl_opensbi.c.
>
> > > Any idea about why the access of memory address(0x10000) will fail ?
> > > I guess it seem relative to pmp configuration.
> >
> > If it is PMP access checks then you should get ACCESS faults error
> > prints from OpenSBI.
> >
>
> The access violation you are seeing is strange and I am not sure why
> OpenSBI does not print any errors. It does seem like a problem with the
> PMP configuration though.
>

I change pmpcfg0 from 0x1f18 to 0x1f1f and 0x10000 can be accessed.

==========
gdb message
==========
(gdb) p/x $pmpcfg0
$12 = {0x1f1f, pmp0cfg = {0x1f, a = 0x3}, pmp1cfg = {0x1f, a = 0x3},
  pmp2cfg = {0x0, a = 0x0}, pmp3cfg = {0x0, a = 0x0}, pmp4cfg = {0x0,
    a = 0x0}, pmp5cfg = {0x0, a = 0x0}, pmp6cfg = {0x0, a = 0x0}, pmp7cfg = {
    0x0, a = 0x0}}

U-Boot SPL 2019.07-10574-ge6ef7ec-dirty (Aug 02 2019 - 16:07:54 +0800)
Trying to boot from RAM

============
u-boot message
============

U-Boot 2019.07-10574-ge6ef7ec-dirty (Aug 02 2019 - 16:07:54 +0800)

DRAM:  1 GiB
Flash: 64 MiB
MMC:   mmc at f0e00000: 0
Loading Environment from SPI Flash... SF: Detected mx25u1635e with
page size 256 Bytes, erase size 4 KiB, total 2 MiB
*** Warning - bad CRC, using default environment

In:    serial at f0300000
Out:   serial at f0300000
Err:   serial at f0300000
Net:   no alias for ethernet0

Warning: mac at e0100000 (eth0) using random MAC address - ea:d7:a7:97:06:2c
eth0: mac at e0100000
Hit any key to stop autoboot:  0
RISC-V #
RISC-V # md.b 0x10000
00010000: ef 80 c2 00 aa 87 3e 85 6f c0 22 26 ef c2 02 22    ......>.o."&..."
00010010: 17 25 03 00 13 05 05 03 ef a0 2f 92 19 c5 41 46    .%......../...AF
00010020: 81 45 ef 80 e2 13 6f c0 e2 23 83 b7 01 00 17 25    .E....o..#.....%
00010030: 03 00 13 05 25 ff 80 67 84 6b ef a0 0f 90 a2 87    ....%..g.k......
RISC-V #

Thanks
Rick

> Thanks,
> Lukas

      reply	other threads:[~2019-08-08  9:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-28 15:57 [U-Boot] [PATCH v2 00/11] SPL support for RISC-V Lukas Auer
2019-07-28 15:57 ` [U-Boot] [PATCH v2 01/11] fdtdec: make CONFIG_OF_PRIOR_STAGE available in SPL Lukas Auer
2019-07-29  8:14   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 02/11] Makefile: support building SPL FIT images without device trees Lukas Auer
2019-07-29  8:17   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 03/11] spl: fit: use U-Boot device tree when FIT image has no device tree Lukas Auer
2019-07-29  8:20   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 04/11] riscv: add run mode configuration for SPL Lukas Auer
2019-07-29  8:24   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 05/11] spl: support booting via RISC-V OpenSBI Lukas Auer
2019-07-29  8:32   ` Anup Patel
2019-07-29 15:51     ` Auer, Lukas
2019-07-30  3:45       ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 06/11] riscv: add SPL support Lukas Auer
2019-07-29  8:34   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 07/11] riscv: support SPL stack and global data relocation Lukas Auer
2019-07-29  8:36   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 08/11] riscv: add a generic FIT generator script Lukas Auer
2019-07-29  8:39   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 09/11] riscv: set default FIT generator script and build target for SPL builds Lukas Auer
2019-07-29  8:40   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 10/11] riscv: qemu: add SPL configuration Lukas Auer
2019-07-29  8:41   ` Anup Patel
2019-07-28 15:57 ` [U-Boot] [PATCH v2 11/11] doc: update QEMU RISC-V documentation Lukas Auer
2019-07-29  8:42   ` Anup Patel
2019-07-29  8:44 ` [U-Boot] [PATCH v2 00/11] SPL support for RISC-V Anup Patel
2019-07-29 15:52   ` Auer, Lukas
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA40F3AC4@ATCPCS16.andestech.com>
2019-08-01  3:32   ` Rick Chen
2019-08-01 13:51     ` Auer, Lukas
2019-08-02  8:41       ` Rick Chen
2019-08-02  8:48         ` Anup Patel
2019-08-02 10:25           ` Auer, Lukas
2019-08-08  9:49             ` Rick Chen [this message]

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='CAN5B=eKuF30T=ZoPq6Z2R_2OMWvjXiwNBBZ3zdysery2MyYFow@mail.gmail.com' \
    --to=rickchen36@gmail.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 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.