DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Fwd: [PATCH] em: enable flash access, tested with Intel 82577LM
       [not found] <1444142686-2579-1-git-send-email-bie.jiuling@gmail.com>
@ 2015-10-07 17:27 ` Jiuling Bie
  2015-10-26 16:01   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Jiuling Bie @ 2015-10-07 17:27 UTC (permalink / raw)
  To: dev

---
 drivers/net/e1000/base/e1000_osdep.h            | 18 ++++++++----------
 drivers/net/e1000/em_ethdev.c                   |  1 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h |  1 +
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/e1000/base/e1000_osdep.h
b/drivers/net/e1000/base/e1000_osdep.h
index d04ec73..ed08441 100644
--- a/drivers/net/e1000/base/e1000_osdep.h
+++ b/drivers/net/e1000/base/e1000_osdep.h
@@ -155,21 +155,19 @@ static inline uint32_t e1000_read_addr(volatile void*
addr)
 #define E1000_WRITE_REG_IO(hw, reg, value) \
        E1000_WRITE_REG(hw, reg, value)

-/*
- * Not implemented.
- */
-
 #define E1000_READ_FLASH_REG(hw, reg) \
-       (E1000_ACCESS_PANIC(E1000_READ_FLASH_REG, hw, reg, 0), 0)
+       rte_le_to_cpu_32(*(volatile uint32_t *)(hw->flash_address + reg))

 #define E1000_READ_FLASH_REG16(hw, reg)  \
-       (E1000_ACCESS_PANIC(E1000_READ_FLASH_REG16, hw, reg, 0), 0)
+       rte_le_to_cpu_16(*(volatile uint16_t *)(hw->flash_address + reg))

-#define E1000_WRITE_FLASH_REG(hw, reg, value)  \
-       E1000_ACCESS_PANIC(E1000_WRITE_FLASH_REG, hw, reg, value)
+#define E1000_WRITE_FLASH_REG(hw, reg, value) do { \
+       *(volatile uint32_t *)(hw->flash_address + reg) =
rte_cpu_to_le_32(value); \
+} while (0)

-#define E1000_WRITE_FLASH_REG16(hw, reg, value) \
-       E1000_ACCESS_PANIC(E1000_WRITE_FLASH_REG16, hw, reg, value)
+#define E1000_WRITE_FLASH_REG16(hw, reg, value) do { \
+       *(volatile uint16_t *)(hw->flash_address + reg) =
rte_cpu_to_le_16(value); \
+} while (0)

 #define STATIC static

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 912f5dd..dd82bad 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -247,6 +247,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
        }

        hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
+       hw->flash_address = (void *)pci_dev->mem_resource[1].addr;
        hw->device_id = pci_dev->id.device_id;
        adapter->stopped = 0;

diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h
b/lib/librte_eal/common/include/rte_pci_dev_ids.h
index 265e66c..071cf8a 100644
--- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
+++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h
@@ -304,6 +304,7 @@ RTE_PCI_DEV_ID_DECL_EM(PCI_VENDOR_ID_INTEL,
E1000_DEV_ID_82572EI)
 RTE_PCI_DEV_ID_DECL_EM(PCI_VENDOR_ID_INTEL, E1000_DEV_ID_82573L)
 RTE_PCI_DEV_ID_DECL_EM(PCI_VENDOR_ID_INTEL, E1000_DEV_ID_82574L)
 RTE_PCI_DEV_ID_DECL_EM(PCI_VENDOR_ID_INTEL, E1000_DEV_ID_82574LA)
+RTE_PCI_DEV_ID_DECL_EM(PCI_VENDOR_ID_INTEL, E1000_DEV_ID_PCH_M_HV_LM)
 RTE_PCI_DEV_ID_DECL_EM(PCI_VENDOR_ID_INTEL, E1000_DEV_ID_82583V)

 /******************** Physical IGB devices from e1000_hw.h
********************/
--
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Fwd: [PATCH] em: enable flash access, tested with Intel 82577LM
  2015-10-07 17:27 ` [dpdk-dev] Fwd: [PATCH] em: enable flash access, tested with Intel 82577LM Jiuling Bie
@ 2015-10-26 16:01   ` Thomas Monjalon
  2015-10-27  1:01     ` Lu, Wenzhuo
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2015-10-26 16:01 UTC (permalink / raw)
  To: wenzhuo.lu; +Cc: dev, Jiuling Bie

This patch does not comply with the DPDK rules.
But the needs deserved to be discussed with the e1000 maintainer.
Wenzhuo?

2015-10-07 13:27, Jiuling Bie:
> ---
>  drivers/net/e1000/base/e1000_osdep.h            | 18 ++++++++----------
>  drivers/net/e1000/em_ethdev.c                   |  1 +
>  lib/librte_eal/common/include/rte_pci_dev_ids.h |  1 +
>  3 files changed, 10 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Fwd: [PATCH] em: enable flash access, tested with Intel 82577LM
  2015-10-26 16:01   ` Thomas Monjalon
@ 2015-10-27  1:01     ` Lu, Wenzhuo
  0 siblings, 0 replies; 3+ messages in thread
From: Lu, Wenzhuo @ 2015-10-27  1:01 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Jiuling Bie

Hi Jiuling, Thomas,
I think we can change the osdep in the base directory.
But the tittle is a little weird, I mean the "Fwd:" :)  And some comments are needed to explain why we need this patch. Thanks.

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, October 27, 2015 12:01 AM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org; Jiuling Bie
> Subject: Re: [dpdk-dev] Fwd: [PATCH] em: enable flash access, tested with
> Intel 82577LM
> 
> This patch does not comply with the DPDK rules.
> But the needs deserved to be discussed with the e1000 maintainer.
> Wenzhuo?
> 
> 2015-10-07 13:27, Jiuling Bie:
> > ---
> >  drivers/net/e1000/base/e1000_osdep.h            | 18 ++++++++----------
> >  drivers/net/e1000/em_ethdev.c                   |  1 +
> >  lib/librte_eal/common/include/rte_pci_dev_ids.h |  1 +
> >  3 files changed, 10 insertions(+), 10 deletions(-)
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-27  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1444142686-2579-1-git-send-email-bie.jiuling@gmail.com>
2015-10-07 17:27 ` [dpdk-dev] Fwd: [PATCH] em: enable flash access, tested with Intel 82577LM Jiuling Bie
2015-10-26 16:01   ` Thomas Monjalon
2015-10-27  1:01     ` Lu, Wenzhuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).