Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Xilinx SOC AARCH64 ARM64 Embedded Boot To SATA
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Mon May 29, 2023 5:28 pm    Post subject: Xilinx SOC AARCH64 ARM64 Embedded Boot To SATA Reply with quote

I'm installing Gentoo on a Xilinx SOC FPGA development board to make it easier to develop code.

I'm not ready yet to deal with peta-linux. I mean it works, but it's a pita-linux.

u-boot (from peta-linux) on this development board is not up to snuff. For example, the built in MMC had a boot image installed, which is great, but I stopped it at boot, dropped to a u-boot prompt and did a 'saveenv' (to eliminate the corrupt environment error message at boot) and that corrupted the peta-linux boot image which won't boot anymore. I'll replace it with the image I built with peta-linux once I get Gentoo running properly.

Right now I'm booting a huge peta-linux BASE image from SDCard that is from Feb of 2022. I have a gentoo base install on a SATA NVMe which reads at hdparm -tT speeds of 300 MB/Second, pretty good, right?

But I have no idea how to make it boot from SATA. The dev board doesn't have a boot from SATA option and since I can't save the u-boot environmental variables, I'll have to do a manual load every time I boot, which is less than user friendly.

I'm thinking I'm going to have to do a special u-boot whose env vars work. It has to be done eventually anyway, but I was hoping since I'm going to be doing more software and firmware development on this board in the beginning if someone could help me find a short cut to booting gentoo from the SATA NVMe.

That's long, thanks for reading!
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Tue May 30, 2023 2:02 pm    Post subject: Reply with quote

RayDude,

There is a difference between 'boot from' and 'boot to'

Boot from places a requirement on the firmware to be able to read from the desired device.
Its game over if the firmware does not do what you want.

I read 'boot to' as a requirement on the kernel to mount root from the desired device.
That needs kernel and possibly initrd support. That's much easier as its mostly under your control.

There is a half way house too. Consider a boot leader that keeps the firmware happy but all it does is load another boot loader that is easier to manipulate.

e.g. early Raspberry Pis can only boot from the SD card but root can be anywhere the kernel can see. USB, NFS, even the SD card.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Wed May 31, 2023 9:32 pm    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

There is a difference between 'boot from' and 'boot to'

Boot from places a requirement on the firmware to be able to read from the desired device.
Its game over if the firmware does not do what you want.

I read 'boot to' as a requirement on the kernel to mount root from the desired device.
That needs kernel and possibly initrd support. That's much easier as its mostly under your control.

There is a half way house too. Consider a boot leader that keeps the firmware happy but all it does is load another boot loader that is easier to manipulate.

e.g. early Raspberry Pis can only boot from the SD card but root can be anywhere the kernel can see. USB, NFS, even the SD card.


Thanks Neddy!

I have made some progress. The SATA Drive is recognized in u-boot (as SCSI) and there are default options for booting from it. I can't save the environment, but I should be able to break into u-boot and tell it to attempt to boot from SATA.

All I need to do is figure out what format to use on the boot partition. I checked into EFI bootstrapping and ... It's complicated.

The easiest way is for u-boot to generate a boot.scr boot script that loads the dtb, the kernel and then boots. I'm currently figuring out how to do that and what it will take to change the "petalinux" yocto bb files to generate it automagically.

And once I get control of u-boot I can specialize it for the QSPI and make it so the environment variables can be saved.

Its a huge learning curve but I'll get there.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Jun 01, 2023 10:02 pm    Post subject: Reply with quote

Hi Neddy,

I got it to boot by creating an extlinux.conf file and forcing u-boot to run bootcmd_scsi0.

But it's hanging, here's a log:

I seem to remember something like this from amd64, but it's been a long time... Any ideas what I borked or failed to do?

Code:
ZynqMP> run bootcmd_scsi0

Device 0: (1:0) Vendor: ATA Prod.: Samsung SSD 850 Rev: EMT0
            Type: Hard Disk
            Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)
