Index: tools/configure =================================================================== --- tools/configure (revision 21192) +++ tools/configure (working copy) @@ -768,6 +768,7 @@ 140) YH-820 150) Elio TPJ-1022 130) Lyre proto 1 141) YH-920 142) YH-925 + 143) YP-P2 EOF buildfor=`input`; @@ -2156,6 +2157,27 @@ t_model="yh925" ;; + 143|ypp2) + target_id=60 + modelname="ypp2" + target="-DSAMSUNG_YPP2" + memory=32 + arm926ejscc + tool="$rootdir/tools/scramble -add=d2" + boottool="$rootdir/tools/scramble -tcc=crc" + bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" + output="rockbox.ypp2" + appextra="recorder:gui" + plugins="yes" + swcodec="yes" + toolset="$tccbitmaptools" + # architecture, manufacturer and model for the target-tree build + t_cpu="arm" + t_manufacturer="tcc780x" + t_model="ypp2" + ;; + *) echo "Please select a supported target platform!" exit 7 Index: apps/plugins/lib/pluginlib_actions.c =================================================================== --- apps/plugins/lib/pluginlib_actions.c (revision 21192) +++ apps/plugins/lib/pluginlib_actions.c (working copy) @@ -163,6 +163,7 @@ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE}, { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE}, #elif (CONFIG_KEYPAD == ONDAVX747_PAD) /* Touchscreen target */ +#elif (CONFIG_KEYPAD == SAMSUNG_YPP2_PAD) #else #error pluginlib_actions: Unsupported keypad #endif @@ -285,6 +286,7 @@ { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE}, { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, #elif (CONFIG_KEYPAD == ONDAVX747_PAD) /* Touchscreen target */ +#elif (CONFIG_KEYPAD == SAMSUNG_YPP2_PAD) #else #error pluginlib_actions: Unsupported keypad #endif @@ -446,6 +448,7 @@ {PLA_MENU, BUTTON_MENU, BUTTON_NONE}, {PLA_FIRE, BUTTON_VOL_UP, BUTTON_NONE}, {PLA_FIRE_REPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, +#elif (CONFIG_KEYPAD == SAMSUNG_YPP2_PAD) #else #error pluginlib_actions: Unsupported keypad #endif @@ -526,6 +529,7 @@ {PLA_DEC, BUTTON_VOL_DOWN, BUTTON_NONE}, {PLA_INC_REPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, {PLA_DEC_REPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE}, +#elif (CONFIG_KEYPAD == SAMSUNG_YPP2_PAD) #else #error pluginlib_actions: Unsupported keypad #endif Index: apps/SOURCES =================================================================== --- apps/SOURCES (revision 21192) +++ apps/SOURCES (working copy) @@ -234,4 +234,6 @@ keymaps/keymap-ondavx767.c #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD keymaps/keymap-yh8xx_yh9xx.c +#elif CONFIG_KEYPAD == SAMSUNG_YPP2_PAD +keymaps/keymap-ypp2.c #endif Index: firmware/export/config.h =================================================================== --- firmware/export/config.h (revision 21192) +++ firmware/export/config.h (working copy) @@ -110,6 +110,7 @@ #define SANSA_FUZE_PAD 36 #define LYRE_PROTO1_PAD 37 #define SAMSUNG_YH_PAD 38 +#define SAMSUNG_YPP2_PAD 39 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 @@ -187,6 +188,7 @@ #define LCD_FUZE 32 /* as used by the Sansa Fuze */ #define LCD_LYRE_PROTO1 33 /* as used by the Lyre */ #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */ +#define LCD_YPP2 35 /* as used by Samsung YP-P2 */ /* LCD_PIXELFORMAT */ #define HORIZONTAL_PACKING 1 @@ -372,6 +374,8 @@ #include "config-yh920.h" #elif defined(SAMSUNG_YH925) #include "config-yh925.h" +#elif defined(SAMSUNG_YPP2) +#include "config-ypp2.h" #else /* no known platform */ #endif Index: firmware/SOURCES =================================================================== --- firmware/SOURCES (revision 21192) +++ firmware/SOURCES (working copy) @@ -1336,3 +1336,27 @@ target/arm/samsung/yh925/powermgmt-yh925.c #endif /* SIMULATOR */ #endif /* SAMSUNG_YH925 */ + +#ifdef SAMSUNG_YPP2 +#ifndef SIMULATOR +drivers/nand_id.c +drivers/pcf50606.c +target/arm/lcd-as-memframe.S +target/arm/tcc780x/adc-tcc780x.c +target/arm/tcc780x/system-tcc780x.c +target/arm/tcc780x/ypp2/button-ypp2.c +target/arm/tcc780x/ypp2/lcd-ypp2.c +target/arm/tcc780x/ypp2/power-ypp2.c +target/arm/tcc780x/ypp2/powermgmt-ypp2.c +target/arm/tcc780x/ypp2/backlight-ypp2.c +target/arm/usb-tcc.c +#ifndef BOOTLOADER +target/arm/tcc780x/kernel-tcc780x.c +target/arm/tcc780x/timer-tcc780x.c +target/arm/wmcodec-telechips.c +target/arm/tcc780x/debug-tcc780x.c +target/arm/pcm-telechips.c +target/arm/tcc780x/ypp2/audio-ypp2.c +#endif /* BOOTLOADER */ +#endif /* SIMULATOR */ +#endif /* SAMSUNG_P2 */ Index: firmware/target/arm/tcc780x/system-tcc780x.c =================================================================== --- firmware/target/arm/tcc780x/system-tcc780x.c (revision 21192) +++ firmware/target/arm/tcc780x/system-tcc780x.c (working copy) @@ -154,9 +154,10 @@ investigate what the GPIO pins do. */ -#ifdef COWON_D2 + static void gpio_init(void) { +#ifdef COWON_D2 /* Do what the original firmware does */ GPIOA = 0x07000C83; GPIOA_DIR = 0x0F010CE3; @@ -173,13 +174,28 @@ PORTCFG1 = 0x0566A000; PORTCFG2 = 0x000004C0; PORTCFG3 = 0x0AA40455; +#elif defined(SAMSUNG_YPP2) + GPIOA = 0x10400C03; + GPIOA_DIR = 0x1EE20C17; + GPIOB = 0; + GPIOB_DIR = 0x280000; + GPIOC = 0x20800000; + GPIOC_DIR = 0x10000007; + GPIOD = 0; + GPIOD_DIR = 0; + GPIOE = 0x100099; + GPIOE_DIR = 0x58009D; + + PORTCFG0 = 0x4000; + PORTCFG1 = 0xc06e8000; + PORTCFG2 = 0x00000933; + PORTCFG3 = 0x0fdff055; +#endif } -#endif - /* Second function called in the original firmware's startup code - we just set up the clocks in the same way as the original firmware for now. */ -#ifdef COWON_D2 +#if (defined(COWON_D2) || defined(SAMSUNG_YPP2)) static void clock_init(void) { int i; @@ -241,7 +257,7 @@ #endif -#ifdef COWON_D2 +#if (defined(COWON_D2) || defined(SAMSUNG_YPP2)) void system_init(void) { MBCFG = 0x19; Index: firmware/target/arm/wmcodec-telechips.c =================================================================== --- firmware/target/arm/wmcodec-telechips.c (revision 21192) +++ firmware/target/arm/wmcodec-telechips.c (working copy) @@ -31,7 +31,7 @@ #include "i2c.h" #include "wmcodec.h" -#if defined(COWON_D2) +#if defined(COWON_D2) || defined(SAMSUNG_YPP2) /* The D2's audio codec uses an I2C address of 0x34 */ #define I2C_AUDIO_ADDRESS 0x34 #elif defined (IAUDIO_7) || defined(LOGIK_DAX) || defined(SANSA_M200) Index: firmware/target/arm/ata-nand-telechips.c =================================================================== --- firmware/target/arm/ata-nand-telechips.c (revision 21192) +++ firmware/target/arm/ata-nand-telechips.c (working copy) @@ -42,7 +42,7 @@ static struct mutex ata_mtx SHAREDBSS_ATTR; -#if defined(COWON_D2) || defined(IAUDIO_7) +#if defined(COWON_D2) || defined(IAUDIO_7) || defined(SAMSUNG_YPP2) #define FTL_V2 #define MAX_WRITE_CACHES 8 #else Index: firmware/target/arm/pcm-telechips.c =================================================================== --- firmware/target/arm/pcm-telechips.c (revision 21192) +++ firmware/target/arm/pcm-telechips.c (working copy) @@ -74,7 +74,7 @@ void pcm_play_dma_init(void) { DAVC = 0x0; /* Digital Volume = max */ -#ifdef COWON_D2 +#if defined(COWON_D2) || defined(SAMSUNG_YPP2) /* Set DAI clock divided from PLL0 (192MHz). The best approximation of 256*44.1kHz is 11.291MHz. */ BCLKCTR &= ~DEV_DAI;