From patchwork Mon Jan 18 16:36:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 8057001 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 87F3BBEEE5 for ; Mon, 18 Jan 2016 18:11:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7801020483 for ; Mon, 18 Jan 2016 18:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30DF120461 for ; Mon, 18 Jan 2016 18:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932123AbcARSKN (ORCPT ); Mon, 18 Jan 2016 13:10:13 -0500 Received: from mail-bn1bon0094.outbound.protection.outlook.com ([157.56.111.94]:34929 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756068AbcARSKG (ORCPT ); Mon, 18 Jan 2016 13:10:06 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ganapatrao.Kulkarni@caviumnetworks.com; Received: from mypc.cavium.com.com (111.93.218.67) by BY1PR0701MB1691.namprd07.prod.outlook.com (10.162.110.29) with Microsoft SMTP Server (TLS) id 15.1.365.19; Mon, 18 Jan 2016 16:37:05 +0000 From: Ganapatrao Kulkarni To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v9 2/6] Documentation, dt, arm64/arm: dt bindings for numa. Date: Mon, 18 Jan 2016 22:06:01 +0530 Message-ID: <1453134965-6125-3-git-send-email-gkulkarni@caviumnetworks.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1453134965-6125-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1453134965-6125-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0010.INDPRD01.PROD.OUTLOOK.COM (25.164.117.17) To BY1PR0701MB1691.namprd07.prod.outlook.com (25.162.110.29) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 2:B2fUOy09jumf1JzhDXtmgQ40SPCyt8PdFwj6W4IHqpWvCHxwdKigG8/REe8hD+d71HPXQLuMaeT3UpueuvslU1+JVFwKTYrhjzGxIaVS3iiq7t0VoCsmvwkAJNZiNcHt/AfjeduWNEXHQhfZyArSCQ==; 3:6bTCcERqcmRzWOFMuk8/CkOVNRj2KpyNJeQlLt96BbvxRmUlCQjzo/RRXK/6POIX433Bb4TV+ubJA8poJoh+YuDmoPugSoctwHfmgH47rmqv5hpU7WR2Q2WXl4su3gDx; 25:iNfFlPFFf6Rc1veXPK6sfObaQLCehmDXk/nRkS8ggIikgCWRR+UjRhePp58xNRoTT4KdaDmgiFkFu1VQiV26I+KeteEkPNrwqGnnhbxjstbaQxy4yNBPjT1D9prS7IkhTu84a/yMSUBgMDN8u8uKIpDw0L+SVgqQUGKNMY0PPrmub+zRb5H9kRKjF1ViUd52MLznEiyeqsNvz+//tZBXElcr6TjUiQX90d6u0YN2/uNJSngpsjSkD5umcCUe1VIH X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1691; X-MS-Office365-Filtering-Correlation-Id: 140cb053-87a8-4614-ce35-08d320259f9d X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 20:GBwKImHclwHjJxydnm7+ZKOSNz+oLFPahTZ52i5ouLLWc57sjgdwRDAorIWEn1wURcMUH8VMrMqGh2QPhQljn4/bk2wFrNV08g600WQ97yqQhQn7Ae/1xYT74gJ6Vq5eoB7/VzPscjHXN3RgmjP9FDA4tZnswpkNnzvIjpUGNU8tqyc4n3EL5xnANWS3sGFWVwf1iGMBy6v5Darxuc1ocXI0RIGrHN56Kkag8U0A8GG94OpMfNNIyGzGF7YTuWt4jiOe2pW28DYGKZLfpqDLJLiSg1oqqJvoxnbf/4c0x9F2Wm7x86OTmmVBd/OjSf7TFZFmuJP/6RMZh7WYDvGdqcAzQ57KnzQCtsqQUmeblYX/A6LEd4e1OxKT5mx/4Vm2CGpY5k23eOs5gZzEafNkZpsbhkdzyiwGKED7bTS6+AGl24mLysO7KsmfFgVE0sZVxfeyAZSGUnBk6Ur6Wpp1Cg73ZYZu+yONIZu4CpwYEs7E0BUhbs3I/1bVszaM3mueniEOikigJfsBuaay+eDUTgLEiW2Ms67j1xQ46EuXiJ+SSKib4FsToSWTjW4RpVRBE7wxdpmgKE1+slhcPfCBe+inWhcs97ZrvGEOMw4oJbg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:BY1PR0701MB1691; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1691; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 4:NUSbe+gan9g+Xs7OUGC+WheqH/moB/HJDfr+K2Z52o8Z+5e4fyuN38H89Y644nCLTjapqogHwXXj69vXW6nfzfmcsc4z2PRr5BFPuZEnFIXcpgrqIVcdaVNAeF2pRs+LxfnisRCEale0DqXCbyM4Xs/fPhkPfuiEVhPS29cLZOQqe/f3qI5gRlFNsCFlAgK44F0NjyRfK1Bcg15cRHHQJB0No7SOAd3cyyzHu2h2cnOWC6b/VAIhVh3mMNEg0apTyuE4UwEHUxGgu0a7ln1w0ZUAwtf2UEgCgWwiv803L4nE2hb2Q12r3anE/WeCsC3Hh5yWGSOvkdykSN5uoKRG5p5yOLeenQXr4/+wnkf4wsiGgEjAFzkd6VSw7zADMYwr X-Forefront-PRVS: 08252193F3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(199003)(189002)(5009440100003)(87976001)(66066001)(4326007)(6116002)(5008740100001)(2201001)(1096002)(36756003)(3846002)(586003)(189998001)(19580395003)(47776003)(5004730100002)(50466002)(2441003)(50226001)(19580405001)(76176999)(48376002)(97736004)(101416001)(50986999)(5001770100001)(5003940100001)(4001450100002)(33646002)(229853001)(92566002)(2906002)(40100003)(105586002)(42186005)(77096005)(106356001)(122386002)(2950100001)(7099028)(921003)(83996005)(1121003)(2101003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1691; H:mypc.cavium.com.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1691; 23:yXqO/LvHyPwaQ/pxeqdpoMUjTQQ4JlrSB4tJ43F?= =?us-ascii?Q?xE4aOHvYtk1z98Rgtd0yDt/uya19+kvX8Au9NCBLB/79912Up13JuYme47O2?= =?us-ascii?Q?clPtTxoWA/rJjqaz9w2bZ4XhUkkRiduutUnlcGAeg4S4uYryOCZIJdNt0QY3?= =?us-ascii?Q?wPcERIIvqudImjYGbtCWpGZbzhpTfNvOqGRpHf5JRnHbhypIsQTyaI27wjR1?= =?us-ascii?Q?9wd50wOLEGNguVFszXf1ekVK3HhJHK/e7HMyyDcDPbTvOLjAtsKxFgL3Ue8U?= =?us-ascii?Q?PB6ks+T1bYVKvxp7Z3SLUiYxXSX5wu82f4iKEpN1BF4ntXyipz809vLqaILr?= =?us-ascii?Q?qi5b7opCRmdY6Rj57c4lnIuJc1/soEPgKFSdAqJfxpgnMvaYLSA4+yJ/qjn8?= =?us-ascii?Q?uzdMdmXaMELgl+flsKndsOjSyvmSM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w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 5:lZbTubyqNLyAvCpBQh43FN2TRG4KS373QQOwfb2rsM2pZepRjOZi2wkfT+bm706Si8InvhH6FXTI8IETuJfVfRHwQVyYd5XFXPG/mpRKLdx/v8M/mJQJQlPruLWssPgX1LgmIOkpZgSK9+XHVwzv3A==; 24:8sqVLInioPTC2VNvhqXYZiVDOAIE3WSdOS4nx7q10wSP8YSy649dpRAmE40FVqGzjpWRnxzcUz2d6VL8k2/2B3U2qWolCYpCrC7qAXYEQBk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2016 16:37:05.4104 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1691 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DT bindings for numa mapping of memory, cores and IOs. Reviewed-by: Robert Richter Signed-off-by: Ganapatrao Kulkarni --- Documentation/devicetree/bindings/arm/numa.txt | 272 +++++++++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/numa.txt diff --git a/Documentation/devicetree/bindings/arm/numa.txt b/Documentation/devicetree/bindings/arm/numa.txt new file mode 100644 index 0000000..734e5b4 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/numa.txt @@ -0,0 +1,272 @@ +============================================================================== +NUMA binding description. +============================================================================== + +============================================================================== +1 - Introduction +============================================================================== + +Systems employing a Non Uniform Memory Access (NUMA) architecture contain +collections of hardware resources including processors, memory, and I/O buses, +that comprise what is commonly known as a NUMA node. +Processor accesses to memory within the local NUMA node is generally faster +than processor accesses to memory outside of the local NUMA node. +DT defines interfaces that allow the platform to convey NUMA node +topology information to OS. + +============================================================================== +2 - numa-node-id +============================================================================== + +For the purpose of identification, each NUMA node is associated with a unique +token known as a node id. For the purpose of this binding +a node id is a 32-bit integer. + +A device node is associated with a NUMA node by the presence of a +numa-node-id property which contains the node id of the device. + +Example: + /* numa node 0 */ + numa-node-id = <0>; + + /* numa node 1 */ + numa-node-id = <1>; + +============================================================================== +3 - distance-map +============================================================================== + +The device tree node distance-map describes the relative +distance (memory latency) between all numa nodes. + +- compatible : Should at least contain "numa-distance-map-v1". + +- distance-matrix + This property defines a matrix to describe the relative distances + between all numa nodes. + It is represented as a list of node pairs and their relative distance. + + Note: + 1. Each entry represents distance from first node to second node. + The distances are equal in either direction. + 2. The distance from a node to self (local distance) is represented + with value 10 and all internode distance should be represented with + a value greater than 10. + 3. distance-matrix should have entries in lexicographical ascending + order of nodes. + 4. There must be only one device node distance-map which must reside in the root node. + +Example: + 4 nodes connected in mesh/ring topology as below, + + 0_______20______1 + | | + | | + 20 20 + | | + | | + |_______________| + 3 20 2 + + if relative distance for each hop is 20, + then internode distance would be, + 0 -> 1 = 20 + 1 -> 2 = 20 + 2 -> 3 = 20 + 3 -> 0 = 20 + 0 -> 2 = 40 + 1 -> 3 = 40 + + and dt presentation for this distance matrix is, + + distance-map { + compatible = "numa-distance-map-v1"; + distance-matrix = <0 0 10>, + <0 1 20>, + <0 2 40>, + <0 3 20>, + <1 0 20>, + <1 1 10>, + <1 2 20>, + <1 3 40>, + <2 0 40>, + <2 1 20>, + <2 2 10>, + <2 3 20>, + <3 0 20>, + <3 1 40>, + <3 2 20>, + <3 3 10>; + }; + +============================================================================== +4 - Example dts +============================================================================== + +2 sockets system consists of 2 boards connected through ccn bus and +each board having one socket/soc of 8 cpus, memory and pci bus. + + memory@00c00000 { + device_type = "memory"; + reg = <0x0 0x00c00000 0x0 0x80000000>; + /* node 0 */ + numa-node-id = <0>; + }; + + memory@10000000000 { + device_type = "memory"; + reg = <0x100 0x00000000 0x0 0x80000000>; + /* node 1 */ + numa-node-id = <1>; + }; + + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu@000 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x000>; + enable-method = "psci"; + /* node 0 */ + numa-node-id = <0>; + }; + cpu@001 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x001>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@002 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x002>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@003 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x003>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@004 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x004>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@005 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x005>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@006 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x006>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@007 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x007>; + enable-method = "psci"; + numa-node-id = <0>; + }; + cpu@008 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x008>; + enable-method = "psci"; + /* node 1 */ + numa-node-id = <1>; + }; + cpu@009 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x009>; + enable-method = "psci"; + numa-node-id = <1>; + }; + cpu@00a { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x00a>; + enable-method = "psci"; + numa-node-id = <1>; + }; + cpu@00b { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x00b>; + enable-method = "psci"; + numa-node-id = <1>; + }; + cpu@00c { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x00c>; + enable-method = "psci"; + numa-node-id = <1>; + }; + cpu@00d { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x00d>; + enable-method = "psci"; + numa-node-id = <1>; + }; + cpu@00e { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x00e>; + enable-method = "psci"; + numa-node-id = <1>; + }; + cpu@00f { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x00f>; + enable-method = "psci"; + numa-node-id = <1>; + }; + }; + + pcie0: pcie0@0x8480,00000000 { + compatible = "arm,armv8"; + device_type = "pci"; + bus-range = <0 255>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0x8480 0x00000000 0 0x10000000>; /* Configuration space */ + ranges = <0x03000000 0x8010 0x00000000 0x8010 0x00000000 0x70 0x00000000>; + /* node 0 */ + numa-node-id = <0>; + }; + + pcie1: pcie1@0x9480,00000000 { + compatible = "arm,armv8"; + device_type = "pci"; + bus-range = <0 255>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0x9480 0x00000000 0 0x10000000>; /* Configuration space */ + ranges = <0x03000000 0x9010 0x00000000 0x9010 0x00000000 0x70 0x00000000>; + /* node 1 */ + numa-node-id = <1>; + }; + + distance-map { + compatible = "numa-distance-map-v1"; + distance-matrix = <0 0 10>, + <0 1 20>, + <1 1 10>; + };