From owner-svn-src-head@freebsd.org Fri Sep 30 04:10:54 2016 Return-Path: Delivered-To: svn-src-head@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 DF4C0C03E0B; Fri, 30 Sep 2016 04:10:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 C6AFB1375; Fri, 30 Sep 2016 04:10:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u8U4Aj0v009955 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 29 Sep 2016 21:10:46 -0700 Subject: Re: svn commit: r306473 - head/sys/dev/fdt To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201609300248.u8U2meEe014568@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <889ba670-a36a-8b80-d9f9-8d8d23cce423@freebsd.org> Date: Thu, 29 Sep 2016 21:10:45 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <201609300248.u8U2meEe014568@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVY0zF/VhVBTqe4famJh7mb4GsbEYQzBG7EO29vN6PWut4FsMJ1K50jjFdby59WiI1oMBnH9KaHrANVm9wPns/NfkT3uEGafOcA= X-Sonic-ID: C;Astz3MOG5hGrFMEYTueg2w== M;GvS+3MOG5hGrFMEYTueg2w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 30 Sep 2016 04:10:55 -0000 I'm a little dubious about this change. It's not really safe to rely on newbus unit numbers anywhere, so making them meaningful in this context seems like a bad idea. -Nathan On 09/29/16 19:48, Justin Hibbits wrote: > Author: jhibbits > Date: Fri Sep 30 02:48:40 2016 > New Revision: 306473 > URL: https://svnweb.freebsd.org/changeset/base/306473 > > Log: > Use the cell-index property as the unit number if available. > > Summary: > NXP/Freescale, among others, includes an optional cell-index property > on nodes to denote the SoC block number of the node. This can be useful if, for > example, a node is disabled or nonexistent in the fdt, or the blocks are not > organized in address-sorted order. For instance, on the P1022, DMA2 is located > at CCSR offset 0xC000, while DMA1 is located at 0x21000. > > Reviewed By: jmcneill > > Differential Revision: https://reviews.freebsd.org/D8054 > > Modified: > head/sys/dev/fdt/simplebus.c > > Modified: head/sys/dev/fdt/simplebus.c > ============================================================================== > --- head/sys/dev/fdt/simplebus.c Fri Sep 30 01:42:29 2016 (r306472) > +++ head/sys/dev/fdt/simplebus.c Fri Sep 30 02:48:40 2016 (r306473) > @@ -265,6 +265,15 @@ simplebus_add_device(device_t dev, phand > > if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL) > return (NULL); > + > + /* > + * If the order is unspecified, use the cell-index field, if available. > + * The cell-index property is not part of any standard, but is widely > + * used in NXP/Freescale and Marvell device trees. > + */ > + if (order == -1) > + OF_getencprop(node, "cell-index", &order, sizeof(order)); > + > cdev = device_add_child_ordered(dev, order, name, unit); > if (cdev == NULL) { > device_printf(dev, "<%s>: device_add_child failed\n", >