apalis-tk1: fixes/updates for v2019.10
Subsystems (3)
v2 cover apalis-tk1: fixes/updates for v2019.10
Misc. fixes related to pinmux configuration (fan), default bootargs, reset reason output and power rail configuration.
Changes in v2:
* Rebased on the latest u-boot-tegra/master
* Attached R-b tags [Oleksandr Suvorov] from v1 [1]
[1] https://patchwork.ozlabs.org/cover/1139705/
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(-)
Signature · 1 line
2.17.1
PATCH v2 1/9 apalis-tk1: do not explicitly release reset_moci#
From: Marcel Ziswiler <[email protected]>
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.
---
board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/toradex/apalis-tk1/pinmux-config-apalis-tk1.h +1 -1
@@ -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),
Signature · 1 line
2.17.1
PATCH v2 2/9 apalis-tk1: set apalis gpio 8 aka fan_en
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Make sure the Apalis GPIO 8 aka FAN_EN is on when using Apalis TK1 modules.
---
board/toradex/apalis-tk1/apalis-tk1.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
board/toradex/apalis-tk1/apalis-tk1.c +10 -0
@@ -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 */
Signature · 1 line
2.17.1
PATCH v2 3/9 apalis-tk1: provide proper USB vendor id
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Use unified values for USB Product/Vendor numbers
when the config block is missing
---
configs/apalis-tk1_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/apalis-tk1_defconfig +1 -1
@@ -53,7 +53,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
Signature · 1 line
2.17.1
PATCH v2 4/9 apalis-tk1: enable user debug by default
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Let the kernel print some debug messages when a user program crashes due to an exception.
---
include/configs/apalis-tk1.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/configs/apalis-tk1.h +2 -1
@@ -94,7 +94,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" \
Signature · 1 line
2.17.1
PATCH v2 4/9 apalis-tk1: enable user debug by default
Quoted 8 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
Let the kernel print some debug messages when a user program crashes due to an exception.
Signed-off-by Stefan Agner <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>
Quoted 26 lines
---
include/configs/apalis-tk1.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)include/configs/apalis-tk1.h +2
-2@@ -94,7 +94,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
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
Signature · 4 lines
Best regards Oleksandr Suvorov cryosay at gmail.com
PATCH v2 5/9 apalis-tk1: add pcie_aspm=off to defargs
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Disabling ASPM fixes incompatibilities with some PCIe cards
---
include/configs/apalis-tk1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/apalis-tk1.h +1 -1
@@ -95,7 +95,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" \
Signature · 1 line
2.17.1
PATCH v2 6/9 apalis-tk1: switch to zImage
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Switch to the generic compressed Kernel image type (zImage) instead of the U-Boot specific uImage format.
---
include/configs/apalis-tk1.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
include/configs/apalis-tk1.h +6 -6
@@ -44,7 +44,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 \
@@ -53,7 +53,7 @@"${setupargs} ${vidargs}; echo Booting from internal eMMC " \"chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \"${boot_file} && run fdt_fixup && " \ -"bootm ${kernel_addr_r} - ${dtbparam}\0" \ +"bootz ${kernel_addr_r} - ${dtbparam}\0" \"emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \"${soc}-apalis-${fdt_board}.dtb && " \"setenv dtbparam ${fdt_addr_r}\0"
@@ -63,7 +63,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"
@@ -74,7 +74,7 @@"${vidargs}; echo Booting from SD card in 8bit slot...; " \"run sddtbload; load mmc 1:1 ${kernel_addr_r} " \"${boot_file} && run fdt_fixup && " \ -"bootm ${kernel_addr_r} - ${dtbparam}\0" \ +"bootz ${kernel_addr_r} - ${dtbparam}\0" \"sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \"${soc}-apalis-${fdt_board}.dtb " \"&& setenv dtbparam ${fdt_addr_r}\0"
@@ -85,13 +85,13 @@"${usbargs} ${vidargs}; echo Booting from USB stick...; " \"usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \"${boot_file} && run fdt_fixup && " \ -"bootm ${kernel_addr_r} - ${dtbparam}\0" \ +"bootz ${kernel_addr_r} - ${dtbparam}\0" \"usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \"${soc}-apalis-${fdt_board}.dtb " \"&& setenv dtbparam ${fdt_addr_r}\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 " \
Signature · 1 line
2.17.1
PATCH v2 7/9 apalis-tk1/t30: colibri_t30: display reset reason
In reply to Igor OpaniukFrom: Dominik Sliwa <[email protected]>
Display proper reset reason after the SoC info.
---
arch/arm/mach-tegra/sys_info.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)
arch/arm/mach-tegra/sys_info.c +22 -10
@@ -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 ;
Signature · 1 line
2.17.1
PATCH v2 7/9 apalis-tk1/t30: colibri_t30: display reset reason
Quoted 7 lines · Igor Opaniuk
From: Dominik Sliwa <[email protected]>
Display proper reset reason after the SoC info.
Signed-off-by Dominik Sliwa <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>
Quoted 63 lines
---
arch/arm/mach-tegra/sys_info.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)arch/arm/mach-tegra/sys_info.c +22
-11@@ -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
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
Signature · 4 lines
Best regards Oleksandr Suvorov cryosay at gmail.com
PATCH v2 8/9 apalis-tk1: remove default vesa vga mode from vidargs
In reply to Igor OpaniukFrom: Marcel Ziswiler <[email protected]>
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.
---
include/configs/apalis-tk1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/apalis-tk1.h +1 -1
@@ -119,7 +119,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
Signature · 1 line
2.17.1
PATCH v2 9/9 apalis-tk1: remove non-esential power rails on boot
In reply to Igor OpaniukFrom: Dominik Sliwa <[email protected]>
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.
---
arch/arm/mach-tegra/tegra124/cpu.c | 45 ++++++++++++++++++++++++++ board/toradex/apalis-tk1/as3722_init.c | 23 +++++++++++++ 2 files changed, 68 insertions(+)
arch/arm/mach-tegra/tegra124/cpu.c +45 -0
@@ -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 */
board/toradex/apalis-tk1/as3722_init.c +23 -0
@@ -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.
Signature · 1 line
2.17.1