Skip to content

Commit

Permalink
Merge tag 'soc-fsl-for-4.19' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/leo/linux into next/drivers

Various updates to soc/fsl for 4.19

Moves DPAA2 DPIO driver from staging to fsl/soc
Adds multiple-pin support to QE gpio driver

* tag 'soc-fsl-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: cleanup Kconfig menu
  soc: fsl: dpio: Convert DPIO documentation to .rst
  staging: fsl-mc: Remove remaining files
  staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl
  staging: fsl-dpaa2: eth: move generic FD defines to DPIO
  soc: fsl: qe: gpio: Add qe_gpio_set_multiple

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Jul 26, 2018
2 parents 92f06c3 + 4625210 commit 1ca8c0a
Showing 29 changed files with 100 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
Copyright 2016 NXP
.. include:: <isonum.txt>

DPAA2 DPIO (Data Path I/O) Overview
===================================

:Copyright: |copy| 2016-2018 NXP

This document provides an overview of the Freescale DPAA2 DPIO
drivers

Introduction
------------
============

A DPAA2 DPIO (Data Path I/O) is a hardware object that provides
interfaces to enqueue and dequeue frames to/from network interfaces
@@ -27,8 +35,11 @@ provides services that:

The Linux DPIO driver consists of 3 primary components--
DPIO object driver-- fsl-mc driver that manages the DPIO object

DPIO service-- provides APIs to other Linux drivers for services

QBman portal interface-- sends portal commands, gets responses
::

fsl-mc other
bus drivers
@@ -45,8 +56,9 @@ The Linux DPIO driver consists of 3 primary components--
|
hardware


The diagram below shows how the DPIO driver components fit with the other
DPAA2 Linux driver components:
DPAA2 Linux driver components::
+------------+
| OS Network |
| Stack |
@@ -98,20 +110,29 @@ DPIO service (dpio-service.c, dpaa2-io.h)

Notification handling
dpaa2_io_service_register()

dpaa2_io_service_deregister()

dpaa2_io_service_rearm()

Queuing
dpaa2_io_service_pull_fq()

dpaa2_io_service_pull_channel()

dpaa2_io_service_enqueue_fq()

dpaa2_io_service_enqueue_qd()

dpaa2_io_store_create()

dpaa2_io_store_destroy()

dpaa2_io_store_next()

Buffer pool management
dpaa2_io_service_release()

dpaa2_io_service_acquire()

QBman portal interface (qbman-portal.c)
@@ -120,7 +141,9 @@ QBman portal interface (qbman-portal.c)
The qbman-portal component provides APIs to do the low level hardware
bit twiddling for operations such as:
-initializing Qman software portals

-building and sending portal commands

-portal interrupt configuration and processing

The qbman-portal APIs are not public to other drivers, and are
1 change: 1 addition & 0 deletions Documentation/networking/dpaa2/index.rst
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@ DPAA2 Documentation
:maxdepth: 1

overview
dpio-driver
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
@@ -4418,7 +4418,7 @@ DPAA2 DATAPATH I/O (DPIO) DRIVER
M: Roy Pledge <Roy.Pledge@nxp.com>
L: linux-kernel@vger.kernel.org
S: Maintained
F: drivers/staging/fsl-mc/bus/dpio
F: drivers/soc/fsl/dpio

DPAA2 ETHERNET DRIVER
M: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2 changes: 1 addition & 1 deletion drivers/crypto/caam/sg_sw_qm2.h
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
#ifndef _SG_SW_QM2_H_
#define _SG_SW_QM2_H_

#include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h"
#include <soc/fsl/dpaa2-fd.h>

static inline void dma_to_qm_sg_one(struct dpaa2_sg_entry *qm_sg_ptr,
dma_addr_t dma, u32 len, u16 offset)
2 changes: 1 addition & 1 deletion drivers/crypto/caam/sg_sw_sec4.h
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
#include "ctrl.h"
#include "regs.h"
#include "sg_sw_qm2.h"
#include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h"
#include <soc/fsl/dpaa2-fd.h>