... is now current device
Scanning scsi 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1:      Gentoo
Retrieving file: /extlinux/vmlinuz
append:  quiet root=/dev/sda3 rw rootwait rootfstype=ext4 console=ttyPS0,115200n8
Retrieving file: /extlinux/zynqmp.dtb
## Flattened Device Tree blob at 40000000
   Booting using the fdt blob at 0x40000000
   Loading Device Tree to 000000007bbef000, end 000000007bbf8952 ... OK

Starting kernel ...

[    0.297032] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.256590] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: set mux failed for pin 24
[    1.264554] xilinx_can ff070000.can: Error applying setting, reverse things back
[    1.272000]  domain6: domain6 request failed for node 48: -13
[    1.277745] xilinx_can ff070000.can: error -EACCES: failed to add to PM domain domain6
[    1.315642] pca953x 0-0020: failed writing register
INIT: version 3.06 booting

   OpenRC 0.46 is starting up Gentoo Linux (aarch64)

 * Mounting /proc ...
 [ ok ]
 * Mounting /run ...
 * /run/openrc: creating directory
 * /run/lock: creating directory
 * /run/lock: correcting owner
 * Caching service dependencies ...
 [ ok ]
 * Mounting /sys ...
 [ ok ]
 * Mounting debug filesystem ...
 [ ok ]
 * Mounting config filesystem ...
 [ ok ]
 * Mounting fuse control filesystem ...
 [ ok ]
 * Mounting cgroup filesystem ...
 [ ok ]
 * Remounting devtmpfs on /dev ...
 [ ok ]
 * Mounting /dev/mqueue ...
 [ ok ]
 * Mounting /dev/pts ...
 [ ok ]
 * Mounting /dev/shm ...
 [ ok ]
 * Creating list of required static device nodes for the current kernel ...
 [ ok ]
 * Create Static Devices Nodes in /dev ...
 [ ok ]
 * Starting udev ...
 [ ok ]
 * Generating a rule to create a /dev/root symlink ...
 [ ok ]
 * Populating /dev with existing devices through uevents ...
 [ ok ]
 * Setting system clock using the hardware clock [UTC] ...
 [ ok ]
 * Loading custom binary format handlers ...
 [ ok ]
 * Checking local filesystems  ...
fsck.fat 4.2 (2021-01-31)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
  65:01/00
  Not automatically fixing this.
Label '' stored in boot sector is not valid.
  Auto-removing label from boot sector.
Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
 Automatically removing dirty bit.

*** Filesystem was changed ***
Writing changes.
/dev/sda1: 6 files, 6457/127749 clusters
 * Filesystems repaired
 [ !! ]
 * Remounting filesystems ...
 [ ok ]
 * Updating /etc/mtab ...
 * Creating mtab symbolic link
 [ ok ]
 * Activating swap devices ...
swapon: /dev/sda2: swap format pagesize does not match. (Use --fixpgsz to reinitialize it.)
swapon: /dev/sda2: swapon failed: Invalid argument
 [ ok ]
 * Mounting local filesystems ...
 [ ok ]
 * Configuring kernel parameters ...
 [ ok ]
 * Creating user login records ...
 [ ok ]
 * Wiping /tmp directory ...
 [ ok ]
 * Setting hostname to ultrazed from /etc/hostname ...
 [ ok ]
 * Setting terminal encoding [UTF-8] ...
 [ ok ]
 * Setting keyboard mode [UTF-8] ...
 [ ok ]
 * Loading key mappings [us] ...
 [ ok ]
 * Bringing up network interface lo ...
 [ ok ]
 * Saving key mapping ...
 [ ok ]
 * Saving terminal encoding ...
 [ ok ]
 * Seeding random number generator ...
 * Saving 256 bits of non-creditable seed for next boot
 [ ok ]
 * Create Volatile Files and Directories ...
 [ ok ]
INIT: Entering runlevel: 3
 * Checking your configfile (/etc/syslog-ng/syslog-ng.conf) ...
 [ ok ]
 * /var/lib/syslog-ng: correcting mode
 * Starting syslog-ng ...
 [ ok ]
 * Starting cronie ...
 [ ok ]
 * Starting DHCP Client Daemon ...
 [ ok ]
 * Mounting network filesystems ...
 [ ok ]
 * Starting local ...
 [ ok ]
INIT: Id "f0" respawning too fast: disabled for 5 minutes

