NXP/FSL SoC driver updates for v5.11

- Add RCPM errata workaround for A-008646 on LS1021A
 - Various W=1 warning fixes for fsl/soc drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEhb3UXAyxp6UQ0v6khtxQDvusFVQFAl+9rAIACgkQhtxQDvus
 FVQ7Sw//ahekGJoPZS8+aTz/uMcMsaUSACJ3pDUf6BICBhzazJUCIs0ojHAr+UQU
 svuBxkVp+ZWDnm+dV54nCqt0+yhAZrDAA5RiJsqjsqfx4dvNoyKUKwG6ijILs2yh
 8WZDQNU8vYKQAacbpkmjjrSxRWDqYG6h5ay+oFVUWL80SjoUQBDjDqhZ00bc9M79
 XsfkuMuXjhqbtZR3+Oa7uws+PztrLAcZW4KeR+G8jO0VjcTTEovvp3JttYYSQIHj
 iBzyvGFnr/Cpm18Ak52d9D5qlkgcQusVCIhCA+t/uOiR5+NAFFI3VxRvOBFe5PeZ
 jDyZuSyl204qIsUUE+juCwFvZNogM95F04Vr2PgNmopUArs/ng6WmDVyAXx9dnIb
 IKjFMwUf5yWH/UFNQQsxBuyqUJl+T0xcYaae+Pk50j18+xtf5lnqaVtS9kJzJ92G
 TOZ/CsATzjjaMLVjyyJLc+fLitDJw8AQbxvxM/L8No+1RahFRs3OKSKvt3zGnex3
 jT2ggjbnlpsymPKx/9z/U/NrN69eW5H522aWIbd2VF6rW1BGat4kAS3am2aoD0YN
 B6bViZcTlWpb1ybLmZwGqniyRmP1T99qPT6k4upIKypyznXrm0LNxybH3Lr1eHPw
 CNmr6AMWMigdysAeGUgiRRJVxUcC2+aAc/6O1DzStn+Hbp2svlI=
 =wiTB
 -----END PGP SIGNATURE-----

Merge tag 'soc-fsl-next-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/drivers

NXP/FSL SoC driver updates for v5.11

- Add RCPM errata workaround for A-008646 on LS1021A
- Various W=1 warning fixes for fsl/soc drivers

* tag 'soc-fsl-next-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: handle RCPM errata A-008646 on SoC LS1021A
  soc: fsl: qbman: qman: Remove unused variable 'dequeue_wq'
  soc: fsl: qe: qe_common: Fix misnamed function attribute 'addr'
  soc: fsl: dpio: qbman-portal: Fix a bunch of kernel-doc misdemeanours

Link: https://lore.kernel.org/r/20201125165913.15441-1-leoyang.li@nxp.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2020-11-26 22:00:55 +01:00
commit ba622a3e74
4 changed files with 50 additions and 13 deletions

View File

