Skip to contentSkip to conversation

Add (Freescale) elftosb host package

PATCH New Maxime Ripard 2 participants 4 messages Jul 18, 2012 – Jul 20, 2012 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add (Freescale) elftosb host package

From: Eric Jarrige <[email protected]>

Elftosb is a Freescale toolset to build binary image files (like U-Boot.sb) to be used with CPUs imx23, imx28, stp37xx

---
 package/elftosb/elftosb.mk                         |   28 ++++++++++++++++++++
 .../elftosb/elftosb10.12.01-fixes_includes.patch   |   19 +++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 package/elftosb/elftosb.mk
 create mode 100644 package/elftosb/elftosb10.12.01-fixes_includes.patch
package/elftosb/elftosb.mk new file +28 -0
new file mode 100644
index 0000000..75b95a5
@@ -0,0 +1,28 @@
+#############################################################
+#
+# elftosb
+#
+#############################################################
+ELFTOSB_VERSION = 10.12.01
+ELFTOSB_SOURCE = elftosb-$(ELFTOSB_VERSION).tar.gz
+ELFTOSB_SITE = http://repository.timesys.com/buildsources/e/elftosb/elftosb-$(ELFTOSB_VERSION)
+
+define HOST_ELFTOSB_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) all
+endef
+
+define HOST_ELFTOSB_INSTALL_CMDS
+	$(INSTALL) -D $(@D)/bld/linux/elftosb $(HOST_DIR)/usr/bin/elftosb
+	$(INSTALL) -D $(@D)/bld/linux/keygen $(HOST_DIR)/usr/bin/keygen
+	$(INSTALL) -D $(@D)/bld/linux/sbtool $(HOST_DIR)/usr/bin/sbtool
+endef
+
+define HOST_ELFTOSB_CLEAN_CMDS
+	rm -rf $(@D)/bld/linux
+	rm -f $(HOST_DIR)/usr/bin/elftosb
+	rm -f $(HOST_DIR)/usr/bin/keygen
+	rm -f $(HOST_DIR)/usr/bin/sbtool
+endef
+
+$(eval $(call GENTARGETS,host))
+
package/elftosb/elftosb10.12.01-fixes_includes.patch new file +19 -0
new file mode 100644
index 0000000..eaf8eba
@@ -0,0 +1,19 @@
+This patch uses system include files instead of a hard coded system path to fixe
+potential compilation failure on systems that do not populate system header
+files in /usr/include/..
+
+Signed-off-by: Eric Jarrige <[email protected]>
+---
+Index: host-elftosb-10.12.01/common/stdafx.h
+===================================================================
+--- host-elftosb-10.12.01.orig/common/stdafx.h	2012-01-30 12:43:35.000000000 +0100
++++ host-elftosb-10.12.01/common/stdafx.h	2012-01-30 12:43:54.000000000 +0100
+@@ -27,7 +27,7 @@
+ // For Linux systems only, types.h only defines the signed
+ // integer types.  This is not professional code.
+ // Update: They are defined in the header files in the more recent version of redhat enterprise gcc.
+-#include "/usr/include/sys/types.h"
++#include <sys/types.h>
+ #include <stdint.h>
+ //typedef unsigned long uint32_t;
+ //typedef unsigned short uint16_t;
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/2 Add MXS bootlets package

MXS platforms (imx23 and imx28) are relying on bootlets as their first stage bootloaders, that can then either start a regular second stage bootloader or directly a Linux kernel. However, the Makefile allows only to build u-boot and linux images at the same time, which is not very convenient as we will more likely use only one of them, so we need to duplicate a bit what is already done so that we are able to choose what we want to generate.

---
 boot/Config.in                    |    1 +
 boot/common.mk                    |    2 +-
 boot/mxs-bootlets/Config.in       |   91 ++++++++++++++++++++++++++++++++++
 boot/mxs-bootlets/barebox_ivt.bd  |   34 +++++++++++++
 boot/mxs-bootlets/mxs-bootlets.mk |   97 +++++++++++++++++++++++++++++++++++++
 5 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 boot/mxs-bootlets/Config.in
 create mode 100644 boot/mxs-bootlets/barebox_ivt.bd
 create mode 100644 boot/mxs-bootlets/mxs-bootlets.mk
boot/Config.in +1 -0
index f8ab1cf..5252a49 100644
@@ -5,6 +5,7 @@ source "boot/at91dataflashboot/Config.in"
 source "boot/barebox/Config.in"
 source "boot/grub/Config.in"
 source "boot/lpc32xxcdl/Config.in"
+source "boot/mxs-bootlets/Config.in"
 source "boot/syslinux/Config.in"
 source "boot/uboot/Config.in"
 source "boot/xloader/Config.in"
boot/common.mk +1 -1
index dc0bfb4..b315fe8 100644
@@ -1 +1 @@
-include boot/*/*.mk
\ No newline at end of file
+include boot/*/*.mk
boot/mxs-bootlets/Config.in new file +91 -0

91 lines not on this page · raw message

boot/mxs-bootlets/barebox_ivt.bd new file +34 -0
new file mode 100644
index 0000000..e02ddd6
@@ -0,0 +1,34 @@
+// STMP378x ROM command script to load and run U-Boot
+
+sources {
+	power_prep="./power_prep/power_prep";
+	sdram_prep="./boot_prep/boot_prep";
+	barebox="./barebox";
+}
+
+section (0) {
+
+	//----------------------------------------------------------
+	// Power Supply initialization
+	//----------------------------------------------------------
+
+	load power_prep;
+	load ivt (entry = power_prep:_start) > 0x8000;
+	hab call 0x8000;
+
+	//----------------------------------------------------------
+	// SDRAM initialization
+	//----------------------------------------------------------
+
+	load sdram_prep;
+        load ivt (entry = sdram_prep:_start) > 0x8000;
+        hab call 0x8000;
+	//----------------------------------------------------------
+	//  Load and call u_boot - ELF ARM image
+	//----------------------------------------------------------
+
+        load barebox;
+        load ivt (entry = barebox:exception_vectors) > 0x8000;
+	hab call 0x8000;
+
+}
boot/mxs-bootlets/mxs-bootlets.mk new file +97 -0

97 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 Add MXS bootlets package

Le Wed, 18 Jul 2012 18:02:43 +0200,
Maxime Ripard <[email protected]> a ?crit :

Quoted 9 lines

MXS platforms (imx23 and imx28) are relying on bootlets as their first stage bootloaders, that can then either start a regular second stage bootloader or directly a Linux kernel. However, the Makefile allows only to build u-boot and linux images at the same time, which is not very convenient as we will more likely use only one of them, so we need to duplicate a bit what is already done so that we are able to choose what we want to generate.

Applied with minor fixes.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 1/2 Add (Freescale) elftosb host package

In reply to Maxime Ripard

Le Wed, 18 Jul 2012 18:02:42 +0200,
Maxime Ripard <[email protected]> a ?crit :

Quoted 7 lines

From: Eric Jarrige <[email protected]>

Elftosb is a Freescale toolset to build binary image files (like U-Boot.sb) to be used with CPUs imx23, imx28, stp37xx

Applied with minor fixes.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com