Skip to contentSkip to conversation

arm: tegra: apalis-tk1, mmc and ext clock loopback

PATCH Superseded Marcel Ziswiler 2 participants 9 messages Dec 19, 2016 – Dec 20, 2016

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm: tegra: apalis-tk1, mmc and ext clock loopback

From: Marcel Ziswiler <[email protected]>

This series adds support for the Toradex Apalis TK1 as well as moves the CONFIG_TEGRA_MMC to Kconfig and introduces a new option to disable the external clock loopback on SDMMC3.

The whole series is also available here:

http://git.toradex.com/cgit/u-boot-toradex.git/log/?h=for-next

Changes in v2:
- Added Simon's reviewed-by.
- Added TODO(email) as suggested by Simon so it is clear this is temporary and will be moved to device tree controlled approach once proper kernel integration made it mainline.

Marcel Ziswiler (5):
arm: tegra: initial support for apalis tk1
mmc: tegra: introduce CONFIG_TEGRA_MMC to Kconfig
mmc: tegra: move CONFIG_TEGRA_MMC from headers to defconfigs
mmc: tegra: allow disabling external clock loopback
apalis-tk1: disable external clock loopback on SDMMC3

 arch/arm/dts/Makefile                              |    1 +
 arch/arm/dts/tegra124-apalis.dts                   | 2203 ++++++++++++++++++++
 arch/arm/include/asm/arch-tegra/tegra_mmc.h        |    2 +
 arch/arm/mach-tegra/tegra124/Kconfig               |    7 +
 board/toradex/apalis-tk1/Kconfig                   |   30 +
 board/toradex/apalis-tk1/MAINTAINERS               |    7 +
 board/toradex/apalis-tk1/Makefile                  |    5 +
 board/toradex/apalis-tk1/apalis-tk1.c              |  175 ++
 board/toradex/apalis-tk1/as3722_init.c             |  117 ++
 board/toradex/apalis-tk1/as3722_init.h             |   41 +
 .../toradex/apalis-tk1/pinmux-config-apalis-tk1.h  |  287 +++
 configs/apalis-tk1_defconfig                       |   55 +
 configs/apalis_t30_defconfig                       |    1 +
 configs/beaver_defconfig                           |    1 +
 configs/cardhu_defconfig                           |    1 +
 configs/cei-tk1-som_defconfig                      |    1 +
 configs/colibri_t20_defconfig                      |    1 +
 configs/colibri_t30_defconfig                      |    1 +
 configs/dalmore_defconfig                          |    1 +
 configs/harmony_defconfig                          |    1 +
 configs/jetson-tk1_defconfig                       |    1 +
 configs/medcom-wide_defconfig                      |    1 +
 configs/nyan-big_defconfig                         |    1 +
 configs/paz00_defconfig                            |    1 +
 configs/plutux_defconfig                           |    1 +
 configs/seaboard_defconfig                         |    1 +
 configs/tec-ng_defconfig                           |    1 +
 configs/tec_defconfig                              |    1 +
 configs/trimslice_defconfig                        |    1 +
 configs/venice2_defconfig                          |    1 +
 configs/ventana_defconfig                          |    1 +
 configs/whistler_defconfig                         |    1 +
 drivers/mmc/Kconfig                                |   17 +
 drivers/mmc/tegra_mmc.c                            |   16 +
 include/configs/apalis-tk1.h                       |  180 ++
 include/configs/apalis_t30.h                       |    1 -
 include/configs/beaver.h                           |    1 -
 include/configs/cardhu.h                           |    1 -
 include/configs/cei-tk1-som.h                      |    1 -
 include/configs/colibri_t20.h                      |    1 -
 include/configs/colibri_t30.h                      |    1 -
 include/configs/dalmore.h                          |    1 -
 include/configs/e2220-1170.h                       |    1 -
 include/configs/harmony.h                          |    1 -
 include/configs/jetson-tk1.h                       |    1 -
 include/configs/medcom-wide.h                      |    1 -
 include/configs/nyan-big.h                         |    1 -
 include/configs/p2371-0000.h                       |    1 -
 include/configs/p2371-2180.h                       |    1 -
 include/configs/p2571.h                            |    1 -
 include/configs/p2771-0000.h                       |    1 -
 include/configs/paz00.h                            |    1 -
 include/configs/plutux.h                           |    1 -
 include/configs/seaboard.h                         |    1 -
 include/configs/tec-ng.h                           |    1 -
 include/configs/tec.h                              |    1 -
 include/configs/trimslice.h                        |    1 -
 include/configs/venice2.h                          |    1 -
 include/configs/ventana.h                          |    1 -
 include/configs/whistler.h                         |    1 -
 scripts/config_whitelist.txt                       |    1 -
 61 files changed, 3163 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/dts/tegra124-apalis.dts
 create mode 100644 board/toradex/apalis-tk1/Kconfig
 create mode 100644 board/toradex/apalis-tk1/MAINTAINERS
 create mode 100644 board/toradex/apalis-tk1/Makefile
 create mode 100644 board/toradex/apalis-tk1/apalis-tk1.c
 create mode 100644 board/toradex/apalis-tk1/as3722_init.c
 create mode 100644 board/toradex/apalis-tk1/as3722_init.h
 create mode 100644 board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
 create mode 100644 configs/apalis-tk1_defconfig
 create mode 100644 include/configs/apalis-tk1.h
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 1/5 arm: tegra: initial support for apalis tk1

From: Marcel Ziswiler <[email protected]>

This patch adds board support for the Toradex Apalis TK1 a computer on module which can be used on different carrier boards.

The module consists of a Tegra TK1 SoC, a PMIC solution, 2 GB of DDR3L RAM, a bunch of level shifters, an eMMC, a TMP451 temperature sensor chip, an I210 gigabit Ethernet controller and a SGTL5000 audio codec. Furthermore, there is a Kinetis MK20DN512 companion micro controller for analogue, CAN and resistive touch functionality.

