Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread vikasm
Hi Marek,

On 08/12/2015 07:15 PM, Marek Vasut wrote:
 On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
 This patch is to separate the base trigger from the read/write transfer
 start addresses.
 
 This patch breaks the QSPI support on SoCFPGA.

ok, can you please try to debug the issue. Logically this patch looks good to 
me unless there
is something specific to socfpga.

I think latest linux v2 patch from Graham has implemented the same patch.

 
 Base trigger register address (0x1c register) corresponds to the address
 which should be put on AHB bus to handle indirect transfer triggered
 before.

 To handle indirect transfer we need to issue addresses from (value of 0x1c)
 to (value of 0x1c) + 15*4 (4 corresponds to size of SRAM location).
 There are no obstacles in issuing const address just equal to 0x1c.
 Important thing to note is that indirect trigger address has nothing in
 common with your physical or mapped NOR Flash address.

 Transfer read/write start addresses (offset 0x68/0x78)should be programmed
 with the absolute flash address to be read/written.

 plat-ahbbase has been renamed to plat-flashbase for clarity.
 plat-triggerbase is added in device tree for mapped spi flash address.

 Signed-off-by: Vikas Manocha vikas.mano...@st.com
 ---

 Changes in v2: Rebased to master

  arch/arm/dts/socfpga.dtsi  |3 ++-
  arch/arm/dts/stv0991.dts   |3 ++-
  drivers/spi/cadence_qspi.c |   14 +++---
  drivers/spi/cadence_qspi.h |5 +++--
  drivers/spi/cadence_qspi_apb.c |   11 +--
  5 files changed, 19 insertions(+), 17 deletions(-)

 diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
 index 9b12420..1099a92 100644
 --- a/arch/arm/dts/socfpga.dtsi
 +++ b/arch/arm/dts/socfpga.dtsi
 @@ -633,7 +633,8 @@
  #address-cells = 1;
  #size-cells = 0;
  reg = 0xff705000 0x1000,
 -0xffa0 0x1000;
 +0xffa0 0x1000,
 +0x 0x0010;
 
 Shouldn't there be a phandle to
 
  interrupts = 0 151 4;
  clocks = qspi_clk;
  ext-decoder = 0;  /* external decoder */
 diff --git a/arch/arm/dts/stv0991.dts b/arch/arm/dts/stv0991.dts
 index fa3fd64..e23d4fd 100644
 --- a/arch/arm/dts/stv0991.dts
 +++ b/arch/arm/dts/stv0991.dts
 @@ -30,7 +30,8 @@
  #address-cells = 1;
  #size-cells = 0;
  reg = 0x80203000 0x100,
 -0x4000 0x100;
 +0x4000 0x100,
 +0x4000 0x010;
  clocks = 375;
  sram-size = 256;
  status = okay;
 diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
 index 34a0f46..95c9cea 100644
 --- a/drivers/spi/cadence_qspi.c
 +++ b/drivers/spi/cadence_qspi.c
 @@ -150,7 +150,7 @@ static int cadence_spi_probe(struct udevice *bus)
  struct cadence_spi_priv *priv = dev_get_priv(bus);

  priv-regbase = plat-regbase;
 -priv-ahbbase = plat-ahbbase;
 +priv-flashbase = plat-flashbase;

  if (!priv-qspi_is_init) {
  cadence_qspi_apb_controller_init(plat);
 @@ -278,7 +278,7 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) const void *blob = gd-fdt_blob;
  int node = bus-of_offset;
  int subnode;
 -u32 data[4];
 +u32 data[6];
  int ret;

  /* 2 base addresses are needed, lets get them from the DT */
 @@ -289,7 +289,8 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) }

  plat-regbase = (void *)data[0];
 -plat-ahbbase = (void *)data[2];
 +plat-flashbase = (void *)data[2];
 +plat-trigger_base = (void *)data[4];

  /* Use 500KHz as a suitable default */
  plat-max_hz = fdtdec_get_int(blob, node, spi-max-frequency,
 @@ -311,10 +312,9 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) plat-tslch_ns = fdtdec_get_int(blob, subnode, tslch-ns,
 20);
  plat-sram_size = fdtdec_get_int(blob, node, sram-size, 128);

 -debug(%s: regbase=%p ahbbase=%p max-frequency=%d page-size=%d\n,
 -  __func__, plat-regbase, plat-ahbbase, plat-max_hz,
 -  plat-page_size);
 -
 +debug(%s: regbase=%p flashbase=%p trigger_base=%p max-frequency=%d \
 +page-size=%d\n, __func__, plat-regbase, plat-flashbase,
 
 Please never break formating strings, they are the only exception from the 80 
 alignment rule. It is not possible to grep for them if they're broken.

ok, i will fix in next version.

Rgds,
Vikas

 
 +plat-trigger_base, plat-max_hz, plat-page_size);
  return 0;
  }
 
 [...]
 .
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread Marek Vasut
On Thursday, August 13, 2015 at 11:36:31 PM, vikas wrote:
 Hi Marek,

