Add support for TQMa6 modules
cover Add support for TQMa6 modules
From: Markus Niebel <[email protected]>
This series add support for the TQMa6 boards from TQ Systems. The first Patch adds basic support for the modiules and the starterkit baseboard while the other patches add additional features
Markus Niebel (7):
Add TQ Systems TQMa6 board support
TQMa6: mba6: add RGMII enet
TQMa6: add SPI support
TQMa6: add SPI NOR boot support
TQMa6: MBa6: add usb support
TQMa6: add I2C support
TQMa6: add pmic support
board/tqc/tqma6/Makefile | 9 + board/tqc/tqma6/README | 35 ++++ board/tqc/tqma6/clocks.cfg | 24 +++ board/tqc/tqma6/tqma6.c | 240 ++++++++++++++++++++++ board/tqc/tqma6/tqma6_bb.h | 30 +++ board/tqc/tqma6/tqma6_mba6.c | 358 ++++++++++++++++++++++++++++++++ board/tqc/tqma6/tqma6q.cfg | 125 ++++++++++++ board/tqc/tqma6/tqma6s.cfg | 125 ++++++++++++ boards.cfg | 4 + include/configs/tqma6.h | 461 ++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 1411 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
Signature · 1 line
1.7.9.5
PATCH 1/7 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 can be boot from SD (on USDHC2) and eMMC (on USDHC3).
Additional features will be added later:
- Ethernet
- SPI
- I2C
- USB
The modules needs 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)
--- board/tqc/tqma6/Makefile | 9 ++ board/tqc/tqma6/README | 31 ++++++ board/tqc/tqma6/clocks.cfg | 24 +++++ board/tqc/tqma6/tqma6.c | 186 ++++++++++++++++++++++++++++++++++ board/tqc/tqma6/tqma6_bb.h | 30 ++++++ board/tqc/tqma6/tqma6_mba6.c | 148 +++++++++++++++++++++++++++ board/tqc/tqma6/tqma6q.cfg | 125 +++++++++++++++++++++++ board/tqc/tqma6/tqma6s.cfg | 125 +++++++++++++++++++++++ boards.cfg | 2 + include/configs/tqma6.h | 225 ++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 905 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
@@ -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 +31 -0
@@ -0,0 +1,31 @@ +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 + +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 + +This gives the following configurations: + +tqma6q_mba6_mmc_config +tqma6s_mba6_mmc_config
board/tqc/tqma6/clocks.cfg new file +24 -0
@@ -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 +186 -0
186 lines not on this page · raw message
board/tqc/tqma6/tqma6_bb.h new file +30 -0
@@ -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 +148 -0
148 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 +2 -0
@@ -330,6 +330,8 @@ 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 tqma6s_mba6_mmc tqma6:IMX_CONFIG=board/tqc/tqma6/tqma6s.cfg,MX6S,MBA6,TQMA6X_MMC_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 +225 -0
225 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 1/7 Add TQ Systems TQMa6 board support
Dear Markus Niebel,
Quoted 3 lines · In message <[email protected]> you wrote:
This patch adds the changes to boards.cfg and the board directory under board/tqc.
...
Quoted 1 line
+#define
CONFIG_EXTRA_ENV_SETTINGS\
...
include/configs/tqma6.h line 156
Quoted 1 line
include/configs/tqma6.h new file +1
-0+ "baudrate="__stringify(CONFIG_BAUDRATE)"\0" \
"baudrate" is already in the standard settings. You just create a duplicated entry here.
...
include/configs/tqma6.h line 190
Quoted 2 lines
include/configs/tqma6.h new file +2
-0+/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
WARNING: line over 80 characters
#1067: FILE: include/configs/tqma6.h:190:
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
Best regards,
Wolfgang Denk
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-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The important thing about being a leader is not being right or wrong, but being *certain*. - Terry Pratchett, _Truckers_
PATCH 1/7 Add TQ Systems TQMa6 board support
Am 16.06.2014 14:41, wrote Wolfgang Denk:
Quoted 7 lines
Dear Markus Niebel,
Quoted 3 lines · In message <[email protected]> you wrote:
This patch adds the changes to boards.cfg and the board directory under board/tqc.
Quoted 8 lines
...
Quoted 1 line
+#define
CONFIG_EXTRA_ENV_SETTINGS\...
include/configs/tqma6.h line 156
Quoted 1 line
include/configs/tqma6.h new file +1
-0+ "baudrate="__stringify(CONFIG_BAUDRATE)"\0" \"baudrate" is already in the standard settings. You just create a duplicated entry here.
Thanks, good to know. Will fix that.
Quoted 13 lines
...
include/configs/tqma6.h line 190
Quoted 2 lines
include/configs/tqma6.h new file +2
-0+/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)WARNING: line over 80 characters
#1067: FILE:include/configs/tqma6.h:190:
+#defineCONFIG_SYS_PBSIZE(CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+ 16)Best regards,
Wolfgang Denk
PATCH 2/7 TQMa6: mba6: add RGMII enet
In reply to Markus NiebelFrom: Markus Niebel <[email protected]>
Add RGMII ethernet using micrel KSZ9031 phy to mba6 mainboard for TQMa6<x> module. The phy needs special configurateions for the pad skew registers to adjust for the signal routing.
Also support for standard ethernet commands and uppdate via tftp is supported.
--- board/tqc/tqma6/tqma6_mba6.c | 158 ++++++++++++++++++++++++++++++++++++++++++ include/configs/tqma6.h | 78 ++++++++++++++++++++- 2 files changed, 235 insertions(+), 1 deletion(-)
board/tqc/tqma6/tqma6_mba6.c +158 -0
@@ -20,7 +20,11 @@#include <common.h> #include <fsl_esdhc.h> #include <libfdt.h> +#include <malloc.h> +#include <micrel.h> +#include <miiphy.h> #include <mmc.h> +#include <netdev.h> #include "tqma6_bb.h"
@@ -41,6 +45,87 @@ DECLARE_GLOBAL_DATA_PTR;#define GPIO_IN_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_LOW | \ PAD_CTL_DSE_40ohm | PAD_CTL_HYS) +#if defined(CONFIG_MX6Q ) + +#define IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII 0x02e0790 +#define IOMUX_SW_PAD_CTRL_GRP_RGMII_TERM 0x02e07ac + +#elif defined(CONFIG_MX6S ) + +#define IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII 0x02e0768 +#define IOMUX_SW_PAD_CTRL_GRP_RGMII_TERM 0x02e0788 + +#else + +#error "need to define target CPU" + +#endif + +#define ENET_RX_PAD_CTRL (PAD_CTL_DSE_34ohm) +#define ENET_TX_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_DSE_34ohm) +#define ENET_CLK_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_HIGH | \ + PAD_CTL_DSE_34ohm) +#define ENET_MDIO_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_60ohm) + +/* disable on die termination for RGMII */ +#define IOMUX_SW_PAD_CTRL_GRP_RGMII_TERM_DISABLE 0x00000000 +/* optimised drive strength for 1.0 .. 1.3 V signal on RGMII */ +#define IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII_1P2V 0x00080000 +/* optimised drive strength for 1.3 .. 2.5 V signal on RGMII */ +#define IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII_1P5V 0x000C0000 + +#define ENET_PHY_RESET_GPIO IMX_GPIO_NR(1, 25) + +static iomux_v3_cfg_t const mba6_enet_pads[] = { +NEW_PAD_CTRL (MX6_PAD_ENET_MDIO__ENET_MDIO ,ENET_MDIO_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_ENET_MDC__ENET_MDC ,ENET_MDIO_PAD_CTRL ), + +NEW_PAD_CTRL (MX6_PAD_RGMII_TXC__RGMII_TXC ,ENET_TX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_TD0__RGMII_TD0 ,ENET_TX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_TD1__RGMII_TD1 ,ENET_TX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_TD2__RGMII_TD2 ,ENET_TX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_TD3__RGMII_TD3 ,ENET_TX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL ,ENET_TX_PAD_CTRL ), + +NEW_PAD_CTRL (MX6_PAD_ENET_REF_CLK__ENET_TX_CLK ,ENET_CLK_PAD_CTRL ), +/* +* these pins are also used for config strapping by phy +*/ +NEW_PAD_CTRL (MX6_PAD_RGMII_RD0__RGMII_RD0 ,ENET_RX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_RD1__RGMII_RD1 ,ENET_RX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_RD2__RGMII_RD2 ,ENET_RX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_RD3__RGMII_RD3 ,ENET_RX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_RXC__RGMII_RXC ,ENET_RX_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL ,ENET_RX_PAD_CTRL ), +/* KSZ9031 PHY Reset */ +NEW_PAD_CTRL (MX6_PAD_ENET_CRS_DV__GPIO1_IO25 ,GPIO_OUT_PAD_CTRL ), +}; + +static void mba6_setup_iomuxc_enet (void ) +{ +__raw_writel (IOMUX_SW_PAD_CTRL_GRP_RGMII_TERM_DISABLE , + (void *)IOMUX_SW_PAD_CTRL_GRP_RGMII_TERM ); +__raw_writel (IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII_1P5V , + (void *)IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII ); + +imx_iomux_v3_setup_multiple_pads (mba6_enet_pads, +ARRAY_SIZE (mba6_enet_pads)); + +/* Reset PHY */ +gpio_direction_output (ENET_PHY_RESET_GPIO ,0 ); +/* Need delay 10ms after power on according to KSZ9031 spec */ +udelay (1000 *10 ); +gpio_set_value (ENET_PHY_RESET_GPIO ,1 ); +/* +* KSZ9031 manual: 100 usec wait time after reset before communication +* over MDIO +* BUGBUG: hardware has an RC const that needs > 10 msec from 0->1 on +* reset before the phy sees a high level +*/ +udelay (200 ); +} +static iomux_v3_cfg_t const mba6_uart2_pads[] = {NEW_PAD_CTRL (MX6_PAD_SD4_DAT4__UART2_RX_DATA ,UART_PAD_CTRL ),NEW_PAD_CTRL (MX6_PAD_SD4_DAT7__UART2_TX_DATA ,UART_PAD_CTRL ),
@@ -115,6 +200,76 @@ int tqma6_bb_board_mmc_init(bd_t *bis)return 0 ; } +int board_phy_config (struct phy_device *phydev) +{ +#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 +#define MBA6X_KSZ9031_CLK_SKEW 0x03ff +#define MBA6X_KSZ9031_RX_SKEW 0x3333 +#define MBA6X_KSZ9031_TX_SKEW 0x2052 +#else +#error +#endif +/* min rx/tx ctrl delay */ +ksz9031_phy_extended_write (phydev,2 , +MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW , +MII_KSZ9031_MOD_DATA_NO_POST_INC , +MBA6X_KSZ9031_CTRL_SKEW ); +/* min rx delay */ +ksz9031_phy_extended_write (phydev,2 , +MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW , +MII_KSZ9031_MOD_DATA_NO_POST_INC , +MBA6X_KSZ9031_RX_SKEW ); +/* max tx delay */ +ksz9031_phy_extended_write (phydev,2 , +MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW , +MII_KSZ9031_MOD_DATA_NO_POST_INC , +MBA6X_KSZ9031_TX_SKEW ); +/* rx/tx clk skew */ +ksz9031_phy_extended_write (phydev,2 , +MII_KSZ9031_EXT_RGMII_CLOCK_SKEW , +MII_KSZ9031_MOD_DATA_NO_POST_INC , +MBA6X_KSZ9031_CLK_SKEW ); + + phydev->drv->config (phydev); + +return 0 ; +} + +int board_eth_init (bd_t *bis) +{ +uint32_t base =IMX_FEC_BASE ; +struct mii_dev *bus =NULL ; +struct phy_device *phydev =NULL ; +int ret; + + bus =fec_get_miibus (base,-1 ); +if (!bus) +return 0 ; +/* scan phy */ + phydev =phy_find_by_mask (bus, (0xf <<CONFIG_FEC_MXC_PHYADDR ), +PHY_INTERFACE_MODE_RGMII ); + +if (!phydev) { +free (bus); +printf ("No phy found\n" ); +return 0 ; + } + ret =fec_probe (bis,-1 , base, bus, phydev); +if (ret) { +printf ("FEC MXC: %s:failed\n" , __func__); +free (phydev); +free (bus); + } + +return 0 ; +} +int tqma6_bb_board_early_init_f (void ) {mba6_setup_iomuxc_uart ();
@@ -124,6 +279,9 @@ int tqma6_bb_board_early_init_f(void)int tqma6_bb_board_init (void ) { +/* do it here - to have reset completed */ +mba6_setup_iomuxc_enet (); +return 0 ; }
include/configs/tqma6.h +77 -1
98 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 3/7 TQMa6: add SPI support
In reply to Markus NiebelFrom: Markus Niebel <[email protected]>
This patch adds the support for SPI,
the serial flash on TQMa6<x> and the two additional CS on MBa6
--- board/tqc/tqma6/tqma6.c | 27 +++++++++++++++++++++++++++ board/tqc/tqma6/tqma6_mba6.c | 24 ++++++++++++++++++++++++ include/configs/tqma6.h | 14 ++++++++++++++ 3 files changed, 65 insertions(+)
board/tqc/tqma6/tqma6.c +27 -0
@@ -37,6 +37,9 @@ DECLARE_GLOBAL_DATA_PTR;#define GPIO_IN_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_LOW | \ PAD_CTL_DSE_40ohm | PAD_CTL_HYS) +#define SPI_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) +int dram_init (void ) { gd->ram_size =get_ram_size ((void *)PHYS_SDRAM ,PHYS_SDRAM_SIZE );
@@ -118,6 +121,28 @@ int board_mmc_init(bd_t *bis)return 0 ; } +static iomux_v3_cfg_t const tqma6_ecspi1_pads[] = { +/* SS1 */ +NEW_PAD_CTRL (MX6_PAD_EIM_D19__GPIO3_IO19 ,SPI_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_EIM_D16__ECSPI1_SCLK ,SPI_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_EIM_D17__ECSPI1_MISO ,SPI_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_EIM_D18__ECSPI1_MOSI ,SPI_PAD_CTRL ), +}; + +static unsigned const tqma6_ecspi1_cs[] = { +IMX_GPIO_NR (3 ,19 ), +}; + +static void tqma6_iomuxc_spi (void ) +{ +unsigned i; + +for (i =0 ; i <ARRAY_SIZE (tqma6_ecspi1_cs); ++i) +gpio_direction_output (tqma6_ecspi1_cs[i],1 ); +imx_iomux_v3_setup_multiple_pads (tqma6_ecspi1_pads, +ARRAY_SIZE (tqma6_ecspi1_pads)); +} +int board_early_init_f (void ) {return tqma6_bb_board_early_init_f ();
@@ -128,6 +153,8 @@ int board_init(void)/* address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ; +tqma6_iomuxc_spi (); +tqma6_bb_board_init ();return 0 ;
board/tqc/tqma6/tqma6_mba6.c +24 -0
@@ -45,6 +45,9 @@ DECLARE_GLOBAL_DATA_PTR;#define GPIO_IN_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_LOW | \ PAD_CTL_DSE_40ohm | PAD_CTL_HYS) +#define SPI_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) +#if defined(CONFIG_MX6Q )#define IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII 0x02e0790
@@ -200,6 +203,26 @@ int tqma6_bb_board_mmc_init(bd_t *bis)return 0 ; } +static iomux_v3_cfg_t const mba6_ecspi1_pads[] = { +NEW_PAD_CTRL (MX6_PAD_EIM_D24__GPIO3_IO24 ,SPI_PAD_CTRL ), +NEW_PAD_CTRL (MX6_PAD_EIM_D25__GPIO3_IO25 ,SPI_PAD_CTRL ), +}; + +static unsigned const mba6_ecspi1_cs[] = { +IMX_GPIO_NR (3 ,24 ), +IMX_GPIO_NR (3 ,25 ), +}; + +static void mba6_setup_iomuxc_spi (void ) +{ +unsigned i; + +for (i =0 ; i <ARRAY_SIZE (mba6_ecspi1_cs); ++i) +gpio_direction_output (mba6_ecspi1_cs[i],1 ); +imx_iomux_v3_setup_multiple_pads (mba6_ecspi1_pads, +ARRAY_SIZE (mba6_ecspi1_pads)); +} +int board_phy_config (struct phy_device *phydev) {#if defined(CONFIG_MX6Q )
@@ -279,6 +302,7 @@ int tqma6_bb_board_early_init_f(void)int tqma6_bb_board_init (void ) { +mba6_setup_iomuxc_spi ();/* do it here - to have reset completed */ mba6_setup_iomuxc_enet ();
include/configs/tqma6.h +14 -0
@@ -47,6 +47,20 @@#define CONFIG_MXC_GPIO #define CONFIG_MXC_UART +/* SPI */ +#define CONFIG_CMD_SPI +#define CONFIG_MXC_SPI + +/* SPI Flash */ +#define CONFIG_SPI_FLASH +#define CONFIG_SPI_FLASH_STMICRO + +#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_SPEED 50000000 +#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0) +/* MMC Configs */ #define CONFIG_FSL_ESDHC #define CONFIG_FSL_USDHC
Signature · 1 line
1.7.9.5
PATCH 4/7 TQMa6: add SPI NOR boot support
In reply to Markus NiebelFrom: Markus Niebel <[email protected]>
This patch adds support for booting from SPI NOR flash and having the environment also in SPI NOR. Also all environment settings to allow update of bootloader and kernel are added.
--- board/tqc/tqma6/README | 4 ++ boards.cfg | 2 + include/configs/tqma6.h | 103 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+)
board/tqc/tqma6/README +4 -0
@@ -9,6 +9,7 @@ U-Boot to the TQ Systems TQMa6 modules. The following boot source is supported: - SD/eMMC +- SPI NOR 2. Building ------------
@@ -24,8 +25,11 @@ 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
boards.cfg +2 -0
@@ -331,7 +331,9 @@ Active arm armv7 mx6 freescale mx6slevk 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 +103 -0
109 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 5/7 TQMa6: MBa6: add usb support
In reply to Markus NiebelFrom: Markus Niebel <[email protected]>
add support for USB and USB storage on the USB ports on the MBA6 baseboard for TQMa6 moduels
--- board/tqc/tqma6/tqma6_mba6.c | 7 +++++++ include/configs/tqma6.h | 11 +++++++++++ 2 files changed, 18 insertions(+)
board/tqc/tqma6/tqma6_mba6.c +7 -0
@@ -293,6 +293,13 @@ int board_eth_init(bd_t *bis)return 0 ; } +#ifdef CONFIG_USB_EHCI_MX6 +int board_ehci_hcd_init (int port) +{ +return 0 ; +} +#endif +int tqma6_bb_board_early_init_f (void ) {mba6_setup_iomuxc_uart ();
include/configs/tqma6.h +11 -0
@@ -71,6 +71,17 @@#define CONFIG_GENERIC_MMC #define CONFIG_BOUNCE_BUFFER +/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#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 +/* Fuses */ #define CONFIG_MXC_OCOTP #define CONFIG_CMD_FUSE
Signature · 1 line
1.7.9.5
PATCH 6/7 TQMa6: add I2C support
In reply to Markus NiebelFrom: Markus Niebel <[email protected]>
This patch adds support for the I2C busses and devices on the TQMa6 modules and MBa6 baseboards. Support for the PMIC will be added later on.
--- board/tqc/tqma6/tqma6.c | 27 +++++++++++++++++++++++++++ board/tqc/tqma6/tqma6_mba6.c | 35 ++++++++++++++++++++++++++++------- include/configs/tqma6.h | 27 +++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 7 deletions(-)
board/tqc/tqma6/tqma6.c +27 -0
@@ -16,9 +16,11 @@#include <asm/errno.h> #include <asm/gpio.h> #include <asm/io.h> +#include <asm/imx-common/mxc_i2c.h> #include <common.h> #include <fsl_esdhc.h> #include <libfdt.h> +#include <i2c.h> #include <mmc.h> #include "tqma6_bb.h"
@@ -40,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR;#define SPI_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) +#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ + PAD_CTL_ODE | PAD_CTL_SRE_FAST) +int dram_init (void ) { gd->ram_size =get_ram_size ((void *)PHYS_SDRAM ,PHYS_SDRAM_SIZE );
@@ -143,6 +149,26 @@ static void tqma6_iomuxc_spi(void) ARRAY_SIZE(tqma6_ecspi1_pads)); } +static struct i2c_pads_info tqma6_i2c3_pads = { +/* I2C3: on board LM75, M24C64, */ + .scl = { + .i2c_mode =NEW_PAD_CTRL (MX6_PAD_GPIO_5__I2C3_SCL ,I2C_PAD_CTRL ), + .gpio_mode =NEW_PAD_CTRL (MX6_PAD_GPIO_5__GPIO1_IO05 ,I2C_PAD_CTRL ), + .gp =IMX_GPIO_NR (1 ,5 ) + }, + .sda = { + .i2c_mode =NEW_PAD_CTRL (MX6_PAD_GPIO_6__I2C3_SDA ,I2C_PAD_CTRL ), + .gpio_mode =NEW_PAD_CTRL (MX6_PAD_GPIO_6__GPIO1_IO06 ,I2C_PAD_CTRL ), + .gp =IMX_GPIO_NR (1 ,6 ) + } +}; + +static void tqma6_setup_i2c (void ) +{ +/* use logical index for bus, e.g. I2C1 -> 0 */ +setup_i2c (2 ,CONFIG_SYS_I2C_SPEED ,0x7f , &tqma6_i2c3_pads); +} +int board_early_init_f (void ) {return tqma6_bb_board_early_init_f ();
@@ -154,6 +180,7 @@ int board_init(void) gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ;tqma6_iomuxc_spi (); +tqma6_setup_i2c ();tqma6_bb_board_init ();
board/tqc/tqma6/tqma6_mba6.c +28 -7
@@ -16,11 +16,13 @@#include <asm/arch/sys_proto.h> #include <asm/errno.h> #include <asm/gpio.h> +#include <asm/imx-common/mxc_i2c.h> #include <common.h> #include <fsl_esdhc.h> #include <libfdt.h> #include <malloc.h> +#include <i2c.h> #include <micrel.h> #include <miiphy.h> #include <mmc.h>
@@ -48,6 +50,10 @@ DECLARE_GLOBAL_DATA_PTR;#define SPI_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) +#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ + PAD_CTL_ODE | PAD_CTL_SRE_FAST) +#if defined(CONFIG_MX6Q )#define IOMUX_SW_PAD_CTRL_GRP_DDR_TYPE_RGMII 0x02e0790
@@ -203,6 +209,27 @@ int tqma6_bb_board_mmc_init(bd_t *bis)return 0 ; } +static struct i2c_pads_info mba6_i2c1_pads = { +/* I2C1: MBa6x */ + .scl = { + .i2c_mode =NEW_PAD_CTRL (MX6_PAD_CSI0_DAT9__I2C1_SCL ,I2C_PAD_CTRL ), + .gpio_mode =NEW_PAD_CTRL (MX6_PAD_CSI0_DAT9__GPIO5_IO27 ,I2C_PAD_CTRL ), + .gp =IMX_GPIO_NR (5 ,27 ) + }, + .sda = { + .i2c_mode =NEW_PAD_CTRL (MX6_PAD_CSI0_DAT8__I2C1_SDA ,I2C_PAD_CTRL ), + .gpio_mode =NEW_PAD_CTRL (MX6_PAD_CSI0_DAT8__GPIO5_IO26 ,I2C_PAD_CTRL ), + .gp =IMX_GPIO_NR (5 ,26 ) + } +}; + +static void mba6_setup_i2c (void ) +{ +/* use logical index for bus, e.g. I2C1 -> 0 */ +setup_i2c (0 ,CONFIG_SYS_I2C_SPEED ,0x7f , &mba6_i2c1_pads); +} + +static iomux_v3_cfg_t const mba6_ecspi1_pads[] = {NEW_PAD_CTRL (MX6_PAD_EIM_D24__GPIO3_IO24 ,SPI_PAD_CTRL ),NEW_PAD_CTRL (MX6_PAD_EIM_D25__GPIO3_IO25 ,SPI_PAD_CTRL ),
@@ -293,13 +320,6 @@ int board_eth_init(bd_t *bis)return 0 ; } -#ifdef CONFIG_USB_EHCI_MX6 -int board_ehci_hcd_init (int port) -{ -return 0 ; -} -#endif -int tqma6_bb_board_early_init_f (void ) {mba6_setup_iomuxc_uart ();
@@ -309,6 +329,7 @@ int tqma6_bb_board_early_init_f(void)int tqma6_bb_board_init (void ) { +mba6_setup_i2c ();mba6_setup_iomuxc_spi ();/* do it here - to have reset completed */ mba6_setup_iomuxc_enet ();
include/configs/tqma6.h +27 -0
@@ -61,6 +61,33 @@#define CONFIG_SF_DEFAULT_SPEED 50000000#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0) +/* I2C Configs */ +#define CONFIG_CMD_I2C +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_I2C_MULTI_BUS +/* #define CONFIG_I2C_MXC */ +#define CONFIG_SYS_I2C_SPEED 100000 + +/* 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 +#define CONFIG_CMD_DTT + +/* I2C EEPROM (M24C64) */ +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 +#define CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_BITS 5/* 32 Bytes */ +#define CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_DELAY_MS 20 +#define CONFIG_CMD_EEPROM +/* MMC Configs */ #define CONFIG_FSL_ESDHC #define CONFIG_FSL_USDHC
Signature · 1 line
1.7.9.5
PATCH 7/7 TQMa6: add pmic support
In reply to Markus NiebelFrom: Markus Niebel <[email protected]>
Support for the PMIC on the TQMa6 modules is added.
--- include/configs/tqma6.h | 5 +++++ 1 file changed, 5 insertions(+)
include/configs/tqma6.h +5 -0
@@ -88,6 +88,11 @@#define CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_DELAY_MS 20#define CONFIG_CMD_EEPROM +#define CONFIG_POWER +#define CONFIG_POWER_I2C +#define CONFIG_POWER_PFUZE100 +#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08 +/* MMC Configs */ #define CONFIG_FSL_ESDHC #define CONFIG_FSL_USDHC
Signature · 1 line
1.7.9.5