From nobody Fri Apr 19 05:03:21 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=1555264303; cv=none; d=zoho.com; s=zohoarc; b=XyyM8/tvHARa3uFtDdshpLKsQQFe6rP4gJiDXsuD4CnPuw1KvIzS/RKSVsevoW164D2J2F1hMy2bEUqUR0vusPmOa4DbldGhBiMqKVdUNQbIUSsVaAZwUYz3vFkjwtOrmqMuMxBPvnnnzDkjRt58q70KVcc8eiqNm4fnnr8ZtbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555264303; 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=bwYUfyoxM22zhScpnctnSBvB+MxG8+mb3B37IMOo6aE=; b=CzAZsyRSSeGo468AfdXr9RAGc8/boYdugJi52QRFhgdtC3THFm+OqzeqHtNi1WLOUefNeLQj/5VktvnGlLS1CPVZrxzT1xrzlgZFPCipfunhbheYltlTiY1qKjUI5DUvhPCIPjMOBRAeWPB+uu1rPivp1ueRPnJy67cu4jHcWE4= 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 1555264303056526.3962351427305; Sun, 14 Apr 2019 10:51:43 -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 1hFjGm-0001qH-LD; Sun, 14 Apr 2019 17:50:20 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hFjGl-0001qA-6v for xen-devel@lists.xenproject.org; Sun, 14 Apr 2019 17:50:19 +0000 Received: from mail-pf1-x441.google.com (unknown [2607:f8b0:4864:20::441]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id c367d3cf-5edd-11e9-92d7-bc764e045a96; Sun, 14 Apr 2019 17:50:17 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id e24so7433006pfi.12 for ; Sun, 14 Apr 2019 10:50:17 -0700 (PDT) Received: from localhost.localdomain ([106.215.44.17]) by smtp.gmail.com with ESMTPSA id p14sm60675573pfa.26.2019.04.14.10.50.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Apr 2019 10:50:15 -0700 (PDT) X-Inumbo-ID: c367d3cf-5edd-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=Uf3oVtCZ0E7oGCP51/SCIoovwDE6Pde9k5hoxT2L5DE=; b=pMqOOK/zb8/ckQ6vsnrPUAVyaPaYgmlDuM6kZ7q80zqOv3p8qLf6ONbuCJAk72MyLv XnbYZcAGRVhCZhuyK3K6uDZX2nD3+tVqGmQIEvUO2S3LJh9CYIzAWn3PRluKniyeXhwS 7BQPkfPpXB2kKDEegPnXRy02WlDuFGPlzcYNtCvi4bWeXJOmnWpvV1Cjd7yYj9BnMKBZ L6rlF0QrpDDiF1kWbbmmu8ZlpfujuWywM1DJNvLvGo5srnnLAq2v/jwFQQHR8mVCHzAN xkphVhdRxs4Ee5zNibLcxAgKWR/Dsrq8WYXagcDHJQ0zVIcKLgFbCO6x0mzNZNigFgsj TF6A== 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=Uf3oVtCZ0E7oGCP51/SCIoovwDE6Pde9k5hoxT2L5DE=; b=pKOEf190n9uI4cI2e72USnoinem52Lr3zRIOHF+KK6KAJjzT7rIA2JdBdHENaKtPzG MUqEeOOy0sHxkQl/CJ9AkQkZUy7EDPCGsINkIp7zvEvnQ4IekQyPjH8UbE/z9OpK7UiG md2a3XmGmeU+zf7ZH/NSq011bxQjz+avGUh+/KXI1E5oTjjILksYftaCefiJWrkHJ54X ntJkrEVE75Hl2sKmJLx2V6Nx2j5t3QrJlEnK2SCRg9zR00Be3sIcpV+Hjk9kz1wanW3C W2eNvuZoPz+hMYT1wmwxgGSwo+G1tprwgne1am53olNzw02F+BXKjO/MFDouwNFCC3a+ EIkg== X-Gm-Message-State: APjAAAUr6ujz8EndLdojbFPTfw2U2yJiEaEsq8p3mdbVgkTetuU2OePQ 4TKWPmZXYBXPD89mZkzSUq51IMdb X-Google-Smtp-Source: APXvYqwIEbh4zn90abOsuMX3ZMqKXRXjV+aH8nRzW9Iu+viAeoSEiD9yzPAhL3pafjo7dPnpIfy/gw== X-Received: by 2002:a62:a515:: with SMTP id v21mr70368303pfm.41.1555264216195; Sun, 14 Apr 2019 10:50:16 -0700 (PDT) From: Amit Singh Tomar To: xen-devel@lists.xenproject.org Date: Sun, 14 Apr 2019 23:20:06 +0530 Message-Id: <1555264206-19673-1-git-send-email-amittomer25@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH v4] 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. ATF[1] and U-boot[2] already initialize the UART for us. So no need to do i= t again. 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 [2]: https://github.com/u-boot/u-boot/blob/master/drivers/serial/serial_mes= on.c#L44 Signed-off-by: Amit Singh Tomar Acked-by: Julien Grall --- Changes since v3: =20 * Change the commit message to include firmware names. Changes since v2: * Added the commit message that talks about uart initialization. * 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