All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sparc/leon3: Initialize stack pointer
@ 2014-02-03  9:18 Sebastian Huber
  2014-02-05  9:02 ` Fabien Chouteau
  2014-02-06  8:40 ` Michael Tokarev
  0 siblings, 2 replies; 10+ messages in thread
From: Sebastian Huber @ 2014-02-03  9:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Sebastian Huber, Fabien Chouteau

A lot of real world LEON3 systems are shipped with the GRMON boot
loader.  This boot loader initializes the stack pointer with the end of
RAM address.  The application can use this to detect the RAM size of a
particular board variant.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 hw/sparc/leon3.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index c583c3d..c16e9e4 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -45,6 +45,7 @@
 typedef struct ResetData {
     SPARCCPU *cpu;
     uint32_t  entry;            /* save kernel entry in case of reset */
+    target_ulong sp;            /* initial stack pointer */
 } ResetData;
 
 static void main_cpu_reset(void *opaque)
@@ -58,6 +59,7 @@ static void main_cpu_reset(void *opaque)
     cpu->halted = 0;
     env->pc     = s->entry;
     env->npc    = s->entry + 4;
+    env->regbase[6] = s->sp;
 }
 
 void leon3_irq_ack(void *irq_manager, int intno)
@@ -133,6 +135,7 @@ static void leon3_generic_hw_init(QEMUMachineInitArgs *args)
     /* Reset data */
     reset_info        = g_malloc0(sizeof(ResetData));
     reset_info->cpu   = cpu;
+    reset_info->sp    = 0x40000000 + ram_size;
     qemu_register_reset(main_cpu_reset, reset_info);
 
     /* Allocate IRQ manager */
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-03  9:18 [Qemu-devel] [PATCH] sparc/leon3: Initialize stack pointer Sebastian Huber
@ 2014-02-05  9:02 ` Fabien Chouteau
  2014-02-05  9:26   ` [Qemu-devel] [Qemu-trivial] " Fabien Chouteau
  2014-02-06  8:40 ` Michael Tokarev
  1 sibling, 1 reply; 10+ messages in thread
From: Fabien Chouteau @ 2014-02-05  9:02 UTC (permalink / raw)
  To: Sebastian Huber, qemu-devel; +Cc: qemu-trivial

On 02/03/2014 10:18 AM, Sebastian Huber wrote:
> A lot of real world LEON3 systems are shipped with the GRMON boot
> loader.  This boot loader initializes the stack pointer with the end of
> RAM address.  The application can use this to detect the RAM size of a
> particular board variant.
>

Looks good, thank you Sebastian.

Reviewed-by: Fabien Chouteau <chouteau@adacore.com>

 
> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> ---
>  hw/sparc/leon3.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index c583c3d..c16e9e4 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -45,6 +45,7 @@
>  typedef struct ResetData {
>      SPARCCPU *cpu;
>      uint32_t  entry;            /* save kernel entry in case of reset */
> +    target_ulong sp;            /* initial stack pointer */
>  } ResetData;
>  
>  static void main_cpu_reset(void *opaque)
> @@ -58,6 +59,7 @@ static void main_cpu_reset(void *opaque)
>      cpu->halted = 0;
>      env->pc     = s->entry;
>      env->npc    = s->entry + 4;
> +    env->regbase[6] = s->sp;
>  }
>  
>  void leon3_irq_ack(void *irq_manager, int intno)
> @@ -133,6 +135,7 @@ static void leon3_generic_hw_init(QEMUMachineInitArgs *args)
>      /* Reset data */
>      reset_info        = g_malloc0(sizeof(ResetData));
>      reset_info->cpu   = cpu;
> +    reset_info->sp    = 0x40000000 + ram_size;
>      qemu_register_reset(main_cpu_reset, reset_info);
>  
>      /* Allocate IRQ manager */
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-05  9:02 ` Fabien Chouteau
@ 2014-02-05  9:26   ` Fabien Chouteau
  0 siblings, 0 replies; 10+ messages in thread
From: Fabien Chouteau @ 2014-02-05  9:26 UTC (permalink / raw)
  To: Sebastian Huber, qemu-devel, Blue Swirl; +Cc: qemu-trivial

On 02/05/2014 10:02 AM, Fabien Chouteau wrote:
> On 02/03/2014 10:18 AM, Sebastian Huber wrote:
>> A lot of real world LEON3 systems are shipped with the GRMON boot
>> loader.  This boot loader initializes the stack pointer with the end of
>> RAM address.  The application can use this to detect the RAM size of a
>> particular board variant.
>>
> 
> Looks good, thank you Sebastian.
> 
> Reviewed-by: Fabien Chouteau <chouteau@adacore.com>
> 

Sorry Blue you should be in copy. Can you apply this patch please?

Thanks,

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-03  9:18 [Qemu-devel] [PATCH] sparc/leon3: Initialize stack pointer Sebastian Huber
  2014-02-05  9:02 ` Fabien Chouteau
@ 2014-02-06  8:40 ` Michael Tokarev
  2014-02-06  8:52   ` Sebastian Huber
  2014-02-06  8:57   ` Peter Maydell
  1 sibling, 2 replies; 10+ messages in thread
From: Michael Tokarev @ 2014-02-06  8:40 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: qemu-trivial, qemu-devel, Fabien Chouteau

03.02.2014 13:18, Sebastian Huber wrote:
> A lot of real world LEON3 systems are shipped with the GRMON boot
> loader.  This boot loader initializes the stack pointer with the end of
> RAM address.  The application can use this to detect the RAM size of a
> particular board variant.

I don't really know much about sparc or leon3 stuff.  But having a
reviewed-by from Fabien I can apply it to trivial-patches.  I'm not
really sure why it can't go to sparc tree instead.

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-06  8:40 ` Michael Tokarev
@ 2014-02-06  8:52   ` Sebastian Huber
  2014-02-06  8:57   ` Peter Maydell
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Huber @ 2014-02-06  8:52 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-trivial, qemu-devel, Fabien Chouteau

On 2014-02-06 09:40, Michael Tokarev wrote:
> 03.02.2014 13:18, Sebastian Huber wrote:
>> A lot of real world LEON3 systems are shipped with the GRMON boot
>> loader.  This boot loader initializes the stack pointer with the end of
>> RAM address.  The application can use this to detect the RAM size of a
>> particular board variant.
>
> I don't really know much about sparc or leon3 stuff.  But having a
> reviewed-by from Fabien I can apply it to trivial-patches.  I'm not
> really sure why it can't go to sparc tree instead.

I sent this patch to the trivial patches list, since the last tiny patch for 
the LEON3 was ignored by the SPARC maintainer for several weeks.  Even after 
review by Fabien Chouteau and Richard Henderson.

http://lists.gnu.org/archive/html/qemu-devel/2013-11/msg03488.html
http://lists.gnu.org/archive/html/qemu-devel/2014-01/msg01783.html

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-06  8:40 ` Michael Tokarev
  2014-02-06  8:52   ` Sebastian Huber
@ 2014-02-06  8:57   ` Peter Maydell
  2014-02-12 13:54     ` Sebastian Huber
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-02-06  8:57 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: QEMU Trivial, Sebastian Huber, Mark Cave-Ayland, QEMU Developers,
	Fabien Chouteau, Blue Swirl

On 6 February 2014 08:40, Michael Tokarev <mjt@tls.msk.ru> wrote:
> 03.02.2014 13:18, Sebastian Huber wrote:
>> A lot of real world LEON3 systems are shipped with the GRMON boot
>> loader.  This boot loader initializes the stack pointer with the end of
>> RAM address.  The application can use this to detect the RAM size of a
>> particular board variant.
>
> I don't really know much about sparc or leon3 stuff.  But having a
> reviewed-by from Fabien I can apply it to trivial-patches.  I'm not
> really sure why it can't go to sparc tree instead.

As far as I'm aware there is currently no sparc tree; Blue is the
listed maintainer and typically just applied patches directly.
In the absence of Blue, if somebody else who cares about sparc
wishes to collect up reviewed sparc patches and submit them as
a pull request so they don't just get ignored, I'm willing to apply
that pull.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-06  8:57   ` Peter Maydell
@ 2014-02-12 13:54     ` Sebastian Huber
  2014-02-12 14:00       ` Peter Maydell
  2014-02-12 16:40       ` Andreas Färber
  0 siblings, 2 replies; 10+ messages in thread
From: Sebastian Huber @ 2014-02-12 13:54 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Trivial, Michael Tokarev, Mark Cave-Ayland, QEMU Developers,
	Fabien Chouteau, Blue Swirl

On 2014-02-06 09:57, Peter Maydell wrote:
> On 6 February 2014 08:40, Michael Tokarev<mjt@tls.msk.ru>  wrote:
>> >03.02.2014 13:18, Sebastian Huber wrote:
>>> >>A lot of real world LEON3 systems are shipped with the GRMON boot
>>> >>loader.  This boot loader initializes the stack pointer with the end of
>>> >>RAM address.  The application can use this to detect the RAM size of a
>>> >>particular board variant.
>> >
>> >I don't really know much about sparc or leon3 stuff.  But having a
>> >reviewed-by from Fabien I can apply it to trivial-patches.  I'm not
>> >really sure why it can't go to sparc tree instead.
> As far as I'm aware there is currently no sparc tree; Blue is the
> listed maintainer and typically just applied patches directly.
> In the absence of Blue, if somebody else who cares about sparc
> wishes to collect up reviewed sparc patches and submit them as
> a pull request so they don't just get ignored, I'm willing to apply
> that pull.

