Skip to contentSkip to conversation

8260/8xx Embedded Boot patch

PATCH Allen Curtis 3 participants 7 messages Aug 28, 2002

lore
Share & tools
lore
#0 lore raw

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

# 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 [email protected] 1.1114.1.2
# CONFIG_EMBEDDEDBOOT and CONFIG_PPC_ALL cleanup
# --------------------------------------------
#

arch/ppc/boot/simple/embed_config.c +16 -1
diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
@@ -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 */
 
arch/ppc/boot/simple/head.S +2 -2
diff -Nru a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
@@ -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
 			 */
arch/ppc/config.in +17 -4
diff -Nru a/arch/ppc/config.in b/arch/ppc/config.in
@@ -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
 
arch/ppc/boot/simple/embed_config.c +2 -2
diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
@@ -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;
#5 lore raw
Quoted 4 lines

The first thing I saw was the define_bool CONFIG_ALL_PPC n. If this was actually needed someplace, there's a bug there that needs to be fixed.

This is not required. All of the xxxx8260_defconfig files define this so you do not get all of the generic Mac stuff like IDE and video. If it is not appropriate take it out. It just serves to weed out a lot of options you are just going to turn-off anyway.

------------------------------------------------------------

Allen Curtis              |  All good things come to those
Ones and Zeros, Inc.      |  who wait. Some of us have to
mailto:[email protected]    |  wait a little longer.

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

#6 lore raw
Quoted 9 lines · On Tue, Aug 27, 2002 at 05:28:29PM -0700, [email protected] wrote:
Quoted 4 lines

The first thing I saw was the define_bool CONFIG_ALL_PPC n. If this was actually needed someplace, there's a bug there that needs to be fixed.

This is not required. All of the xxxx8260_defconfig files define this so you do not get all of the generic Mac stuff like IDE and video. If it is not appropriate take it out. It just serves to weed out a lot of options you are just going to turn-off anyway.

They shouldn't show up on 8260, since they don't show up on other, non-CONFIG_ALL_PPC platforms. Again, if they show up it's a bug. The bug is doing:
dep_{tristate,bool} 'Some pmac-specific driver' CONFIG_PMACSPEC $CONFIG_ALL_PPC It should be:
if [ "$CONFIG_ALL_PPC" = "y" ]; then
{bool,tristate} 'Some pmac-specific driver' CONFIG_PMACSPEC
fi

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

#2 lore raw
In reply to Allen Curtis
Quoted 1 line · Allen Curtis

Fix/cleanup to embedded boot

Please explain these changes. You shouldn't be using embed_config.c if you don't have EMBEDDEDBOOT defined. The EMBEDDEDBOOT is a generic bootloader that should only have unique functions in embed_config.c You should be definining a board configuration for whatever you are doing and use that.

	-- Dan

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

#3 lore raw
Quoted 6 lines

Please explain these changes. You shouldn't be using embed_config.c if you don't have EMBEDDEDBOOT defined. The EMBEDDEDBOOT is a generic bootloader that should only have unique functions in embed_config.c You should be definining a board configuration for whatever you are doing and use that.

I am using a modified EST8260 configuration. However the EST8260 embedded stuff was broke. The bd_info structure was not passed up from head.S. The call to configure the clocks was missing at the end of embed_config(). You will also see that I translate the CONFIG_RPX (and other platform conditionals) into CONFIG_EMBEDDED and use the single conditional compile.

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

#4 lore raw
Quoted 2 lines · Allen Curtis

I am using a modified EST8260 configuration. However the EST8260 embedded stuff was broke.

So, if you have an EST configuration that passes a bd pointer from the boot rom in r3, the attached patch should be all that is necessary, correct?

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.

Thanks.

	-- Dan
arch/ppc/boot/simple/embed_config.c +2 -0
diff -aru devel_old/arch/ppc/boot/simple/embed_config.c linuxppc_2_4_devel/arch/ppc/boot/simple/embed_config.c
@@ -465,6 +465,8 @@
 	bd->bi_brgfreq *= 1000000;
 #endif
 
+	clk_8260(bd);
+
 	cp = (u_char *)def_enet_addr;
 	for (i=0; i<6; i++) {
 		bd->bi_enetaddr[i] = *cp++;
arch/ppc/boot/simple/head.S +2 -2
diff -aru devel_old/arch/ppc/boot/simple/head.S linuxppc_2_4_devel/arch/ppc/boot/simple/head.S
@@ -59,7 +59,7 @@
 	isync
 #endif
 
-#if defined(CONFIG_MBX) || defined(CONFIG_RPX6)
+#if defined(CONFIG_MBX) || defined(CONFIG_RPX6) || defined(CONFIG_EST8260)
 	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)
+#if defined(CONFIG_MBX) || defined(CONFIG_RPX6) || defined(CONFIG_EST8260)
 	mr	r4,r29	/* put the board info pointer where the relocate
 			 * routine will find it
 			 */