All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10
@ 2019-07-31 12:04 Igor Opaniuk
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci# Igor Opaniuk
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

Misc. fixes related to pinmux configuration (fan), default bootargs,
reset reason output and power rail configuration.

Dominik Sliwa (2):
  apalis-tk1/t30: colibri_t30: display reset reason
  apalis-tk1: remove non-esential power rails on boot

Igor Opaniuk (5):
  apalis-tk1: set apalis gpio 8 aka fan_en
  apalis-tk1: provide proper USB vendor id
  apalis-tk1: enable user debug by default
  apalis-tk1: add pcie_aspm=off to defargs
  apalis-tk1: switch to zImage

Marcel Ziswiler (2):
  apalis-tk1: do not explicitly release reset_moci#
  apalis-tk1: remove default vesa vga mode from vidargs

 arch/arm/mach-tegra/sys_info.c                | 32 ++++++++-----
 arch/arm/mach-tegra/tegra124/cpu.c            | 45 +++++++++++++++++++
 board/toradex/apalis-tk1/apalis-tk1.c         | 10 +++++
 board/toradex/apalis-tk1/as3722_init.c        | 23 ++++++++++
 .../apalis-tk1/pinmux-config-apalis-tk1.h     |  2 +-
 configs/apalis-tk1_defconfig                  |  2 +-
 include/configs/apalis-tk1.h                  | 17 +++----
 7 files changed, 111 insertions(+), 20 deletions(-)

-- 
2.17.1

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

* [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci#
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:00   ` Oleksandr Suvorov
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 2/9] apalis-tk1: set apalis gpio 8 aka fan_en Igor Opaniuk
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Marcel Ziswiler <marcel.ziswiler@toradex.com>

By keeping RESET_MOCI_CTRL low we avoid explicitly releasing
RESET_MOCI#.

Please note that module hardware versions up to V1.1A will already
release RESET_MOCI# in hardware coming out of reset.

Please further note that with this change the USB hub on the Apalis
Evaluation board is kept in reset in U-Boot and therefore none of its
ports are operational in U-Boot.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h b/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
index 1584d9b2d3..d2d24c4391 100644
--- a/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
+++ b/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
@@ -39,7 +39,7 @@ static const struct tegra_gpio_config apalis_tk1_gpio_inits[] = {
 	GPIO_INIT(R,    1,   OUT0), /* Shift_CTRL_Dir_In[1] */
 	GPIO_INIT(R,    2,   OUT0), /* Shift_CTRL_OE[3] */
 	GPIO_INIT(S,    3,   OUT0), /* Shift_CTRL_Dir_In[2] */
-	GPIO_INIT(U,    4,   OUT1),
+	GPIO_INIT(U,    4,   OUT0), /* RESET_MOCI_CTRL */
 	GPIO_INIT(W,    3,   IN),
 	GPIO_INIT(W,    5,   IN),
 	GPIO_INIT(BB,   0,  IN),
-- 
2.17.1

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

* [U-Boot] [PATCH v1 2/9] apalis-tk1: set apalis gpio 8 aka fan_en
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci# Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:02   ` Oleksandr Suvorov
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 3/9] apalis-tk1: provide proper USB vendor id Igor Opaniuk
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Make sure the Apalis GPIO 8 aka FAN_EN is on when using Apalis TK1
modules.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
---

 board/toradex/apalis-tk1/apalis-tk1.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
index b87e9e7a3e..d57c5042dd 100644
--- a/board/toradex/apalis-tk1/apalis-tk1.c
+++ b/board/toradex/apalis-tk1/apalis-tk1.c
@@ -19,6 +19,7 @@
 
 #define LAN_DEV_OFF_N	TEGRA_GPIO(O, 6)
 #define LAN_RESET_N	TEGRA_GPIO(S, 2)
+#define FAN_EN		TEGRA_GPIO(DD, 2)
 #define LAN_WAKE_N	TEGRA_GPIO(O, 5)
 #ifdef CONFIG_APALIS_TK1_PCIE_EVALBOARD_INIT
 #define PEX_PERST_N	TEGRA_GPIO(DD, 1) /* Apalis GPIO7 */
@@ -241,6 +242,15 @@ void tegra_pcie_board_port_reset(struct tegra_pcie_port *port)
 }
 #endif /* CONFIG_PCI_TEGRA */
 
+/*
+ * Enable/start PWM CPU fan
+ */
+void start_cpu_fan(void)
+{
+	gpio_request(FAN_EN, "FAN_EN");
+	gpio_direction_output(FAN_EN, 1);
+}
+
 /*
  * Backlight off before OS handover
  */
-- 
2.17.1

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

* [U-Boot] [PATCH v1 3/9] apalis-tk1: provide proper USB vendor id
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci# Igor Opaniuk
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 2/9] apalis-tk1: set apalis gpio 8 aka fan_en Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:03   ` Oleksandr Suvorov
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 4/9] apalis-tk1: enable user debug by default Igor Opaniuk
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Use unified values for USB Product/Vendor numbers
when the config block is missing

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 configs/apalis-tk1_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/apalis-tk1_defconfig b/configs/apalis-tk1_defconfig
index 41f3aff149..ceefe4e86a 100644
--- a/configs/apalis-tk1_defconfig
+++ b/configs/apalis-tk1_defconfig
@@ -56,7 +56,7 @@ CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Toradex"
 CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
-CONFIG_USB_GADGET_PRODUCT_NUM=0xffff
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT_OVERLAY=y
-- 
2.17.1

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

* [U-Boot] [PATCH v1 4/9] apalis-tk1: enable user debug by default
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (2 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 3/9] apalis-tk1: provide proper USB vendor id Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 5/9] apalis-tk1: add pcie_aspm=off to defargs Igor Opaniuk
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Let the kernel print some debug messages when a user program
crashes due to an exception.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 include/configs/apalis-tk1.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
index b4ddd1bdc6..efc52841d1 100644
--- a/include/configs/apalis-tk1.h
+++ b/include/configs/apalis-tk1.h
@@ -111,7 +111,8 @@
 	"boot_file=uImage\0" \
 	"console=ttyS0\0" \
 	"defargs=lp0_vec=2064 at 0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
-		"usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0\0" \
+		"usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \
+		"user_debug=30\0" \
 	"dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
 	EMMC_BOOTCMD \
 	"fdt_board=eval\0" \
-- 
2.17.1

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

* [U-Boot] [PATCH v1 5/9] apalis-tk1: add pcie_aspm=off to defargs
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (3 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 4/9] apalis-tk1: enable user debug by default Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:07   ` Oleksandr Suvorov
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 6/9] apalis-tk1: switch to zImage Igor Opaniuk
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Disabling ASPM fixes incompatibilities with some PCIe cards

Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 include/configs/apalis-tk1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
index efc52841d1..0bde1697bb 100644
--- a/include/configs/apalis-tk1.h
+++ b/include/configs/apalis-tk1.h
@@ -112,7 +112,7 @@
 	"console=ttyS0\0" \
 	"defargs=lp0_vec=2064 at 0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
 		"usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \
-		"user_debug=30\0" \
+		"user_debug=30 pcie_aspm=off\0" \
 	"dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
 	EMMC_BOOTCMD \
 	"fdt_board=eval\0" \
-- 
2.17.1

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

