* [PATCH net-next 1/5] cxgb4: Allow T4/T5 firmware sizes up to 1MB
2014-09-10 12:14 [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes Hariprasad Shenai
@ 2014-09-10 12:14 ` Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 2/5] cxgb4: Add support to S25FL032P flash Hariprasad Shenai
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
index 35e3d8e..06fa583 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
@@ -175,7 +175,7 @@ enum {
* Location of firmware image in FLASH.
*/
FLASH_FW_START_SEC = 8,
- FLASH_FW_NSECS = 8,
+ FLASH_FW_NSECS = 16,
FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC),
FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS),
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 2/5] cxgb4: Add support to S25FL032P flash
2014-09-10 12:14 [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 1/5] cxgb4: Allow T4/T5 firmware sizes up to 1MB Hariprasad Shenai
@ 2014-09-10 12:14 ` Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 3/5] cxgb4: Fix t4_flash_erase_sectors() to throw an error when requested to erase sectors which aren't in the FLASH Hariprasad Shenai
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
Add support for Spansion S25FL032P flash
Based on original work by Dimitris Michailidis
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 41d0446..7d4cc28 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3850,8 +3850,20 @@ int t4_wait_dev_ready(struct adapter *adap)
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)
{
+ /* 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;
u32 info;
@@ -3862,6 +3874,14 @@ static int get_flash_params(struct adapter *adap)
if (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 */
return -EINVAL;
info >>= 16; /* log2 of size */
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 3/5] cxgb4: Fix t4_flash_erase_sectors() to throw an error when requested to erase sectors which aren't in the FLASH
2014-09-10 12:14 [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 1/5] cxgb4: Allow T4/T5 firmware sizes up to 1MB Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 2/5] cxgb4: Add support to S25FL032P flash Hariprasad Shenai
@ 2014-09-10 12:14 ` Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 4/5] cxgb4: Add warning msg when attaching to adapters which have FLASHes smaller than 2Mb Hariprasad Shenai
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 7d4cc28..586a5f1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -1099,6 +1099,9 @@ static int t4_flash_erase_sectors(struct adapter *adapter, int start, int end)
{
int ret = 0;
+ if (end >= adapter->params.sf_nsec)
+ return -EINVAL;
+
while (start <= end) {
if ((ret = sf1_write(adapter, 1, 0, 1, SF_WR_ENABLE)) != 0 ||
(ret = sf1_write(adapter, 4, 0, 1,
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 4/5] cxgb4: Add warning msg when attaching to adapters which have FLASHes smaller than 2Mb
2014-09-10 12:14 [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes Hariprasad Shenai
` (2 preceding siblings ...)
2014-09-10 12:14 ` [PATCH net-next 3/5] cxgb4: Fix t4_flash_erase_sectors() to throw an error when requested to erase sectors which aren't in the FLASH Hariprasad Shenai
@ 2014-09-10 12:14 ` Hariprasad Shenai
2014-09-10 12:14 ` [PATCH net-next 5/5] cxgb4/cxgb4vf: Add device ID for new adapter and remove for dbg adapter Hariprasad Shenai
2014-09-10 21:02 ` [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 4 ++++
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 586a5f1..22d7581 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3897,6 +3897,10 @@ static int get_flash_params(struct adapter *adap)
adap->params.sf_size = 1 << info;
adap->params.sf_fw_start =
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;
}
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
index 06fa583..6833a7b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
@@ -206,6 +206,12 @@ enum {
FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC),
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 = FLASH_START(FLASH_FPGA_CFG_START_SEC),
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 5/5] cxgb4/cxgb4vf: Add device ID for new adapter and remove for dbg adapter
2014-09-10 12:14 [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes Hariprasad Shenai
` (3 preceding siblings ...)
2014-09-10 12:14 ` [PATCH net-next 4/5] cxgb4: Add warning msg when attaching to adapters which have FLASHes smaller than 2Mb Hariprasad Shenai
@ 2014-09-10 12:14 ` Hariprasad Shenai
2014-09-10 21:02 ` [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 ++
.../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index d6a9a0b..f56b95a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -283,6 +283,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = {
CH_DEVICE(0x5083, 4),
CH_DEVICE(0x5084, 4),
CH_DEVICE(0x5085, 4),
+ CH_DEVICE(0x5086, 4),
CH_DEVICE(0x5401, 4),
CH_DEVICE(0x5402, 4),
CH_DEVICE(0x5403, 4),
@@ -310,6 +311,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = {
CH_DEVICE(0x5483, 4),
CH_DEVICE(0x5484, 4),
CH_DEVICE(0x5485, 4),
+ CH_DEVICE(0x5486, 4),
{ 0, }
};
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 2102a4c..8253403 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2912,7 +2912,6 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0xb000, 0), /* PE10K FPGA */
- CH_DEVICE(0x4800, 0), /* T440-dbg */
CH_DEVICE(0x4801, 0), /* T420-cr */
CH_DEVICE(0x4802, 0), /* T422-cr */
CH_DEVICE(0x4803, 0), /* T440-cr */
@@ -2934,7 +2933,6 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0x4880, 6),
CH_DEVICE(0x4880, 7),
CH_DEVICE(0x4880, 8),
- CH_DEVICE(0x5800, 0), /* T580-dbg */
CH_DEVICE(0x5801, 0), /* T520-cr */
CH_DEVICE(0x5802, 0), /* T522-cr */
CH_DEVICE(0x5803, 0), /* T540-cr */
@@ -2962,6 +2960,7 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0x5883, 0),
CH_DEVICE(0x5884, 0),
CH_DEVICE(0x5885, 0),
+ CH_DEVICE(0x5886, 0),
{ 0, }
};
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes
2014-09-10 12:14 [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes Hariprasad Shenai
` (4 preceding siblings ...)
2014-09-10 12:14 ` [PATCH net-next 5/5] cxgb4/cxgb4vf: Add device ID for new adapter and remove for dbg adapter Hariprasad Shenai
@ 2014-09-10 21:02 ` David Miller
5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2014-09-10 21:02 UTC (permalink / raw)
To: hariprasad; +Cc: netdev, leedom, nirranjan, kumaras, anish
From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Wed, 10 Sep 2014 17:44:26 +0530
> 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.
Series applied, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread