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.

configuring serial port for rs485 mode

Other Parts Discussed in Thread: TPS65910

Hi all,

I am having trouble getting the driver in meta-ti to accept the GPIO configuration from my DTS file.  I get a parse error:

of_get_named_gpiod_flags: can't parse gpios property of node '/ocp/serial@48024000[0]'

I checked my configuration against another DTS file and we use the same format for the GPIOs. 

So two questions,  

1) Has the driver been fixed from: question #408682 "8250_omap serial driver RS-485 support", e2e.ti.com/.../408682

2) What am I doing wrong with my configuration of the RTS line?  See attached .dts file.

Chuck

/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

/*
*
build with:
cpp -nostdinc -Iinclude -undef -D__DTS__ -x assembler-with-cpp -o am335x-FinesseV2.dtb.dts.tmp am335x-FinesseV2.dts; dtc -O dtb -o am335x-FinesseV2.dtb -b 0 am335x-FinesseV2.dtb.dts.tmp
*
*/

/dts-v1/;

#include "am33xx.dtsi"
#include <dt-bindings/pwm/pwm.h>

/ {
model = "TI AM335x Finesse Revision 2";
compatible = "ti,am335x-bone", "ti,am33xx";

cpus {
cpu@0 {
cpu0-supply = <&vdd1_reg>;
};
};

memory {
device_type = "memory";
reg = <0x80000000 0x20000000>; /* 512 MB */
};

vbat: fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "vbat";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-boot-on;
};

vtt_fixed: fixedregulator@3 {
compatible = "regulator-fixed";
regulator-name = "vtt";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
regulator-always-on;
regulator-boot-on;
enable-active-high;
};

leds {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&user_leds_default>;
pinctrl-1 = <&user_leds_sleep>;

compatible = "gpio-leds";

led@2 {
label = "beaglebone:green:heartbeat";
gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
};

backlight {
compatible = "pwm-backlight";
pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
brightness-levels = <0 58 61 66 75 90 125 170 255>;
default-brightness-level = <8>;
};
};

// don't accidently turn off the dram on gpio 1,28!!!!
&gpio1 {
ti,no-reset-on-init;
};


&am33xx_pinmux {
pinctrl-names = "default";
pinctrl-0 = <&ddr3_vtt_toggle>;

ddr3_vtt_toggle: ddr3_vtt_toggle {
pinctrl-single,pins = <
0x78 (PIN_OUTPUT | MUX_MODE7) /* gpmc_be1.gpio1_28 OK */
>;
};

user_leds_default: user_leds_default {
pinctrl-single,pins = <
0x1A0 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_aclkr.gpio3_18 OK */
>;
};

user_leds_sleep: user_leds_sleep {
pinctrl-single,pins = <
0x1A0 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_aclkr.gpio3_18 OK */
>;
};

i2c0_pins: pinmux_i2c0_pins {
pinctrl-single,pins = <
0x188 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda OK */
0x18c (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl OK */
>;
};

uart0_pins: pinmux_uart0_pins {
pinctrl-single,pins = <
0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd OK */
0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd OK */
0x16C (PIN_INPUT_PULLUP | MUX_MODE7) /* uart0_rtsn.uart0_rtsn OK read UART0_RTSn it is nINVALID signal from 232 driver */
>;
};

uart1_pins: pinmux_uart1_pins {
pinctrl-single,pins = <
0x180 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd OK */
0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd OK */
0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* uart1_rtsn.uart1_rtsn OK GPIO */
>;
};

uart2_pins: pinmux_uart2_pins {
pinctrl-single,pins = <
0x12C (PIN_INPUT_PULLUP | MUX_MODE1) /* gmii1_txclk.uart2_rxd OK */
0x130 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gmii1_rxclk.uart2_txd OK */
0x118 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gmii1_rxdv.GPIO3_4... uart2_rtsn OK GPIO */
>;
};

ecap0_pins_default: backlight_pins {
pinctrl-single,pins = <
0x164 (PIN_OUTPUT | MUX_MODE0) /* ecap0_in_pwm0_out */
>;
};

ecap0_pins_sleep: ecap0_pins_sleep {
pinctrl-single,pins = <
0x164 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* ecap0_in_pwm0_out */
>;
};

cpsw_default: cpsw_default {
pinctrl-single,pins = <
/* Slave 1 RMII mode */
0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmmi1_crs_dv OK */
0x110 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxer.rmii1_rxer OK */
0x114 (PIN_OUTPUT | MUX_MODE1) /* mii1_txen.rmii1_txen OK */
0x124 (PIN_OUTPUT | MUX_MODE1) /* mii1_txd1.rmii1_txd1 OK */
0x128 (PIN_OUTPUT | MUX_MODE1) /* mii1_txd0.rmii1_txd0 OK */
0x13C (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 OK */
0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 OK */
0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_refclk.rmii1_refclk OK */

/* Slave 2 */
0x070 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpmc_wait0.rmmi2_crs_dv OK */
0x074 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpmc_wpn.rmii2_rxer OK */
0x040 (PIN_OUTPUT | MUX_MODE3) /* gpmc_a0.rmii2_txen OK */
0x050 (PIN_OUTPUT | MUX_MODE3) /* gpmc_a4.rmii2_txd1 OK */
0x054 (PIN_OUTPUT | MUX_MODE3) /* gpmc_a5.rmii2_txd0 OK */
0x068 (PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpmc_a10.rmii2_rxd1 OK */
0x06c (PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpmc_a11.rmii2_rxd0 OK */
0x108 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gmmi1_col.rmii2_refclk OK */
>;
};

cpsw_sleep: cpsw_sleep {
pinctrl-single,pins = <
/* Slave 1 reset value */
0x10C (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x13C (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x144 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */

/* Slave 2 reset value*/
0x070 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x074 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x040 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x050 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x054 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x068 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x06c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
>;
};

davinci_mdio_default: davinci_mdio_default {
pinctrl-single,pins = <
/* MDIO */
0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data OK */
0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk OK */
>;
};

davinci_mdio_sleep: davinci_mdio_sleep {
pinctrl-single,pins = <
/* MDIO reset value */
0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
>;
};

mmc1_pins_default: pinmux_mmc1_pins {
pinctrl-single,pins = <
0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 OK */
0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 OK */
0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 OK */
0x0FC (PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 OK */
0x100 (PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk OK */
0x104 (PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd OK */
0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 uSD_CARD_DETECT OK*/
>;
};

mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
pinctrl-single,pins = <
0x0F0 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x0F4 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x0F8 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x0FC (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x100 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x104 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
0x160 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* OK */
>;
};

mmc2_pins: pinmux_mmc2_pins {
pinctrl-single,pins = <
0x080 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk OK */
0x084 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd OK */
0x000 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 OK */
0x004 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 OK */
0x008 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 OK */
0x00C (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 OK */
0x010 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 OK */
0x014 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 OK */
0x018 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 OK */
0x01C (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 OK */
0x09C (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_be0n_cle.gpio2_5 eMMC_RSTn OK */
>;
};

nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
pinctrl-single,pins = <
0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ /* setup as clockout 1 OK */
0x0a0 0x08 /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0a4 0x08 /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0a8 0x08 /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0ac 0x08 /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0b0 0x08 /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0b4 0x08 /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0b8 0x08 /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA *OK */
0x0bc 0x08 /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA *OK */
0x0c0 0x08 /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA *OK */
0x0c4 0x08 /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA *OK */
0x0c8 0x08 /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0cc 0x08 /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0d0 0x08 /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0d4 0x08 /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0d8 0x08 /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0dc 0x08 /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA OK */
0x0e0 0x00 /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT OK */
0x0e4 0x00 /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT OK */
0x0e8 0x00 /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT OK */
0x0ec 0x00 /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT OK */
>;
};

nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
pinctrl-single,pins = <
0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ /* turn off clock out */
>;
};

mcasp0_pins: mcasp0_pins {
pinctrl-single,pins = <
// need clock input here!
0x120 (PIN_INPUT_PULLUP | MUX_MODE6) /* MUX_MODE6 gmii1_txd2.mcasp0_ahclkx U15 */

0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 PIN C12*/
0x194 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx PIN B13*/
0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx PIN A13*/
// need clock control output here
// 0x1A4 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO3_19 C13 */
>;
};

mcasp0_pins_sleep: mcasp0_pins_sleep {
pinctrl-single,pins = <
0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* MUX_MODE6 gmii1_txd2.mcasp0_ahclkx */
0x19c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_ahclkr.mcasp0_axr2 */
0x194 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_fsx.mcasp0_fsx */
0x190 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_aclkx.mcasp0_aclkx */
// 0x1A4 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 C13 */
>;
};
};

&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
status = "okay";
};

&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins>;
linux,rs485-enabled-at-boot-time;
rs485-rts-delay = <0 0>; // <a b> a for start of packet, b end of packet in milliseconds
rs485-rts-active-high; // sets rts active high
rts-gpio = <0x17C>;
status = "okay";
};

&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pins>;
linux,rs485-enabled-at-boot-time;
rs485-rts-delay = <0 0>; // <a b> a for start of packet, b end of packet in milliseconds
rs485-rts-active-high; // sets rts active high
rts-gpio = <0x118>;
status = "okay";
};

&usb {
status = "okay";

control@44e10620 {
status = "okay";
};

usb-phy@47401300 {
status = "okay";
};

usb-phy@47401b00 {
status = "okay";
};

usb@47401000 {
status = "okay";
dr_mode = "otg";
};

usb@47401800 {
status = "okay";
dr_mode = "otg";
};

dma-controller@47402000 {
status = "okay";
};
};

&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;

status = "okay";
clock-frequency = <400000>;

tps: tps@2d {
reg = <0x2d>;
};

eeprom@50 {
compatible = "at,24c64";
reg = <0x50>;
};

eeprom@57 {
compatible = "at,24c64";
reg = <0x57>;
};
};

&epwmss0 {
status = "okay";

ecap0: ecap@48300100 {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&ecap0_pins_default>;
pinctrl-1 = <&ecap0_pins_sleep>;
};
};

/*
//Support for VTT Toggle
//
//In order to enable the support for VTT toggle during Suspend/Resume
//sequence needed by some boards (like AM335x EVM-SK & AM437x GP EVM),
//the below DT properties are required. It is possible to toggle VTT
//using one of two methods depending on the SoC being used, either
//GPIO0 toggle (AM335x and AM437x), or any GPIO with DS_PAD_CONFIG
//bits in the control module (AM437x only).
//
//Important Note:
//- Here it is assumed that VTT Toggle will be done using a pin on GPIO-0 Instance.
//It will not work on any other GPIO using the above properties, regardless of
//which part is being used.
//
//Example:
// wkup_m3: wkup_m3@44d00000 {
// compatible = "ti,am3353-wkup-m3";
// ...
// ...
// ti,needs-vtt-toggle;
// ti,vtt-gpio-pin = <7>;
// };
*/
// goes not work with gpio 1!!!
//&wkup_m3 {
// ti,needs-vtt-toggle;
// ti,vtt-gpio-pin = <&gpio1 28 GPIO_ACTIVE_HIGH>;
// ti,scale-data-fw = "am335x-evm-scale-data.bin";
//};

#include "tps65910.dtsi"

&tps {
vcc1-supply = <&vbat>;
vcc2-supply = <&vbat>;
vcc3-supply = <&vbat>;
vcc4-supply = <&vbat>;
vcc5-supply = <&vbat>;
vcc6-supply = <&vbat>;
vcc7-supply = <&vbat>;
vccio-supply = <&vbat>;

regulators {
vrtc_reg: regulator@0 {
regulator-always-on;
};

vio_reg: regulator@1 {
regulator-always-on;
};

vdd1_reg: regulator@2 {
/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
regulator-name = "vdd_mpu";
regulator-min-microvolt = <912500>;
regulator-max-microvolt = <1378000>;
regulator-boot-on;
regulator-always-on;
};

vdd2_reg: regulator@3 {
/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
regulator-name = "vdd_core";
regulator-min-microvolt = <912500>;
regulator-max-microvolt = <1150000>;
regulator-boot-on;
regulator-always-on;
};

vdd3_reg: regulator@4 {
regulator-always-on;
};

vdig1_reg: regulator@5 {
regulator-always-on;
};

vdig2_reg: regulator@6 {
regulator-always-on;
};

vpll_reg: regulator@7 {
regulator-always-on;
};

vdac_reg: regulator@8 {
regulator-always-on;
};

vaux1_reg: regulator@9 {
regulator-always-on;
};

vaux2_reg: regulator@10 {
regulator-always-on;
};

vaux33_reg: regulator@11 {
regulator-always-on;
};

vmmc_reg: regulator@12 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
};
};

&cpsw_emac0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "rmii";
dual_emac_res_vlan = <1>;
};

&cpsw_emac1 {
phy_id = <&davinci_mdio>, <1>;
phy-mode = "rmii";
dual_emac_res_vlan = <2>;
};

&phy_sel {
rmii-clock-ext;
};

&mac {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
dual_emac = <1>;
};

&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
};

&mmc1 {
status = "okay";
vmmc-supply = <&vmmc_reg>;
bus-width = <4>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&mmc1_pins_default>;
pinctrl-1 = <&mmc1_pins_sleep>;
cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
//cd-inverted; //???
};

&mmc2 {
status = "okay";
vmmc-supply = <&vmmc_reg>;
ti,non-removable;
bus-width = <8>;
cap-power-off-card;
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>;
};


&rtc {
ti,system-power-controller;
};

&lcdc {
status = "okay";
};

&mcasp0 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&mcasp0_pins>;
pinctrl-1 = <&mcasp0_pins_sleep>;
status = "okay";
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>; /* two channels per serializer */
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
0 0 1 0 /* serilizer 2 active TX */
>;
tx-num-evt = <1>;
rx-num-evt = <1>;
};

/ {
hdmi {
compatible = "ti,tilcdc,slave";
i2c = <&i2c0>;
pinctrl-names = "default", "off";
pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
status = "okay";
};

clk_mcasp0_fixed: clk_mcasp0_fixed {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24576000>;
};

clk_mcasp0: clk_mcasp0 {
#clock-cells = <0>;
compatible = "ti,gpio-gate-clock";
clocks = <&clk_mcasp0_fixed>;
// warning pin missed!
// enable-gpios = <&gpio3 19 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
};

hdmi_audio: hdmi_audio@0 {
compatible = "linux,hdmi-audio";
status = "okay";
};

sound {
compatible = "ti,beaglebone-black-audio";
ti,model = "TI BeagleBone Black";
ti,audio-codec = <&hdmi_audio>;
ti,mcasp-controller = <&mcasp0>;
ti,audio-routing =
"HDMI Out", "TX";
clocks = <&clk_mcasp0>;
// ti,codec-clock-rate = <12000000>;
clock-names = "mclk";
};
};

  • Hi,

    I will forward this to the SW team.

  • Hi, 

    CKamas said:
    1) Has the driver been fixed from: question #408682 "8250_omap serial driver RS-485 support

     

    I have no way of testing if rs485 works with the latest sdk. I couldn't find a commit stating that this has been added in 8250 driver in latest ti  SDK release.

    You can test this yourself, or try using the older driver, as stated here: e2e.ti.com/.../408682

    CKamas said:
    2) What am I doing wrong with my configuration of the RTS line?

    The rs485-rts-delay & rs485-rts-active-high are OK. But the rts-gpio should not point  a single hex value; it should point a gpio controller, gpio pin & active high/low directive, see the bellow example: 
     rts-gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>; 

    Best Regards, 

    Yordan

  • Yordan,

    Thank you for the reply. I accidentally included the wrong dts file, one I had derived from decompiling my dtb file. The original is below. You can see that I am already using your suggested format, however, the rts gpio specification is still is not accepted by the kernel, even though my format is the same as yours.

    Any ideas?

    Thanks,
    Chuck


    #include "am33xx.dtsi"
    #include <dt-bindings/pwm/pwm.h>

    .......... <cut>.....................

    // don't accidently turn off the dram on gpio 1,28!!!!
    &gpio1 {
    ti,no-reset-on-init;
    };


    &am33xx_pinmux {
    .......... <cut>.....................
    uart0_pins: pinmux_uart0_pins {
    pinctrl-single,pins = <
    0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd OK */
    0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd OK */
    0x16C (PIN_INPUT_PULLUP | MUX_MODE7) /* uart0_rtsn.uart0_rtsn OK read UART0_RTSn it is nINVALID signal from 232 driver */
    >;
    };

    uart1_pins: pinmux_uart1_pins {
    pinctrl-single,pins = <
    0x180 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd OK */
    0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd OK */
    0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* uart1_rtsn.uart1_rtsn OK GPIO */
    >;
    };

    uart2_pins: pinmux_uart2_pins {
    pinctrl-single,pins = <
    0x12C (PIN_INPUT_PULLUP | MUX_MODE1) /* gmii1_txclk.uart2_rxd OK */
    0x130 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gmii1_rxclk.uart2_txd OK */
    0x118 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gmii1_rxdv.GPIO3_4... uart2_rtsn OK GPIO */
    >;
    };
    .......... <cut>.....................

    };

    &uart0 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart0_pins>;
    status = "okay";
    };

    &uart1 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart1_pins>;
    linux,rs485-enabled-at-boot-time;
    rs485-rts-delay = <1 1>; // <a b> a for start of packet, b end of packet in milliseconds
    rs485-rts-active-high; // sets rts active high
    rts-gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
    status = "okay";
    };
    &uart2 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart2_pins>;
    linux,rs485-enabled-at-boot-time;
    rs485-rts-delay = <0 0>; // <a b> a for start of packet, b end of packet in milliseconds
    rs485-rts-active-high; // sets rts active high
    rts-gpio = <&gpio3 4 GPIO_ACTIVE_HIGH>;
    status = "okay";
    };

    .......... <cut>.....................
  • Yordan,

    Any direction as to how to debug this? It appears that I am doing everything correctly, but it does not configure the GPIO pin.... Help!

    Chuck
  • What is the behavior if you use  rts-gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;  or even only gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>; ?  

    Also have a look in the latest SDK01.00.00.03 sources (drivers/tty/serial/8250 & drivers/tty/serial/omap-serial.c).

    Best Regards,

    Yordan

  • Yordan Kovachev said:

    Also have a look in the latest SDK01.00.00.03 sources (drivers/tty/serial/8250 & drivers/tty/serial/omap-serial.c).

    I have found the problem.  In meta-ti / yocto the developers have moved away from using drivers/tty/serial/omap-serial.c to using the more generic drivers/tty/serial/8250/8250_omap.c  I assume that this is also the case with the SDK 1.00.00.03.  I have not check which of the drivers the SDK compiles. The issue is that in 2015 the omap-serial.c was modified to support the use of RTS for RS485, and this was NOT ported over to the new 8250_omap.c file when the switch to the better supported code was made.  Nor, as far as I can tell, are there any plans to incorporate this into the new driver.

    Also,  there are two GPIO drivers that are linked to the serial port. One is a generic GPIO driver that uses the form:

    gpio = <>

    and the one for the omap-serial.c that has a different keyword to keep it clear to the device tree which one you are talking about....

    rts-gpio=<>

    To sum up, until such time as someone picks this up and ports the RTS GPIO control from the old driver into the new driver, the OMAP SOCs will NOT support RS485.  To go back to the old driver change the kernel config:

    # CONFIG_SERIAL_8250 is not set
    CONFIG_SERIAL_OMAP=y
    CONFIG_SERIAL_OMAP_CONSOLE=y

    Chuck

  • Hi Chuck,

    Thanks for updating the thread.

    CKamas said:
    In meta-ti / yocto the developers have moved away from using drivers/tty/serial/omap-serial.c to using the more generic drivers/tty/serial/8250/8250_omap.c  I assume that this is also the case with the SDK 1.00.00.03

    Yes, TI SDKs (since SDK8.0, I think) use the 8250 driver. 

    Best Regards, 

    Yordan