|
@@ -331,6 +331,21 @@ arbel_cmd_run_fw ( struct arbel *arbel ) {
|
331
|
331
|
0, NULL, 0, NULL );
|
332
|
332
|
}
|
333
|
333
|
|
|
334
|
+static inline int
|
|
335
|
+arbel_cmd_disable_lam ( struct arbel *arbel ) {
|
|
336
|
+ return arbel_cmd ( arbel,
|
|
337
|
+ ARBEL_HCR_VOID_CMD ( ARBEL_HCR_DISABLE_LAM ),
|
|
338
|
+ 0, NULL, 0, NULL );
|
|
339
|
+}
|
|
340
|
+
|
|
341
|
+static inline int
|
|
342
|
+arbel_cmd_enable_lam ( struct arbel *arbel, struct arbelprm_access_lam *lam ) {
|
|
343
|
+ return arbel_cmd ( arbel,
|
|
344
|
+ ARBEL_HCR_OUT_CMD ( ARBEL_HCR_ENABLE_LAM,
|
|
345
|
+ 1, sizeof ( *lam ) ),
|
|
346
|
+ 1, NULL, 0, lam );
|
|
347
|
+}
|
|
348
|
+
|
334
|
349
|
static inline int
|
335
|
350
|
arbel_cmd_unmap_icm ( struct arbel *arbel, unsigned int page_count ) {
|
336
|
351
|
return arbel_cmd ( arbel,
|
|
@@ -1431,6 +1446,7 @@ static int arbel_get_mad_params ( struct ib_device *ibdev ) {
|
1431
|
1446
|
*/
|
1432
|
1447
|
static int arbel_start_firmware ( struct arbel *arbel ) {
|
1433
|
1448
|
struct arbelprm_query_fw fw;
|
|
1449
|
+ struct arbelprm_access_lam lam;
|
1434
|
1450
|
struct arbelprm_virtual_physical_mapping map_fa;
|
1435
|
1451
|
unsigned int fw_pages;
|
1436
|
1452
|
unsigned int log2_fw_pages;
|
|
@@ -1453,6 +1469,11 @@ static int arbel_start_firmware ( struct arbel *arbel ) {
|
1453
|
1469
|
DBGC ( arbel, "Arbel %p requires %d kB for firmware\n",
|
1454
|
1470
|
arbel, ( fw_pages * 4 ) );
|
1455
|
1471
|
|
|
1472
|
+ /* Enable locally-attached memory. Ignore failure; there may
|
|
1473
|
+ * be no attached memory.
|
|
1474
|
+ */
|
|
1475
|
+ arbel_cmd_enable_lam ( arbel, &lam );
|
|
1476
|
+
|
1456
|
1477
|
/* Allocate firmware pages and map firmware area */
|
1457
|
1478
|
fw_size = ( fw_pages * 4096 );
|
1458
|
1479
|
arbel->firmware_area = umalloc ( fw_size );
|
|
@@ -1605,13 +1626,16 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1605
|
1626
|
( icm_offset >> 7 ),
|
1606
|
1627
|
qpc_eec_cqc_eqc_rdb_parameters.log_num_of_qp,
|
1607
|
1628
|
log_num_qps );
|
|
1629
|
+ DBGC ( arbel, "Arbel %p ICM QPC base = %zx\n", arbel, icm_offset );
|
1608
|
1630
|
icm_offset += icm_usage ( log_num_qps, arbel->limits.qpc_entry_size );
|
1609
|
1631
|
|
1610
|
1632
|
/* Extended queue pair contexts */
|
1611
|
1633
|
MLX_FILL_1 ( init_hca, 25,
|
1612
|
1634
|
qpc_eec_cqc_eqc_rdb_parameters.eqpc_base_addr_l,
|
1613
|
1635
|
icm_offset );
|
1614
|
|
- icm_offset += icm_usage ( log_num_qps, arbel->limits.eqpc_entry_size );
|
|
1636
|
+ DBGC ( arbel, "Arbel %p ICM EQPC base = %zx\n", arbel, icm_offset );
|
|
1637
|
+ // icm_offset += icm_usage ( log_num_qps, arbel->limits.eqpc_entry_size );
|
|
1638
|
+ icm_offset += icm_usage ( log_num_qps, arbel->limits.qpc_entry_size );
|
1615
|
1639
|
|
1616
|
1640
|
/* Shared receive queue contexts */
|
1617
|
1641
|
log_num_srqs = fls ( arbel->limits.reserved_srqs - 1 );
|
|
@@ -1620,6 +1644,7 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1620
|
1644
|
( icm_offset >> 5 ),
|
1621
|
1645
|
qpc_eec_cqc_eqc_rdb_parameters.log_num_of_srq,
|
1622
|
1646
|
log_num_srqs );
|
|
1647
|
+ DBGC ( arbel, "Arbel %p ICM SRQC base = %zx\n", arbel, icm_offset );
|
1623
|
1648
|
icm_offset += icm_usage ( log_num_srqs, arbel->limits.srqc_entry_size );
|
1624
|
1649
|
|
1625
|
1650
|
/* End-to-end contexts */
|
|
@@ -1629,12 +1654,14 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1629
|
1654
|
( icm_offset >> 7 ),
|
1630
|
1655
|
qpc_eec_cqc_eqc_rdb_parameters.log_num_of_ee,
|
1631
|
1656
|
log_num_ees );
|
|
1657
|
+ DBGC ( arbel, "Arbel %p ICM EEC base = %zx\n", arbel, icm_offset );
|
1632
|
1658
|
icm_offset += icm_usage ( log_num_ees, arbel->limits.eec_entry_size );
|
1633
|
1659
|
|
1634
|
1660
|
/* Extended end-to-end contexts */
|
1635
|
1661
|
MLX_FILL_1 ( init_hca, 29,
|
1636
|
1662
|
qpc_eec_cqc_eqc_rdb_parameters.eeec_base_addr_l,
|
1637
|
1663
|
icm_offset );
|
|
1664
|
+ DBGC ( arbel, "Arbel %p ICM EEEC base = %zx\n", arbel, icm_offset );
|
1638
|
1665
|
icm_offset += icm_usage ( log_num_ees, arbel->limits.eeec_entry_size );
|
1639
|
1666
|
|
1640
|
1667
|
/* Completion queue contexts */
|
|
@@ -1644,12 +1671,14 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1644
|
1671
|
( icm_offset >> 6 ),
|
1645
|
1672
|
qpc_eec_cqc_eqc_rdb_parameters.log_num_of_cq,
|
1646
|
1673
|
log_num_cqs );
|
|
1674
|
+ DBGC ( arbel, "Arbel %p ICM CQC base = %zx\n", arbel, icm_offset );
|
1647
|
1675
|
icm_offset += icm_usage ( log_num_cqs, arbel->limits.cqc_entry_size );
|
1648
|
1676
|
|
1649
|
1677
|
/* Memory translation table */
|
1650
|
1678
|
log_num_mtts = fls ( arbel->limits.reserved_mtts - 1 );
|
1651
|
1679
|
MLX_FILL_1 ( init_hca, 65,
|
1652
|
1680
|
tpt_parameters.mtt_base_addr_l, icm_offset );
|
|
1681
|
+ DBGC ( arbel, "Arbel %p ICM MTT base = %zx\n", arbel, icm_offset );
|
1653
|
1682
|
icm_offset += icm_usage ( log_num_mtts, arbel->limits.mtt_entry_size );
|
1654
|
1683
|
|
1655
|
1684
|
/* Memory protection table */
|
|
@@ -1658,6 +1687,7 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1658
|
1687
|
tpt_parameters.mpt_base_adr_l, icm_offset );
|
1659
|
1688
|
MLX_FILL_1 ( init_hca, 62,
|
1660
|
1689
|
tpt_parameters.log_mpt_sz, log_num_mpts );
|
|
1690
|
+ DBGC ( arbel, "Arbel %p ICM MTT base = %zx\n", arbel, icm_offset );
|
1661
|
1691
|
icm_offset += icm_usage ( log_num_mpts, arbel->limits.mpt_entry_size );
|
1662
|
1692
|
|
1663
|
1693
|
/* RDMA something or other */
|
|
@@ -1665,6 +1695,7 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1665
|
1695
|
MLX_FILL_1 ( init_hca, 37,
|
1666
|
1696
|
qpc_eec_cqc_eqc_rdb_parameters.rdb_base_addr_l,
|
1667
|
1697
|
icm_offset );
|
|
1698
|
+ DBGC ( arbel, "Arbel %p ICM RDB base = %zx\n", arbel, icm_offset );
|
1668
|
1699
|
icm_offset += icm_usage ( log_num_rdbs, 32 );
|
1669
|
1700
|
|
1670
|
1701
|
/* Event queue contexts */
|
|
@@ -1674,6 +1705,7 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1674
|
1705
|
( icm_offset >> 6 ),
|
1675
|
1706
|
qpc_eec_cqc_eqc_rdb_parameters.log_num_eq,
|
1676
|
1707
|
log_num_eqs );
|
|
1708
|
+ DBGC ( arbel, "Arbel %p ICM EQ base = %zx\n", arbel, icm_offset );
|
1677
|
1709
|
icm_offset += ( ( 1 << log_num_eqs ) * arbel->limits.eqc_entry_size );
|
1678
|
1710
|
|
1679
|
1711
|
/* Multicast table */
|
|
@@ -1686,6 +1718,7 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1686
|
1718
|
multicast_parameters.mc_table_hash_sz, 8 );
|
1687
|
1719
|
MLX_FILL_1 ( init_hca, 54,
|
1688
|
1720
|
multicast_parameters.log_mc_table_sz, 3 );
|
|
1721
|
+ DBGC ( arbel, "Arbel %p ICM MC base = %zx\n", arbel, icm_offset );
|
1689
|
1722
|
icm_offset += ( 8 * sizeof ( struct arbelprm_mgm_entry ) );
|
1690
|
1723
|
|
1691
|
1724
|
arbel->icm_len = icm_offset;
|
|
@@ -1700,10 +1733,9 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1700
|
1733
|
arbel, strerror ( rc ) );
|
1701
|
1734
|
goto err_set_icm_size;
|
1702
|
1735
|
}
|
1703
|
|
- arbel->icm_aux_len = MLX_GET ( &icm_aux_size, value );
|
|
1736
|
+ arbel->icm_aux_len = ( MLX_GET ( &icm_aux_size, value ) * 4096 );
|
1704
|
1737
|
|
1705
|
1738
|
/* Allocate ICM data and auxiliary area */
|
1706
|
|
- arbel->icm_aux_len = ( ( arbel->icm_aux_len + 4095 ) & ~4095 );
|
1707
|
1739
|
DBGC ( arbel, "Arbel %p requires %zd kB ICM and %zd kB AUX ICM\n",
|
1708
|
1740
|
arbel, ( arbel->icm_len / 1024 ),
|
1709
|
1741
|
( arbel->icm_aux_len / 1024 ) );
|
|
@@ -1717,7 +1749,8 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1717
|
1749
|
memset ( &map_icm_aux, 0, sizeof ( map_icm_aux ) );
|
1718
|
1750
|
MLX_FILL_2 ( &map_icm_aux, 3,
|
1719
|
1751
|
log2size, fls ( ( arbel->icm_aux_len / 4096 ) - 1 ),
|
1720
|
|
- pa_l, user_to_phys ( arbel->icm, arbel->icm_len ) );
|
|
1752
|
+ pa_l,
|
|
1753
|
+ ( user_to_phys ( arbel->icm, arbel->icm_len ) >> 12 ) );
|
1721
|
1754
|
if ( ( rc = arbel_cmd_map_icm_aux ( arbel, &map_icm_aux ) ) != 0 ) {
|
1722
|
1755
|
DBGC ( arbel, "Arbel %p could not map AUX ICM: %s\n",
|
1723
|
1756
|
arbel, strerror ( rc ) );
|
|
@@ -1728,7 +1761,7 @@ static int arbel_alloc_icm ( struct arbel *arbel,
|
1728
|
1761
|
memset ( &map_icm, 0, sizeof ( map_icm ) );
|
1729
|
1762
|
MLX_FILL_2 ( &map_icm, 3,
|
1730
|
1763
|
log2size, fls ( ( arbel->icm_len / 4096 ) - 1 ),
|
1731
|
|
- pa_l, user_to_phys ( arbel->icm, 0 ) );
|
|
1764
|
+ pa_l, ( user_to_phys ( arbel->icm, 0 ) >> 12 ) );
|
1732
|
1765
|
if ( ( rc = arbel_cmd_map_icm ( arbel, &map_icm ) ) != 0 ) {
|
1733
|
1766
|
DBGC ( arbel, "Arbel %p could not map ICM: %s\n",
|
1734
|
1767
|
arbel, strerror ( rc ) );
|
|
@@ -1815,7 +1848,7 @@ static int arbel_probe ( struct pci_device *pci,
|
1815
|
1848
|
goto err_mailbox_out;
|
1816
|
1849
|
}
|
1817
|
1850
|
|
1818
|
|
-#define SELF_INIT 0
|
|
1851
|
+#define SELF_INIT 1
|
1819
|
1852
|
|
1820
|
1853
|
#if SELF_INIT
|
1821
|
1854
|
/* Start firmware */
|