Index: bootloader/SOURCES =================================================================== --- bootloader/SOURCES (revision 17611) +++ bootloader/SOURCES (working copy) @@ -1,4 +1,6 @@ +#if 0 common.c +#endif #if defined(IPOD_ARCH) ipod.c Index: tools/configure =================================================================== --- tools/configure (revision 17611) +++ tools/configure (working copy) @@ -650,7 +650,7 @@ ################################################################## # Figure out target platform # - +uname=`uname` if [ "1" != `parse_args --target` ]; then buildfor=`parse_args --target`; else @@ -677,8 +677,8 @@ 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB 71) M:Robe 100 - ==Creative== ==Philips== - 90) Zen Vision:M 30GB 100) GoGear SA9200 + ==Creative== ==Philips== ==App== + 90) Zen Vision:M 30GB 100) GoGear SA9200 200) SDL 91) Zen Vision:M 60GB 92) Zen Vision @@ -1675,6 +1675,31 @@ t_manufacturer="philips" t_model="sa9200" ;; + + 200) + target_id=42 + modelname="sdl" + target="-DSDL" # The #define used in firmware/export/config.h for conditional compilation + memory=16 # how many megabytes of RAM + simcc # Which compiler to use, see the beginning of the file + tool="" #"$rootdir/tools/scramble -add=iax5" # Which command to use for creating a rockbox binary to be loaded by the boot loader + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" # How to create a monochrome bitmap + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" # How to create a native bitmap + bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" # How to create a monochrome bitmap for the remote lcd + bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" # How to create a native bitmap for the remote lcd + output="rockbox" # The name of the Rockbox binary file + appextra="gui" # What directories in the apps/ tree to include in compilation + archosrom="" # The name of the binary file if the device supports running directly from flash (mostly Archos related) + flash="" # The name of the Rockbox binary file if the device supports having the binary in flash (mostly Archos related) + plugins="yes" # Does it support plugins? + codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a" # What codecs it supports + # toolset is the tools within the tools directory that we build for this particular target. + toolset="$genericbitmaptools" + # architecture, manufacturer and model for the target-tree build + t_cpu="generic" + t_manufacturer="sdl" + #t_model="" + ;; *) echo "Please select a supported target platform!" Index: apps/Makefile =================================================================== --- apps/Makefile (revision 17611) +++ apps/Makefile (working copy) @@ -103,7 +103,7 @@ libspeex-rockbox: $(SILENT)mkdir -p $(OBJDIR)/libspeex-rockbox $(call PRINTS,MAKE in libspeex for rockbox core)$(MAKE) -C $(APPSDIR)/codecs/libspeex ROCKBOX_VOICE_CODEC=1 OBJDIR=$(OBJDIR)/libspeex-rockbox OUTPUT=$(BUILDDIR)/libspeex-rockbox.a - + build-codecs: $(SILENT)$(MAKE) -C codecs/lib OBJDIR=$(OBJDIR)/codecs/lib $(SILENT)$(MAKE) -C codecs OBJDIR=$(OBJDIR)/codecs @@ -141,8 +141,21 @@ $(OBJDIR)/rombox.elf : $(OBJS) $(LINKROM) $(DEPFILE) $(LIBROCKBOX) $(VOICE) $(BITMAPLIBS) $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lgcc $(LINKVOICE) $(LINKBITMAPS) -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map -ifndef SIMVER +#hack to test if its a sim or an SDL builds +temp=0 +ifdef SIMVER +temp=1 +endif +ifdef SDL +temp=1 +endif +ifeq "$(test)" "1" + +#if (!defined(SIMVER) && !defined(SDL)) + +#ifndef SIMVER + $(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) $(VOICE) $(BITMAPLIBS) $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR)/firmware -L$(BUILDDIR) -lrockbox $(LINKVOICE) $(LINKBITMAPS) -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map @@ -175,12 +188,6 @@ else # this is a simulator build -ifeq ($(SIMVER), win32) -# OK, this is ugly but we need it on the link line to make it do right -EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o -LDOPTS += -lwinmm -endif - # OS X's ld does not support -Map ifeq ($(UNAME), Darwin) SIMULATOR_MAP= Index: firmware/export/config-sdl.h =================================================================== --- firmware/export/config-sdl.h (revision 0) +++ firmware/export/config-sdl.h (revision 0) @@ -0,0 +1,206 @@ +/* + * This config file is for SDL targets + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 200 +#define MODEL_NAME "SDL" + +/* Taken from other targets*/ +#define VOLUME_MIN -730 +#define VOLUME_MAX 0 + +//#define HW_SAMPR_CAPS (SAMPR_CAP_44) + +/* define this if you have recording possibility */ +//#define HAVE_RECORDING + +//#define REC_SAMPR_CAPS (SAMPR_CAP_22) +//#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ +//#define REC_SAMPR_DEFAULT SAMPR_22 + +/* Define bitmask of input sources - recordable bitmask can be defined + explicitly if different */ +//#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) + +/* 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 if you have a light associated with the buttons */ +//#define HAVE_BUTTON_LIGHT + +/* 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 320 +#define LCD_HEIGHT 240 +#define LCD_DEPTH 16 /* 65536 colours */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ + +#ifndef BOOTLOADER +/* define this if you have LCD enable function */ +#define HAVE_LCD_ENABLE + +/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE + should be defined as well. */ +#define HAVE_LCD_SLEEP +#define HAVE_LCD_SLEEP_SETTING +#endif + +/* define this if you can flip your LCD */ +//#define HAVE_LCD_FLIP + +/* define this if you can invert the colours on your LCD */ +//#define HAVE_LCD_INVERT + +/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ + +#define CONFIG_KEYPAD SLD_PAD + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC +/* There is no hardware tone control */ +#define HAVE_SW_TONE_CONTROLS +/* The PP5024 has a built-in AustriaMicrosystems AS3514 */ +//#define HAVE_AS3514 + +/* define this if you have a real-time clock */ +#ifndef BOOTLOADER +//#define CONFIG_RTC RTC_AS3514 +#endif + +/* Define this if you have a software controlled poweroff */ +#define HAVE_SW_POWEROFF + +/* Some Sansa E200s seem to be FAT16 formatted */ +//#define HAVE_FAT16SUPPORT + +/* The number of bytes reserved for loadable codecs */ +#define CODEC_SIZE 0x80000 + +/* The number of bytes reserved for loadable plugins */ +#define PLUGIN_BUFFER_SIZE 0x80000 + +#define AB_REPEAT_ENABLE 1 + +/* FM Tuner */ +#define CONFIG_TUNER LV24020LP +#define HAVE_TUNER_PWR_CTRL + +/* Define this for LCD backlight available */ +#define HAVE_BACKLIGHT +#define HAVE_BACKLIGHT_BRIGHTNESS + +/* define this if the unit uses a scrollwheel for navigation */ +//#define HAVE_SCROLLWHEEL +/* define from which rotation speed [degree/sec] on the acceleration starts */ +//#define WHEEL_ACCEL_START 540 +/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */ +//#define WHEEL_ACCELERATION 1 + +/* define this if you have a flash memory storage */ +#define HAVE_FLASH_STORAGE + +/* define this if the flash memory uses the SecureDigital Memory Card protocol */ +//#define HAVE_ATA_SD + +#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 0 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ + +/* Hardware controlled charging? FIXME */ +//#define CONFIG_CHARGING CHARGING_SIMPLE + +/* define this if the unit can be powered or charged via USB */ +//#define HAVE_USB_POWER + +/** Non-simulator section **/ +#ifndef SIMULATOR + +/* Define this if you have a PortalPlayer PP5024 */ +#define CONFIG_CPU X86 + +/* Define this if you want to use the PP5024 i2c interface */ +#define CONFIG_I2C I2C_PP5024 + +/* define this if the hardware can be powered off while charging */ +/* Sansa can't be powered off while charging */ +/* #define HAVE_POWEROFF_WHILE_CHARGING */ + +/* The start address index for ROM builds */ +#define ROM_START 0x00000000 + +/* Define this to the CPU frequency */ +#define CPU_FREQ 75000000 + +/* Type of LCD TODO: hopefully the same as the x5 but check this*/ +#define CONFIG_LCD LCD_X5 + +/* Offset ( in the firmware file's header ) to the file CRC and data. These are + only used when loading the old format rockbox.e200 file */ +#define FIRMWARE_OFFSET_FILE_CRC 0x0 +#define FIRMWARE_OFFSET_FILE_DATA 0x8 + +#ifndef BOOTLOADER +#define HAVE_MULTIVOLUME +#define HAVE_HOTSWAP +#endif + +/* #define USB_IPODSTYLE */ + +/* USB On-the-go */ +//#define CONFIG_USBOTG USBOTG_ARC + +/* enable these for the experimental usb stack */ +#define HAVE_USBSTACK +#define USB_VENDOR_ID 0x0781 +#define USB_PRODUCT_ID 0x7421 + +/* Virtual LED (icon) */ +#define CONFIG_LED LED_VIRTUAL + +/* Define this if you have adjustable CPU frequency */ +//#define HAVE_ADJUSTABLE_CPU_FREQ + +#define MI4_FORMAT +#define BOOTFILE_EXT "mi4" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define OLD_BOOTFILE "rockbox.e200" +#define BOOTDIR "/.rockbox" + +#define ICODE_ATTR_TREMOR_NOT_MDCT + +#define INCLUDE_TIMEOUT_API + +#endif /* SIMULATOR */ + +/** Port-specific settings **/ + +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 12 +#define DEFAULT_BRIGHTNESS_SETTING 6 + +/* Default recording levels */ +#define DEFAULT_REC_MIC_GAIN 23 +#define DEFAULT_REC_LEFT_GAIN 23 +#define DEFAULT_REC_RIGHT_GAIN 23 + + + Property changes on: firmware/export/config-sdl.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/export/system.h =================================================================== --- firmware/export/system.h (revision 17611) +++ firmware/export/system.h (working copy) @@ -191,7 +191,7 @@ MAXMEMGUARD }; -#ifndef SIMULATOR +#ifndef SIMULATOR // #include "system-target.h" #else /* SIMULATOR */ Index: firmware/export/thread.h =================================================================== --- firmware/export/thread.h (revision 17611) +++ firmware/export/thread.h (working copy) @@ -79,7 +79,7 @@ #define DEFAULT_STACK_SIZE 0x400 /* Bytes */ -#ifndef SIMULATOR +#if(!defined(SIMULATOR) && !defined(SDL)) /* Need to keep structures inside the header file because debug_menu * needs them. */ #ifdef CPU_COLDFIRE @@ -115,7 +115,7 @@ void *s; /* Semaphore for blocking and wakeup */ void (*start)(void); /* Start function */ }; -#endif /* !SIMULATOR */ +#endif /* !SIMULATOR && !SDL */ /* NOTE: The use of the word "queue" may also refer to a linked list of threads being maintained that are normally dealt with in FIFO order @@ -469,7 +469,7 @@ create_thread(void (*function)(void), void* stack, size_t stack_size, unsigned flags, const char *name IF_PRIO(, int priority) - IF_COP(, unsigned int core)); + IF_COP(, unsigned int core)); /* Set and clear the CPU frequency boost flag for the calling thread */ #ifdef HAVE_SCHEDULER_BOOSTCTRL Index: firmware/export/config.h =================================================================== --- firmware/export/config.h (revision 17611) +++ firmware/export/config.h (working copy) @@ -262,6 +262,8 @@ #include "config-creativezv.h" #elif defined(PHILIPS_SA9200) #include "config-sa9200.h" +#elif defined(SDL) +#include "config-sdl.h" #else /* no known platform */ #endif Index: firmware/kernel.c =================================================================== --- firmware/kernel.c (revision 17611) +++ firmware/kernel.c (working copy) @@ -20,7 +20,7 @@ #include #include "config.h" #include "kernel.h" -#ifdef SIMULATOR +#if defined(SIMULATOR) || defined(SDL) #include "system-sdl.h" #include "debug.h" #endif @@ -437,7 +437,7 @@ switch_thread(); #elif defined(CREATIVE_ZVx) && defined(BOOTLOADER) /* hacky.. */ - long sleep_ticks = current_tick + ticks + 1; + long sleep_ticks = current_tick + ticks + 1; while (sleep_ticks > current_tick) switch_thread(); #else Index: firmware/sound.c =================================================================== --- firmware/sound.c (revision 17611) +++ firmware/sound.c (working copy) @@ -33,7 +33,7 @@ #if CONFIG_CODEC == SWCODEC #include "pcm.h" #endif -#endif +#endif /* SIMULATOR */ /* TODO * find a nice way to handle 1.5db steps -> see wm8751 ifdef in sound_set_bass/treble Index: firmware/panic.c =================================================================== --- firmware/panic.c (revision 17611) +++ firmware/panic.c (working copy) @@ -38,7 +38,7 @@ { va_list ap; -#ifndef SIMULATOR +#if (!defined(SIMULATOR) && !defined(SDL)) #if (CONFIG_LED == LED_REAL) bool state = false; int i = 0; @@ -50,7 +50,7 @@ #endif set_irq_level(DISABLE_INTERRUPTS); -#endif /* SIMULATOR */ +#endif /* !SIMULATOR || !SDL*/ va_start( ap, fmt ); vsnprintf( panic_buf, sizeof(panic_buf), fmt, ap ); @@ -88,7 +88,7 @@ while (1) { -#ifndef SIMULATOR +#if (!defined(SIMULATOR) && !defined(SDL)) #if (CONFIG_LED == LED_REAL) if (--i <= 0) { @@ -127,6 +127,6 @@ if(false) #endif /* CPU */ system_reboot(); -#endif /* !SIMULATOR */ +#endif /* !SIMULATOR !SDL*/ } } Index: firmware/SOURCES =================================================================== --- firmware/SOURCES (revision 17611) +++ firmware/SOURCES (working copy) @@ -14,10 +14,12 @@ #ifdef RB_PROFILE profile.c #endif /* RB_PROFILE */ +#ifndef SDL rolo.c thread.c timer.c #endif /* SIMULATOR */ +#endif /* SDL */ panic.c debug.c @@ -28,10 +30,10 @@ common/crc32-mi4.c #endif common/ctype.c -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) common/dir_uncached.c common/file.c -#endif /* SIMULATOR */ +#endif /* !SIMULATOR && !SDL */ #ifdef HAVE_DIRCACHE common/dircache.c #endif /* HAVE_DIRCACHE */ @@ -161,7 +163,7 @@ /* Tuner */ #if CONFIG_TUNER tuner.c -#ifndef SIMULATOR +#if !def(SIMULATOR) && !def(SDL) #if (CONFIG_TUNER & LV24020LP) drivers/tuner/lv24020lp.c #endif /* (CONFIG_TUNER & LV24020LP) */ @@ -236,7 +238,7 @@ #endif /* !defined(SIMULATOR) && !defined(BOOTLOADER) */ /* USB Stack */ -#if !defined(SIMULATOR) +#if !defined(SIMULATOR) && !defined(SDL) #ifdef HAVE_USBSTACK usbstack/usb_core.c usbstack/usb_storage.c @@ -254,7 +256,7 @@ drivers/m5636.c #endif #endif /* !defined(HAVE_USBSTACK) */ -#endif /* !defined(SIMULATOR) */ +#endif /* !defined(SIMULATOR) && !defined(SDL) */ /* Other Random Hardware */ #ifdef HAVE_TSC2100 @@ -370,7 +372,7 @@ common/memset.c common/memset16.c common/strlen.c -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) crt0.S drivers/i2c.c #endif /* SIMULATOR */ Index: firmware/target/generic/sdl/ata-target.h =================================================================== --- firmware/target/generic/sdl/ata-target.h (revision 0) +++ firmware/target/generic/sdl/ata-target.h (revision 0) @@ -0,0 +1,22 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: ata-target.h 14624 2007-09-06 03:01:41Z lowlight $ + * + * Copyright (C) 2006 by Daniel Ankers + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef ATA_TARGET_H +#define ATA_TARGET_H + +#endif Property changes on: firmware/target/generic/sdl/ata-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/sdl/adc-target.h =================================================================== --- firmware/target/generic/sdl/adc-target.h (revision 0) +++ firmware/target/generic/sdl/adc-target.h (revision 0) @@ -0,0 +1,44 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: adc-target.h 14624 2007-09-06 03:01:41Z lowlight $ + * + * Copyright (C) 2006 by Barry Wardell + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _ADC_TARGET_H_ +#define _ADC_TARGET_H_ + +#if 0 +/* ADC channels */ +#define NUM_ADC_CHANNELS 13 + +#define ADC_BVDD 0 /* Battery voltage of 4V LiIo accumulator */ +#define ADC_RTCSUP 1 /* RTC backup battery voltage */ +#define ADC_UVDD 2 /* USB host voltage */ +#define ADC_CHG_IN 3 /* Charger input voltage */ +#define ADC_CVDD 4 /* Charger pump output voltage */ +#define ADC_BATTEMP 5 /* Battery charging temperature */ +#define ADC_MICSUP1 6 /* Voltage on MicSup1 for remote control + or external voltage measurement */ +#define ADC_MICSUP2 7 /* Voltage on MicSup1 for remote control + or external voltage measurement */ +#define ADC_VBE1 8 /* Measuring junction temperature @ 2uA */ +#define ADC_VBE2 9 /* Measuring junction temperature @ 1uA */ +#define ADC_I_MICSUP1 10 /* Current of MicSup1 for remote control detection */ +#define ADC_I_MICSUP2 11 /* Current of MicSup2 for remote control detection */ +#define ADC_VBAT 12 /* Single cell battery voltage */ + +#define ADC_UNREG_POWER ADC_BVDD /* For compatibility */ +#endif +#endif Property changes on: firmware/target/generic/sdl/adc-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/sdl/backlight-target.h =================================================================== --- firmware/target/generic/sdl/backlight-target.h (revision 0) +++ firmware/target/generic/sdl/backlight-target.h (revision 0) @@ -0,0 +1,30 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: backlight-target.h 15599 2007-11-12 18:49:53Z amiconn $ + * + * Copyright (C) 2006 by Barry Wardell + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +#define _backlight_init() true +void _backlight_on(void); +void _backlight_off(void); +void _backlight_set_brightness(int brightness); +int __backlight_is_on(void); + +void _buttonlight_on(void); +void _buttonlight_off(void); +#endif Property changes on: firmware/target/generic/sdl/backlight-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/sdl/usb-target.h =================================================================== --- firmware/target/generic/sdl/usb-target.h (revision 0) +++ firmware/target/generic/sdl/usb-target.h (revision 0) @@ -0,0 +1,24 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: usb-target.h 12198 2007-02-04 21:46:01Z dave $ + * + * Copyright (C) 2006 by Barry Wardelll + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef USB_TARGET_H +#define USB_TARGET_H + +//void usb_init_device(void); + +#endif Property changes on: firmware/target/generic/sdl/usb-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/sdl/boot.lds =================================================================== Property changes on: firmware/target/generic/sdl/boot.lds ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/sdl/button-target.h =================================================================== --- firmware/target/generic/sdl/button-target.h (revision 0) +++ firmware/target/generic/sdl/button-target.h (revision 0) @@ -0,0 +1,56 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: button-target.h 16045 2008-01-10 08:08:31Z jdgordon $ + * + * Copyright (C) 2006 by Michael Giacomelli + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef _BUTTON_TARGET_H_ +#define _BUTTON_TARGET_H_ + +#include +#include "config.h" //includes config-sdl.h + +#define HAS_BUTTON_HOLD + +bool button_hold(void); +void button_init_device(void); +int button_read_device(void); + +/* Toshiba Gigabeat specific button codes */ + +#define BUTTON_POWER 0x00000001 +#define BUTTON_MENU 0x00000002 + +#define BUTTON_LEFT 0x00000004 +#define BUTTON_RIGHT 0x00000008 +#define BUTTON_UP 0x00000010 +#define BUTTON_DOWN 0x00000020 + +#define BUTTON_VOL_UP 0x00000040 +#define BUTTON_VOL_DOWN 0x00000080 + +#define BUTTON_SELECT 0x00000100 +#define BUTTON_A 0x00000200 + + + +/* No Remote control */ +#define BUTTON_REMOTE 0 + +#define POWEROFF_BUTTON BUTTON_POWER +#define POWEROFF_COUNT 10 + +#endif /* _BUTTON_TARGET_H_ */ Property changes on: firmware/target/generic/sdl/button-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/system-generic.h =================================================================== --- firmware/target/generic/system-generic.h (revision 0) +++ firmware/target/generic/system-generic.h (revision 0) @@ -0,0 +1,160 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: system-arm.h 17148 2008-04-16 20:44:10Z jethead71 $ + * + * Copyright (C) 2002 by Alan Korr + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef SYSTEM_GENERIC_H +#define SYSTEM_GENERIC_H + +#define nop \ + asm volatile ("nop") + +static inline uint16_t swap16(uint16_t value) + /* + result[15..8] = value[ 7..0]; + result[ 7..0] = value[15..8]; + */ +{ + return (value >> 8) | (value << 8); +} + +static inline uint32_t swap32(uint32_t value) + /* + result[31..24] = value[ 7.. 0]; + result[23..16] = value[15.. 8]; + result[15.. 8] = value[23..16]; + result[ 7.. 0] = value[31..24]; + */ +{ + uint32_t hi = swap16(value >> 16); + uint32_t lo = swap16(value & 0xffff); + return (lo << 16) | hi; +} + +static inline uint32_t swap_odd_even32(uint32_t value) +{ + /* + result[31..24],[15.. 8] = value[23..16],[ 7.. 0] + result[23..16],[ 7.. 0] = value[31..24],[15.. 8] + */ + uint32_t t = value & 0xff00ff00; + return (t >> 8) | ((t ^ value) << 8); +} + +#if 0 +/* Core-level interrupt masking */ + +/* This one returns the old status */ +#define IRQ_ENABLED 0x00 +#define IRQ_DISABLED 0x80 +#define IRQ_STATUS 0x80 +#define FIQ_ENABLED 0x00 +#define FIQ_DISABLED 0x40 +#define FIQ_STATUS 0x40 +#define IRQ_FIQ_ENABLED 0x00 +#define IRQ_FIQ_DISABLED 0xc0 +#define IRQ_FIQ_STATUS 0xc0 +#define HIGHEST_IRQ_LEVEL IRQ_DISABLED + +#define set_irq_level(status) \ + set_interrupt_status((status), IRQ_STATUS) +#define set_fiq_status(status) \ + set_interrupt_status((status), FIQ_STATUS) + +static inline int set_interrupt_status(int status, int mask) +{ + unsigned long cpsr; + int oldstatus; + /* Read the old levels and set the new ones */ + asm volatile ( + "mrs %1, cpsr \n" + "bic %0, %1, %[mask] \n" + "orr %0, %0, %2 \n" + "msr cpsr_c, %0 \n" + : "=&r,r"(cpsr), "=&r,r"(oldstatus) + : "r,i"(status & mask), [mask]"i,i"(mask)); + + return oldstatus; +} + +static inline void enable_interrupt(int mask) +{ + /* Clear I and/or F disable bit */ + int tmp; + asm volatile ( + "mrs %0, cpsr \n" + "bic %0, %0, %1 \n" + "msr cpsr_c, %0 \n" + : "=&r"(tmp) : "i"(mask)); +} + +static inline void disable_interrupt(int mask) +{ + /* Set I and/or F disable bit */ + int tmp; + asm volatile ( + "mrs %0, cpsr \n" + "orr %0, %0, %1 \n" + "msr cpsr_c, %0 \n" + : "=&r"(tmp) : "i"(mask)); +} + +#define disable_irq() \ + disable_interrupt(IRQ_STATUS) + +#define enable_irq() \ + enable_interrupt(IRQ_STATUS) + +#define disable_fiq() \ + disable_interrupt(FIQ_STATUS) + +#define enable_fiq() \ + enable_interrupt(FIQ_STATUS) + +static inline int disable_interrupt_save(int mask) +{ + /* Set I and/or F disable bit and return old cpsr value */ + int cpsr, tmp; + asm volatile ( + "mrs %1, cpsr \n" + "orr %0, %1, %2 \n" + "msr cpsr_c, %0 \n" + : "=&r"(tmp), "=&r"(cpsr) + : "i"(mask)); + return cpsr; +} + +#define disable_irq_save() \ + disable_interrupt_save(IRQ_STATUS) + +#define disable_fiq_save() \ + disable_interrupt_save(FIQ_STATUS) + +static inline void restore_interrupt(int cpsr) +{ + /* Set cpsr_c from value returned by disable_interrupt_save + * or set_interrupt_status */ + asm volatile ("msr cpsr_c, %0" : : "r"(cpsr)); +} + +#define restore_irq(cpsr) \ + restore_interrupt(cpsr) + +#define restore_fiq(cpsr) \ + restore_interrupt(cpsr) + +#endif /* SYSTEM_GENERIC_H */ +#endif Property changes on: firmware/target/generic/system-generic.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/crt0.c =================================================================== --- firmware/target/generic/crt0.c (revision 0) +++ firmware/target/generic/crt0.c (revision 0) @@ -0,0 +1,18 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: crt0-pp.S 17290 2008-04-29 06:47:34Z amiconn $ + * + * Copyright (C) 2002 by Linus Nielsen Feltzing + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ Property changes on: firmware/target/generic/crt0.c ___________________________________________________________________ Name: svn:executable + * Index: firmware/target/generic/system-target.h =================================================================== --- firmware/target/generic/system-target.h (revision 0) +++ firmware/target/generic/system-target.h (revision 0) @@ -0,0 +1,180 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: system-target.h 17192 2008-04-20 17:53:05Z amiconn $ + * + * Copyright (C) 2002 by Alan Korr + * Copyright (C) 2007 by Michael Sevakis + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef SYSTEM_TARGET_H +#define SYSTEM_TARGET_H + +#include "system-generic.h" + +#ifdef CPU_PP +/* TODO: This header is actually portalplayer specific, and should be + * moved into an appropriate subdir (or even split in 2). */ + +#if CONFIG_CPU == PP5002 +#define CPUFREQ_SLEEP 32768 +#define CPUFREQ_DEFAULT 24000000 +#define CPUFREQ_NORMAL 30000000 +#define CPUFREQ_MAX 80000000 + +#else /* PP5022, PP5024 */ +#define CPUFREQ_SLEEP 32768 +#define CPUFREQ_DEFAULT 24000000 +#define CPUFREQ_NORMAL 30000000 +#define CPUFREQ_MAX 80000000 +#endif + +#define inl(a) (*(volatile unsigned long *) (a)) +#define outl(a,b) (*(volatile unsigned long *) (b) = (a)) +#define inb(a) (*(volatile unsigned char *) (a)) +#define outb(a,b) (*(volatile unsigned char *) (b) = (a)) +#define inw(a) (*(volatile unsigned short *) (a)) +#define outw(a,b) (*(volatile unsigned short *) (b) = (a)) + +#if defined(HAVE_ADJUSTABLE_CPU_FREQ) && NUM_CORES > 1 +extern struct spinlock boostctrl_spin; +#endif + +static inline void udelay(unsigned usecs) +{ + unsigned stop = USEC_TIMER + usecs; + while (TIME_BEFORE(USEC_TIMER, stop)); +} + +static inline unsigned int current_core(void) +{ + /* + * PROCESSOR_ID seems to be 32-bits: + * CPU = 0x55555555 = |01010101|01010101|01010101|01010101| + * COP = 0xaaaaaaaa = |10101010|10101010|10101010|10101010| + * ^ + */ + unsigned int core; + asm volatile ( + "ldrb %0, [%1] \n" /* Just load the LSB */ + "mov %0, %0, lsr #7 \n" /* Bit 7 => index */ + : "=r"(core) /* CPU=0, COP=1 */ + : "r"(&PROCESSOR_ID) + ); + return core; +} + +/* Return the actual ID instead of core index */ +static inline unsigned int processor_id(void) +{ + unsigned int id; + + asm volatile ( + "ldrb %0, [%1] \n" + : "=r"(id) + : "r"(&PROCESSOR_ID) + ); + + return id; +} + +#if CONFIG_CPU == PP5002 +static inline void sleep_core(int core) +{ + asm volatile ( + /* Sleep: PP5002 crashes if the instruction that puts it to sleep is + * located at 0xNNNNNNN0. 4/8/C works. This sequence makes sure + * that the correct alternative is executed. Don't change the order + * of the next 4 instructions! */ + "tst pc, #0x0c \n" + "mov r0, #0xca \n" + "strne r0, [%[ctl]] \n" + "streq r0, [%[ctl]] \n" + "nop \n" /* nop's needed because of pipeline */ + "nop \n" + "nop \n" + : + : [ctl]"r"(&PROC_CTL(core)) + : "r0" + ); +} +static inline void wake_core(int core) +{ + asm volatile ( + "mov r0, #0xce \n" + "str r0, [%[ctl]] \n" + : + : [ctl]"r"(&PROC_CTL(core)) + : "r0" + ); +} +#else /* PP502x */ +static inline void sleep_core(int core) +{ + asm volatile ( + "mov r0, #0x80000000 \n" + "str r0, [%[ctl]] \n" + "nop \n" + : + : [ctl]"r"(&PROC_CTL(core)) + : "r0" + ); +} +static inline void wake_core(int core) +{ + asm volatile ( + "mov r0, #0 \n" + "str r0, [%[ctl]] \n" + : + : [ctl]"r"(&PROC_CTL(core)) + : "r0" + ); +} +#endif + +#ifdef BOOTLOADER +/* All addresses within rockbox are in IRAM in the bootloader so + are therefore uncached */ +#define UNCACHED_ADDR(a) (a) + +#else /* !BOOTLOADER */ + +#if CONFIG_CPU == PP5002 +#define UNCACHED_BASE_ADDR 0x28000000 +#else /* PP502x */ +#define UNCACHED_BASE_ADDR 0x10000000 +#endif + +#define UNCACHED_ADDR(a) \ + ((typeof (a))((uintptr_t)(a) | UNCACHED_BASE_ADDR)) +#endif /* BOOTLOADER */ + +/* Certain data needs to be out of the way of cache line interference + * such as data for COP use or for use with UNCACHED_ADDR */ +#define PROC_NEEDS_CACHEALIGN +#define CACHEALIGN_BITS (4) /* 2^4 = 16 bytes */ + +/** cache functions **/ +#ifndef BOOTLOADER +#define CACHE_FUNCTIONS_AS_CALL + +#define HAVE_INVALIDATE_ICACHE +void invalidate_icache(void); + +#define HAVE_FLUSH_ICACHE +void flush_icache(void); +#endif + +#endif /* CPU_PP */ + +#endif /* SYSTEM_TARGET_H */ Property changes on: firmware/target/generic/system-target.h ___________________________________________________________________ Name: svn:executable + * Index: firmware/usb.c =================================================================== --- firmware/usb.c (revision 17611) +++ firmware/usb.c (working copy) @@ -63,7 +63,7 @@ #endif #endif -#if !defined(SIMULATOR) && !defined(USB_NONE) +#if !defined(SIMULATOR) && !defined(USB_NONE) && !defined(SDL) #define NUM_POLL_READINGS (HZ/5) static int countdown; Index: firmware/drivers/button.c =================================================================== --- firmware/drivers/button.c (revision 17611) +++ firmware/drivers/button.c (working copy) @@ -37,7 +37,7 @@ #include "lcd-remote.h" #endif -#ifndef SIMULATOR +#if !defined(SIMULATOR) && !defined(SDL) #if 0 /* Older than MAX_EVENT_AGE button events are going to be ignored. * Used to prevent for example volume going up uncontrollable when events Index: uisimulator/sdl/button.c =================================================================== --- uisimulator/sdl/button.c (revision 17611) +++ uisimulator/sdl/button.c (working copy) @@ -880,6 +880,40 @@ case SDLK_s: new_btn = BUTTON_VOL_UP; break; +#elif CONFIG_KEYPAD == SLD_PAD + case SDLK_KP4: + case SDLK_LEFT: + new_btn = BUTTON_LEFT; + break; + case SDLK_KP6: + case SDLK_RIGHT: + new_btn = BUTTON_RIGHT; + break; + case SDLK_KP8: + case SDLK_UP: + new_btn = BUTTON_UP; + break; + case SDLK_KP2: + case SDLK_DOWN: + new_btn = BUTTON_DOWN; + break; + case SDLK_KP_PLUS: + case SDLK_F8: + new_btn = BUTTON_POWER; + break; + case SDLK_ESCAPE: + new_btn = BUTTON_POWER; + break; + case SDLK_KP_ENTER: + case SDLK_RETURN: + case SDLK_KP5: + case SDLK_SPACE: + new_btn = BUTTON_SELECT; + break; + case SDLK_KP_PERIOD: + case SDLK_INSERT: + new_btn = BUTTON_MENU; + break; #else #error No keymap defined! #endif /* CONFIG_KEYPAD */ Index: uisimulator/sdl/lcd-bitmap.c =================================================================== --- uisimulator/sdl/lcd-bitmap.c (revision 17611) +++ uisimulator/sdl/lcd-bitmap.c (working copy) @@ -108,7 +108,7 @@ } #endif -/* initialise simulator lcd driver */ +/* initialize simulator lcd driver */ void sim_lcd_init(void) { #if LCD_DEPTH == 16 Index: uisimulator/sdl/uisdl.h =================================================================== --- uisimulator/sdl/uisdl.h (revision 17611) +++ uisimulator/sdl/uisdl.h (working copy) @@ -404,6 +404,16 @@ #define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ #define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ +#elif defined(SDL) +#define UI_TITLE "SDL Rockbox" +#define UI_WIDTH 401 /* width of GUI window */ +#define UI_HEIGHT 655 /* height of GUI window */ +/* high-colour */ +#define UI_LCD_POSX 48 /* x position of lcd */ +#define UI_LCD_POSY 60 /* y position of lcd */ +#define UI_LCD_WIDTH 240 +#define UI_LCD_HEIGHT 320 + #endif extern SDL_Surface *gui_surface; extern bool background; /* True if the background image is enabled */ Index: uisimulator/sdl/UI-sdl.bmp =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: uisimulator/sdl/UI-sdl.bmp ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream