Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3712650iob; Tue, 17 May 2022 05:59:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrCNmDtGDi0BhQNNbAXSQy0dgO0aKwlILR+AaTo7lADypw0ntwcfyRvGry8CZFaWHNfspQ X-Received: by 2002:a17:902:d50c:b0:15e:9455:19b2 with SMTP id b12-20020a170902d50c00b0015e945519b2mr21869929plg.140.1652792370150; Tue, 17 May 2022 05:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652792370; cv=none; d=google.com; s=arc-20160816; b=umsWHokg57XBHYKOhIRNX8Y7bCovyg7+Ajxe2+iVYcGh4HXI8K13PV2r309lM4YjQ0 usGA38yfgd0Hy0Kh89WGFs6z4fJk4JThAgH2u3pfi6Rde1VeMYw8qDlYPWQ0/mcVYlfc PbnmlTczom+2fo3QxY25DpNNBfJN0+0Qd2YUjxYGtUty+clHnZyhWQiMkBeYq4h9gOv5 yqFoPZuypmLiVUaocAM42zN5TOauhTIruQP3fM1oUOpmdbSj9VAmmHyEH9s1bz8oHfjQ dM3WZgm5weIfAdZa3418bOF/gqlrVZtsTRfhUXKQZNqUESSGUYIW9zatc2Qp4yq6albw /AZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8oLADI5NiHsnQbc73WheH/PuvP/+QEln3IGTPYBBAzo=; b=ZxrC4fTLg+tEV2ayDAxlTk6ZGE+qj6x3kJXPDHcZPfAZAd3cirQiOWVCZvA10FPPUJ x5wPKlUHn33G5ioPfTs/xGVjmXqkNfDcumojtzILDdmOOJEl+88yd9nv03QQadEXxig/ SLNyKemcwSzJDAIYjSMtWSggF9HXhaR9ksfwOlu6EsZV0pIccqw5eoHaGQZhJdOtac/9 pTJRX1GSEN1rGCL4YhOBZRy17RxSY6WCBsYij3FoQ8zh15EO+I6EgUPklo5w/BTMV8vG G+taWjr+qmAPhz7Gm0mcgHiJDncIdlEcZza8jj6fj5dIUoY4Lk2K+4JT+xGmZ563Wyi7 W1Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="V/+CTtde"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020aa792cb000000b005104fe7eeefsi14607763pfa.108.2022.05.17.05.59.18; Tue, 17 May 2022 05:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="V/+CTtde"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238786AbiEQAzv (ORCPT + 99 others); Mon, 16 May 2022 20:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237820AbiEQAzj (ORCPT ); Mon, 16 May 2022 20:55:39 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9497F369D4 for ; Mon, 16 May 2022 17:55:36 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id t11-20020a17090a6a0b00b001df6f318a8bso958517pjj.4 for ; Mon, 16 May 2022 17:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8oLADI5NiHsnQbc73WheH/PuvP/+QEln3IGTPYBBAzo=; b=V/+CTtdeJnUKuXDCGH6M/X0W1zvVeJof1JXCsrKIids9z9JZ0SgI935DIS00Y83oA+ R3yny+ba7IvenXfqyNazXP5CC4Jd8WKgUa8iZmwPzNRN+I7bhT1OiMtWPRzaTgrogyrW LZvO688C9uYRdqu63tP1pscsxGUShlhNU3C811xEUwV44ydjjkkMRCkvxiytyIW2+hfP FRRj4HDrp0m2dS5skBKX+IeF9lcN/BYkhAmj5btvClQbZggmvmGlMLk3MDgO8ZBkNTvw 2zGQxX5kecmDtmagEN+oXedLmt6Tl44L4R3xjwtSo9Dx7P6JDQoR58jKmbRVncpXZJMK ojSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8oLADI5NiHsnQbc73WheH/PuvP/+QEln3IGTPYBBAzo=; b=o2dL5Ii1FnoAjM5igiKaAeDYXItVD7TBCozlD2SCfMKgmIuefE4PXqS9SmSARhr1R0 djbEPbaMHPOyw0iTNUcW/ik61uE8crIpgC+1XHTf+IqW72ryA7tID/aWzeWl4E15JKHy qn+YvYC+GROqZj+zlf3l/Rfl7tjEPxMBI2oBqkGCGWW1ENW/LoxDucboPk4dilev3pKm tS/zjFquVWE5hJwvRJ3cpmZ85l1Mxdn0N758lSEYJeitp4/Zs/Sb47km5k+Y1ve2MU7v SvoKRm1lTrknr0fIi+O50HniL1jDXDNpJEf80WzGEwaDnVBcv/YGjJT1hLAAnAQ8XxL+ pqIg== X-Gm-Message-State: AOAM533pkE7joiiaNY6X7wte5y2RMmTEmGDHwmRvgp1fq67M+IChkri8 cz6WNo/sdA4UBz/LpsKkzoEhcJHoRp8= X-Received: by 2002:a17:903:2481:b0:15f:249c:2006 with SMTP id p1-20020a170903248100b0015f249c2006mr20168453plw.31.1652748935585; Mon, 16 May 2022 17:55:35 -0700 (PDT) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id w8-20020a170902e88800b0015e8d4eb28fsm7633165plg.217.2022.05.16.17.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 17:55:34 -0700 (PDT) From: Stafford Horne To: LKML Cc: Openrisc , Stafford Horne , Jonas Bonn , Stefan Kristiansson , Randy Dunlap Subject: [PATCH v2 03/13] openrisc: Add support for liteuart emergency printing Date: Tue, 17 May 2022 09:55:00 +0900 Message-Id: <20220517005510.3500105-4-shorne@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220517005510.3500105-1-shorne@gmail.com> References: <20220517005510.3500105-1-shorne@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support for sending emergency print output, such as unhandled exception details, to a liteuart serial device. This is the default device available on litex platforms. If a developer want to use this they should update UART_BASE_ADD to the address of liteuart. Signed-off-by: Stafford Horne --- Changes since v1: - Update for patch 2/12 ifdef changes arch/openrisc/kernel/head.S | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index 7bfa6e4b60c5..21db50563f97 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S @@ -1555,7 +1555,18 @@ ENTRY(_emergency_putc) l.movhi r4,hi(UART_BASE_ADD) l.ori r4,r4,lo(UART_BASE_ADD) -#if defined(CONFIG_SERIAL_8250) +#if defined(CONFIG_SERIAL_LITEUART) + /* Check OFF_TXFULL status */ +1: l.lwz r5,4(r4) + l.andi r5,r5,0xff + l.sfnei r5,0 + l.bf 1b + l.nop + + /* Write character */ + l.andi r7,r7,0xff + l.sw 0(r4),r7 +#elif defined(CONFIG_SERIAL_8250) /* Check UART LSR THRE (hold) bit */ l.addi r6,r0,0x20 1: l.lbz r5,5(r4) -- 2.31.1