From nobody Sat Apr 27 03:35:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1555223736; cv=none; d=zoho.com; s=zohoarc; b=T6qfrAFHwKDMrvB0J4jx0gB2eJcO3Ho3qO126jsC7++/or8alv9+yqoSP2WLh4RBq+616v1UvmkaT3O5+yf0nqC26ITe9z3ivv/dYzZx07aeyBzMS6T+oe6eVAd90hc80QZ0gDlL6kCQE/TR1nn1+2bTrIs8qdWTHSc+LvtplRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555223736; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=8GAORo+WOwxHXPtYtv4cqnMyzWL9R5U5Mfgt67+1YXE=; b=JV25ZpM3FQiVlS5BfT0L0+jp5qzt6mGXXObENZcrp065jw37SmqTnYYZOqPsgTOmYtEdkFiOtdk1FCGgH1IIgV3BmFTwop0+EMFdNuRYGxezB+ypKra39qkRuSyZpHdYVawnbGS4G9iglNSWJ9IsUl7c6tbT/AfDZc/IoF1w94k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1555223736211571.0559731737346; Sat, 13 Apr 2019 23:35:36 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hFYiB-0000dU-2o; Sun, 14 Apr 2019 06:33:55 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hFYi9-0000dP-8Z for xen-devel@lists.xenproject.org; Sun, 14 Apr 2019 06:33:53 +0000 Received: from mail-pf1-x442.google.com (unknown [2607:f8b0:4864:20::442]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 44836bb0-5e7f-11e9-92d7-bc764e045a96; Sun, 14 Apr 2019 06:33:51 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id w25so7046442pfi.9 for ; Sat, 13 Apr 2019 23:33:51 -0700 (PDT) Received: from localhost.localdomain ([223.190.30.100]) by smtp.gmail.com with ESMTPSA id i15sm64574212pfd.162.2019.04.13.23.33.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Apr 2019 23:33:49 -0700 (PDT) X-Inumbo-ID: 44836bb0-5e7f-11e9-92d7-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=owxNVnAJ4MtRR0omIw5jro2IGQnbvI8ArzcKNr9mPso=; b=Dz0JB7NW/lCU/VkDuQPIK4bvZATA0BRM7CjhfZQXwg80Kp0UzI6HsmE1Bl7ehEEz7Y iWDqEkRFTP1+OWxmFR1lUzwhTuPwKs1+slOu/f0Awvzx+SCjmBPl1xjHkYNL8g3WZJ2g qyZF0mn2TCwamtufSJhbGAs36doMaPi38+9PpI7Ah6ZGxeL3TiSPK/eC6lUh8Eh6u6Na R4NMslMI221hWvaQclYdYdDucDKz7ITCR0gocufQsKKlA7sCrDv/QIrkzRRf+LDK/mKm x+dThqojo2C0ZqFsOTwMPjVuSqPVJ6GAuAGNVAI4pcNjubls35+yJ7pQSLvBSv/pHZiQ yjXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=owxNVnAJ4MtRR0omIw5jro2IGQnbvI8ArzcKNr9mPso=; b=O5uCcwjWhesr9XCyuly2nN0T2KNJUwyrMnSbvigTFbAl9s5/UphGu+2tcX7DY5Ewvv J+1z2SkA2b0ENB9c8g3byU6HFNIx26lpWHW3qOmoZis/XldGzAjDdhfrRntz3lOVw5fh ilP+HjiSEhzNEtEabqYqBpVn2pl6bQfC46y3LbrFxmuJWbEVOgJMb06vx0bhYjTSZW2o f3S8LwwNnadGMGkXf26UQMYoYQsyf4niXY11mXYS7uvNer5R5iKLAaMnLe1oeS6vT7ra omb6kjOTqz8wv5RyxT5t8j0z7ONZKgHjyCruwj6GdlZyADwq5E8LOuAGMWa3fDastv6d X9Kw== X-Gm-Message-State: APjAAAUwtTr9KFS1Vow9P+Dgy2DP7Rwbi+9sr0unlk+RV4tDRaULCb8a xfqaRXxm6BU+t3cUT1mDtpMrtVDD X-Google-Smtp-Source: APXvYqxhGpYt3+XaAt6Jj+rug7G73OyOphTm+0iRLf/ZlIC9bcCjidP+7zxj9dozNXkki5mFdt0NIA== X-Received: by 2002:aa7:9193:: with SMTP id x19mr68781326pfa.108.1555223630537; Sat, 13 Apr 2019 23:33:50 -0700 (PDT) From: Amit Singh Tomar To: xen-devel@lists.xenproject.org Date: Sun, 14 Apr 2019 12:03:31 +0530 Message-Id: <1555223611-10263-1-git-send-email-amittomer25@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH v3] xen/arm: Add Amlogic Meson SoCs earlyprintk support X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: andre.przywara@arm.com, julien.grall@arm.com, sstabellini@kernel.org, Amit Singh Tomar MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This patch adds earlyprintk support for Amlogic Meson SoC based boards. It relies on firmware[1] to initialize the UART. Tested With: http://wiki.friendlyarm.com/wiki/index.php/NanoPi_K2 [1]: https://github.com/ARM-software/arm-trusted-firmware/blob/master/drive= rs/meson/console/aarch64/meson_console.S#L92 Signed-off-by: Amit Singh Tomar --- Changes since v2: * Added the commit message that talks about uart initialization. =20 * Added dummy early_uart_init function. Changes since v1: * Fixed coding style issue. * Undone changes in early-printk.txt. Changes since RFC: * Replaced LDRH with LDR, with this there is no scattered output on console now. * Used tbnz instead of tst and b.ne. * Used AML_ prefix against register names. --- xen/arch/arm/arm64/debug-meson.inc | 55 ++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 55 insertions(+) create mode 100644 xen/arch/arm/arm64/debug-meson.inc diff --git a/xen/arch/arm/arm64/debug-meson.inc b/xen/arch/arm/arm64/debug-= meson.inc new file mode 100644 index 0000000..e1a8fa8 --- /dev/null +++ b/xen/arch/arm/arm64/debug-meson.inc @@ -0,0 +1,55 @@ +/* + * xen/arch/arm/arm64/debug-meson.inc + * + * MESON specific debug code. + * + * Copyright (c) 2019, Amit Singh Tomar . + * + * This program is free software; you can redistribute it and/or + * modify it under the terms and conditions of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; If not, see . + */ + +#define AML_UART_WFIFO_REG 0x00 +#define AML_UART_STATUS_REG 0x0c + +#define AML_UART_TX_FIFO_FULL 21 + +.macro early_uart_init xb, c +/* Uart has already been initialized by Firmware, for instance by TF-A */ +.endm + +/* + * MESON UART wait UART to be ready to transmit + * xb: register which contains the UART base address + * c: scratch register + */ +.macro early_uart_ready xb c +1: + ldr w\c, [\xb, #AML_UART_STATUS_REG] /* status register= */ + tbnz w\c, #AML_UART_TX_FIFO_FULL, 1b /* Check TXFIFO FU= LL bit */ +.endm + +/* + * MESON UART transmit character + * xb: register which contains the UART base address + * wt: register which contains the character to transmit + */ +.macro early_uart_transmit xb wt + str \wt, [\xb, #AML_UART_WFIFO_REG] +.endm + +/* + * Local variables: + * mode: ASM + * indent-tabs-mode: nil + * End: + */ --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel