dreambox: update 2.6.18 base kernel patch, smaller and faster kernel, dm800se use...
[openembedded.git] / recipes / linux / linux-dm800se-2.6.18 / linux-2.6.18-fix-serial.patch
1 --- linux-2.6.18-org/drivers/serial/8250.c      2010-03-19 19:12:10.000000000 +0100
2 +++ linux-2.6.18/drivers/serial/8250.c  2010-03-19 19:34:54.000000000 +0100
3 @@ -1871,8 +1871,20 @@
4         /*
5          * Ask the core to calculate the divisor for us.
6          */
7 -       baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); 
8 -       quot = serial8250_get_divisor(port, baud);
9 +
10 +#ifdef CONFIG_MIPS_BCM7405
11 +       if (up->port.irq != 22)
12 +#endif
13 +       {
14 +               baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
15 +               quot = serial8250_get_divisor(port, baud);
16 +       }
17 +#ifdef CONFIG_MIPS_BCM7405
18 +       else {
19 +               quot = 5;
20 +               baud = 1000000;
21 +       }
22 +#endif
23  
24         /*
25          * Oxford Semi 952 rev B workaround
26 --- a/arch/mips/brcmstb/brcm97405d0/bcm_uart.c
27 +++ b/arch/mips/brcmstb/brcm97405d0/bcm_uart.c
28 @@ -115,20 +115,18 @@ unsigned long serial_init(int chan, void *ignored)
29         shift = 2;
30  
31  
32 -#if 1 /* Enable UARTB */
33 -if (chan == 1) {
34 -// MUX for UARTB is: RX: ctrl3: bit 29:27 (001'b) and TX: ctrl4: bit 02:00 (001'b)
35 -
36 +#if 1 /* Enable UARTC */
37 +if (chan == 2) {
38  #define SUN_TOP_CTRL_PIN_MUX_CTRL_3    (0xb040410c)
39         volatile unsigned long* pSunTopMuxCtrl3 = (volatile unsigned long*) SUN_TOP_CTRL_PIN_MUX_CTRL_3;
40 -#define SUN_TOP_CTRL_PIN_MUX_CTRL_4    (0xb0404110)
41 -       volatile unsigned long* pSunTopMuxCtrl4 = (volatile unsigned long*) SUN_TOP_CTRL_PIN_MUX_CTRL_4;
42 +#define SUN_TOP_CTRL_PIN_MUX_CTRL_9    (0xb0404124)
43 +       volatile unsigned long* pSunTopMuxCtrl9 = (volatile unsigned long*) SUN_TOP_CTRL_PIN_MUX_CTRL_9;
44         
45 -       *pSunTopMuxCtrl3 &= 0xc7ffffff; // Clear it
46 -       *pSunTopMuxCtrl3 |= 0x08000000;  // Write 001'b at 27:29
47 +       *pSunTopMuxCtrl3 &= 0xf81fffff; // Clear it
48 +       *pSunTopMuxCtrl3 |= 0x02400000;  // Write 010'b at 21:23, 010'b at 24:26
49  
50 -       *pSunTopMuxCtrl4 &= 0xfffffff8; // Clear it
51 -       *pSunTopMuxCtrl4 |= 0x00000001;  // Write 001'b  at 00:02
52 +       *pSunTopMuxCtrl9 &= 0xf03fffff; // Clear it
53 +       *pSunTopMuxCtrl9 |= 0x09000000;  // Write 100'b at 25:27, 100'b at 22:24
54  }
55  #endif
56  
57 @@ -147,7 +145,7 @@ if (chan == 1) {
58                 writel(0, (void *)(uartBaseAddr + (UART_FCR << shift)));
59  
60                 if (chan == 1) {
61 -                       uartB_puts("Done initializing UARTB\n");
62 +                       uartB_puts("Done initializing UARTC\n");
63                 }
64         }
65         return (uartBaseAddr);
66 @@ -211,7 +209,7 @@ void
67  //PutChar(char c)
68  uartB_putc(char c)
69  {
70 -    serial_putc(UARTB_ADR_BASE, c);
71 +    serial_putc(UARTC_ADR_BASE, c);
72  }
73  /* --------------------------------------------------------------------------
74      Name: PutString
75 @@ -253,7 +251,7 @@ uart_getc(void)
76  char
77  uartB_getc(void)
78  {
79 -       return serial_getc(UARTB_ADR_BASE);
80 +       return serial_getc(UARTC_ADR_BASE);
81  }
82  
83  
84 @@ -277,8 +275,7 @@ void
85  uart_init(unsigned long ignored)
86  {
87         serial_init(0, NULL);
88 -       serial_init(1, NULL);           /* Uart B */
89 -       //serial_init(2, NULL);         /* Uart C */
90 +       //serial_init(1, NULL);         /* Uart B */
91 +       serial_init(2, NULL);           /* Uart C */
92         //console_initialized = 1;
93  }
94 -
95 --- a/include/asm-mips/serial.h
96 +++ b/include/asm-mips/serial.h
97 @@ -123,7 +123,6 @@
98  /* 3 16550A compatible UARTs */
99  #define BRCM_UART_PORT_DEFNS                           \
100         _BRCM_16550_INIT(BRCM_SERIAL1_IRQ, BRCM_SERIAL1_BASE),          \
101 -       _BRCM_16550_INIT(BRCM_SERIAL2_IRQ, BRCM_SERIAL2_BASE),      \
102         _BRCM_16550_INIT(BRCM_SERIAL3_IRQ, BRCM_SERIAL3_BASE),  
103  #endif  //end SIM
104