Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753754AbcDKQsu (ORCPT ); Mon, 11 Apr 2016 12:48:50 -0400 Received: from mail-bn1on0091.outbound.protection.outlook.com ([157.56.110.91]:49696 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750719AbcDKQss (ORCPT ); Mon, 11 Apr 2016 12:48:48 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; From: Stuart Yoder To: , CC: , , , , , Stuart Yoder Subject: [PATCH 02/14] staging: fsl-mc: DPAA2 overview readme update Date: Mon, 11 Apr 2016 11:48:42 -0500 Message-ID: <1460393322-15788-1-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.7.9.5 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131048669246474805;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(33646002)(5001770100001)(50226001)(50466002)(105606002)(48376002)(189998001)(47776003)(2906002)(11100500001)(6806005)(104016004)(81166005)(86362001)(36756003)(92566002)(19580395003)(19580405001)(586003)(77096005)(50986999)(5008740100001)(4326007)(1220700001)(1096002)(106466001)(87936001)(15650500001)(7059030)(4720700001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0301MB1224;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD034;1:BgYWT+l3PDd53VB0khrBtl68r+/1iHEFktbwNVGkGzkYLJoXjeVpJ0w6dkLHEXnzFGVq7tQRmNT0ISKn8URB0bjNKHSVx9Jmk33dncOVwu4KzQ04lNVF2Y0DDLMhlAZRn0IZquQIQkgggmwolq80YSG/dgU+UCaW5tPVd4OzbjG+nKxEHl86dkIgsdTRaMf7Iw3+rm+q+7QPGfO6EguUD2tu4dPYGc7hwNClJOyVZ6w1GZ4D7qqWbULFtr0hWt8lcifbTPkdK32uAN54XoOTpaV7uXdV78UZulB0cgNjjx29MPRkXOLRJrI7SjHrih/l2hC6Y26AKYDvv6+zsgKHEjkKfD1yfiXjy5PuXqxRbJIktQW99Fw6yRKHp3ls+XRjrB94l7S16uJghypU1nZNEOw4mZKbrWtJtHZjrCzPRZUSoSXefiBTGpH69DApFgTKLJD3hbKNSjdWPS5vTedvsS9aBn7pQHGJY9xYV3txkrh7DWc7tCQdh/urnZX1VV5sgqS1rJWJbmz29ePB3Pc3B52FLNLVgRaXPnkNHmPWMSJjRjMuKKFGwtAM6SIhI/qygw8VW1nLExYDwvuBaB9ha0cAqFYWUqwlUOD6rBL2NdxKwrgxfIjcwT+3tiS5H9jcOOC/R3AT3oxKhU463JnMrgqW2JDHTfjKNXJHrNGDIRkurpD8z1XITXwYwovV3K68 MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f74f886e-a780-40d3-3f2d-08d36229251d X-Microsoft-Exchange-Diagnostics: 1;BY1PR0301MB1224;2:2euSJMzNQOuwSJkXgPDkonMK+t2bSR/KGThMC6FccNQeA4APU6w4YFIyEUiDg2y+7fgPxDCXuWLAFBRPnMIMlGVZualMnGvguspR1/SGbPQgoBHDQ4m27DhWCHBymUS35h+4BEUaSgLIU8GF+vnAJkV7fagwbjp7asUQDgqbNojs/COX7BqXwcJmDDCu9pFm;3:RMwwf3xWPA8wlfBx4UL302507+QJxG8zYqqfeLps7vbhCm3TJagQMYAdDpYC30uEd2Ycu5HLrbcBghQMz538Of0qNxICNZ1jW6uEG19YZXGJrHRKLdcLfPdcfcDUQicBlvUgAu2+A7+gBML2sVVjbYBvTqmEd+6Qj8KHlLz7DLy+WpfLl9iI89uEqf+0l9IfudRsb8Y0QC0d1L3Eoq246353ofVDG1N0bFRIUiUlKZ4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1224; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0301MB1224;25:yitCKZgiS59pIPCp+RtFcm+VvD4gEm2GlbJhguqU6SB3q5+V/zzG/WorgNM2mbXBasC2KKVKaksbdjmGVJMvqy2kItNZcuLR2dhZ4uxhUvmh9423zHstfldZtFi7IO6FzKpC0WYsNqEHagvPRECVilNGVz6HGPrIVIn89coWJcrKJY5T88U3eYnb7st/kSAXOxDHizjtoZ+TIzhqB8KnTe0UzT1OyZHMmwNo+B/5LmEyqGbW321IPPGWJvwI5TV1/fWn+mD5ibwdG85XpDO3M3hetC+ulmgFt9wnK5Ez/7vPPvjOKJlZkMzSV1saXUHuCR8RNMxxUdynxAzCUqfpNDLrpkSNDQBijT+xGDwckRrRUhGKjHrP/XbzhzzXrNyrvfX3RlqZokdlHpZz2wZr/7NpYtMfMhqrNRgdLg4Kaw0yBmcmNa+YsPEFnzOIrwTA2tRK5O0nk7JgjDmImP1WMoKR1ABODZ/nbjZFljlSkE62yea3Igf9QKvEoemF4TusUsEkI8eeYafZFyXiHRfuqOQHgP9XH1i3d2v+y7uM7NKfUCeqEnlGNPp2Zy6YKS8X4MvdmEjgPrK+Ki75mn5rKIOeu9VDToMOi/WIwPCavh/xGPtJXJIsxkAwdCJ9dbWY3/mgo9TrwYwB+W0a/YVhkB5/7cjxip7YEz7qjkxY1+ia9Qxoqe1gR9FXecCCdIZK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(13017025)(13015025)(5005006)(13024025)(13023025)(8121501046)(10201501046)(3002001)(6055026);SRVR:BY1PR0301MB1224;BCL:0;PCL:0;RULEID:(400006);SRVR:BY1PR0301MB1224; X-Microsoft-Exchange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yHf1DadD2CQ6Boixxc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2016 16:48:44.3354 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB1224 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 13259 Lines: 278 From: Stuart Yoder incorporated feedback from review comments, other misc cleanup/tweaks Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/README.txt | 138 +++++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 58 deletions(-) diff --git a/drivers/staging/fsl-mc/README.txt b/drivers/staging/fsl-mc/README.txt index 8214102..179536a 100644 --- a/drivers/staging/fsl-mc/README.txt +++ b/drivers/staging/fsl-mc/README.txt @@ -11,11 +11,11 @@ Contents summary -Overview of DPAA2 objects -DPAA2 Linux driver architecture overview -bus driver - -dprc driver + -DPRC driver -allocator - -dpio driver + -DPIO driver -Ethernet - -mac + -MAC DPAA2 Overview -------------- @@ -37,6 +37,9 @@ interfaces, an L2 switch, or accelerator instances. The MC provides memory-mapped I/O command interfaces (MC portals) which DPAA2 software drivers use to operate on DPAA2 objects: +The diagram below shows an overview of the DPAA2 resource management +architecture: + +--------------------------------------+ | OS | | DPAA2 drivers | @@ -77,13 +80,13 @@ DPIO objects. Overview of DPAA2 Objects ------------------------- -The section provides a brief overview of some key objects -in the DPAA2 hardware. A simple scenario is described illustrating -the objects involved in creating a network interfaces. +The section provides a brief overview of some key DPAA2 objects. +A simple scenario is described illustrating the objects involved +in creating a network interfaces. -DPRC (Datapath Resource Container) - A DPRC is an container object that holds all the other + A DPRC is a container object that holds all the other types of DPAA2 objects. In the example diagram below there are 8 objects of 5 types (DPMCP, DPIO, DPBP, DPNI, and DPMAC) in the container. @@ -101,23 +104,23 @@ the objects involved in creating a network interfaces. | | +---------------------------------------------------------+ - From the point of view of an OS, a DPRC is bus-like. Like - a plug-and-play bus, such as PCI, DPRC commands can be used to - enumerate the contents of the DPRC, discover the hardware - objects present (including mappable regions and interrupts). + From the point of view of an OS, a DPRC behaves similar to a plug and + play bus, like PCI. DPRC commands can be used to enumerate the contents + of the DPRC, discover the hardware objects present (including mappable + regions and interrupts). - dprc.1 (bus) + DPRC.1 (bus) | +--+--------+-------+-------+-------+ | | | | | - dpmcp.1 dpio.1 dpbp.1 dpni.1 dpmac.1 - dpmcp.2 dpio.2 - dpmcp.3 + DPMCP.1 DPIO.1 DPBP.1 DPNI.1 DPMAC.1 + DPMCP.2 DPIO.2 + DPMCP.3 Hardware objects can be created and destroyed dynamically, providing the ability to hot plug/unplug objects in and out of the DPRC. - A DPRC has a mappable mmio region (an MC portal) that can be used + A DPRC has a mappable MMIO region (an MC portal) that can be used to send MC commands. It has an interrupt for status events (like hotplug). @@ -137,10 +140,11 @@ the objects involved in creating a network interfaces. A typical Ethernet NIC is monolithic-- the NIC device contains TX/RX queuing mechanisms, configuration mechanisms, buffer management, physical ports, and interrupts. DPAA2 uses a more granular approach - utilizing multiple hardware objects. Each object has specialized - functions, and are used together by software to provide Ethernet network - interface functionality. This approach provides efficient use of finite - hardware resources, flexibility, and performance advantages. + utilizing multiple hardware objects. Each object provides specialized + functions. Groups of these objects are used by software to provide + Ethernet network interface functionality. This approach provides + efficient use of finite hardware resources, flexibility, and + performance advantages. The diagram below shows the objects needed for a simple network interface configuration on a system with 2 CPUs. @@ -168,46 +172,52 @@ the objects involved in creating a network interfaces. Below the objects are described. For each object a brief description is provided along with a summary of the kinds of operations the object - supports and a summary of key resources of the object (mmio regions - and irqs). + supports and a summary of key resources of the object (MMIO regions + and IRQs). -DPMAC (Datapath Ethernet MAC): represents an Ethernet MAC, a hardware device that connects to an Ethernet PHY and allows physical transmission and reception of Ethernet frames. - -mmio regions: none - -irqs: dpni link change + -MMIO regions: none + -IRQs: DPNI link change -commands: set link up/down, link config, get stats, - irq config, enable, reset + IRQ config, enable, reset -DPNI (Datapath Network Interface): contains TX/RX queues, - network interface configuration, and rx buffer pool configuration - mechanisms. - -mmio regions: none - -irqs: link state + network interface configuration, and RX buffer pool configuration + mechanisms. The TX/RX queues are in memory and are identified by + queue number. + -MMIO regions: none + -IRQs: link state -commands: port config, offload config, queue config, - parse/classify config, irq config, enable, reset + parse/classify config, IRQ config, enable, reset -DPIO (Datapath I/O): provides interfaces to enqueue and dequeue - packets and do hardware buffer pool management operations. For - optimum performance there is typically DPIO per CPU. This allows - each CPU to perform simultaneous enqueue/dequeue operations. - -mmio regions: queue operations, buffer mgmt - -irqs: data availability, congestion notification, buffer + packets and do hardware buffer pool management operations. The DPAA2 + architecture separates the mechanism to access queues (the DPIO object) + from the queues themselves. The DPIO provides an MMIO interface to + enqueue/dequeue packets. To enqueue something a descriptor is written + to the DPIO MMIO region, which includes the target queue number. + There will typically be one DPIO assigned to each CPU. This allows all + CPUs to simultaneously perform enqueue/dequeued operations. DPIOs are + expected to be shared by different DPAA2 drivers. + -MMIO regions: queue operations, buffer management + -IRQs: data availability, congestion notification, buffer pool depletion - -commands: irq config, enable, reset + -commands: IRQ config, enable, reset -DPBP (Datapath Buffer Pool): represents a hardware buffer pool. - -mmio regions: none - -irqs: none + -MMIO regions: none + -IRQs: none -commands: enable, reset -DPMCP (Datapath MC Portal): provides an MC command portal. Used by drivers to send commands to the MC to manage objects. - -mmio regions: MC command portal - -irqs: command completion - -commands: irq config, enable, reset + -MMIO regions: MC command portal + -IRQs: command completion + -commands: IRQ config, enable, reset Object Connections ------------------ @@ -268,22 +278,22 @@ of each driver follows. | Stack | +------------+ +------------+ | Allocator |. . . . . . . | Ethernet | - |(dpmcp,dpbp)| | (dpni) | + |(DPMCP,DPBP)| | (DPNI) | +-.----------+ +---+---+----+ . . ^ | . . | | dequeue> +-------------+ . | | | DPRC driver | . +---+---V----+ +---------+ - | (dprc) | . . . . . .| DPIO driver| | MAC | - +----------+--+ | (dpio) | | (dpmac) | + | (DPRC) | . . . . . .| DPIO driver| | MAC | + +----------+--+ | (DPIO) | | (DPMAC) | | +------+-----+ +-----+---+ | | | | | | +----+--------------+ | +--+---+ - | mc-bus driver | | | PHY | + | MC-bus driver | | | PHY | | | | |driver| - | /fsl-mc@80c000000 | | +--+---+ + | /soc/fsl-mc | | +--+---+ +-------------------+ | | | | ================================ HARDWARE =========|=================|====== @@ -298,25 +308,27 @@ of each driver follows. A brief description of each driver is provided below. - mc-bus driver + MC-bus driver ------------- - The mc-bus driver is a platform driver and is probed from an - "/fsl-mc@xxxx" node in the device tree passed in by boot firmware. - It is responsible for bootstrapping the DPAA2 kernel infrastructure. + The MC-bus driver is a platform driver and is probed from a + node in the device tree (compatible "fsl,qoriq-mc") passed in by boot + firmware. It is responsible for bootstrapping the DPAA2 kernel + infrastructure. Key functions include: -registering a new bus type named "fsl-mc" with the kernel, and implementing bus call-backs (e.g. match/uevent/dev_groups) - -implemeting APIs for DPAA2 driver registration and for device + -implementing APIs for DPAA2 driver registration and for device add/remove - -creates an MSI irq domain - -do a device add of the 'root' DPRC device, which is needed - to bootstrap things + -creates an MSI IRQ domain + -doing a 'device add' to expose the 'root' DPRC, in turn triggering + a bind of the root DPRC to the DPRC driver DPRC driver ----------- - The dprc-driver is bound DPRC objects and does runtime management + The DPRC driver is bound to DPRC objects and does runtime management of a bus instance. It performs the initial bus scan of the DPRC - and handles interrupts for container events such as hot plug. + and handles interrupts for container events such as hot plug by + re-scanning the DPRC. Allocator ---------- @@ -334,14 +346,20 @@ A brief description of each driver is provided below. DPIO driver ----------- The DPIO driver is bound to DPIO objects and provides services that allow - other drivers such as the Ethernet driver to receive and transmit data. + other drivers such as the Ethernet driver to enqueue and dequeue data for + their respective objects. Key services include: -data availability notifications -hardware queuing operations (enqueue and dequeue of data) -hardware buffer pool management + To transmit a packet the Ethernet driver puts data on a queue and + invokes a DPIO API. For receive, the Ethernet driver registers + a data availability notification callback. To dequeue a packet + a DPIO API is used. + There is typically one DPIO object per physical CPU for optimum - performance, allowing each CPU to simultaneously enqueue + performance, allowing different CPUs to simultaneously enqueue and dequeue data. The DPIO driver operates on behalf of all DPAA2 drivers @@ -362,3 +380,7 @@ A brief description of each driver is provided below. by the appropriate PHY driver via an mdio bus. The MAC driver plays a role of being a proxy between the PHY driver and the MC. It does this proxy via the MC commands to a DPMAC object. + If the PHY driver signals a link change, the MAC driver notifies + the MC via a DPMAC command. If a network interface is brought + up or down, the MC notifies the DPMAC driver via an interrupt and + the driver can take appropriate action. -- 1.7.9.5