For the sake of ease of use we do not distinguish between different carrier boards for now as the base module features are deemed sufficient enough for regular booting.

The following functionality is working so far:
- eMMC boot, environment storage and Toradex factory config block
- Gigabit Ethernet
- MMC/SD cards (both MMC1 as well as SD1 slot)
- USB client/host (dual role OTG port as client e.g. for DFU/UMS or host, other two ports as host)

---

Changes in v2:
- Added Simon's reviewed-by.

 arch/arm/dts/Makefile                              |    1 +
 arch/arm/dts/tegra124-apalis.dts                   | 2203 ++++++++++++++++++++
 arch/arm/mach-tegra/tegra124/Kconfig               |    7 +
 board/toradex/apalis-tk1/Kconfig                   |   30 +
 board/toradex/apalis-tk1/MAINTAINERS               |    7 +
 board/toradex/apalis-tk1/Makefile                  |    5 +
 board/toradex/apalis-tk1/apalis-tk1.c              |  175 ++
 board/toradex/apalis-tk1/as3722_init.c             |  117 ++
 board/toradex/apalis-tk1/as3722_init.h             |   41 +
 .../toradex/apalis-tk1/pinmux-config-apalis-tk1.h  |  287 +++
 configs/apalis-tk1_defconfig                       |   53 +
 include/configs/apalis-tk1.h                       |  181 ++
 12 files changed, 3107 insertions(+)
 create mode 100644 arch/arm/dts/tegra124-apalis.dts
 create mode 100644 board/toradex/apalis-tk1/Kconfig
 create mode 100644 board/toradex/apalis-tk1/MAINTAINERS
 create mode 100644 board/toradex/apalis-tk1/Makefile
 create mode 100644 board/toradex/apalis-tk1/apalis-tk1.c
 create mode 100644 board/toradex/apalis-tk1/as3722_init.c
 create mode 100644 board/toradex/apalis-tk1/as3722_init.h
 create mode 100644 board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
 create mode 100644 configs/apalis-tk1_defconfig
 create mode 100644 include/configs/apalis-tk1.h
arch/arm/dts/Makefile +1 -0
index f437469..e3155b4 100644
@@ -57,6 +57,7 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra30-colibri.dtb \
 	tegra30-tec-ng.dtb \
 	tegra114-dalmore.dtb \
+	tegra124-apalis.dtb \
 	tegra124-jetson-tk1.dtb \
 	tegra124-nyan-big.dtb \
 	tegra124-cei-tk1-som.dtb \
arch/arm/dts/tegra124-apalis.dts new file +2203 -0

2,203 lines not on this page · raw message

arch/arm/mach-tegra/tegra124/Kconfig +7 -0
index df77462..443bfeb 100644
@@ -4,6 +4,12 @@ choice
 	prompt "Tegra124 board select"
 	optional
 
+config TARGET_APALIS_TK1
+	bool "Toradex Apalis TK1 module"
+	select CPU_V7_HAS_NONSEC
+	select CPU_V7_HAS_VIRT
+	select ARCH_SUPPORT_PSCI
+
 config TARGET_JETSON_TK1
 	bool "NVIDIA Tegra124 Jetson TK1 board"
 	select CPU_V7_HAS_NONSEC
@@ -42,5 +48,6 @@ source "board/cei/cei-tk1-som/Kconfig"
 source "board/nvidia/jetson-tk1/Kconfig"
 source "board/nvidia/nyan-big/Kconfig"
 source "board/nvidia/venice2/Kconfig"
+source "board/toradex/apalis-tk1/Kconfig"
 
 endif
board/toradex/apalis-tk1/Kconfig new file +30 -0
new file mode 100644
index 0000000..05407ad
@@ -0,0 +1,30 @@
+if TARGET_APALIS_TK1
+
+config SYS_BOARD
+	default "apalis-tk1"
+
+config SYS_VENDOR
+	default "toradex"
+
+config SYS_CONFIG_NAME
+	default "apalis-tk1"
+
+config TDX_CFG_BLOCK
+	default y
+
+config TDX_HAVE_MMC
+	default y
+
+config TDX_CFG_BLOCK_DEV
+	default "0"
+
+config TDX_CFG_BLOCK_PART
+	default "1"
+
+# Toradex config block in eMMC, at the end of 1st "boot sector"
+config TDX_CFG_BLOCK_OFFSET
+	default "-512"
+
+source "board/toradex/common/Kconfig"
+
+endif
board/toradex/apalis-tk1/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000..3c908e1
@@ -0,0 +1,7 @@
+Apalis TK1
+M:	Marcel Ziswiler <[email protected]>
+S:	Maintained
+F:	board/toradex/apalis-tk1/
+F:	include/configs/apalis-tk1.h
+F:	configs/apalis-tk1_defconfig
+F:	arch/arm/dts/tegra124-apalis.dtb
board/toradex/apalis-tk1/Makefile new file +5 -0
new file mode 100644
index 0000000..9ef06dd
@@ -0,0 +1,5 @@
+# Copyright (c) 2016 Toradex, Inc.
+# SPDX-License-Identifier:      GPL-2.0+
+
+obj-y	+= as3722_init.o
+obj-y	+= apalis-tk1.o
board/toradex/apalis-tk1/apalis-tk1.c new file +175 -0

175 lines not on this page · raw message

board/toradex/apalis-tk1/as3722_init.c new file +117 -0

117 lines not on this page · raw message

board/toradex/apalis-tk1/as3722_init.h new file +41 -0

41 lines not on this page · raw message

board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h new file +287 -0

287 lines not on this page · raw message

configs/apalis-tk1_defconfig new file +53 -0

53 lines not on this page · raw message

include/configs/apalis-tk1.h new file +181 -0

57 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.9.3

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH v2 1/5 arm: tegra: initial support for apalis tk1

Marcel,

