Re: [U-Boot] [PATCH 3/7] arm: omap-common: sata: prepare driver for DM conversion
On 01/04/2017 06:21, Simon Glass wrote: Hi, On 24 March 2017 at 06:24, Jean-Jacques Hiblotwrote: From: Mugunthan V N Prepare sata driver for DM conversion by abstracting sata phy init to seperate function. Signed-off-by: Mugunthan V N Signed-off-by: Jean-Jacques Hiblot --- arch/arm/mach-omap2/sata.c | 13 + include/sata.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/sata.c b/arch/arm/mach-omap2/sata.c index 217f1c9..dce432b 100644 --- a/arch/arm/mach-omap2/sata.c +++ b/arch/arm/mach-omap2/sata.c @@ -32,16 +32,21 @@ struct omap_pipe3 sata_phy = { .dpll_map = dpll_map_sata, }; +int enable_sata_phy(void) We should not be calling board functions from the driver. Can you instead add a SATA PHY uclass / driver? Simon, thanks for the review. I'll re-work the series in that direction. We already have all the required entries in the dts for this. Jean-Jacques +{ + sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; + + /* Power up the PHY */ + return phy_pipe3_power_on(_phy); +} + #ifndef CONFIG_DM_SCSI int init_sata(int dev) { int ret; u32 val; - sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; - - /* Power up the PHY */ - phy_pipe3_power_on(_phy); + enable_sata_phy(); /* Enable SATA module, No Idle, No Standby */ val = TI_SATA_IDLE_NO | TI_SATA_STANDBY_NO; diff --git a/include/sata.h b/include/sata.h index d18cc9a..583b72d 100644 --- a/include/sata.h +++ b/include/sata.h @@ -18,4 +18,6 @@ int sata_port_status(int dev, int port); extern struct blk_desc sata_dev_desc[]; #endif +int enable_sata_phy(void); + #endif -- 1.9.1 Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 3/7] arm: omap-common: sata: prepare driver for DM conversion
Hi, On 24 March 2017 at 06:24, Jean-Jacques Hiblotwrote: > From: Mugunthan V N > > Prepare sata driver for DM conversion by abstracting sata phy > init to seperate function. > > Signed-off-by: Mugunthan V N > Signed-off-by: Jean-Jacques Hiblot > --- > arch/arm/mach-omap2/sata.c | 13 + > include/sata.h | 2 ++ > 2 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/mach-omap2/sata.c b/arch/arm/mach-omap2/sata.c > index 217f1c9..dce432b 100644 > --- a/arch/arm/mach-omap2/sata.c > +++ b/arch/arm/mach-omap2/sata.c > @@ -32,16 +32,21 @@ struct omap_pipe3 sata_phy = { > .dpll_map = dpll_map_sata, > }; > > +int enable_sata_phy(void) We should not be calling board functions from the driver. Can you instead add a SATA PHY uclass / driver? > +{ > + sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; > + > + /* Power up the PHY */ > + return phy_pipe3_power_on(_phy); > +} > + > #ifndef CONFIG_DM_SCSI > int init_sata(int dev) > { > int ret; > u32 val; > > - sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; > - > - /* Power up the PHY */ > - phy_pipe3_power_on(_phy); > + enable_sata_phy(); > > /* Enable SATA module, No Idle, No Standby */ > val = TI_SATA_IDLE_NO | TI_SATA_STANDBY_NO; > diff --git a/include/sata.h b/include/sata.h > index d18cc9a..583b72d 100644 > --- a/include/sata.h > +++ b/include/sata.h > @@ -18,4 +18,6 @@ int sata_port_status(int dev, int port); > extern struct blk_desc sata_dev_desc[]; > #endif > > +int enable_sata_phy(void); > + > #endif > -- > 1.9.1 > Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 3/7] arm: omap-common: sata: prepare driver for DM conversion
From: Mugunthan V NPrepare sata driver for DM conversion by abstracting sata phy init to seperate function. Signed-off-by: Mugunthan V N Signed-off-by: Jean-Jacques Hiblot --- arch/arm/mach-omap2/sata.c | 13 + include/sata.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/sata.c b/arch/arm/mach-omap2/sata.c index 217f1c9..dce432b 100644 --- a/arch/arm/mach-omap2/sata.c +++ b/arch/arm/mach-omap2/sata.c @@ -32,16 +32,21 @@ struct omap_pipe3 sata_phy = { .dpll_map = dpll_map_sata, }; +int enable_sata_phy(void) +{ + sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; + + /* Power up the PHY */ + return phy_pipe3_power_on(_phy); +} + #ifndef CONFIG_DM_SCSI int init_sata(int dev) { int ret; u32 val; - sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; - - /* Power up the PHY */ - phy_pipe3_power_on(_phy); + enable_sata_phy(); /* Enable SATA module, No Idle, No Standby */ val = TI_SATA_IDLE_NO | TI_SATA_STANDBY_NO; diff --git a/include/sata.h b/include/sata.h index d18cc9a..583b72d 100644 --- a/include/sata.h +++ b/include/sata.h @@ -18,4 +18,6 @@ int sata_port_status(int dev, int port); extern struct blk_desc sata_dev_desc[]; #endif +int enable_sata_phy(void); + #endif -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot