* Re: MPC8555 8280/8270 USB host support
2005-11-15 6:59 ` Mike Rapoport
@ 2005-12-01 12:26 ` Hans Schillstrom
2005-12-01 13:55 ` Mike Rapoport
2005-12-01 15:29 ` Wolfgang Denk
0 siblings, 2 replies; 5+ messages in thread
From: Hans Schillstrom @ 2005-12-01 12:26 UTC (permalink / raw)
To: Mike Rapoport; +Cc: 'linuxppc-embedded@ozlabs.org'
[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]
Hi Mike
I've made some modifications due to the difference between mpc8272 and
mpc8270. MPC8272 use SCC3 and MPC8270 use SCC4.
Added some more clock configuration options ...
I think the changes are quite generic.
The driver seems to work with a 2.6.13 kernel.
Only some basic tests is performed with
- serial ftdi_sio to ports ttyUSB0 & ttyUSB1
- storage i.e. some kind of "no name" usb-memory
- 3 1/4 floppy drive
- Nokia hub.
Don't you think u-boot should take care of clock setup
i.e. as much as possible of all board dependent stuff ?
Regards
Hans Schillstrom
On Tue, 2005-11-15 at 07:59, Mike Rapoport wrote:
> Hans Schillstrom wrote:
>
> >Hi Mike
> >I'm working with a 8270 board and 2.6.12 kernel and searching for USB
> >drivers.
> >
> >Could you help me finding the files ?
> >
> >
> I've opened a project on the SourceForge,
> http://cpm2usb.sourceforge.net. The file containing patch against
> 2.6.12.3 can be downloaded at http://sourceforge.net/projects/cpm2usb.
>
> >I can help you with the testing.
> >What status do they have right now ?
> >
> >
> The driver was developed on MPC8272ADS, but should go as well on 8270
> since they have the same USB host controller AFAIK.
> Currently, as far as I tested it works fine with full-speed single
> device attached through hub, but fails is there are transfers from/to
> several devices simultaneously.
> As for the code itself, it's far from being perfect.
>
> >Regards
> >Hans
> >
> >
>
[-- Attachment #2: m8270usb.patch --]
[-- Type: text/x-patch, Size: 6861 bytes --]
diff -Nruw linux-2.6.13.2/drivers/usb/host/m82xx-hcd.c linux-2.6-dev/drivers/usb/host/m82xx-hcd.c
--- linux-2.6.13.2/drivers/usb/host/m82xx-hcd.c 2005-12-01 10:58:55.000000000 +0100
+++ linux-2.6-dev/drivers/usb/host/m82xx-hcd.c 2005-12-01 12:59:27.000000000 +0100
@@ -12,6 +12,9 @@
* George Panageas <gpana@intracom.gr>
* Pantelis Antoniou <panto@intracom.gr>
*
+ * Fixes for MPC8270/80 & adaptions to powervave technologies rcb8270 board.
+ * Hans Schillstrom <hans.schillstrom@pwav.com>
+ *
* designed for the EmbeddedPlanet RPX lite board
* (C) Copyright 2000 Embedded Planet
* http://www.embeddedplanet.com
@@ -110,6 +113,15 @@
*bcsr_usb |= BCSR_USB_POWER;
}
+#elif defined(CONFIG_RCB8270)
+ hp->usb_clock = USB_CLOCK_PC25_CLK7;
+ {
+ volatile cpm2_map_t *immap = (volatile cpm2_map_t *)CPM_MAP_ADDR;
+ volatile iop_cpm2_t *io = &immap->im_ioport;
+
+ io->iop_pdata &= ~(1 << (31 - 2)); // Turn on power tu usb driver
+ udelay(1000);
+ }
#endif
return 0;
}
@@ -167,26 +179,39 @@
volatile cpmux_t *cm = &immap->im_cpmux;
switch (usb_clock) {
+ case USB_CLOCK_PC27_CLK5:
+ io->iop_pdirc &= ~PC_CLK5_48MHz;
+ io->iop_psorc &= ~PC_CLK5_48MHz;
+ io->iop_pparc |= PC_CLK5_48MHz;
+ cm->cmx_scr &= ~USB_CMX_SCR_MASK;
+ cm->cmx_scr |= USB_CMX_CLK5;
+ break;
case USB_CLOCK_PC26_CLK6:
io->iop_pdirc &= ~PC_CLK6_48MHz;
io->iop_psorc &= ~PC_CLK6_48MHz;
io->iop_pparc |= PC_CLK6_48MHz;
- cm->cmx_scr &= ~0x0000ff00;
- cm->cmx_scr |= 0x00003f00;
+ cm->cmx_scr &= ~USB_CMX_SCR_MASK;
+ cm->cmx_scr |= USB_CMX_CLK6;
+ break;
+ case USB_CLOCK_PC25_CLK7:
+ io->iop_pdirc &= ~PC_CLK7_48MHz; // Input mode
+ io->iop_psorc &= ~PC_CLK7_48MHz; // special option
+ io->iop_pparc |= PC_CLK7_48MHz; // Dedicated port
+ cm->cmx_scr &= ~USB_CMX_SCR_MASK;
+ cm->cmx_scr |= USB_CMX_CLK7;
break;
case USB_CLOCK_PC24_CLK8:
io->iop_pdirc &= ~PC_CLK8_48MHz;
io->iop_psorc &= ~PC_CLK8_48MHz;
io->iop_pparc |= PC_CLK8_48MHz;
- cm->cmx_scr &= ~0x0000ff00;
- cm->cmx_scr |= 0x00003f00;
+ cm->cmx_scr &= ~USB_CMX_SCR_MASK;
+ cm->cmx_scr |= USB_CMX_CLK8;
break;
default:
printk(KERN_ERR "m8xxhci: invalid usb_clock value %d!\n", usb_clock);
return -1;
}
-
return 0;
}
@@ -317,13 +342,21 @@
#define USB_MODE_PIN ((uint)(1 << (31 - 0)))
#define USB_SPEED_PIN ((uint)(1 << (31 - 23)))
#define USB_SUSPEND_PIN ((uint)(1 << (31 - 29)))
-
-
io->iop_pdirc |= (USB_MODE_PIN | USB_SPEED_PIN | USB_SUSPEND_PIN);
io->iop_pparc &= ~(USB_MODE_PIN | USB_SPEED_PIN | USB_SUSPEND_PIN);
io->iop_pdatc |= (USB_MODE_PIN | USB_SPEED_PIN);
io->iop_podrc |= USB_MODE_PIN;
io->iop_pdatc &= ~(USB_SUSPEND_PIN);
+
+#elif defined(CONFIG_RCB8270)
+
+#define USB_MODE_PIN ((uint)(1 << (31 - 0)))
+#define USB_SPEED_PIN ((uint)(1 << (31 - 5)))
+
+ io->iop_pdirc |= (USB_MODE_PIN | USB_SPEED_PIN );
+ io->iop_pparc &= ~(USB_MODE_PIN | USB_SPEED_PIN );
+ io->iop_pdatc |= (USB_MODE_PIN | USB_SPEED_PIN);
+ io->iop_podrc |= USB_MODE_PIN;
#endif
msleep(10);
diff -Nruw linux-2.6.13.2/drivers/usb/host/m82xx-hcd.h linux-2.6-dev/drivers/usb/host/m82xx-hcd.h
--- linux-2.6.13.2/drivers/usb/host/m82xx-hcd.h 2005-12-01 10:58:55.000000000 +0100
+++ linux-2.6-dev/drivers/usb/host/m82xx-hcd.h 2005-11-22 11:07:44.000000000 +0100
@@ -16,6 +16,9 @@
* (C) Copyright 2000 Embedded Planet
* http://www.embeddedplanet.com
*
+ * Fixes for MPC8270/80
+ * Hans Schillstrom <hans.schillstrom@pwav.com>
+ *
*/
#ifndef M82XXHCI_H
@@ -42,9 +45,21 @@
#endif
#ifdef CONFIG_CPM2
+
+#ifdef CONFIG_RCB8270
+# ifndef CONFIG_MPC8270
+# define CONFIG_MPC8270 1
+# endif
+#endif
+
+#if defined(CONFIG_MPC8270) || defined(CONFIG_MPC8280)
+#define USB_SCC_IDX 3 /* SCC4 */
+#define CPMVEC_USB (CPM_IRQ_OFFSET + CPMVEC_SCC4)
+#else
#define USB_SCC_IDX 2 /* SCC3 */
#define CPMVEC_USB (CPM_IRQ_OFFSET + CPMVEC_SCC3)
#endif
+#endif
#define BD_USB_TC ((ushort)0x0400) /* transmit crc after last */
#define BD_USB_CNF ((ushort)0x0200) /* wait for handshake */
@@ -238,6 +253,41 @@
#endif
#ifdef CONFIG_CPM2
+/* Clock source setting */
+#define USB_CMX_SCR_MASK ((uint)(0xff000000 >> (USB_SCC_IDX<<3)))
+#define USB_CMX_CLK5 ((uint)((CMXSCR_RS1CS_CLK11 | CMXSCR_TS1CS_CLK11) >> (USB_SCC_IDX<<3)))
+#define USB_CMX_CLK6 ((uint)((CMXSCR_RS1CS_CLK12 | CMXSCR_TS1CS_CLK12) >> (USB_SCC_IDX<<3)))
+#define USB_CMX_CLK7 ((uint)((CMXSCR_RS1CS_CLK3 | CMXSCR_TS1CS_CLK3) >> (USB_SCC_IDX<<3)))
+#define USB_CMX_CLK8 ((uint)((CMXSCR_RS1CS_CLK4 | CMXSCR_TS1CS_CLK4) >> (USB_SCC_IDX<<3)))
+
+#define PC_CLK5_48MHz ((uint)(1 << (31 - 27)))
+#define PC_CLK6_48MHz ((uint)(1 << (31 - 26)))
+#define PC_CLK7_48MHz ((uint)(1 << (31 - 25)))
+#define PC_CLK8_48MHz ((uint)(1 << (31 - 24)))
+
+#if defined(CONFIG_MPC8270) || defined(CONFIG_MPC8280)
+
+/* bits in parallel i/o port registers that have to be cleared to */
+/* configure the pins for SCC4 USB use. */
+ /* sor dir */
+ /* --- --- */
+#define PD_USB_RXD ((uint)(1 << (31 - 22))) /* 0 0 */
+#define PD_USB_TN ((uint)(1 << (31 - 21))) /* 0 1 */
+#define PD_USB_TP ((uint)(1 << (31 - 20))) /* 0 1 */
+
+#define PD_MSK (PD_USB_RXD | PD_USB_TN | PD_USB_TP)
+#define PD_DIR0 PD_USB_RXD
+#define PD_DIR1 (PD_USB_TN | PD_USB_TP)
+
+#define PC_USB_OE ((uint)(1 << (31 - 20))) /* 0 1 */
+#define PC_USB_RP ((uint)(1 << (31 - 9))) /* 0 0 */
+#define PC_USB_RN ((uint)(1 << (31 - 8))) /* 0 0 */
+
+#define PC_MSK (PC_USB_OE | PC_USB_RP | PC_USB_RN)
+#define PC_DIR0 (PC_USB_RP | PC_USB_RN)
+#define PC_DIR1 PC_USB_OE
+
+#else
/* bits in parallel i/o port registers that have to be cleared to */
/* configure the pins for SCC1 USB use. */
@@ -259,8 +309,7 @@
#define PC_DIR0 (PC_USB_RP | PC_USB_RN)
#define PC_DIR1 PC_USB_OE
-#define PC_CLK6_48MHz ((uint)(1 << (31 - 26))) /* 0 0 */
-#define PC_CLK8_48MHz ((uint)(1 << (31 - 24))) /* 0 0 */
+#endif
#endif
@@ -409,7 +458,9 @@
USB_CLOCK_PA6_CLK2,
USB_CLOCK_BRG3,
USB_CLOCK_BRG4,
+ USB_CLOCK_PC27_CLK5,
USB_CLOCK_PC26_CLK6,
+ USB_CLOCK_PC25_CLK7,
USB_CLOCK_PC24_CLK8,
USB_CLOCK_CNT,
};
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPC8555 8280/8270 USB host support
2005-12-01 12:26 ` MPC8555 8280/8270 " Hans Schillstrom
@ 2005-12-01 13:55 ` Mike Rapoport
2005-12-01 15:29 ` Wolfgang Denk
1 sibling, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2005-12-01 13:55 UTC (permalink / raw)
To: Hans Schillstrom; +Cc: 'linuxppc-embedded@ozlabs.org'
Hans Schillstrom wrote:
>Hi Mike
>I've made some modifications due to the difference between mpc8272 and
>mpc8270. MPC8272 use SCC3 and MPC8270 use SCC4.
>Added some more clock configuration options ...
>
>
Thanks a lot.
I've added your patch as is to the SF page.
>
>Don't you think u-boot should take care of clock setup
>i.e. as much as possible of all board dependent stuff ?
>
>
I think you're right, but then it was easier to make all these setups in
the driver itself.
>
>Regards
>Hans Schillstrom
>
>
>
--
Sincerely yours,
Mike Rapoport
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPC8555 8280/8270 USB host support
2005-12-01 12:26 ` MPC8555 8280/8270 " Hans Schillstrom
2005-12-01 13:55 ` Mike Rapoport
@ 2005-12-01 15:29 ` Wolfgang Denk
1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-12-01 15:29 UTC (permalink / raw)
To: Hans Schillstrom; +Cc: 'linuxppc-embedded@ozlabs.org'
In message <1133439981.8518.237.camel@hawk.pwav.net> you wrote:
>
> Don't you think u-boot should take care of clock setup
> i.e. as much as possible of all board dependent stuff ?
No, it should not. A river should not make any assumptions about the
state of the hardware, but initialize everything it needs for correct
operation itself.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Save yourself! Reboot in 5 seconds!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPC8555 8280/8270 USB host support
@ 2005-12-01 15:41 Nathael PAJANI
2005-12-01 17:37 ` Wolfgang Denk
0 siblings, 1 reply; 5+ messages in thread
From: Nathael PAJANI @ 2005-12-01 15:41 UTC (permalink / raw)
To: linuxppc-embedded
Hi
>
>>
>>Don't you think u-boot should take care of clock setup
>>i.e. as much as possible of all board dependent stuff ?
>>
>>
>I think you're right, but then it was easier to make all these setups
>in the driver itself.
>
If u-boot is the boot loader of your board (the stuff running on it
--before-- we see this:
loaded at: 00400000 005153B4
board data at: 00513130 00513334
relocated to: 00405090 00405294
zimage at: 00405A85 00512099
avail ram: 00516000 08000000
Linux/PPC load: rw console=ttyS0 root=/dev/nfs ip=on
Uncompressing Linux...done)
Then I would say NO
If u-boot is this exact stuff (the files in arch/ppc/boot/simple/...
misc-embedded.c for example)
then, yes, this is somehow better.
But (tell me if I'm wrong) this is not really Linux code, and this
should be done by Linux.
What I think should be good also is the platform files
(arch/ppc/platforms/....) for this is the place where all the board
dependant stuff stays.
Maybe I'm completely mistaken.
Feel free to tell me (and explain please !)
Have fun.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPC8555 8280/8270 USB host support
2005-12-01 15:41 MPC8555 8280/8270 USB host support Nathael PAJANI
@ 2005-12-01 17:37 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-12-01 17:37 UTC (permalink / raw)
To: Nathael PAJANI; +Cc: linuxppc-embedded
In message <438F198F.9020606@cpe.fr> you wrote:
>
> If u-boot is the boot loader of your board (the stuff running on it
> --before-- we see this:
>
> loaded at: 00400000 005153B4
> board data at: 00513130 00513334
> relocated to: 00405090 00405294
> zimage at: 00405A85 00512099
> avail ram: 00516000 08000000
If U-Boot is your boot load, *and* you see this, than you made some
serious mistake. U-Boot is supposed to boot the "uImage" images,
which do not issue such messages.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The shortest unit of time in the multiverse is the News York Second,
defined as the period of time between the traffic lights turning
green and the cab behind you honking.
- Terry Pratchett, _Lords and Ladies_
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-12-01 17:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-01 15:41 MPC8555 8280/8270 USB host support Nathael PAJANI
2005-12-01 17:37 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2005-10-07 5:05 Problem Regarding Ping in Linux kernel version 2.4.24 apoorv sangal
2005-10-12 6:59 ` MPC8555 USB host support Stefan Roese
2005-10-12 7:11 ` Mike Rapoport
2005-10-12 7:27 ` Stefan Roese
2005-10-12 12:34 ` Alex Zeffertt
2005-10-31 6:45 ` Mike Rapoport
[not found] ` <1131960060.7748.9.camel@hawk.pwav.net>
2005-11-15 6:59 ` Mike Rapoport
2005-12-01 12:26 ` MPC8555 8280/8270 " Hans Schillstrom
2005-12-01 13:55 ` Mike Rapoport
2005-12-01 15:29 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.