|
From: Dave A. <ai...@us...> - 2003-06-10 01:49:31
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/mbx
In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/ppc/boot/mbx
Modified Files:
Makefile misc.c
Log Message:
DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed)
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/mbx/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 10 Apr 2002 15:04:00 -0000 1.1
+++ Makefile 10 Jun 2003 01:46:01 -0000 1.2
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.7 06/05/01 20:20:05 paulus
+# BK Id: SCCS/s.Makefile 1.9 10/15/01 10:53:29 trini
#
#
# arch/ppc/mbxboot/Makefile
@@ -73,6 +73,12 @@
-DZIMAGE_SIZE=0 -c -o $@ $*.c
zvmlinux.initrd: $(OBJECTS) $(LIBS) ../images/vmlinux.gz
+#
+# Recompile misc.o again with more 'correct' bogus offsets
+#
+ $(CC) $(CFLAGS) -DINITRD_OFFSET=0x0008c8e3 -DINITRD_SIZE=0x0000111a \
+ -DZIMAGE_OFFSET=0x00018000 -DZIMAGE_SIZE=0x000748e2 \
+ -c -o misc.o misc.c
$(LD) $(ZLINKFLAGS) -o $@.tmp $(OBJECTS) $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=initrd=../images/ramdisk.image.gz \
@@ -88,6 +94,8 @@
--add-section=initrd=../images/ramdisk.image.gz \
--add-section=image=../images/vmlinux.gz \
$@.tmp ../images/$@.embedded
+# Remove zvmlinux and zvmlinux.temp, we have ../images/zvmlinux.embedded
+ rm -f $@.tmp $@
zImage: zvmlinux
ifeq ($(CONFIG_RPXCLASSIC),y)
@@ -104,6 +112,12 @@
endif
zvmlinux: $(OBJECTS) $(LIBS) ../images/vmlinux.gz
+#
+# Recompile misc.o again with more 'correct' bogus offsets
+#
+ $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \
+ -DZIMAGE_OFFSET=0x00018000 -DZIMAGE_SIZE=0x000748e2 \
+ -c -o misc.o misc.c
#
# build the boot loader image and then compute the offset into it
# for the kernel image
Index: misc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/mbx/misc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- misc.c 10 Apr 2002 15:04:00 -0000 1.1
+++ misc.c 10 Jun 2003 01:46:01 -0000 1.2
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.misc.c 1.13 07/27/01 11:44:37 trini
+ * BK Id: SCCS/s.misc.c 1.15 10/15/01 10:53:29 trini
*/
/*
* Adapted for PowerPC by Gary Thomas
@@ -44,10 +44,6 @@
char *avail_ram;
char *end_avail;
-/* See comment below.....
-*/
-unsigned int initrd_offset, initrd_size;
-
/* Because of the limited amount of memory on embedded, it presents
* loading problems. The biggest is that we load this boot program
* into a relatively low memory address, and the Linux kernel Bss often
@@ -75,14 +71,13 @@
bd_t *hold_residual = &hold_resid_buf;
unsigned long initrd_start = 0, initrd_end = 0;
char *zimage_start;
-int zimage_size;
extern void gunzip(void *, int, unsigned char *, int *);
unsigned long
decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
{
- int timer;
+ int timer, zimage_size = ZIMAGE_SIZE;
extern unsigned long start;
char *cp, ch;
@@ -93,17 +88,6 @@
serial_init(bp);
#endif
- /* These values must be variables. If not, the compiler optimizer
- * will remove some code, causing the size of the code to vary
- * when these values are zero. This is bad because we first
- * compile with these zero to determine the size and offsets
- * in an image, than compile again with these set to the proper
- * discovered value.....Ya know, we used to read these from the
- * header a long time ago.....
- */
- initrd_offset = INITRD_OFFSET;
- initrd_size = INITRD_SIZE;
-
/* Grab some space for the command line and board info. Since
* we no longer use the ELF header, but it was loaded, grab
* that space.
@@ -154,13 +138,12 @@
/* we have to subtract 0x10000 here to correct for objdump including the
size of the elf header which we strip -- Cort */
zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET);
- zimage_size = ZIMAGE_SIZE;
- if ( initrd_offset )
- initrd_start = load_addr - 0x10000 + initrd_offset;
+ if ( INITRD_OFFSET )
+ initrd_start = load_addr - 0x10000 + INITRD_OFFSET;
else
initrd_start = 0;
- initrd_end = initrd_size + initrd_start;
+ initrd_end = INITRD_SIZE + initrd_start;
/*
* setup avail_ram - this is the first part of ram usable
@@ -201,9 +184,9 @@
if ((unsigned long)initrd_start > 0x01000000) {
memcpy ((void *)PAGE_ALIGN(-PAGE_SIZE+(unsigned long)end_avail-INITRD_SIZE),
(void *)initrd_start,
- initrd_size );
+ INITRD_SIZE );
initrd_start = PAGE_ALIGN(-PAGE_SIZE+(unsigned long)end_avail-INITRD_SIZE);
- initrd_end = initrd_start + initrd_size;
+ initrd_end = initrd_start + INITRD_SIZE;
end_avail = (char *)initrd_start;
puts("relocated to: "); puthex(initrd_start);
puts(" "); puthex(initrd_end); puts("\n");
|