Skip to contentSkip to conversation

omap: musb: Add device tree support

PATCH In review Kishon Vijay Abraham I 5 participants 13 messages Sep 6, 2012 – Sep 11, 2012

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

cover omap: musb: Add device tree support

This patch series adds device tree support for MUSB.

The glue layer is now made to write to mailbox register (present in control module) instead of calling phy layer to write to mailbox register. Writing to mailbox register notifies the core of events like device connect/disconnect.

Previously these patches were part of [PATCH v7 0/7] omap: musb: Add device tree support

This patch series was created to contain only the *musb* part and it also has one hwmod patch.

This patch series was created on
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git musb

Kishon Vijay Abraham I (3):
arm: omap: hwmod: add a new addr space in otg for writing to control
module
usb: musb: omap: write directly to mailbox instead of using phy
usb: musb: omap: Add device tree support for omap musb glue

 Documentation/devicetree/bindings/usb/omap-usb.txt |   33 ++++++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c         |    5 +
 drivers/usb/musb/omap2430.c                        |  106 ++++++++++++++++++--
 drivers/usb/musb/omap2430.h                        |    9 ++
 4 files changed, 146 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txt
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 arm: omap: hwmod: add a new addr space in otg for writing to control module

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
index 242aee4..02341bc 100644
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},
 	{ }
 };
 
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

Thanks,
Vaibhav

Quoted 4 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
 	{ }
 };
 
#3 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Hi,

Quoted 38 lines · Vaibhav Hiremath
Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120906/65c44fa3/attachment.sig>
#4 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Hi,

Quoted 41 lines · Felipe Balbi

Hi,

Quoted 38 lines · Vaibhav Hiremath
Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 8 lines
Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Tony, can I get your Acked-by to this patch so I can take it together with the rest of the series ? Thanks

ps: I'll apply this to my 'musb' branch which is immutable, so it's safe to merge it into your tree once I apply.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120906/2db3b3d5/attachment.sig>
maintainer
#5 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Quoted 53 lines · Felipe Balbi

Hi,

Quoted 41 lines · Felipe Balbi

Hi,

Quoted 38 lines · Vaibhav Hiremath
Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 8 lines
Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Quoted 5 lines

Tony, can I get your Acked-by to this patch so I can take it together with the rest of the series ? Thanks

ps: I'll apply this to my 'musb' branch which is immutable, so it's safe to merge it into your tree once I apply.

It would be best if this got acked by Benoit and Paul as they may have some other patches queued up. I'll ack if they ack ;)

Tony

#6 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Hi,

Quoted 54 lines · Tony Lindgren
Quoted 53 lines · Felipe Balbi

Hi,

Quoted 49 lines · Felipe Balbi

Hi,

Quoted 38 lines · Vaibhav Hiremath
Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Quoted 8 lines
Quoted 5 lines

Tony, can I get your Acked-by to this patch so I can take it together with the rest of the series ? Thanks

ps: I'll apply this to my 'musb' branch which is immutable, so it's safe to merge it into your tree once I apply.

It would be best if this got acked by Benoit and Paul as they may have some other patches queued up. I'll ack if they ack ;)

Benoit, care to ack this patch ???

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120910/f04477e0/attachment.sig>
#7 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Hi Felipe,

Quoted 60 lines · Felipe Balbi

Hi,

Quoted 57 lines · Tony Lindgren
Quoted 56 lines · Felipe Balbi

Hi,

Quoted 41 lines · Felipe Balbi

Hi,

Quoted 38 lines · Vaibhav Hiremath
Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 8 lines
Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Tony, can I get your Acked-by to this patch so I can take it together with the rest of the series ? Thanks

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

ps: I'll apply this to my 'musb' branch which is immutable, so it's safe to merge it into your tree once I apply.

It would be best if this got acked by Benoit and Paul as they may have some other patches queued up. I'll ack if they ack ;)

Benoit, care to ack this patch ???

Gosh, that's hard to ack something like that :-)

But considering that the control module driver is not there yet, I have no choice but accepting that one if we want to have the functionality we've been waiting for years.

Could you just update the patch with a big disclaimer on top of the address range to explain that this should not belong here and will be removed ASAP, when the proper driver will be done.

Then you sign the patch with your blood and that should be fine for me :-).

Thanks,
Benoit

#8 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Hi,

