ddaney.cavm | 11 Nov 2011 01:29
Picon

[PATCH 2/3] MIPS: Octeon: Update bootloader board type constants.

From: David Daney <david.daney <at> cavium.com>

Many new types of boards exist, so lets recognize them.

Signed-off-by: David Daney <david.daney <at> cavium.com>
---
 .../cavium-octeon/executive/cvmx-helper-board.c    |   20 ++++++
 arch/mips/include/asm/octeon/cvmx-bootinfo.h       |   72 +++++++++++++++++++-
 arch/mips/include/asm/octeon/cvmx-helper-board.h   |    6 ++
 3 files changed, 95 insertions(+), 3 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 71590a3..fd20153 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
 <at>  <at>  -117,6 +117,10  <at>  <at>  int cvmx_helper_board_get_mii_address(int ipd_port)
 	case CVMX_BOARD_TYPE_EBH5200:
 	case CVMX_BOARD_TYPE_EBH5201:
 	case CVMX_BOARD_TYPE_EBT5200:
+		/* Board has 2 management ports */
+		if ((ipd_port >= CVMX_HELPER_BOARD_MGMT_IPD_PORT) &&
+		    (ipd_port < (CVMX_HELPER_BOARD_MGMT_IPD_PORT + 2)))
+			return ipd_port - CVMX_HELPER_BOARD_MGMT_IPD_PORT;
 		/*
 		 * Board has 4 SGMII ports. The PHYs start right after the MII
 		 * ports MII0 = 0, MII1 = 1, SGMII = 2-5.
 <at>  <at>  -128,6 +132,9  <at>  <at>  int cvmx_helper_board_get_mii_address(int ipd_port)
 	case CVMX_BOARD_TYPE_EBH5600:
 	case CVMX_BOARD_TYPE_EBH5601:
 	case CVMX_BOARD_TYPE_EBH5610:
(Continue reading)

ddaney.cavm | 11 Nov 2011 01:29
Picon

[PATCH 0/3] Move some Octeon support files out of staging.

From: David Daney <david.daney <at> cavium.com>

First patch:

In preparation for my next set of patches to add device tree support
for Octeon, move some files out of drivers/staging/octeon to common
location.  There are two basic types of files I am moving:

1) Register definition files.  Most Octeon register definition files
   are in arch/mips/include/asm/octeon, put the rest there too.

2) Low level packet port type probing code.  This is needed by both
   the Ethernet driver and the code that fixes up the in-kernel device
   trees.  Although new board pass a device tree to the kernel,
   support of legacy boards requires that this probing code be used to
   fix up an in-kernel device tree template.

Second patch:

Update support for legacy boards.

Third patch:

Seperate probing and initialization of packet ports.

Since these are MIPS architecture files we could merge via Ralf's tree
if approved.

David Daney (3):
  MIPS: Octeon: Move some Ethernet support files out of staging.
(Continue reading)

ddaney.cavm | 11 Nov 2011 01:29
Picon

[PATCH 3/3] MIPS: Octeon: Rearrange CVMX files in preperation for device tree

From: David Daney <david.daney <at> cavium.com>

Signed-off-by: David Daney <david.daney <at> cavium.com>
---
 .../cavium-octeon/executive/cvmx-helper-sgmii.c    |    6 +-
 .../mips/cavium-octeon/executive/cvmx-helper-spi.c |   10 ++
 .../cavium-octeon/executive/cvmx-helper-xaui.c     |   22 +++--
 arch/mips/cavium-octeon/executive/cvmx-helper.c    |   93 ++++++++++++++++---
 arch/mips/include/asm/octeon/cvmx-helper-loop.h    |    1 +
 arch/mips/include/asm/octeon/cvmx-helper-npi.h     |    1 +
 arch/mips/include/asm/octeon/cvmx-helper-rgmii.h   |    1 +
 arch/mips/include/asm/octeon/cvmx-helper-sgmii.h   |    1 +
 arch/mips/include/asm/octeon/cvmx-helper-spi.h     |    1 +
 arch/mips/include/asm/octeon/cvmx-helper-xaui.h    |    1 +
 arch/mips/include/asm/octeon/cvmx-helper.h         |    1 +
 11 files changed, 114 insertions(+), 24 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c b/arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c
index 464347f..0c0bf5d 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c
 <at>  <at>  -326,6 +326,10  <at>  <at>  static int __cvmx_helper_sgmii_hardware_init(int interface, int num_ports)
 	return 0;
 }

+int __cvmx_helper_sgmii_enumerate(int interface)
+{
+	return 4;
+}
 /**
(Continue reading)

ddaney.cavm | 11 Nov 2011 01:29
Picon

[PATCH 1/3] MIPS: Octeon: Move some Ethernet support files out of staging.

From: David Daney <david.daney <at> cavium.com>

Signed-off-by: David Daney <david.daney <at> cavium.com>
---
 arch/mips/cavium-octeon/executive/Makefile         |    5 +
 .../mips/cavium-octeon/executive}/cvmx-cmd-queue.c |    8 +-
 .../mips/cavium-octeon/executive}/cvmx-fpa.c       |    0
 .../cavium-octeon/executive}/cvmx-helper-board.c   |   18 +--
 .../cavium-octeon/executive}/cvmx-helper-fpa.c     |    0
 .../cavium-octeon/executive}/cvmx-helper-loop.c    |    6 +-
 .../cavium-octeon/executive}/cvmx-helper-npi.c     |    6 +-
 .../cavium-octeon/executive}/cvmx-helper-rgmii.c   |   17 +-
 .../cavium-octeon/executive}/cvmx-helper-sgmii.c   |   12 +-
 .../cavium-octeon/executive}/cvmx-helper-spi.c     |   10 +-
 .../cavium-octeon/executive}/cvmx-helper-util.c    |   16 +-
 .../cavium-octeon/executive}/cvmx-helper-xaui.c    |   10 +-
 .../mips/cavium-octeon/executive}/cvmx-helper.c    |   27 ++--
 .../executive}/cvmx-interrupt-decodes.c            |   10 +-
 .../cavium-octeon/executive}/cvmx-interrupt-rsl.c  |    4 +-
 .../mips/cavium-octeon/executive}/cvmx-pko.c       |    8 +-
 .../mips/cavium-octeon/executive}/cvmx-spi.c       |   12 +-
 .../mips/include/asm}/octeon/cvmx-address.h        |    0
 .../mips/include/asm}/octeon/cvmx-asxx-defs.h      |    0
 .../mips/include/asm}/octeon/cvmx-cmd-queue.h      |    0
 .../mips/include/asm}/octeon/cvmx-config.h         |    0
 .../mips/include/asm}/octeon/cvmx-dbg-defs.h       |    0
 .../mips/include/asm}/octeon/cvmx-fau.h            |    0
 .../mips/include/asm}/octeon/cvmx-fpa-defs.h       |    0
 .../mips/include/asm}/octeon/cvmx-fpa.h            |    0
 .../mips/include/asm}/octeon/cvmx-gmxx-defs.h      |    0
(Continue reading)

Greg KH | 11 Nov 2011 01:45
Picon

Re: [PATCH 0/3] Move some Octeon support files out of staging.

On Thu, Nov 10, 2011 at 04:29:44PM -0800, ddaney.cavm <at> gmail.com wrote:
> From: David Daney <david.daney <at> cavium.com>
> 
> First patch:
> 
> In preparation for my next set of patches to add device tree support
> for Octeon, move some files out of drivers/staging/octeon to common
> location.  There are two basic types of files I am moving:
> 
> 1) Register definition files.  Most Octeon register definition files
>    are in arch/mips/include/asm/octeon, put the rest there too.
> 
> 2) Low level packet port type probing code.  This is needed by both
>    the Ethernet driver and the code that fixes up the in-kernel device
>    trees.  Although new board pass a device tree to the kernel,
>    support of legacy boards requires that this probing code be used to
>    fix up an in-kernel device tree template.
> 
> 
> Second patch:
> 
> Update support for legacy boards.
> 
> 
> Third patch:
> 
> Seperate probing and initialization of packet ports.
> 
> 
> Since these are MIPS architecture files we could merge via Ralf's tree
(Continue reading)

David Daney | 11 Nov 2011 01:48

Re: [PATCH] netdev/phy: Use mdiobus_read() so that proper locks are taken.

On 11/10/2011 04:29 PM, Tabi Timur-B04825 wrote:
> On Fri, Sep 30, 2011 at 4:51 PM, David Daney<david.daney <at> cavium.com>  wrote:
>> Accesses to the mdio busses must be done with the mdio_lock to ensure
>> proper operation.  Conveniently we have the helper function
>> mdiobus_read() to do that for us.  Lets use it in get_phy_id() instead
>> of accessing the bus without the lock held.
>>
>> Signed-off-by: David Daney<david.daney <at> cavium.com>
>> ---
>
> This patch is causing me problems, but I'm not exactly certain how.

I think it is because fsl_pq_mdio_probe() is defective.

You are using the bus, by calling fsl_pq_mdio_find_free(), before the 
driver is registered and initialized by calling  of_mdiobus_register().

At least that is my take on it.

David Daney

> The problems only appear when I add some unrelated code to my platform
> file (p1022ds.c), but the trap is definitely in the phy code:
>
> Fixed MDIO Bus: probed
> INFO: trying to register non-static key.
> the code is fine but needs lockdep annotation.
> turning off the locking correctness validator.
> Call Trace:
> [e685dcc0] [c0008c7c] show_stack+0x44/0x154 (unreliable)
(Continue reading)

Richard Zhao | 11 Nov 2011 02:10
Favicon

[PATCH V2 10/14] ARM: mxs: add clk_prepare/clk_unprepare

Signed-off-by: Richard Zhao <richard.zhao <at> linaro.org>
---
 arch/arm/mach-mxs/system.c |    2 +-
 arch/arm/mach-mxs/timer.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
index 20ec3bd..9760a12 100644
--- a/arch/arm/mach-mxs/system.c
+++ b/arch/arm/mach-mxs/system.c
 <at>  <at>  -66,7 +66,7  <at>  <at>  static int __init mxs_arch_reset_init(void)

 	clk = clk_get_sys("rtc", NULL);
 	if (!IS_ERR(clk))
-		clk_enable(clk);
+		clk_prepare_enable(clk);

 	return 0;
 }
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index cace0d2..564a632 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
 <at>  <at>  -245,7 +245,7  <at>  <at>  static int __init mxs_clocksource_init(struct clk *timer_clk)

 void __init mxs_timer_init(struct clk *timer_clk, int irq)
 {
-	clk_enable(timer_clk);
+	clk_prepare_enable(timer_clk);

(Continue reading)

Richard Zhao | 11 Nov 2011 02:10
Favicon

[PATCH V2 12/14] net: fec: add clk_prepare/clk_unprepare

Signed-off-by: Richard Zhao <richard.zhao <at> linaro.org>
---
 drivers/net/ethernet/freescale/fec.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 1124ce0..e96fa44 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
 <at>  <at>  -1588,7 +1588,7  <at>  <at>  fec_probe(struct platform_device *pdev)
 		ret = PTR_ERR(fep->clk);
 		goto failed_clk;
 	}
-	clk_enable(fep->clk);
+	clk_prepare_enable(fep->clk);

 	ret = fec_enet_init(ndev);
 	if (ret)
 <at>  <at>  -1611,7 +1611,7  <at>  <at>  failed_register:
 	fec_enet_mii_remove(fep);
 failed_mii_init:
 failed_init:
-	clk_disable(fep->clk);
+	clk_disable_unprepare(fep->clk);
 	clk_put(fep->clk);
 failed_clk:
 	for (i = 0; i < FEC_IRQ_NUM; i++) {
 <at>  <at>  -1638,7 +1638,7  <at>  <at>  fec_drv_remove(struct platform_device *pdev)

 	fec_stop(ndev);
(Continue reading)

Richard Zhao | 11 Nov 2011 02:10
Favicon

[PATCH V2 07/14] ARM: mxc: audmux-v2: add clk_prepare/clk_unprepare

Signed-off-by: Richard Zhao <richard.zhao <at> linaro.org>
---
 arch/arm/plat-mxc/audmux-v2.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
index 8cced35..0e51fc3 100644
--- a/arch/arm/plat-mxc/audmux-v2.c
+++ b/arch/arm/plat-mxc/audmux-v2.c
 <at>  <at>  -73,13 +73,13  <at>  <at>  static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
 		return -ENOMEM;

 	if (audmux_clk)
-		clk_enable(audmux_clk);
+		clk_prepare_enable(audmux_clk);

 	ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port));
 	pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port));

 	if (audmux_clk)
-		clk_disable(audmux_clk);
+		clk_disable_unprepare(audmux_clk);

 	ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
 		       pdcr, ptcr);
 <at>  <at>  -172,13 +172,13  <at>  <at>  int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
 		return -ENOSYS;

 	if (audmux_clk)
-		clk_enable(audmux_clk);
(Continue reading)

Richard Zhao | 11 Nov 2011 02:10
Favicon

[PATCH V2 11/14] serial: imx: add clk_prepare/clk_unprepare

Signed-off-by: Richard Zhao <richard.zhao <at> linaro.org>
---
 drivers/tty/serial/imx.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..8f3709f 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
 <at>  <at>  -1390,7 +1390,7  <at>  <at>  static int serial_imx_probe(struct platform_device *pdev)
 		ret = PTR_ERR(sport->clk);
 		goto unmap;
 	}
-	clk_enable(sport->clk);
+	clk_prepare_enable(sport->clk);

 	sport->port.uartclk = clk_get_rate(sport->clk);

 <at>  <at>  -1413,8 +1413,8  <at>  <at>  deinit:
 	if (pdata && pdata->exit)
 		pdata->exit(pdev);
 clkput:
+	clk_disable_unprepare(sport->clk);
 	clk_put(sport->clk);
-	clk_disable(sport->clk);
 unmap:
 	iounmap(sport->port.membase);
 free:
 <at>  <at>  -1434,11 +1434,10  <at>  <at>  static int serial_imx_remove(struct platform_device *pdev)

(Continue reading)


Gmane