Lines Matching +full:flash +full:- +full:dma
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
4 * Copyright (c) 2014- QLogic Corporation.
8 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
21 (sizeof(struct bfa_trc_mod_s) - \
84 struct list_head qe; /* Queue of DMA elements */
87 u64 dma; /* dma address if DMA memory */ member
89 u64 dma_curp; /* dma allocation cursor */
111 dm_ptr->mem_len = seg_sz; in bfa_mem_dma_setup()
113 list_add_tail(&dm_ptr->qe, &meminfo->dma_info.qe); in bfa_mem_dma_setup()
120 kva_ptr->mem_len = seg_sz; in bfa_mem_kva_setup()
122 list_add_tail(&kva_ptr->qe, &meminfo->kva_info.qe); in bfa_mem_kva_setup()
125 /* BFA dma memory segments iterator */
126 #define bfa_mem_dma_sptr(_mod, _i) (&(_mod)->dma_seg[(_i)])
131 #define bfa_mem_kva_curp(_mod) ((_mod)->kva_seg.kva_curp)
132 #define bfa_mem_dma_virt(_sptr) ((_sptr)->kva_curp)
133 #define bfa_mem_dma_phys(_sptr) ((_sptr)->dma_curp)
134 #define bfa_mem_dma_len(_sptr) ((_sptr)->mem_len)
136 /* Get the corresponding dma buf kva for a req - from the tag */
138 (((u8 *)(_mod)->dma_seg[BFI_MEM_SEG_FROM_TAG(_tag, _rqsz)].kva_curp) +\
141 /* Get the corresponding dma buf pa for a req - from the tag */
143 ((_mod)->dma_seg[BFI_MEM_SEG_FROM_TAG(_tag, _rqsz)].dma_curp + \
158 * Structure used to remember the DMA-able memory block's KVA and Physical
167 #define BFA_ROUNDUP(_l, _s) (((_l) + ((_s) - 1)) & ~((_s) - 1))
180 dma_addr->a32.addr_lo = cpu_to_be32(pa); in __bfa_dma_be_addr_set()
181 dma_addr->a32.addr_hi = cpu_to_be32(pa >> 32); in __bfa_dma_be_addr_set()
190 alen->al_len = cpu_to_be32(len); in __bfa_alen_set()
191 bfa_dma_be_addr_set(alen->al_addr, pa); in __bfa_alen_set()
281 (__notify)->cbfn = (__cbfn); \
282 (__notify)->cbarg = (__cbarg); \
412 #define BFA_MEM_ABLK_DMA(__bfa) (&((__bfa)->modules.ablk.ablk_dma))
429 u8 *dbuf_kva; /* dma buf virtual address */
430 u64 dbuf_pa; /* dma buf physical address */
444 #define BFA_SFP_MOD(__bfa) (&(__bfa)->modules.sfp)
445 #define BFA_MEM_SFP_DMA(__bfa) (&(BFA_SFP_MOD(__bfa)->sfp_dma))
467 * Flash module specific
481 u8 *dbuf_kva; /* dma buf virtual address */
482 u64 dbuf_pa; /* dma buf physical address */
494 #define BFA_FLASH(__bfa) (&(__bfa)->modules.flash)
495 #define BFA_MEM_FLASH_DMA(__bfa) (&(BFA_FLASH(__bfa)->flash_dma))
497 bfa_status_t bfa_flash_get_attr(struct bfa_flash_s *flash,
500 bfa_status_t bfa_flash_erase_part(struct bfa_flash_s *flash,
503 bfa_status_t bfa_flash_update_part(struct bfa_flash_s *flash,
507 bfa_status_t bfa_flash_read_part(struct bfa_flash_s *flash,
511 void bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc,
513 void bfa_flash_memclaim(struct bfa_flash_s *flash,
540 u8 rsvd; /* 64-bit align */
556 u8 *dbuf_kva; /* dma buf virtual address */
557 u64 dbuf_pa; /* dma buf physical address */
565 u16 temp; /* 10-bit A/D value */
566 u16 brd_temp; /* 9-bit board temp */
591 u8 *dbuf_kva; /* dma buf virtual address */
592 u64 dbuf_pa; /* dma buf physical address */
628 #define BFA_DIAG_MOD(__bfa) (&(__bfa)->modules.diag_mod)
629 #define BFA_MEM_DIAG_DMA(__bfa) (&(BFA_DIAG_MOD(__bfa)->diag_dma))
673 u8 *dbuf_kva; /* dma buf virtual address */
674 u64 dbuf_pa; /* dma buf physical address */
685 #define BFA_PHY(__bfa) (&(__bfa)->modules.phy)
686 #define BFA_MEM_PHY_DMA(__bfa) (&(BFA_PHY(__bfa)->phy_dma))
722 u8 *dbuf_kva; /* dma buf virtual address */
723 u64 dbuf_pa; /* dma buf physical address */
736 #define BFA_FRU(__bfa) (&(__bfa)->modules.fru)
737 #define BFA_MEM_FRU_DMA(__bfa) (&(BFA_FRU(__bfa)->fru_dma))
792 (&(__bfa)->modules.dconf_mod)
793 #define BFA_MEM_DCONF_KVA(__bfa) (&(BFA_DCONF_MOD(__bfa)->kva_seg))
795 (BFA_DCONF_MOD(__bfa)->read_data_valid)
798 (BFA_DCONF_MOD(__bfa)->min_cfg)
807 #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func)
808 #define bfa_ioc_devid(__ioc) ((__ioc)->pcidev.device_id)
809 #define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva)
810 #define bfa_ioc_portid(__ioc) ((__ioc)->port_id)
811 #define bfa_ioc_asic_gen(__ioc) ((__ioc)->asic_gen)
816 (((__stats)->drv_stats) = (__ioc)->stats)
818 memset(&(__ioc)->stats, 0, sizeof((__ioc)->stats))
819 #define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize)
820 #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit)
823 BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop))
825 BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop)
827 #define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++)
853 ((__ioc)->ioc_hwif->ioc_pll_init((__ioc)->pcidev.pci_bar_kva, \
854 (__ioc)->asic_mode))
862 if ((__ioc)->ioc_hwif->ioc_isr_mode_set) \
863 ((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix)); \
866 ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc))
867 #define bfa_ioc_get_fcmode(__ioc) ((__ioc)->fcmode)
869 if ((__ioc)->ioc_hwif->ioc_lpu_read_stat) \
870 ((__ioc)->ioc_hwif->ioc_lpu_read_stat(__ioc)); \