Skip to contentSkip to conversation

am33x-cm3: add FW for suspend/resume

PATCH New Anders Darander 2 participants 4 messages May 11, 2013 – May 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 am33x-cm3: add FW for suspend/resume

(Resend a as I first sent from an unsubcribed email).

Quoted 10 lines · Arnout Vandecappelle
Quoted 3 lines · Anders Darander

From: Anders Darander <[email protected]>

Without this firmware, the beaglebone won't be able to reboot

correctly.

Quoted 2 lines

[snip]

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/am33x-cm3/am33x-cm3.mk

Quoted 15 lines

package/am33x-cm3/am33x-cm3.mk line 8

Quoted 13 lines

new file mode 100644
index 0000000..6180157

package/am33x-cm3/am33x-cm3.mk new file +8 -0
@@ -0,0 +1,26 @@
+#############################################################
+#
+# am33x-cm3
+#
+#############################################################
+
+# SHA1 corresponds to tag "AM335xPSP_04.06.00.10-rc1"
+AM33X_CM3_VERSION = 27ca4643e422245a95723de1df0247a00eada45b

If it is a tag, then use the tag, not the sha1.

Ok, I'll double check that the tag exists and update the patch.

Quoted 4 lines

package/am33x-cm3/am33x-cm3.mk line 10

Quoted 2 lines
package/am33x-cm3/am33x-cm3.mk new file +2 -0
+AM33X_CM3_SITE = git://arago-project.org/git/projects/am33x-cm3.git
+AM33X_CM3_METHOD = git

Since the site starts with git://, the method is git by default.

I didn't get the fetcher to actually try git unless I added the method explicitly. All my previous ?ries ended with wget errors.

Quoted 3 lines

However, if the site supports http, we prefer to use that. Some company

firewalls block git.

Ok I'll lade if I can find out if http is available.

Quoted 6 lines

package/am33x-cm3/am33x-cm3.mk line 11

Quoted 1 line
package/am33x-cm3/am33x-cm3.mk new file +1 -0
+AM33X_CM3_LICENSE = TI-BSD

I don't really like this license name. Either it's BSD (then it should specify 2-, 3- or 4-clause), or it is not. In the latter case, it would

be something like "TI Open Source license (BSD-like)".

To be honest, I merely used what TI is using in their own BSP. I'll see what it reads like.

Quoted 8 lines

package/am33x-cm3/am33x-cm3.mk line 15

Quoted 4 lines
package/am33x-cm3/am33x-cm3.mk new file +4 -0
+AM33X_CM3_LICENSE_FILES = License.txt
+
+define AM33X_CM3_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D)

all

Does it work with $(TARGET_CONFIGURE_OPTS) instead of CC=? If not, then

Quoted 8 lines

please also pass the CFLAGS and LDFLAGS - they may be important.

However, now I think about it - this is abusing the cross-compiler for the Cortex-A8 to generate code for the Cortex-M3, correct? In that case,
passing CFLAGS and LDFLAGS is probably not a good idea. But it would also
be good to add a note about what is happening here.

I'll add a comment on this. Once again, the technique is taken from the TI's BSP.

Quoted 8 lines

package/am33x-cm3/am33x-cm3.mk line 21

Quoted 6 lines
package/am33x-cm3/am33x-cm3.mk new file +6 -0
+endef
+
+# Not all of the firmware files are used
+define AM33X_CM3_INSTALL_TARGET_CMDS
+ $(INSTALL) -d -m 0755 $(TARGET_DIR)/lib/firmware/
+ $(INSTALL) -m 0644 $(@D)/bin/am335x-pm-firmware.bin

$(TARGET_DIR)/lib/firmware

Quoted 4 lines

We normally create directories with the -D option to install, so:

$(INSTALL) -m 0644 -D $(@D)/bin/am335x-pm-firmware.bin \
$(TARGET_DIR)/lib/firmware/am335x-pm-firmware.bin

Ok, I'll fix that.

Quoted 8 lines

package/am33x-cm3/am33x-cm3.mk line 23

Quoted 2 lines
package/am33x-cm3/am33x-cm3.mk new file +2 -0
+ $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/init.d
+ $(INSTALL) -m 0755 package/am33x-cm3/am335x-pm-firmware-load

$(TARGET_DIR)/etc/init.d/S93-am335x-pm-firwmare-load

init scripts are installed by a separate variable,
AM33X_CM3_INSTALL_INIT_SYSV. And of course, the same remark about the -D
option applies.

Thanks, I'm fox that too.

Does that make it install when using busybox init also?

Thanks for the feedback!

Cheers,
Anders

Signature · 9 lines
Anders Darander
ChargeStorm AB          Tel: +46 702 44 84 36
Laxholmstorget 3        Email: anders at chargestorm.se
602 21 Norrk?ping       Web: www.chargestorm.se

Sent from my Android phone with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130511/aa443ece/attachment.html>
#1 lore raw

PATCH 3/5 am33x-cm3: add FW for suspend/resume

Quoted 32 lines · Anders Darander

