mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: Ahmad Fatoum <ahmad@a3f.at>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 2/2] RISC-V: sifive: enable SPI Flash and SD in config
Date: Mon, 22 Aug 2022 14:32:42 +0300	[thread overview]
Message-ID: <20220822143242.a7937c979f582c4989303380@gmail.com> (raw)
In-Reply-To: <20220426064604.422292-2-ahmad@a3f.at>

On Tue, 26 Apr 2022 08:46:04 +0200
Ahmad Fatoum <ahmad@a3f.at> wrote:

Hi Ahmad!

I'm trying to run SiFive target with emulate.pl, e.g.

barebox$ dd if=/dev/zero of=/tmp/1M count=1 bs=1M
barebox$ ./test/emulate.pl sifive_defconfig  -- -drive file=/tmp/1M,if=sd
...
qemu-system-riscv64: -drive file=/tmp/1M,if=sd: machine type does not support if=sd,bus=0,unit=0
Error running emulator: 256

I use QEMU emulator version 5.2.0 (Debian 1:5.2+dfsg-11+deb11u2), please see https://gitlab.com/frantony/barebox-gitlab-ci-runner .

If I skip the '-drive file=/tmp/1M,if=sd' qemu option then I see "Load access fault", e.g.

barebox$ ./test/emulate.pl sifive_defconfig
...
barebox 2022.08.0-00162-g7fce4ae853b0 #1 @1661158478


Board: SiFive HiFive Unleashed A00
Unhandled exception: 5 "Load access fault"
E [<0000000087e224fc>] ra: [<0000000087e224f0>] tval: 0000000010040014

sp:  0000000087fffd70 gp:  0000000000000000 tp:  0000000000000001
t0:  0000000083f16cf0 t1:  0000000000000002 t2:  ffffffffffffffff
s0:  0000000083f16c78 s1:  0000000087eaf590 a0:  0000000003f940aa
a1:  0000000083f0fee0 a2:  0000000000000001 a3:  0000000083f0f3d8
a4:  0000000000000002 a5:  0000000010040000 a6:  0000000000000001
a7:  0000000000ff0000 s2:  0000000083f0fee0 s3:  ffffffffffffffff
s4:  fffffffffffff000 s5:  0000000000000008 s6:  0000000080201ca0
s7:  0000000000000001 s8:  00000000000db4f8 s9:  0000000087fe0000
s10: 0000000000000000 s11: 0000000000000000 t3:  0000000000000048
t4:  0000000000000000 t5:  0000000000000000 t6:  fffffffffffffffd
### ERROR ### Please RESET the board ###

If I revert the 'RISC-V: sifive: enable SPI Flash and SD in config' commit then './test/emulate.pl sifive_defconfig' runs successfully.

> To test SD-Card:
> 
>   ./test/emulate.pl sifive_defconfig  -- -drive file=image.sdcard,if=sd
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
> v1 -> v2:
>   - No change
> ---
>  arch/riscv/configs/sifive_defconfig | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/riscv/configs/sifive_defconfig b/arch/riscv/configs/sifive_defconfig
> index 59cfebf194df..6ebe6eaf3785 100644
> --- a/arch/riscv/configs/sifive_defconfig
> +++ b/arch/riscv/configs/sifive_defconfig
> @@ -13,13 +13,10 @@ CONFIG_HUSH_FANCY_PROMPT=y
>  CONFIG_CMDLINE_EDITING=y
>  CONFIG_AUTO_COMPLETE=y
>  CONFIG_MENU=y
> -CONFIG_IMD_TARGET=y
>  CONFIG_CONSOLE_ALLOW_COLOR=y
>  CONFIG_PBL_CONSOLE=y
>  CONFIG_PARTITION_DISK_EFI=y
>  CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
> -CONFIG_BAREBOXENV_TARGET=y
> -CONFIG_BAREBOXCRC32_TARGET=y
>  CONFIG_STATE=y
>  CONFIG_STATE_CRYPTO=y
>  CONFIG_BOOTCHOOSER=y
> @@ -85,20 +82,21 @@ CONFIG_VIRTIO_CONSOLE=y
>  CONFIG_SERIAL_SIFIVE=y
>  CONFIG_DRIVER_NET_MACB=y
>  CONFIG_DRIVER_SPI_GPIO=y
> +CONFIG_SPI_SIFIVE=y
>  CONFIG_I2C=y
>  CONFIG_I2C_GPIO=y
>  CONFIG_MTD=y
> -# CONFIG_MTD_OOB_DEVICE is not set
> +CONFIG_MTD_RAW_DEVICE=y
>  CONFIG_MTD_CONCAT=y
>  CONFIG_MTD_M25P80=y
>  CONFIG_DRIVER_CFI=y
>  CONFIG_DRIVER_CFI_BANK_WIDTH_8=y
> -CONFIG_DISK=y
> -CONFIG_DISK_WRITE=y
>  CONFIG_VIRTIO_BLK=y
>  CONFIG_VIDEO=y
>  CONFIG_FRAMEBUFFER_CONSOLE=y
>  CONFIG_DRIVER_VIDEO_SIMPLEFB_CLIENT=y
> +CONFIG_MCI=y
> +CONFIG_MCI_SPI=y
>  CONFIG_CLOCKSOURCE_DUMMY_RATE=60000
>  CONFIG_EEPROM_AT24=y
>  CONFIG_HWRNG=y
> @@ -126,3 +124,6 @@ CONFIG_ZSTD_DECOMPRESS=y
>  CONFIG_XZ_DECOMPRESS=y
>  CONFIG_BASE64=y
>  CONFIG_DIGEST_CRC32_GENERIC=y
> +CONFIG_IMD_TARGET=y
> +CONFIG_BAREBOXENV_TARGET=y
> +CONFIG_BAREBOXCRC32_TARGET=y
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
Best regards,
  Antony Pavlov



  reply	other threads:[~2022-08-22 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  6:46 [PATCH v2 1/2] spi: Port SiFive SPI controller driver Ahmad Fatoum
2022-04-26  6:46 ` [PATCH v2 2/2] RISC-V: sifive: enable SPI Flash and SD in config Ahmad Fatoum
2022-08-22 11:32   ` Antony Pavlov [this message]
2022-08-23  5:18     ` Ahmad Fatoum
2022-08-23 14:35       ` Antony Pavlov
2022-08-30 11:05       ` Antony Pavlov
2022-04-29  7:08 ` [PATCH v2 1/2] spi: Port SiFive SPI controller driver Sascha Hauer

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=20220822143242.a7937c979f582c4989303380@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH v2 2/2] RISC-V: sifive: enable SPI Flash and SD in config' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox