mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			61 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 5783097bccf3911f56cd647ba82cd4e45d74e2e4 Mon Sep 17 00:00:00 2001
 | |
| From: Phil Elwell <phil@raspberrypi.com>
 | |
| Date: Thu, 23 Feb 2023 09:33:52 +0000
 | |
| Subject: [PATCH] Revert "amba_pl011: Round input clock up"
 | |
| 
 | |
| This reverts commit 947ba6e85ea973b53e2f8d6860b191c0257e04fb.
 | |
| 
 | |
| Since [1], the clock driver has automatically rounded up the
 | |
| UART clock frequency, so this patch is no longer needed.
 | |
| 
 | |
| [1] f690a4d7a8f6 ("clk: bcm2835: Round UART input clock up")
 | |
| 
 | |
| Signed-off-by: Phil Elwell <phil@raspberrypi.com>
 | |
| ---
 | |
|  drivers/tty/serial/amba-pl011.c | 21 ++-------------------
 | |
|  1 file changed, 2 insertions(+), 19 deletions(-)
 | |
| 
 | |
| --- a/drivers/tty/serial/amba-pl011.c
 | |
| +++ b/drivers/tty/serial/amba-pl011.c
 | |
| @@ -1730,23 +1730,6 @@ static void pl011_put_poll_char(struct u
 | |
|  
 | |
|  #endif /* CONFIG_CONSOLE_POLL */
 | |
|  
 | |
| -unsigned long pl011_clk_round(unsigned long clk)
 | |
| -{
 | |
| -	unsigned long scaler;
 | |
| -
 | |
| -	/*
 | |
| -	 * If increasing a clock by less than 0.1% changes it
 | |
| -	 * from ..999.. to ..000.., round up.
 | |
| -	 */
 | |
| -	scaler = 1;
 | |
| -	while (scaler * 100000 < clk)
 | |
| -		scaler *= 10;
 | |
| -	if ((clk + scaler - 1)/scaler % 1000 == 0)
 | |
| -		clk = (clk/scaler + 1) * scaler;
 | |
| -
 | |
| -	return clk;
 | |
| -}
 | |
| -
 | |
|  static int pl011_hwinit(struct uart_port *port)
 | |
|  {
 | |
|  	struct uart_amba_port *uap =
 | |
| @@ -1763,7 +1746,7 @@ static int pl011_hwinit(struct uart_port
 | |
|  	if (retval)
 | |
|  		return retval;
 | |
|  
 | |
| -	uap->port.uartclk = pl011_clk_round(clk_get_rate(uap->clk));
 | |
| +	uap->port.uartclk = clk_get_rate(uap->clk);
 | |
|  
 | |
|  	/* Clear pending error and receive interrupts */
 | |
|  	pl011_write(UART011_OEIS | UART011_BEIS | UART011_PEIS |
 | |
| @@ -2454,7 +2437,7 @@ static int pl011_console_setup(struct co
 | |
|  			plat->init();
 | |
|  	}
 | |
|  
 | |
| -	uap->port.uartclk = pl011_clk_round(clk_get_rate(uap->clk));
 | |
| +	uap->port.uartclk = clk_get_rate(uap->clk);
 | |
|  
 | |
|  	if (uap->vendor->fixed_options) {
 | |
|  		baud = uap->fixed_baud;
 |