Skip to content

Commit

Permalink
removed redundancies
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrs committed Oct 20, 2012
1 parent 7509fda commit 9b71379
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
3 changes: 1 addition & 2 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void dump_settings(char * ignored __attribute__((unused))) {

HEADER_LEVEL0(atag);
DUMP_LEVEL1(settings.atag, start);
DUMP_LEVEL1(settings.atag, raddr);
DUMP_LEVEL1(settings.atag, size);
FOOTER_LEVEL0();

Expand All @@ -116,6 +115,6 @@ void dump_settings(char * ignored __attribute__((unused))) {
DUMP_LEVEL0(settings, kernel_loaded);

printl("kernel_cmdline = \"%s\"\n", settings.kernel_cmdline);
printl("serialnr = 0x%x%x\n", settings.serialnr[0], settings.serialnr[1]);
printl("serialnr = 0x%x%x\n", settings.serialnr[1], settings.serialnr[0]);

}
1 change: 0 additions & 1 deletion common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct params {

struct {
void* start; /* A separate section of memory for writing ATAGs */
void* raddr; /* Where the atags should be relocated to during booting */
size_t size;
} atag;

Expand Down
14 changes: 1 addition & 13 deletions kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

typedef void kentry(int, int, void*);

static void self_memcpy(char *dst, char *src, size_t size) {
while (size--) *dst++ = *src++;
}

void kernel_cmdline(char * cmdline) {
if (strlen(cmdline)) strncpy(settings.kernel_cmdline, cmdline, sizeof(settings.kernel_cmdline)-1);
printl("Kernel command line: \"%s\"\n", settings.kernel_cmdline);
Expand All @@ -45,21 +41,13 @@ void kernel_boot(char * ignored __attribute__((unused))) {
/* Build atag next */
if (atag_build()) return;

if (!settings.atag.raddr) settings.atag.raddr = settings.atag.start;

/* Relocate atags if need be */
if (settings.atag.start != settings.atag.raddr) {
self_memcpy(settings.atag.raddr, settings.atag.start, settings.atag.size);
}


clear_cache();
/* Disable D-Cache and MMU */
asm volatile("mrc p15, 0, r0, c1, c0, 0 \n"
"bic r0, r0, #0x5 \n"
"mcr p15, 0, r0, c1, c0,0 \n"
: : : "r0" );
/* Bye bye */
entry(0, settings.machine_id, settings.atag.raddr);
entry(0, settings.machine_id, settings.atag.start);
__builtin_unreachable();
}

0 comments on commit 9b71379

Please sign in to comment.