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/PROCESSOR-SDK-AM437X: gpio_request error return with EPROBE_DEFER(-517)

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: AM4379

Tool/software: Linux

Hi,

When I call gpio_request(5*32+11, "nSTATUS") in linux driver program, it return  -517, 517 means EPROBE_DEFER ( Driver requests probe retry,
defined in include/linux/errno.h). The linux driver   can work in old SDK(linux 3.14.43,ti-sdk-01.00.00.03),
but return failure(-517) in the new SDK(linux4.14.67, ti-sdk-05.01.00.11). Is some modules missing from the system or DTS file error ?I attachment the two program here.

Best Regards,

8737.fpgaload.rar5732.am437x-gp-evm.rar

  • Hi user3529609,

    From what I see, you want to use gpio5_8 signal, and you calculate is as 168 (5*32+11). I am not sure if this calculation is correct, as not all GPIO banks have 32 pins. For example, AM437x GPIO3 has 26 pins (0 to 25).

    You might use function of_get_named_gpio() to automatically calculate the correct gpio number for you, then you can compare if you still have 168 as result.

    I can suggest you to refer the below DTS and C/H fiels for reference. These files are using of_get_named_gpio()

    linux-kernel/arch/arm/boot/dts/am572x-idk-pps.dts

    pps-enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;

    linux-kernel/drivers/net/ethernet/ti/cpts.h
    linux-kernel/drivers/net/ethernet/ti/cpts.c

    gpio = of_get_named_gpio(node, "pps-enable-gpios", 0);
    if (!gpio_is_valid(gpio)) {
    dev_err(cpts->dev, "failed to parse pps-enable gpio\n");
    return gpio;
    }

    See also below link:

    www.embedded.com/.../Linux-device-driver-development--The-GPIO-interface-and-device-tree

    Regards,
    Pavel
  • Hi Pavel,

    I want to use gpio5_8, gpio5_9,gpio5_10,gpio5_11,gpio5_13,gpio5_6, this pins is ok in old SDK.

    I use function of_get_named_gpio()(GPIO_FPGA_nSTATUS = of_get_named_gpio(node,"fpga",0))  in my driver program the first time but it return -2 when insmod;

    I then check the probe funciton in the driver and find node == 0:

    static int fpga_probe(struct platform_device *pdev)
    {

        int err = 0, ret=0;
       
        struct device_node *node = pdev->dev.of_node;
        if( !node){                           //node == 0 here., probe fail.
            printk("probe err!\n");   
            return -1;
        }
    ...

    }

    Why the node == 0? then I get gpio_request((32*5+11),"nSTATUS") as I did it in old SDK(where it work well), but it return -517 

     The primary program of  the driver is as following:

    #define NAME            "fpgaload"

    static struct platform_device fpga_load_platform_device={
        .name = NAME,
        .id = -1,
        .dev = {
        }
    };

    static const struct of_device_id of_fpga_match[] = {
        { .compatible = "cr,fpgaload"},
        {},
    };
    MODULE_DEVICE_TABLE(of, of_fpga_match);


    static struct platform_driver fpga_load_platform_driver = {
        .probe        = fpga_probe,
        .remove    = fpga_remove,
        .driver        = {
            .name    = NAME,
            .owner = THIS_MODULE,
            .of_match_table = of_fpga_match,
        },
    };


    static int __init fpga_init(void)
    {
        int ret = 0;
        unsigned long phybase;
        unsigned int size = 0x10000;

        ret = platform_device_register(&fpga_load_platform_device);
        if(ret){
            printk("platform device register failed!\n");
            return ret;
        }
        ret = platform_driver_register(&fpga_load_platform_driver);
        if(ret){
            printk("platform driver register failed!\n");
            return ret;
        }
      return 0;
    }

    ...
    module_init(fpga_init);
    module_exit(fpga_exit);


    I define the FPGA_Load_pins node in DTS:

        FPGA_Load_pins {
            compatible = "cr,fpgaload";
            status = "okay";
            
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_fpga_load>;
           
            fpga-gpios = <&gpio5 8 GPIO_ACTIVE_HIGH>, //nSTATUS
                    <&gpio5 9 GPIO_ACTIVE_HIGH>, //nDCLK
                    <&gpio5 10 GPIO_ACTIVE_HIGH>, //DATA0
                    <&gpio5 11 GPIO_ACTIVE_HIGH>, //nCONFIG
                    <&gpio5 13 GPIO_ACTIVE_HIGH>, //CONFIG_DONE
                    <&gpio5 6 GPIO_ACTIVE_LOW>; //RESET
                
        };
        
    ...

    Why the node == 0? and gpio_request return -517?  Is it match from fpga_of_matble? Can you check what is wrong in my driver program?

    I attachment the two program here.

    Many thanks for your response!

    Best Regards,

    0677.am437x-gp-evm.rar

    2728.fpgaload.rar

  • user3529609,

    Let we focus on gpio5_8 for now.

    Your C file should looks like:

    int GPIO_FPGA_nSTATUS = 0;
    int ret = 0;

    struct device_node *node;

    GPIO_FPGA_nSTATUS = of_get_named_gpio(node,"fpga-nSTATUS",0);
    printk("GPIO_FPGA_nSTATUS = %d\n");

    ret = gpio_is_valid(GPIO_FPGA_nSTATUS);
    printk("ret = %d\n");

    ret = gpio_request(GPIO_FPGA_nSTATUS, "FPGA nSTATUS);
    printk("ret = %d\n");



    Your DTS file should have the below entry:

    fpga-nSTATUS = <&gpio5 8 GPIO_ACTIVE_HIGH>;


    If still not working, please provide me:

    - the latest version of your C and DTS file
    - console log


    Regards,
    Pavel
  • Hi Pavel,

    I modified  the DTS and the C driver program(I attachment here ) as your instruction, when "insmod fpgaload.ko", the console appear:


    root@am437x-evm:/server# insmod fpgaload.ko
    [  107.822244] fpgaload init
    [  107.828164] device register
    [  107.838156] driver register
    [  107.847857] fpga probe...
    [  107.850503] node ok...
    [  107.860929] GPIO_FPGA_nSTATUS = 104
    [  107.864444] ret = 1
    [  107.866605] ret = 0
    [  107.868736] GPIO_FPGA_nDCLK = 105
    [  107.888811] ret = 1
    [  107.893008] ret = 0
    [  107.895223] GPIO_FPGA_nDCLK = 106
    [  107.898649] ret = 1
    [  107.905181] ret = 0
    [  107.907393] GPIO_FPGA_nCONFIG = 107
    [  107.917878] ret = 1
    [  107.920008] ret = 0
    [  107.925393] GPIO_FPGA_CONFIG_DONE = 109
    [  107.929253] ret = 1
    [  107.936053] ret = 0
    [  107.938265] GPIO_FPGA_RESET = 102
    [  107.946225] ret = 1
    [  107.948354] ret = 0
    [  107.956034] fpga probe ok!
    [  107.967791] fpga probe...
    [  107.970443] node err!
    [  107.980856] fpgaload: probe of fpgaload failed with error -1
    root@am437x-evm:/server#

    the drive seem probe two timers, the first probe is OK, it get gpio= 104(should be 168 , am4379 ball number D25), the second probe get error node(node==0) and return -1;

    why did it get the the unexpected gpio? this gpio may be correct in the new SDK, I'll check it later,  But why did it probe two timers with the second err?

    4571.fpgaload.rar

    5383.am437x-gp-evm.rar

    root@am437x-evm:/server# root@am437x-evm:/server# 
    U-Boot SPL 2018.01-00444-ge782a78ca9-dirty (Feb 16 2019 - 10:11:27)
    Trying to boot from NAND
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    
    
    U-Boot 2018.01-00444-ge782a78ca9-dirty (Feb 16 2019 - 10:11:27 +0800)
    
    CPU  : AM437X-GP rev 1.2
    Model: TI AM437x GP EVM
    DRAM:  1 GiB
    PMIC:  TPS65218
    NAND:  512 MiB
    MMC:   OMAP SD/MMC: 0
    *** Warning - bad CRC, using default environment
    
    Net:   <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot:  0 
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    starting USB...
    USB0:   Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 0 Storage Device(s) found
    
    Device 0: device type unknown
    ... is now current device
    MMC: no card present
    ** Bad device mmc 0 **
    ** Bad device usb 0 **
    Booting from nand ...
    
    NAND read: device 0 offset 0x100000, size 0x80000
     524288 bytes read: OK
    
    NAND read: device 0 offset 0x300000, size 0x700000
     7340032 bytes read: OK
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff0000, end 8ffff407 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.14.67-gd315a9bb00 (root@cr) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 PREEMPT Wed Apr 10 09:58:21 CST 2019
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt: Machine model: TI AM437x GP EVM
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] efi: Getting EFI parameters from FDT:
    [    0.000000] efi: UEFI not found.
    [    0.000000] cma: Reserved 48 MiB at 0xbd000000
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM437x ES1.2 (sgx neon)
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 260416
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Memory: 976240K/1048576K available (8192K kernel code, 328K rwdata, 2488K rodata, 1024K init, 276K bss, 23184K reserved, 49152K cma-reserved, 212992K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
    [    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
    [    0.000000]       .data : 0xc0d00000 - 0xc0d52250   ( 329 kB)
    [    0.000000]        .bss : 0xc0d52250 - 0xc0d974bc   ( 277 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  Tasks RCU enabled.
    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [    0.000000] L2C: platform modifies aux control register: 0x0e030000 -> 0x3e430000
    [    0.000000] L2C: DT/platform modifies aux control register: 0x0e030000 -> 0x3e430000
    [    0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [    0.000000] OMAP L2C310: ROM does not support power control setting
    [    0.000000] L2C-310 dynamic clock gating disabled, standby mode disabled
    [    0.000000] L2C-310 cache controller enabled, 16 ways, 256 kB
    [    0.000000] L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x4e430000
    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [    0.000011] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.000028] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000037] OMAP clocksource: timer1 at 24000000 Hz
    [    0.000404] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
    [    0.000415] OMAP clocksource: 32k_counter at 32768 Hz
    [    0.000792] Console: colour dummy device 80x30
    [    0.000819] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    0.000825] This ensures that you still see kernel messages. Please
    [    0.000829] update your kernel commandline.
    [    0.000852] Calibrating delay loop... 1987.37 BogoMIPS (lpj=9936896)
    [    0.060182] pid_max: default: 32768 minimum: 301
    [    0.060341] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.060364] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.061034] CPU: Testing write buffer coherency: ok
    [    0.061763] Setting up static identity map for 0x80100000 - 0x80100060
    [    0.061906] Hierarchical SRCU implementation.
    [    0.062226] EFI services will not be available.
    [    0.063071] devtmpfs: initialized
    [    0.071226] random: get_random_u32 called from bucket_table_alloc+0x8c/0x1ac with crng_init=0
    [    0.071623] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [    0.071883] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.071904] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.075123] pinctrl core: initialized pinctrl subsystem
    [    0.075780] DMI not present or invalid.
    [    0.076164] NET: Registered protocol family 16
    [    0.077715] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.147548] cpuidle: using governor ladder
    [    0.147583] cpuidle: using governor menu
    [    0.153136] OMAP GPIO hardware version 0.1
    [    0.159058] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp@44000000/l4_wkup@44c00000/scm@210000/pinmux@800/nand_flash_x8, deferring probe
    [    0.162178] No ATAGs?
    [    0.162202] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
    [    0.162217] hw-breakpoint: maximum watchpoint size is 4 bytes.
    [    0.173901] edma 49000000.edma: TI EDMA DMA engine driver
    [    0.177725] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp@44000000/l4_wkup@44c00000/scm@210000/pinmux@800/i2c0_pins, deferring probe
    [    0.177783] omap_i2c 4802a000.i2c: could not find pctldev for node /ocp@44000000/l4_wkup@44c00000/scm@210000/pinmux@800/i2c1_pins, deferring probe
    [    0.177894] media: Linux media interface: v0.10
    [    0.177930] Linux video capture interface: v2.00
    [    0.178026] pps_core: LinuxPPS API ver. 1 registered
    [    0.178034] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.178055] PTP clock support registered
    [    0.178092] EDAC MC: Ver: 3.0.0
    [    0.178513] dmi: Firmware registration failed.
    [    0.178835] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [    0.179176] Advanced Linux Sound Architecture Driver Initialized.
    [    0.180287] clocksource: Switched to clocksource timer1
    [    0.187200] NET: Registered protocol family 2
    [    0.187806] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.187872] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.187946] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.188112] UDP hash table entries: 512 (order: 1, 8192 bytes)
    [    0.188135] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
    [    0.188292] NET: Registered protocol family 1
    [    0.188696] RPC: Registered named UNIX socket transport module.
    [    0.188708] RPC: Registered udp transport module.
    [    0.188714] RPC: Registered tcp transport module.
    [    0.188719] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.190798] workingset: timestamp_bits=14 max_order=18 bucket_order=4
    [    0.194179] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.194820] NFS: Registering the id_resolver key type
    [    0.194853] Key type id_resolver registered
    [    0.194860] Key type id_legacy registered
    [    0.194896] ntfs: driver 2.1.32 [Flags: R/O].
    [    0.196760] bounce: pool size: 64 pages
    [    0.196854] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
    [    0.196866] io scheduler noop registered
    [    0.196872] io scheduler deadline registered
    [    0.197055] io scheduler cfq registered (default)
    [    0.197065] io scheduler mq-deadline registered
    [    0.197071] io scheduler kyber registered
    [    0.199902] pinctrl-single 44e10800.pinmux: 199 pins at pa f9e10800 size 796
    [    0.202772] pwm-backlight backlight: backlight supply power not found, using dummy regulator
    [    0.244039] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [    0.246221] omap8250 44e09000.serial: No clock speed specified: using default: 48000000
    [    0.246783] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
    [    0.946713] console [ttyS0] enabled
    [    0.951981] omap_rng 48310000.rng: Random Number Generator ver. 20
    [    0.959252] omapdss_dss 4832a000.dss: 4832a000.dss supply vdda_video not found, using dummy regulator
    [    0.968680] DSS: OMAP DSS rev 2.0
    [    0.972814] omapdss_dss 4832a000.dss: bound 4832a400.dispc (ops dispc_component_ops)
    [    0.981894] panel-dpi display: display supply vcc not found, using dummy regulator
    [    1.001529] brd: module loaded
    [    1.012719] loop: module loaded
    [    1.017616] pinctrl-single 44e10800.pinmux: pin PIN152 already requested by 44e10800.pinmux; cannot claim for 481a2000.spi
    [    1.028878] pinctrl-single 44e10800.pinmux: pin-152 (481a2000.spi) status -22
    [    1.036074] pinctrl-single 44e10800.pinmux: could not request pin 152 (PIN152) from group spi2_pins  on device pinctrl-single
    [    1.047438] omap2_mcspi 481a2000.spi: Error applying setting, reverse things back
    [    1.054981] omap2_mcspi: probe of 481a2000.spi failed with error -22
    [    1.062099] libphy: Fixed MDIO Bus: probed
    [    1.140348] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [    1.148048] davinci_mdio 4a101000.mdio: detected phy mask ffffffce
    [    1.156888] libphy: 4a101000.mdio: probed
    [    1.161019] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver RTL8211F Gigabit Ethernet
    [    1.170667] davinci_mdio 4a101000.mdio: phy[4]: device 4a101000.mdio:04, driver RTL8211F Gigabit Ethernet
    [    1.180278] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver RTL8211F Gigabit Ethernet
    [    1.190884] cpsw 4a100000.ethernet: Missing dual_emac_res_vlan in DT.
    [    1.197364] cpsw 4a100000.ethernet: Using 1 as Reserved VLAN for 0 slave
    [    1.204220] cpsw 4a100000.ethernet: Missing dual_emac_res_vlan in DT.
    [    1.210715] cpsw 4a100000.ethernet: Using 2 as Reserved VLAN for 1 slave
    [    1.217447] cpsw 4a100000.ethernet: Detected MACID = 7c:38:66:21:be:7b
    [    1.224111] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [    1.230516] cpsw 4a100000.ethernet: ALE Table size 1024
    [    1.235797] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [    1.243657] cpsw 4a100000.ethernet: cpsw: Detected MACID = 7c:38:66:21:be:7d
    [    1.251859] i2c /dev entries driver
    [    1.255776] IR NEC protocol handler initialized
    [    1.260499] IR RC5(x/sz) protocol handler initialized
    [    1.265576] IR RC6 protocol handler initialized
    [    1.270122] IR JVC protocol handler initialized
    [    1.274688] IR Sony protocol handler initialized
    [    1.279321] IR SANYO protocol handler initialized
    [    1.284055] IR Sharp protocol handler initialized
    [    1.288776] IR MCE Keyboard/mouse protocol handler initialized
    [    1.294639] IR XMP protocol handler initialized
    [    1.300760] cpuidle: enable-method property 'ti,am4372' found operations
    [    1.307856] sdhci: Secure Digital Host Controller Interface driver
    [    1.314107] sdhci: Copyright(c) Pierre Ossman
    [    1.319120] sdhci-pltfm: SDHCI platform and OF driver helper
    [    1.325447] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.334699] NET: Registered protocol family 10
    [    1.340511] Segment Routing with IPv6
    [    1.344267] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.350870] NET: Registered protocol family 17
    [    1.355608] Key type dns_resolver registered
    [    1.360103] omap_voltage_late_init: Voltage driver support not added
    [    1.372660] omapdrm omapdrm.0: DMM not available, disable DMM support
    [    1.379512] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [    1.386266] [drm] No driver support for vblank timestamp query.
    [    1.466365] Console: switching to colour frame buffer device 128x48
    [    1.490828] omapdrm omapdrm.0: fb0: omapdrm frame buffer device
    [    1.497456] [drm] Initialized omapdrm 1.0.0 20110917 for omapdrm.0 on minor 0
    [    1.505184] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [    1.510441] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [    1.518145] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
    [    1.524640] nand: AMD/Spansion S34ML04G2
    [    1.528583] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
    [    1.536402] using OMAP_ECC_BCH16_CODE_HW ECC scheme
    [    1.541412] 10 ofpart partitions found on MTD device omap2-nand.0
    [    1.547532] Creating 10 MTD partitions on "omap2-nand.0":
    [    1.552987] 0x000000000000-0x000000040000 : "NAND.SPL"
    [    1.559186] 0x000000040000-0x000000080000 : "NAND.SPL.backup1"
    [    1.565999] 0x000000080000-0x0000000c0000 : "NAND.SPL.backup2"
    [    1.572776] 0x0000000c0000-0x000000100000 : "NAND.SPL.backup3"
    [    1.579437] 0x000000100000-0x000000180000 : "NAND.u-boot-spl-os"
    [    1.586561] 0x000000180000-0x000000280000 : "NAND.u-boot"
    [    1.593305] 0x000000280000-0x0000002c0000 : "NAND.u-boot-env"
    [    1.599873] 0x0000002c0000-0x000000300000 : "NAND.u-boot-env.backup1"
    [    1.607249] 0x000000300000-0x000000a00000 : "NAND.kernel"
    [    1.617289] 0x000000a00000-0x000020000000 : "NAND.file-system"
    [    1.935253] omap_i2c 44e0b000.i2c: bus 0 rev0.12 at 100 kHz
    [    1.942243] omap_i2c 4802a000.i2c: bus 1 rev0.12 at 100 kHz
    [    1.950146] ubi0: attaching mtd9
    [    1.976165] random: fast init done
    [    3.573121] ubi0: scanning is finished
    [    3.589098] ubi0: attached mtd9 (name "NAND.file-system", size 502 MiB)
    [    3.596091] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
    [    3.603136] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
    [    3.609925] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
    [    3.617006] ubi0: good PEBs: 4016, bad PEBs: 0, corrupted PEBs: 0
    [    3.623302] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    3.630657] ubi0: max/mean erase counter: 3/0, WL threshold: 4096, image sequence number: 1218135550
    [    3.639894] ubi0: available PEBs: 0, total reserved PEBs: 4016, PEBs reserved for bad PEB handling: 80
    [    3.649317] ubi0: background thread "ubi_bgt0d" started, PID 48
    [    3.655845] hctosys: unable to open rtc device (rtc0)
    [    3.656483] evm_v3_3d: disabling
    [    3.656489] vmmcwl_fixed: disabling
    [    3.656493] ads7846-reg: disabling
    [    3.656502] ALSA device list:
    [    3.656506]   No soundcards found.
    [    3.690406] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 49
    [    3.709992] UBIFS (ubi0:0): recovery needed
    [    4.114475] UBIFS (ubi0:0): recovery completed
    [    4.124653] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [    4.133948] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [    4.145716] UBIFS (ubi0:0): FS size: 497872896 bytes (474 MiB, 3921 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
    [    4.158329] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
    [    4.166045] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 1A63F863-3B17-4E7B-8F54-C79DB3495770, small LPT model
    [    4.184179] VFS: Mounted root (ubifs filesystem) on device 0:15.
    [    4.196588] devtmpfs: mounted
    [    4.202967] Freeing unused kernel memory: 1024K
    [    4.270342] NOHZ: local_softirq_pending 40
    [    4.410338] NOHZ: local_softirq_pending 40
    [    4.414476] NOHZ: local_softirq_pending 40
    [    4.418613] NOHZ: local_softirq_pending 40
    [    4.422745] NOHZ: local_softirq_pending 242
    [    4.450628] systemd[1]: System time before build time, advancing clock.
    [    4.460334] NOHZ: local_softirq_pending 40
    [    4.480347] NOHZ: local_softirq_pending 40
    [    4.533723] systemd[1]: systemd 234 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN default-hierarchy=hybrid)
    [    4.555736] systemd[1]: Detected architecture arm.
    
    Welcome to Arago 2018.08!
    
    [    4.592141] systemd[1]: Set hostname to <am437x-evm>.
    [    4.790336] NOHZ: local_softirq_pending 202
    [    4.794577] NOHZ: local_softirq_pending 202
    [    5.080338] NOHZ: local_softirq_pending 40
    [    5.221856] random: systemd: uninitialized urandom read (16 bytes read)
    [    5.230133] systemd[1]: Listening on Syslog Socket.
    [  OK  ] Listening on Syslog Socket.
    [    5.262857] random: systemd: uninitialized urandom read (16 bytes read)
    [    5.280056] systemd[1]: Created slice System Slice.
    [  OK  ] Created slice System Slice.
    [    5.311022] random: systemd: uninitialized urandom read (16 bytes read)
    [    5.318298] systemd[1]: Listening on Journal Socket.
    [  OK  ] Listening on Journal Socket.
    [    5.354837] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
    [  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
    [    5.392319] systemd[1]: Listening on udev Control Socket.
    [  OK  ] Listening on udev Control Socket.
    [    5.421130] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
    [  OK  ] Started Dispatch Password Requests to Console Directory Watch.
    [    5.479551] systemd[1]: Starting Load Kernel Modules...
             Starting Load Kernel Modules...
    [  OK  ] Reached target Swap.
    [    5.532348] cryptodev: loading out-of-tree module taints kernel.
    [    5.540533] cryptodev: driver 1.9 loaded.
             Mounting Temporary Directory (/tmp)...
    [  OK  ] Started Forward Password Requests to Wall Directory Watch.
             Starting Remount Root and Kernel File Systems...
    [  OK  ] Listening on udev Kernel Socket.
    [  OK  ] Listening on Journal Socket (/dev/log).
    [  OK  ] Created slice system-getty.slice.
    [  OK  ] Created slice system-serial\x2dgetty.slice.
             Mounting POSIX Message Queue File System...
             Mounting Kernel Debug File System...
    [  OK  ] Reached target Paths.
    [  OK  ] Listening on Process Core Dump Socket.
    [  OK  ] Created slice User and Session Slice.
    [  OK  ] Reached target Slices.
    [  OK  ] Reached target Remote File Systems.
             Starting Journal Service...
    [  OK  ] Listening on Network Service Netlink Socket.
    [  OK  ] Mounted Kernel Debug File System.
    [  OK  ] Mounted POSIX Message Queue File System.
    [  OK  ] Mounted Temporary Directory (/tmp).
    [  OK  ] Started Load Kernel Modules.
    [  OK  ] Started Remount Root and Kernel File Systems.
    [  OK  ] Started Journal Service.
             Starting Flush Journal to Persistent Storage...
             Starting Create System Users...
             Starting Rebuild Hardware Database...
             Starting Apply Kernel Variables...
             Mounting Kernel Configuration File System...
    [  OK  ] Mounted Kernel Configuration File System.
    [  OK  ] Started Create System Users.
    [  OK  ] Started Apply Kernel Variables.
             Starting Create Static Device Nodes in /dev...
    [    6.610980] systemd-journald[70]: Received request to flush runtime journal from PID 1
    [  OK  ] Started Flush Journal to Persistent Storage.
    [    6.706060] random: crng init done
    [    6.709502] random: 7 urandom warning(s) missed due to ratelimiting
    [  OK  ] Started Create Static Device Nodes in /dev.
    [  OK  ] Reached target Local File Systems (Pre).
             Mounting /var/volatile...
             Mounting /media/ram...
             Starting udev Kernel Device Manager...
    [  OK  ] Mounted /var/volatile.
    [  OK  ] Mounted /media/ram.
             Starting Load/Save Random Seed...
    [  OK  ] Reached target Local File Systems.
             Starting Rebuild Journal Catalog...
             Starting Create Volatile Files and Directories...
             Starting Rebuild Dynamic Linker Cache...
    [  OK  ] Started udev Kernel Device Manager.
    [  OK  ] Started Load/Save Random Seed.
    [  OK  ] Started Rebuild Journal Catalog.
    [  OK  ] Started Create Volatile Files and Directories.
             Starting Network Time Synchronization...
             Starting Update UTMP about System Boot/Shutdown...
    [  OK  ] Started Update UTMP about System Boot/Shutdown.
    [  OK  ] Started Network Time Synchronization.
    [  OK  ] Reached target System Time Synchronized.
    [  OK  ] Started Rebuild Dynamic Linker Cache.
    [  OK  ] Started Rebuild Hardware Database.
             Starting udev Coldplug all Devices...
             Starting Update is Completed...
    [  OK  ] Started Update is Completed.
    [   11.040634] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [   11.111363] remoteproc remoteproc0: wkup_m3 is available
    [  OK  ] Found device /dev/ttyS0.
    [   11.144658] omap_rtc 44e3e000.rtc: already running
    [  OK  ] Started udev Coldplug all Devices.
    [  OK  ] Reached target System Initialization.
    [   11.190730] omap_rtc 44e3e000.rtc: registered as rtc0
    [  OK  ] Listening on RPCbind Server Activation Socket.
    [  OK  ] Started Daily Cleanup of Temporary Directories.
             Starting Network Service...
    [  OK  ] Started Daily rotation of log files.
    [  OK  ] Reached target Timers.
    [  OK  ] Listening on D-Bus System Message Bus Socket.
    [   11.433044] remoteproc remoteproc0: powering up wkup_m3
    [  OK  ] Reached target Sockets.
    [  OK  ] Reached target Basic System.
    [  OK  ] Reached target Containers.
    [   11.573277] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 224624
             Starting RPC Bind Service...
    [   11.703325] remoteproc remoteproc0: remote processor wkup_m3 is now up
    [   11.711630] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
             Starting Print notice about GPLv3 packages...
    [  OK  ] Started Job spooling tools.
    [  OK  ] Started Kernel Logging Service.
    [  OK  ] Started Periodic Command Scheduler.
    [  OK  ] Started D-Bus System Message Bus.
    [   12.296458] omap-aes 53501000.aes: OMAP AES hw accel rev: 0.1
    [   12.448722] omap-aes 53501000.aes: will run requests pump with realtime priority
    [   12.563414] omap-sham 53100000.sham: hw accel on OMAP rev 0.0
    [   12.703548] omap-des 53701000.des: OMAP DES hw accel rev: 0.33
    [   12.733784] omap-des 53701000.des: will run requests pump with realtime priority
    [   12.893439] [drm] Initialized pvr 1.14.3699939 20110701 for 56000000.sgx on minor 1
    [   13.958353] PM: bootloader does not support rtc-only!
    [  OK  ] Started Hardware RNG Entropy Gatherer Daemon.
    [  OK  ] Started System Logging Service.
             Starting rc.pvr.service...
    [   14.248635] asoc-simple-card sound0: tlv320aic3x-hifi <-> 4803c000.mcasp mapping ok
             Starting Login Service...
    [  OK  ] Started RPC Bind Service.
    [   14.359629] asoc-simple-card sound0: ASoC: no DMI vendor name!
    [  OK  ] Started Network Service.
    [   14.826834] net eth1: initializing cpsw version 1.15 (0)
    [   15.030858] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
    [   15.062341] RTL8211F Gigabit Ethernet 4a101000.mdio:05: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=4a101000.mdio:05, irq=POLL)
    [   15.249427] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
    [   15.506997] net eth0: initializing cpsw version 1.15 (0)
    [   15.753540] RTL8211F Gigabit Ethernet 4a101000.mdio:04: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=4a101000.mdio:04, irq=POLL)
    [   15.924392] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [  OK  ] Started rc.pvr.service.
    [  OK  ] Started Login Service.
    [  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
             Starting telnetd.service...
    [  OK  ] Created slice system-systemd\x2dbacklight.slice.
             Starting Load/Save Screen Backlight鈥ghtness of backlight:backlight...
    [  OK  ] Reached target Network.
             Starting Permit User Sessions...
             Starting Network Name Resolution...
    [  OK  ] Started Load/Save Screen Backlight Brightness of backlight:backlight.
    [  OK  ] Started telnetd.service.
    [  OK  ] Started Permit User Sessions.
    [  OK  ] Started Serial Getty on ttyS0.
    [  OK  ] Started Getty on tty1.
    [  OK  ] Reached target Login Prompts.
             Starting Synchronize System and HW clocks...
             Starting thttpd.service...
    [  OK  ] Started Synchronize System and HW clocks.
    [  OK  ] Started thttpd.service.
             Starting rng-tools.service...
    [  OK  ] Started Network Name Resolution.
    [  OK  ] Started rng-tools.service.
    [   19.486988] pruss 54400000.pruss: creating PRU cores and other child platform devices
    [   19.536015] pruss 54440000.pruss: creating PRU cores and other child platform devices
    [   19.985224] remoteproc remoteproc1: 54434000.pru is available
    [   20.071568] pru-rproc 54434000.pru: PRU rproc node /ocp@44000000/pruss_soc_bus@54426000/pruss@0/pru@34000 probed successfully
    [   20.186525] remoteproc remoteproc2: 54438000.pru is available
    [   20.231457] usbcore: registered new interface driver usbfs
    [   20.234160] usbcore: registered new interface driver hub
    [   20.242243] usbcore: registered new device driver usb
    [   20.311270] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
    [   20.311311] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 1
    [   20.327437] xhci-hcd xhci-hcd.3.auto: hcc params 0x0238f06d hci version 0x100 quirks 0x02010010
    [   20.327493] xhci-hcd xhci-hcd.3.auto: irq 95, io mem 0x48390000
    [   20.332628] hub 1-0:1.0: USB hub found
    [   20.332784] hub 1-0:1.0: 1 port detected
    [   20.354243] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
    [   20.354266] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 2
    [   20.354292] xhci-hcd xhci-hcd.3.auto: Host supports USB 3.0  SuperSpeed
    [   20.355031] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
    [   20.359715] hub 2-0:1.0: USB hub found
    [   20.359918] hub 2-0:1.0: 1 port detected
    [   20.367649] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
    [   20.367685] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 3
    [   20.385985] xhci-hcd xhci-hcd.4.auto: hcc params 0x0238f06d hci version 0x100 quirks 0x02010010
    [   20.386042] xhci-hcd xhci-hcd.4.auto: irq 96, io mem 0x483d0000
    [   20.391134] hub 3-0:1.0: USB hub found
    [   20.393312] hub 3-0:1.0: 1 port detected
    [   20.396001] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
    [   20.396021] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 4
    [   20.396039] xhci-hcd xhci-hcd.4.auto: Host supports USB 3.0  SuperSpeed
    [   20.396500] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
    [   20.405838] hub 4-0:1.0: USB hub found
    [   20.405913] hub 4-0:1.0: 1 port detected
    [   21.083631] pru-rproc 54438000.pru: PRU rproc node /ocp@44000000/pruss_soc_bus@54426000/pruss@0/pru@38000 probed successfully
    [   21.146181] remoteproc remoteproc3: 54474000.pru is available
    [   21.180839] pru-rproc 54474000.pru: PRU rproc node /ocp@44000000/pruss_soc_bus@54426000/pruss@40000/pru@74000 probed successfully
    [   21.244772] remoteproc remoteproc4: 54478000.pru is available
    [   21.271129] pru-rproc 54478000.pru: PRU rproc node /ocp@44000000/pruss_soc_bus@54426000/pruss@40000/pru@78000 probed successfully
    ***************************************************************
    ***************************************************************
    NOTICE: This file system contains the following GPLv3 packages:
            bash
            binutils
            cifs-utils
            cpio
            dosfstools
            elfutils
            gawk
            gzip
            libdw1
            libelf1
            libreadline7
            m4
            which
    
    If you do not wish to distribute GPLv3 components please remove
    the above packages prior to distribution.  This can be done using
    the opkg remove command.  i.e.:
        opkg remove <package>
    Where <package> is the name printed in the list above
    
    NOTE: If the package is a dependency of another package you
          will be notified of the dependent packages.  You should
          use the --force-removal-of-dependent-packages option to
          also remove the dependent packages as well
    ***************************************************************
    ***************************************************************
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am437x-evm ttyS0
    
    Arago 2018.08 am437x-evm ttyS0
    
    am437x-evm login: root
    root@am437x-evm:~# [   27.362174] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
    [   27.373884] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    cd /server
    root@am437x-evm:/server# insmod fpgaload.ko
    [   37.140812] fpgaload init
    [   37.143470] device register
    [   37.161999] driver register
    [   37.165288] fpga probe...
    [   37.167926] node ok...
    [   37.188768] GPIO_FPGA_nSTATUS = 104
    [   37.195873] ret = 1
    [   37.198051] ret = 0
    [   37.200252] GPIO_FPGA_nDCLK = 105
    [   37.208034] ret = 1
    [   37.210163] ret = 0
    [   37.217874] GPIO_FPGA_nDCLK = 106
    [   37.224631] ret = 1
    [   37.226759] ret = 0
    [   37.228954] GPIO_FPGA_nCONFIG = 107
    [   37.236814] ret = 1
    [   37.238943] ret = 0
    [   37.246611] GPIO_FPGA_CONFIG_DONE = 109
    [   37.253784] ret = 1
    [   37.255913] ret = 0
    [   37.258111] GPIO_FPGA_RESET = 102
    [   37.265664] ret = 1
    [   37.267792] ret = 0
    [   37.277794] fpga probe ok!
    [   37.285694] fpga probe...
    [   37.288340] node err!
    [   37.301691] fpgaload: probe of fpgaload failed with error -1
    

    Best Regards,

  • user3529609,

    Seems that gpio numbers mapped in kernel do not correspond to the physical numbers from the AM437x datasheet. For example, in am437x-gp-evm.dts we have:

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

    This means gpio5_7 pin is used to enable fixed voltage regulator. When I print what value the kernel allocates, I have 135 as result.

    linux-kernel/drivers/regulator/fixed.c

    config->gpio = of_get_named_gpio(np, "gpio", 0);
    printk("config->gpio = %d\n",config->gpio); //135

    Thus it seems to me your gpio5_8 number is correct and configuration is successful. You can check with scope on the D25 pin if there will be high level when you output data on that D25 pin, thus verify the number of 104 is correct or not.

    Regarding second probe of your custom FPGA driver, I think this is not related with AM437x GPIO configuration.

    Regards,
    Pavel
  • Hi Pavel,
    I checked and found the gpio number is right,
    Thanks for your support!
    Regards,