_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Jun 01, 2023 10:35 pm    Post subject: Reply with quote

Update. I remembered. /etc/inittab:

s0:12345:respawn:/sbin/agetty -L 115200 ttyPS0 vt100

It announces that it's up and gives me a login prompt but does not accept key input...
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Fri Jun 02, 2023 5:04 pm    Post subject: Reply with quote

RayDude,

You have a bit missing from the kernel but you are getting there. :)

How is the keyboard connected?
What kernel version are you using?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Sat Jun 03, 2023 4:10 am    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

You have a bit missing from the kernel but you are getting there. :)

How is the keyboard connected?
What kernel version are you using?


Thanks! Here's an update:

I realized studying the avnet kernel that comes with petalinux that I'm missing some drivers for the console, I enabled those, but when I went through and compared the stock 6.3.4 kernel with the avnet version from last year some time, I realized that there are xilinx patches to the kernel for features of the xilinx part.

Which will likely give me hassles later.

So I downloaded the latest xilinx kernel linux-xlnx and copied the config from avnet's kernel and compiled it. Then added a driver I needed and compilation broke. I disabled the driver and compilation stayed broke... make disclean, cp .config from elsewhere and make -j4 probably would have worked, but it's too slow.

So I'm targzing the kernel to copy over to my laptop to cross compile it, because doing it on ARM takes too long.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Sat Jun 03, 2023 8:03 am    Post subject: Reply with quote

RayDude,

Moved from Other Things Gentoo to Gentoo on ARM.
Its one of these.

When that Xilinx SOC works, add it to the ARM hardware list.
Maybe donate a Wiki page too, in case you need to do it again :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Sun Jun 11, 2023 7:16 am    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

Moved from Other Things Gentoo to Gentoo on ARM.
Its one of these.

When that Xilinx SOC works, add it to the ARM hardware list.
Maybe donate a Wiki page too, in case you need to do it again :)


I'll do that. Thanks for the link.

I got it booting okay (I created a syslinux, "/boot/extlinux/extlinux.conf" file, then on boot I break into u-boot and type, 'run bootcmd_scsi0'). Running emerge -DNuq for the first time right now.

But I'm using u-boot from the board and the kernel that builds with yocto. (haven't built my own yet). u-boot can't save env variables. Blech.

I have a gentoo kernel working, but it's missing components... I still can't find the config file they are using, when I copied the one directly from the kernel, what I got was literally ever driver as a module... I know that's not right. Plus the kernel itself was 230 MB... I know that's not right... Reverse engineering is ... time consuming.

Everything Xilinx has, source code wise, is patched up the wazoo I think.

I'm going to attempt to do what I did with Altera SOC FPGAs and generate a patch file for u-boot and the kernel, but it's going to require a lot of digging and I haven't had the time yet.

Kernel is first. Less likely to brick it that way.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Tue Jul 04, 2023 9:31 pm    Post subject: Reply with quote

Update.

I have been trying to get the PCI x1 port to work. I need it to work for my hobby project. I have not been able to get it to work even with avnets flash images.

The card I plug in is not seen, does not train, etc etc etc.

I finished checking that the reset_n signal to the PCIE port is high as it should be and the wake_n signal is low as it is supposed to be.

Then I realized after looking at this board for months that I was plugging the display port connector into the wrong port.

I thought, "well that explains why video doesn't work. Who knew they put a display port out on the fpga side of the device."

So I plugged in the proper display port and tried to bring up video.

Not a single image from avnet worked. startx looked like it was running, but the video only flickered on and off about once every 20 seconds.

I had all but given up and I thought, why not try booting gentoo...

So I booted off the Gentoo SATA SSD and boom, video is up on a console with a login prompt.

GOOD OLD GENTOO!

Now if I could get the usb port to work I could plug in a keyboard...

Wow. This is like pulling your own teeth with tweezers.

Anyway.

GOOD OLD GENTOO!
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Tue Jul 04, 2023 10:02 pm    Post subject: Reply with quote

Hi Neddy.

My display hardware is being detected by the kernel and initialized, but I have no idea what it is, nor do I have any idea what VIDEO_CARDS should be set to. fbdev does not work.

I'm not even sure that gentoo supports this hardware...

