Hi Boris, I recently upgraded my kernel from 2.6.15 to 2.6.17 on a 8247 based custom board (8247 has a CPM2 and is similar to the 8260). I use SMC2 as a serial port, and I had a couple of problems when I started using 2.6.17. I think initially I was seeing the same behaviour as you (serial port only worked when it was defined as the console).
The "compat mode" message you are seeing is part of the new CPM UART 0.02 driver (refer to http://patchwork.ozlabs.org/linuxppc/patch?id=5149 and related patches). If there are no UART platform devices added in your board specific code, then you will see this message. To make the compat mode work properly with the new driver I made a couple of changes (see attached cpm2_uart_noplatform.diff). The changes are to drivers/serial/cpm_uart/cpm_uart_core.c: 1) Added a call to pinfo->set_lineif in cpm_uart_request_port This code is required to set up the port pins and BRG for the UART. This was in the old version of the driver and I added it back. As far as I can tell, this chunk of code is what makes the serial port work properly when it is not the console (in compat mode). To make this properly compatible with the platform stuff, this call should not be made if the device has platform data, but I'm not exactly sure how to add that check in a clean way. 2) Added a call to cpm_uart_init_portdesc in cpm_uart_console_init This was another snippet that was in the previous version of the driver. I don't recall exactly what behaviour this fixed, but I think it made things better. Again this may not work properly if the device has platform data. I did try defining a platform device for the UART in my board specific file (similar to what is done in arch/ppc/platforms/mpc8272ads_setup.c), but I ran into a couple of problems here too. The main problem is that arch/ppc/syslib/pq2_devices.c needs a small change to the naming of things for the SMCs (see attached cpm2_smc_resource_rename.diff). That made things work better, but not 100%. I decided to go back to compat mode, because with the fixes outlined above it was working fine for me. - Hope this helps, David Pelton -----Original Message----- Sent: Monday, August 14, 2006 6:26 PM To: linuxppc-embedded at ozlabs.org Subject: 8260 SMC1 and SMC2 serial port problems Hi guys. I am working on the Linux port on a custom 8260-based board. During the port I've encountered a few problems with serial ports. 1. On the latest kernel 2.6.17 the cpm2 serial driver fails during the bus scan and fails back to so called compat mode. 2. For whatever strange reason, the driver is unable to initialize serial port, if the console on SMC is not selected. 3. I am unable to work with both SMC1 and SMC2 together. During driver init, only one port actually gets an IRQ. In another words, if I enable both SMC1 and SMC2 in the kernel config. and put console on ttyCPM0, then SMC1 gets IRQ, but SMC2 doesn't. dmesg actually prints IRQs for both ports, but looking into /proc/irq reveals, that only one interrupt is assigned only for port that is used as a console. 2) and 3) relate for both 2.6.17 and 2.6.16 kernel trees Could someone, please, advise me, on possible solutions for those problems ? Thanks in advance, Boris _______________________________________________ Linuxppc-embedded mailing list Linuxppc-embedded at ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded -------------- next part -------------- A non-text attachment was scrubbed... Name: cpm2_smc_resource_rename.diff Type: application/octet-stream Size: 901 bytes Desc: cpm2_smc_resource_rename.diff Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060816/e0d85cd6/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: cpm2_uart_noplatform.diff Type: application/octet-stream Size: 881 bytes Desc: cpm2_uart_noplatform.diff Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060816/e0d85cd6/attachment-0001.obj