Quoted 51 lines · Benoit Cousson
Quoted 51 lines
Quoted 51 lines
Quoted 50 lines
Quoted 36 lines
Quoted 36 lines · Kishon Vijay Abraham I
Quoted 20 lines

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 8 lines
Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Tony, can I get your Acked-by to this patch so I can take it together with the rest of the series ? Thanks

ps: I'll apply this to my 'musb' branch which is immutable, so it's safe to merge it into your tree once I apply.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

It would be best if this got acked by Benoit and Paul as they may have some other patches queued up. I'll ack if they ack ;)

Benoit, care to ack this patch ???

Gosh, that's hard to ack something like that :-)

btw, that's not different than what's already in tree, the only difference is that now hwmod knows about it...

Quoted 7 lines

But considering that the control module driver is not there yet, I have no choice but accepting that one if we want to have the functionality we've been waiting for years.

Could you just update the patch with a big disclaimer on top of the address range to explain that this should not belong here and will be removed ASAP, when the proper driver will be done.

sure, that's doable... Kishon, can you do this ASAP ? I want to send my pull requests tomorrow at the latest.

Quoted 2 lines

Then you sign the patch with your blood and that should be fine for me :-).

I'm running out of blood already, but maybe there's enough for this last one... 8-#

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120910/18b7f9cf/attachment.sig>
#9 lore raw

Re: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

Hi,

Quoted 68 lines · Felipe Balbi

Hi,

Quoted 51 lines · Benoit Cousson
Quoted 51 lines
Quoted 51 lines
Quoted 50 lines
Quoted 36 lines
Quoted 36 lines · Kishon Vijay Abraham I
Quoted 20 lines

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
               .pa_end         = 0x4a0ab003,
               .flags          = ADDR_TYPE_RT
       },
+      {
+              .pa_start       = 0x4a00233c,
+              .pa_end         = 0x4a00233f,
+              .flags          = ADDR_TYPE_RT
+      },

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 8 lines
Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Tony, can I get your Acked-by to this patch so I can take it together with the rest of the series ? Thanks

ps: I'll apply this to my 'musb' branch which is immutable, so it's safe to merge it into your tree once I apply.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

It would be best if this got acked by Benoit and Paul as they may have some other patches queued up. I'll ack if they ack ;)

Benoit, care to ack this patch ???

Gosh, that's hard to ack something like that :-)

btw, that's not different than what's already in tree, the only difference is that now hwmod knows about it...

Quoted 4 lines

But considering that the control module driver is not there yet, I have no choice but accepting that one if we want to have the functionality we've been waiting for years.

Quoted 6 lines
Quoted 3 lines

Could you just update the patch with a big disclaimer on top of the address range to explain that this should not belong here and will be removed ASAP, when the proper driver will be done.

sure, that's doable... Kishon, can you do this ASAP ? I want to send my pull requests tomorrow at the latest.

Sure. Will send now.

Thanks
Kishon

#10 lore raw

