diff options
author | QuIC Gerrit Code Review <gerrit@quicinc.com> | 2009-12-17 11:17:47 -0800 |
---|---|---|
committer | QuIC Gerrit Code Review <gerrit@quicinc.com> | 2009-12-17 11:17:47 -0800 |
commit | 2b0315b56f74e8d16da273f6f765333c8ae3b53f (patch) | |
tree | 75906548d3b264897c9091f0d72697bbe7f18fae | |
parent | a29c75e83a2017219a4526b915848be254c24e3e (diff) | |
parent | bbec2b0c4775dc4c50e67d0b93d5bcf57f0825ff (diff) | |
download | lk-2b0315b56f74e8d16da273f6f765333c8ae3b53f.tar.gz |
Merge change Ibba4ccaa
* changes:
[nandwrite]: Disable bootstrap2 and app thread creation for nandwrite
-rw-r--r-- | app/nandwrite/nandwrite.c | 6 | ||||
-rw-r--r-- | kernel/main.c | 31 |
2 files changed, 32 insertions, 5 deletions
diff --git a/app/nandwrite/nandwrite.c b/app/nandwrite/nandwrite.c index d37011b7..3173a569 100644 --- a/app/nandwrite/nandwrite.c +++ b/app/nandwrite/nandwrite.c @@ -190,15 +190,11 @@ void handle_command(const char *cmd, unsigned a0, unsigned a1, unsigned a2) jtag_fail("unknown command"); } -void nandwrite_init(const struct app_descriptor *app) +void nandwrite_init(void) { page_size = flash_page_size(); page_mask = page_size - 1; jtag_cmd_loop(handle_command); } -APP_START(nandwrite) - .init = nandwrite_init, -APP_END - diff --git a/kernel/main.c b/kernel/main.c index e9c84adc..f48ea555 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -1,6 +1,8 @@ /* * Copyright (c) 2008 Travis Geiselbrecht * + * Copyright (c) 2009, Code Aurora Forum. All rights reserved. + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, @@ -39,6 +41,10 @@ extern int _end; static int bootstrap2(void *arg); +#if (ENABLE_NANDWRITE) +void bootstrap_nandwrite(void); +#endif + static void call_constructors(void) { void **ctor; @@ -92,6 +98,7 @@ void kmain(void) dprintf(SPEW, "initializing timers\n"); timer_init(); +#if (!ENABLE_NANDWRITE) // create a thread to complete system initialization dprintf(SPEW, "creating bootstrap completion thread\n"); thread_resume(thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE)); @@ -101,6 +108,9 @@ void kmain(void) // become the idle thread thread_become_idle(); +#else + bootstrap_nandwrite(); +#endif } int main(void); @@ -125,3 +135,24 @@ static int bootstrap2(void *arg) return 0; } +#if (ENABLE_NANDWRITE) +void bootstrap_nandwrite(void) +{ + dprintf(SPEW, "top of bootstrap2()\n"); + + arch_init(); + + // initialize the rest of the platform + dprintf(SPEW, "initializing platform\n"); + platform_init(); + + // initialize the target + dprintf(SPEW, "initializing target\n"); + target_init(); + + dprintf(SPEW, "calling nandwrite_init()\n"); + nandwrite_init(); + + return 0; +} +#endif |