Hi!

 On 08/13/2015 09:42 AM, vikasm wrote:
  Hi Marek,
  
  On 08/12/2015 07:15 PM, Marek Vasut wrote:
  On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
  This patch is to separate the base trigger from the read/write transfer
  start addresses.
  
  This patch breaks the QSPI support on SoCFPGA.
  
  ok, can you please try to debug the issue. Logically this patch looks
  good to me unless there is something specific to socfpga.
 
 One quick check, can you test if it works on reverting the trigger base in
 arch/arm/dts/socfpga.dtsi from 0x 0x0010 to 0xffa0 0x1000.

Can you please spin V3 of the patchset first, one which omits the buggy bits,
so I can test it on a more final form of the patches ? Please keep me on CC,
I'll test it then.

Thanks!

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread vikas
Hi Marek,

On 08/13/2015 09:42 AM, vikasm wrote:
 Hi Marek,
 
 On 08/12/2015 07:15 PM, Marek Vasut wrote:
 On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
 This patch is to separate the base trigger from the read/write transfer
 start addresses.

 This patch breaks the QSPI support on SoCFPGA.
 
 ok, can you please try to debug the issue. Logically this patch looks good to 
 me unless there
 is something specific to socfpga.

One quick check, can you test if it works on reverting the trigger base in 
arch/arm/dts/socfpga.dtsi from
0x 0x0010 to 0xffa0 0x1000.

