FPGA access in Linux 4.4

Using Zynq Programmable Logic and Xilinx tools to create custom board configurations

FPGA access in Linux 4.4

Postby sebraa » Fri May 06, 2016 2:51 pm

Hi,

I am using the current image (Linux 4.4, eSDK 2016.3) on a Parallella with Zynq 7020. So far, I have not touched the FPGA. I try to follow the tutorial available here somewhat, but I am using the original bitstream for now.

When removing the Epiphany snippet from the device-tree, neither the Epiphany driver nor the thermal daemon will start at runtime, which avoids crashes if the eLink is missing in the bitstream (thanks, Adapteva!). So I have removed the Epiphany snippet and added the following to the device tree instead:
Code: Select all
/ {
        amba_pl {
                compatible = "simple-bus";
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                ranges;

                my_mult@70020000 {
                        compatible = "generic-uio";
                        reg = <0x70020000 0x1000>;
                        interrupts = <0 57 0>;
                        interrupt-parent = <0x1>;
                };
        };
};


I also have changed the kernel command line in the device-tree as well and verified that it is used:
Code: Select all
$ cat /proc/cmdline
console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait


However, there is still no UIO device appearing (kernel log is silent on this matter).

So I cross-compiled a new kernel, using this github repository, but the parallella-linux-2016.3 branch. I changed the following configuration options compared to parallella_defconfig:
Code: Select all
CONFIG_UIO=y
CONFIG_UIO_PDRV_GENIRQ=y
CONFIG_UIO_DMEM_GENIRQ=y
CONFIG_GS_FPGABOOT=y
CONFIG_FPGA=y
CONFIG_FPGA_MGR_ZYNQ_FPGA=y


The device-tree definitely contains my device:
Code: Select all
$ cat /proc/device-tree/amba_pl/my_mult\@70020000/compatible
generic-uio


My UIO device does not show up. What am I missing?

I also noticed that neither kernel supports the /dev/xdevcfg device, and I don't know how to enable it. The gs_fpgaboot driver seems to have replaced it, but I don't know how to use it.

What do I need to do in order to change the bitstream at runtime (without crashing the system)?

Best Regards,
sebraa
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: FPGA access in Linux 4.4

Postby kirill » Sat May 07, 2016 12:23 pm

Not sure why you are having issues with UIO sebraa, looks like you enabled the right modules in config and supplied correct kernel cmdline. I have been able to use uio driver using 2016.3 release. I also tried to enable synz fpga module, but it fails to load with some error, I haven't investigated further. Instead I switched to Xilinx version of the Linux Kernel. It was relatively straightforward to copy Epiphany driver over. I have made a patch and build script:

https://github.com/Kirill888/parallella ... ter/kernel

Tested on 7010 parallella, xdevcfg works and epiphany driver also seems to work, but I didn't test it rigorously, just ran some sample apps.
kirill
 
Posts: 38
Joined: Mon Sep 28, 2015 7:24 am

Re: FPGA access in Linux 4.4

Postby sebraa » Sat May 07, 2016 11:49 pm

Well, after some random fiddling, I got the /dev/uio0 device to appear, using the parallella-linux kernel. I have no clue why it works now.

However, while I can build your kernel (Xilinx + Epiphany patch), it won't boot. Unfortunately, I don't have a serial cable and can't see why. I only noticed that the Xilinx kernel is much smaller (~2.2 MB) than the parallella-linux kernel (~6 MB), both using parallella_defconfig.

I have looked into the CONFIG_GS_FPGABOOT (or gs_fpga) staging driver, which seems a suitable replacement for Xilinx /dev/xdevcfg driver. However, it doesn't seem functional yet. The xl_init_io() function in drivers/staging/gs_fpgaboot/io.c always returns -1, which results in a "GPIO INIT FAIL!!" error when trying to load (use) the driver. So I have to figure out how to get the Xilinx kernel running. Sigh.

