public inbox for openrisc@lists.librecores.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Rob Landley <rob@landley.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Linux OpenRISC <linux-openrisc@vger.kernel.org>
Subject: Re: or1k -M virt -hda and net.
Date: Mon, 23 Dec 2024 13:05:51 +0000	[thread overview]
Message-ID: <Z2lgL31ZeSkO59MZ@antec> (raw)
In-Reply-To: <57c5207c-3aca-47cd-bfd3-3d7eb7be3c0f@landley.net>

On Sun, Dec 22, 2024 at 11:29:19AM -0600, Rob Landley wrote:
> On 11/24/24 00:50, Stafford Horne wrote:
> > > Speaking of which, is there a way to get or1k to exit the emulator? I told
> > > the kernel to reboot but it says "reboot failed, system halted" and hangs
> > > instead of exiting qemu. (My testroot runs qemu under "timeout -i 10" to
> > > kill it after 10 seconds of inactivity, I.E. nothing written to stdout, but
> > > it still counts as a failure on one of the criteria.)
> > 
> > With the or1k-sim board it is not possible.  Traditionally on or1k we use
> > special NOP instructions to reboot simulators i.e. 'l.nop 1'.  The QEMU team was
> > not happy to support this mechanism.
> > 
> >    https://lore.kernel.org/openrisc/fb69c137317a365dcb549dfef1ecd2fbff48e92c.1492384862.git.shorne@gmail.com/T/#mef76d30d294aed84548b1e0d3e23aae499deaeec
> > 
> > As an alertnative we can use the 'virt' board which supports shutdown and
> > restart via the generic syscon drivers.
> > 
> >      $ grep -C1 SYSCON arch/openrisc/configs/virt_defconfig
> >      CONFIG_POWER_RESET=y
> >      CONFIG_POWER_RESET_SYSCON=y
> >      CONFIG_POWER_RESET_SYSCON_POWEROFF=y
> >      CONFIG_SYSCON_REBOOT_MODE=y
> >      # CONFIG_HWMON is not set
> 
> I built the 6.12 ARCH=openrisc virt_defconfig and got it to boot my
> initramfs, but while it does shut down, it hasn't got network or block
> device support.
> 
> The kernel config looks like it should have virt block device support, but
> nether -hda README nor "-drive file=README,format=raw,id=hd0 -device
> virtio-blk-device,drive=hd0" seem to be wiring it up in qemu where the
> kernel can find it?

The default virt_defconfig should have the drivers we need.  The OpenRISC virt
platform supports PCI and virtio devices, so I select many of the related
drivers.

    $ grep -C1 -e PCI -e VIRT arch/openrisc/configs/virt_defconfig
    # CONFIG_WIRELESS is not set
    CONFIG_PCI=y
    CONFIG_PCIEPORTBUS=y
    CONFIG_PCI_HOST_GENERIC=y
    CONFIG_DEVTMPFS=y
    --
    CONFIG_BLK_DEV_NBD=y
    CONFIG_VIRTIO_BLK=y
    CONFIG_NETDEVICES=y
    CONFIG_VIRTIO_NET=y
    CONFIG_ETHOC=y

In my qemu startup I wire in the hard drive and network in my qemu start script:

 - https://github.com/stffrdhrn/or1k-utils/blob/master/scripts/qemu-or1k-linux

This uses:

  -device virtio-net-pci,netdev=user -netdev user,id=user,net=$IPRANGE.1/24,host=$IPRANGE.100
  -device virtio-blk-device,drive=d0 -drive file=${DISK},id=d0,if=none,format=qcow2

> Haven't tried to get fancy with the network yet. The buildroot config is
> still or1ksim...

Yeah, its nothing fancy for me either. The buildroot with systemV init scripts
get everything working for me.

-Stafford

       reply	other threads:[~2024-12-23 13:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <afac091f-08cb-0f6d-4c01-bfa4421e7a47@landley.net>
     [not found] ` <Zufcf4iAqosZ7VBf@antec>
     [not found]   ` <9b2761aa-8ee0-4399-b237-31e70e3ed165@landley.net>
     [not found]     ` <Z0Cyx3i3z7Zl7XPm@antec>
     [not found]       ` <31fa6255-8e0c-4d05-bad9-dd843c676244@landley.net>
     [not found]         ` <Z0GSETLeT5w8B2DX@antec>
     [not found]           ` <87a6b910-5af6-47ad-ad8d-b79f11a7cbf2@landley.net>
     [not found]             ` <Z0LMqEqcdjkAxnN-@antec>
     [not found]               ` <57c5207c-3aca-47cd-bfd3-3d7eb7be3c0f@landley.net>
2024-12-23 13:05                 ` Stafford Horne [this message]
     [not found]                   ` <8807078a-0673-4b27-8d58-4a2a3ce4987d@landley.net>
2025-01-07 11:56                     ` or1k -M virt -hda and net Rob Landley
2025-01-07 17:31                       ` Stafford Horne
2025-01-07 18:05                         ` Alex Bennée
2025-01-07 23:20                           ` Rob Landley
2025-01-08 13:01                             ` BALATON Zoltan
2025-01-08 22:57                               ` Rob Landley
2025-01-09  2:05                                 ` BALATON Zoltan
2025-01-08 14:59                             ` Alex Bennée
2025-01-08 22:34                               ` Rob Landley
2025-01-09  2:48                                 ` BALATON Zoltan
2025-01-07 22:44                         ` Rob Landley
2025-01-08  8:24                           ` Geert Uytterhoeven
2025-01-08 16:23                             ` Rob Landley
2025-01-08 16:26                               ` Geert Uytterhoeven
2025-01-08 22:40                                 ` Rob Landley
2025-01-09  8:49                                   ` Geert Uytterhoeven

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=Z2lgL31ZeSkO59MZ@antec \
    --to=shorne@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rob@landley.net \
    /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