Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'v2630-rc3-fixes' of git://aeryn.fluff.org.uk/bjdooks/linux

authored by

Russell King and committed by
Russell King
bc75159f b4348f32

+68 -3
+3
arch/arm/mach-s3c2412/pm.c
··· 21 21 #include <linux/io.h> 22 22 23 23 #include <mach/hardware.h> 24 + #include <asm/cacheflush.h> 24 25 #include <asm/irq.h> 25 26 26 27 #include <mach/regs-power.h> ··· 39 38 static void s3c2412_cpu_suspend(void) 40 39 { 41 40 unsigned long tmp; 41 + 42 + flush_cache_all(); 42 43 43 44 /* set our standby method to sleep */ 44 45
+2
arch/arm/mach-s3c6400/include/mach/map.h
··· 40 40 41 41 #define S3C64XX_PA_FB (0x77100000) 42 42 #define S3C64XX_PA_SYSCON (0x7E00F000) 43 + #define S3C64XX_PA_IIS0 (0x7F002000) 44 + #define S3C64XX_PA_IIS1 (0x7F003000) 43 45 #define S3C64XX_PA_TIMER (0x7F006000) 44 46 #define S3C64XX_PA_IIC0 (0x7F004000) 45 47 #define S3C64XX_PA_IIC1 (0x7F00F000)
+1
drivers/serial/s3c6400.c
··· 102 102 .name = "Samsung S3C6400 UART", 103 103 .type = PORT_S3C6400, 104 104 .fifosize = 64, 105 + .has_divslot = 1, 105 106 .rx_fifomask = S3C2440_UFSTAT_RXMASK, 106 107 .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 107 108 .rx_fifofull = S3C2440_UFSTAT_RXFULL,
+58 -3
drivers/serial/samsung.c
··· 508 508 struct baud_calc { 509 509 struct s3c24xx_uart_clksrc *clksrc; 510 510 unsigned int calc; 511 + unsigned int divslot; 511 512 unsigned int quot; 512 513 struct clk *src; 513 514 }; ··· 518 517 struct s3c24xx_uart_clksrc *clksrc, 519 518 unsigned int baud) 520 519 { 520 + struct s3c24xx_uart_port *ourport = to_ourport(port); 521 521 unsigned long rate; 522 522 523 523 calc->src = clk_get(port->dev, clksrc->name); ··· 529 527 rate /= clksrc->divisor; 530 528 531 529 calc->clksrc = clksrc; 532 - calc->quot = (rate + (8 * baud)) / (16 * baud); 533 - calc->calc = (rate / (calc->quot * 16)); 530 + 531 + if (ourport->info->has_divslot) { 532 + unsigned long div = rate / baud; 533 + 534 + /* The UDIVSLOT register on the newer UARTs allows us to 535 + * get a divisor adjustment of 1/16th on the baud clock. 536 + * 537 + * We don't keep the UDIVSLOT value (the 16ths we calculated 538 + * by not multiplying the baud by 16) as it is easy enough 539 + * to recalculate. 540 + */ 541 + 542 + calc->quot = div / 16; 543 + calc->calc = rate / div; 544 + } else { 545 + calc->quot = (rate + (8 * baud)) / (16 * baud); 546 + calc->calc = (rate / (calc->quot * 16)); 547 + } 534 548 535 549 calc->quot--; 536 550 return 1; ··· 629 611 return best->quot; 630 612 } 631 613 614 + /* udivslot_table[] 615 + * 616 + * This table takes the fractional value of the baud divisor and gives 617 + * the recommended setting for the UDIVSLOT register. 618 + */ 619 + static u16 udivslot_table[16] = { 620 + [0] = 0x0000, 621 + [1] = 0x0080, 622 + [2] = 0x0808, 623 + [3] = 0x0888, 624 + [4] = 0x2222, 625 + [5] = 0x4924, 626 + [6] = 0x4A52, 627 + [7] = 0x54AA, 628 + [8] = 0x5555, 629 + [9] = 0xD555, 630 + [10] = 0xD5D5, 631 + [11] = 0xDDD5, 632 + [12] = 0xDDDD, 633 + [13] = 0xDFDD, 634 + [14] = 0xDFDF, 635 + [15] = 0xFFDF, 636 + }; 637 + 632 638 static void s3c24xx_serial_set_termios(struct uart_port *port, 633 639 struct ktermios *termios, 634 640 struct ktermios *old) ··· 665 623 unsigned int baud, quot; 666 624 unsigned int ulcon; 667 625 unsigned int umcon; 626 + unsigned int udivslot = 0; 668 627 669 628 /* 670 629 * We don't support modem control lines. ··· 687 644 /* check to see if we need to change clock source */ 688 645 689 646 if (ourport->clksrc != clksrc || ourport->baudclk != clk) { 647 + dbg("selecting clock %p\n", clk); 690 648 s3c24xx_serial_setsource(port, clksrc); 691 649 692 650 if (ourport->baudclk != NULL && !IS_ERR(ourport->baudclk)) { ··· 700 656 ourport->clksrc = clksrc; 701 657 ourport->baudclk = clk; 702 658 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0; 659 + } 660 + 661 + if (ourport->info->has_divslot) { 662 + unsigned int div = ourport->baudclk_rate / baud; 663 + 664 + udivslot = udivslot_table[div & 15]; 665 + dbg("udivslot = %04x (div %d)\n", udivslot, div & 15); 703 666 } 704 667 705 668 switch (termios->c_cflag & CSIZE) { ··· 748 697 749 698 spin_lock_irqsave(&port->lock, flags); 750 699 751 - dbg("setting ulcon to %08x, brddiv to %d\n", ulcon, quot); 700 + dbg("setting ulcon to %08x, brddiv to %d, udivslot %08x\n", 701 + ulcon, quot, udivslot); 752 702 753 703 wr_regl(port, S3C2410_ULCON, ulcon); 754 704 wr_regl(port, S3C2410_UBRDIV, quot); 755 705 wr_regl(port, S3C2410_UMCON, umcon); 706 + 707 + if (ourport->info->has_divslot) 708 + wr_regl(port, S3C2443_DIVSLOT, udivslot); 756 709 757 710 dbg("uart: ulcon = 0x%08x, ucon = 0x%08x, ufcon = 0x%08x\n", 758 711 rd_regl(port, S3C2410_ULCON),
+4
drivers/serial/samsung.h
··· 21 21 unsigned long tx_fifoshift; 22 22 unsigned long tx_fifofull; 23 23 24 + /* uart port features */ 25 + 26 + unsigned int has_divslot:1; 27 + 24 28 /* clock source control */ 25 29 26 30 int (*get_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk);