[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Problem with make petalinux kernel 2.6 driver codes



hello folks:

I am new to write a driver for petalinux kernel 2.6,and i had ported the petalinux kernel 2.6 to Xilinx ML403 broad.It can booted
successfully.

Now,i try to write a driver for a simple IP named "ipgcd"
when i "make" my driver codes ,i got some error message below:

make -C /home/bluedkdk/petalinux-v0.30-rc1/software/petalinux-dist/linux-2.6.x/ ARCH=microblaze M=/home/bluedkdk/petalinux-v0.30-rc1/software/user-apps/ipgcd modules
make[1]: Entering directory `/home/bluedkdk/petalinux-v0.30-rc1/software/linux-2.6.x-petalogix'
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M]  /home/bluedkdk/petalinux-v0.30-rc1/software/user-apps/ipgcd/ipgcd.ko
/home/bluedkdk/petalinux-v0.30-rc1/tools/linux-i386/microblaze-uclinux-tools/bin/microblaze-uclinux-ld.real: unrecognised emulation mode: cpu=v5.00.c
Supported emulations: elf32microblaze
make[2]: *** [/home/bluedkdk/petalinux-v0.30-rc1/software/user-apps/ipgcd/ipgcd.ko] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/bluedkdk/petalinux-v0.30-rc1/software/linux-2.6.x-petalogix'
make: *** [modules] Error 2

i don't know how to fix it, could anyone help me to fix the problem?

My Makefile is below :
######################################################################################
# Comment/uncomment the following line to disable/enable debugging
#DEBUG = y


# Add your debugging flag (or not) to CFLAGS
#ifeq ($(DEBUG),y)
#  DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines
#else
  DEBFLAGS = -O2
#endif

CFLAGS += $(DEBFLAGS)
CFLAGS += -I$(LDDINC)

ifndef ROOTDIR
 ROOTDIR=$(PETALINUX)/software/petalinux-dist
endif

UCLINUX_BUILD_USER = 1
-include $(ROOTDIR)/.config
-include $(ROOTDIR)/$(CONFIG_LINUXDIR)/.config
#LIBCDIR = $(CONFIG_LIBCDIR)
-include $(ROOTDIR)/config.arch
#ROMFSDIR=$(ROOTDIR)/romfs
#ROMFSINST=$(ROOTDIR)/tools/romfs-inst.sh


#ifneq ($(KERNELRELEASE),)
# call from kernel build system

#ipgcd-objs := ipgcd.o

obj-m    := ipgcd.o

#else

#KERNELDIR ?= /lib/modules/$(shell uname -r)/build
KERNELDIR := /home/bluedkdk/petalinux-v0.30-rc1/software/petalinux-dist/linux-2.6.x/

PWD       := $(shell pwd)

modules:
    $(MAKE) -C $(KERNELDIR) ARCH=microblaze M=$(PWD) modules
    #$(MAKE) -C $(KERNELDIR) ARCH=microblaze M=$(PWD) LDDINC=$(CONFIG_LIBCDIR) modules

#endif



clean:
    rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions

depend .depend dep:
    $(CC) $(CFLAGS) -M *.c > .depend


#ifeq (.depend,$(wildcard .depend))
#include .depend
#endif
######################################################################################
--
Best regards

Bruce Lan