struct sec4_sg_entry {
u64 ptr;
15 changes: 14 additions & 1 deletion drivers/soc/fsl/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#
# Freescale SOC drivers
# NXP/Freescale QorIQ series SOC drivers
#

menu "NXP/Freescale QorIQ SoC drivers"

source "drivers/soc/fsl/qbman/Kconfig"
source "drivers/soc/fsl/qe/Kconfig"

@@ -16,3 +18,14 @@ config FSL_GUTS
Initially only reading SVR and registering soc device are supported.
Other guts accesses, such as reading RCW, should eventually be moved
into this driver as well.

config FSL_MC_DPIO
tristate "QorIQ DPAA2 DPIO driver"
depends on FSL_MC_BUS
help
Driver for the DPAA2 DPIO object. A DPIO provides queue and
buffer management facilities for software to interact with
other DPAA2 objects. This driver does not expose the DPIO
objects individually, but groups them under a service layer
API.
endmenu
1 change: 1 addition & 0 deletions drivers/soc/fsl/Makefile
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@ obj-$(CONFIG_FSL_DPAA) += qbman/
obj-$(CONFIG_QUICC_ENGINE) += qe/
obj-$(CONFIG_CPM) += qe/
obj-$(CONFIG_FSL_GUTS) += guts.o
obj-$(CONFIG_FSL_MC_DPIO) += dpio/
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
#include <linux/io.h>

#include <linux/fsl/mc.h>
#include "../../include/dpaa2-io.h"
#include <soc/fsl/dpaa2-io.h>

#include "qbman-portal.h"
#include "dpio.h"
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
*/
#include <linux/types.h>
#include <linux/fsl/mc.h>
#include "../../include/dpaa2-io.h"
#include <soc/fsl/dpaa2-io.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
#include <asm/cacheflush.h>
#include <linux/io.h>
#include <linux/slab.h>
#include "../../include/dpaa2-global.h"
#include <soc/fsl/dpaa2-global.h>

#include "qbman-portal.h"

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#ifndef __FSL_QBMAN_PORTAL_H
#define __FSL_QBMAN_PORTAL_H

#include "../../include/dpaa2-fd.h"
#include <soc/fsl/dpaa2-fd.h>

struct dpaa2_dq;
struct qbman_swp;
2 changes: 1 addition & 1 deletion drivers/soc/fsl/qbman/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
menuconfig FSL_DPAA
bool "Freescale DPAA 1.x support"
bool "QorIQ DPAA1 framework support"
depends on (FSL_SOC_BOOKE || ARCH_LAYERSCAPE)
select GENERIC_ALLOCATOR
help
2 changes: 1 addition & 1 deletion drivers/soc/fsl/qe/Kconfig
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
#

config QUICC_ENGINE
bool "Freescale QUICC Engine (QE) Support"
bool "QUICC Engine (QE) framework support"
depends on FSL_SOC && PPC32
select GENERIC_ALLOCATOR
select CRC32
28 changes: 28 additions & 0 deletions drivers/soc/fsl/qe/gpio.c
Original file line number Diff line number Diff line change
@@ -83,6 +83,33 @@ static void qe_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
spin_unlock_irqrestore(&qe_gc->lock, flags);
}

static void qe_gpio_set_multiple(struct gpio_chip *gc,
unsigned long *mask, unsigned long *bits)
{
struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
struct qe_gpio_chip *qe_gc = gpiochip_get_data(gc);
struct qe_pio_regs __iomem *regs = mm_gc->regs;
unsigned long flags;
int i;

spin_lock_irqsave(&qe_gc->lock, flags);

for (i = 0; i < gc->ngpio; i++) {
if (*mask == 0)
break;
if (__test_and_clear_bit(i, mask)) {
if (test_bit(i, bits))
qe_gc->cpdata |= (1U << (QE_PIO_PINS - 1 - i));
else
qe_gc->cpdata &= ~(1U << (QE_PIO_PINS - 1 - i));
}
}

out_be32(&regs->cpdata, qe_gc->cpdata);

spin_unlock_irqrestore(&qe_gc->lock, flags);
}

static int qe_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
{
struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
@@ -298,6 +325,7 @@ static int __init qe_add_gpiochips(void)
gc->direction_output = qe_gpio_dir_out;
gc->get = qe_gpio_get;
gc->set = qe_gpio_set;
gc->set_multiple = qe_gpio_set_multiple;

ret = of_mm_gpiochip_add_data(np, mm_gc, qe_gc);
if (ret)
2 changes: 0 additions & 2 deletions drivers/staging/Kconfig
Original file line number Diff line number Diff line change
@@ -92,8 +92,6 @@ source "drivers/staging/clocking-wizard/Kconfig"

source "drivers/staging/fbtft/Kconfig"

source "drivers/staging/fsl-mc/Kconfig"

source "drivers/staging/fsl-dpaa2/Kconfig"

source "drivers/staging/wilc1000/Kconfig"
1 change: 0 additions & 1 deletion drivers/staging/Makefile
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@ obj-$(CONFIG_CRYPTO_SKEIN) += skein/
obj-$(CONFIG_UNISYSSPAR) += unisys/
obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/
obj-$(CONFIG_FB_TFT) += fbtft/
obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/
obj-$(CONFIG_FSL_DPAA2) += fsl-dpaa2/
obj-$(CONFIG_WILC1000) += wilc1000/
obj-$(CONFIG_MOST) += most/
4 changes: 2 additions & 2 deletions drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
Original file line number Diff line number Diff line change
@@ -455,7 +455,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,
dpaa2_fd_set_format(fd, dpaa2_fd_sg);
dpaa2_fd_set_addr(fd, addr);
dpaa2_fd_set_len(fd, skb->len);
dpaa2_fd_set_ctrl(fd, DPAA2_FD_CTRL_PTA | DPAA2_FD_CTRL_PTV1);
dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA | FD_CTRL_PTV1);

