Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10 Dec 2015 08:53 AM by  Adam Ford
UART with enabled DMA
 13 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Zile
New Member
New Member
Posts:45


--
18 Nov 2015 07:36 AM
    Hello,

    We switched to BSP-2.4-4, but now we have issues with serial UARTs. We are using uart at ttyO2 with hw flow ctrl (cts/rts) enabled to communicate with some chip at 3Mbps (actual throughput on ttyO2 during the streaming is around 1.3Mbps). On the previous BSP 2.3-2 this worked just fine, except note 1, see below. With the new BSP-2.4-4, we have troubles, like this:
    -If we stream some bigger data on debug console (ttyO0), for example "cat command" some big file, streaming on ttyO2 is stuck and we lose data. If we copy rpm/BUILD/linux-xxx/drivers/tty/serial/omap-serial.c driver from BSP2.3-2 we don't lose data, but again we have issue from note 1.

    Note 1: In both cases, if some message is printed from kernel for example
     user.warn kernel: [  602.206604] omap_device: omap_i2c.1: new worst case activate latency 0: 274658
    we lost data (seems like ttyO2 is stuck again for some time, and we lose some packets since we have packet counter implement inside packets which are send over ttyO2). We simulated this by making  Loadable module (like in chapter 7 Loadable Module Development from 1020203G_DM37x_Linux_BSP_UM.pdf) which printk some messages 50 bytes message at every 2 seconds, and we see data lost when we load and start this module.

    We think that problem can be CPU overload since both UARTs use IRQs, 
    dmesg | grep irq
    [    0.818359] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
    [    1.926116] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
    [    1.935302] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2

    and with top command we see that 
    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     
    10 root     -51   0     0    0    0 S  9.1  0.0   0:05.61 irq/74-serial i 

    consumes around 10% CPU

    so we want to switch UARTs to use DMA, if it is possible, to relax CPU.
    Do you have some suggestions how to enable DMA to be used with UARTs?

    We tried to set flag
    uart->dma_enabled = 1;

    inside arch/arm/mach-omap2/serial.c folder. We see that CPU load for IRQs is 0, while streaming, but again we lose data and after some time whole system hungs, with bunch of errors

    [  408.928863] DMA transaction error with device 54
    [  408.933776] omap3_l3_app_irq: L3_STATUS_0:           400000
    [  408.939666] kernel BUG at arch/arm/mach-omap2/omap_l3_smx.c:190!
    [  408.946044] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [  408.954589] pgd = c0004000
    [  408.957458] [00000000] *pgd=00000000
    [  408.961242] Internal error: Oops: 817 [#1]
    [  408.965576] Modules linked in: g_file_storage wl12xx wlcore mac80211 cfg80211 wlcore_sdio compat
    [  408.974945] CPU: 0    Not tainted  (3.0.101-BSP-dm37x-2.4-4 #25)
    [  408.981323] PC is at __bug+0x1c/0x24
    [  408.985107] LR is at __bug+0x18/0x24
    [  408.988891] pc : []    lr : []    psr: 60000193
    [  408.988922] sp : cccc7de0  ip : cccc6000  fp : c0886634
    [  409.001007] r10: 00000000  r9 : c0e3504c  r8 : 00000000
    [  409.006530] r7 : 00000000  r6 : 00400000  r5 : cf45ab40  r4 : c0886634
    [  409.013427] r3 : 00000000  r2 : 00000000  r1 : ceda3080  r0 : 0000004a
    [  409.020355] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    [  409.028167] Control: 10c5387d  Table: 8ee0c019  DAC: 00000015
    [  409.034240] Process irq/312-wl12xx (pid: 676, stack limit = 0xcccc62f0)
    [  409.041229] Stack: (0xcccc7de0 to 0xcccc8000)
    [  409.045837] 7de0: c0886634 c006bd98 00000002 60000193 00000256 c00744a0 c0886634 cf45ab40
    [  409.054504] 7e00: 0000000a c08f5980 00000000 c0e3504c 00000000 c00ce754 00000001 c00bf95c
    [  409.063140] 7e20: c0886678 c0886634 cf45ab40 c0886678 c08f5980 00000000 cef360c0 ffffffff
    [  409.071807] 7e40: 00001920 c00ce930 c0886634 c0886678 00000000 c00d09cc c08a2408 0000000a
    [  409.080444] 7e60: 00000000 c00ce3c8 c08a2408 c0045038 ffffffff fa200000 00003679 c0512078
    [  409.089080] 7e80: 00000001 c0903268 00000130 002e3bb2 c08f5980 a0000013 00003679 c08f5980
    [  409.097747] 7ea0: 00000000 cef360c0 ffffffff 00001920 0000005f cccc7ec8 c00bc2b4 c0511ea4
    [  409.106384] 7ec0: 20000013 ffffffff c08f5980 cef36600 00003679 c0096498 bf1a1ed8 a0000013
    [  409.115051] 7ee0: cef365d8 cf7d8440 cef36600 bf17c128 00000004 c00a2a64 00000000 cef360a0
    [  409.123687] 7f00: 00000000 cef36154 000000ff cef360c0 bf1a1ed8 bf17c128 22222222 bf1a0738
    [  409.132354] 7f20: cef36328 cef360a0 00000000 cef360c0 cef360fc cef36328 c0893160 ceda7ec0
    [  409.140991] 7f40: c070a948 bf180310 ceda7ec0 c089311c c089318c c089311c 00000001 c00cecd4
    [  409.149658] 7f60: cccc6000 ceda7edc c089318c c00cee18 c0893190 c08931b8 00000000 cccc7fac
    [  409.158294] 7f80: cee95e98 ceda7ec0 c00cecf0 00000000 00000000 00000000 00000000 c00a68c0
    [  409.166961] 7fa0: 00000002 00000000 ceda7ec0 00000000 00000001 dead4ead ffffffff ffffffff
    [  409.175598] 7fc0: c08f702c 00000000 00000000 c06510e8 00000000 c0051f30 cccc7fd8 cccc7fd8
    [  409.184234] 7fe0: 00000000 cee95e98 c00a6834 c0051f40 00000013 c0051f40 e59930b4 e3833901
    [  409.192932] [] (__bug+0x1c/0x24) from [] (omap2_iommu_set_twl+0x0/0x24)
    [  409.201782] Code: e306016c e34c0063 eb12e688 e3a03000 (e5833000)
    [  409.208374] ---[ end trace ce25ab719cdbaea4 ]---
    [  409.213287] Kernel panic - not syncing: Fatal exception in interrupt
    [  409.220092] [] (unwind_backtrace+0x0/0x138) from [] (panic+0x6c/0x1a4)
    [  409.228912] [] (panic+0x6c/0x1a4) from [] (die+0x2a4/0x300)
    [  409.236724] [] (die+0x2a4/0x300) from [] (__do_kernel_fault+0x74/0x84)
    [  409.245544] [] (__do_kernel_fault+0x74/0x84) from [] (do_page_fault+0xa0/0x360)
    [  409.255157] [] (do_page_fault+0xa0/0x360) from [] (do_DataAbort+0x34/0x98)
    [  409.264343] [] (do_DataAbort+0x34/0x98) from [] (__dabt_svc+0x4c/0x60)
    [  409.273132] Exception stack(0xcccc7d98 to 0xcccc7de0)
    [  409.278503] 7d80:                                                       0000004a ceda3080
    [  409.287200] 7da0: 00000000 00000000 c0886634 cf45ab40 00400000 00000000 00000000 c0e3504c
    [  409.295898] 7dc0: 00000000 c0886634 cccc6000 cccc7de0 c005493c c0054940 60000193 ffffffff
    [  409.304626] [] (__dabt_svc+0x4c/0x60) from [] (__bug+0x1c/0x24)
    [  409.312774] [] (__bug+0x1c/0x24) from [] (omap2_iommu_set_twl+0x0/0x24)

    Some solutions says to use "OMAP internal UART 8250 based driver"
    but this driver isn't supported in BSP2.4-4. Do you have some BSP which support this driver? Or how we can add this driver inside current BSP?

    Other solutions 
    https://e2e.ti.com/support/embedded/linux/f/354/t/387797
    says to change  .dma_enabled    = false, inside serial.c file but there is no that option  (only uart->dma_enabled = 0;) which we changed to 1 as descibed above, but got kernel panic.

    Thank you for your help.

    Regards,
    Zile
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    18 Nov 2015 01:53 PM
    Zile,

    I spoke with the developer who pulled forward many of the UART changes. One of the changes he pulled was from here: http://git.kernel.org/cgi...1c06b87db08cc7075568

    From what I understand, the previous driver did not communicate with higher layers that it was filling. The short answer to the DMA question is that we currently don't have a DMA enabled solution, but we are curious to better understand this data loss situation.

    Is the data lost happening on data leaving the SOM or data received by the SOM?

    Do you have a sample code base that you could send us that would help us reproduce the issue you are seeing? If necessary, I can provide you a with a private mechanism so you don't have to publish code here.

    adam

    Zile
    New Member
    New Member
    Posts:45


    --
    19 Nov 2015 03:42 AM
    Hi Adam,

    Thank you for your quick response.
    As I understand from source files in BSP and from dmesg command output is that all peripherals, except USB, don't use DMA controller. On this way CPU is too much loaded.
    Another my concern is that, these BSP packages are based on the Linux kernel 3.0, which is now pretty old (released in 2011) and this UART driver changes are from 2012, I am sure that since then there were many changes, which increased performance of UART and other peripherals. For example for UART, since 3.19 kernel 8250-omap.c driver is preferred instead of omap-serial.c.

    Data lost happening on data received by the SOM. Our UART communication is part of bigger application, so I need to pull out only this part. It will need me some time to do that, since now I am trying to somehow incorporate 8250-omap.c driver into current BSP and enable DMA to perform UART communications. Also I will try to test it with using some commands like stty, and making loopback on 2 UARTs, if it is possible.

    Regards,
    Dragan
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    19 Nov 2015 07:04 AM
    I understand your concern. We have been working some people in the open source community, and there is basic support for the Torpedo in the mainstream Linux 4.2 kernel.

    If you would like, I can send you a device tree I have been using with some additional functionality if that helps you. It's not officially supported by Logic PD and it hasn't gone through any of our quality testing. If are at all interested, we offer services contracts where some people in our software team could help get you moving faster with the latest Linux Kernel.

    adam
    Zile
    New Member
    New Member
    Posts:45


    --
    20 Nov 2015 04:11 AM
    Hi Adam,
    Thank you for your answer.
    Yes, please send me all files that you have for the 4.2 kernel.

    Regards,
    Zile
    Zile
    New Member
    New Member
    Posts:45


    --
    26 Nov 2015 05:42 AM
    Hi Adam,

    Any update on this?

    Regards,
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    30 Nov 2015 08:32 AM
    The 4.2.6 Kernel is located: https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.2.6.tar.xz

    The latest U-boot is located: ftp://ftp.denx.de/pub/u-boot/u-boot-2015.10.tar.bz2

    You'll need a newer Root file system than what we offer. I have been playing with Buildroot: http://buildroot.uclibc.org/ but I am sure others would work too.

    adam
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    30 Nov 2015 08:34 AM
    I am still having issues with the LCD display, and the Bluetooth and Wifi components on the Torpedo + Wifi haven't been fully tested.


    I replaced the logicpd-torpedo-37xx-devkit.dts file with the following:

    /*
    * 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.
    */

    /dts-v1/;

    #include "omap36xx.dtsi"
    #include "logicpd-torpedo-som.dtsi"
    #include "omap-gpmc-smsc9221.dtsi"

    / {
    model = "LogicPD Zoom DM3730 Torpedo Development Kit";
    compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap36xx";

    gpio_keys {
    compatible = "gpio-keys";
    pinctrl-names = "default";
    pinctrl-0 = <&gpio_key_pins &gpio_key_pins_wkup>;

    sysboot2 {
    label = "sysboot2";
    gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; /* gpio2 */
    linux,code = ;
    gpio-key,wakeup;
    };

    sysboot5 {
    label = "sysboot5";
    gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; /* gpio7 */
    linux,code = ;
    gpio-key,wakeup;
    };

    gpio1 {
    label = "gpio1";
    gpios = <&gpio6 21 GPIO_ACTIVE_LOW>; /* gpio181 */
    linux,code = ;
    gpio-key,wakeup;
    };

    gpio2 {
    label = "gpio2";
    gpios = <&gpio6 18 GPIO_ACTIVE_LOW>; /* gpio178 */
    linux,code = ;
    gpio-key,wakeup;
    };
    };

    sound {
    compatible = "ti,omap-twl4030";
    ti,model = "omap3logic";
    ti,mcbsp = <&mcbsp2>;
    };

    leds {
    compatible = "gpio-leds";
    pinctrl-names = "default";
    pinctrl-0 = <&led_pins>;

    led1 {
    label = "led1";
    gpios = <&gpio6 20 GPIO_ACTIVE_HIGH>; /* gpio180 */
    linux,default-trigger = "cpu0";
    };

    led2 {
    label = "led2";
    gpios = <&gpio6 19 GPIO_ACTIVE_HIGH>; /* gpio179 */
    linux,default-trigger = "none";
    };
    };
    };

    &vaux1 {
    regulator-always-on;
    regulator-min-microvolt = <3000000>;
    regulator-max-microvolt = <3000000>;
    };

    &vaux4 {
    regulator-always-on;
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <1800000>;
    };

    &mcbsp2 {
    status = "okay";
    };

    &dss {
    status = "ok";
    vdds_dsi-supply = <&vpll2>;
    pinctrl-names = "default";
    pinctrl-0 = <&dss_dpi_pins1>;
    port {
    dpi_out: endpoint {
    remote-endpoint = <&lcd_in>;
    data-lines = <16>;
    };
    };
    };

    / {
    aliases {
    display0 = &lcd0;
    };

    lcd0: display@0 {
    compatible = "panel-dpi";
    label = "28";
    status = "okay";
    default-on;
    pinctrl-names = "default";
    enable-gpios = <&gpio5 27 GPIO_ACTIVE_HIGH>; /* gpio155, lcd INI */

    port {
    lcd_in: endpoint {
    remote-endpoint = <&dpi_out>;
    };
    };

    panel-timing {
    clock-frequency = <9000000>;
    hactive = <480>;
    vactive = <272>;
    hfront-porch = <3>;
    hback-porch = <2>;
    hsync-len = <42>;
    vback-porch = <3>;
    vfront-porch = <4>;
    vsync-len = <11>;

    hsync-active = <0>;
    vsync-active = <0>;
    de-active = <1>;
    pixelclk-active = <1>;
    };
    };

    bl: backlight {
    compatible = "gpio-backlight";
    pinctrl-names = "default";
    pinctrl-0 = <&backlight_pins>;

    gpios = <&gpio2 24 GPIO_ACTIVE_HIGH>, /* gpio_56 */
    <&gpio5 26 GPIO_ACTIVE_HIGH>; /* gpio_154 */
    default-on;
    };



    };

    &charger {
    ti,bb-uvolt = <3200000>;
    ti,bb-uamp = <150>;
    };

    &gpmc {
    ranges = <1 0 0x08000000 0x1000000>; /* CS1: 16MB for LAN9221 */

    ethernet@gpmc {
    pinctrl-names = "default";
    pinctrl-0 = <&lan9221_pins>;
    interrupt-parent = <&gpio5>;
    interrupts = <1 IRQ_TYPE_LEVEL_LOW>; /* gpio129 */
    reg = <1 0 0xff>;
    };
    };

    &mmc1 {
    interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>;
    pinctrl-names = "default";
    pinctrl-0 = <&mmc1_pins &mmc1_cd>;
    cd-gpios = <&gpio4 31 IRQ_TYPE_LEVEL_LOW>; /* gpio127 */
    vmmc-supply = <&vmmc1>;
    bus-width = <4>;
    cap-power-off-card;
    };

    &omap3_pmx_core {
    gpio_key_pins: pinmux_gpio_key_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLUP | MUX_MODE4) /* mcspi2_clk.gpio_178 */
    OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLUP | MUX_MODE4) /* mcspi2_cs0.gpio_181 */
    >;
    };

    led_pins: pinmux_led_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x21d8, PIN_OUTPUT | MUX_MODE4) /* gpio_179 */
    OMAP3_CORE1_IOPAD(0x21da, PIN_OUTPUT | MUX_MODE4) /* gpio_180 */
    >;
    };

    backlight_pins: pinmux_backlight_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x20B8, PIN_OUTPUT | MUX_MODE4) /* gpmc_ncs5.gpio_56 */
    OMAP3_CORE1_IOPAD(0x2188, PIN_OUTPUT | MUX_MODE4) /* mcbsp4_dx.gpio_154 */
    >;
    };

    dss_dpi_pins1: pinmux_dss_dpi_pins1 {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
    OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
    OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
    OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */

    OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
    OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
    OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
    OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
    OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
    OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
    OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
    OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
    OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
    OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
    OMAP3_CORE1_IOPAD(0x20fc, PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
    OMAP3_CORE1_IOPAD(0x20fe, PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */

    OMAP3_CORE1_IOPAD(0x2100, PIN_OUTPUT | MUX_MODE3) /* dss_data18.dss_data0 */
    OMAP3_CORE1_IOPAD(0x2102, PIN_OUTPUT | MUX_MODE3) /* dss_data19.dss_data1 */
    OMAP3_CORE1_IOPAD(0x2104, PIN_OUTPUT | MUX_MODE3) /* dss_data20.dss_data2 */
    OMAP3_CORE1_IOPAD(0x2106, PIN_OUTPUT | MUX_MODE3) /* dss_data21.dss_data3 */
    OMAP3_CORE1_IOPAD(0x2108, PIN_OUTPUT | MUX_MODE3) /* dss_data22.dss_data4 */
    OMAP3_CORE1_IOPAD(0x210a, PIN_OUTPUT | MUX_MODE3) /* dss_data23.dss_data5 */
    >;
    };

    mmc1_pins: pinmux_mmc1_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x2144, PIN_OUTPUT | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
    OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
    OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
    OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
    OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
    OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
    >;
    };
    };

    &omap3_pmx_wkup {
    gpio_key_pins_wkup: pinmux_gpio_key_pins_wkup {
    pinctrl-single,pins = <
    OMAP3_WKUP_IOPAD(0x2a0a, PIN_INPUT_PULLUP | MUX_MODE4) /* sys_boot0.gpio_2 */
    OMAP3_WKUP_IOPAD(0x2a14, PIN_INPUT_PULLUP | MUX_MODE4) /* sys_boot5.gpio_7 */
    >;
    };

    lan9221_pins: pinmux_lan9221_pins {
    pinctrl-single,pins = <
    OMAP3_WKUP_IOPAD(0x2a5a, PIN_INPUT | MUX_MODE4) /* reserved.gpio_129 */
    >;
    };

    mmc1_cd: pinmux_mmc1_cd {
    pinctrl-single,pins = <
    OMAP3_WKUP_IOPAD(0x2a54, PIN_INPUT_PULLUP | MUX_MODE4) /* reserved.gpio_127 */
    >;
    };
    };

    &uart1 {
    interrupts-extended = <&intc 72 &omap3_pmx_core OMAP3_UART1_RX>;
    };

    /* Wired to the tps65950 on the SOM, only the USB connector is on the devkit */
    &usb_otg_hs {
    interface-type = <0>;
    usb-phy = <&usb2_phy>;
    phys = <&usb2_phy>;
    phy-names = "usb2-phy";
    mode = <3>;
    power = <50>;
    };

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    30 Nov 2015 08:35 AM
    Here is the logicpd-torpedo-son.dtsi:

    /*
    * 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.
    */

    #include

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

    leds {
    compatible = "gpio-leds";
    user0 {
    label = "user0";
    gpios = <&twl_gpio 18 GPIO_ACTIVE_LOW>; /* LEDA */
    linux,default-trigger = "none";
    };
    };

    wl12xx_vmmc: wl12xx_vmmc {
    compatible = "regulator-fixed";
    regulator-name = "vwl1271";
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <1800000>;
    gpio = <&gpio5 29 0>; /* gpio157 */
    startup-delay-us = <70000>;
    enable-active-high;
    vin-supply = <&vmmc2>;
    };

    kim {
    compatible = "kim";
    nshutdown_gpio = <162>; /* Bank3, pin21 */
    dev_name = "/dev/ttyS1";
    flow_cntrl = <1>;
    baud_rate = <300000>;
    };

    btwilink {
    compatible = "btwilink";
    };
    };

    &gpmc {
    ranges = <0 0 0x00000000 0x1000000>; /* CS0: 16MB for NAND */

    nand@0,0 {
    linux,mtd-name = "micron,mt29f4g16abbda3w";
    reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
    nand-bus-width = <16>;
    ti,nand-ecc-opt = "bch8";
    gpmc,sync-clk-ps = <0>;
    gpmc,cs-on-ns = <0>;
    gpmc,cs-rd-off-ns = <44>;
    gpmc,cs-wr-off-ns = <44>;
    gpmc,adv-on-ns = <6>;
    gpmc,adv-rd-off-ns = <34>;
    gpmc,adv-wr-off-ns = <44>;
    gpmc,we-off-ns = <40>;
    gpmc,oe-off-ns = <54>;
    gpmc,access-ns = <64>;
    gpmc,rd-cycle-ns = <82>;
    gpmc,wr-cycle-ns = <82>;
    gpmc,wr-access-ns = <40>;
    gpmc,wr-data-mux-bus-ns = <0>;
    gpmc,device-width = <2>;
    #address-cells = <1>;
    #size-cells = <1>;

    /* u-boot uses mtdparts=omap2-nand.0:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs) */

    x-loader@0 {
    label = "x-loader";
    reg = <0 0x80000>;
    };

    bootloaders@80000 {
    label = "u-boot";
    reg = <0x80000 0x1e0000>;
    };

    bootloaders_env@260000 {
    label = "u-boot-env";
    reg = <0x260000 0x20000>;
    };

    kernel@280000 {
    label = "kernel";
    reg = <0x280000 0x400000>;
    };

    filesystem@680000 {
    label = "fs";
    reg = <0x680000 0>; /* 0 = MTDPART_SIZ_FULL */
    };
    };
    };

    &i2c1 {
    clock-frequency = <2600000>;

    twl: twl@48 {
    reg = <0x48>;
    interrupts = <7>; /* SYS_NIRQ cascaded to intc */
    interrupt-parent = <&intc>;
    twl_audio: audio {
    compatible = "ti,twl4030-audio";
    codec {
    };
    };
    };
    };

    &i2c2 {
    clock-frequency = <400000>;
    };

    &i2c3 {
    clock-frequency = <400000>;
    };

    /*
    * Only found on the wireless SOM. For the SOM without wireless, the pins for
    * MMC3 can be routed with jumpers to the second MMC slot on the devkit and
    * gpio157 is not connected. So this should be OK to keep common for now,
    * probably device tree overlays is the way to go with the various SOM and
    * jumpering combinations for the long run.
    */
    &mmc3 {
    interrupts-extended = <&intc 94 &omap3_pmx_core2 0x46>;
    pinctrl-0 = <&mmc3_pins &mmc3_core2_pins>;
    pinctrl-names = "default";
    vmmc-supply = <&wl12xx_vmmc>;
    non-removable;
    bus-width = <4>;
    cap-power-off-card;
    #address-cells = <1>;
    #size-cells = <0>;
    wlcore: wlcore@2 {
    compatible = "ti,wl1283";
    reg = <2>;
    interrupt-parent = <&gpio5>;
    interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; /* gpio 152 */
    ref-clock-frequency = <26000000>;
    };
    };

    &omap3_pmx_core {
    mmc3_pins: pinmux_mm3_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x2164, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat4.sdmmc3_dat0 */
    OMAP3_CORE1_IOPAD(0x2166, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat5.sdmmc3_dat1 */
    OMAP3_CORE1_IOPAD(0x2168, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat6.sdmmc3_dat2 */
    OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat6.sdmmc3_dat3 */
    OMAP3_CORE1_IOPAD(0x2184, PIN_INPUT_PULLUP | MUX_MODE4) /* mcbsp4_clkx.gpio_152 */
    OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4) /* mcbsp1_fsr.gpio_157 */
    >;
    };
    mcbsp2_pins: pinmux_mcbsp2_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x213c, PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx */
    OMAP3_CORE1_IOPAD(0x213e, PIN_INPUT | MUX_MODE0) /* mcbsp2_clkx */
    OMAP3_CORE1_IOPAD(0x2140, PIN_INPUT | MUX_MODE0) /* mcbsp2_dr */
    OMAP3_CORE1_IOPAD(0x2142, PIN_OUTPUT | MUX_MODE0) /* mcbsp2_dx */
    >;
    };
    uart2_pins: pinmux_uart2_pins {
    pinctrl-single,pins = <
    OMAP3_CORE1_IOPAD(0x2174, PIN_INPUT | MUX_MODE0) /* uart2_cts.uart2_cts */
    OMAP3_CORE1_IOPAD(0x2176, PIN_OUTPUT | MUX_MODE0) /* uart2_rts .uart2_rts*/
    OMAP3_CORE1_IOPAD(0x2178, PIN_OUTPUT | MUX_MODE0) /* uart2_tx.uart2_tx */
    OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0) /* uart2_rx.uart2_rx */
    OMAP3_CORE1_IOPAD(0x2198, PIN_OUTPUT | MUX_MODE4) /* GPIO_162,BT_EN */
    >;
    };
    };

    &uart2 {
    interrupts-extended = <&intc 73 &omap3_pmx_core OMAP3_UART2_RX>;
    pinctrl-names = "default";
    pinctrl-0 = <&uart2_pins>;
    };

    &omap3_pmx_core2 {
    mmc3_core2_pins: pinmux_mmc3_core2_pins {
    pinctrl-single,pins = <
    OMAP3630_CORE2_IOPAD(0x25d8, PIN_INPUT_PULLUP | MUX_MODE2) /* etk_clk.sdmmc3_clk */
    OMAP3630_CORE2_IOPAD(0x25da, PIN_INPUT_PULLUP | MUX_MODE2) /* etk_ctl.sdmmc3_cmd */
    >;
    };
    };

    #include "twl4030.dtsi"
    #include "twl4030_omap3.dtsi"

    &twl {
    twl_power: power {
    compatible = "ti,twl4030-power-idle-osc-off", "ti,twl4030-power-idle";
    ti,use_poweroff;
    };
    };

    &twl_gpio {
    ti,use-leds;
    };
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    30 Nov 2015 09:15 AM
    None of the above has been tested through our quality team, but it's been a side project for me.

    Depending on module you are using, you can use either omap2plus_defconfig or multi_v7_defconfig with the kernel. I have had issues wtih omap2plus, so I prefer the multi_v7, but some drivers aren't enabled by default.

    Either way, I would suggest you go manually change the serial driver to the new version you need with the DMA option based on the message you previously sent.

    You'll need to change the consoledevice in u-boot to ttyS0 instead of ttyO0 if you want to the DMA enabled driver to work.

    I can't offer you much more assistance there, but I can suggest a services contact. Our services group is willing to help you with as much or as little as much as you need. If you want, I can have one of our sales people contact you.

    adam
    Zile
    New Member
    New Member
    Posts:45


    --
    01 Dec 2015 03:14 AM
    Hi Adam,

    Thank you. We will try to setup this with buildroot.
    No need for service contract for now.
    It would be great if LogicPD update their official BSPs to support newer kernels and device tree in the next period.

    Regards,
    Dragan
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    01 Dec 2015 07:00 AM
    I am working on something to present. It may or may not go through the full SQA testing, but due to a variety of reasons, I am only able to work on this part time.

    I pushed a bunch of patches to the mainstream Linux project that were accepted yesterday. I hope many of them to appear by the time Linux 4.4 is released. I am working on a bunch of patches for U-Boot as well.

    I don't have an ETA on the final project, but I'll try to help as I can.

    adam
    Zile
    New Member
    New Member
    Posts:45


    --
    10 Dec 2015 06:38 AM
    Hello Adam,

    Can you please upload dts and dtsi files somewhere or send it to my email?
    There are some syntax errors when I copied them from this post thread to new file, but I can't figured out where.

    Regards,
    Dragan
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    10 Dec 2015 08:53 AM
    I have e-mailed you the DTS, DTSI and config files I have been using.

    adam
    You are not authorized to post a reply.