# Compiling restool

**URL:** <https://community.solid-run.com/t/compiling-restool/620>\
**Category:** NXP LX2160\
**Tags:** NXP-LX2160\
**Created:** [April 6, 2023, 7:25am UTC](https://community.solid-run.com/t/compiling-restool/620 "2023-04-06T07:25:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terminada](https://avatars.discourse-cdn.com/v4/letter/t/839c29/32.png) [@Terminada](https://community.solid-run.com/u/Terminada)\
**Post date:** [April 6, 2023, 7:25am UTC](https://community.solid-run.com/t/compiling-restool/620/1 "2023-04-06T07:25:33Z")

</div>

Is it still necessary to apply this patch to get restool to compile?  
[https://gitce.net/mirrors/openwrt/raw/commit/b62a4cfc9330e9631a372a11fa9e09ac809080f5/package/network/utils/layerscape/restool/patches/0002-restool-yocto-build-issue.patch](https://gitce.net/mirrors/openwrt/raw/commit/b62a4cfc9330e9631a372a11fa9e09ac809080f5/package/network/utils/layerscape/restool/patches/0002-restool-yocto-build-issue.patch)

This is how I have been building restool so that it will work:

```auto
wget https://gitce.net/mirrors/openwrt/raw/commit/b62a4cfc9330e9631a372a11fa9e09ac809080f5/package/network/utils/layerscape/restool/patches/0002-restool-yocto-build-issue.patch

git clone https://github.com/nxp-qoriq/restool

cd restool
patch -p1 < ../0002-restool-yocto-build-issue.patch

```

Then I build it as a deb package. restool works for me this way and I can get all sfp+ ports to work.

But I wondered if it is still necessary to apply this patch because from reading comments it seems like others are not using this patch.

I saw comments about compiling specific git tags so I tried checking out the following tags and compiling without the patch:

- la1224rdb-bsp1.4
- lf-5.15.52-2.1.0
- lf-6.1.1-1.0.0

These would all compile but when I tried running restool I got the following errors:

```auto
ls-listni

```

> MC error: Unsupported operation (status 0xb)

I boot the board using the UEFI flexspi image: lx2160acex7\_2000\_700\_3200\_8\_5\_2\_flexspi\_nor\_ee5c233.img.xz  
which was written to the board using the procedure documented at: forum topic “anyone-tried-flashing-uefi-f-w-to-spi/185”

I am running kernel 6.1.0-0.deb11.5-arm64

So my question is: How are you supposed to compile restool?

---

<div class="post-metadata">

**Author:** ![surcant](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@surcant](https://community.solid-run.com/u/surcant)\
**Post date:** [April 8, 2023, 1:22am UTC](https://community.solid-run.com/t/compiling-restool/620/2 "2023-04-08T01:22:13Z")

</div>

Might help your problem [What is the current state of the fsl\_mc and dpaa2 system when using UEFI](https://community.solid-run.com/t/what-is-the-current-state-of-the-fsl-mc-and-dpaa2-system-when-using-uefi/571/1)

---

<div class="post-metadata">

**Author:** ![Terminada](https://avatars.discourse-cdn.com/v4/letter/t/839c29/32.png) [@Terminada](https://community.solid-run.com/u/Terminada)\
**Post date:** [May 3, 2023, 10:58pm UTC](https://community.solid-run.com/t/compiling-restool/620/3 "2023-05-03T22:58:20Z")

</div>

I figured out that I needed to select specific tagged versions from the restool repository that are compatible with my bootloader and kernel.

I am trying to run a Debian mainline kernel in order to offload some security maintenance concerns to the expert Debian team.

Consequently, it seems that I need to boot my Honeycomb machine using a [lx2160a\_uefi image](https://images.solid-run.com/LX2k/lx2160a_uefi). These images will boot the Debian installer from a USB stick and have no trouble booting standard Debian kernels after install.

It seems that the latest git tagged version of restool, which works with these lx2160a\_uefi images, is git tag: ‘lf-5.10.52-2.1.0’ which builds ‘restool --version’:

> restool v2.3 (commit lf-5.10.52-2.1.0)

I tried many others, but I believe that is the latest version that will work.

I could get the [latest u-boot bootloader](https://solid-run-images.sos-de-fra-1.exo.io/LX2k/lx2160a_build/lx2160acex7_2000_700_3200_8_5_2-5bf5e08.img.xz) to boot a Debian mainline kernel, but no matter which version of restool I compiled I could not get the SFP+ ports to work.

If I boot with a u-boot bootloader then Debian mainline kernels generated boot messages like:

> fsl-mc: Deploying data path layout … WARNING: Firmware returned an error (GSR:  
> 0x3f)

> [2.083882] fsl\_mc\_dprc dprc.1: Adding to iommu group 0  
> [2.138852] fsl\_mc\_allocator dpbp.1: Adding to iommu group 0  
> [2.138937] fsl\_mc\_allocator dpbp.0: Adding to iommu group 0  
> [2.140017] fsl\_mc\_allocator dpmcp.35: Adding to iommu group 0  
> …  
> [23.785022] fsl\_mc\_dprc dprc.1 (unnamed net\_device) (uninitialized): netif\_na  
> pi\_add\_weight() called with weight 512  
> [23.826712] dpaa2\_caam dpseci.0: FD error: 000000a0  
> …

Then occasionally this happens:

```auto
[69.806895] ------------[cut here]------------                             
[69.806905] WARNING: CPU: 1 PID: 461 at drivers/soc/fsl/dpio/qbman-portal.c:1
580 qbman_swp_acquire+0x1bc/0x1f4 [fsl_mc_dpio]                                 
[69.806935] Modules linked in: sr9700 lz4 lz4_compress zram dm9601 zsmalloc u
sbnet mii fsl_dpaa2_ptp nls_ascii nls_cp437 vfat fat fsl_dpaa2_eth dpaa2_caam lm
90 at24 ext4 caam_jr xhci_plat_hcd ptp_qoriq caamhash_desc ofpart crc16 caamalg_
desc xhci_hcd mbcache spi_nor fsl_mc_dpio ptp i2c_mux_pca954x rtc_pcf2127 crypto
_engine pcs_lynx jbd2 usbcore rng_core authenc mtd regmap_spi i2c_mux evdev at80
3x polyval_ce polyval_generic libdes ghash_ce pps_core phylink xgmac_mdio gf128m
ul acpi_mdio ahci_qoriq dwc3 sha2_ce libahci_platform mdio_devres udc_core libah
ci sha256_arm64 of_mdio libata sha1_ce dpaa2_console roles caam fixed_phy sdhci_
of_esdhc ulpi sbsa_gwdt scsi_mod error fwnode_mdio sdhci_pltfm spi_nxp_fspi usb_
common sfp sdhci scsi_common mdio_i2c libphy i2c_imx gpio_keys qoriq_thermal qor
iq_cpufreq fixed layerscape_edac_mod drm fuse configfs ip_tables x_tables autofs
4 btrfs blake2b_generic libcrc32c crc32c_generic xor xor_neon raid6_pq zstd_comp
ress dm_crypt dm_mod dax nvme nvme_core                                         
[69.807215] t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic crct10d
if_ce crct10dif_common aes_neon_bs aes_neon_blk aes_ce_blk aes_ce_cipher        
[69.807252] CPU: 1 PID: 461 Comm: kworker/u32:9 Not tainted 6.1.0-0.deb11.6-a
rm64 #1 Debian 6.1.15-1~bpo11+1                                                
[69.807261] Hardware name: SolidRun LX2160A Honeycomb (DT)                   
[69.807267] Workqueue: events_unbound deferred_probe_work_func               
[69.807287] pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)  
[69.807295] pc : qbman_swp_acquire+0x1bc/0x1f4 [fsl_mc_dpio]                 
[69.807311] lr : dpaa2_io_service_acquire+0x78/0x1e0 [fsl_mc_dpio]           
[69.807326] sp : ffff8000099e39d0                                            
[69.807330] x29: ffff8000099e39d0 x28: 0000000000000000 x27: ffff59056ca85400
[69.807345] x26: ffff590546b2b400 x25: ffff59056a3679c0 x24: 0000000000000007
[69.807358] x23: 0000000000000000 x22: 0000000000000000 x21: ffff8000099e3a70
[69.807370] x20: ffff590543ec0068 x19: ffff590543ec0000 x18: 00000000fffffffc
[69.807382] x17: 6d2d6c73662d2d30 x16: ffffabc97d9fa140 x15: 0000000000000020
[69.807394] x14: ffffffffffffffff x13: ffffabc97df344c8 x12: ffffabc97ea6ebb0
[69.807406] x11: ffff80000aab1680 x10: 0000000000000080 x9 : ffff590543ec0030
[69.807418] x8 : 0000000004ffffff x7 : ffff80000aab0000 x6 : 0000000000000000
[69.807430] x5 : 00000000000007d0 x4 : ffff80000aab1680 x3 : 0000000000000007
[69.807441] x2 : ffff8000099e3a70 x1 : 0000000000000000 x0 : 0000000000000046
[69.807454] Call trace:                                                      
[69.807458] qbman_swp_acquire+0x1bc/0x1f4 [fsl_mc_dpio]                     
[69.807474] dpaa2_io_service_acquire+0x78/0x1e0 [fsl_mc_dpio]               
[69.807489] dpaa2_eth_drain_bufs+0x54/0xf0 [fsl_dpaa2_eth]                  
[69.807508] dpaa2_eth_free_dpbp+0x24/0xac [fsl_dpaa2_eth]                   
[69.807525] dpaa2_eth_probe+0xff0/0x1604 [fsl_dpaa2_eth]                    
[69.807541] fsl_mc_driver_probe+0x2c/0x74                                   
[69.807557] really_probe+0xc8/0x3e0                                         
[69.807566] __driver_probe_device+0x84/0x190                                
[69.807576] driver_probe_device+0x44/0x120                                  
[69.807585] __device_attach_driver+0xc4/0x160                               
[69.807594] bus_for_each_drv+0x80/0xe0                                      
[69.807603] __device_attach+0xb0/0x1f0                                      
[69.807612] device_initial_probe+0x1c/0x2c                                  
[69.807622] bus_probe_device+0xa4/0xb0                                      
[69.807630] deferred_probe_work_func+0xc0/0x114                             
[69.807639] process_one_work+0x1f0/0x470                                    
[69.807649] worker_thread+0x188/0x4e0                                       
[69.807658] kthread+0xe0/0xe4                                               
[69.807665] ret_from_fork+0x10/0x20                                         
[69.807674] ---[end trace 0000000000000000]---                             
[69.809720] ------------[cut here]------------                             
[69.809723] WARNING: CPU: 1 PID: 461 at drivers/soc/fsl/dpio/qbman-portal.c:1
694 qbman_swp_CDAN_set+0x188/0x1b0 [fsl_mc_dpio]
[69.809742] Modules linked in: sr9700 lz4 lz4_compress zram dm9601 zsmalloc u
sbnet mii fsl_dpaa2_ptp nls_ascii nls_cp437 vfat fat fsl_dpaa2_eth dpaa2_caam lm
90 at24 ext4 caam_jr xhci_plat_hcd ptp_qoriq caamhash_desc ofpart crc16 caamalg_
desc xhci_hcd mbcache spi_nor fsl_mc_dpio ptp i2c_mux_pca954x rtc_pcf2127 crypto
_engine pcs_lynx jbd2 usbcore rng_core authenc mtd regmap_spi i2c_mux evdev at80
3x polyval_ce polyval_generic libdes ghash_ce pps_core phylink xgmac_mdio gf128m
ul acpi_mdio ahci_qoriq dwc3 sha2_ce libahci_platform mdio_devres udc_core libah
ci sha256_arm64 of_mdio libata sha1_ce dpaa2_console roles caam fixed_phy sdhci_
of_esdhc ulpi sbsa_gwdt scsi_mod error fwnode_mdio sdhci_pltfm spi_nxp_fspi usb_
common sfp sdhci scsi_common mdio_i2c libphy i2c_imx gpio_keys qoriq_thermal qor
iq_cpufreq fixed layerscape_edac_mod drm fuse configfs ip_tables x_tables autofs
4 btrfs blake2b_generic libcrc32c crc32c_generic xor xor_neon raid6_pq zstd_comp
ress dm_crypt dm_mod dax nvme nvme_core
[69.810001] t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic crct10d
if_ce crct10dif_common aes_neon_bs aes_neon_blk aes_ce_blk aes_ce_cipher        
[69.810032] CPU: 1 PID: 461 Comm: kworker/u32:9 Tainted: G W          
6.1.0-0.deb11.6-arm64 #1 Debian 6.1.15-1~bpo11+1                               
[69.810040] Hardware name: SolidRun LX2160A Honeycomb (DT)                   
[69.810044] Workqueue: events_unbound deferred_probe_work_func               
[69.810055] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)  
[69.810063] pc : qbman_swp_CDAN_set+0x188/0x1b0 [fsl_mc_dpio]                
[69.810078] lr : dpaa2_io_service_deregister+0xfc/0x100 [fsl_mc_dpio]

```

But changing to a lx2160a\_uefi bootloader I see:

```auto
[0.959049] fsl_mc_bus NXP0008:00: Adding to iommu group 0                   
[0.959574] fsl_mc_bus NXP0008:00: MC firmware version: 10.28.1              
[0.962121] fsl_mc_dprc dprc.1: DMA mask not set                             
[0.962161] fsl_mc_dprc dprc.1: Adding to iommu group 1                      
[1.006250] fsl_mc_allocator dpbp.0: Adding to iommu group 1                 
[1.007338] fsl_mc_allocator dpmcp.35: Adding to iommu group 1
...
[38.145892] fsl_mc_dpio dpio.10: unknown SoC version                         
[38.146259] scsi host3: ahci                                                 
[38.151294] ata4: SATA max UDMA/133 mmio [mem 0x03230000-0x0323ffff] port 0x5
[38.151460] fsl_mc_dpio dpio.10: probed                                      
[38.151872] fsl_mc_dpio dpio.9: Adding to iommu group 1
...
[39.441559] fsl_dpaa2_eth dpni.1: Adding to iommu group 1                    
[39.593552] fsl_dpaa2_eth dpni.1: Probed interface eth0
[39.594402] fsl_dpaa2_eth dpni.1 lan: renamed from eth0
...

```

And the SFP+ ports all work.

Hopefully that helps someone else save some time and frustration.

What I don’t understand is why most documentation seems to point me in the direction of using u-boot.