Quoted 62 lines

-----Original Message-----
From: Marcel Ziswiler [mailto:marcel at ziswiler.com]
Sent: Monday, December 19, 2016 7:36 AM
To: u-boot at lists.denx.de
Cc: Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Marcel Ziswiler <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Masahiro Yamada <[email protected]>; York Sun <[email protected]>; Tom Warren <[email protected]>; Lokesh Vutla <[email protected]>; Ian Campbell <[email protected]>; Peter Chubb <[email protected]>; Jaehoon Chung <[email protected]>; Hans de Goede <[email protected]>; Alexander Graf <[email protected]>; Albert Aribaud <[email protected]>; Stefan Roese <[email protected]>; Prabhakar Kushwaha <[email protected]>; Stephen Warren <[email protected]>
Subject: [PATCH v2 1/5] arm: tegra: initial support for apalis tk1

From: Marcel Ziswiler <[email protected]>

This patch adds board support for the Toradex Apalis TK1 a computer on module which can be used on different carrier boards.

The module consists of a Tegra TK1 SoC, a PMIC solution, 2 GB of DDR3L RAM, a bunch of level shifters, an eMMC, a TMP451 temperature sensor chip, an I210 gigabit Ethernet controller and a SGTL5000 audio codec. Furthermore, there is a Kinetis MK20DN512 companion micro controller for analogue, CAN and resistive touch functionality.

For the sake of ease of use we do not distinguish between different carrier boards for now as the base module features are deemed sufficient enough for regular booting.

The following functionality is working so far:
- eMMC boot, environment storage and Toradex factory config block
- Gigabit Ethernet
- MMC/SD cards (both MMC1 as well as SD1 slot)
- USB client/host (dual role OTG port as client e.g. for DFU/UMS or host, other two ports as host)

---

Changes in v2:
- Added Simon's reviewed-by.

 arch/arm/dts/Makefile                              |    1 +
 arch/arm/dts/tegra124-apalis.dts                   | 2203 ++++++++++++++++++++
 arch/arm/mach-tegra/tegra124/Kconfig               |    7 +
 board/toradex/apalis-tk1/Kconfig                   |   30 +
 board/toradex/apalis-tk1/MAINTAINERS               |    7 +
 board/toradex/apalis-tk1/Makefile                  |    5 +
 board/toradex/apalis-tk1/apalis-tk1.c              |  175 ++
 board/toradex/apalis-tk1/as3722_init.c             |  117 ++
 board/toradex/apalis-tk1/as3722_init.h             |   41 +
 .../toradex/apalis-tk1/pinmux-config-apalis-tk1.h  |  287 +++
 configs/apalis-tk1_defconfig                       |   53 +
 include/configs/apalis-tk1.h                       |  181 ++
 12 files changed, 3107 insertions(+)
 create mode 100644 arch/arm/dts/tegra124-apalis.dts
 create mode 100644 board/toradex/apalis-tk1/Kconfig
Quoted 9 lines
 create mode 100644 board/toradex/apalis-tk1/MAINTAINERS
 create mode 100644 board/toradex/apalis-tk1/Makefile
 create mode 100644 board/toradex/apalis-tk1/apalis-tk1.c
 create mode 100644 board/toradex/apalis-tk1/as3722_init.c
 create mode 100644 board/toradex/apalis-tk1/as3722_init.h
 create mode 100644 board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
 create mode 100644 configs/apalis-tk1_defconfig
 create mode 100644 include/configs/apalis-tk1.h

<snip>

I tried to apply this to u-boot-tegra/master (after rebasing that with u-boot/master TOT), and get the following build error:

board/toradex/apalis-tk1/apalis-tk1.c: In function 'ft_board_setup':
board/toradex/apalis-tk1/apalis-tk1.c:39:2: warning: implicit declaration of function 'ft_common_board_setup' [-Wimplicit-function-declaration]
board/toradex/common/built-in.o: In function `ft_board_setup':
/home/tom/denx/uboot-tegra/board/toradex/common/tdx-common.c:125: multiple definition of `ft_board_setup' board/toradex/apalis-tk1/built-in.o:/home/tom/denx/uboot-tegra/board/toradex/apalis-tk1/apalis-tk1.c:39: first defined here
board/toradex/apalis-tk1/built-in.o: In function `ft_board_setup':
apalis-tk1.c:(.text.ft_board_setup+0x0): undefined reference to `ft_common_board_setup'
arm-none-linux-gnueabi-ld: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux-eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu/bfd/elf32-arm.c:7504
arm-none-linux-gnueabi-ld: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux-eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu/bfd/elf32-arm.c:13826 Segmentation fault (core dumped)
make: *** [u-boot] Error 139

Is this building OK for you against u-boot-tegra/master or u-boot/master?

Here are my top dozen commits for my local tegra/master (not yet pushed to Denx):

01646c4 colibri_t20: fix ulpi reset polarity
c68566a apalis_t30: comment about disabled pcie nodes 65b8f48 pci: kconfig: fix spelling in description
a4718e0 video: tegra: fix spelling in comment
6da200e apalis-tk1: disable external clock loopback on SDMMC3 a7bc3cf mmc: tegra: allow disabling external clock loopback ee2289d mmc: tegra: move CONFIG_TEGRA_MMC from headers to defconfigs 69bdc09 mmc: tegra: introduce CONFIG_TEGRA_MMC to Kconfig 242af81 arm: tegra: initial support for apalis tk1 4fcb6d4 ARM: tegra: allow passing cboot DTB to the kernel 0b4bc1b Merge branch 'master' of git://git.denx.de/u-boot-spi
b5178a1 Merge git://git.denx.de/u-boot-fsl-qoriq

Thanks,

Tom
--
nvpublic

#3 lore raw

PATCH v2 1/5 arm: tegra: initial support for apalis tk1

Hi Tom

Quoted 118 lines · Tom Warren

Marcel,

Quoted 73 lines

-----Original Message-----
From: Marcel Ziswiler [mailto:marcel at ziswiler.com]
Sent: Monday, December 19, 2016 7:36 AM
To: u-boot at lists.denx.de
Cc: Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Marcel Ziswiler <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass
<[email protected]>; Masahiro Yamada <[email protected]> ;
York Sun <[email protected]>; Tom Warren <[email protected]>; Lokesh
Vutla <[email protected]>; Ian Campbell <[email protected]>; Peter Chubb
<[email protected]>; Jaehoon Chung <[email protected] m>;
Hans de Goede <[email protected]>; Alexander Graf <[email protected]> ;
Albert Aribaud <[email protected]>; Stefan Roese <[email protected] e>;
Prabhakar Kushwaha <[email protected]>; Stephen Warren <[email protected]>
Subject: [PATCH v2 1/5] arm: tegra: initial support for apalis tk1

From: Marcel Ziswiler <[email protected]>

This patch adds board support for the Toradex Apalis TK1 a computer on
module which can be used on different carrier boards.

The module consists of a Tegra TK1 SoC, a PMIC solution, 2 GB of DDR3L
RAM, a bunch of level shifters, an eMMC, a TMP451 temperature sensor
chip, an I210 gigabit Ethernet controller and a SGTL5000 audio codec.
Furthermore, there is a Kinetis MK20DN512 companion micro controller for
analogue, CAN and resistive touch functionality.

For the sake of ease of use we do not distinguish between different carrier boards for now as the base module features are deemed sufficient enough for regular booting.

The following functionality is working so far:
- eMMC boot, environment storage and Toradex factory config block
- Gigabit Ethernet
- MMC/SD cards (both MMC1 as well as SD1 slot)
- USB client/host (dual role OTG port as client e.g. for DFU/UMS or host,
? other two ports as host)

---

Changes in v2:
- Added Simon's reviewed-by.

?arch/arm/dts/Makefile??????????????????????????????|????1 + ?arch/arm/dts/tegra124-apalis.dts???????????????????| 2203
++++++++++++++++++++

?arch/arm/mach-tegra/tegra124/Kconfig???????????????|????7 +
?board/toradex/apalis-tk1/Kconfig???????????????????|???30 +
?board/toradex/apalis-tk1/MAINTAINERS???????????????|????7 +
?board/toradex/apalis-tk1/Makefile??????????????????|????5 +
?board/toradex/apalis-tk1/apalis-tk1.c??????????????|??175 ++
?board/toradex/apalis-tk1/as3722_init.c?????????????|??117 ++
?board/toradex/apalis-tk1/as3722_init.h?????????????|???41 +
?.../toradex/apalis-tk1/pinmux-config-apalis-tk1.h??|??287 +++
?configs/apalis-tk1_defconfig???????????????????????|???53 +
?include/configs/apalis-tk1.h???????????????????????|??181 ++
Quoted 13 lines

?12 files changed, 3107 insertions(+)
?create mode 100644 arch/arm/dts/tegra124-apalis.dts ?create mode 100644 board/toradex/apalis-tk1/Kconfig ?create mode 100644 board/toradex/apalis-tk1/MAINTAINERS ?create mode 100644 board/toradex/apalis-tk1/Makefile ?create mode 100644 board/toradex/apalis-tk1/apalis-tk1.c ?create mode 100644 board/toradex/apalis-tk1/as3722_init.c ?create mode 100644 board/toradex/apalis-tk1/as3722_init.h ?create mode 100644 board/toradex/apalis-tk1/pinmux-config-apalis- tk1.h
?create mode 100644 configs/apalis-tk1_defconfig ?create mode 100644 include/configs/apalis-tk1.h

<snip>

I tried to apply this to u-boot-tegra/master (after rebasing that with u-boot/master TOT), and get the following build error:

board/toradex/apalis-tk1/apalis-tk1.c: In function 'ft_board_setup':
board/toradex/apalis-tk1/apalis-tk1.c:39:2: warning: implicit declaration of function 'ft_common_board_setup' [-Wimplicit-function- declaration]
board/toradex/common/built-in.o: In function `ft_board_setup':
/home/tom/denx/uboot-tegra/board/toradex/common/tdx-common.c:125:
multiple definition of ft_board_setup' board/toradex/apalis-tk1/built-in.o:/home/tom/denx/uboot- tegra/board/toradex/apalis-tk1/apalis-tk1.c:39: first defined here board/toradex/apalis-tk1/built-in.o: In function ft_board_setup':
apalis-tk1.c:(.text.ft_board_setup+0x0): undefined reference to `ft_common_board_setup'
arm-none-linux-gnueabi-ld: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux- eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-pc- linux-gnu/bfd/elf32-arm.c:7504
arm-none-linux-gnueabi-ld: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux- eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-pc- linux-gnu/bfd/elf32-arm.c:13826
Segmentation fault (core dumped)
make: *** [u-boot] Error 139

Quoted 1 line

Is this building OK for you against u-boot-tegra/master

No, sorry. That one also fails for me due to missing the following from Stefan recently merged into u-boot/master:

commit 37fa41256bd756f3652e7479b976982092a4f9bc (toradex: allow custom fdt board setup in board file)

Quoted 1 line

or u-boot/master?

Yes, that one builds fine for me.

Quoted 15 lines

Here are my top dozen commits for my local tegra/master (not yet pushed to Denx):

01646c4 colibri_t20: fix ulpi reset polarity
c68566a apalis_t30: comment about disabled pcie nodes 65b8f48 pci: kconfig: fix spelling in description
a4718e0 video: tegra: fix spelling in comment
6da200e apalis-tk1: disable external clock loopback on SDMMC3 a7bc3cf mmc: tegra: allow disabling external clock loopback ee2289d mmc: tegra: move CONFIG_TEGRA_MMC from headers to defconfigs 69bdc09 mmc: tegra: introduce CONFIG_TEGRA_MMC to Kconfig 242af81 arm: tegra: initial support for apalis tk1 4fcb6d4 ARM: tegra: allow passing cboot DTB to the kernel 0b4bc1b Merge branch 'master' of git://git.denx.de/u-boot-spi
b5178a1 Merge git://git.denx.de/u-boot-fsl-qoriq

Let me know if you rather like me to re-base and re-send.

Quoted 3 lines

Thanks,

Tom

Cheers

Marcel

#4 lore raw

PATCH v2 1/5 arm: tegra: initial support for apalis tk1

Marcel,

Quoted 159 lines

-----Original Message-----
From: Marcel Ziswiler [mailto:marcel at ziswiler.com]
Sent: Monday, December 19, 2016 6:11 PM
To: Tom Warren <[email protected]>; u-boot at lists.denx.de
Cc: Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Masahiro Yamada <[email protected]>; York Sun <[email protected]>; Lokesh Vutla <[email protected]>; Ian Campbell <[email protected]>; Peter Chubb <[email protected]>; Jaehoon Chung <[email protected]>; Hans de Goede <[email protected]>; Alexander Graf <[email protected]>; Albert Aribaud <[email protected]>; Stefan Roese <[email protected]>; Prabhakar Kushwaha <[email protected]>; Stephen Warren <[email protected]>
Subject: Re: [PATCH v2 1/5] arm: tegra: initial support for apalis tk1

Hi Tom

Quoted 7 lines · Tom Warren

Marcel,

Quoted 5 lines

-----Original Message-----
From: Marcel Ziswiler [mailto:marcel at ziswiler.com]
Sent: Monday, December 19, 2016 7:36 AM
To: u-boot at lists.denx.de
Cc: Max Krummenacher <[email protected]>; Stefan

Agner

Quoted 104 lines
Quoted 61 lines

<[email protected]>; Marcel Ziswiler <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Masahiro Yamada <[email protected]> ; York Sun <[email protected]>; Tom Warren <[email protected]>; Lokesh Vutla <[email protected]>; Ian Campbell <[email protected]>; Peter Chubb <[email protected]>; Jaehoon Chung <[email protected] m>;
Hans de Goede <[email protected]>; Alexander Graf <[email protected]> ; Albert Aribaud <[email protected]>; Stefan Roese <[email protected]
e>;
Prabhakar Kushwaha <[email protected]>; Stephen Warren <[email protected]>
Subject: [PATCH v2 1/5] arm: tegra: initial support for apalis tk1

From: Marcel Ziswiler <[email protected]>

This patch adds board support for the Toradex Apalis TK1 a computer on module which can be used on different carrier boards.

The module consists of a Tegra TK1 SoC, a PMIC solution, 2 GB of DDR3L RAM, a bunch of level shifters, an eMMC, a TMP451 temperature sensor chip, an I210 gigabit Ethernet controller and a SGTL5000 audio codec.
Furthermore, there is a Kinetis MK20DN512 companion micro controller for analogue, CAN and resistive touch functionality.

For the sake of ease of use we do not distinguish between different carrier boards for now as the base module features are deemed sufficient enough for regular booting.

The following functionality is working so far:
- eMMC boot, environment storage and Toradex factory config block
- Gigabit Ethernet
- MMC/SD cards (both MMC1 as well as SD1 slot)
- USB client/host (dual role OTG port as client e.g. for DFU/UMS or host,
? other two ports as host)

---

Changes in v2:
- Added Simon's reviewed-by.

?arch/arm/dts/Makefile??????????????????????????????|????1 + ?arch/arm/dts/tegra124-apalis.dts???????????????????| 2203
++++++++++++++++++++

?arch/arm/mach-tegra/tegra124/Kconfig???????????????|????7 +
?board/toradex/apalis-tk1/Kconfig???????????????????|???30 +
?board/toradex/apalis-tk1/MAINTAINERS???????????????|????7 +
?board/toradex/apalis-tk1/Makefile??????????????????|????5 +
?board/toradex/apalis-tk1/apalis-tk1.c??????????????|??175 ++
?board/toradex/apalis-tk1/as3722_init.c?????????????|??117 ++
?board/toradex/apalis-tk1/as3722_init.h?????????????|???41 +
?.../toradex/apalis-tk1/pinmux-config-apalis-tk1.h??|??287 +++
?configs/apalis-tk1_defconfig???????????????????????|???53 +
?include/configs/apalis-tk1.h???????????????????????|??181 ++
Quoted 13 lines

?12 files changed, 3107 insertions(+)
?create mode 100644 arch/arm/dts/tegra124-apalis.dts ?create mode 100644 board/toradex/apalis-tk1/Kconfig ?create mode 100644 board/toradex/apalis-tk1/MAINTAINERS ?create mode 100644 board/toradex/apalis-tk1/Makefile ?create mode 100644 board/toradex/apalis-tk1/apalis-tk1.c ?create mode 100644 board/toradex/apalis-tk1/as3722_init.c ?create mode 100644 board/toradex/apalis-tk1/as3722_init.h ?create mode 100644 board/toradex/apalis-tk1/pinmux-config-apalis- tk1.h
?create mode 100644 configs/apalis-tk1_defconfig ?create mode 100644 include/configs/apalis-tk1.h

<snip>

I tried to apply this to u-boot-tegra/master (after rebasing that with u-boot/master TOT), and get the following build error:

board/toradex/apalis-tk1/apalis-tk1.c: In function 'ft_board_setup':
board/toradex/apalis-tk1/apalis-tk1.c:39:2: warning: implicit declaration of function 'ft_common_board_setup' [-Wimplicit-function- declaration]
board/toradex/common/built-in.o: In function `ft_board_setup':
/home/tom/denx/uboot-tegra/board/toradex/common/tdx-common.c:125:
multiple definition of ft_board_setup' board/toradex/apalis-tk1/built-in.o:/home/tom/denx/uboot- tegra/board/toradex/apalis-tk1/apalis-tk1.c:39: first defined here board/toradex/apalis-tk1/built-in.o: In function ft_board_setup':
apalis-tk1.c:(.text.ft_board_setup+0x0): undefined reference to `ft_common_board_setup'
arm-none-linux-gnueabi-ld: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux- eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-pc- linux-gnu/bfd/elf32-arm.c:7504
arm-none-linux-gnueabi-ld: BFD (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905 assertion fail /scratch/jwlemke/2011.09-arm-linux- eabi-lite/obj/binutils-src-2011.09-70-arm-none-linux-gnueabi-i686-pc- linux-gnu/bfd/elf32-arm.c:13826
Segmentation fault (core dumped)
make: *** [u-boot] Error 139

Quoted 1 line

Is this building OK for you against u-boot-tegra/master

No, sorry. That one also fails for me due to missing the following from Stefan recently merged into u-boot/master:

commit 37fa41256bd756f3652e7479b976982092a4f9bc (toradex: allow custom fdt board setup in board file)

Quoted 1 line

or u-boot/master?

Yes, that one builds fine for me.

Quoted 15 lines

Here are my top dozen commits for my local tegra/master (not yet pushed to Denx):

01646c4 colibri_t20: fix ulpi reset polarity c68566a apalis_t30:
comment about disabled pcie nodes
65b8f48 pci: kconfig: fix spelling in description a4718e0 video: tegra: fix spelling in comment 6da200e apalis-tk1:
disable external clock loopback on SDMMC3 a7bc3cf mmc: tegra: allow disabling external clock loopback ee2289d mmc: tegra: move CONFIG_TEGRA_MMC from headers to defconfigs
69bdc09 mmc: tegra: introduce CONFIG_TEGRA_MMC to Kconfig 242af81 arm: tegra: initial support for apalis tk1 4fcb6d4 ARM: tegra: allow passing cboot DTB to the kernel 0b4bc1b Merge branch 'master' of git://git.denx.de/u-boot-spi
b5178a1 Merge git://git.denx.de/u-boot-fsl-qoriq

Quoted 1 line

Let me know if you rather like me to re-base and re-send.

Yes, please. That makes my life a little easier, as I expect all Tegra-bound patches to work against u-boot-tegra/master. Note that I did push the rest of your changes to Denx so I'll have to rework /master and repush for you to rebase against. I'll also redo the rebase against TOT u-boot/master just in case.

Thanks,

Tom

Quoted 8 lines
Quoted 4 lines

Thanks,

Tom

Cheers

Marcel

--
nvpublic

#5 lore raw

PATCH v2 2/5 mmc: tegra: introduce CONFIG_TEGRA_MMC to Kconfig

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

---

Changes in v2:
- Added Simon's reviewed-by.

 drivers/mmc/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/Kconfig +6 -0
index 5e84a41..18f0e97 100644
@@ -110,4 +110,10 @@ config SANDBOX_MMC
 	  improves build coverage for sandbox and makes it easier to detect
 	  MMC build errors with sandbox.
 
+config TEGRA_MMC
+	bool "Tegra SDHCI aka MMC support"
+	depends on DM_MMC && TEGRA
+	help
+	  This selects support for SDHCI on Tegra SoCs.
+
 endmenu
Signature · 1 line
2.9.3
#6 lore raw

PATCH v2 3/5 mmc: tegra: move CONFIG_TEGRA_MMC from headers to defconfigs

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Basically running the following script:

tools/moveconfig.py CONFIG_TEGRA_MMC

Note that I left the SPL specific handling in
include/configs/tegra-common-post.h unchanged.

---

Changes in v2:
- Added Simon's reviewed-by.

BTW: I will look at converting tegra to use CONFIG_BLK and CONFIG_DM_MMC_OPS in a later separate step.

---
 configs/apalis-tk1_defconfig  | 1 +
 configs/apalis_t30_defconfig  | 1 +
 configs/beaver_defconfig      | 1 +
 configs/cardhu_defconfig      | 1 +
 configs/cei-tk1-som_defconfig | 1 +
 configs/colibri_t20_defconfig | 1 +
 configs/colibri_t30_defconfig | 1 +
 configs/dalmore_defconfig     | 1 +
 configs/harmony_defconfig     | 1 +
 configs/jetson-tk1_defconfig  | 1 +
 configs/medcom-wide_defconfig | 1 +
 configs/nyan-big_defconfig    | 1 +
 configs/paz00_defconfig       | 1 +
 configs/plutux_defconfig      | 1 +
 configs/seaboard_defconfig    | 1 +
 configs/tec-ng_defconfig      | 1 +
 configs/tec_defconfig         | 1 +
 configs/trimslice_defconfig   | 1 +
 configs/venice2_defconfig     | 1 +
 configs/ventana_defconfig     | 1 +
 configs/whistler_defconfig    | 1 +
 include/configs/apalis-tk1.h  | 1 -
 include/configs/apalis_t30.h  | 1 -
 include/configs/beaver.h      | 1 -
 include/configs/cardhu.h      | 1 -
 include/configs/cei-tk1-som.h | 1 -
 include/configs/colibri_t20.h | 1 -
 include/configs/colibri_t30.h | 1 -
 include/configs/dalmore.h     | 1 -
 include/configs/e2220-1170.h  | 1 -
 include/configs/harmony.h     | 1 -
 include/configs/jetson-tk1.h  | 1 -
 include/configs/medcom-wide.h | 1 -
 include/configs/nyan-big.h    | 1 -
 include/configs/p2371-0000.h  | 1 -
 include/configs/p2371-2180.h  | 1 -
 include/configs/p2571.h       | 1 -
 include/configs/p2771-0000.h  | 1 -
 include/configs/paz00.h       | 1 -
 include/configs/plutux.h      | 1 -
 include/configs/seaboard.h    | 1 -
 include/configs/tec-ng.h      | 1 -
 include/configs/tec.h         | 1 -
 include/configs/trimslice.h   | 1 -
 include/configs/venice2.h     | 1 -
 include/configs/ventana.h     | 1 -
 include/configs/whistler.h    | 1 -
 scripts/config_whitelist.txt  | 1 -
 48 files changed, 21 insertions(+), 27 deletions(-)
configs/apalis-tk1_defconfig +1 -0
index ae95f6b..c1caef1 100644
@@ -36,6 +36,7 @@ CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_E1000=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
configs/apalis_t30_defconfig +1 -0
index 691148c..0822e2e 100644
@@ -25,6 +25,7 @@ CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_E1000=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
configs/beaver_defconfig +1 -0
index 5cb73c0..69c9ccd 100644
@@ -28,6 +28,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_RTL8169=y
configs/cardhu_defconfig +1 -0
index 0214758..e8e8b20 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_RTL8169=y
configs/cei-tk1-som_defconfig +1 -0
index 909b367..57b87c9 100644
@@ -28,6 +28,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_RTL8169=y
configs/colibri_t20_defconfig +1 -0
index a543246..3a4dc31 100644
@@ -28,6 +28,7 @@ CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
configs/colibri_t30_defconfig +1 -0
index 2ab6764..724a600 100644
@@ -25,6 +25,7 @@ CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
configs/dalmore_defconfig +1 -0
index 0db2d1d..285785d 100644
@@ -28,6 +28,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SYS_NS16550=y
configs/harmony_defconfig +1 -0
index d8712d5..8ce493f 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
configs/jetson-tk1_defconfig +1 -0
index b0aa3c7..5ee5372 100644
@@ -28,6 +28,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_RTL8169=y
configs/medcom-wide_defconfig +1 -0
index a65c3ad..4d99925 100644
@@ -22,6 +22,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
configs/nyan-big_defconfig +1 -0
index e6f862d..106a1a6 100644
@@ -36,6 +36,7 @@ CONFIG_CROS_EC_KEYB=y
 CONFIG_CROS_EC=y
 CONFIG_CROS_EC_SPI=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_PMIC=y
configs/paz00_defconfig +1 -0
index b3d6f90..e1b33e3 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
configs/plutux_defconfig +1 -0
index 3c45b9d..dabbc09 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
configs/seaboard_defconfig +1 -0
index c3119dc..78dd24b 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
configs/tec-ng_defconfig +1 -0
index f52f19b..7e1e3f3 100644
@@ -24,6 +24,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SYS_NS16550=y
configs/tec_defconfig +1 -0
index 1ccec73..2f3d131 100644
@@ -22,6 +22,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
configs/trimslice_defconfig +1 -0
index a145ff8..aa0da8f 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_RTL8169=y
configs/venice2_defconfig +1 -0
index 8ff879f..022b4ef 100644
@@ -28,6 +28,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SYS_NS16550=y
configs/ventana_defconfig +1 -0
index 1f2809a..7021b62 100644
@@ -20,6 +20,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
configs/whistler_defconfig +1 -0
index b7c3ed9..221e520 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_SPL_DM=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
+CONFIG_TEGRA_MMC=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
include/configs/apalis-tk1.h +0 -1
index 50e30b1..a38f5d5 100644
@@ -31,7 +31,6 @@
 /* SD/MMC support */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 #define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
 
 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
include/configs/apalis_t30.h +0 -1
index f2a24c1..b3c6e20 100644
@@ -30,7 +30,6 @@
 /* SD/MMC support */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/beaver.h +0 -1
index ab1ab14..ffa2909 100644
@@ -30,7 +30,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/cardhu.h +0 -1
index 462b784..29a74c7 100644
@@ -33,7 +33,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/cei-tk1-som.h +0 -1
index f3bb279..4688b33 100644
@@ -32,7 +32,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/colibri_t20.h +0 -1
index 6a52869..3c917b0 100644
@@ -29,7 +29,6 @@
 /* SD/MMC support */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* USB host support */
 #define CONFIG_USB_EHCI
include/configs/colibri_t30.h +0 -1
index e8b3f99..cb1488f 100644
@@ -30,7 +30,6 @@
 /* SD/MMC support */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/dalmore.h +0 -1
index b0311bf..45576f4 100644
@@ -26,7 +26,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/e2220-1170.h +0 -1
index c9e8c8e..3de36d7 100644
@@ -24,7 +24,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/harmony.h +0 -1
index 3d6b5fc..784fffa 100644
@@ -29,7 +29,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* NAND support */
 #define CONFIG_CMD_NAND
include/configs/jetson-tk1.h +0 -1
index 90e282f..a00f9fa 100644
@@ -28,7 +28,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/medcom-wide.h +0 -1
index ae7ca3b..d3d0b15 100644
@@ -22,7 +22,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* NAND support */
 #define CONFIG_CMD_NAND
include/configs/nyan-big.h +0 -1
index c548ee1..95324d8 100644
@@ -27,7 +27,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/p2371-0000.h +0 -1
index 968b89e..b200dc4 100644
@@ -24,7 +24,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/p2371-2180.h +0 -1
index 9cf697f..03cbf72 100644
@@ -24,7 +24,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/p2571.h +0 -1
index 4fa345d..7ab3c78 100644
@@ -25,7 +25,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/p2771-0000.h +0 -1
index 67a1603..1bba51e 100644
@@ -20,7 +20,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/paz00.h +0 -1
index a8bb3ff..36a1bb5 100644
@@ -25,7 +25,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/plutux.h +0 -1
index 635e439..39e4e4f 100644
@@ -22,7 +22,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* NAND support */
 #define CONFIG_CMD_NAND
include/configs/seaboard.h +0 -1
index 2b6509a..099b2c9 100644
@@ -34,7 +34,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/tec-ng.h +0 -1
index 0e9d98c..953b196 100644
@@ -23,7 +23,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/tec.h +0 -1
index 7b14299..0386071 100644
@@ -22,7 +22,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* NAND support */
 #define CONFIG_CMD_NAND
include/configs/trimslice.h +0 -1
index cfc8451..e78a5e6 100644
@@ -30,7 +30,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in SPI */
 #define CONFIG_ENV_IS_IN_SPI_FLASH
include/configs/venice2.h +0 -1
index 72fa973..f2c8f22 100644
@@ -25,7 +25,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/ventana.h +0 -1
index 7a38869..2c88d64 100644
@@ -23,7 +23,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
include/configs/whistler.h +0 -1
index 0cd892e..1c2e166 100644
@@ -27,7 +27,6 @@
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_TEGRA_MMC
 
 /*
  * Environment in eMMC, at the end of 2nd "boot sector". Note: This assumes
scripts/config_whitelist.txt +0 -1
index 8814841..ae6882b 100644
@@ -7819,7 +7819,6 @@ CONFIG_TEGRA_ENABLE_UARTE
 CONFIG_TEGRA_GPU
 CONFIG_TEGRA_KEYBOARD
 CONFIG_TEGRA_LP0
-CONFIG_TEGRA_MMC
 CONFIG_TEGRA_NAND
 CONFIG_TEGRA_PMU
 CONFIG_TEGRA_SLINK_CTRLS
Signature · 1 line
2.9.3
#7 lore raw

PATCH v2 4/5 mmc: tegra: allow disabling external clock loopback

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Introduce CONFIG_TEGRA124_MMC_DISABLE_EXT_LOOPBACK to disable the external clock loopback and use the internal one on SDMMC3 as per the SDMMC_VENDOR_MISC_CNTRL_0 register's SDMMC_SPARE1 bits being set to 0xfffd according to the TRM.

---

Changes in v2:
- Added Simon's reviewed-by.
- Added TODO(email) as suggested by Simon so it is clear this is temporary and will be moved to device tree controlled approach once proper kernel integration made it mainline.

 arch/arm/include/asm/arch-tegra/tegra_mmc.h |  2 ++
 drivers/mmc/Kconfig                         | 11 +++++++++++
 drivers/mmc/tegra_mmc.c                     | 16 ++++++++++++++++
 3 files changed, 29 insertions(+)
arch/arm/include/asm/arch-tegra/tegra_mmc.h +2 -0
index 64c848a..c40599a 100644
@@ -108,6 +108,8 @@ struct tegra_mmc {
 #define TEGRA_MMC_CLKCON_SDCLK_FREQ_SEL_SHIFT			8
 #define TEGRA_MMC_CLKCON_SDCLK_FREQ_SEL_MASK			(0xff << 8)
 
+#define TEGRA_MMC_MISCON_ENABLE_EXT_LOOPBACK			(1 << 17)
+
 #define TEGRA_MMC_SWRST_SW_RESET_FOR_ALL			(1 << 0)
 #define TEGRA_MMC_SWRST_SW_RESET_FOR_CMD_LINE			(1 << 1)
 #define TEGRA_MMC_SWRST_SW_RESET_FOR_DAT_LINE			(1 << 2)
drivers/mmc/Kconfig +11 -0
index 18f0e97..6372876 100644
@@ -116,4 +116,15 @@ config TEGRA_MMC
 	help
 	  This selects support for SDHCI on Tegra SoCs.
 
+config TEGRA124_MMC_DISABLE_EXT_LOOPBACK
+	bool "Disable external clock loopback"
+	depends on TEGRA_MMC && TEGRA124
+	help
+	  Disable the external clock loopback and use the internal one on SDMMC3
+	  as per the SDMMC_VENDOR_MISC_CNTRL_0 register's SDMMC_SPARE1 bits
+	  being set to 0xfffd according to the TRM.
+
+	  TODO(marcel.ziswiler at toradex.com): Move to device tree controlled
+	  approach once proper kernel integration made it mainline.
+
 endmenu
drivers/mmc/tegra_mmc.c +16 -0
index 97b1154..839b15d 100644
@@ -511,6 +511,22 @@ static int tegra_mmc_init(struct mmc *mmc)
 
 	tegra_mmc_reset(priv, mmc);
 
+#if defined(CONFIG_TEGRA124_MMC_DISABLE_EXT_LOOPBACK)
+	/*
+	 * Disable the external clock loopback and use the internal one on
+	 * SDMMC3 as per the SDMMC_VENDOR_MISC_CNTRL_0 register's SDMMC_SPARE1
+	 * bits being set to 0xfffd according to the TRM.
+	 *
+	 * TODO([email protected]): Move to device tree controlled
+	 * approach once proper kernel integration made it mainline.
+	 */
+	if (priv->reg == (void *)0x700b0400) {
+		mask = readl(&priv->reg->venmiscctl);
+		mask &= ~TEGRA_MMC_MISCON_ENABLE_EXT_LOOPBACK;
+		writel(mask, &priv->reg->venmiscctl);
+	}
+#endif
+
 	priv->version = readw(&priv->reg->hcver);
 	debug("host version = %x\n", priv->version);
 
Signature · 1 line
2.9.3
#8 lore raw

PATCH v2 5/5 apalis-tk1: disable external clock loopback on SDMMC3

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Actually make use of that shiny new CONFIG_TEGRA124_MMC_DISABLE_EXT_LOOPBACK.

---

Changes in v2: None

 configs/apalis-tk1_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apalis-tk1_defconfig +1 -0
index c1caef1..204137b 100644
@@ -37,6 +37,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 # CONFIG_DM_MMC_OPS is not set
 CONFIG_TEGRA_MMC=y
+CONFIG_TEGRA124_MMC_DISABLE_EXT_LOOPBACK=y
 CONFIG_E1000=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
Signature · 1 line
2.9.3