Adding FPGA Manager support for Xilinx Zynq
Subsystems (3)
v2 cover Adding FPGA Manager support for Xilinx Zynq
Hi all,
I've tried to address most of the feedback that was brought up, the one thing I haven't looked at was the firmware format part, since that was still in discussion.
So I'm still open to suggestions on how to handle this.
In the interest of moving forward, and early feedback I decided to submit another rev without the firmware format part addressed.
Thanks to all the reviewers of the first round, can we maybe get ACKs for the docs and devicetree changes?
Cheers,
Moritz
Moritz Fischer (3):
ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager.
ARM: zynq: dt: Updated devicetree for Zynq 7000 platform. fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
.../bindings/fpga/xilinx-zynq-fpga-mgr.txt | 19 + arch/arm/boot/dts/zynq-7000.dtsi | 5 + drivers/fpga/Kconfig | 5 + drivers/fpga/Makefile | 1 + drivers/fpga/zynq-fpga.c | 533 +++++++++++++++++++++ 5 files changed, 563 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt create mode 100644 drivers/fpga/zynq-fpga.c
Signature · 1 line
2.4.3
PATCH v2 1/3 ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager.
---
v2:
- Clock names are now a required property
- Removed interrupt-parent property
--- .../devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt new file +19 -0
@@ -0,0 +1,19 @@ +Xilinx Zynq FPGA Manager + +Required properties: +- compatible: should contain "xlnx,zynq-devcfg-1.0" +- reg: base address and size for memory mapped io +- interrupts: interrupt for the FPGA manager device +- clocks: phandle for clocks required operation +- clock-names: name for the clock, should be "ref_clk" +- syscon: phandle for access to SLCR registers + +Example: + devcfg: devcfg at f8007000 { + compatible = "xlnx,zynq-devcfg-1.0"; + reg = <0xf8007000 0x100>; + interrupts = <0 8 4>; + clocks = <&clkc 12>; + clock-names = "ref_clk"; + syscon = <&slcr>; + };
Signature · 1 line
2.4.3
Re: [PATCHv2 1/3] ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager.
Quoted 18 lines · Moritz Fischer
Signed-off-by Moritz Fischer <[email protected]>---
v2:
- Clock names are now a required property
- Removed interrupt-parent property--- .../devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txtDocumentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt new file +0
-0
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt line 7
Quoted 7 lines
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt new file +7
-0@@ -0,0 +1,19 @@ +Xilinx Zynq FPGA Manager + +Required properties: +- compatible: should contain "xlnx,zynq-devcfg-1.0" +- reg: base address and size for memory mapped io +- interrupts: interrupt for the FPGA manager device +- clocks: phandle for clocks required operation
Technically a "clock specifier", but other than that:
Josh
Sören Brinkmann
Reviewed-byRe: [PATCHv2 1/3] ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager.
Quoted 13 lines · Josh Cartwright
Quoted 12 lines · Moritz Fischer
Signed-off-by Moritz Fischer <[email protected]>---
v2:
- Clock names are now a required property
- Removed interrupt-parent property--- .../devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt
Quoted 12 lines
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt line 6
Quoted 12 lines
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt new file +6
-0@@ -0,0 +1,19 @@ +Xilinx Zynq FPGA Manager + +Required properties: +- compatible: should contain "xlnx,zynq-devcfg-1.0" +- reg: base address and size for memory mapped io +- interrupts: interrupt for the FPGA manager device
If we are that picky, this is technically an interrupt specifier :)
Quoted 5 lines
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt line 7
Quoted 1 line
Documentation/devicetree/bindings/fpga/xilinx-zynq-fpga-mgr.txt new file +1
-0+- clocks: phandle for clocks required operationTechnically a "clock specifier", but other than that:
Reviewed-by Josh Cartwright <[email protected]>
S?ren
PATCH v2 2/3 ARM: zynq: dt: Updated devicetree for Zynq 7000 platform.
In reply to Moritz FischerAdded addtional nodes required for FPGA Manager operation of the Xilinx Zynq Devc configuration interface.
---
v2: No changes
--- arch/arm/boot/dts/zynq-7000.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/zynq-7000.dtsi +5 -0
@@ -294,6 +294,11 @@ devcfg: devcfg at f8007000 { compatible = "xlnx,zynq-devcfg-1.0"; reg = <0xf8007000 0x100>; + interrupt-parent = <&intc>; + interrupts = <0 8 4>; + clocks = <&clkc 12>; + clock-names = "ref_clk"; + syscon = <&slcr>; }; global_timer: timer at f8f00200 {
Signature · 1 line
2.4.3
Re: [PATCHv2 2/3] ARM: zynq: dt: Updated devicetree for Zynq 7000 platform.
Quoted 18 lines · Moritz Fischer
Added addtional nodes required for FPGA Manager operation of the Xilinx Zynq Devc configuration interface.
Reviewed-by S?ren Brinkmann <[email protected]>Signed-off-by Moritz Fischer <[email protected]>---
v2: No changes
--- arch/arm/boot/dts/zynq-7000.dtsi | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/boot/dts/zynq-7000.dtsi +0
-0
arch/arm/boot/dts/zynq-7000.dtsi line 297
Quoted 4 lines
arch/arm/boot/dts/zynq-7000.dtsi +1
-0@@ -294,6 +294,11 @@ devcfg: devcfg at f8007000 { compatible = "xlnx,zynq-devcfg-1.0"; reg = <0xf8007000 0x100>; + interrupt-parent = <&intc>;
You shouldn't need interrupt-parent here. In fact, I suspect it can be removed from all sibling nodes as well.
Josh
Re: [PATCHv2 2/3] ARM: zynq: dt: Updated devicetree for Zynq 7000 platform.
Quoted 14 lines · Josh Cartwright
Quoted 13 lines · Moritz Fischer
Added addtional nodes required for FPGA Manager operation of the Xilinx Zynq Devc configuration interface.
Reviewed-by S?ren Brinkmann <[email protected]>Signed-off-by Moritz Fischer <[email protected]>---
v2: No changes
--- arch/arm/boot/dts/zynq-7000.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
Quoted 12 lines
arch/arm/boot/dts/zynq-7000.dtsi line 297
Quoted 9 lines
arch/arm/boot/dts/zynq-7000.dtsi +1
-0@@ -294,6 +294,11 @@ devcfg: devcfg at f8007000 { compatible = "xlnx,zynq-devcfg-1.0"; reg = <0xf8007000 0x100>; + interrupt-parent = <&intc>;You shouldn't need interrupt-parent here. In fact, I suspect it can be removed from all sibling nodes as well.
Correct. But I tend to do it vice-versa. To remove it from amba node and keep it in every IP here. The reason is simple to let everybody know that setting up right interrupt controller is something what they have to care. If you have more interrupt controllers in the system it can be messy.
But again. Please remove this patch from this series. This will go to mainline through arm-soc but 1/3 and 3/3 will go through Greg. That's why please do not include it here.
Thanks,
Michal
Re: [PATCHv2 2/3] ARM: zynq: dt: Updated devicetree for Zynq 7000 platform.
Quoted 2 lines · Michal Simek
Quoted 1 line · Josh Cartwright
On Fri, Oct 16, 2015 at 03:42:29PM -0700, Moritz Fischer wrote:
[..]
Quoted 9 lines
Quoted 8 lines
arch/arm/boot/dts/zynq-7000.dtsi line 297
Quoted 5 lines
arch/arm/boot/dts/zynq-7000.dtsi +1
-0@@ -294,6 +294,11 @@ devcfg: devcfg at f8007000 { compatible = "xlnx,zynq-devcfg-1.0"; reg = <0xf8007000 0x100>; + interrupt-parent = <&intc>;You shouldn't need interrupt-parent here. In fact, I suspect it can be removed from all sibling nodes as well.
Quoted 5 lines
Correct. But I tend to do it vice-versa. To remove it from amba node and keep it in every IP here. The reason is simple to let everybody know that setting up right interrupt controller is something what they have to care. If you have more interrupt controllers in the system it can be messy.
If you like that, then you'd like the interrupt-extended properly even better (I think).
Quoted 3 lines
But again. Please remove this patch from this series. This will go to mainline through arm-soc but 1/3 and 3/3 will go through Greg. That's why please do not include it here.
Not all of the patches in a series need to go through the same maintainer...splitting them up is common. It's nice seeing related things out on the list together. (Especially when there is a dependency at some level).
Josh
Re: [PATCHv2 2/3] ARM: zynq: dt: Updated devicetree for Zynq 7000 platform.
Quoted 13 lines · Josh Cartwright
Quoted 2 lines · Michal Simek
Quoted 1 line · Josh Cartwright
On Fri, Oct 16, 2015 at 03:42:29PM -0700, Moritz Fischer wrote:
[..]
Quoted 9 lines
Quoted 8 lines
arch/arm/boot/dts/zynq-7000.dtsi line 297
Quoted 5 lines
arch/arm/boot/dts/zynq-7000.dtsi +1
-0@@ -294,6 +294,11 @@ devcfg: devcfg at f8007000 { compatible = "xlnx,zynq-devcfg-1.0"; reg = <0xf8007000 0x100>; + interrupt-parent = <&intc>;You shouldn't need interrupt-parent here. In fact, I suspect it can be removed from all sibling nodes as well.
Quoted 8 lines
Quoted 5 lines
Correct. But I tend to do it vice-versa. To remove it from amba node and keep it in every IP here. The reason is simple to let everybody know that setting up right interrupt controller is something what they have to care. If you have more interrupt controllers in the system it can be messy.
If you like that, then you'd like the interrupt-extended properly even better (I think).
yep. That works for me too.
Thanks,
Michal
PATCH v2 3/3 fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
In reply to Moritz FischerThis commit adds FPGA Manager support for the Xilinx Zynq chip. The code borrows some from the xdevcfg driver in Xilinx' vendor tree.
---
v2:
- Replaced locking error flag and broken completion with irq masking and changed completion handling
- Dealing with timeout cases
- Reworked clock handling
- Moved initialization from probe() to write_init()
- Fixed return value of devm_request_irq() check to check for non-zero
- Alphabetized includes ;-)
- Changed some of the comments, to better explain what's happening
--- drivers/fpga/Kconfig | 5 + drivers/fpga/Makefile | 1 + drivers/fpga/zynq-fpga.c | 533 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 539 insertions(+) create mode 100644 drivers/fpga/zynq-fpga.c
drivers/fpga/Kconfig +5 -0
@@ -19,6 +19,11 @@ config FPGA_MGR_SOCFPGA help FPGA manager driver support for Altera SOCFPGA. +config FPGA_MGR_ZYNQ_FPGA + tristate "Xilinx Zynq FPGA" + help + FPGA manager driver support for Xilinx Zynq FPGAs. + endif # FPGA endmenu
drivers/fpga/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-$(CONFIG_FPGA) += fpga-mgr.o # FPGA Manager Drivers obj-$(CONFIG_FPGA_MGR_SOCFPGA) += socfpga.o +obj-$(CONFIG_FPGA_MGR_ZYNQ_FPGA) += zynq-fpga.o
drivers/fpga/zynq-fpga.c new file +533 -0
533 lines not on this page · raw message
Signature · 1 line
2.4.3
Re: [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
Hey Moritz-
Quoted 16 lines · Moritz Fischer
This commit adds FPGA Manager support for the Xilinx Zynq chip. The code borrows some from the xdevcfg driver in Xilinx' vendor tree.
Signed-off-by Moritz Fischer <[email protected]>---
v2:
- Replaced locking error flag and broken completion with irq masking and changed completion handling
- Dealing with timeout cases
- Reworked clock handling
- Moved initialization fromprobe()towrite_init()
- Fixed return value ofdevm_request_irq()check to check for non-zero
- Alphabetized includes ;-)
- Changed some of the comments, to better explain what's happening
[..]
Quoted 2 lines
drivers/fpga/zynq-fpga.c new file +2
-0+static int zynq_fpga_probe (struct platform_device *pdev) +{
[..]
drivers/fpga/zynq-fpga.c line 479
Quoted 11 lines
drivers/fpga/zynq-fpga.c new file +11
-0+ priv->clk =devm_clk_get (dev,"ref_clk" ); +if (IS_ERR (priv->clk)) { +dev_err (dev,"input clock not found" ); +return PTR_ERR (priv->clk); + } + + err =clk_prepare_enable (priv->clk); +if (err) { +dev_err (dev,"unable to enable clock" ); +return err; + }
prepare_cnt = 1, enable_cnt = 1
drivers/fpga/zynq-fpga.c line 484
Quoted 5 lines
drivers/fpga/zynq-fpga.c new file +5
-0+ +/* unlock the device */ +zynq_fpga_write (priv,UNLOCK_OFFSET ,UNLOCK_MASK ); + +clk_disable (priv->clk);
prepare_cnt = 1, enable_cnt = 0
drivers/fpga/zynq-fpga.c line 490
Quoted 6 lines
drivers/fpga/zynq-fpga.c new file +6
-0+ + err =fpga_mgr_register (dev,"Xilinx Zynq FPGA Manager" , + &zynq_fpga_ops, priv); +if (err) { +dev_err (dev,"unable to register FPGA manager" ); +clk_disable_unprepare (priv->clk);
prepare_cnt = 0, enable_cnt = -1 /* OOPS! */
Clock management is still wonky. I think you only want clk_unprepare here.
drivers/fpga/zynq-fpga.c line 223
Quoted 3 lines
drivers/fpga/zynq-fpga.c new file +3
-0+return err; + } +
Assuming all goes well, you'll be leaving probe() with:
prepare_cnt = 1, enable_cnt = 0.
drivers/fpga/zynq-fpga.c line 505
Quoted 12 lines
drivers/fpga/zynq-fpga.c new file +12
-0+return 0 ; +} + +static int zynq_fpga_remove (struct platform_device *pdev) +{ +struct zynq_fpga_priv *priv; + +fpga_mgr_unregister (&pdev->dev); + + priv =platform_get_drvdata (pdev); + +clk_disable_unprepare (priv->clk);
Which means, symmetrically, you'll only want this to be a clk_unprepare().
Josh
Re: [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
Quoted 78 lines · Josh Cartwright
Hey Moritz-
Quoted 16 lines · Moritz Fischer
This commit adds FPGA Manager support for the Xilinx Zynq chip. The code borrows some from the xdevcfg driver in Xilinx' vendor tree.
Signed-off-by Moritz Fischer <[email protected]>---
v2:
- Replaced locking error flag and broken completion with irq masking and changed completion handling
- Dealing with timeout cases
- Reworked clock handling
- Moved initialization fromprobe()towrite_init()
- Fixed return value ofdevm_request_irq()check to check for non-zero
- Alphabetized includes ;-)
- Changed some of the comments, to better explain what's happening[..]
Quoted 2 lines
drivers/fpga/zynq-fpga.c new file +2
-0+static int zynq_fpga_probe (struct platform_device *pdev) +{[..]
drivers/fpga/zynq-fpga.c line 479
Quoted 11 lines
drivers/fpga/zynq-fpga.c new file +11
-0+ priv->clk =devm_clk_get (dev,"ref_clk" ); +if (IS_ERR (priv->clk)) { +dev_err (dev,"input clock not found" ); +return PTR_ERR (priv->clk); + } + + err =clk_prepare_enable (priv->clk); +if (err) { +dev_err (dev,"unable to enable clock" ); +return err; + }
prepare_cnt= 1,enable_cnt= 1drivers/fpga/zynq-fpga.c line 484
Quoted 5 lines
drivers/fpga/zynq-fpga.c new file +5
-0+ +/* unlock the device */ +zynq_fpga_write (priv,UNLOCK_OFFSET ,UNLOCK_MASK ); + +clk_disable (priv->clk);
prepare_cnt= 1,enable_cnt= 0drivers/fpga/zynq-fpga.c line 490
Quoted 6 lines
drivers/fpga/zynq-fpga.c new file +6
-0+ + err =fpga_mgr_register (dev,"Xilinx Zynq FPGA Manager" , + &zynq_fpga_ops, priv); +if (err) { +dev_err (dev,"unable to register FPGA manager" ); +clk_disable_unprepare (priv->clk);
prepare_cnt= 0,enable_cnt= -1 /* OOPS! */Clock management is still wonky. I think you only want
clk_unpreparehere.drivers/fpga/zynq-fpga.c line 223
Quoted 3 lines
drivers/fpga/zynq-fpga.c new file +3
-0+return err; + } +Assuming all goes well, you'll be leaving
probe()with:
prepare_cnt= 1,enable_cnt= 0.drivers/fpga/zynq-fpga.c line 505
Quoted 12 lines
drivers/fpga/zynq-fpga.c new file +12
-0+return 0 ; +} + +static int zynq_fpga_remove (struct platform_device *pdev) +{ +struct zynq_fpga_priv *priv; + +fpga_mgr_unregister (&pdev->dev); + + priv =platform_get_drvdata (pdev); + +clk_disable_unprepare (priv->clk);Which means, symmetrically, you'll only want this to be a
clk_unprepare().
Quoted 1 line
Josh
Greg had already queued the v2 this weekend (which caught me by suprise). I tried to figure out if it's possible to send a v3, but he said to send follow up patches as he can't rebase the branch he merged it into.
I will have access to hardware this afternoon, and send out follow up patches to fix the unbalanced clock handling.
Cheers,
Moritz
Re: [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
In reply to Moritz FischerOn Fri, 16 Oct 2015, Moritz Fischer wrote:
Hi Moritz,
I just noticed a problem regarding private data. Fortunately it is easy to fix. See below...
drivers/fpga/zynq-fpga.c line 439
Quoted 12 lines
drivers/fpga/zynq-fpga.c new file +12
-0+static int zynq_fpga_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct zynq_fpga_priv *priv; +struct resource *res; +int err; + + priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +platform_set_drvdata (pdev, priv);
fpga-mgr.c uses drvdata for its struct fpga_manager, so this will get overwritten. So remove this platform_set_drvdata(). priv is saved in struct fpga_manager during fpga_mgr_register().
...
drivers/fpga/zynq-fpga.c line 498
Quoted 2 lines
drivers/fpga/zynq-fpga.c new file +2
-0+static int zynq_fpga_remove (struct platform_device *pdev) +{
Here you can get a pointer to priv from the fpga_manager struct:
struct fpga_manager *mgr = platform_get_drvdata(pdev);
struct zynq_fpga_priv *priv = mgr->priv;Alan
Quoted 10 lines
drivers/fpga/zynq-fpga.c new file +10
-0+struct zynq_fpga_priv *priv; + +fpga_mgr_unregister (&pdev->dev); + + priv =platform_get_drvdata (pdev); + +clk_disable_unprepare (priv->clk); + +return 0 ; +}
Re: [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
Hi Alan,
Quoted 7 lines · atull
On Fri, 16 Oct 2015, Moritz Fischer wrote:
Hi Moritz,
I just noticed a problem regarding private data. Fortunately it is easy to fix. See below...
Quoted 16 lines
drivers/fpga/zynq-fpga.c line 439
Quoted 12 lines
drivers/fpga/zynq-fpga.c new file +12
-0+static int zynq_fpga_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct zynq_fpga_priv *priv; +struct resource *res; +int err; + + priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +platform_set_drvdata (pdev, priv);
fpga-mgr.cuses drvdata for its structfpga_manager, so this will get overwritten. So remove thisplatform_set_drvdata(). priv is saved in structfpga_managerduringfpga_mgr_register().
Ouch, I missed that.
Quoted 9 lines
...
drivers/fpga/zynq-fpga.c line 498
Quoted 2 lines
drivers/fpga/zynq-fpga.c new file +2
-0+static int zynq_fpga_remove (struct platform_device *pdev) +{Here you can get a pointer to priv from the
fpga_managerstruct:struct fpga_manager *mgr = platform_get_drvdata(pdev); struct zynq_fpga_priv *priv = mgr->priv;
Thanks, will submit a follow up patch.
Quoted 12 lines
drivers/fpga/zynq-fpga.c
Quoted 10 lines
drivers/fpga/zynq-fpga.c new file +10
-0+struct zynq_fpga_priv *priv; + +fpga_mgr_unregister (&pdev->dev); + + priv =platform_get_drvdata (pdev); + +clk_disable_unprepare (priv->clk); + +return 0 ; +}>Alan
Cheers,
Moritz
Quoted 6 lines · Moritz Fischer
Hi all,
I've tried to address most of the feedback that was brought up, the one thing I haven't looked at was the firmware format part, since that was still in discussion.
So I'm still open to suggestions on how to handle this.
Was there disagreement? I had thought we settled on limiting the handling the BIN format explicitly, the rest of the thread was about userspace tooling for BIT->BIN conversion.
Josh
Quoted 11 lines · Josh Cartwright
Quoted 6 lines · Moritz Fischer
Hi all,
I've tried to address most of the feedback that was brought up, the one thing I haven't looked at was the firmware format part, since that was still in discussion.
So I'm still open to suggestions on how to handle this.Was there disagreement? I had thought we settled on limiting the handling the BIN format explicitly, the rest of the thread was about userspace tooling for
BIT->BINconversion.
yep. Only BIN handling and keep small BIN header with sync word.
Thanks,
Michal
Quoted 9 lines · Michal Simek
Quoted 8 lines · Josh Cartwright
Quoted 6 lines · Moritz Fischer
Hi all,
I've tried to address most of the feedback that was brought up, the one thing I haven't looked at was the firmware format part, since that was still in discussion.
So I'm still open to suggestions on how to handle this.
Quoted 5 lines
Quoted 3 lines
Was there disagreement? I had thought we settled on limiting the handling the BIN format explicitly, the rest of the thread was about userspace tooling for
BIT->BINconversion.yep. Only BIN handling and keep small BIN header with sync word.
Greg had already queued the v2 this weekend (which caught me by suprise). I tried to figure out if it's possible to send a v3, but he said to send follow up patches as he can't rebase the branch he merged it into.
I will have access to hardware this afternoon, and send out follow up patches to fix the BIN vs BIT issue.
Quoted 4 lines
Thanks,
Michal
Cheers,
Moritz