From patchwork Thu Mar 21 10:25:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Tomer X-Patchwork-Id: 10863277 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 E9E751390 for ; Thu, 21 Mar 2019 10:28:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF4A12A095 for ; Thu, 21 Mar 2019 10:28:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3C162A0A8; Thu, 21 Mar 2019 10:28:22 +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 C376B2A095 for ; Thu, 21 Mar 2019 10:28:21 +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 1h6utZ-0008Bi-6C; Thu, 21 Mar 2019 10:25:57 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h6utX-0008Bd-JE for xen-devel@lists.xenproject.org; Thu, 21 Mar 2019 10:25:55 +0000 X-Inumbo-ID: b51138cd-4bc3-11e9-bc90-bc764e045a96 Received: from mail-pg1-x541.google.com (unknown [2607:f8b0:4864:20::541]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id b51138cd-4bc3-11e9-bc90-bc764e045a96; Thu, 21 Mar 2019 10:25:54 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id v12so3927166pgq.1 for ; Thu, 21 Mar 2019 03:25:54 -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; bh=KuZ+cW+cdDWicrERWr2YtFt2ZTL8d3zsamiUESnlGow=; b=eAofXjOPL8ZTHSa7PzmtqJRvcP8NOBCHL/mKoP758aU3anahXpbUtA4O3yFn9wVfEv lo+Uf+/0TgI3tCuCqcTzcgqbY6hsd9pNTvw+yrknXH6Qu/uGU7I8LKpoeLRmsU3GgJ0r LxZoRKif8HAOC92CVXBohSy4TDEb4kLKRyGXMMcX8Oo6+w31nn4eKxRJ/ujDmvHQGKI/ S/hsIalis/XTi+g5AozD5QWXzuBFxWwfqe99FLc+Wwm7wNfwj7Q1xXwYyoh2R3mwKqSn I73nW4uCR3nmXMYSNNQ0gbciF0dRtTV5VmdmF+5AGJ59fTpkEx1KTOAqLHM+XiV9iKuX 6g7g== 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=KuZ+cW+cdDWicrERWr2YtFt2ZTL8d3zsamiUESnlGow=; b=EecwBRSpk9TfW7NQsfx6MhJv5ZCXR4cYLyfkHjhIYie55RtAQ2K6nnUybS6mFrBS8x BYCDBqbmrBCar+L+UdmK/YAPiTf5mX5AGrx/ydHqezCWIzio5Phowi+nhMcpBFn+cOKX IEpZTezlS6LocPBheedC/w1D3cdWcubMqTPVnbhYUsB5mUnfdwp0eQh0L8n7i4O769hH OrQ1G6hUn7DMjhiQ1LpDVpr2CR6P6yPL3EXZPTWfjutYM49pUrX8BUBZfDOtliQnXBiF 2sMJ6GcTJoaE00tQ7+g0YAxrGwlLgo9EunWpQGVhDIFUPfrPCIAnjLli/kIkJeA2UOcS uUIQ== X-Gm-Message-State: APjAAAW99Jo5TYhmQVm9P8pSysXj2G7mDC16AUZ+ePG+arHcIC/qLD/C da4dTaLDuY0tpw+G05H/qT/OFm9P X-Google-Smtp-Source: APXvYqzFhvmZbrrKqUZkzHqytuCuQ2HAk593qXXLAOwmDh4WzjkH4i1aiMOBxWfLQLYuDc20V10Gww== X-Received: by 2002:a63:f558:: with SMTP id e24mr2544766pgk.373.1553163953352; Thu, 21 Mar 2019 03:25:53 -0700 (PDT) Received: from localhost.localdomain ([47.31.89.138]) by smtp.gmail.com with ESMTPSA id f87sm6657208pff.38.2019.03.21.03.25.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Mar 2019 03:25:52 -0700 (PDT) From: Amit Singh Tomar To: xen-devel@lists.xenproject.org Date: Thu, 21 Mar 2019 15:55:33 +0530 Message-Id: <1553163935-12862-1-git-send-email-amittomer25@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH v2 1/3] 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Amit Singh Tomar Reviewed-by: Andre Przywara Tested-by: Andre Przywara --- TODO: * Capture XEN boot info on WIKI. 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 | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 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..01b70f0 --- /dev/null +++ b/xen/arch/arm/arm64/debug-meson.inc @@ -0,0 +1,51 @@ +/* + * 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 + +/* + * 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 FULL 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: + */