linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: Re: fadsrom -> mkrombin
@ 1999-12-09 13:55 Ruedi.Hofer
  0 siblings, 0 replies; 2+ messages in thread
From: Ruedi.Hofer @ 1999-12-09 13:55 UTC (permalink / raw)
  To: kd; +Cc: linuxppc-embedded

[-- Attachment #1: Type: TEXT/PLAIN, Size: 396 bytes --]

Thanx, applying the patch works!


But unfortunataly a file "byteconv.h" is missing:

rac26090:/usr/src/fadsrom # make mkrombin
cc -O0 -g -o mkrombin mkrombin.c
mkrombin.c:15: byteconv.h: No such file or directory
make: *** [mkrombin] Error 1
rac26090:/usr/src/fadsrom # 

It should probably be in your fadsrom directory!

Do you mind tgz-ing the whole fadsrom and sending it to me!?!?


Ruedi



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

* Re: Re: fadsrom -> mkrombin
@ 1999-12-09 15:49 kd
  0 siblings, 0 replies; 2+ messages in thread
From: kd @ 1999-12-09 15:49 UTC (permalink / raw)
  To: Ruedi.Hofer; +Cc: linuxppc-embedded

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


O.k.

Here is a cleaned up diff between orginal fadsrom and our inhous fadsrom
(the parts skiped are very board specific changes for hardware only found
on our 823 custom board). It compiles (verified) but I am not shure if it
runs 8-).....


K.D.
(See attached file: fadsrom.diff)


                                                                                                                                 
                    Ruedi.Hofer@a                                                                                                
                    scom.ch              To:     kd@flaga.is                                                                     
                                         cc:     linuxppc-embedded@lists.linuxppc.org                                            
                    12/09/99             Subject:     Re: Re: fadsrom -> mkrombin                                                
                    01:55 PM                                                                                                     
                                                                                                                                 
                                                                                                                                 




Thanx, applying the patch works!


But unfortunataly a file "byteconv.h" is missing:

rac26090:/usr/src/fadsrom # make mkrombin
cc -O0 -g -o mkrombin mkrombin.c
mkrombin.c:15: byteconv.h: No such file or directory
make: *** [mkrombin] Error 1
rac26090:/usr/src/fadsrom #

It should probably be in your fadsrom directory!

Do you mind tgz-ing the whole fadsrom and sending it to me!?!?


Ruedi





[-- Attachment #2: fadsrom.diff --]
[-- Type: application/octet-stream, Size: 6115 bytes --]

diff -u -b -B fadsrom_org/Makefile fadsrom/Makefile
--- fadsrom_org/Makefile	Mon Nov 30 18:12:34 1998
+++ fadsrom/Makefile	Thu Dec  9 15:38:45 1999
@@ -2,14 +2,32 @@
 # Makefile for the FADS ROM
 #
 
+KERNELHEADER=/home/kd/devel/linux/include
+
+CROSSCOMPILE = /usr/powerpc-linux/bin/
+#CROSSCOMPILE = 
+
+CC = $(CROSSCOMPILE)gcc
+LD = $(CROSSCOMPILE)ld
+
+
 # Use kernel include files to get machine/processor dependent stuff
-INCS = -I../linux/include \
-	-I../linux/arch/ppc/8xx_io
+INCS = -I$(KERNELHEADER) \
+	-I$(KERNELHEADER)/linux \
+	-I$(KERNELHEADER)/../arch/ppc/8xx_io 
 
+#ROMLOAD=0xfe000000
 ROMLOAD=0xfe000000
 DATA=0x00010000
 
-CFLAGS = -O2 -mcpu=860 $(INCS) -D__powerpc__ -DMHZ_50 -DFADS_860 \
+S19ADDR=0xfe000000
+
+DEBUG = -D_DEBUG -g
+#DEBUG =
+
+HOST = -DHOSTi386
+
+CFLAGS = -gdwarf -O -mcpu=823 $(INCS) -D__powerpc__ -DMHZ_50 -DFADS_860 \
 	-D__KERNEL__ -DDATA_MEM_ADDR=$(DATA) -DCONFIG_8xx -fsigned-char \
 	-msoft-float  -pipe -fno-builtin -ffixed-r2 -Wno-uninitialized \
 	-mmultiple -mstring
@@ -26,20 +44,20 @@
 	ppcstring.o extable.o
 
 fadsrom: $(OBJS) mkrombin
-	ld $(LINKFLAGS) $(OBJS) -o fadsrom
-	mkrombin fadsrom
+	$(LD) $(LINKFLAGS) $(OBJS) -o fadsrom
+	./mkrombin fadsrom
 
 # I ran this though 'dd' because on some NFS mounted file systems this
 # was pretty slow due to the printf.  The 'dd' buffers it into
 # more efficient blocks.
 s19: fadsrom bintos19
-	bintos19 fadsrom.bin | dd of=fadsrom.s19
+	./bintos19 fadsrom.bin $(S19ADDR) | dd of=fadsrom.s19
 
 mkrombin: mkrombin.c
-	cc -O2 -o mkrombin mkrombin.c
+	gcc $(DEBUG) $(HOST) -O2 -o mkrombin mkrombin.c
 
 bintos19: bintos19.c
-	cc -O2 -o bintos19 bintos19.c
+	gcc $(DEBUG) $(HOST) -O2 -o bintos19 bintos19.c
 
 clean:
 	rm -f $(OBJS) fadsrom fadsrom.bin fadsrom.s19
@@ -52,4 +70,9 @@
 start.o: Makefile ppc_asm.tmpl ppc_defs.h
 main.o: Makefile
 serial.o: Makefile
+dsp.o: Makefile
+exttimer.o: Makefile
+
+
+
 
diff -u -b -B fadsrom_org/extable.c fadsrom/extable.c
--- fadsrom_org/extable.c	Wed Nov 18 06:43:39 1998
+++ fadsrom/extable.c	Thu Dec  9 15:38:25 1999
@@ -4,7 +4,8 @@
  * from linux/arch/i386/mm/extable.c
  */
 
-#include <sys/types.h>
+//#include <sys/types.h>
+#include <types.h>
 
 /*
  * The exception table consists of pairs of addresses: the first is the
diff -u -b -B fadsrom_org/main.c fadsrom/main.c
--- fadsrom_org/main.c	Tue Nov 24 23:04:54 1998
+++ fadsrom/main.c	Thu Dec  9 15:37:12 1999
@@ -2,7 +2,8 @@
 /* FADS Boot ROM (skeleton :-).
  * Dan Malek.
  */
-#include <sys/types.h>
+#include <types.h>
+//#include <sys/types.h>
 #include "asm/fads.h"
 #include <asm/8xx_immap.h>
 
diff -u -b -B fadsrom_org/memstuff.c fadsrom/memstuff.c
--- fadsrom_org/memstuff.c	Wed Nov 18 06:52:45 1998
+++ fadsrom/memstuff.c	Thu Dec  9 15:37:37 1999
@@ -2,7 +2,8 @@
 /* FADS ROM
  * Dan Malek (dmalek@jlc.net)
  */
-#include <sys/types.h>
+#include <types.h>
+//#include <sys/types.h>
 #include "asm/fads.h"
 #include <asm/8xx_immap.h>
 
diff -u -b -B fadsrom_org/mkrombin.c fadsrom/mkrombin.c
--- fadsrom_org/mkrombin.c	Wed Nov 18 06:43:39 1998
+++ fadsrom/mkrombin.c	Thu Dec  9 15:39:26 1999
@@ -10,6 +10,9 @@
  * We strip the header, place the code first, and move the data to
  * a 4K page boundary following the code.
  */
+
+
+#include "byteconv.h"
 #include <sys/types.h>
 #include <fcntl.h>
 #include <string.h>
@@ -50,31 +53,42 @@
 		exit(2);
 	}
 	ehp = (Elf32_Ehdr *) ibuf;
+#ifdef _DEBUG
+	fprintf(stdout,"ibuf = %u, ehp = %u ", ibuf, ehp);
+#endif
 
 	if (strncmp(ehp->e_ident, ELFMAG, 4) != 0) {
 		fprintf(stderr, "%s doesn't look like ELF\n", argv[1]);
 		exit(2);
 	}
 
