linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: 8260/8xx Embedded Boot patch
@ 2002-08-28 17:08 Curtis, Allen
  2002-08-28 18:44 ` Dan Malek
  0 siblings, 1 reply; 10+ messages in thread
From: Curtis, Allen @ 2002-08-28 17:08 UTC (permalink / raw)
  To: 'dan@embeddededge.com'
  Cc: 'linuxppc-embedded@lists.linuxppc.org'


>I'll just check it in right from my tree if it is what you need.  The
>part inside the '#if 0' to hardcode the values still needs to
>be fixed if
>someone actually uses that.  In fact, I'll just fix it and push out the
>change since it will work on all boards depending upon what you want.

I looked at the patch and I have a couple comments:

1. The loop that overwrites the b_enetaddr[] should check that it does not
contain any information before assigning the default. This could have been
passed in by the bios.

2. If you assume that any platform that uses CONFIG_EMBEDDEDBOOT may want to
pass in a bd_info structure, then the platform specific patch in head.S is
wrong. Based on the current architecture I believe this is a safe
assumption. You may totally ignore this parameter in embed_config.c where
the platform dependent code is located.

diff -aru devel_old/arch/ppc/boot/simple/head.S
linuxppc_2_4_devel/arch/ppc/boot/simple/head.S
--- devel_old/arch/ppc/boot/simple/head.S	Wed Aug 28 00:59:37 2002
+++ linuxppc_2_4_devel/arch/ppc/boot/simple/head.S	Wed Aug 28 01:00:12
2002
@@ -59,7 +59,7 @@
 	isync
 #endif

-#if defined(CONFIG_MBX) || defined(CONFIG_RPX6)
+#if defined(CONFIG_EMBEDDEDBOOT)
 	mr	r29,r3	/* On the MBX860, r3 is the board info pointer.
...


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: 8260/8xx Embedded Boot patch
@ 2002-08-28 19:03 Curtis, Allen
  0 siblings, 0 replies; 10+ messages in thread
From: Curtis, Allen @ 2002-08-28 19:03 UTC (permalink / raw)
  To: 'Dan Malek', Curtis, Allen
  Cc: 'linuxppc-embedded@lists.linuxppc.org'


>currently working without the ability to test everything else that may
>be affected.  You definitely have to take the "if it works,

They are not using this code, it was not working.

>> 2. If you assume that any platform that uses
>CONFIG_EMBEDDEDBOOT may want to
>> pass in a bd_info structure,
>
>We don't assume that at all.  In fact there are only three
>boards now where
>we make that assumption and it is clear in the code which ones
>they are.

You seem to have missed the part about putting the platform specific stuff
in embed_config.c. When you are starting up and you use documentation such
as Documentation/powerpc/SBC8260_memory_mapping.txt, which specifies that
the BIOS passes in bd_info structures, you assume that is what you should do
and then find out that it only works for specific boards.

This brings me back to my original suggestion, create kernel features with
specific behaviors that platform specific header files can enable. Keep the
kernel source free of platform conditional compiles with the exception of
files contained in the platform directory. In this case CONFIG_EMBEDDED
indicates that simple boot should be used and the bios may provide a bd_info
structure. It does not specify the structure or that a structure is required
but the provision has been made for it.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread
* 8260/8xx Embedded Boot patch
@ 2002-08-28  0:06 Allen Curtis
  2002-08-28  0:23 ` Tom Rini
  2002-08-28  4:03 ` Dan Malek
  0 siblings, 2 replies; 10+ messages in thread
From: Allen Curtis @ 2002-08-28  0:06 UTC (permalink / raw)
  To: dan; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]

Fix/cleanup to embedded boot
--
All things come to those who wait. Some of us just have to wait a little
longer...

[-- Attachment #2: embedded.patch --]
[-- Type: text/x-diff, Size: 4232 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1114.1.1 -> 1.1114.1.2
#	  arch/ppc/config.in	1.150   -> 1.151
#	arch/ppc/boot/simple/head.S	1.3     -> 1.4
#	arch/ppc/boot/simple/embed_config.c	1.13    -> 1.14
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/26	acurtis@ws01.onz.com	1.1114.1.2
# CONFIG_EMBEDDEDBOOT and CONFIG_PPC_ALL cleanup
# --------------------------------------------
#
diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
--- a/arch/ppc/boot/simple/embed_config.c	Tue Aug 27 16:29:02 2002
+++ b/arch/ppc/boot/simple/embed_config.c	Tue Aug 27 16:29:02 2002
@@ -27,7 +27,7 @@

 /* For those boards that don't provide one.
 */
-#if !defined(CONFIG_MBX)
+#ifndef(CONFIG_EMBEDDEDBOOT)
 static	bd_t	bdinfo;
 #endif

@@ -444,6 +444,10 @@
 	bd_t	*bd;

 	bd = *bdp;
+
+#if !defined(CONFIG_EMBEDDEDBOOT)
+	bd = &bdinfo;
+	*bdp = bd;
 #if 0
 	/* This is actually provided by my boot rom.  I have it
 	 * here for those people that may load the kernel with
@@ -469,6 +473,17 @@
 	for (i=0; i<6; i++) {
 		bd->bi_enetaddr[i] = *cp++;
 	}
+#else
+	/* The boot rom passes these to us in MHz.  Linux now expects
+	 * them to be in Hz.
+	 */
+	bd->bi_intfreq *= 1000000;
+	bd->bi_busfreq *= 1000000;
+	bd->bi_cpmfreq *= 1000000;
+	bd->bi_brgfreq *= 1000000;
+
+	clk_8260(bd);
+#endif
 }
 #endif /* EST8260 */

diff -Nru a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
--- a/arch/ppc/boot/simple/head.S	Tue Aug 27 16:29:02 2002
+++ b/arch/ppc/boot/simple/head.S	Tue Aug 27 16:29:02 2002
@@ -59,7 +59,7 @@
 	isync
 #endif

-#if defined(CONFIG_MBX) || defined(CONFIG_RPX6)
+#ifdef CONFIG_EMBEDDEDBOOT
 	mr	r29,r3	/* On the MBX860, r3 is the board info pointer.
 			 * On the RPXSUPER, r3 points to the
 			 * NVRAM configuration keys.
@@ -103,7 +103,7 @@
 	mr	r3, r29
 #endif

-#if defined(CONFIG_MBX) || defined(CONFIG_RPX6)
+#ifdef CONFIG_EMBEDDEDBOOT
 	mr	r4,r29	/* put the board info pointer where the relocate
 			 * routine will find it
 			 */
diff -Nru a/arch/ppc/config.in b/arch/ppc/config.in
--- a/arch/ppc/config.in	Tue Aug 27 16:29:02 2002
+++ b/arch/ppc/config.in	Tue Aug 27 16:29:02 2002
@@ -62,12 +62,18 @@

 if [ "$CONFIG_8260" = "y" ]; then
   define_bool CONFIG_SERIAL_CONSOLE y
+  define_bool CONFIG_PPC_ALL    n
+
   choice 'Machine Type'	\
 	"EST8260	CONFIG_EST8260	\
 	 SBS8260	CONFIG_SBS8260	\
 	 RPXSUPER	CONFIG_RPX6	\
  	 TQM8260	CONFIG_TQM8260	\
 	 Willow		CONFIG_WILLOW"	Willow
+
+	if [ "$CONFIG_EST8260" = "y" -o "$CONFIG_RPX6" = "y" ]; then
+	  define_bool CONFIG_EMBEDDEDBOOT y
+	fi
 fi

 if [ "$CONFIG_40x" = "y" ]; then
@@ -131,6 +137,17 @@
 	 MBX		CONFIG_MBX		\
 	 WinCept	CONFIG_WINCEPT"		RPX-Lite

+  if [ "$CONFIG_MBX"     = "y" -o \
+       "$CONFIG_RPXLITE" = "y" -o \
+       "$CONFIG_IVMS8"   = "y" -o \
+       "$CONFIG_SM850"   = "y" -o \
+       "$CONFIG_TQM823L" = "y" -o \
+       "$CONFIG_TQM850L" = "y" -o \
+       "$CONFIG_TQM860L" = "y" -o \
+       "$CONFIG_BSEIP"   = "y" ]; then
+    define_bool CONFIG_EMBEDDEDBOOT y
+  fi
+
   if [ "$CONFIG_TQM823L" = "y" -o \
        "$CONFIG_TQM850L" = "y" -o \
        "$CONFIG_FPS850L" = "y" -o \
@@ -343,10 +360,6 @@
     fi
   fi
   dep_bool 'OCP Device proc fs support (experimental)' CONFIG_OCP_PROC $CONFIG_IBM_OCP
-fi
-
-if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then
-    define_bool CONFIG_EMBEDDEDBOOT y
 fi
 endmenu

diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
--- a/arch/ppc/boot/simple/embed_config.c	Tue Aug 27 16:29:27 2002
+++ b/arch/ppc/boot/simple/embed_config.c	Tue Aug 27 16:29:27 2002
@@ -27,7 +27,7 @@

 /* For those boards that don't provide one.
 */
-#ifndef(CONFIG_EMBEDDEDBOOT)
+#ifndef CONFIG_EMBEDDEDBOOT
 static	bd_t	bdinfo;
 #endif

@@ -402,7 +402,7 @@
 clk_8260(bd_t *bd)
 {
 	uint	scmr, vco_out, clkin;
-	uint	plldf, pllmf, busdf, brgdf, cpmdf;
+	uint	plldf, pllmf, busdf, cpmdf;
 	volatile immap_t	*ip;

 	ip = (immap_t *)IMAP_ADDR;

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

end of thread, other threads:[~2002-08-28 19:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-28 17:08 8260/8xx Embedded Boot patch Curtis, Allen
2002-08-28 18:44 ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2002-08-28 19:03 Curtis, Allen
2002-08-28  0:06 Allen Curtis
2002-08-28  0:23 ` Tom Rini
2002-08-28  0:28   ` acurtis
2002-08-28  0:36     ` Tom Rini
2002-08-28  4:03 ` Dan Malek
2002-08-28  4:16   ` Allen Curtis
2002-08-28  6:06     ` Dan Malek

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