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.

Linux/AM3359: Interfacing Xilinx Artix-7 family(XC7A200T) with am3359 GPMC

Part Number: AM3359

Tool/software: Linux

Hello All,

                         I'm trying to interface xilinx FPGA with am3359 via GPCM(CS1) on custom board based on AM3359 icev2.A nand flash is also connected to the GPMC(CS0).I added fpga and nand as the child nodes of gpmc in the device tree.Is the device tree configuration and enabling the respective fpga drivers enough to access the fpga?.Also I would like to write a .bin file to fpga from the  user space.Is it possible?. The board is is the final phase of design.I'm looking for a head start.Any  information would be really helpful.TIA

Regards,

Murugan S

  • Please attached the device tree file.
  • am335x-icev2.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /*
    * Copyright (C) 2016 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.
    */
    /*
    * AM335x ICE V2 board
    * http://www.ti.com/tool/tmdsice3359
    */
    /dts-v1/;
    #include "am33xx.dtsi"
    / {
    model = "TI AM3359 ICE-V2";
    compatible = "ti,am3359-icev2", "ti,am33xx";
    memory@80000000 {
    device_type = "memory";
    reg = <0x80000000 0x10000000>; /* 256 MB */
    };
    chosen {
    stdout-path = &uart3;
    };
    vbat: fixedregulator0 {
    compatible = "regulator-fixed";
    regulator-name = "vbat";
    regulator-min-microvolt = <5000000>;
    regulator-max-microvolt = <5000000>;
    regulator-boot-on;
    };
    vtt_fixed: fixedregulator1 {
    compatible = "regulator-fixed";
    regulator-name = "vtt";
    regulator-min-microvolt = <1500000>;
    regulator-max-microvolt = <1500000>;
    gpio = <&gpio0 18 GPIO_ACTIVE_HIGH>;
    regulator-always-on;
    regulator-boot-on;
    enable-active-high;
    };
    leds-iio {
    status = "disabled";
    compatible = "gpio-leds";
    led-out0 {
    label = "out0";
    gpios = <&tpic2810 0 GPIO_ACTIVE_HIGH>;
    default-state = "off";
    };
    led-out1 {
    label = "out1";
    gpios = <&tpic2810 1 GPIO_ACTIVE_HIGH>;
    default-state = "off";
    };
    led-out2 {
    label = "out2";
    gpios = <&tpic2810 2 GPIO_ACTIVE_HIGH>;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Marcus,
    I have attached the dts file(rename to .txt because i cant upload the dts file as such).Please have a look.
    Regards,
    Murugan S
  • Murugan,

    I didn't see pin mux data in your DTS. Have a look here for an example in the AM437x family:

    git.ti.com/.../am437x-gp-evm.dts

    As far as writing the data, this is beyond the scope of the support we can provide. The GPMC driver will use the data in the DTS file to configure the GPMC, but there is no "driver" per se to write the data to that space. You will need to develop this methodology as part of your system design.
  • Hi Ron,
    Thanks for the input.I referred the link you shared and enabled pinmuxing for gpmc:

            gpmc_pins: gpmc_pins {
                    pinctrl-single,pins=<
                            AM33XX_IOPAD(0x800,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad0.gpmc.ad0*/
                            AM33XX_IOPAD(0x804,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad1.gpmc.ad1*/
                            AM33XX_IOPAD(0x808,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad2.gpmc.ad2*/
                            AM33XX_IOPAD(0x80C,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad3.gpmc.ad3*/
                            AM33XX_IOPAD(0x810,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad4.gpmc.ad4*/
                            AM33XX_IOPAD(0x814,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad5.gpmc.ad5*/
                            AM33XX_IOPAD(0x818,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad6.gpmc.ad6*/
                            AM33XX_IOPAD(0x81C,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad7.gpmc.ad7*/
                            AM33XX_IOPAD(0x820,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad8.gpmc.ad8*/
                            AM33XX_IOPAD(0x824,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad9.gpmc.ad9*/
                            AM33XX_IOPAD(0x828,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad10.gpmc.ad10*/
                            AM33XX_IOPAD(0x82C,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad11.gpmc.ad11*/
                            AM33XX_IOPAD(0x830,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad12.gpmc.ad12*/
                            AM33XX_IOPAD(0x834,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad13.gpmc.ad13*/
                            AM33XX_IOPAD(0x838,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad14.gpmc.ad14*/
                            AM33XX_IOPAD(0x83C,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad15.gpmc.ad15*/

                            AM33XX_IOPAD(0x870,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_wait0*/
                            AM33XX_IOPAD(0x874,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_wpn*/
                            AM33XX_IOPAD(0x878,PIN_OUTPUT|MUX_MODE0)/*gpmc_ben1*/
                            AM33XX_IOPAD(0x87C,PIN_OUTPUT|MUX_MODE0)/*gpmc_csn0*/
                            AM33XX_IOPAD(0x884,PIN_OUTPUT|MUX_MODE0)/*gpmc_csn2*/
                            AM33XX_IOPAD(0x88C,PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_clk*/
                            AM33XX_IOPAD(0x890,PIN_OUTPUT|MUX_MODE0)/*gpmc_advn_ale*/
                            AM33XX_IOPAD(0x894,PIN_OUTPUT_PULLUP|MUX_MODE0)/*gpmc_oen_ren*/
                            AM33XX_IOPAD(0x898,PIN_OUTPUT_PULLUP|MUX_MODE0)/*gpmc_wen*/
                            AM33XX_IOPAD(0x89C,PIN_OUTPUT_PULLUP|MUX_MODE0)/*gpmc_ben0_cle*/
                    >;
            };



    Is this correct?And also I couldn't understand the difference between PIN_OUTPUT and PIN_OUTPUT_PULLUP.

    Regards,
    Murugan S

  • Murugan S,

    This is starting to look much better. The _PULLUP enables the internal PULLUP within the device. Whether it is needed or not depends on your board implementation and use. Please refer to the TRM for more details.

    Thanks.