* Re: [RFC 10/18] omap3isp: Move the syscon register out of the ISP register maps [not found] ` <1425764475-27691-11-git-send-email-sakari.ailus@iki.fi> @ 2015-03-07 23:34 ` Laurent Pinchart 2015-03-07 23:43 ` Sakari Ailus 0 siblings, 1 reply; 6+ messages in thread From: Laurent Pinchart @ 2015-03-07 23:34 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, devicetree, pali.rohar, linux-omap, Tony Lindgren Hi Sakari, Thank you for the patch. (CC'ing linux-omap and Tony) On Saturday 07 March 2015 23:41:07 Sakari Ailus wrote: > The syscon register isn't part of the ISP, use it through the syscom driver > regmap instead. The syscom block is considered to be from 343x on ISP > revision 2.0 whereas 15.0 is assumed to have 3630 syscon. > > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> > --- > arch/arm/boot/dts/omap3.dtsi | 2 +- > arch/arm/mach-omap2/devices.c | 10 ---------- > drivers/media/platform/omap3isp/isp.c | 19 +++++++++++++++---- > drivers/media/platform/omap3isp/isp.h | 19 +++++++++++++++++-- > drivers/media/platform/omap3isp/ispcsiphy.c | 20 +++++++++----------- You might be asked to split the patch into two, let's see what Tony says. > 5 files changed, 42 insertions(+), 28 deletions(-) > > diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi > index 01b7111..fe0b293 100644 > --- a/arch/arm/boot/dts/omap3.dtsi > +++ b/arch/arm/boot/dts/omap3.dtsi > @@ -183,7 +183,7 @@ > > omap3_scm_general: tisyscon@48002270 { > compatible = "syscon"; > - reg = <0x48002270 0x2f0>; > + reg = <0x48002270 0x2f4>; > }; > > pbias_regulator: pbias_regulator { > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > index 1afb50d..e945957 100644 > --- a/arch/arm/mach-omap2/devices.c > +++ b/arch/arm/mach-omap2/devices.c > @@ -143,16 +143,6 @@ static struct resource omap3isp_resources[] = { > .flags = IORESOURCE_MEM, > }, > { > - .start = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE, > - .end = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE + 3, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL, > - .end = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3, > - .flags = IORESOURCE_MEM, > - }, > - { > .start = 24 + OMAP_INTC_START, > .flags = IORESOURCE_IRQ, > } > diff --git a/drivers/media/platform/omap3isp/isp.c > b/drivers/media/platform/omap3isp/isp.c index 68d7edfc..4ff4bbd 100644 > --- a/drivers/media/platform/omap3isp/isp.c > +++ b/drivers/media/platform/omap3isp/isp.c > @@ -51,6 +51,7 @@ > #include <linux/dma-mapping.h> > #include <linux/i2c.h> > #include <linux/interrupt.h> > +#include <linux/mfd/syscon.h> > #include <linux/module.h> > #include <linux/omap-iommu.h> > #include <linux/platform_device.h> > @@ -94,8 +95,9 @@ static const struct isp_res_mapping isp_res_maps[] = { > 1 << OMAP3_ISP_IOMEM_RESZ | > 1 << OMAP3_ISP_IOMEM_SBL | > 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > - 1 << OMAP3_ISP_IOMEM_CSIPHY2 | > - 1 << OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, > + 1 << OMAP3_ISP_IOMEM_CSIPHY2, > + .syscon_offset = 0xdc, > + .phy_type = ISP_PHY_TYPE_3430, > }, > { > .isp_rev = ISP_REVISION_15_0, > @@ -112,8 +114,9 @@ static const struct isp_res_mapping isp_res_maps[] = { > 1 << OMAP3_ISP_IOMEM_CSI2A_REGS2 | > 1 << OMAP3_ISP_IOMEM_CSI2C_REGS1 | > 1 << OMAP3_ISP_IOMEM_CSIPHY1 | > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2 | > - 1 << OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, > + 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2, > + .syscon_offset = 0x2f0, > + .phy_type = ISP_PHY_TYPE_3630, > }, > }; > > @@ -2352,6 +2355,14 @@ static int isp_probe(struct platform_device *pdev) > } > } > > + isp->syscon = syscon_regmap_lookup_by_pdevname("syscon.0"); > + isp->syscon_offset = isp_res_maps[m].syscon_offset; > + isp->phy_type = isp_res_maps[m].phy_type; You could move those two lines after the error check to keep the check closer to the source of error. Apart from that, Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > + if (IS_ERR(isp->syscon)) { > + ret = PTR_ERR(isp->syscon); > + goto error_isp; > + } > + > /* IOMMU */ > ret = isp_attach_iommu(isp); > if (ret < 0) { > diff --git a/drivers/media/platform/omap3isp/isp.h > b/drivers/media/platform/omap3isp/isp.h index 9535524..03d2129 100644 > --- a/drivers/media/platform/omap3isp/isp.h > +++ b/drivers/media/platform/omap3isp/isp.h > @@ -59,8 +59,6 @@ enum isp_mem_resources { > OMAP3_ISP_IOMEM_CSI2C_REGS1, > OMAP3_ISP_IOMEM_CSIPHY1, > OMAP3_ISP_IOMEM_CSI2C_REGS2, > - OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, > - OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, > OMAP3_ISP_IOMEM_LAST > }; > > @@ -93,14 +91,25 @@ enum isp_subclk_resource { > /* ISP2P: OMAP 36xx */ > #define ISP_REVISION_15_0 0xF0 > > +#define ISP_PHY_TYPE_3430 0 > +#define ISP_PHY_TYPE_3630 1 > + > +struct regmap; > + > /* > * struct isp_res_mapping - Map ISP io resources to ISP revision. > * @isp_rev: ISP_REVISION_x_x > * @map: bitmap for enum isp_mem_resources > + * @syscon_offset: offset of the syscon register for 343x / 3630 > + * (CONTROL_CSIRXFE / CONTROL_CAMERA_PHY_CTRL, respectively) > + * from the syscon base address > + * @phy_type: ISP_PHY_TYPE_{3430,3630} > */ > struct isp_res_mapping { > u32 isp_rev; > u32 map; > + u32 syscon_offset; > + u32 phy_type; > }; > > /* > @@ -140,6 +149,9 @@ struct isp_xclk { > * regions. > * @mmio_hist_base_phys: Physical L4 bus address for ISP hist block > register > * region. > + * @syscon: Regmap for the syscon register space > + * @syscon_offset: Offset of the CSIPHY control register in syscon > + * @phy_type: ISP_PHY_TYPE_{3430,3630} > * @mapping: IOMMU mapping > * @stat_lock: Spinlock for handling statistics > * @isp_mutex: Mutex for serializing requests to ISP. > @@ -176,6 +188,9 @@ struct isp_device { > > void __iomem *mmio_base[OMAP3_ISP_IOMEM_LAST]; > unsigned long mmio_hist_base_phys; > + struct regmap *syscon; > + u32 syscon_offset; > + u32 phy_type; > > struct dma_iommu_mapping *mapping; > > diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c > b/drivers/media/platform/omap3isp/ispcsiphy.c index 4486e9f..d91dde1 100644 > --- a/drivers/media/platform/omap3isp/ispcsiphy.c > +++ b/drivers/media/platform/omap3isp/ispcsiphy.c > @@ -16,6 +16,7 @@ > > #include <linux/delay.h> > #include <linux/device.h> > +#include <linux/regmap.h> > #include <linux/regulator/consumer.h> > > #include "isp.h" > @@ -26,10 +27,11 @@ static void csiphy_routing_cfg_3630(struct isp_csiphy > *phy, enum isp_interface_type iface, > bool ccp2_strobe) > { > - u32 reg = isp_reg_readl( > - phy->isp, OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, 0); > + u32 reg; > u32 shift, mode; > > + regmap_read(phy->isp->syscon, phy->isp->syscon_offset, ®); > + > switch (iface) { > default: > /* Should not happen in practice, but let's keep the compiler happy. */ > @@ -63,8 +65,7 @@ static void csiphy_routing_cfg_3630(struct isp_csiphy > *phy, reg &= ~(OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_MASK << shift); reg > |= mode << shift; > > - isp_reg_writel(phy->isp, reg, > - OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, 0); > + regmap_write(phy->isp->syscon, phy->isp->syscon_offset, reg); > } > > static void csiphy_routing_cfg_3430(struct isp_csiphy *phy, u32 iface, bool > on, @@ -78,16 +79,14 @@ static void csiphy_routing_cfg_3430(struct > isp_csiphy *phy, u32 iface, bool on, return; > > if (!on) { > - isp_reg_writel(phy->isp, 0, > - OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, 0); > + regmap_write(phy->isp->syscon, phy->isp->syscon_offset, 0); > return; > } > > if (ccp2_strobe) > csirxfe |= OMAP343X_CONTROL_CSIRXFE_SELFORM; > > - isp_reg_writel(phy->isp, csirxfe, > - OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, 0); > + regmap_write(phy->isp->syscon, phy->isp->syscon_offset, csirxfe); > } > > /* > @@ -106,10 +105,9 @@ static void csiphy_routing_cfg(struct isp_csiphy *phy, > enum isp_interface_type iface, bool on, > bool ccp2_strobe) > { > - if (phy->isp->mmio_base[OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL] > - && on) > + if (phy->isp->phy_type == ISP_PHY_TYPE_3630 && on) > return csiphy_routing_cfg_3630(phy, iface, ccp2_strobe); > - if (phy->isp->mmio_base[OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE]) > + if (phy->isp->phy_type == ISP_PHY_TYPE_3430) > return csiphy_routing_cfg_3430(phy, iface, on, ccp2_strobe); > } -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC 10/18] omap3isp: Move the syscon register out of the ISP register maps 2015-03-07 23:34 ` [RFC 10/18] omap3isp: Move the syscon register out of the ISP register maps Laurent Pinchart @ 2015-03-07 23:43 ` Sakari Ailus 2015-03-09 15:20 ` Tony Lindgren 0 siblings, 1 reply; 6+ messages in thread From: Sakari Ailus @ 2015-03-07 23:43 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, pali.rohar-Re5JQEeQqe8AvxtiuMwx3w, linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren Hi Laurent, On Sun, Mar 08, 2015 at 01:34:17AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > (CC'ing linux-omap and Tony) Thanks. > On Saturday 07 March 2015 23:41:07 Sakari Ailus wrote: > > The syscon register isn't part of the ISP, use it through the syscom driver > > regmap instead. The syscom block is considered to be from 343x on ISP > > revision 2.0 whereas 15.0 is assumed to have 3630 syscon. > > > > Signed-off-by: Sakari Ailus <sakari.ailus-X3B1VOXEql0@public.gmane.org> > > --- > > arch/arm/boot/dts/omap3.dtsi | 2 +- > > arch/arm/mach-omap2/devices.c | 10 ---------- > > drivers/media/platform/omap3isp/isp.c | 19 +++++++++++++++---- > > drivers/media/platform/omap3isp/isp.h | 19 +++++++++++++++++-- > > drivers/media/platform/omap3isp/ispcsiphy.c | 20 +++++++++----------- > > You might be asked to split the patch into two, let's see what Tony says. > > > 5 files changed, 42 insertions(+), 28 deletions(-) > > > > diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi > > index 01b7111..fe0b293 100644 > > --- a/arch/arm/boot/dts/omap3.dtsi > > +++ b/arch/arm/boot/dts/omap3.dtsi > > @@ -183,7 +183,7 @@ > > > > omap3_scm_general: tisyscon@48002270 { > > compatible = "syscon"; > > - reg = <0x48002270 0x2f0>; > > + reg = <0x48002270 0x2f4>; > > }; > > > > pbias_regulator: pbias_regulator { > > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > > index 1afb50d..e945957 100644 > > --- a/arch/arm/mach-omap2/devices.c > > +++ b/arch/arm/mach-omap2/devices.c > > @@ -143,16 +143,6 @@ static struct resource omap3isp_resources[] = { > > .flags = IORESOURCE_MEM, > > }, > > { > > - .start = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE, > > - .end = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE + 3, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL, > > - .end = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > .start = 24 + OMAP_INTC_START, > > .flags = IORESOURCE_IRQ, > > } > > diff --git a/drivers/media/platform/omap3isp/isp.c > > b/drivers/media/platform/omap3isp/isp.c index 68d7edfc..4ff4bbd 100644 > > --- a/drivers/media/platform/omap3isp/isp.c > > +++ b/drivers/media/platform/omap3isp/isp.c > > @@ -51,6 +51,7 @@ > > #include <linux/dma-mapping.h> > > #include <linux/i2c.h> > > #include <linux/interrupt.h> > > +#include <linux/mfd/syscon.h> > > #include <linux/module.h> > > #include <linux/omap-iommu.h> > > #include <linux/platform_device.h> > > @@ -94,8 +95,9 @@ static const struct isp_res_mapping isp_res_maps[] = { > > 1 << OMAP3_ISP_IOMEM_RESZ | > > 1 << OMAP3_ISP_IOMEM_SBL | > > 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > > - 1 << OMAP3_ISP_IOMEM_CSIPHY2 | > > - 1 << OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, > > + 1 << OMAP3_ISP_IOMEM_CSIPHY2, > > + .syscon_offset = 0xdc, > > + .phy_type = ISP_PHY_TYPE_3430, > > }, > > { > > .isp_rev = ISP_REVISION_15_0, > > @@ -112,8 +114,9 @@ static const struct isp_res_mapping isp_res_maps[] = { > > 1 << OMAP3_ISP_IOMEM_CSI2A_REGS2 | > > 1 << OMAP3_ISP_IOMEM_CSI2C_REGS1 | > > 1 << OMAP3_ISP_IOMEM_CSIPHY1 | > > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2 | > > - 1 << OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, > > + 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2, > > + .syscon_offset = 0x2f0, > > + .phy_type = ISP_PHY_TYPE_3630, > > }, > > }; > > > > @@ -2352,6 +2355,14 @@ static int isp_probe(struct platform_device *pdev) > > } > > } > > > > + isp->syscon = syscon_regmap_lookup_by_pdevname("syscon.0"); > > + isp->syscon_offset = isp_res_maps[m].syscon_offset; > > + isp->phy_type = isp_res_maps[m].phy_type; > > You could move those two lines after the error check to keep the check closer > to the source of error. Ack. > Apart from that, > > Acked-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> Thanks for the acks! -- Kind regards, Sakari Ailus e-mail: sakari.ailus-X3B1VOXEql0@public.gmane.org XMPP: sailus-PCDdDYkjdNMDXYZnReoRVg@public.gmane.org -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC 10/18] omap3isp: Move the syscon register out of the ISP register maps 2015-03-07 23:43 ` Sakari Ailus @ 2015-03-09 15:20 ` Tony Lindgren 2015-03-14 15:00 ` Sakari Ailus 0 siblings, 1 reply; 6+ messages in thread From: Tony Lindgren @ 2015-03-09 15:20 UTC (permalink / raw) To: Sakari Ailus Cc: Laurent Pinchart, linux-media, devicetree, pali.rohar, linux-omap * Sakari Ailus <sakari.ailus@iki.fi> [150307 15:44]: > Hi Laurent, > > On Sun, Mar 08, 2015 at 01:34:17AM +0200, Laurent Pinchart wrote: > > Hi Sakari, > > > > Thank you for the patch. > > > > (CC'ing linux-omap and Tony) > > Thanks. > > > On Saturday 07 March 2015 23:41:07 Sakari Ailus wrote: > > > The syscon register isn't part of the ISP, use it through the syscom driver > > > regmap instead. The syscom block is considered to be from 343x on ISP > > > revision 2.0 whereas 15.0 is assumed to have 3630 syscon. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> > > > --- > > > arch/arm/boot/dts/omap3.dtsi | 2 +- > > > arch/arm/mach-omap2/devices.c | 10 ---------- > > > drivers/media/platform/omap3isp/isp.c | 19 +++++++++++++++---- > > > drivers/media/platform/omap3isp/isp.h | 19 +++++++++++++++++-- > > > drivers/media/platform/omap3isp/ispcsiphy.c | 20 +++++++++----------- > > > > You might be asked to split the patch into two, let's see what Tony says. > > > > > 5 files changed, 42 insertions(+), 28 deletions(-) > > > > > > diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi > > > index 01b7111..fe0b293 100644 > > > --- a/arch/arm/boot/dts/omap3.dtsi > > > +++ b/arch/arm/boot/dts/omap3.dtsi > > > @@ -183,7 +183,7 @@ > > > > > > omap3_scm_general: tisyscon@48002270 { > > > compatible = "syscon"; > > > - reg = <0x48002270 0x2f0>; > > > + reg = <0x48002270 0x2f4>; > > > }; > > > > > > pbias_regulator: pbias_regulator { Can you please send the above dts change separately as a fix describing what goes wrong? Let's get that out of the way for the -rc, otherwise we're going to probably get conflicts with Tero's dts changes. > > > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > > > index 1afb50d..e945957 100644 > > > --- a/arch/arm/mach-omap2/devices.c > > > +++ b/arch/arm/mach-omap2/devices.c > > > @@ -143,16 +143,6 @@ static struct resource omap3isp_resources[] = { > > > .flags = IORESOURCE_MEM, > > > }, > > > { > > > - .start = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE, > > > - .end = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE + 3, > > > - .flags = IORESOURCE_MEM, > > > - }, > > > - { > > > - .start = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL, > > > - .end = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3, > > > - .flags = IORESOURCE_MEM, > > > - }, > > > - { > > > .start = 24 + OMAP_INTC_START, > > > .flags = IORESOURCE_IRQ, > > > } Looks good to me, teel free to merge this part along with the other isp changes: Acked-by: Tony Lindgren <tony@atomide.com> > > > diff --git a/drivers/media/platform/omap3isp/isp.c > > > b/drivers/media/platform/omap3isp/isp.c index 68d7edfc..4ff4bbd 100644 > > > --- a/drivers/media/platform/omap3isp/isp.c > > > +++ b/drivers/media/platform/omap3isp/isp.c > > > @@ -51,6 +51,7 @@ > > > #include <linux/dma-mapping.h> > > > #include <linux/i2c.h> > > > #include <linux/interrupt.h> > > > +#include <linux/mfd/syscon.h> > > > #include <linux/module.h> > > > #include <linux/omap-iommu.h> > > > #include <linux/platform_device.h> > > > @@ -94,8 +95,9 @@ static const struct isp_res_mapping isp_res_maps[] = { > > > 1 << OMAP3_ISP_IOMEM_RESZ | > > > 1 << OMAP3_ISP_IOMEM_SBL | > > > 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > > > - 1 << OMAP3_ISP_IOMEM_CSIPHY2 | > > > - 1 << OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, > > > + 1 << OMAP3_ISP_IOMEM_CSIPHY2, > > > + .syscon_offset = 0xdc, > > > + .phy_type = ISP_PHY_TYPE_3430, > > > }, > > > { > > > .isp_rev = ISP_REVISION_15_0, > > > @@ -112,8 +114,9 @@ static const struct isp_res_mapping isp_res_maps[] = { > > > 1 << OMAP3_ISP_IOMEM_CSI2A_REGS2 | > > > 1 << OMAP3_ISP_IOMEM_CSI2C_REGS1 | > > > 1 << OMAP3_ISP_IOMEM_CSIPHY1 | > > > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2 | > > > - 1 << OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, > > > + 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2, > > > + .syscon_offset = 0x2f0, > > > + .phy_type = ISP_PHY_TYPE_3630, > > > }, > > > }; > > > > > > @@ -2352,6 +2355,14 @@ static int isp_probe(struct platform_device *pdev) > > > } > > > } > > > > > > + isp->syscon = syscon_regmap_lookup_by_pdevname("syscon.0"); > > > + isp->syscon_offset = isp_res_maps[m].syscon_offset; > > > + isp->phy_type = isp_res_maps[m].phy_type; > > > > You could move those two lines after the error check to keep the check closer > > to the source of error. > > Ack. > > > Apart from that, > > > > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > Thanks for the acks! > > -- > Kind regards, > > Sakari Ailus > e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC 10/18] omap3isp: Move the syscon register out of the ISP register maps 2015-03-09 15:20 ` Tony Lindgren @ 2015-03-14 15:00 ` Sakari Ailus 0 siblings, 0 replies; 6+ messages in thread From: Sakari Ailus @ 2015-03-14 15:00 UTC (permalink / raw) To: Tony Lindgren Cc: Laurent Pinchart, linux-media, devicetree, pali.rohar, linux-omap Hi Tony, Thanks for the comments!! On Mon, Mar 09, 2015 at 08:20:38AM -0700, Tony Lindgren wrote: > * Sakari Ailus <sakari.ailus@iki.fi> [150307 15:44]: > > Hi Laurent, > > > > On Sun, Mar 08, 2015 at 01:34:17AM +0200, Laurent Pinchart wrote: > > > Hi Sakari, > > > > > > Thank you for the patch. > > > > > > (CC'ing linux-omap and Tony) > > > > Thanks. > > > > > On Saturday 07 March 2015 23:41:07 Sakari Ailus wrote: > > > > The syscon register isn't part of the ISP, use it through the syscom driver > > > > regmap instead. The syscom block is considered to be from 343x on ISP > > > > revision 2.0 whereas 15.0 is assumed to have 3630 syscon. > > > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> > > > > --- > > > > arch/arm/boot/dts/omap3.dtsi | 2 +- > > > > arch/arm/mach-omap2/devices.c | 10 ---------- > > > > drivers/media/platform/omap3isp/isp.c | 19 +++++++++++++++---- > > > > drivers/media/platform/omap3isp/isp.h | 19 +++++++++++++++++-- > > > > drivers/media/platform/omap3isp/ispcsiphy.c | 20 +++++++++----------- > > > > > > You might be asked to split the patch into two, let's see what Tony says. > > > > > > > 5 files changed, 42 insertions(+), 28 deletions(-) > > > > > > > > diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi > > > > index 01b7111..fe0b293 100644 > > > > --- a/arch/arm/boot/dts/omap3.dtsi > > > > +++ b/arch/arm/boot/dts/omap3.dtsi > > > > @@ -183,7 +183,7 @@ > > > > > > > > omap3_scm_general: tisyscon@48002270 { > > > > compatible = "syscon"; > > > > - reg = <0x48002270 0x2f0>; > > > > + reg = <0x48002270 0x2f4>; > > > > }; > > > > > > > > pbias_regulator: pbias_regulator { > > Can you please send the above dts change separately as a fix describing > what goes wrong? Let's get that out of the way for the -rc, otherwise > we're going to probably get conflicts with Tero's dts changes. Sure. There's one register that didn't used to be mapped to syscon. > > > > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > > > > index 1afb50d..e945957 100644 > > > > --- a/arch/arm/mach-omap2/devices.c > > > > +++ b/arch/arm/mach-omap2/devices.c > > > > @@ -143,16 +143,6 @@ static struct resource omap3isp_resources[] = { > > > > .flags = IORESOURCE_MEM, > > > > }, > > > > { > > > > - .start = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE, > > > > - .end = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE + 3, > > > > - .flags = IORESOURCE_MEM, > > > > - }, > > > > - { > > > > - .start = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL, > > > > - .end = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3, > > > > - .flags = IORESOURCE_MEM, > > > > - }, > > > > - { > > > > .start = 24 + OMAP_INTC_START, > > > > .flags = IORESOURCE_IRQ, > > > > } > > Looks good to me, teel free to merge this part along with the other > isp changes: > > Acked-by: Tony Lindgren <tony@atomide.com> Thanks! -- Regards, Sakari Ailus e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <1425764475-27691-12-git-send-email-sakari.ailus@iki.fi>]
* Re: [RFC 11/18] omap3isp: Replace many MMIO regions by two [not found] ` <1425764475-27691-12-git-send-email-sakari.ailus@iki.fi> @ 2015-03-07 23:43 ` Laurent Pinchart 2015-03-09 15:22 ` Tony Lindgren 0 siblings, 1 reply; 6+ messages in thread From: Laurent Pinchart @ 2015-03-07 23:43 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, devicetree, pali.rohar, linux-omap, Tony Lindgren Hi Sakari, Thank you for the patch. (CC'ing linux-omap and Tony) On Saturday 07 March 2015 23:41:08 Sakari Ailus wrote: > The omap3isp MMIO register block is contiguous in the MMIO register space > apart from the fact that the ISP IOMMU register block is in the middle of > the area. Ioremap it at two occasions, and keep the rest of the layout of > the register space internal to the omap3isp driver. > > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > arch/arm/mach-omap2/devices.c | 66 +------------------ > arch/arm/mach-omap2/omap34xx.h | 36 +---------- Once again you might be asked to split this. However, it would be pretty painful, so it would be nice if we could merge everything through the Linux media tree. You will need an ack from Tony. > drivers/media/platform/omap3isp/isp.c | 113 ++++++++++++++++-------------- > drivers/media/platform/omap3isp/isp.h | 4 +- > 4 files changed, 66 insertions(+), 153 deletions(-) > > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > index e945957..990338f 100644 > --- a/arch/arm/mach-omap2/devices.c > +++ b/arch/arm/mach-omap2/devices.c > @@ -74,72 +74,12 @@ omap_postcore_initcall(omap3_l3_init); > static struct resource omap3isp_resources[] = { > { > .start = OMAP3430_ISP_BASE, > - .end = OMAP3430_ISP_END, > + .end = OMAP3430_ISP_BASE + 0x12fc, > .flags = IORESOURCE_MEM, > }, > { > - .start = OMAP3430_ISP_CCP2_BASE, > - .end = OMAP3430_ISP_CCP2_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_CCDC_BASE, > - .end = OMAP3430_ISP_CCDC_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_HIST_BASE, > - .end = OMAP3430_ISP_HIST_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_H3A_BASE, > - .end = OMAP3430_ISP_H3A_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_PREV_BASE, > - .end = OMAP3430_ISP_PREV_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_RESZ_BASE, > - .end = OMAP3430_ISP_RESZ_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_SBL_BASE, > - .end = OMAP3430_ISP_SBL_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_CSI2A_REGS1_BASE, > - .end = OMAP3430_ISP_CSI2A_REGS1_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3430_ISP_CSIPHY2_BASE, > - .end = OMAP3430_ISP_CSIPHY2_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3630_ISP_CSI2A_REGS2_BASE, > - .end = OMAP3630_ISP_CSI2A_REGS2_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3630_ISP_CSI2C_REGS1_BASE, > - .end = OMAP3630_ISP_CSI2C_REGS1_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3630_ISP_CSIPHY1_BASE, > - .end = OMAP3630_ISP_CSIPHY1_END, > - .flags = IORESOURCE_MEM, > - }, > - { > - .start = OMAP3630_ISP_CSI2C_REGS2_BASE, > - .end = OMAP3630_ISP_CSI2C_REGS2_END, > + .start = OMAP3430_ISP_BASE2, > + .end = OMAP3430_ISP_BASE2 + 0x0600, > .flags = IORESOURCE_MEM, > }, > { > diff --git a/arch/arm/mach-omap2/omap34xx.h b/arch/arm/mach-omap2/omap34xx.h > index c0d1b4b..ed0024d 100644 > --- a/arch/arm/mach-omap2/omap34xx.h > +++ b/arch/arm/mach-omap2/omap34xx.h > @@ -46,39 +46,9 @@ > > #define OMAP34XX_IC_BASE 0x48200000 > > -#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000) > -#define OMAP3430_ISP_CBUFF_BASE (OMAP3430_ISP_BASE + 0x0100) > -#define OMAP3430_ISP_CCP2_BASE (OMAP3430_ISP_BASE + 0x0400) > -#define OMAP3430_ISP_CCDC_BASE (OMAP3430_ISP_BASE + 0x0600) > -#define OMAP3430_ISP_HIST_BASE (OMAP3430_ISP_BASE + 0x0A00) > -#define OMAP3430_ISP_H3A_BASE (OMAP3430_ISP_BASE + 0x0C00) > -#define OMAP3430_ISP_PREV_BASE (OMAP3430_ISP_BASE + 0x0E00) > -#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000) > -#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200) > -#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400) > -#define OMAP3430_ISP_CSI2A_REGS1_BASE (OMAP3430_ISP_BASE + 0x1800) > -#define OMAP3430_ISP_CSIPHY2_BASE (OMAP3430_ISP_BASE + 0x1970) > -#define OMAP3630_ISP_CSI2A_REGS2_BASE (OMAP3430_ISP_BASE + 0x19C0) > -#define OMAP3630_ISP_CSI2C_REGS1_BASE (OMAP3430_ISP_BASE + 0x1C00) > -#define OMAP3630_ISP_CSIPHY1_BASE (OMAP3430_ISP_BASE + 0x1D70) > -#define OMAP3630_ISP_CSI2C_REGS2_BASE (OMAP3430_ISP_BASE + 0x1DC0) > - > -#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F) > -#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077) > -#define OMAP3430_ISP_CCP2_END (OMAP3430_ISP_CCP2_BASE + 0x1EF) > -#define OMAP3430_ISP_CCDC_END (OMAP3430_ISP_CCDC_BASE + 0x0A7) > -#define OMAP3430_ISP_HIST_END (OMAP3430_ISP_HIST_BASE + 0x047) > -#define OMAP3430_ISP_H3A_END (OMAP3430_ISP_H3A_BASE + 0x05F) > -#define OMAP3430_ISP_PREV_END (OMAP3430_ISP_PREV_BASE + 0x09F) > -#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB) > -#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB) > -#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F) > -#define OMAP3430_ISP_CSI2A_REGS1_END (OMAP3430_ISP_CSI2A_REGS1_BASE + > 0x16F) -#define OMAP3430_ISP_CSIPHY2_END (OMAP3430_ISP_CSIPHY2_BASE + > 0x00B) -#define OMAP3630_ISP_CSI2A_REGS2_END (OMAP3630_ISP_CSI2A_REGS2_BASE > + 0x3F) -#define > OMAP3630_ISP_CSI2C_REGS1_END (OMAP3630_ISP_CSI2C_REGS1_BASE + 0x16F) > -#define OMAP3630_ISP_CSIPHY1_END (OMAP3630_ISP_CSIPHY1_BASE + 0x00B) > -#define OMAP3630_ISP_CSI2C_REGS2_END (OMAP3630_ISP_CSI2C_REGS2_BASE + > 0x3F) +#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000) > +#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400) > +#define OMAP3430_ISP_BASE2 (OMAP3430_ISP_BASE + 0x1800) > > #define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) > #define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) > diff --git a/drivers/media/platform/omap3isp/isp.c > b/drivers/media/platform/omap3isp/isp.c index 4ff4bbd..7804895 100644 > --- a/drivers/media/platform/omap3isp/isp.c > +++ b/drivers/media/platform/omap3isp/isp.c > @@ -86,35 +86,43 @@ static void isp_restore_ctx(struct isp_device *isp); > static const struct isp_res_mapping isp_res_maps[] = { > { > .isp_rev = ISP_REVISION_2_0, > - .map = 1 << OMAP3_ISP_IOMEM_MAIN | > - 1 << OMAP3_ISP_IOMEM_CCP2 | > - 1 << OMAP3_ISP_IOMEM_CCDC | > - 1 << OMAP3_ISP_IOMEM_HIST | > - 1 << OMAP3_ISP_IOMEM_H3A | > - 1 << OMAP3_ISP_IOMEM_PREV | > - 1 << OMAP3_ISP_IOMEM_RESZ | > - 1 << OMAP3_ISP_IOMEM_SBL | > - 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > - 1 << OMAP3_ISP_IOMEM_CSIPHY2, > + .offset = { > + /* first MMIO area */ > + 0x0000, /* base, len 0x0070 */ > + 0x0400, /* ccp2, len 0x01f0 */ > + 0x0600, /* ccdc, len 0x00a8 */ > + 0x0a00, /* hist, len 0x0048 */ > + 0x0c00, /* h3a, len 0x0060 */ > + 0x0e00, /* preview, len 0x00a0 */ > + 0x1000, /* resizer, len 0x00ac */ > + 0x1200, /* sbl, len 0x00fc */ > + /* second MMIO area */ > + 0x0000, /* csi2a, len 0x0170 */ > + 0x0170, /* csiphy2, len 0x000c */ > + }, > .syscon_offset = 0xdc, > .phy_type = ISP_PHY_TYPE_3430, > }, > { > .isp_rev = ISP_REVISION_15_0, > - .map = 1 << OMAP3_ISP_IOMEM_MAIN | > - 1 << OMAP3_ISP_IOMEM_CCP2 | > - 1 << OMAP3_ISP_IOMEM_CCDC | > - 1 << OMAP3_ISP_IOMEM_HIST | > - 1 << OMAP3_ISP_IOMEM_H3A | > - 1 << OMAP3_ISP_IOMEM_PREV | > - 1 << OMAP3_ISP_IOMEM_RESZ | > - 1 << OMAP3_ISP_IOMEM_SBL | > - 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > - 1 << OMAP3_ISP_IOMEM_CSIPHY2 | > - 1 << OMAP3_ISP_IOMEM_CSI2A_REGS2 | > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS1 | > - 1 << OMAP3_ISP_IOMEM_CSIPHY1 | > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2, > + .offset = { > + /* first MMIO area */ > + 0x0000, /* base, len 0x0070 */ > + 0x0400, /* ccp2, len 0x01f0 */ > + 0x0600, /* ccdc, len 0x00a8 */ > + 0x0a00, /* hist, len 0x0048 */ > + 0x0c00, /* h3a, len 0x0060 */ > + 0x0e00, /* preview, len 0x00a0 */ > + 0x1000, /* resizer, len 0x00ac */ > + 0x1200, /* sbl, len 0x00fc */ > + /* second MMIO area */ > + 0x0000, /* csi2a, len 0x0170 (1st area) */ > + 0x0170, /* csiphy2, len 0x000c */ > + 0x01c0, /* csi2a, len 0x0040 (2nd area) */ > + 0x0400, /* csi2c, len 0x0170 (1st area) */ > + 0x0570, /* csiphy1, len 0x000c */ > + 0x05c0, /* csi2c, len 0x0040 (2nd area) */ > + }, > .syscon_offset = 0x2f0, > .phy_type = ISP_PHY_TYPE_3630, > }, > @@ -2235,27 +2243,6 @@ static int isp_remove(struct platform_device *pdev) > return 0; > } > > -static int isp_map_mem_resource(struct platform_device *pdev, > - struct isp_device *isp, > - enum isp_mem_resources res) > -{ > - struct resource *mem; > - > - /* request the mem region for the camera registers */ > - > - mem = platform_get_resource(pdev, IORESOURCE_MEM, res); > - > - /* map the region */ > - isp->mmio_base[res] = devm_ioremap_resource(isp->dev, mem); > - if (IS_ERR(isp->mmio_base[res])) > - return PTR_ERR(isp->mmio_base[res]); > - > - if (res == OMAP3_ISP_IOMEM_HIST) > - isp->mmio_hist_base_phys = mem->start; > - > - return 0; > -} > - > /* > * isp_probe - Probe ISP platform device > * @pdev: Pointer to ISP platform device > @@ -2271,6 +2258,7 @@ static int isp_probe(struct platform_device *pdev) > { > struct isp_platform_data *pdata = pdev->dev.platform_data; > struct isp_device *isp; > + struct resource *mem; > int ret; > int i, m; > > @@ -2303,10 +2291,21 @@ static int isp_probe(struct platform_device *pdev) > * > * The ISP clock tree is revision-dependent. We thus need to enable ICLK > * manually to read the revision before calling __omap3isp_get(). > + * > + * Start by mapping the ISP MMIO area, which is in two pieces. > + * The ISP IOMMU is in between. Map both now, and fill in the > + * ISP revision specific portions a little later in the > + * function. > */ > - ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN); > - if (ret < 0) > - goto error; > + for (i = 0; i < 2; i++) { > + unsigned int map_idx = i ? OMAP3_ISP_IOMEM_CSI2A_REGS1 : 0; > + > + mem = platform_get_resource(pdev, IORESOURCE_MEM, i); > + isp->mmio_base[map_idx] = > + devm_ioremap_resource(isp->dev, mem); > + if (IS_ERR(isp->mmio_base[map_idx])) > + return PTR_ERR(isp->mmio_base[map_idx]); > + } > > ret = isp_get_clocks(isp); > if (ret < 0) > @@ -2347,13 +2346,17 @@ static int isp_probe(struct platform_device *pdev) > goto error_isp; > } > > - for (i = 1; i < OMAP3_ISP_IOMEM_LAST; i++) { > - if (isp_res_maps[m].map & 1 << i) { > - ret = isp_map_mem_resource(pdev, isp, i); > - if (ret) > - goto error_isp; > - } > - } > + for (i = 1; i < OMAP3_ISP_IOMEM_CSI2A_REGS1; i++) > + isp->mmio_base[i] = > + isp->mmio_base[0] + isp_res_maps[m].offset[i]; > + > + for (i = OMAP3_ISP_IOMEM_CSIPHY2; i < OMAP3_ISP_IOMEM_LAST; i++) > + isp->mmio_base[i] = > + isp->mmio_base[OMAP3_ISP_IOMEM_CSI2A_REGS1] > + + isp_res_maps[m].offset[i]; > + > + isp->mmio_hist_base_phys = > + mem->start + isp_res_maps[m].offset[OMAP3_ISP_IOMEM_HIST]; > > isp->syscon = syscon_regmap_lookup_by_pdevname("syscon.0"); > isp->syscon_offset = isp_res_maps[m].syscon_offset; > diff --git a/drivers/media/platform/omap3isp/isp.h > b/drivers/media/platform/omap3isp/isp.h index 03d2129..dcb7d20 100644 > --- a/drivers/media/platform/omap3isp/isp.h > +++ b/drivers/media/platform/omap3isp/isp.h > @@ -99,7 +99,7 @@ struct regmap; > /* > * struct isp_res_mapping - Map ISP io resources to ISP revision. > * @isp_rev: ISP_REVISION_x_x > - * @map: bitmap for enum isp_mem_resources > + * @offset: register offsets of various ISP sub-blocks > * @syscon_offset: offset of the syscon register for 343x / 3630 > * (CONTROL_CSIRXFE / CONTROL_CAMERA_PHY_CTRL, respectively) > * from the syscon base address > @@ -107,7 +107,7 @@ struct regmap; > */ > struct isp_res_mapping { > u32 isp_rev; > - u32 map; > + u32 offset[OMAP3_ISP_IOMEM_LAST]; > u32 syscon_offset; > u32 phy_type; > }; -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC 11/18] omap3isp: Replace many MMIO regions by two 2015-03-07 23:43 ` [RFC 11/18] omap3isp: Replace many MMIO regions by two Laurent Pinchart @ 2015-03-09 15:22 ` Tony Lindgren 0 siblings, 0 replies; 6+ messages in thread From: Tony Lindgren @ 2015-03-09 15:22 UTC (permalink / raw) To: Laurent Pinchart Cc: Sakari Ailus, linux-media, devicetree, pali.rohar, linux-omap * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [150307 15:43]: > Hi Sakari, > > Thank you for the patch. > > (CC'ing linux-omap and Tony) > > On Saturday 07 March 2015 23:41:08 Sakari Ailus wrote: > > The omap3isp MMIO register block is contiguous in the MMIO register space > > apart from the fact that the ISP IOMMU register block is in the middle of > > the area. Ioremap it at two occasions, and keep the rest of the layout of > > the register space internal to the omap3isp driver. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> > > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > --- > > arch/arm/mach-omap2/devices.c | 66 +------------------ > > arch/arm/mach-omap2/omap34xx.h | 36 +---------- > > Once again you might be asked to split this. However, it would be pretty > painful, so it would be nice if we could merge everything through the Linux > media tree. You will need an ack from Tony. These changes look fine to me and should not conflict with anything I'm planning to queue, so please feel free to take them along with the other isp changes: Acked-by: Tony Lindgren <tony@atomide.com> > > drivers/media/platform/omap3isp/isp.c | 113 ++++++++++++++++-------------- > > drivers/media/platform/omap3isp/isp.h | 4 +- > > 4 files changed, 66 insertions(+), 153 deletions(-) > > > > diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c > > index e945957..990338f 100644 > > --- a/arch/arm/mach-omap2/devices.c > > +++ b/arch/arm/mach-omap2/devices.c > > @@ -74,72 +74,12 @@ omap_postcore_initcall(omap3_l3_init); > > static struct resource omap3isp_resources[] = { > > { > > .start = OMAP3430_ISP_BASE, > > - .end = OMAP3430_ISP_END, > > + .end = OMAP3430_ISP_BASE + 0x12fc, > > .flags = IORESOURCE_MEM, > > }, > > { > > - .start = OMAP3430_ISP_CCP2_BASE, > > - .end = OMAP3430_ISP_CCP2_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_CCDC_BASE, > > - .end = OMAP3430_ISP_CCDC_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_HIST_BASE, > > - .end = OMAP3430_ISP_HIST_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_H3A_BASE, > > - .end = OMAP3430_ISP_H3A_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_PREV_BASE, > > - .end = OMAP3430_ISP_PREV_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_RESZ_BASE, > > - .end = OMAP3430_ISP_RESZ_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_SBL_BASE, > > - .end = OMAP3430_ISP_SBL_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_CSI2A_REGS1_BASE, > > - .end = OMAP3430_ISP_CSI2A_REGS1_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3430_ISP_CSIPHY2_BASE, > > - .end = OMAP3430_ISP_CSIPHY2_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3630_ISP_CSI2A_REGS2_BASE, > > - .end = OMAP3630_ISP_CSI2A_REGS2_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3630_ISP_CSI2C_REGS1_BASE, > > - .end = OMAP3630_ISP_CSI2C_REGS1_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3630_ISP_CSIPHY1_BASE, > > - .end = OMAP3630_ISP_CSIPHY1_END, > > - .flags = IORESOURCE_MEM, > > - }, > > - { > > - .start = OMAP3630_ISP_CSI2C_REGS2_BASE, > > - .end = OMAP3630_ISP_CSI2C_REGS2_END, > > + .start = OMAP3430_ISP_BASE2, > > + .end = OMAP3430_ISP_BASE2 + 0x0600, > > .flags = IORESOURCE_MEM, > > }, > > { > > diff --git a/arch/arm/mach-omap2/omap34xx.h b/arch/arm/mach-omap2/omap34xx.h > > index c0d1b4b..ed0024d 100644 > > --- a/arch/arm/mach-omap2/omap34xx.h > > +++ b/arch/arm/mach-omap2/omap34xx.h > > @@ -46,39 +46,9 @@ > > > > #define OMAP34XX_IC_BASE 0x48200000 > > > > -#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000) > > -#define OMAP3430_ISP_CBUFF_BASE (OMAP3430_ISP_BASE + 0x0100) > > -#define OMAP3430_ISP_CCP2_BASE (OMAP3430_ISP_BASE + 0x0400) > > -#define OMAP3430_ISP_CCDC_BASE (OMAP3430_ISP_BASE + 0x0600) > > -#define OMAP3430_ISP_HIST_BASE (OMAP3430_ISP_BASE + 0x0A00) > > -#define OMAP3430_ISP_H3A_BASE (OMAP3430_ISP_BASE + 0x0C00) > > -#define OMAP3430_ISP_PREV_BASE (OMAP3430_ISP_BASE + 0x0E00) > > -#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000) > > -#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200) > > -#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400) > > -#define OMAP3430_ISP_CSI2A_REGS1_BASE (OMAP3430_ISP_BASE + 0x1800) > > -#define OMAP3430_ISP_CSIPHY2_BASE (OMAP3430_ISP_BASE + 0x1970) > > -#define OMAP3630_ISP_CSI2A_REGS2_BASE (OMAP3430_ISP_BASE + 0x19C0) > > -#define OMAP3630_ISP_CSI2C_REGS1_BASE (OMAP3430_ISP_BASE + 0x1C00) > > -#define OMAP3630_ISP_CSIPHY1_BASE (OMAP3430_ISP_BASE + 0x1D70) > > -#define OMAP3630_ISP_CSI2C_REGS2_BASE (OMAP3430_ISP_BASE + 0x1DC0) > > - > > -#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F) > > -#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077) > > -#define OMAP3430_ISP_CCP2_END (OMAP3430_ISP_CCP2_BASE + 0x1EF) > > -#define OMAP3430_ISP_CCDC_END (OMAP3430_ISP_CCDC_BASE + 0x0A7) > > -#define OMAP3430_ISP_HIST_END (OMAP3430_ISP_HIST_BASE + 0x047) > > -#define OMAP3430_ISP_H3A_END (OMAP3430_ISP_H3A_BASE + 0x05F) > > -#define OMAP3430_ISP_PREV_END (OMAP3430_ISP_PREV_BASE + 0x09F) > > -#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB) > > -#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB) > > -#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F) > > -#define OMAP3430_ISP_CSI2A_REGS1_END (OMAP3430_ISP_CSI2A_REGS1_BASE + > > 0x16F) -#define OMAP3430_ISP_CSIPHY2_END (OMAP3430_ISP_CSIPHY2_BASE + > > 0x00B) -#define OMAP3630_ISP_CSI2A_REGS2_END > (OMAP3630_ISP_CSI2A_REGS2_BASE > > + 0x3F) -#define > > OMAP3630_ISP_CSI2C_REGS1_END (OMAP3630_ISP_CSI2C_REGS1_BASE + 0x16F) > > -#define OMAP3630_ISP_CSIPHY1_END (OMAP3630_ISP_CSIPHY1_BASE + 0x00B) > > -#define OMAP3630_ISP_CSI2C_REGS2_END (OMAP3630_ISP_CSI2C_REGS2_BASE + > > 0x3F) +#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000) > > +#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400) > > +#define OMAP3430_ISP_BASE2 (OMAP3430_ISP_BASE + 0x1800) > > > > #define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) > > #define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) > > diff --git a/drivers/media/platform/omap3isp/isp.c > > b/drivers/media/platform/omap3isp/isp.c index 4ff4bbd..7804895 100644 > > --- a/drivers/media/platform/omap3isp/isp.c > > +++ b/drivers/media/platform/omap3isp/isp.c > > @@ -86,35 +86,43 @@ static void isp_restore_ctx(struct isp_device *isp); > > static const struct isp_res_mapping isp_res_maps[] = { > > { > > .isp_rev = ISP_REVISION_2_0, > > - .map = 1 << OMAP3_ISP_IOMEM_MAIN | > > - 1 << OMAP3_ISP_IOMEM_CCP2 | > > - 1 << OMAP3_ISP_IOMEM_CCDC | > > - 1 << OMAP3_ISP_IOMEM_HIST | > > - 1 << OMAP3_ISP_IOMEM_H3A | > > - 1 << OMAP3_ISP_IOMEM_PREV | > > - 1 << OMAP3_ISP_IOMEM_RESZ | > > - 1 << OMAP3_ISP_IOMEM_SBL | > > - 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > > - 1 << OMAP3_ISP_IOMEM_CSIPHY2, > > + .offset = { > > + /* first MMIO area */ > > + 0x0000, /* base, len 0x0070 */ > > + 0x0400, /* ccp2, len 0x01f0 */ > > + 0x0600, /* ccdc, len 0x00a8 */ > > + 0x0a00, /* hist, len 0x0048 */ > > + 0x0c00, /* h3a, len 0x0060 */ > > + 0x0e00, /* preview, len 0x00a0 */ > > + 0x1000, /* resizer, len 0x00ac */ > > + 0x1200, /* sbl, len 0x00fc */ > > + /* second MMIO area */ > > + 0x0000, /* csi2a, len 0x0170 */ > > + 0x0170, /* csiphy2, len 0x000c */ > > + }, > > .syscon_offset = 0xdc, > > .phy_type = ISP_PHY_TYPE_3430, > > }, > > { > > .isp_rev = ISP_REVISION_15_0, > > - .map = 1 << OMAP3_ISP_IOMEM_MAIN | > > - 1 << OMAP3_ISP_IOMEM_CCP2 | > > - 1 << OMAP3_ISP_IOMEM_CCDC | > > - 1 << OMAP3_ISP_IOMEM_HIST | > > - 1 << OMAP3_ISP_IOMEM_H3A | > > - 1 << OMAP3_ISP_IOMEM_PREV | > > - 1 << OMAP3_ISP_IOMEM_RESZ | > > - 1 << OMAP3_ISP_IOMEM_SBL | > > - 1 << OMAP3_ISP_IOMEM_CSI2A_REGS1 | > > - 1 << OMAP3_ISP_IOMEM_CSIPHY2 | > > - 1 << OMAP3_ISP_IOMEM_CSI2A_REGS2 | > > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS1 | > > - 1 << OMAP3_ISP_IOMEM_CSIPHY1 | > > - 1 << OMAP3_ISP_IOMEM_CSI2C_REGS2, > > + .offset = { > > + /* first MMIO area */ > > + 0x0000, /* base, len 0x0070 */ > > + 0x0400, /* ccp2, len 0x01f0 */ > > + 0x0600, /* ccdc, len 0x00a8 */ > > + 0x0a00, /* hist, len 0x0048 */ > > + 0x0c00, /* h3a, len 0x0060 */ > > + 0x0e00, /* preview, len 0x00a0 */ > > + 0x1000, /* resizer, len 0x00ac */ > > + 0x1200, /* sbl, len 0x00fc */ > > + /* second MMIO area */ > > + 0x0000, /* csi2a, len 0x0170 (1st area) */ > > + 0x0170, /* csiphy2, len 0x000c */ > > + 0x01c0, /* csi2a, len 0x0040 (2nd area) */ > > + 0x0400, /* csi2c, len 0x0170 (1st area) */ > > + 0x0570, /* csiphy1, len 0x000c */ > > + 0x05c0, /* csi2c, len 0x0040 (2nd area) */ > > + }, > > .syscon_offset = 0x2f0, > > .phy_type = ISP_PHY_TYPE_3630, > > }, > > @@ -2235,27 +2243,6 @@ static int isp_remove(struct platform_device *pdev) > > return 0; > > } > > > > -static int isp_map_mem_resource(struct platform_device *pdev, > > - struct isp_device *isp, > > - enum isp_mem_resources res) > > -{ > > - struct resource *mem; > > - > > - /* request the mem region for the camera registers */ > > - > > - mem = platform_get_resource(pdev, IORESOURCE_MEM, res); > > - > > - /* map the region */ > > - isp->mmio_base[res] = devm_ioremap_resource(isp->dev, mem); > > - if (IS_ERR(isp->mmio_base[res])) > > - return PTR_ERR(isp->mmio_base[res]); > > - > > - if (res == OMAP3_ISP_IOMEM_HIST) > > - isp->mmio_hist_base_phys = mem->start; > > - > > - return 0; > > -} > > - > > /* > > * isp_probe - Probe ISP platform device > > * @pdev: Pointer to ISP platform device > > @@ -2271,6 +2258,7 @@ static int isp_probe(struct platform_device *pdev) > > { > > struct isp_platform_data *pdata = pdev->dev.platform_data; > > struct isp_device *isp; > > + struct resource *mem; > > int ret; > > int i, m; > > > > @@ -2303,10 +2291,21 @@ static int isp_probe(struct platform_device *pdev) > > * > > * The ISP clock tree is revision-dependent. We thus need to enable ICLK > > * manually to read the revision before calling __omap3isp_get(). > > + * > > + * Start by mapping the ISP MMIO area, which is in two pieces. > > + * The ISP IOMMU is in between. Map both now, and fill in the > > + * ISP revision specific portions a little later in the > > + * function. > > */ > > - ret = isp_map_mem_resource(pdev, isp, OMAP3_ISP_IOMEM_MAIN); > > - if (ret < 0) > > - goto error; > > + for (i = 0; i < 2; i++) { > > + unsigned int map_idx = i ? OMAP3_ISP_IOMEM_CSI2A_REGS1 : 0; > > + > > + mem = platform_get_resource(pdev, IORESOURCE_MEM, i); > > + isp->mmio_base[map_idx] = > > + devm_ioremap_resource(isp->dev, mem); > > + if (IS_ERR(isp->mmio_base[map_idx])) > > + return PTR_ERR(isp->mmio_base[map_idx]); > > + } > > > > ret = isp_get_clocks(isp); > > if (ret < 0) > > @@ -2347,13 +2346,17 @@ static int isp_probe(struct platform_device *pdev) > > goto error_isp; > > } > > > > - for (i = 1; i < OMAP3_ISP_IOMEM_LAST; i++) { > > - if (isp_res_maps[m].map & 1 << i) { > > - ret = isp_map_mem_resource(pdev, isp, i); > > - if (ret) > > - goto error_isp; > > - } > > - } > > + for (i = 1; i < OMAP3_ISP_IOMEM_CSI2A_REGS1; i++) > > + isp->mmio_base[i] = > > + isp->mmio_base[0] + isp_res_maps[m].offset[i]; > > + > > + for (i = OMAP3_ISP_IOMEM_CSIPHY2; i < OMAP3_ISP_IOMEM_LAST; i++) > > + isp->mmio_base[i] = > > + isp->mmio_base[OMAP3_ISP_IOMEM_CSI2A_REGS1] > > + + isp_res_maps[m].offset[i]; > > + > > + isp->mmio_hist_base_phys = > > + mem->start + isp_res_maps[m].offset[OMAP3_ISP_IOMEM_HIST]; > > > > isp->syscon = syscon_regmap_lookup_by_pdevname("syscon.0"); > > isp->syscon_offset = isp_res_maps[m].syscon_offset; > > diff --git a/drivers/media/platform/omap3isp/isp.h > > b/drivers/media/platform/omap3isp/isp.h index 03d2129..dcb7d20 100644 > > --- a/drivers/media/platform/omap3isp/isp.h > > +++ b/drivers/media/platform/omap3isp/isp.h > > @@ -99,7 +99,7 @@ struct regmap; > > /* > > * struct isp_res_mapping - Map ISP io resources to ISP revision. > > * @isp_rev: ISP_REVISION_x_x > > - * @map: bitmap for enum isp_mem_resources > > + * @offset: register offsets of various ISP sub-blocks > > * @syscon_offset: offset of the syscon register for 343x / 3630 > > * (CONTROL_CSIRXFE / CONTROL_CAMERA_PHY_CTRL, respectively) > > * from the syscon base address > > @@ -107,7 +107,7 @@ struct regmap; > > */ > > struct isp_res_mapping { > > u32 isp_rev; > > - u32 map; > > + u32 offset[OMAP3_ISP_IOMEM_LAST]; > > u32 syscon_offset; > > u32 phy_type; > > }; > > -- > Regards, > > Laurent Pinchart > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-14 15:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1425764475-27691-1-git-send-email-sakari.ailus@iki.fi>
[not found] ` <1425764475-27691-11-git-send-email-sakari.ailus@iki.fi>
2015-03-07 23:34 ` [RFC 10/18] omap3isp: Move the syscon register out of the ISP register maps Laurent Pinchart
2015-03-07 23:43 ` Sakari Ailus
2015-03-09 15:20 ` Tony Lindgren
2015-03-14 15:00 ` Sakari Ailus
[not found] ` <1425764475-27691-12-git-send-email-sakari.ailus@iki.fi>
2015-03-07 23:43 ` [RFC 11/18] omap3isp: Replace many MMIO regions by two Laurent Pinchart
2015-03-09 15:22 ` Tony Lindgren
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).