Re: LEON3 networking

2019-10-24 Thread Jiri Gaisler


On 10/24/19 12:31 AM, Philippe Mathieu-Daudé wrote:
> 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 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


Yes.

>
> -- >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.

Correct, it only fixes 8-bit accesses so that RTEMS can boot.


>
> 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,
> +    },
>  };
>

I don't know enough about qemu internals to have an opinion on this, but it 
certainly looks much more elegant than my simple fix .. :-)

Jiri.

> ---
>
> (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  
 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,
>
>




Re: LEON3 networking

2019-10-23 Thread Philippe Mathieu-Daudé

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 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  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,






Re: LEON3 networking

2019-10-23 Thread Jiri Gaisler
BTW, here is a patch that you might want to apply to qemu if you intend
to run RTEMS on leon3. The plug area must support byte accesses,
which is used by the RTEMS grlib scanning functions...

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  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,
>>>
diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index 7338461694..eaaedbfbcc 100644
--- 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];
 }
 


Re: LEON3 networking

2019-10-23 Thread Jiri Gaisler
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  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,
>>



Re: LEON3 networking

2019-10-23 Thread Joshua Shaffer
Does anyone know what needs implemented to get networking supported?

Joshua

On Wed, Oct 16, 2019 at 6:34 AM Fabien Chouteau  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,
>

-- 
Notice: This message is intended solely for use of the individual or entity 
to which it is addressed and may contain information that is proprietary, 
privileged, company confidential and/or exempt from disclosure under 
applicable law. If the reader is not the intended recipient or agent 
responsible for delivering the message to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. This communication may also contain 
data subject to the International Traffic in Arms Regulations or U.S. 
Export Administration Regulations and cannot be disseminated, distributed 
or copied to foreign nationals, residing in the U.S. or abroad, without the 
prior approval of the U.S. Department of State or appropriate export 
licensing authority. If you have received this communication in error, 
please notify the sender by reply e-mail or collect telephone call and 
delete or destroy all copies of this email message, any physical copies 
made of this e-mail message and/or any file attachment(s).



Re: LEON3 networking

2019-10-16 Thread Fabien Chouteau
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,




Re: LEON3 networking

2019-10-15 Thread Philippe Mathieu-Daudé

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


Note we have maintainers for the Leon3, I'm Cc'ing them:

$ ./scripts/get_maintainer.pl -f hw/sparc/leon3.c
Fabien Chouteau  (maintainer:Leon3)
KONRAD Frederic  (maintainer:Leon3)
Mark Cave-Ayland  (maintainer:SPARC TCG CPUs)
Artyom Tarasenko  (maintainer:SPARC TCG CPUs)
qemu-devel@nongnu.org (open list:All patches CC here)

Regards,

Phil.




Re: LEON3 networking

2019-10-15 Thread Joshua Shaffer
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


On Tue, Oct 15, 2019 at 9:17 AM 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
>
> Joshua Shaffer

-- 
Notice: This message is intended solely for use of the individual or entity 
to which it is addressed and may contain information that is proprietary, 
privileged, company confidential and/or exempt from disclosure under 
applicable law. If the reader is not the intended recipient or agent 
responsible for delivering the message to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. This communication may also contain 
data subject to the International Traffic in Arms Regulations or U.S. 
Export Administration Regulations and cannot be disseminated, distributed 
or copied to foreign nationals, residing in the U.S. or abroad, without the 
prior approval of the U.S. Department of State or appropriate export 
licensing authority. If you have received this communication in error, 
please notify the sender by reply e-mail or collect telephone call and 
delete or destroy all copies of this email message, any physical copies 
made of this e-mail message and/or any file attachment(s).