Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450AbeAPRny (ORCPT + 1 other); Tue, 16 Jan 2018 12:43:54 -0500 Received: from mail-by2nam03on0073.outbound.protection.outlook.com ([104.47.42.73]:19076 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750925AbeAPRnw (ORCPT ); Tue, 16 Jan 2018 12:43:52 -0500 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=fail action=none header.from=nxp.com; From: Ioana Radulescu To: , CC: , , , , , , , , , , , , , Subject: [PATCH v2] staging: fsl-mc: Convert documentation to rst format Date: Tue, 16 Jan 2018 11:43:48 -0600 Message-ID: <20180116174348.24723-1-ruxandra.radulescu@nxp.com> X-Mailer: git-send-email 2.11.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605982301055834;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(396003)(39860400002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(6636002)(105606002)(2906002)(8936002)(50466002)(36756003)(48376002)(1076002)(16586007)(59450400001)(54906003)(51416003)(97736004)(110136005)(305945005)(498600001)(53946003)(5660300001)(53936002)(316002)(81166006)(356003)(4326008)(81156014)(7416002)(8676002)(104016004)(8656006)(85426001)(39060400002)(68736007)(47776003)(86362001)(106466001)(26005)(77096006)(50226002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2696;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC005;1:ZIkmfDRwJBDmU2423zrcdVGffRsIT+LhczY6F7gBpcL9lFYdZZpPE+3gWvkP7hUK6th0fryPmBp/xdqUFumxJeyCCX6+P53df26jAnGC/WCt2dstNs0Bb5RztRwNNzMU MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6279c7f8-46c9-44b7-eb5a-08d55d08b3d5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(5600026)(4604075)(2017052603307);SRVR:CY4PR03MB2696; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2696;3:gDLlRCnEBivpqFdRDYlO8QbgL1tm2eAFO++C5wl/PqnN2o+7Oa4O0ul7IbRYn3DONZ8y3BgXY+o44dNLTY0IrUvQLIK9YEd7UBZi0dZFxDb56jYZOyJL9XQsxgC4g8nv8HbW8zJQgz0Umc1lfMK/v2rlsctMUNezR0Hrlgv0hKnpTffljdwBlq7momzJBQQXj00O7OjG8TjWwZunrfhRMxvunrJwhqwCkKSlC4dXqPe9fC00HS4bFOxsluEc8dyc/WeM8drbQ2kpTUUkW+4od9JKmQ9ShrIqKgReRmLGNjkDdPAXkCVTofrksIyyy602WCmlxuGIL7xn7/gcrsC5Dn1rR7yG6D36zcWfTQUXqxk=;25:1RLTEKwtNbt15bEEXspNiAs15Z0xWPkohPk6cTitfv4Dr4V8GS7na8eVwiWeNyVjerdF+Bqy5GlR261eCV5r4g3A3o/zO0N1R19H6ttREfew0tC7u8/g1sDGhhx8WLFl01B8GlMlPWbLVMaValGX+U4LjYn9PTbrDzJ6vdi/aeKlE0WnwvbNot9YCX+O/vGe3Ws0WGEkNR0S5DNiByBZaM8YDG7zULtN7Xpu5gGSODdVYqUTFahAO5UyL1Xev8STh1AkX+G0/TpMBjk3rrNWqc6S0Drj5lFJZ1rvSSkwtff0VFMu2jFXe7EwRj6ODCcB8j5QXnTL+ZZC6316/Px6Ww== X-MS-TrafficTypeDiagnostic: CY4PR03MB2696: X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2696;31:V/vDw0HuKck/j9RAMdYgJu+EaLYFiV5Tu3d2kX3Qkw57xk2pzO6bnZ2y76vQ14qWOGtAoYNhhqRUFSUfU03DLysyzgycChJXNp8ANip277Poc6N7cwwbsorW03vVIu2VI3BUIM7U3xyPEag8Ezt0pWv6pxEAwS25kKi3KmIyQr40Qic5TCoYCtLi3VG3vO0sO7o9TuKEeE7mAPZIaMlvhSsZ9mYmOa8K6rosHjPdgzM=;4:1J8G3lFz3+iDy7lh0qW9/leV1pz3ro73tKWX0PISwMs1VP04ylxyJ/muiTcTLI+yDREsQYPQYQG6W4vtWFUfKIexdvXgddIzbhCggnB8BKsJxsRs3I8ZLKW8pWi3IIA1fVX06THELtJ88vzPxlRkJ0kabfnadUzPnBsDuzzGvNjIFPShqBECUkq3RBARGUjlnLsTvWmh8gnzENJFkUuqfrrUU8joDEwqZmxldoAG7hlejY2o+ulr5GMLAR/fBt6J2wJJAU4JNs8Po1oexxI+E8LtG3g/QbLCTBF8IiANsliF1gruEDEYNnUekb7Y/pl0esW3sF/TbOg7xzzuBajLqNbzVB1F/buV8lHPvesdxeF9ZOQYFTvuzYowHEA6Vwmo+1tJd2ZcNaPhd4pdQiCiB89lQTGwRGmJGv6qaXph0z0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684)(21532816269658); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231023)(944501161)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123561025)(20161123565025)(20161123556025)(20161123563025)(201708071742011);SRVR:CY4PR03MB2696;BCL:0;PCL:0;RULEID:(100000803101)(100110400095)(400006);SRVR:CY4PR03MB2696; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2696;23:gFa2ozhx7XSECuoQloDf5LatZsK0+jnyrvJyPy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U31467hDVqqej+sdc5Av3/ZFig6uWW3XxADKk4A8LvizTXInWnbWOafJkII31gF1HXyk5zdqzSvk1Zw9eNpjKYwMUx3MBuXFebMvXFKki3yp0aHD6r25kw+NXKgv+h0rWj0IJqzIlHu46VZ0jrvXL//drLEuuaD1ZzA7cWElSwKKAqi5m78GKOFFSU8FBMLUFmXjZH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 17:43:49.9495 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6279c7f8-46c9-44b7-eb5a-08d55d08b3d5 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: CY4PR03MB2696 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Update the doc file to comply with the rst format. It's not integrated into the documentation build structure yet, since it's still located in drivers/staging. Signed-off-by: Ioana Radulescu --- v2: patch generated with -M option .../staging/fsl-mc/{README.txt => overview.rst} | 655 +++++++++++---------- 1 file changed, 336 insertions(+), 319 deletions(-) rename drivers/staging/fsl-mc/{README.txt => overview.rst} (14%) diff --git a/drivers/staging/fsl-mc/README.txt b/drivers/staging/fsl-mc/overview.rst similarity index 14% rename from drivers/staging/fsl-mc/README.txt rename to drivers/staging/fsl-mc/overview.rst index 0ea5cd7..79fede4 100644 --- a/drivers/staging/fsl-mc/README.txt +++ b/drivers/staging/fsl-mc/overview.rst @@ -1,24 +1,16 @@ -Copyright (C) 2015 Freescale Semiconductor Inc. +.. include:: DPAA2 (Data Path Acceleration Architecture Gen2) Overview ---------------------------------------------------------- +========================================================= + +:Copyright: |copy| 2015 Freescale Semiconductor Inc. +:Copyright: |copy| 2018 NXP This document provides an overview of the Freescale DPAA2 architecture and how it is integrated into the Linux kernel. -Contents summary - -DPAA2 overview - -Overview of DPAA2 objects - -DPAA2 Linux driver architecture overview - -bus driver - -DPRC driver - -allocator - -DPIO driver - -Ethernet - -MAC - Introduction ------------- +============ DPAA2 is a hardware architecture designed for high-speeed network packet processing. DPAA2 consists of sophisticated mechanisms for @@ -29,48 +21,47 @@ autonomous L2 switching, virtual Ethernet bridging, and accelerator A DPAA2 hardware component called the Management Complex (or MC) manages the DPAA2 hardware resources. The MC provides an object-based abstraction for software drivers to use the DPAA2 hardware. - The MC uses DPAA2 hardware resources such as queues, buffer pools, and network ports to create functional objects/devices such as network 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 | - | | | - +-----------------------------|--------+ - | - | (create,discover,connect - | config,use,destroy) - | - DPAA2 | - +------------------------| mc portal |-+ - | | | - | +- - - - - - - - - - - - -V- - -+ | - | | | | - | | Management Complex (MC) | | - | | | | - | +- - - - - - - - - - - - - - - -+ | - | | - | Hardware Hardware | - | Resources Objects | - | --------- ------- | - | -queues -DPRC | - | -buffer pools -DPMCP | - | -Eth MACs/ports -DPIO | - | -network interface -DPNI | - | profiles -DPMAC | - | -queue portals -DPBP | - | -MC portals ... | - | ... | - | | - +--------------------------------------+ +architecture:: + + +--------------------------------------+ + | OS | + | DPAA2 drivers | + | | | + +-----------------------------|--------+ + | + | (create,discover,connect + | config,use,destroy) + | + DPAA2 | + +------------------------| mc portal |-+ + | | | + | +- - - - - - - - - - - - -V- - -+ | + | | | | + | | Management Complex (MC) | | + | | | | + | +- - - - - - - - - - - - - - - -+ | + | | + | Hardware Hardware | + | Resources Objects | + | --------- ------- | + | -queues -DPRC | + | -buffer pools -DPMCP | + | -Eth MACs/ports -DPIO | + | -network interface -DPNI | + | profiles -DPMAC | + | -queue portals -DPBP | + | -MC portals ... | + | ... | + | | + +--------------------------------------+ + The MC mediates operations such as create, discover, connect, configuration, and destroy. Fast-path operations @@ -79,154 +70,176 @@ the MC and are done directly using memory mapped regions in DPIO objects. Overview of DPAA2 Objects -------------------------- +========================= + 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 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. - - +---------------------------------------------------------+ - | DPRC | - | | - | +-------+ +-------+ +-------+ +-------+ +-------+ | - | | DPMCP | | DPIO | | DPBP | | DPNI | | DPMAC | | - | +-------+ +-------+ +-------+ +---+---+ +---+---+ | - | | DPMCP | | DPIO | | - | +-------+ +-------+ | - | | DPMCP | | - | +-------+ | - | | - +---------------------------------------------------------+ - - 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) - | - +--+--------+-------+-------+-------+ - | | | | | - 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 - to send MC commands. It has an interrupt for status events (like - hotplug). - - All objects in a container share the same hardware "isolation context". - This means that with respect to an IOMMU the isolation granularity - is at the DPRC (container) level, not at the individual object - level. - - DPRCs can be defined statically and populated with objects - via a config file passed to the MC when firmware starts it. - --DPAA2 Objects for an Ethernet Network Interface - - 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 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. - - +---+---+ +---+---+ - CPU0 CPU1 - +---+---+ +---+---+ - | | - +---+---+ +---+---+ - DPIO DPIO - +---+---+ +---+---+ - \ / - \ / - \ / - +---+---+ - DPNI --- DPBP,DPMCP - +---+---+ - | - | - +---+---+ - DPMAC - +---+---+ - | - port/PHY - - 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). - - -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 - -commands: set link up/down, link config, get stats, - IRQ config, enable, reset - - -DPNI (Datapath Network Interface): contains TX/RX queues, - 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 - - -DPIO (Datapath I/O): provides interfaces to enqueue and dequeue - 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 - - -DPBP (Datapath Buffer Pool): represents a hardware buffer - pool. - -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 +DPRC (Datapath Resource Container) +---------------------------------- + +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. + +:: + + +---------------------------------------------------------+ + | DPRC | + | | + | +-------+ +-------+ +-------+ +-------+ +-------+ | + | | DPMCP | | DPIO | | DPBP | | DPNI | | DPMAC | | + | +-------+ +-------+ +-------+ +---+---+ +---+---+ | + | | DPMCP | | DPIO | | + | +-------+ +-------+ | + | | DPMCP | | + | +-------+ | + | | + +---------------------------------------------------------+ + +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) + | + +--+--------+-------+-------+-------+ + | | | | | + 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 +to send MC commands. It has an interrupt for status events (like +hotplug). +All objects in a container share the same hardware "isolation context". +This means that with respect to an IOMMU the isolation granularity +is at the DPRC (container) level, not at the individual object +level. + +DPRCs can be defined statically and populated with objects +via a config file passed to the MC when firmware starts it. + +DPAA2 Objects for an Ethernet Network Interface +----------------------------------------------- + +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 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. + +:: + + +---+---+ +---+---+ + CPU0 CPU1 + +---+---+ +---+---+ + | | + +---+---+ +---+---+ + DPIO DPIO + +---+---+ +---+---+ + \ / + \ / + \ / + +---+---+ + DPNI --- DPBP,DPMCP + +---+---+ + | + | + +---+---+ + DPMAC + +---+---+ + | + port/PHY + +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). + +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 +- commands: set link up/down, link config, get stats, + IRQ config, enable, reset + +DPNI (Datapath Network Interface) +Contains TX/RX queues, 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 + +DPIO (Datapath I/O) +~~~~~~~~~~~~~~~~~~~ +Provides interfaces to enqueue and dequeue +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 + +DPBP (Datapath Buffer Pool) +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Represents a hardware buffer pool. + +- 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 Object Connections ------------------- - Some objects have explicit relationships that must - be configured: +================== +Some objects have explicit relationships that must +be configured: - -DPNI <--> DPMAC - -DPNI <--> DPNI - -DPNI <--> L2-switch-port - A DPNI must be connected to something such as a DPMAC, - another DPNI, or L2 switch port. The DPNI connection - is made via a DPRC command. +- DPNI <--> DPMAC +- DPNI <--> DPNI +- DPNI <--> L2-switch-port + + A DPNI must be connected to something such as a DPMAC, + another DPNI, or L2 switch port. The DPNI connection + is made via a DPRC command. + +:: +-------+ +-------+ | DPNI | | DPMAC | @@ -234,28 +247,29 @@ Object Connections | | +==========+ - -DPNI <--> DPBP - A network interface requires a 'buffer pool' (DPBP - object) which provides a list of pointers to memory - where received Ethernet data is to be copied. The - Ethernet driver configures the DPBPs associated with - the network interface. +- DPNI <--> DPBP + + A network interface requires a 'buffer pool' (DPBP + object) which provides a list of pointers to memory + where received Ethernet data is to be copied. The + Ethernet driver configures the DPBPs associated with + the network interface. Interrupts ----------- - All interrupts generated by DPAA2 objects are message - interrupts. At the hardware level message interrupts - generated by devices will normally have 3 components-- - 1) a non-spoofable 'device-id' expressed on the hardware - bus, 2) an address, 3) a data value. +========== +All interrupts generated by DPAA2 objects are message +interrupts. At the hardware level message interrupts +generated by devices will normally have 3 components-- +1) a non-spoofable 'device-id' expressed on the hardware +bus, 2) an address, 3) a data value. - In the case of DPAA2 devices/objects, all objects in the - same container/DPRC share the same 'device-id'. - For ARM-based SoC this is the same as the stream ID. +In the case of DPAA2 devices/objects, all objects in the +same container/DPRC share the same 'device-id'. +For ARM-based SoC this is the same as the stream ID. DPAA2 Linux Drivers Overview ----------------------------- +============================ This section provides an overview of the Linux kernel drivers for DPAA2-- 1) the bus driver and associated "DPAA2 infrastructure" @@ -264,124 +278,127 @@ drivers and 2) functional object drivers (such as Ethernet). As described previously, a DPRC is a container that holds the other types of DPAA2 objects. It is functionally similar to a plug-and-play bus controller. - Each object in the DPRC is a Linux "device" and is bound to a driver. The diagram below shows the Linux drivers involved in a networking scenario and the objects bound to each driver. A brief description of each driver follows. - +------------+ - | OS Network | - | Stack | - +------------+ +------------+ - | Allocator |. . . . . . . | Ethernet | - |(DPMCP,DPBP)| | (DPNI) | - +-.----------+ +---+---+----+ - . . ^ | - . . | | dequeue> - +-------------+ . | | - | DPRC driver | . +---+---V----+ +---------+ - | (DPRC) | . . . . . .| DPIO driver| | MAC | - +----------+--+ | (DPIO) | | (DPMAC) | - | +------+-----+ +-----+---+ - | | | - | | | - +----+--------------+ | +--+---+ - | MC-bus driver | | | PHY | - | | | |driver| - | /bus/fsl-mc | | +--+---+ - +-------------------+ | | - | | - ================================ HARDWARE =========|=================|====== - DPIO | - | | - DPNI---DPBP | - | | - DPMAC | - | | - PHY ---------------+ - ===================================================|======================== +:: + + +------------+ + | OS Network | + | Stack | + +------------+ +------------+ + | Allocator |. . . . . . . | Ethernet | + |(DPMCP,DPBP)| | (DPNI) | + +-.----------+ +---+---+----+ + . . ^ | + . . | | dequeue> + +-------------+ . | | + | DPRC driver | . +---+---V----+ +---------+ + | (DPRC) | . . . . . .| DPIO driver| | MAC | + +----------+--+ | (DPIO) | | (DPMAC) | + | +------+-----+ +-----+---+ + | | | + | | | + +--------+----------+ | +--+---+ + | MC-bus driver | | | PHY | + | | | |driver| + | /bus/fsl-mc | | +--+---+ + +-------------------+ | | + | | + ========================= HARDWARE =========|=================|====== + DPIO | + | | + DPNI---DPBP | + | | + DPMAC | + | | + PHY ---------------+ + ============================================|======================== A brief description of each driver is provided below. - MC-bus driver - ------------- - 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) - -implementing APIs for DPAA2 driver registration and for device - add/remove - -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 - The binding for the MC-bus device-tree node can be consulted here: - Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt - The sysfs bind/unbind interfaces for the MC-bus can be consulted here: - Documentation/ABI/testing/sysfs-bus-fsl-mc* - - DPRC driver - ----------- - 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 by - re-scanning the DPRC. - - Allocator - ---------- - Certain objects such as DPMCP and DPBP are generic and fungible, - and are intended to be used by other drivers. For example, - the DPAA2 Ethernet driver needs: - -DPMCPs to send MC commands, to configure network interfaces - -DPBPs for network buffer pools - - The allocator driver registers for these allocatable object types - and those objects are bound to the allocator when the bus is probed. - The allocator maintains a pool of objects that are available for - allocation by other DPAA2 drivers. - - DPIO driver - ----------- - The DPIO driver is bound to DPIO objects and provides services that allow - 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 different CPUs to simultaneously enqueue - and dequeue data. - - The DPIO driver operates on behalf of all DPAA2 drivers - active in the kernel-- Ethernet, crypto, compression, - etc. - - Ethernet driver - --------------- - The Ethernet driver is bound to a DPNI and implements the kernel - interfaces needed to connect the DPAA2 network interface to - the network stack. - - Each DPNI corresponds to a Linux network interface. - - MAC driver - ---------- - An Ethernet PHY is an off-chip, board specific component and is managed - 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. +MC-bus driver +------------- +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) +- implementing APIs for DPAA2 driver registration and for device + add/remove +- 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 + +The binding for the MC-bus device-tree node can be consulted at +*Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt*. +The sysfs bind/unbind interfaces for the MC-bus can be consulted at +*Documentation/ABI/testing/sysfs-bus-fsl-mc*. + +DPRC driver +----------- +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 by +re-scanning the DPRC. + +Allocator +--------- +Certain objects such as DPMCP and DPBP are generic and fungible, +and are intended to be used by other drivers. For example, +the DPAA2 Ethernet driver needs: + +- DPMCPs to send MC commands, to configure network interfaces +- DPBPs for network buffer pools + +The allocator driver registers for these allocatable object types +and those objects are bound to the allocator when the bus is probed. +The allocator maintains a pool of objects that are available for +allocation by other DPAA2 drivers. + +DPIO driver +----------- +The DPIO driver is bound to DPIO objects and provides services that allow +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 different CPUs to simultaneously enqueue +and dequeue data. + +The DPIO driver operates on behalf of all DPAA2 drivers +active in the kernel-- Ethernet, crypto, compression, +etc. + +Ethernet driver +--------------- +The Ethernet driver is bound to a DPNI and implements the kernel +interfaces needed to connect the DPAA2 network interface to +the network stack. +Each DPNI corresponds to a Linux network interface. + +MAC driver +---------- +An Ethernet PHY is an off-chip, board specific component and is managed +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. -- 2.7.4