Patch: Disable console when GSM is enabled (GTA01 only)

Mike (mwester) mwester at dls.net
Thu May 15 05:32:25 CEST 2008


This patch disables console output while the GSM is active on the GTA01 only.

This is necessary despite the fact that the console is disabled when the GSM is 
enabled because the resume order causes a race condition that permits a burst of 
console text to be sent to the GSM upon resume, which usually fatally confuses 
the GSM and the user-space process managing the GSM.

This patch is _not_ suitable for upstream.

Signed-off-by: Mike Westerhof <mwester at dls.net>
---
--- git/drivers/serial/s3c2410.c.orig   2008-05-11 12:27:50.000000000 -0500
+++ git/drivers/serial/s3c2410.c        2008-05-11 17:03:04.000000000 -0500
@@ -1713,12 +1713,18 @@ s3c24xx_serial_console_txrdy(struct uart
         return (utrstat & S3C2410_UTRSTAT_TXE) ? 1 : 0;
  }

+extern int gta01_gsm_enabled;  /* set when the GTA01 turns on the GSM */
+
  static void
  s3c24xx_serial_console_putchar(struct uart_port *port, int ch)
  {
         unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON);
         unsigned int umcon = rd_regl(cons_uart, S3C2410_UMCON);

+       /* No console output if switched to the GSM device on the GTA01 */
+       if (gta01_gsm_enabled)
+               return;
+
         /* If auto HW flow control enabled, temporarily turn it off */
         if (umcon & S3C2410_UMCOM_AFC)
                 wr_regl(port, S3C2410_UMCON, (umcon & !S3C2410_UMCOM_AFC));
--- git/arch/arm/plat-s3c24xx/neo1973_pm_gsm.old 2008-05-11 12:28:06.000000000 -0500
+++ git/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c 2008-05-11 17:08:29.000000000 -0500
@@ -30,6 +37,9 @@
  #include <asm/arch/regs-gpioj.h>
  #endif

+int gta01_gsm_enabled = 0;
+EXPORT_SYMBOL(gta01_gsm_enabled);
+
  struct gta01pm_priv {
         int gpio_ngsm_en;
          int gpio_ndl_gsm;
@@ -97,6 +112,9 @@ static ssize_t gsm_write(struct device *
                         if (gta01_gsm.gpio_ngsm_en)
                                 s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 0);

+                       if (gta01_gsm.gpio_ngsm_en)
+                               gta01_gsm_enabled = 1;
+
                         switch (system_rev) {
  #ifdef CONFIG_MACH_NEO1973_GTA02
                         case GTA02v2_SYSTEM_REV:
@@ -130,6 +148,9 @@ static ssize_t gsm_write(struct device *
                         if (gta01_gsm.gpio_ngsm_en)
                                 s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 1);

+                       if (gta01_gsm.gpio_ngsm_en)
+                               gta01_gsm_enabled = 0;
+
                         if (gta01_gsm.con) {
                                 console_start(gta01_gsm.con);





More information about the openmoko-kernel mailing list