Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-05-05 Thread Stefano Babic
On 05/05/2015 11:37, Stefan Roese wrote:
 Hi Stefano,
 
 On 12.03.2015 13:34, Stefan Roese wrote:
 By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
 add a different function for this SPI configuration. This can be used
 by other baseboards, that might have a different SPI setup.

 This patch will be used by the upcoming WRU-IV board support which also
 uses the TQMa6 SoM.

 Signed-off-by: Stefan Roese s...@denx.de
 ---
   board/tqc/tqma6/tqma6.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
 index c9e163e..29db838 100644
 --- a/board/tqc/tqma6/tqma6.c
 +++ b/board/tqc/tqma6/tqma6.c
 @@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
   TQMA6_SF_CS_GPIO,
   };

 -static void tqma6_iomuxc_spi(void)
 +__weak void tqma6_iomuxc_spi(void)
   {
   unsigned i;


 
 Ping on this patch. Markus has Ack'ed it. Could you please push it to Tom?
 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-05-05 Thread Stefan Roese

Hi Stefano,

On 12.03.2015 13:34, Stefan Roese wrote:

By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
add a different function for this SPI configuration. This can be used
by other baseboards, that might have a different SPI setup.

This patch will be used by the upcoming WRU-IV board support which also
uses the TQMa6 SoM.

Signed-off-by: Stefan Roese s...@denx.de
---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
index c9e163e..29db838 100644
--- a/board/tqc/tqma6/tqma6.c
+++ b/board/tqc/tqma6/tqma6.c
@@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
TQMA6_SF_CS_GPIO,
  };

-static void tqma6_iomuxc_spi(void)
+__weak void tqma6_iomuxc_spi(void)
  {
unsigned i;




Ping on this patch. Markus has Ack'ed it. Could you please push it to Tom?

Thanks,
Stefan

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


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-13 Thread Markus Niebel
Hello Stefan,
Am 12.03.2015 um 16:18 schrieb Stefan Roese:
 Hi Markus,
 
 On 12.03.2015 15:25, Markus Niebel wrote:
 Am 12.03.2015 um 13:34 schrieb Stefan Roese:
 By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
 add a different function for this SPI configuration. This can be used
 by other baseboards, that might have a different SPI setup.

 This patch will be used by the upcoming WRU-IV board support which also
 uses the TQMa6 SoM.

 Signed-off-by: Stefan Roese s...@denx.de
 ---
   board/tqc/tqma6/tqma6.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
 index c9e163e..29db838 100644
 --- a/board/tqc/tqma6/tqma6.c
 +++ b/board/tqc/tqma6/tqma6.c
 @@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
   TQMA6_SF_CS_GPIO,
   };

 -static void tqma6_iomuxc_spi(void)
 +__weak void tqma6_iomuxc_spi(void)
   {
   unsigned i;

 When implementing an baseboard specific init handler, we will get
 a warning about unused
 tqma6_ecspi1_pads and tqma6_ecspi1_cs, or did I miss something?
 
 I'm not getting one with the current (unfinished) WRU4 baseboard. Which has 
 no SPI.
 
Oops, not understand the weak mechanism completely - compiler sees usage of data
in weak function but linker selects function from baseboard - correct?
If this is the case, we have only the duplication of IOMUX and CS gpio.

 Just as a thought (not ready): Could we supply CS initialisation
 data via defines in the
 baseboard config header and append it to the tables if needed?
 
 Not sure if I understand this correctly. Could you give an example? Again, my 
 current baseboard has no SPI at all.
 

tqma6_iomux_spi is for the SPI controller the serial nor is connected,
so baseboard specific data are additional CS.

You could solve the data duplication using 

#define TQMA6_BB_ECSPI1_CS_GPIO IMX_GPIO_NR(n, mm),
#define TQMA6_BB_CS_PAD_CTRLNEW_PAD_CTRL(MX6_PAD_bla__GPIOn, IOmm, 
PAD_CTRL)

and in the board file:

if !defined(TQMA6_BB_ECSPI1_CS_GPIO)
#define TQMA6_BB_ECSPI1_CS_GPIO
#endif

static unsigned const tqma6_ecspi1_cs[] = {
   TQMA6_SF_CS_GPIO,
   TQMA6_BB_ECSPI1_CS_GPIO  
};

But OK, this looks not very nice

As I said, not completely ready, but would prevent some code duplication.

 Thanks,
 Stefan
 

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


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-13 Thread Stefan Roese

Hi Markus,

On 13.03.2015 10:05, Markus Niebel wrote:

-static void tqma6_iomuxc_spi(void)
+__weak void tqma6_iomuxc_spi(void)
   {
   unsigned i;


When implementing an baseboard specific init handler, we will get
a warning about unused
tqma6_ecspi1_pads and tqma6_ecspi1_cs, or did I miss something?


I'm not getting one with the current (unfinished) WRU4 baseboard. Which has no 
SPI.


Oops, not understand the weak mechanism completely - compiler sees usage of data
in weak function but linker selects function from baseboard - correct?
If this is the case, we have only the duplication of IOMUX and CS gpio.


Just as a thought (not ready): Could we supply CS initialisation
data via defines in the
baseboard config header and append it to the tables if needed?


Not sure if I understand this correctly. Could you give an example? Again, my 
current baseboard has no SPI at all.



tqma6_iomux_spi is for the SPI controller the serial nor is connected,
so baseboard specific data are additional CS.

You could solve the data duplication using

#define TQMA6_BB_ECSPI1_CS_GPIO IMX_GPIO_NR(n, mm),
#define TQMA6_BB_CS_PAD_CTRLNEW_PAD_CTRL(MX6_PAD_bla__GPIOn, IOmm, 
PAD_CTRL)

