Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2233340rdh; Sun, 29 Oct 2023 06:47:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtPMvnSwXfXYB9faQ625ZsglvDogNC1wfIH++YbjcQ4UNmiU1+OR3Q/UMnLBb+GQvtjsjz X-Received: by 2002:a17:90a:b78b:b0:27d:c35:7f3 with SMTP id m11-20020a17090ab78b00b0027d0c3507f3mr5532997pjr.8.1698587225519; Sun, 29 Oct 2023 06:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698587225; cv=none; d=google.com; s=arc-20160816; b=Lkd3vVhlYeeUVslLPuZuelk+BgJ2VaMKA91ZUV2SGQloTL/3v4Uvo5FdYkprTh/nRj Wbo8qaIUOH8FuAqJXRKBah8BxlfXa81d8FuX5roM34o5fK4gz3VDDpL8mSewq6zFezFv fN0jxNeGpSrTZtNlTN8zkX25Gf7+FgOxViwI7jJ3vSgI9KanUswwZDoHetbJ4P6jmbEa Ou/AmsnYY2z/5q2QXld6exRP7xN2WHiPRsVFy3n6mVOU03286iqMqCSyxz42ViGHqH3y oZaNSz586HoxpzIsBF6aFdTfz6mr6zsLwkRYZS1+2XstNCyE1q5KWdkVsJckU1Ms2yVK wKqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=XPw34Iav2T+hzoHR6mAbmW6CU2TVaqRpR57TvU3su/0=; fh=Dii/wXcZb/mJUCmsdlZbBl/o0XRcaQ9S/xOY9NGTLc4=; b=bk5FirSiNCkDt/fk1Cl0rP7FWe5vLE6QZaGOQpJ2srVriOg2RTx1ye5iCT6DJkmlRZ jXNjb2EblYid4m6d/bbBU7I+AG9DukQGmB8xs9vGmX74YsHBqCEYcshJLlvLWlNVyoRz eH1x9oaHQ+r8XNTZD4h+jXHrnsriwL/xHnBI5QjnCFV3eKyCs3MWnCBolInKPnfp2Czg gDcFSwHQLpfJ9mncjmGMm2o0N5Tis1m1VM1eWfXrR62V1CJ6NHzJKaE2WSl0eg712M2h 6y7BloCbMSOaPA2K4qLT498078aA+TSnhZg5uMCoAicAI8OnrWOCj0dk1G8zywKRqCLO NGOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=BwY5WxrQ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KQZE+ZZm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ga17-20020a17090b039100b0027ffb7e1eb2si3638352pjb.58.2023.10.29.06.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 06:47:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=BwY5WxrQ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KQZE+ZZm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C5D3380708AF; Sun, 29 Oct 2023 06:47:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbjJ2NqN (ORCPT + 99 others); Sun, 29 Oct 2023 09:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbjJ2NqF (ORCPT ); Sun, 29 Oct 2023 09:46:05 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 365E6BF; Sun, 29 Oct 2023 06:46:03 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 59337320027A; Sun, 29 Oct 2023 09:46:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 29 Oct 2023 09:46:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1698587161; x=1698673561; bh=XPw34Iav2T+hzoHR6mAbmW6CU2TVaqRpR57 TvU3su/0=; b=BwY5WxrQ6pgPiGsUfBkHxT78tKE6bnMvKstG/Z4lHs2ePbcz21v Q3Vmri1QIwwn4AhXk+s+WZYbSSyRFmt06e1LBEK19dU3ipz1G/JHfr9e0YG7b9lM Qgt716D0PPipMTZCY3JW1jDpRHiMjosp+ywVrab/zXG8U/YETNHDxqD7g7j6uey4 5KbGYfcApsQUL3Mqv+ls49Rjyyrqy47V3BwxNUq4utl/enQjMcbiWn5Osd/xacMR VnTWsBPiP2fINOHD0im2DwGRHHm1mLaUSxDFz3yncFV3b1eNsRuab0geDrPqZ+6A rFDADMy5QFWwWO1OG4mR3bDHVpvmaIK4cjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698587161; x=1698673561; bh=XPw34Iav2T+hzoHR6mAbmW6CU2TVaqRpR57 TvU3su/0=; b=KQZE+ZZmUIVrRL0M5r7SDl7pQrEUg1tUw4xEvrrIi6Ub66XQw8c DWhaJmRWDNjeJvt4+w3vZIs7xJG0P+UI8DWdzCRM+gF/3x4Ro9aGE5ovOx7UVaND X+V+BHG69xQs4f+geeyuJd0FMt63UNgRrZLGoAEYyIsxxOGO/2ffv6pSXtF+c9A7 3Jv6OyPGWdxH+DP2QF8V0NXt7gI5t8F3TheIsfkSHAMIXtQlDUFse2S70qPQyVzZ 6OJofY21J9OzMunoCYJ19cqnbBgKv5ULIZ/eadJBYBlQIgWHkFdcX3wSe45ZJyM1 nPcBIIVH2ngLN3wqgt1dU4X0/ik9JAmFNrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleekgdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheplfhirgig uhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenuc ggtffrrghtthgvrhhnpeevvdfggffgtdeuudekfeetleffkedvveeljeffjeeigeekfeff vdffleetieejgfenucffohhmrghinheprghrleeffeigrdhssgenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Oct 2023 09:46:01 -0400 (EDT) From: Jiaxun Yang Date: Sun, 29 Oct 2023 02:53:08 +0000 Subject: [PATCH 7/8] MIPS: debug_ll: Implement support for AR933X uarts MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231029-mips_debug_ll-v1-7-d7a491e8c278@flygoat.com> References: <20231029-mips_debug_ll-v1-0-d7a491e8c278@flygoat.com> In-Reply-To: <20231029-mips_debug_ll-v1-0-d7a491e8c278@flygoat.com> To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang X-Mailer: b4 0.12.4 X-Spam-Status: No, score=0.3 required=5.0 tests=DATE_IN_PAST_06_12,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 29 Oct 2023 06:47:03 -0700 (PDT) Implement support for AR933X uarts which has it's own register definition. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig.debug | 9 +++++++++ arch/mips/include/debug/ar933x.S | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index aef116058654..a6687c503c34 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -265,6 +265,14 @@ choice Say Y here if you want kernel low-level debugging support on uart of alchemy SoCs. + config DEBUG_AR933X_UART + bool "Kernel low-level debugging messages via Alchemy UART" + depends on MIPS_ALCHEMY + select DEBUG_LL_UART + help + Say Y here if you want kernel low-level debugging support + on uart of AR933X SoCs. + endchoice config DEBUG_LL_INCLUDE @@ -303,6 +311,7 @@ config DEBUG_UART_PHYS default 0x1fe00000 if DEBUG_LOONGSON2K_UART default 0x10030000 if DEBUG_INGENIC_UART default 0x11100000 if DEBUG_ALCHEMY_UART + default 0x18020000 if DEBUG_AR933X_UART help This is the physical base address of the debug UART. It must be accessible from unmapped kernel space (i.e. KSEG1 for 32bit kernels diff --git a/arch/mips/include/debug/ar933x.S b/arch/mips/include/debug/ar933x.S new file mode 100644 index 000000000000..1a0449082080 --- /dev/null +++ b/arch/mips/include/debug/ar933x.S @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023, Jiaxun Yang + * MIPS Low level debug include file for ar933x UART + */ + +#include +#include +#include + +#define DEBUG_LL_UART + +#define UART_BASE CKSEG1ADDR(CONFIG_DEBUG_UART_PHYS) + +# define UART_L lw +# define UART_S sw + + .macro addruart,rd,rx + PTR_LA \rd, UART_BASE + .endm + + .macro senduart,rd,rx + UART_S \rd, AR933X_UART_DATA_REG(\rx) + .endm + + /* CTS and RDY are handled by AR933X_UART_DATA_TX_CSR as well */ + .macro busyuart,rd,rx +1002: + UART_L \rd, AR933X_UART_DATA_REG(\rx) + andi \rd, \rd, (AR933X_UART_DATA_TX_CSR) + xori \rd, (AR933X_UART_DATA_TX_CSR) + bnez \rd, 1002b + .endm + + .macro waituarttxrdy,rd,rx + busyuart \rd, \rx + .endm + + .macro waituartcts,rd,rx + busyuart \rd, \rx + .endm -- 2.34.1