Code:

[    1.296669] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA engine is probed
[    1.297689] zynqmp-display fd4a0000.display: vtc bridge property not present
[    1.300325] xilinx-dp-snd-codec fd4a0000.display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
[    1.300583] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    1.300825] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    1.301872] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
[    1.301976] OF: graph: no port node found in /axi/display@fd4a0000
[    1.308521] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops 0xffff800008f352a8)
[    1.448308] Console: switching to colour frame buffer device 240x67
[    1.473733] zynqmp-display fd4a0000.display: [drm] fb0: xlnxdrmfb frame buffer device
[    1.473993] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display on minor 0
[    1.474022] zynqmp-display fd4a0000.display: ZynqMP DisplayPort Subsystem driver probed


Any idea what I need to do?

(and no USB and PCIe are still not working)
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Sat Jul 08, 2023 6:06 pm    Post subject: Reply with quote

RayDude,

Code:
[    1.473733] zynqmp-display fd4a0000.display: [drm] fb0: xlnxdrmfb frame buffer device

Its using xlnxdrmfb for the framebuffer.

It probably needs VIDEO_CARDS=" fbdev" unless there is an out of tree xlnxdrmfb dliver for Xorg.
Putting xlnxdrmfb into search engine finds a few hits. Some are Xilinx too.

VIDEO_CARDS will not be used unless you plan to use Xorg.

When you built the gentoo kernel, where did you get the *dtb file from?
It should be built with the kernel.
There is a wide selection of Device Tree Sources in /usr/src/linux-6.2.5-gentoo/arch/arm64/boot/dts/xilinx/

If the PCIe and USB were missing from that, they would not work, or the address etc were wrong ...

There is lots in the kernel for xilinx PCI and USB. What hardware do you have and what USB/PCI chip sets do your need to drive?
The concept of 'chip set' includes something like the Desgnware2/3 IP that may be built into the FPGA, so you cannot read the numbers on the chips.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Tue Jul 11, 2023 11:17 pm    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

Code:
[    1.473733] zynqmp-display fd4a0000.display: [drm] fb0: xlnxdrmfb frame buffer device

Its using xlnxdrmfb for the framebuffer.

It probably needs VIDEO_CARDS=" fbdev" unless there is an out of tree xlnxdrmfb dliver for Xorg.
Putting xlnxdrmfb into search engine finds a few hits. Some are Xilinx too.

VIDEO_CARDS will not be used unless you plan to use Xorg.

When you built the gentoo kernel, where did you get the *dtb file from?
It should be built with the kernel.
There is a wide selection of Device Tree Sources in /usr/src/linux-6.2.5-gentoo/arch/arm64/boot/dts/xilinx/

If the PCIe and USB were missing from that, they would not work, or the address etc were wrong ...

There is lots in the kernel for xilinx PCI and USB. What hardware do you have and what USB/PCI chip sets do your need to drive?
The concept of 'chip set' includes something like the Desgnware2/3 IP that may be built into the FPGA, so you cannot read the numbers on the chips.


Thanks so much Neddy.

I'm at frustration level 100 at the moment.

I'm using a custom kernel from xilinx based on 6.1.0 and I'm using a custom dtb generated by tools from xilinx and avnet. I hvae double checked the dts file to ensure that the pci and usb drivers are getting the right addresses based on a couple of sources, but since I have no workin example I can't be sure about anything. I probably should check the documentation to see if it matches. I just find it hard to believe that avnet would ship example boot files that don't work.

The only thing I haven't double checked (that I can think of) is the pins. It's possible the USB and PCIe X1 pins have been swapped for some reason on the board I'm using.

I have VIDEO_CARD="fbdev" specified, but when I type startx nothing happens. It feels like I'm missing something. I haven't done a minimal X implementation in a while.

I will eventually need X working to display graphics, so when I get some gumption I'll continue to play with that.

I really need USB and PCIe to work though.

The out of box examples built specifically for this board do not recognize the USB or PCIe either so I've got a bad board (which seems unlikely) or a configuration on the board is wrong (but I checked the USB jumpers and I think they are correct) or something else is going on.

I'll post updates as I persue getting this to work. I'm really hoping to isolate the kernel changes necessary as well as the u-boot changes.

Thanks for listening!
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Wed Jul 12, 2023 6:29 am    Post subject: Reply with quote

Update: USB is working with the example SOC configuration.

I diffed my config and their config and found USB DWC is disabled in mine.

Why?

Because there is a compile error with it enabled. I didn't realize it was important and disabled it over a month ago to get the kernel to compile.

Now I have to debug the kernel. Not my first rodeo, but I'm viscously slow at it.

Code:
ld: Unexpected GOT/PLT entries detected!
ld: Unexpected run-time procedure linkages detected!
ld: ID map text too big or misaligned
  CC [M]  drivers/mtd/tests/mtd_speedtest.mod.o
  CC [M]  drivers/mtd/tests/mtd_stresstest.mod.o
  CC [M]  drivers/mtd/tests/mtd_subpagetest.mod.o
ld: drivers/usb/dwc3/core.o: in function `dwc3_suspend_common':
/usr/src/linux/drivers/usb/dwc3/core.c:2168: undefined reference to `ulpi_write'
ld: drivers/usb/dwc3/core.o: in function `dwc3_resume_common':
/usr/src/linux/drivers/usb/dwc3/core.c:2252: undefined reference to `ulpi_write'
make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [Makefile:1236: vmlinux] Error 2
make: *** Waiting for unfinished jobs....


Edit: For those who find this searching the internet. There is a missing dependency that can be worked around by enabling ULPI in the USB section.

Code:
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_DWC3_ULPI=y


USB is working on my build of the xilinx kernel.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Jul 13, 2023 1:32 am    Post subject: Reply with quote

It's so weird. Last night in the wee hours I got USB working. I had video coming out of the display port with a text console that was working.

Today, when I powered up, it stopped working.

Inconsistency is the bane of all engineering work.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Jul 13, 2023 1:56 am    Post subject: Reply with quote

Okay. The Xilinx SOC does not like the DisplayPort to HDMI converter I have.

If I power up with the DisplayPort connected to my 4K monitor I get video.

The xorg log indicates that fbdev is not necessary and unloads it:

Code:
[   232.680] (II) modeset(0): Output DP-1 connected
[   232.680] (II) modeset(0): Using exact sizes for initial modes
[   232.680] (II) modeset(0): Output DP-1 using initial mode 1920x1080 +0+0
[   232.680] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[   232.680] (==) modeset(0): DPI set to (96, 96)
[   232.680] (II) Loading sub module "fb"
[   232.680] (II) LoadModule: "fb"
[   232.680] (II) Module "fb" already built-in
[   232.680] (II) UnloadModule: "fbdev"
[   232.680] (II) Unloading fbdev
[   232.680] (II) UnloadSubModule: "fbdevhw"
[   232.680] (II) Unloading fbdevhw



Later, I get this crash in Xorg.0.log:

Code:
[   232.755] (EE)
[   232.755] (EE) Backtrace:
[   232.756] (EE) 0: /usr/libexec/Xorg (xorg_backtrace+0x5c) [0xaaaacfdf782c]
[   232.756] (EE) 1: /usr/libexec/Xorg (0xaaaacfcc0000+0x13b6f8) [0xaaaacfdfb6f8]
[   232.756] (EE) 2: linux-vdso.so.1 (__kernel_rt_sigreturn+0x0) [0xffff9a8667ac/var/log/Xorg.0.log lines 210-231/2]
[   232.756] (EE) 3: /usr/lib64/xorg/modules/drivers/modesetting_drv.so (0xffff9/var/log/Xorg.0.log lines 212-232/29710000+0x12628) [0xffff99722628]
[   232.756] (EE) 4: /usr/lib64/xorg/modules/drivers/modesetting_drv.so (0xffff9/var/log/Xorg.0.log lines 214-233/29710000+0x12288) [0xffff99722288]
[   232.756] (EE) 5: /usr/lib64/xorg/modules/drivers/modesetting_drv.so (0xffff9/var/log/Xorg.0.log lines 216-234/29710000+0x91c8) [0xffff997191c8]
[   232.756] (EE) 6: /usr/libexec/Xorg (0xaaaacfcc0000+0x17a3cc) [0xaaaacfe3a3cc/var/log/Xorg.0.log lines 218-235/2]
[   232.756] (EE) 7: /usr/libexec/Xorg (0xaaaacfcc0000+0x77c8c) [0xaaaacfd37c8c]
[   232.757] (EE) 8: /lib64/libc.so.6 (0xffff99ed0000+0x26a80) [0xffff99ef6a80]
[   232.757] (EE) 9: /lib64/libc.so.6 (__libc_start_main+0x98) [0xffff99ef6b58]
[   232.757] (EE) 10: /usr/libexec/Xorg (_start+0x30) [0xaaaacfd013b0]
[   232.757] (EE)
[   232.757] (EE) Segmentation fault at address 0x8
[   232.757] (EE)
Fatal server error:
[   232.757] (EE) Caught signal 11 (Segmentation fault). Server aborting
[   232.757] (EE)
[   232.757] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[   232.757] (EE) Please also check the log file at "/var/log/Xorg.0.log" for ad/var/log/Xorg.0.log lines 232-250/2ditional information.
[   232.757] (EE)
[   232.770] (EE) Server terminated with error (1). Closing log file
.

