Part Number: AM6422
We have built a custom board and are trying to set the gpios from the device tree and from gpioset. Gpioinfo shows that they are set, but we get no output on the pins. We have a related error when we enable the uarts on the board. We get a kernel panic in relation to the pinmux setting for the pins. We are using a build based on the 08.06.00.xx SDK.
dts settings for gpios:
&main_pmx0 {
/* gpio0_63 */
gpio0_63_dir2_b_a_3v3_pins: gpio0-63-dir2-b-a-3v3-pins {
pinctrl-singlr,pins = <
AM64X_IOPAD(0x0100, PIN_OUTPUT, 7) /* (V7) PRG1_PRU0_GPO18.GPIO0_63 */
>;
};
/* gpio1_43 */
gpio1_43_2v5_reg_en_pins: gpio1-43-2v5-reg-en-pins {
pinctrl-singlr,pins = <
AM64X_IOPAD(0x020c, PIN_OUTPUT, 7) /* (C13) SPI0_CS1.GPIO1_43 */
>;
};
/* gpio1_58 */
gpio1_58_emmc_rst_pins: gpio1-58-emmc-rst-pins {
pinctrl-singlr,pins = <
AM64X_IOPAD(0x0248, PIN_OUTPUT, 7) /* (D16) UART1_CTSn.GPIO1_58 */
>;
};
/* gpio1_62 */
vsel_sd_switch_pins: vsel-sd-switch-pins {
pinctrl-singlr,pins = <
AM64X_IOPAD(0x0258, PIN_OUTPUT, 7) /* (C17) MCAN1_TX.GPIO1_62 */
>;
};
};
&main_gpio0 {
status = "okay";
pinctrl-names = "default";
gpio-line-names =
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"ospi0_flash0", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "gpio0_31_io_exp_intn",
"dc_hdr_gpio0_32", "gpio0_33_eeprom_wp",
"gpio0_34_can_intr", "dc_hdr_gpio0_35",
"rtc_ic_int_sqw", "gpio0_37_rtc_rst_3v3",
"dc_hdr_gpio0_38 ", "dc_hdr_gpio0_39",
"dc_hdr_gpio0_40", "dc_hdr_gpio0_41",
"dc_hdr_gpio0_42", "",
"", "",
"", "",
"", "",
"", "",
"test_gpio2_ls", "",
"", "",
"", "",
"", "",
"", "",
"gpio0_62_oe1_gpio_hdr_bfr", "gpio0_63_dir2_b_a_3v3",
"gpio0_64_oe2_gpio_hdr", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"";
gpio0_63_dir2_b_a_3v3 {
pinctrl-0 = <&gpio0_63_dir2_b_a_3v3_pins>;
gpios = <&main_gpio0 63 GPIO_ACTIVE_HIGH>;
line-name = "gpio0-63-dir2-b-a-3v3";
output;
gpio-hog;
};
};
&main_gpio1 {
status = "okay";
pinctrl-names = "default";
gpio-line-names =
"", "",
"", "",
"", "",
"gpio_hdr_gpio1_6_3v3", "gpio_hdr_gpio1_7_3v3",
"gpio_hdr_gpio1_8_3v3", "gpio_hdr_gpio1_9_3v3",
"gpio_hdr_gpio1_10_3v3", "gpio_hdr_gpio1_11_3v3",
"gpio_hdr_gpio1_12_3v3", "",
"", "gpio_hdr_gpio1_15_3v3",
"", "",
"", "",
"gpio_hdr_gpio1_20_3v3", "usbflt_gpio1_21_3v3",
"gpio1_22_wakeup_ems_3v3", "gpio1_23_shdn_ems_3v3",
"gpio1_24_epo_ctrl_ems_3v3", "gpio1_25_wup_flg_3v3",
"gpio1_26_rs485_re_3v3", "gpio1_27_shdn_flg_3v3",
"gpio1_28_rs485_de_3v3", "gpio1_29_epo_flg_3v3",
"gpio1_30_dc_hdr_en_3v3", "gpio1_31_dc_hdr_flg_3v3",
"gpio1_32_dc_hdr_pg_3v3", "",
"", "",
"", "",
"", "",
"gpio1_40_dcflt_3v3", "gpio1_41_dc5vsw_en_3v3",
"", "gpio1_43_2v5_reg_en",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"gpio1_58_emmc_rst", "gpio1_59_intn",
"", "",
"vsel_sd_switch", "pmic_stby",
"", "",
"", "",
"", "",
"pmic_intr", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", "";
gpio1_43_2v5_reg_en {
pinctrl-0 = <&gpio1_43_2v5_reg_en_pins>;
gpios = <&main_gpio1 43 GPIO_ACTIVE_HIGH>;
line-name = "gpio1-43-2v5-reg-en";
output;
gpio-hog;
};
gpio1_58_emmc_rst {
pinctrl-0 = <&gpio1_58_emmc_rst_pins>;
gpios = <&main_gpio1 58 GPIO_ACTIVE_HIGH>;
line-name = "gpio1-58-emmc-rst";
output;
gpio-hog;
};
vsel_sd_switch {
pinctrl-0 = <&vsel_sd_switch_pins>;
gpios = <&main_gpio1 62 GPIO_ACTIVE_HIGH>;
line-name = "vsel-sd-switch";
output;
gpio-hog;
};
};
dts settings for uarts:
&main_pmx0 {
soc_main_uart0_pins: soc-main-uart0-pins {
pinctrl-single,pins = <
AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */
AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */
AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */
AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */
>;
};
soc_main_uart1_pins: soc-main-uart1-pins {
pinctrl-singlr,pins = <
AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD.UART1_RXD */
AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD.UART1_TXD */
>;
};
rs232_uart2_pins: rs232-uart2-pins {
pinctrl-single,pins = <
AM64X_IOPAD(0x0160, PIN_INPUT, 10) /* (Y1) UART2_CTSn */
AM64X_IOPAD(0x0168, PIN_OUTPUT, 10) /* (U2) UART2_RTSn */
AM64X_IOPAD(0x0148, PIN_INPUT, 10) /* (V1) UART2_RXD */
AM64X_IOPAD(0x0164, PIN_OUTPUT, 10) /* (R4) UART2_TXD */
>;
};
rs232_uart3_pins: rs232-uart3-pins {
pinctrl-single,pins = <
AM64X_IOPAD(0x016c, PIN_INPUT, 10) /* (V2) UART2_CTSn */
AM64X_IOPAD(0x0174, PIN_OUTPUT, 10) /* (R3) UART2_RTSn */
AM64X_IOPAD(0x0148, PIN_INPUT, 10) /* (W1) UART2_RXD */
AM64X_IOPAD(0x0179, PIN_OUTPUT, 10) /* (AA2) UART2_TXD */
>;
};
rs485_uart4_pins: rs485-uart4-pins {
pinctrl-singlr,pins = <
AM64X_IOPAD(0x0254, PIN_OUTPUT, 1) /* (B17) MCAN0_RX.UART4_TXD */
AM64X_IOPAD(0x0250, PIN_INPUT, 1) /* (A17) MCAN0_TX.UART4_RXD */
>;
};
};
&main_uart0 {
pinctrl-names = "default";
pinctrl-0 = <&soc_main_uart0_pins>;
};
&main_uart1 {
/* main_uart1 is reserved for firmware usage */
status = "reserved";
};
&main_uart2 {
pinctrl-names = "default";
pinctrl-0 = <&rs232_uart2_pins>;
status = "okay";
};
&main_uart3 {
pinctrl-names = "default";
pinctrl-0 = <&rs232_uart3_pins>;
status = "okay";
};
&main_uart4 {
pinctrl-names = "default";
pinctrl-0 = <&rs485_uart4_pins>;
status = "okay";
};
kernel log
[ 0.729325] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled [ 0.738708] Unable to handle kernel paging request at virtual address ffff8000112c5179 [ 0.746807] Mem abort info: [ 0.749653] ESR = 0x96000021 [ 0.752766] EC = 0x25: DABT (current EL), IL = 32 bits [ 0.758185] SET = 0, FnV = 0 [ 0.761297] EA = 0, S1PTW = 0 [ 0.764497] Data abort info: [ 0.767430] ISV = 0, ISS = 0x00000021 [ 0.771341] CM = 0, WnR = 0 [ 0.774368] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000082f0c000 [ 0.781209] [ffff8000112c5179] pgd=00000000fffff003, p4d=00000000fffff003, pud=00000000ffffe003, pmd=00000000ffffa003, pte=00680000000f4717 [ 0.794015] Internal error: Oops: 96000021 [#1] PREEMPT SMP [ 0.799702] Modules linked in: [ 0.802825] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.10.168 #1 [ 0.809045] Hardware name: American Energy Storage Innovations am642-aesi (DT) [ 0.816421] pstate: 20000085 (nzCv daIf -PAN -UAO -TCO BTYPE=--) [ 0.822565] pc : pcs_readl+0x4/0x20 [ 0.826123] lr : pcs_set_mux+0xa0/0x120 [ 0.830035] sp : ffff80001128bac0 [ 0.833414] x29: ffff80001128bac0 x28: 0000000000000000 [ 0.838839] x27: ffff800010f81060 x26: ffff000000f29980 [ 0.844264] x25: ffff000000f297b0 x24: ffff000000f29780 [ 0.849690] x23: 0000000000000030 x22: 0000000000000000 [ 0.855116] x21: 0000000000000004 x20: ffff000000e2ace0 [ 0.860539] x19: ffff000000e2ac80 x18: 0000000000000020 [ 0.865963] x17: 0000000000000068 x16: 0000000000c1162e [ 0.871388] x15: ffffffffffffffff x14: ffff000000f2490a [ 0.876811] x13: ffffffffffffffff x12: ffff000000f24908 [ 0.882236] x11: 0000000000000040 x10: ffff0000003b2348 [ 0.887660] x9 : ffff0000003b2340 x8 : ffff0000004c54b0 [ 0.893085] x7 : 0000000000000000 x6 : 0000000000000000 [ 0.898509] x5 : ffff0000004c5488 x4 : 0000000000000000 [ 0.903934] x3 : ffff000000e2ace0 x2 : 0000000000000001 [ 0.909359] x1 : ffff8000104f1690 x0 : ffff8000112c5179 [ 0.914785] Call trace: [ 0.917279] pcs_readl+0x4/0x20 [ 0.920488] pinmux_enable_setting+0xf8/0x270 [ 0.924935] pinctrl_commit_state+0x94/0x170 [ 0.929293] pinctrl_select_state+0x1c/0x30 [ 0.933566] pinctrl_bind_pins+0x150/0x160 [ 0.937749] really_probe+0x84/0x4f0 [ 0.941396] driver_probe_device+0x58/0xc0 [ 0.945575] device_driver_attach+0xc0/0xd0 [ 0.949843] __driver_attach+0x68/0x130 [ 0.953757] bus_for_each_dev+0x70/0xd0 [ 0.957668] driver_attach+0x24/0x30 [ 0.961314] bus_add_driver+0x108/0x200 [ 0.965228] driver_register+0x78/0x130 [ 0.969141] __platform_driver_register+0x48/0x60 [ 0.973945] omap8250_platform_driver_init+0x1c/0x28 [ 0.979015] do_one_initcall+0x50/0x1b0 [ 0.982931] kernel_init_freeable+0x230/0x298 [ 0.987378] kernel_init+0x14/0x11c [ 0.990935] ret_from_fork+0x10/0x38 [ 0.994589] Code: d503201f d503201f d503201f d503233f (b9400000) [ 1.000843] ---[ end trace dd57f23a9d7298ab ]--- [ 1.005559] note: swapper/0[1] exited with preempt_count 1 [ 1.011166] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [ 1.018984] SMP: stopping secondary CPUs [ 1.022994] Kernel Offset: disabled [ 1.026550] CPU features: 0x00040002,2000200c [ 1.030993] Memory Limit: none [ 1.034111] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---