A first tiny set of changes for the Creative Zen Vision:M. Work done by

Maurus Cuelenaere


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16347 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2008-02-18 19:08:29 +00:00
parent 332a14036b
commit 65068e28f3
4 changed files with 297 additions and 1 deletions

View File

@ -0,0 +1,161 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2008 by Maurus Cuelenaere
*
* 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.
*
****************************************************************************/
/*
* This config file is for the Creative Zen Vision:M
*/
#define TARGET_TREE /* this target is using the target tree system */
#define CONFIG_SDRAM_START 0x00900000
#define CREATIVE_ZVM 1
/* For Rolo and boot loader */
#define MODEL_NUMBER 35
/* 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 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
/* define this if the target has volume keys which can be used in the lists */
#define HAVE_VOLUME_IN_LIST
/* LCD dimensions */
#define CONFIG_LCD LCD_CREATIVEZVM
/* choose the lcd orientation. both work */
#define CONFIG_ORIENTATION SCREEN_PORTAIT
#define LCD_WIDTH 320
#define LCD_HEIGHT 240
#define LCD_DEPTH 16 /* 65k colours */
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
/* Define this if your LCD can be enabled/disabled */
#define HAVE_LCD_ENABLE
#define LCD_REMOTE_PIXELFORMAT VERTICAL_PACKING
#define MIN_REMOTE_CONTRAST_SETTING 0
#define MAX_REMOTE_CONTRAST_SETTING 15
#define DEFAULT_REMOTE_CONTRAST_SETTING 7
#define CONFIG_KEYPAD MROBE500_PAD
//#define HAVE_TOUCHPAD
#define HAVE_BUTTON_DATA
/* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC
/* define this if you have a real-time clock */
//#define CONFIG_RTC RTC_RX5X348AB
/* Define this for LCD backlight available */
//#define HAVE_BACKLIGHT
#define HAVE_BACKLIGHT_BRIGHTNESS
/* Main LCD backlight brightness range and defaults */
#define MIN_BRIGHTNESS_SETTING 0
#define MAX_BRIGHTNESS_SETTING 127
#define DEFAULT_BRIGHTNESS_SETTING 85 /* OF "full brightness" */
#define DEFAULT_DIMNESS_SETTING 22 /* OF "most dim" */
/* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF
/* The number of bytes reserved for loadable codecs */
#define CODEC_SIZE 0x80000
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x100000
/* Define this if you have the TLV320 audio codec */
//#define HAVE_TLV320
/* Define this if you want to use the adaptive bass capibility of the 8751 */
/* #define USE_ADAPTIVE_BASS */
#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \
SAMPR_CAP_11)
#define BATTERY_CAPACITY_DEFAULT 1100 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
#define BATTERY_CAPACITY_INC 100 /* capacity increment */
#define BATTERY_TYPES_COUNT 1 /* only one type */
/* Hardware controlled charging with monitoring */
#define CONFIG_CHARGING CHARGING_MONITOR
#ifndef SIMULATOR
/* Define this if you have a TI TMS320DM320 */
#define CONFIG_CPU DM320
/* Define this if you have a Texas Instruments TSC2100 touch screen */
//#define HAVE_TSC2100
/* Define this if you want to use coldfire's i2c interface */
//#define CONFIG_I2C I2C_S3C2440
/* define this if the hardware can be powered off while charging */
#define HAVE_POWEROFF_WHILE_CHARGING
/* The size of the flash ROM */
#define FLASH_SIZE 0x400000
/* Define this to the CPU frequency */
#define CPU_FREQ 16934400
/* Define this if you have ATA power-off control */
//#define HAVE_ATA_POWER_OFF
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
/* define this if the backlight can be set to a brightness */
//#define __BACKLIGHT_INIT
/* 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 this if you have adjustable CPU frequency */
/* #define HAVE_ADJUSTABLE_CPU_FREQ */
#define BOOTFILE_EXT "zvm"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
#endif

View File

@ -114,6 +114,7 @@
#define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
#define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
#define LCD_COWOND2 21 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
#define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@ -239,6 +240,8 @@
#include "config-iaudio7.h"
#elif defined(COWON_D2)
#include "config-cowond2.h"
#elif defined(CREATIVE_ZVM)
#include "config-creativezvm.h"
#else
/* no known platform */
#endif

34
tools/configure vendored
View File

@ -219,6 +219,13 @@ arm946cc () {
endian="little"
}
arm9cc () {
prefixtools arm-elf-
GCCOPTS="$CCOPTS -mcpu=arm9 -mlong-calls"
GCCOPTIMIZE="-fomit-frame-pointer"
endian="little"
}
arm926ejscc () {
prefixtools arm-elf-
GCCOPTS="$CCOPTS -mcpu=arm926ej-s -mlong-calls"
@ -611,7 +618,9 @@ cat <<EOF
==Tatung== ==Olympus== ==Logik==
60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB
71) M:Robe 100
71) M:Robe 10
==Creative==
90) Zen Vision:M
EOF
buildfor=`input`;
@ -1313,6 +1322,29 @@ EOF
t_manufacturer="tcc77x"
t_model="logikdax"
;;
90|creativezvm)
target_id=35
modelname="creativezvm"
target="-DCREATIVE_ZVM"
memory=32 # always
arm9cc
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
output="rockbox.zvm"
appextra="recorder:gui"
plugins="yes"
swcodec="yes"
toolset=$gigabeatbitmaptools
boottool="$rootdir/tools/scramble -zvm"
bootoutput="rockbox.zvmboot"
# architecture, manufacturer and model for the target-tree build
t_cpu="arm"
t_manufacturer="tms320dm320"
t_model="creative-zvm"
;;
50|e200)
target_id=23

View File

@ -94,6 +94,7 @@ void usage(void)
"\t-ipod3g ipod firmware partition format (3rd Gen)\n"
"\t-ipod4g ipod firmware partition format (4th Gen, Mini, Nano, Photo/Color)\n"
"\t-ipod5g ipod firmware partition format (5th Gen - aka Video)\n"
"\t-zvm Zen Vision:M FRESCUE structure format\n"
"\t-gigabeat Toshiba Gigabeat F/X format\n"
"\t-gigabeats Toshiba Gigabeat S format\n"
"\t-mi4v2 PortalPlayer .mi4 format (revision 010201)\n"
@ -314,6 +315,11 @@ int main (int argc, char** argv)
oname = argv[3];
return ipod_encode(iname, oname, 3, true); /* Firmware image v3 */
}
else if(!strcmp(argv[1], "-zvm")) {
iname = argv[2];
oname = argv[3];
return zvm_encode(iname, oname);
}
else if(!strncmp(argv[1], "-mi4", 4)) {
int mi4magic;
int version;
@ -723,3 +729,97 @@ int ipod_encode(char *iname, char *oname, int fw_ver, bool fake_rsrc)
return 0;
}
/* Create an Zen Vision:M FRESCUE structure file
*/
int zvm_encode(char *iname, char *oname)
{
size_t len;
int length;
FILE *file;
unsigned int sum = 0;
unsigned char *outbuf;
int i;
file = fopen(iname, "rb");
if (!file) {
perror(iname);
return -1;
}
fseek(file,0,SEEK_END);
length = ftell(file);
fseek(file,0,SEEK_SET);
outbuf = malloc(length+0x18+0x10);
if ( !outbuf ) {
printf("out of memory!\n");
return -1;
}
len = fread(outbuf+0x18, 1, length, file);
if(len < length) {
perror(iname);
return -2;
}
fclose(file);
/* Calculate checksum for later use in header */
for(i=0; i<length; i+= 4)
sum += le2int(&outbuf[0x18+i]) + (le2int(&outbuf[0x18+i])>>16);
/* Clear the header area to zero */
memset(outbuf, 0, 0x18);
/* Header (EDOC) */
memcpy((char*)outbuf, "EDOC", 4);
/* Total Size */
int2le(length+0x20, &outbuf[0x4]);
/* 4 bytes of zero */
/* Address = 0x900000 */
int2le(0x900000, &outbuf[0xC]);
/* Size */
int2le(length, &outbuf[0x10]);
/* Checksum */
int2le(sum, &outbuf[0x14]);
outbuf[0x16] = 0;
outbuf[0x17] = 0;
/* Data starts here... */
/* Second block starts here ... */
/* Address = 0x0 */
/* Size */
int2le(0x4, &outbuf[0x18+length+0x4]);
/* Checksum */
outbuf[0x18+length+0x8] = 0xB7;
outbuf[0x18+length+0x9] = 0xD5;
/* Data: LDR PC, =0x900000 */
outbuf[0x18+length+0xC] = 0x18;
outbuf[0x18+length+0xD] = 0xF0;
outbuf[0x18+length+0xE] = 0x9F;
outbuf[0x18+length+0xF] = 0xE5;
file = fopen(oname, "wb");
if (!file) {
perror(oname);
return -3;
}
len = fwrite(outbuf, 1, length+0x28, file);
if(len < length+0x18) {
perror(oname);
return -4;
}
free(outbuf);
fclose(file);
return 0;
}