From: Mark Zhan <rongkai.zhan@windriver.com>
To: "paulus@samba.org" <paulus@samba.org>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: [PATCH 3/6] 82xx: Add the support of Wind River SBC PowerQUICCII 82xx
Date: Fri, 08 Jun 2007 16:54:38 +0800 [thread overview]
Message-ID: <1181292878.11341.15.camel@mark> (raw)
This patch fixes the following problems:
(1) The bus_id fs_enet device should be the same with its associated phy
device bus_id, which is the combination of mdio bus ID and phy_addr,
otherwise fs_enet driver will not be able to attach to its PHY device.
MDIO bus ID is equal to fs_enet platform device ID.
(2) The phy irq map should not be hardcoded. It should match the PHY
address provided by the platform DevTree Blob.
(3) Add the support of CPM2 SMC serial.
Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
---
b/arch/powerpc/sysdev/fsl_soc.c | 49
++++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c
b/arch/powerpc/sysdev/fsl_soc.c
index cad1757..fe40c86 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -689,7 +689,8 @@ static int __init fs_enet_of_init(void)
fs_enet_data.cp_block = CPM_CR_FCC_SBLOCK(fcc_index);
snprintf((char*)&bus_id[(*id)], BUS_ID_SIZE, "%x:%02x",
- (u32)res.start, fs_enet_data.phy_addr);
+ fs_enet_dev->id, fs_enet_data.phy_addr);
+
fs_enet_data.bus_id = (char*)&bus_id[(*id)];
fs_enet_data.init_ioports = init_fcc_ioports;
@@ -716,11 +717,9 @@ static int __init fs_enet_of_init(void)
fs_enet_mdio_bb_data.delay =
mdio_bb_prop[5];
- fs_enet_mdio_bb_data.irq[0] = phy_irq[0];
- fs_enet_mdio_bb_data.irq[1] = -1;
- fs_enet_mdio_bb_data.irq[2] = -1;
- fs_enet_mdio_bb_data.irq[3] = phy_irq[0];
- fs_enet_mdio_bb_data.irq[31] = -1;
+ memset(fs_enet_mdio_bb_data.irq, -1,
+ sizeof(fs_enet_mdio_bb_data.irq));
+ fs_enet_mdio_bb_data.irq[(*phy_addr)] = phy_irq[0];
fs_enet_mdio_bb_data.mdio_dat.offset =
(u32)&cpm2_immr->im_ioport.iop_pdatc;
@@ -757,8 +756,8 @@ err:
arch_initcall(fs_enet_of_init);
-static const char scc_regs[] = "regs";
-static const char scc_pram[] = "pram";
+static const char cpm_uart_regs[] = "regs";
+static const char cpm_uart_pram[] = "pram";
static int __init cpm_uart_of_init(void)
{
@@ -775,38 +774,42 @@ static int __init cpm_uart_of_init(void)
const int *id;
const char *model;
+ cpm_uart_dev = NULL;
memset(r, 0, sizeof(r));
memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
ret = of_address_to_resource(np, 0, &r[0]);
if (ret)
goto err;
-
- r[0].name = scc_regs;
+ r[0].name = cpm_uart_regs;
ret = of_address_to_resource(np, 1, &r[1]);
if (ret)
goto err;
- r[1].name = scc_pram;
+ r[1].name = cpm_uart_pram;
of_irq_to_resource(np, 0, &r[2]);
- cpm_uart_dev =
- platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3);
-
- if (IS_ERR(cpm_uart_dev)) {
- ret = PTR_ERR(cpm_uart_dev);
- goto err;
- }
-
id = of_get_property(np, "device-id", NULL);
cpm_uart_data.fs_no = *id;
model = of_get_property(np, "model", NULL);
strcpy(cpm_uart_data.fs_type, model);
- cpm_uart_data.uart_clk = ppc_proc_freq;
+ if (strstr(model, "SMC")) {
+ cpm_uart_dev = platform_device_register_simple("fsl-cpm-smc:uart",
+ i, &r[0], 3);
+ } else if (strstr(model, "SCC")) {
+ cpm_uart_dev = platform_device_register_simple("fsl-cpm-scc:uart",
+ i, &r[0], 3);
+ }
+
+ if (IS_ERR(cpm_uart_dev)) {
+ ret = PTR_ERR(cpm_uart_dev);
+ goto err;
+ }
+ cpm_uart_data.uart_clk = ppc_proc_freq;
cpm_uart_data.tx_num_fifo = 4;
cpm_uart_data.tx_buf_size = 32;
cpm_uart_data.rx_num_fifo = 4;
@@ -816,10 +819,8 @@ static int __init cpm_uart_of_init(void)
cpm_uart_data.clk_tx = *((u32 *)of_get_property(np,
"tx-clock", NULL));
- ret =
- platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
- sizeof(struct
- fs_uart_platform_info));
+ ret = platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
+ sizeof(struct fs_uart_platform_info));
if (ret)
goto unreg;
}
next reply other threads:[~2007-06-08 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-08 8:54 Mark Zhan [this message]
2007-06-09 15:25 ` [PATCH 3/6] 82xx: Add the support of Wind River SBC PowerQUICCII 82xx Vitaly Bordug
2007-06-11 7:59 ` Mark Zhan
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=1181292878.11341.15.camel@mark \
--to=rongkai.zhan@windriver.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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).