* [U-Boot] [PATCH v1 6/9] apalis-tk1: switch to zImage
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (4 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 5/9] apalis-tk1: add pcie_aspm=off to defargs Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:09   ` Oleksandr Suvorov
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 7/9] apalis-tk1/t30: colibri_t30: display reset reason Igor Opaniuk
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Switch to the generic compressed Kernel image type (zImage) instead of
the U-Boot specific uImage format.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 include/configs/apalis-tk1.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
index 0bde1697bb..10f2948c62 100644
--- a/include/configs/apalis-tk1.h
+++ b/include/configs/apalis-tk1.h
@@ -42,7 +42,7 @@
 #define DFU_ALT_EMMC_INFO	"apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
 				"boot part 0 1 mmcpart 0; " \
 				"rootfs part 0 2 mmcpart 0; " \
-				"uImage fat 0 1 mmcpart 0; " \
+				"zImage fat 0 1 mmcpart 0; " \
 				"tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
 
 #define EMMC_BOOTCMD \
@@ -54,7 +54,7 @@
 		"run emmcdtbload; " \
 		"load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
 		"${boot_file} && run fdt_fixup && " \
-		"bootm ${kernel_addr_r} - ${dtbparam}\0" \
+		"bootz ${kernel_addr_r} - ${dtbparam}\0" \
 	"emmcbootpart=1\0" \
 	"emmcdev=0\0" \
 	"emmcdtbload=setenv dtbparam; load mmc ${emmcdev}:${emmcbootpart} " \
@@ -68,7 +68,7 @@
 	"nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
 		"${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
 		"run nfsdtbload; dhcp ${kernel_addr_r} " \
-		"&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
+		"&& run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}\0" \
 	"nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
 		"${soc}-apalis-${fdt_board}.dtb " \
 		"&& setenv dtbparam ${fdt_addr_r}\0"
@@ -81,7 +81,7 @@
 		"${vidargs}; echo Booting from SD card in 8bit slot...; " \
 		"run sddtbload; load mmc ${sddev}:${sdbootpart} " \
 		"${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
-		"bootm ${kernel_addr_r} - ${dtbparam}\0" \
+		"bootz ${kernel_addr_r} - ${dtbparam}\0" \
 	"sdbootpart=1\0" \
 	"sddev=1\0" \
 	"sddtbload=setenv dtbparam; load mmc ${sddev}:${sdbootpart} " \
@@ -98,7 +98,7 @@
 		"${usbargs} ${vidargs}; echo Booting from USB stick...; " \
 		"run usbdtbload; load usb ${usbdev}:${usbbootpart} " \
 		"${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
-		"bootm ${kernel_addr_r} - ${dtbparam}\0" \
+		"bootz ${kernel_addr_r} - ${dtbparam}\0" \
 	"usbbootpart=1\0" \
 	"usbdev=0\0" \
 	"usbdtbload=setenv dtbparam; load usb ${usbdev}:${usbbootpart} " \
@@ -108,7 +108,7 @@
 	"usbrootpart=2\0"
 
 #define BOARD_EXTRA_ENV_SETTINGS \
-	"boot_file=uImage\0" \
+	"boot_file=zImage\0" \
 	"console=ttyS0\0" \
 	"defargs=lp0_vec=2064 at 0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
 		"usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \
-- 
2.17.1

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

* [U-Boot] [PATCH v1 7/9] apalis-tk1/t30: colibri_t30: display reset reason
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (5 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 6/9] apalis-tk1: switch to zImage Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 8/9] apalis-tk1: remove default vesa vga mode from vidargs Igor Opaniuk
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Dominik Sliwa <dominik.sliwa@toradex.com>

Display proper reset reason after the SoC info.

Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 arch/arm/mach-tegra/sys_info.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-tegra/sys_info.c b/arch/arm/mach-tegra/sys_info.c
index 9975f33e0b..5dc998a52b 100644
--- a/arch/arm/mach-tegra/sys_info.c
+++ b/arch/arm/mach-tegra/sys_info.c
@@ -6,24 +6,36 @@
 
 #include <common.h>
 #include <linux/ctype.h>
+#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
+#include <asm/arch-tegra/pmc.h>
 
-static void upstring(char *s)
+static char *get_reset_cause(void)
 {
-	while (*s) {
-		*s = toupper(*s);
-		s++;
+	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+	switch (pmc->pmc_reset_status) {
+	case 0x00:
+		return "POR";
+	case 0x01:
+		return "WATCHDOG";
+	case 0x02:
+		return "SENSOR";
+	case 0x03:
+		return "SW_MAIN";
+	case 0x04:
+		return "LP0";
 	}
+	return "UNKNOWN";
 }
+#endif
 
 /* Print CPU information */
 int print_cpuinfo(void)
 {
-	char soc_name[10];
-
-	strncpy(soc_name, CONFIG_SYS_SOC, 10);
-	upstring(soc_name);
-	puts(soc_name);
-	puts("\n");
+	printf("SoC: %s\n", CONFIG_SYS_SOC);
+#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
+	printf("Reset cause: %s\n", get_reset_cause());
+#endif
 
 	/* TBD: Add printf of major/minor rev info, stepping, etc. */
 	return 0;
-- 
2.17.1

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

* [U-Boot] [PATCH v1 8/9] apalis-tk1: remove default vesa vga mode from vidargs
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (6 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 7/9] apalis-tk1/t30: colibri_t30: display reset reason Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:12   ` Oleksandr Suvorov
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 9/9] apalis-tk1: remove non-esential power rails on boot Igor Opaniuk
  2019-07-31 22:13 ` [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Tom Warren
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Marcel Ziswiler <marcel.ziswiler@toradex.com>

Remove video=tegrafb0:640x480-16 at 60 aka VESA VGA mode from vidargs in
order for the panel specification in the device tree to be used. This
causes the default to be the 10.1" LVDS display which will be available
in the Toradex webshop shortly.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 include/configs/apalis-tk1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
index 10f2948c62..843e64e3cc 100644
--- a/include/configs/apalis-tk1.h
+++ b/include/configs/apalis-tk1.h
@@ -137,7 +137,7 @@
 		"load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
 		"source ${loadaddr}\0" \
 	USB_BOOTCMD \
-	"vidargs=video=tegrafb0:640x480-16 at 60 fbcon=map:1\0"
+	"vidargs=fbcon=map:1\0"
 
 /* Increase console I/O buffer size */
 #undef CONFIG_SYS_CBSIZE
-- 
2.17.1

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

* [U-Boot] [PATCH v1 9/9] apalis-tk1: remove non-esential power rails on boot
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (7 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 8/9] apalis-tk1: remove default vesa vga mode from vidargs Igor Opaniuk
@ 2019-07-31 12:04 ` Igor Opaniuk
  2019-07-31 13:13   ` Oleksandr Suvorov
  2019-07-31 22:13 ` [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Tom Warren
  9 siblings, 1 reply; 19+ messages in thread
From: Igor Opaniuk @ 2019-07-31 12:04 UTC (permalink / raw)
  To: u-boot

From: Dominik Sliwa <dominik.sliwa@toradex.com>

When mainline kernels reboot TK1 they use SW_RESET,
that reset mode does not reset PMIC. Some rails
need to be off for RAM Re-repair to work correctly.

Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 arch/arm/mach-tegra/tegra124/cpu.c     | 45 ++++++++++++++++++++++++++
 board/toradex/apalis-tk1/as3722_init.c | 23 +++++++++++++
 2 files changed, 68 insertions(+)

diff --git a/arch/arm/mach-tegra/tegra124/cpu.c b/arch/arm/mach-tegra/tegra124/cpu.c
index 992c0beb04..abc050c27b 100644
--- a/arch/arm/mach-tegra/tegra124/cpu.c
+++ b/arch/arm/mach-tegra/tegra124/cpu.c
@@ -238,6 +238,45 @@ static bool is_partition_powered(u32 partid)
 	return !!(reg & (1 << partid));
 }
 