(Resend a as I first sent from an unsubcribed email).

Quoted 10 lines · Arnout Vandecappelle <arnout at mind.be <mailto:[email protected]>> wrote:
Quoted 3 lines · Anders Darander

From: Anders Darander <[email protected]

Without this firmware, the beaglebone won't be able to reboot

correctly.

Quoted 2 lines

[snip]

<http://am33x-cm3.mk>

Quoted 1 line
<http://am33x-cm3.mk> renamed from package/am33x-cm3/am33x-cm3.mk +0 -0

b/package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk>

Quoted 15 lines

package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> line 8

Quoted 13 lines

new file mode 100644
index 0000000..6180157

package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> new file +8 -0
@@ -0,0 +1,26 @@
+#############################################################
+#
+# am33x-cm3
+#
+#############################################################
+
+# SHA1 corresponds to tag "AM335xPSP_04.06.00.10-rc1"
+AM33X_CM3_VERSION = 27ca4643e422245a95723de1df0247a00eada45b

If it is a tag, then use the tag, not the sha1.

Ok, I'll double check that the tag exists and update the patch.

Quoted 7 lines
Quoted 4 lines

package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> line 10

Quoted 2 lines
package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> new file +2 -0
+AM33X_CM3_SITE = git://arago-project.org/git/projects/am33x-cm3.git
+AM33X_CM3_METHOD = git

Since the site starts with git://, the method is git by default.

I didn't get the fetcher to actually try git unless I added the method explicitly. All my previous ?ries ended with wget errors.

Works for me though. But anyway, if you switch to http it's irrelevant.

Quoted 9 lines
Quoted 4 lines

However, if the site supports http, we prefer to use that. Some company

firewalls block git.

Ok I'll lade if I can find out if http is available.

Quoted 2 lines
Quoted 1 line
package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> new file +1 -0
+AM33X_CM3_LICENSE = TI-BSD
Quoted 7 lines
Quoted 4 lines

I don't really like this license name. Either it's BSD (then it should specify 2-, 3- or 4-clause), or it is not. In the latter case, it would

be something like "TI Open Source license (BSD-like)".

To be honest, I merely used what TI is using in their own BSP. I'll see what it reads like.

OK I checked and there's nothing BSD-like about it. The full title is
Texas Instruments Incorporated Technology and Software Publicly Available Software License Agreement
I propose we abbreviate that to e.g.
TI Publicly Available Software License

Quoted 17 lines
Quoted 8 lines

package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> line 15

Quoted 4 lines
package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> new file +4 -0
+AM33X_CM3_LICENSE_FILES = License.txt
+
+define AM33X_CM3_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D)

all

Does it work with $(TARGET_CONFIGURE_OPTS) instead of CC=? If not, then

Quoted 8 lines

please also pass the CFLAGS and LDFLAGS - they may be important.

However, now I think about it - this is abusing the cross-compiler for the Cortex-A8 to generate code for the Cortex-M3, correct? In that case,
passing CFLAGS and LDFLAGS is probably not a good idea. But it would also
be good to add a note about what is happening here.

Quoted 2 lines

I'll add a comment on this. Once again, the technique is taken from the TI's BSP.

I get a lot of

warning: switch -mcpu=cortex-m3 conflicts with -march=armv7-a switch [enabled by default]

but I guess these are harmless.

(the -march=armv7-a is added by the toolchain wrapper).

But I'm not 100% sure if a custom toolchain will actually build for the
correct architecture. Could you try if the result of something built with the buildroot toolchain works correctly? If you want, I can send you the .bin file so you don't have to wait an hour for the whole toolchain to compile. Or, if you have actually tested it with a buildroot toolchain, could you try if it also works with an external Sourcery and/or Linaro toolchain?

Quoted 19 lines
Quoted 8 lines

package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> line 21

Quoted 6 lines
package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> new file +6 -0
+endef
+
+# Not all of the firmware files are used
+define AM33X_CM3_INSTALL_TARGET_CMDS
+ $(INSTALL) -d -m 0755 $(TARGET_DIR)/lib/firmware/
+ $(INSTALL) -m 0644 $(@D)/bin/am335x-pm-firmware.bin

$(TARGET_DIR)/lib/firmware

Quoted 4 lines

We normally create directories with the -D option to install, so:

$(INSTALL) -m 0644 -D $(@D)/bin/am335x-pm-firmware.bin \
$(TARGET_DIR)/lib/firmware/am335x-pm-firmware.bin

Ok, I'll fix that.

Quoted 4 lines

package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> line 23

Quoted 2 lines
package/am33x-cm3/am33x-cm3.mk <http://am33x-cm3.mk> new file +2 -0
+ $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/init.d
+ $(INSTALL) -m 0755 package/am33x-cm3/am335x-pm-firmware-load

$(TARGET_DIR)/etc/init.d/S93-am335x-pm-firwmare-load

Quoted 8 lines
Quoted 4 lines

init scripts are installed by a separate variable,
AM33X_CM3_INSTALL_INIT_SYSV. And of course, the same remark about the -D
option applies.

