* SH7760
@ 2016-05-20 14:49 Martin Townsend
2016-05-22 6:32 ` SH7760 Yoshinori Sato
0 siblings, 1 reply; 2+ messages in thread
From: Martin Townsend @ 2016-05-20 14:49 UTC (permalink / raw)
To: linux-sh
Hi,
Is the USB interface on the SH7760 compatible with the OHCI driver in
the 4.1 linux kernel.
I've setup the platform as follows:
#define USB_IRQ evt2irq(0xa00)
#define SH7760_USB_BASE 0xFE340000
#define SH7760_USB_IOLEN 0x58
static struct usb_ohci_pdata usb_ohci_pdata;
static struct resource sh7760_usb_resources[] = {
DEFINE_RES_MEM_NAMED(SH7760_USB_BASE, SH7760_USB_IOLEN,
"sh7760-usb-memory"),
DEFINE_RES_IRQ_NAMED(USB_IRQ, "sh7760-usb-irq"),
};
static struct platform_device sh7760_usb_host_device = {
.name = "ohci-platform",
.id = -1,
.dev = {
.dma_mask = NULL, /* not use dma */
.coherent_dma_mask = 0xffffffff,
.platform_data = &usb_ohci_pdata,
},
.num_resources = ARRAY_SIZE(sh7760_usb_resources),
.resource = sh7760_usb_resources,
};
enabled the OHCI driver
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_SH=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
Setup PCF
/* Setup Port H Pull-Up Control Register:- Pull Ups on PH7 to PH3 */
__raw_writeb(0xF8, PHPUPR);
/* Setup Port H Control Register so that USB Peripheral Module is set */
__raw_writew(0x4000, PHCR);
__raw_writeb(0x00, PHDR);
but I get the following error:
[ 3.600000] usb 1-1: new full-speed USB device number 2 using ohci-platform
[ 3.872000] ohci-platform ohci-platform: frame counter not updating; disabled
[ 3.872000] ohci-platform ohci-platform: HC died; cleaning up
Any ideas as to what I'm missing? I know the hardware is fine as I
have a 2.6 kernel running that uses a SH7760 specific OHCI driver.
Many Thanks,
Martin.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: SH7760
2016-05-20 14:49 SH7760 Martin Townsend
@ 2016-05-22 6:32 ` Yoshinori Sato
0 siblings, 0 replies; 2+ messages in thread
From: Yoshinori Sato @ 2016-05-22 6:32 UTC (permalink / raw)
To: linux-sh
On Fri, 20 May 2016 23:49:04 +0900,
Martin Townsend wrote:
>
> Hi,
>
> Is the USB interface on the SH7760 compatible with the OHCI driver in
> the 4.1 linux kernel.
>
> I've setup the platform as follows:
>
> #define USB_IRQ evt2irq(0xa00)
> #define SH7760_USB_BASE 0xFE340000
> #define SH7760_USB_IOLEN 0x58
>
> static struct usb_ohci_pdata usb_ohci_pdata;
>
> static struct resource sh7760_usb_resources[] = {
> DEFINE_RES_MEM_NAMED(SH7760_USB_BASE, SH7760_USB_IOLEN,
> "sh7760-usb-memory"),
> DEFINE_RES_IRQ_NAMED(USB_IRQ, "sh7760-usb-irq"),
> };
>
> static struct platform_device sh7760_usb_host_device = {
> .name = "ohci-platform",
> .id = -1,
> .dev = {
> .dma_mask = NULL, /* not use dma */
> .coherent_dma_mask = 0xffffffff,
> .platform_data = &usb_ohci_pdata,
> },
> .num_resources = ARRAY_SIZE(sh7760_usb_resources),
> .resource = sh7760_usb_resources,
> };
>
> enabled the OHCI driver
> CONFIG_USB_OHCI_LITTLE_ENDIAN=y
> CONFIG_USB_SUPPORT=y
> CONFIG_USB_COMMON=y
> CONFIG_USB_ARCH_HAS_HCD=y
> CONFIG_USB=y
> CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> CONFIG_USB_OHCI_HCD=y
> CONFIG_USB_OHCI_SH=y
> CONFIG_USB_OHCI_HCD_PLATFORM=y
>
> Setup PCF
> /* Setup Port H Pull-Up Control Register:- Pull Ups on PH7 to PH3 */
> __raw_writeb(0xF8, PHPUPR);
>
> /* Setup Port H Control Register so that USB Peripheral Module is set */
> __raw_writew(0x4000, PHCR);
> __raw_writeb(0x00, PHDR);
>
>
> but I get the following error:
>
> [ 3.600000] usb 1-1: new full-speed USB device number 2 using ohci-platform
> [ 3.872000] ohci-platform ohci-platform: frame counter not updating; disabled
> [ 3.872000] ohci-platform ohci-platform: HC died; cleaning up
>
>
> Any ideas as to what I'm missing? I know the hardware is fine as I
> have a 2.6 kernel running that uses a SH7760 specific OHCI driver.
Are you enable clock of USB controller?.
Plase see CLKSTP00 setting.
> Many Thanks,
> Martin.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-22 6:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-20 14:49 SH7760 Martin Townsend
2016-05-22 6:32 ` SH7760 Yoshinori Sato
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).