From owner-svn-src-all@freebsd.org Mon Jan 18 17:29:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEA42A86360; Mon, 18 Jan 2016 17:29:52 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDD4C1F02; Mon, 18 Jan 2016 17:29:52 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u0IHThSh007484 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 18 Jan 2016 09:29:44 -0800 Subject: Re: svn commit: r294280 - head/sys/dev/uart To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601181703.u0IH3Cxa031629@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <569D2107.8030302@freebsd.org> Date: Mon, 18 Jan 2016 09:29:43 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601181703.u0IH3Cxa031629@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYqxvjL9Jp4z4XBQYO4awuWv2WmrpgcTFnOwDQ9SG3wDBnN2rKz8Yk7Z4+piG3h4LHBLjIggmHcIixTE0m1hV3UMs+e5iVubdg= X-Sonic-ID: C;bAC8Dwm+5RGnH3tm14k5kQ== M;wjaEEAm+5RGnH3tm14k5kQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 17:29:53 -0000 Nice work! You can remove the #include in this file now, since it no longer depends on anything in dev/fdt. -Nathan On 01/18/16 09:03, Ian Lepore wrote: > Author: ian > Date: Mon Jan 18 17:03:12 2016 > New Revision: 294280 > URL: https://svnweb.freebsd.org/changeset/base/294280 > > Log: > Use OF_decode_addr() to create a bus_space tag and handle for the console > on FDT/OFW platforms. > > After the refactoring of the powerpc code so that OF_decode_addr() is usable > on all FDT/OFW platforms, this switches uart(4) to using it. > > Differential Revision: https://reviews.freebsd.org/D4675 > > Modified: > head/sys/dev/uart/uart_cpu_fdt.c > > Modified: head/sys/dev/uart/uart_cpu_fdt.c > ============================================================================== > --- head/sys/dev/uart/uart_cpu_fdt.c Mon Jan 18 16:54:26 2016 (r294279) > +++ head/sys/dev/uart/uart_cpu_fdt.c Mon Jan 18 17:03:12 2016 (r294280) > @@ -133,7 +133,6 @@ uart_cpu_getdev(int devtype, struct uart > struct uart_class *class; > phandle_t node, chosen; > pcell_t shift, br, rclk; > - u_long start, size, pbase, psize; > char *cp; > int err; > > @@ -212,16 +211,6 @@ uart_cpu_getdev(int devtype, struct uart > di->databits = 8; > di->stopbits = 1; > di->parity = UART_PARITY_NONE; > - di->bas.bst = uart_bus_space_mem; > > - err = fdt_regsize(node, &start, &size); > - if (err) > - return (ENXIO); > - err = fdt_get_range(OF_parent(node), 0, &pbase, &psize); > - if (err) > - pbase = 0; > - > - start += pbase; > - > - return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); > + return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh)); > } >