Thanks, I'm fox that too.

Does that make it install when using busybox init also?

Yes it does.

Only when systemd is selected, it doesn't install anything. So ideally
you should also add a systemd unit file.

Regards,
Arnout

Quoted 15 lines

Thanks for the feedback!

Cheers,
Anders

--
Anders Darander
ChargeStorm AB Tel: +46 702 44 84 36
Laxholmstorget 3 Email: anders at chargestorm.se
<mailto:[email protected]>
602 21 Norrk?ping Web: www.chargestorm.se <http://www.chargestorm.se>

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH 3/5 am33x-cm3: add FW for suspend/resume

Quoted 32 lines · Arnout Vandecappelle
Quoted 26 lines · Anders Darander

(Resend a as I first sent from an unsubcribed email).

Quoted 8 lines · Arnout Vandecappelle <arnout at mind.be <mailto:[email protected]>> wrote:
Quoted 1 line · Anders Darander

From: Anders Darander <[email protected]

+AM33X_CM3_LICENSE_FILES = License.txt

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+define AM33X_CM3_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" CROSS_COMPILE="$(TARGET_CROSS)**" -C

$(@D)

Quoted 4 lines

all

Does it work with $(TARGET_CONFIGURE_OPTS) instead of CC=? If not, then

Quoted 8 lines

please also pass the CFLAGS and LDFLAGS - they may be important.

However, now I think about it - this is abusing the cross-compiler for the Cortex-A8 to generate code for the Cortex-M3, correct? In that case,
passing CFLAGS and LDFLAGS is probably not a good idea. But it would also
be good to add a note about what is happening here.

Quoted 3 lines

I'll add a comment on this. Once again, the technique is taken from the TI's BSP.

Quoted 9 lines

I get a lot of

warning: switch -mcpu=cortex-m3 conflicts with -march=armv7-a switch [enabled by default]

but I guess these are harmless.

(the -march=armv7-a is added by the toolchain wrapper).

Using what toolchain? I'm not seeing these warning (and neither am I seeing any -march=armv7-a) in my test builds. I'm using the buildroot toolchain generated with this patch series applied to the 2013.05-rc1 tag.

Quoted 17 lines

But I'm not 100% sure if a custom toolchain will actually build for the
correct architecture. Could you try if the result of something built with the buildroot toolchain works correctly? If you want, I can send you the .bin file so you don't have to wait an hour for the whole toolchain to compile. Or, if you have actually tested it with a buildroot toolchain, could you try if it also works with an external Sourcery and/or Linaro toolchain?

Quoted 7 lines

init scripts are installed by a separate variable,

Quoted 3 lines

AM33X_CM3_INSTALL_INIT_SYSV. And of course, the same remark about the -D
option applies.

Thanks, I'm fox that too.

Quoted 8 lines
Quoted 2 lines

Does that make it install when using busybox init also?

Yes it does.

Only when systemd is selected, it doesn't install anything. So ideally
you should also add a systemd unit file.

As I'm not building systemd in any buildroot / beaglebone project, I think I'll wait with adding the systemd unit file until I can test it more. Or if someone beats me to it.

Version 2 of the patch series on it's way...

Cheers,
Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130511/95081d5a/attachment.html>

#3 lore raw

PATCH 3/5 am33x-cm3: add FW for suspend/resume

Quoted 5 lines · Anders Darander

On 11 May 2013 08:36, Arnout Vandecappelle <[email protected] <mailto:[email protected]>> wrote:

[snip]

Quoted 11 lines

I get a lot of

warning: switch -mcpu=cortex-m3 conflicts with -march=armv7-a switch [enabled by default]

but I guess these are harmless.

(the -march=armv7-a is added by the toolchain wrapper).

Using what toolchain?

Sourcery external toolchain.

Quoted 3 lines

I'm not seeing these warning (and neither am I
seeing any -march=armv7-a) in my test builds. I'm using the buildroot toolchain generated with this patch series applied to the 2013.05-rc1 tag.

OK, that answers my question if you had tested it with an internal
toolchain :-)

Quoted 22 lines

But I'm not 100% sure if a custom toolchain will actually build for
the correct architecture. Could you try if the result of something built with the buildroot toolchain works correctly? If you want, I can send you the .bin file so you don't have to wait an hour for the whole toolchain to compile. Or, if you have actually tested it with a buildroot toolchain, could you try if it also works with an external Sourcery and/or Linaro toolchain?

> init scripts are installed by a separate variable, >AM33X_CM3_INSTALL_INIT_SYSV. And of course, the same remark
about the
>-D
>option applies.

Thanks, I'm fox that too.

Does that make it install when using busybox init also?

Yes it does.

Quoted 7 lines

Only when systemd is selected, it doesn't install anything. So
ideally you should also add a systemd unit file.

As I'm not building systemd in any buildroot / beaglebone project, I think I'll wait with adding the systemd unit file until I can test it more. Or if someone beats me to it.

Fair enough.

Regards,
Arnout

Quoted 5 lines

Version 2 of the patch series on it's way...

Cheers,
Anders

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F