Re: [PATCH V2 4/9] arch: mips: ralink: add tty detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/05/2015 05:27 PM, John Crispin wrote:

MT7688 has several uarts that can be used for console. There are several
boards in the wild, that use ttyS1 or ttyS2. This patch applies a simply
autodetection routine to figure out which ttyS the bootloader used as
console. The uarts come up in 6 bit mode by default. The bootloader will
have set 8 bit mode on the console. Find that 8bit tty and use it.

Signed-off-by: John Crispin <blogic@xxxxxxxxxxx>
---
Changes in V2:
* remove superflous inline definition

   arch/mips/ralink/early_printk.c |   26 ++++++++++++++++++++++++++
   1 file changed, 26 insertions(+)

diff --git a/arch/mips/ralink/early_printk.c
b/arch/mips/ralink/early_printk.c
index 255d695..3c59ffe 100644
--- a/arch/mips/ralink/early_printk.c
+++ b/arch/mips/ralink/early_printk.c
[...]
@@ -47,8 +49,32 @@ static inline int soc_is_mt7628(void)
           (__raw_readl(chipid_membase) == MT7628_CHIP_NAME1);
   }

+static void find_uart_base(void)
+{
+    int i;
+
+    if (!soc_is_mt7628())
+        return;
+
+    for (i = 0; i < 3; i++) {
+        u32 reg = uart_r32(UART_REG_LCR + (0x100 * i));

    Inner parens not needed, the operator precedence is natural.


"not needed" means "should be removed" or "not needed".

   That's completely up to you.

checkpatch.pl certainly did not complain and a quick look around
instantly yielded lots of places in the kernel where this is done. imho
the brackets make it more readable

Do you really always write 2 + (3 * 4) when you e.g. use scientific calculator?

[...]

MBR, Sergei





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux