All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [ 0/2] tqma6: trivial fixes
@ 2014-10-23 13:47 Markus Niebel
  2014-10-23 13:47 ` [U-Boot] [ 1/2] tqma6: fix sf detection Markus Niebel
  2014-10-23 13:47 ` [U-Boot] [ 2/2] tqma6: fix typo in header guard define Markus Niebel
  0 siblings, 2 replies; 6+ messages in thread
From: Markus Niebel @ 2014-10-23 13:47 UTC (permalink / raw)
  To: u-boot

From: Markus Niebel <Markus.Niebel@tq-group.com>

two trivial fixes for the TQ Systems TQMa6 modules.
Thanks to Anatolij Gustschin to bring the first to
my attention

Markus Niebel (2):
  tqma6: fix sf detection
  tqma6: fix typo in header guard define

 board/tqc/tqma6/tqma6.c    | 10 +++++++++-
 board/tqc/tqma6/tqma6_bb.h |  2 +-
 include/configs/tqma6.h    | 19 ++++++++++++++++---
 3 files changed, 26 insertions(+), 5 deletions(-)

-- 
2.1.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [ 1/2] tqma6: fix sf detection
  2014-10-23 13:47 [U-Boot] [ 0/2] tqma6: trivial fixes Markus Niebel
@ 2014-10-23 13:47 ` Markus Niebel
  2014-10-27 18:18   ` Jagan Teki
  2014-10-30  9:44   ` Stefano Babic
  2014-10-23 13:47 ` [U-Boot] [ 2/2] tqma6: fix typo in header guard define Markus Niebel
  1 sibling, 2 replies; 6+ messages in thread
From: Markus Niebel @ 2014-10-23 13:47 UTC (permalink / raw)
  To: u-boot

From: Markus Niebel <Markus.Niebel@tq-group.com>

Commit 155fa9af95ac5be857a7327e7a968a296e60d4c8 changed the way
to define a GPIO line, which can be used to force CS high
across multiple transactions. In order to fix sf detection
change board code to make use of board_spi_cs_gpio(..).

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
---
 board/tqc/tqma6/tqma6.c | 10 +++++++++-
 include/configs/tqma6.h | 19 ++++++++++++++++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
index b552bb8..fd1bd59 100644
--- a/board/tqc/tqma6/tqma6.c
+++ b/board/tqc/tqma6/tqma6.c
@@ -138,8 +138,10 @@ static iomux_v3_cfg_t const tqma6_ecspi1_pads[] = {
 	NEW_PAD_CTRL(MX6_PAD_EIM_D18__ECSPI1_MOSI, SPI_PAD_CTRL),
 };
 
+#define TQMA6_SF_CS_GPIO IMX_GPIO_NR(3, 19)
+
 static unsigned const tqma6_ecspi1_cs[] = {
-	IMX_GPIO_NR(3, 19),
+	TQMA6_SF_CS_GPIO,
 };
 
 static void tqma6_iomuxc_spi(void)
@@ -152,6 +154,12 @@ static void tqma6_iomuxc_spi(void)
 					 ARRAY_SIZE(tqma6_ecspi1_pads));
 }
 
