UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant jplozier
Participant
683 Views
Registered: ‎04-23-2018

Petalinux 2018.2 pmu-firmware patch

Jump to solution

Hello All,

 

I am trying to patch the pmu-firmware.
The actual file that I want to patch is:

 

<proj-dir>/components/plnx_workspace/pmu-firmware/pmu-firmware_bsp/psu_pmu_0/libsrc/xilfpga_v4_1/src/xilfpga_pcap.c

I followed the instructions to the best of my ability here (for 2017.1):

http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips#toc11

 

but got the following error:

 

DEBUG: Executing shell function do_compile
Display is :122
Source xsctrc script :.xsdbrc FAILED
Starting xsdk. This could take few seconds... Picked up _JAVA_OPTIONS: -Duser.home=<proj-dir>/build/tmp/ xsctenv
done
No project(s) found in: '<proj-dir>/components/plnx_workspace/pmu-firmware'
XSCTHELPER INFO: Empty WorkSpace
Specified project 'pmu-firmware_bsp' doesn't exist in the workspace.
Specified project 'pmu-firmware' doesn't exist in the workspace.
Specified project 'pmu-firmware_bsp' doesn't exist in the workspace.
Specified project 'pmu-firmware' doesn't exist in the workspace.
ERROR: pmu-firmware compile failed.
WARNING: <proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/pmu-firmware/2018.2+gitAUTOINC+6e82c0183b-r0/temp/run.do_compile.115215:1 exit 1 from 'exit 1'
ERROR: Function failed: do_compile (log file is located at <proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/pmu-firmware/2018.2+gitAUTOINC+6e82c0183b-r0/temp/log.do_compile.115215)


And this was the contents of the pmu-firmware directory at the time of failure:

 

ls -a <proj-dir>/components/plnx_workspace/pmu-firmware
./ ../ .metadata/ SDK.log

 

There's obviously no contents in the directory.

Under normal circumstances this directory is fully populated.

 

Inside my <proj-dir>/project-spec/meta-user/recipes-bsp/pmu directory:

 

pmu
├── files
│   └── 0001-PMUFW.patch
└── pmu-firmware_%.bbappend

 

the pmu-firmware_%.bbappend contents:

 

 do_configure() {
    if [ -d "${S}/patches" ]; then
       rm -rf ${S}/patches
    fi  
 
    if [ -d "${S}/.pc" ]; then
       rm -rf ${S}/.pc
    fi  
}

SRC_URI_append = " \ 
        file://0001-PMUFW.patch \
        "
 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
 
#Enable appropriate PMUFW debug flags
YAML_COMPILER_FLAGS_append = " -DENABLE_EM"
 
# Note: This is not required if you are using Yocto
EXTERNALXSCTsrc=""
EXTERNALXSCTSRC_BUILD = ""

Any ideas would be appreciated.

 

Thanks!

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Participant jplozier
Participant
497 Views
Registered: ‎04-23-2018

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution

This is working now.

 

I followed @sandeepg's instructions for the most part but I created the pmu-firmware_%.bbappend file but with the following changes:

 

I commented out the debug flags because their output was spamming the terminal.

 

Also:

EXTERNALXSCTsrc=""

 

was changed to:

EXTERNALXSCTsrc="" <--- This should be all caps and for some reason refuses do display properly.

 

I've attached my final pmu-firmware_%.bbappend file. 

 

The other issue was that the file directory structure in the patch file was incorrect and the patch was not being applied. My working patch looks like this:

 

diff -urN a/lib/sw_services/xilfpga/src/xilfpga_pcap.c b/lib/sw_services/xilfpga/src/xilfpga_pcap.c
--- a/lib/sw_services/xilfpga/src/xilfpga_pcap.c  2018-09-19 18:31:07.579861515 -0400
+++ b/lib/sw_services/xilfpga/src/xilfpga_pcap.c  2018-09-20 14:26:37.472384082 -0400
@@ -413,6 +413,9 @@
    goto END;
  }
 