if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
enable_tx_tstamp(fd, sgt_buf);
@@ -508,7 +508,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
dpaa2_fd_set_offset(fd, (u16)(skb->data - buffer_start));
dpaa2_fd_set_len(fd, skb->len);
dpaa2_fd_set_format(fd, dpaa2_fd_single);
dpaa2_fd_set_ctrl(fd, DPAA2_FD_CTRL_PTA | DPAA2_FD_CTRL_PTV1);
dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA | FD_CTRL_PTV1);

if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
enable_tx_tstamp(fd, buffer_start);
22 changes: 7 additions & 15 deletions drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
Original file line number Diff line number Diff line change
@@ -37,8 +37,8 @@
#include <linux/if_vlan.h>
#include <linux/fsl/mc.h>

#include "../../fsl-mc/include/dpaa2-io.h"
#include "../../fsl-mc/include/dpaa2-fd.h"
#include <soc/fsl/dpaa2-io.h>
#include <soc/fsl/dpaa2-fd.h>
#include "dpni.h"
#include "dpni-cmd.h"

@@ -124,21 +124,13 @@ struct dpaa2_eth_swa {
#define DPAA2_FD_FRC_FAICFDV 0x0400

/* Error bits in FD CTRL */
#define DPAA2_FD_CTRL_UFD 0x00000004
#define DPAA2_FD_CTRL_SBE 0x00000008
#define DPAA2_FD_CTRL_FSE 0x00000020
#define DPAA2_FD_CTRL_FAERR 0x00000040

#define DPAA2_FD_RX_ERR_MASK (DPAA2_FD_CTRL_SBE | \
DPAA2_FD_CTRL_FAERR)
#define DPAA2_FD_TX_ERR_MASK (DPAA2_FD_CTRL_UFD | \
DPAA2_FD_CTRL_SBE | \
DPAA2_FD_CTRL_FSE | \
DPAA2_FD_CTRL_FAERR)
#define DPAA2_FD_RX_ERR_MASK (FD_CTRL_SBE | FD_CTRL_FAERR)
#define DPAA2_FD_TX_ERR_MASK (FD_CTRL_UFD | \
FD_CTRL_SBE | \
FD_CTRL_FSE | \
FD_CTRL_FAERR)

/* Annotation bits in FD CTRL */
#define DPAA2_FD_CTRL_PTA 0x00800000
#define DPAA2_FD_CTRL_PTV1 0x00400000
#define DPAA2_FD_CTRL_ASAL 0x00020000 /* ASAL = 128B */

/* Frame annotation status */
2 changes: 0 additions & 2 deletions drivers/staging/fsl-mc/Kconfig

This file was deleted.

3 changes: 0 additions & 3 deletions drivers/staging/fsl-mc/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions drivers/staging/fsl-mc/bus/Kconfig

This file was deleted.

9 changes: 0 additions & 9 deletions drivers/staging/fsl-mc/bus/Makefile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -67,6 +67,18 @@ struct dpaa2_fd {
#define SG_FINAL_FLAG_MASK 0x1
#define SG_FINAL_FLAG_SHIFT 15

/* Error bits in FD CTRL */
#define FD_CTRL_ERR_MASK 0x000000FF
#define FD_CTRL_UFD 0x00000004
#define FD_CTRL_SBE 0x00000008
#define FD_CTRL_FLC 0x00000010
#define FD_CTRL_FSE 0x00000020
#define FD_CTRL_FAERR 0x00000040

/* Annotation bits in FD CTRL */
#define FD_CTRL_PTA 0x00800000
#define FD_CTRL_PTV1 0x00400000

enum dpaa2_fd_format {
dpaa2_fd_single = 0,
dpaa2_fd_list,
File renamed without changes.
File renamed without changes.

0 comments on commit 1ca8c0a

Please sign in to comment.