+int board_spi_cs_gpio(unsigned bus, unsigned cs)
+{
+	return ((bus == CONFIG_SF_DEFAULT_BUS) &&
+		(cs == CONFIG_SF_DEFAULT_CS)) ? TQMA6_SF_CS_GPIO : -1;
+}
+
 static struct i2c_pads_info tqma6_i2c3_pads = {
 	/* I2C3: on board LM75, M24C64,  */
 	.scl = {
diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h
index 2705d2c..9ba0155 100644
--- a/include/configs/tqma6.h
+++ b/include/configs/tqma6.h
@@ -9,13 +9,26 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_MX6
+
+/* SPL */
+/* #if defined(CONFIG_SPL_BUILD) */
+
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_EXT_SUPPORT
+
+/* common IMX6 SPL configuration */
+#include "imx6_spl.h"
+
+/* #endif */
+
 #include "mx6_common.h"
 #include <asm/arch/imx-regs.h>
 #include <asm/imx-common/gpio.h>
 #include <linux/sizes.h>
 
-#define CONFIG_MX6
-
 #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
 #define PHYS_SDRAM_SIZE			(512u * SZ_1M)
 #elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6D)
@@ -57,7 +70,7 @@
 
 #define CONFIG_CMD_SF
 #define CONFIG_SF_DEFAULT_BUS	0
-#define CONFIG_SF_DEFAULT_CS	(0 | (IMX_GPIO_NR(3, 19) << 8))
+#define CONFIG_SF_DEFAULT_CS	0
 #define CONFIG_SF_DEFAULT_SPEED	50000000
 #define CONFIG_SF_DEFAULT_MODE	(SPI_MODE_0)
 
-- 
2.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [ 2/2] tqma6: fix typo in header guard define
  2014-10-23 13:47 [U-Boot] [ 0/2] tqma6: trivial fixes Markus Niebel
  2014-10-23 13:47 ` [U-Boot] [ 1/2] tqma6: fix sf detection Markus Niebel
@ 2014-10-23 13:47 ` Markus Niebel
  2014-10-30  9:44   ` Stefano Babic
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Niebel @ 2014-10-23 13:47 UTC (permalink / raw)
  To: u-boot

From: Markus Niebel <Markus.Niebel@tq-group.com>

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
---
 board/tqc/tqma6/tqma6_bb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/tqc/tqma6/tqma6_bb.h b/board/tqc/tqma6/tqma6_bb.h
index 9d072d2..fb7b462 100644
--- a/board/tqc/tqma6/tqma6_bb.h
+++ b/board/tqc/tqma6/tqma6_bb.h
@@ -6,7 +6,7 @@
  */
 
 #ifndef __TQMA6_BB__
-#define __TQMA6_BB
+#define __TQMA6_BB__
 
 #include <common.h>
 
-- 
2.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [ 1/2] tqma6: fix sf detection
  2014-10-23 13:47 ` [U-Boot] [ 1/2] tqma6: fix sf detection Markus Niebel
@ 2014-10-27 18:18   ` Jagan Teki
  2014-10-30  9:44   ` Stefano Babic
  1 sibling, 0 replies; 6+ messages in thread
From: Jagan Teki @ 2014-10-27 18:18 UTC (permalink / raw)
  To: u-boot

On 23 October 2014 19:17, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
> From: Markus Niebel <Markus.Niebel@tq-group.com>
>
> Commit 155fa9af95ac5be857a7327e7a968a296e60d4c8 changed the way
> to define a GPIO line, which can be used to force CS high
> across multiple transactions. In order to fix sf detection
> change board code to make use of board_spi_cs_gpio(..).
>
> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
> ---
>  board/tqc/tqma6/tqma6.c | 10 +++++++++-
>  include/configs/tqma6.h | 19 ++++++++++++++++---
>  2 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c
> index b552bb8..fd1bd59 100644
> --- a/board/tqc/tqma6/tqma6.c
> +++ b/board/tqc/tqma6/tqma6.c
> @@ -138,8 +138,10 @@ static iomux_v3_cfg_t const tqma6_ecspi1_pads[] = {
>         NEW_PAD_CTRL(MX6_PAD_EIM_D18__ECSPI1_MOSI, SPI_PAD_CTRL),
>  };
>
> +#define TQMA6_SF_CS_GPIO IMX_GPIO_NR(3, 19)
> +
>  static unsigned const tqma6_ecspi1_cs[] = {
> -       IMX_GPIO_NR(3, 19),
> +       TQMA6_SF_CS_GPIO,
>  };
>
>  static void tqma6_iomuxc_spi(void)
> @@ -152,6 +154,12 @@ static void tqma6_iomuxc_spi(void)
>                                          ARRAY_SIZE(tqma6_ecspi1_pads));
>  }
>
> +int board_spi_cs_gpio(unsigned bus, unsigned cs)
> +{
> +       return ((bus == CONFIG_SF_DEFAULT_BUS) &&
> +               (cs == CONFIG_SF_DEFAULT_CS)) ? TQMA6_SF_CS_GPIO : -1;
> +}
> +

This always be a puzzle to me, (spi flash, here) driver controlled
stuff is validating in board entries.
Which I couldn't see a correct idea.

>  static struct i2c_pads_info tqma6_i2c3_pads = {
>         /* I2C3: on board LM75, M24C64,  */
>         .scl = {
> diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h
> index 2705d2c..9ba0155 100644
> --- a/include/configs/tqma6.h
> +++ b/include/configs/tqma6.h
> @@ -9,13 +9,26 @@
>  #ifndef __CONFIG_H
>  #define __CONFIG_H
>
> +#define CONFIG_MX6
> +
> +/* SPL */
> +/* #if defined(CONFIG_SPL_BUILD) */
> +
> +#define CONFIG_SPL_MMC_SUPPORT
> +#define CONFIG_SPL_SPI_SUPPORT
> +#define CONFIG_SPL_FAT_SUPPORT
> +#define CONFIG_SPL_EXT_SUPPORT
> +
> +/* common IMX6 SPL configuration */
> +#include "imx6_spl.h"
> +
> +/* #endif */
> +
>  #include "mx6_common.h"
>  #include <asm/arch/imx-regs.h>
>  #include <asm/imx-common/gpio.h>
>  #include <linux/sizes.h>
>
> -#define CONFIG_MX6
> -
>  #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
>  #define PHYS_SDRAM_SIZE                        (512u * SZ_1M)
>  #elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6D)
> @@ -57,7 +70,7 @@
>
>  #define CONFIG_CMD_SF
>  #define CONFIG_SF_DEFAULT_BUS  0
> -#define CONFIG_SF_DEFAULT_CS   (0 | (IMX_GPIO_NR(3, 19) << 8))
> +#define CONFIG_SF_DEFAULT_CS   0
>  #define CONFIG_SF_DEFAULT_SPEED        50000000
>  #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
>
> --
> 2.1.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


thanks!
-- 
Jagan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [ 1/2] tqma6: fix sf detection
  2014-10-23 13:47 ` [U-Boot] [ 1/2] tqma6: fix sf detection Markus Niebel
  2014-10-27 18:18   ` Jagan Teki
@ 2014-10-30  9:44   ` Stefano Babic
  1 sibling, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2014-10-30  9:44 UTC (permalink / raw)
  To: u-boot

On 23/10/2014 15:47, Markus Niebel wrote:
> From: Markus Niebel <Markus.Niebel@tq-group.com>
> 
> Commit 155fa9af95ac5be857a7327e7a968a296e60d4c8 changed the way
> to define a GPIO line, which can be used to force CS high
> across multiple transactions. In order to fix sf detection
> change board code to make use of board_spi_cs_gpio(..).
> 
> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [ 2/2] tqma6: fix typo in header guard define
  2014-10-23 13:47 ` [U-Boot] [ 2/2] tqma6: fix typo in header guard define Markus Niebel
@ 2014-10-30  9:44   ` Stefano Babic
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2014-10-30  9:44 UTC (permalink / raw)
  To: u-boot

On 23/10/2014 15:47, Markus Niebel wrote:
> From: Markus Niebel <Markus.Niebel@tq-group.com>
> 
> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-30  9:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23 13:47 [U-Boot] [ 0/2] tqma6: trivial fixes Markus Niebel
2014-10-23 13:47 ` [U-Boot] [ 1/2] tqma6: fix sf detection Markus Niebel
2014-10-27 18:18   ` Jagan Teki
2014-10-30  9:44   ` Stefano Babic
2014-10-23 13:47 ` [U-Boot] [ 2/2] tqma6: fix typo in header guard define Markus Niebel
2014-10-30  9:44   ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.