Skip to contentSkip to conversation

Add TQ Systems TQMa6 board support

PATCH Superseded Markus Niebel 3 participants 5 messages Jun 23, 2014 – Jul 10, 2014

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Add TQ Systems TQMa6 board support

From: Markus Niebel <[email protected]>

This patch adds the changes to boards.cfg and the board directory under board/tqc.

TQMa6 is a family of modules based on Freescale i.MX6. It consists of TQMa6Q (i.MX6 Quad), TQMa6D (i.MX6 Dual) featuring eMMC, and 1 GiB DDR3 TQMa6S (i.MX6 Solo) featuring eMMC and 512 MiB DDR3

The modules need a baseboard. Initially the MBa6x starterkit mainboard is supported. To easy support for other mainboards the functionality is splitted in one file for the module (tqma6.c) and one file for the baseboard (tqma6_ mba6).

The modules can be boot from eMMC (on USDHC3) and SPI flash.

The following features are supported:
- MMC: eMMC on module (on USDHC3) and SD-card (on MBa6x mainboard)
- Ethernet: RGMII using micrel KSZ9031 phy on MBa6x mainboard for TQMa6<x> module. The phy needs special configurations for the pad skew registers to adjust for the signal routing.
Also support for standard ethernet commands and uppdate via tftp.
- SPI: ECSPI1 with bootable serial flash on module and two additional chip selects on MBa6x
- I2C: This patch adds support for the I2C busses on the TQMa6<x> modules (I2C3) and MBa6x baseboards (I2C1). The LM75 temperature sensors on TQMa6<x> and MBa6x are also configured.
- USB: high speed host 1 on MBa6x and support for USB storage
- PMIC: support for pfuze 100 on TQMa6<x>

---
History:

- changes for v3:
- squash the patches as suggested by S. Babic
- fix copy and paste error for MBa6x SD-Card slot
- fix WP handling for MBa6x SD-Card slot
- move PMIC init to board_late_init (power_init_board() does not work)

- changes for v2:
- fix long line warning as suggested by W. Denk
- remove baudrate from CONFIG_EXTRA_ENV_SETTINGS
- remove unused define CONFIG_TQMA6X_BASEBOARD_NAME
- add missing mmcblkdev definition to mmcboot logic in CONFIG_EXTRA_ENV_SETTINGS
- add missing stuff for tftp and nfs in CONFIG_EXTRA_ENV_SETTINGS
- fix fdt_file in env (was partially fdt)
- add missing int power_init_board(void) to tqma6.c

 board/tqc/tqma6/Makefile     |    9 +
 board/tqc/tqma6/README       |   35 ++++
 board/tqc/tqma6/clocks.cfg   |   24 +++
 board/tqc/tqma6/tqma6.c      |  258 +++++++++++++++++++++++
 board/tqc/tqma6/tqma6_bb.h   |   30 +++
 board/tqc/tqma6/tqma6_mba6.c |  352 +++++++++++++++++++++++++++++++
 board/tqc/tqma6/tqma6q.cfg   |  125 +++++++++++
 board/tqc/tqma6/tqma6s.cfg   |  125 +++++++++++
 boards.cfg                   |    4 +
 include/configs/tqma6.h      |  477 ++++++++++++++++++++++++++++++++++++++++++
 10 files changed, 1439 insertions(+)
 create mode 100644 board/tqc/tqma6/Makefile
 create mode 100644 board/tqc/tqma6/README
 create mode 100644 board/tqc/tqma6/clocks.cfg
 create mode 100644 board/tqc/tqma6/tqma6.c
 create mode 100644 board/tqc/tqma6/tqma6_bb.h
 create mode 100644 board/tqc/tqma6/tqma6_mba6.c
 create mode 100644 board/tqc/tqma6/tqma6q.cfg
 create mode 100644 board/tqc/tqma6/tqma6s.cfg
 create mode 100644 include/configs/tqma6.h
board/tqc/tqma6/Makefile new file +9 -0
new file mode 100644
index 0000000..9ee6920
@@ -0,0 +1,9 @@
+#
+# Copyright (C) 2014, Markus Niebel <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y  := tqma6.o
+
+obj-$(CONFIG_MBA6) += tqma6_mba6.o
board/tqc/tqma6/README new file +35 -0
new file mode 100644
index 0000000..2c012e7
@@ -0,0 +1,35 @@
+U-Boot for the TQ Systems TQMa6 modules
+
+This file contains information for the port of
+U-Boot to the TQ Systems TQMa6 modules.
+
+1. Boot source
+--------------
+
+The following boot source is supported:
+
+- SD/eMMC
+- SPI NOR
+
+2. Building
+------------
+
+To build U-Boot for the TQ Systems TQMa6 modules:
+
+	make tqma6<x>_<baseboard>_<boot>_config
+	make
+
+x is a placeholder for the CPU variant
+q - means i.MX6Q/D: TQMa6Q (i.MX6Q) and TQMa6D  (i.MX6D)
+s - means i.MX6S: TQMa6S  (i.MX6S)
+
+baseboard is a placeholder for the boot device
+mmc - means eMMC
+spi - mean SPI NOR
+
+This gives the following configurations:
+
+tqma6q_mba6_mmc_config
+tqma6q_mba6_spi_config
+tqma6s_mba6_mmc_config
+tqma6s_mba6_spi_config
board/tqc/tqma6/clocks.cfg new file +24 -0
new file mode 100644
index 0000000..d9dd273
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2013 Boundary Devices
+ * Copyright (C) 2013, 2014 Markus Niebel <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ * Refer doc/README.imximage for more details about how-to configure
+ * and create imximage boot image
+ */
+
+/* set the default clock gate to save power */
+DATA 4, CCM_CCGR0, 0x00C03F3F
+DATA 4, CCM_CCGR1, 0x0030FC03
+DATA 4, CCM_CCGR2, 0x0FFFC000
+DATA 4, CCM_CCGR3, 0x3FF00000
+DATA 4, CCM_CCGR4, 0x00FFF300
+DATA 4, CCM_CCGR5, 0x0F0000C3
+DATA 4, CCM_CCGR6, 0x000003FF
+
+/* enable AXI cache for VDOA/VPU/IPU */
+DATA 4, MX6_IOMUXC_GPR4, 0xF00000CF
+/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
+DATA 4, MX6_IOMUXC_GPR6, 0x007F007F
+DATA 4, MX6_IOMUXC_GPR7, 0x007F007F
board/tqc/tqma6/tqma6.c new file +258 -0

258 lines not on this page · raw message

board/tqc/tqma6/tqma6_bb.h new file +30 -0
new file mode 100644
index 0000000..9d072d2
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2013, 2014 TQ Systems
+ * Author: Markus Niebel <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __TQMA6_BB__
+#define __TQMA6_BB
+
+#include <common.h>
+
+int tqma6_bb_board_mmc_getwp(struct mmc *mmc);
+int tqma6_bb_board_mmc_getcd(struct mmc *mmc);
+int tqma6_bb_board_mmc_init(bd_t *bis);
+
+int tqma6_bb_board_early_init_f(void);
+int tqma6_bb_board_init(void);
+int tqma6_bb_board_late_init(void);
+int tqma6_bb_checkboard(void);
+
+const char *tqma6_bb_get_boardname(void);
+/*
+ * Device Tree Support
+ */
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+void tqma6_bb_ft_board_setup(void *blob, bd_t *bd);
+#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
+
+#endif
board/tqc/tqma6/tqma6_mba6.c new file +352 -0

352 lines not on this page · raw message

board/tqc/tqma6/tqma6q.cfg new file +125 -0

125 lines not on this page · raw message

board/tqc/tqma6/tqma6s.cfg new file +125 -0

125 lines not on this page · raw message

boards.cfg +4 -0
index dbee7f6..a5ababb 100644
@@ -331,6 +331,10 @@ Active  arm         armv7          mx6         freescale       mx6sabresd
 Active  arm         armv7          mx6         freescale       mx6slevk            mx6slevk                              mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL                                                                   Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         gateworks       gw_ventana          gwventana                            gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6QDL,SPL                                                  Tim Harvey <[email protected]>
 Active  arm         armv7          mx6         solidrun        hummingboard        hummingboard_solo                     hummingboard:IMX_CONFIG=board/solidrun/hummingboard/solo.cfg,MX6S,DDR_MB=512                                                      Jon Nettleton <[email protected]>
+Active  arm         armv7          mx6         tqc             tqma6               tqma6q_mba6_mmc                       tqma6:IMX_CONFIG=board/tqc/tqma6/tqma6q.cfg,MX6Q,MBA6,TQMA6X_MMC_BOOT                                                            Markus Niebel <[email protected]>
+Active  arm         armv7          mx6         tqc             tqma6               tqma6q_mba6_spi                       tqma6:IMX_CONFIG=board/tqc/tqma6/tqma6q.cfg,MX6Q,MBA6,TQMA6X_SPI_BOOT                                                            Markus Niebel <[email protected]>
+Active  arm         armv7          mx6         tqc             tqma6               tqma6s_mba6_mmc                       tqma6:IMX_CONFIG=board/tqc/tqma6/tqma6s.cfg,MX6S,MBA6,TQMA6X_MMC_BOOT                                                            Markus Niebel <[email protected]>
+Active  arm         armv7          mx6         tqc             tqma6               tqma6s_mba6_spi                       tqma6:IMX_CONFIG=board/tqc/tqma6/tqma6s.cfg,MX6S,MBA6,TQMA6X_SPI_BOOT                                                            Markus Niebel <[email protected]>
 Active  arm         armv7          omap3       -               overo               omap3_overo                           -                                                                                                                                 Steve Sakoman <[email protected]>
 Active  arm         armv7          omap3       -               pandora             omap3_pandora                         -                                                                                                                                 Grazvydas Ignotas <[email protected]>
 Active  arm         armv7          omap3       8dtech          eco5pk              eco5pk                                -                                                                                                                                 Raphael Assenat <[email protected]>
include/configs/tqma6.h new file +477 -0

477 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/1 Add TQ Systems TQMa6 board support

Am 23.06.2014 17:56, wrote Markus Niebel:

Quoted 30 lines

From: Markus Niebel <[email protected]>

This patch adds the changes to boards.cfg and the board directory under board/tqc.

TQMa6 is a family of modules based on Freescale i.MX6. It consists of TQMa6Q (i.MX6 Quad), TQMa6D (i.MX6 Dual) featuring eMMC, and 1 GiB DDR3 TQMa6S (i.MX6 Solo) featuring eMMC and 512 MiB DDR3

The modules need a baseboard. Initially the MBa6x starterkit mainboard is supported. To easy support for other mainboards the functionality is splitted in one file for the module (tqma6.c) and one file for the baseboard (tqma6_ mba6).

The modules can be boot from eMMC (on USDHC3) and SPI flash.

The following features are supported:
- MMC: eMMC on module (on USDHC3) and SD-card (on MBa6x mainboard)
- Ethernet: RGMII using micrel KSZ9031 phy on MBa6x mainboard for TQMa6<x> module. The phy needs special configurations for the pad skew registers to adjust for the signal routing.
Also support for standard ethernet commands and uppdate via tftp.
- SPI: ECSPI1 with bootable serial flash on module and two additional chip selects on MBa6x
- I2C: This patch adds support for the I2C busses on the TQMa6<x> modules (I2C3) and MBa6x baseboards (I2C1). The LM75 temperature sensors on TQMa6<x> and MBa6x are also configured.
- USB: high speed host 1 on MBa6x and support for USB storage
- PMIC: support for pfuze 100 on TQMa6<x>

Quoted 2 lines

---

Ping ... any comments or shall I rebase after 2014.07 will be released?

Kind regards

Markus

Quoted 17 lines

History:

- changes for v3:
- squash the patches as suggested by S. Babic
- fix copy and paste error for MBa6x SD-Card slot
- fix WP handling for MBa6x SD-Card slot
- move PMIC init to board_late_init (power_init_board() does not work)

- changes for v2:
- fix long line warning as suggested by W. Denk
- remove baudrate from CONFIG_EXTRA_ENV_SETTINGS
- remove unused define CONFIG_TQMA6X_BASEBOARD_NAME
- add missing mmcblkdev definition to mmcboot logic in CONFIG_EXTRA_ENV_SETTINGS
- add missing stuff for tftp and nfs in CONFIG_EXTRA_ENV_SETTINGS
- fix fdt_file in env (was partially fdt)
- add missing int power_init_board(void) to tqma6.c

#2 lore raw

PATCH v3 1/1 Add TQ Systems TQMa6 board support

Hi Markus,

Quoted 31 lines · Markus Niebel

Am 23.06.2014 17:56, wrote Markus Niebel:

Quoted 30 lines

From: Markus Niebel <[email protected]>

This patch adds the changes to boards.cfg and the board directory under board/tqc.

TQMa6 is a family of modules based on Freescale i.MX6. It consists of TQMa6Q (i.MX6 Quad), TQMa6D (i.MX6 Dual) featuring eMMC, and 1 GiB DDR3 TQMa6S (i.MX6 Solo) featuring eMMC and 512 MiB DDR3

The modules need a baseboard. Initially the MBa6x starterkit mainboard is supported. To easy support for other mainboards the functionality is splitted in one file for the module (tqma6.c) and one file for the baseboard (tqma6_ mba6).

The modules can be boot from eMMC (on USDHC3) and SPI flash.

The following features are supported:
- MMC: eMMC on module (on USDHC3) and SD-card (on MBa6x mainboard)
- Ethernet: RGMII using micrel KSZ9031 phy on MBa6x mainboard for TQMa6<x> module. The phy needs special configurations for the pad skew registers to adjust for the signal routing.
Also support for standard ethernet commands and uppdate via tftp.
- SPI: ECSPI1 with bootable serial flash on module and two additional chip selects on MBa6x
- I2C: This patch adds support for the I2C busses on the TQMa6<x> modules (I2C3) and MBa6x baseboards (I2C1). The LM75 temperature sensors on TQMa6<x> and MBa6x are also configured.
- USB: high speed host 1 on MBa6x and support for USB storage
- PMIC: support for pfuze 100 on TQMa6<x>

Quoted 4 lines
Quoted 2 lines

---

Ping ... any comments or shall I rebase after 2014.07 will be released?

No, please wait...I am reviewing your patch for merging into -next, even before 2014.07 is released. If I still see open issues, I will inform you.

Thanks,
Stefano

Signature · 5 lines
=====================================================================
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
=====================================================================
#3 lore raw

PATCH v3 1/1 Add TQ Systems TQMa6 board support

Hi Markus,

some minor points. I cannot find the original patch in my mailbox, that is the reason my answer can look weird. ;-)

Quoted 34 lines · Stefano Babic

Hi Markus,

Quoted 31 lines · Markus Niebel

Am 23.06.2014 17:56, wrote Markus Niebel:

Quoted 30 lines

From: Markus Niebel <[email protected]>

This patch adds the changes to boards.cfg and the board directory under board/tqc.

TQMa6 is a family of modules based on Freescale i.MX6. It consists of TQMa6Q (i.MX6 Quad), TQMa6D (i.MX6 Dual) featuring eMMC, and 1 GiB DDR3 TQMa6S (i.MX6 Solo) featuring eMMC and 512 MiB DDR3

The modules need a baseboard. Initially the MBa6x starterkit mainboard is supported. To easy support for other mainboards the functionality is splitted in one file for the module (tqma6.c) and one file for the baseboard (tqma6_ mba6).

The modules can be boot from eMMC (on USDHC3) and SPI flash.

The following features are supported:
- MMC: eMMC on module (on USDHC3) and SD-card (on MBa6x mainboard)
- Ethernet: RGMII using micrel KSZ9031 phy on MBa6x mainboard for TQMa6<x> module. The phy needs special configurations for the pad skew registers to adjust for the signal routing.
Also support for standard ethernet commands and uppdate via tftp.
- SPI: ECSPI1 with bootable serial flash on module and two additional chip selects on MBa6x
- I2C: This patch adds support for the I2C busses on the TQMa6<x> modules (I2C3) and MBa6x baseboards (I2C1). The LM75 temperature sensors on TQMa6<x> and MBa6x are also configured.
- USB: high speed host 1 on MBa6x and support for USB storage
- PMIC: support for pfuze 100 on TQMa6<x>

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

---

Ping ... any comments or shall I rebase after 2014.07 will be released?

No, please wait...I am reviewing your patch for merging into -next, even before 2014.07 is released. If I still see open issues, I will inform you.

There is a ton of warning by checkpatch because line exceeds 80 chars. They should be fixed.

Then:

+ printf("Warning: failed to initialize eMMC dev\n");

Use puts instead of printf for static strings. I think there are also a couple of other identical cases.

You set the variable "board" in your code. "board" is quite generic and you use it to set the name. We have already a case in U-Boot doing this with am335x boards. Use "board_name" (even "board_rev" if required) to set target's name to be consistent with other boards.

I have not understood why you put board_mmc_getcd() and board_mmc_getwp() in the module file (tqma6.c). They refer then to board specific code, for example tqma6_bb_board_mmc_getcd(). Should they not belong to the baseboard file ?

+ power_pfuze100_init(2);

Understood, but maybe better to have a constant for the bus number

+#if defined(CONFIG_MX6Q)
+#define MBA6X_KSZ9031_CTRL_SKEW 0x0032
+#define MBA6X_KSZ9031_CLK_SKEW 0x03ff
+#define MBA6X_KSZ9031_RX_SKEW 0x3333
+#define MBA6X_KSZ9031_TX_SKEW 0x2036
+#elif defined(CONFIG_MX6S)
+#define MBA6X_KSZ9031_CTRL_SKEW 0x0030

Does the skew depend on SOC type or maybe on the different baseboard ? Is it correct to make the #ifdef dependig on the SOC ?

There are several new undocumented CONFIG_ in your configuration. A CONFIG_ should be documented, but it seems you use only locally in your tqma6.h. Then I will suggest to change their name to better understand they are not general configuration switches for U-Boot.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================
#4 lore raw

PATCH v3 1/1 Add TQ Systems TQMa6 board support

Hello Stefano,

Am 10.07.2014 14:59, wrote Stefano Babic:

Quoted 4 lines

Hi Markus,

some minor points. I cannot find the original patch in my mailbox, that is the reason my answer can look weird. ;-)

Abolutely not - thanks for review. Will go through your comments and clean up. Just a few points:

Quoted 39 lines · Stefano Babic
Quoted 37 lines

Hi Markus,

Quoted 34 lines · Markus Niebel

Am 23.06.2014 17:56, wrote Markus Niebel:

Quoted 32 lines

From: Markus Niebel <[email protected]>

This patch adds the changes to boards.cfg and the board directory under board/tqc.

TQMa6 is a family of modules based on Freescale i.MX6. It consists of TQMa6Q (i.MX6 Quad), TQMa6D (i.MX6 Dual) featuring eMMC, and 1 GiB DDR3 TQMa6S (i.MX6 Solo) featuring eMMC and 512 MiB DDR3

The modules need a baseboard. Initially the MBa6x starterkit mainboard is supported. To easy support for other mainboards the functionality is splitted in one file for the module (tqma6.c) and one file for the baseboard (tqma6_ mba6).

The modules can be boot from eMMC (on USDHC3) and SPI flash.

The following features are supported:
- MMC: eMMC on module (on USDHC3) and SD-card (on MBa6x mainboard)
- Ethernet: RGMII using micrel KSZ9031 phy on MBa6x mainboard for TQMa6<x> module. The phy needs special configurations for the pad skew registers to adjust for the signal routing.
Also support for standard ethernet commands and uppdate via tftp.
- SPI: ECSPI1 with bootable serial flash on module and two additional chip selects on MBa6x
- I2C: This patch adds support for the I2C busses on the TQMa6<x> modules (I2C3) and MBa6x baseboards (I2C1). The LM75 temperature sensors on TQMa6<x> and MBa6x are also configured.
- USB: high speed host 1 on MBa6x and support for USB storage
- PMIC: support for pfuze 100 on TQMa6<x>

---

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Ping ... any comments or shall I rebase after 2014.07 will be released?

No, please wait...I am reviewing your patch for merging into -next, even before 2014.07 is released. If I still see open issues, I will inform you.

There is a ton of warning by checkpatch because line exceeds 80 chars. They should be fixed.

These 24 or so come from pin multiplexing tables. You are right, will fix it.

Quoted 7 lines

Then:

board/tqc/tqma6/tqma6.c new file +1 -0
+		printf("Warning: failed to initialize eMMC dev\n");

Use puts instead of printf for static strings. I think there are also a couple of other identical cases.

ok

Quoted 6 lines

You set the variable "board" in your code. "board" is quite generic and you use it to set the name. We have already a case in U-Boot doing this with am335x boards. Use "board_name" (even "board_rev" if required) to set target's name to be consistent with other boards.

good point

Quoted 5 lines

I have not understood why you put board_mmc_getcd() and board_mmc_getwp() in the module file (tqma6.c). They refer then to board specific code, for example tqma6_bb_board_mmc_getcd(). Should they not belong to the baseboard file ?

the modules have an eMMC - this needs to set WP to zero and CD to present. Baseboards may or may not implement SD-Card slots with different configurations.

Quoted 12 lines
board/tqc/tqma6/tqma6.c new file +1 -0
+	power_pfuze100_init(2);

Understood, but maybe better to have a constant for the bus number

board/tqc/tqma6/tqma6_mba6.c new file +7 -0
+#if defined(CONFIG_MX6Q)
+#define MBA6X_KSZ9031_CTRL_SKEW	0x0032
+#define MBA6X_KSZ9031_CLK_SKEW	0x03ff
+#define MBA6X_KSZ9031_RX_SKEW	0x3333
+#define MBA6X_KSZ9031_TX_SKEW	0x2036
+#elif defined(CONFIG_MX6S)
+#define MBA6X_KSZ9031_CTRL_SKEW	0x0030
Quoted 2 lines

Does the skew depend on SOC type or maybe on the different baseboard ? Is it correct to make the #ifdef dependig on the SOC ?

for MBa6 it depends on whether we have a TQMa6S (i.MX6S) Module or a TQMa6Q/D (i.MX6Q/D) Module. So at least for MBa6x it depends on which SOC is on the Module.

Quoted 5 lines

There are several new undocumented CONFIG_ in your configuration. A CONFIG_ should be documented, but it seems you use only locally in your tqma6.h. Then I will suggest to change their name to better understand they are not general configuration switches for U-Boot.

Oh, sorry - I missed this.

Quoted 4 lines

Best regards,
Stefano Babic

Best Regards
Markus Niebel