1
0
Fork 0
Commit Graph

876104 Commits (959a22bedb8bea874bd5794a1463ce70104eaf91)

Author SHA1 Message Date
Ioana Ciornei 959a22bedb bus: fsl-mc: add root dprc rescan attribute
Introduce the rescan attribute as a device attribute to
synchronize the fsl-mc bus objects and the MC firmware.

To rescan the root dprc only, e.g.
echo 1 > /sys/bus/fsl-mc/devices/dprc.1/rescan

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
2019-12-02 18:03:39 +08:00
Ioana Ciornei 672699a389 bus: fsl-mc: add fsl-mc userspace support
Adding userspace support for the MC (Management Complex) means exporting
an ioctl capable device file representing the root resource container.

This new functionality in the fsl-mc bus driver intends to provide
userspace applications an interface to interact with the MC firmware.

Commands that are composed in userspace are sent to the MC firmware
through the FSL_MC_SEND_MC_COMMAND ioctl.  By default the implicit MC
I/O portal is used for this operation, but if the implicit one is busy,
a dynamic portal is allocated and then freed upon execution.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
2019-12-02 18:03:38 +08:00
Ioana Ciornei b3e9fc16c0 bus: fsl-mc: move fsl_mc_command struct in a uapi header
Define "struct fsl_mc_command" as a structure that can cross the
user/kernel boundary.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
2019-12-02 18:03:38 +08:00
Madalin Bucur 0962f7fb57 sdk_dpa: align to upstream PHY_INTERFACE_MODE
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:37 +08:00
Dong Aisheng 9c0bab7869 net: dpaa: fix build failure due to skb_frag_t struct change
We met below build break due to new kernel change:
8842d285ba ("net: Convert skb_frag_t to bio_vec")

