Skip to contentSkip to conversation

cpm_uart: Make non-console uart work (rev 1)

PATCH In review Vitaly Bordug 2 participants 2 messages Aug 4, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpm_uart: Make non-console uart work (rev 1)

Kumar, Pantelis,

This patch makes non-console UART work on both 8xx and 82xx. dpram allocation fix by Pantelis included, almost all mentioned issues fixed.

Tested on 8272ADS development board, but as far as there are no major modifications comparing to previous revision (excluding Pantelis change which has been tested independently), 8xx should work as well.
---------------------------------

Signature · 2 lines
Sincerely,
Vitaly
drivers/serial/cpm_uart/cpm_uart.h +4 -0
@@ -40,6 +40,8 @@
 #define TX_NUM_FIFO	4
 #define TX_BUF_SIZE	32
 
+#define SCC_WAIT_CLOSING 100
+
 struct uart_cpm_port {
 	struct uart_port	port;
 	u16			rx_nrfifos;	
@@ -67,6 +69,8 @@ struct uart_cpm_port {
 	int			 bits;
 	/* Keep track of 'odd' SMC2 wirings */
 	int			is_portb;
+	/* wait on close if needed */
+	int 			wait_closing;
 };
 
 extern int cpm_uart_port_map[UART_NR];
drivers/serial/cpm_uart/cpm_uart_core.c +61 -14

240 lines not on this page · raw message

drivers/serial/cpm_uart/cpm_uart_cpm1.c +23 -23

70 lines not on this page · raw message

#1 lore raw
Quoted 11 lines · Vitaly Bordug

Kumar, Pantelis,

This patch makes non-console UART work on both 8xx and 82xx. dpram allocation fix by Pantelis included, almost all mentioned issues fixed.

Tested on 8272ADS development board, but as far as there are no major modifications comparing to previous revision (excluding Pantelis change which has been tested independently), 8xx should work as well.
---------------------------------

Hi all,

Please apply the following patch over the previous one.

It's minor cosmetic & warning fixes.

Regards

Pantelis

drivers/serial/cpm_uart/cpm_uart_core.c +4 -9
@@ -261,7 +261,7 @@
 		}
 
 		/* get pointer */
-		cp = (unsigned char *)cpm2cpu_addr(bdp->cbd_bufaddr);
+		cp = cpm2cpu_addr(bdp->cbd_bufaddr);
 
 		/* loop through the buffer */
 		while (i-- > 0) {
@@ -606,6 +606,7 @@
 		bdp = pinfo->tx_cur;
 
 		p = cpm2cpu_addr(bdp->cbd_bufaddr);
+
 		*p++ = xmit->buf[xmit->tail];
 		bdp->cbd_datlen = 1;
 		bdp->cbd_sc |= BD_SC_READY;
@@ -1030,10 +1031,7 @@
 		 * If the buffer address is in the CPM DPRAM, don't
 		 * convert it.
 		 */
-		if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR)
-			cp = (unsigned char *) (bdp->cbd_bufaddr);
-		else
-			cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+		cp = cpm2cpu_addr(bdp->cbd_bufaddr);
 		
 		*cp = *s;
 
@@ -1050,10 +1048,7 @@
 			while ((bdp->cbd_sc & BD_SC_READY) != 0)
 				;
 
-			if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR)
-				cp = (unsigned char *) (bdp->cbd_bufaddr);
-			else
-				cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+			cp = cpm2cpu_addr(bdp->cbd_bufaddr);
 
 			*cp = 13;
 			bdp->cbd_datlen = 1;
drivers/serial/cpm_uart/cpm_uart_cpm1.c +5 -0
@@ -83,6 +83,7 @@
 {
 	volatile cpm8xx_t *cp = cpmp;
 
+	(void)cp;	/* fix warning */
 #if defined (CONFIG_MPC885ADS)
 	/* Enable SMC1 transceivers */
 	{
@@ -110,6 +111,8 @@
 void smc2_lineif(struct uart_cpm_port *pinfo)
 {
 	volatile cpm8xx_t *cp = cpmp;
+
+	(void)cp;	/* fix warning */
 #if defined (CONFIG_MPC885ADS)
 	cp->cp_pepar |= 0x00000c00;
 	cp->cp_pedir &= ~0x00000c00;
@@ -185,6 +188,8 @@
 	memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
 	    L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
 	if (is_con) {
+		/* was hostalloc but changed cause it blows away the */
+		/* large tlb mapping when pinning the kernel area    */
 		mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
 		dma_addr = 0;
 	} else