qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Jiri Gaisler <jiri@gaisler.se>,
	Joshua Shaffer <joshua.shaffer@astrobotic.com>,
	Fabien Chouteau <chouteau@adacore.com>,
	KONRAD Frederic <frederic.konrad@adacore.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: LEON3 networking
Date: Thu, 24 Oct 2019 00:31:05 +0200	[thread overview]
Message-ID: <6d0ffeda-68c4-3c0e-39bb-e00d544e1b8e@redhat.com> (raw)
In-Reply-To: <2ea63643-5cb2-017e-8889-bb8c77fd75cf@gaisler.se>

Hi Jiri,

On 10/23/19 9:55 PM, Jiri Gaisler wrote:
> BTW, here is a patch that you might want to apply to qemu if you intend
> to run RTEMS on leon3. The plug&play area must support byte accesses,
> which is used by the RTEMS grlib scanning functions...

Do you mean this one?

http://gaisler.org/qemu/qemu-4.1.0-leon3.patch

-- >8 --
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -228,6 +228,9 @@ static uint64_t grlib_apb_pnp_read(void *opaque, 
hwaddr offset, unsigned size)
  {
      APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);

+    if (size != 4)
+        return apb_pnp->regs[offset >> 2] >> ((~offset & 3) * 8);
+
      return apb_pnp->regs[offset >> 2];
  }

---

But then this is incorrect for 16-bit accesses.

The proper patch might be:

-- >8 --
@@ -234,6 +234,13 @@ static uint64_t grlib_apb_pnp_read(void *opaque, 
hwaddr offset, unsigned size)
  static const MemoryRegionOps grlib_apb_pnp_ops = {
      .read       = grlib_apb_pnp_read,
      .endianness = DEVICE_BIG_ENDIAN,
+    .valid = {
+        .min_access_size = 1,
+    },
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
  };

---

(Unrelated note, this device model lacks the MemoryRegionOps::write 
handler).

> Jiri.
> 
> On 10/23/19 8:37 PM, Jiri Gaisler wrote:
>> Leon3 uses the GRETH ethernet IP core for networking. You would need to
>> write a qemu emulation model of it to get networking support. The GRETH
>> is fairly well described in the GRLIB IP manual, so it should not be
>> impossible. The core is also available in open-source (VHDL) if you need
>> to look up some finer details ... :-)
>>
>> Jiri.
>>
>> On 10/23/19 6:59 PM, Joshua Shaffer wrote:
>>> Does anyone know what needs implemented to get networking supported?
>>>
>>> Joshua
>>>
>>> On Wed, Oct 16, 2019 at 6:34 AM Fabien Chouteau <chouteau@adacore.com> wrote:
>>>> Hello people,
>>>>
>>>> On 15/10/2019 18:57, Philippe Mathieu-Daudé wrote:
>>>>> Hi Joshua,
>>>>>
>>>>> On 10/15/19 3:17 PM, Joshua Shaffer wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I've been using the LEON3 port of qemu, and am wondering if anyone has touched the networking setup for such since the thread here: https://lists.rtems.org/pipermail/users/2014-September/028224.html
>>>>> Thanks for sharing this!
>>>>>
>>>>> Good news, Jiri keeps rebasing his patch with the latest stable version.
>>>>> Bad news, he didn't not signed his work with a "Signed-off-by" tag so we can not take this as it into the mainstream repository, see https://wiki.qemu.org/Contribute/SubmitAPatch#Patch_emails_must_include_a_Signed-off-by:_line
>>>>>
>>>> The Gaisler patches have been rewrote by my colleague Frederic (in CC) and they are now in mainstream.
>>>> (see https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg03869.html)
>>>>
>>>> But none of them are implementing network support, and I never heard of someone working on network for leon3.
>>>>
>>>> Regards,
>>>>



  reply	other threads:[~2019-10-23 22:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 13:17 LEON3 networking Joshua Shaffer
2019-10-15 16:53 ` Joshua Shaffer
2019-10-15 16:57 ` Philippe Mathieu-Daudé
2019-10-16 10:34   ` Fabien Chouteau
2019-10-23 16:59     ` Joshua Shaffer
2019-10-23 18:37       ` Jiri Gaisler
2019-10-23 19:55         ` Jiri Gaisler
2019-10-23 22:31           ` Philippe Mathieu-Daudé [this message]
2019-10-24  7:31             ` Jiri Gaisler
  -- strict thread matches above, loose matches on Subject: below --
2019-10-15 16:54 Joshua Shaffer

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=6d0ffeda-68c4-3c0e-39bb-e00d544e1b8e@redhat.com \
    --to=philmd@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=chouteau@adacore.com \
    --cc=frederic.konrad@adacore.com \
    --cc=jiri@gaisler.se \
    --cc=joshua.shaffer@astrobotic.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).