summaryrefslogtreecommitdiffstats
path: root/include/soc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-10-25 19:43:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-25 19:43:35 -0400
commit62606c224d72a98c35d21a849f95cccf95b0a252 (patch)
tree6f6f3466451edf9baa2ea8b5f9fc558aa555c69a /include/soc
parent24ed334f33666f2ae929ccc08f72e7e72e353c64 (diff)
parenta1c6fd4308d37f072e939a2782f24214115fc7e8 (diff)
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Remove VLA usage - Add cryptostat user-space interface - Add notifier for new crypto algorithms Algorithms: - Add OFB mode - Remove speck Drivers: - Remove x86/sha*-mb as they are buggy - Remove pcbc(aes) from x86/aesni - Improve performance of arm/ghash-ce by up to 85% - Implement CTS-CBC in arm64/aes-blk, faster by up to 50% - Remove PMULL based arm64/crc32 driver - Use PMULL in arm64/crct10dif - Add aes-ctr support in s5p-sss - Add caam/qi2 driver Others: - Pick better transform if one becomes available in crc-t10dif" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (124 commits) crypto: chelsio - Update ntx queue received from cxgb4 crypto: ccree - avoid implicit enum conversion crypto: caam - add SPDX license identifier to all files crypto: caam/qi - simplify CGR allocation, freeing crypto: mxs-dcp - make symbols 'sha1_null_hash' and 'sha256_null_hash' static crypto: arm64/aes-blk - ensure XTS mask is always loaded crypto: testmgr - fix sizeof() on COMP_BUF_SIZE crypto: chtls - remove set but not used variable 'csk' crypto: axis - fix platform_no_drv_owner.cocci warnings crypto: x86/aes-ni - fix build error following fpu template removal crypto: arm64/aes - fix handling sub-block CTS-CBC inputs crypto: caam/qi2 - avoid double export crypto: mxs-dcp - Fix AES issues crypto: mxs-dcp - Fix SHA null hashes and output length crypto: mxs-dcp - Implement sha import/export crypto: aegis/generic - fix for big endian systems crypto: morus/generic - fix for big endian systems crypto: lrw - fix rebase error after out of bounds fix crypto: cavium/nitrox - use pci_alloc_irq_vectors() while enabling MSI-X. crypto: cavium/nitrox - NITROX command queue changes. ...
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/fsl/dpaa2-fd.h242
-rw-r--r--include/soc/fsl/dpaa2-global.h15
-rw-r--r--include/soc/fsl/dpaa2-io.h4
3 files changed, 261 insertions, 0 deletions
diff --git a/include/soc/fsl/dpaa2-fd.h b/include/soc/fsl/dpaa2-fd.h
index 2576abaa7779..90ae8d191f1a 100644
--- a/include/soc/fsl/dpaa2-fd.h
+++ b/include/soc/fsl/dpaa2-fd.h
@@ -66,6 +66,15 @@ struct dpaa2_fd {
66#define SG_BPID_MASK 0x3FFF 66#define SG_BPID_MASK 0x3FFF
67#define SG_FINAL_FLAG_MASK 0x1 67#define SG_FINAL_FLAG_MASK 0x1
68#define SG_FINAL_FLAG_SHIFT 15 68#define SG_FINAL_FLAG_SHIFT 15
69#define FL_SHORT_LEN_FLAG_MASK 0x1
70#define FL_SHORT_LEN_FLAG_SHIFT 14
71#define FL_SHORT_LEN_MASK 0x3FFFF
72#define FL_OFFSET_MASK 0x0FFF
73#define FL_FORMAT_MASK 0x3
74#define FL_FORMAT_SHIFT 12
75#define FL_BPID_MASK 0x3FFF
76#define FL_FINAL_FLAG_MASK 0x1
77#define FL_FINAL_FLAG_SHIFT 15
69 78
70/* Error bits in FD CTRL */ 79/* Error bits in FD CTRL */
71#define FD_CTRL_ERR_MASK 0x000000FF 80#define FD_CTRL_ERR_MASK 0x000000FF
@@ -435,4 +444,237 @@ static inline void dpaa2_sg_set_final(struct dpaa2_sg_entry *sg, bool final)
435 sg->format_offset |= cpu_to_le16(final << SG_FINAL_FLAG_SHIFT); 444 sg->format_offset |= cpu_to_le16(final << SG_FINAL_FLAG_SHIFT);
436} 445}
437 446
447/**
448 * struct dpaa2_fl_entry - structure for frame list entry.
449 * @addr: address in the FLE
450 * @len: length in the FLE
451 * @bpid: buffer pool ID
452 * @format_offset: format, offset, and short-length fields
453 * @frc: frame context
454 * @ctrl: control bits...including pta, pvt1, pvt2, err, etc
455 * @flc: flow context address
456 */
457struct dpaa2_fl_entry {
458 __le64 addr;
459 __le32 len;
460 __le16 bpid;
461 __le16 format_offset;
462 __le32 frc;
463 __le32 ctrl;
464 __le64 flc;
465};
466
467enum dpaa2_fl_format {
468 dpaa2_fl_single = 0,
469 dpaa2_fl_res,
470 dpaa2_fl_sg
471};
472
473/**
474 * dpaa2_fl_get_addr() - get the addr field of FLE
475 * @fle: the given frame list entry
476 *
477 * Return the address in the frame list entry.
478 */
479static inline dma_addr_t dpaa2_fl_get_addr(const struct dpaa2_fl_entry *fle)
480{
481 return (dma_addr_t)le64_to_cpu(fle->addr);
482}
483
484/**
485 * dpaa2_fl_set_addr() - Set the addr field of FLE
486 * @fle: the given frame list entry
487 * @addr: the address needs to be set in frame list entry
488 */
489static inline void dpaa2_fl_set_addr(struct dpaa2_fl_entry *fle,
490 dma_addr_t addr)
491{
492 fle->addr = cpu_to_le64(addr);
493}
494
495/**
496 * dpaa2_fl_get_frc() - Get the frame context in the FLE
497 * @fle: the given frame list entry
498 *
499 * Return the frame context field in the frame lsit entry.
500 */
501static inline u32 dpaa2_fl_get_frc(const struct dpaa2_fl_entry *fle)
502{
503 return le32_to_cpu(fle->frc);
504}
505
506/**
507 * dpaa2_fl_set_frc() - Set the frame context in the FLE
508 * @fle: the given frame list entry
509 * @frc: the frame context needs to be set in frame list entry
510 */
511static inline void dpaa2_fl_set_frc(struct dpaa2_fl_entry *fle, u32 frc)
512{
513 fle->frc = cpu_to_le32(frc);
514}
515
516/**
517 * dpaa2_fl_get_ctrl() - Get the control bits in the FLE
518 * @fle: the given frame list entry
519 *
520 * Return the control bits field in the frame list entry.
521 */
522static inline u32 dpaa2_fl_get_ctrl(const struct dpaa2_fl_entry *fle)
523{
524 return le32_to_cpu(fle->ctrl);
525}
526
527/**
528 * dpaa2_fl_set_ctrl() - Set the control bits in the FLE
529 * @fle: the given frame list entry
530 * @ctrl: the control bits to be set in the frame list entry
531 */
532static inline void dpaa2_fl_set_ctrl(struct dpaa2_fl_entry *fle, u32 ctrl)
533{
534 fle->ctrl = cpu_to_le32(ctrl);
535}
536
537/**
538 * dpaa2_fl_get_flc() - Get the flow context in the FLE
539 * @fle: the given frame list entry
540 *
541 * Return the flow context in the frame list entry.
542 */
543static inline dma_addr_t dpaa2_fl_get_flc(const struct dpaa2_fl_entry *fle)
544{
545 return (dma_addr_t)le64_to_cpu(fle->flc);
546}
547
548/**
549 * dpaa2_fl_set_flc() - Set the flow context field of FLE
550 * @fle: the given frame list entry
551 * @flc_addr: the flow context needs to be set in frame list entry
552 */
553static inline void dpaa2_fl_set_flc(struct dpaa2_fl_entry *fle,
554 dma_addr_t flc_addr)
555{
556 fle->flc = cpu_to_le64(flc_addr);
557}
558
559static inline bool dpaa2_fl_short_len(const struct dpaa2_fl_entry *fle)
560{
561 return !!((le16_to_cpu(fle->format_offset) >>
562 FL_SHORT_LEN_FLAG_SHIFT) & FL_SHORT_LEN_FLAG_MASK);
563}
564
565/**
566 * dpaa2_fl_get_len() - Get the length in the FLE
567 * @fle: the given frame list entry
568 *
569 * Return the length field in the frame list entry.
570 */
571static inline u32 dpaa2_fl_get_len(const struct dpaa2_fl_entry *fle)
572{
573 if (dpaa2_fl_short_len(fle))
574 return le32_to_cpu(fle->len) & FL_SHORT_LEN_MASK;
575
576 return le32_to_cpu(fle->len);
577}
578
579/**
580 * dpaa2_fl_set_len() - Set the length field of FLE
581 * @fle: the given frame list entry
582 * @len: the length needs to be set in frame list entry
583 */
584static inline void dpaa2_fl_set_len(struct dpaa2_fl_entry *fle, u32 len)
585{
586 fle->len = cpu_to_le32(len);
587}
588
589/**
590 * dpaa2_fl_get_offset() - Get the offset field in the frame list entry
591 * @fle: the given frame list entry
592 *
593 * Return the offset.
594 */
595static inline u16 dpaa2_fl_get_offset(const struct dpaa2_fl_entry *fle)
596{
597 return le16_to_cpu(fle->format_offset) & FL_OFFSET_MASK;
598}
599
600/**
601 * dpaa2_fl_set_offset() - Set the offset field of FLE
602 * @fle: the given frame list entry
603 * @offset: the offset needs to be set in frame list entry
604 */
605static inline void dpaa2_fl_set_offset(struct dpaa2_fl_entry *fle, u16 offset)
606{
607 fle->format_offset &= cpu_to_le16(~FL_OFFSET_MASK);
608 fle->format_offset |= cpu_to_le16(offset);
609}
610
611/**
612 * dpaa2_fl_get_format() - Get the format field in the FLE
613 * @fle: the given frame list entry
614 *
615 * Return the format.
616 */
617static inline enum dpaa2_fl_format dpaa2_fl_get_format(const struct dpaa2_fl_entry *fle)
618{
619 return (enum dpaa2_fl_format)((le16_to_cpu(fle->format_offset) >>
620 FL_FORMAT_SHIFT) & FL_FORMAT_MASK);
621}
622
623/**
624 * dpaa2_fl_set_format() - Set the format field of FLE
625 * @fle: the given frame list entry
626 * @format: the format needs to be set in frame list entry
627 */
628static inline void dpaa2_fl_set_format(struct dpaa2_fl_entry *fle,
629 enum dpaa2_fl_format format)
630{
631 fle->format_offset &= cpu_to_le16(~(FL_FORMAT_MASK << FL_FORMAT_SHIFT));
632 fle->format_offset |= cpu_to_le16(format << FL_FORMAT_SHIFT);
633}
634
635/**
636 * dpaa2_fl_get_bpid() - Get the bpid field in the FLE
637 * @fle: the given frame list entry
638 *
639 * Return the buffer pool id.
640 */
641static inline u16 dpaa2_fl_get_bpid(const struct dpaa2_fl_entry *fle)
642{
643 return le16_to_cpu(fle->bpid) & FL_BPID_MASK;
644}
645
646/**
647 * dpaa2_fl_set_bpid() - Set the bpid field of FLE
648 * @fle: the given frame list entry
649 * @bpid: buffer pool id to be set
650 */
651static inline void dpaa2_fl_set_bpid(struct dpaa2_fl_entry *fle, u16 bpid)
652{
653 fle->bpid &= cpu_to_le16(~(FL_BPID_MASK));
654 fle->bpid |= cpu_to_le16(bpid);
655}
656
657/**
658 * dpaa2_fl_is_final() - Check final bit in FLE
659 * @fle: the given frame list entry
660 *
661 * Return bool.
662 */
663static inline bool dpaa2_fl_is_final(const struct dpaa2_fl_entry *fle)
664{
665 return !!(le16_to_cpu(fle->format_offset) >> FL_FINAL_FLAG_SHIFT);
666}
667
668/**
669 * dpaa2_fl_set_final() - Set the final bit in FLE
670 * @fle: the given frame list entry
671 * @final: the final boolean to be set
672 */
673static inline void dpaa2_fl_set_final(struct dpaa2_fl_entry *fle, bool final)
674{
675 fle->format_offset &= cpu_to_le16((~(FL_FINAL_FLAG_MASK <<
676 FL_FINAL_FLAG_SHIFT)) & 0xFFFF);
677 fle->format_offset |= cpu_to_le16(final << FL_FINAL_FLAG_SHIFT);
678}
679
438#endif /* __FSL_DPAA2_FD_H */ 680#endif /* __FSL_DPAA2_FD_H */
diff --git a/include/soc/fsl/dpaa2-global.h b/include/soc/fsl/dpaa2-global.h
index 9bc0713346a8..2bfc379d3dc9 100644
--- a/include/soc/fsl/dpaa2-global.h
+++ b/include/soc/fsl/dpaa2-global.h
@@ -174,4 +174,19 @@ static inline const struct dpaa2_fd *dpaa2_dq_fd(const struct dpaa2_dq *dq)
174 return (const struct dpaa2_fd *)&dq->dq.fd[0]; 174 return (const struct dpaa2_fd *)&dq->dq.fd[0];
175} 175}
176 176
177#define DPAA2_CSCN_SIZE sizeof(struct dpaa2_dq)
178#define DPAA2_CSCN_ALIGN 16
179#define DPAA2_CSCN_STATE_CG BIT(0)
180
181/**
182 * dpaa2_cscn_state_congested() - Check congestion state
183 * @cscn: congestion SCN (delivered to WQ or memory)
184 *
185i * Return true is congested.
186 */
187static inline bool dpaa2_cscn_state_congested(struct dpaa2_dq *cscn)
188{
189 return !!(cscn->scn.state & DPAA2_CSCN_STATE_CG);
190}
191
177#endif /* __FSL_DPAA2_GLOBAL_H */ 192#endif /* __FSL_DPAA2_GLOBAL_H */
diff --git a/include/soc/fsl/dpaa2-io.h b/include/soc/fsl/dpaa2-io.h
index ab51e40d11db..70997ab2146c 100644
--- a/include/soc/fsl/dpaa2-io.h
+++ b/include/soc/fsl/dpaa2-io.h
@@ -97,9 +97,13 @@ void dpaa2_io_service_deregister(struct dpaa2_io *service,
97int dpaa2_io_service_rearm(struct dpaa2_io *service, 97int dpaa2_io_service_rearm(struct dpaa2_io *service,
98 struct dpaa2_io_notification_ctx *ctx); 98 struct dpaa2_io_notification_ctx *ctx);
99 99
100int dpaa2_io_service_pull_fq(struct dpaa2_io *d, u32 fqid,
101 struct dpaa2_io_store *s);
100int dpaa2_io_service_pull_channel(struct dpaa2_io *d, u32 channelid, 102int dpaa2_io_service_pull_channel(struct dpaa2_io *d, u32 channelid,
101 struct dpaa2_io_store *s); 103 struct dpaa2_io_store *s);
102 104
105int dpaa2_io_service_enqueue_fq(struct dpaa2_io *d, u32 fqid,
106 const struct dpaa2_fd *fd);
103int dpaa2_io_service_enqueue_qd(struct dpaa2_io *d, u32 qdid, u8 prio, 107int dpaa2_io_service_enqueue_qd(struct dpaa2_io *d, u32 qdid, u8 prio,
104 u16 qdbin, const struct dpaa2_fd *fd); 108 u16 qdbin, const struct dpaa2_fd *fd);
105int dpaa2_io_service_release(struct dpaa2_io *d, u32 bpid, 109int dpaa2_io_service_release(struct dpaa2_io *d, u32 bpid,