From: akpm@linux-foundation•org
To: paulus@samba•org
Cc: akpm@linux-foundation•org, linuxppc-dev@ozlabs•org
Subject: [patch 20/24] rapidio: add the RapidIO master port maintance and doorbell window to space resources
Date: Fri, 28 Mar 2008 14:21:19 -0700 [thread overview]
Message-ID: <200803282121.m2SLLK7x010729@imap1.linux-foundation.org> (raw)
From: Zhang Wei <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>
Signed-off-by: Andrew Morton <akpm@linux-foundation•org>
---
arch/powerpc/sysdev/fsl_rio.c | 26 +++++++++++++++++++++-----
include/linux/rio.h | 1 +
2 files changed, 22 insertions(+), 5 deletions(-)
diff -puN arch/powerpc/sysdev/fsl_rio.c~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources arch/powerpc/sysdev/fsl_rio.c
--- a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources
+++ a/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;
};
/**
@@ -1362,15 +1364,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 = 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 -puN include/linux/rio.h~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources include/linux/rio.h
--- a/include/linux/rio.h~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources
+++ a/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
_
reply other threads:[~2008-03-28 21:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200803282121.m2SLLK7x010729@imap1.linux-foundation.org \
--to=akpm@linux-foundation$(echo .)org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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