Ok, how do we want proceed here?  I have an additional patch in the queue that 
adds AMBA plug and play support to the LEON3 support of QEMU so that you can 
run unmodified binaries for RTEMS, eCos and Linux.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-12 13:54     ` Sebastian Huber
@ 2014-02-12 14:00       ` Peter Maydell
  2014-02-12 16:27         ` Michael Tokarev
  2014-02-12 16:40       ` Andreas Färber
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-02-12 14:00 UTC (permalink / raw)
  To: Sebastian Huber
  Cc: QEMU Trivial, Michael Tokarev, Mark Cave-Ayland, QEMU Developers,
	Fabien Chouteau, Blue Swirl

On 12 February 2014 13:54, Sebastian Huber
<sebastian.huber@embedded-brains.de> wrote:
> On 2014-02-06 09:57, Peter Maydell wrote:
>> On 6 February 2014 08:40, Michael Tokarev<mjt@tls.msk.ru>  wrote:
>>> >I don't really know much about sparc or leon3 stuff.  But having a
>>> >reviewed-by from Fabien I can apply it to trivial-patches.  I'm not
>>> >really sure why it can't go to sparc tree instead.
>>
>> As far as I'm aware there is currently no sparc tree; Blue is the
>> listed maintainer and typically just applied patches directly.
>> In the absence of Blue, if somebody else who cares about sparc
>> wishes to collect up reviewed sparc patches and submit them as
>> a pull request so they don't just get ignored, I'm willing to apply
>> that pull.

> Ok, how do we want proceed here?  I have an additional patch in the queue
> that adds AMBA plug and play support to the LEON3 support of QEMU so that
> you can run unmodified binaries for RTEMS, eCos and Linux.

It's sparc-specific, it's pretty small, it's been reviewed.
MJT: I suggest we take the pragmatic approach and apply it
via -trivial.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-12 14:00       ` Peter Maydell
@ 2014-02-12 16:27         ` Michael Tokarev
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Tokarev @ 2014-02-12 16:27 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Trivial, Sebastian Huber, Mark Cave-Ayland, QEMU Developers,
	Blue Swirl

12.02.2014 18:00, Peter Maydell wrote:
[]
> It's sparc-specific, it's pretty small, it's been reviewed.
> MJT: I suggest we take the pragmatic approach and apply it
> via -trivial.

I actually applied it back at Feb-06.  Should be in the next pull request
at Friday.

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] sparc/leon3: Initialize stack pointer
  2014-02-12 13:54     ` Sebastian Huber
  2014-02-12 14:00       ` Peter Maydell
@ 2014-02-12 16:40       ` Andreas Färber
  1 sibling, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2014-02-12 16:40 UTC (permalink / raw)
  To: Sebastian Huber
  Cc: Peter Maydell, QEMU Trivial, Michael Tokarev, Mark Cave-Ayland,
	QEMU Developers, Fabien Chouteau, Blue Swirl

Am 12.02.2014 14:54, schrieb Sebastian Huber:
> On 2014-02-06 09:57, Peter Maydell wrote:
>> On 6 February 2014 08:40, Michael Tokarev<mjt@tls.msk.ru>  wrote:
>>> >03.02.2014 13:18, Sebastian Huber wrote:
>>>> >>A lot of real world LEON3 systems are shipped with the GRMON boot
>>>> >>loader.  This boot loader initializes the stack pointer with the
>>>> end of
>>>> >>RAM address.  The application can use this to detect the RAM size
>>>> of a
>>>> >>particular board variant.
>>> >
>>> >I don't really know much about sparc or leon3 stuff.  But having a
>>> >reviewed-by from Fabien I can apply it to trivial-patches.  I'm not
>>> >really sure why it can't go to sparc tree instead.
>> As far as I'm aware there is currently no sparc tree; Blue is the
>> listed maintainer and typically just applied patches directly.
>> In the absence of Blue, if somebody else who cares about sparc
>> wishes to collect up reviewed sparc patches and submit them as
>> a pull request so they don't just get ignored, I'm willing to apply
>> that pull.
> 
> Ok, how do we want proceed here?  I have an additional patch in the
> queue that adds AMBA plug and play support to the LEON3 support of QEMU
> so that you can run unmodified binaries for RTEMS, eCos and Linux.

Whether or not someone submits a pull for the reviewed patches, you'll
need to post your second patch for review. You can add either a tag in
[PATCH ...] or indicate textually after --- that it depends on this
patch, you don't need to wait for it to get applied first.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-02-12 16:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-03  9:18 [Qemu-devel] [PATCH] sparc/leon3: Initialize stack pointer Sebastian Huber
2014-02-05  9:02 ` Fabien Chouteau
2014-02-05  9:26   ` [Qemu-devel] [Qemu-trivial] " Fabien Chouteau
2014-02-06  8:40 ` Michael Tokarev
2014-02-06  8:52   ` Sebastian Huber
2014-02-06  8:57   ` Peter Maydell
2014-02-12 13:54     ` Sebastian Huber
2014-02-12 14:00       ` Peter Maydell
2014-02-12 16:27         ` Michael Tokarev
2014-02-12 16:40       ` Andreas Färber

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.