UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor belgium_beer
Visitor
6,891 Views
Registered: ‎11-19-2013

Implementing Xilinx uart 16550 IP to uart 16550 in Linux zynq 3.9

Jump to solution

Hola there,

 

Anyone out there did manage to  implement the uart "ns 16550" to linux ?

Does the "Serial: 8250/16550 driver" support Xilinx 16550 IP? i have tried Uartlite IP with uartlite

linux driver and it work fine. Im totally stuck guys, Im not sure whether is my devicetree or the kernel

just wouldnt accept the uart 16550 that i input witihn the device tree. Hope you guy could help me, Thank you.

 

Kernel output :

Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled

                    <-- im asuming the uart 16550 MMIO registered would display over here(but it didnt)

42c00000.serial_rs485: ttyUL0 at MMIO 0x42c00000 (irq = 91) is a uartlite
xuartps e0001000.uart: failed to get alias id, errno -19
e000console [ttyPS0] enabled, bootconsole disabled
console [ttyPS0] enabled, bootconsole disabled
xuartps e0000000.uart: failed to get alias id, errno -19
e0000000.uart: ttyPS1 at MMIO 0xe0000000 (irq = 59) is a xuartps
xdevcfg f8007000.devcfg: ioremap f8007000 to e0864000 with size 100

 

 

My devicetree setup for uart 16500:

 

serial@42a00000 {
            clock-frequency = <50000000>;
            compatible = "xlnx,axi-uart16550-1.01.a", "xlnx,xps-uart16550-2.00.a", "ns16550";
            current-speed = <9600>;
            device_type = "serial";
            interrupt-parent = <&gic>;
            interrupts = < 0 58 0>;
            reg = < 0x42a00000 0x10000 >;
            reg-offset = <0x1000>;
            reg-shift = <2>;
            xlnx,external-xin-clk-hz = <0x2faf080>;
            xlnx,family = "zynq";
            xlnx,has-external-rclk = <0x0>;
            xlnx,has-external-xin = <0x0>;
            xlnx,is-a-16550 = <0x1>;
            xlnx,s-axi-aclk-freq-hz = <0x2faf080>;
            xlnx,use-modem-ports = <0x0>;
            xlnx,use-user-ports = <0x0>;
            } ;

 

kernel compile config:

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_CONSOLE=y
#CONFIG_SERIAL_8250_DMA is not set

#CONFIG_SERIAL_8250_PCI is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_EM is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_AMBA_PL010 is not set
# CONFIG_SERIAL_AMBA_PL011 is not set
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_MFD_HSU is not set
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_OF_PLATFORM is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_PCH_UART is not set
CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_TTY_PRINTK is not set
# CONFIG_HVC_DCC is not set
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
CONFIG_XILINX_DEVCFG=y
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y

I hope that this information is helpful. Truthfully I have been reading all the thread on this particular topic quite a few times now,unfortunatly im still stuck. Thank for spending your time reading this thread.

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
9,409 Views
Registered: ‎05-01-2012

Re: Implementing Xilinx uart 16550 IP to uart 16550 in Linux zynq 3.9

Jump to solution
I have gotten it working, with 8 instances even. I don't see anything standing out as being wrong with your dts file or your kernel config, other than the compatible entry should probably be ns16550a. Are you instantiating both a uartlite and a 16550? I'm using kernel version 3.2 so I had to change the driver in of_serial.c just a little bit, because it needed to call of_alias_get_id() in order to set port.line before calling serial8250_register_port(). Also, you may need to set CONFIG_SERIAL_OF_PLATFORM=y.
0 Kudos
3 Replies
Adventurer
Adventurer
9,410 Views
Registered: ‎05-01-2012

Re: Implementing Xilinx uart 16550 IP to uart 16550 in Linux zynq 3.9

Jump to solution
I have gotten it working, with 8 instances even. I don't see anything standing out as being wrong with your dts file or your kernel config, other than the compatible entry should probably be ns16550a. Are you instantiating both a uartlite and a 16550? I'm using kernel version 3.2 so I had to change the driver in of_serial.c just a little bit, because it needed to call of_alias_get_id() in order to set port.line before calling serial8250_register_port(). Also, you may need to set CONFIG_SERIAL_OF_PLATFORM=y.
0 Kudos
Highlighted
Visitor amitd
Visitor
6,869 Views
Registered: ‎08-26-2012

Re: Implementing Xilinx uart 16550 IP to uart 16550 in Linux zynq 3.9

Jump to solution

Which UART do you want 16550 or 16550a? 

You probably want 16550a since it has a 16 bytes buffer and not a 1 byte buffer as 16550 ( 16550 is pretty much obselete )

 

This is my DTS entry:( note the bold )

 

plb_uart0_usb: serial@84010000 {
clock-frequency = <100000000>;
compatible = "xlnx,xps-uart16550-3.00.a", "ns16550a";
current-speed = <115200>;
device_type = "serial";
interrupt-parent = <&Interrupt_Cntlr>;
interrupts = < 8 2 >;
reg = < 0x84010000 0x2000 >;
reg-offset = <0x1003>;
reg-shift = <2>;
xlnx,external-xin-clk-hz = <0x17d7840>;
xlnx,family = "spartan6";
xlnx,has-external-rclk = <0x0>;
xlnx,has-external-xin = <0x0>;
xlnx,is-a-16550 = <0x1>;
} ;

 

This is my .config entries ( kernel 3.0.0. for Microblaze )

 

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=2
CONFIG_SERIAL_8250_RUNTIME_UARTS=2

#
# Non-8250 serial port support
#

CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y

0 Kudos
Visitor belgium_beer
Visitor
6,837 Views
Registered: ‎11-19-2013

Re: Implementing Xilinx uart 16550 IP to uart 16550 in Linux zynq 3.9

Jump to solution

Thank you guys, both are the right solution. I manage to make it work now. My problem is to get the OF_SERIAL compile,but didnt to find it in the kernel menuconfig. It was on a a different name then i expected "serial support for powerpc".Thanks again for the support.

 

0 Kudos