summaryrefslogtreecommitdiffstats
path: root/meta/packages/x-load
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-10-10 11:56:19 +0000
committerRichard Purdie <richard@openedhand.com>2008-10-10 11:56:19 +0000
commit457ae5ada547f8f03a5963f40e4f403dd0244a2b (patch)
treecb8a51afe2c96f9c11b7f04f128895e6e3b05d55 /meta/packages/x-load
parentfe795de8f54b4270bc3fcf7b87c06ccf6d837665 (diff)
downloadpoky-457ae5ada547f8f03a5963f40e4f403dd0244a2b.tar.gz
Add overo
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5477 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/x-load')
-rw-r--r--meta/packages/x-load/files/signGP.c73
-rw-r--r--meta/packages/x-load/signgp-native.bb14
-rw-r--r--meta/packages/x-load/x-load-git/beagleboard/armv7-a.patch11
-rw-r--r--meta/packages/x-load/x-load-git/beagleboard/name.patch14
-rw-r--r--meta/packages/x-load/x-load-git/omap3evm/armv7-a.patch11
-rw-r--r--meta/packages/x-load/x-load-git/overo/armv7-a.patch11
-rw-r--r--meta/packages/x-load/x-load.inc46
-rw-r--r--meta/packages/x-load/x-load_git.bb27
8 files changed, 207 insertions, 0 deletions
diff --git a/meta/packages/x-load/files/signGP.c b/meta/packages/x-load/files/signGP.c
new file mode 100644
index 0000000000..0e8ed07f52
--- /dev/null
+++ b/meta/packages/x-load/files/signGP.c
@@ -0,0 +1,73 @@
1//
2// signGP.c
3// Read the x-load.bin file and write out the x-load.bin.ift file.
4// The signed image is the original pre-pended with the size of the image
5// and the load address. If not entered on command line, file name is
6// assumed to be x-load.bin in current directory and load address is
7// 0x40200800.
8
9#include <stdio.h>
10#include <stdlib.h>
11#include <fcntl.h>
12#include <sys/stat.h>
13#include <string.h>
14#include <malloc.h>
15
16
17main(int argc, char *argv[])
18{
19 int i;
20 char ifname[FILENAME_MAX], ofname[FILENAME_MAX], ch;
21 FILE *ifile, *ofile;
22 unsigned long loadaddr, len;
23 struct stat sinfo;
24
25
26 // Default to x-load.bin and 0x40200800.
27 strcpy(ifname, "x-load.bin");
28 loadaddr = 0x40200800;
29
30 if ((argc == 2) || (argc == 3))
31 strcpy(ifname, argv[1]);
32
33 if (argc == 3)
34 loadaddr = strtol(argv[2], NULL, 16);
35
36 // Form the output file name.
37 strcpy(ofname, ifname);
38 strcat(ofname, ".ift");
39
40 // Open the input file.
41 ifile = fopen(ifname, "rb");
42 if (ifile == NULL) {
43 printf("Cannot open %s\n", ifname);
44 exit(0);
45 }
46
47 // Get file length.
48 stat(ifname, &sinfo);
49 len = sinfo.st_size;
50
51 // Open the output file and write it.
52 ofile = fopen(ofname, "wb");
53 if (ofile == NULL) {
54 printf("Cannot open %s\n", ofname);
55 fclose(ifile);
56 exit(0);
57 }
58
59 // Pad 1 sector of zeroes.
60 //ch = 0x00;
61 //for (i=0; i<0x200; i++)
62 // fwrite(&ch, 1, 1, ofile);
63
64 fwrite(&len, 1, 4, ofile);
65 fwrite(&loadaddr, 1, 4, ofile);
66 for (i=0; i<len; i++) {
67 fread(&ch, 1, 1, ifile);
68 fwrite(&ch, 1, 1, ofile);
69 }
70
71 fclose(ifile);
72 fclose(ofile);
73}
diff --git a/meta/packages/x-load/signgp-native.bb b/meta/packages/x-load/signgp-native.bb
new file mode 100644
index 0000000000..1cbd001932
--- /dev/null
+++ b/meta/packages/x-load/signgp-native.bb
@@ -0,0 +1,14 @@
1LICENSE = "unknown"
2DESCRIPTION = "Tool to sign omap3 x-loader images"
3
4inherit native
5SRC_URI = "file://signGP.c"
6
7do_compile() {
8 ${CC} ${WORKDIR}/signGP.c -o signGP
9}
10
11do_stage() {
12 install -d ${STAGING_BINDIR_NATIVE}
13 install -m 0755 signGP ${STAGING_BINDIR_NATIVE}
14}
diff --git a/meta/packages/x-load/x-load-git/beagleboard/armv7-a.patch b/meta/packages/x-load/x-load-git/beagleboard/armv7-a.patch
new file mode 100644
index 0000000000..3131cda6bb
--- /dev/null
+++ b/meta/packages/x-load/x-load-git/beagleboard/armv7-a.patch
@@ -0,0 +1,11 @@
1--- git/cpu/omap3/config.mk-orig 2008-05-27 16:46:45.000000000 -0700
2+++ git/cpu/omap3/config.mk 2008-05-29 12:50:49.000000000 -0700
3@@ -23,7 +23,7 @@
4 PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
5 -msoft-float
6
7-PLATFORM_CPPFLAGS += -march=armv7a
8+PLATFORM_CPPFLAGS += -march=armv7-a
9 # =========================================================================
10 #
11 # Supply options according to compiler version
diff --git a/meta/packages/x-load/x-load-git/beagleboard/name.patch b/meta/packages/x-load/x-load-git/beagleboard/name.patch
new file mode 100644
index 0000000000..98dcbae497
--- /dev/null
+++ b/meta/packages/x-load/x-load-git/beagleboard/name.patch
@@ -0,0 +1,14 @@
1--- git/Makefile-orig 2008-07-29 22:31:03.000000000 -0700
2+++ git/Makefile 2008-07-29 22:34:36.000000000 -0700
3@@ -152,9 +152,9 @@ omap3evm_config : unconfig
4 overo_config : unconfig
5 @./mkconfig $(@:_config=) arm omap3 overo
6
7-omap3530beagle_config : unconfig
8+beagleboard_config : unconfig
9
10- @./mkconfig $(@:_config=) arm omap3 omap3530beagle
11+ @./mkconfig omap3530beagle arm omap3 omap3530beagle
12
13 #########################################################################
14
diff --git a/meta/packages/x-load/x-load-git/omap3evm/armv7-a.patch b/meta/packages/x-load/x-load-git/omap3evm/armv7-a.patch
new file mode 100644
index 0000000000..3131cda6bb
--- /dev/null
+++ b/meta/packages/x-load/x-load-git/omap3evm/armv7-a.patch
@@ -0,0 +1,11 @@
1--- git/cpu/omap3/config.mk-orig 2008-05-27 16:46:45.000000000 -0700
2+++ git/cpu/omap3/config.mk 2008-05-29 12:50:49.000000000 -0700
3@@ -23,7 +23,7 @@
4 PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
5 -msoft-float
6
7-PLATFORM_CPPFLAGS += -march=armv7a
8+PLATFORM_CPPFLAGS += -march=armv7-a
9 # =========================================================================
10 #
11 # Supply options according to compiler version
diff --git a/meta/packages/x-load/x-load-git/overo/armv7-a.patch b/meta/packages/x-load/x-load-git/overo/armv7-a.patch
new file mode 100644
index 0000000000..3131cda6bb
--- /dev/null
+++ b/meta/packages/x-load/x-load-git/overo/armv7-a.patch
@@ -0,0 +1,11 @@
1--- git/cpu/omap3/config.mk-orig 2008-05-27 16:46:45.000000000 -0700
2+++ git/cpu/omap3/config.mk 2008-05-29 12:50:49.000000000 -0700
3@@ -23,7 +23,7 @@
4 PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
5 -msoft-float
6
7-PLATFORM_CPPFLAGS += -march=armv7a
8+PLATFORM_CPPFLAGS += -march=armv7-a
9 # =========================================================================
10 #
11 # Supply options according to compiler version
diff --git a/meta/packages/x-load/x-load.inc b/meta/packages/x-load/x-load.inc
new file mode 100644
index 0000000000..01db413b12
--- /dev/null
+++ b/meta/packages/x-load/x-load.inc
@@ -0,0 +1,46 @@
1DESCRIPTION = "x-load bootloader loader"
2SECTION = "bootloaders"
3PRIORITY = "optional"
4LICENSE = "GPL"
5
6DEPENDS = "signgp-native"
7
8PARALLEL_MAKE=""
9
10EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"
11
12XLOAD_MACHINE ?= "${MACHINE}_config"
13
14XLOAD_IMAGE ?= "x-load-${MACHINE}-${PV}-${PR}.bin.ift"
15XLOAD_SYMLINK ?= "x-load-${MACHINE}.bin.ift"
16MLO_IMAGE ?= "MLO-${MACHINE}-${PV}-${PR}"
17MLO_SYMLINK ?= "MLO-${MACHINE}"
18
19do_compile () {
20 unset LDFLAGS
21 unset CFLAGS
22 unset CPPFLAGS
23 oe_runmake distclean
24 oe_runmake ${XLOAD_MACHINE}
25 oe_runmake
26}
27
28do_deploy () {
29 signGP ${S}/x-load.bin
30 install -d ${DEPLOY_DIR_IMAGE}
31 install ${S}/x-load.bin.ift ${DEPLOY_DIR_IMAGE}/${XLOAD_IMAGE}
32 install ${S}/x-load.bin.ift ${DEPLOY_DIR_IMAGE}/${MLO_IMAGE}
33 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${XLOAD_IMAGE}
34 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${MLO_IMAGE}
35
36 cd ${DEPLOY_DIR_IMAGE}
37 rm -f ${XLOAD_SYMLINK}
38 ln -sf ${XLOAD_IMAGE} ${XLOAD_SYMLINK}
39 rm -f ${MLO_SYMLINK}
40 ln -sf ${MLO_IMAGE} ${MLO_SYMLINK}
41 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${XLOAD_SYMLINK}
42 package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${MLO_SYMLINK}
43}
44do_deploy[dirs] = "${S}"
45addtask deploy before do_build after do_compile
46
diff --git a/meta/packages/x-load/x-load_git.bb b/meta/packages/x-load/x-load_git.bb
new file mode 100644
index 0000000000..829ec93ec6
--- /dev/null
+++ b/meta/packages/x-load/x-load_git.bb
@@ -0,0 +1,27 @@
1require x-load.inc
2
3FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/x-load-git/${MACHINE}"
4
5SRCREV = "65ed00323f3807197a83abc75d62ed2a8d3f60de"
6
7PV = "1.42+${PR}+git${SRCREV}"
8PR="r12"
9
10SRC_URI = "git://www.sakoman.net/git/x-load-omap3.git;branch=master;protocol=git"
11
12SRC_URI_append_beagleboard = " \
13 file://name.patch;patch=1 \
14 file://armv7-a.patch;patch=1 \
15 "
16
17SRC_URI_append_omap3evm = " \
18 file://armv7-a.patch;patch=1 \
19 "
20
21SRC_URI_append_overo = " \
22 file://armv7-a.patch;patch=1 \
23 "
24
25S = "${WORKDIR}/git"
26
27PACKAGE_ARCH = "${MACHINE_ARCH}"