@@ -550,6 +550,7 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port)
550550 case TYPE_APPLE_S5L :
551551 s3c24xx_clear_bit (port , APPLE_S5L_UCON_RXTHRESH_ENA , S3C2410_UCON );
552552 s3c24xx_clear_bit (port , APPLE_S5L_UCON_RXTO_ENA , S3C2410_UCON );
553+ s3c24xx_clear_bit (port , APPLE_S5L_UCON_RXTO_LEGACY_ENA , S3C2410_UCON );
553554 break ;
554555 default :
555556 disable_irq_nosync (ourport -> rx_irq );
@@ -968,9 +969,11 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id)
968969 u32 pend = rd_regl (port , S3C2410_UTRSTAT );
969970 irqreturn_t ret = IRQ_NONE ;
970971
971- if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO )) {
972+ if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO |
973+ APPLE_S5L_UTRSTAT_RXTO_LEGACY )) {
972974 wr_regl (port , S3C2410_UTRSTAT ,
973- APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO );
975+ APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO |
976+ APPLE_S5L_UTRSTAT_RXTO_LEGACY );
974977 ret = s3c24xx_serial_rx_irq (irq , id );
975978 }
976979 if (pend & APPLE_S5L_UTRSTAT_TXTHRESH ) {
@@ -1195,7 +1198,8 @@ static void apple_s5l_serial_shutdown(struct uart_port *port)
11951198 ucon = rd_regl (port , S3C2410_UCON );
11961199 ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
11971200 APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
1198- APPLE_S5L_UCON_RXTO_ENA_MSK );
1201+ APPLE_S5L_UCON_RXTO_ENA_MSK |
1202+ APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK );
11991203 wr_regl (port , S3C2410_UCON , ucon );
12001204
12011205 wr_regl (port , S3C2410_UTRSTAT , APPLE_S5L_UTRSTAT_ALL_FLAGS );
@@ -1292,6 +1296,7 @@ static int apple_s5l_serial_startup(struct uart_port *port)
12921296 /* Enable Rx Interrupt */
12931297 s3c24xx_set_bit (port , APPLE_S5L_UCON_RXTHRESH_ENA , S3C2410_UCON );
12941298 s3c24xx_set_bit (port , APPLE_S5L_UCON_RXTO_ENA , S3C2410_UCON );
1299+ s3c24xx_set_bit (port , APPLE_S5L_UCON_RXTO_LEGACY_ENA , S3C2410_UCON );
12951300
12961301 return ret ;
12971302}
@@ -2148,13 +2153,15 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
21482153
21492154 ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
21502155 APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
2151- APPLE_S5L_UCON_RXTO_ENA_MSK );
2156+ APPLE_S5L_UCON_RXTO_ENA_MSK |
2157+ APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK );
21522158
21532159 if (ourport -> tx_enabled )
21542160 ucon |= APPLE_S5L_UCON_TXTHRESH_ENA_MSK ;
21552161 if (ourport -> rx_enabled )
21562162 ucon |= APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
2157- APPLE_S5L_UCON_RXTO_ENA_MSK ;
2163+ APPLE_S5L_UCON_RXTO_ENA_MSK |
2164+ APPLE_S5L_UCON_RXTO_LEGACY_ENA_MSK ;
21582165
21592166 wr_regl (port , S3C2410_UCON , ucon );
21602167
@@ -2541,7 +2548,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
25412548 .name = "Apple S5L UART" ,
25422549 .type = TYPE_APPLE_S5L ,
25432550 .port_type = PORT_8250 ,
2544- .iotype = UPIO_MEM ,
2551+ .iotype = UPIO_MEM32 ,
25452552 .fifosize = 16 ,
25462553 .rx_fifomask = S3C2410_UFSTAT_RXMASK ,
25472554 .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT ,
@@ -2827,6 +2834,9 @@ OF_EARLYCON_DECLARE(gs101, "google,gs101-uart", gs101_early_console_setup);
28272834static int __init apple_s5l_early_console_setup (struct earlycon_device * device ,
28282835 const char * opt )
28292836{
2837+ /* Apple A7-A11 requires MMIO32 register accesses. */
2838+ device -> port .iotype = UPIO_MEM32 ;
2839+
28302840 /* Close enough to S3C2410 for earlycon... */
28312841 device -> port .private_data = & s3c2410_early_console_data ;
28322842
0 commit comments