From patchwork Thu Oct 15 04:25:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1382446 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=cSoMT+/h; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBbnR3Hqbz9sTL for ; Thu, 15 Oct 2020 15:25:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8FB982369; Thu, 15 Oct 2020 06:25:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cSoMT+/h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 50D2282279; Thu, 15 Oct 2020 06:25:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B243382279 for ; Thu, 15 Oct 2020 06:25:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x1042.google.com with SMTP id j8so1129741pjy.5 for ; Wed, 14 Oct 2020 21:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ecBusdBaYYW6Frq2q85LNTsgVhaiv3d4zBC4018Qxmc=; b=cSoMT+/hgxxOeUENt+6dOnBM180dAJJ3Boyw+mkFlchfOZeYWFWNipxLK4cv+UBca1 TBIHpSSraDtITkgfKpTOY4h5Rg38tAfDVxeC68f+djYp1avJvxkHNGUKK7XHvKdmY6mI b8GByJDckp50dMs19/OSx1qiiTzuacL609ujrP41qUi2fWUqioPw3N+RItmf8DBoh1mX eKBC3iBOiqsvJeHyMRgGA3rC1bjFenL7Ej9GRY7AuUF9E0LcWwdR4nYZxSqxK55NfPMD ajMNNPqntCv/ANiVT5Q5b8JkSBwTfMna3Vlh1HUJ25BqHiJVwOu/PZqzwaTvakjHbQve 4Z6w== 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:mime-version:content-transfer-encoding; bh=ecBusdBaYYW6Frq2q85LNTsgVhaiv3d4zBC4018Qxmc=; b=Dj+tf0MoFqPvhUZnpC2j410mUrrJKomSMj07NmtsKpn+8jJeIBXWZXjskFNlVyAMET 6uVcPMQEWfhhTkF1REd0dzlzfJ699+MUWqEFwS9sWNoAZIZFrgbGJBIh4IhIsDEiNoZF uw0L3O8i/Orf1RjOebpsfu4Xw1UoOV3GyeL2KpN5BFIEHeo7uqVrQCgFHM+psd7Ak7eh BGRyEde+JkmK4GLVThZxr6M3gC85vMjf2R71j1ymhk73fM8vEQObuQOcfkjHT/D2dpV7 gYT9BRXjxT19eLlbVw8DG66MGB4cnNRGvoykFtm9WpzW0drGi/5Ix/ue3qmqMP5FvIDB UJNg== X-Gm-Message-State: AOAM531gbCBc7Fk4/9qAvCqjKNr2dukgkcCmd4yNwyIwF9mTQz/zszGn 2nxjtAKKadVyK/Gc6OcJ9J5ydw== X-Google-Smtp-Source: ABdhPJzo+bpmJne2/rJ5d3cWvQ3fT0l6LvghYUdv5OuqwpS11eebVyaAM1/nrEf2Ags1iyakLh5EGw== X-Received: by 2002:a17:90a:d146:: with SMTP id t6mr2520122pjw.76.1602735944081; Wed, 14 Oct 2020 21:25:44 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id w17sm1306489pga.16.2020.10.14.21.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 21:25:43 -0700 (PDT) From: AKASHI Takahiro To: anastasiia_lukianenko@epam.com, oleksandr_andrushchenko@epam.com Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 1/4] serial: serial_xen: print U-Boot banner and others Date: Thu, 15 Oct 2020 13:25:13 +0900 Message-Id: <20201015042516.41197-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015042516.41197-1-takahiro.akashi@linaro.org> References: <20201015042516.41197-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean At present, DM_FLAG_PRE_RELOC is set only if !OF_CONTROL. It doesn't make sense for this para-virtualized driver. With this patch applied, you will be able to see early boot messages: U-Boot 2020.10-00001-ge442e71a6c52-dirty (Oct 15 2020 - 11:02:25 +0900) xenguest Xen virtual CPU Model: XENVM-4.15 DRAM: 128 MiB PVBLOCK: (XEN) gnttab_mark_dirty not implemented yet pvblock: 0 In: hypervisor Out: hypervisor Err: hypervisor xenguest# Signed-off-by: AKASHI Takahiro Reviewed-by: Peng Fan --- drivers/serial/serial_xen.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/serial/serial_xen.c b/drivers/serial/serial_xen.c index ba6504b94796..ed191829f059 100644 --- a/drivers/serial/serial_xen.c +++ b/drivers/serial/serial_xen.c @@ -175,8 +175,6 @@ U_BOOT_DRIVER(serial_xen) = { .priv_auto_alloc_size = sizeof(struct xen_uart_priv), .probe = xen_serial_probe, .ops = &xen_serial_ops, -#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, -#endif }; From patchwork Thu Oct 15 04:25:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1382447 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uqnqO+0g; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBbnZ5H5wz9sTL for ; Thu, 15 Oct 2020 15:26:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC82A8235E; Thu, 15 Oct 2020 06:25:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="uqnqO+0g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6AED8235E; Thu, 15 Oct 2020 06:25:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2A9D182367 for ; Thu, 15 Oct 2020 06:25:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x644.google.com with SMTP id o9so883312plx.10 for ; Wed, 14 Oct 2020 21:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m+jkdY0w9G7q7VHLMvAWHWscZRaBIokj+lachCA92T4=; b=uqnqO+0gCCqe01RRotpOTGav1dectvBl0+vkUGSdsVhilz+wENfwIgntc/r1BrH49s pv+HnKCyf2oRLe/f7vyLp7laWUPq0P9HBtBaFB5UF4tpYLl5B08FG5pwfECAMs4l7zmq JvF/+L9a2bF5HnLNpaf6edjpUicQoqMaskr1GLUsm+sPCxUwBd1/1PdtPruNw8UeCgdP sr5fcBxCBV85lnq/XvcsmfzacERSobScqhR9qIcfoCquEgcb72DNng9sBwLyjwLuEI8X aPjUtkFMMf+mugiJjyufel4zGIg9dQr9MMrtsOxz0Qiv9jSemQ3xQlLjXLS8Ciowk+Ar oxLA== 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:mime-version:content-transfer-encoding; bh=m+jkdY0w9G7q7VHLMvAWHWscZRaBIokj+lachCA92T4=; b=rHbDPV6stRJPlujTo4DKZ+JfcW/+Qv6ZtaHwlsJQUMcGJhu8YP15kbjil46TkvhyBz Fle4yXj3NQOP6yJSJW/hrGRB756XLdxgS4Tn0e/Pmusd4wK3SdOsk36HeSqmZXKiW2qR lG6YUHLTL92COGnb6OZEmvqbcCixBSaRZ8pNQkRK4EGHg48wmTr97EZjKAjcVKL0JyAv k6igRaqHm3WFJcCvTQoINLnbyzW0FJB6LsXORMs16T4jqFCrOxcsaFAf8FpbJT0j0uKt XHnY0N5UqmO6RHpWtFAxMOhrdL2s/NbbzXyAMz8wBUVvnPd+xJdmNPNiFTTjVxOXB97D bSgw== X-Gm-Message-State: AOAM532E3m0N9jk6hY4Yv0Z3Z/LBpzGHBQkptNhbpzyD4RKBsApwLU1Y 0yJMEHY2z+0AHQMzcIZFhwSh/w== X-Google-Smtp-Source: ABdhPJzKdgMSkEMgj8OGGIXnCECh9jBkvr2nk9fIYQmrSnOY7OYiqwGJARJc+/+jdAHuM+nHKxnbPw== X-Received: by 2002:a17:902:8547:b029:d4:e2c7:1a32 with SMTP id d7-20020a1709028547b02900d4e2c71a32mr2165247plo.38.1602735946521; Wed, 14 Oct 2020 21:25:46 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id w17sm1306489pga.16.2020.10.14.21.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 21:25:45 -0700 (PDT) From: AKASHI Takahiro To: anastasiia_lukianenko@epam.com, oleksandr_andrushchenko@epam.com Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 2/4] arch: arm/xen: add putc() for debugging Date: Thu, 15 Oct 2020 13:25:14 +0900 Message-Id: <20201015042516.41197-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015042516.41197-1-takahiro.akashi@linaro.org> References: <20201015042516.41197-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This new function, xen_debug_putc(), is intended to be used to enable CONFIG_DEBUG_UART on xen guest. Please note that the underlying functionality in Xen is available only when Xen is configured with !NDEBUG but is much simpler than a generic HYPERVISOR_console_io(). Signed-off-by: AKASHI Takahiro Reviewed-by: Peng Fan --- arch/arm/include/asm/xen/hypercall.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h index a4fd077079a9..121ccfcc608f 100644 --- a/arch/arm/include/asm/xen/hypercall.h +++ b/arch/arm/include/asm/xen/hypercall.h @@ -19,4 +19,10 @@ int HYPERVISOR_sched_op(int cmd, void *arg); int HYPERVISOR_event_channel_op(int cmd, void *arg); unsigned long HYPERVISOR_hvm_op(int op, void *arg); int HYPERVISOR_memory_op(unsigned int cmd, void *arg); + +static inline void xen_debug_putc(int c) +{ + register int v __asm__ ("x0") = c; + __asm__ __volatile__("hvc 0xfffe" : "=r" (v) : "0" (v)); +} #endif /* _ASM_ARM_XEN_HYPERCALL_H */ From patchwork Thu Oct 15 04:25:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1382448 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tPrQqmLc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBbnp0Fvqz9sTL for ; Thu, 15 Oct 2020 15:26:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D7F83823C4; Thu, 15 Oct 2020 06:25:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tPrQqmLc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DA84F823CC; Thu, 15 Oct 2020 06:25:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 473BE82300 for ; Thu, 15 Oct 2020 06:25:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x1041.google.com with SMTP id j8so1129851pjy.5 for ; Wed, 14 Oct 2020 21:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+woduzzEJxbTl/zLgO3juCiCTY6WHwko9iK83upDIbw=; b=tPrQqmLcpECf8q3J/Rtb8aDsgpd2IzoqxEgJU+YkEHl+J0PnEt/GFDvop3jbqQ5sxa 6zAvnx9i1A8OE+M7mY/KwDubQ9dxYK5/NgusM5sS955/kn6tjLo4pNSKc/W6AnXwtTxb Cq8JZQY/cv/fRNUflqdKv5uBeOB6YruKs2hFlhsHYPrlV137wILVRoiByuhpq55KSq34 IpxKRr4XAZyEECwxBr/AB5vn3G17047bA+8IatgXad9QY3bB5RMkwy14cesvs/qCwkJG RpI+X7MFyHh67uI0ynLYMtQybnJaOV3d9h1VyaW6c1qXvD2r2Iil3Tky3SMIm8KlHGXa sLtA== 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:mime-version:content-transfer-encoding; bh=+woduzzEJxbTl/zLgO3juCiCTY6WHwko9iK83upDIbw=; b=UpZexCi7t3G/Okr35hYrOzezJr9RBj6Bggvv9nbfd5Q/mrBMC6+C5r1lj2J018OuGh guDFAwweR4SsGcxKT5IXLmRG8SZjTwMPzwRzzVKfhukAocdkJK9xN5wigA+ASKeDiTTz tBaBlysfsTjpUmvhVSiN+EKN5kV3HQfspdIaOt8dis/2FAoMD+NavOTOjm/hr1ArCuKI bg90vFFP26dI8zkCZo3P0iGrzKQUZea1BPaJUzECfsJuK7c8uJWq7lo0FEASYUC+toKp 2J+ZDZ6q/75bRUs8pbZ+ZlcYelf7Cd9D5g6xiDb80mgvKXtTiipbvl+2sbA38tvd2ZYO TJnA== X-Gm-Message-State: AOAM531ODmocpFYh46WnwWrBXKVMvCeOuihyce6cxVEaV1sr1XTsbibE +nUVutkm8Cegx5+YbPGXWWkSEg== X-Google-Smtp-Source: ABdhPJyTUwKticZjN+X0lm0XMrP5CIeFQ0JfqhAaeUi1LmvfwL4cAbna8Ghh9uwWmbcxoHKmQQoKyA== X-Received: by 2002:a17:90a:a505:: with SMTP id a5mr2410789pjq.76.1602735948888; Wed, 14 Oct 2020 21:25:48 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id w17sm1306489pga.16.2020.10.14.21.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 21:25:48 -0700 (PDT) From: AKASHI Takahiro To: anastasiia_lukianenko@epam.com, oleksandr_andrushchenko@epam.com Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 3/4] xen: add definitions for console_io Date: Thu, 15 Oct 2020 13:25:15 +0900 Message-Id: <20201015042516.41197-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015042516.41197-1-takahiro.akashi@linaro.org> References: <20201015042516.41197-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Those definitions added are used with HYPERVISOR_console_io(). Signed-off-by: AKASHI Takahiro Reviewed-by: Peng Fan --- include/xen/interface/xen.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index eec8ab75b9ce..a7c8ed781b34 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h @@ -76,6 +76,12 @@ #define __HYPERVISOR_arch_6 54 #define __HYPERVISOR_arch_7 55 +/* + * Commands to HYPERVISOR_console_io(). + */ +#define CONSOLEIO_write 0 +#define CONSOLEIO_read 1 + #ifndef __ASSEMBLY__ typedef u16 domid_t; From patchwork Thu Oct 15 04:25:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1382449 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Do0tpheU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBbp05vcQz9sTL for ; Thu, 15 Oct 2020 15:26:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3EFA823DD; Thu, 15 Oct 2020 06:25:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Do0tpheU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4AAF7823DE; Thu, 15 Oct 2020 06:25:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A0796823C9 for ; Thu, 15 Oct 2020 06:25:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x1042.google.com with SMTP id a1so1140027pjd.1 for ; Wed, 14 Oct 2020 21:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n6zhHXf14PTvan9difWQHk+Wdx9Y8KOQYIWTF+AlerE=; b=Do0tpheU/ninx8JAbGXgis0Lk2mtlAc7/565xupclnCvPYRfwx+m+U/GkB0u10VqjS 8DSf288GvVMQXgEX7Noh21qDsE/0eCG7gn+tqlGda6DeNM/bgmL+QB8NaEsPWbN11nIj Xi9o91lOBCt7kSzK4Mbm7FHf1yWKdQ/gvb3h9tB6XpRG/TX4frIJ6xB/XIEQceE2QVX4 j2kr50JaI4hb5nKBW5IDwpbfYy9KbB0PPNFpn0Eh1ykObmar5wnrzjw+ucBrbgk1ElG+ pF8KMBHH/mT/Rw0fLS+ll/8Wh/ufwmZCnxjPzh2mpdirFUYWT1eAbN/bzGoRAIVb6HZ9 H2cQ== 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:mime-version:content-transfer-encoding; bh=n6zhHXf14PTvan9difWQHk+Wdx9Y8KOQYIWTF+AlerE=; b=Vqp3Yo8+blEsKPUrBq9YlHURl8ii5xrYiE1oJ4FSlf3B6aUM4AVihH16kXGrkMmZIr 2x+pGgNzZjjXrRt3KckcEHOVRkbXoe8J9AMJZvyw2/Zz3cNFrY0eeIcq8aQYI7zbZN9z LTvNvP9JKNrx3tnTQjhI1qC3f/pGiic+uPMI6+9AjpL/he8itRSgckZKw+HSzrIUBGKH BVgyThKL1ElK2S6/kaaZ367flMtMuxgjXn6RvyRurwT1j9IU2YjPY0/0gnyCJBN5ojQ8 EIXIoJlzW3cQJiRE9tSNtD7bUopJ99Hm3omz5vYv8y21HLhYlTk99Mn1qWtPHwgi9zXu nkmA== X-Gm-Message-State: AOAM531Napk2Ixxff/3pD+yCR2f1FlSaKurVbvXiu2vi6uvSqm8cZ+LK cEg8xiKCdIiKRqoC5O/aEbTMcw== X-Google-Smtp-Source: ABdhPJyKF64afArYKPrO5pB6zv8jCkm6s7A9Tq8kjBErwPQHEkzDYaaorjhvyoUFV7hDmZK4IGS3LA== X-Received: by 2002:a17:90a:d341:: with SMTP id i1mr2575862pjx.18.1602735951197; Wed, 14 Oct 2020 21:25:51 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id w17sm1306489pga.16.2020.10.14.21.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 21:25:50 -0700 (PDT) From: AKASHI Takahiro To: anastasiia_lukianenko@epam.com, oleksandr_andrushchenko@epam.com Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 4/4] serial: serial_xen: add DEBUG_UART support Date: Thu, 15 Oct 2020 13:25:16 +0900 Message-Id: <20201015042516.41197-5-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015042516.41197-1-takahiro.akashi@linaro.org> References: <20201015042516.41197-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean By using a hypervisor call, we can implement DEBUG_UART on xen. This will allow us to see messages even earlier than serial_init(). Signed-off-by: AKASHI Takahiro --- drivers/serial/Kconfig | 14 +++++++++++--- drivers/serial/serial_xen.c | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index e344677f91f6..536cf0641773 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -401,11 +401,19 @@ config DEBUG_UART_MTK driver will be available until the real driver model serial is running. +config DEBUG_UART_XEN + bool "XEN Hypervisor Console" + depends on XEN_SERIAL + help + Select this to enable a debug UART using the serial_xen driver. You + will not have to provide any parameters to make this work. The driver + will be available until the real driver-model serial is running. + endchoice config DEBUG_UART_BASE hex "Base address of UART" - depends on DEBUG_UART + depends on DEBUG_UART && !DEBUG_UART_XEN default 0 if DEBUG_UART_SANDBOX help This is the base address of your UART for memory-mapped UARTs. @@ -415,7 +423,7 @@ config DEBUG_UART_BASE config DEBUG_UART_CLOCK int "UART input clock" - depends on DEBUG_UART + depends on DEBUG_UART && !DEBUG_UART_XEN default 0 if DEBUG_UART_SANDBOX help The UART input clock determines the speed of the internal UART @@ -427,7 +435,7 @@ config DEBUG_UART_CLOCK config DEBUG_UART_SHIFT int "UART register shift" - depends on DEBUG_UART + depends on DEBUG_UART && !DEBUG_UART_XEN default 0 if DEBUG_UART help Some UARTs (notably ns16550) support different register layouts diff --git a/drivers/serial/serial_xen.c b/drivers/serial/serial_xen.c index ed191829f059..34c90ece40fc 100644 --- a/drivers/serial/serial_xen.c +++ b/drivers/serial/serial_xen.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include #include @@ -15,11 +16,14 @@ #include #include +#include #include #include #include #include +#include + DECLARE_GLOBAL_DATA_PTR; u32 console_evtchn; @@ -178,3 +182,19 @@ U_BOOT_DRIVER(serial_xen) = { .flags = DM_FLAG_PRE_RELOC, }; +#if defined(CONFIG_DEBUG_UART_XEN) +static inline void _debug_uart_init(void) {} + +static inline void _debug_uart_putc(int c) +{ +#if CONFIG_IS_ENABLED(ARM) + xen_debug_putc(c); +#else + /* the type cast should work on LE only */ + HYPERVISOR_console_io(CONSOLEIO_write, 1, (char *)&ch); +#endif +} + +DEBUG_UART_FUNCS + +#endif