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.

am3358扩展16c554问题

Other Parts Discussed in Thread: AM3359, TL16C554

下面的代码我是在8250_exar_st16c554.c基础上改的,使用的8250.c驱动,但系统启动时注册exar_device总是报错“
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:481 sysfs_add_one+0x8c/0xac()
sysfs: cannot create duplicate filename '/devices/platform/serial8250.6'
Modules linked in:
Backtrace:
[<c0018220>] (dump_bac”

-----------------------------------------------------

有帖子说是该用mapbase,但不管我用哪一个或几个,都是一样的错误,请大家帮忙看看到底是什么问题

---------------------------------------

8250_exar_st16c554.c

static struct platform_device exar_device =
{
 .name   = "serial8250",
 .id   = PLAT8250_DEV_EXAR_ST16C554,
 .dev   = {
  .platform_data = exar_data,
 },
};


static void AM3359_SET_PORTDATA(struct plat_serial8250_port* pPort, unsigned int _base, int _irq)
{
 
 //(pPort)->mapbase = _base;
 (pPort)->membase = ioremap_nocache(_base, 512);
(pPort)->mapbase = _base;
 (pPort)->iobase = _base;

printk("tl16c554: irq:%d base:%x,ioremap=%x\n", _irq,_base, (pPort)->membase);

 (pPort)->irq = _irq;
 (pPort)->uartclk = 25000000;
 (pPort)->iotype = UPIO_MEM;
 (pPort)->flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
 (pPort)->regshift = 0;
 (pPort)->irqflags = IRQF_TRIGGER_RISING;
}


static int __init exar_init(void)
{
 int ret;
 unsigned long mem_base;


 printk(KERN_INFO "sct:exar_init\n ");
 memset(exar_data, 0, sizeof(exar_data));
 
 if (gpmc_cs_request(2, 512, (unsigned long *)&mem_base) < 0)
    {
        printk(KERN_ERR "exar_init:Failed request for GPMC mem for usrp_e\n");
        return -1;
    }
    printk("Got CS%d, address = %lx\n",2,mem_base);
   
    AM3359_SET_PORTDATA(exar_data, mem_base, UART1_INT);
   
 ret=platform_device_register(&exar_device);
 printk(KERN_INFO "sct:exar_init:ret=%d\n ",ret);
 return ret;
}

module_init(exar_init);

MODULE_AUTHOR("Paul B Schroeder");
MODULE_DESCRIPTION("8250 serial probe module for Exar cards");
MODULE_LICENSE("GPL");