Browse Source

can compile for fcr_soc.

master
root 15 years ago
parent
commit
361336cfd8
  1. 29
      Targets/fcr_soc/conf/Makefile.fcr_soc
  2. 4
      Targets/fcr_soc/conf/ld.script
  3. 4
      Targets/fcr_soc/dev/if_dc2114x.c
  4. 1
      Targets/fcr_soc/dev/lcd.c
  5. 4
      include/linux/module.h
  6. 2
      pmon/cmds/mycmd.c
  7. 6
      pmon/fs/yaffsfs.c
  8. 3
      zloader/Makefile.fcr
  9. 4
      zloader/Makefile.inc

29
Targets/fcr_soc/conf/Makefile.fcr_soc

@ -1,4 +1,4 @@
# $Id: Makefile.Bonito2edev,v 1.1.1.1 2006/09/14 01:59:09 root Exp $
# $Id: Makefile.fcr_soc,v 1.1.1.1 2006/09/14 01:59:09 root Exp $
#
# Makefile for PMON2000 EV64240
#
@ -17,7 +17,7 @@
#
.SUFFIXES: .S .c .o
CROSS_COMPILE =mips-elf-
#CROSS_COMPILE =mips-elf-
#CROSS_COMPILE =mipsel-linux-
#
@ -25,8 +25,8 @@ CROSS_COMPILE =mips-elf-
#
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
CC ?= $(CROSS_COMPILE)gcc -mips3
LD = $(CROSS_COMPILE)ld -m elf32ltsmip -G 0 -static -n -nostdlib
#CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
@ -37,6 +37,8 @@ RANLIB = $(CROSS_COMPILE)ranlib
SIZE = $(CROSS_COMPILE)size
OPT?= -O2
IDENT:=${IDENT} $(shell echo ${IDENT}|sed -n 's/.*-DX\([0-9]\+\)x\([0-9]\+\).*/ -DFB_XSIZE=\1 -DFB_YSIZE=\2 /p')
IDENT:=${IDENT} $(shell echo ${IDENT}|sed -n 's/.*-DCONFIG_VIDEO_\([0-9]\+\)BPP.*/ -DFB_COLOR_BITS=\1 /p')
all: pmon
@ -59,16 +61,16 @@ PMONDIR=${S}
INCLUDES= -I. -I${S}/include -I./machine -I${S} \
-I${S}/sys/arch/${MACHINE}/include -I${S}/sys \
-I${TARGET} -I${COMPILEDIR} -nostdinc
-I${TARGET} -I${COMPILEDIR} -I${PATH1} -nostdinc -fno-strict-aliasing -fno-pic
CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -D__OpenBSD__ -DPMON -D__PMON__\
-${ENDIAN} -mno-abicalls -mmemcpy -mcpu=r4000
-mmemcpy -mno-abicalls -mips2 -fno-builtin#-march=r4600
#CWARNFLAGS= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \
-Wno-uninitialized -Wno-format -Wno-main
CWARNFLAGS= -Wall -Wstrict-prototypes \
-Wno-uninitialized -Wno-format -Wno-main
CFLAGS= ${DEBUG} ${CWARNFLAGS} ${OPT} -G 0
AFLAGS= -D_LOCORE -G 0
LFLAGS= -${ENDIAN} -N -G 0 -T../../conf/ld.script -e start
LFLAGS= -N -G 0 -T../../conf/ld.script -e start
STRIPFLAGS= -g -S --strip-debug
HOSTCC?= ${CC}
@ -82,7 +84,6 @@ LIBM=${MLIB}
include ${S}/lib/libz/Makefile.inc
LIBZ=${ZLIB}
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
@ -118,12 +119,14 @@ endif
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD}
# ${SYSTEM_LD_TAIL}
#SYSTEM_OBJ= ${START} crtbegin.o param.o ioconf.o ri.o ${OBJS} ${LIBC} ${LIBM} ${LIBZ} \
SYSTEM_OBJ= ${START} crtbegin.o param.o ioconf.o ri.o ${OBJS} ${LIBC} ${LIBM} ${LIBZ} \
crtend.o
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= rm -f $@
SYSTEM_LD= @echo ${LD} ${LFLAGS} -o $@ ${LIBDIR} '$${SYSTEM_OBJ}' vers.o; \
${LD} ${LFLAGS} -o $@ ${LIBDIR} ${SYSTEM_OBJ} vers.o
SYSTEM_LD= @echo ${LD} ${LFLAGS} -o $@ ${LIBDIR} '${SYSTEM_OBJ}' vers.o; \
${LD} ${LFLAGS} -o $@ ${LIBDIR} ${SYSTEM_OBJ} vers.o -L../../../../examples/math/ -lgcc
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ ; \
${OBJCOPY} -O binary $@ $@.bin
@ -196,10 +199,10 @@ SRCS= ${TARGET}/${SUBTARGET}/start.S \
param.c ioconf.c ri.c ${CFILES} ${SFILES}
depend:: .depend
.depend: ${SRCS} param.c
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${TARGET}/${SUBTARGET}/start.S
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
${MKDEP} ${AFLAGS} ${shell echo ${CPPFLAGS}|sed -e 's/ -f[^ ]*//g' } ${TARGET}/${SUBTARGET}/start.S
${MKDEP} -a ${CFLAGS} ${shell echo ${CPPFLAGS}|sed -e 's/ -f[^ ]*//g' } param.c ioconf.c ${CFILES}
ifneq (${SFILES}, "")
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
${MKDEP} -a ${AFLAGS} ${shell echo ${CPPFLAGS}|sed -e 's/ -f[^ ]*//g' } ${SFILES}
endif
# depend on root or device configuration

