LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Zhang Wei <wei.zhang@freescale.com>
To: mporter@kernel.crashing.org, galak@kernel.crashing.org
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	Zhang Wei <wei.zhang@freescale.com>
Subject: [PATCH 14/17] Add the RapidIO master port maintance and doorbell window to space resources.
Date: Wed,  5 Mar 2008 00:29:59 +0800	[thread overview]
Message-ID: <1204648202-5495-14-git-send-email-wei.zhang@freescale.com> (raw)
In-Reply-To: <1204648202-5495-13-git-send-email-wei.zhang@freescale.com>

Add the RapidIO master port maintance and doorbell IO windows to
RIO space resources.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
---
 arch/powerpc/sysdev/fsl_rio.c |   26 +++++++++++++++++++++-----
 include/linux/rio.h           |    1 +
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index c260ae5..350db4e 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -192,6 +192,8 @@ struct rio_priv {
 	int bellirq;
 	int txirq;
 	int rxirq;
+	struct resource maint_res;
+	struct resource dbell_res;
 };
 
 /**
@@ -1363,15 +1365,29 @@ int fsl_rio_setup(struct of_device *dev)
 		out_be32((priv->regs_win + RIO_ISR_AACR), RIO_ISR_AACR_AA);
 
 	/* Configure maintenance transaction window */
-	out_be32(&priv->maint_atmu_regs->rowbar, 0x000c0000);
-	out_be32(&priv->maint_atmu_regs->rowar, 0x80077015);
+	rio_init_io_res(&priv->maint_res, law_start, RIO_MAINT_WIN_SIZE,
+			"maint_win", RIO_RESOURCE_MAINT);
+	rc = rio_request_io_region(port, &priv->maint_res);
+	if (rc) {
+		dev_err(&dev->dev, "request maint window error!\n");
+		goto err;
+	}
+	out_be32(&priv->maint_atmu_regs->rowbar, (law_start >> 12) & 0xffffff);
+	out_be32(&priv->maint_atmu_regs->rowar, 0x80077000
+					| (__ilog2(RIO_MAINT_WIN_SIZE) - 1));
 
 	priv->maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
 
 	/* Configure outbound doorbell window */
-	out_be32(&priv->dbell_atmu_regs->rowbar, 0x000c0400);
-	out_be32(&priv->dbell_atmu_regs->rowar, 0x8004200b);
-	fsl_rio_doorbell_init(port);
+	rio_init_io_res(&priv->dbell_res, law_start + RIO_MAINT_WIN_SIZE,
+			RIO_DBELL_WIN_SIZE, "dbell_win", RIO_RESOURCE_DOORBELL);
+	out_be32(&priv->dbell_atmu_regs->rowbar, (priv->dbell_res.start >> 12)
+							& 0xffffff);
+	out_be32(&priv->dbell_atmu_regs->rowar, 0x80042000
+					| (__ilog2(RIO_DBELL_WIN_SIZE) - 1));
+	rc = fsl_rio_doorbell_init(port);
+	if (rc)
+		goto err;
 
 	return 0;
 err:
diff --git a/include/linux/rio.h b/include/linux/rio.h
index d8ff4b8..c4acb52 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -257,6 +257,7 @@ struct rio_ops {
 #define RIO_RESOURCE_MEM	0x00000100
 #define RIO_RESOURCE_DOORBELL	0x00000200
 #define RIO_RESOURCE_MAILBOX	0x00000400
+#define RIO_RESOURCE_MAINT	0x00000800
 
 #define RIO_RESOURCE_CACHEABLE	0x00010000
 #define RIO_RESOURCE_PCI	0x00020000
-- 
1.5.4


  reply	other threads:[~2008-03-04  8:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 16:29 [PATCH 01/17] Change RIO function mpc85xx_ to fsl_ Zhang Wei
2008-03-04 16:29 ` [PATCH 02/17] Add RapidIO option to kernel configuration Zhang Wei
2008-03-04 16:29   ` [PATCH 03/17] Move include/asm-ppc/rio.h to include/asm-powerpc/rio.h Zhang Wei
2008-03-04 16:29     ` [PATCH 04/17] Add RapidIO multi mport support Zhang Wei
2008-03-04 16:29       ` [PATCH 05/17] Add OF-tree support to RapidIO controller driver Zhang Wei
2008-03-04 10:12         ` Stephen Rothwell
2008-03-04 16:29         ` [PATCH 06/17] Change the kernel configurated RapidIO system size to auto-probing Zhang Wei
2008-03-04 10:20           ` Stephen Rothwell
2008-03-04 16:29           ` [PATCH 07/17] Add RapidIO node into MPC8641HPCN dts file Zhang Wei
2008-03-04 16:29             ` [PATCH 08/17] Add RapidIO node probing into MPC86xx_HPCN board id table Zhang Wei
2008-03-04 16:29               ` [PATCH 09/17] Add serial RapidIO controller support, which includes MPC8548, MPC8641 Zhang Wei
2008-03-04 16:29                 ` [PATCH 10/17] Add RapidIO connection info print out and re-training for break connection Zhang Wei
2008-03-04 16:29                   ` [PATCH 11/17] Add memory mapping driver to RapidIO Zhang Wei
2008-03-04 10:37                     ` Stephen Rothwell
2008-03-05  1:59                       ` Zhang Wei
2008-03-05  2:51                         ` Stephen Rothwell
2008-03-11  8:53                           ` Zhang Wei
2008-03-04 16:29                     ` [PATCH 12/17] Add RapidIO space allocation bitmap arithmetic Zhang Wei
2008-03-04 16:29                       ` [PATCH 13/17] Add FSL RapidIO controller memory ops functions Zhang Wei
2008-03-04 16:29                         ` Zhang Wei [this message]
2008-03-04 16:30                           ` [PATCH 15/17] Add RapidIO proc fs for memory mapping debugging Zhang Wei
2008-03-04 16:30                             ` [PATCH 16/17] Change RapidIO doorbell source and target ID field to 16-bit Zhang Wei
2008-03-04 16:30                               ` [PATCH 17/17] Add the memory mapping support in rionet driver Zhang Wei
2008-03-11  9:07 [PATCH 01/17] Change RIO function mpc85xx_ to fsl_ Zhang Wei
2008-03-11  9:07 ` [PATCH 02/17] Add RapidIO option to kernel configuration Zhang Wei
2008-03-11  9:07   ` [PATCH 03/17] Move include/asm-ppc/rio.h to include/asm-powerpc/rio.h Zhang Wei
2008-03-11  9:07     ` [PATCH 04/17] Add RapidIO multi mport support Zhang Wei
2008-03-11  9:07       ` [PATCH 05/17] Add OF-tree support to RapidIO controller driver Zhang Wei
2008-03-11  9:07         ` [PATCH 06/17] Change the kernel configurated RapidIO system size to auto-probing Zhang Wei
2008-03-11  9:07           ` [PATCH 07/17] Add RapidIO node into MPC8641HPCN dts file Zhang Wei
2008-03-11  9:07             ` [PATCH 08/17] Add RapidIO node probing into MPC86xx_HPCN board id table Zhang Wei
2008-03-11  9:07               ` [PATCH 09/17] Add serial RapidIO controller support, which includes MPC8548, MPC8641 Zhang Wei
2008-03-11  9:07                 ` [PATCH 10/17] Add RapidIO connection info print out and re-training for break connection Zhang Wei
2008-03-11  9:07                   ` [PATCH 11/17] Add memory mapping driver to RapidIO Zhang Wei
2008-03-11  9:07                     ` [PATCH 12/17] Add RapidIO space allocation bitmap arithmetic Zhang Wei
2008-03-11  9:07                       ` [PATCH 13/17] Add FSL RapidIO controller memory ops functions Zhang Wei
2008-03-11  9:07                         ` [PATCH 14/17] Add the RapidIO master port maintance and doorbell window to space resources Zhang Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204648202-5495-14-git-send-email-wei.zhang@freescale.com \
    --to=wei.zhang@freescale.com \
    --cc=galak@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mporter@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).