From owner-svn-src-head@freebsd.org Fri Sep 30 04:16:51 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 185DDC03FCB; Fri, 30 Sep 2016 04:16:51 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-vk0-x22c.google.com (mail-vk0-x22c.google.com [IPv6:2607:f8b0:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3C35189F; Fri, 30 Sep 2016 04:16:50 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-vk0-x22c.google.com with SMTP id z126so93726325vkd.0; Thu, 29 Sep 2016 21:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Uv4Id/A1NAbrWW6Wd7SFcQPK5w9gxO5ohF4Zg/qgeoU=; b=M4UjEUR5vbZi35KrGIiRUjNzXk5X6/4pB4WYD+VccFIofYMaPJtHuDeXeu9chhVWF0 3shwtz+IvrpgHV8doVcOi6M3qImKZgtTWs4UhTx8fy6amK2P5NDER8nI8kI9OGrkqtzE xYhh9wxGfzlJfcmQP/DU9GmdFdDT++85riIsEvrK7jIdApkuTAYPNnel2EcBgrKx2AuA O57WOVpsoaAUnP/nQFsslKUNRXfit1OHnirZjqKORAiKohyDHJmWKnm2fhYZcqDclgnG wr3FhdIisGxRI3D2B+prgdZZx9QUw2+RVKVPZ3PLlUKSXec73SfgHXEMPc5DJsweprEv p5+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Uv4Id/A1NAbrWW6Wd7SFcQPK5w9gxO5ohF4Zg/qgeoU=; b=MjKFg6uZ41Ig6C1LNUKZCbk5r6qi3VweqEuoSo6TAypZaBmgBXx6+qJT8OFYl5RMLD 0sNqIkY4IXnPXHz9HSInnEm/ERvi5s0r/4gtmJ6gNIFjJiAmVaYcgGBt/UAtHt/mBZNR fkqBT0gRutyT1Cf0NSap8KuZpA/Wq9KeoTj0G/RQ6R2YuPgosC2T3WMf2O+h4XS9tAAv nOq1eWdo+h4ms8YRdSEs/TLj3ZwIPahIuUY0fajKCPP07aGfz4qESppiZhJnN1WMQwuc p0mf5cYp+s0TmVZSQbEv7sW0Fo213mw9U1lexPqhpry2/qnVZupT/ds6qUvv9zOu78d7 nPOA== X-Gm-Message-State: AA6/9RmPnmHULsRQR0bZ5OYmjk5ewK6+A5p+TxFveIGAXWjpAOW06JoAjvSwlD7P3kkw9XT+GdWjURglQ8r4KA== X-Received: by 10.31.237.193 with SMTP id l184mr4216191vkh.56.1475209009442; Thu, 29 Sep 2016 21:16:49 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.103.72.141 with HTTP; Thu, 29 Sep 2016 21:16:48 -0700 (PDT) Received: by 10.103.72.141 with HTTP; Thu, 29 Sep 2016 21:16:48 -0700 (PDT) In-Reply-To: <889ba670-a36a-8b80-d9f9-8d8d23cce423@freebsd.org> References: <201609300248.u8U2meEe014568@repo.freebsd.org> <889ba670-a36a-8b80-d9f9-8d8d23cce423@freebsd.org> From: Justin Hibbits Date: Thu, 29 Sep 2016 23:16:48 -0500 X-Google-Sender-Auth: UuD5CKuSnfX5EnrtozVspm_fpAo Message-ID: Subject: Re: svn commit: r306473 - head/sys/dev/fdt To: Nathan Whitehorn Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:16:51 -0000 It's more cosmetic than anything else. I did realize a potential complication with it tonight, too, if newbus devices are created as children (like DMA channels in this case), and have the cell-index property. If you object it's an easy revert. - Justin On Sep 29, 2016 23:10, "Nathan Whitehorn" wrote: > 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", >> >> >