4
Targets/fcr_soc/conf/ld.script

@ -1,8 +1,8 @@
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
"elf32-tradlittlemips")
OUTPUT_ARCH(mips)
ENTRY(_start)
SECTIONS

4
Targets/fcr_soc/dev/if_dc2114x.c

@ -342,6 +342,8 @@ static void OUTL(struct eth_device* dev, int command, u_long addr)
#define PHY_ADDR_17 17
void phy_write( u8 phy_addr, u8 offset, u16 phy_data);
u16 phy_read(u8 phy_addr, u8 offset);
u16 loop_back_17(void)
{
u16 data_phy=0;
@ -561,6 +563,7 @@ void phy_write_1( u32 phy_addr, u32 offset, u32 phy_data)
// }
}
static u16 phy_read_1bit(unsigned long ioaddr);
u32 phy_read_1(u32 phy_addr, u32 offset)
{
int i;
@ -751,6 +754,7 @@ int dc21x4x_initialize(struct eth_device* dev)
#define next_tx(x) (((x+1)==NUM_TX_DESC)?0:(x+1))
#define next_rx(x) (((x+1)==NUM_RX_DESC)?0:(x+1))
static void send_setup_frame(struct eth_device* dev);
/*
* init function
*/

1
Targets/fcr_soc/dev/lcd.c

@ -9,6 +9,7 @@
unsigned char __SD_LCD_BAR_BASE[VMAX*HMAX*2] __attribute__ ((aligned(64)));
static int count = 0;
void init_lcd_regs();
void init_lcd()
{
pci_sync_cache(0, (vm_offset_t)__SD_LCD_BAR_BASE, sizeof(__SD_LCD_BAR_BASE), SYNC_R);

4
include/linux/module.h

@ -1,3 +1,7 @@
#ifndef __MODULE_H__
#define __MODULE_H__
#define EXPORT_SYMBOL(...)
#define MODULE_LICENSE(...)
struct module{};
#endif

2
pmon/cmds/mycmd.c

@ -362,7 +362,7 @@ case 1:
break;
case 2:
MYC(mydata->data2=*(volatile short *)addr;);
asm("dsll32 %1,%1,0;dsrl32 %1,%1,0;dsll32 %2,%2,0;or %1,%2;lhu $2,(%1);" \
MYASM("dsll32 %1,%1,0;dsrl32 %1,%1,0;dsll32 %2,%2,0;or %1,%2;lhu $2,(%1);" \
"sh $2,(%0);" \
::"r"(&mydata->data2),"r"(a.l[0]),"r"(a.l[1])
:"$2"

6
pmon/fs/yaffsfs.c

@ -2177,6 +2177,7 @@ static int yaffs_CreateFreeObjects(yaffs_Device * dev, int nObjects)
}
static void yaffs_AddObjectToDirectory(yaffs_Object * directory, yaffs_Object * obj);
/* AllocateEmptyObject gets us a clean Object. Tries to make allocate more if we run out */
static yaffs_Object *yaffs_AllocateEmptyObject(yaffs_Device * dev)
{
@ -2215,6 +2216,8 @@ static yaffs_Object *yaffs_AllocateEmptyObject(yaffs_Device * dev)
return tn;
}
yaffs_Object *yaffs_CreateNewObject(yaffs_Device * dev, int number,
yaffs_ObjectType type);
static yaffs_Object *yaffs_CreateFakeDirectory(yaffs_Device * dev, int number, __u32 mode)
{
@ -2893,6 +2896,7 @@ static void yaffs_DeviceToCheckpointDevice(yaffs_CheckpointDevice *cp, yaffs_Dev
}
static void yaffs_CheckpointDeviceToDevice(yaffs_Device *dev, yaffs_CheckpointDevice *cp);
static int yaffs_ReadCheckpointDevice(yaffs_Device *dev)
{
yaffs_CheckpointDevice cp;
@ -2976,6 +2980,7 @@ static int yaffs_ReadCheckpointTnodes(yaffs_Object *obj)
}
static void yaffs_HardlinkFixup(yaffs_Device *dev, yaffs_Object *hardList);
static int yaffs_ReadCheckpointObjects(yaffs_Device *dev)
{
yaffs_Object *obj;
@ -4023,6 +4028,7 @@ static int yaffs_CreateInitialDirectories(yaffs_Device *dev)
return YAFFS_FAIL;
}
void yaffs_Deinitialise(yaffs_Device * dev);
int yaffs_GutsInitialise(yaffs_Device * dev)
{
int init_failed = 0;

3
zloader/Makefile.fcr

@ -2,8 +2,7 @@ TARGET=fcr_soc
TARGETEL=fcr
START=start.o
MEMSIZE=16
ZLOADER_OPTIONS=-DNOCACHE2 -DNOMSG
PMONCC=mips-elf-gcc -mips2
ZLOADER_OPTIONS=-DNOCACHE2 -DNOMSG -mips2
RAMSTARTADDR=0xffffffff80800000
include Makefile.inc

4
zloader/Makefile.inc

@ -7,7 +7,7 @@ endif
GZROMSTARTADDR?=0xffffffff81000000
ROMSTARTADDR?=0xffffffff80010000
RAMSTARTADDR?=0xffffffff88000000
export CC += ${MYCC} -mips3 -mno-abicalls -fno-pic
export CC += ${MYCC} -mno-abicalls -fno-pic
export MKDEP=makedepend
ifdef obj
@ -36,7 +36,7 @@ rom: clean ${START} zloader.o
ram: clean startram.o zloader.o
gcc -DSTARTADDR=${GZROMSTARTADDR} -E -P ld.script.S |sed 's/OUTPUT_ARCH(1)/OUTPUT_ARCH(mips)/'> ld.script
${CROSS_COMPILE}ld -mips3 -T ld.script -e start -o gzram startram.o zloader.o
${CROSS_COMPILE}ld -T ld.script -e start -o gzram startram.o zloader.o
zlib_rom: clean ${START} zlib_loader.o
gcc -DSTARTADDR=${GZROMSTARTADDR} -E -P ld.script.S > ld.script

Loading…
Cancel
Save