Hauke Mehrtens | 29 Apr 2012 02:18
Picon

[PATCH 0/4] bcma: add PCI functions from brcmsmac

This patch series contains the functions regarding the PCIe core from 
brcmsmac for the supported PCIe core revisions.

Some of these functions have to be called on resume after suspend, but 
I do not know which or if all have to be called. I do not have a PCIe 
based device supported by brcmsmac, so I can not test this. Could 
someone which such a device do some tests and create a patch with the 
functions, which have to be called on resume.

The goal of theses patches is to remove the PCIe code from brcmsmac to 
get one step ahead in making brcmsmac support non pcie based devices.

This is based on wireless-testing/master.

Hauke Mehrtens (4):
  bcma: implement setting core clock mode to dynamic
  bcma: add bcma_core_pci_extend_L1timer
  bcma: add bcma_core_pci_fixcfg()
  bcma: add bcma_core_pci_config_fixup()

 drivers/bcma/core.c                  |    2 +-
 drivers/bcma/driver_pci.c            |   53 ++++++++++++++++++++++++++++++++--
 include/linux/bcma/bcma_driver_pci.h |   11 +++++++
 3 files changed, 63 insertions(+), 3 deletions(-)

--

-- 
1.7.9.5
Hauke Mehrtens | 29 Apr 2012 02:18
Picon

[PATCH 2/4] bcma: add bcma_core_pci_extend_L1timer

This code is based on code from pcie_extendL1timer() in brcmsmac. This
patch is part of the move of pci specific code from brcmsmac to bcma.

Signed-off-by: Hauke Mehrtens <hauke@...>
---
 drivers/bcma/driver_pci.c            |   16 ++++++++++++++--
 include/linux/bcma/bcma_driver_pci.h |    2 ++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 4d38ae1..9492066 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
 <at>  <at>  -24,14 +24,12  <at>  <at>  u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)
 	return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA);
 }

-#if 0
 static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data)
 {
 	pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address);
 	pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR);
 	pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data);
 }
-#endif

 static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
 {
 <at>  <at>  -224,3 +222,17  <at>  <at>  out:
 	return err;
(Continue reading)

Hauke Mehrtens | 29 Apr 2012 02:18
Picon

[PATCH 3/4] bcma: add bcma_core_pci_fixcfg()

This code is based on code from pcicore_fixcfg() in brcmsmac. This
patch is part of the move of pci specific code from brcmsmac to bcma.

Signed-off-by: Hauke Mehrtens <hauke@...>
---
 drivers/bcma/driver_pci.c            |   19 +++++++++++++++++++
 include/linux/bcma/bcma_driver_pci.h |    5 +++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 9492066..472d14f 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
 <at>  <at>  -168,12 +168,31  <at>  <at>  static void bcma_pcicore_serdes_workaround(struct bcma_drv_pci *pc)
 		                     tmp & ~BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN);
 }

+static void bcma_core_pci_fixcfg(struct bcma_drv_pci *pc)
+{
+	struct bcma_device *core = pc->core;
+	u16 val16, core_index;
+	uint regoff;
+
+	regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_PI_OFFSET);
+	core_index = (u16)core->core_index;
+
+	val16 = pcicore_read16(pc, regoff);
+	if (((val16 & BCMA_CORE_PCI_SPROM_PI_MASK) >> BCMA_CORE_PCI_SPROM_PI_SHIFT)
+	     != core_index) {
+		val16 = (core_index << BCMA_CORE_PCI_SPROM_PI_SHIFT) |
(Continue reading)

Hauke Mehrtens | 29 Apr 2012 02:18
Picon

[PATCH 4/4] bcma: add bcma_core_pci_config_fixup()

This code is based on code from pcie_misc_config_fixup() in brcmsmac.
This patch is part of the move of pci specific code from brcmsmac to
bcma.

Signed-off-by: Hauke Mehrtens <hauke@...>
---
 drivers/bcma/driver_pci.c            |   18 ++++++++++++++++++
 include/linux/bcma/bcma_driver_pci.h |    4 ++++
 2 files changed, 22 insertions(+)

diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 472d14f..9a96f14 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
 <at>  <at>  -186,6 +186,23  <at>  <at>  static void bcma_core_pci_fixcfg(struct bcma_drv_pci *pc)
 	}
 }