Any ideas?
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Jul 13, 2023 5:14 pm    Post subject: Reply with quote

Update.

Sometimes the display works and sometimes it doesn't.

Here's dmesg when it doesn't:

Code:
[    1.296532] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA engine is probed
[    1.297565] zynqmp-display fd4a0000.display: vtc bridge property not present
[    1.300217] xilinx-dp-snd-codec fd4a0000.display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
[    1.300489] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    1.300738] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    1.301785] xilinx-dp-snd-card fd4a0000.display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
[    1.301891] OF: graph: no port node found in /axi/display@fd4a0000
[    1.308444] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops 0xffff800008f55458)
[    1.457588] zynqmp-display fd4a0000.display: failed to configure link values
[    1.457594] zynqmp-display fd4a0000.display: failed to train the DP link
[    1.464889] Console: switching to colour frame buffer device 240x67
[    1.504053] zynqmp-display fd4a0000.display: [drm] fb0: xlnxdrmfb frame buffer device
[    1.504304] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display on minor 0
[    1.504331] zynqmp-display fd4a0000.display: ZynqMP DisplayPort Subsystem driver probed


A warm boot seems to fix it. Or perhaps it's just a roll of the dice.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Sat Jul 15, 2023 11:19 pm    Post subject: Reply with quote

The Xilinx hacked kernel is a bit of a mess.

The video output of the board works once in a while, but mostly it does not work.

I have not been able to find a way to make it work every time.

I've convinced myself that the hacked kernel has a race condition

So I decided to turn the Xilinx video out driver into a module so I can load it later and debug it with printf statements or maybe gdb if possible.

But the kernel won't build the Xilinx displayport drivers as modules because the code itself is incomplete.

I had to add MODULE_LICENSE to three source files and I had to add SYMBOL_EXPORT to roughly 60 functions.

Now I get these error messages:

Code:
  LD [M]  drivers/gpu/drm/xlnx/zynqmp-dpsub.ko
  LD      .tmp_vmlinux.kallsyms1
ld: Unexpected GOT/PLT entries detected!
ld: Unexpected run-time procedure linkages detected!
ld: ID map text too big or misaligned
ld: drivers/gpu/drm/display/drm_dp_mst_topology.o: in function `drm_dp_mst_duplicate_state':
/usr/src/linux/drivers/gpu/drm/display/drm_dp_mst_topology.c:4951: undefined reference to `__drm_atomic_helper_private_obj_duplicate_state'
ld: drivers/gpu/drm/display/drm_dp_mst_topology.o: in function `drm_dp_delayed_destroy_work':
/usr/src/linux/drivers/gpu/drm/display/drm_dp_mst_topology.c:4937: undefined reference to `drm_kms_helper_hotplug_event'
ld: drivers/gpu/drm/display/drm_dp_mst_topology.o: in function `drm_dp_mst_up_req_work':
/usr/src/linux/drivers/gpu/drm/display/drm_dp_mst_topology.c:3979: undefined reference to `drm_kms_helper_hotplug_event'
ld: drivers/gpu/drm/display/drm_dp_mst_topology.o: in function `drm_dp_mst_link_probe_work':
/usr/src/linux/drivers/gpu/drm/display/drm_dp_mst_topology.c:2689: undefined reference to `drm_kms_helper_hotplug_event'
make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [Makefile:1236: vmlinux] Error 2


