This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Platform driver loading fails

Other Parts Discussed in Thread: AM3517

Using AM3517 with 2.6.37, ti sdk 5 and arago toolchain

I am trying to define my FPGA driver in the system but fail to load it, getting after "insmod fpga.ko":

[ 72.929351] fpga: module license 'unspecified' taints kernel.

[ 72.935424] Disabling lock debugging due to kernel taint
[ 72.943817] fpga: Unknown symbol device_create_file (err 0)
[ 72.950286] fpga: Unknown symbol device_remove_file (err 0)
insmod: error inserting 'fpga.ko': -1 Unknown symbol in module

Please advise what's wrong...

So, for AM3517 board file I had added the following:

#define FPGA_START_ADDRESS 0x1000000

static struct resource am3517_fpga_mmx_resources[] = {
{
.start = FPGA_START_ADDRESS,
.end = FPGA_START_ADDRESS + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device am3517_fpga_mmx_device = {
.name = "fpga_mmx",
.id = -1,
.num_resources = ARRAY_SIZE(am3517_fpga_mmx_resources),
.resource = am3517_fpga_mmx_resources,
};

and running the: platform_device_register(&am3517_fpga_mmx_device); in the main EVM init function.

No warnings.

My driver is calling functions creating sysfs nodes. it is a platform driver which should just access FPGA memory.

Here it is:

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/version.h>
#include <linux/device.h>
#include <linux/platform_device.h>

#include "fpga_ctrl.h"
#include "rf_ctrl.h"

static struct class *rf_ctrl_class;
static struct device *rf_ctrl_class_dev;
static struct class *fpga_ctrl_class;
static struct device *fpga_ctrl_class_dev;

/* fpga_probe */
static int __devinit fpga_probe(struct platform_device *device)
{
return 0;
}

static struct platform_driver fpga_driver =
{
.driver =
{
.name = "fpga_mmx",
.owner = THIS_MODULE,
},

.probe = fpga_probe,
.remove = __devexit_p(fpga_remove),
};

/* fpga_remove */
static int __devexit fpga_remove(struct platform_device *device)
{
return 0;
}

static int __init fpga_mod_init()
{
printk(KERN_ALERT "fpga_mod_init\n");
platform_driver_register(&fpga_driver);

/* Create class for FPGA RF Control */

rf_ctrl_class = class_create(THIS_MODULE, "rf_ctrl");
rf_ctrl_class_dev = device_create(rf_ctrl_class, NULL, 0, NULL, "rf_ctrl");

rf_nodes_init(rf_ctrl_class_dev);

/* Create class for FPGA Modules Control */

fpga_ctrl_class = class_create(THIS_MODULE, "fpga_ctrl");
fpga_ctrl_class_dev = device_create(fpga_ctrl_class, NULL, 0, NULL, "fpga_ctrl");

rxphy_nodes_init(fpga_ctrl_class_dev);
txphy_nodes_init(fpga_ctrl_class_dev);
mac_nodes_init(fpga_ctrl_class_dev);
cpuif_nodes_init(fpga_ctrl_class_dev);
refpll_nodes_init(fpga_ctrl_class_dev);
pt_nodes_init(fpga_ctrl_class_dev);

return 0;
}

static void __exit fpga_mod_exit()
{
rf_nodes_cleanup(rf_ctrl_class_dev);

device_destroy(rf_ctrl_class, 0);
class_destroy(rf_ctrl_class);

rxphy_nodes_cleanup(fpga_ctrl_class_dev);
txphy_nodes_cleanup(fpga_ctrl_class_dev);
mac_nodes_cleanup(fpga_ctrl_class_dev);
cpuif_nodes_cleanup(fpga_ctrl_class_dev);
refpll_nodes_cleanup(fpga_ctrl_class_dev);
pt_nodes_cleanup(fpga_ctrl_class_dev);

device_destroy(fpga_ctrl_class, 0);
class_destroy(fpga_ctrl_class);

platform_driver_unregister(&fpga_driver);
printk(KERN_ALERT "fpga_mod_exit\n");
}

module_init(fpga_mod_init);
module_exit(fpga_mod_exit);

MODULE_AUTHOR("Y.M.");
MODULE_LICENSE("GPL");