From patchwork Tue Nov 17 17:20:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 545689 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EE91D14076B for ; Wed, 18 Nov 2015 04:37:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751639AbbKQRhe (ORCPT ); Tue, 17 Nov 2015 12:37:34 -0500 Received: from mail-bn1bn0100.outbound.protection.outlook.com ([157.56.110.100]:32829 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751496AbbKQRhd (ORCPT ); Tue, 17 Nov 2015 12:37:33 -0500 X-Greylist: delayed 965 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Nov 2015 12:37:33 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ganapatrao.Kulkarni@caviumnetworks.com; Received: from mypc.cavium.com.com (111.93.218.67) by CY1PR0701MB1693.namprd07.prod.outlook.com (10.163.20.27) with Microsoft SMTP Server (TLS) id 15.1.325.17; Tue, 17 Nov 2015 17:21:33 +0000 From: Ganapatrao Kulkarni To: , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v7 2/4] Documentation, dt, arm64/arm: dt bindings for numa. Date: Tue, 17 Nov 2015 22:50:41 +0530 Message-ID: <1447780843-9223-3-git-send-email-gkulkarni@caviumnetworks.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1447780843-9223-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1447780843-9223-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR01CA0057.INDPRD01.PROD.OUTLOOK.COM (25.164.146.157) To CY1PR0701MB1693.namprd07.prod.outlook.com (25.163.20.27) X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1693; 2:27M9cg7XQYIcDnDJuoOENKrzUnrh1xxG5T03b7R5v4v8dzSzwI+6SSDkgYGWglgFE/JHUK1rx+pRztYKZvzhvQMwehf1HTox8NPPsMb3EF4b105fGVIFZ3rHpUgTlG85to/mcwnJDSvhYGRyx/l0YZlvU6CHCLI3fu+abkdFzXE=; 3:bi8IYiIHc5Ih3IVfLfU/mcNvFPade5V/uXfJJzabmntII7V8UGLpUjaK7B4Z8I57PyAJaAniObqQ7hVxtoBWidnxWNSI8id8S4u0ojo4zWYPvfy9fQ/wsnlIlU/g4Y4R6qrGvuwvO1XOgeGkp8f4gQ==; 25:EG+xsZvmmRkl6Y+SANbafOSSc5dAP9r02sHcTW9XQ19M75DJFuNuAaH91ez1Ht4pWXXOtTyxFsg1WGXg63lpFjHcvbsfehN0RHWZGeQjCZTLABLQfkYSCeMojTW4WOuqYzMNPzrHE/JAo1qwIMaWUSw2x6p1/AbYYISVPL7cUwKIEwfBAmsQuhI+xNxlIU4y9tT5LfyaFEEX5z3UCGYojvs81+0eSGKHxBqsLPJPQhQY58xgiAN2Iwev2QOBfouI3HMv6O7saA9nILgwLXTOfA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1693; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1693; 20:yf9IMAzsN08Af44xOGaWYrUbZZIMK7bE2NTWm2Mzyt7uq1cmXuVnjx57BYbrrWJexog7jYV9yGRrjloVIMj9GfS/YVW/YOduY/Zc57uGDJH6Y3ZH1Wsaskhs+TuYAxZv2yxylrrLnP5kz+obgfmG/sD18TSE/a/tKEqgT4wcaHWlUy2HOBCsM87IE5+X3FoX2ZtLoUajPFFojuX5tXJueAAPRkJQawfZLP0zUdTTIOi1UQnvZ95Y7N8oGkij+JRkVDiDwOF+w2kg6VIt7vD+M9e23kZWKsM7LV0wDW0RhaM6A9h6A+uEoBntlmc4SN54Bmvyum2urIIA9tEInFVZ0PgT5e5CVQb+1UAn92Z6g4+nO7j1i/+Q87KB0UclOoCLPhE7vfPUcK+iXGBQjK6sh0uboaOf8upPLWOx2pqwaov7KLP/1T5qy9AfLiom3RqaGAupNhA92gfOE09euR63JuDvxMfGv1cjWntRlPAEaRwgIhiAHGVZC14tCiTxzJTQV3w+87s3XKjXGD2eszoOWXsJhC7VxcMBuIcB8lfDTkXKQKEmQKiWMqVhV3FHTeLTIyYfwX6Txad+NDHhZKEMwsUI2yULN64XJVhqHMuly0I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:CY1PR0701MB1693; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1693; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1693; 4:Ukzk33rd5zmeBZDKwXWRinrqdLpUjfFjAduPZLB1FQZZLsghM21v+0MpMvbaVSZfcCfH6fzE5Awn7Hc3cl+urdzmnuXj1jCEZjPIBT4hCr2SD22H13z8Y0d8GDtDH5feaX1JdXXP2AHL2nrV+rCPk5h0dN6oZuO4dRmcon2EC0R0O5S5Rk+Q+iesXr8LrAGczqmxAERLU0qXLR7nIkqPmE6yC0G94KZTqvjAytSPcl+JzbeJPAfaof+50qtbD22Qu7xjdt1j7Pmz3RT8QdFELjxdjEHh3BMg2Xm9PDLWk1HBhFnKefsQsyyJTO9/JfPLLfNq+RHqzv803wH3jZGfsaqdDHL03cFnss5xzzRYmhRfd40iMG1SXyVYXhr7mI+N X-Forefront-PRVS: 07630F72AD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(48376002)(122386002)(19580395003)(189998001)(50466002)(105586002)(5004730100002)(5008740100001)(5003940100001)(77096005)(50986999)(87976001)(586003)(97736004)(76176999)(4001450100002)(229853001)(101416001)(2201001)(33646002)(5001770100001)(5009440100003)(106356001)(5007970100001)(42186005)(2950100001)(47776003)(66066001)(19580405001)(50226001)(92566002)(36756003)(40100003)(7099028)(921003)(83996005)(2101003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1693; 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; CY1PR0701MB1693; 23:nBNwv1F+Xv+ay4Dndd+sI2ePvRUUturViWzZXGe?= =?us-ascii?Q?bnHDypRgoZprBWf9nT9PkM0JzF7CfdvVzHxxq7XogpcOV6HrPBLecIBrKKkP?= =?us-ascii?Q?pfb57oyqTn2Xc+yaJ+xRchh7xFLvrJMY39FR8JXXiBiPGXfvMQsQGpKCfpCJ?= =?us-ascii?Q?u6I1TSVebUT3DKkgreIBmKz+lrdoTnl4Kv+hQRA8jdyPzCXC2wT9KqJB6kml?= =?us-ascii?Q?vHz/GJYBumhD/sA09JG8+GGH2lmRY3mIzs/SocIqyF+pg8yLUeiEk+wooTxD?= =?us-ascii?Q?EHQjtd3dNAYoRAHzJyw+4icZKrRk8HbvW/H+0Rgzk4T4BbZl6y/b5MpmyWOc?= =?us-ascii?Q?pPw/4qDZ8RouYDKPRZFaPM3bynHPLRSf68jukR3lCoj/wM6Q60aCD6cE+sat?= =?us-ascii?Q?vw6k6mu+pPAoondRvE86eN4GtdKQU78xSLgKO9RC5ZtioSC/VfAJ8gCMKuh4?= =?us-ascii?Q?JaeQ6p07hNP9d1f67cos5uCMcrYmrBEDJb+no2cXpy7Z7iit7uxDdiRLo6Fc?= =?us-ascii?Q?BDpLk7301S920xI0WuduuTxhdzqWLqpsW2UgCA64RV5RYGPn08Bs7c1ce3+T?= =?us-ascii?Q?g42+iw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osticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 17:21:33.0253 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1693 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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..b87bf4f --- /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 +============================================================================== +The device node property numa-node-id describes numa domains within a +machine. This property can be used in device nodes like cpu, memory, bus and +devices to map to respective numa nodes. + +numa-node-id property is a 32-bit integer which defines numa node id to which +this device node has numa domain association. + +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. + 2. If both directions between 2 nodes have the same distance, only + one entry is required. + 2. distance-matrix shold have entries in lexicographical ascending order of nodes. + 3. There must be only one Device node distance-map and 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 inter node distance would be for this topology will 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>; + }; + +Note: + 1. The entries like <1 0> can be optional if <0 1> and <1 0> + are of same distance. + +============================================================================== +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>; + };