Rgds,
Vikas

 
 I think latest linux v2 patch from Graham has implemented the same patch.
 

 Base trigger register address (0x1c register) corresponds to the address
 which should be put on AHB bus to handle indirect transfer triggered
 before.

 To handle indirect transfer we need to issue addresses from (value of 0x1c)
 to (value of 0x1c) + 15*4 (4 corresponds to size of SRAM location).
 There are no obstacles in issuing const address just equal to 0x1c.
 Important thing to note is that indirect trigger address has nothing in
 common with your physical or mapped NOR Flash address.

 Transfer read/write start addresses (offset 0x68/0x78)should be programmed
 with the absolute flash address to be read/written.

 plat-ahbbase has been renamed to plat-flashbase for clarity.
 plat-triggerbase is added in device tree for mapped spi flash address.

 Signed-off-by: Vikas Manocha vikas.mano...@st.com
 ---

 Changes in v2: Rebased to master

  arch/arm/dts/socfpga.dtsi  |3 ++-
  arch/arm/dts/stv0991.dts   |3 ++-
  drivers/spi/cadence_qspi.c |   14 +++---
  drivers/spi/cadence_qspi.h |5 +++--
  drivers/spi/cadence_qspi_apb.c |   11 +--
  5 files changed, 19 insertions(+), 17 deletions(-)

 diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
 index 9b12420..1099a92 100644
 --- a/arch/arm/dts/socfpga.dtsi
 +++ b/arch/arm/dts/socfpga.dtsi
 @@ -633,7 +633,8 @@
 #address-cells = 1;
 #size-cells = 0;
 reg = 0xff705000 0x1000,
 -   0xffa0 0x1000;
 +   0xffa0 0x1000,
 +   0x 0x0010;

 Shouldn't there be a phandle to

 interrupts = 0 151 4;
 clocks = qspi_clk;
 ext-decoder = 0;  /* external decoder */
 diff --git a/arch/arm/dts/stv0991.dts b/arch/arm/dts/stv0991.dts
 index fa3fd64..e23d4fd 100644
 --- a/arch/arm/dts/stv0991.dts
 +++ b/arch/arm/dts/stv0991.dts
 @@ -30,7 +30,8 @@
 #address-cells = 1;
 #size-cells = 0;
 reg = 0x80203000 0x100,
 -   0x4000 0x100;
 +   0x4000 0x100,
 +   0x4000 0x010;
 clocks = 375;
 sram-size = 256;
 status = okay;
 diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
 index 34a0f46..95c9cea 100644
 --- a/drivers/spi/cadence_qspi.c
 +++ b/drivers/spi/cadence_qspi.c
 @@ -150,7 +150,7 @@ static int cadence_spi_probe(struct udevice *bus)
 struct cadence_spi_priv *priv = dev_get_priv(bus);

 priv-regbase = plat-regbase;
 -   priv-ahbbase = plat-ahbbase;
 +   priv-flashbase = plat-flashbase;

 if (!priv-qspi_is_init) {
 cadence_qspi_apb_controller_init(plat);
 @@ -278,7 +278,7 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) const void *blob = gd-fdt_blob;
 int node = bus-of_offset;
 int subnode;
 -   u32 data[4];
 +   u32 data[6];
 int ret;

 /* 2 base addresses are needed, lets get them from the DT */
 @@ -289,7 +289,8 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) }

 plat-regbase = (void *)data[0];
 -   plat-ahbbase = (void *)data[2];
 +   plat-flashbase = (void *)data[2];
 +   plat-trigger_base = (void *)data[4];

 /* Use 500KHz as a suitable default */
 plat-max_hz = fdtdec_get_int(blob, node, spi-max-frequency,
 @@ -311,10 +312,9 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) plat-tslch_ns = fdtdec_get_int(blob, subnode, tslch-ns,
 20);
 plat-sram_size = fdtdec_get_int(blob, node, sram-size, 128);

 -   debug(%s: regbase=%p ahbbase=%p max-frequency=%d page-size=%d\n,
 - __func__, plat-regbase, plat-ahbbase, plat-max_hz,
 - plat-page_size);
 -
 +   debug(%s: regbase=%p flashbase=%p trigger_base=%p max-frequency=%d \
 +   page-size=%d\n, __func__, plat-regbase, plat-flashbase,

 Please never break formating strings, they are the only exception from the 
 80 
 alignment rule. It is not possible to grep for them if they're broken.
 
 ok, i will fix in next version.
 
 Rgds,
 Vikas
 

 +   plat-trigger_base, plat-max_hz, plat-page_size);
 return 0;
  }

 [...]
 .


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread vikas
Hi,

On 08/13/2015 03:48 PM, Marek Vasut wrote:
 On Thursday, August 13, 2015 at 11:36:31 PM, vikas wrote:
 Hi Marek,
 
 Hi!
 
 On 08/13/2015 09:42 AM, vikasm wrote:
 Hi Marek,

 On 08/12/2015 07:15 PM, Marek Vasut wrote:
 On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
 This patch is to separate the base trigger from the read/write transfer
 start addresses.

 This patch breaks the QSPI support on SoCFPGA.

 ok, can you please try to debug the issue. Logically this patch looks
 good to me unless there is something specific to socfpga.

 One quick check, can you test if it works on reverting the trigger base in
 arch/arm/dts/socfpga.dtsi from 0x 0x0010 to 0xffa0 0x1000.
 
 Can you please spin V3 of the patchset first, one which omits the buggy bits,
 so I can test it on a more final form of the patches ? Please keep me on CC,
 I'll test it then.


Once i add sram level test patches, i would not be able to test it on my 
platform.
This particular issue is pending for long time. I suggest to debug (at least 
with above mentioned quick test)
this particular issue/patch with current version v2. There is only minor change 
(format string) in this patch for v3.

Rgds,
Vikas

 
 Thanks!
 
 Best regards,
 Marek Vasut
 .
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread Marek Vasut
On Friday, August 14, 2015 at 02:37:53 AM, vikas wrote:
 Hi,
 
 On 08/13/2015 03:48 PM, Marek Vasut wrote:
  On Thursday, August 13, 2015 at 11:36:31 PM, vikas wrote:
  Hi Marek,
  
  Hi!
  
  On 08/13/2015 09:42 AM, vikasm wrote:
  Hi Marek,
  
  On 08/12/2015 07:15 PM, Marek Vasut wrote:
  On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
  This patch is to separate the base trigger from the read/write
  transfer start addresses.
  
  This patch breaks the QSPI support on SoCFPGA.
  
  ok, can you please try to debug the issue. Logically this patch looks
  good to me unless there is something specific to socfpga.
  
  One quick check, can you test if it works on reverting the trigger base
  in arch/arm/dts/socfpga.dtsi from 0x 0x0010 to 0xffa0
  0x1000.
  
  Can you please spin V3 of the patchset first, one which omits the buggy
  bits, so I can test it on a more final form of the patches ? Please keep
  me on CC, I'll test it then.
 
 Once i add sram level test patches, i would not be able to test it on my
 platform. This particular issue is pending for long time. I suggest to
 debug (at least with above mentioned quick test) this particular
 issue/patch with current version v2. There is only minor change (format
 string) in this patch for v3.

That's fine, just send the V3 as RFT and I'll check it.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread vikas
Hi Marek,

On 08/13/2015 06:04 PM, Marek Vasut wrote:
 On Friday, August 14, 2015 at 02:37:53 AM, vikas wrote:
 Hi,

 On 08/13/2015 03:48 PM, Marek Vasut wrote:
 On Thursday, August 13, 2015 at 11:36:31 PM, vikas wrote:
 Hi Marek,

 Hi!

 On 08/13/2015 09:42 AM, vikasm wrote:
 Hi Marek,

 On 08/12/2015 07:15 PM, Marek Vasut wrote:
 On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
 This patch is to separate the base trigger from the read/write
 transfer start addresses.

 This patch breaks the QSPI support on SoCFPGA.

 ok, can you please try to debug the issue. Logically this patch looks
 good to me unless there is something specific to socfpga.

 One quick check, can you test if it works on reverting the trigger base
 in arch/arm/dts/socfpga.dtsi from 0x 0x0010 to 0xffa0
 0x1000.

 Can you please spin V3 of the patchset first, one which omits the buggy
 bits, so I can test it on a more final form of the patches ? Please keep
 me on CC, I'll test it then.

 Once i add sram level test patches, i would not be able to test it on my
 platform. This particular issue is pending for long time. I suggest to
 debug (at least with above mentioned quick test) this particular
 issue/patch with current version v2. There is only minor change (format
 string) in this patch for v3.
 
 That's fine, just send the V3 as RFT and I'll check it.

If this patch is not debugged, there is no major significance of this patchset.
I would appreciate if you do some test with current v2.

Rgds,
Vikas

 
 Best regards,
 Marek Vasut
 .
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread Marek Vasut
On Friday, August 14, 2015 at 03:39:22 AM, vikas wrote:
 Hi Marek,
 
 On 08/13/2015 06:04 PM, Marek Vasut wrote:
  On Friday, August 14, 2015 at 02:37:53 AM, vikas wrote:
  Hi,
  
  On 08/13/2015 03:48 PM, Marek Vasut wrote:
  On Thursday, August 13, 2015 at 11:36:31 PM, vikas wrote:
  Hi Marek,
  
  Hi!
  
  On 08/13/2015 09:42 AM, vikasm wrote:
  Hi Marek,
  
  On 08/12/2015 07:15 PM, Marek Vasut wrote:
  On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
  This patch is to separate the base trigger from the read/write
  transfer start addresses.
  
  This patch breaks the QSPI support on SoCFPGA.
  
  ok, can you please try to debug the issue. Logically this patch looks
  good to me unless there is something specific to socfpga.
  
  One quick check, can you test if it works on reverting the trigger
  base in arch/arm/dts/socfpga.dtsi from 0x 0x0010 to
  0xffa0 0x1000.
  
  Can you please spin V3 of the patchset first, one which omits the buggy
  bits, so I can test it on a more final form of the patches ? Please
  keep me on CC, I'll test it then.
  
  Once i add sram level test patches, i would not be able to test it on my
  platform. This particular issue is pending for long time. I suggest to
  debug (at least with above mentioned quick test) this particular
  issue/patch with current version v2. There is only minor change (format
  string) in this patch for v3.
  
  That's fine, just send the V3 as RFT and I'll check it.
 
 If this patch is not debugged, there is no major significance of this
 patchset. I would appreciate if you do some test with current v2.

I stop here for today and will get back to this in a few days again.
Please send V3 until then, I don't want to dig in old/broken code.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-13 Thread Vikas MANOCHA

Hi,


 On Aug 13, 2015, at 6:57 PM, Marek Vasut ma...@denx.de wrote:
 
 On Friday, August 14, 2015 at 03:39:22 AM, vikas wrote:
 Hi Marek,
 
 On 08/13/2015 06:04 PM, Marek Vasut wrote:
 On Friday, August 14, 2015 at 02:37:53 AM, vikas wrote:
 Hi,
 
 On 08/13/2015 03:48 PM, Marek Vasut wrote:
 On Thursday, August 13, 2015 at 11:36:31 PM, vikas wrote:
 Hi Marek,
 
 Hi!
 
 On 08/13/2015 09:42 AM, vikasm wrote:
 Hi Marek,
 
 On 08/12/2015 07:15 PM, Marek Vasut wrote:
 On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
 This patch is to separate the base trigger from the read/write
 transfer start addresses.
 
 This patch breaks the QSPI support on SoCFPGA.
 
 ok, can you please try to debug the issue. Logically this patch looks
 good to me unless there is something specific to socfpga.
 
 One quick check, can you test if it works on reverting the trigger
 base in arch/arm/dts/socfpga.dtsi from 0x 0x0010 to
 0xffa0 0x1000.
 
 Can you please spin V3 of the patchset first, one which omits the buggy
 bits, so I can test it on a more final form of the patches ? Please
 keep me on CC, I'll test it then.
 
 Once i add sram level test patches, i would not be able to test it on my
 platform. This particular issue is pending for long time. I suggest to
 debug (at least with above mentioned quick test) this particular
 issue/patch with current version v2. There is only minor change (format
 string) in this patch for v3.
 
 That's fine, just send the V3 as RFT and I'll check it.
 
 If this patch is not debugged, there is no major significance of this
 patchset. I would appreciate if you do some test with current v2.
 
 I stop here for today and will get back to this in a few days again.
 Please send V3 until then, I don't want to dig in old/broken code.

Ok, I will send the v3 tomorrow.

Rgds,
Vikas

 
 Best regards,
 Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-08-12 Thread Marek Vasut
On Thursday, July 16, 2015 at 04:27:33 AM, Vikas Manocha wrote:
 This patch is to separate the base trigger from the read/write transfer
 start addresses.

This patch breaks the QSPI support on SoCFPGA.

 Base trigger register address (0x1c register) corresponds to the address
 which should be put on AHB bus to handle indirect transfer triggered
 before.
 
 To handle indirect transfer we need to issue addresses from (value of 0x1c)
 to (value of 0x1c) + 15*4 (4 corresponds to size of SRAM location).
 There are no obstacles in issuing const address just equal to 0x1c.
 Important thing to note is that indirect trigger address has nothing in
 common with your physical or mapped NOR Flash address.
 
 Transfer read/write start addresses (offset 0x68/0x78)should be programmed
 with the absolute flash address to be read/written.
 
 plat-ahbbase has been renamed to plat-flashbase for clarity.
 plat-triggerbase is added in device tree for mapped spi flash address.
 
 Signed-off-by: Vikas Manocha vikas.mano...@st.com
 ---
 
 Changes in v2: Rebased to master
 
  arch/arm/dts/socfpga.dtsi  |3 ++-
  arch/arm/dts/stv0991.dts   |3 ++-
  drivers/spi/cadence_qspi.c |   14 +++---
  drivers/spi/cadence_qspi.h |5 +++--
  drivers/spi/cadence_qspi_apb.c |   11 +--
  5 files changed, 19 insertions(+), 17 deletions(-)
 
 diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
 index 9b12420..1099a92 100644
 --- a/arch/arm/dts/socfpga.dtsi
 +++ b/arch/arm/dts/socfpga.dtsi
 @@ -633,7 +633,8 @@
   #address-cells = 1;
   #size-cells = 0;
   reg = 0xff705000 0x1000,
 - 0xffa0 0x1000;
 + 0xffa0 0x1000,
 + 0x 0x0010;

Shouldn't there be a phandle to 

   interrupts = 0 151 4;
   clocks = qspi_clk;
   ext-decoder = 0;  /* external decoder */
 diff --git a/arch/arm/dts/stv0991.dts b/arch/arm/dts/stv0991.dts
 index fa3fd64..e23d4fd 100644
 --- a/arch/arm/dts/stv0991.dts
 +++ b/arch/arm/dts/stv0991.dts
 @@ -30,7 +30,8 @@
   #address-cells = 1;
   #size-cells = 0;
   reg = 0x80203000 0x100,
 - 0x4000 0x100;
 + 0x4000 0x100,
 + 0x4000 0x010;
   clocks = 375;
   sram-size = 256;
   status = okay;
 diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
 index 34a0f46..95c9cea 100644
 --- a/drivers/spi/cadence_qspi.c
 +++ b/drivers/spi/cadence_qspi.c
 @@ -150,7 +150,7 @@ static int cadence_spi_probe(struct udevice *bus)
   struct cadence_spi_priv *priv = dev_get_priv(bus);
 
   priv-regbase = plat-regbase;
 - priv-ahbbase = plat-ahbbase;
 + priv-flashbase = plat-flashbase;
 
   if (!priv-qspi_is_init) {
   cadence_qspi_apb_controller_init(plat);
 @@ -278,7 +278,7 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) const void *blob = gd-fdt_blob;
   int node = bus-of_offset;
   int subnode;
 - u32 data[4];
 + u32 data[6];
   int ret;
 
   /* 2 base addresses are needed, lets get them from the DT */
 @@ -289,7 +289,8 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) }
 
   plat-regbase = (void *)data[0];
 - plat-ahbbase = (void *)data[2];
 + plat-flashbase = (void *)data[2];
 + plat-trigger_base = (void *)data[4];
 
   /* Use 500KHz as a suitable default */
   plat-max_hz = fdtdec_get_int(blob, node, spi-max-frequency,
 @@ -311,10 +312,9 @@ static int cadence_spi_ofdata_to_platdata(struct
 udevice *bus) plat-tslch_ns = fdtdec_get_int(blob, subnode, tslch-ns,
 20);
   plat-sram_size = fdtdec_get_int(blob, node, sram-size, 128);
 
 - debug(%s: regbase=%p ahbbase=%p max-frequency=%d page-size=%d\n,
 -   __func__, plat-regbase, plat-ahbbase, plat-max_hz,
 -   plat-page_size);
 -
 + debug(%s: regbase=%p flashbase=%p trigger_base=%p max-frequency=%d \
 + page-size=%d\n, __func__, plat-regbase, plat-flashbase,

Please never break formating strings, they are the only exception from the 80 
alignment rule. It is not possible to grep for them if they're broken.

 + plat-trigger_base, plat-max_hz, plat-page_size);
   return 0;
  }

[...]
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [v2 5/6] spi: cadence_qspi: fix base trigger address transfer start address

2015-07-15 Thread Vikas Manocha
This patch is to separate the base trigger from the read/write transfer start
addresses.

Base trigger register address (0x1c register) corresponds to the address which
should be put on AHB bus to handle indirect transfer triggered before.

To handle indirect transfer we need to issue addresses from (value of 0x1c) to
(value of 0x1c) + 15*4 (4 corresponds to size of SRAM location).
There are no obstacles in issuing const address just equal to 0x1c. Important
thing to note is that indirect trigger address has nothing in common with your
physical or mapped NOR Flash address.

Transfer read/write start addresses (offset 0x68/0x78)should be programmed with
the absolute flash address to be read/written.

plat-ahbbase has been renamed to plat-flashbase for clarity.
plat-triggerbase is added in device tree for mapped spi flash address.

Signed-off-by: Vikas Manocha vikas.mano...@st.com
---

Changes in v2: Rebased to master

 arch/arm/dts/socfpga.dtsi  |3 ++-
 arch/arm/dts/stv0991.dts   |3 ++-
 drivers/spi/cadence_qspi.c |   14 +++---
 drivers/spi/cadence_qspi.h |5 +++--
 drivers/spi/cadence_qspi_apb.c |   11 +--
 5 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index 9b12420..1099a92 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -633,7 +633,8 @@
#address-cells = 1;
#size-cells = 0;
reg = 0xff705000 0x1000,
-   0xffa0 0x1000;
+   0xffa0 0x1000,
+   0x 0x0010;
interrupts = 0 151 4;
clocks = qspi_clk;
ext-decoder = 0;  /* external decoder */
diff --git a/arch/arm/dts/stv0991.dts b/arch/arm/dts/stv0991.dts
index fa3fd64..e23d4fd 100644
--- a/arch/arm/dts/stv0991.dts
+++ b/arch/arm/dts/stv0991.dts
@@ -30,7 +30,8 @@
#address-cells = 1;
#size-cells = 0;
reg = 0x80203000 0x100,
-   0x4000 0x100;
+   0x4000 0x100,
+   0x4000 0x010;
clocks = 375;
sram-size = 256;
status = okay;
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index 34a0f46..95c9cea 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -150,7 +150,7 @@ static int cadence_spi_probe(struct udevice *bus)
struct cadence_spi_priv *priv = dev_get_priv(bus);
 
priv-regbase = plat-regbase;
-   priv-ahbbase = plat-ahbbase;
+   priv-flashbase = plat-flashbase;
 
if (!priv-qspi_is_init) {
cadence_qspi_apb_controller_init(plat);
@@ -278,7 +278,7 @@ static int cadence_spi_ofdata_to_platdata(struct udevice 
*bus)
const void *blob = gd-fdt_blob;
int node = bus-of_offset;
int subnode;
-   u32 data[4];
+   u32 data[6];
int ret;
 
/* 2 base addresses are needed, lets get them from the DT */
@@ -289,7 +289,8 @@ static int cadence_spi_ofdata_to_platdata(struct udevice 
*bus)
}
 
plat-regbase = (void *)data[0];
-   plat-ahbbase = (void *)data[2];
+   plat-flashbase = (void *)data[2];
+   plat-trigger_base = (void *)data[4];
 
/* Use 500KHz as a suitable default */
plat-max_hz = fdtdec_get_int(blob, node, spi-max-frequency,
@@ -311,10 +312,9 @@ static int cadence_spi_ofdata_to_platdata(struct udevice 
*bus)
plat-tslch_ns = fdtdec_get_int(blob, subnode, tslch-ns, 20);
plat-sram_size = fdtdec_get_int(blob, node, sram-size, 128);
 
-   debug(%s: regbase=%p ahbbase=%p max-frequency=%d page-size=%d\n,
- __func__, plat-regbase, plat-ahbbase, plat-max_hz,
- plat-page_size);
-
+   debug(%s: regbase=%p flashbase=%p trigger_base=%p max-frequency=%d \
+   page-size=%d\n, __func__, plat-regbase, plat-flashbase,
+   plat-trigger_base, plat-max_hz, plat-page_size);
return 0;
 }
 
diff --git a/drivers/spi/cadence_qspi.h b/drivers/spi/cadence_qspi.h
index 98e57aa..7341339 100644
--- a/drivers/spi/cadence_qspi.h
+++ b/drivers/spi/cadence_qspi.h
@@ -17,7 +17,8 @@
 struct cadence_spi_platdata {
unsigned intmax_hz;
void*regbase;
-   void*ahbbase;
+   void*flashbase;
+   void*trigger_base;
 
u32 page_size;
u32 block_size;
@@ -30,7 +31,7 @@ struct cadence_spi_platdata {
 
 struct cadence_spi_priv {
void*regbase;
-   void*ahbbase;
+   void*flashbase;
size_t  cmd_len;
u8  cmd_buf[32];
size_t