Jump to content

mrcorcoran

Members
  • Posts

    2
  • Joined

  • Last visited

mrcorcoran's Achievements

  1. Figured it out on my own: Solution: Debugging requires changing the kernel itself to provide more startup information, which is described in https://www.fpgadeveloper.com/how-to-patch-petalinux/ The only difference is using the Petalinux 2022.1 sdk, so requires a different branch to be checked out. There is a note in the afformentioned article which describes where to find the appropriate rebase branch by looking at the appropriate petalinux release notes. For Petalinux 2022.1, it is xlnx_rebase_v5.15_LTS based on https://support.xilinx.com/s/article/000033799?language=en_US. Essentially, the only change I made was in the parser code, in drivers/mtd/parsers/ofpart_core.c, to change the pr_debug messages to pr_err so they show during the kernel booting. This led to more information: spi-nor spi0.0: s25fl128s1 (16384 Kbytes) spi0.0: 'partitions' subnode not found on /axi/spi@e000d000/flash@0. Trying to parse direct subnodes as partitions. spi0.0: ofpart partition /axi/spi@e000d000/flash@0/partition@0 (/axi/spi@e000d000/flash@0) error parsing reg property. spi0.0: error parsing ofpart partition /axi/spi@e000d000/flash@0/partition@0 (/axi/spi@e000d000/flash@0) Looking at the ofpart_core.c code, these messages only happen for the following peice of code: if (len / 4 != a_cells + s_cells) { pr_err("%s: ofpart partition %pOF (%pOF) error parsing reg property.\n", master->name, pp, mtd_node); ... } After further debugging, it was found that "len" was taking a value of 8. To do this I added this line: pr_err("%s: ofpart partition %pOF (%pOF) info-- reg: 0x%x, len %d, a_cells %d, s_cells %d.\n", master->name, pp, mtd_node, reg, len, a_cells, s_cells ); Since system-conf.dtsi defines a_cells as 1 and s_cells as 0, the if statement above evaluates to true since 8/4 should be 2. So to fix this, I overload the bindings and make #size-cells 1. &flash0 { compatible = "s25fl128s1", "jedec,spi-nor"; reg = <0>; #address-cells = <1>; // <------------ #size-cells = <1>; // <------------ spi-tx-bus-width = <1>; spi-rx-bus-width = <4>; spi-max-frequency = <100000000>; }; So I built the kernel again, started it up on the zybo using my SD card and finally got the partitions to automatically load, like I wanted. Was there an easier way of debugging this? Yeah probably. I tried enabling debug messages for printk in the petalinux configuration, but I think it only works on loadable modules, and not at boot up. If anyone knows an easy way to get pr_debug statements to show up while the kernel is loading, please share. I don't know if the autoconfiguration is incorrectly setting #address-cells and #size-cells or the Zybo BSP has an issue. I also have been unable to find any consistent documentation on the device tree bindings for this node, so if anyone has any idea where those are located for Petalinux, I'd also appreciate y'all letting me know. Hopefully this prevents some head banging for someone out there. - Matt
  2. Hi, I've been trying to get partitions set up on my Zybo Z7 and keep running into this problem: spi-nor spi0.0: s25fl128s1 (16384 Kbytes) spi0.0: error parsing ofpart partition /axi/spi@e000d000/flash@0/partition@0 (/axi/spi@e000d000/flash@0) The Petalinux kernel I'm using is derived from the Zynq template (e.g. not the Zybo Z7 BSP provided from here). I did try using the prebuilt image from the Zybo Z7 Petalinux demo BSP as well, and the exact same issue happens. I've tried reducing the number of partitions, making one big partition, using the default ones from the BSP (all via the menuconfig). In system-user.dtsi I've tried making it compatible with the "micron,m25p80" (which was a suggestion I got from a different post with similar but not identical issues). Below are the flash setups for system-user.dtsi and system-conf.dtsi, respectively system-user.dtsi &flash0 { compatible = "s25fl128s1", "jedec,spi-nor"; reg = <0x0>; spi-tx-bus-width = <1>; spi-rx-bus-width = <4>; spi-max-frequency = <100000000>; //#address-cells = <1>; //#size-cells = <1>; }; system-conf.dtsi &qspi { #address-cells = <1>; #size-cells = <0>; flash0: flash@0 { /delete-node/ partition@0; /delete-node/ partition@100000; /delete-node/ partition@600000; /delete-node/ partition@620000; /delete-node/ partition@c00000; partition@0 { label = "otp"; reg = <0x00000000 0x00010000>; }; partition@1 { label = "otp2"; reg = <0x00010000 0x00100000>; }; partition@2 { label = "user"; reg = <0x00110000 0x00400000>; }; partition@3 { label = "test"; reg = <0x00510000 0x00af0000>; }; }; }; I'm using Petalinux 2022.1. The Zybo Z7 is a Rev. B board with the S25FL128SAGMFI00 flash chip. I feel like I'm missing something obvious. (also, yes I know the s25fl128 has a dedicated OTP, however the board I'm developing will not be using this chip) - Matt
×
×
  • Create New...