+/* Fix MISC config to allow coming out of L2/L3-Ready state w/o PRST */
+/* Needs to happen when coming out of 'standby'/'hibernate' */
+static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
+{
+	u16 val16;
+	uint regoff;
+
+	regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_MISC_CONFIG);
+
+	val16 = pcicore_read16(pc, regoff);
+
+	if (!(val16 & BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST)) {
(Continue reading)

Hauke Mehrtens | 29 Apr 2012 02:18
Picon

[PATCH 1/4] bcma: implement setting core clock mode to dynamic

This patch is based on code from _ai_clkctl_cc() in brcmsmac.

Signed-off-by: Hauke Mehrtens <hauke@...>
---
 drivers/bcma/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/core.c b/drivers/bcma/core.c
index 893f6e0..98e243c 100644
--- a/drivers/bcma/core.c
+++ b/drivers/bcma/core.c
 <at>  <at>  -77,7 +77,7  <at>  <at>  void bcma_core_set_clockmode(struct bcma_device *core,
 			pr_err("HT force timeout\n");
 		break;
 	case BCMA_CLKMODE_DYNAMIC:
-		pr_warn("Dynamic clockmode not supported yet!\n");
+		bcma_set32(core, BCMA_CLKCTLST, ~BCMA_CLKCTLST_FORCEHT);
 		break;
 	}
 }
--

-- 
1.7.9.5
Arend van Spriel | 29 Apr 2012 10:05
Favicon

Re: [PATCH 0/4] bcma: add PCI functions from brcmsmac

On 04/29/2012 02:18 AM, Hauke Mehrtens wrote:
> This patch series contains the functions regarding the PCIe core from
> brcmsmac for the supported PCIe core revisions.
>
> Some of these functions have to be called on resume after suspend, but
> I do not know which or if all have to be called. I do not have a PCIe
> based device supported by brcmsmac, so I can not test this. Could
> someone which such a device do some tests and create a patch with the
> functions, which have to be called on resume.

I do have some devices and feel it is my/our responsibility to get this 
tested. I let you know the results.

> The goal of theses patches is to remove the PCIe code from brcmsmac to
> get one step ahead in making brcmsmac support non pcie based devices.
>
> This is based on wireless-testing/master.
>

Gr. AvS
Hauke Mehrtens | 10 May 2012 00:17
Picon

Re: [PATCH 0/4] bcma: add PCI functions from brcmsmac

On 04/29/2012 02:18 AM, Hauke Mehrtens wrote:
> This patch series contains the functions regarding the PCIe core from 
> brcmsmac for the supported PCIe core revisions.
> 
> Some of these functions have to be called on resume after suspend, but 
> I do not know which or if all have to be called. I do not have a PCIe 
> based device supported by brcmsmac, so I can not test this. Could 
> someone which such a device do some tests and create a patch with the 
> functions, which have to be called on resume.
> 
> The goal of theses patches is to remove the PCIe code from brcmsmac to 
> get one step ahead in making brcmsmac support non pcie based devices.
> 
> This is based on wireless-testing/master.
> 
> Hauke Mehrtens (4):
>   bcma: implement setting core clock mode to dynamic
>   bcma: add bcma_core_pci_extend_L1timer
>   bcma: add bcma_core_pci_fixcfg()
>   bcma: add bcma_core_pci_config_fixup()
> 
>  drivers/bcma/core.c                  |    2 +-
>  drivers/bcma/driver_pci.c            |   53 ++++++++++++++++++++++++++++++++--
>  include/linux/bcma/bcma_driver_pci.h |   11 +++++++
>  3 files changed, 63 insertions(+), 3 deletions(-)
> 

Hi Rafał,

could you give me an ack or a nack about this patch series and the other
(Continue reading)

John W. Linville | 15 May 2012 23:15
Favicon

Re: [PATCH 0/4] bcma: add PCI functions from brcmsmac

On Thu, May 10, 2012 at 12:17:39AM +0200, Hauke Mehrtens wrote:
> On 04/29/2012 02:18 AM, Hauke Mehrtens wrote:
> > This patch series contains the functions regarding the PCIe core from 
> > brcmsmac for the supported PCIe core revisions.
> > 
> > Some of these functions have to be called on resume after suspend, but 
> > I do not know which or if all have to be called. I do not have a PCIe 
> > based device supported by brcmsmac, so I can not test this. Could 
> > someone which such a device do some tests and create a patch with the 
> > functions, which have to be called on resume.
> > 
> > The goal of theses patches is to remove the PCIe code from brcmsmac to 
> > get one step ahead in making brcmsmac support non pcie based devices.
> > 
> > This is based on wireless-testing/master.
> > 
> > Hauke Mehrtens (4):
> >   bcma: implement setting core clock mode to dynamic
> >   bcma: add bcma_core_pci_extend_L1timer
> >   bcma: add bcma_core_pci_fixcfg()
> >   bcma: add bcma_core_pci_config_fixup()
> > 
> >  drivers/bcma/core.c                  |    2 +-
> >  drivers/bcma/driver_pci.c            |   53 ++++++++++++++++++++++++++++++++--
> >  include/linux/bcma/bcma_driver_pci.h |   11 +++++++
> >  3 files changed, 63 insertions(+), 3 deletions(-)
> > 
> 
> Hi Rafał,
> 
(Continue reading)


Gmane