aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Uddaraju <chandanu@quicinc.com>2009-12-16 13:27:55 -0800
committerChandan Uddaraju <chandanu@quicinc.com>2009-12-16 13:31:20 -0800
commitbbec2b0c4775dc4c50e67d0b93d5bcf57f0825ff (patch)
treed19a9467bf7e99941661bbe9e49cc106b8e9344b
parent19012bc0a8cca035c18c9937d6e6469d8cd2c665 (diff)
downloadlk-bbec2b0c4775dc4c50e67d0b93d5bcf57f0825ff.tar.gz
[nandwrite]: Disable bootstrap2 and app thread creation for nandwrite
-rw-r--r--app/nandwrite/nandwrite.c6
-rw-r--r--kernel/main.c31
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