forked from len0rd/rockbox
Initial commit for the Sony NWZ linux port
SUPPORTED SERIES: - NWZ-E450 - NWZ-E460 - NWZ-E470 - NWZ-E580 - NWZ-A10 NOTES: - bootloader makefile convert an extra font to be installed alongside the bootloader since sysfont is way too small - the toolsicon bitmap comes from the Oxygen iconset - touchscreen driver is untested TODO: - implement audio routing driver (pcm is handled by pcm-alsa) - fix playback: it crashes on illegal instruction in DEBUG builds - find out why the browser starts at / instead of /contents - implement radio support - implement return to OF for usb handling - calibrate battery curve (NB: of can report a battery level on a 0-5 scale but probabl don't want to use that ?) - implement simulator build (we need a nice image of the player) - figure out if we can detect jack removal POTENTIAL TODOS: - try to build a usb serial gadget and gdbserver Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
This commit is contained in:
parent
142f80f07d
commit
1d121e8c08
89 changed files with 4439 additions and 2913 deletions
105
rbutil/mknwzboot/main.c
Normal file
105
rbutil/mknwzboot/main.c
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 by Amaury Pouly
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "mknwzboot.h"
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
printf("Usage: mknwzboot [options | file]...\n");
|
||||
printf("Options:\n");
|
||||
printf(" -h/--help Display this message\n");
|
||||
printf(" -o <file> Set output file\n");
|
||||
printf(" -b <file> Set boot file\n");
|
||||
printf(" -d/--debug Enable debug output\n");
|
||||
printf(" -x Dump device informations\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *outfile = NULL;
|
||||
char *bootfile = NULL;
|
||||
bool debug = false;
|
||||
|
||||
if(argc == 1)
|
||||
usage();
|
||||
|
||||
while(1)
|
||||
{
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"out-file", required_argument, 0, 'o'},
|
||||
{"boot-file", required_argument, 0, 'b'},
|
||||
{"debug", no_argument, 0, 'd'},
|
||||
{"dev-info", no_argument, 0, 'x'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
int c = getopt_long(argc, argv, "ho:b:dx", long_options, NULL);
|
||||
if(c == -1)
|
||||
break;
|
||||
switch(c)
|
||||
{
|
||||
case 'd':
|
||||
debug = true;
|
||||
break;
|
||||
case 'h':
|
||||
usage();
|
||||
break;
|
||||
case 'o':
|
||||
outfile = optarg;
|
||||
break;
|
||||
case 'b':
|
||||
bootfile = optarg;
|
||||
break;
|
||||
case 'x':
|
||||
dump_nwz_dev_info("");
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
if(!outfile)
|
||||
{
|
||||
printf("You must specify an output file\n");
|
||||
return 1;
|
||||
}
|
||||
if(!bootfile)
|
||||
{
|
||||
printf("You must specify a boot file\n");
|
||||
return 1;
|
||||
}
|
||||
if(optind != argc)
|
||||
{
|
||||
printf("Extra arguments on command line\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int err = mknwzboot(bootfile, outfile, debug);
|
||||
printf("Result: %d\n", err);
|
||||
return err;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue