Message ID | 1342866729-30460-3-git-send-email-gautam.vivek@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Saturday 21 July 2012, Vivek Gautam wrote: > From: Ajay Kumar <ajaykumar.rs@samsung.com> > > This patch adds address mapping of USB 2.0 PHY for exynos5 > > Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> > --- > arch/arm/mach-exynos/common.c | 5 +++++ > arch/arm/mach-exynos/include/mach/map.h | 2 ++ > 2 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c > index 4eb39cd..92d5e61 100644 > --- a/arch/arm/mach-exynos/common.c > +++ b/arch/arm/mach-exynos/common.c > @@ -275,6 +275,11 @@ static struct map_desc exynos5_iodesc[] __initdata = { > .pfn = __phys_to_pfn(EXYNOS5_PA_GIC_DIST), > .length = SZ_4K, > .type = MT_DEVICE, > + }, { > + .virtual = (unsigned long)S3C_VA_USB_HSPHY, > + .pfn = __phys_to_pfn(EXYNOS5_PA_USB_PHY), > + .length = SZ_4K, > + .type = MT_DEVICE, > }, > }; Can you pleae explain why this is done in the changelog? We try hard to do such mappings from the device driver instead, so I'm surprised that this is necessary fo rthe USB phy. Arnd
On Thu, Jul 26, 2012 at 8:24 PM, Arnd Bergmann <arnd@arndb.de> wrote: > On Saturday 21 July 2012, Vivek Gautam wrote: > > From: Ajay Kumar <ajaykumar.rs@samsung.com> > > > > This patch adds address mapping of USB 2.0 PHY for exynos5 > > > > Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com> > > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> > > --- > > arch/arm/mach-exynos/common.c | 5 +++++ > > arch/arm/mach-exynos/include/mach/map.h | 2 ++ > > 2 files changed, 7 insertions(+), 0 deletions(-) > > > > diff --git a/arch/arm/mach-exynos/common.c > b/arch/arm/mach-exynos/common.c > > index 4eb39cd..92d5e61 100644 > > --- a/arch/arm/mach-exynos/common.c > > +++ b/arch/arm/mach-exynos/common.c > > @@ -275,6 +275,11 @@ static struct map_desc exynos5_iodesc[] __initdata > = { > > .pfn = __phys_to_pfn(EXYNOS5_PA_GIC_DIST), > > .length = SZ_4K, > > .type = MT_DEVICE, > > + }, { > > + .virtual = (unsigned long)S3C_VA_USB_HSPHY, > > + .pfn = __phys_to_pfn(EXYNOS5_PA_USB_PHY), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > }, > > }; > > Can you pleae explain why this is done in the changelog? > > We try hard to do such mappings from the device driver instead, > so I'm surprised that this is necessary fo rthe USB phy. > We are doing the mapping for device address in the driver, but this memory mapping for USB PHY registers that need to be programmed by the software is done here. This is similar to what we see for exynos4 also. Is it something that i can still change? Please suggest. > > Arnd > > _______________________________________________ > devicetree-discuss mailing list > devicetree-discuss@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/devicetree-discuss > Best regards Vivek
On Saturday 28 July 2012, Vivek Gautam wrote: > > Can you pleae explain why this is done in the changelog? > > > > We try hard to do such mappings from the device driver instead, > > so I'm surprised that this is necessary fo rthe USB phy. > > > > We are doing the mapping for device address in the driver, but this memory > mapping for USB PHY registers that need to be programmed by the software > is done here. This is similar to what we see for exynos4 also. Is it > something > that i can still change? Please suggest. Yes, I think the USB PHY handling for all exynos chips should be changed from an ad-hoc method to a more formal device driver. As I commented in another patch of this series, I think the main problem is that treat the USB PHY as a property of the "platform", which it really isn't. We have a bunch of other USB PHY drivers for other platforms that are inside of the drivers/usb hierarchy. For all I know, there is no formal USB PHY driver API yet, and it seems that it would be a good idea to introduce one now, but for now, just move the code to drivers/usb/phy/ and make it one file per different kind of PHY. Arnd
On 07/29/2012 10:11 PM, Arnd Bergmann wrote: > On Saturday 28 July 2012, Vivek Gautam wrote: >>> Can you pleae explain why this is done in the changelog? >>> >>> We try hard to do such mappings from the device driver instead, >>> so I'm surprised that this is necessary fo rthe USB phy. >>> >> We are doing the mapping for device address in the driver, but this memory >> mapping for USB PHY registers that need to be programmed by the software >> is done here. This is similar to what we see for exynos4 also. Is it >> something >> that i can still change? Please suggest. > > Yes, I think the USB PHY handling for all exynos chips should be changed > from an ad-hoc method to a more formal device driver. As I commented > in another patch of this series, I think the main problem is that > treat the USB PHY as a property of the "platform", which it really isn't. > > We have a bunch of other USB PHY drivers for other platforms that are > inside of the drivers/usb hierarchy. For all I know, there is no formal > USB PHY driver API yet, and it seems that it would be a good idea to > introduce one now, but for now, just move the code to > drivers/usb/phy/ and make it one file per different kind of PHY. > Totally agree. I think that two PHY drivers need for usb2.0 PHY and usb3.0 PHY in drivers/usb/phy directory. First, let's make usb2.0 PHY driver for samsung SoCs from phy control codes of arch/arm, then add to support usb2.0 PHY for exynos5 and make usb3.0 PHY driver for exynos. Thanks.
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 4eb39cd..92d5e61 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -275,6 +275,11 @@ static struct map_desc exynos5_iodesc[] __initdata = { .pfn = __phys_to_pfn(EXYNOS5_PA_GIC_DIST), .length = SZ_4K, .type = MT_DEVICE, + }, { + .virtual = (unsigned long)S3C_VA_USB_HSPHY, + .pfn = __phys_to_pfn(EXYNOS5_PA_USB_PHY), + .length = SZ_4K, + .type = MT_DEVICE, }, }; diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index c72b675..331ae57 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -192,6 +192,8 @@ #define EXYNOS4_PA_UART 0x13800000 #define EXYNOS5_PA_UART 0x12C00000 +#define EXYNOS5_PA_USB_PHY 0x12130000 + #define EXYNOS4_PA_VP 0x12C00000 #define EXYNOS4_PA_MIXER 0x12C10000 #define EXYNOS4_PA_SDO 0x12C20000