-	nscns = ehp->e_phnum;
-	epp = (Elf32_Phdr *)((uint)ehp + ehp->e_phoff);
+	nscns = CTOHS(ehp->e_phnum);
+	epp = (Elf32_Phdr *)((uint)ehp + CTOHL(ehp->e_phoff));
+#ifdef _DEBUG
+	fprintf(stdout,"nscsn = %i, e_phoff = %i\n", nscns, CTOHL(ehp->e_phoff));
+#endif
 
 	if (nscns != 2) {
-		fprintf(stderr, "something wrong with file %s\n", argv[1]);
-		exit(2);
+		fprintf(stderr, "1something wrong with file %s\n", argv[1]);
+	//	exit(2);
 	}
 
 	/* Get the data portion.
 	*/
-	if ((epp->p_type != PT_LOAD) || (epp->p_offset != 0x10000)) {
-		fprintf(stderr, "something wrong with file %s\n", argv[1]);
+#ifdef _DEBUG
+	fprintf(stdout, "p_type = %i, p_offset = %i\n",
+				CTOHL(epp->p_type),CTOHL(epp->p_offset));
+#endif
+	if ((CTOHL(epp->p_type) != PT_LOAD) ||
+				(CTOHL(epp->p_offset) != 0x10000)) {
+		fprintf(stderr, "2something wrong with file %s\n", argv[1]);
 		exit(2);
 	}
-	dsize = epp->p_filesz;
+	dsize = CTOHL(epp->p_filesz);
 
-#if 0
-	printf(" %d %d %d %d\n", epp->p_type, epp->p_offset, epp->p_filesz,
-		epp->p_memsz);
+#if _DEBUG
+	printf(" %d %d %d %d\n", CTOHL(epp->p_type), CTOHL(epp->p_offset),
+			CTOHL(epp->p_filesz), CTOHL(epp->p_memsz));
 #endif
 	if (read(elf_fd, dbuf, sizeof(dbuf)) != sizeof(dbuf)) {
 		fprintf(stderr, "%s doesn't look like ELF\n", argv[1]);
@@ -84,16 +98,17 @@
 	/* Get the instruction portion.
 	*/
 	epp++;
-	if ((epp->p_type != PT_LOAD) || (epp->p_offset != 0x20000) ||
-		(epp->p_filesz != epp->p_memsz)) {
-		fprintf(stderr, "something wrong with file %s\n", argv[1]);
+	if ((CTOHL(epp->p_type) != PT_LOAD) ||
+			(CTOHL(epp->p_offset) != 0x20000) ||
+			(CTOHL(epp->p_filesz) != CTOHL(epp->p_memsz))) {
+		fprintf(stderr, "3something wrong with file %s\n", argv[1]);
 		exit(2);
 	}
 #if 0
-	printf(" %d %d %d %d\n", epp->p_type, epp->p_offset, epp->p_filesz,
-		epp->p_memsz);
+	printf(" %d %d %d %d\n", CTOHL(epp->p_type), CTOHL(epp->p_offset), 
+			CTOHL(epp->p_filesz), CTOHL(epp->p_memsz));
 #endif
-	size = epp->p_filesz;
+	size = CTOHL(epp->p_filesz);
 	if (read(elf_fd, ibuf, size) != size) {
 		fprintf(stderr, "%s doesn't look like ELF\n", argv[1]);
 		exit(2);
diff -u -b -B fadsrom_org/partition.c fadsrom/partition.c
--- fadsrom_org/partition.c	Wed Nov 18 06:43:39 1998
+++ fadsrom/partition.c	Thu Dec  9 15:37:56 1999
@@ -4,7 +4,8 @@
  * Write an OSF partition to the first sector of the flash disk.
  */
 
-#include <sys/types.h>
+//#include <sys/types.h>
+#include <types.h>
 
 struct disklabel {
 	uint d_magic;

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

end of thread, other threads:[~1999-12-09 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-12-09 13:55 Re: fadsrom -> mkrombin Ruedi.Hofer
  -- strict thread matches above, loose matches on Subject: below --
1999-12-09 15:49 kd

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