From owner-freebsd-current@FreeBSD.ORG Wed Mar 13 17:51:16 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA27E90B for ; Wed, 13 Mar 2013 17:51:16 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ob0-x22e.google.com (mail-ob0-x22e.google.com [IPv6:2607:f8b0:4003:c01::22e]) by mx1.freebsd.org (Postfix) with ESMTP id BA588A63 for ; Wed, 13 Mar 2013 17:51:16 +0000 (UTC) Received: by mail-ob0-f174.google.com with SMTP id 16so1319847obc.33 for ; Wed, 13 Mar 2013 10:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=yHm+iqWcV5zhVCLCf0txwcLXb6Bgok/YFenYIAhP6Y4=; b=iFrLjAoR9hlU4cDAfGNRognWCm9p59r9AmLs893dPFeTCqMm81pioTk8I3WYMb5UHu fbnqxMLnOUo9/BsWz4Ecxdu9QAlATO5hlPPvMV9JwYZJi7uQMb/zNvPcsYd12nzzxX8P mfuIHoGa0oZK5fkqwMZQxNFncIPHHxgvqxCuEiaEbBEDo+od3X5HW1bJCJH8LJzSMFUo 1eEKEU95VVsXn4yx5J/SvBjZQtx6n/c1BUgQmm8V55QfNO49MgcVvQAeZJ66dW19IRDg fDetmZl1/S0wp/XNefsmb81S89Ve7x8SuxgF3czsQ0Vk4IbB4fapOqnjgOlfOReV8Cvi 9g5A== MIME-Version: 1.0 X-Received: by 10.60.18.233 with SMTP id z9mr16072101oed.19.1363195767930; Wed, 13 Mar 2013 10:29:27 -0700 (PDT) Received: by 10.76.109.236 with HTTP; Wed, 13 Mar 2013 10:29:27 -0700 (PDT) Date: Wed, 13 Mar 2013 13:29:27 -0400 Message-ID: Subject: [PATCH] Add support for Exar XR17V358IV to puc(4) From: Ryan Stone To: FreeBSD Current Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2013 17:51:17 -0000 I've implemented support for Exar XR17V358IV 8-port UARTs. These are quite similar to previous Exar UARTs, with the notable exception of the strange 125MHz clock. I've done some basic testing using it as a tty at 9600 baud and 115200 baud, but nothing really extensive. I can't seem to find any tools for stressing out serial ports. I'm not sure if anybody has any suggestions for this. I plan to commit this within a couple of days if nobody has any objections. I'll try to get it MFC'ed for 8.4-RELEASE, The patch can be found here: http://people.freebsd.org/~rstone/patches/exar_358.diff I've also included it inline in case anybody wants to review it: commit d1da80b5c90b3ae5a44db165cb032e9e86d2c804 Author: Ryan Stone Date: Mon Mar 11 17:02:13 2013 -0400 add support for Exar XR17V358IV 8-port serial port to puc(4) diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c index 6d933e8..34d6986 100644 --- a/sys/dev/puc/pucdata.c +++ b/sys/dev/puc/pucdata.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; +static puc_config_f puc_config_exar_pcie; static puc_config_f puc_config_icbook; static puc_config_f puc_config_moxa; static puc_config_f puc_config_oxford_pcie; @@ -630,6 +631,13 @@ const struct puc_cfg puc_pci_devices[] = { PUC_PORT_8S, 0x10, 0, -1, }, + { 0x13a8, 0x0358, 0xffff, 0, + "Exar XR17V358IV", + 125000000, + PUC_PORT_8S, 0x10, 0, -1, + .config_function = puc_config_exar_pcie + }, + { 0x13fe, 0x1600, 0x1602, 0x0002, "Advantech PCI-1602", DEFAULT_RCLK * 8, @@ -1186,6 +1194,17 @@ puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, } static int +puc_config_exar_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + if (cmd == PUC_CFG_GET_OFS) { + *res = port * 0x400; + return (0); + } + return (ENXIO); +} + +static int puc_config_icbook(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) {