I have checked, the .h files for those defines are included in the source code mentioned and those functions do exist and are compiled.

I have no idea why the linker is not finding the symbols.

I tried adding SYMBOL_EXPORT() for those symbols but that made matters worse, not better.

Does anyone know how to debug this? I'm lost and google is not giving me any clues either.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Aug 03, 2023 9:14 pm    Post subject: Reply with quote

Update.

I have the display port driver loading as a module, but that didn't help.

I found a thread on a Xilinx forum about the issue with display port. The problem is: the display port on this dev board only supports one lane of SERDES and the 4K monitor I have requires 2 lanes to run native. The monitor says: I can do 4K and the linux driver attempts 4K and then it doesn't work because a lane is missing. I think the driver should be smarter than that, but I can't blame them, it's an unusual board.

Since the linux driver does not know to limit to a lower resolution / refresh rate, it attempts to connect at 4K-60 and because one line is missing the display gets really confused which accounts for it syncing with no video for a moment, then going to sleep then repeating ad-infinitum.

I either need another monitor that can do just one lane display port, which I don't have. Or I need someway to tell the driver to force 1080p which will work as I've seen it working through some quirk of playing with a DP to HDMI adapter I have.

I also have my own dts working. It's just a hack of an existing one for the 6.4.2 kernel that I adjusted to support this board. The big trick was to assume that u-boot set the pin muxes and GPIO correctly and not let the dts adjust them based on the file I copied, because pinctrl is completely different for this board, compared to the ZCU-104 I copied. I just commented out all the pin configuration stuff and features started working.

USB is up and running.

PCIe is still not working. I suspect that's because u-boot is not correctly configuring GPIO for reset / interrupt / something else or serdes for the single PCIe lane.

Debugging that is going to take time as I have to reverse engineer how it's connected on the board and then learn how to configure the pinmuxes and gpios.

I've been putting that off for long enough I guess.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Fri Aug 04, 2023 5:21 pm    Post subject: Reply with quote

RayDude,

You can force any ramdom display mode you want.

For the console, its a kernel command line thing.
For Xorg its a xor.conf.d/ fragment.

Connect the display somewhere where it works and post the entire Xorg.0.log file please.
I'm looking for the part that lists the modes that the display supports.
Being lazy, pick one and turn it into a modeline for Xorg.

You should be able to gen 4k at 30Hz but that may be a bit ugly.
If you can see the flicker, it will give you headaches. It might even if you can't notice the flicker.