../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c: In function ‘dpaa_errata_a010022_has_dma_issue’:
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2137:37: error: ‘skb_frag_t’ has no member named ‘page_offset’
   if (CROSS_4K_BOUND((uintptr_t)frag->page_offset, frag->bv_len))
                                     ^
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2105:5: note: in definition of macro ‘CROSS_4K_BOUND’
  (((start) + (size)) > (((start) + 0x1000) & ~0xFFF))
     ^
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2137:37: error: ‘skb_frag_t’ has no member named ‘page_offset’
   if (CROSS_4K_BOUND((uintptr_t)frag->page_offset, frag->bv_len))
                                     ^
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2105:27: note: in definition of macro ‘CROSS_4K_BOUND’
  (((start) + (size)) > (((start) + 0x1000) & ~0xFFF))

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-12-02 18:03:37 +08:00
Yangbo Lu 513f4f7812 ptp: support ptp_qoriq for sdk dpaa
The ptp_qoriq driver could be used for both sdk version
dpaa driver and upstream version dpaa driver. So added
sdk dpaa dependency for ptp_qoriq driver.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:37 +08:00
Madalin Bucur 8cf1c902a9 net: Makefile: re-add DPAA SDK drivers
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:36 +08:00
Madalin Bucur d30d0c1e96 config: add SDK QBMan driver
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
[ Aisheng: fix minor conflict due to removed CONFIG_VBOXSF_FS ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-12-02 18:03:36 +08:00
Madalin Bucur 8530f309f0 config: enable SDK QBMan
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
[ Aisheng: fix minor conflcit due to removed vboxsf/Kconfig ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-12-02 18:03:36 +08:00
Madalin Bucur 69a050c01a config: enable SDK DPAA driver
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:35 +08:00
Madalin Bucur bdcf59b776 config: enable SDK FMan driver
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:35 +08:00
Li Yang 724a6c4e73 dpaa_eth: Rename skb_frag_t size to bv_len
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2019-12-02 18:03:35 +08:00
Li Yang 3e79b81e54 sdk_dpaa: net: Rename skb_frag_t size to bv_len
Update for upstream data structure change similar to

commit b8b576a16f
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date:   Mon Jul 22 20:08:30 2019 -0700

    net: Rename skb_frag_t size to bv_len

Signed-off-by: Li Yang <leoyang.li@nxp.com>
2019-12-02 18:03:34 +08:00
Camelia Groza 506b2806f8 sdk_dpaa: ceetm: update Makefile to use absolute include paths
Explicitly mention the root source tree directory when building. This
allows the build process to start from a different location.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:34 +08:00
Camelia Groza a16647b81b dpaa_eth: ERR010022: preserve timestamping
Maintain all timestamping fields when copying the skb.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:33 +08:00
Camelia Groza 23b525eb68 dpaa_eth: ERR010022: align skb_shinfo
Cache-line align the new skb's shared info field.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:33 +08:00
Camelia Groza 63456fc727 sdk_dpaa: ceetm: align to upstream API changes
Align to the following upstream patches:
8cb0817 netlink: make validation more configurable for future strictness
ae0be8d netlink: make nla_nest_start() add NLA_F_NESTED flag

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:32 +08:00
Li Yang 03fa50842a sdk_qbman: Update cpus_allowed to cpus_mask to cope with upstream change
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2019-12-02 18:03:32 +08:00
Madalin Bucur 5a22522dea sdk_dpaa: SGMII 2500 needs AN disabled
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:32 +08:00
Roy Pledge 9851bf3f8c sdk_qbman: Fix error in IP revision comparison
The comparison for QMAN_REV31 was incorrect as it
would always fail due to the wrong mask.

This fixes the following error in newer GCC versions:
"error: bitwise comparison always evaluates to false
	[-Werror=tautological-compare]"

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2019-12-02 18:03:31 +08:00
Roy Pledge 56edc75e74 sdk_dpaa: Rework QBMan portal mappings
Rework the QBMan portal mappings in the SDK driver to
match the mechanism used in the upstream varient.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2019-12-02 18:03:31 +08:00
Roy Pledge 6e3d32d6c0 sdk_qbman: Avoid variable length array in USDPAA
As of Linux 5.0 variable length arrays on the stack are no
longer allowed. Change to a dynamic array and create a common
exit point in the function for cleanup.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2019-12-02 18:03:31 +08:00
Camelia Groza 2ddcb37980 sdk_dpaa: adapt to kernel 5.1.0 rc1
Apply fixes corresponding to the following upstream patches:
3c1bcc8 net: ethernet: Convert phydev advertize and supported from u32 to link mode
1e562c8 ptp_qoriq: make structure/function names more consistent
70814e8 net: ethernet: Add helper for set_pauseparam for Asym Pause
22b7d29 net: ethernet: Add helper to determine if pause configuration is supported

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:30 +08:00
Madalin Bucur 5eed844329 sdk_dpaa: remove the QM_FQCTRL_PREFERINCACHE flag
Only a limited number of FQs can be in the cache, setting the
QM_FQCTRL_PREFERINCACHE flag for all FQs is not useful.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:30 +08:00
Camelia Groza 8319e92525 sdk_dpaa: ls1043a errata: impose S/G frame realignment
Scatter/Gather frames are not support on LS1043A beacuse they trigger
the A010022 errata.

Even though we do not advertise S/G support to the stack, we need to
make sure that if S/G frames do reach the driver somehow, they trigger
the errata workaround.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:30 +08:00
Vakul Garg 20a95a6321 fsl_qbman: Adjust platform device creation for QMan portals
Fix the platform device creation in QMan portals such that
dma mappings are done properly.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2019-12-02 18:03:29 +08:00
Florinel Iordache 034786ce18 sdk_fman: avoid array overflow error in fman port init
Perform a verification of external buffer pools used which can cause array
overflow error in port init function SetExtBufferPools() if it was set to
value 1 via fman port API

Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
2019-12-02 18:03:29 +08:00
Zhao Qiang 4332a99301 sdk/qbman: fix issue in qman_delete_cgr_safe()
The wait_for_completion() call in qman_delete_cgr_safe()
was triggering a scheduling while atomic bug, replacing the
kthread with a smp_call_function_single() call to fix it.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
2019-12-02 18:03:29 +08:00
Yangbo Lu 0225bc611c sdk_dpaa: remove useless 1588 timer enablement
1588 timer had been enabled to run at ptp_qoriq driver
probing stage. So removed the useless enablement.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:28 +08:00
Yangbo Lu 07b89cb04a sdk_dpaa: fix hardware timestamp value
The hardware timestamp value got didn't need to be multiplied
by nominal frequency since ptp_qoriq driver initialized the
counter to add clock period, not the clock tick.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:28 +08:00
Yangbo Lu fb5cf1854e sdk_fman: share the event interrupt
This patch is to share fman event interrupt because
the 1588 timer driver will also use this interrupt.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:27 +08:00
Yangbo Lu df01c2f49b sdk_dpaa: add the get_ts_info interface for ethtool
Added the get_ts_info interface for ethtool to check
the timestamping capability.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:27 +08:00
Yangbo Lu 202cc40c6f sdk_fman: disable ptp timer probe
DPAA PTP timer was managed by ptp_qoriq driver in drivers/ptp/.
We will no longer manage it in sdk_fman driver and use related
APIs.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:27 +08:00
Camelia Groza d5afe66afc sdk_fman: suspend the FMan to Deep Sleep on PPC only
The SCFG_FMCLKDPSLPCR register is present on PPC targets only. This
feature does not apply to ARM SoCs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:26 +08:00
Yangbo Lu a25f10599f sdk_dpaa: remove ptp clock driver
Removed dpaa_ptp driver since we could use common
ptp_qoriq driver in drivers/ptp/ instead.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2019-12-02 18:03:26 +08:00
Camelia Groza 251f60a2ee sdk_dpaa: set the skb queue mapping when looping
Save the current CPU ID on ingress, when FSL_DPAA_DBG_LOOP is set.
Use the skb_set_queue_mapping() call instead of skb_record_rx_queue()
because the stack isn't involved and won't compensate for the additional
offset.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:26 +08:00
Camelia Groza 2504ba39e2 sdk_dpaa: guard against an out of bounds queue index
Make sure the queue mapping recorded in the skb is not larger than our
egress queue count.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:25 +08:00
Camelia Groza c2b7d10bd0 sdk_dpaa: ceetm: guard against an out of bounds queue index
Make sure the queue mapping recorded in the skb is not larger than our
egress queue count.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:25 +08:00
Laurentiu Tudor 44fffdeb55 dpaa_eth: fix iova handling for sg frames
The driver relies on the no longer valid assumption that dma addresses
(iovas) are identical to physical addressees and uses phys_to_virt() to
make iova -> vaddr conversions. Fix this also for scatter-gather frames
using the iova -> phys conversion function added in the previous patch.
While at it, clean-up a redundant dpaa_bpid2pool() and pass the bp
as parameter.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:24 +08:00
Laurentiu Tudor 68f7175c14 dpaa_eth: fix iova handling for contiguous frames
The driver relies on the no longer valid assumption that dma addresses
(iovas) are identical to physical addressees and uses phys_to_virt() to
make iova -> vaddr conversions. Fix this by adding a function that does
proper iova -> phys conversions using the iommu api and update the code
to use it.
Also, a dma_unmap_single() call had to be moved further down the code
because iova -> vaddr conversions were required before the unmap.
For now only the contiguous frame case is handled and the SG case is
split in a following patch.
While at it, clean-up a redundant dpaa_bpid2pool() and pass the bp
as parameter.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:24 +08:00
Laurentiu Tudor 80cb48f3df dpaa_eth: base dma mappings on the fman rx port
The dma transactions initiator is the rx fman port so that's the device
that the dma mappings should be done. Previously the mappings were done
through the MAC device which makes no sense because it's neither dma-able
nor connected in any way to smmu.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:24 +08:00
Laurentiu Tudor 290d620c46 dpaa_eth: defer probing after qbman
Enabling SMMU altered the order of device probing causing the dpaa1
ethernet driver to get probed before qbman and causing a boot crash.
Add predictability in the probing order by deferring the ethernet
driver probe after qbman and portals by using the recently introduced
qbman APIs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:23 +08:00
Laurentiu Tudor 550fb342cb fsl/fman: add API to get the device behind a fman port
Add an API that retrieves the 'struct device' that the specified fman
port probed against. The new API will be used in a subsequent iommu
enablement related patch.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:23 +08:00
Laurentiu Tudor 30dd550e68 fsl/fman: backup and restore ICID registers
During probing, FMAN is reset thus losing all its register
settings. Backup port ICID registers before reset and restore
them after, similarly to how it's done on powerpc / PAMU based
platforms.
This also has the side effect of disabling the old code path
(liodn backup/restore handling) that obviously make no sense
in the context of SMMU on ARMs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:22 +08:00
Madalin Bucur 9580032bed sdk_dpaa: remove FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
Remove FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE and record the
receive CPU in skb queue mapping to maintain the same CPU
for tx in forwarding scenarios.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
2019-12-02 18:03:22 +08:00
Camelia Groza 7c8d934e12 sdk_dpaa: ceetm: rename qdisc_destroy() to qdisc_put()
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:22 +08:00
Camelia Groza eac6c84c8a sdk_dpaa: ceetm: avoid double frees on error paths
The stack calls the destroy() callback when a qdisc init() fails.
We stop calling it ourselves and trust the stack do the cleanup.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:21 +08:00
Camelia Groza 08f45df7f9 staging/fsl_qbman: stop using current_kernel_time()
The current_kernel_time() call was removed in [1] in order to avoid
overflows in 2038. Use ktime_get_coarse_real_ts64() instead.

[1] 9765164 ("y2038: remove unused time interfaces")

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:21 +08:00
Camelia Groza 01a63a24ac staging/fsl_qbman: remove bootmem header
The bootmem allocator was removed in [1]. The memblock allocator is
supposed to be used directly instead. We already include it.

[1] afd505b ("mm: remove include/linux/bootmem.h")

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:21 +08:00
Camelia Groza 299edfcd06 sdk_dpaa: ceetm: lower the default congestion thresholds
The congestion thresholds need to be set in such a way that:
    a) the threshold is high enough so that frames aren't dropped
    unnecessarily
    b) the threshold is low enough so that the latency isn't too big

The current thresholds are set too high. In forwarding scenarios, the
latency is too large and frames are dropped on ingress due to a lack of
buffers.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2019-12-02 18:03:20 +08:00