move usbgecko defines to Makefile, fix warnings

This commit is contained in:
dhewg 2010-07-09 01:27:09 +02:00
parent f432ae5661
commit f742371e9e
7 changed files with 21 additions and 9 deletions

View File

@ -1,5 +1,12 @@
include starlet.mk
# disables debug spew over usbgecko
#CFLAGS += -DNDEBUG
# enables LFCR linefeeds for usbgecko output, useful for some terminal apps
#CFLAGS += -DGECKO_LFCR
# uses the 'safe' version of the usbgecko receive and send functions
#CFLAGS += -DGECKO_SAFE
ASFLAGS += -D_LANGUAGE_ASSEMBLY
CFLAGS += -DCAN_HAZ_IRQ -DCAN_HAZ_IPC
LDSCRIPT = mini.ld

View File

@ -217,8 +217,10 @@ int boot2_load(int copy)
memset(boot2_iv, 0, 16);
memcpy(boot2_iv, &tmd.contents.index, 2); //just zero anyway...
#ifndef NDEBUG
u32 *kp = (u32*)boot2_key;
gecko_printf("boot2 title key: %08x%08x%08x%08x\n", kp[0], kp[1], kp[2], kp[3]);
#endif
boot2_content_size = (tmd.contents.size + 15) & ~15;
gecko_printf("boot2 content size: 0x%x (padded: 0x%x)\n",

View File

@ -55,6 +55,8 @@ void exception_initialize(void)
void exc_handler(u32 type, u32 spsr, u32 *regs)
{
(void) spsr;
if (type > 8) type = 8;
gecko_printf("\nException %d (%s):\n", type, exceptions[type]);

11
gecko.c
View File

@ -23,9 +23,6 @@ Copyright (C) 2009 Andre Heider "dhewg" <dhewg@wiibrew.org>
#include "powerpc_elf.h"
#include "gecko.h"
//#define GECKO_LFCR
//#define GECKO_SAFE
static u8 gecko_console_enabled = 0;
static u32 _gecko_command(u32 command)
@ -56,6 +53,7 @@ static u32 _gecko_getid(void)
return i;
}
#ifndef NDEBUG
static u32 _gecko_sendbyte(u8 sendbyte)
{
u32 i = 0;
@ -64,6 +62,7 @@ static u32 _gecko_sendbyte(u8 sendbyte)
return 1; // Return 1 if byte was sent
return 0;
}
#endif
static u32 _gecko_recvbyte(u8 *recvbyte)
{
@ -78,7 +77,7 @@ static u32 _gecko_recvbyte(u8 *recvbyte)
return 0;
}
#ifdef GECKO_SAFE
#if !defined(NDEBUG) && defined(GECKO_SAFE)
static u32 _gecko_checksend(void)
{
u32 i = 0;
@ -135,7 +134,7 @@ static int gecko_recvbuffer(void *buffer, u32 size)
}
#endif
#ifndef GECKO_SAFE
#if !defined(NDEBUG) && !defined(GECKO_SAFE)
static int gecko_sendbuffer(const void *buffer, u32 size)
{
u32 left = size;
@ -175,7 +174,7 @@ static int gecko_recvbuffer_safe(void *buffer, u32 size)
}
#endif
#ifdef GECKO_SAFE
#if !defined(NDEBUG) && defined(GECKO_SAFE)
static int gecko_sendbuffer_safe(const void *buffer, u32 size)
{
u32 left = size;

View File

@ -1,6 +1,6 @@
#!/bin/env python
#!/usr/bin/env python
import sys, os, struct, sha
import sys, os, struct
loaderfile = sys.argv[1]
elffile = sys.argv[2]

2
nand.c
View File

@ -249,6 +249,8 @@ void nand_initialize(void)
int nand_correct(u32 pageno, void *data, void *ecc)
{
(void) pageno;
u8 *dp = (u8*)data;
u32 *ecc_read = (u32*)((u8*)ecc+0x30);
u32 *ecc_calc = (u32*)((u8*)ecc+0x40);

View File

@ -18,7 +18,7 @@ Copyright (C) 2008, 2009 Hector Martin "marcan" <marcan@marcansoft.com>
#include <stdarg.h>
#ifndef LOADER
#if !defined(LOADER) && !defined(NDEBUG)
static char ascii(char s) {
if(s < 0x20) return '.';
if(s > 0x7E) return '.';