and in the board file:

if !defined(TQMA6_BB_ECSPI1_CS_GPIO)
#define TQMA6_BB_ECSPI1_CS_GPIO
#endif

static unsigned const tqma6_ecspi1_cs[] = {
TQMA6_SF_CS_GPIO,
TQMA6_BB_ECSPI1_CS_GPIO 
};

But OK, this looks not very nice

As I said, not completely ready, but would prevent some code duplication.


With my current approach we have code duplication. I suggest we give 
this version a try and see if it scales for other, future baseboards as 
well. If not, we can always try a solution like you described above.


Okay?

Thanks,
Stefan

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


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-13 Thread Stefan Roese

On 13.03.2015 14:25, Stefan Roese wrote:

But OK, this looks not very nice

As I said, not completely ready, but would prevent some code duplication.


With my current approach we have code duplication.


Ups. I meant we have *no* code duplication. Sorry!

Thanks,
Stefan

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


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-13 Thread Markus Niebel
Hello Stefan,
Am 13.03.2015 um 14:25 schrieb Stefan Roese:
 Hi Markus,
 
 On 13.03.2015 10:05, Markus Niebel wrote:

 Not sure if I understand this correctly. Could you give an example? Again, 
 my current baseboard has no SPI at all.


 tqma6_iomux_spi is for the SPI controller the serial nor is connected,
 so baseboard specific data are additional CS.

 You could solve the data duplication using

 #define TQMA6_BB_ECSPI1_CS_GPIOIMX_GPIO_NR(n, mm),
 #define TQMA6_BB_CS_PAD_CTRLNEW_PAD_CTRL(MX6_PAD_bla__GPIOn, IOmm, 
 PAD_CTRL)

 and in the board file:

 if !defined(TQMA6_BB_ECSPI1_CS_GPIO)
 #define TQMA6_BB_ECSPI1_CS_GPIO
 #endif

 static unsigned const tqma6_ecspi1_cs[] = {
 TQMA6_SF_CS_GPIO,
 TQMA6_BB_ECSPI1_CS_GPIO   
 };

 But OK, this looks not very nice

 As I said, not completely ready, but would prevent some code duplication.
 
 With my current approach we have code duplication. I suggest we give this 
 version a try and see if it scales for other, future baseboards as well. If 
 not, we can always try a solution like you described above.
 
 Okay?

Yes, Okay.

you can add my Acked-by
 
 Thanks,
 Stefan
 
Regards

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


[U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-12 Thread Stefan Roese
By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
add a different function for this SPI configuration. This can be used
by other baseboards, that might have a different SPI setup.

This patch will be used by the upcoming WRU-IV board support which also
uses the TQMa6 SoM.

Signed-off-by: Stefan Roese s...@denx.de
---
 board/tqc/tqma6/tqma6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
index c9e163e..29db838 100644
--- a/board/tqc/tqma6/tqma6.c
+++ b/board/tqc/tqma6/tqma6.c
@@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
TQMA6_SF_CS_GPIO,
 };
 
-static void tqma6_iomuxc_spi(void)
+__weak void tqma6_iomuxc_spi(void)
 {
unsigned i;
 
-- 
2.3.2

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


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-12 Thread Markus Niebel
Hello Stefan,

Am 12.03.2015 um 13:34 schrieb Stefan Roese:
 By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
 add a different function for this SPI configuration. This can be used
 by other baseboards, that might have a different SPI setup.
 
 This patch will be used by the upcoming WRU-IV board support which also
 uses the TQMa6 SoM.
 
 Signed-off-by: Stefan Roese s...@denx.de
 ---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
 index c9e163e..29db838 100644
 --- a/board/tqc/tqma6/tqma6.c
 +++ b/board/tqc/tqma6/tqma6.c
 @@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
   TQMA6_SF_CS_GPIO,
  };
  
 -static void tqma6_iomuxc_spi(void)
 +__weak void tqma6_iomuxc_spi(void)
  {
   unsigned i;
  
When implementing an baseboard specific init handler, we will get a warning 
about unused 
tqma6_ecspi1_pads and tqma6_ecspi1_cs, or did I miss something?

Just as a thought (not ready): Could we supply CS initialisation data via 
defines in the
baseboard config header and append it to the tables if needed?

Regards

Markus


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


Re: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

2015-03-12 Thread Stefan Roese

Hi Markus,

On 12.03.2015 15:25, Markus Niebel wrote:

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to
add a different function for this SPI configuration. This can be used
by other baseboards, that might have a different SPI setup.

This patch will be used by the upcoming WRU-IV board support which also
uses the TQMa6 SoM.

Signed-off-by: Stefan Roese s...@denx.de
---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
index c9e163e..29db838 100644
--- a/board/tqc/tqma6/tqma6.c
+++ b/board/tqc/tqma6/tqma6.c
@@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
TQMA6_SF_CS_GPIO,
  };

-static void tqma6_iomuxc_spi(void)
+__weak void tqma6_iomuxc_spi(void)
  {
unsigned i;


When implementing an baseboard specific init handler, we will get

 a warning about unused

tqma6_ecspi1_pads and tqma6_ecspi1_cs, or did I miss something?


I'm not getting one with the current (unfinished) WRU4 baseboard. Which 
has no SPI.



Just as a thought (not ready): Could we supply CS initialisation

 data via defines in the

baseboard config header and append it to the tables if needed?


Not sure if I understand this correctly. Could you give an example? 
Again, my current baseboard has no SPI at all.


Thanks,
Stefan

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