From my display I get.
Code:
[    81.193] (II) AMDGPU(0): Printing probed modes for output DisplayPort-2
[    81.193] (II) AMDGPU(0): Modeline "3840x2160"x60.0  533.25  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync (133.3 kHz eP)
[    81.193] (II) AMDGPU(0): Modeline "3840x2160"x30.0  262.75  3840 3888 3920 4000  2160 2163 2168 2191 +hsync +vsync (65.7 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "3840x2160"x24.0  209.75  3840 3888 3920 4000  2160 2163 2168 2185 +hsync -vsync (52.4 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "2560x1440"x60.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync (88.8 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1920x1200"x60.0  533.25  1920 3888 3920 4000  1200 2163 2168 2222 +hsync -vsync (133.3 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "2048x1080"x60.0  147.17  2048 2096 2128 2208  1080 1083 1093 1111 +hsync -vsync (66.7 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 -hsync -vsync (67.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1920x1080"x50.0  148.50  1920 2448 2492 2640  1080 1084 1089 1125 +hsync +vsync (56.2 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1920x1080"x59.9  148.35  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.4 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1600x1200"x60.0  533.25  1600 3888 3920 4000  1200 2163 2168 2222 +hsync -vsync (133.3 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1680x1050"x60.0  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync (65.3 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1280x1024"x75.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1280x1024"x60.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1440x900"x75.0  136.75  1440 1536 1688 1936  900 903 909 942 -hsync +vsync (70.6 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1440x900"x59.9  106.50  1440 1520 1672 1904  900 903 909 934 -hsync +vsync (55.9 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1280x960"x60.0  108.00  1280 1376 1488 1800  960 961 964 1000 +hsync +vsync (60.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1280x800"x60.0  533.25  1280 3888 3920 4000  800 2163 2168 2222 +hsync -vsync (133.3 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1280x720"x60.0   74.25  1280 1390 1430 1650  720 725 730 750 +hsync +vsync (45.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1280x720"x59.9   74.18  1280 1390 1430 1650  720 725 730 750 +hsync +vsync (45.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1024x768"x75.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "800x600"x75.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "720x576"x50.0   27.00  720 732 796 864  576 581 586 625 -hsync -vsync (31.2 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "720x480"x60.0   27.03  720 736 798 858  480 489 495 525 -hsync -vsync (31.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "720x480"x59.9   27.00  720 736 798 858  480 489 495 525 -hsync -vsync (31.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "640x480"x75.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "640x480"x72.8   31.50  640 664 704 832  480 489 492 520 -hsync -vsync (37.9 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "640x480"x66.7   30.24  640 704 768 864  480 483 486 525 -hsync -vsync (35.0 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "640x480"x60.0   25.20  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[    81.193] (II) AMDGPU(0): Modeline "720x400"x70.1   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Mon Aug 07, 2023 12:11 am    Post subject: Reply with quote

Thanks Neddy.

I'm getting there. I learned how the psgtr driver works on modern linux kernels.

It doesn't actually seem to do anything though so I'm not sure if I wasted my time as the kernel seems to ignore any phy="" command I give it.

But I was able to determine how to get my monitor to work with the single lane DisplayPort.

The secret is to leave the monitor off until it goes to sleep, then boot the Xilinx board. The display will initialize properly then.

If you don't wait, I think the monitor and the board never really understand that there is only one lane.

I have X up and running on the example linux build. It's just a matter of time before I get my dts file working.

Its too bad that avnet hasn't updated their example builds to use a later version of the kernel, it would have saved me a lot of time.

I will not run a 5.15 kernel and be stuck there, I just can't do it.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Tue Sep 05, 2023 8:46 pm    Post subject: Reply with quote

I don't know if anyone is still following this thread, but I can't get debug information from the kernel.

I followed several guides to configure the kernel, set logging levels as high as possible, but I still am not seeing anything on the console, in dmesg or in syslog...

None of the debug messages are showing up.

I have dynamic debug enabled, I'm passing the debug parameter to the kernel.

I set the default debug levels as high as possible and I even set printk to 7 and 8 trying to get some form of message from the kernel, but nothing happens, it's as if the debug features were turned off.

Based on googling about it looks like aarch64 supports dynamic debug.

I guess I'll just have to change all the dev_dbg and dev_err messages to printk, in the source code like I did a couple years ago debugging altera Cyclone III PCI.

Unless you guys can save me the hassle...

*crosses fingers*
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Wed Sep 06, 2023 3:52 pm    Post subject: Reply with quote

RayDude,

I'm following but you are way out of my comfort zone.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Wed Sep 06, 2023 5:08 pm    Post subject: Reply with quote

RayDude,

I don't know much of kernel debugging, but I think you can control how printk work by changing value in /proc/sys/kernel/printk

You can check the current console_loglevel with:
Code:
$ cat /proc/sys/kernel/printk
4        4        1        7
The result shows the current, default, minimum and boot-time-default log levels.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2066
Location: San Jose, CA

PostPosted: Thu Sep 07, 2023 1:28 am    Post subject: Reply with quote

pingtoo wrote:
RayDude,

I don't know much of kernel debugging, but I think you can control how printk work by changing value in /proc/sys/kernel/printk

You can check the current console_loglevel with:
Code:
$ cat /proc/sys/kernel/printk
4        4        1        7
The result shows the current, default, minimum and boot-time-default log levels.


Thanks I have monkeyed with this, unloaded the display port driver and reloaded it and nothing appears in syslog, console, or dmesg...
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum