From patchwork Fri Jun 7 20:16:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Tomer X-Patchwork-Id: 10982749 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9B4A92A for ; Fri, 7 Jun 2019 20:19:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C547F27031 for ; Fri, 7 Jun 2019 20:19:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9A6E28BA6; Fri, 7 Jun 2019 20:19:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4628D27031 for ; Fri, 7 Jun 2019 20:19:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hZLIK-0007jE-Jh; Fri, 07 Jun 2019 20:17:00 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hZLIJ-0007j9-W2 for xen-devel@lists.xenproject.org; Fri, 07 Jun 2019 20:17:00 +0000 X-Inumbo-ID: 33d45f09-8961-11e9-8980-bc764e045a96 Received: from mail-pl1-x642.google.com (unknown [2607:f8b0:4864:20::642]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 33d45f09-8961-11e9-8980-bc764e045a96; Fri, 07 Jun 2019 20:16:58 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id a93so1232564pla.7 for ; Fri, 07 Jun 2019 13:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P+vzjtp1i44txySUhOSs0ClNAsx/SX8KzzDN/ABCcHA=; b=Rq4m8h4RliGU0ykVi+KjpYlzFaE5803cX8T9xqTIXcYqk4OZtC59Z/8LXeJ6kye7+q HtIFpQEBcVl0vL74ugArv64kgW1BcxaDeyETCidPjwOwuHWMzIU79JpOpM0tiBeM+OlM RhLQKpKyN86ZviftTZ8B2n4dcn7HpVX62XRx3yzBVCzwHymUvWqQHbGIO8hCy+kToxWZ 7ED6NTWaTkhNoDIaGzqMLBX0tiDQcj6A3EbjTVqx7fk8p3D8BwJ3boFfzbYc0utqYYUL 3tL2pgt1zDMSikLAdTa8Xrgvi/eVA56MWJeZAVDMuaPlJv9ITTzRsBXBqOJ2RpsD01kU uWhw== 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:in-reply-to :references; bh=P+vzjtp1i44txySUhOSs0ClNAsx/SX8KzzDN/ABCcHA=; b=g+wJTbuTYA1T9lPOBeDfV2K+JbsuFbdstcoujekuiPnv1IElXQMIj9/oN2n0Mi6Vdy LYlSevDQgMHfASkxdzDAPd2x42RbEqUE3PLeMChunWBZgHo+Tc42YG66W39V18iReQ9g b90u+dl4DlVSe7Jg3aOasYg+muorZNxjGZGBEX1UNBGWub3qqQBlfOJkbh+6RDcLaWpS os6i5WBRTcrXPcrjVN5+ibws2wJrGhxFoZ3JceIrwur5MPMWr2rwR/npyAI26FS0vpw8 XwwZQP39kdJDZWOGovaeNjs3ko0xyYK9+nNsHToiHeo58/zfnl9RM5nJzQ6pa4YJr3Wr /Vmg== X-Gm-Message-State: APjAAAX/SlmfhsKNFqwGYCuK4ELF79TIiCnxuYMUAzxbaILwnoN5dclD ko7HyS6mx+IEMd6TPs4FFR6XDuE4 X-Google-Smtp-Source: APXvYqyhr83QMokrjPqmMVUNglnmoksowai/QwtttTkouYNjXvIXJRSHY9ZfREctTqg38/TBwZe9Qw== X-Received: by 2002:a17:902:42a5:: with SMTP id h34mr20024752pld.16.1559938617704; Fri, 07 Jun 2019 13:16:57 -0700 (PDT) Received: from localhost.localdomain ([223.233.80.237]) by smtp.gmail.com with ESMTPSA id a12sm4407502pgq.0.2019.06.07.13.16.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Jun 2019 13:16:56 -0700 (PDT) From: Amit Singh Tomar To: xen-devel@lists.xenproject.org Date: Sat, 8 Jun 2019 01:46:35 +0530 Message-Id: <1559938596-5696-2-git-send-email-amittomer25@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559938596-5696-1-git-send-email-amittomer25@gmail.com> References: <1559938596-5696-1-git-send-email-amittomer25@gmail.com> Subject: [Xen-devel] [RFC PATCH 1/2] xen/arm: Add i.MX8MQ 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, peng.fan@nxp.com, Amit Singh Tomar MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds earlyprintk support for i.MX8MQ SoC based boards. As with most of other debug code for other platforms, uart is initialized by bootloaders(for instance u-boot[1]). [1]:https://github.com/u-boot/u-boot/blob/master/drivers/serial/serial_mxc.c#L141 Signed-off-by: Amit Singh Tomar --- xen/arch/arm/arm64/debug-imx8mq.inc | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 xen/arch/arm/arm64/debug-imx8mq.inc diff --git a/xen/arch/arm/arm64/debug-imx8mq.inc b/xen/arch/arm/arm64/debug-imx8mq.inc new file mode 100644 index 0000000..ec331dc --- /dev/null +++ b/xen/arch/arm/arm64/debug-imx8mq.inc @@ -0,0 +1,54 @@ +/* + * xen/arch/arm/arm64/debug-imx8mq.inc + * + * IMX8MQ 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 UTXD 0x40 +#define UTS 0xb4 +#define UTS_TXEMPTY 3<<1 + +.macro early_uart_init xb, c +/* Uart has already been initialized by bootloader Firmware, for instance by TF-A */ +.endm + +/* + * IMX8MQ 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, #UTS] /* UART Test Register */ + tbz w\c, #UTS_TXEMPTY, 1b /* Check TXEMPTY bit */ +.endm + +/* + * IMX8MQ 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, #UTXD] +.endm + +/* + * Local variables: + * mode: ASM + * indent-tabs-mode: nil + * End: + */