LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Adding Driver in menuconfig (http://www.linuxquestions.org/questions/programming-9/adding-driver-in-menuconfig-4175470051/)

answerme 07-18-2013 07:17 AM

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 .

smallpond 07-18-2013 01:20 PM

The definition of CONFIG_8548_pci in Kconfig does not match the use int the Makefile
Code:

obj-$(CONFIG_8548_test)                        += test.o

answerme 07-19-2013 12:14 AM

Ok
Now I have changed it to CONFIG_8548_pci but still its giving me same thing
Code:

obj-$(CONFIG_8548_pci)                        += test.o

smallpond 07-19-2013 09:12 AM

In the kernel source top level directory:
Code:

grep 8548 .config
If it's not there do:
Code:

make oldconfig


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