Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp113893ybj; Wed, 6 May 2020 12:53:09 -0700 (PDT) X-Google-Smtp-Source: APiQypLLOkyaZsXW/SgBohAvzihhQC32RRdb7Mgg0Naoepj0Nh+4e2MiZzewjBDUEH2kC9u0eujy X-Received: by 2002:a17:906:4907:: with SMTP id b7mr8335444ejq.279.1588794788949; Wed, 06 May 2020 12:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588794788; cv=none; d=google.com; s=arc-20160816; b=LLEC073V+bQaD5FLAVxsNPKzq1co+itEkXuLU2NtBsTy7J6y3Fh2QZnpuO9RKQXxak T4maST3CUZ6sFlpDOeHB+xtB3RzyVmOMFmzhm/cNWLVSuOi6eG+PHwrPjxDd3xhZMiOP eNb1lZBSELg9Rb7/NdhVnCeaf8Sxuedgg/Fnpy7AdjYzPLmo8CW24dQMkklpKi0XAljL l41aJpka4/D9fPaFQhJmZAlMVZHrnDmdUkT7/8Wfz3UXoUPMQv/Z8H0z90jYvYTXhdsX IPsjmA70nQkHTH5VAHYDLpEU6P3BxQwisS5jVvOSVGZyydH+Ekr6aB/P+BsxkBNYgpPv TDMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=++QVaU/idvjBb3wzlt5zvR6wSAhmE2H8PrYjUinZSYA=; b=kdfoHWU/O9e292DHQvQ82qri8Dgc4xyR7FqN0nJn/nb6xLjtKOKa9u1iPRhgmv93Z4 2qcR4mAeRGdc3HyNQ9/hvjhR/f0iBgZaAr3O7aXlTHcroX3LdE58ngAJcQwcEuyytNBa OzQZ5Ah+h3ApK/aHHte9dIWltASfk6BpBQzrLlf1f5qn5ISFcDLDrSEWbo34VNE/6E4L AU1SqzpNwryinQ1NNwyQjN5BeZpxawF6Nb1Vpli38IkAk6cpLrGqiWGG06kHGDRI5x1P 9/k64z5PMO9tD9o9+WnLJ7mBV7kre+9TsTXSMVd4Mho7pLglv+x/XVMVTDSzuk4TZzOk Gqvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si893930ejx.46.2020.05.06.12.52.45; Wed, 06 May 2020 12:53:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730381AbgEFRob (ORCPT + 99 others); Wed, 6 May 2020 13:44:31 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:32814 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730263AbgEFRoW (ORCPT ); Wed, 6 May 2020 13:44:22 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 948DE8000B81; Wed, 6 May 2020 17:44:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yB4vVyCw6pxE; Wed, 6 May 2020 20:44:19 +0300 (MSK) From: To: Thomas Bogendoerfer CC: Serge Semin , Serge Semin , Alexey Malahov , Paul Burton , Ralf Baechle , Arnd Bergmann , Rob Herring , , , Allison Randal , Greg Kroah-Hartman , Thomas Gleixner , , Subject: [PATCH v2 14/20] mips: Use offset-sized IO-mem accessors in CPS debug printout Date: Wed, 6 May 2020 20:42:32 +0300 Message-ID: <20200506174238.15385-15-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Serge Semin Similar to commit 8e5c62e38a88 ("mips: early_printk_8250: Use offset-sized IO-mem accessors") the IO-memory might require to use a proper load/store instructions (like Bailal-T1 IO-memory). To fix the cps-vec UART debug printout lets use the memory access instructions in accordance with the UART registers offset config specified at boot time. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-pm@vger.kernel.org Cc: devicetree@vger.kernel.org --- There might be another problem in cps-vec-ns16550.S connected with the difference in CPU/devices endinanness on some platforms. But there is no such for Baikal-T1 SoC. --- arch/mips/kernel/cps-vec-ns16550.S | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/cps-vec-ns16550.S b/arch/mips/kernel/cps-vec-ns16550.S index d5a67b4ce9f6..2adb1c56c7c5 100644 --- a/arch/mips/kernel/cps-vec-ns16550.S +++ b/arch/mips/kernel/cps-vec-ns16550.S @@ -14,16 +14,30 @@ #define UART_TX_OFS (UART_TX << CONFIG_MIPS_CPS_NS16550_SHIFT) #define UART_LSR_OFS (UART_LSR << CONFIG_MIPS_CPS_NS16550_SHIFT) +#if CONFIG_MIPS_CPS_NS16550_SHIFT == 0 +# define UART_L lb +# define UART_S sb +#elif CONFIG_MIPS_CPS_NS16550_SHIFT == 1 +# define UART_L lh +# define UART_S sh +#elif CONFIG_MIPS_CPS_NS16550_SHIFT == 2 +# define UART_L lw +# define UART_S sw +#else +# define UART_L lw +# define UART_S sb +#endif + /** * _mips_cps_putc() - write a character to the UART * @a0: ASCII character to write * @t9: UART base address */ LEAF(_mips_cps_putc) -1: lw t0, UART_LSR_OFS(t9) +1: UART_L t0, UART_LSR_OFS(t9) andi t0, t0, UART_LSR_TEMT beqz t0, 1b - sb a0, UART_TX_OFS(t9) + UART_S a0, UART_TX_OFS(t9) jr ra END(_mips_cps_putc) -- 2.25.1