Merge tag 'ntb-5.1' of git://github.com/jonmason/ntb
Pull NTB updates from Jon Mason: - fixes for switchtec debugability and mapping table entries - NTB transport improvements - a reworking of the peer_db_addr for better abstraction * tag 'ntb-5.1' of git://github.com/jonmason/ntb: NTB: add new parameter to peer_db_addr() db_bit and db_data NTB: ntb_transport: Ensure the destination buffer is mapped for TX DMA NTB: ntb_transport: Free MWs in ntb_transport_link_cleanup() ntb_hw_switchtec: Added support of >=4G memory windows ntb_hw_switchtec: NT req id mapping table register entry number should be 512 ntb_hw_switchtec: debug print 64bit aligned crosslink BAR Numbers
This commit is contained in:
@@ -236,6 +236,7 @@ static void switchtec_ntb_mw_clr_direct(struct switchtec_ntb *sndev, int idx)
|
||||
ctl_val &= ~NTB_CTRL_BAR_DIR_WIN_EN;
|
||||
iowrite32(ctl_val, &ctl->bar_entry[bar].ctl);
|
||||
iowrite32(0, &ctl->bar_entry[bar].win_size);
|
||||
iowrite32(0, &ctl->bar_ext_entry[bar].win_size);
|
||||
iowrite64(sndev->self_partition, &ctl->bar_entry[bar].xlate_addr);
|
||||
}
|
||||
|
||||
@@ -258,7 +259,9 @@ static void switchtec_ntb_mw_set_direct(struct switchtec_ntb *sndev, int idx,
|
||||
ctl_val |= NTB_CTRL_BAR_DIR_WIN_EN;
|
||||
|
||||
iowrite32(ctl_val, &ctl->bar_entry[bar].ctl);
|
||||
iowrite32(xlate_pos | size, &ctl->bar_entry[bar].win_size);
|
||||
iowrite32(xlate_pos | (lower_32_bits(size) & 0xFFFFF000),
|
||||
&ctl->bar_entry[bar].win_size);
|
||||
iowrite32(upper_32_bits(size), &ctl->bar_ext_entry[bar].win_size);
|
||||
iowrite64(sndev->self_partition | addr,
|
||||
&ctl->bar_entry[bar].xlate_addr);
|
||||
}
|
||||
@@ -679,11 +682,16 @@ static u64 switchtec_ntb_db_read_mask(struct ntb_dev *ntb)
|
||||
|
||||
static int switchtec_ntb_peer_db_addr(struct ntb_dev *ntb,
|
||||
phys_addr_t *db_addr,
|
||||
resource_size_t *db_size)
|
||||
resource_size_t *db_size,
|
||||
u64 *db_data,
|
||||
int db_bit)
|
||||
{
|
||||
struct switchtec_ntb *sndev = ntb_sndev(ntb);
|
||||
unsigned long offset;
|
||||
|
||||
if (unlikely(db_bit >= BITS_PER_LONG_LONG))
|
||||
return -EINVAL;
|
||||
|
||||
offset = (unsigned long)sndev->mmio_peer_dbmsg->odb -
|
||||
(unsigned long)sndev->stdev->mmio;
|
||||
|
||||
@@ -693,6 +701,8 @@ static int switchtec_ntb_peer_db_addr(struct ntb_dev *ntb,
|
||||
*db_addr = pci_resource_start(ntb->pdev, 0) + offset;
|
||||
if (db_size)
|
||||
*db_size = sizeof(u32);
|
||||
if (db_data)
|
||||
*db_data = BIT_ULL(db_bit) << sndev->db_peer_shift;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1025,7 +1035,9 @@ static int crosslink_setup_mws(struct switchtec_ntb *sndev, int ntb_lut_idx,
|
||||
ctl_val |= NTB_CTRL_BAR_DIR_WIN_EN;
|
||||
|
||||
iowrite32(ctl_val, &ctl->bar_entry[bar].ctl);
|
||||
iowrite32(xlate_pos | size, &ctl->bar_entry[bar].win_size);
|
||||
iowrite32(xlate_pos | (lower_32_bits(size) & 0xFFFFF000),
|
||||
&ctl->bar_entry[bar].win_size);
|
||||
iowrite32(upper_32_bits(size), &ctl->bar_ext_entry[bar].win_size);
|
||||
iowrite64(sndev->peer_partition | addr,
|
||||
&ctl->bar_entry[bar].xlate_addr);
|
||||
}
|
||||
@@ -1092,7 +1104,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev,
|
||||
|
||||
dev_dbg(&sndev->stdev->dev,
|
||||
"Crosslink BAR%d addr: %llx\n",
|
||||
i, bar_addr);
|
||||
i*2, bar_addr);
|
||||
|
||||
if (bar_addr != bar_space * i)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user