In any case, thank you for your help and the tutorials. I plan on following them as soon as I get the required infrastructure working. :-)
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: FPGA access in Linux 4.4

Postby kirill » Sun May 08, 2016 6:52 am

I strongly recommend getting a usb to uart adaptor, they are like $3 on ebay. It helps a lot, just make sure to use 3.3V version.

It is worth making sure that boot partition has no errors. Debugging without uart is hard, but possible. For example you can clear /var/log/ folder before booting, then check if anything was written to it during "unsuccessful boot", it could be just a network problem for example.

The size of the kernel sounds about right, this is what works on my setup. Although I would expect parallella kernel would also be closer to 2M if you used my config and not default one.

EDIT: removed note about u-boot and uart, got things confused with zedboard problems I have had in the past, on parallella u-boot only drops into prompt if it can't read sd-card.
kirill
 
Posts: 38
Joined: Mon Sep 28, 2015 7:24 am

Re: FPGA access in Linux 4.4

Postby sebraa » Mon May 09, 2016 10:57 pm

I have connected my trusty old 5V adapter (only Rx/GND) to at least see the kernel log. The kernel panics early at boot and I am stuck here.

After building the kernel (just running your script, which uses on xilinx-v2016.1.tar.gz) I get a uImage-4.4.xlnx, which is 2,238,400 bytes in size.

This is the full kernel log:
Code: Select all
U-Boot 2012.10-00003-g792c31c (Jan 03 2014 - 12:24:08)

I2C:   ready
DRAM:  992 MiB
WARNING: Caches not enabled
MMC:   SDHCI: 0
SF: Detected N25Q128 with page size 64 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
Net:   zynq_gem
Hit any key to stop autoboot:  0
Configuring PL and Booting Linux...
Device: SDHCI
Manufacturer ID: 3
OEM: 5344
Name: SL16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
reading parallella.bit.bin

4045568 bytes read
reading uImage

2238400 bytes read
reading devicetree.dtb

13330 bytes read
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-4.4.0-xlnx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2238336 Bytes = 2.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x02a00000
   Loading Kernel Image ... OK
OK
   Loading Device Tree to 1fff9000, end 1ffff411 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.4.0-xlnx (basti@sebraa) (gcc version 4.8.4 20141219 (release) (4.8.4-1+11-1) ) #1 SMP PREEMPT Tue May 10 00:38:21 CEST 2016
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Adapteva Parallella Board with headless bitstream
cma: Reserved 16 MiB at 0x3d000000
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @ef810000 s18944 r8192 d22016 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 252416
Kernel command line: console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 984036K/1015808K available (4316K kernel code, 206K rwdata, 1440K rodata, 248K init, 202K bss, 15388K reserved, 16384K cma-reserved, 212992K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc05a7514   (5758 kB)
      .init : 0xc05a8000 - 0xc05e6000   ( 248 kB)
      .data : 0xc05e6000 - 0xc0619a20   ( 207 kB)
       .bss : 0xc0619a20 - 0xc064c290   ( 203 kB)
Preemptible hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 32.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
slcr mapped to f0800000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0800100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at f0808000, irq=18
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x8280 - 0x82b4
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
zynq-gpio e000a000.gpio: could not find pctldev for node /amba/slcr@f8000000/pinctrl@700/gpio0-default, deferring probe
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
phy0 supply vcc not found, using dummy regulator
phy1 supply vcc not found, using dummy regulator
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 23, base_baud = 3125000) is a xuartps
console [ttyPS0] enabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f08ac000
xdevcfg f8007000.devcfg: fclk not found
brd: module loaded
loop: module loaded
m25p80 spi32766.0: unrecognized JEDEC id bytes: 10, 33,  0
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 34 (04:4f:8b:00:1c:09)
macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1318S] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 100 kHz mmio e0004000 irq 38
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-arasan e0101000.sdhci: No vmmc regulator found
sdhci-arasan e0101000.sdhci: No vqmmc regulator found
mmc0: Invalid maximum block size, assuming 512 bytes
mmc0: SDHCI controller on e0101000.sdhci [e0101000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
Unable to handle kernel paging request at virtual address 001e8840
pgd = c0004000
[001e8840] *pgd=00000000
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.4.0-xlnx #1
Hardware name: Xilinx Zynq Platform
task: ef0299c0 ti: ef04e000 task.ti: ef04e000
PC is at strnlen+0x1c/0x30
LR is at string+0x30/0xd8
pc : [<c01c4bb4>]    lr : [<c01c59fc>]    psr: 20000113
sp : ef04fcf0  ip : 00000000  fp : ef04fd20
r10: 00000000  r9 : 00000000  r8 : c0542354
r7 : 001e8840  r6 : 00000000  r5 : 0000ffff  r4 : 00000000
r3 : 001e8840  r2 : 001e8840  r1 : 001e883f  r0 : 001e8840
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 18c5387d  Table: 0000404a  DAC: 00000051
Process swapper/0 (pid: 1, stack limit = 0xef04e210)
Stack: (0xef04fcf0 to 0xef050000)
fce0:                                     ff0a0004 ef04fd80 00000000 ef04fd84
fd00: 00000000 c01c72c8 00000000 ff0a0004 ffffffff ffffffff ef001080 00000001
fd20: ff0a0004 ffffffff ef000040 ef04fd80 c0542352 c0542438 c01c9598 024000c0
fd40: c030340c c0303bd0 ef21ca88 c01c94e8 024000c0 ef04fd80 ef21dc80 ef21ca88
fd60: c0542438 00000000 ef2f2554 c01c9598 024000c0 ef04fd80 c0303d14 c0542352
fd80: 001e8840 c0542438 c0542438 ef21ca88 c0303bd0 c030340c 00000006 00000000
fda0: 00000006 00000000 ef2f2400 00000000 ef21caa8 c0304020 00000006 00000000
fdc0: 00000000 ef2f2410 ef2f2554 c003d330 00000100 ef2f2400 ef21ca88 00000000
fde0: 00000000 00000014 00000009 00000002 00000000 c030423c 00000030 00000000
fe00: 00000042 c030801c ef2f2600 00000042 00000030 ef2f269c ef2f2600 ef2f2400
fe20: ef2f269c ef0c7000 ef2f2600 ef2f262a 00000000 00000010 00000000 c030931c
fe40: ef0c64c0 ef2f2400 ef04fe64 0000002a 00000000 ef832fd0 00000001 ef20b268
fe60: ef20b1c8 00000000 ef0c8678 ef0c7010 c06120d8 00000000 c06120d8 00000000
fe80: 00000000 00000000 00000000 c0218b48 c0218b10 ef0c7010 c063fef8 c02176ec
fea0: ef0c7010 ef0c7044 c06120d8 00000000 00000000 c02178b8 00000000 c06120d8
fec0: c0217850 c021600c ef09df5c ef0c0a34 c06120d8 ef2b7c80 c05fb680 c0216f7c
fee0: c0542852 c0542852 00000000 c06120d8 c05eb9e0 c05c6c80 c05dfd18 c0217e5c
ff00: c02186c0 ef1a2f80 c05eb9e0 c0009704 ef099b80 c010b0d4 ef099b80 c041a518
ff20: c0622500 c010b2d8 00000000 efffc22b 00000000 c0037170 00000000 c057d714
ff40: c057cb70 00000095 00000006 00000006 c05ee840 00000006 c05d582c c0619a40
ff60: 00000006 c05d5830 c0619a40 c05dfd18 00000095 c05a8d48 00000006 00000006
ff80: 00000000 c05a84f4 00000000 00000000 00000000 c04105dc 00000000 00000000
ffa0: 00000000 c04105e4 00000000 c000eeb8 00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 278c9001 c522cf90
[<c01c4bb4>] (strnlen) from [<c01c59fc>] (string+0x30/0xd8)
[<c01c59fc>] (string) from [<c01c72c8>] (vsnprintf+0x17c/0x2e8)
[<c01c72c8>] (vsnprintf) from [<c01c94e8>] (kvasprintf+0x2c/0x64)
[<c01c94e8>] (kvasprintf) from [<c01c9598>] (kasprintf+0x18/0x28)
[<c01c9598>] (kasprintf) from [<c0303d14>] (__iio_add_chan_devattr+0xb8/0x34c)
[<c0303d14>] (__iio_add_chan_devattr) from [<c0304020>] (iio_device_add_info_mask_type+0x78/0xd4)
[<c0304020>] (iio_device_add_info_mask_type) from [<c030423c>] (iio_device_register+0x158/0x480)
[<c030423c>] (iio_device_register) from [<c030931c>] (xadc_probe+0x5a4/0x6ac)
[<c030931c>] (xadc_probe) from [<c0218b48>] (platform_drv_probe+0x38/0x68)
[<c0218b48>] (platform_drv_probe) from [<c02176ec>] (driver_probe_device+0xd8/0x23c)
[<c02176ec>] (driver_probe_device) from [<c02178b8>] (__driver_attach+0x68/0x8c)
[<c02178b8>] (__driver_attach) from [<c021600c>] (bus_for_each_dev+0x70/0x84)
[<c021600c>] (bus_for_each_dev) from [<c0216f7c>] (bus_add_driver+0xc4/0x1e8)
[<c0216f7c>] (bus_add_driver) from [<c0217e5c>] (driver_register+0x8c/0xd0)
[<c0217e5c>] (driver_register) from [<c0009704>] (do_one_initcall+0x104/0x18c)
[<c0009704>] (do_one_initcall) from [<c05a8d48>] (kernel_init_freeable+0x11c/0x1e8)
[<c05a8d48>] (kernel_init_freeable) from [<c04105e4>] (kernel_init+0x8/0xe4)
[<c04105e4>] (kernel_init) from [<c000eeb8>] (ret_from_fork+0x14/0x3c)
Code: e1a02003 1a000001 e0600002 e12fff1e (e5d2c000)
---[ end trace b28daf91dce47854 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D         4.4.0-xlnx #1
Hardware name: Xilinx Zynq Platform
[<c00156cc>] (unwind_backtrace) from [<c0012674>] (show_stack+0x10/0x14)
[<c0012674>] (show_stack) from [<c01bf2c8>] (dump_stack+0x8c/0xd4)
[<c01bf2c8>] (dump_stack) from [<c0013f5c>] (ipi_cpu_stop+0x3c/0x6c)
[<c0013f5c>] (ipi_cpu_stop) from [<c0014670>] (handle_IPI+0x64/0x84)
[<c0014670>] (handle_IPI) from [<c00093d8>] (gic_handle_irq+0x74/0x94)
[<c00093d8>] (gic_handle_irq) from [<c0013094>] (__irq_svc+0x54/0x90)
Exception stack(0xc05e7f38 to 0xc05e7f80)
7f20:                                                       00000000 00000000
7f40: 2f230000 ef813e80 584ed71f 00000000 5854c1b0 00000000 ef813498 00000000
7f60: 00000000 00000000 00000008 c05e7f88 c02d3e98 c02d3ebc 60000113 ffffffff
[<c0013094>] (__irq_svc) from [<c02d3ebc>] (cpuidle_enter_state+0x134/0x210)
[<c02d3ebc>] (cpuidle_enter_state) from [<c004e8c0>] (cpu_startup_entry+0x1b8/0x204)
[<c004e8c0>] (cpu_startup_entry) from [<c05a8bcc>] (start_kernel+0x33c/0x39c)
[<c05a8bcc>] (start_kernel) from [<0000807c>] (0x807c)
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b


The virtual address shown in the BUG screen is different for every boot.
The panic happens even if I remove the Epiphany and UIO parts from the device tree.

I am stuck. Have you experienced a similar problem?
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: FPGA access in Linux 4.4

Postby kirill » Mon May 09, 2016 11:26 pm

Hm, looks like one of IIO drivers (Industrial I/O) is chocking while parsing device tree. By the way I have added some more drivers to the default config as they seemed to be explicitly added to parallella config. Not sure what version of the patch you are using. Also are you using 7010 or 7020?
kirill
 
Posts: 38
Joined: Mon Sep 28, 2015 7:24 am

Re: FPGA access in Linux 4.4

Postby sebraa » Tue May 10, 2016 4:01 pm

I am a step further, but still no cake. I have just updated the patch and I am using a Zynq 7020, btw.

Removing the Xilinx XADC driver (or IIC support altogether) or removing the "xlnx,channels" subnode of the adc@f8007100 node removes the panic. So this is fixed now. Now the kernel actually reaches userspace, but hangs shortly thereafter (before doing DHCP). Sigh.

Are you using the device-tree from the Xilinx kernel? That will be my next step, but I won't have time for it today.

Doing this is way more work than I anticipated.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: FPGA access in Linux 4.4

Postby kirill » Tue May 10, 2016 10:16 pm

Well maybe you are better off trying to go the other way and add xdevcfg to the kernel that works for you.

Here is the patch it should apply cleanly against 2016.3 release. Unfortunately you can't just compile it as a module that can be used with the pre-compiled kernel because some extra functions are added to the kernel itself, so you'll need to rebuild kernel as well.

I am using devicetree from Adapteva, patched a bit to add my uio devices. Your hang is probably due to thermal service kicking in and failing in some way due to changes in kernel or device tree. See /etc/init/parallella-thermald.conf
Attachments
0001-Adding-xilinx_devconfig-driver.patch.gz
(10.14 KiB) Downloaded 540 times
kirill
 
Posts: 38
Joined: Mon Sep 28, 2015 7:24 am

Re: FPGA access in Linux 4.4

Postby sebraa » Wed May 11, 2016 1:03 pm

kirill wrote:Here is the patch it should apply cleanly against 2016.3 release.
Thank you thank you thank you! It works! :shock: Now I have a kernel with support for Epiphany, /dev/xdevcfg and /dev/uio0.

kirill wrote:Your hang is probably due to thermal service kicking in and failing in some way due to changes in kernel or device tree.
Since I use the same bitstream, the necessary logic is always present, but as far as I understand the daemon, it is only loaded if the Epiphany device is present (according to the device-tree). In any case, the daemon is not running if the Epiphany part is missing.

Thank you!
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: FPGA access in Linux 4.4

Postby olajep » Thu May 12, 2016 1:02 pm

kirill wrote:Well maybe you are better off trying to go the other way and add xdevcfg to the kernel that works for you.

Here is the patch it should apply cleanly against 2016.3 release. Unfortunately you can't just compile it as a module that can be used with the pre-compiled kernel because some extra functions are added to the kernel itself, so you'll need to rebuild kernel as well.

Thanks!

Applied here (well, I took it directly from xilinx master but same idea)
https://github.com/parallella/parallell ... nux-2016.3
https://github.com/parallella/parallell ... a0449c264c

Will go into 2016.3.1

kirill wrote:I am using devicetree from Adapteva, patched a bit to add my uio devices. Your hang is probably due to thermal service kicking in and failing in some way due to changes in kernel or device tree. See /etc/init/parallella-thermald.conf

Things changed in 2016.3. Now if the elink bitstream is missing the driver will hang in the probe function. You need to disable the elink in the device tree, either comment it out or add
Code: Select all
status = "disabled";


// Ola
_start = 266470723;
olajep
 
Posts: 140
Joined: Mon Dec 17, 2012 3:24 am
Location: Sweden

Next

Return to FPGA Design

Who is online

Users browsing this forum: No registered users and 1 guest

cron