From: Michal Simek <hidden> Date: 2013-06-03 10:13:28
Hi,
I have done more changes in the driver to support probing
on little and big endian system where detection is done
directly on the hardware.
I have also done some cleanups to get it to the better shape.
Thanks for your review,
Michal
Changes in v4:
- Acked by Arnd
- Remove "video: xilinxfb: Fix sparse warnings"
patch because it is trying to fix incorrect API
usage and sparse should warn about it.
Changes in v3:
- fix commit message
- Remove out_be IO name from function name
- Change patch subject from "Do not use out_be32 IO function"
to "Do not name out_be32 in function name"
- New patch in this patchset based on discussions
- New patch in this patchset based on discussions
- New patch in this patchset
- New patch in this patchset based on discussions
Changes in v2:
- use of_property_read_u32 helper function
Michal Simek (7):
video: xilinxfb: Fix OF probing on little-endian systems
video: xilinxfb: Do not name out_be32 in function name
video: xilinxfb: Rename PLB_ACCESS_FLAG to BUS_ACCESS_FLAG
video: xilinxfb: Use drvdata->regs_phys instead of physaddr
video: xilinxfb: Group bus initialization
video: xilinxfb: Add support for little endian accesses
video: xilinxfb: Use driver for Xilinx ARM Zynq
drivers/video/Kconfig | 2 +-
drivers/video/xilinxfb.c | 135 +++++++++++++++++++++++------------------------
2 files changed, 68 insertions(+), 69 deletions(-)
--
1.8.2.3
From: Michal Simek <hidden> Date: 2013-06-03 10:13:35
From: Michal Simek <monstr@monstr.eu>
DTB is always big-endian that's why it is necessary
to properly convert value (*p).
It is automatically done in of_property_read_u32().
Signed-off-by: Michal Simek <redacted>
---
Changes in v4: None
Changes in v3:
- fix commit message
Changes in v2:
- use of_property_read_u32 helper function
drivers/video/xilinxfb.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
From: Michal Simek <hidden> Date: 2013-06-03 10:13:41
Using only PLB name is wrong for a long time because
the same access functions are also used for AXI.
s/PLB/BUS/g
Signed-off-by: Michal Simek <redacted>
---
Changes in v4: None
Changes in v3:
- New patch in this patchset based on discussions
Changes in v2: None
drivers/video/xilinxfb.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
@@ -235,10 +235,10 @@ static int xilinxfb_assign(struct device *dev,intrc;intfbsize=pdata->xvirt*pdata->yvirt*BYTES_PER_PIXEL;-if(drvdata->flags&PLB_ACCESS_FLAG){+if(drvdata->flags&BUS_ACCESS_FLAG){/**Mapthecontrolregistersinifthecontroller-*isondirectPLBinterface.+*isondirectBUSinterface.*/if(!request_mem_region(physaddr,8,DRIVER_NAME)){dev_err(dev,"Couldn't lock memory region at 0x%08lX\n",
@@ -270,7 +270,7 @@ static int xilinxfb_assign(struct device *dev,if(!drvdata->fb_virt){dev_err(dev,"Could not allocate frame buffer memory\n");rc=-ENOMEM;-if(drvdata->flags&PLB_ACCESS_FLAG)+if(drvdata->flags&BUS_ACCESS_FLAG)gotoerr_fbmem;elsegotoerr_region;
@@ -323,7 +323,7 @@ static int xilinxfb_assign(struct device *dev,gotoerr_regfb;}-if(drvdata->flags&PLB_ACCESS_FLAG){+if(drvdata->flags&BUS_ACCESS_FLAG){/* Put a banner in the log (for DEBUG) */dev_dbg(dev,"regs: phys=%lx, virt=%p\n",physaddr,drvdata->regs);
@@ -384,7 +384,7 @@ static int xilinxfb_release(struct device *dev)xilinx_fb_out32(drvdata,REG_CTRL,0);/* Release the resources, as allocated based on interface */-if(drvdata->flags&PLB_ACCESS_FLAG){+if(drvdata->flags&BUS_ACCESS_FLAG){iounmap(drvdata->regs);release_mem_region(drvdata->regs_phys,8);}
@@ -423,18 +423,18 @@ static int xilinxfb_of_probe(struct platform_device *op)}/*-*TocheckwhetherthecoreisconnecteddirectlytoDCRorPLB+*TocheckwhetherthecoreisconnecteddirectlytoDCRorBUS*interfaceandinitializethetft_accessaccordingly.*/of_property_read_u32(op->dev.of_node,"xlnx,dcr-splb-slave-if",&tft_access);/*-*FilltheresourcestructureifitsdirectPLBinterface+*FilltheresourcestructureifitsdirectBUSinterface*otherwisefillthedcr_hoststructure.*/if(tft_access){-drvdata->flags|=PLB_ACCESS_FLAG;+drvdata->flags|=BUS_ACCESS_FLAG;rc=of_address_to_resource(op->dev.of_node,0,&res);if(rc){dev_err(&op->dev,"invalid address\n");--
From: Michal Simek <hidden> Date: 2013-06-03 10:13:45
physaddr will be remove in the next patch.
Signed-off-by: Michal Simek <redacted>
---
Changes in v4: None
Changes in v3:
- New patch in this patchset based on discussions
Changes in v2: None
drivers/video/xilinxfb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -325,7 +325,7 @@ static int xilinxfb_assign(struct device *dev,if(drvdata->flags&BUS_ACCESS_FLAG){/* Put a banner in the log (for DEBUG) */-dev_dbg(dev,"regs: phys=%lx, virt=%p\n",physaddr,+dev_dbg(dev,"regs: phys=%x, virt=%p\n",drvdata->regs_phys,drvdata->regs);}/* Put a banner in the log (for DEBUG) */
From: Michal Simek <hidden> Date: 2013-06-03 10:13:50
Move of_address_to_resource() to xilinxfb_assign()
which simplify driver probing.
Signed-off-by: Michal Simek <redacted>
---
Changes in v4: None
Changes in v3:
- New patch in this patchset
Changes in v2: None
drivers/video/xilinxfb.c | 56 +++++++++++++-----------------------------------
1 file changed, 15 insertions(+), 41 deletions(-)
@@ -227,33 +227,23 @@ static struct fb_ops xilinxfb_ops =*Busindependentsetup/teardown*/-staticintxilinxfb_assign(structdevice*dev,+staticintxilinxfb_assign(structplatform_device*pdev,structxilinxfb_drvdata*drvdata,-unsignedlongphysaddr,structxilinxfb_platform_data*pdata){intrc;+structdevice*dev=&pdev->dev;intfbsize=pdata->xvirt*pdata->yvirt*BYTES_PER_PIXEL;if(drvdata->flags&BUS_ACCESS_FLAG){-/*-*Mapthecontrolregistersinifthecontroller-*isondirectBUSinterface.-*/-if(!request_mem_region(physaddr,8,DRIVER_NAME)){-dev_err(dev,"Couldn't lock memory region at 0x%08lX\n",-physaddr);-rc=-ENODEV;-gotoerr_region;-}+structresource*res;-drvdata->regs_phys=physaddr;-drvdata->regs=ioremap(physaddr,8);+res=platform_get_resource(pdev,IORESOURCE_MEM,0);+drvdata->regs_phys=res->start;+drvdata->regs=devm_request_and_ioremap(&pdev->dev,res);if(!drvdata->regs){-dev_err(dev,"Couldn't lock memory region at 0x%08lX\n",-physaddr);-rc=-ENODEV;-gotoerr_map;+rc=-EADDRNOTAVAIL;+gotoerr_region;}}
@@ -384,10 +370,8 @@ static int xilinxfb_release(struct device *dev)xilinx_fb_out32(drvdata,REG_CTRL,0);/* Release the resources, as allocated based on interface */-if(drvdata->flags&BUS_ACCESS_FLAG){-iounmap(drvdata->regs);-release_mem_region(drvdata->regs_phys,8);-}+if(drvdata->flags&BUS_ACCESS_FLAG)+devm_iounmap(dev,drvdata->regs);#ifdef CONFIG_PPC_DCRelsedcr_unmap(drvdata->dcr_host,drvdata->dcr_len);
@@ -408,8 +392,7 @@ static int xilinxfb_of_probe(struct platform_device *op)constu32*prop;u32tft_access=0;structxilinxfb_platform_datapdata;-structresourceres;-intsize,rc;+intsize;structxilinxfb_drvdata*drvdata;/* Copy with the default pdata (not a ptr reference!) */
From: Michal Simek <hidden> Date: 2013-06-03 10:14:04
From: Michal Simek <monstr@monstr.eu>
Enable this driver for all Xilinx platforms.
Signed-off-by: Michal Simek <redacted>
---
Changes in v4:
- Remove "video: xilinxfb: Fix sparse warnings"
patch because it is trying to fix incorrect API
usage and sparse should warn about it.
Changes in v3: None
Changes in v2: None
drivers/video/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Michal Simek <hidden> Date: 2013-06-03 10:14:06
Dynamically detect endianess on IP and use
ioread/iowrite functions instead of powerpc and microblaze
specific out_be32.
Signed-off-by: Michal Simek <redacted>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
Changes in v4:
- Acked by Arnd
Changes in v3:
- New patch in this patchset based on discussions
Changes in v2: None
drivers/video/xilinxfb.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
@@ -271,6 +291,12 @@ static int xilinxfb_assign(struct platform_device *pdev,/* Tell the hardware where the frame buffer is */xilinx_fb_out32(drvdata,REG_FB_ADDR,drvdata->fb_phys);+rc=xilinx_fb_in32(drvdata,REG_FB_ADDR);+/* Endianess detection */+if(rc!=drvdata->fb_phys){+drvdata->flags|=LITTLE_ENDIAN_ACCESS;+xilinx_fb_out32(drvdata,REG_FB_ADDR,drvdata->fb_phys);+}/* Turn on the display */drvdata->reg_ctrl_default=REG_CTRL_ENABLE;--
From: Michal Simek <hidden> Date: 2013-06-03 10:15:27
out_be32 IO function is not supported by ARM.
It is only available for PPC and Microblaze.
Because this driver can be used on ARM let's
remove out_be32 from function name.
Signed-off-by: Michal Simek <redacted>
---
Changes in v4: None
Changes in v3:
- Remove out_be IO name from function name
- Change patch subject from "Do not use out_be32 IO function"
to "Do not name out_be32 in function name"
Changes in v2: None
drivers/video/xilinxfb.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
@@ -280,13 +280,13 @@ static int xilinxfb_assign(struct device *dev,memset_io((void__iomem*)drvdata->fb_virt,0,fbsize);/* Tell the hardware where the frame buffer is */-xilinx_fb_out_be32(drvdata,REG_FB_ADDR,drvdata->fb_phys);+xilinx_fb_out32(drvdata,REG_FB_ADDR,drvdata->fb_phys);/* Turn on the display */drvdata->reg_ctrl_default=REG_CTRL_ENABLE;if(pdata->rotate_screen)drvdata->reg_ctrl_default|=REG_CTRL_ROTATE;-xilinx_fb_out_be32(drvdata,REG_CTRL,+xilinx_fb_out32(drvdata,REG_CTRL,drvdata->reg_ctrl_default);/* Fill struct fb_info */
@@ -345,7 +345,7 @@ err_cmap:iounmap(drvdata->fb_virt);/* Turn off the display */-xilinx_fb_out_be32(drvdata,REG_CTRL,0);+xilinx_fb_out32(drvdata,REG_CTRL,0);err_fbmem:if(drvdata->flags&PLB_ACCESS_FLAG)
@@ -381,7 +381,7 @@ static int xilinxfb_release(struct device *dev)iounmap(drvdata->fb_virt);/* Turn off the display */-xilinx_fb_out_be32(drvdata,REG_CTRL,0);+xilinx_fb_out32(drvdata,REG_CTRL,0);/* Release the resources, as allocated based on interface */if(drvdata->flags&PLB_ACCESS_FLAG){--
Arnd can you take look on it again please
I'll take a look on it next week
Best Regards,
J.
I have done more changes in the driver to support probing
on little and big endian system where detection is done
directly on the hardware.
I have also done some cleanups to get it to the better shape.
Thanks for your review,
Michal
Changes in v4:
- Acked by Arnd
- Remove "video: xilinxfb: Fix sparse warnings"
patch because it is trying to fix incorrect API
usage and sparse should warn about it.
Changes in v3:
- fix commit message
- Remove out_be IO name from function name
- Change patch subject from "Do not use out_be32 IO function"
to "Do not name out_be32 in function name"
- New patch in this patchset based on discussions
- New patch in this patchset based on discussions
- New patch in this patchset
- New patch in this patchset based on discussions
Changes in v2:
- use of_property_read_u32 helper function
Michal Simek (7):
video: xilinxfb: Fix OF probing on little-endian systems
video: xilinxfb: Do not name out_be32 in function name
video: xilinxfb: Rename PLB_ACCESS_FLAG to BUS_ACCESS_FLAG
video: xilinxfb: Use drvdata->regs_phys instead of physaddr
video: xilinxfb: Group bus initialization
video: xilinxfb: Add support for little endian accesses
video: xilinxfb: Use driver for Xilinx ARM Zynq
drivers/video/Kconfig | 2 +-
drivers/video/xilinxfb.c | 135 +++++++++++++++++++++++------------------------
2 files changed, 68 insertions(+), 69 deletions(-)
--
1.8.2.3
From: Michal Simek <monstr@monstr.eu> Date: 2013-06-17 05:24:05
On 06/06/2013 06:23 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
On 12:13 Mon 03 Jun , Michal Simek wrote:
quoted
Hi,
Arnd can you take look on it again please
I'll take a look on it next week
Any update on this?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
From: Michal Simek <monstr@monstr.eu> Date: 2013-06-17 09:02:16
On 06/17/2013 10:56 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
On 07:23 Mon 17 Jun , Michal Simek wrote:
quoted
On 06/06/2013 06:23 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 12:13 Mon 03 Jun , Michal Simek wrote:
quoted
Hi,
Arnd can you take look on it again please
I'll take a look on it next week
Any update on this?
look ok but I want the Ack from Arnd
ok.
Arnd?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
On 06/06/2013 06:23 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 12:13 Mon 03 Jun , Michal Simek wrote:
quoted
Hi,
Arnd can you take look on it again please
I'll take a look on it next week
Any update on this?
look ok but I want the Ack from Arnd
Best Regards,
J.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
From: Michal Simek <monstr@monstr.eu> Date: 2013-06-26 10:02:25
On 06/17/2013 11:07 PM, Arnd Bergmann wrote:
On Monday 17 June 2013, Michal Simek wrote:
quoted
On 06/17/2013 10:56 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 07:23 Mon 17 Jun , Michal Simek wrote:
quoted
On 06/06/2013 06:23 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 12:13 Mon 03 Jun , Michal Simek wrote:
quoted
Hi,
Arnd can you take look on it again please
I'll take a look on it next week
Any update on this?
look ok but I want the Ack from Arnd
Sorry for the delay, everything looks good to me.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Jean-Christophe: Will you apply this series?
Or should I take it through my microblaze tree?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
From: Michal Simek <monstr@monstr.eu> Date: 2013-06-26 12:51:45
On 06/26/2013 01:41 PM, Tomi Valkeinen wrote:
Hi,
On 26/06/13 13:02, Michal Simek wrote:
quoted
On 06/17/2013 11:07 PM, Arnd Bergmann wrote:
quoted
On Monday 17 June 2013, Michal Simek wrote:
quoted
On 06/17/2013 10:56 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 07:23 Mon 17 Jun , Michal Simek wrote:
quoted
On 06/06/2013 06:23 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
On 12:13 Mon 03 Jun , Michal Simek wrote:
quoted
Hi,
Arnd can you take look on it again please
I'll take a look on it next week
Any update on this?
look ok but I want the Ack from Arnd
Sorry for the delay, everything looks good to me.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Jean-Christophe: Will you apply this series?
Or should I take it through my microblaze tree?
I've added this to my fbdev-3.11 branch.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform