From owner-svn-src-head@freebsd.org Sun Jul 22 23:32:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3459B1032EB9; Sun, 22 Jul 2018 23:32:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA10D8A99C; Sun, 22 Jul 2018 23:32:22 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2B5414B44; Sun, 22 Jul 2018 23:32:22 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6MNWMpk061105; Sun, 22 Jul 2018 23:32:22 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6MNWMNp061103; Sun, 22 Jul 2018 23:32:22 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201807222332.w6MNWMNp061103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 22 Jul 2018 23:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336623 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 336623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2018 23:32:23 -0000 Author: mmacy Date: Sun Jul 22 23:32:21 2018 New Revision: 336623 URL: https://svnweb.freebsd.org/changeset/base/336623 Log: Add busy detect quirk to list of console options This change allows one to set the busy_detect flag required by the synopsys UART at the loader prompt. This is needed by the EPYC 3000 SoC. This will give users a working console up to the point where getty is required: hw.uart.console="mm:0xfedc9000,rs:2,bd:1" Reviewed by: imp MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D16399 Modified: head/sys/dev/uart/uart.h head/sys/dev/uart/uart_dev_ns8250.c head/sys/dev/uart/uart_subr.c Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Sun Jul 22 23:20:24 2018 (r336622) +++ head/sys/dev/uart/uart.h Sun Jul 22 23:32:21 2018 (r336623) @@ -44,6 +44,7 @@ struct uart_bas { u_int rclk; u_int regshft; u_int regiowidth; + u_int busy_detect; }; #define uart_regofs(bas, reg) ((reg) << (bas)->regshft) Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Sun Jul 22 23:20:24 2018 (r336622) +++ head/sys/dev/uart/uart_dev_ns8250.c Sun Jul 22 23:32:21 2018 (r336623) @@ -469,6 +469,7 @@ ns8250_bus_attach(struct uart_softc *sc) bas = &sc->sc_bas; + ns8250->busy_detect = bas->busy_detect; ns8250->mcr = uart_getreg(bas, REG_MCR); ns8250->fcr = FCR_ENABLE; #ifdef CPU_XBURST Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Sun Jul 22 23:20:24 2018 (r336622) +++ head/sys/dev/uart/uart_subr.c Sun Jul 22 23:32:21 2018 (r336623) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #define UART_TAG_RS 7 #define UART_TAG_SB 8 #define UART_TAG_XO 9 +#define UART_TAG_BD 10 static struct uart_class *uart_classes[] = { &uart_ns8250_class, @@ -124,6 +125,10 @@ uart_parse_tag(const char **p) { int tag; + if ((*p)[0] == 'b' && (*p)[1] == 'd') { + tag = UART_TAG_BD; + goto out; + } if ((*p)[0] == 'b' && (*p)[1] == 'r') { tag = UART_TAG_BR; goto out; @@ -179,6 +184,7 @@ out: * separated by commas. Each attribute is a tag-value pair with the tag and * value separated by a colon. Supported tags are: * + * bd = Busy Detect * br = Baudrate * ch = Channel * db = Data bits @@ -242,6 +248,9 @@ uart_getenv(int devtype, struct uart_devinfo *di, stru spec = cp; for (;;) { switch (uart_parse_tag(&spec)) { + case UART_TAG_BD: + di->bas.busy_detect = uart_parse_long(&spec); + break; case UART_TAG_BR: di->baudrate = uart_parse_long(&spec); break;