Skip to contentSkip to conversation

am33x-cm3: add firmware for am33x suspend/resume

PATCH In review Koen Kooi 3 participants 5 messages Apr 10, 2012 – Apr 18, 2012

lore
Share & tools
lore

Koen Kooi

author
#0 lore raw

PATCH 1/1 am33x-cm3: add firmware for am33x suspend/resume

---
 recipes-bsp/ti/am33x-cm3_git.bb |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 recipes-bsp/ti/am33x-cm3_git.bb
recipes-bsp/ti/am33x-cm3_git.bb new file +23 -0
new file mode 100644
index 0000000..247ba4d
@@ -0,0 +1,23 @@
+DESCRIPTION = "Cortex-M3 binary blob for suspend-resume"
+
+LICENSE = "TI-BSD"
+LIC_FILES_CHKSUM = "file://License.txt;md5=858099c817e47ea63559fc6b67ae8d91"
+
+PV = "04.06.00.07"
+SRCREV = "cf07b841d6e8c5e026eecb259d143f3dff412c8e"
+
+SRC_URI = "git://arago-project.org/git/projects/am33x-cm3.git"
+
+S = "${WORKDIR}/git"
+
+do_compile() {
+	make CC="${TARGET_CC}" CROSS_COMPILE="${TARGET_PREFIX}"
+}
+
+do_install() {
+	install -d ${D}${base_libdir}/firmware
+	install -m 0644 bin/am335x-pm-firmware.bin ${D}${base_libdir}/firmware/
+}
+
+FILES_${PN} = "${base_libdir}/firmware"
+
Signature · 1 line
1.7.2.5
#1 lore raw

Koen,

I'm commenting on both of your patches together...

am33x-cm3:

recipes-bsp/ti/am33x-cm3_git.bb line 20

Quoted 6 lines

+++ b/recipes-bsp/ti/am33x-cm3_git.bb

recipes-bsp/ti/am33x-cm3_git.bb new file +4 -0
+do_install() {
+	install -d ${D}${base_libdir}/firmware
+	install -m 0644 bin/am335x-pm-firmware.bin ${D}${base_libdir}/firmware/
+}

linux-ti33x-psp:

Review

Quoted 11 lines

This fixes most PM operations: cpufreq, cpuidle and suspend. Resume does not work on beaglebone, but 3 out of 4 ain't bad :)

The M3 firmware needed for suspend/resume is used as a binary, building it from source and including it from sysroots is planned for future commits.

+++ b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb

(quoted diff) +3 -0
+do_compile_prepend() {
+       cp ${WORKDIR}/am335x-pm-firmware.bin ${S}/firmware/
+}

Have you looked at how it's done in Arago/AM-SDK? The firmware is staged in the sysroots and gets picked up by the kernel:

do_install() {
    install -d ${STAGING_FIRMWARE_DIR}/am33x-cm3
    install ${S}/bin/am335x-pm-firmware.bin {STAGING_FIRMWARE_DIR}/am33x-cm3/
}

Where the kernel then copies it to ${S}/firmware:

# Copy the am33x-cm3 firmware if it is available

do_compile_prepend() {
    if [ -e "${STAGING_FIRMWARE_DIR}/am33x-cm3/am335x-pm-firmware.bin" ]
    then
        cp "${STAGING_FIRMWARE_DIR}/am33x-cm3/am335x-pm-firmware.bin" ${S}/firmware"
    fi
}

It's not the most elegant solution either, but at least it gets around the need to keep the binary version of the firmware in the repository with the kernel recipe...

Do you want me to make similar changes to your patches? Or do you have any arguments against this approach?

Signature · 1 line
Denys
author
#2 lore raw

Op 12 apr. 2012, om 22:09 heeft Denys Dmytriyenko het volgende geschreven:

Quoted 20 lines

Koen,

I'm commenting on both of your patches together...

am33x-cm3:

recipes-bsp/ti/am33x-cm3_git.bb line 20

Quoted 6 lines

+++ b/recipes-bsp/ti/am33x-cm3_git.bb

recipes-bsp/ti/am33x-cm3_git.bb new file +4 -0
+do_install() {
+	install -d ${D}${base_libdir}/firmware
+	install -m 0644 bin/am335x-pm-firmware.bin ${D}${base_libdir}/firmware/
+}

linux-ti33x-psp:

Quoted 6 lines

This fixes most PM operations: cpufreq, cpuidle and suspend. Resume does not work on beaglebone, but 3 out of 4 ain't bad :)

The M3 firmware needed for suspend/resume is used as a binary, building it from source and including it from sysroots is planned for future commits.

Quoted 8 lines

Review

Quoted 5 lines

+++ b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb

(quoted diff) +3 -0
+do_compile_prepend() {
+       cp ${WORKDIR}/am335x-pm-firmware.bin ${S}/firmware/
+}

Have you looked at how it's done in Arago/AM-SDK?