+static void unpower_partition(u32 partid)
+{
+	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+	debug("%s: part ID = %08X\n", __func__, partid);
+	/* Is the partition on? */
+	if (is_partition_powered(partid)) {
+		/* Yes, toggle the partition power state (ON -> OFF) */
+		debug("power_partition, toggling state\n");
+		writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);
+
+		/* Wait for the power to come down */
+		while (is_partition_powered(partid))
+			;
+
+		/* Give I/O signals time to stabilize */
+		udelay(IO_STABILIZATION_DELAY);
+	}
+}
+
+void unpower_cpus(void)
+{
+	debug("%s entry: G cluster\n", __func__);
+
+	/* Power down the fast cluster rail partition */
+	debug("%s: CRAIL\n", __func__);
+	unpower_partition(CRAIL);
+
+	/* Power down the fast cluster non-CPU partition */
+	debug("%s: C0NC\n", __func__);
+	unpower_partition(C0NC);
+
+	/* Power down the fast cluster CPU0 partition */
+	debug("%s: CE0\n", __func__);
+	unpower_partition(CE0);
+
+	debug("%s: done\n", __func__);
+}
+
 static void power_partition(u32 partid)
 {
 	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
@@ -284,6 +323,12 @@ void start_cpu(u32 reset_vector)
 
 	debug("%s entry, reset_vector = %x\n", __func__, reset_vector);
 
+	/*
+	 * High power clusters are on after software reset,
+	 * it may interfere with tegra124_ram_repair.
+	 * unpower them.
+	 */
+	unpower_cpus();
 	tegra124_init_clocks();
 
 	/* Set power-gating timer multiplier */
diff --git a/board/toradex/apalis-tk1/as3722_init.c b/board/toradex/apalis-tk1/as3722_init.c
index bd754e5fcf..15f8dce2f1 100644
--- a/board/toradex/apalis-tk1/as3722_init.c
+++ b/board/toradex/apalis-tk1/as3722_init.c
@@ -43,6 +43,29 @@ void pmic_enable_cpu_vdd(void)
 	udelay(10 * 1000);
 #endif
 
+	/*
+	 * Make sure all non-fused regulators are down.
+	 * That way we're in known state after software reboot from linux
+	 */
+	tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
+	tegra_i2c_ll_write_data(0x0003, I2C_SEND_2_BYTES);
+	udelay(10 * 1000);
+	tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
+	tegra_i2c_ll_write_data(0x0004, I2C_SEND_2_BYTES);
+	udelay(10 * 1000);
+	tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
+	tegra_i2c_ll_write_data(0x001b, I2C_SEND_2_BYTES);
+	udelay(10 * 1000);
+	tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
+	tegra_i2c_ll_write_data(0x0014, I2C_SEND_2_BYTES);
+	udelay(10 * 1000);
+	tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
+	tegra_i2c_ll_write_data(0x001a, I2C_SEND_2_BYTES);
+	udelay(10 * 1000);
+	tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
+	tegra_i2c_ll_write_data(0x0019, I2C_SEND_2_BYTES);
+	udelay(10 * 1000);
+
 	debug("%s: Setting VDD_CPU to 1.0V via AS3722 reg 0/4D\n", __func__);
 	/*
 	 * Bring up VDD_CPU via the AS3722 PMIC on the PWR I2C bus.
-- 
2.17.1

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

* [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci#
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci# Igor Opaniuk
@ 2019-07-31 13:00   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:00 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:05 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>
> By keeping RESET_MOCI_CTRL low we avoid explicitly releasing
> RESET_MOCI#.
>
> Please note that module hardware versions up to V1.1A will already
> release RESET_MOCI# in hardware coming out of reset.
>
> Please further note that with this change the USB hub on the Apalis
> Evaluation board is kept in reset in U-Boot and therefore none of its
> ports are operational in U-Boot.
>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h b/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
> index 1584d9b2d3..d2d24c4391 100644
> --- a/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
> +++ b/board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h
> @@ -39,7 +39,7 @@ static const struct tegra_gpio_config apalis_tk1_gpio_inits[] = {
>         GPIO_INIT(R,    1,   OUT0), /* Shift_CTRL_Dir_In[1] */
>         GPIO_INIT(R,    2,   OUT0), /* Shift_CTRL_OE[3] */
>         GPIO_INIT(S,    3,   OUT0), /* Shift_CTRL_Dir_In[2] */
> -       GPIO_INIT(U,    4,   OUT1),
> +       GPIO_INIT(U,    4,   OUT0), /* RESET_MOCI_CTRL */
>         GPIO_INIT(W,    3,   IN),
>         GPIO_INIT(W,    5,   IN),
>         GPIO_INIT(BB,   0,  IN),
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards
Oleksandr Suvorov

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500
4800 (main line)

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

* [U-Boot] [PATCH v1 2/9] apalis-tk1: set apalis gpio 8 aka fan_en
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 2/9] apalis-tk1: set apalis gpio 8 aka fan_en Igor Opaniuk
@ 2019-07-31 13:02   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:02 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:07 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> Make sure the Apalis GPIO 8 aka FAN_EN is on when using Apalis TK1
> modules.
>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
> Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  board/toradex/apalis-tk1/apalis-tk1.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
> index b87e9e7a3e..d57c5042dd 100644
> --- a/board/toradex/apalis-tk1/apalis-tk1.c
> +++ b/board/toradex/apalis-tk1/apalis-tk1.c
> @@ -19,6 +19,7 @@
>
>  #define LAN_DEV_OFF_N  TEGRA_GPIO(O, 6)
>  #define LAN_RESET_N    TEGRA_GPIO(S, 2)
> +#define FAN_EN         TEGRA_GPIO(DD, 2)
>  #define LAN_WAKE_N     TEGRA_GPIO(O, 5)
>  #ifdef CONFIG_APALIS_TK1_PCIE_EVALBOARD_INIT
>  #define PEX_PERST_N    TEGRA_GPIO(DD, 1) /* Apalis GPIO7 */
> @@ -241,6 +242,15 @@ void tegra_pcie_board_port_reset(struct tegra_pcie_port *port)
>  }
>  #endif /* CONFIG_PCI_TEGRA */
>
> +/*
> + * Enable/start PWM CPU fan
> + */
> +void start_cpu_fan(void)
> +{
> +       gpio_request(FAN_EN, "FAN_EN");
> +       gpio_direction_output(FAN_EN, 1);
> +}
> +
>  /*
>   * Backlight off before OS handover
>   */
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards
Oleksandr Suvorov

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500
4800 (main line)

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

* [U-Boot] [PATCH v1 3/9] apalis-tk1: provide proper USB vendor id
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 3/9] apalis-tk1: provide proper USB vendor id Igor Opaniuk
@ 2019-07-31 13:03   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:03 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:09 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> Use unified values for USB Product/Vendor numbers
> when the config block is missing
>
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  configs/apalis-tk1_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configs/apalis-tk1_defconfig b/configs/apalis-tk1_defconfig
> index 41f3aff149..ceefe4e86a 100644
> --- a/configs/apalis-tk1_defconfig
> +++ b/configs/apalis-tk1_defconfig
> @@ -56,7 +56,7 @@ CONFIG_USB_EHCI_TEGRA=y
>  CONFIG_USB_GADGET=y
>  CONFIG_USB_GADGET_MANUFACTURER="Toradex"
>  CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
> -CONFIG_USB_GADGET_PRODUCT_NUM=0xffff
> +CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
>  CONFIG_CI_UDC=y
>  CONFIG_USB_GADGET_DOWNLOAD=y
>  CONFIG_OF_LIBFDT_OVERLAY=y
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards

Oleksandr Suvorov
cryosay at gmail.com

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

* [U-Boot] [PATCH v1 5/9] apalis-tk1: add pcie_aspm=off to defargs
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 5/9] apalis-tk1: add pcie_aspm=off to defargs Igor Opaniuk
@ 2019-07-31 13:07   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:07 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:09 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> Disabling ASPM fixes incompatibilities with some PCIe cards
>
> Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  include/configs/apalis-tk1.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
> index efc52841d1..0bde1697bb 100644
> --- a/include/configs/apalis-tk1.h
> +++ b/include/configs/apalis-tk1.h
> @@ -112,7 +112,7 @@
>         "console=ttyS0\0" \
>         "defargs=lp0_vec=2064 at 0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
>                 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \
> -               "user_debug=30\0" \
> +               "user_debug=30 pcie_aspm=off\0" \
>         "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
>         EMMC_BOOTCMD \
>         "fdt_board=eval\0" \
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards

Oleksandr Suvorov
cryosay at gmail.com

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

* [U-Boot] [PATCH v1 6/9] apalis-tk1: switch to zImage
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 6/9] apalis-tk1: switch to zImage Igor Opaniuk
@ 2019-07-31 13:09   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:09 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:09 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> Switch to the generic compressed Kernel image type (zImage) instead of
> the U-Boot specific uImage format.
>
> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  include/configs/apalis-tk1.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
> index 0bde1697bb..10f2948c62 100644
> --- a/include/configs/apalis-tk1.h
> +++ b/include/configs/apalis-tk1.h
> @@ -42,7 +42,7 @@
>  #define DFU_ALT_EMMC_INFO      "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
>                                 "boot part 0 1 mmcpart 0; " \
>                                 "rootfs part 0 2 mmcpart 0; " \
> -                               "uImage fat 0 1 mmcpart 0; " \
> +                               "zImage fat 0 1 mmcpart 0; " \
>                                 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
>
>  #define EMMC_BOOTCMD \
> @@ -54,7 +54,7 @@
>                 "run emmcdtbload; " \
>                 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
>                 "${boot_file} && run fdt_fixup && " \
> -               "bootm ${kernel_addr_r} - ${dtbparam}\0" \
> +               "bootz ${kernel_addr_r} - ${dtbparam}\0" \
>         "emmcbootpart=1\0" \
>         "emmcdev=0\0" \
>         "emmcdtbload=setenv dtbparam; load mmc ${emmcdev}:${emmcbootpart} " \
> @@ -68,7 +68,7 @@
>         "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
>                 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
>                 "run nfsdtbload; dhcp ${kernel_addr_r} " \
> -               "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
> +               "&& run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}\0" \
>         "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
>                 "${soc}-apalis-${fdt_board}.dtb " \
>                 "&& setenv dtbparam ${fdt_addr_r}\0"
> @@ -81,7 +81,7 @@
>                 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
>                 "run sddtbload; load mmc ${sddev}:${sdbootpart} " \
>                 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
> -               "bootm ${kernel_addr_r} - ${dtbparam}\0" \
> +               "bootz ${kernel_addr_r} - ${dtbparam}\0" \
>         "sdbootpart=1\0" \
>         "sddev=1\0" \
>         "sddtbload=setenv dtbparam; load mmc ${sddev}:${sdbootpart} " \
> @@ -98,7 +98,7 @@
>                 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
>                 "run usbdtbload; load usb ${usbdev}:${usbbootpart} " \
>                 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
> -               "bootm ${kernel_addr_r} - ${dtbparam}\0" \
> +               "bootz ${kernel_addr_r} - ${dtbparam}\0" \
>         "usbbootpart=1\0" \
>         "usbdev=0\0" \
>         "usbdtbload=setenv dtbparam; load usb ${usbdev}:${usbbootpart} " \
> @@ -108,7 +108,7 @@
>         "usbrootpart=2\0"
>
>  #define BOARD_EXTRA_ENV_SETTINGS \
> -       "boot_file=uImage\0" \
> +       "boot_file=zImage\0" \
>         "console=ttyS0\0" \
>         "defargs=lp0_vec=2064 at 0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
>                 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards

Oleksandr Suvorov
cryosay at gmail.com

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

* [U-Boot] [PATCH v1 8/9] apalis-tk1: remove default vesa vga mode from vidargs
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 8/9] apalis-tk1: remove default vesa vga mode from vidargs Igor Opaniuk
@ 2019-07-31 13:12   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:12 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:08 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>
> Remove video=tegrafb0:640x480-16 at 60 aka VESA VGA mode from vidargs in
> order for the panel specification in the device tree to be used. This
> causes the default to be the 10.1" LVDS display which will be available
> in the Toradex webshop shortly.
>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  include/configs/apalis-tk1.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
> index 10f2948c62..843e64e3cc 100644
> --- a/include/configs/apalis-tk1.h
> +++ b/include/configs/apalis-tk1.h
> @@ -137,7 +137,7 @@
>                 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
>                 "source ${loadaddr}\0" \
>         USB_BOOTCMD \
> -       "vidargs=video=tegrafb0:640x480-16 at 60 fbcon=map:1\0"
> +       "vidargs=fbcon=map:1\0"
>
>  /* Increase console I/O buffer size */
>  #undef CONFIG_SYS_CBSIZE
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards
Oleksandr Suvorov

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500
4800 (main line)

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

* [U-Boot] [PATCH v1 9/9] apalis-tk1: remove non-esential power rails on boot
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 9/9] apalis-tk1: remove non-esential power rails on boot Igor Opaniuk
@ 2019-07-31 13:13   ` Oleksandr Suvorov
  0 siblings, 0 replies; 19+ messages in thread
From: Oleksandr Suvorov @ 2019-07-31 13:13 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 3:07 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Dominik Sliwa <dominik.sliwa@toradex.com>
>
> When mainline kernels reboot TK1 they use SW_RESET,
> that reset mode does not reset PMIC. Some rails
> need to be off for RAM Re-repair to work correctly.
>
> Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  arch/arm/mach-tegra/tegra124/cpu.c     | 45 ++++++++++++++++++++++++++
>  board/toradex/apalis-tk1/as3722_init.c | 23 +++++++++++++
>  2 files changed, 68 insertions(+)
>
> diff --git a/arch/arm/mach-tegra/tegra124/cpu.c b/arch/arm/mach-tegra/tegra124/cpu.c
> index 992c0beb04..abc050c27b 100644
> --- a/arch/arm/mach-tegra/tegra124/cpu.c
> +++ b/arch/arm/mach-tegra/tegra124/cpu.c
> @@ -238,6 +238,45 @@ static bool is_partition_powered(u32 partid)
>         return !!(reg & (1 << partid));
>  }
>
> +static void unpower_partition(u32 partid)
> +{
> +       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
> +
> +       debug("%s: part ID = %08X\n", __func__, partid);
> +       /* Is the partition on? */
> +       if (is_partition_powered(partid)) {
> +               /* Yes, toggle the partition power state (ON -> OFF) */
> +               debug("power_partition, toggling state\n");
> +               writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);
> +
> +               /* Wait for the power to come down */
> +               while (is_partition_powered(partid))
> +                       ;
> +
> +               /* Give I/O signals time to stabilize */
> +               udelay(IO_STABILIZATION_DELAY);
> +       }
> +}
> +
> +void unpower_cpus(void)
> +{
> +       debug("%s entry: G cluster\n", __func__);
> +
> +       /* Power down the fast cluster rail partition */
> +       debug("%s: CRAIL\n", __func__);
> +       unpower_partition(CRAIL);
> +
> +       /* Power down the fast cluster non-CPU partition */
> +       debug("%s: C0NC\n", __func__);
> +       unpower_partition(C0NC);
> +
> +       /* Power down the fast cluster CPU0 partition */
> +       debug("%s: CE0\n", __func__);
> +       unpower_partition(CE0);
> +
> +       debug("%s: done\n", __func__);
> +}
> +
>  static void power_partition(u32 partid)
>  {
>         struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
> @@ -284,6 +323,12 @@ void start_cpu(u32 reset_vector)
>
>         debug("%s entry, reset_vector = %x\n", __func__, reset_vector);
>
> +       /*
> +        * High power clusters are on after software reset,
> +        * it may interfere with tegra124_ram_repair.
> +        * unpower them.
> +        */
> +       unpower_cpus();
>         tegra124_init_clocks();
>
>         /* Set power-gating timer multiplier */
> diff --git a/board/toradex/apalis-tk1/as3722_init.c b/board/toradex/apalis-tk1/as3722_init.c
> index bd754e5fcf..15f8dce2f1 100644
> --- a/board/toradex/apalis-tk1/as3722_init.c
> +++ b/board/toradex/apalis-tk1/as3722_init.c
> @@ -43,6 +43,29 @@ void pmic_enable_cpu_vdd(void)
>         udelay(10 * 1000);
>  #endif
>
> +       /*
> +        * Make sure all non-fused regulators are down.
> +        * That way we're in known state after software reboot from linux
> +        */
> +       tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
> +       tegra_i2c_ll_write_data(0x0003, I2C_SEND_2_BYTES);
> +       udelay(10 * 1000);
> +       tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
> +       tegra_i2c_ll_write_data(0x0004, I2C_SEND_2_BYTES);
> +       udelay(10 * 1000);
> +       tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
> +       tegra_i2c_ll_write_data(0x001b, I2C_SEND_2_BYTES);
> +       udelay(10 * 1000);
> +       tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
> +       tegra_i2c_ll_write_data(0x0014, I2C_SEND_2_BYTES);
> +       udelay(10 * 1000);
> +       tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
> +       tegra_i2c_ll_write_data(0x001a, I2C_SEND_2_BYTES);
> +       udelay(10 * 1000);
> +       tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2);
> +       tegra_i2c_ll_write_data(0x0019, I2C_SEND_2_BYTES);
> +       udelay(10 * 1000);
> +
>         debug("%s: Setting VDD_CPU to 1.0V via AS3722 reg 0/4D\n", __func__);
>         /*
>          * Bring up VDD_CPU via the AS3722 PMIC on the PWR I2C bus.
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best regards

Oleksandr Suvorov
cryosay at gmail.com

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

* [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10
  2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
                   ` (8 preceding siblings ...)
  2019-07-31 12:04 ` [U-Boot] [PATCH v1 9/9] apalis-tk1: remove non-esential power rails on boot Igor Opaniuk
@ 2019-07-31 22:13 ` Tom Warren
  2019-08-01  7:57   ` Igor Opaniuk
  9 siblings, 1 reply; 19+ messages in thread
From: Tom Warren @ 2019-07-31 22:13 UTC (permalink / raw)
  To: u-boot

The 'switch to zImage' patch fails to apply using git am, either in the complete (9-patch) bundle, or as part of the 5-patch Igor Opaniuk bundle, or even as a stand-alone patch.  This is using the current TOT u-boot-tegra/master.

Please ensure the entire bundle of Apalis-TK1 patches can be applied to u-boot-tegra/master.

Thanks,

Tom

--
nvpublic

-----Original Message-----
From: Igor Opaniuk <igor.opaniuk@gmail.com> 
Sent: Wednesday, July 31, 2019 5:05 AM
To: u-boot at lists.denx.de
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>; Philippe Schenker <philippe.schenker@toradex.com>; Oleksandr Suvorov <oleksandr.suvorov@toradex.com>; Dominik Sliwa <dominik.sliwa@toradex.com>; Igor Opaniuk <igor.opaniuk@gmail.com>; Albert Aribaud <albert.u.boot@aribaud.net>; Igor Opaniuk <igor.opaniuk@toradex.com>; Tom Warren <TWarren@nvidia.com>
Subject: [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10

Misc. fixes related to pinmux configuration (fan), default bootargs, reset reason output and power rail configuration.

Dominik Sliwa (2):
  apalis-tk1/t30: colibri_t30: display reset reason
  apalis-tk1: remove non-esential power rails on boot

Igor Opaniuk (5):
  apalis-tk1: set apalis gpio 8 aka fan_en
  apalis-tk1: provide proper USB vendor id
  apalis-tk1: enable user debug by default
  apalis-tk1: add pcie_aspm=off to defargs
  apalis-tk1: switch to zImage

Marcel Ziswiler (2):
  apalis-tk1: do not explicitly release reset_moci#
  apalis-tk1: remove default vesa vga mode from vidargs

 arch/arm/mach-tegra/sys_info.c                | 32 ++++++++-----
 arch/arm/mach-tegra/tegra124/cpu.c            | 45 +++++++++++++++++++
 board/toradex/apalis-tk1/apalis-tk1.c         | 10 +++++
 board/toradex/apalis-tk1/as3722_init.c        | 23 ++++++++++
 .../apalis-tk1/pinmux-config-apalis-tk1.h     |  2 +-
 configs/apalis-tk1_defconfig                  |  2 +-
 include/configs/apalis-tk1.h                  | 17 +++----
 7 files changed, 111 insertions(+), 20 deletions(-)

--
2.17.1

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

* [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10
  2019-07-31 22:13 ` [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Tom Warren
@ 2019-08-01  7:57   ` Igor Opaniuk
  0 siblings, 0 replies; 19+ messages in thread
From: Igor Opaniuk @ 2019-08-01  7:57 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Thu, Aug 1, 2019 at 1:13 AM Tom Warren <TWarren@nvidia.com> wrote:
>
> The 'switch to zImage' patch fails to apply using git am, either in the complete (9-patch) bundle, or as part of the 5-patch Igor Opaniuk bundle, or even as a stand-alone patch.  This is using the current TOT u-boot-tegra/master.
>
> Please ensure the entire bundle of Apalis-TK1 patches can be applied to u-boot-tegra/master.
>
> Thanks,
>
> Tom
>
> --
> nvpublic
>
> -----Original Message-----
> From: Igor Opaniuk <igor.opaniuk@gmail.com>
> Sent: Wednesday, July 31, 2019 5:05 AM
> To: u-boot at lists.denx.de
> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>; Philippe Schenker <philippe.schenker@toradex.com>; Oleksandr Suvorov <oleksandr.suvorov@toradex.com>; Dominik Sliwa <dominik.sliwa@toradex.com>; Igor Opaniuk <igor.opaniuk@gmail.com>; Albert Aribaud <albert.u.boot@aribaud.net>; Igor Opaniuk <igor.opaniuk@toradex.com>; Tom Warren <TWarren@nvidia.com>
> Subject: [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10
>
> Misc. fixes related to pinmux configuration (fan), default bootargs, reset reason output and power rail configuration.
>
> Dominik Sliwa (2):
>   apalis-tk1/t30: colibri_t30: display reset reason
>   apalis-tk1: remove non-esential power rails on boot
>
> Igor Opaniuk (5):
>   apalis-tk1: set apalis gpio 8 aka fan_en
>   apalis-tk1: provide proper USB vendor id
>   apalis-tk1: enable user debug by default
>   apalis-tk1: add pcie_aspm=off to defargs
>   apalis-tk1: switch to zImage
>
> Marcel Ziswiler (2):
>   apalis-tk1: do not explicitly release reset_moci#
>   apalis-tk1: remove default vesa vga mode from vidargs
>
>  arch/arm/mach-tegra/sys_info.c                | 32 ++++++++-----
>  arch/arm/mach-tegra/tegra124/cpu.c            | 45 +++++++++++++++++++
>  board/toradex/apalis-tk1/apalis-tk1.c         | 10 +++++
>  board/toradex/apalis-tk1/as3722_init.c        | 23 ++++++++++
>  .../apalis-tk1/pinmux-config-apalis-tk1.h     |  2 +-
>  configs/apalis-tk1_defconfig                  |  2 +-
>  include/configs/apalis-tk1.h                  | 17 +++----
>  7 files changed, 111 insertions(+), 20 deletions(-)
>
> --
> 2.17.1
>
Will do,
Thanks!

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk

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

end of thread, other threads:[~2019-08-01  7:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 12:04 [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Igor Opaniuk
2019-07-31 12:04 ` [U-Boot] [PATCH v1 1/9] apalis-tk1: do not explicitly release reset_moci# Igor Opaniuk
2019-07-31 13:00   ` Oleksandr Suvorov
2019-07-31 12:04 ` [U-Boot] [PATCH v1 2/9] apalis-tk1: set apalis gpio 8 aka fan_en Igor Opaniuk
2019-07-31 13:02   ` Oleksandr Suvorov
2019-07-31 12:04 ` [U-Boot] [PATCH v1 3/9] apalis-tk1: provide proper USB vendor id Igor Opaniuk
2019-07-31 13:03   ` Oleksandr Suvorov
2019-07-31 12:04 ` [U-Boot] [PATCH v1 4/9] apalis-tk1: enable user debug by default Igor Opaniuk
2019-07-31 12:04 ` [U-Boot] [PATCH v1 5/9] apalis-tk1: add pcie_aspm=off to defargs Igor Opaniuk
2019-07-31 13:07   ` Oleksandr Suvorov
2019-07-31 12:04 ` [U-Boot] [PATCH v1 6/9] apalis-tk1: switch to zImage Igor Opaniuk
2019-07-31 13:09   ` Oleksandr Suvorov
2019-07-31 12:04 ` [U-Boot] [PATCH v1 7/9] apalis-tk1/t30: colibri_t30: display reset reason Igor Opaniuk
2019-07-31 12:04 ` [U-Boot] [PATCH v1 8/9] apalis-tk1: remove default vesa vga mode from vidargs Igor Opaniuk
2019-07-31 13:12   ` Oleksandr Suvorov
2019-07-31 12:04 ` [U-Boot] [PATCH v1 9/9] apalis-tk1: remove non-esential power rails on boot Igor Opaniuk
2019-07-31 13:13   ` Oleksandr Suvorov
2019-07-31 22:13 ` [U-Boot] [PATCH v1 0/9] apalis-tk1: fixes/updates for v2019.10 Tom Warren
2019-08-01  7:57   ` Igor Opaniuk

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