patch-2.1.124 linux/arch/ppc/boot/mbxtty.c

Next file: linux/arch/ppc/boot/misc.c
Previous file: linux/arch/ppc/boot/head.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.123/linux/arch/ppc/boot/mbxtty.c linux/arch/ppc/boot/mbxtty.c
@@ -12,14 +12,22 @@
  * I f**ked around for a day trying to figure out how to make EPPC-Bug
  * use SMC1, but gave up and decided to fix it here.
  */
+#include <linux/config.h>
 #include <linux/types.h>
+#ifdef CONFIG_MBX
 #include <asm/mbx.h>
+#endif
+#ifdef CONFIG_FADS
+#include <asm/fads.h>
+#endif
 #include "../8xx_io/commproc.h"
 
+#ifdef CONFIG_MBX
 #define MBX_CSR1	((volatile u_char *)0xfa100000)
 #define CSR1_COMEN	(u_char)0x02
+#endif
 
-static cpm8xx_t	*cpmp = (cpm8xx_t *)&(((immap_t *)MBX_IMAP_ADDR)->im_cpm);
+static cpm8xx_t	*cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm);
 
 void
 serial_init(bd_t *bd)
@@ -38,6 +46,7 @@
 	*/
 	sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
 
+#ifdef CONFIG_MBX
 	if (*MBX_CSR1 & CSR1_COMEN) {
 		/* COM1 is enabled.  Initialize SMC1 and use it for
 		 * the console port.
@@ -45,7 +54,7 @@
 
 		/* Enable SDMA.
 		*/
-		((immap_t *)MBX_IMAP_ADDR)->im_siu_conf.sc_sdcr = 1;
+		((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1;
 
 		/* Use Port B for SMCs instead of other functions.
 		*/
@@ -103,6 +112,7 @@
 		*MBX_CSR1 &= ~CSR1_COMEN;
 	}
 	else {
+#endif
 		/* SMC1 is used as console port.
 		*/
 		tbdf = (cbd_t *)&cp->cp_dpmem[up->smc_tbase];
@@ -113,7 +123,9 @@
 		cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC1,
 					CPM_CR_STOP_TX) | CPM_CR_FLG;
 		while (cp->cp_cpcr & CPM_CR_FLG);
+#ifdef CONFIG_MBX
 	}
+#endif
 
 	/* Make the first buffer the only buffer.
 	*/

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov