From: Sylvain Munaut <tnt@246tNt•com>
To: ML linuxppc-embedded <linuxppc-embedded@ozlabs•org>
Subject: [PATCH 6/6] ppc32: Adds necessary cpu init to use USB on LITE5200 Platform
Date: Tue, 22 Mar 2005 00:09:47 +0100 (CET) [thread overview]
Message-ID: <6.20050322_000905.tnt@patchsend.246tNt.com> (raw)
In-Reply-To: <0.20050322_000905.tnt@patchsend.246tNt.com>
ppc32: Adds necessary cpu init to use USB on LITE5200 Platform
To use external peripheral on MPC5200, some clocking registers
and port-muxing must be done. Since this is platform specific,
it's placed the platform support file. This particular patch
is for USB support on the LITE5200.
Signed-off-by: Sylvain Munaut <tnt@246tNt•com>
---
diff -Nru a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
--- a/arch/ppc/platforms/lite5200.c 2005-03-21 20:11:23 +01:00
+++ b/arch/ppc/platforms/lite5200.c 2005-03-21 20:11:23 +01:00
@@ -79,21 +79,47 @@
static void __init
lite5200_setup_cpu(void)
{
+ struct mpc52xx_cdm __iomem *cdm;
+ struct mpc52xx_gpio __iomem *gpio;
struct mpc52xx_intr __iomem *intr;
struct mpc52xx_xlb __iomem *xlb;
+ u32 port_config;
u32 intr_ctrl;
/* Map zones */
+ cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
+ gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
xlb = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE);
intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
- if (!xlb || !intr) {
- printk("lite5200.c: Error while mapping XLB/INTR during "
+ if (!cdm || !gpio || !xlb || !intr) {
+ printk("lite5200.c: Error while mapping CDM/GPIO/XLB/INTR during"
"lite5200_setup_cpu\n");
goto unmap_regs;
}
+ /* Use internal 48 Mhz */
+ out_8(&cdm->ext_48mhz_en, 0x00);
+ out_8(&cdm->fd_enable, 0x01);
+ if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */
+ out_be16(&cdm->fd_counters, 0x0001);
+ else
+ out_be16(&cdm->fd_counters, 0x5555);
+
+ /* Get port mux config */
+ port_config = in_be32(&gpio->port_config);
+
+ /* 48Mhz internal, pin is GPIO */
+ port_config &= ~0x00800000;
+
+ /* USB port */
+ port_config &= ~0x00007000; /* Differential mode - USB1 only */
+ port_config |= 0x00001000;
+
+ /* Commit port config */
+ out_be32(&gpio->port_config, port_config);
+
/* Configure the XLB Arbiter */
out_be32(&xlb->master_pri_enable, 0xff);
out_be32(&xlb->master_priority, 0x11111111);
@@ -111,6 +137,8 @@
/* Unmap reg zone */
unmap_regs:
+ if (cdm) iounmap(cdm);
+ if (gpio) iounmap(gpio);
if (xlb) iounmap(xlb);
if (intr) iounmap(intr);
}
@@ -171,7 +199,11 @@
isa_mem_base = 0;
/* Powersave */
- powersave_nap = 1; /* We allow this platform to NAP */
+ /* This is provided as an example on how to do it. But you
+ need to be aware that NAP disable bus snoop and that may
+ be required for some devices to work properly, like USB ... */
+ /* powersave_nap = 1; */
+
/* Setup the ppc_md struct */
ppc_md.setup_arch = lite5200_setup_arch;
next prev parent reply other threads:[~2005-03-21 23:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-21 23:06 [PATCH 0/6] [RFC] Change MPC52xx to platform bus / ppc_sys model Sylvain Munaut
2005-03-21 23:07 ` [PATCH 1/6] ppc32: Remove unnecessary test in MPC52xx reset code Sylvain Munaut
2005-03-21 23:07 ` [PATCH 2/6] ppc32: Remove the OCP system from the Freescale MPC52xx support Sylvain Munaut
2005-03-21 23:08 ` [PATCH 3/6] ppc32: Change constants style in Freescale MPC52xx related code Sylvain Munaut
2005-03-21 23:08 ` [PATCH 4/6] ppc32: Add platform bus / ppc_sys model to Freescale MPC52xx Sylvain Munaut
2005-03-25 15:15 ` Kumar Gala
2005-03-21 23:09 ` [PATCH 5/6] serial: Update mpc52xx_uart.c to use platform bus Sylvain Munaut
2005-03-21 23:09 ` Sylvain Munaut [this message]
2005-03-22 1:11 ` [PATCH 0/6] [RFC] Change MPC52xx to platform bus / ppc_sys model Kumar Gala
2005-03-22 7:12 ` Sylvain Munaut
2005-03-24 8:37 ` [RFC] MPC5200 PCI problem Andrey Volkov
2005-03-24 14:34 ` Sylvain Munaut
2005-03-24 18:58 ` Andrey Volkov
2005-03-25 12:32 ` [RFC] MPC5200 Kernel/UBoot " Andrey Volkov
2005-03-25 13:02 ` Dale Farnsworth
2005-03-25 14:00 ` Sylvain Munaut
2005-03-22 7:04 ` Future of OCP Lawrence E. Bakst
2005-03-22 7:48 ` Eugene Surovegin
-- strict thread matches above, loose matches on Subject: below --
2005-03-26 23:44 [PATCH 0/6] Change MPC52xx to platform bus / ppc_sys model Sylvain Munaut
2005-03-26 23:47 ` [PATCH 6/6] ppc32: Adds necessary cpu init to use USB on LITE5200 Platform Sylvain Munaut
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=6.20050322_000905.tnt@patchsend.246tNt.com \
--to=tnt@246tnt$(echo .)com \
--cc=linuxppc-embedded@ozlabs$(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