RE: [PATCH 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module

In reply to Felipe Balbi
Quoted 41 lines · Felipe

Hi,

Quoted 38 lines · Vaibhav Hiremath
Quoted 20 lines · Kishon Vijay Abraham I

The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.

Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -0
index 242aee4..02341bc 100644

arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { · line 5897

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +5 -0
@@ -5890,6 +5890,11 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
 		.pa_end		= 0x4a0ab003,
 		.flags		= ADDR_TYPE_RT
 	},
+	{
+		.pa_start	= 0x4a00233c,
+		.pa_end		= 0x4a00233f,
+		.flags		= ADDR_TYPE_RT
+	},

I do not have any objection/comment here, but I believe this is control module address space required for USB module, right?
I am not sure this is right way of accessing control module space. Actually Control Module Access required for drivers is one of the blocking issue we have currently.

Quoted 9 lines
Quoted 3 lines

Also there was some effort put up by 'Konstantine' to convert Control module to MFD driver, I haven't seen any further update on it. But it would be good to check with him.

this was an agreement with Benoit since we already lost a couple merge windows for this patchset. We agreed to wait until -rc4 for SCM driver and if it wasn't ready, we'd go ahead with this and SCM author would fix it up on a patch converting users to new SCM driver.

Understood and thanks for confirming.

Thanks,
Vaibhav

Quoted 3 lines
Signature · 1 line
balbi
#11 lore raw

PATCH 2/3 usb: musb: omap: write directly to mailbox instead of using phy

In reply to Kishon Vijay Abraham I

The glue layer should directly write to mailbox register (present in control module) instead of calling phy layer to write to mailbox register. Writing to mailbox register notifies the core of events like device connect/disconnect.

Currently writing to control module register is taken care in this driver which will be removed once the control module driver is in place.

---
 drivers/usb/musb/omap2430.c |   52 +++++++++++++++++++++++++++++++++++++------
 drivers/usb/musb/omap2430.h |    9 ++++++++
 2 files changed, 54 insertions(+), 7 deletions(-)
drivers/usb/musb/omap2430.c +45 -7
index 02c39a7..f4d9503 100644
@@ -45,6 +45,7 @@ struct omap2430_glue {
 	struct platform_device	*musb;
 	enum omap_musb_vbus_id_status status;
 	struct work_struct	omap_musb_mailbox_work;
+	u32 __iomem		*control_otghs;
 };
 #define glue_to_musb(g)		platform_get_drvdata(g->musb)
 
@@ -52,6 +53,26 @@ struct omap2430_glue		*_glue;
 
 static struct timer_list musb_idle_timer;
 
+/**
+ * omap4_usb_phy_mailbox - write to usb otg mailbox
+ * @glue: struct omap2430_glue *
+ * @val: the value to be written to the mailbox
+ *
+ * On detection of a device (ID pin is grounded), this API should be called
+ * to set AVALID, VBUSVALID and ID pin is grounded.
+ *
+ * When OMAP is connected to a host (OMAP in device mode), this API
+ * is called to set AVALID, VBUSVALID and ID pin in high impedance.
+ *
+ * XXX: This function will be removed once we have a seperate driver for
+ * control module
+ */
+static void omap4_usb_phy_mailbox(struct omap2430_glue *glue, u32 val)
+{
+	if (glue->control_otghs)
+		writel(val, glue->control_otghs);
+}
+
 static void musb_do_idle(unsigned long _musb)
 {
 	struct musb	*musb = (void *)_musb;
@@ -247,6 +268,7 @@ EXPORT_SYMBOL_GPL(omap_musb_mailbox);
 
 static void omap_musb_set_mailbox(struct omap2430_glue *glue)
 {
+	u32 val;
 	struct musb *musb = glue_to_musb(glue);
 	struct device *dev = musb->controller;
 	struct musb_hdrc_platform_data *pdata = dev->platform_data;
@@ -262,7 +284,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
 		musb->xceiv->last_event = USB_EVENT_ID;
 		if (musb->gadget_driver) {
 			pm_runtime_get_sync(dev);
-			usb_phy_init(musb->xceiv);
+			val = AVALID | VBUSVALID;
+			omap4_usb_phy_mailbox(glue, val);
 			omap2430_musb_set_vbus(musb, 1);
 		}
 		break;
@@ -275,7 +298,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
 		musb->xceiv->last_event = USB_EVENT_VBUS;
 		if (musb->gadget_driver)
 			pm_runtime_get_sync(dev);
-		usb_phy_init(musb->xceiv);
+		val = IDDIG | AVALID | VBUSVALID;
+		omap4_usb_phy_mailbox(glue, val);
 		break;
 
 	case OMAP_MUSB_ID_FLOAT:
@@ -292,7 +316,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
 			if (musb->xceiv->otg->set_vbus)
 				otg_set_vbus(musb->xceiv->otg, 0);
 		}
-		usb_phy_shutdown(musb->xceiv);
+		val = SESSEND | IDDIG;
+		omap4_usb_phy_mailbox(glue, val);
 		break;
 	default:
 		dev_dbg(dev, "ID float\n");
@@ -367,6 +392,7 @@ err1:
 static void omap2430_musb_enable(struct musb *musb)
 {
 	u8		devctl;
+	u32		val;
 	unsigned long timeout = jiffies + msecs_to_jiffies(1000);
 	struct device *dev = musb->controller;
 	struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
@@ -376,7 +402,8 @@ static void omap2430_musb_enable(struct musb *musb)
 	switch (glue->status) {
 
 	case OMAP_MUSB_ID_GROUND:
-		usb_phy_init(musb->xceiv);
+		val = AVALID | VBUSVALID;
+		omap4_usb_phy_mailbox(glue, val);
 		if (data->interface_type != MUSB_INTERFACE_UTMI)
 			break;
 		devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
@@ -395,7 +422,8 @@ static void omap2430_musb_enable(struct musb *musb)
 		break;
 
 	case OMAP_MUSB_VBUS_VALID:
-		usb_phy_init(musb->xceiv);
+		val = IDDIG | AVALID | VBUSVALID;
+		omap4_usb_phy_mailbox(glue, val);
 		break;
 
 	default:
@@ -405,11 +433,14 @@ static void omap2430_musb_enable(struct musb *musb)
 
 static void omap2430_musb_disable(struct musb *musb)
 {
+	u32 val;
 	struct device *dev = musb->controller;
 	struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
 
-	if (glue->status != OMAP_MUSB_UNKNOWN)
-		usb_phy_shutdown(musb->xceiv);
+	if (glue->status != OMAP_MUSB_UNKNOWN) {
+		val = SESSEND | IDDIG;
+		omap4_usb_phy_mailbox(glue, val);
+	}
 }
 
 static int omap2430_musb_exit(struct musb *musb)
@@ -441,6 +472,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 	struct musb_hdrc_platform_data	*pdata = pdev->dev.platform_data;
 	struct platform_device		*musb;
 	struct omap2430_glue		*glue;
+	struct resource			*res;
 	int				ret = -ENOMEM;
 
 	glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
@@ -463,6 +495,12 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
 	glue->musb			= musb;
 	glue->status			= OMAP_MUSB_UNKNOWN;
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+
+	glue->control_otghs = devm_request_and_ioremap(&pdev->dev, res);
+	if (glue->control_otghs == NULL)
+		dev_dbg(&pdev->dev, "Failed to obtain control memory\n");
+
 	pdata->platform_ops		= &omap2430_ops;
 
 	platform_set_drvdata(pdev, glue);
drivers/usb/musb/omap2430.h +9 -0
index 40b3c02..b85f397 100644
@@ -49,4 +49,13 @@
 #define OTG_FORCESTDBY		0x414
 #	define	ENABLEFORCE		(1 << 0)
 
+/*
+ * Control Module bit definitions
+ * XXX: Will be removed once we have a driver for control module.
+ */
+#define	AVALID				BIT(0)
+#define	BVALID				BIT(1)
+#define	VBUSVALID			BIT(2)
+#define	SESSEND				BIT(3)
+#define	IDDIG				BIT(4)
 #endif	/* __MUSB_OMAP243X_H__ */
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH 3/3 usb: musb: omap: Add device tree support for omap musb glue

In reply to Kishon Vijay Abraham I

Added device tree support for omap musb driver and updated the Documentation with device tree binding information.

---
 Documentation/devicetree/bindings/usb/omap-usb.txt |   33 ++++++++++++
 drivers/usb/musb/omap2430.c                        |   54 ++++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txt
Documentation/devicetree/bindings/usb/omap-usb.txt new file +33 -0
new file mode 100644
index 0000000..544fa97
@@ -0,0 +1,33 @@
+OMAP GLUE
+
+OMAP MUSB GLUE
+ - compatible : Should be "ti,musb-omap2430"
+ - ti,hwmods : must be "usb_otg_hs"
+ - multipoint : Should be "1" indicating the musb controller supports
+   multipoint. This is a MUSB configuration-specific setting.
+ - num_eps : Specifies the number of endpoints. This is also a
+   MUSB configuration-specific setting. Should be set to "16"
+ - ram_bits : Specifies the ram address size. Should be set to "12"
+ - interface_type : This is a board specific setting to describe the type of
+   interface between the controller and the phy. It should be "0" or "1"
+   specifying ULPI and UTMI respectively.
+ - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
+   represents PERIPHERAL.
+ - power : Should be "50". This signifies the controller can supply upto
+   100mA when operating in host mode.
+
+SOC specific device node entry
+usb_otg_hs: usb_otg_hs at 4a0ab000 {
+	compatible = "ti,musb-omap2430";
+	ti,hwmods = "usb_otg_hs";
+	multipoint = <1>;
+	num_eps = <16>;
+	ram_bits = <12>;
+};
+
+Board specific device node entry
+&usb_otg_hs {
+	interface_type = <1>;
+	mode = <3>;
+	power = <50>;
+};
drivers/usb/musb/omap2430.c +54 -0

86 lines not on this page · raw message

Signature · 1 line
1.7.9.5