提交 17fa1f98 编写于 作者: D David S. Miller

Merge branch 'cxgb4-next'

Hariprasad Shenai says:

====================
cxgb4: Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes

This patch series adds support to allow FW size upto 1MB, support for S25FL032P
flash. Fix t4_flash_erase_sectors to throw an error, when erase sector aren't in
the flash and also warning message when adapters have flashes less than 2Mb.
Adds device id of new adapter and removes device id of debug adapter.

The patches series is created against 'net-next' tree.
And includes patches on cxgb4 driver and cxgb4vf driver.

We have included all the maintainers of respective drivers. Kindly review the
change and let us know in case of any review comments.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -283,6 +283,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = { ...@@ -283,6 +283,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = {
CH_DEVICE(0x5083, 4), CH_DEVICE(0x5083, 4),
CH_DEVICE(0x5084, 4), CH_DEVICE(0x5084, 4),
CH_DEVICE(0x5085, 4), CH_DEVICE(0x5085, 4),
CH_DEVICE(0x5086, 4),
CH_DEVICE(0x5401, 4), CH_DEVICE(0x5401, 4),
CH_DEVICE(0x5402, 4), CH_DEVICE(0x5402, 4),
CH_DEVICE(0x5403, 4), CH_DEVICE(0x5403, 4),
...@@ -310,6 +311,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = { ...@@ -310,6 +311,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = {
CH_DEVICE(0x5483, 4), CH_DEVICE(0x5483, 4),
CH_DEVICE(0x5484, 4), CH_DEVICE(0x5484, 4),
CH_DEVICE(0x5485, 4), CH_DEVICE(0x5485, 4),
CH_DEVICE(0x5486, 4),
{ 0, } { 0, }
}; };
......
...@@ -1099,6 +1099,9 @@ static int t4_flash_erase_sectors(struct adapter *adapter, int start, int end) ...@@ -1099,6 +1099,9 @@ static int t4_flash_erase_sectors(struct adapter *adapter, int start, int end)
{ {
int ret = 0; int ret = 0;
if (end >= adapter->params.sf_nsec)
return -EINVAL;
while (start <= end) { while (start <= end) {
if ((ret = sf1_write(adapter, 1, 0, 1, SF_WR_ENABLE)) != 0 || if ((ret = sf1_write(adapter, 1, 0, 1, SF_WR_ENABLE)) != 0 ||
(ret = sf1_write(adapter, 4, 0, 1, (ret = sf1_write(adapter, 4, 0, 1,
...@@ -3850,8 +3853,20 @@ int t4_wait_dev_ready(struct adapter *adap) ...@@ -3850,8 +3853,20 @@ int t4_wait_dev_ready(struct adapter *adap)
return t4_read_reg(adap, PL_WHOAMI) != 0xffffffff ? 0 : -EIO; return t4_read_reg(adap, PL_WHOAMI) != 0xffffffff ? 0 : -EIO;
} }
struct flash_desc {
u32 vendor_and_model_id;
u32 size_mb;
};
static int get_flash_params(struct adapter *adap) static int get_flash_params(struct adapter *adap)
{ {
/* Table for non-Numonix supported flash parts. Numonix parts are left
* to the preexisting code. All flash parts have 64KB sectors.
*/
static struct flash_desc supported_flash[] = {
{ 0x150201, 4 << 20 }, /* Spansion 4MB S25FL032P */
};
int ret; int ret;
u32 info; u32 info;
...@@ -3862,6 +3877,14 @@ static int get_flash_params(struct adapter *adap) ...@@ -3862,6 +3877,14 @@ static int get_flash_params(struct adapter *adap)
if (ret) if (ret)
return ret; return ret;
for (ret = 0; ret < ARRAY_SIZE(supported_flash); ++ret)
if (supported_flash[ret].vendor_and_model_id == info) {
adap->params.sf_size = supported_flash[ret].size_mb;
adap->params.sf_nsec =
adap->params.sf_size / SF_SEC_SIZE;
return 0;
}
if ((info & 0xff) != 0x20) /* not a Numonix flash */ if ((info & 0xff) != 0x20) /* not a Numonix flash */
return -EINVAL; return -EINVAL;
info >>= 16; /* log2 of size */ info >>= 16; /* log2 of size */
...@@ -3874,6 +3897,10 @@ static int get_flash_params(struct adapter *adap) ...@@ -3874,6 +3897,10 @@ static int get_flash_params(struct adapter *adap)
adap->params.sf_size = 1 << info; adap->params.sf_size = 1 << info;
adap->params.sf_fw_start = adap->params.sf_fw_start =
t4_read_reg(adap, CIM_BOOT_CFG) & BOOTADDR_MASK; t4_read_reg(adap, CIM_BOOT_CFG) & BOOTADDR_MASK;
if (adap->params.sf_size < FLASH_MIN_SIZE)
dev_warn(adap->pdev_dev, "WARNING!!! FLASH size %#x < %#x!!!\n",
adap->params.sf_size, FLASH_MIN_SIZE);
return 0; return 0;
} }
......
...@@ -175,7 +175,7 @@ enum { ...@@ -175,7 +175,7 @@ enum {
* Location of firmware image in FLASH. * Location of firmware image in FLASH.
*/ */
FLASH_FW_START_SEC = 8, FLASH_FW_START_SEC = 8,
FLASH_FW_NSECS = 8, FLASH_FW_NSECS = 16,
FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC), FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC),
FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS), FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS),
...@@ -206,6 +206,12 @@ enum { ...@@ -206,6 +206,12 @@ enum {
FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC), FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC),
FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS), FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS),
/* We don't support FLASH devices which can't support the full
* standard set of sections which we need for normal
* operations.
*/
FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE,
FLASH_FPGA_CFG_START_SEC = 15, FLASH_FPGA_CFG_START_SEC = 15,
FLASH_FPGA_CFG_START = FLASH_START(FLASH_FPGA_CFG_START_SEC), FLASH_FPGA_CFG_START = FLASH_START(FLASH_FPGA_CFG_START_SEC),
......
...@@ -2912,7 +2912,6 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev) ...@@ -2912,7 +2912,6 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
static const struct pci_device_id cxgb4vf_pci_tbl[] = { static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0xb000, 0), /* PE10K FPGA */ CH_DEVICE(0xb000, 0), /* PE10K FPGA */
CH_DEVICE(0x4800, 0), /* T440-dbg */
CH_DEVICE(0x4801, 0), /* T420-cr */ CH_DEVICE(0x4801, 0), /* T420-cr */
CH_DEVICE(0x4802, 0), /* T422-cr */ CH_DEVICE(0x4802, 0), /* T422-cr */
CH_DEVICE(0x4803, 0), /* T440-cr */ CH_DEVICE(0x4803, 0), /* T440-cr */
...@@ -2934,7 +2933,6 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = { ...@@ -2934,7 +2933,6 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0x4880, 6), CH_DEVICE(0x4880, 6),
CH_DEVICE(0x4880, 7), CH_DEVICE(0x4880, 7),
CH_DEVICE(0x4880, 8), CH_DEVICE(0x4880, 8),
CH_DEVICE(0x5800, 0), /* T580-dbg */
CH_DEVICE(0x5801, 0), /* T520-cr */ CH_DEVICE(0x5801, 0), /* T520-cr */
CH_DEVICE(0x5802, 0), /* T522-cr */ CH_DEVICE(0x5802, 0), /* T522-cr */
CH_DEVICE(0x5803, 0), /* T540-cr */ CH_DEVICE(0x5803, 0), /* T540-cr */
...@@ -2962,6 +2960,7 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = { ...@@ -2962,6 +2960,7 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0x5883, 0), CH_DEVICE(0x5883, 0),
CH_DEVICE(0x5884, 0), CH_DEVICE(0x5884, 0),
CH_DEVICE(0x5885, 0), CH_DEVICE(0x5885, 0),
CH_DEVICE(0x5886, 0),
{ 0, } { 0, }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册