From 48e45f57516d24d8cf24f632ecf73fec95e3a785 Mon Sep 17 00:00:00 2001 From: Marcoen Hirschberg Date: Wed, 17 Sep 2008 23:22:11 +0000 Subject: add Meizu M6SP and M3 ports git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18544 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/SOURCES | 4 + bootloader/meizu_m3.c | 142 +++++++++++++++++ bootloader/meizu_m6sp.c | 123 +++++++++++++++ firmware/SOURCES | 22 ++- firmware/export/config-meizu-m3.h | 175 +++++++++++++++++++++ firmware/export/config-meizu-m6sp.h | 175 +++++++++++++++++++++ firmware/export/config.h | 6 + firmware/target/arm/s5l8700/meizu-m3/adc-target.h | 35 +++++ .../target/arm/s5l8700/meizu-m3/backlight-target.h | 29 ++++ .../target/arm/s5l8700/meizu-m3/button-target.h | 54 +++++++ firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c | 135 ++++++++++++++++ .../target/arm/s5l8700/meizu-m6sp/adc-target.h | 35 +++++ .../arm/s5l8700/meizu-m6sp/backlight-target.h | 29 ++++ .../target/arm/s5l8700/meizu-m6sp/button-target.h | 54 +++++++ firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c | 135 ++++++++++++++++ tools/configure | 49 +++++- utils/meizu_dfu/Makefile | 2 +- 17 files changed, 1200 insertions(+), 4 deletions(-) create mode 100644 bootloader/meizu_m3.c create mode 100644 bootloader/meizu_m6sp.c create mode 100644 firmware/export/config-meizu-m3.h create mode 100644 firmware/export/config-meizu-m6sp.h create mode 100644 firmware/target/arm/s5l8700/meizu-m3/adc-target.h create mode 100644 firmware/target/arm/s5l8700/meizu-m3/backlight-target.h create mode 100644 firmware/target/arm/s5l8700/meizu-m3/button-target.h create mode 100644 firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c create mode 100644 firmware/target/arm/s5l8700/meizu-m6sp/adc-target.h create mode 100644 firmware/target/arm/s5l8700/meizu-m6sp/backlight-target.h create mode 100644 firmware/target/arm/s5l8700/meizu-m6sp/button-target.h create mode 100644 firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c diff --git a/bootloader/SOURCES b/bootloader/SOURCES index c1771ff24f..c54d1e16b1 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES @@ -31,6 +31,10 @@ mrobe500.c telechips.c #elif defined(MEIZU_M6SL) meizu_m6sl.c +#elif defined(MEIZU_M6SP) +meizu_m6sp.c +#elif defined(MEIZU_M3) +meizu_m3.c #elif defined(ONDA_VX747) || defined(ONDA_VX767) ondavx747.c #elif defined(CREATIVE_ZVx) diff --git a/bootloader/meizu_m3.c b/bootloader/meizu_m3.c new file mode 100644 index 0000000000..cc9fbab88d --- /dev/null +++ b/bootloader/meizu_m3.c @@ -0,0 +1,142 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Greg White + * + * 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 "config.h" + +#include +#include +#include "inttypes.h" +#include "string.h" +#include "cpu.h" +#include "system.h" +#include "lcd.h" +#include "kernel.h" +#include "thread.h" +#include "ata.h" +#include "fat.h" +#include "disk.h" +#include "font.h" +#include "adc.h" +#include "backlight.h" +#include "backlight-target.h" +#include "button.h" +#include "panic.h" +#include "power.h" +#include "file.h" +#include "common.h" +#include "rbunicode.h" +#include "usb.h" +#include "qt1106.h" + +#include + +char version[] = APPSVERSION; +#define LONG_DELAY 200000 +#define SHORT_DELAY 50000 +#define PAUSE_DELAY 50000 + +static inline void delay(int duration) +{ + volatile int i; + for(i=0;i>i & 1); + } + delay(SHORT_DELAY*6); +} + +void main(void) +{ + //Set backlight pin to output and enable + int oldval = PCON0; + PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); + PDAT0 |= (1 << 2); + + //Set PLAY to input + oldval = PCON1; + PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); + + init_qt1106(); + + // Wait for play to be pressed + while(!(PDAT1 & (1 << 4))); + // Wait for play to be released + while((PDAT1 & (1 << 4))); + PDAT0 ^= (1 << 2); //Toggle backlight + delay(LONG_DELAY); + + /* Calibrate the lot */ + qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF | QT1106_DI \ + | QT1106_SLD_SLIDER | QT1106_CAL_WHEEL | QT1106_CAL_KEYS | QT1106_RES_4); + + /* Set to maximum sensitivity */ + qt1106_io(QT1106_CT | (0x00 << 8) ); + + while(true) + { + qt1106_wait(); + + int slider = qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF \ + | QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_4); + if(slider & 0x008000) + bl_debug_count(((slider&0xff)) + 1); + } + + //power off + PDAT1&=~(1<<3); +} + diff --git a/bootloader/meizu_m6sp.c b/bootloader/meizu_m6sp.c new file mode 100644 index 0000000000..7608c9bd30 --- /dev/null +++ b/bootloader/meizu_m6sp.c @@ -0,0 +1,123 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Greg White + * + * 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 "config.h" + +#include +#include +#include "inttypes.h" +#include "string.h" +#include "cpu.h" +#include "system.h" +#include "lcd.h" +#include "kernel.h" +#include "thread.h" +#include "ata.h" +#include "fat.h" +#include "disk.h" +#include "font.h" +#include "adc.h" +#include "backlight.h" +#include "backlight-target.h" +#include "button.h" +#include "panic.h" +#include "power.h" +#include "file.h" +#include "common.h" +#include "rbunicode.h" +#include "usb.h" +#include "qt1106.h" + +#include + +char version[] = APPSVERSION; +#define LONG_DELAY 200000 +#define SHORT_DELAY 50000 +#define PAUSE_DELAY 50000 + +static inline void delay(int duration) +{ + volatile int i; + for(i=0;i>i & 1); + } + delay(SHORT_DELAY*6); +} + +void main(void) +{ + //Set backlight pin to output and enable + int oldval = PCON0; + PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); + PDAT0 |= (1 << 2); + + //Set PLAY to input + oldval = PCON1; + PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); + + // Wait for play to be pressed + while(!(PDAT1 & (1 << 4))); + // Wait for play to be released + while((PDAT1 & (1 << 4))); + PDAT0 ^= (1 << 2); //Toggle backlight + delay(LONG_DELAY); + + //power off + PDAT1&=~(1<<3); +} + diff --git a/firmware/SOURCES b/firmware/SOURCES index d000447b6b..a120c88fa2 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1082,9 +1082,12 @@ target/arm/tcc780x/cowond2/audio-cowond2.c #endif /* SIMULATOR */ #endif /* COWON_D2 */ -#ifdef MEIZU_M6SL +#if CONFIG_CPU==S5L8700 target/arm/s5l8700/system-s5l8700.c target/arm/s5l8700/ata-nand-s5l8700.c +#endif + +#ifdef MEIZU_M6SL target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c drivers/qt1106.c #ifndef SIMULATOR @@ -1093,6 +1096,23 @@ drivers/qt1106.c #endif /* SIMULATOR */ #endif /* MEIZU_M6SL */ +#ifdef MEIZU_M6SP +target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c +#ifndef SIMULATOR +#ifndef BOOTLOADER +#endif /* BOOTLOADER */ +#endif /* SIMULATOR */ +#endif /* MEIZU_M6SP */ + +#ifdef MEIZU_M3 +target/arm/s5l8700/meizu-m3/lcd-m3.c +drivers/qt1106.c +#ifndef SIMULATOR +#ifndef BOOTLOADER +#endif /* BOOTLOADER */ +#endif /* SIMULATOR */ +#endif /* MEIZU_M3 */ + #if CONFIG_CPU==JZ4732 target/mips/ingenic_jz47xx/ata-nand-jz4740.c target/mips/ingenic_jz47xx/lcd-jz4740.c diff --git a/firmware/export/config-meizu-m3.h b/firmware/export/config-meizu-m3.h new file mode 100644 index 0000000000..7a07339bcb --- /dev/null +++ b/firmware/export/config-meizu-m3.h @@ -0,0 +1,175 @@ +/* + * This config file is for Meizu M3 + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 1 + +#define MODEL_NAME "Meizu M3" + +/* define this if you have recording possibility */ +//#define HAVE_RECORDING + +/* Define bitmask of input sources - recordable bitmask can be defined + explicitly if different */ +#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) + +/* define the bitmask of hardware sample rates */ +#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) + +/* define the bitmask of recording sample rates */ +#define REC_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) + +/* define this if you have a bitmap LCD display */ +#define HAVE_LCD_BITMAP + +/* define this if you can flip your LCD */ +//#define HAVE_LCD_FLIP + +/* 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 can invert the colours on your LCD */ +//#define HAVE_LCD_INVERT + +/* 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 you have a flash memory storage */ +#define HAVE_FLASH_STORAGE + +/* LCD dimensions */ +#define LCD_WIDTH 176 +#define LCD_HEIGHT 132 +#define LCD_DEPTH 16 /* pseudo 262.144 colors */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ + +/* Define this if your LCD can be enabled/disabled */ +//#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 CONFIG_KEYPAD MEIZU_M3_PAD + +//#define AB_REPEAT_ENABLE 1 +//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC + +/* define this if you have a real-time clock */ +#define CONFIG_RTC RTC_S5L8700 +//#define CONFIG_RTC RTC_S35390A + +#define CONFIG_LCD LCD_MEIZUM6 + +/* Define this if you have the WM8975 audio codec */ +#define HAVE_WM8751 //FIXME + +/* Define this for LCD backlight available */ +#define HAVE_BACKLIGHT +#define HAVE_BACKLIGHT_BRIGHTNESS + +/* 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 0x80000 + +/* FM Tuner */ +#define CONFIG_TUNER TEA5760 +#define CONFIG_TUNER_XTAL 32768 + +//#define HAVE_TLV320 + +/* TLV320 has no tone controls, so we use the software ones */ +#define HAVE_SW_TONE_CONTROLS + +#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 50 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ + +/* Hardware controlled charging? FIXME */ +#define CONFIG_CHARGING CHARGING_SIMPLE + +#ifndef SIMULATOR + +/* Define this if your LCD can set contrast */ +//#define HAVE_LCD_CONTRAST + +/* Define this if you have a Motorola SCF5250 */ +#define CONFIG_CPU S5L8700 + +/* Define this if you want to use coldfire's i2c interface */ +#define CONFIG_I2C I2C_S5L8700 + +/* 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 11289600 + +/* Define this if you have ATA power-off control */ +//#define HAVE_ATA_POWER_OFF + +/* Virtual LED (icon) */ +#define CONFIG_LED LED_VIRTUAL + +/* 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 + +/* USB On-the-go */ +//#define CONFIG_USBOTG USBOTG_M5636 + +/* Define this if you have adjustable CPU frequency */ +#define HAVE_ADJUSTABLE_CPU_FREQ + +#define BOOTFILE_EXT "meizu" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define BOOTDIR "/.rockbox" + +#define BOOTLOADER_ENTRYPOINT 0x001F0000 +#define FLASH_ENTRYPOINT 0x00001000 +#define FLASH_MAGIC 0xfbfbfbf1 + +#endif /* SIMULATOR */ + +/* Define this for FM radio input available */ +#define HAVE_FMRADIO_IN + +/** Port-specific settings **/ + +/* Main LCD contrast range and defaults */ +#define MIN_CONTRAST_SETTING 1 +#define MAX_CONTRAST_SETTING 30 +#define DEFAULT_CONTRAST_SETTING 19 /* Match boot contrast */ + +/* Main LCD backlight brightness range and defaults */ +/* PCF50506 can output 0%-100% duty cycle but D305A expects %15-100%. */ +#define MIN_BRIGHTNESS_SETTING 1 /* 15/16 (93.75%) */ +#define MAX_BRIGHTNESS_SETTING 13 /* 3/16 (18.75%) */ +#define DEFAULT_BRIGHTNESS_SETTING 8 /* 8/16 (50.00%) = x5 boot default */ + diff --git a/firmware/export/config-meizu-m6sp.h b/firmware/export/config-meizu-m6sp.h new file mode 100644 index 0000000000..4867904f4d --- /dev/null +++ b/firmware/export/config-meizu-m6sp.h @@ -0,0 +1,175 @@ +/* + * This config file is for Meizu M6SP + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 1 + +#define MODEL_NAME "Meizu M6SP" + +/* define this if you have recording possibility */ +//#define HAVE_RECORDING + +/* Define bitmask of input sources - recordable bitmask can be defined + explicitly if different */ +#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) + +/* define the bitmask of hardware sample rates */ +#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) + +/* define the bitmask of recording sample rates */ +#define REC_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) + +/* define this if you have a bitmap LCD display */ +#define HAVE_LCD_BITMAP + +/* define this if you can flip your LCD */ +//#define HAVE_LCD_FLIP + +/* 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 can invert the colours on your LCD */ +//#define HAVE_LCD_INVERT + +/* 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 you have a flash memory storage */ +#define HAVE_FLASH_STORAGE + +/* LCD dimensions */ +#define LCD_WIDTH 320 +#define LCD_HEIGHT 240 +#define LCD_DEPTH 16 /* pseudo 262.144 colors */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ + +/* Define this if your LCD can be enabled/disabled */ +//#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 CONFIG_KEYPAD MEIZU_M6SP_PAD + +//#define AB_REPEAT_ENABLE 1 +//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC + +/* define this if you have a real-time clock */ +#define CONFIG_RTC RTC_S5L8700 +//#define CONFIG_RTC RTC_S35390A + +#define CONFIG_LCD LCD_MEIZUM6 + +/* Define this if you have the WM8975 audio codec */ +#define HAVE_WM8751 //FIXME + +/* Define this for LCD backlight available */ +#define HAVE_BACKLIGHT +#define HAVE_BACKLIGHT_BRIGHTNESS + +/* 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 0x80000 + +/* FM Tuner */ +#define CONFIG_TUNER TEA5760 +#define CONFIG_TUNER_XTAL 32768 + +//#define HAVE_TLV320 + +/* TLV320 has no tone controls, so we use the software ones */ +#define HAVE_SW_TONE_CONTROLS + +#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 2250 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 50 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ + +/* Hardware controlled charging? FIXME */ +#define CONFIG_CHARGING CHARGING_SIMPLE + +#ifndef SIMULATOR + +/* Define this if your LCD can set contrast */ +//#define HAVE_LCD_CONTRAST + +/* Define this if you have a Motorola SCF5250 */ +#define CONFIG_CPU S5L8700 + +/* Define this if you want to use coldfire's i2c interface */ +#define CONFIG_I2C I2C_S5L8700 + +/* 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 11289600 + +/* Define this if you have ATA power-off control */ +//#define HAVE_ATA_POWER_OFF + +/* Virtual LED (icon) */ +#define CONFIG_LED LED_VIRTUAL + +/* 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 + +/* USB On-the-go */ +//#define CONFIG_USBOTG USBOTG_M5636 + +/* Define this if you have adjustable CPU frequency */ +#define HAVE_ADJUSTABLE_CPU_FREQ + +#define BOOTFILE_EXT "meizu" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define BOOTDIR "/.rockbox" + +#define BOOTLOADER_ENTRYPOINT 0x001F0000 +#define FLASH_ENTRYPOINT 0x00001000 +#define FLASH_MAGIC 0xfbfbfbf1 + +#endif /* SIMULATOR */ + +/* Define this for FM radio input available */ +#define HAVE_FMRADIO_IN + +/** Port-specific settings **/ + +/* Main LCD contrast range and defaults */ +#define MIN_CONTRAST_SETTING 1 +#define MAX_CONTRAST_SETTING 30 +#define DEFAULT_CONTRAST_SETTING 19 /* Match boot contrast */ + +/* Main LCD backlight brightness range and defaults */ +/* PCF50506 can output 0%-100% duty cycle but D305A expects %15-100%. */ +#define MIN_BRIGHTNESS_SETTING 1 /* 15/16 (93.75%) */ +#define MAX_BRIGHTNESS_SETTING 13 /* 3/16 (18.75%) */ +#define DEFAULT_BRIGHTNESS_SETTING 8 /* 8/16 (50.00%) = x5 boot default */ + diff --git a/firmware/export/config.h b/firmware/export/config.h index fe2cff0ea6..f6ec686b1f 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -95,6 +95,8 @@ #define MEIZU_M6SL_PAD 30 #define ONDAVX747_PAD 31 #define ONDAVX767_PAD 32 +#define MEIZU_M6SP_PAD 33 +#define MEIZU_M3_PAD 34 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 @@ -291,6 +293,10 @@ #include "config-c100.h" #elif defined(MEIZU_M6SL) #include "config-meizu-m6sl.h" +#elif defined(MEIZU_M6SP) +#include "config-meizu-m6sp.h" +#elif defined(MEIZU_M3) +#include "config-meizu-m3.h" #elif defined(ONDA_VX747) #include "config-ondavx747.h" #elif defined(ONDA_VX767) diff --git a/firmware/target/arm/s5l8700/meizu-m3/adc-target.h b/firmware/target/arm/s5l8700/meizu-m3/adc-target.h new file mode 100644 index 0000000000..d21d401735 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m3/adc-target.h @@ -0,0 +1,35 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Barry Wardell + * + * 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. + * + ****************************************************************************/ +#ifndef _ADC_TARGET_H_ +#define _ADC_TARGET_H_ + +/* only two channels used by the Gigabeat */ +#define NUM_ADC_CHANNELS 1 + +#define ADC_UNKNOWN_1 0 +#define ADC_UNKNOWN_2 1 +#define ADC_BATTERY 2 +#define ADC_UNKNOWN_4 3 + +#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ +#define ADC_READ_ERROR 0xFFFF + +#endif diff --git a/firmware/target/arm/s5l8700/meizu-m3/backlight-target.h b/firmware/target/arm/s5l8700/meizu-m3/backlight-target.h new file mode 100644 index 0000000000..91579b080d --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m3/backlight-target.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 by Marcoen Hirschberg + * + * 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. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +bool _backlight_init(void); +void _backlight_on(void); +void _backlight_off(void); +void _backlight_set_brightness(int brightness); + +#endif diff --git a/firmware/target/arm/s5l8700/meizu-m3/button-target.h b/firmware/target/arm/s5l8700/meizu-m3/button-target.h new file mode 100644 index 0000000000..7fab9c4d64 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m3/button-target.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Linus Nielsen Feltzing + * + * 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. + * + ****************************************************************************/ +#ifndef _BUTTON_TARGET_H_ +#define _BUTTON_TARGET_H_ + +#include +#include "config.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_LEFT 0x00000001 +#define BUTTON_RIGHT 0x00000002 +#define BUTTON_UP 0x00000004 +#define BUTTON_DOWN 0x00000008 + +#define BUTTON_SELECT 0x00000010 + +#define BUTTON_MENU 0x00000020 +#define BUTTON_PLAY 0x00000040 + + +#define BUTTON_MAIN (BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\ + |BUTTON_UP|BUTTON_DOWN|BUTTON_SELECT|BUTTON_PLAY) + +#define BUTTON_REMOTE 0 + +#define POWEROFF_BUTTON BUTTON_PLAY +#define POWEROFF_COUNT 10 + +#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c new file mode 100644 index 0000000000..1affab3b01 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c @@ -0,0 +1,135 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Alan Korr + * + * 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 "config.h" + +#include "hwcompat.h" +#include "kernel.h" +#include "lcd.h" +#include "system.h" +#include "cpu.h" + +/*** definitions ***/ + + +/** globals **/ + +static int xoffset; /* needed for flip */ + +/*** hardware configuration ***/ + +int lcd_default_contrast(void) +{ + return 0x1f; +} + +void lcd_set_contrast(int val) +{ +} + +void lcd_set_invert_display(bool yesno) +{ +} + +/* turn the display upside down (call lcd_update() afterwards) */ +void lcd_set_flip(bool yesno) +{ + /* TODO: flip mode isn't working. The commands in the else part of + this function are how the original firmware inits the LCD */ + + if (yesno) + { + xoffset = 132 - LCD_WIDTH; /* 132 colums minus the 128 we have */ + } + else + { + xoffset = 0; + } +} + + +/* LCD init */ +void lcd_init_device(void) +{ +} + +/*** Update functions ***/ + +/* Performance function that works with an external buffer + note that by and bheight are in 8-pixel units! */ +void lcd_blit_mono(const unsigned char *data, int x, int by, int width, + int bheight, int stride) +{ + /* Copy display bitmap to hardware */ + while (bheight--) + { + } +} + + +/* Performance function that works with an external buffer + note that by and bheight are in 8-pixel units! */ +void lcd_blit_grey_phase_blit(unsigned char *values, unsigned char *phases, + int x, int by, int width, int bheight, int stride) +{ + (void)values; + (void)phases; + (void)x; + (void)by; + (void)width; + (void)bheight; + (void)stride; +} + +/* Update the display. + This must be called after all other LCD functions that change the display. */ +void lcd_update(void) ICODE_ATTR; +void lcd_update(void) +{ + int y; + + /* Copy display bitmap to hardware */ + for (y = 0; y < LCD_FBHEIGHT; y++) + { + } +} + +/* Update a fraction of the display. */ +void lcd_update_rect(int, int, int, int) ICODE_ATTR; +void lcd_update_rect(int x, int y, int width, int height) +{ + int ymax; + + /* The Y coordinates have to work on even 8 pixel rows */ + ymax = (y + height-1) >> 3; + y >>= 3; + + if(x + width > LCD_WIDTH) + width = LCD_WIDTH - x; + if (width <= 0) + return; /* nothing left to do, 0 is harmful to lcd_write_data() */ + if(ymax >= LCD_FBHEIGHT) + ymax = LCD_FBHEIGHT-1; + + /* Copy specified rectange bitmap to hardware */ + for (; y <= ymax; y++) + { + } +} diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/adc-target.h b/firmware/target/arm/s5l8700/meizu-m6sp/adc-target.h new file mode 100644 index 0000000000..d21d401735 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sp/adc-target.h @@ -0,0 +1,35 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Barry Wardell + * + * 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. + * + ****************************************************************************/ +#ifndef _ADC_TARGET_H_ +#define _ADC_TARGET_H_ + +/* only two channels used by the Gigabeat */ +#define NUM_ADC_CHANNELS 1 + +#define ADC_UNKNOWN_1 0 +#define ADC_UNKNOWN_2 1 +#define ADC_BATTERY 2 +#define ADC_UNKNOWN_4 3 + +#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ +#define ADC_READ_ERROR 0xFFFF + +#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/backlight-target.h b/firmware/target/arm/s5l8700/meizu-m6sp/backlight-target.h new file mode 100644 index 0000000000..91579b080d --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sp/backlight-target.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 by Marcoen Hirschberg + * + * 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. + * + ****************************************************************************/ +#ifndef BACKLIGHT_TARGET_H +#define BACKLIGHT_TARGET_H + +bool _backlight_init(void); +void _backlight_on(void); +void _backlight_off(void); +void _backlight_set_brightness(int brightness); + +#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/button-target.h b/firmware/target/arm/s5l8700/meizu-m6sp/button-target.h new file mode 100644 index 0000000000..7fab9c4d64 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sp/button-target.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 by Linus Nielsen Feltzing + * + * 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. + * + ****************************************************************************/ +#ifndef _BUTTON_TARGET_H_ +#define _BUTTON_TARGET_H_ + +#include +#include "config.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_LEFT 0x00000001 +#define BUTTON_RIGHT 0x00000002 +#define BUTTON_UP 0x00000004 +#define BUTTON_DOWN 0x00000008 + +#define BUTTON_SELECT 0x00000010 + +#define BUTTON_MENU 0x00000020 +#define BUTTON_PLAY 0x00000040 + + +#define BUTTON_MAIN (BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\ + |BUTTON_UP|BUTTON_DOWN|BUTTON_SELECT|BUTTON_PLAY) + +#define BUTTON_REMOTE 0 + +#define POWEROFF_BUTTON BUTTON_PLAY +#define POWEROFF_COUNT 10 + +#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c new file mode 100644 index 0000000000..1affab3b01 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c @@ -0,0 +1,135 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Alan Korr + * + * 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 "config.h" + +#include "hwcompat.h" +#include "kernel.h" +#include "lcd.h" +#include "system.h" +#include "cpu.h" + +/*** definitions ***/ + + +/** globals **/ + +static int xoffset; /* needed for flip */ + +/*** hardware configuration ***/ + +int lcd_default_contrast(void) +{ + return 0x1f; +} + +void lcd_set_contrast(int val) +{ +} + +void lcd_set_invert_display(bool yesno) +{ +} + +/* turn the display upside down (call lcd_update() afterwards) */ +void lcd_set_flip(bool yesno) +{ + /* TODO: flip mode isn't working. The commands in the else part of + this function are how the original firmware inits the LCD */ + + if (yesno) + { + xoffset = 132 - LCD_WIDTH; /* 132 colums minus the 128 we have */ + } + else + { + xoffset = 0; + } +} + + +/* LCD init */ +void lcd_init_device(void) +{ +} + +/*** Update functions ***/ + +/* Performance function that works with an external buffer + note that by and bheight are in 8-pixel units! */ +void lcd_blit_mono(const unsigned char *data, int x, int by, int width, + int bheight, int stride) +{ + /* Copy display bitmap to hardware */ + while (bheight--) + { + } +} + + +/* Performance function that works with an external buffer + note that by and bheight are in 8-pixel units! */ +void lcd_blit_grey_phase_blit(unsigned char *values, unsigned char *phases, + int x, int by, int width, int bheight, int stride) +{ + (void)values; + (void)phases; + (void)x; + (void)by; + (void)width; + (void)bheight; + (void)stride; +} + +/* Update the display. + This must be called after all other LCD functions that change the display. */ +void lcd_update(void) ICODE_ATTR; +void lcd_update(void) +{ + int y; + + /* Copy display bitmap to hardware */ + for (y = 0; y < LCD_FBHEIGHT; y++) + { + } +} + +/* Update a fraction of the display. */ +void lcd_update_rect(int, int, int, int) ICODE_ATTR; +void lcd_update_rect(int x, int y, int width, int height) +{ + int ymax; + + /* The Y coordinates have to work on even 8 pixel rows */ + ymax = (y + height-1) >> 3; + y >>= 3; + + if(x + width > LCD_WIDTH) + width = LCD_WIDTH - x; + if (width <= 0) + return; /* nothing left to do, 0 is harmful to lcd_write_data() */ + if(ymax >= LCD_FBHEIGHT) + ymax = LCD_FBHEIGHT-1; + + /* Copy specified rectange bitmap to hardware */ + for (; y <= ymax; y++) + { + } +} diff --git a/tools/configure b/tools/configure index 2cb50a940b..3dee5155db 100755 --- a/tools/configure +++ b/tools/configure @@ -693,10 +693,11 @@ cat <