Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NTB: Add parameters for Intel SNB B2B addresses

Add module parameters for the addresses to be used in B2B topology.

Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>

authored by

Allen Hubbe and committed by
Jon Mason
42fefc86 2849b5d7

+68 -19
+10
Documentation/ntb.txt
··· 56 56 * b2b\_mw\_share - If the peer ntb is to be accessed via a memory window, and if 57 57 the memory window is large enough, still allow the client to use the 58 58 second half of the memory window for address translation to the peer. 59 + * snb\_b2b\_usd\_bar2\_addr64 - If using B2B topology on Xeon hardware, use this 60 + 64 bit address on the bus between the NTB devices for the window at 61 + BAR2, on the upstream side of the link. 62 + * snb\_b2b\_usd\_bar4\_addr64 - See *snb\_b2b\_bar2\_addr64*. 63 + * snb\_b2b\_usd\_bar4\_addr32 - See *snb\_b2b\_bar2\_addr64*. 64 + * snb\_b2b\_usd\_bar5\_addr32 - See *snb\_b2b\_bar2\_addr64*. 65 + * snb\_b2b\_dsd\_bar2\_addr64 - See *snb\_b2b\_bar2\_addr64*. 66 + * snb\_b2b\_dsd\_bar4\_addr64 - See *snb\_b2b\_bar2\_addr64*. 67 + * snb\_b2b\_dsd\_bar4\_addr32 - See *snb\_b2b\_bar2\_addr64*. 68 + * snb\_b2b\_dsd\_bar5\_addr32 - See *snb\_b2b\_bar2\_addr64*.
+58 -19
drivers/ntb/hw/intel/ntb_hw_intel.c
··· 72 72 #define bar0_off(base, bar) ((base) + ((bar) << 2)) 73 73 #define bar2_off(base, bar) bar0_off(base, (bar) - 2) 74 74 75 + static const struct intel_ntb_reg bwd_reg; 76 + static const struct intel_ntb_alt_reg bwd_pri_reg; 77 + static const struct intel_ntb_alt_reg bwd_sec_reg; 78 + static const struct intel_ntb_alt_reg bwd_b2b_reg; 79 + static const struct intel_ntb_xlat_reg bwd_pri_xlat; 80 + static const struct intel_ntb_xlat_reg bwd_sec_xlat; 81 + static const struct intel_ntb_reg snb_reg; 82 + static const struct intel_ntb_alt_reg snb_pri_reg; 83 + static const struct intel_ntb_alt_reg snb_sec_reg; 84 + static const struct intel_ntb_alt_reg snb_b2b_reg; 85 + static const struct intel_ntb_xlat_reg snb_pri_xlat; 86 + static const struct intel_ntb_xlat_reg snb_sec_xlat; 87 + static struct intel_b2b_addr snb_b2b_usd_addr; 88 + static struct intel_b2b_addr snb_b2b_dsd_addr; 89 + static const struct ntb_dev_ops intel_ntb_ops; 90 + 91 + static const struct file_operations intel_ntb_debugfs_info; 92 + static struct dentry *debugfs_dir; 93 + 75 94 static int b2b_mw_idx = -1; 76 95 module_param(b2b_mw_idx, int, 0644); 77 96 MODULE_PARM_DESC(b2b_mw_idx, "Use this mw idx to access the peer ntb. A " ··· 105 86 "the mw, so the second half can still be used as a mw. Both " 106 87 "sides MUST set the same value here!"); 107 88 108 - static const struct intel_ntb_reg bwd_reg; 109 - static const struct intel_ntb_alt_reg bwd_pri_reg; 110 - static const struct intel_ntb_alt_reg bwd_sec_reg; 111 - static const struct intel_ntb_alt_reg bwd_b2b_reg; 112 - static const struct intel_ntb_xlat_reg bwd_pri_xlat; 113 - static const struct intel_ntb_xlat_reg bwd_sec_xlat; 114 - static const struct intel_ntb_reg snb_reg; 115 - static const struct intel_ntb_alt_reg snb_pri_reg; 116 - static const struct intel_ntb_alt_reg snb_sec_reg; 117 - static const struct intel_ntb_alt_reg snb_b2b_reg; 118 - static const struct intel_ntb_xlat_reg snb_pri_xlat; 119 - static const struct intel_ntb_xlat_reg snb_sec_xlat; 120 - static const struct intel_b2b_addr snb_b2b_usd_addr; 121 - static const struct intel_b2b_addr snb_b2b_dsd_addr; 89 + module_param_named(snb_b2b_usd_bar2_addr64, 90 + snb_b2b_usd_addr.bar2_addr64, ullong, 0644); 91 + MODULE_PARM_DESC(snb_b2b_usd_bar2_addr64, 92 + "SNB B2B USD BAR 2 64-bit address"); 122 93 123 - static const struct ntb_dev_ops intel_ntb_ops; 94 + module_param_named(snb_b2b_usd_bar4_addr64, 95 + snb_b2b_usd_addr.bar4_addr64, ullong, 0644); 96 + MODULE_PARM_DESC(snb_b2b_usd_bar2_addr64, 97 + "SNB B2B USD BAR 4 64-bit address"); 124 98 125 - static const struct file_operations intel_ntb_debugfs_info; 126 - static struct dentry *debugfs_dir; 99 + module_param_named(snb_b2b_usd_bar4_addr32, 100 + snb_b2b_usd_addr.bar4_addr32, ullong, 0644); 101 + MODULE_PARM_DESC(snb_b2b_usd_bar2_addr64, 102 + "SNB B2B USD split-BAR 4 32-bit address"); 103 + 104 + module_param_named(snb_b2b_usd_bar5_addr32, 105 + snb_b2b_usd_addr.bar5_addr32, ullong, 0644); 106 + MODULE_PARM_DESC(snb_b2b_usd_bar2_addr64, 107 + "SNB B2B USD split-BAR 5 32-bit address"); 108 + 109 + module_param_named(snb_b2b_dsd_bar2_addr64, 110 + snb_b2b_dsd_addr.bar2_addr64, ullong, 0644); 111 + MODULE_PARM_DESC(snb_b2b_dsd_bar2_addr64, 112 + "SNB B2B DSD BAR 2 64-bit address"); 113 + 114 + module_param_named(snb_b2b_dsd_bar4_addr64, 115 + snb_b2b_dsd_addr.bar4_addr64, ullong, 0644); 116 + MODULE_PARM_DESC(snb_b2b_dsd_bar2_addr64, 117 + "SNB B2B DSD BAR 4 64-bit address"); 118 + 119 + module_param_named(snb_b2b_dsd_bar4_addr32, 120 + snb_b2b_dsd_addr.bar4_addr32, ullong, 0644); 121 + MODULE_PARM_DESC(snb_b2b_dsd_bar2_addr64, 122 + "SNB B2B DSD split-BAR 4 32-bit address"); 123 + 124 + module_param_named(snb_b2b_dsd_bar5_addr32, 125 + snb_b2b_dsd_addr.bar5_addr32, ullong, 0644); 126 + MODULE_PARM_DESC(snb_b2b_dsd_bar2_addr64, 127 + "SNB B2B DSD split-BAR 5 32-bit address"); 127 128 128 129 #ifndef ioread64 129 130 #ifdef readq ··· 2112 2073 .bar2_xlat = SNB_SBAR23XLAT_OFFSET, 2113 2074 }; 2114 2075 2115 - static const struct intel_b2b_addr snb_b2b_usd_addr = { 2076 + static struct intel_b2b_addr snb_b2b_usd_addr = { 2116 2077 .bar2_addr64 = SNB_B2B_BAR2_USD_ADDR64, 2117 2078 .bar4_addr64 = SNB_B2B_BAR4_USD_ADDR64, 2118 2079 .bar4_addr32 = SNB_B2B_BAR4_USD_ADDR32, 2119 2080 .bar5_addr32 = SNB_B2B_BAR5_USD_ADDR32, 2120 2081 }; 2121 2082 2122 - static const struct intel_b2b_addr snb_b2b_dsd_addr = { 2083 + static struct intel_b2b_addr snb_b2b_dsd_addr = { 2123 2084 .bar2_addr64 = SNB_B2B_BAR2_DSD_ADDR64, 2124 2085 .bar4_addr64 = SNB_B2B_BAR4_DSD_ADDR64, 2125 2086 .bar4_addr32 = SNB_B2B_BAR4_DSD_ADDR32,