aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r--arch/arm/mach-omap2/serial.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 32e91a9c8b6b..1ac361b7b8cb 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -486,7 +486,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
486 mod_timer(&uart->timer, jiffies + uart->timeout); 486 mod_timer(&uart->timer, jiffies + uart->timeout);
487 omap_uart_smart_idle_enable(uart, 0); 487 omap_uart_smart_idle_enable(uart, 0);
488 488
489 if (cpu_is_omap34xx()) { 489 if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
490 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; 490 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
491 u32 wk_mask = 0; 491 u32 wk_mask = 0;
492 u32 padconf = 0; 492 u32 padconf = 0;
@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value)
655} 655}
656#endif 656#endif
657 657
658void __init omap_serial_early_init(void) 658static int __init omap_serial_early_init(void)
659{ 659{
660 int i = 0; 660 int i = 0;
661 661
@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void)
672 672
673 uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); 673 uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL);
674 if (WARN_ON(!uart)) 674 if (WARN_ON(!uart))
675 return; 675 return -ENODEV;
676 676
677 uart->oh = oh; 677 uart->oh = oh;
678 uart->num = i++; 678 uart->num = i++;
@@ -680,7 +680,7 @@ void __init omap_serial_early_init(void)
680 num_uarts++; 680 num_uarts++;
681 681
682 /* 682 /*
683 * NOTE: omap_hwmod_init() has not yet been called, 683 * NOTE: omap_hwmod_setup*() has not yet been called,
684 * so no hwmod functions will work yet. 684 * so no hwmod functions will work yet.
685 */ 685 */
686 686
@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void)
691 */ 691 */
692 uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; 692 uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET;
693 } while (1); 693 } while (1);
694
695 return 0;
694} 696}
697core_initcall(omap_serial_early_init);
695 698
696/** 699/**
697 * omap_serial_init_port() - initialize single serial port 700 * omap_serial_init_port() - initialize single serial port
@@ -759,13 +762,13 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
759 p->private_data = uart; 762 p->private_data = uart;
760 763
761 /* 764 /*
762 * omap44xx: Never read empty UART fifo 765 * omap44xx, ti816x: Never read empty UART fifo
763 * omap3xxx: Never read empty UART fifo on UARTs 766 * omap3xxx: Never read empty UART fifo on UARTs
764 * with IP rev >=0x52 767 * with IP rev >=0x52
765 */ 768 */
766 uart->regshift = p->regshift; 769 uart->regshift = p->regshift;
767 uart->membase = p->membase; 770 uart->membase = p->membase;
768 if (cpu_is_omap44xx()) 771 if (cpu_is_omap44xx() || cpu_is_ti816x())
769 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; 772 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
770 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF) 773 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
771 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) 774 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
@@ -847,7 +850,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
847 } 850 }
848 851
849 /* Enable the MDR1 errata for OMAP3 */ 852 /* Enable the MDR1 errata for OMAP3 */
850 if (cpu_is_omap34xx()) 853 if (cpu_is_omap34xx() && !cpu_is_ti816x())
851 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; 854 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS;
852} 855}
853 856