No, I only looked at meta-ti :)

Quoted 18 lines

The firmware is staged in
the sysroots and gets picked up by the kernel:

do_install() {
   install -d ${STAGING_FIRMWARE_DIR}/am33x-cm3
   install ${S}/bin/am335x-pm-firmware.bin {STAGING_FIRMWARE_DIR}/am33x-cm3/
}

Where the kernel then copies it to ${S}/firmware:

# Copy the am33x-cm3 firmware if it is available

do_compile_prepend() {
   if [ -e "${STAGING_FIRMWARE_DIR}/am33x-cm3/am335x-pm-firmware.bin" ]
   then
       cp "${STAGING_FIRMWARE_DIR}/am33x-cm3/am335x-pm-firmware.bin" ${S}/firmware"
   fi
}
Quoted 6 lines

It's not the most elegant solution either, but at least it gets around the need to keep the binary version of the firmware in the repository with the kernel recipe...

Do you want me to make similar changes to your patches? Or do you have any arguments against this approach?

Yes, you're not allowed to touch sysroots from inside do_install since that will break sstate, which is why I added regular recipes first to get it working and fix it properly later.

It's a bit academic at this point, since you need to get lucky in the silicon bingo to have suspend/resume working on am335x anyway. I can disable CONFIG_SUSPEND and remove the copying bits if you want.

regards,

Koen

#3 lore raw

Op 12 apr. 2012, om 22:21 heeft Koen Kooi het volgende geschreven:

Quoted 56 lines

Op 12 apr. 2012, om 22:09 heeft Denys Dmytriyenko het volgende geschreven:

Quoted 20 lines

Koen,

I'm commenting on both of your patches together...

am33x-cm3:

recipes-bsp/ti/am33x-cm3_git.bb line 20

Quoted 6 lines

+++ b/recipes-bsp/ti/am33x-cm3_git.bb

recipes-bsp/ti/am33x-cm3_git.bb new file +4 -0
+do_install() {
+	install -d ${D}${base_libdir}/firmware
+	install -m 0644 bin/am335x-pm-firmware.bin ${D}${base_libdir}/firmware/
+}

linux-ti33x-psp:

Quoted 6 lines

This fixes most PM operations: cpufreq, cpuidle and suspend. Resume does not work on beaglebone, but 3 out of 4 ain't bad :)

The M3 firmware needed for suspend/resume is used as a binary, building it from source and including it from sysroots is planned for future commits.

Quoted 8 lines

Review

Quoted 5 lines

+++ b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb

(quoted diff) +3 -0
+do_compile_prepend() {
+       cp ${WORKDIR}/am335x-pm-firmware.bin ${S}/firmware/
+}

Have you looked at how it's done in Arago/AM-SDK?

No, I only looked at meta-ti :)

Quoted 22 lines

The firmware is staged in
the sysroots and gets picked up by the kernel:

do_install() {
install -d ${STAGING_FIRMWARE_DIR}/am33x-cm3
install ${S}/bin/am335x-pm-firmware.bin {STAGING_FIRMWARE_DIR}/am33x-cm3/
}

Where the kernel then copies it to ${S}/firmware:

# Copy the am33x-cm3 firmware if it is available do_compile_prepend() {
if [ -e "${STAGING_FIRMWARE_DIR}/am33x-cm3/am335x-pm-firmware.bin" ] then

      cp "${STAGING_FIRMWARE_DIR}/am33x-cm3/am335x-pm-firmware.bin" ${S}/firmware"

fi
}

It's not the most elegant solution either, but at least it gets around the need to keep the binary version of the firmware in the repository with the kernel recipe...

Quoted 6 lines
Quoted 2 lines

Do you want me to make similar changes to your patches? Or do you have any arguments against this approach?

Yes, you're not allowed to touch sysroots from inside do_install since that will break sstate, which is why I added regular recipes first to get it working and fix it properly later.

It's a bit academic at this point, since you need to get lucky in the silicon bingo to have suspend/resume working on am335x anyway. I can disable CONFIG_SUSPEND and remove the copying bits if you want.

ping

#4 lore raw
In reply to Koen Kooi
Quoted 10 lines · Koen Kooi

Op 12 apr. 2012, om 22:09 heeft Denys Dmytriyenko het volgende geschreven:

Quoted 6 lines

It's not the most elegant solution either, but at least it gets around the need to keep the binary version of the firmware in the repository with the kernel recipe...

Do you want me to make similar changes to your patches? Or do you have any arguments against this approach?

Quoted 7 lines

Yes, you're not allowed to touch sysroots from inside do_install since that will break sstate, which is why I added regular recipes first to get it working and fix it properly later.

It's a bit academic at this point, since you need to get lucky in the silicon bingo to have suspend/resume working on am335x anyway. I can disable CONFIG_SUSPEND and remove the copying bits if you want.

Ok, I pushed it as is and will look into the staging issue...

Signature · 1 line
Denys