]> git.sur5r.net Git - u-boot/commitdiff
ARMV7: S5P: serial: support the s5pc210
authorMinkyu Kang <mk7.kang@samsung.com>
Tue, 28 Sep 2010 05:35:02 +0000 (14:35 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 19 Oct 2010 02:35:29 +0000 (11:35 +0900)
This patch is for s5pc210 support.
Due to the resigter of baudrate is changed from slot to value,
add both of them to uart structure.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
arch/arm/include/asm/arch-s5pc1xx/uart.h
drivers/serial/serial_s5p.c

index 2d7ad7ec987ff1f7f900c7ba5a052eae72b50ce9..f6eeab45cdc23f4fe7da73226b72f80f52d37ff5 100644 (file)
 #define __ASM_ARCH_UART_H_
 
 #ifndef __ASSEMBLY__
+/* baudrate rest value */
+union br_rest {
+       unsigned short  slot;           /* udivslot */
+       unsigned char   value;          /* ufracval */
+};
+
 struct s5p_uart {
        unsigned int    ulcon;
        unsigned int    ucon;
@@ -38,10 +44,12 @@ struct s5p_uart {
        unsigned char   urxh;
        unsigned char   res2[3];
        unsigned int    ubrdiv;
-       unsigned short  udivslot;
-       unsigned char   res3[2];
-       unsigned char   res4[0x3d0];
+       union br_rest   rest;
+       unsigned char   res3[0x3d0];
 };
+
+static int use_divslot = 1;
+
 #endif /* __ASSEMBLY__ */
 
 #endif
index 77096643f1f87a01eebab57727926bf5f42eea77..36333c3d49a78d9292c8a82d8c049be679b006cd 100644 (file)
@@ -70,7 +70,11 @@ void serial_setbrg_dev(const int dev_index)
        val = uclk / baudrate;
 
        writel(val / 16 - 1, &uart->ubrdiv);
-       writew(udivslot[val % 16], &uart->udivslot);
+
+       if (use_divslot)
+               writew(udivslot[val % 16], &uart->rest.slot);
+       else
+               writeb(val % 16, &uart->rest.value);
 }
 
 /*