LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-18-2013, 06:17 AM   #1
answerme
Member
 
Registered: Apr 2008
Posts: 85

Rep: Reputation: 24
Adding Driver in menuconfig


Hi All
I have linux kernel 2.6.23 ,I have created a simple driver in the path
/home/RF/MPC8641/kernel/linux-2.6.23/drivers/alpha-driver/test.c
In alpha-driver I included in kconfig & Makefile
My kConfig & makfile looks like this:

Code:
menu "ALPHA- 8548 Card support"

config CONFIG_8548_pci
        tristate "ALPHAPCI"
        help
          TO enable ALPHAPCI
          Select Y here
endmenu
Code:
 Makefile 


obj-$(CONFIG_8548_test)			+= test.o
Whereas I have take care Makefile & Kconfig file in this Path also
/home/RF/MPC8641/kernel/linux-2.6.23/drivers/
Please see the BOLD LINE in Makefile & KConfig

Code:
menu "Device Drivers"

source "drivers/base/Kconfig"

source "drivers/connector/Kconfig"

source "drivers/mtd/Kconfig"

source "drivers/of/Kconfig"

source "drivers/parport/Kconfig"

source "drivers/pnp/Kconfig"

source "drivers/block/Kconfig"

# misc before ide - BLK_DEV_SGIIOC4 depends on SGI_IOC4

source "drivers/misc/Kconfig"

source "drivers/ide/Kconfig"

source "drivers/scsi/Kconfig"

source "drivers/ata/Kconfig"

source "drivers/md/Kconfig"

source "drivers/message/fusion/Kconfig"

source "drivers/ieee1394/Kconfig"

source "drivers/message/i2o/Kconfig"

source "drivers/macintosh/Kconfig"

source "drivers/net/Kconfig"

source "drivers/isdn/Kconfig"

source "drivers/telephony/Kconfig"

# input before char - char/joystick depends on it. As does USB.

source "drivers/input/Kconfig"

source "drivers/char/Kconfig"

source "drivers/i2c/Kconfig"

source "drivers/spi/Kconfig"

source "drivers/w1/Kconfig"

source "drivers/power/Kconfig"

source "drivers/hwmon/Kconfig"

source "drivers/mfd/Kconfig"

source "drivers/media/Kconfig"

source "drivers/video/Kconfig"

source "sound/Kconfig"

source "drivers/hid/Kconfig"

source "drivers/usb/Kconfig"

source "drivers/mmc/Kconfig"

source "drivers/leds/Kconfig"

source "drivers/infiniband/Kconfig"

source "drivers/edac/Kconfig"

source "drivers/rtc/Kconfig"

source "drivers/dma/Kconfig"

source "drivers/auxdisplay/Kconfig"

source "drivers/kvm/Kconfig"

source "drivers/uio/Kconfig"

source "drivers/lguest/Kconfig"

source "drivers/alpha-driver/Kconfig"
endmenu

MAKEFILE

Code:
obj-$(CONFIG_PCI)		+= pci/
obj-$(CONFIG_PARISC)		+= parisc/
obj-$(CONFIG_RAPIDIO)		+= rapidio/
obj-y				+= video/
obj-$(CONFIG_ACPI)		+= acpi/
# PnP must come after ACPI since it will eventually need to check if acpi
# was used and do nothing if so
obj-$(CONFIG_PNP)		+= pnp/
obj-$(CONFIG_ARM_AMBA)		+= amba/

obj-$(CONFIG_XEN)		+= xen/

# char/ comes before serial/ etc so that the VT console is the boot-time
# default.
obj-y				+= char/

obj-$(CONFIG_CONNECTOR)		+= connector/

# i810fb and intelfb depend on char/agp/
obj-$(CONFIG_FB_I810)           += video/i810/
obj-$(CONFIG_FB_INTEL)          += video/intelfb/

obj-y				+= serial/
obj-$(CONFIG_PARPORT)		+= parport/
obj-y				+= base/ block/ misc/ mfd/ net/ media/
obj-$(CONFIG_NUBUS)		+= nubus/
obj-$(CONFIG_ATM)		+= atm/
obj-y				+= macintosh/
obj-$(CONFIG_IDE)		+= ide/
obj-$(CONFIG_FC4)		+= fc4/
obj-$(CONFIG_SCSI)		+= scsi/
obj-$(CONFIG_ATA)		+= ata/
obj-$(CONFIG_FUSION)		+= message/
obj-$(CONFIG_FIREWIRE)		+= firewire/
obj-$(CONFIG_IEEE1394)		+= ieee1394/
obj-$(CONFIG_UIO)		+= uio/
obj-y				+= cdrom/
obj-y				+= auxdisplay/
obj-$(CONFIG_MTD)		+= mtd/
obj-$(CONFIG_SPI)		+= spi/
obj-$(CONFIG_PCCARD)		+= pcmcia/
obj-$(CONFIG_DIO)		+= dio/
obj-$(CONFIG_SBUS)		+= sbus/
obj-$(CONFIG_KVM)		+= kvm/
obj-$(CONFIG_ZORRO)		+= zorro/
obj-$(CONFIG_MAC)		+= macintosh/
obj-$(CONFIG_ATA_OVER_ETH)	+= block/aoe/
obj-$(CONFIG_PARIDE) 		+= block/paride/
obj-$(CONFIG_TC)		+= tc/
obj-$(CONFIG_USB)		+= usb/
obj-$(CONFIG_PCI)		+= usb/
obj-$(CONFIG_USB_GADGET)	+= usb/gadget/
obj-$(CONFIG_SERIO)		+= input/serio/
obj-$(CONFIG_GAMEPORT)		+= input/gameport/
obj-$(CONFIG_INPUT)		+= input/
obj-$(CONFIG_I2O)		+= message/
obj-$(CONFIG_RTC_LIB)		+= rtc/
obj-y				+= i2c/
obj-$(CONFIG_W1)		+= w1/
obj-$(CONFIG_POWER_SUPPLY)	+= power/
obj-$(CONFIG_HWMON)		+= hwmon/
obj-$(CONFIG_WATCHDOG)		+= char/watchdog/
obj-$(CONFIG_PHONE)		+= telephony/
obj-$(CONFIG_MD)		+= md/
obj-$(CONFIG_BT)		+= bluetooth/
obj-$(CONFIG_ISDN)		+= isdn/
obj-$(CONFIG_EDAC)		+= edac/
obj-$(CONFIG_MCA)		+= mca/
obj-$(CONFIG_EISA)		+= eisa/
obj-$(CONFIG_LGUEST_GUEST)	+= lguest/
obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
obj-$(CONFIG_MMC)		+= mmc/
obj-$(CONFIG_NEW_LEDS)		+= leds/
obj-$(CONFIG_INFINIBAND)	+= infiniband/
obj-$(CONFIG_SGI_SN)		+= sn/
obj-y				+= firmware/
obj-$(CONFIG_CRYPTO)		+= crypto/
obj-$(CONFIG_SUPERH)		+= sh/
obj-$(CONFIG_GENERIC_TIME)	+= clocksource/
obj-$(CONFIG_DMA_ENGINE)	+= dma/
obj-$(CONFIG_HID)		+= hid/
obj-$(CONFIG_PPC_PS3)		+= ps3/
obj-$(CONFIG_OF)		+= of/
obj-$(CONFIG_8548_pci )	        += alpha-driver/
Now I follow up these procedures
Code:
1. source /opt/ELDK/4.2/eldk_init 4xx (cross compiler)
2.make ARCH=powerpc menuconfig ( to enable test driver )
3. make ARCH=powerpc uImage

I am always getting statement in my terminal 
make[1]: `arch/powerpc/boot/uImage' is up to date.
Even if I have purposefully I have remove semicolon from printk to check whether any error is getting or not .but still I am getting this statement only

Code:
make[1]: `arch/powerpc/boot/uImage' is up to date
I have checked in menuconfig test driver is there & I have made it enabled also but stil same problem .
Where I am doing wrong .
 
Old 07-18-2013, 12:20 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 1,482

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
The definition of CONFIG_8548_pci in Kconfig does not match the use int the Makefile
Code:
obj-$(CONFIG_8548_test)			+= test.o
 
Old 07-18-2013, 11:14 PM   #3
answerme
Member
 
Registered: Apr 2008
Posts: 85

Original Poster
Rep: Reputation: 24
Ok
Now I have changed it to CONFIG_8548_pci but still its giving me same thing
Code:
obj-$(CONFIG_8548_pci)			+= test.o
 
Old 07-19-2013, 08:12 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 1,482

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
In the kernel source top level directory:
Code:
grep 8548 .config
If it's not there do:
Code:
make oldconfig

Last edited by smallpond; 07-19-2013 at 09:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding vortual driver for mini2440 kasimMCA Linux - Embedded & Single-board computer 3 10-01-2011 03:05 PM
adding a driver ahmed gamal Slackware 1 07-14-2006 08:11 AM
Adding a driver to IPCop. Boemenenoekinzo Linux - General 11 02-08-2006 09:27 PM
Compiling from 2.6.5-1 to 2.6.12-3 (adding raid driver) marsupillami Linux - Newbie 8 08-05-2005 09:30 PM
adding isa modem support in menuconfig (2.6.5) positiveinflux Linux - Newbie 1 04-07-2004 11:42 PM


All times are GMT -5. The time now is 12:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration