RaaA: Add initial Pandora support

More information: www.openpandora.org

Possible things to implement:
- Special button mappings
- Battery monitoring
- ALSA audio backend
- Automate creation of "pnd" (=binary) file

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29451 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Jarosch 2011-02-27 23:42:37 +00:00
parent 87f7dcf38e
commit 6e9e6a7571
13 changed files with 188 additions and 13 deletions

View file

@ -54,7 +54,7 @@
#define LOGF_ENABLE #define LOGF_ENABLE
#include "logf.h" #include "logf.h"
#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) #if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
#define PREFIX(_x_) sim_ ## _x_ #define PREFIX(_x_) sim_ ## _x_
#else #else
#define PREFIX(_x_) _x_ #define PREFIX(_x_) _x_

View file

@ -125,7 +125,7 @@
#define MAIN_NORETURN_ATTR #define MAIN_NORETURN_ATTR
#endif #endif
#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) #if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
#include "sim_tasks.h" #include "sim_tasks.h"
#include "system-sdl.h" #include "system-sdl.h"
#define HAVE_ARGV_MAIN #define HAVE_ARGV_MAIN
@ -351,7 +351,7 @@ static void init(void)
show_logo(); show_logo();
button_init(); button_init();
backlight_init(); backlight_init();
#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) #if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
sim_tasks_init(); sim_tasks_init();
#endif #endif
#if (CONFIG_PLATFORM & PLATFORM_ANDROID) #if (CONFIG_PLATFORM & PLATFORM_ANDROID)

View file

@ -217,7 +217,7 @@ static const char graphic_numeric[] = "graphic,numeric";
#define DEFAULT_FONTNAME "15-Adobe-Helvetica" #define DEFAULT_FONTNAME "15-Adobe-Helvetica"
#elif LCD_HEIGHT <= 400 #elif LCD_HEIGHT <= 400
#define DEFAULT_FONTNAME "16-Adobe-Helvetica" #define DEFAULT_FONTNAME "16-Adobe-Helvetica"
#elif LCD_HEIGHT <= 480 && !(CONFIG_PLATFORM & PLATFORM_MAEMO) #elif LCD_HEIGHT <= 480 && !(CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA))
#define DEFAULT_FONTNAME "27-Adobe-Helvetica" #define DEFAULT_FONTNAME "27-Adobe-Helvetica"
#else #else
#define DEFAULT_FONTNAME "35-Adobe-Helvetica" #define DEFAULT_FONTNAME "35-Adobe-Helvetica"

View file

@ -91,7 +91,7 @@ bool dir_exists(const char *path)
#endif /* __PCTOOL__ */ #endif /* __PCTOOL__ */
#if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL|PLATFORM_MAEMO)) #if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
struct dirinfo dir_get_info(DIR* parent, struct dirent *entry) struct dirinfo dir_get_info(DIR* parent, struct dirent *entry)
{ {
(void)parent; (void)parent;

View file

@ -43,7 +43,7 @@
#define opendir opendir_android #define opendir opendir_android
#define mkdir mkdir_android #define mkdir mkdir_android
#define rmdir rmdir_android #define rmdir rmdir_android
#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) #elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
#define open sim_open #define open sim_open
#define remove sim_remove #define remove sim_remove
#define rename sim_rename #define rename sim_rename

View file

@ -86,6 +86,7 @@
#define PLATFORM_MAEMO4 (1<<4) #define PLATFORM_MAEMO4 (1<<4)
#define PLATFORM_MAEMO5 (1<<5) #define PLATFORM_MAEMO5 (1<<5)
#define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5) #define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5)
#define PLATFORM_PANDORA (1<<6)
/* CONFIG_KEYPAD */ /* CONFIG_KEYPAD */
#define PLAYER_PAD 1 #define PLAYER_PAD 1
@ -448,6 +449,8 @@ Lyre prototype 1 */
#include "config/nokian8xx.h" #include "config/nokian8xx.h"
#elif defined(NOKIAN900) #elif defined(NOKIAN900)
#include "config/nokian900.h" #include "config/nokian900.h"
#elif defined(PANDORA)
#include "config/pandora.h"
#else #else
/* no known platform */ /* no known platform */
#endif #endif
@ -511,7 +514,8 @@ Lyre prototype 1 */
#endif #endif
/* define for all cpus from ARM family */ /* define for all cpus from ARM family */
#if (CONFIG_PLATFORM & PLATFORM_MAEMO5) && defined(MAEMO_ARM_BUILD) #if ((CONFIG_PLATFORM & PLATFORM_MAEMO5) && defined(MAEMO_ARM_BUILD)) \
|| (CONFIG_PLATFORM & PLATFORM_PANDORA)
#define CPU_ARM #define CPU_ARM
#define ARM_ARCH 7 /* ARMv7 */ #define ARM_ARCH 7 /* ARMv7 */

View file

@ -0,0 +1,96 @@
/*
* This config file is for Rockbox as an application on the Nokia N8xx
*/
#define TARGET_TREE /* this target is using the target tree system */
/* We don't run on hardware directly */
#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_PANDORA)
/* For Rolo and boot loader */
#define MODEL_NUMBER 100
#define MODEL_NAME "Rockbox"
#define USB_NONE
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
/* define this if you have a colour LCD */
#define HAVE_LCD_COLOR
/* define this if you want album art for this target */
#define HAVE_ALBUMART
/* define this to enable bitmap scaling */
#define HAVE_BMP_SCALING
/* define this to enable JPEG decoding */
#define HAVE_JPEG
/* define this if you have access to the quickscreen */
#define HAVE_QUICKSCREEN
/* define this if you have access to the pitchscreen */
#define HAVE_PITCHSCREEN
/* define this if you would like tagcache to build on this target */
#define HAVE_TAGCACHE
/* LCD dimensions */
#define LCD_WIDTH 800
#define LCD_HEIGHT 480
#define LCD_DEPTH 16
#define LCD_PIXELFORMAT 565
/* define this to indicate your device's keypad */
#define HAVE_TOUCHSCREEN
#define HAVE_BUTTON_DATA
/* define this if you have RTC RAM available for settings */
//#define HAVE_RTC_RAM
/* The number of bytes reserved for loadable codecs */
#define CODEC_SIZE 0x100000
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000
#define AB_REPEAT_ENABLE
/* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC
/* Work around debug macro expansion of strncmp in scratchbox */
#define _HAVE_STRING_ARCH_strncmp
#define HAVE_SCROLLWHEEL
#define CONFIG_KEYPAD SDL_PAD
/* Use SDL audio/pcm in a SDL app build */
#define HAVE_SDL
#define HAVE_SDL_AUDIO
#define HAVE_SW_TONE_CONTROLS
/* Define current usage levels. */
#define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */
#define CURRENT_BACKLIGHT 30 /* TBD */
#define CURRENT_RECORD 0 /* no recording yet */
/* Define this to the CPU frequency */
/*
#define CPU_FREQ 48000000
*/
/* Offset ( in the firmware file's header ) to the file CRC */
#define FIRMWARE_OFFSET_FILE_CRC 0
/* Offset ( in the firmware file's header ) to the real data */
#define FIRMWARE_OFFSET_FILE_DATA 8
#define CONFIG_LCD LCD_COWOND2
/* Define this if a programmable hotkey is mapped */
//#define HAVE_HOTKEY
#define BOOTDIR "/.rockbox"

View file

@ -34,7 +34,7 @@ extern void ldebugf(const char* file, int line, const char *fmt, ...)
/* */ /* */
#if defined(SIMULATOR) && !defined(__PCTOOL__) \ #if defined(SIMULATOR) && !defined(__PCTOOL__) \
|| ((CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO)) && defined(DEBUG)) || ((CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO|PLATFORM_PANDORA)) && defined(DEBUG))
#define DEBUGF debugf #define DEBUGF debugf
#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__) #define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__)
#else #else

View file

@ -33,7 +33,7 @@ struct dirinfo {
#include <stdbool.h> #include <stdbool.h>
#include "file.h" #include "file.h"
#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) #if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
# define dirent_uncached sim_dirent # define dirent_uncached sim_dirent
# define DIR_UNCACHED SIM_DIR # define DIR_UNCACHED SIM_DIR
# define opendir_uncached sim_opendir # define opendir_uncached sim_opendir

View file

@ -46,7 +46,7 @@ extern int app_open(const char *name, int o, ...);
extern int app_creat(const char *name, mode_t mode); extern int app_creat(const char *name, mode_t mode);
extern int app_remove(const char* pathname); extern int app_remove(const char* pathname);
extern int app_rename(const char* path, const char* newname); extern int app_rename(const char* path, const char* newname);
# if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) # if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
# define filesize(x) sim_filesize(x) # define filesize(x) sim_filesize(x)
# define fsync(x) sim_fsync(x) # define fsync(x) sim_fsync(x)
# define ftruncate(x,y) sim_ftruncate(x,y) # define ftruncate(x,y) sim_ftruncate(x,y)

View file

@ -50,7 +50,7 @@ int key_to_button(int keyboard_key)
case SDLK_LEFT: case SDLK_LEFT:
new_btn = BUTTON_MIDLEFT; new_btn = BUTTON_MIDLEFT;
break; break;
#if (CONFIG_PLATFORM & PLATFORM_MAEMO) #if (CONFIG_PLATFORM & PLATFORM_MAEMO|PLATFORM_PANDORA)
case SDLK_RETURN: case SDLK_RETURN:
case SDLK_KP_ENTER: case SDLK_KP_ENTER:
#endif #endif

View file

@ -133,7 +133,7 @@ static int sdl_event_thread(void * param)
depth = 16; depth = 16;
flags = SDL_HWSURFACE|SDL_DOUBLEBUF; flags = SDL_HWSURFACE|SDL_DOUBLEBUF;
#if (CONFIG_PLATFORM & PLATFORM_MAEMO) #if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA))
/* Fullscreen mode for maemo app */ /* Fullscreen mode for maemo app */
flags |= SDL_FULLSCREEN; flags |= SDL_FULLSCREEN;
#endif #endif
@ -142,7 +142,7 @@ static int sdl_event_thread(void * param)
panicf("%s", SDL_GetError()); panicf("%s", SDL_GetError());
} }
#if (CONFIG_PLATFORM & PLATFORM_MAEMO) #if (CONFIG_PLATFORM & PLATFORM_MAEMO|PLATFORM_PANDORA)
/* Hide mouse cursor on real touchscreen device */ /* Hide mouse cursor on real touchscreen device */
SDL_ShowCursor(SDL_DISABLE); SDL_ShowCursor(SDL_DISABLE);
#endif #endif

75
tools/configure vendored
View file

@ -592,6 +592,48 @@ maemocc () {
fi fi
} }
pandoracc () {
# Note: The new "Ivanovic" pandora toolchain is not able to compile rockbox.
# You have to use the sebt3 toolchain:
# http://www.gp32x.com/board/index.php?/topic/58490-yactfeau/
PNDSDK="/usr/local/angstrom/arm"
if [ ! -x $PNDSDK/bin/arm-angstrom-linux-gnueabi-gcc ]; then
echo "Pandora SDK gcc not found in $PNDSDK/bin/arm-angstrom-linux-gnueabi-gcc"
exit
fi
PATH=$PNDSDK/bin:$PATH:$PNDSDK/arm-angstrom-linux-gnueabi/usr/bin
PKG_CONFIG_PATH=$PNDSDK/arm-angstrom-linux-gnueabi/usr/lib/pkgconfig
LDOPTS="-L$PNDSDK/arm-angstrom-linux-gnueabi/usr/lib -Wl,-rpath,$PNDSDK/arm-angstrom-linux-gnueabi/usr/lib $LDOPTS"
PKG_CONFIG="pkg-config"
GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef//`
GCCOPTS="$GCCOPTS -fno-builtin -g -I\$(SIMDIR)"
GCCOPTIMIZE=''
LDOPTS="-lm -ldl $LDOPTS"
GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs"
SHARED_FLAG="-shared"
endian="little"
thread_support="HAVE_SIGALTSTACK_THREADS"
# Include path
GCCOPTS="-I$PNDSDK/arm-angstrom-linux-gnueabi/usr/include"
# Set up compiler
gccchoice="4.3.3"
prefixtools "$PNDSDK/bin/arm-angstrom-linux-gnueabi-"
# Detect SDL
GCCOPTS="$GCCOPTS `$PKG_CONFIG --cflags sdl`"
LDOPTS="$LDOPTS `$PKG_CONFIG --libs sdl`"
# Compiler options
GCCOPTS="$GCCOPTS -O2 -fno-strict-aliasing"
GCCOPTS="$GCCOPTS -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
GCCOPTS="$GCCOPTS -ffast-math -fsingle-precision-constant"
}
androidcc () { androidcc () {
if [ -z "$ANDROID_SDK_PATH" ]; then if [ -z "$ANDROID_SDK_PATH" ]; then
echo "ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH" echo "ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH"
@ -1230,6 +1272,7 @@ cat <<EOF
201) Android 171) HD300 201) Android 171) HD300
202) Nokia N8xx 202) Nokia N8xx
203) Nokia N900 203) Nokia N900
204) Pandora
EOF EOF
@ -3012,6 +3055,33 @@ fi
t_model="app" t_model="app"
;; ;;
204|pandora)
application="yes"
target_id=77
modelname="pandora"
app_type="sdl-app"
target="-DPANDORA"
sharedir="rockbox/share"
bindir="rockbox/bin"
libdir="rockbox/lib"
memory=8
uname=`uname`
pandoracc
tool="cp "
boottool="cp "
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
output="rockbox"
bootoutput="rockbox"
appextra="recorder:gui:radio"
plugins="yes"
swcodec="yes"
# architecture, manufacturer and model for the target-tree build
t_cpu="hosted"
t_manufacturer="pandora"
t_model="app"
;;
*) *)
echo "Please select a supported target platform!" echo "Please select a supported target platform!"
exit 7 exit 7
@ -3469,10 +3539,15 @@ if test -n "$t_cpu"; then
# Maemo needs the SDL port, too # Maemo needs the SDL port, too
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/app" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/app"
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl"
elif [ "$t_cpu" = "hosted" ] && [ "$t_manufacturer" = "pandora" ]; then
# Pandora needs the SDL port, too
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl/app"
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl"
elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl"
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted"
fi fi
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer"
TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu"
GCCOPTS="$GCCOPTS" GCCOPTS="$GCCOPTS"