Skip to contentSkip to conversation

arm: mx6: tqma6: Fix USB and add other filesystems

PATCH New Stefan Roese 5 participants 17 messages Mar 12, 2015 – May 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 arm: mx6: tqma6: Fix USB and add other filesystems

This patch fixes the USB EHCI support on the TQMa6 SoM. Additionally some filesystems are added, included the generic FS commands (e.g. ls...).

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
 include/configs/tqma6.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
include/configs/tqma6.h +5 -2
index a099687..9022550 100644
@@ -125,16 +125,19 @@
 #define CONFIG_USB_STORAGE
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT	1
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_MXC_USB_FLAGS	0
+#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
 
 /* Fuses */
 #define CONFIG_MXC_OCOTP
 #define CONFIG_CMD_FUSE
 
 #define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_CMD_PING
Signature · 1 line
2.3.2
#1 lore raw

PATCH 1/3 arm: mx6: tqma6: Fix USB and add other filesystems

Hi Stefano,

Quoted 27 lines · Stefan Roese

This patch fixes the USB EHCI support on the TQMa6 SoM. Additionally some filesystems are added, included the generic FS commands (e.g. ls...).

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
  include/configs/tqma6.h | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
include/configs/tqma6.h +2 -2
index a099687..9022550 100644
@@ -125,16 +125,19 @@
  #define CONFIG_USB_STORAGE
  #define CONFIG_USB_HOST_ETHER
  #define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT	1
  #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_MXC_USB_FLAGS	0
+#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
 
  /* Fuses */
  #define CONFIG_MXC_OCOTP

include/configs/tqma6.h line 143

Quoted 10 lines
include/configs/tqma6.h +3 -0
  #define CONFIG_CMD_FUSE
 
  #define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
  #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
  #define CONFIG_DOS_PARTITION
 
  #define CONFIG_CMD_PING

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

Thanks,
Stefan

#2 lore raw

PATCH 1/3 arm: mx6: tqma6: Fix USB and add other filesystems

Quoted 39 lines · Stefan Roese

Hi Stefano,

Quoted 36 lines · Stefan Roese

This patch fixes the USB EHCI support on the TQMa6 SoM. Additionally some filesystems are added, included the generic FS commands (e.g. ls...).

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
  include/configs/tqma6.h | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
include/configs/tqma6.h +5 -2
index a099687..9022550 100644
@@ -125,16 +125,19 @@
  #define CONFIG_USB_STORAGE
  #define CONFIG_USB_HOST_ETHER
  #define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT    1
  #define CONFIG_MXC_USB_PORTSC    (PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_MXC_USB_FLAGS    0
+#define CONFIG_USB_MAX_CONTROLLER_COUNT    2
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET    /* For OTG port */
 
  /* Fuses */
  #define CONFIG_MXC_OCOTP
  #define CONFIG_CMD_FUSE
 
  #define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
  #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
  #define CONFIG_DOS_PARTITION
 
Quoted 4 lines

include/configs/tqma6.h line 143

Quoted 1 line
include/configs/tqma6.h +0 -0
  #define CONFIG_CMD_PING

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

Sorry, I confuse these ones with the patches to split tqma code and I was convinced I have already applied. I'll do it.

Best regards,
Stefano

Signature · 5 lines
=====================================================================
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: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

In reply to 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.

---
 board/tqc/tqma6/tqma6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/tqc/tqma6/tqma6.c +1 -1
index c9e163e..29db838 100644
@@ -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;
 
Signature · 1 line
2.3.2
#4 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

Hello Stefan,

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

Quoted 17 lines

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.

---
 board/tqc/tqma6/tqma6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/tqc/tqma6/tqma6.c +0 -0
index c9e163e..29db838 100644

board/tqc/tqma6/tqma6.c static unsigned const tqma6_ecspi1_cs[] = { · line 151

Quoted 8 lines
board/tqc/tqma6/tqma6.c +1 -1
@@ -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

#5 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

Hi Markus,

Quoted 21 lines · Markus Niebel

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

Quoted 20 lines

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.

---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/tqc/tqma6/tqma6.c +0 -0
index c9e163e..29db838 100644
@@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
  	TQMA6_SF_CS_GPIO,
  };
 
Quoted 8 lines

board/tqc/tqma6/tqma6.c static unsigned const tqma6_ecspi1_cs[] = { · line 151

Quoted 5 lines
board/tqc/tqma6/tqma6.c +1 -1
-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.

Quoted 3 lines

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

#6 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

Hello Stefan,
Am 12.03.2015 um 16:18 schrieb Stefan Roese:

Quoted 33 lines

Hi Markus,

Quoted 21 lines · Markus Niebel

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

Quoted 20 lines

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.

---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/tqc/tqma6/tqma6.c +0 -0
index c9e163e..29db838 100644
@@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
      TQMA6_SF_CS_GPIO,
  };
 
Quoted 8 lines

board/tqc/tqma6/tqma6.c static unsigned const tqma6_ecspi1_cs[] = { · line 151

Quoted 5 lines
board/tqc/tqma6/tqma6.c +1 -1
-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?

Quoted 2 lines

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.

Quoted 6 lines
Quoted 3 lines

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_CTRL NEW_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.

Quoted 3 lines

Thanks,
Stefan

#7 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

Hi Markus,

Quoted 36 lines · Markus Niebel
Quoted 11 lines
Quoted 8 lines

board/tqc/tqma6/tqma6.c static unsigned const tqma6_ecspi1_cs[] = { · line 150

Quoted 5 lines
board/tqc/tqma6/tqma6.c +1 -1
-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.

Quoted 6 lines
Quoted 3 lines

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_CTRL NEW_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

Quoted 8 lines
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

#8 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

Quoted 5 lines · Stefan Roese
Quoted 3 lines

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

#9 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

In reply to Stefan Roese

Hello Stefan,
Am 13.03.2015 um 14:25 schrieb Stefan Roese:

Quoted 26 lines

Hi Markus,

Quoted 23 lines · Markus Niebel
Quoted 3 lines

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_CTRL NEW_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   
};
Quoted 7 lines
Quoted 3 lines

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

Quoted 4 lines

Thanks,
Stefan

Regards

Markus

#10 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

In reply to Stefan Roese

Hi Stefano,

Quoted 18 lines · 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.

---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/tqc/tqma6/tqma6.c +0 -0
index c9e163e..29db838 100644

board/tqc/tqma6/tqma6.c static unsigned const tqma6_ecspi1_cs[] = { · line 151

Quoted 8 lines
board/tqc/tqma6/tqma6.c +1 -1
@@ -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

#11 lore raw

PATCH 2/3 arm: mx6: tqma6: Update to optionally configure an alternative SPI setup

Quoted 23 lines · Stefan Roese

Hi Stefano,

Quoted 20 lines · 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.

---
  board/tqc/tqma6/tqma6.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/tqc/tqma6/tqma6.c +0 -0
index c9e163e..29db838 100644
@@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = {
      TQMA6_SF_CS_GPIO,
  };
 
Quoted 9 lines

board/tqc/tqma6/tqma6.c static unsigned const tqma6_ecspi1_cs[] = { · line 151

Quoted 6 lines
board/tqc/tqma6/tqma6.c +1 -1
-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

Signature · 5 lines
=====================================================================
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: sbabic at denx.de
=====================================================================
#12 lore raw

PATCH 1/3 arm: mx6: tqma6: Fix USB and add other filesystems

In reply to Stefan Roese

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

Quoted 28 lines

This patch fixes the USB EHCI support on the TQMa6 SoM. Additionally some filesystems are added, included the generic FS commands (e.g. ls...).

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
 include/configs/tqma6.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
include/configs/tqma6.h +2 -2
index a099687..9022550 100644
@@ -125,16 +125,19 @@
 #define CONFIG_USB_STORAGE
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT	1
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_MXC_USB_FLAGS	0
+#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
 
 /* Fuses */
 #define CONFIG_MXC_OCOTP

include/configs/tqma6.h line 143

Quoted 10 lines
include/configs/tqma6.h +3 -0
 #define CONFIG_CMD_FUSE
 
 #define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_CMD_PING
#13 lore raw

PATCH 3/3 arm: mx6: tqma6: Extract baseboard configs into separate config file

In reply to Stefan Roese

This patch extracts all baseboard specific defines into a separate config file. This makes it easier to add other baseboards that use the TQMa6 SoM.

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

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
 include/configs/tqma6.h      | 52 ++++++++++----------------------------------
 include/configs/tqma6_mba6.h | 32 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 41 deletions(-)
 create mode 100644 include/configs/tqma6_mba6.h
include/configs/tqma6.h +11 -41
index 9022550..69b6b57 100644
@@ -35,16 +35,6 @@
 #define PHYS_SDRAM_SIZE			(1024u * SZ_1M)
 #endif
 
-#if defined(CONFIG_MBA6)
-
-#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
-#define CONFIG_DEFAULT_FDT_FILE		"imx6dl-mba6x.dtb"
-#elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6Q)
-#define CONFIG_DEFAULT_FDT_FILE		"imx6q-mba6x.dtb"
-#endif
-
-#endif
-
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_SYS_GENERIC_BOARD
@@ -85,11 +75,6 @@
 
 /* I2C SYSMON (LM75) */
 #define CONFIG_DTT_LM75
-#if defined(CONFIG_MBA6)
-#define CONFIG_DTT_SENSORS		{ 0, 1 }
-#else
-#define CONFIG_DTT_SENSORS		{ 0 }
-#endif
 #define CONFIG_DTT_MAX_TEMP		70
 #define CONFIG_DTT_MIN_TEMP		-30
 #define CONFIG_DTT_HYSTERESIS	3
@@ -150,38 +135,12 @@
 #define CONFIG_PHYLIB
 #define CONFIG_MII
 
-#if defined(CONFIG_MBA6)
-
-#define CONFIG_FEC_XCV_TYPE		RGMII
-#define CONFIG_ETHPRIME			"FEC"
-
-#define CONFIG_FEC_MXC_PHYADDR		0x03
-#define CONFIG_PHY_MICREL
-#define CONFIG_PHY_KSZ9031
-
-#else
-
-#error "define PHY to use for your baseboard"
-
-#endif
-
 #define CONFIG_ARP_TIMEOUT		200UL
 /* Network config - Allow larger/faster download for TFTP/NFS */
 #define CONFIG_IP_DEFRAG
 #define CONFIG_TFTP_BLOCKSIZE	4096
 #define CONFIG_NFS_READ_SIZE	4096
 
-#if defined(CONFIG_MBA6)
-
-#define CONFIG_MXC_UART_BASE		UART2_BASE
-#define CONFIG_CONSOLE_DEV		"ttymxc1"
-
-#else
-
-#error "define baseboard specific things (uart, number of SD-card slots)"
-
-#endif
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX		1
@@ -495,4 +454,15 @@
 #define CONFIG_CMD_CACHE
 #endif
 
+/*
+ * All the defines above are for the TQMa6 SoM
+ *
+ * Now include the baseboard specific configuration
+ */
+#ifdef CONFIG_MBA6
+#include "tqma6_mba6.h"
+#else
+#error "No baseboard for the TQMa6 defined!"
+#endif
+
 #endif /* __CONFIG_H */
include/configs/tqma6_mba6.h new file +32 -0
new file mode 100644
index 0000000..a16120a
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2013, 2014 Markus Niebel <[email protected]>
+ *
+ * Configuration settings for the TQ Systems TQMa6<Q,S> module.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_TQMA6_MBA6_H
+#define __CONFIG_TQMA6_MBA6_H
+
+/* And now the baseboard specific configuration */
+
+#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
+#define CONFIG_DEFAULT_FDT_FILE		"imx6dl-mba6x.dtb"
+#elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6Q)
+#define CONFIG_DEFAULT_FDT_FILE		"imx6q-mba6x.dtb"
+#endif
+
+#define CONFIG_DTT_SENSORS		{ 0, 1 }
+
+#define CONFIG_FEC_XCV_TYPE		RGMII
+#define CONFIG_ETHPRIME			"FEC"
+
+#define CONFIG_FEC_MXC_PHYADDR		0x03
+#define CONFIG_PHY_MICREL
+#define CONFIG_PHY_KSZ9031
+
+#define CONFIG_MXC_UART_BASE		UART2_BASE
+#define CONFIG_CONSOLE_DEV		"ttymxc1"
+
+#endif /* __CONFIG_TQMA6_MBA6_H */
Signature · 1 line
2.3.2
#14 lore raw

PATCH 3/3 arm: mx6: tqma6: Extract baseboard configs into separate config file

Hello Stefan,

I like the idea - did not know at time when we brought it to mainline that splitting configs is an allowed way. See comment.

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

Quoted 37 lines

This patch extracts all baseboard specific defines into a separate config file. This makes it easier to add other baseboards that use the TQMa6 SoM.

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

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
 include/configs/tqma6.h      | 52 ++++++++++----------------------------------
 include/configs/tqma6_mba6.h | 32 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 41 deletions(-)
 create mode 100644 include/configs/tqma6_mba6.h
include/configs/tqma6.h +0 -10
index 9022550..69b6b57 100644
@@ -35,16 +35,6 @@
 #define PHYS_SDRAM_SIZE			(1024u * SZ_1M)
 #endif
 
-#if defined(CONFIG_MBA6)
-
-#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
-#define CONFIG_DEFAULT_FDT_FILE		"imx6dl-mba6x.dtb"
-#elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6Q)
-#define CONFIG_DEFAULT_FDT_FILE		"imx6q-mba6x.dtb"
-#endif
-
-#endif
-
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_SYS_GENERIC_BOARD

include/configs/tqma6.h line 91

Quoted 7 lines
include/configs/tqma6.h +0 -4
@@ -85,11 +75,6 @@
 
 /* I2C SYSMON (LM75) */
 #define CONFIG_DTT_LM75
-#if defined(CONFIG_MBA6)
-#define CONFIG_DTT_SENSORS		{ 0, 1 }
-#else
-#define CONFIG_DTT_SENSORS		{ 0 }

This will be lost for baseboards not implementing DTT_SENSORS feature

Quoted 47 lines
include/configs/tqma6.h +0 -27
-#endif
 #define CONFIG_DTT_MAX_TEMP		70
 #define CONFIG_DTT_MIN_TEMP		-30
 #define CONFIG_DTT_HYSTERESIS	3
@@ -150,38 +135,12 @@
 #define CONFIG_PHYLIB
 #define CONFIG_MII
 
-#if defined(CONFIG_MBA6)
-
-#define CONFIG_FEC_XCV_TYPE		RGMII
-#define CONFIG_ETHPRIME			"FEC"
-
-#define CONFIG_FEC_MXC_PHYADDR		0x03
-#define CONFIG_PHY_MICREL
-#define CONFIG_PHY_KSZ9031
-
-#else
-
-#error "define PHY to use for your baseboard"
-
-#endif
-
 #define CONFIG_ARP_TIMEOUT		200UL
 /* Network config - Allow larger/faster download for TFTP/NFS */
 #define CONFIG_IP_DEFRAG
 #define CONFIG_TFTP_BLOCKSIZE	4096
 #define CONFIG_NFS_READ_SIZE	4096
 
-#if defined(CONFIG_MBA6)
-
-#define CONFIG_MXC_UART_BASE		UART2_BASE
-#define CONFIG_CONSOLE_DEV		"ttymxc1"
-
-#else
-
-#error "define baseboard specific things (uart, number of SD-card slots)"
-
-#endif
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX		1
@@ -495,4 +454,15 @@
 #define CONFIG_CMD_CACHE
 #endif
 

include/configs/tqma6.h line 466

Quoted 10 lines
include/configs/tqma6.h +10 -0
+/*
+ * All the defines above are for the TQMa6 SoM
+ *
+ * Now include the baseboard specific configuration
+ */
+#ifdef CONFIG_MBA6
+#include "tqma6_mba6.h"
+#else
+#error "No baseboard for the TQMa6 defined!"
+#endif

Maybe this is the right place to add something like:

/* support at least the sensor on TQMa6 SOM */
#if !defined(CONFIG_DTT_SENSORS)
#define CONFIG_DTT_SENSORS { 0 }
#endif

Quoted 10 lines
include/configs/tqma6.h +1 -0
+
 #endif /* __CONFIG_H */
include/configs/tqma6_mba6.h new file +2 -0
new file mode 100644
index 0000000..a16120a
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2013, 2014 Markus Niebel <[email protected]>

include/configs/tqma6_mba6.h line 12

Quoted 10 lines
include/configs/tqma6_mba6.h new file +10 -0
+ *
+ * Configuration settings for the TQ Systems TQMa6<Q,S> module.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_TQMA6_MBA6_H
+#define __CONFIG_TQMA6_MBA6_H
+
+/* And now the baseboard specific configuration */

Please delete this comment.

Quoted 11 lines
include/configs/tqma6_mba6.h new file +10 -0
+
+#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
+#define CONFIG_DEFAULT_FDT_FILE		"imx6dl-mba6x.dtb"
+#elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6Q)
+#define CONFIG_DEFAULT_FDT_FILE		"imx6q-mba6x.dtb"
+#endif
+
+#define CONFIG_DTT_SENSORS		{ 0, 1 }
+
+#define CONFIG_FEC_XCV_TYPE		RGMII

include/configs/tqma6_mba6.h line 32

Quoted 10 lines
include/configs/tqma6_mba6.h new file +10 -0
+#define CONFIG_ETHPRIME			"FEC"
+
+#define CONFIG_FEC_MXC_PHYADDR		0x03
+#define CONFIG_PHY_MICREL
+#define CONFIG_PHY_KSZ9031
+
+#define CONFIG_MXC_UART_BASE		UART2_BASE
+#define CONFIG_CONSOLE_DEV		"ttymxc1"
+
+#endif /* __CONFIG_TQMA6_MBA6_H */

Regards

Markus

#15 lore raw

PATCH 3/3 arm: mx6: tqma6: Extract baseboard configs into separate config file

Hi Markus,

Quoted 3 lines · Markus Niebel

I like the idea - did not know at time when we brought it to mainline that splitting configs
is an allowed way.

No, I'm not aware of such a thing. This proposed config file addition for the baseboard makes integration of multiple baseboards much easier than the current approach with the ugly #ifdef mess. So I definitely prefer this new version.

Quoted 1 line

See comment.

Okay. Some answers from me as well below.

Quoted 39 lines

Am 12.03.2015 um 13:34 schrieb Stefan Roese:

Quoted 38 lines

This patch extracts all baseboard specific defines into a separate config file. This makes it easier to add other baseboards that use the TQMa6 SoM.

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

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>
---
  include/configs/tqma6.h      | 52 ++++++++++----------------------------------
  include/configs/tqma6_mba6.h | 32 +++++++++++++++++++++++++++
  2 files changed, 43 insertions(+), 41 deletions(-)

create mode 100644 include/configs/tqma6_mba6.h

include/configs/tqma6.h +0 -10
index 9022550..69b6b57 100644
@@ -35,16 +35,6 @@
  #define PHYS_SDRAM_SIZE			(1024u * SZ_1M)
  #endif
 
-#if defined(CONFIG_MBA6)
-
-#if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
-#define CONFIG_DEFAULT_FDT_FILE		"imx6dl-mba6x.dtb"
-#elif defined(CONFIG_MX6Q) || defined(CONFIG_MX6Q)
-#define CONFIG_DEFAULT_FDT_FILE		"imx6q-mba6x.dtb"
-#endif
-
-#endif
-
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO
  #define CONFIG_SYS_GENERIC_BOARD
@@ -85,11 +75,6 @@
 
Quoted 7 lines

include/configs/tqma6.h line 91

Quoted 6 lines
include/configs/tqma6.h +0 -4
  /* I2C SYSMON (LM75) */
  #define CONFIG_DTT_LM75
-#if defined(CONFIG_MBA6)
-#define CONFIG_DTT_SENSORS		{ 0, 1 }
-#else
-#define CONFIG_DTT_SENSORS		{ 0 }

This will be lost for baseboards not implementing DTT_SENSORS feature

I was wondering, why this define was there. And now its clear. Thanks. I'll update the patch accordingly.

Quoted 60 lines
Quoted 47 lines
include/configs/tqma6.h +0 -27
-#endif
  #define CONFIG_DTT_MAX_TEMP		70
  #define CONFIG_DTT_MIN_TEMP		-30
  #define CONFIG_DTT_HYSTERESIS	3
@@ -150,38 +135,12 @@
  #define CONFIG_PHYLIB
  #define CONFIG_MII
 
-#if defined(CONFIG_MBA6)
-
-#define CONFIG_FEC_XCV_TYPE		RGMII
-#define CONFIG_ETHPRIME			"FEC"
-
-#define CONFIG_FEC_MXC_PHYADDR		0x03
-#define CONFIG_PHY_MICREL
-#define CONFIG_PHY_KSZ9031
-
-#else
-
-#error "define PHY to use for your baseboard"
-
-#endif
-
  #define CONFIG_ARP_TIMEOUT		200UL
  /* Network config - Allow larger/faster download for TFTP/NFS */
  #define CONFIG_IP_DEFRAG
  #define CONFIG_TFTP_BLOCKSIZE	4096
  #define CONFIG_NFS_READ_SIZE	4096
 
-#if defined(CONFIG_MBA6)
-
-#define CONFIG_MXC_UART_BASE		UART2_BASE
-#define CONFIG_CONSOLE_DEV		"ttymxc1"
-
-#else
-
-#error "define baseboard specific things (uart, number of SD-card slots)"
-
-#endif
-
  /* allow to overwrite serial and ethaddr */
  #define CONFIG_ENV_OVERWRITE
  #define CONFIG_CONS_INDEX		1
@@ -495,4 +454,15 @@
  #define CONFIG_CMD_CACHE
  #endif
 

include/configs/tqma6.h line 466

Quoted 10 lines
include/configs/tqma6.h +10 -0
+/*
+ * All the defines above are for the TQMa6 SoM
+ *
+ * Now include the baseboard specific configuration
+ */
+#ifdef CONFIG_MBA6
+#include "tqma6_mba6.h"
+#else
+#error "No baseboard for the TQMa6 defined!"
+#endif

Maybe this is the right place to add something like:

Quoted 4 lines

/* support at least the sensor on TQMa6 SOM */
#if !defined(CONFIG_DTT_SENSORS)
#define CONFIG_DTT_SENSORS { 0 }
#endif

Yes, will do. Thanks.

Quoted 13 lines
Quoted 13 lines
include/configs/tqma6.h +1 -0
+
  #endif /* __CONFIG_H */
include/configs/tqma6_mba6.h new file +5 -0
new file mode 100644
index 0000000..a16120a
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2013, 2014 Markus Niebel <[email protected]>
+ *
+ * Configuration settings for the TQ Systems TQMa6<Q,S> module.
+ *
Quoted 8 lines

include/configs/tqma6_mba6.h line 12

Quoted 7 lines
include/configs/tqma6_mba6.h new file +7 -0
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_TQMA6_MBA6_H
+#define __CONFIG_TQMA6_MBA6_H
+
+/* And now the baseboard specific configuration */

Please delete this comment.

Okay.

Thanks,
Stefan

#16 lore raw

PATCH 1/3 arm: mx6: tqma6: Fix USB and add other filesystems

In reply to Stefan Roese
Quoted 8 lines · Stefan Roese

This patch fixes the USB EHCI support on the TQMa6 SoM. Additionally some filesystems are added, included the generic FS commands (e.g. ls...).

Cc Markus Niebel <[email protected]>
Cc Stefano Babic <[email protected]>

---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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: sbabic at denx.de
=====================================================================