@ -424,7 +424,7 @@ int qbman_swp_interrupt_get_inhibit(struct qbman_swp *p)
/** /**
* qbman_swp_interrupt_set_inhibit() - write interrupt mask register * qbman_swp_interrupt_set_inhibit() - write interrupt mask register
* @p: the given software portal object * @p: the given software portal object
* @mask: The mask to set in SWP_IIR register * @inhibit: whether to inhibit the IRQs
*/ */
void qbman_swp_interrupt_set_inhibit(struct qbman_swp *p, int inhibit) void qbman_swp_interrupt_set_inhibit(struct qbman_swp *p, int inhibit)
{ {
@ -510,7 +510,7 @@ enum qb_enqueue_commands {
#define QB_ENQUEUE_CMD_TARGET_TYPE_SHIFT 4 #define QB_ENQUEUE_CMD_TARGET_TYPE_SHIFT 4
#define QB_ENQUEUE_CMD_DCA_EN_SHIFT 7 #define QB_ENQUEUE_CMD_DCA_EN_SHIFT 7
/** /*
* qbman_eq_desc_clear() - Clear the contents of a descriptor to * qbman_eq_desc_clear() - Clear the contents of a descriptor to
* default/starting state. * default/starting state.
*/ */
@ -522,7 +522,7 @@ void qbman_eq_desc_clear(struct qbman_eq_desc *d)
/** /**
* qbman_eq_desc_set_no_orp() - Set enqueue descriptor without orp * qbman_eq_desc_set_no_orp() - Set enqueue descriptor without orp
* @d: the enqueue descriptor. * @d: the enqueue descriptor.
* @response_success: 1 = enqueue with response always; 0 = enqueue with * @respond_success: 1 = enqueue with response always; 0 = enqueue with
* rejections returned on a FQ. * rejections returned on a FQ.
*/ */
void qbman_eq_desc_set_no_orp(struct qbman_eq_desc *d, int respond_success) void qbman_eq_desc_set_no_orp(struct qbman_eq_desc *d, int respond_success)
@ -932,7 +932,7 @@ int qbman_swp_enqueue_multiple_desc_mem_back(struct qbman_swp *s,
/** /**
* qbman_swp_push_get() - Get the push dequeue setup * qbman_swp_push_get() - Get the push dequeue setup
* @p: the software portal object * @s: the software portal object
* @channel_idx: the channel index to query * @channel_idx: the channel index to query
* @enabled: returned boolean to show whether the push dequeue is enabled * @enabled: returned boolean to show whether the push dequeue is enabled
* for the given channel * for the given channel
@ -947,7 +947,7 @@ void qbman_swp_push_get(struct qbman_swp *s, u8 channel_idx, int *enabled)
/** /**
* qbman_swp_push_set() - Enable or disable push dequeue * qbman_swp_push_set() - Enable or disable push dequeue
* @p: the software portal object * @s: the software portal object
* @channel_idx: the channel index (0 to 15) * @channel_idx: the channel index (0 to 15)
* @enable: enable or disable push dequeue * @enable: enable or disable push dequeue
*/ */
@ -1046,6 +1046,7 @@ void qbman_pull_desc_set_numframes(struct qbman_pull_desc *d, u8 numframes)
/** /**
* qbman_pull_desc_set_fq() - Set fqid from which the dequeue command dequeues * qbman_pull_desc_set_fq() - Set fqid from which the dequeue command dequeues
* @d: the pull dequeue descriptor to be set
* @fqid: the frame queue index of the given FQ * @fqid: the frame queue index of the given FQ
*/ */
void qbman_pull_desc_set_fq(struct qbman_pull_desc *d, u32 fqid) void qbman_pull_desc_set_fq(struct qbman_pull_desc *d, u32 fqid)
@ -1057,6 +1058,7 @@ void qbman_pull_desc_set_fq(struct qbman_pull_desc *d, u32 fqid)
/** /**
* qbman_pull_desc_set_wq() - Set wqid from which the dequeue command dequeues * qbman_pull_desc_set_wq() - Set wqid from which the dequeue command dequeues
* @d: the pull dequeue descriptor to be set
* @wqid: composed of channel id and wqid within the channel * @wqid: composed of channel id and wqid within the channel
* @dct: the dequeue command type * @dct: the dequeue command type
*/ */
@ -1071,6 +1073,7 @@ void qbman_pull_desc_set_wq(struct qbman_pull_desc *d, u32 wqid,
/** /**
* qbman_pull_desc_set_channel() - Set channelid from which the dequeue command * qbman_pull_desc_set_channel() - Set channelid from which the dequeue command
* dequeues * dequeues
* @d: the pull dequeue descriptor to be set
* @chid: the channel id to be dequeued * @chid: the channel id to be dequeued
* @dct: the dequeue command type * @dct: the dequeue command type
*/ */
@ -1398,6 +1401,7 @@ int qbman_result_has_new_result(struct qbman_swp *s, const struct dpaa2_dq *dq)
/** /**
* qbman_release_desc_clear() - Clear the contents of a descriptor to * qbman_release_desc_clear() - Clear the contents of a descriptor to
* default/starting state. * default/starting state.
* @d: the pull dequeue descriptor to be cleared
*/ */
void qbman_release_desc_clear(struct qbman_release_desc *d) void qbman_release_desc_clear(struct qbman_release_desc *d)
{ {
@ -1407,6 +1411,8 @@ void qbman_release_desc_clear(struct qbman_release_desc *d)
/** /**
* qbman_release_desc_set_bpid() - Set the ID of the buffer pool to release to * qbman_release_desc_set_bpid() - Set the ID of the buffer pool to release to
* @d: the pull dequeue descriptor to be set
* @bpid: the bpid value to be set
*/ */
void qbman_release_desc_set_bpid(struct qbman_release_desc *d, u16 bpid) void qbman_release_desc_set_bpid(struct qbman_release_desc *d, u16 bpid)
{ {
@ -1416,6 +1422,8 @@ void qbman_release_desc_set_bpid(struct qbman_release_desc *d, u16 bpid)
/** /**
* qbman_release_desc_set_rcdi() - Determines whether or not the portal's RCDI * qbman_release_desc_set_rcdi() - Determines whether or not the portal's RCDI
* interrupt source should be asserted after the release command is completed. * interrupt source should be asserted after the release command is completed.
* @d: the pull dequeue descriptor to be set
* @enable: enable (1) or disable (0) value
*/ */
void qbman_release_desc_set_rcdi(struct qbman_release_desc *d, int enable) void qbman_release_desc_set_rcdi(struct qbman_release_desc *d, int enable)
{ {

View File

@ -2622,7 +2622,7 @@ int qman_shutdown_fq(u32 fqid)
union qm_mc_command *mcc; union qm_mc_command *mcc;
union qm_mc_result *mcr; union qm_mc_result *mcr;
int orl_empty, drain = 0, ret = 0; int orl_empty, drain = 0, ret = 0;
u32 channel, wq, res; u32 channel, res;
u8 state; u8 state;
p = get_affine_portal(); p = get_affine_portal();
@ -2655,7 +2655,7 @@ int qman_shutdown_fq(u32 fqid)
DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ); DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ);
/* Need to store these since the MCR gets reused */ /* Need to store these since the MCR gets reused */
channel = qm_fqd_get_chan(&mcr->queryfq.fqd); channel = qm_fqd_get_chan(&mcr->queryfq.fqd);
wq = qm_fqd_get_wq(&mcr->queryfq.fqd); qm_fqd_get_wq(&mcr->queryfq.fqd);
if (channel < qm_channel_pool1) { if (channel < qm_channel_pool1) {
channel_portal = get_portal_for_channel(channel); channel_portal = get_portal_for_channel(channel);
@ -2697,7 +2697,6 @@ int qman_shutdown_fq(u32 fqid)
* to dequeue from the channel the FQ is scheduled on * to dequeue from the channel the FQ is scheduled on
*/ */
int found_fqrn = 0; int found_fqrn = 0;
u16 dequeue_wq = 0;
/* Flag that we need to drain FQ */ /* Flag that we need to drain FQ */
drain = 1; drain = 1;
@ -2705,11 +2704,8 @@ int qman_shutdown_fq(u32 fqid)
if (channel >= qm_channel_pool1 && if (channel >= qm_channel_pool1 &&
channel < qm_channel_pool1 + 15) { channel < qm_channel_pool1 + 15) {
/* Pool channel, enable the bit in the portal */ /* Pool channel, enable the bit in the portal */
dequeue_wq = (channel -
qm_channel_pool1 + 1)<<4 | wq;
} else if (channel < qm_channel_pool1) { } else if (channel < qm_channel_pool1) {
/* Dedicated channel */ /* Dedicated channel */
dequeue_wq = wq;
} else { } else {
dev_err(dev, "Can't recover FQ 0x%x, ch: 0x%x", dev_err(dev, "Can't recover FQ 0x%x, ch: 0x%x",
fqid, channel); fqid, channel);

View File

@ -231,7 +231,7 @@ EXPORT_SYMBOL(cpm_muram_offset);
/** /**
* cpm_muram_dma - turn a muram virtual address into a DMA address * cpm_muram_dma - turn a muram virtual address into a DMA address
* @offset: virtual address from cpm_muram_addr() to convert * @addr: virtual address from cpm_muram_addr() to convert
*/ */
dma_addr_t cpm_muram_dma(void __iomem *addr) dma_addr_t cpm_muram_dma(void __iomem *addr)
{ {

View File

@ -2,7 +2,7 @@
// //
// rcpm.c - Freescale QorIQ RCPM driver // rcpm.c - Freescale QorIQ RCPM driver
// //
// Copyright 2019 NXP // Copyright 2019-2020 NXP
// //
// Author: Ran Wang <ran.wang_1@nxp.com> // Author: Ran Wang <ran.wang_1@nxp.com>
@ -22,6 +22,28 @@ struct rcpm {
bool little_endian; bool little_endian;
}; };
#define SCFG_SPARECR8 0x051c
static void copy_ippdexpcr1_setting(u32 val)
{
struct device_node *np;
void __iomem *regs;
u32 reg_val;
np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-scfg");
if (!np)
return;
regs = of_iomap(np, 0);
if (!regs)
return;
reg_val = ioread32be(regs + SCFG_SPARECR8);
iowrite32be(val | reg_val, regs + SCFG_SPARECR8);
iounmap(regs);
}
/** /**
* rcpm_pm_prepare - performs device-level tasks associated with power * rcpm_pm_prepare - performs device-level tasks associated with power
* management, such as programming related to the wakeup source control. * management, such as programming related to the wakeup source control.
@ -90,6 +112,17 @@ static int rcpm_pm_prepare(struct device *dev)
tmp |= ioread32be(address); tmp |= ioread32be(address);
iowrite32be(tmp, address); iowrite32be(tmp, address);
} }
/*
* Workaround of errata A-008646 on SoC LS1021A:
* There is a bug of register ippdexpcr1.
* Reading configuration register RCPM_IPPDEXPCR1
* always return zero. So save ippdexpcr1's value
* to register SCFG_SPARECR8.And the value of
* ippdexpcr1 will be read from SCFG_SPARECR8.
*/
if (dev_of_node(dev) && (i == 1))
if (of_device_is_compatible(np, "fsl,ls1021a-rcpm"))
copy_ippdexpcr1_setting(tmp);
} }
return 0; return 0;