mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org
Cc: David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH linux-firmware 1/4] dsp56k: Add makefile for building from source
Date: Sat, 17 Dec 2011 04:29:46 +0000	[thread overview]
Message-ID: <1324096186.2825.311.camel@deadeye> (raw)
In-Reply-To: <1324096119.2825.310.camel@deadeye>

[-- Attachment #1: Type: text/plain, Size: 2596 bytes --]

Some small amount of postprocessing is required after assembling
bootstrap.asm with a56.  Add a script and makefile for this.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 WHENCE                     |    4 +++-
 dsp56k/Makefile            |    6 ++++++
 dsp56k/concat-bootstrap.pl |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletions(-)
 create mode 100644 dsp56k/Makefile
 create mode 100644 dsp56k/concat-bootstrap.pl

diff --git a/WHENCE b/WHENCE
index bf216fe..7553628 100644
--- a/WHENCE
+++ b/WHENCE
@@ -372,10 +372,12 @@ Driver: dsp56k - Atari DSP56k support
 
 File: dsp56k/bootstrap.bin
 Source: dsp56k/bootstrap.asm
+Source: dsp56k/Makefile
+Source: dsp56k/concat-bootstrap.pl
 
 Licence: GPLv2 or later
 
-DSP56001 assembler, possibly buildable with a56 from 
+DSP56001 assembler, buildable with a56 from
 http://www.zdomain.com/a56.html
 
 --------------------------------------------------------------------------
diff --git a/dsp56k/Makefile b/dsp56k/Makefile
new file mode 100644
index 0000000..c758a28
--- /dev/null
+++ b/dsp56k/Makefile
@@ -0,0 +1,6 @@
+bootstrap.bin: bootstrap.asm concat-bootstrap.pl
+	a56 bootstrap.asm >/dev/null
+	perl concat-bootstrap.pl <a56.out >bootstrap.bin
+
+clean:
+	rm -f a56.out bootstrap.bin
diff --git a/dsp56k/concat-bootstrap.pl b/dsp56k/concat-bootstrap.pl
new file mode 100644
index 0000000..b6d9003
--- /dev/null
+++ b/dsp56k/concat-bootstrap.pl
@@ -0,0 +1,33 @@
+# Postprocessor for dsp56k bootstrap code.
+#
+# Copyright Ben Hutchings 2011.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+use strict;
+use warnings;
+
+my @memory;
+my %symbol;
+
+# Reconstruct memory image and symbol table
+while (<>) {
+    if (/^P ([0-9A-F]{4}) ([0-9A-F]{6})\n/) {
+	$memory[hex($1)] = hex($2);
+    } elsif (/^I ([0-9A-F]{6}) (\w+)\n/) {
+	$symbol{$2} = hex($1);
+    } else {
+	print STDERR "W: did not recognise line $.\n";
+    }
+}
+
+# Concatenate first and second stage.  Second stage is assembled
+# between 'upload' and 'upload_end', but initially loaded at
+# 'real' (end of the first stage).
+for (0 .. ($symbol{real} - 1), $symbol{upload} .. ($symbol{upload_end} - 1)) {
+    my $word = $memory[$_] || 0;
+    print pack('CCC', $word / 65536, ($word / 256) % 256, $word % 256);
+}
-- 
1.7.7.3




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2011-12-17  4:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17  4:28 [PATCH linux-firmware 0/4] Complete source for GPL'd firmware Ben Hutchings
2011-12-17  4:29 ` Ben Hutchings [this message]
2011-12-17  4:30 ` [PATCH linux-firmware 2/4] dvb-ttpci: Add source code and makefile Ben Hutchings
2011-12-17  4:30 ` [PATCH linux-firmware 3/4] keyspan_pda: Fix parse error with as31 version 2.3.1 Ben Hutchings
2011-12-17  4:31 ` [PATCH linux-firmware 4/4] keyspan_pda: Add makefile for building from source Ben Hutchings
2011-12-17  4:33 ` [PATCH linux-firmware 0/4] Complete source for GPL'd firmware Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324096186.2825.311.camel@deadeye \
    --to=ben@decadent.org.uk \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®