Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 2020 18:54:19 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r356923 - stable/11/sys/dev/uart
Message-ID:  <202001201854.00KIsJoo048219@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Mon Jan 20 18:54:19 2020
New Revision: 356923
URL: https://svnweb.freebsd.org/changeset/base/356923

Log:
  MFC r336623 by mmacy:
  
  Fixes the interrupt storm in UART during the boot on ARMADA38X.  The missing
  attribution of ns8250->busy_detect breaks the UART support.
  
  Original commit 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"
  
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/dev/uart/uart_dev_ns8250.c
  stable/11/sys/dev/uart/uart_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c
==============================================================================
--- stable/11/sys/dev/uart/uart_dev_ns8250.c	Mon Jan 20 18:43:10 2020	(r356922)
+++ stable/11/sys/dev/uart/uart_dev_ns8250.c	Mon Jan 20 18:54:19 2020	(r356923)
@@ -479,6 +479,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;
 	if (!resource_int_value("uart", device_get_unit(sc->sc_dev), "flags",

Modified: stable/11/sys/dev/uart/uart_subr.c
==============================================================================
--- stable/11/sys/dev/uart/uart_subr.c	Mon Jan 20 18:43:10 2020	(r356922)
+++ stable/11/sys/dev/uart/uart_subr.c	Mon Jan 20 18:54:19 2020	(r356923)
@@ -47,6 +47,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,
@@ -122,6 +123,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;
@@ -177,6 +182,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
@@ -240,6 +246,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001201854.00KIsJoo048219>