Ticket #1595: uboot-gta02-terminal.patch

File uboot-gta02-terminal.patch, 2.2 KB (added by laforge, 9 years ago)

patch to fix 'terminal s3ser0' on GTA02

  • common/cmd_terminal.c

    diff --git a/common/cmd_terminal.c b/common/cmd_terminal.c
    index 762c3ea..882cefa 100644
    a b  
    2727#include <common.h> 
    2828#include <command.h> 
    2929#include <devices.h> 
     30#include <serial.h> 
    3031 
    3132#if defined(CONFIG_CMD_TERMINAL) 
    3233 
     34static void init_serial_by_name(char *name) 
     35{ 
     36        struct serial_device *ser; 
     37        for (ser = serial_devices; ser; ser = ser->next) { 
     38                if (!strcmp(ser->name, name)) { 
     39                        ser->init(); 
     40                        return; 
     41                } 
     42        } 
     43} 
     44 
    3345int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[]) 
    3446{ 
    3547        int i, l; 
    int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[]) 
    5870                neo1973_gta01_serial0_gsm(1); 
    5971#endif 
    6072 
     73        init_serial_by_name(dev->name); 
    6174        //serial_reinit_all(); 
    6275        printf("Entering terminal mode for port %s\n", dev->name); 
    6376        puts("Use '~.' to leave the terminal and get back to u-boot\n"); 
  • common/serial.c

    diff --git a/common/serial.c b/common/serial.c
    index dbf0a86..efda612 100644
    a b DECLARE_GLOBAL_DATA_PTR; 
    2929 
    3030#if defined(CONFIG_SERIAL_MULTI) 
    3131 
    32 static struct serial_device *serial_devices = NULL; 
     32struct serial_device *serial_devices = NULL; 
    3333static struct serial_device *serial_current = NULL; 
    3434 
    3535#if !defined(CONFIG_LWMON) && !defined(CONFIG_PXA27X) 
  • cpu/arm920t/s3c24x0/serial.c

    diff --git a/cpu/arm920t/s3c24x0/serial.c b/cpu/arm920t/s3c24x0/serial.c
    index ba60ad1..032390e 100644
    a b static int serial_init_dev(const int dev_index) 
    132132#endif 
    133133 
    134134        /* FIXME: This is sooooooooooooooooooo ugly */ 
    135 #if defined(CONFIG_ARCH_GTA02_v1) || defined(CONFIG_ARCH_GTA02_v2) 
     135#include <config.h> 
     136#if defined(CONFIG_GTA02_REVISION) 
    136137        /* we need auto hw flow control on the gsm and gps port */ 
    137138        if (dev_index == 0 || dev_index == 1) 
    138139                uart->UMCON = 0x10; 
  • include/serial.h

    diff --git a/include/serial.h b/include/serial.h
    index 043410c..926c63e 100644
    a b extern void serial_devices_init(void); 
    5252extern int serial_assign(char * name); 
    5353extern void serial_reinit_all(void); 
    5454 
     55#if defined(CONFIG_SERIAL_MULTI) 
     56extern struct serial_device *serial_devices; 
     57#endif /* CONFIG_SERIAL_MULTI */ 
     58 
    5559#endif