* [U-Boot] [PATCH] PPC: define post_word_{load/store} for all PPC boards.
@ 2010-04-20 19:44 Michael Zaidman
2010-04-20 21:52 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Michael Zaidman @ 2010-04-20 19:44 UTC (permalink / raw)
To: u-boot
Defining the post_word_{load/store} routines in the ppc common code
eliminates the necessity to redefine them for each of the ppc CPUs or
boards.
Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
---
arch/ppc/lib/Makefile | 1 +
arch/ppc/lib/commproc.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 0 deletions(-)
create mode 100644 arch/ppc/lib/commproc.c
diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile
index 334e457..be9c6a3 100644
--- a/arch/ppc/lib/Makefile
+++ b/arch/ppc/lib/Makefile
@@ -38,6 +38,7 @@ COBJS-y += extable.o
COBJS-y += interrupts.o
COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
COBJS-y += time.o
+COBJS-y += commproc.o
SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
diff --git a/arch/ppc/lib/commproc.c b/arch/ppc/lib/commproc.c
new file mode 100644
index 0000000..a0aaae6
--- /dev/null
+++ b/arch/ppc/lib/commproc.c
@@ -0,0 +1,54 @@
+/*
+ * (C) Copyright 2010
+ * Michael Zaidman, Kodak, michael.zaidman at kodak.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include <common.h>
+#include <asm/io.h>
+
+#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
+/* The CONFIG_SYS_POST_WORD_ADDR and/or CONFIG_SYS_POST_ALT_WORD_ADDR
+ * should be defined in the bord's configuration file as address of the
+ * RAM word available immediately after power on. For CPUs with IMMR it
+ * usually is configured as address of an unused register in IMMR area.
+ */
+#if defined(CONFIG_SYS_POST_WORD_ADDR)
+# define _POST_WORD_ADDR CONFIG_SYS_POST_WORD_ADDR
+#elif defined(CONFIG_SYS_POST_ALT_WORD_ADDR)
+# define _POST_WORD_ADDR (CONFIG_SYS_POST_ALT_WORD_ADDR)
+#endif
+
+static ulong __post_word_load (void)
+{
+ return in_be32((volatile void *)(_POST_WORD_ADDR));
+}
+ulong post_word_load (void)
+ __attribute__((weak, alias("__post_word_load")));
+
+static void __post_word_store (ulong value)
+{
+ out_be32((volatile void *)(_POST_WORD_ADDR), value);
+}
+void post_word_store (ulong value)
+ __attribute__((weak, alias("__post_word_store")));
+
+#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
--
1.6.3.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] PPC: define post_word_{load/store} for all PPC boards.
2010-04-20 19:44 [U-Boot] [PATCH] PPC: define post_word_{load/store} for all PPC boards Michael Zaidman
@ 2010-04-20 21:52 ` Wolfgang Denk
2010-04-21 7:28 ` Michael Zaidman
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2010-04-20 21:52 UTC (permalink / raw)
To: u-boot
Dear Michael Zaidman,
In message <1271792672-10567-1-git-send-email-michael.zaidman@gmail.com> you wrote:
> Defining the post_word_{load/store} routines in the ppc common code
> eliminates the necessity to redefine them for each of the ppc CPUs or
> boards.
>
> Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
> ---
> arch/ppc/lib/Makefile | 1 +
> arch/ppc/lib/commproc.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 55 insertions(+), 0 deletions(-)
> create mode 100644 arch/ppc/lib/commproc.c
NAK. "commproc" is by definition code for the communication
processors on some freescale processors. It makes no sense to use this
name for generica code.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Question: How does one get fresh air into a Russian church?
Answer: One clicks on an icon, and a window opens!
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] PPC: define post_word_{load/store} for all PPC boards.
2010-04-20 21:52 ` Wolfgang Denk
@ 2010-04-21 7:28 ` Michael Zaidman
0 siblings, 0 replies; 3+ messages in thread
From: Michael Zaidman @ 2010-04-21 7:28 UTC (permalink / raw)
To: u-boot
Link to the related thread:
http://lists.denx.de/pipermail/u-boot/2010-April/070263.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-21 7:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-20 19:44 [U-Boot] [PATCH] PPC: define post_word_{load/store} for all PPC boards Michael Zaidman
2010-04-20 21:52 ` Wolfgang Denk
2010-04-21 7:28 ` Michael Zaidman
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.