1.问一下串口的serial_in seril_out函数,用的iowrite8 ioread8函数,请问一下如果连接GPMC总线的话是否需要修改读写函数?改为GPMC读写方式?
Steven Liu1:
看下函数实现,是否能实现是对GPMC划分的片选地址区域的访问。
leo chen:
只要是对应的地址空间都没什么问题
不过需要注意gpmc的位宽
Jian Zhou:
回复 leo chen:
把16c554作为串口设备,融合到tty driver层里面,相关的最底层读写可定要改成GPMC的读写。
zai Jonathan:
回复 Jian Zhou:
insmod 8250_exar_st16c554.ko [ 624.628601] ————[ cut here ]————[ 624.633575] WARNING: at fs/sysfs/dir.c:481 sysfs_add_one+0x94/0xb4()[ 624.640197] sysfs: cannot create duplicate filename '/devices/platform/serial8250.6'[ 624.648406] Modules linked in: 8250_exar_st16c554(+)[ 624.653594] Backtrace: [ 624.656158] [<c0017e34>] (dump_backtrace+0x0/0x10c) from [<c02c9810>] (dump_stack+0x18/0x1c)[ 624.664978] r6:000001e1 r5:c00ff4b0 r4:c7829ce8 r3:c0429d88[ 624.670898] [<c02c97f8>] (dump_stack+0x0/0x1c) from [<c003d054>] (warn_slowpath_common+0x54/0x6c)[ 624.680175] [<c003d000>] (warn_slowpath_common+0x0/0x6c) from [<c003d110>] (warn_slowpath_fmt+0x38/0x40)[ 624.690063] r8:c7b430e0 r7:c78fa000 r6:c7b430e0 r5:c78fa000 r4:ffffffef[ 624.696868] r3:00000009[ 624.699615] [<c003d0d8>] (warn_slowpath_fmt+0x0/0x40) from [<c00ff4b0>] (sysfs_add_one+0x94/0xb4)[ 624.708862] r3:c78fa000 r2:c0383bbc[ 624.712615] [<c00ff41c>] (sysfs_add_one+0x0/0xb4) from [<c00ff53c>] (create_dir+0x6c/0xc0)[ 624.721221] r7:00000000 r6:00000001 r5:bf00b040 r4:c7813310[ 624.727142] [<c00ff4d0>] (create_dir+0x0/0xc0) from [<c00ff650>] (sysfs_create_dir+0x8c/0xd4)[ 624.736053] [<c00ff5c4>] (sysfs_create_dir+0x0/0xd4) from [<c01735c4>] (kobject_add_internal+0xa0/0x238)[ 624.745941] r6:c04470c0 r5:00000000 r4:bf00b040[ 624.750762] [<c0173524>] (kobject_add_internal+0x0/0x238) from [<c0173a98>] (kobject_add+0x58/0x98)[ 624.760192] r8:c04470b8 r7:bf00b040 r6:c04470c0 r5:00000000 r4:bf00b040[ 624.767211] [<c0173a40>] (kobject_add+0x0/0x98) from [<c01c2988>] (device_add+0xa0/0x584)[ 624.775756] r3:00000000 r2:00000000[ 624.779479] r6:00000000 r5:bf00b158 r4:bf00b038[ 624.784332] [<c01c28e8>] (device_add+0x0/0x584) from [<c01c719c>] (platform_device_add+0x114/0x204)[ 624.793762] [<c01c7088>] (platform_device_add+0x0/0x204) from [<c01c73ec>] (platform_device_register+0x28/0x2c)[ 624.804290] r7:00000001 r6:00000000 r5:c0455800 r4:bf00b030[ 624.810211] [<c01c73c4>] (platform_device_register+0x0/0x2c) from [<bf00d014>] (exar_init+0x14/0x1c [8250_exar_st16c554])[ 624.821746] r4:bf00b2f8 r3:00000000[ 624.825469] [<bf00d000>] (exar_init+0x0/0x1c [8250_exar_st16c554]) from [<c0008770>] (do_one_initcall+0x44/0x1ac)[ 624.836212] [<c000872c>] (do_one_initcall+0x0/0x1ac) from [<c006b3d0>] (sys_init_module+0xf8/0x1b04)[ 624.845733] [<c006b2d8>] (sys_init_module+0x0/0x1b04) from [<c0014700>] (ret_fast_syscall+0x0/0x30)[ 624.855163] —[ end trace bf32a16277959dc2 ]—[ 624.859985] kobject_add_internal failed for serial8250.6 with -EEXIST, don't try to register things with the same name in the same directory.[ 624.873229] Backtrace: [ 624.875793] [<c0017e34>] (dump_backtrace+0x0/0x10c) from [<c02c9810>] (dump_stack+0x18/0x1c)[ 624.884582] r6:c04470c0 r5:ffffffef r4:bf00b040 r3:c0429d88[ 624.890502] [<c02c97f8>] (dump_stack+0x0/0x1c) from [<c0173734>] (kobject_add_internal+0x210/0x238)[ 624.899932] [<c0173524>] (kobject_add_internal+0x0/0x238) from [<c0173a98>] (kobject_add+0x58/0x98)[ 624.909393] r8:c04470b8 r7:bf00b040 r6:c04470c0 r5:00000000 r4:bf00b040[ 624.916412] [<c0173a40>] (kobject_add+0x0/0x98) from [<c01c2988>] (device_add+0xa0/0x584)[ 624.924957] r3:00000000 r2:00000000[ 624.928680] r6:00000000 r5:bf00b158 r4:bf00b038[ 624.933502] [<c01c28e8>] (device_add+0x0/0x584) from [<c01c719c>] (platform_device_add+0x114/0x204)[ 624.942962] [<c01c7088>] (platform_device_add+0x0/0x204) from [<c01c73ec>] (platform_device_register+0x28/0x2c)[ 624.953460] r7:00000001 r6:00000000 r5:c0455800 r4:bf00b030[ 624.959381] [<c01c73c4>] (platform_device_register+0x0/0x2c) from [<bf00d014>] (exar_init+0x14/0x1c [8250_exar_st16c554])[ 624.970825] r4:bf00b2f8 r3:00000000[ 624.974548] [<bf00d000>] (exar_init+0x0/0x1c [8250_exar_st16c554]) from [<c0008770>] (do_one_initcall+0x44/0x1ac)[ 624.985260] [<c000872c>] (do_one_initcall+0x0/0x1ac) from [<c006b3d0>] (sys_init_module+0xf8/0x1b04)[ 624.994812] [<c006b2d8>] (sys_init_module+0x0/0x1b04) from [<c0014700>] (ret_fast_syscall+0x0/0x30)insmod: can't insert '8250_exar_st16c554.ko': File exists
zai Jonathan:
回复 zai Jonathan:
这个问题已经解决了,是由于8250_exar_16c554.c文件中的地址类型错误引起的要用mapbase.
zai Jonathan:
回复 zai Jonathan:
insmod 8250_exar_st16c554.ko [ 23.651458] Unhandled fault: external abort on non-linefetch (0x008) at 0xc88c0009[ 23.659393] Internal error: : 8 [#1][ 23.663146] Modules linked in: 8250_exar_st16c554(+)[ 23.668365] CPU: 0 Not tainted (3.2.0 #37)[ 23.673004] PC is at mem_serial_in+0x18/0x24[ 23.677490] LR is at serial8250_config_port+0x104/0xbe8[ 23.682952] pc : [<c01b79a0>] lr : [<c01ba510>] psr: 40000093[ 23.682952] sp : c78fbb58 ip : c78fbb68 fp : c78fbb64[ 23.694976] r10: c046d2f8 r9 : c046d2f4 r8 : 00000000[ 23.700439] r7 : 20000013 r6 : fffffffe r5 : 00000001 r4 : c046d2f8[ 23.707275] r3 : c88c0008 r2 : 00000001 r1 : 00000001 r0 : c046d2f8[ 23.714111] Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user[ 23.721649] Control: 10c5387d Table: 87bd4019 DAC: 00000015[ 23.727661] Process insmod (pid: 1234, stack limit = 0xc78fa2f0)[ 23.733947] Stack: (0xc78fbb58 to 0xc78fc000)[ 23.738525] bb40: c78fbba4 c78fbb68[ 23.747070] bb60: c01ba510 c01b7994 c7a48e00 00000000 c78fbb94 c78fbb80 c0174a60 c0446940[ 23.755645] bb80: c046d2f8 c7a48e00 c7a48e30 00000004 c046d2f4 c046d2f8 c78fbc34 c78fbba8[ 23.764190] bba0: c01b72a8 c01ba418 c78fbbc4 c78fbbb8 c01c1948 c0173264 c78fbbdc c78fbbc8[ 23.772766] bbc0: c01c27dc c01c1938 00000003 c7a48a00 c78fbbfc c78fbbe0 c01c2848 c01c27b8[ 23.781341] bbe0: c04297f0 00400040 c7b77480 c046d2f8 c78fbc0c c78fbc00 c019c80c c01c281c[ 23.789886] bc00: c78fbc34 c78fbc10 c01b52cc c046d2f8 00000004 c78fbc78 c0446940 00000004[ 23.798461] bc20: c046d2f4 c046d2f8 c78fbc64 c78fbc38 c01b9cd0 c01b71ac 00000000 bf0001bc[ 23.807006] bc40: 00000001 bf000038 c78fbc78 00000080 0000010b 00000000 c78fbd3c c78fbc68[ 23.815582] bc60: c02c6c18 c01b9b34 c7b3e5e0 c78fbcf0 c7b3e0e0 c78fbcf0 00000000 00000000[ 23.824127] bc80: 00000000 00000000 00000000 00000000 00000000 00000007 00000081 00708000[ 23.832702] bca0: 00000000 00020000 00000000 00000000 00000000 00000000 00000000 00000000[ 23.841278] bcc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000[ 23.849822] bce0: 00000000 00000000 90000000 00000000 00000000 00000000 00000000 00000000[ 23.858398] bd00: 00000000 00000008 bf000038 00000000 00000000 00000000 bf000038 c046db80[ 23.866943] bd20: c0452d88 c04469dc c04470b8 c046db5c c78fbd4c c78fbd40 c01c6acc c02c6b40[ 23.875518] bd40: c78fbd7c c78fbd50 c01c54d8 c01c6ab8 c78fbd7c c78fbd60 c01c6ea4 c04469dc[ 23.884063] bd60: bf000038 c01c5794 00000000 c04470b8 c78fbd94 c78fbd80 c01c57d8 c01c542c[ 23.892639] bd80: bf000038 c78fbd98 c78fbdbc c78fbd98 c01c4134 c01c57a0 c7806f08 c7a41574[ 23.901214] bda0: bf000038 bf00006c 00000000 bf000040 c78fbddc c78fbdc0 c01c52f4 c01c40d8[ 23.909759] bdc0: 00000001 bf000038 bf000158 00000000 c78fbdec c78fbde0 c01c4aac c01c5264[ 23.918334] bde0: c78fbe3c c78fbdf0 c01c2d80 c01c4a8c c01739c4 00000000 00000000 bf000030[ 23.926879] be00: bf000038 00000001 c78fbe30 c78fbe18 c01c1b14 00000000 bf000030 bf000038[ 23.935455] be20: 00000001 c7bb8740 0000010b 00000001 c78fbe5c c78fbe40 c01c719c c01c28f4[ 23.944000] be40: bf000030 c0455800 00000000 00000001 c78fbe74 c78fbe60 c01c73ec c01c7094[ 23.952575] be60: 00000000 bf0002f8 c78fbe84 c78fbe78 bf002014 c01c73d0 c78fbee4 c78fbe88[ 23.961151] be80: c0008770 bf00200c 00000001 c7bb8740 c78fbeb4 c78fa000 bf002000 00000000[ 23.969696] bea0: c7ae6b80 00000000 c78fbed4 c78fbeb8 bf0002f8 bf0002b0 0000001c bf0002f8[ 23.978271] bec0: bf0002b0 0000001c 00000001 c7bb8740 0000010b 00000001 c78fbfa4 c78fbee8[ 23.986816] bee0: c006b3d0 c0008738 bf0002bc c78102c0 c7b87e48 00000000 c006a194 000a2008[ 23.995391] bf00: c887d4e8 c887d4e8 c78fa000 00000025 bf0003d0 bf0002bc c78fbf34 c887d000[ 24.003967] bf20: 00000d1b c887d6a0 c887d5e7 c887dc10 c7bb8880 000003e4 000003f4 00000000[ 24.012512] bf40: 00000000 00000011 00000012 00000009 00000006 00000004 00000000 00000000[ 24.021087] bf60: 00000000 00000000 00000000 00000000 00000000 c03bdb6c 00000000 be98bea6[ 24.029632] bf80: 000a2018 000a2008 00000080 c00148a8 c78fa000 00000000 00000000 c78fbfa8[ 24.038208] bfa0: c0014700 c006b2e4 be98bea6 000a2018 000a2018 00000d1b 000a2008 00000000[ 24.046752] bfc0: be98bea6 000a2018 000a2008 00000080 000a0aa4 0000cf20 be98bd18 00000000[ 24.055328] bfe0: 400edd34 be98bc98 0001b184 400edd44 20000010 000a2018 00000000 00000000[ 24.063873] Backtrace: [ 24.066467] [<c01b7988>] (mem_serial_in+0x0/0x24) from [<c01ba510>] (serial8250_config_port+0x104/0xbe8)[ 24.076385] [<c01ba40c>] (serial8250_config_port+0x0/0xbe8) from [<c01b72a8>] (uart_add_one_port+0x108/0x38c)[ 24.086761] [<c01b71a0>] (uart_add_one_port+0x0/0x38c) from [<c01b9cd0>] (serial8250_register_port+0x1a8/0x268)[ 24.097351] [<c01b9b28>] (serial8250_register_port+0x0/0x268) from [<c02c6c18>] (serial8250_probe+0xe4/0x14c)[ 24.107727] [<c02c6b34>] (serial8250_probe+0x0/0x14c) from [<c01c6acc>] (platform_drv_probe+0x20/0x24)[ 24.117462] [<c01c6aac>] (platform_drv_probe+0x0/0x24) from [<c01c54d8>] (driver_probe_device+0xb8/0x2dc)[ 24.127502] [<c01c5420>] (driver_probe_device+0x0/0x2dc) from [<c01c57d8>] (__device_attach+0x44/0x48)[ 24.137237] r8:c04470b8 r7:00000000 r6:c01c5794 r5:bf000038 r4:c04469dc[ 24.144287] [<c01c5794>] (__device_attach+0x0/0x48) from [<c01c4134>] (bus_for_each_drv+0x68/0x94)[ 24.153656] r5:c78fbd98 r4:bf000038[ 24.157409] [<c01c40cc>] (bus_for_each_drv+0x0/0x94) from [<c01c52f4>] (device_attach+0x9c/0xc0)[ 24.166595] r7:bf000040 r6:00000000 r5:bf00006c r4:bf000038[ 24.172546] [<c01c5258>] (device_attach+0x0/0xc0) from [<c01c4aac>] (bus_probe_device+0x2c/0x48)[ 24.181732] r6:00000000 r5:bf000158 r4:bf000038 r3:00000001[ 24.187683] [<c01c4a80>] (bus_probe_device+0x0/0x48) from [<c01c2d80>] (device_add+0x498/0x584)[ 24.196807] [<c01c28e8>] (device_add+0x0/0x584) from [<c01c719c>] (platform_device_add+0x114/0x204)[ 24.206268] [<c01c7088>] (platform_device_add+0x0/0x204) from [<c01c73ec>] (platform_device_register+0x28/0x2c)[ 24.216827] r7:00000001 r6:00000000 r5:c0455800 r4:bf000030[ 24.222778] [<c01c73c4>] (platform_device_register+0x0/0x2c) from [<bf002014>] (exar_init+0x14/0x1c [8250_exar_st16c554])[ 24.234252] r4:bf0002f8 r3:00000000[ 24.238006] [<bf002000>] (exar_init+0x0/0x1c [8250_exar_st16c554]) from [<c0008770>] (do_one_initcall+0x44/0x1ac)[ 24.248748] [<c000872c>] (do_one_initcall+0x0/0x1ac) from [<c006b3d0>] (sys_init_module+0xf8/0x1b04)[ 24.258331] [<c006b2d8>] (sys_init_module+0x0/0x1b04) from [<c0014700>] (ret_fast_syscall+0x0/0x30)[ 24.267822] Code: e24cb004 e5d0202d e5903004 e1a02211 (e7d30002) [ 24.274505] —[ end trace 27588c68e8ff92ef ]—Segmentation fault
Jian Zhou:
回复 zai Jonathan:
我看你一直在自问自答啊,能不能把问题出现的描述下,也好做个总结啊
zai Jonathan:
回复 Jian Zhou:
现在有个问题,就是通过FPGA软件分析时序发现一个问题。验证TL16C554a的时序都是正确的,但是到IOR IOW的上升沿后发现没有数据数据。下边是有可能的问题
1.我发现RESET554连到了FPGA上处于高电平,芯片处于复位状态,已经把这个27管脚RESET拉底了
2.经过1步还发现不是这个问题引起的,又仔细对了一下,时序是周建给出的那个时序。这个我希望重新CHECK一下。
3.后来测量了电源,时钟发现都没有问题。
4.如果时序正常的情况下,芯片又不处于复位状态,供电和晶振都正常工作,请问为什么读写数据老是总线上的数据呢?
我是这样验证的
setp1: 对寄存器A写 0x6e
setp2: 对寄存器B写 0x17
setp3: 读寄存器A的值是0x17
setp4: 读寄存器B的值是0x17
用同样的writeb,readb函数对FPGA的寄存器进行读写setp1: 对寄存器A写 0x6e
setp2: 对寄存器B写 0x17
setp3: 读寄存器A的值是0x6e
setp4: 读寄存器B的值是0x17
Jian Zhou:
回复 zai Jonathan:
我看16c554的datasheet,reset信号应该是高有效,也就是先置低,然后置高1ms,然后再置低