+
+ //testing patches
+
  if (flags & XFPGA_SECURE_FLAGS)
 #ifdef XFPGA_SECURE_MODE
  {

I'll mark this as the complete answer to my issue but kudos to @sandeepg and @stephenm for their assistance.

Thanks guys!

 

FYI: @sandeepg

 

I noticed that entering text in the Rich Text tab and then previewing the results was sometimes lowercasing some of the text. In your case it lowercased the src in EXTERNALXSCTsrc="". You can see this in the preview. I noticed it because i was previewing my changes and I realized that I can not post a fully capitol EXTERNALXSCTsrc="" and see it displayed properly. That is why I had to attach the bbappend file. I'm not sure why I'm experiencing this.

 

j

 

0 Kudos
6 Replies
Moderator
Moderator
677 Views
Registered: ‎09-12-2007

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution
Can you do a rm -rf on the components folder and petalinux-build-x mrproper. The retry again?
Participant jplozier
Participant
663 Views
Registered: ‎04-23-2018

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution

@stephenm

Thanks for your response.

Unfortunately it failed with the following error:

 

ERROR: device-tree-xilinx+gitAUTOINC+f38738e568-r0 do_compile: Function failed: do_compile (log file is located at <proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+f38738e568-r0/temp/log.do_compile.76593)
ERROR: Logfile of failure stored in: <proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+f38738e568-r0/temp/log.do_compile.76593
Log data follows:
| DEBUG: Executing shell function do_compile
| gcc: error: <proj-dir>/build/../components/plnx_workspace/device-tree/device-tree/*.dts: No such file or directory
| gcc: warning: ‘-x assembler-with-cpp’ after last input file has no effect
| gcc: fatal error: no input files
| compilation terminated.
| WARNING: <proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+f38738e568-r0/temp/run.do_compile.76593:1 exit 4 from 'gcc -E -nostdinc -Ulinux -x assembler-with-cpp -I<proj-dir>/build/../components/plnx_workspace/device-tree/device-tree -I<proj-dir>/build/tmp/work-shared/plnx-zynqmp/kernel-source/include -I<proj-dir>/build/tmp/work-shared/plnx-zynqmp/kernel-source/arch/arm64/boot/dts/xilinx -I<proj-dir>/build/tmp/work-shared/plnx-zynqmp/kernel-source/include -I<proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+f38738e568-r0 -o `basename ${DTS_FILE}`.pp ${DTS_FILE}'
| ERROR: Function failed: do_compile (log file is located at <proj-dir>/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+f38738e568-r0/temp/log.do_compile.76593)
ERROR: Task (/opt/xilinx/petalinux/2018.2/components/yocto/source/aarch64/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1'
0 Kudos
Moderator
Moderator
656 Views
Registered: ‎09-12-2007

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution
Can you do petalinux-build -c device-tree
Then petalinux-build -c pmufw
0 Kudos
Moderator
Moderator
648 Views
Registered: ‎04-24-2017

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution

Hi @jplozier,

 

For 2018.x release the directory structure and PMUFW flags has changed. I will update once wiki freeze is lifted.

 

1. Create a pmu and files directory in meta-user layer as

$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-bsp/pmu-firmware/files

2. Copy patch files to <plnx-proj-root>/project-spec/meta-user/recipes-bsp/pmu-firmware/files as

$ cp 0001-PMUFW.patch <plnx-proj-root>/project-spec/meta-user/recipes-bsp/pmu-firmware/files
 

3. Create a pmu-firmware_%.bbappend file and add below content

$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/pmu-firmware/pmu-firmware_%.bbappend
SRC_URI_append = " \
        file://0001-PMUFW.patch \
        "
 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
 
#Enable appropriate PMUFW debug flags
#Refer http://www.wiki.xilinx.com/PMU%20Firmware#PMU%20FW%20Build%20Flags YAML_COMPILER_FLAGS_append = " -DDEBUG_MODE -DXPFW_DEBUG_DETAILED"

#By pass PMUFW debug logs on UART1 console:
YAML_SERIAL_CONSOLE_STDOUT = "psu_uart_1"
YAML_SERIAL_CONSOLE_STDIN = "psu_uart_1"
# Note: This is not required if you are using Yocto EXTERNALXSCTsrc="" EXTERNALXSCTSRC_BUILD = ""


4. Remove the <plnx-proj-root>/components/plnx_workspace and clean you project workspace before rebuilding PMUFW components. In 2018.x PetaLinux mrproper option deletes components/plnx_workspace directory

$ petalinux-build -x mrproper

5. Rebuilding PMUFW components

$ petalinux-build -c pmufw

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Participant jplozier
Participant
583 Views
Registered: ‎04-23-2018

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution

@sandeepg,

@stephenm,

 

Thank you both for your responses.

 

Following sandeepg's instructions:


The build does succeed however the patch is not applied.

The file that I am attempting to patch is:

 

<proj-dir>/components/plnx_workspace/pmu-firmware/pmu-firmware_bsp/psu_pmu_0/libsrc/xilfpga_v4_1/src/xilfpga_pcap.c

I can hand edit this file to see my changes take effect but I'm not able to utilize the petalinux tool to apply a patch to it. I created the patch from the git repository for that file. Perhaps it's malformed when I bring it in to petalinux? If that were the case i would expect it to attempt to patch and print a failure message.

 

j

 

0 Kudos
Participant jplozier
Participant
498 Views
Registered: ‎04-23-2018

Re: Petalinux 2018.2 pmu-firmware patch

Jump to solution

This is working now.

 

I followed @sandeepg's instructions for the most part but I created the pmu-firmware_%.bbappend file but with the following changes:

 

I commented out the debug flags because their output was spamming the terminal.

 

Also:

EXTERNALXSCTsrc=""

 

was changed to:

EXTERNALXSCTsrc="" <--- This should be all caps and for some reason refuses do display properly.

 

I've attached my final pmu-firmware_%.bbappend file. 

 

The other issue was that the file directory structure in the patch file was incorrect and the patch was not being applied. My working patch looks like this:

 

diff -urN a/lib/sw_services/xilfpga/src/xilfpga_pcap.c b/lib/sw_services/xilfpga/src/xilfpga_pcap.c
--- a/lib/sw_services/xilfpga/src/xilfpga_pcap.c  2018-09-19 18:31:07.579861515 -0400
+++ b/lib/sw_services/xilfpga/src/xilfpga_pcap.c  2018-09-20 14:26:37.472384082 -0400
@@ -413,6 +413,9 @@
    goto END;
  }
 
+
+ //testing patches
+
  if (flags & XFPGA_SECURE_FLAGS)
 #ifdef XFPGA_SECURE_MODE
  {

I'll mark this as the complete answer to my issue but kudos to @sandeepg and @stephenm for their assistance.

Thanks guys!

 

FYI: @sandeepg

 

I noticed that entering text in the Rich Text tab and then previewing the results was sometimes lowercasing some of the text. In your case it lowercased the src in EXTERNALXSCTsrc="". You can see this in the preview. I noticed it because i was previewing my changes and I realized that I can not post a fully capitol EXTERNALXSCTsrc="" and see it displayed properly. That is why I had to attach the bbappend file. I'm not sure why I'm experiencing this.

 

j

 

0 Kudos