This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LEDs test on EVM

Part Number: PROCESSOR-SDK-AM62X

Hi,

I am trying to run the gpio_leds.sh on EVM but it keeps failing due to not having any file in the /sys/class/leds/.

Both dts and defconfig are the default of the sdk (ti-processor-sdk-linux-am62xx-evm-08.04.01.03).

Host linux version: Ubuntu 20.04.5 LTS
Evm: am62xx-evm

CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_LEDS_TRIGGER_PANIC=y

// SPDX-License-Identifier: GPL-2.0
/*
 * AM62x LP SK
 *
 * Copyright (C) 2021-2022 Texas Instruments Incorporated - https://www.ti.com/
 */

/dts-v1/;

#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/net/ti-dp83867.h>
#include "k3-am625.dtsi"
#include "k3-am62x-sk-common.dtsi"

/ {
	compatible =  "ti,am625-sk", "ti,am625";
	model = "Texas Instruments AM62x LP SK";

	wlan_lten: regulator-5 {
		compatible = "regulator-fixed";
		regulator-name = "wlan_lten";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		vin-supply = <&vcc_3v3_sys>;
		gpios = <&exp2 9 GPIO_ACTIVE_LOW>;
	};

	wlan_en: regulator-6 {
		/* OUTPUT of SN74AVC2T244DQMR */
		compatible = "regulator-fixed";
		regulator-name = "wlan_en";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		enable-active-high;
		vin-supply = <&wlan_lten>;
		gpios = <&main_gpio0 71 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_en_pins_default>;
	};
};

&main_pmx0 {
	wlan_en_pins_default: wlan-en-pins-default {
		pinctrl-single,pins = <
			AM62X_IOPAD(0x124, PIN_OUTPUT, 7) /* (A23) MMC2_SDCD.GPIO0_71 */
		>;
	};

	main_mmc2_pins_default: main-mmc2-pins-default {
		pinctrl-single,pins = <
			AM62X_IOPAD(0x120, PIN_INPUT, 0) /* (C24) MMC2_CMD */
			AM62X_IOPAD(0x118, PIN_INPUT, 0) /* (D25) MMC2_CLK */
			AM62X_IOPAD(0x114, PIN_INPUT, 0) /* (B24) MMC2_DAT0 */
			AM62X_IOPAD(0x110, PIN_INPUT, 0) /* (C25) MMC2_DAT1 */
			AM62X_IOPAD(0x10c, PIN_INPUT, 0) /* (E23) MMC2_DAT2 */
			AM62X_IOPAD(0x108, PIN_INPUT, 0) /* (D24) MMC2_DAT3 */
			AM62X_IOPAD(0x11c, PIN_INPUT, 0) /* (#N/A) MMC2_CLKB */
		>;
	};

	main_wlirq_pins_default: main-wlirq-pins-default {
		pinctrl-single,pins = <
			AM62X_IOPAD(0x128, PIN_INPUT, 7) /* (B23) MMC2_SDWP.GPIO0_72 */
		>;
	};

};
&main_i2c1 {
	exp1: gpio@22 {
		compatible = "ti,tca6424";
		reg = <0x22>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "GPIO_CPSW2_RST", "GPIO_CPSW1_RST",
				   "PRU_DETECT", "MMC1_SD_EN",
				   "VPP_LDO_EN", "EXP_PS_3V3_En",
				   "EXP_PS_5V0_En", "EXP_HAT_DETECT",
				   "GPIO_AUD_RSTn", "GPIO_eMMC_RSTn",
				   "UART1_FET_BUF_EN", "BT_UART_WAKE_SOC",
				   "GPIO_HDMI_RSTn", "CSI_GPIO0",
				   "CSI_GPIO1", "GPIO_OLDI_INT",
				   "HDMI_INTn", "TEST_GPIO2",
				   "MCASP1_FET_EN", "MCASP1_BUF_BT_EN",
				   "MCASP1_FET_SEL", "UART1_FET_SEL",
				   "", "IO_EXP_TEST_LED";

		interrupt-parent = <&main_gpio1>;
		interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
		interrupt-controller;
		#interrupt-cells = <2>;

		pinctrl-names = "default";
		pinctrl-0 = <&main_gpio1_ioexp_intr_pins_default>;
	};

	exp2: gpio@23 {
		compatible = "ti,tca6424";
		reg = <0x23>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "", "",
				   "", "",
				   "", "",
				   "", "",
				   "WL_LT_EN", "CSI_RSTz",
				   "", "",
				   "", "",
				   "", "",
				   "SPI0_FET_SEL", "SPI0_FET_OE",
				   "GPIO_OLDI_RSTn", "PRU_3V3_EN",
				   "", "",
				   "CSI_VLDO_SEL", "SOC_WLAN_SDIO_RST";
	};

};

/*
 * All SoC variants with the AMC package have no PRU.
 * Attempting to access the PRU on these devices will
 * result in a crash at kernel bootup.
 *
 * For now, we do not have any code that can figure out
 * the absence of the PRU by reading any SoC registers,
 * so for now disable the PRU here in the board DTS file.
 */
&pruss {
	status = "disabled";
};

&sdhci2 {
	status = "disabled";
};

&cpsw_port2 {
	status = "disabled";
};

&cpsw3g_mdio {
	cpsw3g_phy1: ethernet-phy@1 {
		status = "disabled";
	};
};

&ospi0 {
	flash@0 {
		compatible = "spi-nand";
		reg = <0x0>;
		spi-tx-bus-width = <8>;
		spi-rx-bus-width = <8>;
		spi-max-frequency = <25000000>;
		cdns,tshsl-ns = <60>;
		cdns,tsd2d-ns = <60>;
		cdns,tchsh-ns = <60>;
		cdns,tslch-ns = <60>;
		cdns,read-delay = <2>;
		cdns,phy-mode;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "ospi.tiboot3";
				reg = <0x0 0x80000>;
			};

			partition@80000 {
				label = "ospi.tispl";
				reg = <0x80000 0x200000>;
			};

			partition@280000 {
				label = "ospi.u-boot";
				reg = <0x280000 0x400000>;
			};

			partition@680000 {
				label = "ospi.env";
				reg = <0x680000 0x40000>;
			};

			partition@6c0000 {
				label = "ospi.env.backup";
				reg = <0x6c0000 0x40000>;
			};

			partition@800000 {
				label = "ospi.rootfs";
				reg = <0x800000 0x77c0000>;
			};

			partition@3fc0000 {
				label = "ospi.phypattern";
				reg = <0x7fc0000 0x40000>;
			};
		};
	};
};