* [PATCH 5/6] bootwrapper: Add support for the DINK firmware
@ 2006-07-19 23:14 Mark A. Greer
2006-07-19 23:33 ` Mark A. Greer
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Mark A. Greer @ 2006-07-19 23:14 UTC (permalink / raw)
To: linuxppc-dev
This patch adds the firmware operations that support the DINK firmware
from Freescale.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
--
dink.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+)
--
diff --git a/arch/powerpc/boot/dink.c b/arch/powerpc/boot/dink.c
new file mode 100644
index 0000000..aa446e2
--- /dev/null
+++ b/arch/powerpc/boot/dink.c
@@ -0,0 +1,56 @@
+/*
+ * Sandpoint specific fixups.
+ *
+ * Author: Mark A. Greer <mgreer@mvista.com>
+ *
+ * 2006 (c) MontaVista, Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <stdarg.h>
+#include <stddef.h>
+#include "types.h"
+#include "string.h"
+#include "stdio.h"
+#include "page.h"
+#include "ops.h"
+
+#define MB (1024*1024)
+
+extern char _end[];
+
+static u32 cur_base;
+static u32 end_of_ram = 32 * MB;
+
+static void *
+dink_malloc(u32 size)
+{
+ void *area = NULL;
+ static u8 first_time = 1;
+
+ if (first_time) {
+ cur_base = _ALIGN_UP((unsigned long)_end, MB);
+ first_time = 0;
+ }
+
+ if ((cur_base + size) < end_of_ram) {
+ area = (void *)cur_base;
+ cur_base += _ALIGN_UP(size, MB);
+ }
+
+ return area;
+}
+
+static struct fw_ops dink_fw_ops;
+
+struct fw_ops *
+dink_init(void)
+{
+ dink_fw_ops.malloc = dink_malloc;
+ dink_fw_ops.free = NULL;
+ dink_fw_ops.exit = NULL;
+
+ return &dink_fw_ops;
+}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 5/6] bootwrapper: Add support for the DINK firmware
2006-07-19 23:14 [PATCH 5/6] bootwrapper: Add support for the DINK firmware Mark A. Greer
@ 2006-07-19 23:33 ` Mark A. Greer
2006-08-02 16:19 ` Tom Rini
2006-09-08 3:40 ` [PATCH 5/6] bootwrapper: Add simple memory allocator Mark A. Greer
2 siblings, 0 replies; 7+ messages in thread
From: Mark A. Greer @ 2006-07-19 23:33 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
On Wed, Jul 19, 2006 at 04:14:21PM -0700, Mark A. Greer wrote:
> This patch adds the firmware operations that support the DINK firmware
> from Freescale.
>
> Signed-off-by: Mark A. Greer <mgreer@mvista.com>
> --
>
> dink.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 56 insertions(+)
> --
>
> diff --git a/arch/powerpc/boot/dink.c b/arch/powerpc/boot/dink.c
> new file mode 100644
> index 0000000..aa446e2
> --- /dev/null
> +++ b/arch/powerpc/boot/dink.c
> @@ -0,0 +1,56 @@
> +/*
> + * Sandpoint specific fixups.
Obviously an incorrect comment. Will fix.
Mark
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5/6] bootwrapper: Add support for the DINK firmware
2006-07-19 23:14 [PATCH 5/6] bootwrapper: Add support for the DINK firmware Mark A. Greer
2006-07-19 23:33 ` Mark A. Greer
@ 2006-08-02 16:19 ` Tom Rini
2006-08-02 18:14 ` Mark A. Greer
2006-09-08 3:40 ` [PATCH 5/6] bootwrapper: Add simple memory allocator Mark A. Greer
2 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2006-08-02 16:19 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
On Wed, Jul 19, 2006 at 04:14:21PM -0700, Mark A. Greer wrote:
> This patch adds the firmware operations that support the DINK firmware
> from Freescale.
This isn't really DINK support (which would mean actually talking
back/with DINK, parsing the infos that it does pass along, and it does,
iirc, but I don't recall if it's at all ever correct / useful :)) but
just a, um, I suck at naming things (see arch/ppc/boot/simple) but
non-nonsense, no help 'firmware' ops. Please think up a name that
doesn't suck (as a name I would come up with would). Thanks!
--
Tom Rini
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5/6] bootwrapper: Add support for the DINK firmware
2006-08-02 16:19 ` Tom Rini
@ 2006-08-02 18:14 ` Mark A. Greer
2006-08-02 18:15 ` Tom Rini
0 siblings, 1 reply; 7+ messages in thread
From: Mark A. Greer @ 2006-08-02 18:14 UTC (permalink / raw)
To: Tom Rini; +Cc: linuxppc-dev
On Wed, Aug 02, 2006 at 09:19:34AM -0700, Tom Rini wrote:
> On Wed, Jul 19, 2006 at 04:14:21PM -0700, Mark A. Greer wrote:
>
> > This patch adds the firmware operations that support the DINK firmware
> > from Freescale.
>
> This isn't really DINK support (which would mean actually talking
> back/with DINK,
You seem to be thinking that this is the final, end-all solution to
everything. It isn't. Its a step in the direction that we are trying
go (IIUC). dink.c is about the easiest one there will be. of.c has a
slightly more complicated fw_ops. We still need to figure out what uboot
needs and what PIBS needs and what...
As things are added, it'll evolve.
> parsing the infos that it does pass along, and it does,
> iirc,
Not that I know of.
> but I don't recall if it's at all ever correct / useful :)) but
> just a, um, I suck at naming things (see arch/ppc/boot/simple) but
> non-nonsense, no help 'firmware' ops. Please think up a name that
> doesn't suck (as a name I would come up with would). Thanks!
Guess I suck too b/c I can't think of anything better. As things
evolve, fw_ops may go away all together. The problem is, I'm not
exactly sure where we're going to end up so this is the best that
I can do with the info that I have.
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5/6] bootwrapper: Add support for the DINK firmware
2006-08-02 18:14 ` Mark A. Greer
@ 2006-08-02 18:15 ` Tom Rini
2006-08-02 18:31 ` Mark A. Greer
0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2006-08-02 18:15 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
On Wed, Aug 02, 2006 at 11:14:22AM -0700, Mark A. Greer wrote:
> On Wed, Aug 02, 2006 at 09:19:34AM -0700, Tom Rini wrote:
> > On Wed, Jul 19, 2006 at 04:14:21PM -0700, Mark A. Greer wrote:
> >
> > > This patch adds the firmware operations that support the DINK firmware
> > > from Freescale.
> >
> > This isn't really DINK support (which would mean actually talking
> > back/with DINK,
>
> You seem to be thinking that this is the final, end-all solution to
> everything. It isn't. Its a step in the direction that we are trying
> go (IIUC). dink.c is about the easiest one there will be. of.c has a
> slightly more complicated fw_ops. We still need to figure out what uboot
> needs and what PIBS needs and what...
Right. I'm just saying that unless you're planning on making this talk
with / use DINK (I swear, the DINK manual talks about this a bit, but
I'm too lazy to look just this second), this isn't the DINK one, this is
the (will be needed and used) bare metal one.
--
Tom Rini
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5/6] bootwrapper: Add support for the DINK firmware
2006-08-02 18:15 ` Tom Rini
@ 2006-08-02 18:31 ` Mark A. Greer
0 siblings, 0 replies; 7+ messages in thread
From: Mark A. Greer @ 2006-08-02 18:31 UTC (permalink / raw)
To: Tom Rini; +Cc: linuxppc-dev
On Wed, Aug 02, 2006 at 11:15:14AM -0700, Tom Rini wrote:
> On Wed, Aug 02, 2006 at 11:14:22AM -0700, Mark A. Greer wrote:
> > On Wed, Aug 02, 2006 at 09:19:34AM -0700, Tom Rini wrote:
> > > On Wed, Jul 19, 2006 at 04:14:21PM -0700, Mark A. Greer wrote:
> > >
> > > > This patch adds the firmware operations that support the DINK firmware
> > > > from Freescale.
> > >
> > > This isn't really DINK support (which would mean actually talking
> > > back/with DINK,
> >
> > You seem to be thinking that this is the final, end-all solution to
> > everything. It isn't. Its a step in the direction that we are trying
> > go (IIUC). dink.c is about the easiest one there will be. of.c has a
> > slightly more complicated fw_ops. We still need to figure out what uboot
> > needs and what PIBS needs and what...
>
> Right. I'm just saying that unless you're planning on making this talk
> with / use DINK (I swear, the DINK manual talks about this a bit, but
> I'm too lazy to look just this second), this isn't the DINK one, this is
> the (will be needed and used) bare metal one.
Ah, okay. Sure.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5/6] bootwrapper: Add simple memory allocator
2006-07-19 23:14 [PATCH 5/6] bootwrapper: Add support for the DINK firmware Mark A. Greer
2006-07-19 23:33 ` Mark A. Greer
2006-08-02 16:19 ` Tom Rini
@ 2006-09-08 3:40 ` Mark A. Greer
2 siblings, 0 replies; 7+ messages in thread
From: Mark A. Greer @ 2006-09-08 3:40 UTC (permalink / raw)
To: linuxppc-dev
This patch adds a simple memory allocator to the bootwrapper.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
--
simple_alloc.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+)
--
diff --git a/arch/powerpc/boot/simple_alloc.c b/arch/powerpc/boot/simple_alloc.c
new file mode 100644
index 0000000..ccf61b2
--- /dev/null
+++ b/arch/powerpc/boot/simple_alloc.c
@@ -0,0 +1,48 @@
+/*
+ * Simple memory allocator.
+ *
+ * Author: Mark A. Greer <mgreer@mvista.com>
+ *
+ * 2006 (c) MontaVista, Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+/* Some day, put in a real memory allocator */
+
+#include <stddef.h>
+#include "types.h"
+#include "page.h"
+#include "ops.h"
+
+#define MB (1024*1024)
+
+extern char _end[];
+
+static u32 cur_base;
+static u32 end_of_ram = 32 * MB;
+
+static void *simple_malloc(u32 size)
+{
+ void *area = NULL;
+ static u8 first_time = 1;
+
+ if (first_time) {
+ cur_base = _ALIGN_UP((unsigned long)_end, MB);
+ first_time = 0;
+ }
+
+ if ((cur_base + size) < end_of_ram) {
+ area = (void *)cur_base;
+ cur_base += _ALIGN_UP(size, MB);
+ }
+
+ return area;
+}
+
+void simple_alloc_init(void)
+{
+ platform_ops.malloc = simple_malloc;
+ platform_ops.free = NULL;
+}
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-09-08 3:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-19 23:14 [PATCH 5/6] bootwrapper: Add support for the DINK firmware Mark A. Greer
2006-07-19 23:33 ` Mark A. Greer
2006-08-02 16:19 ` Tom Rini
2006-08-02 18:14 ` Mark A. Greer
2006-08-02 18:15 ` Tom Rini
2006-08-02 18:31 ` Mark A. Greer
2006-09-08 3:40 ` [PATCH 5/6] bootwrapper: Add simple memory allocator Mark A. Greer
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).