* [PATCH] redboot - add exec option to set board revision
@ 2010-05-13 14:02 Jose Vasconcellos
2010-05-13 14:47 ` Gary Thomas
0 siblings, 1 reply; 2+ messages in thread
From: Jose Vasconcellos @ 2010-05-13 14:02 UTC (permalink / raw)
To: ecos-patches
[-- Attachment #1: Type: text/plain, Size: 89 bytes --]
This patch adds an exec option (-v) to set the board revision
via the ATAG_REVISION tag.
[-- Attachment #2: redboot_revision.patch --]
[-- Type: text/x-patch, Size: 2282 bytes --]
diff --git a/packages/hal/arm/arch/current/src/redboot_linux_exec.c b/packages/hal/arm/arch/current/src/redboot_linux_exec.c
--- a/packages/hal/arm/arch/current/src/redboot_linux_exec.c
+++ b/packages/hal/arm/arch/current/src/redboot_linux_exec.c
@@ -90,7 +90,7 @@
"Execute an image - with MMU off",
"[-w timeout] [-b <load addr> [-l <length>]]\n"
" [-r <ramdisk addr> [-s <ramdisk length>]]\n"
- " [-c \"kernel command line\"] [-t <target> ] [<entry_point>]",
+ " [-c \"kernel command line\"] [-t <target> ] [-v <revision>] [<entry_point>]",
do_exec
);
@@ -311,9 +311,11 @@
int wait_time, res, num_opts;
bool base_addr_set, length_set, cmd_line_set;
bool ramdisk_addr_set, ramdisk_size_set;
+ bool revision_set;
+ unsigned long revision;
unsigned long base_addr, length;
unsigned long ramdisk_addr, ramdisk_size;
- struct option_info opts[7];
+ struct option_info opts[9];
char line[8];
char *cmd_line;
struct tag *params = (struct tag *)CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS;
@@ -352,7 +354,9 @@
(void **)&ramdisk_size, (bool *)&ramdisk_size_set, "ramdisk_size");
init_opts(&opts[6], 't', true, OPTION_ARG_TYPE_NUM,
&target, 0, "[physical] target address");
- num_opts = 7;
+ init_opts(&opts[7], 'v', true, OPTION_ARG_TYPE_NUM,
+ (void **)&revision, (bool *)&revision_set, "revision");
+ num_opts = 8;
#ifdef CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH
init_opts(&opts[num_opts], 'x', false, OPTION_ARG_TYPE_FLG,
(void **)&swap_endian, 0, "swap endianess");
@@ -384,6 +388,12 @@
params->u.initrd.size = ramdisk_size;
params = (struct tag *)((long *)params + params->hdr.size);
}
+ if (revision_set) {
+ params->hdr.size = (sizeof(struct tag_revision) + sizeof(struct tag_header))/sizeof(long);
+ params->hdr.tag = ATAG_REVISION;
+ params->u.revision.rev = revision;
+ params = (struct tag *)((long *)params + params->hdr.size);
+ }
if (cmd_line_set) {
params->hdr.size = (ROUNDUP(strlen(cmd_line)) + sizeof(struct tag_header))/sizeof(long);
params->hdr.tag = ATAG_CMDLINE;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] redboot - add exec option to set board revision
2010-05-13 14:02 [PATCH] redboot - add exec option to set board revision Jose Vasconcellos
@ 2010-05-13 14:47 ` Gary Thomas
0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2010-05-13 14:47 UTC (permalink / raw)
To: Jose Vasconcellos; +Cc: ecos-patches
On 05/13/2010 08:02 AM, Jose Vasconcellos wrote:
> This patch adds an exec option (-v) to set the board revision
> via the ATAG_REVISION tag.
What's it used for? (Why do you need this tag)
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-13 14:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-13 14:02 [PATCH] redboot - add exec option to set board revision Jose Vasconcellos
2010-05-13 14:47 ` Gary Thomas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).