diff --git a/apps/SOURCES b/apps/SOURCES index 285d02fa3d..923e979af5 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -215,14 +215,6 @@ keymaps/keymap-mr500.c keymaps/keymap-mr100.c #elif CONFIG_KEYPAD == COWON_D2_PAD keymaps/keymap-cowond2.c -#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD -keymaps/keymap-meizu-m6sl.c -#elif CONFIG_KEYPAD == MEIZU_M6SP_PAD -keymaps/keymap-meizu-m6sp.c -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -keymaps/keymap-creativezvm.c -#elif CONFIG_KEYPAD == CREATIVEZV_PAD -keymaps/keymap-creativezv.c #elif CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD keymaps/keymap-zenxfi2.c #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD @@ -244,8 +236,6 @@ keymaps/keymap-ondavx767.c #elif (CONFIG_KEYPAD == SAMSUNG_YH820_PAD) \ || (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD) keymaps/keymap-yh8xx_yh9xx.c -#elif CONFIG_KEYPAD == MINI2440_PAD -keymaps/keymap-mini2440.c #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD keymaps/keymap-vibe500.c #elif CONFIG_KEYPAD == MPIO_HD200_PAD diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 61788fe559..117194b834 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -143,6 +143,10 @@ #include "iap.h" #endif +#ifdef HIBY_LINUX +#include +#endif + #define SCREEN_MAX_CHARS (LCD_WIDTH / SYSFONT_WIDTH) static const char* threads_getname(int selected_item, void *data, @@ -2597,31 +2601,6 @@ static bool dbg_isp1583(void) } #endif -#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) -extern int pic_dbg_num_items(void); -extern const char* pic_dbg_item(int selected_item, void *data, - char *buffer, size_t buffer_len); - -static int pic_action_callback(int action, struct gui_synclist *lists) -{ - (void)lists; - if (action == ACTION_NONE) - action = ACTION_REDRAW; - return action; -} - -static bool dbg_pic(void) -{ - struct simplelist_info pic; - pic.scroll_all = true; - simplelist_info_init(&pic, "PIC", pic_dbg_num_items(), NULL); - pic.timeout = HZ/100; - pic.get_name = pic_dbg_item; - pic.action_callback = pic_action_callback; - return simplelist_show_list(&pic); -} -#endif - #if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) static bool dbg_boot_data(void) { @@ -2800,6 +2779,55 @@ static bool dbg_bootflash_dump(void) { } #endif +#ifdef HIBY_LINUX +static bool view_ram_info(void) +{ + struct simplelist_info info; + simplelist_info_init(&info, "RAM Info", 0, NULL); + + simplelist_reset_lines(); + simplelist_addline("Rockbox: %d MB", MEMORYSIZE); + + struct sysinfo sys_info; + if (sysinfo(&sys_info) == 0) { + long total_ram = sys_info.totalram * sys_info.mem_unit / 1024 / 1024; + long free_ram = sys_info.freeram * sys_info.mem_unit / 1024 / 1024; + long buffer_ram = sys_info.bufferram * sys_info.mem_unit / 1024 / 1024; + simplelist_addline("Total RAM: %ld MB", total_ram); + simplelist_addline("Free RAM: %ld MB", free_ram); + simplelist_addline("Buffer RAM: %ld MB", buffer_ram); + + /* Try to read MemAvailable from /proc/meminfo for a better "free" estimate */ + FILE *fp = fopen("/proc/meminfo", "r"); + if (fp) { + char line[128]; + long mem_avail = -1; + long cached = -1; + while (fgets(line, sizeof(line), fp)) { + if (sscanf(line, "MemAvailable: %ld kB", &mem_avail) == 1) { + mem_avail /= 1024; + } + else if (sscanf(line, "Cached: %ld kB", &cached) == 1) { + cached /= 1024; + } + } + fclose(fp); + + if (mem_avail != -1) { + /* Estimate of how much memory is available for starting new applications */ + simplelist_addline("Available: %ld MB", mem_avail); + } + if (cached != -1) { + /* Memory used by the page cache. */ + simplelist_addline("Cached: %ld MB", cached); + } + } + } + + return simplelist_show_list(&info); +} +#endif + /****** The menu *********/ static const struct { unsigned char *desc; /* string or ID */ @@ -2839,6 +2867,9 @@ static const struct { #ifdef __linux__ { "View CPU stats", dbg_cpuinfo }, #endif +#ifdef HIBY_LINUX + { "View RAM info", view_ram_info }, +#endif #if (CONFIG_BATTERY_MEASURE != 0) && !defined(SIMULATOR) { "View battery", view_battery }, #endif @@ -2886,9 +2917,6 @@ static const struct { #if CONFIG_USBOTG == USBOTG_ISP1583 { "View ISP1583 info", dbg_isp1583 }, #endif -#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) - { "View PIC info", dbg_pic }, -#endif #ifdef ROCKBOX_HAS_LOGF {"Show Log File", logfdisplay }, {"Dump Log File", logfdump }, diff --git a/apps/fileop.c b/apps/fileop.c index e24761be58..54c9b14f52 100644 --- a/apps/fileop.c +++ b/apps/fileop.c @@ -97,19 +97,23 @@ static bool poll_cancel_action(int operation, struct file_op_params *param) { int total_shft = (int) (param->total_size >> 15); int current_shft = (int) (param->processed_size >> 15); + const char *unit_str = str(LANG_MEBIBYTE); splash_progress(current_shft, total_shft, - "%s %s (%d MiB)\n%d MiB", + "%s %s (%d %s)\n%d %s", op_str, param->toplevel_name, - total_shft >> 5, current_shft >> 5); + total_shft >> 5, unit_str, + current_shft >> 5, unit_str); } else if (param->total_size >= 1024) { int total_kib = (int) (param->total_size >> 10); int current_kib = (int) (param->processed_size >> 10); + const char *unit_str = str(LANG_KIBIBYTE); splash_progress(current_kib, total_kib, - "%s %s (%d KiB)\n%d KiB", + "%s %s (%d %s)\n%d %s", op_str, param->toplevel_name, - total_kib, current_kib); + total_kib, unit_str, + current_kib, unit_str); } } return ACTION_STD_CANCEL == get_action(CONTEXT_STD, TIMEOUT_NOBLOCK); diff --git a/apps/keymaps/keymap-creativezv.c b/apps/keymaps/keymap-creativezv.c deleted file mode 100644 index 3242e8924f..0000000000 --- a/apps/keymaps/keymap-creativezv.c +++ /dev/null @@ -1,256 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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. - * - ****************************************************************************/ - -/* Button Code Definitions for the Creative Zen Vision target */ -/* Copied from ZVM target for now... */ -#include -#include -#include - -#include "config.h" -#include "action.h" -#include "button.h" -#include "settings.h" - -/* - * The format of the list is as follows - * { Action Code, Button code, Prereq button code } - * if there's no need to check the previous button's value, use BUTTON_NONE - * Insert LAST_ITEM_IN_LIST at the end of each mapping - */ - -/* CONTEXT_CUSTOM's used in this file... - -CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) -CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens - i.e where up/down is inc/dec - CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec - -*/ - -static const struct button_mapping button_context_standard[] = { - { ACTION_STD_PREV, BUTTON_UP|BUTTON_REL, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, - - { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - - { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_standard */ - - -static const struct button_mapping button_context_wps[] = { - { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - - { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, - { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - - //{ ACTION_WPS_ABSETB_NEXTDIR,BUTTON_RIGHT, BUTTON_CUSTOM }, - //{ ACTION_WPS_ABSETA_PREVDIR,BUTTON_LEFT, BUTTON_CUSTOM }, - //{ ACTION_WPS_ABRESET, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, - - { ACTION_WPS_PITCHSCREEN, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK }, - - { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - { ACTION_WPS_VIEW_PLAYLIST, BUTTON_POWER, BUTTON_NONE }, - { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - - { ACTION_WPS_HOTKEY, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, - { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_BACK }, - LAST_ITEM_IN_LIST -}; /* button_context_wps */ - -static const struct button_mapping button_context_list[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_list */ - -static const struct button_mapping button_context_tree[] = { - { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, - { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, - { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_TREE_HOTKEY, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) -}; /* button_context_tree */ - -static const struct button_mapping button_context_listtree_scroll_without_combo[] = { - { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, - { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_settings[] = { - { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, - { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, - { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, - { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings */ - -static const struct button_mapping button_context_settings_right_is_inc[] = { - { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settingsgraphical */ - -static const struct button_mapping button_context_yesno[] = { - { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings_yesno */ - -static const struct button_mapping button_context_colorchooser[] = { - { ACTION_STD_OK, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_colorchooser */ - -static const struct button_mapping button_context_eq[] = { - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_eq */ - -/** Bookmark Screen **/ -static const struct button_mapping button_context_bmark[] = { - { ACTION_BMS_DELETE, BUTTON_BACK, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), -}; /* button_context_bmark */ - -static const struct button_mapping button_context_time[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), -}; /* button_context_time */ - -static const struct button_mapping button_context_quickscreen[] = { - { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, - { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_quickscreen */ - -static const struct button_mapping button_context_pitchscreen[] = { - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_pitchcreen */ - -static const struct button_mapping button_context_keyboard[] = { - { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, - { ACTION_KBD_PAGE_FLIP, BUTTON_BACK|BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_KBD_ABORT, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST -}; /* button_context_keyboard */ - -const struct button_mapping* get_context_mapping(int context) -{ - switch (context&~CONTEXT_REMOTE) - { - case CONTEXT_STD: - return button_context_standard; - case CONTEXT_WPS: - return button_context_wps; - case CONTEXT_LIST: - return button_context_list; - case CONTEXT_MAINMENU: - case CONTEXT_TREE: - return button_context_listtree_scroll_without_combo; - case CONTEXT_CUSTOM|CONTEXT_TREE: - return button_context_tree; - case CONTEXT_SETTINGS: - return button_context_settings; - case CONTEXT_CUSTOM|CONTEXT_SETTINGS: - return button_context_settings_right_is_inc; - case CONTEXT_SETTINGS_COLOURCHOOSER: - return button_context_colorchooser; - case CONTEXT_SETTINGS_EQ: - return button_context_eq; - case CONTEXT_SETTINGS_TIME: - return button_context_time; - case CONTEXT_YESNOSCREEN: - return button_context_yesno; - case CONTEXT_BOOKMARKSCREEN: - return button_context_bmark; - case CONTEXT_QUICKSCREEN: - return button_context_quickscreen; - case CONTEXT_PITCHSCREEN: - return button_context_pitchscreen; - case CONTEXT_KEYBOARD: - case CONTEXT_MORSE_INPUT: - return button_context_keyboard; - } - return button_context_standard; -} diff --git a/apps/keymaps/keymap-creativezvm.c b/apps/keymaps/keymap-creativezvm.c deleted file mode 100644 index 47b24bf8b3..0000000000 --- a/apps/keymaps/keymap-creativezvm.c +++ /dev/null @@ -1,255 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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. - * - ****************************************************************************/ - -/* Button Code Definitions for the Creative Zen Vision:M target */ -#include -#include -#include - -#include "config.h" -#include "action.h" -#include "button.h" -#include "settings.h" - -/* - * The format of the list is as follows - * { Action Code, Button code, Prereq button code } - * if there's no need to check the previous button's value, use BUTTON_NONE - * Insert LAST_ITEM_IN_LIST at the end of each mapping - */ - -/* CONTEXT_CUSTOM's used in this file... - -CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) -CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens - i.e where up/down is inc/dec - CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec - -*/ - -static const struct button_mapping button_context_standard[] = { - { ACTION_STD_PREV, BUTTON_UP|BUTTON_REL, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, - - { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - - { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_standard */ - - -static const struct button_mapping button_context_wps[] = { - { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - - { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, - { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - - //{ ACTION_WPS_ABSETB_NEXTDIR,BUTTON_RIGHT, BUTTON_CUSTOM }, - //{ ACTION_WPS_ABSETA_PREVDIR,BUTTON_LEFT, BUTTON_CUSTOM }, - //{ ACTION_WPS_ABRESET, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, - - { ACTION_WPS_PITCHSCREEN, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK }, - - { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - { ACTION_WPS_VIEW_PLAYLIST, BUTTON_POWER, BUTTON_NONE }, - { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - - { ACTION_WPS_HOTKEY, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, - { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_BACK }, - LAST_ITEM_IN_LIST -}; /* button_context_wps */ - -static const struct button_mapping button_context_list[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_list */ - -static const struct button_mapping button_context_tree[] = { - { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, - { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, - { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_TREE_HOTKEY, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) -}; /* button_context_tree */ - -static const struct button_mapping button_context_listtree_scroll_without_combo[] = { - { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, - { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_settings[] = { - { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, - { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, - { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, - { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings */ - -static const struct button_mapping button_context_settings_right_is_inc[] = { - { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settingsgraphical */ - -static const struct button_mapping button_context_yesno[] = { - { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings_yesno */ - -static const struct button_mapping button_context_colorchooser[] = { - { ACTION_STD_OK, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_colorchooser */ - -static const struct button_mapping button_context_eq[] = { - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_eq */ - -/** Bookmark Screen **/ -static const struct button_mapping button_context_bmark[] = { - { ACTION_BMS_DELETE, BUTTON_BACK, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), -}; /* button_context_bmark */ - -static const struct button_mapping button_context_time[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), -}; /* button_context_time */ - -static const struct button_mapping button_context_quickscreen[] = { - { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, - { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_quickscreen */ - -static const struct button_mapping button_context_pitchscreen[] = { - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_pitchcreen */ - -static const struct button_mapping button_context_keyboard[] = { - { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, - { ACTION_KBD_PAGE_FLIP, BUTTON_BACK|BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_KBD_ABORT, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST -}; /* button_context_keyboard */ - -const struct button_mapping* get_context_mapping(int context) -{ - switch (context&~CONTEXT_REMOTE) - { - case CONTEXT_STD: - return button_context_standard; - case CONTEXT_WPS: - return button_context_wps; - case CONTEXT_LIST: - return button_context_list; - case CONTEXT_MAINMENU: - case CONTEXT_TREE: - return button_context_listtree_scroll_without_combo; - case CONTEXT_CUSTOM|CONTEXT_TREE: - return button_context_tree; - case CONTEXT_SETTINGS: - return button_context_settings; - case CONTEXT_CUSTOM|CONTEXT_SETTINGS: - return button_context_settings_right_is_inc; - case CONTEXT_SETTINGS_COLOURCHOOSER: - return button_context_colorchooser; - case CONTEXT_SETTINGS_EQ: - return button_context_eq; - case CONTEXT_SETTINGS_TIME: - return button_context_time; - case CONTEXT_YESNOSCREEN: - return button_context_yesno; - case CONTEXT_BOOKMARKSCREEN: - return button_context_bmark; - case CONTEXT_QUICKSCREEN: - return button_context_quickscreen; - case CONTEXT_PITCHSCREEN: - return button_context_pitchscreen; - case CONTEXT_KEYBOARD: - case CONTEXT_MORSE_INPUT: - return button_context_keyboard; - } - return button_context_standard; -} diff --git a/apps/keymaps/keymap-echor1.c b/apps/keymaps/keymap-echor1.c index 4964535b82..140c682f82 100644 --- a/apps/keymaps/keymap-echor1.c +++ b/apps/keymaps/keymap-echor1.c @@ -57,6 +57,7 @@ static const struct button_mapping button_context_wps[] = { {ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE}, {ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT}, {ACTION_WPS_QUICKSCREEN, BUTTON_B, BUTTON_NONE}, + {ACTION_WPS_MENU, BUTTON_Y, BUTTON_NONE}, LAST_ITEM_IN_LIST }; /* button_context_wps */ diff --git a/apps/keymaps/keymap-meizu-m6sl.c b/apps/keymaps/keymap-meizu-m6sl.c deleted file mode 100644 index 31dbc88432..0000000000 --- a/apps/keymaps/keymap-meizu-m6sl.c +++ /dev/null @@ -1,299 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2006 Jonathan Gordon - * - * 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. - * - ****************************************************************************/ - -/* Button Code Definitions for the toshiba gigabeat target */ -#include -#include -#include - -#include "config.h" -#include "action.h" -#include "button.h" -#include "settings.h" - -/* - * The format of the list is as follows - * { Action Code, Button code, Prereq button code } - * if there's no need to check the previous button's value, use BUTTON_NONE - * Insert LAST_ITEM_IN_LIST at the end of each mapping - */ - -/* CONTEXT_CUSTOM's used in this file... - -CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) -CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens - i.e where up/down is inc/dec - CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec - -*/ - - -static const struct button_mapping button_context_standard[] = { - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, - - { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, - - { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_standard */ - - -static const struct button_mapping button_context_wps[] = { - { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - - { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, - { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - - { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_WPS_ABSETA_PREVDIR, BUTTON_PLAY|BUTTON_LEFT, BUTTON_NONE }, - { ACTION_WPS_ABRESET, BUTTON_PLAY|BUTTON_SELECT, BUTTON_NONE }, - - { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, - - { ACTION_WPS_PITCHSCREEN, BUTTON_PLAY|BUTTON_UP, BUTTON_PLAY }, - { ACTION_WPS_VIEW_PLAYLIST, BUTTON_PLAY|BUTTON_DOWN, BUTTON_PLAY }, - - { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - - { ACTION_WPS_HOTKEY, BUTTON_PLAY|BUTTON_MENU, BUTTON_NONE }, - { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - - LAST_ITEM_IN_LIST -}; /* button_context_wps */ - -static const struct button_mapping button_context_list[] = { - { ACTION_LISTTREE_PGUP, BUTTON_PLAY|BUTTON_UP, BUTTON_NONE }, - { ACTION_LISTTREE_PGUP, BUTTON_PLAY|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_LISTTREE_PGDOWN, BUTTON_PLAY|BUTTON_DOWN, BUTTON_NONE }, - { ACTION_LISTTREE_PGDOWN, BUTTON_PLAY|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_list */ - -static const struct button_mapping button_context_tree[] = { - { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_TREE_HOTKEY, BUTTON_PLAY|BUTTON_MENU, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) -}; /* button_context_tree */ - -static const struct button_mapping button_context_listtree_scroll_with_combo[] = { - { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE }, - { ACTION_TREE_PGLEFT, BUTTON_PLAY|BUTTON_LEFT, BUTTON_NONE }, - { ACTION_TREE_ROOT_INIT, BUTTON_PLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_PLAY|BUTTON_LEFT }, - { ACTION_TREE_PGLEFT, BUTTON_PLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_TREE_PGRIGHT, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_TREE_PGRIGHT, BUTTON_PLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_listtree_scroll_without_combo[] = { - { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, - { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_settings[] = { - { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings */ - -static const struct button_mapping button_context_settings_right_is_inc[] = { - { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settingsgraphical */ - -static const struct button_mapping button_context_yesno[] = { - { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings_yesno */ - -static const struct button_mapping button_context_colorchooser[] = { - { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_colorchooser */ - -static const struct button_mapping button_context_eq[] = { - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_eq */ - -/** Bookmark Screen **/ -static const struct button_mapping button_context_bmark[] = { - { ACTION_BMS_DELETE, BUTTON_PLAY, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), -}; /* button_context_bmark */ - -static const struct button_mapping button_context_time[] = { - { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), -}; /* button_context_time */ - -static const struct button_mapping button_context_quickscreen[] = { - { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, - { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_quickscreen */ - -static const struct button_mapping button_context_pitchscreen[] = { - { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, - { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, - { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, - { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE }, - { ACTION_PS_RESET, BUTTON_PLAY, BUTTON_NONE }, - { ACTION_PS_EXIT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_pitchcreen */ - -static const struct button_mapping button_context_keyboard[] = { - { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_PLAY|BUTTON_LEFT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_PLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, - { ACTION_KBD_PAGE_FLIP, BUTTON_PLAY|BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_KBD_ABORT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, -// { ACTION_KBD_MORSE_INPUT, BUTTON_PLAY|BUTTON_POWER, BUTTON_NONE }, - { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_keyboard */ - - -const struct button_mapping* get_context_mapping(int context) -{ - switch (context) - { - case CONTEXT_STD: - return button_context_standard; - case CONTEXT_WPS: - return button_context_wps; - - case CONTEXT_LIST: - return button_context_list; - case CONTEXT_MAINMENU: - case CONTEXT_TREE: - if (global_settings.hold_lr_for_scroll_in_list) - return button_context_listtree_scroll_without_combo; - else - return button_context_listtree_scroll_with_combo; - case CONTEXT_CUSTOM|CONTEXT_TREE: - return button_context_tree; - - case CONTEXT_SETTINGS: - return button_context_settings; - case CONTEXT_CUSTOM|CONTEXT_SETTINGS: - return button_context_settings_right_is_inc; - - case CONTEXT_SETTINGS_COLOURCHOOSER: - return button_context_colorchooser; - case CONTEXT_SETTINGS_EQ: - return button_context_eq; - - case CONTEXT_SETTINGS_TIME: - return button_context_time; - - case CONTEXT_YESNOSCREEN: - return button_context_yesno; - case CONTEXT_BOOKMARKSCREEN: - return button_context_bmark; - case CONTEXT_QUICKSCREEN: - return button_context_quickscreen; - case CONTEXT_PITCHSCREEN: - return button_context_pitchscreen; - case CONTEXT_KEYBOARD: - case CONTEXT_MORSE_INPUT: - return button_context_keyboard; - } - return button_context_standard; -} diff --git a/apps/keymaps/keymap-meizu-m6sp.c b/apps/keymaps/keymap-meizu-m6sp.c deleted file mode 100644 index 962b8b5579..0000000000 --- a/apps/keymaps/keymap-meizu-m6sp.c +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2006 Jonathan Gordon - * - * 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. - * - ****************************************************************************/ - -/* Button Code Definitions for the toshiba gigabeat target */ -#include -#include -#include - -#include "config.h" -#include "action.h" -#include "button.h" -#include "settings.h" - -/* - * The format of the list is as follows - * { Action Code, Button code, Prereq button code } - * if there's no need to check the previous button's value, use BUTTON_NONE - * Insert LAST_ITEM_IN_LIST at the end of each mapping - */ - -/* CONTEXT_CUSTOM's used in this file... - -CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) -CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens - i.e where up/down is inc/dec - CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec - -*/ - -/* copied from Meizu M6SP keymap */ -static const struct button_mapping button_context_standard[] = { -#if 0 /* disabled for now, there is no BUTTON_UP/DOWN yet */ - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, -#endif - { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, - - { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, - - { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_standard */ - - -const struct button_mapping* get_context_mapping(int context) -{ - (void)context; - - /* TODO add more button contexts */ - return button_context_standard; -} diff --git a/apps/keymaps/keymap-mini2440.c b/apps/keymaps/keymap-mini2440.c deleted file mode 100644 index 3fe0698fa0..0000000000 --- a/apps/keymaps/keymap-mini2440.c +++ /dev/null @@ -1,380 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bob Cousins - * - * 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. - * - ****************************************************************************/ - -/* Button Code Definitions for the Mini2440 target - * based on Toshiba Gigabeat F keymap - */ -#include -#include -#include - -#include "config.h" -#include "action.h" -#include "button.h" -#include "settings.h" - -/* - * The format of the list is as follows - * { Action Code, Button code, Prereq button code } - * if there's no need to check the previous button's value, use BUTTON_NONE - * Insert LAST_ITEM_IN_LIST at the end of each mapping - */ - -/* CONTEXT_CUSTOM's used in this file... - -CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) -CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens - i.e where up/down is inc/dec - CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec - -*/ - - -static const struct button_mapping button_context_standard[] = { - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, - - { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, - - { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_standard */ - - -static const struct button_mapping button_context_wps[] = { - { ACTION_WPS_PLAY, BUTTON_A|BUTTON_REL, BUTTON_A }, - { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, - - { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - - { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, - { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - - { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_WPS_ABSETA_PREVDIR,BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, - { ACTION_WPS_ABRESET, BUTTON_A|BUTTON_SELECT, BUTTON_NONE }, - - { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, - - { ACTION_WPS_PITCHSCREEN, BUTTON_A|BUTTON_UP, BUTTON_A }, - { ACTION_WPS_VIEW_PLAYLIST, BUTTON_A|BUTTON_DOWN, BUTTON_NONE }, - - { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, - - { ACTION_WPS_HOTKEY, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, - { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, - - LAST_ITEM_IN_LIST -}; /* button_context_wps */ - -static const struct button_mapping button_context_list[] = { - { ACTION_LISTTREE_PGUP, BUTTON_A|BUTTON_UP, BUTTON_NONE }, - { ACTION_LISTTREE_PGUP, BUTTON_A|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_LISTTREE_PGDOWN, BUTTON_A|BUTTON_DOWN, BUTTON_NONE }, - { ACTION_LISTTREE_PGDOWN, BUTTON_A|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, -#ifdef HAVE_VOLUME_IN_LIST - { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, - { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, - { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, -#endif - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_list */ - -static const struct button_mapping button_context_tree[] = { - { ACTION_TREE_WPS, BUTTON_A|BUTTON_REL, BUTTON_A }, - { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, - { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, - { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_TREE_HOTKEY, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) -}; /* button_context_tree */ - -static const struct button_mapping button_context_listtree_scroll_with_combo[] = { - { ACTION_NONE, BUTTON_A, BUTTON_NONE }, - { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, - { ACTION_TREE_ROOT_INIT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_A|BUTTON_LEFT }, - { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_listtree_scroll_without_combo[] = { - { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, - { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, - { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, - { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_settings[] = { - { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings */ - -static const struct button_mapping button_context_settings_right_is_inc[] = { - { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settingsgraphical */ - -static const struct button_mapping button_context_yesno[] = { - { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_settings_yesno */ - -static const struct button_mapping button_context_colorchooser[] = { - { ACTION_STD_OK, BUTTON_A|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_colorchooser */ - -static const struct button_mapping button_context_eq[] = { - { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), -}; /* button_context_eq */ - -/** Bookmark Screen **/ -static const struct button_mapping button_context_bmark[] = { - { ACTION_BMS_DELETE, BUTTON_A, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), -}; /* button_context_bmark */ - -static const struct button_mapping button_context_time[] = { - { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_A, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), -}; /* button_context_time */ - -static const struct button_mapping button_context_quickscreen[] = { - { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, - { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_quickscreen */ - -static const struct button_mapping button_context_pitchscreen[] = { - { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, - { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, - { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, - { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE }, - { ACTION_PS_RESET, BUTTON_A, BUTTON_NONE }, - { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, - { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_pitchcreen */ - -static const struct button_mapping button_context_keyboard[] = { - { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, - { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_LEFT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, - { ACTION_KBD_CURSOR_RIGHT, BUTTON_A|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, - { ACTION_KBD_PAGE_FLIP, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_DONE, BUTTON_A|BUTTON_REL, BUTTON_A }, - { ACTION_KBD_ABORT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, - { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, - { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, - { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_MORSE_INPUT, BUTTON_A|BUTTON_POWER, BUTTON_NONE }, - { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; /* button_context_keyboard */ - -#ifdef HAVE_MINI2440_REMOTE -/***************************************************************************** - * Remote control mappings - *****************************************************************************/ - -static const struct button_mapping remote_button_context_standard[] = { - { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, - { ACTION_STD_CONTEXT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF }, - { ACTION_STD_MENU, BUTTON_RC_DSP, BUTTON_NONE }, - - LAST_ITEM_IN_LIST -}; - -static const struct button_mapping remote_button_context_wps[] = { - { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE }, - - { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, - { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW }, - - { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT }, - { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT }, - - { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, - { ACTION_WPS_MENU, BUTTON_RC_DSP, BUTTON_NONE }, - - { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, - { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; - -static const struct button_mapping remote_button_context_tree[] = { - { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, - { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, - { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; - -static const struct button_mapping* get_context_mapping_remote( int context ) -{ - context ^= CONTEXT_REMOTE; - - switch (context) - { - case CONTEXT_WPS: - return remote_button_context_wps; - case CONTEXT_MAINMENU: - case CONTEXT_TREE: - return remote_button_context_tree; - } - return remote_button_context_standard; -} -#endif - -const struct button_mapping* target_get_context_mapping(int context) -{ -#ifdef HAVE_MINI2440_REMOTE - if (context&CONTEXT_REMOTE) - return get_context_mapping_remote(context); -#endif - switch (context) - { - case CONTEXT_STD: - return button_context_standard; - case CONTEXT_WPS: - return button_context_wps; - - case CONTEXT_LIST: - return button_context_list; - case CONTEXT_MAINMENU: - case CONTEXT_TREE: - if (global_settings.hold_lr_for_scroll_in_list) - return button_context_listtree_scroll_without_combo; - else - return button_context_listtree_scroll_with_combo; - case CONTEXT_CUSTOM|CONTEXT_TREE: - return button_context_tree; - - case CONTEXT_SETTINGS: - return button_context_settings; - case CONTEXT_CUSTOM|CONTEXT_SETTINGS: - return button_context_settings_right_is_inc; - - case CONTEXT_SETTINGS_COLOURCHOOSER: - return button_context_colorchooser; - case CONTEXT_SETTINGS_EQ: - return button_context_eq; - - case CONTEXT_SETTINGS_TIME: - return button_context_time; - - case CONTEXT_YESNOSCREEN: - return button_context_yesno; - case CONTEXT_BOOKMARKSCREEN: - return button_context_bmark; - case CONTEXT_QUICKSCREEN: - return button_context_quickscreen; - case CONTEXT_PITCHSCREEN: - return button_context_pitchscreen; - case CONTEXT_KEYBOARD: - return button_context_keyboard; - } - return button_context_standard; -} diff --git a/apps/lang/basque.lang b/apps/lang/basque.lang index 4aa63f8cc3..44d62202bf 100644 --- a/apps/lang/basque.lang +++ b/apps/lang/basque.lang @@ -10142,15 +10142,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Baxuen Mozketa" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Baxuen Mozketa" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Baxuen Mozketa" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Baxuen Mozketa" @@ -10159,15 +10159,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Altuen Mozketa" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Altuen Mozketa" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Altuen Mozketa" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Altuen Mozketa" diff --git a/apps/lang/bulgarian.lang b/apps/lang/bulgarian.lang index 179b73e2ec..06f75d50a4 100644 --- a/apps/lang/bulgarian.lang +++ b/apps/lang/bulgarian.lang @@ -9105,15 +9105,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на баса" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на баса" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на баса" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на баса" @@ -9122,15 +9122,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на високите" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на високите" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на високите" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отрязване на високите" diff --git a/apps/lang/catala.lang b/apps/lang/catala.lang index 853d3c4409..dbc9aa17ed 100644 --- a/apps/lang/catala.lang +++ b/apps/lang/catala.lang @@ -10136,15 +10136,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Freq. de tall de baixos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Freq. de tall de baixos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frequència de tall de baix" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frequència de tall de baix" @@ -10153,15 +10153,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Freq. de tall d'aguts" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Freq. de tall d'aguts" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frequència de tall d'aguts" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frequència de tall d'aguts" diff --git a/apps/lang/chinese-simp.lang b/apps/lang/chinese-simp.lang index 4448432ded..0495b17a0a 100644 --- a/apps/lang/chinese-simp.lang +++ b/apps/lang/chinese-simp.lang @@ -8889,15 +8889,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低频截止频率" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低频截止频率" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低频截止频率" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低频截止频率" @@ -9095,15 +9095,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高频截止频率" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高频截止频率" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高频截止频率" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高频截止频率" diff --git a/apps/lang/chinese-trad.lang b/apps/lang/chinese-trad.lang index 5e92c5b1d3..cc7eca6ab4 100644 --- a/apps/lang/chinese-trad.lang +++ b/apps/lang/chinese-trad.lang @@ -9160,15 +9160,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音截斷" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音截斷" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音截斷" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音截斷" @@ -9366,15 +9366,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音截斷" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音截斷" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音截斷" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音截斷" diff --git a/apps/lang/czech.lang b/apps/lang/czech.lang index 305b2a5589..90a4246006 100644 --- a/apps/lang/czech.lang +++ b/apps/lang/czech.lang @@ -10159,15 +10159,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí basů" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí basů" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí basů" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí basů" @@ -10176,15 +10176,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí výšek" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí výšek" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí výšek" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Oříznutí výšek" diff --git a/apps/lang/dansk.lang b/apps/lang/dansk.lang index 964c60d106..a0fbcacdd0 100644 --- a/apps/lang/dansk.lang +++ b/apps/lang/dansk.lang @@ -9936,15 +9936,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgrænse" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgrænse" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgrænse" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgrænse" @@ -10142,15 +10142,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrænse" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrænse" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrænse" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrænse" diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang index 572187cef9..8a8f5ae5a1 100644 --- a/apps/lang/deutsch.lang +++ b/apps/lang/deutsch.lang @@ -9092,15 +9092,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiefengrenzfrequenz" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiefengrenzfrequenz" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiefengrenzfrequenz" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiefengrenzfrequenz" @@ -9109,15 +9109,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Höhengrenzfrequenz" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Höhengrenzfrequenz" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Höhengrenzfrequenz" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Höhengrenzfrequenz" diff --git a/apps/lang/english-us.lang b/apps/lang/english-us.lang index 1063dbc539..1b3a7d83ab 100644 --- a/apps/lang/english-us.lang +++ b/apps/lang/english-us.lang @@ -9113,15 +9113,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" @@ -9130,15 +9130,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 52adf54617..c244096637 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -9284,15 +9284,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" @@ -9301,15 +9301,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" @@ -14919,7 +14919,7 @@ user: core *: "Press LEFT to cancel." - android,hifietma*,zenvision: "Press BACK to cancel." + android,hifietma*: "Press BACK to cancel." cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." ihifi760,ihifi960: "Double tap RETURN to cancel." ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." @@ -14934,7 +14934,7 @@ *: "Press LEFT to cancel." - android,hifietma*,zenvision: "Press BACK to cancel." + android,hifietma*: "Press BACK to cancel." cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." ihifi760,ihifi960: "Double tap RETURN to cancel." ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." @@ -14949,7 +14949,7 @@ *: "Press LEFT to cancel." - android,hifietma*,zenvision: "Press BACK to cancel." + android,hifietma*: "Press BACK to cancel." cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." ihifi760,ihifi960: "Double tap RETURN to cancel." ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." diff --git a/apps/lang/espanol.lang b/apps/lang/espanol.lang index 1eba90de21..d6d989d395 100644 --- a/apps/lang/espanol.lang +++ b/apps/lang/espanol.lang @@ -7392,15 +7392,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frecuencia de corte de bajos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frecuencia de corte de bajos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frecuencia de corte de bajos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frecuencia de corte de bajos" @@ -8934,15 +8934,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frec. de corte de agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frec. de corte de agudos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frecuencia de corte de agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frecuencia de corte de agudos" diff --git a/apps/lang/finnish.lang b/apps/lang/finnish.lang index 7a9b95cdbc..5476e09018 100644 --- a/apps/lang/finnish.lang +++ b/apps/lang/finnish.lang @@ -10127,15 +10127,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basson katkaisu" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basson katkaisu" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basson katkaisu" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basson katkaisu" @@ -10144,15 +10144,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantin katkaisu" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantin katkaisu" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantin katkaisu" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantin katkaisu" diff --git a/apps/lang/francais.lang b/apps/lang/francais.lang index bbb195f4e0..316c3eef6c 100644 --- a/apps/lang/francais.lang +++ b/apps/lang/francais.lang @@ -9201,15 +9201,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour basses" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour basses" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour les basses" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour les basses" @@ -9218,15 +9218,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour aigus" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour aigus" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour les aigus" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Fréquence de coupure pour les aigus" diff --git a/apps/lang/galego.lang b/apps/lang/galego.lang index e9dfaf00e3..c7b2a62db7 100644 --- a/apps/lang/galego.lang +++ b/apps/lang/galego.lang @@ -5985,15 +5985,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de baixos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de baixos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de baixos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de baixos" @@ -11323,15 +11323,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de agudos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de agudos" diff --git a/apps/lang/greek.lang b/apps/lang/greek.lang index f2dc518393..b9f07d4c33 100644 --- a/apps/lang/greek.lang +++ b/apps/lang/greek.lang @@ -10054,15 +10054,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή μπάσων" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή μπάσων" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή μπάσων" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή μπάσων" @@ -10071,15 +10071,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή πρίμων" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή πρίμων" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή πρίμων" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Αποκοπή πρίμων" diff --git a/apps/lang/hebrew.lang b/apps/lang/hebrew.lang index 16b4d91285..b49104adb0 100644 --- a/apps/lang/hebrew.lang +++ b/apps/lang/hebrew.lang @@ -10175,15 +10175,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך בס" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך בס" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך בס" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך בס" @@ -10192,15 +10192,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך טרבל" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך טרבל" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך טרבל" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "חיתוך טרבל" diff --git a/apps/lang/hrvatski.lang b/apps/lang/hrvatski.lang index 8e89965509..55b8d1beeb 100644 --- a/apps/lang/hrvatski.lang +++ b/apps/lang/hrvatski.lang @@ -10139,15 +10139,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje basa" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje basa" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje basa" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje basa" @@ -10156,15 +10156,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje treblea" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje treblea" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje treblea" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Odsijecanje treblea" diff --git a/apps/lang/italiano.lang b/apps/lang/italiano.lang index 22f37d489e..9d873e219f 100644 --- a/apps/lang/italiano.lang +++ b/apps/lang/italiano.lang @@ -9089,15 +9089,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Bassi" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Bassi" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Bassi" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Bassi" @@ -9106,15 +9106,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Alti" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Alti" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Alti" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Taglio Alti" diff --git a/apps/lang/japanese.lang b/apps/lang/japanese.lang index 26a8b767c2..dcabb9ab73 100644 --- a/apps/lang/japanese.lang +++ b/apps/lang/japanese.lang @@ -9176,15 +9176,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音域カットオフ" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音域カットオフ" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音域カットオフ" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "低音域カットオフ" @@ -9193,15 +9193,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音域カットオフ" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音域カットオフ" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音域カットオフ" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "高音域カットオフ" diff --git a/apps/lang/korean.lang b/apps/lang/korean.lang index 77ec04eafc..441d5545cd 100644 --- a/apps/lang/korean.lang +++ b/apps/lang/korean.lang @@ -9131,15 +9131,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "저음 컷오프" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "저음 컷오프" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "저음 컷오프" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "저음 컷오프" @@ -9148,15 +9148,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "고음 컷오프" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "고음 컷오프" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "고음 컷오프" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "고음 컷오프" diff --git a/apps/lang/latviesu.lang b/apps/lang/latviesu.lang index 67136695c2..8434a4a05f 100644 --- a/apps/lang/latviesu.lang +++ b/apps/lang/latviesu.lang @@ -9102,15 +9102,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basu robežfrekvence" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basu robežfrekvence" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basu robežfrekvence" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basu robežfrekvence" @@ -9119,15 +9119,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Augšu robežfrekvence" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Augšu robežfrekvence" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Augšu robežfrekvence" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Augšu robežfrekvence" @@ -16945,3 +16945,17 @@ general_purpose_led: "Izmantot LED indikatorus" + + id: LANG_ANNOUNCE_STATUS + desc: announnnce_status plugin + user: core + + *: "Announce Status" + + + *: "Paziņot statusu" + + + *: "Paziņot statusu" + + diff --git a/apps/lang/lietuviu.lang b/apps/lang/lietuviu.lang index 60a32afcfa..5423cb6ba7 100644 --- a/apps/lang/lietuviu.lang +++ b/apps/lang/lietuviu.lang @@ -10217,15 +10217,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bosų nukirpimas" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bosų nukirpimas" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bosų nukirpimas" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bosų nukirpimas" @@ -10234,15 +10234,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Aukštų daž. Nukirpimas" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Aukštų daž. Nukirpimas" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Aukštų daž. Nukirpimas" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Aukštų daž. Nukirpimas" diff --git a/apps/lang/magyar.lang b/apps/lang/magyar.lang index 0836f589eb..4eb911dabc 100644 --- a/apps/lang/magyar.lang +++ b/apps/lang/magyar.lang @@ -8922,15 +8922,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Alsó határfrekvencia" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Alsó határfrekvencia" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Alsó határfrekvencia" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Alsó határfrekvencia" @@ -9599,15 +9599,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Magas határfrekvencia" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Magas határfrekvencia" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Magas határfrekvencia" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Magas határfrekvencia" @@ -14784,7 +14784,7 @@ user: core *: "Press LEFT to cancel." - android,hifietma*,zenvision: "Press BACK to cancel." + android,hifietma*: "Press BACK to cancel." cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel." ihifi760,ihifi960: "Double tap RETURN to cancel." ihifi770,ihifi770c,ihifi800: "Press HOME to cancel." @@ -14799,7 +14799,7 @@ *: "Nyomja meg a LEFT gombot a megszakításhoz." - android,hifietma*,zenvision: "Nyomja meg a BACK gombot a megszakításhoz." + android,hifietma*: "Nyomja meg a BACK gombot a megszakításhoz." cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Nyomja meg a POWER gombot a megszakításhoz." ihifi760,ihifi960: "Duplán koppintson a RETURN-re megszakításhoz." ihifi770,ihifi770c,ihifi800: "Nyomja meg a HOME gombot a megszakításhoz." @@ -14814,7 +14814,7 @@ *: "Nyomja meg a LEFT gombot a megszakításhoz." - android,hifietma*,zenvision: "Nyomja meg a BACK gombot a megszakításhoz." + android,hifietma*: "Nyomja meg a BACK gombot a megszakításhoz." cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Nyomja meg a POWER gombot a megszakításhoz." ihifi760,ihifi960: "Duplán koppintson a RETURN-re megszakításhoz." ihifi770,ihifi770c,ihifi800: "Nyomja meg a HOME gombot a megszakításhoz." @@ -16948,3 +16948,17 @@ general_purpose_led: "LED jelzőfények használata" + + id: LANG_ANNOUNCE_STATUS + desc: announnnce_status plugin + user: core + + *: "Announce Status" + + + *: "Állapot bejelentése" + + + *: "Állapot bejelentése" + + diff --git a/apps/lang/moldoveneste.lang b/apps/lang/moldoveneste.lang index 142842c00a..d3b315e8d6 100644 --- a/apps/lang/moldoveneste.lang +++ b/apps/lang/moldoveneste.lang @@ -2232,15 +2232,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" @@ -8280,15 +8280,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" diff --git a/apps/lang/nederlands.lang b/apps/lang/nederlands.lang index 88f73c1fa4..d5ef15c06c 100644 --- a/apps/lang/nederlands.lang +++ b/apps/lang/nederlands.lang @@ -9078,15 +9078,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" @@ -9095,15 +9095,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" diff --git a/apps/lang/norsk-nynorsk.lang b/apps/lang/norsk-nynorsk.lang index c62796a27b..928805ace2 100644 --- a/apps/lang/norsk-nynorsk.lang +++ b/apps/lang/norsk-nynorsk.lang @@ -9877,15 +9877,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bassgrense" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bassgrense" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bassgrense" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bassgrense" @@ -10083,15 +10083,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrense" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrense" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrense" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgrense" diff --git a/apps/lang/norsk.lang b/apps/lang/norsk.lang index 8c498a9616..71f96172b7 100644 --- a/apps/lang/norsk.lang +++ b/apps/lang/norsk.lang @@ -8846,15 +8846,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass-knekkfrekvens" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass-knekkfrekvens" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass-knekkfrekvens" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass-knekkfrekvens" @@ -9901,15 +9901,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantknekkfrekvens" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantknekkfrekvens" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantknekkfrekvens" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantknekkfrekvens" diff --git a/apps/lang/polski.lang b/apps/lang/polski.lang index 7dc97aebc8..f65875e0d5 100644 --- a/apps/lang/polski.lang +++ b/apps/lang/polski.lang @@ -9095,15 +9095,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie basów" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie basów" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie basów" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie basów" @@ -9112,15 +9112,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie tonów niskich" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie tonów niskich" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie tonów niskich" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Ścięcie tonów niskich" diff --git a/apps/lang/portugues-brasileiro.lang b/apps/lang/portugues-brasileiro.lang index fd7509b6db..b16f331b76 100644 --- a/apps/lang/portugues-brasileiro.lang +++ b/apps/lang/portugues-brasileiro.lang @@ -9171,15 +9171,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" @@ -9188,15 +9188,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Agudos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Agudos" diff --git a/apps/lang/portugues.lang b/apps/lang/portugues.lang index 5853ff9397..8eb325986f 100644 --- a/apps/lang/portugues.lang +++ b/apps/lang/portugues.lang @@ -10140,15 +10140,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Graves" @@ -10515,15 +10515,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte de Agudos" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte dos Agudos" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Corte dos Agudos" diff --git a/apps/lang/romaneste.lang b/apps/lang/romaneste.lang index aa30868589..c83af7ad2f 100644 --- a/apps/lang/romaneste.lang +++ b/apps/lang/romaneste.lang @@ -2232,15 +2232,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Retezare basuri" @@ -8280,15 +8280,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tăiere inalte" diff --git a/apps/lang/russian.lang b/apps/lang/russian.lang index d282fd5c09..01df4bb766 100644 --- a/apps/lang/russian.lang +++ b/apps/lang/russian.lang @@ -6289,15 +6289,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отсечение баса" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отсечение баса" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отсечение баса" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Отсечение баса" @@ -8856,15 +8856,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Подавление высоких частот" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Подавление высоких частот" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Подавление высоких частот" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Подавление высоких частот" diff --git a/apps/lang/slovak.lang b/apps/lang/slovak.lang index 4e347617eb..6c4589903e 100644 --- a/apps/lang/slovak.lang +++ b/apps/lang/slovak.lang @@ -9087,15 +9087,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica hĺbok" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica hĺbok" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica hĺbok" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica hĺbok" @@ -9104,15 +9104,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica výšok" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica výšok" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica výšok" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Hranica výšok" diff --git a/apps/lang/slovenscina.lang b/apps/lang/slovenscina.lang index 9d763cec9b..1f88f15c2d 100644 --- a/apps/lang/slovenscina.lang +++ b/apps/lang/slovenscina.lang @@ -2988,15 +2988,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" @@ -10628,15 +10628,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" diff --git a/apps/lang/srpski.lang b/apps/lang/srpski.lang index e043cf8fb0..61e2015854 100644 --- a/apps/lang/srpski.lang +++ b/apps/lang/srpski.lang @@ -9213,15 +9213,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фрекв. за ниске" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фрекв. за ниске" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фреквенција за ниске" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фреквенција за ниске" @@ -9230,15 +9230,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фрекв. за високе" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фрекв. за високе" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фреквенција за високе" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Гранична фреквенција за високе" diff --git a/apps/lang/svenska.lang b/apps/lang/svenska.lang index 335b1e975e..671fecaf46 100644 --- a/apps/lang/svenska.lang +++ b/apps/lang/svenska.lang @@ -9110,15 +9110,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgräns" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgräns" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgräns" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Basgräns" @@ -9127,15 +9127,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgräns" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgräns" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgräns" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Diskantgräns" diff --git a/apps/lang/tagalog.lang b/apps/lang/tagalog.lang index b7e1dfab51..b259c86da6 100644 --- a/apps/lang/tagalog.lang +++ b/apps/lang/tagalog.lang @@ -6019,15 +6019,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass araw ng katapusan" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass araw ng katapusan" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass araw ng katapusan" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass araw ng katapusan" @@ -9590,15 +9590,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Pagtatluhin araw ng katapusan" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Pagtatluhin araw ng katapusan" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Pagtatluhin araw ng katapusan" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Pagtatluhin araw ng katapusan" diff --git a/apps/lang/thai.lang b/apps/lang/thai.lang index f2be4962e9..bcd4505eab 100644 --- a/apps/lang/thai.lang +++ b/apps/lang/thai.lang @@ -9918,15 +9918,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "ความถี่ตัดเสียงทุ้ม" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "ความถี่ตัดเสียงทุ้ม" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" @@ -10152,15 +10152,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "ความถี่ตัดเสียงแหลม" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "ความถี่ตัดเสียงแหลม" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" diff --git a/apps/lang/turkce.lang b/apps/lang/turkce.lang index 8840378509..f8cd2e1c96 100644 --- a/apps/lang/turkce.lang +++ b/apps/lang/turkce.lang @@ -5446,15 +5446,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiz Kesme" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiz Kesme" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiz Kesme" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Tiz Kesme" @@ -9553,15 +9553,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas Kesme" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas Kesme" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas Kesme" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas Kesme" diff --git a/apps/lang/ukrainian.lang b/apps/lang/ukrainian.lang index 7ef0df1edb..c5a7f1926b 100644 --- a/apps/lang/ukrainian.lang +++ b/apps/lang/ukrainian.lang @@ -9102,15 +9102,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Басу" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Басу" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Басу" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Басу" @@ -9119,15 +9119,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Високих Частот" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Високих Частот" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Високих Частот" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Вiдсiкання Високих Частот" diff --git a/apps/lang/vietnamese.lang b/apps/lang/vietnamese.lang index 11d20d84bb..1b9c6f948e 100644 --- a/apps/lang/vietnamese.lang +++ b/apps/lang/vietnamese.lang @@ -9140,15 +9140,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm trầm" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm trầm" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm trầm" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm trầm" @@ -9157,15 +9157,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm cao" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm cao" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm cao" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Khoảng cắt âm cao" diff --git a/apps/lang/vlaams.lang b/apps/lang/vlaams.lang index fac4ff2c4d..cf10d3441c 100644 --- a/apps/lang/vlaams.lang +++ b/apps/lang/vlaams.lang @@ -10103,15 +10103,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bas-afsnijfrequentie" @@ -10120,15 +10120,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble-afsnijfrequentie" diff --git a/apps/lang/walon.lang b/apps/lang/walon.lang index a53272a20c..b9d440ee63 100644 --- a/apps/lang/walon.lang +++ b/apps/lang/walon.lang @@ -10158,15 +10158,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Bass Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des basses" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des basses" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des basses" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des basses" @@ -10175,15 +10175,15 @@ user: core *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Treble Cutoff" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des hôts sons" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des hôts sons" *: none - gigabeatfx,ipod6g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des hôts sons" + gigabeatfx,ipod6g,ipodnano3g,ipodnano4g,ipodvideo,mpiohd200,mpiohd300,mrobe100: "Frécwince di côpaedje des hôts sons" diff --git a/apps/main.c b/apps/main.c index c25847430f..009f2e96ac 100644 --- a/apps/main.c +++ b/apps/main.c @@ -153,7 +153,10 @@ #endif #endif /* SDL */ -/*#define AUTOROCK*/ /* define this to check for "autostart.rock" on boot */ +// #define AUTOROCK /* define this to check for "autostart.rock" on boot */ +/* Alternatively, you can define autostart plugin path and its argument: */ +// #define AUTOROCK VIEWERS_DATA_DIR"/imageviewer.rock" +// #define AUTOROCK_ARG "/jpegs/sample.jpg" static void init(void); /* main(), and various functions called by main() and init() may be @@ -214,17 +217,25 @@ int main(void) #ifdef AUTOROCK { - char filename[MAX_PATH]; - const char *file = + const char *file = ""AUTOROCK; + file = *file + ? file + : #ifdef APPLICATION ROCKBOX_DIR #else PLUGIN_APPS_DIR #endif "/autostart.rock"; - if(file_exists(file)) /* no complaint if it doesn't exist */ + if (file_exists(file)) /* no complaint if it doesn't exist */ { - plugin_load(file, NULL); /* start if it does */ + plugin_load(file, +#ifdef AUTOROCK_ARG + AUTOROCK_ARG +#else + NULL +#endif + ); /* start if it does */ } } #endif /* #ifdef AUTOROCK */ diff --git a/apps/misc.c b/apps/misc.c index 39936f2b36..05f1fa6a93 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -904,7 +904,7 @@ static void update_norm_tab(void) norm_tab[0] = min; norm_tab_size = 1; - for (int i = 0; i < lim; ++i) + for (int i = 1; i < lim - 1; ++i) { int vol = from_normalized_volume(i, min, max, lim); int rem = vol % step; @@ -1944,49 +1944,40 @@ int core_load_bmp(const char * filename, struct bitmap *bm, const int bmformat, #define NVOL_FRACBITS 16 #define NVOL_UNITY (1L << NVOL_FRACBITS) -#define NVOL_FACTOR (600L << NVOL_FRACBITS) - -#define NVOL_MAX_LINEAR_DB_SCALE (240L << NVOL_FRACBITS) #define nvol_div(x,y) fp_div((x), (y), NVOL_FRACBITS) #define nvol_mul(x,y) fp_mul((x), (y), NVOL_FRACBITS) #define nvol_exp10(x) fp_exp10((x), NVOL_FRACBITS) #define nvol_log10(x) fp_log10((x), NVOL_FRACBITS) -static bool use_linear_dB_scale(long min_vol, long max_vol) +static long get_nvol_factor(void) { - /* - * Alsamixer uses a linear scale for small ranges. - * Commented out so perceptual volume works as advertised on all targets. - */ - /* - return max_vol - min_vol <= NVOL_MAX_LINEAR_DB_SCALE; - */ + long factor = 600L << NVOL_FRACBITS; + long numdecimals = sound_numdecimals(SOUND_VOLUME); - (void)min_vol; - (void)max_vol; - return false; + if (numdecimals == 0) + factor /= 10; + + /* nothing *actually* needs this, but: */ + while (numdecimals-- > 1) + factor *= 10; + + return factor; } long to_normalized_volume(long vol, long min_vol, long max_vol, long max_norm) { long norm, min_norm; + long factor = get_nvol_factor(); vol <<= NVOL_FRACBITS; min_vol <<= NVOL_FRACBITS; max_vol <<= NVOL_FRACBITS; max_norm <<= NVOL_FRACBITS; - if (use_linear_dB_scale(min_vol, max_vol)) - { - norm = nvol_div(vol - min_vol, max_vol - min_vol); - } - else - { - min_norm = nvol_exp10(nvol_div(min_vol - max_vol, NVOL_FACTOR)); - norm = nvol_exp10(nvol_div(vol - max_vol, NVOL_FACTOR)); - norm = nvol_div(norm - min_norm, NVOL_UNITY - min_norm); - } + min_norm = nvol_exp10(nvol_div(min_vol - max_vol, factor)); + norm = nvol_exp10(nvol_div(vol - max_vol, factor)); + norm = nvol_div(norm - min_norm, NVOL_UNITY - min_norm); return nvol_mul(norm, max_norm) >> NVOL_FRACBITS; } @@ -1994,6 +1985,7 @@ long to_normalized_volume(long vol, long min_vol, long max_vol, long max_norm) long from_normalized_volume(long norm, long min_vol, long max_vol, long max_norm) { long vol, min_norm; + long factor = get_nvol_factor(); norm <<= NVOL_FRACBITS; min_vol <<= NVOL_FRACBITS; @@ -2002,16 +1994,9 @@ long from_normalized_volume(long norm, long min_vol, long max_vol, long max_norm vol = nvol_div(norm, max_norm); - if (use_linear_dB_scale(min_vol, max_vol)) - { - vol = nvol_mul(vol, max_vol - min_vol) + min_vol; - } - else - { - min_norm = nvol_exp10(nvol_div(min_vol - max_vol, NVOL_FACTOR)); - vol = nvol_mul(vol, NVOL_UNITY - min_norm) + min_norm; - vol = nvol_mul(nvol_log10(vol), NVOL_FACTOR) + max_vol; - } + min_norm = nvol_exp10(nvol_div(min_vol - max_vol, factor)); + vol = nvol_mul(vol, NVOL_UNITY - min_norm) + min_norm; + vol = nvol_mul(nvol_log10(vol), factor) + max_vol; return vol >> NVOL_FRACBITS; } diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index b32cb4c429..6bd39d4dc0 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -799,8 +799,10 @@ static void pcmbuf_pcm_callback(const void **start, size_t *size) if (desc) { + bool track_change = index == chunk_transidx; + /* If last chunk in the track, notify of track change */ - if (index == chunk_transidx) + if (track_change) { chunk_transidx = INVALID_BUF_INDEX; audio_pcmbuf_track_change(true); @@ -808,6 +810,13 @@ static void pcmbuf_pcm_callback(const void **start, size_t *size) /* Free it for reuse */ chunk_ridx = index = index_next(index); + + if (track_change && !audio_pcmbuf_may_play()) + { + current_desc = NULL; + *size = 0; + return; + } } /*- Process the new one -*/ diff --git a/apps/playback.c b/apps/playback.c index 22c19c4755..0e8871c96c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -325,6 +325,7 @@ static unsigned int track_event_flags = TEF_NONE; /* (A, O-) */ static int skip_offset = 0; /* (A, O) */ static bool track_skip_is_manual = false; +static bool pause_on_track_change = false; /* Track change notification */ static struct @@ -1502,7 +1503,7 @@ static bool halt_decoding_track(bool stop) codec_skip_pending = false; codec_seeking = false; - + pause_on_track_change = false; return retval; } @@ -2734,10 +2735,14 @@ static void audio_finalise_track_change(void) buf_read_cuesheet(info.cuesheet_hid); track_id3 = bufgetid3(info.id3_hid); - if (single_mode_do_pause(info.id3_hid)) + /* When pause_on_track_change is calculated, next track_info may be missing + * (due to a low buffer or an automatic directory change), + * so we need to recalculate it. */ + if (pause_on_track_change || single_mode_do_pause(info.id3_hid)) { play_status = PLAY_PAUSED; pcmbuf_pause(true); + pause_on_track_change = false; } } /* Sync the next track information */ @@ -2815,11 +2820,16 @@ static void audio_monitor_end_of_playlist(void) } /* Does this track have an entry allocated? */ -static bool audio_can_change_track(int *trackstat, int *id3_hid) +static bool audio_can_change_track(int *trackstat, enum pcm_track_change_type *type) { struct track_info info; bool have_track = track_list_advance_current(1, &info); - *id3_hid = info.id3_hid; + + pause_on_track_change = have_track && single_mode_do_pause(info.id3_hid); + *type = pause_on_track_change + ? TRACK_CHANGE_END_OF_DATA + : TRACK_CHANGE_AUTO; + if (!have_track || info.audio_hid < 0) { bool end_of_playlist = false; @@ -2828,8 +2838,8 @@ static bool audio_can_change_track(int *trackstat, int *id3_hid) { if (filling == STATE_STOPPED) { - audio_begin_track_change(TRACK_CHANGE_END_OF_DATA, *trackstat); - return false; + *type = TRACK_CHANGE_END_OF_DATA; + return true; } /* Track load is not complete - it might have stopped on a @@ -2931,13 +2941,10 @@ static void audio_on_codec_complete(int status) track_event_flags = TEF_AUTO_SKIP; skip_pending = TRACK_SKIP_AUTO; - int id3_hid = 0; - if (audio_can_change_track(&trackstat, &id3_hid)) + enum pcm_track_change_type type; + if (audio_can_change_track(&trackstat, &type)) { - audio_begin_track_change( - single_mode_do_pause(id3_hid) - ? TRACK_CHANGE_END_OF_DATA - : TRACK_CHANGE_AUTO, trackstat); + audio_begin_track_change(type, trackstat); } } @@ -3850,7 +3857,7 @@ void audio_pcmbuf_track_change(bool pcmbuf) /* May pcmbuf start PCM playback when the buffer is full enough? */ bool audio_pcmbuf_may_play(void) { - return play_status == PLAY_PLAYING && !ff_rw_mode; + return play_status == PLAY_PLAYING && !ff_rw_mode && !pause_on_track_change; } diff --git a/apps/plugin.c b/apps/plugin.c index 5b2bae91b4..fd886ea93f 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -758,9 +758,6 @@ static const struct plugin_api rockbox_api = { audio_current_track, audio_flush_and_reload_tracks, audio_get_file_pos, -#ifdef PLUGIN_USE_IRAM - audio_hard_stop, -#endif add_playbacklog, /* menu */ diff --git a/apps/plugin.h b/apps/plugin.h index 20190846c5..bc700cbbc1 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -178,7 +178,7 @@ int plugin_open(const char *plugin, const char *parameter); * when this happens please take the opportunity to sort in * any new functions "waiting" at the end of the list. */ -#define PLUGIN_API_VERSION 277 +#define PLUGIN_API_VERSION 278 /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ @@ -889,9 +889,6 @@ struct plugin_api { struct mp3entry* (*audio_current_track)(void); void (*audio_flush_and_reload_tracks)(void); int (*audio_get_file_pos)(void); -#ifdef PLUGIN_USE_IRAM - void (*audio_hard_stop)(void); -#endif void (*add_playbacklog)(struct mp3entry *id3); /* menu */ diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index fc67b306b0..6245340fb3 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -150,12 +150,6 @@ struct battery_tables_t { #define BATTERY_OFF BUTTON_POWER #define BATTERY_OFF_TXT "POWER" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_ON_TXT "PLAY - start" -#define BATTERY_OFF BUTTON_BACK -#define BATTERY_OFF_TXT "BACK" - #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD #define BATTERY_ON BUTTON_MENU diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index b39aa4b2f4..10272f90e4 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c @@ -237,22 +237,6 @@ enum { #define BJACK_QUIT BUTTON_POWER #define BJACK_DOUBLEDOWN BUTTON_MINUS -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define BJACK_SELECT_NAME "SELECT" -#define BJACK_STAY_NAME "PLAY" -#define BJACK_QUIT_NAME "POWER" -#define BJACK_DOUBLE_NAME "CUSTOM" -#define BJACK_SELECT BUTTON_SELECT -#define BJACK_QUIT BUTTON_POWER -#define BJACK_STAY BUTTON_PLAY -#define BJACK_MAX (BUTTON_CUSTOM|BUTTON_UP) -#define BJACK_MIN (BUTTON_CUSTOM|BUTTON_DOWN) -#define BJACK_DOUBLEDOWN BUTTON_CUSTOM -#define BJACK_UP BUTTON_UP -#define BJACK_DOWN BUTTON_DOWN -#define BJACK_RIGHT BUTTON_RIGHT -#define BJACK_LEFT BUTTON_LEFT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define BJACK_SELECT_NAME "PLAY" #define BJACK_STAY_NAME "MENU" diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 121a96cdda..bb34219895 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -169,14 +169,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define DOWN BUTTON_RC_VOL_DOWN #define RC_QUIT BUTTON_REC -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define QUIT BUTTON_BACK -#define LEFT BUTTON_LEFT -#define RIGHT BUTTON_RIGHT -#define SELECT BUTTON_SELECT -#define UP BUTTON_UP -#define DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_BACK @@ -1504,8 +1496,7 @@ static int brickmania_help(void) "Releases", "the", "ball/Fire!", "", /* 30 */ #if CONFIG_KEYPAD == IAUDIO_M3_PAD "REC:", -#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \ - (CONFIG_KEYPAD == CREATIVEZVM_PAD) +#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) "BACK:", #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ (CONFIG_KEYPAD == IPOD_3G_PAD) || \ diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index f4790a00cd..5e69e1f12a 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -269,17 +269,6 @@ F3: equal to "=" #define CALCULATOR_QUIT BUTTON_POWER #define CALCULATOR_CLEAR BUTTON_MENU -#elif (CONFIG_KEYPAD == CREATIVEZVM_PAD) - -#define CALCULATOR_LEFT BUTTON_LEFT -#define CALCULATOR_RIGHT BUTTON_RIGHT -#define CALCULATOR_UP BUTTON_UP -#define CALCULATOR_DOWN BUTTON_DOWN -#define CALCULATOR_QUIT BUTTON_BACK -#define CALCULATOR_INPUT BUTTON_SELECT -#define CALCULATOR_CALC BUTTON_MENU -#define CALCULATOR_CLEAR BUTTON_PLAY - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CALCULATOR_LEFT (BUTTON_BACK|BUTTON_REL) diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index deb23f05e7..d1213367ae 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -149,16 +149,6 @@ #define CALENDAR_PREV_MONTH BUTTON_BOTTOMLEFT #define CALENDAR_EVENT_MENU_NAME "menu" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define CALENDAR_QUIT BUTTON_BACK -#define CALENDAR_SELECT BUTTON_SELECT -#define CALENDAR_NEXT_WEEK BUTTON_DOWN -#define CALENDAR_PREV_WEEK BUTTON_UP -#define CALENDAR_NEXT_DAY BUTTON_RIGHT -#define CALENDAR_PREV_DAY BUTTON_LEFT -#define CALENDAR_NEXT_MONTH BUTTON_CUSTOM -#define CALENDAR_PREV_MONTH BUTTON_PLAY - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CALENDAR_QUIT BUTTON_POWER #define CALENDAR_SELECT BUTTON_PLAY diff --git a/apps/plugins/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make index 87f0a6ecc0..77a038febc 100644 --- a/apps/plugins/chessbox/chessbox.make +++ b/apps/plugins/chessbox/chessbox.make @@ -39,7 +39,7 @@ $(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(CHESSBOX_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) # special pattern rule for compiling chessbox with extra flags $(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(CHESSBOX_SRCDIR)/chessbox.make diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h index 342f2f2cce..681f89150c 100644 --- a/apps/plugins/chessbox/chessbox_pgn.h +++ b/apps/plugins/chessbox/chessbox_pgn.h @@ -222,20 +222,6 @@ #define CB_RESTART BUTTON_MINUS #define CB_MENU (BUTTON_MENU|BUTTON_REL) -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define CB_SELECT BUTTON_PLAY -#define CB_UP BUTTON_UP -#define CB_DOWN BUTTON_DOWN -#define CB_LEFT BUTTON_LEFT -#define CB_RIGHT BUTTON_RIGHT -#define CB_PLAY BUTTON_SELECT -#define CB_LEVEL BUTTON_CUSTOM -#define CB_MENU BUTTON_MENU -#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT) -#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT) -#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT) -#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT) - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CB_SELECT (BUTTON_PLAY|BUTTON_REL) #define CB_UP BUTTON_UP diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index 7b01ece12f..521ae034b7 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -147,16 +147,6 @@ #define CHC_SETTINGS_DEC BUTTON_MINUS #define CHC_SETTINGS_CANCEL BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define CHC_QUIT BUTTON_BACK -#define CHC_STARTSTOP BUTTON_PLAY -#define CHC_RESET BUTTON_CUSTOM -#define CHC_MENU BUTTON_MENU -#define CHC_SETTINGS_INC BUTTON_UP -#define CHC_SETTINGS_DEC BUTTON_DOWN -#define CHC_SETTINGS_OK BUTTON_SELECT -#define CHC_SETTINGS_CANCEL BUTTON_BACK - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CHC_QUIT BUTTON_POWER #define CHC_STARTSTOP BUTTON_PLAY diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index acb23b38c3..fa6acea82a 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c @@ -1048,16 +1048,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD #elif (CONFIG_KEYPAD == COWON_D2_PAD) #define CHIP8_OFF BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define CHIP8_OFF BUTTON_BACK -#define CHIP8_KEY1 BUTTON_MENU -#define CHIP8_KEY2 BUTTON_UP -#define CHIP8_KEY3 BUTTON_CUSTOM -#define CHIP8_KEY4 BUTTON_LEFT -#define CHIP8_KEY5 BUTTON_PLAY -#define CHIP8_KEY6 BUTTON_RIGHT -#define CHIP8_KEY8 BUTTON_DOWN - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CHIP8_OFF BUTTON_POWER #define CHIP8_KEY1 BUTTON_VOL_UP diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 864d087076..74d1fc9237 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -108,12 +108,6 @@ Still To do: #define QUIT BUTTON_POWER #define ACTION2 BUTTON_PLUS -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define QUIT BUTTON_BACK -#define ACTION BUTTON_UP -#define ACTION2 BUTTON_MENU -#define ACTIONTEXT "UP" - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define QUIT BUTTON_POWER #define ACTION BUTTON_UP diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index 321e7129bd..210864968b 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c @@ -114,14 +114,6 @@ #define CLIX_BUTTON_UP BUTTON_UP #define CLIX_BUTTON_DOWN BUTTON_DOWN -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define CLIX_BUTTON_QUIT BUTTON_BACK -#define CLIX_BUTTON_LEFT BUTTON_LEFT -#define CLIX_BUTTON_RIGHT BUTTON_RIGHT -#define CLIX_BUTTON_CLICK BUTTON_SELECT -#define CLIX_BUTTON_UP BUTTON_UP -#define CLIX_BUTTON_DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CLIX_BUTTON_QUIT BUTTON_POWER #define CLIX_BUTTON_LEFT BUTTON_BACK diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 929630a09f..d3c95be10f 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -163,16 +163,6 @@ #elif CONFIG_KEYPAD == COWON_D2_PAD #define CUBE_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define CUBE_QUIT BUTTON_BACK -#define CUBE_NEXT BUTTON_RIGHT -#define CUBE_PREV BUTTON_LEFT -#define CUBE_INC BUTTON_UP -#define CUBE_DEC BUTTON_DOWN -#define CUBE_MODE BUTTON_MENU -#define CUBE_PAUSE BUTTON_PLAY -#define CUBE_HIGHSPEED BUTTON_SELECT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define CUBE_QUIT BUTTON_POWER #define CUBE_NEXT BUTTON_UP diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 31a646f988..cdae2a2b5c 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -316,18 +316,6 @@ void I_ShutdownGraphics(void) #define DOOMBUTTON_ENTER BUTTON_MENU #define DOOMBUTTON_WEAPON BUTTON_DISPLAY -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define DOOMBUTTON_UP BUTTON_UP -#define DOOMBUTTON_DOWN BUTTON_DOWN -#define DOOMBUTTON_LEFT BUTTON_LEFT -#define DOOMBUTTON_RIGHT BUTTON_RIGHT -#define DOOMBUTTON_SHOOT BUTTON_SELECT -#define DOOMBUTTON_OPEN BUTTON_PLAY -#define DOOMBUTTON_ESC BUTTON_BACK -#define DOOMBUTTON_ENTER BUTTON_PLAY -#define DOOMBUTTON_WEAPON BUTTON_MENU -#define DOOMBUTTON_MAP BUTTON_CUSTOM - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define DOOMBUTTON_UP BUTTON_UP #define DOOMBUTTON_DOWN BUTTON_DOWN diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index deb5a115bc..fb719ab9aa 100644 --- a/apps/plugins/fft/fft.c +++ b/apps/plugins/fft/fft.c @@ -799,7 +799,7 @@ static inline bool fft_get_fft(void) #if NUM_CORES > 1 /* use a worker thread if there is another processor core */ -static volatile bool fft_thread_run SHAREDDATA_ATTR = false; +static volatile bool fft_thread_run SHAREDBSS_ATTR; static unsigned long fft_thread = 0; static long fft_thread_stack[CACHEALIGN_UP(DEFAULT_STACK_SIZE*4/sizeof(long))] diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 79518bfa80..3080f2f239 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -226,18 +226,6 @@ #define FLIPIT_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define FLIPIT_LEFT BUTTON_LEFT -#define FLIPIT_RIGHT BUTTON_RIGHT -#define FLIPIT_UP BUTTON_UP -#define FLIPIT_DOWN BUTTON_DOWN -#define FLIPIT_QUIT BUTTON_BACK -#define FLIPIT_SHUFFLE BUTTON_CUSTOM -#define FLIPIT_SOLVE BUTTON_PLAY -#define FLIPIT_STEP_BY_STEP BUTTON_MENU -#define FLIPIT_TOGGLE BUTTON_SELECT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define FLIPIT_LEFT BUTTON_BACK #define FLIPIT_RIGHT BUTTON_MENU diff --git a/apps/plugins/fractals/fractal.h b/apps/plugins/fractals/fractal.h index f3da8bc781..d56b7a1f39 100644 --- a/apps/plugins/fractals/fractal.h +++ b/apps/plugins/fractals/fractal.h @@ -200,18 +200,6 @@ #elif CONFIG_KEYPAD == COWON_D2_PAD #define FRACTAL_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define FRACTAL_QUIT BUTTON_BACK -#define FRACTAL_UP BUTTON_UP -#define FRACTAL_DOWN BUTTON_DOWN -#define FRACTAL_LEFT BUTTON_LEFT -#define FRACTAL_RIGHT BUTTON_RIGHT -#define FRACTAL_ZOOM_IN BUTTON_PLAY -#define FRACTAL_ZOOM_OUT BUTTON_MENU -#define FRACTAL_PRECISION_INC (BUTTON_UP | BUTTON_CUSTOM) -#define FRACTAL_PRECISION_DEC (BUTTON_DOWN | BUTTON_CUSTOM) -#define FRACTAL_RESET BUTTON_SELECT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define FRACTAL_QUIT BUTTON_POWER #define FRACTAL_UP BUTTON_UP diff --git a/apps/plugins/goban/goban.h b/apps/plugins/goban/goban.h index 83c8a81221..159f3d2fbd 100644 --- a/apps/plugins/goban/goban.h +++ b/apps/plugins/goban/goban.h @@ -150,20 +150,6 @@ #define GBN_BUTTON_CONTEXT BUTTON_SELECT | BUTTON_REPEAT #define GBN_BUTTON_NEXT_VAR BUTTON_NEXT - -#elif (CONFIG_KEYPAD == CREATIVEZVM_PAD) \ - || (CONFIG_KEYPAD == CREATIVEZV_PAD) -#define GBN_BUTTON_UP BUTTON_UP -#define GBN_BUTTON_DOWN BUTTON_DOWN -#define GBN_BUTTON_LEFT BUTTON_LEFT -#define GBN_BUTTON_RIGHT BUTTON_RIGHT -#define GBN_BUTTON_RETREAT BUTTON_BACK -#define GBN_BUTTON_ADVANCE BUTTON_CUSTOM -#define GBN_BUTTON_MENU BUTTON_MENU -#define GBN_BUTTON_PLAY BUTTON_SELECT | BUTTON_REL -#define GBN_BUTTON_CONTEXT BUTTON_SELECT | BUTTON_REPEAT -#define GBN_BUTTON_NEXT_VAR BUTTON_PLAY - #elif (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) #define GBN_BUTTON_UP BUTTON_UP | BUTTON_REL #define GBN_BUTTON_DOWN BUTTON_DOWN diff --git a/apps/plugins/goban/goban.make b/apps/plugins/goban/goban.make index 2201dc60f4..ae221e8840 100644 --- a/apps/plugins/goban/goban.make +++ b/apps/plugins/goban/goban.make @@ -36,4 +36,4 @@ $(GOBAN_BUILDDIR)/goban.ovl: $(GOBAN_OBJ) $(GOBAN_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(GOBAN_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) diff --git a/apps/plugins/imageviewer/imageviewer.make b/apps/plugins/imageviewer/imageviewer.make index 23f9813357..25701fc6d2 100644 --- a/apps/plugins/imageviewer/imageviewer.make +++ b/apps/plugins/imageviewer/imageviewer.make @@ -40,7 +40,7 @@ $(IMGVBUILDDIR)/%.ovl: $(IMGDEC_OUTLDS) $(filter-out $(PLUGIN_CRT0),$(filter %.o, $^)) \ $(filter %.a, $+) \ -lgcc $(IMGDEC_OVLFLAGS) - $(SILENT)$(call objcopy,$(IMGVBUILDDIR)/$*.elf,$@) + $(SILENT)$(call objcopy_plugin,$(IMGVBUILDDIR)/$*.elf,$@) # rule to create reference map for image decoder $(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGIN_LIBS) diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h index aea8904280..46e99ff3f8 100644 --- a/apps/plugins/imageviewer/imageviewer_button.h +++ b/apps/plugins/imageviewer/imageviewer_button.h @@ -209,18 +209,6 @@ #elif CONFIG_KEYPAD == COWON_D2_PAD -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define IMGVIEW_ZOOM_IN BUTTON_PLAY -#define IMGVIEW_ZOOM_OUT BUTTON_CUSTOM -#define IMGVIEW_UP BUTTON_UP -#define IMGVIEW_DOWN BUTTON_DOWN -#define IMGVIEW_LEFT BUTTON_LEFT -#define IMGVIEW_RIGHT BUTTON_RIGHT -#define IMGVIEW_NEXT BUTTON_SELECT -#define IMGVIEW_PREVIOUS BUTTON_BACK -#define IMGVIEW_MENU BUTTON_MENU - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define IMGVIEW_ZOOM_IN (BUTTON_VOL_UP|BUTTON_REL) #define IMGVIEW_ZOOM_OUT (BUTTON_VOL_DOWN|BUTTON_REL) diff --git a/apps/plugins/imageviewer/jpegp/FILEGETC.c b/apps/plugins/imageviewer/jpegp/FILEGETC.c index 5b03deb25c..2370923e02 100644 --- a/apps/plugins/imageviewer/jpegp/FILEGETC.c +++ b/apps/plugins/imageviewer/jpegp/FILEGETC.c @@ -5,7 +5,7 @@ static int fd; extern int GETC(void) { unsigned char x = 0; - rb->read(fd, &x, 1) + rb->read(fd, &x, 1); return x; } diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 0a4eae97f3..d8b792aedc 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -155,13 +155,6 @@ #define RIGHT BUTTON_PLUS #define FIRE BUTTON_MENU -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define QUIT BUTTON_BACK -#define LEFT BUTTON_LEFT -#define RIGHT BUTTON_RIGHT -#define FIRE BUTTON_SELECT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define QUIT BUTTON_POWER diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index e9c137b12f..e681c578ad 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -191,16 +191,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define JEWELS_CANCEL BUTTON_POWER #define HK_CANCEL "POWER" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define JEWELS_UP BUTTON_UP -#define JEWELS_DOWN BUTTON_DOWN -#define JEWELS_LEFT BUTTON_LEFT -#define JEWELS_RIGHT BUTTON_RIGHT -#define JEWELS_SELECT BUTTON_SELECT -#define JEWELS_CANCEL BUTTON_BACK -#define HK_SELECT "MIDDLE" -#define HK_CANCEL "BACK" - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define JEWELS_UP BUTTON_UP #define JEWELS_DOWN BUTTON_DOWN diff --git a/apps/plugins/lib/keymaps.h b/apps/plugins/lib/keymaps.h index a8521af23e..f5194ee053 100644 --- a/apps/plugins/lib/keymaps.h +++ b/apps/plugins/lib/keymaps.h @@ -56,7 +56,6 @@ (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || \ (CONFIG_KEYPAD == CREATIVE_ZEN_PAD) || \ (CONFIG_KEYPAD == SONY_NWZ_PAD) || \ - (CONFIG_KEYPAD == CREATIVEZVM_PAD) || \ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) || \ (CONFIG_KEYPAD == HM801_PAD) || \ @@ -128,10 +127,6 @@ #define BTN_FIRE BUTTON_SELECT #define BTN_PAUSE BUTTON_BACK -#elif (CONFIG_KEYPAD == CREATIVEZVM_PAD) -#define BTN_FIRE BUTTON_PLAY -#define BTN_PAUSE BUTTON_MENU - #elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD) #define BTN_FIRE BUTTON_USER #define BTN_PAUSE BUTTON_MENU diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c index 4b759b2437..171522acae 100644 --- a/apps/plugins/lib/pluginlib_actions.c +++ b/apps/plugins/lib/pluginlib_actions.c @@ -96,7 +96,6 @@ const struct button_mapping pla_main_ctx[] = || (CONFIG_KEYPAD == MROBE100_PAD) \ || (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) \ || (CONFIG_KEYPAD == SANSA_CLIP_PAD) \ - || (CONFIG_KEYPAD == CREATIVEZVM_PAD) \ || (CONFIG_KEYPAD == SANSA_M200_PAD)\ || (CONFIG_KEYPAD == SANSA_E200_PAD) \ || (CONFIG_KEYPAD == SANSA_FUZE_PAD) \ @@ -405,12 +404,6 @@ const struct button_mapping pla_main_ctx[] = {PLA_SELECT, BUTTON_PLAY, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY}, {PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE}, -#elif (CONFIG_KEYPAD == CREATIVEZVM_PAD) - {PLA_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK}, - {PLA_EXIT, BUTTON_BACK|BUTTON_REPEAT, BUTTON_NONE}, - {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE}, - {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT}, - {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, #elif (CONFIG_KEYPAD == ONDAVX747_PAD) {PLA_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER}, {PLA_EXIT, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE}, diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index 9102f03264..c357ff1b57 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c @@ -74,6 +74,7 @@ struct preferences { bool wrap; bool wipe; bool active_one_line; + bool autoscroll; int align; /* 0: left, 1: center, 2: right */ bool statusbar_on; bool display_title; @@ -99,6 +100,7 @@ static const char *extentions[NUM_TYPES] = { static struct lrc_info { struct mp3entry *id3; long elapsed; + long scroll; long length; long ff_rewind; int audio_status; @@ -1643,21 +1645,25 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i) struct screen *display = rb->screens[i]; struct lrc_word *lrc_word; struct lrc_brpos *lrc_brpos; - long time_start, time_end, elapsed; + long time_start, time_end, time_elapsed, elapsed; int count, width, nword; int xpos; const char *str; bool active_line; + if (!prefs.autoscroll) + time_elapsed = current.scroll; + else + time_elapsed = current.elapsed; time_start = get_time_start(lrc_line); time_end = get_time_start(lrc_line->next); - active_line = (time_start <= current.elapsed - && time_end > current.elapsed); + active_line = (time_start <= time_elapsed + && time_end > time_elapsed); if (!lrc_line->width) { /* empty line. draw bar during interval. */ - long rin = current.elapsed - time_start; + long rin = time_elapsed - time_start; long len = time_end - time_start; if (current.wipe && active_line && len >= 3500) { @@ -1697,12 +1703,12 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i) else time_end = get_time_start(lrc_line->next); - if (time_start > current.elapsed || !active_line) + if (time_start > time_elapsed || !active_line) { /* inactive */ elapsed = 0; } - else if (!current.wipe || time_end <= current.elapsed) + else if (!current.wipe || time_end <= time_elapsed) { /* active whole word */ elapsed = lrc_word->width; @@ -1710,7 +1716,7 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i) else { /* wipe word */ - long rin = current.elapsed - time_start; + long rin = time_elapsed - time_start; long len = time_end - time_start; elapsed = rin * lrc_word->width / len; } @@ -1727,27 +1733,30 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i) c = word_count; w = word_width; } - if (elapsed <= 0) + if (prefs.autoscroll) { - set_to_inactive(display); - } - else if (elapsed < w) - { - /* wipe text */ - display->fillrect(xpos, ypos, elapsed, font_ui_height); - set_to_inactive(display); - display->fillrect(xpos+elapsed, ypos, - w-elapsed, font_ui_height); + if (elapsed <= 0) + { + set_to_inactive(display); + } + else if (elapsed < w) + { + /* wipe text */ + display->fillrect(xpos, ypos, elapsed, font_ui_height); + set_to_inactive(display); + display->fillrect(xpos+elapsed, ypos, + w-elapsed, font_ui_height); #if (LCD_DEPTH > 1) #ifdef HAVE_REMOTE_LCD - if (display->screen_type == SCREEN_REMOTE) - display->set_drawmode(DRMODE_INVERSEVID); - else + if (display->screen_type == SCREEN_REMOTE) + display->set_drawmode(DRMODE_INVERSEVID); + else #endif - display->set_drawmode(DRMODE_BG); + display->set_drawmode(DRMODE_BG); #else - display->set_drawmode(DRMODE_INVERSEVID); + display->set_drawmode(DRMODE_INVERSEVID); #endif + } } rb->strlcpy(temp_buf, str, c+1); display->putsxy(xpos, ypos, temp_buf); @@ -1777,13 +1786,18 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i) static void display_lrcs(void) { - long time_start, time_end, rin, len; + long time_start, time_end, time_elapsed, rin, len; int nline[NB_SCREENS] = {0}; struct lrc_line *lrc_center = current.ll_head; if (!lrc_center) return; - while (get_time_start(lrc_center->next) <= current.elapsed) + if (!prefs.autoscroll) + time_elapsed = current.scroll; + else + time_elapsed = current.elapsed; + + while (get_time_start(lrc_center->next) <= time_elapsed) { nline[SCREEN_MAIN] += lrc_center->nline[SCREEN_MAIN]; #ifdef HAVE_REMOTE_LCD @@ -1794,7 +1808,7 @@ static void display_lrcs(void) time_start = get_time_start(lrc_center); time_end = get_time_start(lrc_center->next); - rin = current.elapsed - time_start; + rin = time_elapsed - time_start; len = time_end - time_start; struct screen *display; @@ -1810,9 +1824,9 @@ static void display_lrcs(void) y = (nblines-1)/2; if (rin < 0) { - /* current.elapsed < time of first lrc */ + /* time_elapsed < time of first lrc */ if (!current.wipe) - ypos = (time_start - current.elapsed) + ypos = (time_start - time_elapsed) * font_ui_height / time_start; else y++; @@ -1849,7 +1863,7 @@ static void display_lrcs(void) ypos = display_lrc_line(lrc_line, ypos, i); lrc_line = lrc_line->next; } - if (!lrc_line && ypos < vp_lyrics[i].height) + if (!lrc_line && ypos < vp_lyrics[i].height && prefs.autoscroll) display->putsxy(0, ypos, "[end]"); display->update_viewport(); @@ -2150,6 +2164,7 @@ static void load_or_save_settings(bool save) { TYPE_BOOL, 0, 1, { .bool_p = &prefs.wipe }, "wipe", NULL }, { TYPE_BOOL, 0, 1, { .bool_p = &prefs.active_one_line }, "active one line", NULL }, + { TYPE_BOOL, 0, 1, { .bool_p = &prefs.autoscroll }, "autoscroll", NULL }, { TYPE_INT, 0, 2, { .int_p = &prefs.align }, "align", NULL }, { TYPE_BOOL, 0, 1, { .bool_p = &prefs.statusbar_on }, "statusbar on", NULL }, @@ -2179,6 +2194,7 @@ static void load_or_save_settings(bool save) prefs.wrap = true; prefs.wipe = true; prefs.active_one_line = false; + prefs.autoscroll = true; prefs.align = 1; /* center */ prefs.statusbar_on = false; prefs.display_title = true; @@ -2264,6 +2280,7 @@ static bool lrc_display_menu(void) LRC_MENU_WIPE, LRC_MENU_ALIGN, LRC_MENU_LINE_MODE, + LRC_MENU_SCROLL_MODE, }; int selected = 0; @@ -2271,7 +2288,8 @@ static bool lrc_display_menu(void) MENUITEM_STRINGLIST(menu, "Display Settings", NULL, "Wrap", "Wipe", "Alignment", - "Activate Only Current Line"); + "Activate Only Current Line", + "Automatic Scrolling"); struct opt_items align_names[] = { {"Left", -1}, {"Centre", -1}, {"Right", -1}, @@ -2295,6 +2313,9 @@ static bool lrc_display_menu(void) usb = rb->set_bool("Activate Only Current Line", &prefs.active_one_line); break; + case LRC_MENU_SCROLL_MODE: + usb = rb->set_bool("Automatic Scrolling", &prefs.autoscroll); + break; case MENU_ATTACHED_USB: usb = true; break; @@ -2619,10 +2640,28 @@ static int handle_button(void) } break; case ACTION_WPS_VOLDOWN: - rb->adjust_volume(-1); + if (!prefs.autoscroll) + { + current.scroll -= 3000; + if (current.scroll < 0) + current.scroll = 0; + } + else + { + rb->adjust_volume(-1); + } break; case ACTION_WPS_VOLUP: - rb->adjust_volume(1); + if (!prefs.autoscroll) + { + current.scroll += 3000; + if (current.scroll > current.length) + current.scroll = current.length; + } + else + { + rb->adjust_volume(1); + } break; case ACTION_WPS_CONTEXT: ret = LRC_GOTO_EDITOR; @@ -2705,6 +2744,7 @@ static int lrc_main(void) { current.elapsed = 0; current.length = 1; + current.scroll = 0; } if (current.id3 && id3_timeout && @@ -2782,6 +2822,7 @@ enum plugin_status plugin_start(const void* parameter) current.lrc_file[0] = 0; current.ff_rewind = -1; current.found_lrc = false; + current.scroll = 0; if (parameter && check_audio_status()) { const char *ext; @@ -2790,7 +2831,7 @@ enum plugin_status plugin_start(const void* parameter) rb->strcpy(current.lrc_file, parameter); if (!rb->file_exists(current.lrc_file)) { - rb->splash(HZ, "Specified file dose not exist."); + rb->splash(HZ, "Specified file does not exist."); return PLUGIN_ERROR; } ext = rb->strrchr(current.lrc_file, '.'); diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make index a5d1813a8b..ec8a7e8b38 100644 --- a/apps/plugins/lua/lua.make +++ b/apps/plugins/lua/lua.make @@ -73,7 +73,7 @@ $(LUA_BUILDDIR)/lua.ovl: $(LUA_OBJ) $(TLSFLIB) $(LUA_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(LUA_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) $(LUA_BUILDDIR): $(call PRINTS,MKDIR $@)mkdir -p $(LUA_BUILDDIR)/ diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 4d7c5e8f04..4404598ad3 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -1052,6 +1052,11 @@ LUALIB_API int luaopen_rock(lua_State *L) { luaL_register(L, LUA_ROCKLIBNAME, rocklib); luaL_register(L, LUA_ROCKLIBNAME, rocklib_aux); +#ifdef SIMULATOR /* rb.SIMULATOR = true allows checking for the SIM in lua */ + lua_pushboolean(L, 1); + luaS_newlloc(L, "SIMULATOR", TSTR_INBIN); + lua_setfield(L, -2, "SIMULATOR"); +#endif lua_getglobal(L, "require"); lua_pushstring(L, "rb_defines"); if (lua_pcall (L, 1, 0, 0)) diff --git a/apps/plugins/lua_scripts/stars.lua b/apps/plugins/lua_scripts/stars.lua index e05007afb6..2a46b00707 100644 --- a/apps/plugins/lua_scripts/stars.lua +++ b/apps/plugins/lua_scripts/stars.lua @@ -414,7 +414,11 @@ action_event(rb.actions.ACTION_NONE) -- we can call this now but not after regis local eva = rockev.register("action", action_event) local evc = rockev.register("timer", action_drift, rb.HZ/7) +if not rb.SIMULATOR then while not action_quit() do rb.sleep(rb.HZ) end +else -- the SIM requires lcd_update to be called from the main thread +while not action_quit() do _lcd:update(); rb.sleep(10) end +end if start_x and start_y then file = io.open(fname, "w") diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c index f3e74d4ec0..510b03f789 100644 --- a/apps/plugins/midi/midiplay.c +++ b/apps/plugins/midi/midiplay.c @@ -140,14 +140,6 @@ #elif CONFIG_KEYPAD == COWON_D2_PAD #define MIDI_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define MIDI_QUIT BUTTON_BACK -#define MIDI_FFWD BUTTON_RIGHT -#define MIDI_REWIND BUTTON_LEFT -#define MIDI_VOL_UP BUTTON_UP -#define MIDI_VOL_DOWN BUTTON_DOWN -#define MIDI_PLAYPAUSE BUTTON_PLAY - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define MIDI_QUIT (BUTTON_PLAY|BUTTON_REPEAT) #define MIDI_FFWD BUTTON_MENU diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index bda2093b2a..e4a99e8f22 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -165,16 +165,6 @@ enum minesweeper_status { #elif (CONFIG_KEYPAD == COWON_D2_PAD) # define MINESWP_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -# define MINESWP_LEFT BUTTON_LEFT -# define MINESWP_RIGHT BUTTON_RIGHT -# define MINESWP_UP BUTTON_UP -# define MINESWP_DOWN BUTTON_DOWN -# define MINESWP_QUIT BUTTON_BACK -# define MINESWP_TOGGLE BUTTON_SELECT -# define MINESWP_DISCOVER BUTTON_PLAY -# define MINESWP_INFO BUTTON_MENU - #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD # define MINESWP_LEFT BUTTON_LEFT # define MINESWP_RIGHT BUTTON_RIGHT diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 89851de875..7e96ab81d9 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c @@ -2446,12 +2446,6 @@ static void get_mp3_filename(const char *wav_name) #elif CONFIG_KEYPAD == COWON_D2_PAD #define MP3ENC_DONE BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define MP3ENC_PREV BUTTON_UP -#define MP3ENC_NEXT BUTTON_DOWN -#define MP3ENC_DONE BUTTON_BACK -#define MP3ENC_SELECT BUTTON_SELECT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define MP3ENC_PREV BUTTON_UP #define MP3ENC_NEXT BUTTON_DOWN diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 8c4b6d4ee3..58dc11c89a 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c @@ -142,16 +142,6 @@ struct mpeg_settings settings; #elif CONFIG_KEYPAD == COWON_D2_PAD #define MPEG_START_TIME_EXIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define MPEG_START_TIME_SELECT BUTTON_SELECT -#define MPEG_START_TIME_LEFT BUTTON_LEFT -#define MPEG_START_TIME_RIGHT BUTTON_RIGHT -#define MPEG_START_TIME_UP BUTTON_UP -#define MPEG_START_TIME_DOWN BUTTON_DOWN -#define MPEG_START_TIME_LEFT2 BUTTON_PLAY -#define MPEG_START_TIME_RIGHT2 BUTTON_MENU -#define MPEG_START_TIME_EXIT BUTTON_BACK - #elif (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) #define MPEG_START_TIME_SELECT (BUTTON_PLAY|BUTTON_REL) #define MPEG_START_TIME_LEFT BUTTON_BACK @@ -985,13 +975,6 @@ static int get_start_time(uint32_t duration) case STATE0: if (!sliding) { - if (rb->global_settings->talk_menu) - { - rb->talk_disable(true); -#ifdef PLUGIN_USE_IRAM - mpegplayer_iram_restore(); -#endif - } trigger_cpu_boost(); sliding = true; } @@ -1010,10 +993,6 @@ static int get_start_time(uint32_t duration) cancel_cpu_boost(); if (rb->global_settings->talk_menu) { -#ifdef PLUGIN_USE_IRAM - mpegplayer_iram_preserve(); -#endif - rb->talk_disable(false); talk_val(resume_time / TS_SECOND, UNIT_TIME, false); talk_val(resume_time * 100 / duration, UNIT_PERCENT, true); } @@ -1053,14 +1032,6 @@ static int show_start_menu(uint32_t duration) ID2P(LANG_SETTINGS), ID2P(LANG_MENU_QUIT)); - if (rb->global_settings->talk_menu) - { -#ifdef PLUGIN_USE_IRAM - mpegplayer_iram_preserve(); -#endif - rb->talk_disable(false); - } - rb->button_clear_queue(); while (!menu_quit) @@ -1109,14 +1080,6 @@ static int show_start_menu(uint32_t duration) } } - if (rb->global_settings->talk_menu) - { - rb->talk_disable(true); -#ifdef PLUGIN_USE_IRAM - mpegplayer_iram_restore(); -#endif - } - return result; } @@ -1151,14 +1114,6 @@ int mpeg_menu(void) ID2P(LANG_RESUME_PLAYBACK), ID2P(LANG_MENU_QUIT)); - if (rb->global_settings->talk_menu) - { -#ifdef PLUGIN_USE_IRAM - mpegplayer_iram_preserve(); -#endif - rb->talk_disable(false); - } - rb->button_clear_queue(); mpeg_sysevent_clear(); @@ -1184,14 +1139,6 @@ int mpeg_menu(void) if (mpeg_sysevent() != 0) result = MPEG_MENU_QUIT; - if (rb->global_settings->talk_menu) - { - rb->talk_disable(true); -#ifdef PLUGIN_USE_IRAM - mpegplayer_iram_restore(); -#endif - } - return result; } diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 923dff0b40..02eeb6455d 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -254,15 +254,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define MPEG_VOLDOWN BUTTON_MINUS #define MPEG_VOLUP BUTTON_PLUS -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define MPEG_MENU BUTTON_MENU -#define MPEG_STOP BUTTON_BACK -#define MPEG_PAUSE BUTTON_PLAY -#define MPEG_VOLDOWN BUTTON_UP -#define MPEG_VOLUP BUTTON_DOWN -#define MPEG_RW BUTTON_LEFT -#define MPEG_FF BUTTON_RIGHT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define MPEG_MENU BUTTON_MENU #define MPEG_STOP (BUTTON_PLAY|BUTTON_REPEAT) @@ -690,54 +681,6 @@ static unsigned draw_blendcolor(unsigned c1, unsigned c2, unsigned char amount) } #endif -#ifdef PLUGIN_USE_IRAM -/* IRAM preserving mechanism to enable talking menus */ -static char *iram_saved_copy; -extern char iramstart[], iramend[]; - -static void iram_saving_init(void) -{ -#ifndef SIMULATOR - size_t size; - iram_saved_copy = (char *)rb->plugin_get_buffer(&size); - - if (size >= (size_t)(iramend-iramstart)) - iram_saved_copy += size - (size_t)(iramend - iramstart); - else -#endif - iram_saved_copy = NULL; - - return; -} - -void mpegplayer_iram_preserve(void) -{ - if (iram_saved_copy) - { - rb->memcpy(iram_saved_copy, iramstart, iramend-iramstart); -#ifdef HAVE_CPUCACHE_INVALIDATE - /* make the icache (if it exists) up to date with the new code */ - rb->cpucache_invalidate(); -#endif /* HAVE_CPUCACHE_INVALIDATE */ - } - return; -} - -void mpegplayer_iram_restore(void) -{ - if (iram_saved_copy) - { - rb->audio_hard_stop(); - rb->memcpy(iramstart, iram_saved_copy, iramend-iramstart); -#ifdef HAVE_CPUCACHE_INVALIDATE - /* make the icache (if it exists) up to date with the new code */ - rb->cpucache_invalidate(); -#endif /* HAVE_CPUCACHE_INVALIDATE */ - } - return; -} -#endif - /* Drawing functions that operate rotated on LCD_PORTRAIT displays - * most are just wrappers of lcd_* functions with transforms applied. * The origin is the upper-left corner of the OSD area */ @@ -2472,29 +2415,12 @@ enum plugin_status plugin_start(const void* parameter) int status = PLUGIN_OK; /* assume success */ bool quit = false; -#if defined(PLUGIN_USE_IRAM) && !defined(SIMULATOR) - bool preserved_talk_state; -#endif - if (parameter == NULL) { /* No file = GTFO */ rb->splash(HZ*2, "No File"); return PLUGIN_ERROR; } - /* Disable all talking before initializing IRAM */ - rb->talk_disable(true); - -#ifdef PLUGIN_USE_IRAM - iram_saving_init(); - -#ifndef SIMULATOR - preserved_talk_state = rb->global_settings->talk_menu; - if (!iram_saved_copy) - rb->global_settings->talk_menu = false; -#endif -#endif - #ifdef HAVE_LCD_COLOR rb->lcd_set_backdrop(NULL); rb->lcd_set_foreground(LCD_WHITE); @@ -2645,13 +2571,6 @@ enum plugin_status plugin_start(const void* parameter) stream_exit(); -#if defined(PLUGIN_USE_IRAM) && !defined(SIMULATOR) - if (!iram_saved_copy) - rb->global_settings->talk_menu = preserved_talk_state; -#endif - - rb->talk_disable(false); - /* Actually handle delayed processing of system events of interest * that were captured in other button loops */ mpeg_sysevent_handle(); diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h index 51fb9a8f8a..4ddf0ca7b1 100644 --- a/apps/plugins/mpegplayer/mpegplayer.h +++ b/apps/plugins/mpegplayer/mpegplayer.h @@ -86,10 +86,4 @@ #define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0) #define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1) -#ifdef PLUGIN_USE_IRAM -/* IRAM preserving mechanism to enable talking menus */ -extern void mpegplayer_iram_preserve(void); -extern void mpegplayer_iram_restore(void); -#endif - #endif /* MPEGPLAYER_H */ diff --git a/apps/plugins/open_plugins.c b/apps/plugins/open_plugins.c index c7007b1bd0..e90d2d95de 100644 --- a/apps/plugins/open_plugins.c +++ b/apps/plugins/open_plugins.c @@ -176,12 +176,18 @@ static void op_entry_set_checksum(void) (op_entry.lang_id <= OPEN_PLUGIN_LANG_INVALID ? 0 : LANG_LAST_INDEX_IN_ARRAY); } -static void op_entry_set_name(void) +static bool op_entry_set_name(void) { char tmp_buf[OPEN_PLUGIN_NAMESZ+1]; rb->strlcpy(tmp_buf, op_entry.name, OPEN_PLUGIN_NAMESZ); + uint32_t crc = rb->crc_32(tmp_buf, sizeof(tmp_buf), 0xffffffff); + if (rb->kbd_input(tmp_buf, OPEN_PLUGIN_NAMESZ, NULL) >= 0) + { rb->strlcpy(op_entry.name, tmp_buf, OPEN_PLUGIN_NAMESZ); + return crc != rb->crc_32(tmp_buf, sizeof(tmp_buf), 0xffffffff); + } + return false; } static int op_entry_set_path(void) @@ -392,10 +398,10 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha rb->strlcpy(op_entry.param, parameter, OPEN_PLUGIN_BUFSZ); /* hash on the parameter path if it is a file */ - if (op_entry.lang_id <0 && key == op_entry.path && + if (op_entry.lang_id <0 && (key == op_entry.path || key == NULL) && rb->file_exists(op_entry.param)) { - open_plugin_get_hash(op_entry.path, &newhash); + open_plugin_get_hash(op_entry.param, &newhash); op_entry.hash = newhash; } } @@ -692,6 +698,7 @@ static void edit_menu(int selection) { int selected_item; bool exit = false; + bool name_set = false; int action = 0; if (!op_entry_read(fd_dat, selection, op_entry_sz)) @@ -713,11 +720,22 @@ static void edit_menu(int selection) { case ACTION_STD_OK: if (selected_item == 0) - op_entry_set_name(); + { + name_set = op_entry_set_name(); + } else if (selected_item == 2) op_entry_set_path(); else if (selected_item == 4) + { op_entry_set_param(); + /* if user already set the name they probably don't want us to change it */ + if (!name_set && op_entry.lang_id < 0 && rb->file_exists(op_entry.param)) + { + char *slash = rb->strrchr(op_entry.param, '/'); + if(slash) + rb->strlcpy(op_entry.name, slash+1, OPEN_PLUGIN_NAMESZ); + } + } else exit = true; diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 9943b78aba..49c0aeda4e 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -223,20 +223,6 @@ #define OSCILLOSCOPE_VOL_UP BUTTON_PLUS #define OSCILLOSCOPE_VOL_DOWN BUTTON_MINUS -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define OSCILLOSCOPE_QUIT BUTTON_BACK -#define OSCILLOSCOPE_DRAWMODE BUTTON_SELECT -#define OSCILLOSCOPE_ADVMODE BUTTON_CUSTOM -#define OSCILLOSCOPE_ORIENTATION_PRE BUTTON_MENU -#define OSCILLOSCOPE_ORIENTATION (BUTTON_MENU | BUTTON_REL) -#define OSCILLOSCOPE_GRAPHMODE_PRE BUTTON_MENU -#define OSCILLOSCOPE_GRAPHMODE (BUTTON_MENU | BUTTON_REPEAT) -#define OSCILLOSCOPE_PAUSE BUTTON_PLAY -#define OSCILLOSCOPE_SPEED_UP BUTTON_RIGHT -#define OSCILLOSCOPE_SPEED_DOWN BUTTON_LEFT -#define OSCILLOSCOPE_VOL_UP BUTTON_UP -#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define OSCILLOSCOPE_QUIT BUTTON_POWER #define OSCILLOSCOPE_DRAWMODE (BUTTON_MENU | BUTTON_UP) diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c old mode 100755 new mode 100644 index a7f662a823..c5e9e9c22e --- a/apps/plugins/pacbox/pacbox.c +++ b/apps/plugins/pacbox/pacbox.c @@ -387,7 +387,7 @@ static void start_sound(void) if (sound_playing) return; -#ifndef PLUGIN_USE_IRAM +#ifndef USE_IRAM /* Ensure control of PCM - stopping music itn't obligatory */ rb->plugin_get_audio_buffer(NULL); #endif diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h index 1102a01ab1..00cc6b1f59 100644 --- a/apps/plugins/pacbox/pacbox.h +++ b/apps/plugins/pacbox/pacbox.h @@ -169,17 +169,6 @@ #define PACMAN_MENU (BUTTON_MENU|BUTTON_REL) -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define PACMAN_UP BUTTON_UP -#define PACMAN_DOWN BUTTON_DOWN -#define PACMAN_LEFT BUTTON_LEFT -#define PACMAN_RIGHT BUTTON_RIGHT -#define PACMAN_1UP BUTTON_CUSTOM -#define PACMAN_2UP BUTTON_PLAY -#define PACMAN_COIN BUTTON_SELECT -#define PACMAN_MENU BUTTON_MENU - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define PACMAN_UP BUTTON_UP diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c index 8547df603b..832ebc49f7 100644 --- a/apps/plugins/pegbox.c +++ b/apps/plugins/pegbox.c @@ -271,23 +271,6 @@ #define QUIT_TEXT "POWER" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define PEGBOX_SELECT BUTTON_CUSTOM -#define PEGBOX_QUIT BUTTON_BACK -#define PEGBOX_RESTART BUTTON_SELECT -#define PEGBOX_LVL_UP BUTTON_PLAY -#define PEGBOX_LVL_DOWN BUTTON_MENU -#define PEGBOX_UP BUTTON_UP -#define PEGBOX_DOWN BUTTON_DOWN -#define PEGBOX_RIGHT BUTTON_RIGHT -#define PEGBOX_LEFT BUTTON_LEFT - -#define SELECT_TEXT "CUSTOM" -#define QUIT_TEXT "BACK" -#define RESTART_TEXT "MIDDLE" -#define LVL_UP_TEXT "SELECT" -#define LVL_DOWN_TEXT "MENU" - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define PEGBOX_SELECT (BUTTON_PLAY|BUTTON_REL) #define PEGBOX_QUIT BUTTON_POWER diff --git a/apps/plugins/picross/picross_default.picross b/apps/plugins/picross/picross_default.picross old mode 100755 new mode 100644 diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index 73bf98154b..259b95f5f0 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -126,8 +126,7 @@ const struct button_mapping pf_context_buttons[] = {PF_SELECT, BUTTON_CENTER, BUTTON_NONE}, {PF_BACK, BUTTON_BOTTOMRIGHT, BUTTON_NONE}, #endif -#if CONFIG_KEYPAD == CREATIVEZV_PAD || CONFIG_KEYPAD == CREATIVEZVM_PAD || \ - CONFIG_KEYPAD == PHILIPS_HDD1630_PAD || \ +#if CONFIG_KEYPAD == PHILIPS_HDD1630_PAD || \ CONFIG_KEYPAD == GIGABEAT_PAD || CONFIG_KEYPAD == GIGABEAT_S_PAD || \ CONFIG_KEYPAD == MROBE100_PAD || CONFIG_KEYPAD == MROBE500_PAD || \ CONFIG_KEYPAD == PHILIPS_SA9200_PAD || CONFIG_KEYPAD == SANSA_CLIP_PAD || \ @@ -162,8 +161,6 @@ const struct button_mapping pf_context_buttons[] = {PF_QUIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU}, #elif CONFIG_KEYPAD == IAUDIO_M3_PAD {PF_QUIT, BUTTON_RC_REC, BUTTON_NONE}, -#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD - {PF_QUIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU}, #elif CONFIG_KEYPAD == IRIVER_H100_PAD || CONFIG_KEYPAD == IRIVER_H300_PAD {PF_QUIT, BUTTON_OFF, BUTTON_NONE}, #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD diff --git a/apps/plugins/pictureflow/pictureflow.make b/apps/plugins/pictureflow/pictureflow.make index e13ba61a72..7436af2433 100644 --- a/apps/plugins/pictureflow/pictureflow.make +++ b/apps/plugins/pictureflow/pictureflow.make @@ -37,7 +37,7 @@ $(PICTUREFLOW_OBJDIR)/pictureflow.ovl: $(PICTUREFLOW_OBJ) $(PICTUREFLOW_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PICTUREFLOW_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) # special pattern rule for compiling pictureflow with extra flags $(PICTUREFLOW_OBJDIR)/%.o: $(PICTUREFLOW_SRCDIR)/%.c $(PICTUREFLOW_SRCDIR)/pictureflow.make diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index 9840aab325..9bed3ff754 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -248,7 +248,7 @@ static volatile int audio_tail = 0; /* which of the two buffers to record? */ #ifndef SIMULATOR static int16_t audio_data[2][BUFFER_SIZE] MEM_ALIGN_ATTR; static fixed yin_buffer[YIN_BUFFER_SIZE] IBSS_ATTR; -#ifdef PLUGIN_USE_IRAM +#ifdef USE_IRAM static int16_t iram_audio_data[BUFFER_SIZE] IBSS_ATTR; #else #define iram_audio_data audio_data[audio_head] @@ -1047,7 +1047,7 @@ static void record_and_get_pitch(void) #ifdef HAVE_SCHEDULER_BOOSTCTRL rb->trigger_cpu_boost(); #endif -#ifdef PLUGIN_USE_IRAM +#ifdef USE_IRAM rb->memcpy(iram_audio_data, audio_data[audio_head], settings.sample_size * sizeof (int16_t)); #endif diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index b0fd8d6d28..9437be1766 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds @@ -13,12 +13,6 @@ OUTPUT_FORMAT(elf32-littlemips) #error Unknown CPU architecture #endif -#ifdef DEBUG -#define STUBOFFSET 0x10000 -#else -#define STUBOFFSET 0 -#endif - #if defined(CPU_PP) #ifdef CPU_PP502x #define NOCACHE_BASE 0x10000000 @@ -31,7 +25,7 @@ OUTPUT_FORMAT(elf32-littlemips) #if CONFIG_CPU==IMX31L /* No fudges! */ #include "imx31l.h" -#define DRAMSIZE ((MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE \ +#define DRAMSIZE ((MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE \ - CODEC_SIZE - QHARRAY_SIZE - FRAME_SIZE - TTB_SIZE) #elif CONFIG_CPU==DM320 @@ -56,25 +50,25 @@ OUTPUT_FORMAT(elf32-littlemips) #define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE) #endif -#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA #elif CONFIG_CPU==S3C2440 #include "cpu.h" /* must be 16Kb (0x4000) aligned */ #define TTB_SIZE (0x4000) -#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE #elif CONFIG_CPU==TCC7801 #include "cpu.h" -#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - TTB_SIZE +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - CODEC_SIZE - TTB_SIZE #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 #include "cpu.h" #define DRAMORIG DRAM_ORIG #if defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2) -#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - TTB_SIZE) +#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - TTB_SIZE) #else -#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - TTB_SIZE) +#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - TTB_SIZE) #endif #elif CONFIG_CPU==S5L8702 || CONFIG_CPU==S5L8720 #define ASM @@ -83,15 +77,17 @@ OUTPUT_FORMAT(elf32-littlemips) #elif CONFIG_CPU==IMX233 #include "cpu.h" #define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - FRAME_SIZE - TTB_SIZE) +#elif CONFIG_CPU == JZ4732 || CONFIG_CPU == JZ4760B +/* fake 'iram' region occupies first 16k */ +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - CODEC_SIZE - 0x4000 #elif CONFIG_CPU==X1000 #include "cpu.h" -#undef STUBOFFSET #define DRAMSIZE (X1000_DRAM_SIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE) #endif /* default to full RAM (minus codecs&plugins) unless specified otherwise */ #ifndef DRAMSIZE -#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - CODEC_SIZE #endif /* MCF5249 have 96KB of IRAM */ @@ -119,17 +115,17 @@ OUTPUT_FORMAT(elf32-littlemips) #define IRAMSIZE 0x0c000 #elif CONFIG_CPU == PNX0101 -#define DRAMORIG 0xc00000 + STUBOFFSET +#define DRAMORIG 0xc00000 #define IRAMORIG 0x407000 #define IRAMSIZE 0x9000 #elif CONFIG_CPU == IMX31L || CONFIG_CPU == S3C2440 -#define DRAMORIG 0x0 + STUBOFFSET +#define DRAMORIG 0x0 #define IRAM DRAM #define IRAMSIZE 0 #elif CONFIG_CPU==DM320 -#define DRAMORIG CONFIG_SDRAM_START + STUBOFFSET +#define DRAMORIG CONFIG_SDRAM_START #define IRAM DRAM /* The bit of IRAM that is available is used in the core */ #define IRAMSIZE 0 @@ -181,13 +177,7 @@ OUTPUT_FORMAT(elf32-littlemips) #define IRAMSIZE (136*1024) #elif CONFIG_CPU == JZ4732 || CONFIG_CPU == JZ4760B -#undef STUBOFFSET -#ifdef DEBUG -#define STUBOFFSET 0x14000 -#else -#define STUBOFFSET 0x4000 -#endif -#define DRAMORIG 0x80000000 + STUBOFFSET +#define DRAMORIG 0x80004000 #define IRAM DRAM #define IRAMSIZE 0 /* The bit of IRAM that is available is used in the core */ @@ -209,8 +199,14 @@ OUTPUT_FORMAT(elf32-littlemips) #define IRAM DRAM #define IRAMSIZE 0 +#elif CONFIG_CPU == STM32H743 +#include "cpu.h" +#define DRAMORIG STM32_SDRAM1_BASE +#define IRAM DRAM +#define IRAMSIZE 0 + #else -#define DRAMORIG 0x09000000 + STUBOFFSET +#define DRAMORIG 0x09000000 #endif #ifndef NOCACHE_BASE @@ -288,25 +284,18 @@ SECTIONS } > PLUGIN_RAM #if NOCACHE_BASE != 0 - .ncdata . + NOCACHE_BASE : + /* + * Allocate .ncdata based on the following constraints: + * + * 1. the LMA must be allocated at the next free LMA in + * PLUGIN_RAM and aligned to a cacheline boundary. + * 2. the VMA - LMA offset must equal NOCACHE_BASE. + */ + .ncdata ALIGN(. + NOCACHE_BASE, CACHEALIGN_SIZE) : ALIGN(CACHEALIGN_SIZE) { - . = ALIGN(CACHEALIGN_SIZE); *(.ncdata*) . = ALIGN(CACHEALIGN_SIZE); -/* EABI currently needs these defined here, otherwise .iram and .bss can - sometimes have an incorrect load address, breaking codecs and plugins. */ - bssaddr = . - NOCACHE_BASE; -#if defined(IRAMSIZE) && IRAMSIZE != 0 - iramcopy = . - NOCACHE_BASE; -#endif } AT> PLUGIN_RAM -/* This definition is used when NOCACHE_BASE is 0. The address offset bug only - seems to occur when the empty .ncdata is present. */ -#else - bssaddr = .; -#if defined(IRAMSIZE) && IRAMSIZE != 0 - iramcopy = .; -#endif #endif /DISCARD/ : @@ -318,7 +307,7 @@ SECTIONS #endif } - .bss bssaddr (NOLOAD) : + .bss (NOLOAD) : { plugin_bss_start = .; _plugin_bss_start = .; @@ -331,29 +320,47 @@ SECTIONS } > PLUGIN_RAM #if NOCACHE_BASE != 0 - .ncbss . + NOCACHE_BASE (NOLOAD) : + /* + * .ncbss has the same constraints as the .ncdata section + * above but there is an extra complication: because it is + * a NOLOAD section, unlike .ncdata it cannot consume any + * VMAs or LMAs in PLUGIN_RAM itself. + * + * Because free VMA/LMAs in PLUGIN_RAM are unchanged, any + * subsequent sections will get placed at the end of the + * .bss section, overlapping .ncbss, which we don't want. + * + * One solution is to manually place the next sections to + * account for the size of .ncbss, but a cleaner solution + * is to define a dummy section (.ncbss_vma) allocated at + * the same VMA as .ncbss and equal in size, and placed in + * the PLUGIN_RAM region. This allocates the correct VMA + * range in plugin RAM so that the next section will not + * overlap .ncbss. + */ + .ncbss ALIGN(. + NOCACHE_BASE, CACHEALIGN_SIZE) (NOLOAD) : ALIGN(CACHEALIGN_SIZE) { - . = ALIGN(CACHEALIGN_SIZE); *(.ncbss*) . = ALIGN(CACHEALIGN_SIZE); - /* We won't trust this one any more than with .ncdata */ - pluginendaddr = . - NOCACHE_BASE; } AT> PLUGIN_RAM -#else - pluginendaddr = .; + + .ncbss_vma (NOLOAD) : ALIGN(CACHEALIGN_SIZE) + { + . += SIZEOF(.ncbss); + } > PLUGIN_RAM #endif /* Final end of plugin after IRAM setup. The plugin or codec buffer is considered unused by the in-RAM image at this point once IRAM is copied. */ - .pluginend pluginendaddr : + .pluginend (NOLOAD) : { _plugin_end_addr = .; plugin_end_addr = .; - } + } > PLUGIN_RAM #if defined(IRAMSIZE) && IRAMSIZE != 0 - .iram IRAMORIG : AT (iramcopy) + .iram IRAMORIG : AT(LOADADDR(.bss)) { iramstart = .; *(.icode) @@ -361,6 +368,7 @@ SECTIONS *(.idata) iramend = .; } > PLUGIN_IRAM + iramcopy = LOADADDR(.iram); .ibss (NOLOAD) : { @@ -391,3 +399,13 @@ SECTIONS KEEP(*(.comment)) } } + +#if NOCACHE_BASE != 0 +/* Some asserts to make sure nocache sections appear correctly defined */ +ASSERT(LOADADDR(.ncdata) == ADDR(.ncdata) - NOCACHE_BASE, ".ncdata has incorrect LMA/VMA address"); +ASSERT(LOADADDR(.ncdata) % CACHEALIGN_SIZE == 0, ".ncdata incorrectly aligned"); +ASSERT(LOADADDR(.ncbss) == ADDR(.ncbss) - NOCACHE_BASE, ".ncbss has incorrect LMA/VMA address"); +ASSERT(LOADADDR(.ncbss) % CACHEALIGN_SIZE == 0, ".ncbss incorrectly aligned"); +ASSERT(ADDR(.ncbss_vma) == LOADADDR(.ncbss), ".ncbss_vma has wrong address"); +ASSERT(SIZEOF(.ncbss_vma) == SIZEOF(.ncbss), ".ncbss_vma has wrong size"); +#endif diff --git a/apps/plugins/plugin_crt0.c b/apps/plugins/plugin_crt0.c index 934f4e9338..4358f65aa9 100644 --- a/apps/plugins/plugin_crt0.c +++ b/apps/plugins/plugin_crt0.c @@ -74,7 +74,7 @@ enum plugin_status plugin__start(const void *param) #if (CONFIG_PLATFORM & PLATFORM_NATIVE) /* IRAM must be copied before clearing the BSS ! */ -#ifdef PLUGIN_USE_IRAM +#ifdef USE_IRAM extern char iramcopy[], iramstart[], iramend[], iedata[], iend[]; size_t iram_size = iramend - iramstart; size_t ibss_size = iend - iedata; @@ -92,7 +92,7 @@ enum plugin_status plugin__start(const void *param) */ asm volatile ("" ::: "memory"); } -#endif /* PLUGIN_USE_IRAM */ +#endif /* USE_IRAM */ /* zero out the bss section */ rb->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start); diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index 2babb329a5..55a6946c61 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make @@ -20,11 +20,15 @@ ifeq ($(APP_TYPE),ctru-app) is_app_build = endif +ifdef SELECTED_PLUGINS_SRC +PLUGINS_SRC = $(SELECTED_PLUGINS_SRC) +else ifdef is_app_build PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES.app_build) else PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES) endif +endif # ifdef SELECTED_PLUGINS_SRC OTHER_SRC += $(PLUGINS_SRC) ROCKS1 := $(PLUGINS_SRC:.c=.rock) ROCKS1 := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(ROCKS1)) @@ -58,11 +62,15 @@ endif OTHER_SRC += $(ROOTDIR)/apps/plugins/plugin_crt0.c PLUGIN_CRT0 := $(BUILDDIR)/apps/plugins/plugin_crt0.o # multifile plugins (subdirs): +ifdef SELECTED_PLUGINS_SUBDIRS +PLUGINSUBDIRS := $(SELECTED_PLUGINS_SUBDIRS) +else ifdef is_app_build PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS.app_build) else PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS) endif +endif # ifdef SELECTED_PLUGINS_SUBDIRS PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB) $(FIXEDPOINTLIB) @@ -169,7 +177,7 @@ $(BUILDDIR)/%.rock: $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PLUGINLDFLAGS) - $(SILENT)$(call objcopy,$(BUILDDIR)/$*.elf,$@) + $(SILENT)$(call objcopy_plugin,$(BUILDDIR)/$*.elf,$@) $(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua $(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/ diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 8f409712b6..c9addff347 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -139,13 +139,6 @@ #elif (CONFIG_KEYPAD == COWON_D2_PAD) #define PONG_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define PONG_QUIT BUTTON_BACK -#define PONG_LEFT_UP BUTTON_UP -#define PONG_LEFT_DOWN BUTTON_DOWN -#define PONG_RIGHT_UP BUTTON_PLAY -#define PONG_RIGHT_DOWN BUTTON_MENU - #elif (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) #define PONG_QUIT BUTTON_POWER #define PONG_PAUSE BUTTON_PLAY diff --git a/apps/plugins/puzzles/puzzles.make b/apps/plugins/puzzles/puzzles.make index 91e84c50da..4c3322d32e 100644 --- a/apps/plugins/puzzles/puzzles.make +++ b/apps/plugins/puzzles/puzzles.make @@ -49,14 +49,14 @@ $(PUZZLES_OBJDIR)/sgt-%.rock: $(PUZZLES_OBJDIR)/src/%.o $(PUZZLES_OBJDIR)/help/% $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(filter-out -Wl%.map, $(PLUGINLDFLAGS)) -Wl,$(LDMAP_OPT),$(PUZZLES_OBJDIR)/src/$*.map - $(SILENT)$(call objcopy,$(PUZZLES_OBJDIR)/$*.elf,$@) + $(SILENT)$(call objcopy_plugin,$(PUZZLES_OBJDIR)/$*.elf,$@) $(PUZZLES_OBJDIR)/sgt-%.rock: $(PUZZLES_OBJDIR)/src/unfinished/%.o $(PUZZLES_OBJDIR)/help/%.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB) $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(PUZZLES_OBJDIR)/$*.elf \ $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(filter-out -Wl%.map, $(PLUGINLDFLAGS)) -Wl,$(LDMAP_OPT),$(PUZZLES_OBJDIR)/src/$*.map - $(SILENT)$(call objcopy,$(PUZZLES_OBJDIR)/$*.elf,$@) + $(SILENT)$(call objcopy_plugin,$(PUZZLES_OBJDIR)/$*.elf,$@) $(PUZZLES_SRCDIR)/rbcompat.h: $(APPSDIR)/plugin.h \ $(APPSDIR)/plugins/lib/pluginlib_exit.h \ diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h index 8bf5475164..389d190169 100644 --- a/apps/plugins/reversi/reversi-gui.h +++ b/apps/plugins/reversi/reversi-gui.h @@ -136,15 +136,6 @@ #define REVERSI_BUTTON_QUIT BUTTON_POWER #define REVERSI_BUTTON_MENU BUTTON_MENU -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define REVERSI_BUTTON_QUIT BUTTON_BACK -#define REVERSI_BUTTON_UP BUTTON_UP -#define REVERSI_BUTTON_DOWN BUTTON_DOWN -#define REVERSI_BUTTON_LEFT BUTTON_LEFT -#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT -#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT -#define REVERSI_BUTTON_MENU BUTTON_MENU - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define REVERSI_BUTTON_QUIT BUTTON_POWER #define REVERSI_BUTTON_UP BUTTON_UP diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index d2887af78f..a657dde2d7 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -195,16 +195,6 @@ #define ROCKBLOX_OFF BUTTON_POWER #define ROCKBLOX_RESTART BUTTON_MENU -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define ROCKBLOX_OFF BUTTON_BACK -#define ROCKBLOX_ROTATE_CCW BUTTON_UP -#define ROCKBLOX_ROTATE_CW BUTTON_PLAY -#define ROCKBLOX_DOWN BUTTON_DOWN -#define ROCKBLOX_LEFT BUTTON_LEFT -#define ROCKBLOX_RIGHT BUTTON_RIGHT -#define ROCKBLOX_DROP BUTTON_SELECT -#define ROCKBLOX_RESTART BUTTON_CUSTOM - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define ROCKBLOX_OFF BUTTON_POWER #define ROCKBLOX_ROTATE_CCW BUTTON_VOL_DOWN diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index 7cca8d9130..3cb4ba6771 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -210,16 +210,6 @@ static void setoptions (void) options.SELECT = BUTTON_SELECT; options.MENU = BUTTON_MENU; -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - options.UP = BUTTON_UP; - options.DOWN = BUTTON_DOWN; - - options.A = BUTTON_CUSTOM; - options.B = BUTTON_PLAY; - options.START = BUTTON_BACK; - options.SELECT = BUTTON_SELECT; - options.MENU = BUTTON_MENU; - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD options.UP = BUTTON_UP; options.DOWN = BUTTON_DOWN; diff --git a/apps/plugins/rockboy/rockboy.make b/apps/plugins/rockboy/rockboy.make index 8be44ef9c5..8725604933 100644 --- a/apps/plugins/rockboy/rockboy.make +++ b/apps/plugins/rockboy/rockboy.make @@ -37,7 +37,7 @@ $(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(ROCKBOY_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) # special rule to build with devkitarm gcc ifeq ($(APP_TYPE),ctru-app) diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index c821cd234d..8c7d05c00d 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c @@ -134,17 +134,6 @@ #define ROCKPAINT_QUIT BUTTON_POWER #define ROCKPAINT_MENU BUTTON_MENU -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define ROCKPAINT_QUIT BUTTON_BACK -#define ROCKPAINT_DRAW BUTTON_SELECT -#define ROCKPAINT_MENU BUTTON_MENU -#define ROCKPAINT_TOOLBAR BUTTON_PLAY -#define ROCKPAINT_TOOLBAR2 ( BUTTON_PLAY | BUTTON_LEFT ) -#define ROCKPAINT_UP BUTTON_UP -#define ROCKPAINT_DOWN BUTTON_DOWN -#define ROCKPAINT_LEFT BUTTON_LEFT -#define ROCKPAINT_RIGHT BUTTON_RIGHT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define ROCKPAINT_QUIT BUTTON_POWER #define ROCKPAINT_DRAW BUTTON_VOL_UP diff --git a/apps/plugins/sdl/sdl.make b/apps/plugins/sdl/sdl.make index 9d666bd732..7234656268 100644 --- a/apps/plugins/sdl/sdl.make +++ b/apps/plugins/sdl/sdl.make @@ -95,7 +95,7 @@ $(SDL_OBJDIR)/wolf3d.ovl: $(SDL_OBJ) $(WOLF3D_OBJ) $(TLSFLIB) $(WOLF3D_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc -T$(WOLF3D_OUTLDS) $(SDL_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) # Quake ### @@ -113,7 +113,7 @@ $(SDL_OBJDIR)/quake.ovl: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB) $(QUAKE_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc -T$(QUAKE_OUTLDS) $(SDL_OVLFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) ### diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index 273a178c2d..63121edba1 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -140,15 +140,6 @@ #define PUZZLE_QUIT BUTTON_POWER #define PUZZLE_QUIT_TEXT "[POWER]" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define PUZZLE_QUIT BUTTON_BACK -#define PUZZLE_LEFT BUTTON_LEFT -#define PUZZLE_RIGHT BUTTON_RIGHT -#define PUZZLE_UP BUTTON_UP -#define PUZZLE_DOWN BUTTON_DOWN -#define PUZZLE_SHUFFLE BUTTON_PLAY -#define PUZZLE_PICTURE BUTTON_MENU - #elif (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) #define PUZZLE_QUIT BUTTON_POWER #define PUZZLE_LEFT BUTTON_BACK diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 23842e443c..4055087159 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -133,14 +133,6 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; #define SNAKE_RC_QUIT BUTTON_REC -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define SNAKE_QUIT BUTTON_BACK -#define SNAKE_LEFT BUTTON_LEFT -#define SNAKE_RIGHT BUTTON_RIGHT -#define SNAKE_UP BUTTON_UP -#define SNAKE_DOWN BUTTON_DOWN -#define SNAKE_PLAYPAUSE BUTTON_PLAY - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define SNAKE_QUIT BUTTON_POWER #define SNAKE_LEFT BUTTON_BACK diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index 864cda688a..d8a97f159f 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -265,15 +265,6 @@ Head and Tail are stored #elif (CONFIG_KEYPAD == COWON_D2_PAD) #define SNAKE2_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define SNAKE2_LEFT BUTTON_LEFT -#define SNAKE2_RIGHT BUTTON_RIGHT -#define SNAKE2_UP BUTTON_UP -#define SNAKE2_DOWN BUTTON_DOWN -#define SNAKE2_QUIT BUTTON_BACK -#define SNAKE2_PLAYPAUSE BUTTON_PLAY -#define SNAKE2_PLAYPAUSE_TEXT "Play" - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define SNAKE2_LEFT BUTTON_BACK #define SNAKE2_RIGHT BUTTON_MENU diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 1d61ba1749..7b6e79f70b 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -312,21 +312,6 @@ #define SOKOBAN_LEVEL_UP BUTTON_PLUS #define SOKOBAN_MENU_NAME "[MENU]" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define SOKOBAN_LEFT BUTTON_LEFT -#define SOKOBAN_RIGHT BUTTON_RIGHT -#define SOKOBAN_UP BUTTON_UP -#define SOKOBAN_DOWN BUTTON_DOWN -#define SOKOBAN_MENU BUTTON_MENU -#define SOKOBAN_UNDO BUTTON_BACK -#define SOKOBAN_REDO (BUTTON_BACK | BUTTON_PLAY) -#define SOKOBAN_LEVEL_DOWN (BUTTON_SELECT | BUTTON_DOWN) -#define SOKOBAN_LEVEL_REPEAT (BUTTON_SELECT | BUTTON_RIGHT) -#define SOKOBAN_LEVEL_UP (BUTTON_SELECT | BUTTON_UP) -#define SOKOBAN_PAUSE BUTTON_PLAY -#define BUTTON_SAVE BUTTON_CUSTOM -#define BUTTON_SAVE_NAME "CUSTOM" - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define SOKOBAN_LEFT BUTTON_BACK #define SOKOBAN_RIGHT BUTTON_MENU diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 07cebef043..6205c186ca 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -295,24 +295,6 @@ #elif (CONFIG_KEYPAD == COWON_D2_PAD) # define SOL_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -# define SOL_QUIT BUTTON_BACK -# define SOL_UP BUTTON_UP -# define SOL_DOWN BUTTON_DOWN -# define SOL_LEFT BUTTON_LEFT -# define SOL_RIGHT BUTTON_RIGHT -# define SOL_MOVE_PRE BUTTON_SELECT -# define SOL_MOVE (BUTTON_SELECT | BUTTON_REL) -# define SOL_DRAW BUTTON_MENU -# define SOL_REM2CUR (BUTTON_LEFT | BUTTON_SELECT) -# define SOL_CUR2STACK (BUTTON_SELECT | BUTTON_REPEAT) -# define SOL_REM2STACK (BUTTON_RIGHT | BUTTON_SELECT) -# define HK_MOVE "MIDDLE" -# define HK_DRAW "MENU" -# define HK_REM2CUR "PLAY+LEFT" -# define HK_CUR2STACK "PLAY.." -# define HK_REM2STACK "PLAY+RIGHT" - #elif (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) # define SOL_QUIT BUTTON_POWER # define SOL_UP BUTTON_UP diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index f543065f27..38ee7504ac 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -152,15 +152,6 @@ #elif (CONFIG_KEYPAD == COWON_D2_PAD) #define AST_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define AST_PAUSE BUTTON_PLAY -#define AST_QUIT BUTTON_BACK -#define AST_THRUST BUTTON_UP -#define AST_HYPERSPACE BUTTON_DOWN -#define AST_LEFT BUTTON_LEFT -#define AST_RIGHT BUTTON_RIGHT -#define AST_FIRE BUTTON_SELECT - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define AST_PAUSE (BUTTON_PLAY | BUTTON_REL) #define AST_QUIT BUTTON_POWER diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 5a7cff70ef..856a2af51a 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -242,23 +242,6 @@ #define STAR_QUIT BUTTON_POWER #define STAR_QUIT_NAME "POWER" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define STAR_QUIT BUTTON_BACK -#define STAR_LEFT BUTTON_LEFT -#define STAR_RIGHT BUTTON_RIGHT -#define STAR_UP BUTTON_UP -#define STAR_DOWN BUTTON_DOWN -#define STAR_TOGGLE_CONTROL BUTTON_PLAY -#define STAR_LEVEL_UP (BUTTON_CUSTOM | BUTTON_UP) -#define STAR_LEVEL_DOWN (BUTTON_CUSTOM | BUTTON_DOWN) -#define STAR_LEVEL_REPEAT (BUTTON_CUSTOM | BUTTON_RIGHT) -#define STAR_TOGGLE_CONTROL_NAME "PLAY" -#define STAR_QUIT_NAME "BACK" -#define STAR_LEVEL_UP_NAME "CUSTOM+UP" -#define STAR_LEVEL_DOWN_NAME "CUSTOM+DOWN" -#define STAR_LEVEL_REPEAT_NAME "CUSTOM+RIGHT" - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define STAR_QUIT BUTTON_POWER diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c index 7a9737815f..d7ae418611 100644 --- a/apps/plugins/stopwatch.c +++ b/apps/plugins/stopwatch.c @@ -123,14 +123,6 @@ #elif CONFIG_KEYPAD == COWON_D2_PAD #define STOPWATCH_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define STOPWATCH_QUIT BUTTON_BACK -#define STOPWATCH_START_STOP BUTTON_PLAY -#define STOPWATCH_RESET_TIMER BUTTON_SELECT -#define STOPWATCH_LAP_TIMER BUTTON_CUSTOM -#define STOPWATCH_SCROLL_UP BUTTON_UP -#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define STOPWATCH_QUIT BUTTON_POWER #define STOPWATCH_START_STOP (BUTTON_PLAY|BUTTON_REL) diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h index 2ed792872a..8df6fcb870 100644 --- a/apps/plugins/sudoku/sudoku.h +++ b/apps/plugins/sudoku/sudoku.h @@ -181,16 +181,6 @@ #define SUDOKU_BUTTON_QUIT BUTTON_POWER #define SUDOKU_BUTTON_MENU BUTTON_MENU -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define SUDOKU_BUTTON_QUIT BUTTON_BACK -#define SUDOKU_BUTTON_UP BUTTON_UP -#define SUDOKU_BUTTON_DOWN BUTTON_DOWN -#define SUDOKU_BUTTON_LEFT BUTTON_LEFT -#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT -#define SUDOKU_BUTTON_TOGGLE BUTTON_SELECT -#define SUDOKU_BUTTON_MENU BUTTON_MENU -#define SUDOKU_BUTTON_POSSIBLE BUTTON_PLAY - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define SUDOKU_BUTTON_QUIT BUTTON_POWER #define SUDOKU_BUTTON_UP BUTTON_UP diff --git a/apps/plugins/test_mem.c b/apps/plugins/test_mem.c index 3e5b8283b0..e7eb08608f 100644 --- a/apps/plugins/test_mem.c +++ b/apps/plugins/test_mem.c @@ -36,7 +36,7 @@ static int loop_repeat_dram = LOOP_REPEAT_DRAM; static volatile int buf_dram[BUF_SIZE] MEM_ALIGN_ATTR; -#if defined(PLUGIN_USE_IRAM) +#if defined(USE_IRAM) #if PLUGIN_BUFFER_SIZE <= 0x8000 #define IBUF_SIZE (1<<12) /* 16 KB = (1<<12)*sizeof(int) */ @@ -231,7 +231,7 @@ enum plugin_status plugin_start(const void* parameter) ret |= test(buf_dram, BUF_SIZE, loop_repeat_dram, MEMSET); ret |= test(buf_dram, BUF_SIZE, loop_repeat_dram, MEMCPY); if (ret != 0 && loop_repeat_dram < MAX_REPEAT_DRAM) loop_repeat_dram *= 2; -#if defined(PLUGIN_USE_IRAM) +#if defined(USE_IRAM) TEST_MEM_PRINTF("IRAM cnt: %d size: %d MB", loop_repeat_iram, (loop_repeat_iram*BUF_SIZE*sizeof(buf_iram[0]))>>20); ret = 0; diff --git a/apps/plugins/text_viewer/tv_button.h b/apps/plugins/text_viewer/tv_button.h index 10a2b3ee3e..a7a38221d0 100644 --- a/apps/plugins/text_viewer/tv_button.h +++ b/apps/plugins/text_viewer/tv_button.h @@ -236,17 +236,6 @@ #define TV_SCROLL_DOWN BUTTON_PLUS #define TV_BOOKMARK (BUTTON_MENU|BUTTON_PLUS) -/* Creative Zen Vision:M keys */ -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define TV_QUIT BUTTON_BACK -#define TV_SCROLL_UP BUTTON_UP -#define TV_SCROLL_DOWN BUTTON_DOWN -#define TV_SCREEN_LEFT BUTTON_LEFT -#define TV_SCREEN_RIGHT BUTTON_RIGHT -#define TV_MENU BUTTON_MENU -#define TV_AUTOSCROLL BUTTON_SELECT -#define TV_BOOKMARK BUTTON_PLAY - /* Creative Zen X-Fi3 keys */ #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define TV_QUIT BUTTON_POWER diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index f52ac140fe..d18b6a658c 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -181,17 +181,6 @@ #define LABEL_QUIT "POWER" #define LABEL_MENU "MENU" -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define VUMETER_QUIT BUTTON_BACK -#define VUMETER_HELP BUTTON_SELECT -#define VUMETER_MENU BUTTON_MENU -#define VUMETER_UP BUTTON_UP -#define VUMETER_DOWN BUTTON_DOWN -#define LABEL_HELP "MIDDLE" -#define LABEL_QUIT "BACK" -#define LABEL_MENU "MENU" -#define LABEL_VOLUME "UP/DOWN" - #elif (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) #define VUMETER_QUIT BUTTON_POWER #define VUMETER_HELP BUTTON_MENU|BUTTON_REPEAT diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 5002ca8790..c02234d500 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -175,16 +175,6 @@ static long max_cycle; #define BTN_QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define BTN_DIR_UP BUTTON_UP -#define BTN_DIR_DOWN BUTTON_DOWN -#define BTN_DIR_LEFT BUTTON_LEFT -#define BTN_DIR_RIGHT BUTTON_RIGHT -#define BTN_STARTPAUSE BUTTON_PLAY -#define BTN_QUIT BUTTON_BACK -#define BTN_STOPRESET BUTTON_MENU - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define BTN_DIR_UP BUTTON_UP diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index b8b883709f..f82cde1c32 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -146,15 +146,6 @@ #define QUIT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define QUIT BUTTON_BACK -#define LEFT BUTTON_LEFT -#define RIGHT BUTTON_RIGHT -#define UP BUTTON_UP -#define DOWN BUTTON_DOWN -#define PAUSE BUTTON_PLAY - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_BACK diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h index 94472d4e15..0bb7d3e80f 100644 --- a/apps/plugins/zxbox/keymaps.h +++ b/apps/plugins/zxbox/keymaps.h @@ -102,14 +102,6 @@ #elif CONFIG_KEYPAD == COWON_D2_PAD #define ZX_MENU (BUTTON_MENU|BUTTON_REL) -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define ZX_UP BUTTON_UP -#define ZX_DOWN BUTTON_DOWN -#define ZX_LEFT BUTTON_LEFT -#define ZX_RIGHT BUTTON_RIGHT -#define ZX_SELECT BUTTON_SELECT -#define ZX_MENU BUTTON_MENU - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define ZX_UP BUTTON_UP #define ZX_DOWN BUTTON_DOWN diff --git a/apps/plugins/zxbox/zxbox.make b/apps/plugins/zxbox/zxbox.make index 4638d5f0a2..1ee64d6fb5 100644 --- a/apps/plugins/zxbox/zxbox.make +++ b/apps/plugins/zxbox/zxbox.make @@ -45,7 +45,7 @@ $(ZXBOX_OBJDIR)/zxbox.ovl: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(ZXBOX_LDFLAGS) - $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) + $(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@) # special pattern rule for compiling zxbox with extra flags $(ZXBOX_OBJDIR)/%.o: $(ZXBOX_SRCDIR)/%.c $(ZXBOX_SRCDIR)/zxbox.make diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c index 2eb7feaa06..6a5c2a6c81 100644 --- a/apps/plugins/zxbox/zxbox_keyb.c +++ b/apps/plugins/zxbox/zxbox_keyb.c @@ -102,15 +102,6 @@ #define KBD_ABORT BUTTON_POWER -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD - -#define KBD_SELECT BUTTON_SELECT -#define KBD_ABORT BUTTON_BACK -#define KBD_LEFT BUTTON_LEFT -#define KBD_RIGHT BUTTON_RIGHT -#define KBD_UP BUTTON_UP -#define KBD_DOWN BUTTON_DOWN - #elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD #define KBD_SELECT (BUTTON_PLAY|BUTTON_REL) diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index 9ed8f3f12f..22fbbb2395 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c @@ -472,6 +472,37 @@ int kbd_input(char* text, int buflen, ucschar_t *kbd) } else #endif /* LCD_WIDTH >= 160 && LCD_HEIGHT >= 96 */ +#if (LCD_WIDTH == 128 && LCD_HEIGHT == 64) || (LCD_WIDTH == 96 && LCD_HEIGHT == 96) +/* CLIP PLUS & XDUOO X3 || CLIP ZIP*/ + { + p = "ABCDEFG !?\" $%+'\n" + "HIJKLMN 789 &_-`\n" + "OPQRSTU 456 §|/\n" + "VWXYZ.,0123 ~=*#\n" + + "abcdefg ¢£¤¥¦§©®\n" + "hijklmn «»ºª¹²³\n" + "opqrstu ¯±×÷¡¿µ·\n" + "vwxyz.,¨:;¼½¾¬¶°\n" + + "< ({[-*?\"!'@#$%\n" + "> )}]+/\\=& 789_`\n" + "¢£¤¥¦§©®¬§ 456x|\n" + "«»°ºª¹²³¶.,0123~\n" + + "ÀÁÂÃÄÅÆ ÌÍÎÏÈÉÊË\n" + "àáâãäåæ ìíîïèéêë\n" + "ÓÒÔÕÖØ ÇÐÞÝßÙÚÛÜ\n" + "òóôõöø çðþýÿùúûü"; + +#if ((LCD_WIDTH == 128 && LCD_HEIGHT == 64)) + pm->default_lines = 4; +#else + pm->default_lines = 8; +#endif + pm->max_line_len = 16; + } +#else { p = "ABCDEFG !?\" @#$%+'\n" "HIJKLMN 789 &_()-`\n" @@ -491,7 +522,7 @@ int kbd_input(char* text, int buflen, ucschar_t *kbd) pm->default_lines = 4; pm->max_line_len = 18; } - +#endif pbuf = pm->kbd_buf; while (*p) { diff --git a/apps/voice_thread.c b/apps/voice_thread.c index 0f0d89c24e..b31bc5bc76 100644 --- a/apps/voice_thread.c +++ b/apps/voice_thread.c @@ -97,7 +97,7 @@ static const char voice_thread_name[] = "voice"; /* Voice thread synchronization objects */ static struct event_queue voice_queue SHAREDBSS_ATTR; static struct queue_sender_list voice_queue_sender_list SHAREDBSS_ATTR; -static int quiet_counter SHAREDDATA_ATTR = 0; +static int quiet_counter SHAREDBSS_ATTR; static bool voice_playing = false; #define VOICE_PCM_FRAME_COUNT ((PLAY_SAMPR_MAX*VOICE_FRAME_COUNT + \ diff --git a/bootloader/SOURCES b/bootloader/SOURCES index 1221e044c1..8510479739 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES @@ -19,14 +19,12 @@ show_logo.c defined(MROBE_100) || defined(PHILIPS_SA9200) || \ defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) || \ defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || \ - defined(SAMSUNG_YH925) || defined(SANSA_VIEW) + defined(SAMSUNG_YH925) #ifdef E200R_INSTALLER main-e200r-installer.c #elif defined(SANSA_PP_ERASE) main-ppsansawipe.c fat32format.c -#elif defined(SANSA_VIEW) -sansaview.c #else show_logo.c main-pp.c @@ -42,33 +40,17 @@ mrobe500.c #elif defined(CPU_TCC780X) telechips.c show_logo.c -#elif defined(MEIZU_M6SL) -meizu_m6sl.c -#elif defined(MEIZU_M6SP) -meizu_m6sp.c -#elif defined(MEIZU_M3) -meizu_m3.c -#elif defined(SAMSUNG_YPS3) -samsung_yps3.c #elif defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX767) || defined(ONDA_VX777) ondavx747.c show_logo.c #elif defined(XDUOO_X3) xduoox3.c show_logo.c -#elif defined(CREATIVE_ZVx) -creativezvm.c #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 sansa_as3525.c show_logo.c #elif CONFIG_CPU==IMX233 imx233.c -#elif defined(LYRE_PROTO1) -lyre_proto1.c -show_logo.c -#elif defined(MINI2440) -mini2440.c -show_logo.c #elif defined(PBELL_VIBE500) main-pp.c show_logo.c diff --git a/bootloader/creativezvm.c b/bootloader/creativezvm.c deleted file mode 100644 index db7a8c7459..0000000000 --- a/bootloader/creativezvm.c +++ /dev/null @@ -1,120 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* 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. -* -****************************************************************************/ - -#include "system.h" -#include "lcd.h" -#include "../kernel-internal.h" -#include "storage.h" -#include "ata-target.h" -#include "file_internal.h" -#include "disk.h" -#include "font.h" -#include "backlight.h" -#include "button.h" -#include "common.h" -#include "loader_strerror.h" -#include "rb-loader.h" -#include "usb.h" -#include "version.h" - - -static void load_fw(unsigned char* ptr, unsigned int len) -{ - (void)ptr; - (void)len; - asm volatile("ldr pc, =0x1EE0000"); -} - -void main(void) -{ - unsigned char* loadbuffer; - int buffer_size; - int(*kernel_entry)(void); - int ret; - - /* Make sure interrupts are disabled */ - set_irq_level(IRQ_DISABLED); - set_fiq_status(FIQ_DISABLED); - system_init(); - kernel_init(); - - /* Now enable interrupts */ - set_irq_level(IRQ_ENABLED); - set_fiq_status(FIQ_ENABLED); - lcd_init(); - backlight_init(); /* BUGFIX backlight_init MUST BE AFTER lcd_init */ - font_init(); - button_init(); - usb_init(); - -#ifdef HAVE_LCD_ENABLE - lcd_enable(true); -#endif - lcd_setfont(FONT_SYSFIXED); - reset_screen(); - printf("Rockbox boot loader"); - printf("Version %s", rbversion); - - ret = storage_init(); - if(ret) - printf("ATA error: %d", ret); - - filesystem_init(); - - /* If no button is held, start the OF */ - if(button_read_device() == 0) - { - printf("Loading Creative firmware..."); - - loadbuffer = (unsigned char*)0x00A00000; - ret = load_minifs_file("creativeos.jrm", loadbuffer); - if(ret != -1) - { - set_irq_level(IRQ_DISABLED); - set_fiq_status(FIQ_DISABLED); - /* Doesn't return! */ - load_fw(loadbuffer, ret); - } - else - printf("FAILED!"); - } - else - { - ret = disk_mount_all(); - if (ret <= 0) - error(EDISK, ret, true); - - printf("Loading Rockbox firmware..."); - - loadbuffer = (unsigned char*)0x00900000; - buffer_size = (unsigned char*)0x01900000 - loadbuffer; - - ret = load_firmware(loadbuffer, BOOTFILE, buffer_size); - if(ret <= EFILE_EMPTY) - error(EBOOTFILE, ret, true); - - kernel_entry = (void*) loadbuffer; - ret = kernel_entry(); - printf("FAILED!"); - } - - storage_sleepnow(); - - while(1); -} diff --git a/bootloader/echoplayer.c b/bootloader/echoplayer.c index 6f742aec50..97b5ec2749 100644 --- a/bootloader/echoplayer.c +++ b/bootloader/echoplayer.c @@ -34,6 +34,7 @@ #include "rbversion.h" #include "system-echoplayer.h" #include "gpio-stm32h7.h" +#include "regs/cortex-m/cm_debug.h" #define SDRAM_SIZE (MEMORYSIZE * 1024 * 1024) @@ -136,6 +137,14 @@ static bool is_usbmode_button_pressed(void) return button_status() & BUTTON_DOWN; } +static bool is_sysdebug_button_pressed(void) +{ + const int mask = BUTTON_A | BUTTON_B; + + /* Both buttons must be held */ + return (button_status() & mask) == mask; +} + static int send_event_on_tmo(struct timeout *tmo) { button_queue_post(tmo->data, 0); @@ -370,6 +379,13 @@ void main(void) power_init(); button_init(); + /* Enable system debugging if button combo held or debugger attached */ + if (reg_readf(CM_DEBUG_DHCSR, C_DEBUGEN) || + is_sysdebug_button_pressed()) + { + system_debug_enable(true); + } + /* Start monitoring power button / usb state */ monitor_init(); diff --git a/bootloader/lyre_proto1.c b/bootloader/lyre_proto1.c deleted file mode 100644 index 6ad095170c..0000000000 --- a/bootloader/lyre_proto1.c +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 Standard files */ -#include "../kernel-internal.h" -#include "system.h" - -int main(void) -{ - /* Initialize Rockbox kernel */ - kernel_init(); - - /* Never returns */ - while(1) ; -} diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c index 0bd4dcbca0..581f486a21 100644 --- a/bootloader/main-pp.c +++ b/bootloader/main-pp.c @@ -265,8 +265,8 @@ static int handle_usb(int connect_timeout) return usb; } -#elif (defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) \ - || defined (SANSA_VIEW)) && !defined(USE_ROCKBOX_USB) +#elif (defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200)) && \ + !defined(USE_ROCKBOX_USB) /* Return USB_INSERTED if cable present */ static int handle_usb(int connect_timeout) { diff --git a/bootloader/meizu_m3.c b/bootloader/meizu_m3.c deleted file mode 100644 index bbe3d77deb..0000000000 --- a/bootloader/meizu_m3.c +++ /dev/null @@ -1,220 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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 -#include -#include -#include - -#include "config.h" - -#include "inttypes.h" -#include "cpu.h" -#include "system.h" -#include "lcd.h" -#include "../kernel-internal.h" -#include "storage.h" -#include "disk.h" -#include "font.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 "bitmaps/rockboxlogo.h" - -#include "i2c-s5l8700.h" -#include "dma-target.h" -#include "pcm.h" -#include "audiohw.h" -#include "rtc.h" -#include "time.h" - -#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 post_mortem_stub(void) -{ -} - -void main(void) -{ - char mystring[64]; - int i; - unsigned short data = 0; - char write_data[2], read_data[16]; - struct tm tm; - - //Set backlight pin to output and enable - int oldval = PCON0; - PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); - PDAT0 |= (1 << 2); - - // Set codec reset pin inactive - PCON5 = (PCON5 & ~0xF) | 1; - PDAT5 &= ~(1 << 0); - - //power on -// oldval = PCON1; -// PCON1 = ((oldval & ~(0xf << 12)) | (1 << 12)); -// PDAT1|=(1<<3); - - //Set PLAY to EINT4 - oldval = PCON1; - PCON1 = ((oldval & ~(0xf << 16)) | (2 << 16)); - - //Set MENU to EINT0 - oldval = PCON1; - PCON1 = (oldval & ~(0xf)) | 2; - - // enable external interrupts - EINTPOL = 0x11; - INTMSK = 0x11; - EINTMSK = 0x11; - asm volatile("msr cpsr_c, #0x13\n\t"); // enable interrupts - - system_init(); - kernel_init(); - - lcd_init(); - backlight_init(); /* BUGFIX backlight_init MUST BE AFTER lcd_init */ - lcd_update(); - - i2c_init(); - - init_qt1106(); - - /* Calibrate the lot */ - qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF | QT1106_DI \ - | QT1106_SLD_SLIDER | QT1106_CAL_WHEEL | QT1106_CAL_KEYS | QT1106_RES_256); - - lcd_clear_display(); - lcd_bitmap(rockboxlogo, 0, 30, BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo); - lcd_update(); - - /* Set to maximum sensitivity */ - qt1106_io(QT1106_CT | (0x00 << 8) ); - - while(true) - { -#if 1 /* enable this to see info about the slider touchpad */ - qt1106_wait(); - - int slider = qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF \ - | QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_256); - snprintf(mystring, 64, "%x %2.2x",(slider & 0x008000)>>15, slider&0xff); - lcd_puts(0,1,mystring); - backlight_hw_brightness((slider & 0xFF) >> 4); - - /* - if(slider & 0x008000) - bl_debug_count(((slider&0xff)) + 1); - */ -#endif - -#if 1 /* enable this to see info about the RTC */ - rtc_read_datetime(&tm); - snprintf(mystring, 64, "%04d-%02d-%02d %02d:%02d:%02d", - tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); - lcd_puts(0, 10, mystring); -#endif - -#if 1 /* enable this so see info about the UDA1380 codec */ - memset(read_data, 0, sizeof(read_data)); - for (i = 0; i < 7; i++) { - write_data[0] = i; - i2c_read(0x30, i, 2, read_data); - data = read_data[0] << 8 | read_data[1]; - snprintf(mystring + 4 * i, 64, "%04X", data); - } - lcd_puts(0, 11, mystring); -#endif - -#if 1 /* enable this to see info about IODMA channel 0 (PCM) */ - snprintf(mystring, 64, "DMA: %08X %08X", (int)DMACADDR0, (int)DMACTCNT0); - lcd_puts(0, 12, mystring); -#endif -#if 1 /* enable this to see info about IIS */ - snprintf(mystring, 64, "IIS: %08X", (int)I2SSTATUS); - lcd_puts(0, 13, mystring); -#endif - - lcd_update(); - } - - //power off - PDAT1&=~(1<<3); -} - diff --git a/bootloader/meizu_m6sl.c b/bootloader/meizu_m6sl.c deleted file mode 100644 index 073c57cb0d..0000000000 --- a/bootloader/meizu_m6sl.c +++ /dev/null @@ -1,153 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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 "storage.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 - -#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); -} - -/* These functions are supposed to be static in lcd-m6sl.c, but - we use them here for testing */ -void init_lcd_spi(void); -unsigned int lcd_read_id(void); - -void main(void) -{ - //Set backlight pin to output and enable - unsigned int model; - 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); - - init_lcd_spi(); - model=lcd_read_id(); - bl_debug_count((model&0xf000)>>12); - bl_debug_count((model&0xf00)>>8); - bl_debug_count((model&0xf0)>>4); - bl_debug_count(model&0xf); - - /* 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 deleted file mode 100644 index 0a6dc274d9..0000000000 --- a/bootloader/meizu_m6sp.c +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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 "storage.h" -#include "disk.h" -#include "font.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 "bitmaps/rockboxlogo.h" - -#include - -#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)); - - lcd_bitmap(rockboxlogo, 0, 0, BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo); - lcd_init_device(); - - // 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/bootloader/mini2440.c b/bootloader/mini2440.c deleted file mode 100644 index 3556fb0633..0000000000 --- a/bootloader/mini2440.c +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins, Lyre Project - * - * 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 Standard files */ -#include -#include -#include "inttypes.h" -#include "string.h" -#include "cpu.h" -#include "system.h" -#include "lcd.h" -#include "../kernel-internal.h" -#include "storage.h" -#include "file_internal.h" -#include "disk.h" -#include "font.h" -#include "backlight.h" -#include "button.h" -#include "panic.h" -#include "power.h" -#include "file.h" -#include "common.h" -#include "rb-loader.h" -#include "loader_strerror.h" -#include "sd.h" -#include "backlight-target.h" -#include "lcd-target.h" -#include "dma-target.h" -#include "uart-s3c2440.h" -#include "led-mini2440.h" -#include "version.h" - - -int main(void) -{ - unsigned char* loadbuffer; - int buffer_size; - int rc; - int(*kernel_entry)(void); - - led_init(); - clear_leds(LED_ALL); - /* NB: something in system_init() prevents H-JTAG from downloading */ -/* system_init(); */ - kernel_init(); -/* enable_interrupt(IRQ_FIQ_STATUS); */ - lcd_init(); - backlight_init(); /* BUGFIX backlight_init MUST BE AFTER lcd_init */ - lcd_setfont(FONT_SYSFIXED); - button_init(); - dma_init(); - - uart_init(); - uart_init_device(DEBUG_UART_PORT); - -/* mini2440_test(); */ - - /* Show debug messages if button is pressed */ - int touch_data; - if(button_read_device(&touch_data) & BUTTON_MENU) - verbose = true; - - printf("Rockbox boot loader"); - printf("Version %s", rbversion); - - rc = storage_init(); - if(rc) - { - reset_screen(); - error(EATA, rc, true); - } - - filesystem_init(); - rc = disk_mount_all(); - if (rc<=0) - { - error(EDISK,rc, true); - } - - printf("Loading firmware"); - - /* Flush out anything pending first */ - commit_discard_idcache(); - - loadbuffer = (unsigned char*) 0x31000000; - buffer_size = (unsigned char*)0x31400000 - loadbuffer; - - rc = load_firmware(loadbuffer, BOOTFILE, buffer_size); - if(rc <= 0) - error(EBOOTFILE, rc, true); - - printf("Loaded firmware %d\n", rc); - -/* storage_close(); */ - system_prepare_fw_start(); - - commit_discard_idcache(); - kernel_entry = (void*) loadbuffer; - rc = kernel_entry(); - - /* end stop - should not get here */ - led_flash(LED_ALL, LED_NONE); - while (1); /* avoid warning */ -} diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c index 245bd51c9b..57356ab71d 100644 --- a/bootloader/mrobe500.c +++ b/bootloader/mrobe500.c @@ -61,7 +61,9 @@ void main(void) backlight_init(); font_init(); button_init(); +#ifdef HAVE_BOOTLOADER_USB_MODE usb_init(); +#endif power_init(); @@ -79,6 +81,7 @@ void main(void) printf("Rockbox boot loader"); printf("Version %s", rbversion); +#ifdef HAVE_BOOTLOADER_USB_MODE /* Enter USB mode without USB thread */ if(usb_detect() == USB_INSERTED) { @@ -104,6 +107,7 @@ void main(void) reset_screen(); lcd_update(); } +#endif sleep(50); diff --git a/bootloader/sansaview.c b/bootloader/sansaview.c deleted file mode 100644 index 31716d4b25..0000000000 --- a/bootloader/sansaview.c +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2014 by Szymon Dziok - * - * 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. - * - ****************************************************************************/ - -/* -SANSA VIEW: TESTING CODE -*/ - - -#include -#include -#include -#include -#include "config.h" -#include "inttypes.h" -#include "cpu.h" -#include "system.h" -#include "lcd.h" -#include "../kernel-internal.h" -#include "storage.h" -#include "disk.h" -#include "font.h" -#include "backlight.h" -#include "backlight-target.h" -#include "button.h" -#include "panic.h" -#include "power.h" -#include "file.h" -#include "common.h" - -void main(void) -{ - system_init(); - kernel_init(); - disable_irq(); - - while(1) - { - backlight_hw_on(); - buttonlight_hw_off(); - sleep(HZ/4); - backlight_hw_off(); - buttonlight_hw_on(); - sleep(HZ/4); - } -} diff --git a/bootloader/x1000/utils.c b/bootloader/x1000/utils.c index fecf7908d1..5aeb0d8a25 100644 --- a/bootloader/x1000/utils.c +++ b/bootloader/x1000/utils.c @@ -437,15 +437,29 @@ static int dump_flash_onfi_info(int fd) nand_enable_otp(ndrv, true); + int i; + bool is_onfi; + uint8_t* buf = ndrv->page_buf; + /* read ONFI parameter page */ - ret = nand_page_read(ndrv, 0x01, ndrv->page_buf); - if(ret != NAND_SUCCESS) { - splashf(5*HZ, "Dump failed\nNAND read error"); + for (i = 1; i <= 4; i++) { + ret = nand_page_read(ndrv, i, ndrv->page_buf); + if(ret != NAND_SUCCESS) { + splashf(5*HZ, "Dump failed\nNAND read error"); + goto out; + } + + is_onfi = buf[0] == 'O' && buf[1] == 'N' && buf[2] == 'F' && buf[3] == 'I'; + if (is_onfi) + break; + } + + if(!is_onfi) { + fdprintf(fd, "No ONFI Page!"); goto out; } - uint8_t* buf = ndrv->page_buf; - + fdprintf(fd, "ONFI Page = %02x\n", i); fdprintf(fd, "signature = %08lx\n", load_le32(buf)); fdprintf(fd, "revision = %04x\n", load_le16(buf+4)); diff --git a/bootloader/x1000/x1000bootloader.h b/bootloader/x1000/x1000bootloader.h index 0b5b02969d..44e56cda80 100644 --- a/bootloader/x1000/x1000bootloader.h +++ b/bootloader/x1000/x1000bootloader.h @@ -100,14 +100,14 @@ struct uimage_header; # define BL_QUIT_NAME "POWER" # define BL_SCREENSHOT_NAME "MENU" # define BOOTBACKUP_FILE "/erosqnative-boot.bin" -# define OF_PLAYER_NAME "Aigo Player" +# define OF_PLAYER_NAME "Hiby Player" # define OF_PLAYER_ADDR 0x300000 # define OF_PLAYER_LENGTH (6 * 1024 * 1024) # define OF_PLAYER_ARGS OF_RECOVERY_ARGS \ " init=/linuxrc ubi.mtd=4 root=ubi0:rootfs ubi.mtd=5 rootfstype=ubifs \ sn_no=00000000000000000000000000000000 bt_mac=xxxxxxxxxxxx wifi_mac=xxxxxxxxxxxx rw" # define OF_PLAYER_BTN BUTTON_PLAY -# define OF_RECOVERY_NAME "Aigo Recovery" +# define OF_RECOVERY_NAME "HibyOS Recovery" # define OF_RECOVERY_ADDR 0x900000 # define OF_RECOVERY_LENGTH (7 * 1024 * 1024) # define OF_RECOVERY_ARGS \ diff --git a/docs/CREDITS b/docs/CREDITS index b2e8465938..20c4874544 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -754,6 +754,8 @@ Melissa Autumn Sho Tanimoto Nyx Guan Arin Kim +Ingmar Steen +Lourenço Soares The libmad team The wavpack team diff --git a/docs/PLUGIN_API b/docs/PLUGIN_API index f8bf383896..337a2c6752 100644 --- a/docs/PLUGIN_API +++ b/docs/PLUGIN_API @@ -107,11 +107,6 @@ int audio_get_file_pos(void) \return \description -void audio_hard_stop(void) - \group playback control - \conditions (defined(PLUGIN_USE_IRAM)) - \description - void audio_next(void) \group playback control \description diff --git a/firmware/SOURCES b/firmware/SOURCES index d62b8d254c..fbd92742ba 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -483,8 +483,6 @@ drivers/rtc/rtc_jz4740.c drivers/rtc/rtc_jz4760.c #elif (CONFIG_RTC == RTC_X1000) drivers/rtc/rtc_x1000.c -#elif (CONFIG_RTC == RTC_S35390A) -drivers/rtc/rtc_s35390a.c #elif (CONFIG_RTC == RTC_S35380A) drivers/rtc/rtc_s35380a.c #elif (CONFIG_RTC == RTC_D2) @@ -931,7 +929,7 @@ target/arm/ipod/lcd-color_nano.c target/arm/ipod/lcd-gray.c #elif CONFIG_LCD == LCD_GIGABEATS target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c -#elif CONFIG_LCD == LCD_GIGABEAT || CONFIG_LCD == LCD_MINI2440 +#elif CONFIG_LCD == LCD_GIGABEAT target/arm/s3c2440/lcd-s3c2440.c #elif CONFIG_LCD == LCD_ILI9342 || CONFIG_LCD == LCD_ILI9342C target/arm/rk27xx/ma/lcd-ma.c @@ -949,8 +947,7 @@ target/arm/s5l8702/lcd-asm-s5l8702.S #endif /* USB Stack */ -// TODO: This needs to be HAVE_USBSTACK && (!BOOTLOADER || HAVE_USB_BOOTLOADER_MODE) -#ifdef HAVE_USBSTACK +#if defined(HAVE_USBSTACK) && (!defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE)) usbstack/usb_core.c #ifdef USB_ENABLE_STORAGE usbstack/usb_storage.c @@ -987,6 +984,8 @@ target/arm/rk27xx/usb-drv-rk27xx.c drivers/isp1362.c #elif CONFIG_USBOTG == USBOTG_M5636 drivers/m5636.c +#elif CONFIG_USBOTG == USBOTG_ARC +target/arm/usb-drv-arc.c #endif #endif /* !defined(HAVE_USBSTACK) */ @@ -1076,18 +1075,6 @@ target/arm/sandisk/sansa-c200/button-c200.c target/arm/sandisk/sansa-c200/powermgmt-c200.c #endif /* SANSA_C200 */ -#ifdef SANSA_VIEW -target/arm/sandisk/sansa-view/backlight-view.c -target/arm/sandisk/sansa-view/adc-view.c -target/arm/sandisk/sansa-view/power-view.c -target/arm/sandisk/sansa-view/lcd-view.c -target/arm/sandisk/sansa-view/button-view.c -target/arm/sandisk/sansa-view/powermgmt-view.c -#ifndef BOOTLOADER -/* target/arm/sandisk/audio-view.c */ -#endif /* BOOTLOADER */ -#endif /* SANSA_VIEW */ - #ifdef PHILIPS_SA9200 #ifndef BOOTLOADER drivers/synaptics-mep.c @@ -1178,10 +1165,6 @@ target/coldfire/iaudio/audio-iaudio.c #endif #endif /* IAUDIO_M3 */ -#ifdef STUB -libc/sscanf.c -#endif /* STUB */ - #if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) target/coldfire/iriver/ata-iriver.c target/coldfire/iriver/lcd-remote-iriver.c @@ -1319,22 +1302,11 @@ target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c target/arm/tms320dm320/mrobe-500/pcm-mr500.c target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c target/arm/tms320dm320/mrobe-500/power-mr500.c +#if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE) target/arm/tms320dm320/mrobe-500/usb-mr500.c +#endif #endif /* MROBE_500 */ -#ifdef CREATIVE_ZVx -drivers/lcd-memframe.c -target/arm/tms320dm320/creative-zvm/adc-creativezvm.c -target/arm/tms320dm320/creative-zvm/ata-creativezvm.c -target/arm/tms320dm320/creative-zvm/dma-creativezvm.c -target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c -target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c -target/arm/tms320dm320/creative-zvm/pic-creativezvm.c -target/arm/tms320dm320/creative-zvm/power-creativezvm.c -target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c -target/arm/tms320dm320/creative-zvm/usb-creativezvm.c -#endif /* CREATIVE_ZVx */ - #if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) \ || defined(CREATIVE_ZENV) || defined(CREATIVE_ZENXFISTYLE) #ifndef BOOTLOADER @@ -1604,37 +1576,6 @@ target/arm/tcc780x/cowond2/audio-cowond2.c #endif /* BOOTLOADER */ #endif /* COWON_D2 */ -#ifdef MEIZU_M6SL -target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c -drivers/qt1106.c -#endif /* MEIZU_M6SL */ - -#ifdef MEIZU_M6SP -target/arm/s5l8700/backlight-meizu.c -target/arm/s5l8700/power-meizu.c -target/arm/s5l8700/meizu-m6sp/button-m6sp.c -target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c -#ifndef BOOTLOADER -drivers/generic_i2c.c -drivers/rtc/rtc_s35390a.c -target/arm/s5l8700/audio-meizu.c -target/arm/s5l8700/ftl-meizu.c -target/arm/s5l8700/nand-meizu.c -target/arm/s5l8700/fmradio-i2c-meizu.c -target/arm/s5l8700/powermgmt-meizu.c -target/arm/s5l8700/usb-s5l8700.c -#endif /* BOOTLOADER */ -#endif /* MEIZU_M6SP */ - -#ifdef MEIZU_M3 -target/arm/s5l8700/backlight-meizu.c -target/arm/s5l8700/meizu-m3/lcd-m3.c -drivers/qt1106.c -#ifndef BOOTLOADER -target/arm/s5l8700/udacodec-meizu.c -#endif /* BOOTLOADER */ -#endif /* MEIZU_M3 */ - #ifdef IPOD_NANO2G target/arm/ipod/button-clickwheel.c target/arm/s5l8700/postmortemstub.S @@ -1875,34 +1816,6 @@ target/mips/ingenic_x1000/erosqnative/power-erosqnative.c target/mips/ingenic_x1000/spl-nand-x1000.c #endif /* EROS_QN */ -#if defined(LYRE_PROTO1) -target/arm/at91sam/lyre_proto1/adc-lyre_proto1.c -target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c -target/arm/at91sam/lyre_proto1/button-lyre_proto1.c -target/arm/at91sam/lyre_proto1/crt0.S -target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c -target/arm/at91sam/lyre_proto1/kernel-lyre_proto1.c -target/arm/at91sam/lyre_proto1/lcd-lyre_proto1.c -target/arm/at91sam/lyre_proto1/system-lyre_proto1.c -target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c -#endif - -#if defined(MINI2440) -drivers/lcd-memframe.c -target/arm/s3c2440/dma-s3c2440.c -target/arm/s3c2440/sd-s3c2440.c -target/arm/s3c2440/uart-s3c2440.c -target/arm/s3c2440/mini2440/backlight-mini2440.c -target/arm/s3c2440/mini2440/button-mini2440.c -target/arm/s3c2440/mini2440/led-mini2440.c -target/arm/s3c2440/mini2440/power-mini2440.c -target/arm/s3c2440/mini2440/touchscreen-mini2440.c -#ifndef BOOTLOADER -target/arm/s3c2440/mini2440/powermgmt-mini2440.c -target/arm/s3c2440/mini2440/pcm-mini2440.c -#endif -#endif /* MINI2440 */ - #if defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) target/arm/samsung/akcodec-yh82x_yh92x.c target/arm/samsung/button-yh82x_yh92x.c @@ -1932,15 +1845,6 @@ target/arm/samsung/yh925/powermgmt-yh925.c target/arm/samsung/fmradio-yh92x.c #endif /* SAMSUNG_YH925 */ -#ifdef SAMSUNG_YPS3 -target/arm/s5l8700/yps3/button-yps3.c -target/arm/s5l8700/yps3/lcd-yps3.c -target/arm/s5l8700/yps3/fmradio-i2c-yps3.c -target/arm/s5l8700/yps3/backlight-yps3.c -target/arm/s5l8700/yps3/nand-yps3.c -target/arm/s5l8700/yps3/power-yps3.c -#endif /* SAMSUNG_YPS3 */ - #ifdef PBELL_VIBE500 drivers/synaptics-mep.c target/arm/pbell/vibe500/lcd-vibe500.c @@ -2029,7 +1933,9 @@ target/arm/rk27xx/ihifi2/audio-ihifi800.c target/arm/stm32/crt0-stm32h7.S target/arm/stm32/vectors-stm32h7.S target/arm/stm32/adc-stm32h7.c +#ifndef BOOTLOADER target/arm/stm32/debug-stm32h7.c +#endif target/arm/stm32/gpio-stm32h7.c target/arm/stm32/i2c-stm32h7.c target/arm/stm32/pcm-stm32h7.c diff --git a/firmware/asm/SOURCES b/firmware/asm/SOURCES index dc8d7b5dfc..463c120213 100644 --- a/firmware/asm/SOURCES +++ b/firmware/asm/SOURCES @@ -21,8 +21,7 @@ arm/memmove.S arm/memset.S strlen.c #elif defined(CPU_ARM_MICRO) -memcpy.c -mempcpy.c +arm/memcpy-armv7m.S memmove.c arm/memset.S strlen.c @@ -50,8 +49,8 @@ mempcpy.c #endif #if (defined(SANSA_E200) || defined(GIGABEAT_F) || defined(GIGABEAT_S) || \ - defined(CREATIVE_ZVx) || defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \ - defined(COWON_D2) || defined(MINI2440) || defined(SAMSUNG_YPR0) || \ + defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \ + defined(COWON_D2) || defined(SAMSUNG_YPR0) || \ defined(SAMSUNG_YPR1) || defined(DX50) || defined(DX90) || (defined(MROBE_500) && !defined(LCD_USE_DMA)) || \ defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || \ defined(FIIO_M3K_LINUX)) && \ diff --git a/firmware/asm/arm/memcpy-armv7m.S b/firmware/asm/arm/memcpy-armv7m.S new file mode 100644 index 0000000000..7d2c671175 --- /dev/null +++ b/firmware/asm/arm/memcpy-armv7m.S @@ -0,0 +1,80 @@ +#include "config.h" + +#if (CONFIG_CPU == STM32H743) +# define CPU_SUPPORTS_UNALIGNED_ACCESS +#endif + + .syntax unified + .section .icode,"ax",%progbits + + .global memcpy + .type memcpy,%function + .global mempcpy + .type mempcpy,%function + + /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ + /* Prototype: void *mempcpy(void *dest, const void *src, size_t n); */ + + /* + * r0 = dest + * r1 = src + * r2 = n + * r3 = scratch + * ip = saved r0 + */ + +mempcpy: + add ip, r0, r2 + b 0f + +memcpy: + movs ip, r0 + +0: +#if !defined(CPU_SUPPORTS_UNALIGNED_ACCESS) + /* fall back to byte copy loop if operands not aligned */ + ands r3, r0, #3 + bne 5f + ands r3, r1, #3 + bne 5f +#endif + + /* check remaining bytes >= 16 */ + subs r2, r2, #16 + blt 2f + +1: /* copy 16-byte blocks */ + ldr r3, [r1, #0] + str r3, [r0, #0] + ldr r3, [r1, #4] + str r3, [r0, #4] + ldr r3, [r1, #8] + str r3, [r0, #8] + ldr r3, [r1, #12] + str r3, [r0, #12] + adds r0, #16 + adds r1, #16 + subs r2, r2, #16 + bge 1b + +2: /* get count of remaining bytes (0-15) */ + and r2, r2, #15 + +3: /* copy 4 bytes at a time */ + subs r2, r2, #4 + ldrge r3, [r1], #4 + strge r3, [r0], #4 + bgt 3b + +4: /* get count of remaining bytes (0-3) */ + and r2, #3 + +5: /* copy 1 byte at a time */ + subs r2, r2, #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + bgt 5b + +6: /* return */ + movs r0, ip + bx lr diff --git a/firmware/backlight.c b/firmware/backlight.c index e28793253b..a00483c070 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -199,7 +199,7 @@ static int lcd_sleep_timeout = 10*HZ; #define lcd_sleep_timeout LCD_SLEEP_TIMEOUT #endif -static int lcd_sleep_timer SHAREDDATA_ATTR = 0; +static int lcd_sleep_timer SHAREDBSS_ATTR; static void backlight_lcd_sleep_countdown(bool start) { diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c index c4c748d527..19212155b1 100644 --- a/firmware/drivers/audio/tlv320.c +++ b/firmware/drivers/audio/tlv320.c @@ -50,11 +50,7 @@ static int vol_tenthdb2hw(int db) } /* local functions and definations */ -#ifndef CREATIVE_ZVx #define TLV320_ADDR 0x34 -#else -#define TLV320_ADDR 0x1A -#endif static struct tlv320_info { @@ -133,11 +129,7 @@ void audiohw_init(void) audiohw_mute(true); tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM); tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */ -#ifndef CREATIVE_ZVx tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S); -#else - tlv320_write_reg(REG_DAIF, DAIF_IWL_32 | DAIF_FOR_DSP); -#endif tlv320_write_reg(REG_DIA, DIA_ACT); audiohw_set_frequency(-1); /* default */ } diff --git a/firmware/drivers/rtc/rtc_s35390a.c b/firmware/drivers/rtc/rtc_s35390a.c deleted file mode 100644 index 6e69073254..0000000000 --- a/firmware/drivers/rtc/rtc_s35390a.c +++ /dev/null @@ -1,111 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * Copyright (C) 2008 by Robert Kukla - * - * 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 "rtc.h" -#include "i2c-s5l8700.h" -#include "timefuncs.h" - -/* Driver for the Seiko S35390A real-time clock chip with i2c interface - - This driver was derived from rtc_mr100.c and adapted for the S35390A - used in the Meizu M3 (and possibly others). - */ - -#define RTC_ADDR 0x60 - -#define STATUS_REG1 0 -#define STATUS_REG2 1 -#define REALTIME_DATA1 2 -#define REALTIME_DATA2 3 -#define INT1_REG 4 -#define INT2_REG 5 -#define CLOCK_CORR_REG 6 -#define FREE_REG 7 - - -static void reverse_bits(unsigned char* v, int size) -{ - static const unsigned char flipnibble[] = - {0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E, - 0x01, 0x09, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F}; - int i; - - for (i = 0; i < size; i++) { - v[i] = (flipnibble[v[i] & 0x0F] << 4) | - flipnibble[(v[i] >> 4) & 0x0F]; - } -} - -void rtc_init(void) -{ -} - -int rtc_read_datetime(struct tm *tm) -{ - unsigned char buf[7]; - unsigned int i; - int ret; - - ret = i2c_read(RTC_ADDR | (REALTIME_DATA1 << 1), -1, sizeof(buf), buf); - reverse_bits(buf, sizeof(buf)); - - buf[4] &= 0x3f; /* mask out p.m. flag */ - - for (i = 0; i < sizeof(buf); i++) - buf[i] = BCD2DEC(buf[i]); - - tm->tm_sec = buf[6]; - tm->tm_min = buf[5]; - tm->tm_hour = buf[4]; - tm->tm_mday = buf[2]; - tm->tm_mon = buf[1] - 1; - tm->tm_year = buf[0] + 100; - - set_day_of_week(tm); - set_day_of_year(tm); - - return ret; -} - -int rtc_write_datetime(const struct tm *tm) -{ - unsigned char buf[7]; - unsigned int i; - int ret; - - buf[6] = tm->tm_sec; - buf[5] = tm->tm_min; - buf[4] = tm->tm_hour; - buf[3] = tm->tm_wday; - buf[2] = tm->tm_mday; - buf[1] = tm->tm_mon + 1; - buf[0] = tm->tm_year - 100; - - for (i = 0; i < sizeof(buf); i++) - buf[i] = DEC2BCD(buf[i]); - - reverse_bits(buf, sizeof(buf)); - ret = i2c_write(RTC_ADDR | (REALTIME_DATA1 << 1), -1, sizeof(buf), buf); - - return ret; -} - diff --git a/firmware/drivers/sdmmc_host.c b/firmware/drivers/sdmmc_host.c index c012731a7e..ad21cfed32 100644 --- a/firmware/drivers/sdmmc_host.c +++ b/firmware/drivers/sdmmc_host.c @@ -677,10 +677,12 @@ static int sdmmc_host_transfer(struct sdmmc_host *host, if (start + count > host->cardinfo.numblocks) goto out; + int max_nr_blocks = MAX(host->config.max_nr_blocks, 1); while (count > 0) { - /* TODO: multiple block transfers */ - int xfer_count = 1; + int xfer_count = count; + if (xfer_count > max_nr_blocks) + xfer_count = max_nr_blocks; /* Set block length for non-HCS cards */ if (!host->is_hcs_card) @@ -692,15 +694,25 @@ static int sdmmc_host_transfer(struct sdmmc_host *host, struct sdmmc_host_command cmd = { .buffer = buf, - .nr_blocks = 1, + .nr_blocks = xfer_count, .block_len = SD_BLOCK_SIZE, .flags = SDMMC_RESP_SHORT | data_dir, }; - if (data_dir == SDMMC_DATA_WRITE) - cmd.command = SD_WRITE_BLOCK; + if (xfer_count > 1) + { + if (data_dir == SDMMC_DATA_WRITE) + cmd.command = SD_WRITE_MULTIPLE_BLOCK; + else + cmd.command = SD_READ_MULTIPLE_BLOCK; + } else - cmd.command = SD_READ_SINGLE_BLOCK; + { + if (data_dir == SDMMC_DATA_WRITE) + cmd.command = SD_WRITE_BLOCK; + else + cmd.command = SD_READ_SINGLE_BLOCK; + } if (host->cardinfo.sd2plus) cmd.argument = start; @@ -711,6 +723,22 @@ static int sdmmc_host_transfer(struct sdmmc_host *host, if (rc) goto out; + /* + * NOTE: some controllers can send CMD12 automatically after + * the end of a transfer, eg. X1000; it might be worth + * supporting that via a feature flag. + */ + if (xfer_count > 1) + { + memset(&cmd, 0, sizeof(cmd)); + cmd.command = SD_STOP_TRANSMISSION; + cmd.flags = SDMMC_RESP_SHORT | SDMMC_RESP_BUSY; + + rc = sdmmc_host_submit_cmd(host, &cmd, NULL); + if (rc) + goto out; + } + buf += xfer_count * SD_BLOCK_SIZE; start += xfer_count; count -= xfer_count; diff --git a/firmware/export/at91sam9260.h b/firmware/export/at91sam9260.h deleted file mode 100644 index 87826d4d4d..0000000000 --- a/firmware/export/at91sam9260.h +++ /dev/null @@ -1,682 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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. - * - ****************************************************************************/ - -/* MATRIX_MRCR : (MATRIX Offset: 0x100) MRCR Register */ -#define AT91C_MATRIX_RCA926I (0x1 << 0) /* (MATRIX) Remap Command for -ARM926EJ-S Instruction Master */ -#define AT91C_MATRIX_RCA926D (0x1 << 1) /* (MATRIX) Remap Command for -ARM926EJ-S Data Master */ - -/* Register definition for MATRIX peripheral */ -#define AT91C_MATRIX_MCFG0 (*(volatile unsigned long*) 0xFFFFEE00) /*(MATRIX) -Master Configuration Register 0 (ram96k) */ -#define AT91C_MATRIX_MCFG7 (*(volatile unsigned long*) 0xFFFFEE1C) /*(MATRIX) -Master Configuration Register 7 (teak_prog) */ -#define AT91C_MATRIX_SCFG1 (*(volatile unsigned long*) 0xFFFFEE44) /*(MATRIX) -Slave Configuration Register 1 (rom) */ -#define AT91C_MATRIX_MCFG4 (*(volatile unsigned long*) 0xFFFFEE10) /*(MATRIX) -Master Configuration Register 4 (bridge) */ -#define AT91C_MATRIX_VERSION (*(volatile unsigned long*) 0xFFFFEFFC) /*(MATRIX) -Version Register */ -#define AT91C_MATRIX_MCFG2 (*(volatile unsigned long*) 0xFFFFEE08) /*(MATRIX) -Master Configuration Register 2 (hperiphs) */ -#define AT91C_MATRIX_PRBS0 (*(volatile unsigned long*) 0xFFFFEE84) /*(MATRIX) -PRBS0 (ram0) */ -#define AT91C_MATRIX_SCFG3 (*(volatile unsigned long*) 0xFFFFEE4C) /*(MATRIX) -Slave Configuration Register 3 (ebi) */ -#define AT91C_MATRIX_MCFG6 (*(volatile unsigned long*) 0xFFFFEE18) /*(MATRIX) -Master Configuration Register 6 (ram16k) */ -#define AT91C_MATRIX_EBI (*(volatile unsigned long*) 0xFFFFEF1C) /*(MATRIX) -Slave 3 (ebi) Special Function Register */ -#define AT91C_MATRIX_SCFG0 (*(volatile unsigned long*) 0xFFFFEE40) /*(MATRIX) -Slave Configuration Register 0 (ram96k) */ -#define AT91C_MATRIX_PRAS0 (*(volatile unsigned long*) 0xFFFFEE80) /*(MATRIX) -PRAS0 (ram0) */ -#define AT91C_MATRIX_MCFG3 (*(volatile unsigned long*) 0xFFFFEE0C) /*(MATRIX) -Master Configuration Register 3 (ebi) */ -#define AT91C_MATRIX_PRAS1 (*(volatile unsigned long*) 0xFFFFEE88) /*(MATRIX) -PRAS1 (ram1) */ -#define AT91C_MATRIX_PRAS2 (*(volatile unsigned long*) 0xFFFFEE90) /*(MATRIX) -PRAS2 (ram2) */ -#define AT91C_MATRIX_SCFG2 (*(volatile unsigned long*) 0xFFFFEE48) /*(MATRIX) -Slave Configuration Register 2 (hperiphs) */ -#define AT91C_MATRIX_MCFG5 (*(volatile unsigned long*) 0xFFFFEE14) /*(MATRIX) -Master Configuration Register 5 (mailbox) */ -#define AT91C_MATRIX_MCFG1 (*(volatile unsigned long*) 0xFFFFEE04) /*(MATRIX) -Master Configuration Register 1 (rom) */ -#define AT91C_MATRIX_MRCR (*(volatile unsigned long*) 0xFFFFEF00) /*(MATRIX) -Master Remp Control Register */ -#define AT91C_MATRIX_PRBS2 (*(volatile unsigned long*) 0xFFFFEE94) /*(MATRIX) -PRBS2 (ram2) */ -#define AT91C_MATRIX_SCFG4 (*(volatile unsigned long*) 0xFFFFEE50) /*(MATRIX) -Slave Configuration Register 4 (bridge) */ -#define AT91C_MATRIX_TEAKCFG (*(volatile unsigned long*) 0xFFFFEF2C) /*(MATRIX) -Slave 7 (teak_prog) Special Function Register */ -#define AT91C_MATRIX_PRBS1 (*(volatile unsigned long*) 0xFFFFEE8C) /*(MATRIX) -PRBS1 (ram1) */ - -/* SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface */ -/* - WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register ---- */ -#define AT91C_WDTC_WDRSTT (0x1 << 0) /* (WDTC) Watchdog Restart */ -#define AT91C_WDTC_KEY (0xFF << 24) /* (WDTC) Watchdog KEY Password */ -/* -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- */ -#define AT91C_WDTC_WDV (0xFFF << 0) /* (WDTC) Watchdog Timer Restart */ -#define AT91C_WDTC_WDFIEN (0x1 << 12) /* (WDTC) Watchdog Fault Interrupt -Enable */ -#define AT91C_WDTC_WDRSTEN (0x1 << 13) /* (WDTC) Watchdog Reset Enable */ -#define AT91C_WDTC_WDRPROC (0x1 << 14) /* (WDTC) Watchdog Timer Restart */ -#define AT91C_WDTC_WDDIS (0x1 << 15) /* (WDTC) Watchdog Disable */ -#define AT91C_WDTC_WDD (0xFFF << 16) /* (WDTC) Watchdog Delta Value */ -#define AT91C_WDTC_WDDBGHLT (0x1 << 28) /* (WDTC) Watchdog Debug Halt */ -#define AT91C_WDTC_WDIDLEHLT (0x1 << 29) /* (WDTC) Watchdog Idle Halt */ -/* -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register ----- */ -#define AT91C_WDTC_WDUNF (0x1 << 0) /* (WDTC) Watchdog Underflow */ -#define AT91C_WDTC_WDERR (0x1 << 1) /* (WDTC) Watchdog Error */ - -/* SOFTWARE API DEFINITION FOR Watchdog Timer Controller Interface */ -/* - WDTC_WDCR : (WDTC Offset: 0x0) Periodic Interval Image Register ---- */ -#define AT91C_WDTC_WDRSTT (0x1 << 0) /* (WDTC) Watchdog Restart */ -#define AT91C_WDTC_KEY (0xFF << 24) /* (WDTC) Watchdog KEY Password */ -/* -------- WDTC_WDMR : (WDTC Offset: 0x4) Watchdog Mode Register -------- */ -#define AT91C_WDTC_WDV (0xFFF << 0) /* (WDTC) Watchdog Timer Restart */ -#define AT91C_WDTC_WDFIEN (0x1 << 12) /* (WDTC) Watchdog Fault Interrupt -Enable */ -#define AT91C_WDTC_WDRSTEN (0x1 << 13) /* (WDTC) Watchdog Reset Enable */ -#define AT91C_WDTC_WDRPROC (0x1 << 14) /* (WDTC) Watchdog Timer Restart */ -#define AT91C_WDTC_WDDIS (0x1 << 15) /* (WDTC) Watchdog Disable */ -#define AT91C_WDTC_WDD (0xFFF << 16) /* (WDTC) Watchdog Delta Value */ -#define AT91C_WDTC_WDDBGHLT (0x1 << 28) /* (WDTC) Watchdog Debug Halt */ -#define AT91C_WDTC_WDIDLEHLT (0x1 << 29) /* (WDTC) Watchdog Idle Halt */ -/* -------- WDTC_WDSR : (WDTC Offset: 0x8) Watchdog Status Register ----- */ -#define AT91C_WDTC_WDUNF (0x1 << 0) /* (WDTC) Watchdog Underflow */ -#define AT91C_WDTC_WDERR (0x1 << 1) /* (WDTC) Watchdog Error */ - -/* Register definition for WDTC peripheral */ -#define AT91C_WDTC_WDCR (*(volatile unsigned long*) 0xFFFFFD40) /* (WDTC) -Watchdog Control Register */ -#define AT91C_WDTC_WDSR (*(volatile unsigned long*) 0xFFFFFD48) /* (WDTC) -Watchdog Status Register */ -#define AT91C_WDTC_WDMR (*(volatile unsigned long*) 0xFFFFFD44) /* (WDTC) -Watchdog Mode Register */ - -/* CKGR_MOR : (CKGR Offset: 0x0) Main Oscillator Register */ -#define AT91C_CKGR_MOSCEN (0x1 << 0) /* (CKGR) Main Oscillator Enable */ -#define AT91C_CKGR_OSCBYPASS (0x1 << 1) /* (CKGR) Main Oscillator Bypass */ -#define AT91C_CKGR_OSCOUNT (0xFF << 8) /* (CKGR) Main Oscillator Start --up Time */ -/* CKGR_MCFR : (CKGR Offset: 0x4) Main Clock Frequency Register */ -#define AT91C_CKGR_MAINF (0xFFFF << 0) /* (CKGR) Main Clock Frequency */ -#define AT91C_CKGR_MAINRDY (0x1 << 16) /* (CKGR) Main Clock Ready */ -/* CKGR_PLLAR : (CKGR Offset: 0x8) PLL A Register */ -#define AT91C_CKGR_DIVA (0xFF << 0) /* (CKGR) Divider A Selected */ -#define AT91C_CKGR_DIVA_0 (0x0) /* (CKGR) Divider A output is 0 */ -#define AT91C_CKGR_DIVA_BYPASS (0x1) /* (CKGR) Divider A is bypassed */ -#define AT91C_CKGR_PLLACOUNT (0x3F << 8) /* (CKGR) PLL A Counter */ -#define AT91C_CKGR_OUTA (0x3 << 14) /* (CKGR) PLL A Output Frequency Range */ -#define AT91C_CKGR_OUTA_0 (0x0 << 14) /* (CKGR) Please -refer to the PLLA datasheet */ -#define AT91C_CKGR_OUTA_1 (0x1 << 14) /* (CKGR) Please -refer to the PLLA datasheet */ -#define AT91C_CKGR_OUTA_2 (0x2 << 14) /* (CKGR) Please -refer to the PLLA datasheet */ -#define AT91C_CKGR_OUTA_3 (0x3 << 14) /* (CKGR) Please -refer to the PLLA datasheet */ -#define AT91C_CKGR_MULA (0x7FF << 16) /* (CKGR) PLL A Multiplier */ -#define AT91C_CKGR_SRCA (0x1 << 29) /* (CKGR) */ -/* CKGR_PLLBR : (CKGR Offset: 0xc) PLL B Register */ -#define AT91C_CKGR_DIVB (0xFF << 0) /* (CKGR) Divider B Selected */ -#define AT91C_CKGR_DIVB_0 (0x0) /* (CKGR) Divider B output is 0 */ -#define AT91C_CKGR_DIVB_BYPASS (0x1) /* (CKGR) Divider B is bypassed */ -#define AT91C_CKGR_PLLBCOUNT (0x3F << 8) /* (CKGR) PLL B Counter */ -#define AT91C_CKGR_OUTB (0x3 << 14) /* (CKGR) PLL B Output Frequency Range */ -#define AT91C_CKGR_OUTB_0 (0x0 << 14) /* (CKGR) Please -refer to the PLLB datasheet */ -#define AT91C_CKGR_OUTB_1 (0x1 << 14) /* (CKGR) Please -refer to the PLLB datasheet */ -#define AT91C_CKGR_OUTB_2 (0x2 << 14) /* (CKGR) Please -refer to the PLLB datasheet */ -#define AT91C_CKGR_OUTB_3 (0x3 << 14) /* (CKGR) Please -refer to the PLLB datasheet */ -#define AT91C_CKGR_MULB (0x7FF << 16) /* (CKGR) PLL B Multiplier */ -#define AT91C_CKGR_USBDIV (0x3 << 28) /* (CKGR) Divider for USB Clocks */ -#define AT91C_CKGR_USBDIV_0 (0x0 << 28) /* (CKGR) -Divider output is PLL clock output */ -#define AT91C_CKGR_USBDIV_1 (0x1 << 28) /* (CKGR) -Divider output is PLL clock output divided by 2 */ -#define AT91C_CKGR_USBDIV_2 (0x2 << 28) /* (CKGR) -Divider output is PLL clock output divided by 4 */ - -/* SOFTWARE API DEFINITION FOR Power Management Controler */ -/* -------- PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register ----- */ -#define AT91C_PMC_PCK (0x1 << 0) /* (PMC) Processor Clock */ -#define AT91C_PMC_UHP (0x1 << 6) /* (PMC) USB Host Port Clock */ -#define AT91C_PMC_UDP (0x1 << 7) /* (PMC) USB Device Port Clock */ -#define AT91C_PMC_PCK0 (0x1 << 8) /* (PMC) Programmable Clock Output */ -#define AT91C_PMC_PCK1 (0x1 << 9) /* (PMC) Programmable Clock Output */ -#define AT91C_PMC_HCK0 (0x1 << 16) /* (PMC) AHB UHP Clock Output */ -#define AT91C_PMC_HCK1 (0x1 << 17) /* (PMC) AHB LCDC Clock Output */ -/* -------- PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register ----- */ - /* -------- PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register ----- */ - /* -------- CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register -------- */ - /* -------- CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register--- */ - /* -------- CKGR_PLLAR : (PMC Offset: 0x28) PLL A Register -------- */ - /* -------- CKGR_PLLBR : (PMC Offset: 0x2c) PLL B Register -------- */ - /* -------- PMC_MCKR : (PMC Offset: 0x30) Master Clock Register -------- */ - #define AT91C_PMC_CSS (0x3 << 0) /* (PMC) Programmable Clock Selection */ - #define AT91C_PMC_CSS_SLOW_CLK (0x0) /* (PMC) Slow Clock is selected */ - #define AT91C_PMC_CSS_MAIN_CLK (0x1) /* (PMC) Main Clock is selected */ - #define AT91C_PMC_CSS_PLLA_CLK (0x2) /* (PMC) Clock from PLL A is selected */ - #define AT91C_PMC_CSS_PLLB_CLK (0x3) /* (PMC) Clock from PLL B is selected */ - #define AT91C_PMC_PRES (0x7 << 2) /* (PMC) Programmable Clock Prescaler */ - #define AT91C_PMC_PRES_CLK (0x0 << 2) /* (PMC) Selected clock */ - #define AT91C_PMC_PRES_CLK_2 (0x1 << 2) /* (PMC) Selected clock - divided by 2 */ - #define AT91C_PMC_PRES_CLK_4 (0x2 << 2) /* (PMC) Selected clock - divided by 4 */ - #define AT91C_PMC_PRES_CLK_8 (0x3 << 2) /* (PMC) Selected clock - divided by 8 */ - #define AT91C_PMC_PRES_CLK_16 (0x4 << 2) /* (PMC) Selected clock - divided by 16 */ - #define AT91C_PMC_PRES_CLK_32 (0x5 << 2) /* (PMC) Selected clock - divided by 32 */ - #define AT91C_PMC_PRES_CLK_64 (0x6 << 2) /* (PMC) Selected clock - divided by 64 */ - #define AT91C_PMC_MDIV (0x3 << 8) /* (PMC) Master Clock Divisionv */ - #define AT91C_PMC_MDIV_1 (0x0 << 8) /* (PMC) The master clock and the - processor clock are the same */ - #define AT91C_PMC_MDIV_2 (0x1 << 8) /* (PMC) The processor clock is twice - as fast as the master clock */ - #define AT91C_PMC_MDIV_3 (0x2 << 8) /* (PMC) The processor clock is four - times faster than the master clock */ - /* -------- PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register ----- */ - /* -------- PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register ---- */ - #define AT91C_PMC_MOSCS (0x1 << 0) /* (PMC) MOSC Status/Enable/Disable/Mask*/ - #define AT91C_PMC_LOCKA (0x1 << 1) /* (PMC) PLL A Status/Enable/Disable/ - Mask */ - #define AT91C_PMC_LOCKB (0x1 << 2) /* (PMC) PLL B Status/Enable/Disable/ - Mask */ - #define AT91C_PMC_MCKRDY (0x1 << 3) /* (PMC) Master Clock Status/Enable/ - Disable/Mask */ - #define AT91C_PMC_PCK0RDY (0x1 << 8) /* (PMC) PCK0_RDY Status/Enable/ - Disable/Mask */ - #define AT91C_PMC_PCK1RDY (0x1 << 9) /* (PMC) PCK1_RDY Status/Enable/ - Disable/Mask */ - /* ---PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register -------- */ - /* ------ PMC_SR : (PMC Offset: 0x68) PMC Status Register -------- */ - #define AT91C_PMC_OSCSEL (0x1 << 7) /* (PMC) 32kHz Oscillator - selection status */ - /* -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register ---- */ - -/* SOFTWARE API DEFINITION FOR Advanced Interrupt Controller */ -/* -------- AIC_SMR : (AIC Offset: 0x0) Control Register -------- */ -#define AT91C_AIC_PRIOR (0x7 << 0) /* (AIC) Priority Level */ -#define AT91C_AIC_PRIOR_LOWEST (0x0) /* (AIC) Lowest priority - level */ -#define AT91C_AIC_PRIOR_HIGHEST (0x7) /* (AIC) Highest - priority level */ -#define AT91C_AIC_SRCTYPE (0x3 << 5) /* (AIC) Interrupt Source Type */ -#define AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE (0x0 << 5) /* (AIC) - Internal Sources Code Label Level Sensitive */ -#define AT91C_AIC_SRCTYPE_INT_EDGE_TRIGGERED (0x1 << 5) /* (AIC) - Internal Sources Code Label Edge triggered */ -#define AT91C_AIC_SRCTYPE_EXT_HIGH_LEVEL (0x2 << 5) /* (AIC) - External Sources Code Label High-level Sensitive */ -#define AT91C_AIC_SRCTYPE_EXT_POSITIVE_EDGE (0x3 << 5) /* (AIC) - External Sources Code Label Positive Edge triggered */ -/* - AIC_CISR : (AIC Offset: 0x114) AIC Core Interrupt Status Register ----- */ -#define AT91C_AIC_NFIQ (0x1 << 0) /* (AIC) NFIQ Status */ -#define AT91C_AIC_NIRQ (0x1 << 1) /* (AIC) NIRQ Status */ -/* - AIC_DCR : (AIC Offset: 0x138) AIC Debug Control Register (Protect) ---- */ -#define AT91C_AIC_DCR_PROT (0x1 << 0) /* (AIC) Protection Mode */ -#define AT91C_AIC_DCR_GMSK (0x1 << 1) /* (AIC) General Mask */ - -/* Register definition for AIC peripheral */ -#define AT91C_AIC_IVR (*(volatile unsigned long*) 0xFFFFF100) /* (AIC) IRQ -Vector Register */ -#define AIC_IVR 0x00000100 -/* (AIC) Source Mode Register */ -#define AT91C_AIC_SMR(a) (*(volatile unsigned long*) (0xFFFFF000 + 4*(a))) -#define AT91C_AIC_FVR (*(volatile unsigned long*) 0xFFFFF104) /* (AIC) FIQ -Vector Register */ -#define AT91C_AIC_DCR (*(volatile unsigned long*) 0xFFFFF138) /* (AIC) Debug -Control Register (Protect) */ -#define AT91C_AIC_EOICR (*(volatile unsigned long*) 0xFFFFF130) /* (AIC) End -of Interrupt Command Register */ -#define AIC_EOICR 0x00000130 -/* (AIC) Source Vector Register */ -#define AT91C_AIC_SVR(a) (*(volatile unsigned long*) (0xFFFFF080 + 4*(a))) -#define AT91C_AIC_FFSR (*(volatile unsigned long*) 0xFFFFF148) /* (AIC) Fast -Forcing Status Register */ -#define AT91C_AIC_ICCR (*(volatile unsigned long*) 0xFFFFF128) /* (AIC) -Interrupt Clear Command Register */ -#define AT91C_AIC_ISR (*(volatile unsigned long*) 0xFFFFF108) /* (AIC) -Interrupt Status Register */ -#define AT91C_AIC_IMR (*(volatile unsigned long*) 0xFFFFF110) /* (AIC) -Interrupt Mask Register */ -#define AT91C_AIC_IPR (*(volatile unsigned long*) 0xFFFFF10C) /* (AIC) -Interrupt Pending Register */ -#define AT91C_AIC_FFER (*(volatile unsigned long*) 0xFFFFF140) /* (AIC) -Fast Forcing Enable Register */ -#define AT91C_AIC_IECR (*(volatile unsigned long*) 0xFFFFF120) /* (AIC) -Interrupt Enable Command Register */ -#define AT91C_AIC_ISCR (*(volatile unsigned long*) 0xFFFFF12C) /* (AIC) -Interrupt Set Command Register */ -#define AT91C_AIC_FFDR (*(volatile unsigned long*) 0xFFFFF144) /* (AIC) -Fast Forcing Disable Register */ -#define AT91C_AIC_CISR (*(volatile unsigned long*) 0xFFFFF114) /* (AIC) -Core Interrupt Status Register */ -#define AT91C_AIC_IDCR (*(volatile unsigned long*) 0xFFFFF124) /* (AIC) -Interrupt Disable Command Register */ -#define AT91C_AIC_SPU (*(volatile unsigned long*) 0xFFFFF134) /* (AIC) -Spurious Vector Register */ - -/* SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface */ -/* PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- */ -#define AT91C_PITC_PIV (0xFFFFF << 0) /* (PITC) Periodic Interval -Value */ -#define AT91C_PITC_PITEN (0x1 << 24) /* (PITC) Periodic Interval Timer -Enabled */ -#define AT91C_PITC_PITIEN (0x1 << 25) /* (PITC) Periodic Interval Timer -Interrupt Enable */ -/* --- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register - */ -#define AT91C_PITC_PITS (0x1 << 0) /* (PITC) Periodic Interval Timer -Status */ -/* - PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register ---- */ -#define AT91C_PITC_CPIV (0xFFFFF << 0) /* (PITC) Current Periodic -Interval Value */ -#define AT91C_PITC_PICNT (0xFFF << 20) /* (PITC) Periodic Interval Counter */ -/* PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register ---- */ - -/* Register definition for AIC peripheral */ -#define AT91C_AIC_IVR (*(volatile unsigned long*) 0xFFFFF100) /* (AIC) IRQ -Vector Register */ -#define AIC_IVR 0x00000100 -#define AT91C_AIC_EOICR (*(volatile unsigned long*) 0xFFFFF130) /* (AIC) End -of Interrupt Command Register */ -#define AIC_EOICR 0x00000130 - -/* Register definition for PIOA peripheral */ -#define AT91C_PIOA_ODR (*(volatile unsigned long*) 0xFFFFF414) /* (PIOA) -Output Disable Registerr */ -#define AT91C_PIOA_SODR (*(volatile unsigned long*) 0xFFFFF430) /* (PIOA) -Set Output Data Register */ -#define AT91C_PIOA_ISR (*(volatile unsigned long*) 0xFFFFF44C) /* (PIOA) -Interrupt Status Register */ -#define AT91C_PIOA_ABSR (*(volatile unsigned long*) 0xFFFFF478) /* (PIOA) -AB Select Status Register */ -#define AT91C_PIOA_IER (*(volatile unsigned long*) 0xFFFFF440) /* (PIOA) -Interrupt Enable Register */ -#define AT91C_PIOA_PPUDR (*(volatile unsigned long*) 0xFFFFF460) /* (PIOA) -Pull-up Disable Register */ -#define AT91C_PIOA_IMR (*(volatile unsigned long*) 0xFFFFF448) /* (PIOA) -Interrupt Mask Register */ -#define AT91C_PIOA_PER (*(volatile unsigned long*) 0xFFFFF400) /* (PIOA) -PIO Enable Register */ -#define AT91C_PIOA_IFDR (*(volatile unsigned long*) 0xFFFFF424) /* (PIOA) -Input Filter Disable Register */ -#define AT91C_PIOA_OWDR (*(volatile unsigned long*) 0xFFFFF4A4) /* (PIOA) -Output Write Disable Register */ -#define AT91C_PIOA_MDSR (*(volatile unsigned long*) 0xFFFFF458) /* (PIOA) -Multi-driver Status Register */ -#define AT91C_PIOA_IDR (*(volatile unsigned long*) 0xFFFFF444) /* (PIOA) -Interrupt Disable Register */ -#define AT91C_PIOA_ODSR (*(volatile unsigned long*) 0xFFFFF438) /* (PIOA) -Output Data Status Register */ -#define AT91C_PIOA_PPUSR (*(volatile unsigned long*) 0xFFFFF468) /* (PIOA) -Pull-up Status Register */ -#define AT91C_PIOA_OWSR (*(volatile unsigned long*) 0xFFFFF4A8) /* (PIOA) -Output Write Status Register */ -#define AT91C_PIOA_BSR (*(volatile unsigned long*) 0xFFFFF474) /* (PIOA) -Select B Register */ -#define AT91C_PIOA_OWER (*(volatile unsigned long*) 0xFFFFF4A0) /* (PIOA) -Output Write Enable Register */ -#define AT91C_PIOA_IFER (*(volatile unsigned long*) 0xFFFFF420) /* (PIOA) -Input Filter Enable Register */ -#define AT91C_PIOA_PDSR (*(volatile unsigned long*) 0xFFFFF43C) /* (PIOA) -Pin Data Status Register */ -#define AT91C_PIOA_PPUER (*(volatile unsigned long*) 0xFFFFF464) /* (PIOA) -Pull-up Enable Register */ -#define AT91C_PIOA_OSR (*(volatile unsigned long*) 0xFFFFF418) /* (PIOA) -Output Status Register */ -#define AT91C_PIOA_ASR (*(volatile unsigned long*) 0xFFFFF470) /* (PIOA) -Select A Register */ -#define AT91C_PIOA_MDDR (*(volatile unsigned long*) 0xFFFFF454) /* (PIOA) -Multi-driver Disable Register */ -#define AT91C_PIOA_CODR (*(volatile unsigned long*) 0xFFFFF434) /* (PIOA) -Clear Output Data Register */ -#define AT91C_PIOA_MDER (*(volatile unsigned long*) 0xFFFFF450) /* (PIOA) -Multi-driver Enable Register */ -#define AT91C_PIOA_PDR (*(volatile unsigned long*) 0xFFFFF404) /* (PIOA) -PIO Disable Register */ -#define AT91C_PIOA_IFSR (*(volatile unsigned long*) 0xFFFFF428) /* (PIOA) -Input Filter Status Register */ -#define AT91C_PIOA_OER (*(volatile unsigned long*) 0xFFFFF410) /* (PIOA) -Output Enable Register */ -#define AT91C_PIOA_PSR (*(volatile unsigned long*) 0xFFFFF408) /* (PIOA) -PIO Status Register */ - -/* Register definition for PIOB peripheral */ -#define AT91C_PIOB_OWDR (*(volatile unsigned long*) 0xFFFFF6A4) /* (PIOB) -Output Write Disable Register */ -#define AT91C_PIOB_MDER (*(volatile unsigned long*) 0xFFFFF650) /* (PIOB) -Multi-driver Enable Register */ -#define AT91C_PIOB_PPUSR (*(volatile unsigned long*) 0xFFFFF668) /* (PIOB) -Pull-up Status Register */ -#define AT91C_PIOB_IMR (*(volatile unsigned long*) 0xFFFFF648) /* (PIOB) -Interrupt Mask Register */ -#define AT91C_PIOB_ASR (*(volatile unsigned long*) 0xFFFFF670) /* (PIOB) -Select A Register */ -#define AT91C_PIOB_PPUDR (*(volatile unsigned long*) 0xFFFFF660) /* (PIOB) -Pull-up Disable Register */ -#define AT91C_PIOB_PSR (*(volatile unsigned long*) 0xFFFFF608) /* (PIOB) -PIO Status Register */ -#define AT91C_PIOB_IER (*(volatile unsigned long*) 0xFFFFF640) /* (PIOB) -Interrupt Enable Register */ -#define AT91C_PIOB_CODR (*(volatile unsigned long*) 0xFFFFF634) /* (PIOB) -Clear Output Data Register */ -#define AT91C_PIOB_OWER (*(volatile unsigned long*) 0xFFFFF6A0) /* (PIOB) -Output Write Enable Register */ -#define AT91C_PIOB_ABSR (*(volatile unsigned long*) 0xFFFFF678) /* (PIOB) -AB Select Status Register */ -#define AT91C_PIOB_IFDR (*(volatile unsigned long*) 0xFFFFF624) /* (PIOB) -Input Filter Disable Register */ -#define AT91C_PIOB_PDSR (*(volatile unsigned long*) 0xFFFFF63C) /* (PIOB) -Pin Data Status Register */ -#define AT91C_PIOB_IDR (*(volatile unsigned long*) 0xFFFFF644) /* (PIOB) -Interrupt Disable Register */ -#define AT91C_PIOB_OWSR (*(volatile unsigned long*) 0xFFFFF6A8) /* (PIOB) -Output Write Status Register */ -#define AT91C_PIOB_PDR (*(volatile unsigned long*) 0xFFFFF604) /* (PIOB) -PIO Disable Register */ -#define AT91C_PIOB_ODR (*(volatile unsigned long*) 0xFFFFF614) /* (PIOB) -Output Disable Registerr */ -#define AT91C_PIOB_IFSR (*(volatile unsigned long*) 0xFFFFF628) /* (PIOB) -Input Filter Status Register */ -#define AT91C_PIOB_PPUER (*(volatile unsigned long*) 0xFFFFF664) /* (PIOB) -Pull-up Enable Register */ -#define AT91C_PIOB_SODR (*(volatile unsigned long*) 0xFFFFF630) /* (PIOB) -Set Output Data Register */ -#define AT91C_PIOB_ISR (*(volatile unsigned long*) 0xFFFFF64C) /* (PIOB) -Interrupt Status Register */ -#define AT91C_PIOB_ODSR (*(volatile unsigned long*) 0xFFFFF638) /* (PIOB) -Output Data Status Register */ -#define AT91C_PIOB_OSR (*(volatile unsigned long*) 0xFFFFF618) /* (PIOB) -Output Status Register */ -#define AT91C_PIOB_MDSR (*(volatile unsigned long*) 0xFFFFF658) /* (PIOB) -Multi-driver Status Register */ -#define AT91C_PIOB_IFER (*(volatile unsigned long*) 0xFFFFF620) /* (PIOB) -Input Filter Enable Register */ -#define AT91C_PIOB_BSR (*(volatile unsigned long*) 0xFFFFF674) /* (PIOB) -Select B Register */ -#define AT91C_PIOB_MDDR (*(volatile unsigned long*) 0xFFFFF654) /* (PIOB) -Multi-driver Disable Register */ -#define AT91C_PIOB_OER (*(volatile unsigned long*) 0xFFFFF610) /* (PIOB) -Output Enable Register */ -#define AT91C_PIOB_PER (*(volatile unsigned long*) 0xFFFFF600) /* (PIOB) -PIO Enable Register */ - -/* Register definition for PIOC peripheral */ -#define AT91C_PIOC_OWDR (*(volatile unsigned long*) 0xFFFFF8A4) /* (PIOC) -Output Write Disable Register */ -#define AT91C_PIOC_SODR (*(volatile unsigned long*) 0xFFFFF830) /* (PIOC) -Set Output Data Register */ -#define AT91C_PIOC_PPUER (*(volatile unsigned long*) 0xFFFFF864) /* (PIOC) -Pull-up Enable Register */ -#define AT91C_PIOC_CODR (*(volatile unsigned long*) 0xFFFFF834) /* (PIOC) -Clear Output Data Register */ -#define AT91C_PIOC_PSR (*(volatile unsigned long*) 0xFFFFF808) /* (PIOC) -PIO Status Register */ -#define AT91C_PIOC_PDR (*(volatile unsigned long*) 0xFFFFF804) /* (PIOC) -PIO Disable Register */ -#define AT91C_PIOC_ODR (*(volatile unsigned long*) 0xFFFFF814) /* (PIOC) -Output Disable Register */ -#define AT91C_PIOC_PPUSR (*(volatile unsigned long*) 0xFFFFF868) /* (PIOC) -Pull-up Status Register */ -#define AT91C_PIOC_ABSR (*(volatile unsigned long*) 0xFFFFF878) /* (PIOC) -AB Select Status Register */ -#define AT91C_PIOC_IFSR (*(volatile unsigned long*) 0xFFFFF828) /* (PIOC) -Input Filter Status Register */ -#define AT91C_PIOC_OER (*(volatile unsigned long*) 0xFFFFF810) /* (PIOC) -Output Enable Register */ -#define AT91C_PIOC_IMR (*(volatile unsigned long*) 0xFFFFF848) /* (PIOC) -Interrupt Mask Register */ -#define AT91C_PIOC_ASR (*(volatile unsigned long*) 0xFFFFF870) /* (PIOC) -Select A Register */ -#define AT91C_PIOC_MDDR (*(volatile unsigned long*) 0xFFFFF854) /* (PIOC) -Multi-driver Disable Register */ -#define AT91C_PIOC_OWSR (*(volatile unsigned long*) 0xFFFFF8A8) /* (PIOC) -Output Write Status Register */ -#define AT91C_PIOC_PER (*(volatile unsigned long*) 0xFFFFF800) /* (PIOC) -PIO Enable Register */ -#define AT91C_PIOC_IDR (*(volatile unsigned long*) 0xFFFFF844) /* (PIOC) -Interrupt Disable Register */ -#define AT91C_PIOC_MDER (*(volatile unsigned long*) 0xFFFFF850) /* (PIOC) -Multi-driver Enable Register */ -#define AT91C_PIOC_PDSR (*(volatile unsigned long*) 0xFFFFF83C) /* (PIOC) -Pin Data Status Register */ -#define AT91C_PIOC_MDSR (*(volatile unsigned long*) 0xFFFFF858) /* (PIOC) -Multi-driver Status Register */ -#define AT91C_PIOC_OWER (*(volatile unsigned long*) 0xFFFFF8A0) /* (PIOC) -Output Write Enable Register */ -#define AT91C_PIOC_BSR (*(volatile unsigned long*) 0xFFFFF874) /* (PIOC) -Select B Register */ -#define AT91C_PIOC_PPUDR (*(volatile unsigned long*) 0xFFFFF860) /* (PIOC) -Pull-up Disable Register */ -#define AT91C_PIOC_IFDR (*(volatile unsigned long*) 0xFFFFF824) /* (PIOC) -Input Filter Disable Register */ -#define AT91C_PIOC_IER (*(volatile unsigned long*) 0xFFFFF840) /* (PIOC) -Interrupt Enable Register */ -#define AT91C_PIOC_OSR (*(volatile unsigned long*) 0xFFFFF818) /* (PIOC) -Output Status Register */ -#define AT91C_PIOC_ODSR (*(volatile unsigned long*) 0xFFFFF838) /* (PIOC) -Output Data Status Register */ -#define AT91C_PIOC_ISR (*(volatile unsigned long*) 0xFFFFF84C) /* (PIOC) -Interrupt Status Register */ -#define AT91C_PIOC_IFER (*(volatile unsigned long*) 0xFFFFF820) /* (PIOC) -Input Filter Enable Register */ - -/* Register definition for PMC peripheral */ -#define AT91C_PMC_PCER (*(volatile unsigned long*) 0xFFFFFC10) /* (PMC) -Peripheral Clock Enable Register */ -#define AT91C_PMC_PCKR (*(volatile unsigned long*) 0xFFFFFC40) /* (PMC) -Programmable Clock Register */ -#define AT91C_PMC_MCKR (*(volatile unsigned long*) 0xFFFFFC30) /* (PMC) -Master Clock Register */ -#define AT91C_PMC_PLLAR (*(volatile unsigned long*) 0xFFFFFC28) /* (PMC) -PLL A Register */ -#define AT91C_PMC_PCDR (*(volatile unsigned long*) 0xFFFFFC14) /* (PMC) -Peripheral Clock Disable Register */ -#define AT91C_PMC_SCSR (*(volatile unsigned long*) 0xFFFFFC08) /* (PMC) -System Clock Status Register */ -#define AT91C_PMC_MCFR (*(volatile unsigned long*) 0xFFFFFC24) /* (PMC) -Main Clock Frequency Register */ -#define AT91C_PMC_IMR (*(volatile unsigned long*) 0xFFFFFC6C) /* (PMC) -Interrupt Mask Register */ -#define AT91C_PMC_IER (*(volatile unsigned long*) 0xFFFFFC60) /* (PMC) -Interrupt Enable Register */ -#define AT91C_PMC_MOR (*(volatile unsigned long *) 0xFFFFFC20) /* (PMC) -Main Oscillator Register */ -#define AT91C_PMC_IDR (*(volatile unsigned long *) 0xFFFFFC64) /* (PMC) -Interrupt Disable Register */ -#define AT91C_PMC_PLLBR (*(volatile unsigned long*) 0xFFFFFC2C) /* (PMC) -PLL B Register */ -#define AT91C_PMC_SCDR (*(volatile unsigned long*) 0xFFFFFC04) /* (PMC) -System Clock Disable Register */ -#define AT91C_PMC_PCSR (*(volatile unsigned long*) 0xFFFFFC18) /* (PMC) -Peripheral Clock Status Register */ -#define AT91C_PMC_SCER (*(volatile unsigned long*) 0xFFFFFC00) /* (PMC) -System Clock Enable Register */ -#define AT91C_PMC_SR (*(volatile unsigned long*) 0xFFFFFC68) /* (PMC) -Status Register */ - -/* Register definition for PITC peripheral */ -#define AT91C_PITC_PIVR (*(volatile unsigned long*) 0xFFFFFD38) /* (PITC) -Period Interval Value Register */ -#define AT91C_PITC_PISR (*(volatile unsigned long*) 0xFFFFFD34) /* (PITC) -Period Interval Status Register */ -#define AT91C_PITC_PIIR (*(volatile unsigned long*) 0xFFFFFD3C) /* (PITC) -Period Interval Image Register */ -#define AT91C_PITC_PIMR (*(volatile unsigned long*) 0xFFFFFD30) /* (PITC) -Period Interval Mode Register */ - -/* PIO DEFINITIONS FOR AT91SAM9260 */ -#define AT91C_PIO_PA0 (1 << 0) /* Pin Controlled by PA0 */ -#define AT91C_PIO_PA1 (1 << 1) /* Pin Controlled by PA1 */ -#define AT91C_PIO_PA10 (1 << 10) /* Pin Controlled by PA10 */ -#define AT91C_PIO_PA11 (1 << 11) /* Pin Controlled by PA11 */ -#define AT91C_PIO_PA12 (1 << 12) /* Pin Controlled by PA12 */ -#define AT91C_PIO_PA13 (1 << 13) /* Pin Controlled by PA13 */ -#define AT91C_PIO_PA14 (1 << 14) /* Pin Controlled by PA14 */ -#define AT91C_PIO_PA15 (1 << 15) /* Pin Controlled by PA15 */ -#define AT91C_PIO_PA16 (1 << 16) /* Pin Controlled by PA16 */ -#define AT91C_PIO_PA17 (1 << 17) /* Pin Controlled by PA17 */ -#define AT91C_PIO_PA18 (1 << 18) /* Pin Controlled by PA18 */ -#define AT91C_PIO_PA19 (1 << 19) /* Pin Controlled by PA19 */ -#define AT91C_PIO_PA2 (1 << 2) /* Pin Controlled by PA2 */ -#define AT91C_PIO_PA20 (1 << 20) /* Pin Controlled by PA20 */ -#define AT91C_PIO_PA21 (1 << 21) /* Pin Controlled by PA21 */ -#define AT91C_PIO_PA22 (1 << 22) /* Pin Controlled by PA22 */ -#define AT91C_PIO_PA23 (1 << 23) /* Pin Controlled by PA23 */ -#define AT91C_PIO_PA24 (1 << 24) /* Pin Controlled by PA24 */ -#define AT91C_PIO_PA25 (1 << 25) /* Pin Controlled by PA25 */ -#define AT91C_PIO_PA26 (1 << 26) /* Pin Controlled by PA26 */ -#define AT91C_PIO_PA27 (1 << 27) /* Pin Controlled by PA27 */ -#define AT91C_PIO_PA28 (1 << 28) /* Pin Controlled by PA28 */ -#define AT91C_PIO_PA29 (1 << 29) /* Pin Controlled by PA29 */ -#define AT91C_PIO_PA3 (1 << 3) /* Pin Controlled by PA3 */ -#define AT91C_PIO_PA30 (1 << 30) /* Pin Controlled by PA30 */ -#define AT91C_PIO_PA31 (1 << 31) /* Pin Controlled by PA31 */ -#define AT91C_PIO_PA4 (1 << 4) /* Pin Controlled by PA4 */ -#define AT91C_PIO_PA5 (1 << 5) /* Pin Controlled by PA5 */ -#define AT91C_PIO_PA6 (1 << 6) /* Pin Controlled by PA6 */ -#define AT91C_PIO_PA7 (1 << 7) /* Pin Controlled by PA7 */ -#define AT91C_PIO_PA8 (1 << 8) /* Pin Controlled by PA8 */ -#define AT91C_PIO_PA9 (1 << 9) /* Pin Controlled by PA9 */ -#define AT91C_PIO_PB0 (1 << 0) /* Pin Controlled by PB0 */ -#define AT91C_PIO_PB1 (1 << 1) /* Pin Controlled by PB1 */ -#define AT91C_PIO_PB10 (1 << 10) /* Pin Controlled by PB10 */ -#define AT91C_PIO_PB11 (1 << 11) /* Pin Controlled by PB11 */ -#define AT91C_PIO_PB12 (1 << 12) /* Pin Controlled by PB12 */ -#define AT91C_PIO_PB13 (1 << 13) /* Pin Controlled by PB13 */ -#define AT91C_PIO_PB14 (1 << 14) /* Pin Controlled by PB14 */ -#define AT91C_PIO_PB15 (1 << 15) /* Pin Controlled by PB15 */ -#define AT91C_PIO_PB16 (1 << 16) /* Pin Controlled by PB16 */ -#define AT91C_PIO_PB17 (1 << 17) /* Pin Controlled by PB17 */ -#define AT91C_PIO_PB18 (1 << 18) /* Pin Controlled by PB18 */ -#define AT91C_PIO_PB19 (1 << 19) /* Pin Controlled by PB19 */ -#define AT91C_PIO_PB2 (1 << 2) /* Pin Controlled by PB2 */ -#define AT91C_PIO_PB20 (1 << 20) /* Pin Controlled by PB20 */ -#define AT91C_PIO_PB21 (1 << 21) /* Pin Controlled by PB21 */ -#define AT91C_PIO_PB22 (1 << 22) /* Pin Controlled by PB22 */ -#define AT91C_PIO_PB23 (1 << 23) /* Pin Controlled by PB23 */ -#define AT91C_PIO_PB24 (1 << 24) /* Pin Controlled by PB24 */ -#define AT91C_PIO_PB25 (1 << 25) /* Pin Controlled by PB25 */ -#define AT91C_PIO_PB26 (1 << 26) /* Pin Controlled by PB26 */ -#define AT91C_PIO_PB27 (1 << 27) /* Pin Controlled by PB27 */ -#define AT91C_PIO_PB28 (1 << 28) /* Pin Controlled by PB28 */ -#define AT91C_PIO_PB29 (1 << 29) /* Pin Controlled by PB29 */ -#define AT91C_PIO_PB3 (1 << 3) /* Pin Controlled by PB3 */ -#define AT91C_PIO_PB30 (1 << 30) /* Pin Controlled by PB30 */ -#define AT91C_PIO_PB31 (1 << 31) /* Pin Controlled by PB31 */ -#define AT91C_PIO_PB4 (1 << 4) /* Pin Controlled by PB4 */ -#define AT91C_PIO_PB5 (1 << 5) /* Pin Controlled by PB5 */ -#define AT91C_PIO_PB6 (1 << 6) /* Pin Controlled by PB6 */ -#define AT91C_PIO_PB7 (1 << 7) /* Pin Controlled by PB7 */ -#define AT91C_PIO_PB8 (1 << 8) /* Pin Controlled by PB8 */ -#define AT91C_PIO_PB9 (1 << 9) /* Pin Controlled by PB9 */ -#define AT91C_PIO_PC0 (1 << 0) /* Pin Controlled by PC0 */ -#define AT91C_PIO_PC1 (1 << 1) /* Pin Controlled by PC1 */ -#define AT91C_PIO_PC10 (1 << 10) /* Pin Controlled by PC10 */ -#define AT91C_PIO_PC11 (1 << 11) /* Pin Controlled by PC11 */ -#define AT91C_PIO_PC12 (1 << 12) /* Pin Controlled by PC12 */ -#define AT91C_PIO_PC13 (1 << 13) /* Pin Controlled by PC13 */ -#define AT91C_PIO_PC14 (1 << 14) /* Pin Controlled by PC14 */ -#define AT91C_PIO_PC15 (1 << 15) /* Pin Controlled by PC15 */ -#define AT91C_PIO_PC16 (1 << 16) /* Pin Controlled by PC16 */ -#define AT91C_PIO_PC17 (1 << 17) /* Pin Controlled by PC17 */ -#define AT91C_PIO_PC18 (1 << 18) /* Pin Controlled by PC18 */ -#define AT91C_PIO_PC19 (1 << 19) /* Pin Controlled by PC19 */ -#define AT91C_PIO_PC2 (1 << 2) /* Pin Controlled by PC2 */ -#define AT91C_PIO_PC20 (1 << 20) /* Pin Controlled by PC20 */ -#define AT91C_PIO_PC21 (1 << 21) /* Pin Controlled by PC21 */ -#define AT91C_PIO_PC22 (1 << 22) /* Pin Controlled by PC22 */ -#define AT91C_PIO_PC23 (1 << 23) /* Pin Controlled by PC23 */ -#define AT91C_PIO_PC24 (1 << 24) /* Pin Controlled by PC24 */ -#define AT91C_PIO_PC25 (1 << 25) /* Pin Controlled by PC25 */ -#define AT91C_PIO_PC26 (1 << 26) /* Pin Controlled by PC26 */ -#define AT91C_PIO_PC27 (1 << 27) /* Pin Controlled by PC27 */ -#define AT91C_PIO_PC28 (1 << 28) /* Pin Controlled by PC28 */ -#define AT91C_PIO_PC29 (1 << 29) /* Pin Controlled by PC29 */ -#define AT91C_PIO_PC3 (1 << 3) /* Pin Controlled by PC3 */ -#define AT91C_PIO_PC30 (1 << 30) /* Pin Controlled by PC30 */ -#define AT91C_PIO_PC31 (1 << 31) /* Pin Controlled by PC31 */ -#define AT91C_PIO_PC4 (1 << 4) /* Pin Controlled by PC4 */ -#define AT91C_PIO_PC5 (1 << 5) /* Pin Controlled by PC5 */ -#define AT91C_PIO_PC6 (1 << 6) /* Pin Controlled by PC6 */ -#define AT91C_PIO_PC7 (1 << 7) /* Pin Controlled by PC7 */ -#define AT91C_PIO_PC8 (1 << 8) /* Pin Controlled by PC8 */ -#define AT91C_PIO_PC9 (1 << 9) /* Pin Controlled by PC9 */ - -/* PERIPHERAL ID DEFINITIONS FOR AT91SAM9260 */ -#define AT91C_ID_FIQ ( 0) /* Advanced Interrupt Controller (FIQ) */ -#define AT91C_ID_SYS ( 1) /* System Controller */ -#define AT91C_ID_PIOA ( 2) /* Parallel IO Controller A */ -#define AT91C_ID_PIOB ( 3) /* Parallel IO Controller B */ -#define AT91C_ID_PIOC ( 4) /* Parallel IO Controller C */ -#define AT91C_ID_ADC ( 5) /* ADC */ -#define AT91C_ID_US0 ( 6) /* USART 0 */ -#define AT91C_ID_US1 ( 7) /* USART 1 */ -#define AT91C_ID_US2 ( 8) /* USART 2 */ -#define AT91C_ID_MCI ( 9) /* Multimedia Card Interface 0 */ -#define AT91C_ID_UDP (10) /* USB Device Port */ -#define AT91C_ID_TWI (11) /* Two-Wire Interface */ -#define AT91C_ID_SPI0 (12) /* Serial Peripheral Interface 0 */ -#define AT91C_ID_SPI1 (13) /* Serial Peripheral Interface 1 */ -#define AT91C_ID_SSC0 (14) /* Serial Synchronous Controller 0 */ -#define AT91C_ID_TC0 (17) /* Timer Counter 0 */ -#define AT91C_ID_TC1 (18) /* Timer Counter 1 */ -#define AT91C_ID_TC2 (19) /* Timer Counter 2 */ -#define AT91C_ID_UHP (20) /* USB Host Port */ -#define AT91C_ID_EMAC (21) /* Ethernet Mac */ -#define AT91C_ID_HISI (22) /* Image Sensor Interface */ -#define AT91C_ID_US3 (23) /* USART 3 */ -#define AT91C_ID_US4 (24) /* USART 4 */ -#define AT91C_ID_US5 (25) /* USART 5 */ -#define AT91C_ID_TC3 (26) /* Timer Counter 3 */ -#define AT91C_ID_TC4 (27) /* Timer Counter 4 */ -#define AT91C_ID_TC5 (28) /* Timer Counter 5 */ -#define AT91C_ID_IRQ0 (29) /* Advanced Interrupt Controller (IRQ0) */ -#define AT91C_ID_IRQ1 (30) /* Advanced Interrupt Controller (IRQ1) */ -#define AT91C_ID_IRQ2 (31) /* Advanced Interrupt Controller (IRQ2) */ -#define AT91C_ALL_INT (0xFFFE7FFF) /* ALL VALID INTERRUPTS */ - -/* MEMORY MAPPING DEFINITIONS FOR AT91SAM9260 */ -#define AT91C_IRAM_1 (0x00200000) /* Maximum IRAM_1 Area : 4Kbyte -base address */ -#define AT91C_IRAM_1_SIZE (0x00001000) /* Maximum IRAM_1 Area : 4Kbyte size - in byte (4 Kbytes) */ -#define AT91C_EBI_SDRAM_32BIT (0x20000000) /* SDRAM on EBI Chip Select 1 -base address */ -#define AT91C_BASE_AIC 0xFFFFF000 /* (AIC) Base Address */ - -/* Timer frequency */ -/* timer is based on PCLK and minimum division is 2 */ -#define TIMER_FREQ (49156800/2) diff --git a/firmware/export/config.h b/firmware/export/config.h index cf79b84fe2..261b2d7402 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -79,7 +79,6 @@ #define JZ4732 4732 #define JZ4760B 47602 #define AS3525 3525 -#define AT91SAM9260 9260 #define AS3525v2 35252 #define IMX233 233 #define RK27XX 2700 @@ -113,23 +112,15 @@ #define GIGABEAT_S_PAD 19 #define COWON_D2_PAD 22 #define IAUDIO_M3_PAD 23 -#define CREATIVEZVM_PAD 24 #define SANSA_M200_PAD 25 -#define CREATIVEZV_PAD 26 #define PHILIPS_SA9200_PAD 27 #define PHILIPS_HDD1630_PAD 29 -#define MEIZU_M6SL_PAD 30 #define ONDAVX747_PAD 31 #define ONDAVX767_PAD 32 -#define MEIZU_M6SP_PAD 33 -#define MEIZU_M3_PAD 34 #define SANSA_CLIP_PAD 35 #define SANSA_FUZE_PAD 36 -#define LYRE_PROTO1_PAD 37 #define SAMSUNG_YH820_PAD 38 #define ONDAVX777_PAD 39 -#define SAMSUNG_YPS3_PAD 40 -#define MINI2440_PAD 41 #define PHILIPS_HDD6330_PAD 42 #define PBELL_VIBE500_PAD 43 #define MPIO_HD200_PAD 44 @@ -240,22 +231,18 @@ #define LCD_C200 17 /* as used by Sandisk Sansa c200 */ #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */ #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */ -#define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */ #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */ #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */ #define LCD_SA9200 25 /* as used by the Philips SA9200 */ #define LCD_S6B33B2 26 /* as used by the Samsumg YH820 */ #define LCD_HDD1630 27 /* as used by the Philips HDD1630 */ -#define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */ #define LCD_ONDAVX747 29 /* as used by the Onda VX747 */ #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */ #define LCD_SSD1303 31 /* as used by the Sansa Clip */ #define LCD_FUZE 32 /* as used by the Sansa Fuze */ -#define LCD_LYRE_PROTO1 33 /* as used by the Lyre prototype 1 */ #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */ #define LCD_VIEW 35 /* as used by the Sansa View */ #define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */ -#define LCD_MINI2440 37 /* as used by the Mini2440 */ #define LCD_HDD6330 38 /* as used by the Philips HDD6330 */ #define LCD_VIBE500 39 /* as used by the Packard Bell Vibe 500 */ #define LCD_IPOD6GNANO3G4G 40 /* as used by the iPod Classic, Nano 3G and Nano 4G */ @@ -354,7 +341,6 @@ Lyre prototype 1 */ #define RTC_MR100 12 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */ #define RTC_S5L8700 14 -#define RTC_S35390A 15 #define RTC_JZ4740 16 /* Ingenic Jz4740 */ #define RTC_NANO2G 17 /* This seems to be a PCF5063x */ #define RTC_D2 18 /* Either PCF50606 or PCF50635 */ @@ -449,12 +435,6 @@ Lyre prototype 1 */ #include "config/mrobe500.h" #elif defined(COWON_D2) #include "config/cowond2.h" -#elif defined(CREATIVE_ZVM) -#include "config/zenvisionm30gb.h" -#elif defined(CREATIVE_ZVM60GB) -#include "config/zenvisionm60gb.h" -#elif defined(CREATIVE_ZV) -#include "config/zenvision.h" #elif defined(CREATIVE_ZENXFI2) #include "config/creativezenxfi2.h" #elif defined(CREATIVE_ZENXFI3) @@ -465,12 +445,6 @@ Lyre prototype 1 */ #include "config/gogearhdd1630.h" #elif defined(PHILIPS_HDD6330) #include "config/gogearhdd6330.h" -#elif defined(MEIZU_M6SL) -#include "config/meizum6sl.h" -#elif defined(MEIZU_M6SP) -#include "config/meizum6sp.h" -#elif defined(MEIZU_M3) -#include "config/meizum3.h" #elif defined(ONDA_VX747) || defined(ONDA_VX747P) #include "config/ondavx747.h" #elif defined(ONDA_VX777) @@ -497,20 +471,12 @@ Lyre prototype 1 */ #include "config/sansaclipzip.h" #elif defined(SANSA_C200V2) #include "config/sansac200v2.h" -#elif defined(SANSA_VIEW) -#include "config/sansaview.h" -#elif defined(LYRE_PROTO1) -#include "config/lyreproto1.h" -#elif defined(MINI2440) -#include "config/mini2440.h" #elif defined(SAMSUNG_YH820) #include "config/samsungyh820.h" #elif defined(SAMSUNG_YH920) #include "config/samsungyh920.h" #elif defined(SAMSUNG_YH925) #include "config/samsungyh925.h" -#elif defined(SAMSUNG_YPS3) -#include "config/samsungyps3.h" #elif defined(PBELL_VIBE500) #include "config/vibe500.h" #elif defined(MPIO_HD200) @@ -1187,12 +1153,10 @@ Lyre prototype 1 */ (CONFIG_CPU == PNX0101) || \ (CONFIG_CPU == TCC7801) # define USE_IRAM -# define PLUGIN_USE_IRAM /* AS3525 +2MB: core, plugins, codecs */ #elif (CONFIG_CPU == AS3525) && (MEMORYSIZE > 2) && !defined(BOOTLOADER) # define USE_IRAM -# define PLUGIN_USE_IRAM /* AS3525 2MB: core only */ #elif (CONFIG_CPU == AS3525) && (MEMORYSIZE <= 2) && !defined(BOOTLOADER) && \ diff --git a/firmware/export/config/ipodnano3g.h b/firmware/export/config/ipodnano3g.h index 1030da1717..9583b3b3d2 100644 --- a/firmware/export/config/ipodnano3g.h +++ b/firmware/export/config/ipodnano3g.h @@ -160,7 +160,6 @@ #define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */ #define BATTERY_CAPACITY_MAX 500 /* max. capacity selectable */ #define BATTERY_CAPACITY_INC 10 /* capacity increment */ -#define BATTERY_TYPES_COUNT 1 /* only one type */ #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE diff --git a/firmware/export/config/ipodnano4g.h b/firmware/export/config/ipodnano4g.h index 7c4b6c8e73..6b651dfe65 100644 --- a/firmware/export/config/ipodnano4g.h +++ b/firmware/export/config/ipodnano4g.h @@ -162,7 +162,6 @@ #define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */ #define BATTERY_CAPACITY_MAX 500 /* max. capacity selectable */ #define BATTERY_CAPACITY_INC 10 /* capacity increment */ -#define BATTERY_TYPES_COUNT 1 /* only one type */ #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE diff --git a/firmware/export/config/lyreproto1.h b/firmware/export/config/lyreproto1.h deleted file mode 100644 index e30b3c4213..0000000000 --- a/firmware/export/config/lyreproto1.h +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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. - * - ****************************************************************************/ - -/* - * This config file is for the Lyre prototype 1. - */ - -#define CONFIG_SDRAM_START 0x20000000 - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 130 - -/* define this if the flash memory uses the - * SecureDigital Memory Card protocol */ -#define CONFIG_STORAGE STORAGE_SD -#define HAVE_FLASH_STORAGE - - - - -/* define this if you have a colour LCD */ -#define HAVE_LCD_COLOR - -#define CONFIG_LCD LCD_LYRE_PROTO1 - -/* LCD dimensions */ -#define LCD_WIDTH 128 -#define LCD_HEIGHT 128 -/* sqrt(128^2 + 128^2) / 1.8 = 100.6 */ -#define LCD_DPI 101 -/* The LCD used is just rgb444, 64 colours. We do a bit conversion on LCD - * drivers. */ -#define LCD_DEPTH 16 /* 65536 colours */ -#define LCD_PIXELFORMAT RGB565 /* rgb565 */ - -#define HAVE_ALBUMART - -/* define this to enable bitmap scaling */ -#define HAVE_BMP_SCALING - -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -#define CONFIG_KEYPAD LYRE_PROTO1_PAD - - - - -/* The number of bytes reserved for loadable codecs */ -#define CODEC_SIZE 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x100000 - -/* Lyre prototype 1 do not use I2C, just SPI */ -#define CONFIG_I2C I2C_NONE - -/* Define this if you have the TLV320 audio codec -> controlled by the DSP */ -#define HAVE_TLV320 - -/* TLV320 has no tone controls, so we use the software ones */ -#define HAVE_SW_TONE_CONTROLS - -#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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -#define CONFIG_CPU AT91SAM9260 - -/* Define this to the CPU frequency */ -#define CPU_FREQ 198656000 -#define MCK_FREQ 99328000 -#define SLOW_CLOCK 32768 - -#define BOOTFILE_EXT "lyre_proto1" -#define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" - -/* Define this if a programmable hotkey is mapped */ -//#define HAVE_HOTKEY diff --git a/firmware/export/config/meizum3.h b/firmware/export/config/meizum3.h deleted file mode 100644 index e519d6469c..0000000000 --- a/firmware/export/config/meizum3.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This config file is for Meizu M3 - */ - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 39 - -#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 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 to enable bitmap scaling */ -#define HAVE_BMP_SCALING - -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -/* 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 would like tagcache to build on this target */ -#define HAVE_TAGCACHE - -/* define this if you have a flash memory storage */ -#define HAVE_FLASH_STORAGE - -#define CONFIG_STORAGE STORAGE_NAND - -#define CONFIG_NAND NAND_SAMSUNG - -/* The NAND flash has 2048-byte sectors, and is our only storage */ -#define SECTOR_SIZE 2048 - -/* LCD dimensions */ -#define LCD_WIDTH 176 -#define LCD_HEIGHT 132 -/* sqrt(176^2 + 132^2) / 1.5 = 146.7 */ -#define LCD_DPI 147 -#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 -//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE - - - - -/* 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 the type of audio codec */ -#define HAVE_UDA1380 - -/* 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 0x100000 - -/* 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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging, software can monitor plug and charge state */ -#define CONFIG_CHARGING CHARGING_MONITOR - -/* 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 - -/* 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 - -/* 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 */ -#define MIN_BRIGHTNESS_SETTING 0 -#define MAX_BRIGHTNESS_SETTING 15 -#define DEFAULT_BRIGHTNESS_SETTING 10 - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/meizum6sl.h b/firmware/export/config/meizum6sl.h deleted file mode 100644 index 0e5e8b8c4a..0000000000 --- a/firmware/export/config/meizum6sl.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * This config file is for Meizu M6SL - */ - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 38 - -#define MODEL_NAME "Meizu M6SL" - -/* 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 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 to enable bitmap scaling */ -#define HAVE_BMP_SCALING - -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -/* 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 would like tagcache to build on this target */ -#define HAVE_TAGCACHE - -/* define this if you have a flash memory storage */ -#define HAVE_FLASH_STORAGE - -#define CONFIG_STORAGE STORAGE_NAND - -#define CONFIG_NAND NAND_SAMSUNG - -/* The NAND flash has 512-byte sectors, and is our only storage */ -#define SECTOR_SIZE 512 - -/* LCD dimensions */ -#define LCD_WIDTH 320 -#define LCD_HEIGHT 240 -/* sqrt(320^2 + 240^2) / 2.6 = 153.8 */ -#define LCD_DPI 154 -#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_M6SL_PAD - -//#define AB_REPEAT_ENABLE -//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE - - - - -/* 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 0x100000 - -/* 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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging? FIXME */ -#define CONFIG_CHARGING CHARGING_SIMPLE - -/* 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 - -/* 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 - -/* 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 */ - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/meizum6sp.h b/firmware/export/config/meizum6sp.h deleted file mode 100644 index 972602ffb0..0000000000 --- a/firmware/export/config/meizum6sp.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * This config file is for Meizu M6SP - */ - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 37 - -#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) - -/* FIXME: define actual rates applicable for M6SP */ -#define CODEC_SRCTRL_11025HZ (0x19 << 1) -#define CODEC_SRCTRL_22050HZ (0x1b << 1) -#define CODEC_SRCTRL_44100HZ (0x11 << 1) -#define CODEC_SRCTRL_88200HZ (0x1f << 1) - -/* 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 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 to enable bitmap scaling */ -#define HAVE_BMP_SCALING - -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -/* 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 would like tagcache to build on this target */ -#define HAVE_TAGCACHE - -/* define this if you have a flash memory storage */ -#define HAVE_FLASH_STORAGE - -#define CONFIG_STORAGE STORAGE_NAND - -#define CONFIG_NAND NAND_SAMSUNG - -/* The NAND flash has 2048-byte sectors, and is our only storage */ -#define SECTOR_SIZE 2048 - -/* LCD dimensions */ -#define LCD_WIDTH 240 -#define LCD_HEIGHT 320 -/* sqrt(240^2 + 320^2) / 2.4 = 166.0 */ -#define LCD_DPI 166 -#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 -//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE - - - - -/* 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 0x100000 - -/* 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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging? FIXME */ -#define CONFIG_CHARGING CHARGING_SIMPLE - -/* 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 - -/* 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 - -/* 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 */ - -/* Define this if a programmable hotkey is mapped */ -//#define HAVE_HOTKEY diff --git a/firmware/export/config/mini2440.h b/firmware/export/config/mini2440.h deleted file mode 100644 index b22098e859..0000000000 --- a/firmware/export/config/mini2440.h +++ /dev/null @@ -1,154 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (C) 2009 by Bob Cousins, Lyre Project - * Copyright (C) 2009 by Jorge Pinto, Lyre Project - * - * 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. - * - ****************************************************************************/ - -/* - * This config file is for the Mini2440 - */ - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 131 -#define MODEL_NAME "Mini2440" - -/***************************************************************************/ -/* Hardware Config */ - -/* TODO: ??? */ -#define CONFIG_SDRAM_START 0x30000000 - -/* Flash storage */ -#define HAVE_FLASH_STORAGE -/* define the storage type */ -#define CONFIG_STORAGE STORAGE_SD - -#define HAVE_MULTIVOLUME -#define HAVE_HOTSWAP -#define HAVE_HOTSWAP_STORAGE_AS_MAIN -#define INCLUDE_TIMEOUT_API - -/* Disk storage */ -/* define this if you have a disk storage, i.e. something - that needs spinups and can cause skips when shaked */ -/* #define HAVE_DISK_STORAGE */ - -/* Display */ - - -/* define this if you have a colour LCD */ -#define HAVE_LCD_COLOR -/* The LCD is assumed to be 3.5" TFT touch screen, others are possible */ -#define CONFIG_LCD LCD_MINI2440 -/* LCD dimensions */ -#define LCD_WIDTH 240 -#define LCD_HEIGHT 320 -/* sqrt(240^2 + 320^2) / 3.5 = 114.3 */ -#define LCD_DPI 114 -#define LCD_DPI 114 /* 400 pixels diagonally / 3.5 inch */ -/* The LCD is configured for RGB565 */ -#define LCD_DEPTH 16 /* 65536 colours */ -#define LCD_PIXELFORMAT RGB565 /* rgb565 */ -/* Define this for LCD backlight available */ -/* The Mini2440 supports backlight brightness depending on LCD type */ -/* But the 3.5" LCD touch screen does not support brightness*/ -#define HAVE_BACKLIGHT -#define HAVE_BACKLIGHT_BRIGHTNESS -/* Main LCD backlight brightness range and defaults */ -#define MIN_BRIGHTNESS_SETTING 1 /* 0.5 mA */ -#define MAX_BRIGHTNESS_SETTING 12 /* 32 mA */ -#define DEFAULT_BRIGHTNESS_SETTING 10 /* 16 mA */ - -/* Keypad */ -#define CONFIG_KEYPAD MINI2440_PAD -#define HAVE_TOUCHSCREEN -#define HAVE_BUTTON_DATA - -/* I2C */ -/* We do not use currently use hardware I2C, but does not build without */ -#define CONFIG_I2C I2C_S3C2440 - -/* Define DAC/Codec */ -#define HAVE_UDA1341 - -#define HW_SAMPR_CAPS (SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) - -/* Battery */ -#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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - - - -/***************************************************************************/ -/* Application Config */ - -#define HAVE_ALBUMART -/* define this to enable bitmap scaling */ -#define HAVE_BMP_SCALING -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -#define HAVE_QUICKSCREEN - -/* define this if you have a real-time clock */ -#define CONFIG_RTC RTC_S3C2440 - - - - -/* The number of bytes reserved for loadable codecs */ -#define CODEC_SIZE 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x100000 - -#define CONFIG_CPU S3C2440 - -/* Define this to the CPU frequency */ -#define CPU_FREQ 406000000 -#define MCK_FREQ (CPU_FREQ/4) -#define SLOW_CLOCK 32768 - - -/* Define this if your LCD can set contrast */ -#define HAVE_LCD_CONTRAST -#define MIN_CONTRAST_SETTING 0 -#define MAX_CONTRAST_SETTING 63 -#define DEFAULT_CONTRAST_SETTING 47 /* Match boot contrast */ - -/* USB */ -/* TODO:#define HAVE_USBSTACK */ -#define USB_NONE - -#define HAVE_SERIAL - -/* Hardware controlled charging with monitoring */ -#define CONFIG_CHARGING CHARGING_MONITOR -/*#define POWER_INPUT_BATTERY 0*/ - -#define BOOTFILE_EXT "mini2440" -#define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/mrobe500.h b/firmware/export/config/mrobe500.h index dc39754742..04570411b8 100644 --- a/firmware/export/config/mrobe500.h +++ b/firmware/export/config/mrobe500.h @@ -210,6 +210,7 @@ #define CONFIG_USBOTG USBOTG_M66591 #define HAVE_USBSTACK +#define HAVE_BOOTLOADER_USB_MODE //#define HAVE_USB_POWER //#define USBPOWER_BUTTON BUTTON_POWER //#define USBPOWER_BTN_IGNORE BUTTON_TOUCH diff --git a/firmware/export/config/samsungyps3.h b/firmware/export/config/samsungyps3.h deleted file mode 100644 index 826c44aedf..0000000000 --- a/firmware/export/config/samsungyps3.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This config file is for Samsung YP-S3 - */ - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 53 - -#define MODEL_NAME "Samsumg YP-S3" - -/* 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 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 to enable bitmap scaling */ -#define HAVE_BMP_SCALING - -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -/* 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 would like tagcache to build on this target */ -#define HAVE_TAGCACHE - -/* define this if you have a flash memory storage */ -#define HAVE_FLASH_STORAGE - -#define CONFIG_STORAGE STORAGE_NAND - -#define CONFIG_NAND NAND_SAMSUNG - -/* LCD dimensions */ -#define LCD_WIDTH 176 -#define LCD_HEIGHT 220 -/* sqrt(176^2 + 220^2) / 1.8 = 156.5 */ -#define LCD_DPI 157 -#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 - -/* We have button lights */ -#define HAVE_BUTTON_LIGHT - -#define CONFIG_KEYPAD MEIZU_M3_PAD - -/* We have headphone detection */ -#define HAVE_HEADPHONE_DETECTION - -//#define AB_REPEAT_ENABLE -//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE - - - - -/* define this if you have a real-time clock */ -#define CONFIG_RTC RTC_S35390A - -/* Define the type of audio codec */ -//#define HAVE_WM.... - -/* 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 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x80000 - -/* FM Tuner */ -#define CONFIG_TUNER SI4700 -#define CONFIG_TUNER_XTAL 32768 - -/* assume no tone controls, so we use the software ones */ -#define HAVE_SW_TONE_CONTROLS - -#define BATTERY_CAPACITY_DEFAULT 580 /* default battery capacity */ -#define BATTERY_CAPACITY_MIN 580 /* min. capacity selectable */ -#define BATTERY_CAPACITY_MAX 580 /* max. capacity selectable */ -#define BATTERY_CAPACITY_INC 0 /* capacity increment */ - - -#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging, software can monitor plug and charge state */ -#define CONFIG_CHARGING CHARGING_MONITOR - -/* Define this if your LCD can set contrast */ -//#define HAVE_LCD_CONTRAST - -/* We have a Samsung S5L8700 */ -#define CONFIG_CPU S5L8700 - -/* We use the S5L8700 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 200000000 - -/* Define this if you have ATA power-off control */ -//#define HAVE_ATA_POWER_OFF - -/* USB */ -//#define HAVE_USBSTACK -#define USB_VENDOR_ID 0x04E8 -#define USB_PRODUCT_ID 0x5090 - -/* Define this if you have adjustable CPU frequency */ -#define HAVE_ADJUSTABLE_CPU_FREQ - -#define BOOTFILE_EXT "yps3" -#define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" - -//#define BOOTLOADER_ENTRYPOINT 0x001F0000 -//#define FLASH_ENTRYPOINT 0x00001000 -//#define FLASH_MAGIC 0xfbfbfbf1 - -/* 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 */ -#define MIN_BRIGHTNESS_SETTING 0 -#define MAX_BRIGHTNESS_SETTING 15 -#define DEFAULT_BRIGHTNESS_SETTING 10 - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h index 190d5a61b8..f8e05be108 100644 --- a/firmware/export/config/sansafuzeplus.h +++ b/firmware/export/config/sansafuzeplus.h @@ -19,7 +19,7 @@ // HW can do it but we don't have the IRAM for mix buffers //#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192 -#define HW_SAMPR_CAPS SAMPR_CAP_ALL_48 +#define HW_SAMPR_CAPS SAMPR_CAP_ALL_96 /* define this if you have recording possibility */ #define HAVE_RECORDING diff --git a/firmware/export/config/sansaview.h b/firmware/export/config/sansaview.h deleted file mode 100644 index 238102d567..0000000000 --- a/firmware/export/config/sansaview.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * This config file is for the Sandisk Sansa View - */ - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 63 -#define MODEL_NAME "Sandisk View" - -#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 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 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 would like tagcache to build on this target */ -#define HAVE_TAGCACHE - -/* LCD dimensions */ -#define LCD_WIDTH 240 -#define LCD_HEIGHT 320 -/* sqrt(240^2 + 320^2) / 2.4 = 166.7 */ -#define LCD_DPI 167 -#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 -#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 - -/* The only difference is that the power/hold is on the left instead of right on Fuze */ -#define CONFIG_KEYPAD SANSA_FUZE_PAD - -/* Define this to have CPU boosted while scrolling in the UI */ -#define HAVE_GUI_BOOST - -/* Define this to enable morse code input */ -#define HAVE_MORSE_INPUT - - - -/* There is no hardware tone control */ -/* #define HAVE_SW_TONE_CONTROLS*/ -#define HAVE_WM8731 - -/* define this if you have a real-time clock */ -#ifndef BOOTLOADER -/* #define CONFIG_RTC RTC_ */ -#endif - -/* Define this if you have a software controlled poweroff */ -#define HAVE_SW_POWEROFF - -/* Required for MicroSD cards */ -#define HAVE_FAT16SUPPORT - -/* 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 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 to activate advanced wheel acceleration code */ -#define HAVE_WHEEL_ACCELERATION -/* 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 CONFIG_STORAGE STORAGE_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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Charging implemented in a target-specific algorithm */ -#define CONFIG_CHARGING CHARGING_SIMPLE -#define HAVE_POWEROFF_WHILE_CHARGING - -/* define current usage levels */ -#define CURRENT_NORMAL 30 /* Toni's measurements in Nov 2008 */ -#define CURRENT_BACKLIGHT 40 /* Screen is about 20, blue LEDs are another 20, so 40 if both */ -#define CURRENT_RECORD 30 /* flash player, so this is just unboosted current*/ - -/* define this if the unit can be powered or charged via USB */ -#define HAVE_USB_POWER - -/* Define this if you have a PortalPlayer PP5024 */ -#define CONFIG_CPU PP6100 - -/* 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 250000000 - -/* Type of LCD */ -#define CONFIG_LCD LCD_VIEW - -#ifndef BOOTLOADER -#define HAVE_MULTIDRIVE -#define NUM_DRIVES 2 -#define HAVE_HOTSWAP -#endif - -/* 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 0x74b1 - -/* 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 BOOTDIR "/.rockbox" - -#define ICODE_ATTR_TREMOR_NOT_MDCT - -#define INCLUDE_TIMEOUT_API - -/** 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 - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/zenvision.h b/firmware/export/config/zenvision.h deleted file mode 100644 index eb94c84ca7..0000000000 --- a/firmware/export/config/zenvision.h +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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. - * - ****************************************************************************/ - -/* - * This config file is for the Creative Zen Vision - */ - -#define CONFIG_SDRAM_START 0x00900000 - -#define CREATIVE_ZV 1 - -#define MODEL_NAME "Creative Zen Vision" - -/* This makes it part of the Creative Zen Vision family :) */ -#define CREATIVE_ZVx 1 - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 28 - -/* define this if you use an ATA controller */ -#define CONFIG_STORAGE STORAGE_ATA - -/*define this if the ATA controller and method of USB access support LBA48 */ -#define HAVE_LBA48 - - - - -/* 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 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_PORTRAIT - -#define LCD_WIDTH 640 -#define LCD_HEIGHT 480 -/* sqrt(640^2 + 480^2) / 2.5 = 320.0 */ -#define LCD_DPI 320 - -#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 CONFIG_KEYPAD CREATIVEZV_PAD -#define HAVE_HEADPHONE_DETECTION -//#define HAVE_TOUCHPAD - -/* Define this to enable morse code input */ -#define HAVE_MORSE_INPUT - - - - -/* define this if you have a real-time clock */ -//#define CONFIG_RTC RTC_RX5X348AB - -/* define this if you have a disk storage, i.e. something - that needs spinups and can cause skips when shaked */ -#define HAVE_DISK_STORAGE - -/* 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 -//TODO: enable this back - -/* The number of bytes reserved for loadable codecs */ -#define CODEC_SIZE 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x100000 - -/* Define this if you have the TLV320 audio codec -> controlled by the DSP */ -#define HAVE_TLV320 - -#define CONFIG_I2C I2C_DM320 - -/* TLV320 has no tone controls, so we use the software ones */ -#define HAVE_SW_TONE_CONTROLS - -/*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ - SAMPR_CAP_11)*/ - -#define BATTERY_CAPACITY_DEFAULT 1250 /* 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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging with monitoring */ -//#define CONFIG_CHARGING CHARGING_MONITOR - -/* Define this if you have a TI TMS320DM320 */ -#define CONFIG_CPU DM320 - -/* 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 - -/* Define this if you have adjustable CPU frequency */ -/* #define HAVE_ADJUSTABLE_CPU_FREQ */ - -#define BOOTFILE_EXT "zv" -#define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" - -#define CONFIG_USBOTG USBOTG_ISP1583 -#define HAVE_USBSTACK -//#define HAVE_BOOTLOADER_USB_MODE -#define USB_VENDOR_ID 0x041e -#define USB_PRODUCT_ID 0x4133 -#define USB_NUM_ENDPOINTS 7 - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/zenvisionm30gb.h b/firmware/export/config/zenvisionm30gb.h deleted file mode 100644 index 236a153a3c..0000000000 --- a/firmware/export/config/zenvisionm30gb.h +++ /dev/null @@ -1,175 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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. - * - ****************************************************************************/ - -/* - * This config file is for the Creative Zen Vision:M - */ - -#define CONFIG_SDRAM_START 0x00900000 - -#define CREATIVE_ZVM 1 - -#define MODEL_NAME "Creative Zen Vision:M" - -/* This makes it part of the Creative Zen Vision family :) */ -#define CREATIVE_ZVx 1 - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 26 - -/* define this if you use an ATA controller */ -#define CONFIG_STORAGE STORAGE_ATA - -/*define this if the ATA controller and method of USB access support LBA48 */ -#define HAVE_LBA48 - - - - -/* 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 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_PORTRAIT - -#define LCD_WIDTH 320 -#define LCD_HEIGHT 240 -/* sqrt(320^2 + 240^2) / 2.5 = 160.0 */ -#define LCD_DPI 160 - -#define LCD_DEPTH 16 /* 65k colours */ -#define LCD_PIXELFORMAT RGB565 /* rgb565 */ - -/* Define this if your LCD can be enabled/disabled */ -/* Disabled until properly working -#define HAVE_LCD_ENABLE */ - -#define CONFIG_KEYPAD CREATIVEZVM_PAD -#define HAVE_HEADPHONE_DETECTION -//#define HAVE_TOUCHPAD - -/* Define this to enable morse code input */ -#define HAVE_MORSE_INPUT - - - - -/* define this if you have a real-time clock */ -//#define CONFIG_RTC RTC_RX5X348AB - -/* define this if you have a disk storage, i.e. something - that needs spinups and can cause skips when shaked */ -#define HAVE_DISK_STORAGE - -/* 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 -//TODO: enable this back - -/* The number of bytes reserved for loadable codecs */ -#define CODEC_SIZE 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x100000 - -/* Define this if you have the TLV320 audio codec -> controlled by the DSP */ -#define HAVE_TLV320 - -#define CONFIG_I2C I2C_DM320 - -/* TLV320 has no tone controls, so we use the software ones */ -#define HAVE_SW_TONE_CONTROLS - -/*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ - SAMPR_CAP_11)*/ - -#define BATTERY_CAPACITY_DEFAULT 1250 /* 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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging with monitoring */ -//#define CONFIG_CHARGING CHARGING_MONITOR - -/* Define this if you have a TI TMS320DM320 */ -#define CONFIG_CPU DM320 - -/* 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 - -/* 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" - -#define CONFIG_USBOTG USBOTG_ISP1583 -#define HAVE_USBSTACK -//#define HAVE_BOOTLOADER_USB_MODE -#define USB_VENDOR_ID 0x041e -#define USB_PRODUCT_ID 0x4133 -#define USB_NUM_ENDPOINTS 7 - -/*DEBUGGING!*/ -/* -#define THREAD_EXTRA_CHECKS 1 -#define DEBUG 1 -#define debug(msg) printf(msg) -#define BUTTON_DEBUG -*/ - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/config/zenvisionm60gb.h b/firmware/export/config/zenvisionm60gb.h deleted file mode 100644 index 64f6925328..0000000000 --- a/firmware/export/config/zenvisionm60gb.h +++ /dev/null @@ -1,167 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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. - * - ****************************************************************************/ - -/* - * This config file is for the Creative Zen Vision:M 60GB - */ - -#define CONFIG_SDRAM_START 0x00900000 - -#define CREATIVE_ZVM60GB 1 - -#define MODEL_NAME "Creative Zen Vision:M 60GB" - -/* This makes it part of the Creative Zen Vision family :) */ -#define CREATIVE_ZVx 1 - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 27 - -/* define this if you use an ATA controller */ -#define CONFIG_STORAGE STORAGE_ATA - -/*define this if the ATA controller and method of USB access support LBA48 */ -#define HAVE_LBA48 - - - - -/* 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 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_PORTRAIT - -#define LCD_WIDTH 320 -#define LCD_HEIGHT 240 -/* sqrt(320^2 + 240^2) / 2.5 = 160.0 */ -#define LCD_DPI 160 - -#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 CONFIG_KEYPAD CREATIVEZVM_PAD -#define HAVE_HEADPHONE_DETECTION -//#define HAVE_TOUCHPAD - -/* Define this to enable morse code input */ -#define HAVE_MORSE_INPUT - - - - -/* define this if you have a real-time clock */ -//#define CONFIG_RTC RTC_RX5X348AB - -/* define this if you have a disk storage, i.e. something - that needs spinups and can cause skips when shaked */ -#define HAVE_DISK_STORAGE - -/* 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 -//TODO: enable this back - -/* The number of bytes reserved for loadable codecs */ -#define CODEC_SIZE 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x100000 - -/* Define this if you have the TLV320 audio codec -> controlled by the DSP */ -#define HAVE_TLV320 - -#define CONFIG_I2C I2C_DM320 - -/* TLV320 has no tone controls, so we use the software ones */ -#define HAVE_SW_TONE_CONTROLS - -/*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ - SAMPR_CAP_11)*/ - -#define BATTERY_CAPACITY_DEFAULT 1250 /* 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 CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Hardware controlled charging with monitoring */ -//#define CONFIG_CHARGING CHARGING_MONITOR - -/* Define this if you have a TI TMS320DM320 */ -#define CONFIG_CPU DM320 - -/* 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 - -/* Define this if you have adjustable CPU frequency */ -/* #define HAVE_ADJUSTABLE_CPU_FREQ */ - -#define BOOTFILE_EXT "zvm60" -#define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" - -/* #define CONFIG_USBOTG USBOTG_ISP1761 */ -#define CONFIG_USBOTG USBOTG_ISP1583 -#define HAVE_USBSTACK -//#define HAVE_BOOTLOADER_USB_MODE -#define USB_VENDOR_ID 0x041e -#define USB_PRODUCT_ID 0x4133 -#define USB_NUM_ENDPOINTS 7 - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY diff --git a/firmware/export/jz4760b.h b/firmware/export/jz4760b.h index 14b5a71097..5f83887b99 100644 --- a/firmware/export/jz4760b.h +++ b/firmware/export/jz4760b.h @@ -6741,7 +6741,7 @@ static __inline__ int __mdmac_get_irq(void) #define MSC_CMDAT_RESPONSE_R4 (0x4 << MSC_CMDAT_RESPONSE_BIT) /* Format R4 */ #define MSC_CMDAT_RESPONSE_R5 (0x5 << MSC_CMDAT_RESPONSE_BIT) /* Format R5 */ #define MSC_CMDAT_RESPONSE_R6 (0x6 << MSC_CMDAT_RESPONSE_BIT) /* Format R6 */ - #define MSC_CMDAT_RESRONSE_R7 (0x7 << MSC_CMDAT_RESPONSE_BIT) /* Format R7 */ + #define MSC_CMDAT_RESPONSE_R7 (0x7 << MSC_CMDAT_RESPONSE_BIT) /* Format R7 */ #define CMDAT_DMA_EN (1 << 8) #define CMDAT_INIT (1 << 7) diff --git a/firmware/export/sd.h b/firmware/export/sd.h index 01ad760f86..3895fdc0c9 100644 --- a/firmware/export/sd.h +++ b/firmware/export/sd.h @@ -93,6 +93,7 @@ int sd_num_drives(int first_drive); #define SD_READ_MULTIPLE_BLOCK 18 #define SD_SEND_NUM_WR_BLOCKS 22 /* acmd22 */ #define SD_UC_ADDRESS_EXTENSION 22 +#define SD_SET_BLOCK_COUNT 23 #define SD_SET_WR_BLK_ERASE_COUNT 23 /* acmd23 */ #define SD_WRITE_BLOCK 24 #define SD_WRITE_MULTIPLE_BLOCK 25 diff --git a/firmware/export/sdmmc.h b/firmware/export/sdmmc.h index ed075f82a3..01158a0061 100644 --- a/firmware/export/sdmmc.h +++ b/firmware/export/sdmmc.h @@ -51,7 +51,7 @@ typedef struct unsigned int current_bank; #endif - unsigned int sd2plus; /* SD 2.0 or better */ + unsigned int sd2plus; /* SD 2.0 or better */ } tCardInfo; #if (CONFIG_STORAGE & STORAGE_SD) diff --git a/firmware/export/sdmmc_host.h b/firmware/export/sdmmc_host.h index 1d00c94a27..3d6c7fbb0f 100644 --- a/firmware/export/sdmmc_host.h +++ b/firmware/export/sdmmc_host.h @@ -207,6 +207,9 @@ struct sdmmc_host_config uint32_t bus_widths; uint32_t bus_clocks; + /* Max number of blocks in a multiblock transfer */ + int max_nr_blocks; + /* Set to true if the device is removable at runtime */ bool is_removable; }; diff --git a/firmware/kernel/tick.c b/firmware/kernel/tick.c index c524560687..6fe2bf4305 100644 --- a/firmware/kernel/tick.c +++ b/firmware/kernel/tick.c @@ -34,7 +34,7 @@ void (*tick_funcs[MAX_NUM_TICK_TASKS+1])(void); #if !defined(CPU_PP) || !defined(BOOTLOADER) || \ defined(HAVE_BOOTLOADER_USB_MODE) -volatile long current_tick SHAREDDATA_ATTR = 0; +volatile long current_tick SHAREDBSS_ATTR; #endif /* - Timer initialization and interrupt handler is defined at diff --git a/firmware/reggen/cortex-m.regs b/firmware/reggen/cortex-m.regs index 4be406b928..cb95bed5cf 100644 --- a/firmware/reggen/cortex-m.regs +++ b/firmware/reggen/cortex-m.regs @@ -168,3 +168,10 @@ CM_SYSTICK @ 0xe000e000 : block { 23 00 TENMS } } + +// Debug +CM_DEBUG @ 0xe000edf0 : block { + DHCSR @ 0x00 : reg { + 0 C_DEBUGEN + } +} diff --git a/firmware/sound.c b/firmware/sound.c index 6f6a37cca3..0e43f38f5a 100644 --- a/firmware/sound.c +++ b/firmware/sound.c @@ -30,10 +30,6 @@ #include "settings.h" /* sound_current */ #endif -#ifdef HAVE_SW_VOLUME_CONTROL -#include "pcm_sw_volume.h" -#endif /* HAVE_SW_VOLUME_CONTROL */ - /* Define sound_setting_entries table */ #define AUDIOHW_SOUND_SETTINGS_ENTRIES #include "audiohw_settings.h" diff --git a/firmware/storage.c b/firmware/storage.c index 5134e0f0e3..f6a168dabb 100644 --- a/firmware/storage.c +++ b/firmware/storage.c @@ -229,7 +229,7 @@ static void NORETURN_ATTR storage_thread(void) break; #endif /* HAVE_HOTSWAP */ -#ifndef USB_NONE +#if !defined(USB_NONE) && (!defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_USB_MODE)) case SYS_USB_CONNECTED: case SYS_USB_DISCONNECTED: bdcast = 0; diff --git a/firmware/target/arm/at91sam/boot.lds b/firmware/target/arm/at91sam/boot.lds deleted file mode 100644 index 2497e09958..0000000000 --- a/firmware/target/arm/at91sam/boot.lds +++ /dev/null @@ -1,81 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(reset_handler) -STARTUP(target/arm/at91sam/lyre_proto1/crt0.o) - -#define DRAMSIZE (MEMORYSIZE * 0x100000) -#define DRAMORIG 0x20000000 -#define IRAM0ORIG 0x200000 -#define IRAM0SIZE 4K -#define IRAM1ORIG 0x300000 -#define IRAM1SIZE 4K -#define STACKSIZE 2k - -MEMORY -{ - DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE - IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE -} - -SECTIONS -{ - /* We will put Rockbox bootloader at the last 1MByte of the SDRAM. */ - - /* Example of a section: - * .section VMA(Virtual Memory Address) : LMA(Load Memory Address). - * VMA and LMA addresses can be verified by doing: - * "arm-elf-objdump -h bootloader.elf". */ - - .vectors 0 : AT (DRAMORIG + DRAMSIZE - 1M) - { - _start_vectors_section = .; - KEEP(*(.vectors)) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); - _end_vectors_section = .; - } - - .text (DRAMORIG + DRAMSIZE -1M + SIZEOF(.vectors)) : \ - AT (DRAMORIG + DRAMSIZE -1M + SIZEOF(.vectors)) - { - *(.text) - *(.text*) - *(.icode) - *(.icode*) - *(.rodata) - *(.rodata*) - . = ALIGN(4); - } - - /* Initialized variables are placed on SDRAM, right after .vectors section. */ - /* Data section: VMA is the same as the LMA, right after the end of .vector */ - .data . : - { - *(.data) - *(.data*) - . = ALIGN(4); - _end_data_section = .; - } - - /* Uninitialized variables are placed at SDRAM, right after .text section. */ - .bss (NOLOAD) : - - { - _start_bss_section = .; - *(.bss) /* Bss section contains all uninitialized data generated by the compiler. */ - *(.bss*) - *(COMMON) - . = ALIGN(4); - _end_bss_section = .; - } - - /* Stack is placed at SDRAM, right after .bss section. */ - .stack . : - { - *(.stack) - stackbegin = .; - . += STACKSIZE; - stackend = .; - } -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/adc-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/adc-lyre_proto1.c deleted file mode 100644 index d3674055ab..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/adc-lyre_proto1.c +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 "adc.h" - -void adc_init(void) -{ -} - -/* Called to get the recent ADC reading */ -inline unsigned short adc_read(int channel) -{ - (void)channel; - return 0; -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/adc-target.h b/firmware/target/arm/at91sam/lyre_proto1/adc-target.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c deleted file mode 100644 index b60449417a..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/backlight-lyre_proto1.c +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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. - * - ****************************************************************************/ - -void backlight_hw_brightness(int brightness) -{ - (void)brightness; -} - -void backlight_hw_on(void) -{ - -} - -void backlight_hw_off(void) -{ - -} - -void buttonlight_hw_on(void) -{ - -} - -void buttonlight_hw_off(void) -{ - -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/backlight-target.h b/firmware/target/arm/at91sam/lyre_proto1/backlight-target.h deleted file mode 100644 index f4e253abbe..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/backlight-target.h +++ /dev/null @@ -1,26 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 - - -#endif diff --git a/firmware/target/arm/at91sam/lyre_proto1/button-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/button-lyre_proto1.c deleted file mode 100644 index 2d38803115..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/button-lyre_proto1.c +++ /dev/null @@ -1,99 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 "at91sam9260.h" -#include "button.h" - -#define BUTTON_01 AT91C_PIO_PB4 -#define BUTTON_02 AT91C_PIO_PB5 -#define BUTTON_03 AT91C_PIO_PB27 -#define BUTTON_04 AT91C_PIO_PB26 -#define BUTTON_05 AT91C_PIO_PB25 -#define BUTTON_06 AT91C_PIO_PB24 -#define BUTTON_07 AT91C_PIO_PB22 -#define BUTTON_08 AT91C_PIO_PB23 - -void button_init_device(void) -{ - /* Enable the periph clock for the PIO controller */ - /* This is mandatory when PIO are configured as input */ - AT91C_PMC_PCER = (1 << AT91C_ID_PIOB); - - /* Set the PIO line in input */ - AT91C_PIOB_ODR = (BUTTON_01 | - BUTTON_02 | - BUTTON_03 | - BUTTON_04 | - BUTTON_05 | - BUTTON_06 | - BUTTON_07 | - BUTTON_08); - - /* Set the PIO controller in PIO mode instead of peripheral mode */ - AT91C_PIOB_PER = (BUTTON_01 | - BUTTON_02 | - BUTTON_03 | - BUTTON_04 | - BUTTON_05 | - BUTTON_06 | - BUTTON_07 | - BUTTON_08); -} - -bool button_hold(void) -{ - return (0); -} - -/* - * Get button pressed from hardware - */ -int button_read_device(void) -{ - uint32_t buttons = AT91C_PIOB_PDSR; - uint32_t ret = 0; - - if ((buttons & BUTTON_01) == 0) - ret |= BUTTON_UP; - - if ((buttons & BUTTON_02) == 0) - ret |= BUTTON_RIGHT; - - if ((buttons & BUTTON_03) == 0) - ret |= BUTTON_PLAY; - - if ((buttons & BUTTON_04) == 0) - ret |= BUTTON_SELECT; - - if ((buttons & BUTTON_05) == 0) - ret |= BUTTON_LEFT; - - if ((buttons & BUTTON_06) == 0) - ret |= BUTTON_DOWN; - - if ((buttons & BUTTON_07) == 0) - ret |= BUTTON_STOP; - - if ((buttons & BUTTON_08) == 0) - ret |= BUTTON_MENU; - - return ret; -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/button-target.h b/firmware/target/arm/at91sam/lyre_proto1/button-target.h deleted file mode 100644 index bfba483df1..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/button-target.h +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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_ - -#define BUTTON_SELECT 0x00000001 -#define BUTTON_MENU 0x00000002 -#define BUTTON_PLAY 0x00000004 -#define BUTTON_STOP 0x00000008 - -#define BUTTON_LEFT 0x00000010 -#define BUTTON_RIGHT 0x00000020 -#define BUTTON_UP 0x00000040 -#define BUTTON_DOWN 0x00000080 - -#define BUTTON_MAIN (BUTTON_UP|BUTTON_DOWN|BUTTON_RIGHT|BUTTON_LEFT \ - |BUTTON_SELECT|BUTTON_MENU|BUTTON_PLAY \ - |BUTTON_STOP) - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/at91sam/lyre_proto1/crt0.S b/firmware/target/arm/at91sam/lyre_proto1/crt0.S deleted file mode 100644 index 029c1b7aec..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/crt0.S +++ /dev/null @@ -1,286 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 "at91sam9260.h" - -#define DRAMORIG AT91C_EBI_SDRAM_32BIT -#define DRAMSIZE (MEMORYSIZE * 0x100000) -#define IRAM0ORIG AT91C_IRAM_1 -#define IRAM0SIZE AT91C_IRAM_1_SIZE -#define TOP_OF_MEMORY (IRAM0ORIG + IRAM0SIZE) -#define ABT_STACK_SIZE 8*3*4 -#define IRQ_STACK_SIZE 8*3*4 - -#define ARM_MODE_ABT 0x17 -#define ARM_MODE_FIQ 0x11 -#define ARM_MODE_IRQ 0x12 -#define ARM_MODE_SVC 0x13 -#define ARM_MODE_UND 0x1b -#define ARM_MODE_SYS 0x1f - -#define I_BIT 0x80 -#define F_BIT 0x40 - - -/* Application startup entry point */ -.globl reset_handler - -.align 4 - -.section .vectors -.arm - - -/* Exception vectors (should be a branch to be detected as a valid code - * by the rom) */ -_exception_vectors: -reset_vector: - ldr pc, =reset_handler -undef_vector: - b undef_vector /* Undefined Instruction */ -swi_vector: - b swi_vector /* Software Interrupt */ -pabt_vector: - ldr pc, =pabt_handler /* Prefetch Abort */ -dabt_vector: - ldr pc, =dabt_handler /* Data Abort */ -rsvd_vector: - b rsvd_vector /* reserved */ -irq_vector: - b irq_handler /* IRQ : read the AIC */ -fiq_vector: -/*----------------------------------------------------------------------------- - *- Function : fiq_handler - *- Treatments : FIQ (Fast Interrupt) Interrupt Handler. - *- Called Functions : - *---------------------------------------------------------------------------*/ -fiq_handler: -pabt_handler: -dabt_handler: - b fiq_handler - -/*----------------------------------------------------------------------------- - *- Function : irq_handler - *- Treatments : IRQ Controller Interrupt Handler. - *- Called Functions : AIC_IVR[interrupt] - *---------------------------------------------------------------------------*/ -irq_handler: -/*- Manage Exception Entry */ -/*- Adjust and save LR_irq in IRQ stack - (LR - Link Register) */ - sub lr, lr, #4 - stmfd sp!, {lr} -/*- Save r0 and SPSR (Saved Program Status Register) in IRQ stack */ - mrs r14, SPSR - stmfd sp!, {r0,r14} - -/*- Write in the IVR (Interrupt Vector Register) to support Protect Mode */ -/*- No effect in Normal Mode */ -/*- De-assert the NIRQ and clear the source in Protect Mode */ - ldr r14, =AT91C_BASE_AIC - ldr r0 , [r14, #AIC_IVR] - str r14, [r14, #AIC_IVR] - -/*- Enable Interrupt and Switch in Supervisor Mode */ - msr CPSR_c, #ARM_MODE_SVC - -/*- Save scratch/used registers and LR in User Stack */ - stmfd sp!, {r1-r3, r12, r14} - -/*- Branch to the routine pointed by the AIC_IVR */ - mov r14, pc - bx r0 - -/*- Restore scratch/used registers and LR from User Stack */ - ldmia sp!, {r1-r3, r12, r14} - -/*- Disable Interrupt and switch back in IRQ mode */ - msr CPSR_c, #ARM_MODE_IRQ | I_BIT - -/*- Mark the End of Interrupt on the AIC */ - ldr r14, =AT91C_BASE_AIC - str r14, [r14, #AIC_EOICR] - -/*- Restore SPSR_irq and r0 from IRQ stack */ - ldmia sp!, {r0,r14} - msr SPSR_cxsf, r14 - -/*- Restore adjusted LR_irq from IRQ stack directly in the PC */ - ldmia sp!, {pc}^ - -/*----------------------------------------------------------------------------- - *- Function : reset_handler - *- Treatments : Reset Interrupt Handler. - *- Called Functions : lowlevel_init - * main - *---------------------------------------------------------------------------*/ -.section .text -reset_handler: -/*----------------------------------------------------------------------------- - *- Low level Init is performed in a C function: lowlevel_init - *- Init Stack Pointer to a valid memory area before calling lowlevel_init - * - * Put Stack Pointer on end of IRAM 1 and branches to lowlevel_init function. - *---------------------------------------------------------------------------*/ -/*- Temporary stack in internal RAM for Low Level Init execution */ -_low_level_init: - ldr r2, =_litteral_pool_lowlevel_init /* Load r2 with the address of - * _litteral_pool_lowlevel_init - */ - ldmia r2, {r0, r1} /* r0 = lowlevel_init and r1 = TOP_OF_MEMORY */ - mov sp, r1 /* sp (Stack Pointer) = TOP_OF_MEMORY (end of IRAM 1) */ - mov lr, pc /* lr (Link register) = pc (Program Counter) */ - bx r0 /* Branch on C function (interworking) -- branch to - * lowlevel_init - */ - -/*----------------------------------------------------------------------------- - *- Setup the stack for each mode - * - * Executes this code after returning from lowlevel_init fucntion. - * Configures Abort Mode Stack + Interrupt Mode Stack + Supervisor Mode Stack, - * reserves 3 blocks, one for each mode and they start at end of IRAM 1. - *---------------------------------------------------------------------------*/ -_stack_init: - ldr r2, =_litteral_pool_stack_init - ldmia r2, {r0, r1, r2} /* r0 = TOP_OF_MEMORY (end of IRAM 1); - * r1 = ABT_STACK_SIZE; - * r2 = IRQ_STACK_SIZE - */ - - /*- Set up Interrupt Mode and set IRQ Mode Stack */ - msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT /* Enter in Mode Interrupt - * and disable IRQ (Interrupt) and FIQ (Fast Interrupt) - */ - - mov sp, r0 /* sp (Interrupt Mode Stack Pointer) = - * TOP_OF_MEMORY (end of IRAM 1) - */ - - /*- Set up Abort Mode and set ABT Mode Stack */ - msr CPSR_c, #ARM_MODE_ABT | I_BIT | F_BIT /* Enter in Mode Abort - * and disable IRQ (Interrupt) and FIQ (Fast Interrupt) - */ - - mov sp, r0 /* sp (ABT Mode Stack Pointer) = TOP_OF_MEMORY - * (end of IRAM 1) - */ - - /*- Set up Abort Mode and set ABT Mode Stack */ - msr CPSR_c, #ARM_MODE_UND | I_BIT | F_BIT /* Enter in Mode Undefined - * and disable IRQ (Interrupt) and FIQ (Fast Interrupt) - */ - - mov sp, r0 /* sp (ABT Mode Stack Pointer) = TOP_OF_MEMORY - * (end of IRAM 1) - */ - - /*- Set up Supervisor Mode and set Supervisor Mode Stack */ - msr CPSR_c, #ARM_MODE_SVC | I_BIT | F_BIT - mov sp, r0 - - sub r0, r0, r2 /* Put on r0 the new address for next - * Stack (Sys Mode) - */ - - /*- Set up Sys Mode and set Sys Mode Stack */ - msr CPSR_c, #ARM_MODE_SYS | F_BIT /* Enter in Sys Mode - * and enable IRQ (Interrupt) and disable FIQ (Fast Interrupt) - */ - mov sp, r0 - -/*----------------------------------------------------------------------------- - *- Segments initialization - *---------------------------------------------------------------------------*/ -/* Copy the vectors section code from the LMA address to the LVA address */ -_init_vectors: - ldr r1, =_litteral_pool_vectors /* Load r1 with the address of - * _litteral_pool_vectors - */ - ldmia r1, {r2, r3, r4} /* r2 = DRAMORIG; r3 = _start_vectors_section; - * r4 = _end_vectors_section; - */ -1: - cmp r3, r4 /* Compare r3 with r4 (r3 - r4) */ - ldrcc r5, [r2], #4 /* if (_start_vectors_section < _end_vectors_section) - * { r5 = [r2]; r2 = r2 + 4; } - */ - strcc r5, [r3], #4 /* if (_start_vectors_section < _end_vectors_section) - * { [r3] = r5; r3 = r3 + 4; } - */ - bcc 1b /* loop while (_start_vectors_section < _end_vectors_section) */ - -/* Clear the bss segment */ -_init_bss: - ldr r2, =_litteral_pool_bss - ldmia r2, {r3, r4} /* r3 = _start_bss_section; r4 = _end_bss_section */ - mov r2, #0 /* r2 = 0 */ -1: - cmp r3, r4 /* Compare --> (_start_bss_section - _end_bss_section) */ - strcc r2, [r3], #4 /* if (_start_bss_section < _end_bss_section) { - * [r3] = 0; r3 = r3 + 4; } - */ - bcc 1b /* loop while _start_bss_section < _end_bss_section */ - -/* Set up some stack and munge it with 0xdeadbeef */ - ldr sp, =stackend - mov r3, sp - ldr r2, =stackbegin - ldr r4, =0xdeadbeef - -stackmunge: - cmp r3, r2 - strhi r4, [r2], #4 - bhi stackmunge - -/*----------------------------------------------------------------------------- - *- Branch to the main - *---------------------------------------------------------------------------*/ -_branch_main: - ldr r0, =main - mov lr, pc - bx r0 - -/*----------------------------------------------------------------------------- - *- Litteral pools - *---------------------------------------------------------------------------*/ -_litteral_pool_lowlevel_init: - .word lowlevel_init - .word TOP_OF_MEMORY /* Default SVC stack after power up */ - -_litteral_pool_stack_init: - .word TOP_OF_MEMORY /* Top of the stack */ - .word ABT_STACK_SIZE /* ABT stack size */ - .word IRQ_STACK_SIZE /* IRQ stack size */ - -_litteral_pool_bss: - .word _start_bss_section - .word _end_bss_section - -_litteral_pool_vectors: -#if defined(BOOTLOADER) - .word (DRAMORIG + DRAMSIZE - 0x100000) /* LMA address of vectors are at - * end of DRAM minus 1MByte - */ -#else - .word DRAMORIG /* LMA address of vectors are at DRAMORIG */ -#endif - .word _start_vectors_section - .word _end_vectors_section diff --git a/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c deleted file mode 100644 index 320833a55b..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/debug-lyre_proto1.c +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 -#include "system.h" - -bool dbg_ports(void) -{ - return false; -} - -bool dbg_hw_info(void) -{ - return false; -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/kernel-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/kernel-lyre_proto1.c deleted file mode 100644 index 4d7167b3ba..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/kernel-lyre_proto1.c +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 "system.h" -#include "kernel.h" -#include "timer.h" -#include "thread.h" -#include "at91sam9260.h" - -/*----------------------------------------------------------------------------- - * Function Name : pitc_handler - * Object : Handler for PITC interrupt - *---------------------------------------------------------------------------*/ -void pitc_handler(void) -{ - unsigned long pivr = 0; - unsigned long pisr = 0; - - /* Read the PISR */ - pisr = AT91C_PITC_PISR & AT91C_PITC_PITS; - - /* Read the PIVR. It acknowledges the IT */ - pivr = AT91C_PITC_PIVR; - - /* Run through the list of tick tasks */ - call_tick_tasks(); -} - -void tick_start(unsigned int interval_in_ms) -{ - volatile unsigned long pimr = 0; - - /* Configure a resolution of 1 ms */ - AT91C_PITC_PIMR = MCK_FREQ / (((16 * 1000) - 1) / interval_in_ms); - - /* Enable interrupts */ - /* Disable the interrupt on the interrupt controller */ - AT91C_AIC_IDCR = (1 << AT91C_ID_SYS); - - /* Save the interrupt handler routine pointer and the interrupt priority */ - AT91C_AIC_SVR(AT91C_ID_SYS) = (unsigned long) pitc_handler; - - /* Store the Source Mode Register */ - AT91C_AIC_SMR(AT91C_ID_SYS) = AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE | \ - AT91C_AIC_PRIOR_LOWEST; - /* Clear the interrupt on the interrupt controller */ - AT91C_AIC_ICCR = (1 << AT91C_ID_SYS); - - /* Enable the interrupt on the interrupt controller */ - AT91C_AIC_IECR = (1 << AT91C_ID_SYS); - - /* Enable the interrupt on the pit */ - pimr = AT91C_PITC_PIMR; - AT91C_PITC_PIMR = pimr | AT91C_PITC_PITIEN; - - /* Enable the pit */ - pimr = AT91C_PITC_PIMR; - AT91C_PITC_PIMR = pimr | AT91C_PITC_PITEN; -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/lcd-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/lcd-lyre_proto1.c deleted file mode 100644 index 258b2052a6..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/lcd-lyre_proto1.c +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 "lcd.h" - -/* Update the display. - This must be called after all other LCD functions that change the display */ -void lcd_update(void) -{ - -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/lcd-target.h b/firmware/target/arm/at91sam/lyre_proto1/lcd-target.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/firmware/target/arm/at91sam/lyre_proto1/system-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/system-lyre_proto1.c deleted file mode 100644 index 34318d24aa..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/system-lyre_proto1.c +++ /dev/null @@ -1,149 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 Standard files */ -#include "at91sam9260.h" -#include "config.h" - -/*----------------------------------------------------------------------------- - * Function Name : default_spurious_handler - * Object : default handler for spurious interrupt - *---------------------------------------------------------------------------*/ -void default_spurious_handler(void) -{ - while (1); -} - -/*----------------------------------------------------------------------------- - * Function Name : default_fiq_handler - * Object : default handler for fast interrupt - *---------------------------------------------------------------------------*/ -void default_fiq_handler(void) -{ - while (1); -} - -/*----------------------------------------------------------------------------- - * Function Name : default_irq_handler - * Object : default handler for irq - *---------------------------------------------------------------------------*/ -void default_irq_handler(void) -{ -#if defined(BOOTLOADER) - while (1); -#endif -} - -/*----------------------------------------------------------------------------- - * Function Name : lowlevel_init - * Object : This function performs very low level HW initialization - * this function can use a Stack, depending the compilation - * optimization mode - *---------------------------------------------------------------------------*/ -void lowlevel_init(void) -{ - unsigned char i = 0; - - /* void default_fiq_handler(void) - * Init PMC Step 1. Enable Main Oscillator - * Main Oscillator startup time is board specific: - * Main Oscillator Startup Time worst case (3MHz) corresponds to 15ms - * (0x40 for AT91C_CKGR_OSCOUNT field) - */ - AT91C_PMC_MOR = (((AT91C_CKGR_OSCOUNT & (0x40 << 8)) | AT91C_CKGR_MOSCEN)); - /* Wait Main Oscillator stabilization */ - while (!(AT91C_PMC_SR & AT91C_PMC_MOSCS)); - - /* Init PMC Step 2. - * Set PLLA to 198,608MHz - * PLL Startup time depends on PLL RC filter: worst case is choosen. - * - * Crystal frequency = 18.432MHz; PLLA = (18.432 * 96) / 9 = 198,608MHz. - */ - - AT91C_PMC_PLLAR = (1 << 29) | - (0x60 << 16) | /* MULA = 96 */ - (0x2 << 14) | - (0x3f << 8) | - (0x09); /* DIVA = 9 */ - - /* Wait for PLLA stabilization */ - while (!(AT91C_PMC_SR & AT91C_PMC_LOCKA)); - /* Wait until the master clock is established for the case we already */ - /* turn on the PLLA */ - while (!(AT91C_PMC_SR & AT91C_PMC_MCKRDY)); - - /* Init PMC Step 3. - * Processor Clock = 198,608MHz (PLLA); Master clock = - * (198,608MHz (PLLA))/2 = 98,304MHz. - * The PMC_MCKR register must not be programmed in a single write operation - * (see. Product Errata Sheet) - */ - AT91C_PMC_MCKR = AT91C_PMC_PRES_CLK | AT91C_PMC_MDIV_2; - /* Wait until the master clock is established */ - while (!(AT91C_PMC_SR & AT91C_PMC_MCKRDY)); - - AT91C_PMC_MCKR |= AT91C_PMC_CSS_PLLA_CLK; - /* Wait until the master clock is established */ - while (!(AT91C_PMC_SR & AT91C_PMC_MCKRDY)); - - /* Reset AIC: assign default handler for each interrupt source - */ - - /* Disable the interrupt on the interrupt controller */ - AT91C_AIC_IDCR = (1 << AT91C_ID_SYS); - - /* Assign default handler for each IRQ source */ - AT91C_AIC_SVR(AT91C_ID_FIQ) = (int) default_fiq_handler; - for (i = 1; i < 31; i++) - { - AT91C_AIC_SVR(i) = (int) default_irq_handler; - } - AT91C_AIC_SPU = (unsigned int) default_spurious_handler; - - /* Perform 8 IT acknoledge (write any value in EOICR) */ - -/* The End of Interrupt Command Register (AIC_EOICR) must be written in order -to indicate to the AIC that the current interrupt is finished. This causes the -current level to be popped from the stack, restoring the previous current level -if one exists on the stack. If another interrupt is pending, with lower or -equal priority than the old current level but with higher priority than the new -current level, the nIRQ line is re-asserted, but the interrupt sequence does -not immediately start because the “I” bit is set in the core. -SPSR_irq is restored. Finally, the saved value of the link register is restored -directly into the PC. This has the effect of returning from the interrupt to -whatever was being executed before, and of loading the CPSR with the stored -SPSR, masking or unmasking the interrupts depending on the state saved in -SPSR_irq. */ - for (i = 0; i < 8 ; i++) - { - AT91C_AIC_EOICR = 0; - } - - /* Enable the interrupt on the interrupt controller */ - AT91C_AIC_IECR = (1 << AT91C_ID_SYS); - - /* Disable Watchdog */ - AT91C_WDTC_WDMR = AT91C_WDTC_WDDIS; - - /* Remap */ - AT91C_MATRIX_MRCR = AT91C_MATRIX_RCA926I | AT91C_MATRIX_RCA926D; -} diff --git a/firmware/target/arm/at91sam/lyre_proto1/system-target.h b/firmware/target/arm/at91sam/lyre_proto1/system-target.h deleted file mode 100644 index 479614f634..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/system-target.h +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 SYSTEM_TARGET_H -#define SYSTEM_TARGET_H - -#include "system-arm.h" - -void system_init(void); - -#endif /* SYSTEM_TARGET_H */ diff --git a/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c b/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c deleted file mode 100644 index 1b620e9c4f..0000000000 --- a/firmware/target/arm/at91sam/lyre_proto1/timer-lyre_proto1.c +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * - * Copyright (C) 2009 by Jorge Pinto - * - * 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 "cpu.h" -#include "system.h" -#include "timer.h" -#include "logf.h" -#include "at91sam9260.h" - -/*----------------------------------------------------------------------------- - * Function Name : pitc_handler - * Object : Handler for PITC interrupt - *---------------------------------------------------------------------------*/ -void pitc_handler(void) -{ - unsigned long pivr = 0; - unsigned long pisr = 0; - - /* Read the PISR */ - pisr = AT91C_PITC_PISR & AT91C_PITC_PITS; - - if (pisr != 0) - { - /* Read the PIVR. It acknowledges the IT */ - pivr = AT91C_PITC_PIVR; - - if (pfn_timer != NULL) - pfn_timer(); - } -} - -bool timer_set(long cycles, bool start) -{ - if (cycles < 1000) /* Max value on PITC?? */ - { - if (start && pfn_unregister != NULL) - { - pfn_unregister(); - pfn_unregister = NULL; - } - - /* Configure a resolution of ms */ - AT91C_PITC_PIMR = MCK_FREQ / ( 16 * cycles) - 1; - - return true; - } - - return false; -} - -bool timer_start(void) -{ - bool retval = true; - volatile unsigned long pimr = 0; - - /* Configure a resolution of 1 ms */ - AT91C_PITC_PIMR = MCK_FREQ / (16 * 1000) - 1; - - /* Enable interrupts */ - /* Disable the interrupt on the interrupt controller */ - AT91C_AIC_IDCR = (1 << AT91C_ID_SYS); - - /* Save the interrupt handler routine pointer and the interrupt priority */ - AT91C_AIC_SVR(AT91C_ID_SYS) = (unsigned long) pitc_handler; - /* Store the Source Mode Register */ - AT91C_AIC_SMR(AT91C_ID_SYS) = AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE | \ - AT91C_AIC_PRIOR_LOWEST; - /* Clear the interrupt on the interrupt controller */ - AT91C_AIC_ICCR = (1 << AT91C_ID_SYS); - - /* Enable the interrupt on the interrupt controller */ - AT91C_AIC_IECR = (1 << AT91C_ID_SYS); - - /* Enable the interrupt on the pit */ - pimr = AT91C_PITC_PIMR; - AT91C_PITC_PIMR = pimr | AT91C_PITC_PITIEN; - - /* Enable the pit */ - pimr = AT91C_PITC_PIMR; - AT91C_PITC_PIMR = pimr | AT91C_PITC_PITEN; - - return retval; -} - -void timer_stop(void) -{ - volatile unsigned long pimr = 0; - - /* Disable the interrupt on the interrupt controller */ - AT91C_AIC_IDCR = (1 << AT91C_ID_SYS); - - /* Clear the interrupt on the interrupt controller */ - AT91C_AIC_ICCR = (1 << AT91C_ID_SYS); - - /* Disable the interrupt on the pit */ - pimr = AT91C_PITC_PIMR; - pimr &= ~AT91C_PITC_PITIEN; - AT91C_PITC_PIMR = pimr; - - /* Disable the pit */ - pimr = AT91C_PITC_PIMR; - pimr &= ~AT91C_PITC_PITEN; - AT91C_PITC_PIMR = pimr; -} diff --git a/firmware/target/arm/ata-as-arm.S b/firmware/target/arm/ata-as-arm.S index cec4a7e235..4b4701f7fa 100644 --- a/firmware/target/arm/ata-as-arm.S +++ b/firmware/target/arm/ata-as-arm.S @@ -36,9 +36,6 @@ /* Untested */ .text .equ .ata_port, 0x18000000 -#elif defined(CREATIVE_ZVx) /* Zen Vision could have an other address */ - .text - .equ .ata_port, 0x50FEE000 #elif defined(MROBE_500) .text .equ .ata_port, 0x50400000 diff --git a/firmware/target/arm/mmu-arm.S b/firmware/target/arm/mmu-arm.S index 2458118186..bb3bfa9815 100644 --- a/firmware/target/arm/mmu-arm.S +++ b/firmware/target/arm/mmu-arm.S @@ -24,7 +24,7 @@ /* Used by ARMv4 & ARMv5 CPUs with cp15 register and MMU */ -#if CONFIG_CPU == TCC7801 || CONFIG_CPU == AT91SAM9260 +#if CONFIG_CPU == TCC7801 /* MMU present but unused */ #define HAVE_TEST_AND_CLEAN_CACHE diff --git a/firmware/target/arm/pp/usb-fw-pp502x.c b/firmware/target/arm/pp/usb-fw-pp502x.c index e3fa02e26f..fb04566cf5 100644 --- a/firmware/target/arm/pp/usb-fw-pp502x.c +++ b/firmware/target/arm/pp/usb-fw-pp502x.c @@ -87,12 +87,6 @@ #define USB_GPIO_MASK 0x04 #define USB_GPIO_VAL 0x04 -#elif defined(SANSA_VIEW) - /* GPIO A bit 7 is usb detect */ -#define USB_GPIO GPIOA -#define USB_GPIO_MASK 0x80 -#define USB_GPIO_VAL 0x80 - #else #error No USB GPIO config specified #endif diff --git a/firmware/target/arm/s3c2440/adc-s3c2440.c b/firmware/target/arm/s3c2440/adc-s3c2440.c index 2e0cf8a512..f7faf54786 100644 --- a/firmware/target/arm/s3c2440/adc-s3c2440.c +++ b/firmware/target/arm/s3c2440/adc-s3c2440.c @@ -24,10 +24,6 @@ #include "adc-target.h" #include "kernel.h" -#ifdef MINI2440 -#include "touchscreen-target.h" -#endif - static unsigned short adc_readings[NUM_ADC_CHANNELS]; /* prototypes */ @@ -136,10 +132,6 @@ static void adc_tick(void) { channel = 0; } -#ifdef MINI2440 - /* interleave a touchscreen read if neccessary */ - touchscreen_scan_device(); -#endif /* setup the next conversion and start it*/ ADCCON = (ADCCON & ~(0x7<<3)) | (channel<<3) | 0x01; } diff --git a/firmware/target/arm/s3c2440/crt0.S b/firmware/target/arm/s3c2440/crt0.S index e103f4f49f..7f4cd2aa00 100644 --- a/firmware/target/arm/s3c2440/crt0.S +++ b/firmware/target/arm/s3c2440/crt0.S @@ -133,38 +133,6 @@ #define VAL_MRSRB7 0x00000030 #define VAL_GPACON 0x00FFFFFF -/****************************************************************************/ -#elif defined (MINI2440) - -/* For Mini2440 board or compatible */ -/* Clock and Power Management setup values */ -/* NB: clock settings must match values in s3c2440/system-target.h */ -#define VAL_CLKDIV 0x5 /* HCLK = FCLK/4, PCLK = HCLK/2 */ -#define VAL_UPLLCON 0x00038022 /* UCLK = 48 MHz */ -#define VAL_MPLLCON 0x000C3041 /* FCLK = 406 MHz */ - - -/* Memory Controller setup */ -#define VAL_BWSCON 0x22111112 -#define VAL_BANKCON0 0x00002F50 -#define VAL_BANKCON1 0x00000700 -#define VAL_BANKCON2 0x00000700 -#define VAL_BANKCON3 0x00000700 -#define VAL_BANKCON4 0x00000700 -#define VAL_BANKCON5 0x0007FFFC -#define VAL_BANKCON6 0x00018009 -#define VAL_BANKCON7 0x00018009 - -#define VAL_REFRESH 0x008E04EB -#define VAL_BANKSIZE 0x000000B2 -#define VAL_MRSRB6 0x00000030 -#define VAL_MRSRB7 0x00000030 - -#define VAL_GPACON 0x00FFFFFF -#define VAL_GPFCON 0x000055AA -#define VAL_GPGCON 0xAA2A0128 -#define VAL_GPGDAT 0x0000 - #else #error Unknown target #endif diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c index de06a43bb9..92d78767eb 100644 --- a/firmware/target/arm/s3c2440/debug-s3c2440.c +++ b/firmware/target/arm/s3c2440/debug-s3c2440.c @@ -31,8 +31,6 @@ #ifdef GIGABEAT_F #define DEBUG_CANCEL BUTTON_POWER -#elif defined(MINI2440) -#define DEBUG_CANCEL BUTTON_MENU #endif bool dbg_hw_info(void) diff --git a/firmware/target/arm/s3c2440/dma-target.h b/firmware/target/arm/s3c2440/dma-target.h index 350a4a2d23..8be19640f5 100644 --- a/firmware/target/arm/s3c2440/dma-target.h +++ b/firmware/target/arm/s3c2440/dma-target.h @@ -29,9 +29,6 @@ #ifdef GIGABEAT_F #define DMA_CHAN_ATA 0 #define DMA_CHAN_AUDIO_OUT 2 -#elif defined(MINI2440) -#define DMA_CHAN_SD 0 -#define DMA_CHAN_AUDIO_OUT 2 #else #error Unsupported target #endif diff --git a/firmware/target/arm/s3c2440/mini2440/adc-target.h b/firmware/target/arm/s3c2440/mini2440/adc-target.h deleted file mode 100644 index 5abf0d06c5..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/adc-target.h +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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_ - -/* Channel 0 is connected to an on board pot for testing - Channels 0-3 are available via expansion connector CON4 - Channels 4-7 are routed to LCD connector for touchscreen operation if - supported by display panel. -*/ -#define NUM_ADC_CHANNELS 4 - -#define ADC_ONBOARD 0 -#define ADC_SPARE_1 1 -#define ADC_SPARE_2 2 -#define ADC_SPARE_3 3 - -#define ADC_READ_ERROR 0xFFFF - -#endif diff --git a/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c b/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c deleted file mode 100644 index c4b93da9bc..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/backlight-mini2440.c +++ /dev/null @@ -1,159 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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 "cpu.h" -#include "system.h" -#include "backlight-target.h" -#include "backlight.h" -#include "lcd.h" -#include "power.h" - - -/* Dummy value at index 0, 1-12 used. */ -static const unsigned char log_brightness[13] = - {0,0,1,2,3,5,7,10,15,22,31,44,63}; - - -static enum backlight_states -{ - BACKLIGHT_CONTROL_IDLE, - BACKLIGHT_CONTROL_OFF, - BACKLIGHT_CONTROL_ON, - BACKLIGHT_CONTROL_SET, - BACKLIGHT_CONTROL_FADE -} backlight_control; - -static unsigned char _backlight_brightness; -static unsigned char backlight_target; - - -/* Assumes that the backlight has been initialized */ -void backlight_hw_brightness(int brightness) -{ - if (brightness < 0) - brightness = 0; - else if(brightness > MAX_BRIGHTNESS_SETTING) - brightness = MAX_BRIGHTNESS_SETTING; - - /* stop the interrupt from messing us up */ - backlight_control = BACKLIGHT_CONTROL_IDLE; - _backlight_brightness = log_brightness[brightness]; - backlight_control = BACKLIGHT_CONTROL_SET; -} - -static void _backlight_set_state (unsigned int level) -{ - if (level == 0) - GPGDAT &= ~GPIO_LCD_PWR; - else - GPGDAT |= GPIO_LCD_PWR; -} - -/* led_control_service runs in interrupt context - be brief! - * This service is called once per interrupt timer tick - 100 times a second. - * - * There should be at most only one i2c operation per call - if more are need - * the calls should be spread across calls. - * - * Putting all led servicing in one thread means that we wont step on any - * i2c operations - they are all serialized here in the ISR tick. It also - * insures that we get called at equal timing for good visual effect. - */ -#ifndef BOOTLOADER -static void led_control_service(void) -{ - switch (backlight_control) - { - case BACKLIGHT_CONTROL_IDLE: - backlight_control = BACKLIGHT_CONTROL_IDLE; - break; - case BACKLIGHT_CONTROL_OFF: - backlight_hw_brightness(0); - backlight_control = BACKLIGHT_CONTROL_IDLE; - break; - case BACKLIGHT_CONTROL_ON: - backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING); - backlight_control = BACKLIGHT_CONTROL_IDLE; - break; - case BACKLIGHT_CONTROL_SET: - /* TODO: This is probably wrong since it sets a fixed value. - It was a fixed value of 255 before, but that was even more wrong - since it accessed the log_brightness buffer out of bounds */ - backlight_hw_brightness(DEFAULT_BRIGHTNESS_SETTING); - backlight_control = BACKLIGHT_CONTROL_IDLE; - break; - case BACKLIGHT_CONTROL_FADE: - backlight_hw_brightness(0); - backlight_control = BACKLIGHT_CONTROL_IDLE; - break; - default: - backlight_control = BACKLIGHT_CONTROL_IDLE; - break; - } -} -#endif /* BOOTLOADER */ - -static void __backlight_dim(bool dim_now) -{ - /* dont let the interrupt tick happen */ - backlight_control = BACKLIGHT_CONTROL_IDLE; - backlight_target = dim_now ? 0 : _backlight_brightness; - if(backlight_target==0 && _backlight_brightness==0) - { - if(dim_now == false) - backlight_control = BACKLIGHT_CONTROL_ON; - else - backlight_control = BACKLIGHT_CONTROL_OFF; - } - else - backlight_control = BACKLIGHT_CONTROL_FADE; -} - -void backlight_hw_on(void) -{ -#ifdef HAVE_LCD_ENABLE - lcd_enable(true); /* power on lcd + visible display */ -#endif - __backlight_dim(false); -} - -void backlight_hw_off(void) -{ - __backlight_dim(true); -} - - -bool backlight_hw_init(void) -{ - unsigned char brightness = log_brightness[DEFAULT_BRIGHTNESS_SETTING]; - _backlight_brightness = brightness; - - backlight_control = BACKLIGHT_CONTROL_ON; - - _backlight_set_state (1); - S3C2440_GPIO_CONFIG (GPGCON, 4, GPIO_OUTPUT); - -#ifndef BOOTLOADER - /* put the led control on the tick list */ - tick_add_task(led_control_service); -#endif - return true; -} diff --git a/firmware/target/arm/s3c2440/mini2440/backlight-target.h b/firmware/target/arm/s3c2440/mini2440/backlight-target.h deleted file mode 100644 index ceb6824841..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/backlight-target.h +++ /dev/null @@ -1,31 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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 BACKLIGHT_TARGET_H -#define BACKLIGHT_TARGET_H - -#define GPIO_LCD_PWR (1 << 4) /* GPIO.G4 */ - -bool backlight_hw_init(void); -void backlight_hw_on(void); -void backlight_hw_off(void); -void backlight_hw_brightness(int brightness); - -#endif diff --git a/firmware/target/arm/s3c2440/mini2440/button-mini2440.c b/firmware/target/arm/s3c2440/mini2440/button-mini2440.c deleted file mode 100644 index 981e2a1280..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/button-mini2440.c +++ /dev/null @@ -1,92 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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 "cpu.h" -#include "system.h" -#include "button.h" -#include "kernel.h" -#include "touchscreen-target.h" - -void button_init_device(void) -{ - /* Configure port directions and enable internal pullups on button inputs */ - - /* These are the standard 6 buttons on the Mini2440 */ - S3C2440_GPIO_CONFIG (GPGCON, 0, GPIO_INPUT); - S3C2440_GPIO_CONFIG (GPGCON, 3, GPIO_INPUT); - S3C2440_GPIO_CONFIG (GPGCON, 5, GPIO_INPUT); - S3C2440_GPIO_CONFIG (GPGCON, 6, GPIO_INPUT); - S3C2440_GPIO_CONFIG (GPGCON, 7, GPIO_INPUT); - S3C2440_GPIO_CONFIG (GPGCON, 11, GPIO_INPUT); - - S3C2440_GPIO_PULLUP (GPGUP, 0, GPIO_PULLUP_ENABLE); - S3C2440_GPIO_PULLUP (GPGUP, 3, GPIO_PULLUP_ENABLE); - S3C2440_GPIO_PULLUP (GPGUP, 5, GPIO_PULLUP_ENABLE); - S3C2440_GPIO_PULLUP (GPGUP, 6, GPIO_PULLUP_ENABLE); - S3C2440_GPIO_PULLUP (GPGUP, 7, GPIO_PULLUP_ENABLE); - S3C2440_GPIO_PULLUP (GPGUP, 11, GPIO_PULLUP_ENABLE); - - /* These are additional buttons on my add on keypad */ - S3C2440_GPIO_CONFIG (GPGCON, 9, GPIO_INPUT); - S3C2440_GPIO_CONFIG (GPGCON, 10, GPIO_INPUT); - S3C2440_GPIO_PULLUP (GPGUP, 9, GPIO_PULLUP_ENABLE); - S3C2440_GPIO_PULLUP (GPGUP, 10, GPIO_PULLUP_ENABLE); - - /* init touchscreen */ - touchscreen_init_device(); -} - -inline bool button_hold(void) -{ - return 0; -} - -int button_read_device(int* data) -{ - int btn = BUTTON_NONE; - static int old_data = 0; - - *data = old_data; - - /* Read the buttons - active low */ - btn = (GPGDAT & BUTTON_MAIN) ^ BUTTON_MAIN; - - /* read touchscreen */ - btn |= touchscreen_read_device(data, &old_data); - - return btn; -} - -void touchpad_set_sensitivity(int level) -{ - (void)level; - /* No touchpad */ -} - -#ifdef HAVE_HEADPHONE_DETECTION -bool headphones_inserted(void) -{ - /* No detect */ - return false; -} -#endif /* HAVE_HEADPHONE_DETECTION */ - diff --git a/firmware/target/arm/s3c2440/mini2440/button-target.h b/firmware/target/arm/s3c2440/mini2440/button-target.h deleted file mode 100644 index 685af7270f..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/button-target.h +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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_ - -void touchpad_set_sensitivity(int level); - -/* Mini2440 specific button codes */ - -#define BUTTON_ONE 0x0001 -#define BUTTON_TWO 0x0008 -#define BUTTON_THREE 0x0020 -#define BUTTON_FOUR 0x0040 -#define BUTTON_FIVE 0x0080 -#define BUTTON_SIX 0x0800 - -/* Add on buttons */ -#define BUTTON_SEVEN 0x0200 -#define BUTTON_EIGHT 0x0400 - -/* Touch Screen Area Buttons */ -#define BUTTON_TOPLEFT 0x010000 -#define BUTTON_TOPMIDDLE 0x020000 -#define BUTTON_TOPRIGHT 0x040000 -#define BUTTON_MIDLEFT 0x080000 -#define BUTTON_CENTER 0x100000 -#define BUTTON_MIDRIGHT 0x200000 -#define BUTTON_BOTTOMLEFT 0x400000 -#define BUTTON_BOTTOMMIDDLE 0x800000 -#define BUTTON_BOTTOMRIGHT 0x100000 - -#define BUTTON_TOUCH 0x200000 - - -#define BUTTON_MENU BUTTON_ONE -#define BUTTON_UP BUTTON_TWO -#define BUTTON_SELECT BUTTON_THREE -#define BUTTON_DOWN BUTTON_FOUR -#define BUTTON_LEFT BUTTON_FIVE -#define BUTTON_RIGHT BUTTON_SIX - -/* Add on buttons */ -#define BUTTON_A BUTTON_SEVEN -#define BUTTON_POWER BUTTON_EIGHT - -/* TODO: bodge to keep keymap-mini2440 happy */ -#define BUTTON_VOL_DOWN 0x4000 -#define BUTTON_VOL_UP 0x8000 - -#define BUTTON_MAIN (BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT | \ - BUTTON_UP |BUTTON_DOWN|BUTTON_SELECT | \ - BUTTON_A |BUTTON_POWER ) - -#define POWEROFF_BUTTON BUTTON_MENU -#define POWEROFF_COUNT 10 - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s3c2440/mini2440/lcd-target.h b/firmware/target/arm/s3c2440/mini2440/lcd-target.h deleted file mode 100644 index 97643f8163..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/lcd-target.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins, Lyre Project - * - * 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 LCD_TARGET_H -#define LCD_TARGET_H - -#define LCD_FRAMEBUF_ADDR(col, row) ((fb_data *)FRAME + (row)*LCD_WIDTH + (col)) - -/* Setup for Mini2440, 3.5" TFT LCD Touchscreen */ - -/* Config values for LCDCON1 */ -#define LCD_CLKVAL 4 -#define LCD_MMODE 0 -#define LCD_PNRMODE 3 -#define LCD_BPPMODE 12 -#define LCD_ENVID 1 - -/* Config values for LCDCON2 */ -#define LCD_UPPER_MARGIN 1 -#define LCD_LOWER_MARGIN 4 -#define LCD_VSYNC_LEN 1 - -/* Config values for LCDCON3 */ -#define LCD_RIGHT_MARGIN 0 -#define LCD_LEFT_MARGIN 25 - -/* Config values for LCDCON4 */ -#define LCD_HSYNC_LEN 4 - -#endif /* LCD_TARGET_H */ diff --git a/firmware/target/arm/s3c2440/mini2440/led-mini2440.c b/firmware/target/arm/s3c2440/mini2440/led-mini2440.c deleted file mode 100644 index 606d443184..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/led-mini2440.c +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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 "cpu.h" -#include "kernel.h" -#include "led-mini2440.h" - -/* LED functions for debug */ - -void led_init (void) -{ - S3C2440_GPIO_CONFIG (GPBCON, 5, GPIO_OUTPUT); - S3C2440_GPIO_CONFIG (GPBCON, 6, GPIO_OUTPUT); - S3C2440_GPIO_CONFIG (GPBCON, 7, GPIO_OUTPUT); - S3C2440_GPIO_CONFIG (GPBCON, 8, GPIO_OUTPUT); - - S3C2440_GPIO_PULLUP (GPBUP, 5, GPIO_PULLUP_DISABLE); - S3C2440_GPIO_PULLUP (GPBUP, 6, GPIO_PULLUP_DISABLE); - S3C2440_GPIO_PULLUP (GPBUP, 7, GPIO_PULLUP_DISABLE); - S3C2440_GPIO_PULLUP (GPBUP, 8, GPIO_PULLUP_DISABLE); -} - -/* Turn on one or more LEDS */ -void set_leds (int led_mask) -{ - GPBDAT &= ~led_mask; -} - -/* Turn off one or more LEDS */ -void clear_leds (int led_mask) -{ - GPBDAT |= led_mask; -} - -/* Alternate flash pattern1 and pattern2 */ -/* Never returns */ -void led_flash (int led_pattern1, int led_pattern2) -{ - while (1) - { - set_leds (led_pattern1); - sleep(HZ/2); - clear_leds (led_pattern1); - - set_leds(led_pattern2); - sleep(HZ/2); - clear_leds (led_pattern2); - } -} diff --git a/firmware/target/arm/s3c2440/mini2440/led-mini2440.h b/firmware/target/arm/s3c2440/mini2440/led-mini2440.h deleted file mode 100644 index 0aaad1c9a4..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/led-mini2440.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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 _LED_MINI2440_H_ -#define _LED_MINI2440_H_ - -/* LED functions for debug etc */ - -#define LED1 0x0020 /* GPB5 */ -#define LED2 0x0040 /* GPB6 */ -#define LED3 0x0080 /* GPB7 */ -#define LED4 0x0100 /* GPB8 */ - -#define LED_NONE 0x0000 -#define LED_ALL (LED1|LED2|LED3|LED4) - -void led_init (void); - -/* Turn on one or more LEDS */ -void set_leds (int led_mask); - -/* Turn off one or more LEDS */ -void clear_leds (int led_mask); - -/* Alternate flash of pattern1 and pattern2 - never returns */ -void led_flash (int led_pattern1, int led_pattern2); - -#endif /* _LED_MINI2440_H_ */ diff --git a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c deleted file mode 100644 index 999a53e3f9..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c +++ /dev/null @@ -1,261 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2006 by Michael Sevakis - * - * 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 -#include "config.h" -#include "system.h" -#include "kernel.h" -#include "logf.h" -#include "audio.h" -#include "sound.h" -#include "file.h" -#include "pcm-internal.h" - -/* PCM interrupt routine lockout */ -static struct -{ - int locked; - unsigned long state; -} dma_play_lock = -{ - .locked = 0, - .state = 0, -}; - -#define FIFO_COUNT ((IISFCON >> 6) & 0x3F) - -/* Setup for the DMA controller */ -#define DMA_CONTROL_SETUP ((1<<31) | (1<<29) | (1<<23) | (1<<22) | (1<<20)) - -#ifdef HAVE_UDA1341 -/* for PCLK = 50 MHz, frame size = 32 */ -/* [prescaler, master clock rate] */ -static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = -{ - [HW_FREQ_44] = { 2, IISMOD_MASTER_CLOCK_384FS }, - [HW_FREQ_22] = { 8, IISMOD_MASTER_CLOCK_256FS }, - [HW_FREQ_11] = { 17, IISMOD_MASTER_CLOCK_256FS }, -}; -#endif - -/* DMA count has hit zero - no more data */ -/* Get more data from the callback and top off the FIFO */ -void fiq_handler(void) __attribute__((interrupt ("FIQ"))); - -/* Mask the DMA interrupt */ -void pcm_play_lock(void) -{ - if (++dma_play_lock.locked == 1) - bitset32(&INTMSK, DMA2_MASK); -} - -/* Unmask the DMA interrupt if enabled */ -void pcm_play_unlock(void) -{ - if (--dma_play_lock.locked == 0) - bitclr32(&INTMSK, dma_play_lock.state); -} - -void pcm_play_dma_init(void) -{ - /* There seem to be problems when changing the IIS interface configuration - * when a clock is not present. - */ - bitset32(&CLKCON, 1<<17); - -#ifdef HAVE_UDA1341 - /* master, transmit mode, 16 bit samples, BCLK 32fs, PCLK */ - IISMOD = IISMOD_MASTER_CLOCK_PCLK | IISMOD_MASTER_MODE | IISMOD_TRANSMIT_MODE - | IISMOD_16_BIT | IISMOD_MASTER_CLOCK_256FS | IISMOD_BIT_CLOCK_32FS; - - /* TX idle, enable prescaler */ - IISCON |= IISCON_TX_IDLE | IISCON_IIS_PRESCALER_ENABLE; -#else - /* slave, transmit mode, 16 bit samples - MCLK 384fs - use 16.9344Mhz - - BCLK 32fs */ - IISMOD = (1<<9) | (1<<8) | (2<<6) | (1<<3) | (1<<2) | (1<<0); - - /* RX,TX off,on */ - IISCON |= (1<<3) | (1<<2); -#endif - - bitclr32(&CLKCON, 1<<17); - - audiohw_init(); - - /* init GPIO */ -#ifdef GIGABEAT_F -/* GPCCON = (GPCCON & ~(3<<14)) | (1<<14); */ - S3C244_GPIO_CONFIG (GPCCON, 7, GPIO_OUTPUT); - GPCDAT |= (1<<7); -#endif - - /* GPE4=I2SDO, GPE3=I2SDI, GPE2=CDCLK, GPE1=I2SSCLK, GPE0=I2SLRCK */ - GPECON = (GPECON & ~0x3ff) | 0x2aa; - - /* Do not service DMA requests, yet */ - - /* clear any pending int and mask it */ - bitset32(&INTMSK, DMA2_MASK); - SRCPND = DMA2_MASK; - - /* connect to FIQ */ - bitset32(&INTMOD, DMA2_MASK); -} - -void pcm_play_dma_postinit(void) -{ - audiohw_postinit(); -} - -void pcm_dma_apply_settings(void) -{ -#ifdef HAVE_UDA1341 - unsigned int reg_val; - /* set prescaler and master clock rate according to freq */ - reg_val = (pcm_freq_parms [pcm_fsel][0] << 5) | pcm_freq_parms [pcm_fsel][0]; - - IISMOD = (IISMOD & ~IISMOD_MASTER_CLOCK_384FS) | pcm_freq_parms [pcm_fsel][1] ; - IISPSR = reg_val; -#endif - - audiohw_set_frequency(pcm_fsel); -} - -/* Connect the DMA and start filling the FIFO */ -static void play_start_pcm(void) -{ - /* clear pending DMA interrupt */ - SRCPND = DMA2_MASK; - - /* Flush any pending writes */ - commit_dcache_range((char*)DISRC2-0x30000000, (DCON2 & 0xFFFFF) * 2); - - /* unmask DMA interrupt when unlocking */ - dma_play_lock.state = DMA2_MASK; - - /* turn on the request */ - IISCON |= (1<<5); - - /* Activate the channel */ - DMASKTRIG2 = 0x2; - - /* turn off the idle */ - IISCON &= ~(1<<3); - -#ifdef HAVE_UDA1341 - IISMOD = (IISMOD & ~IISMOD_MASTER_CLOCK_384FS) | pcm_freq_parms [pcm_fsel][1] ; - IISPSR = (pcm_freq_parms [pcm_fsel][0] << 5) | pcm_freq_parms [pcm_fsel][0]; -#endif - - /* start the IIS */ - IISCON |= (1<<0); -} - -/* Disconnect the DMA and wait for the FIFO to clear */ -static void play_stop_pcm(void) -{ - /* Mask DMA interrupt */ - bitset32(&INTMSK, DMA2_MASK); - - /* De-Activate the DMA channel */ - DMASKTRIG2 = 0x4; - - /* are we playing? wait for the chunk to finish */ - if (dma_play_lock.state != 0) - { - /* wait for the FIFO to empty and DMA to stop */ - while ((IISCON & (1<<7)) || (DMASKTRIG2 & 0x2)); - } - - /* Keep interrupt masked when unlocking */ - dma_play_lock.state = 0; - - /* turn off the request */ - IISCON &= ~(1<<5); - - /* turn on the idle */ - IISCON |= (1<<3); - - /* stop the IIS */ - IISCON &= ~(1<<0); -} - -void pcm_play_dma_start(const void *addr, size_t size) -{ - /* Enable the IIS clock */ - bitset32(&CLKCON, 1<<17); - - /* stop any DMA in progress - idle IIS */ - play_stop_pcm(); - - /* connect DMA to the FIFO and enable the FIFO */ - IISFCON = (1<<15) | (1<<13); - - /* set DMA dest */ - DIDST2 = (unsigned int)&IISFIFO; - - /* IIS is on the APB bus, INT when TC reaches 0, fixed dest addr */ - DIDSTC2 = 0x03; - - /* set DMA source and options */ - DISRC2 = (unsigned int)addr + 0x30000000; - /* How many transfers to make - we transfer half-word at a time = 2 bytes */ - /* DMA control: CURR_TC int, single service mode, I2SSDO int, HW trig */ - /* no auto-reload, half-word (16bit) */ - DCON2 = DMA_CONTROL_SETUP | (size / 2); - DISRCC2 = 0x00; /* memory is on AHB bus, increment addresses */ - - play_start_pcm(); -} - -/* Promptly stop DMA transfers and stop IIS */ -void pcm_play_dma_stop(void) -{ - play_stop_pcm(); - - /* Disconnect the IIS clock */ - bitclr32(&CLKCON, 1<<17); -} - -void fiq_handler(void) -{ - static const void *start; - static size_t size; - - /* clear any pending interrupt */ - SRCPND = DMA2_MASK; - - /* Buffer empty. Try to get more. */ - if (!pcm_play_dma_complete_callback(PCM_DMAST_OK, &start, &size)) - return; - - /* Flush any pending cache writes */ - commit_dcache_range(start, size); - - /* set the new DMA values */ - DCON2 = DMA_CONTROL_SETUP | (size >> 1); - DISRC2 = (unsigned int)start + 0x30000000; - - /* Re-Activate the channel */ - DMASKTRIG2 = 0x2; - - pcm_play_dma_status_callback(PCM_DMAST_STARTED); -} diff --git a/firmware/target/arm/s3c2440/mini2440/power-mini2440.c b/firmware/target/arm/s3c2440/mini2440/power-mini2440.c deleted file mode 100644 index d4b00751e0..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/power-mini2440.c +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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 "cpu.h" -#include -#include -#include "kernel.h" -#include "system.h" -#include "power.h" -#include "led-mini2440.h" - -void power_init(void) -{ - /* Nothing to do */ -} - -unsigned int power_input_status(void) -{ - unsigned int status = 0; - - /* Always on*/ - status = POWER_INPUT_MAIN; - return status; -} - -/* Returns true if the unit is charging the batteries. */ -bool charging_state(void) -{ - return false; -} - -void power_off(void) -{ - /* we don't have any power control, user must do it */ - led_flash (LED_NONE, LED_ALL); - while (1); -} diff --git a/firmware/target/arm/s3c2440/mini2440/powermgmt-mini2440.c b/firmware/target/arm/s3c2440/mini2440/powermgmt-mini2440.c deleted file mode 100644 index 2838c7a74a..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/powermgmt-mini2440.c +++ /dev/null @@ -1,64 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bob Cousins - * - * 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 "system.h" -#include "adc.h" -#include "power.h" -#include "powermgmt.h" - -/* The following constants are dummy values since there is no battery */ -unsigned short battery_level_disksafe = 3450; - -unsigned short battery_level_shutoff = 3400; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -unsigned short percent_to_volt_discharge[11] = -{ - /* Typical Li Ion 830mAH */ - 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 -}; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ -unsigned short percent_to_volt_charge[11] = -{ - /* Typical Li Ion 830mAH */ - 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 -}; - - -/* Returns battery voltage from ADC [millivolts] */ -/* full-scale (2^10) in millivolt */ -int _battery_voltage(void) -{ - /* Since we have no battery, return a fully charged value */ - return 4000 * 1024 / 1000; -} - -#ifdef HAVE_BATTERY_SWITCH -unsigned int input_millivolts(void) -{ - unsigned int batt_millivolts = battery_voltage(); - - /* No battery, return nominal value */ - return batt_millivolts; -} -#endif /* HAVE_BATTERY_SWITCH */ - diff --git a/firmware/target/arm/s3c2440/mini2440/touchscreen-mini2440.c b/firmware/target/arm/s3c2440/mini2440/touchscreen-mini2440.c deleted file mode 100644 index 4ab4a46351..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/touchscreen-mini2440.c +++ /dev/null @@ -1,189 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___void - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Rob Purchase - * - * 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 "touchscreen-target.h" -#include "adc-target.h" -#include "system.h" -#include "stdlib.h" -#include "button.h" -#include "tick.h" -#include "touchscreen.h" - -#define NO_OF_TOUCH_DATA 5 - -struct touch_calibration_point { - short px_x; /* known pixel value */ - short px_y; - short val_x; /* touchscreen value at the known pixel */ - short val_y; -}; - -static struct touch_calibration_point topleft, bottomright; - -static bool touch_available = false; - -static short x[NO_OF_TOUCH_DATA], y[NO_OF_TOUCH_DATA]; - -/* comparator for qsort */ -static int short_cmp(const void *a, const void *b) -{ - return *(short*)a - *(short*)b; -} - -static int touch_to_pixels(short val_x, short val_y) -{ - short x,y; - - x=val_x; - y=val_y; - - x = (x-topleft.val_x)*(bottomright.px_x - topleft.px_x) - / (bottomright.val_x - topleft.val_x) + topleft.px_x; - - y = (y-topleft.val_y)*(bottomright.px_y - topleft.px_y) - / (bottomright.val_y - topleft.val_y) + topleft.px_y; - - if (x < 0) - x = 0; - else if (x>=LCD_WIDTH) - x=LCD_WIDTH-1; - - if (y < 0) - y = 0; - else if (y>=LCD_HEIGHT) - y=LCD_HEIGHT-1; - - return (x<<16)|y; -} - -void touchscreen_init_device() -{ - /* set touchscreen adc controller into wait for interrupt mode */ - ADCTSC = 0xd3; /* Wfait,XP-PU,XP_DIS,XM_DIS,YP_dis,YM_end */ - - /* Arbitrary touchscreen calibration */ - topleft.px_x = 0; - topleft.px_y = 0; - topleft.val_x = 105; - topleft.val_y = 925; - - bottomright.px_x = LCD_WIDTH; - bottomright.px_y = LCD_HEIGHT; - bottomright.val_x = 890; - bottomright.val_y = 105; - - touch_available = false; -} - -void touchscreen_scan_device() -{ - static long last_touch_read = 0; - static int touch_data_index = 0; - - int saveADCDLY; - - /* check touch state */ - if(ADCDAT1 & (1<<15)) - { - return; - } - - if (TIME_AFTER(current_tick, last_touch_read + 1)) - { - /* resets the index if the last touch could not be read 5 times */ - touch_data_index = 0; - } - - /* read touch data */ - saveADCDLY = ADCDLY; - ADCDLY = 40000; /*delay ~0.8ms (1/50M)*4000 */ - ADCTSC = (1<<3)|(1<<2); /* pullup disable, seq x,y pos measure */ - /* start adc */ - ADCCON|= 0x1; - /* wait for start and end */ - while(ADCCON & 0x1); - while(!(ADCCON & 0x8000)); - - x[touch_data_index] = ADCDAT0&0x3ff; - y[touch_data_index] = ADCDAT1&0x3ff; - - ADCTSC = 0xd3; /* back to interrupt mode */ - ADCDLY = saveADCDLY; - - touch_data_index++; - - if (touch_data_index > NO_OF_TOUCH_DATA - 1) - { - /* coordinates 5 times read */ - touch_available = true; - touch_data_index = 0; - } - last_touch_read = current_tick; -} - -int touchscreen_read_device(int *data, int *old_data) -{ - int btn = BUTTON_NONE; - static bool touch_hold = false; - static long last_touch = 0; - - if (touch_available || touch_hold) - { - short x_touch, y_touch; - static short last_x = 0, last_y = 0; - - if (touch_hold) - { - /* get rid of very fast unintended double touches */ - x_touch = last_x; - y_touch = last_y; - } - else - { - /* sort the 5 data taken and use the median value */ - qsort(x, NO_OF_TOUCH_DATA, sizeof(short), short_cmp); - qsort(y, NO_OF_TOUCH_DATA, sizeof(short), short_cmp); - - x_touch = last_x = x[(NO_OF_TOUCH_DATA - 1)/2]; - y_touch = last_y = y[(NO_OF_TOUCH_DATA - 1)/2]; - - last_touch = current_tick; - - touch_hold = true; - touch_available = false; - } - - *old_data = *data = touch_to_pixels(x_touch, y_touch); - - btn |= touchscreen_to_pixels((*data&0xffff0000) >> 16, - (*data&0x0000ffff), - data); - } - - if (TIME_AFTER(current_tick, last_touch + 10)) - { - /* put the touchscreen back into interrupt mode */ - touch_hold = false; - } - - return btn; -} diff --git a/firmware/target/arm/s3c2440/mini2440/touchscreen-target.h b/firmware/target/arm/s3c2440/mini2440/touchscreen-target.h deleted file mode 100644 index 1019a98330..0000000000 --- a/firmware/target/arm/s3c2440/mini2440/touchscreen-target.h +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Dominik Wenger - * - * 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 _TOUCHSCREEN_TARGET_H -#define _TOUCHSCREEN_TARGET_H - -/* try to get a touchscreen reading from adc */ -void touchscreen_scan_device(void); -/* init touchscreen driver */ -void touchscreen_init_device(void); - -int touchscreen_read_device(int *data, int *old_data); - -#endif - diff --git a/firmware/target/arm/s3c2440/system-s3c2440.c b/firmware/target/arm/s3c2440/system-s3c2440.c index 569dcabdbe..b9c6dd5879 100644 --- a/firmware/target/arm/s3c2440/system-s3c2440.c +++ b/firmware/target/arm/s3c2440/system-s3c2440.c @@ -191,8 +191,6 @@ void system_init(void) CLKCON &= ~0xFF1ED0; CLKSLOW |= 0x80; -#elif defined(MINI2440) - /* TODO: anything? */ #else #error Unknown target #endif diff --git a/firmware/target/arm/s3c2440/system-target.h b/firmware/target/arm/s3c2440/system-target.h index 33662cd9e5..e69998f4b9 100644 --- a/firmware/target/arm/s3c2440/system-target.h +++ b/firmware/target/arm/s3c2440/system-target.h @@ -48,20 +48,6 @@ #define UNCACHED_ADDR(a) ((typeof(a))((unsigned int)(a) | UNCACHED_BASE_ADDR )) #endif /* BOOTLOADER */ -#elif defined(MINI2440) - - /* Uses 1:4:8 */ - #define FCLK 406000000 - #define HCLK (FCLK/4) /* = 101,250,000 */ - #define PCLK (HCLK/2) /* = 50,625,000 */ - - #define CPUFREQ_DEFAULT FCLK /* 406 MHz */ - #define CPUFREQ_NORMAL (FCLK/4)/* 101.25 MHz */ - #define CPUFREQ_MAX FCLK /* 406 MHz */ - - #define UNCACHED_BASE_ADDR 0x30000000 - #define UNCACHED_ADDR(a) ((typeof(a))((unsigned int)(a) | UNCACHED_BASE_ADDR )) - #else #error Unknown target #endif diff --git a/firmware/target/arm/s5l8700/audio-meizu.c b/firmware/target/arm/s5l8700/audio-meizu.c deleted file mode 100644 index 670b7e0100..0000000000 --- a/firmware/target/arm/s5l8700/audio-meizu.c +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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 "system.h" -#include "cpu.h" -#include "audio.h" -#include "audiohw.h" -#include "sound.h" - -int audio_channels = 2; -int audio_output_source = AUDIO_SRC_PLAYBACK; - -void audio_set_output_source(int source) -{ - if ((unsigned)source >= AUDIO_NUM_SOURCES) - source = AUDIO_SRC_PLAYBACK; - - audio_output_source = source; -} /* audio_set_output_source */ - -void audio_input_mux(int source, unsigned flags) -{ - static int last_source = AUDIO_SRC_PLAYBACK; - - (void)flags; - - switch (source) - { - default: /* playback - no recording */ - source = AUDIO_SRC_PLAYBACK; - case AUDIO_SRC_PLAYBACK: - audio_channels = 2; - if (source != last_source) - { -// audiohw_set_monitor(false); - } - break; - - case AUDIO_SRC_FMRADIO: /* recording and playback */ - audio_channels = 2; - if (source == last_source) - break; - -// audiohw_set_monitor(true); - break; - } /* end switch */ - - last_source = source; -} /* audio_input_mux */ - diff --git a/firmware/target/arm/s5l8700/backlight-meizu.c b/firmware/target/arm/s5l8700/backlight-meizu.c deleted file mode 100644 index d5c9a22f82..0000000000 --- a/firmware/target/arm/s5l8700/backlight-meizu.c +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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 - -#include "config.h" -#include "backlight.h" -#include "backlight-target.h" -#include "system.h" - -/* - Backlight driver using the PWM mode of a hardware timer. - - The PWM duty cycle depends exponentially on the configured brightness - level. This makes the brightness curve more linear to the human eye. - */ - -void backlight_hw_brightness(int brightness) -{ - /* pwm = round(sqrt(2)**x), where brightness level x = 1..16 */ - static const unsigned int logtable[] = - {1, 2, 3, 4, 6, 8, 11, 16, 23, 32, 45, 64, 91, 128, 181, 256}; - - /* set PWM width */ - TCDATA0 = logtable[brightness]; -} - -void backlight_hw_on(void) -{ - /* configure backlight pin P0.2 as timer PWM output */ - PCON0 = ((PCON0 & ~(3 << 4)) | (2 << 4)); - backlight_hw_brightness(backlight_brightness); -} - -void backlight_hw_off(void) -{ - /* configure backlight pin P0.2 as GPIO and switch off */ - PCON0 = ((PCON0 & ~(3 << 4)) | (1 << 4)); - PDAT0 &= ~(1 << 2); -} - -bool backlight_hw_init(void) -{ - /* enable timer clock */ - PWRCON &= ~(1 << 4); - - /* configure timer */ - TCCMD = (1 << 1); /* TC_CLR */ - TCCON = (0 << 13) | /* TC_INT1_EN */ - (0 << 12) | /* TC_INT0_EN */ - (1 << 11) | /* TC_START */ - (3 << 8) | /* TC_CS = PCLK / 64 */ - (1 << 4); /* TC_MODE_SEL = PWM mode */ - TCDATA1 = 256; /* set PWM period */ - TCPRE = 20; /* prescaler */ - TCCMD = (1 << 0); /* TC_EN */ - - backlight_hw_on(); - - return true; -} - diff --git a/firmware/target/arm/s5l8700/boot.lds b/firmware/target/arm/s5l8700/boot.lds index 4d3c80f1b9..a197ced831 100644 --- a/firmware/target/arm/s5l8700/boot.lds +++ b/firmware/target/arm/s5l8700/boot.lds @@ -24,11 +24,7 @@ STARTUP(target/arm/s5l8700/crt0.o) #define IRAMSIZE 256K #endif -#ifdef MEIZU_M6SL -#define DFULOADADDR IRAMORIG -#else #define DFULOADADDR (IRAMORIG+0x20000) -#endif /* This is not available in all versions of the S5L8700 */ #define FLASHORIG 0x24000000 @@ -41,7 +37,7 @@ MEMORY FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE } -#if defined(IPOD_NANO2G) || defined(MEIZU_M6SL) +#if defined(IPOD_NANO2G) #define LOAD_AREA IRAM #else #define NEEDS_INTVECT_COPYING diff --git a/firmware/target/arm/s5l8700/crt0.S b/firmware/target/arm/s5l8700/crt0.S index b13d89b7e9..49fa9797dc 100644 --- a/firmware/target/arm/s5l8700/crt0.S +++ b/firmware/target/arm/s5l8700/crt0.S @@ -22,28 +22,6 @@ #include "config.h" #include "cpu.h" -/* Meizu M3 SDRAM settings */ -#ifdef MEIZU_M3 -#define SDR_DSS_SEL_B 1 -#define SDR_DSS_SEL_O 1 -#define SDR_DSS_SEL_C 1 -#define SDR_TIMING 0x6A491D -#define SDR_CONFIG 0x900 -#define SDR_MRS 0x37 -#define SDR_EMRS 0x4000 -#endif - -/* Meizu M6SP SDRAM settings */ -#ifdef MEIZU_M6SP -#define SDR_DSS_SEL_B 5 -#define SDR_DSS_SEL_O 2 -#define SDR_DSS_SEL_C 2 -#define SDR_TIMING 0x6A4965 -#define SDR_CONFIG 0x700 -#define SDR_MRS 0x33 -#define SDR_EMRS 0x4033 -#endif - .section .intvect,"ax",%progbits .global start .global _newstart @@ -276,68 +254,6 @@ start_loc: mov r0, #0 // 0x0 str r0, [r1, #44] // do not enter any power saving mode -#if defined(MEIZU_M6SP) || defined(MEIZU_M3) - /* setup SDRAM for Meizu M6SP */ - ldr r1, =0x38200000 - // configure SDR drive strength and pad settings - mov r0, #SDR_DSS_SEL_B - str r0, [r1, #0x4C] // MIU_DSS_SEL_B - mov r0, #SDR_DSS_SEL_O - str r0, [r1, #0x50] // MIU_DSS_SEL_O - mov r0, #SDR_DSS_SEL_C - str r0, [r1, #0x54] // MIU_DSS_SEL_C - mov r0, #2 - str r0, [r1, #0x60] // SSTL2_PAD_ON - // select SDR mode - ldr r0, [r1, #0x40] - mov r2, #0xFFFDFFFF - and r0, r0, r2 - orr r0, r0, #1 - str r0, [r1, #0x40] // MIUORG - // set controller configuration - mov r0, #SDR_CONFIG - str r0, [r1] // MIUCON - // set SDRAM timing - ldr r0, =SDR_TIMING - str r0, [r1, #0x10] // MIUSDPARA - // set refresh rate - mov r0, #0x1080 - str r0, [r1, #0x08] // MIUAREF - // initialise SDRAM - mov r0, #0x003 - str r0, [r1, #0x04] // MIUCOM = nop - ldr r0, =0x203 - str r0, [r1, #0x04] // MIUCOM = precharge all banks - nop - nop - nop - ldr r0, =0x303 - str r0, [r1, #0x04] // MIUCOM = auto-refresh - nop - nop - nop - nop - str r0, [r1, #0x04] // MIUCOM = auto-refresh - nop - nop - nop - nop - str r0, [r1, #0x04] // MIUCOM = auto-refresh - nop - nop - nop - nop - // set mode register - mov r0, #SDR_MRS - str r0, [r1, #0x0C] // MIUMRS - ldr r0, =0x103 - str r0, [r1, #0x04] // MIUCOM = mode register set - ldr r0, =SDR_EMRS - str r0, [r1, #0x0C] // MIUMRS - ldr r0, =0x103 - str r0, [r1, #0x04] // MIUCOM = mode register set -#endif /* MEIZU_M6SP */ - mov r1, #0x1 mrc 15, 0, r0, c1, c0, 0 bic r0, r0, r1 diff --git a/firmware/target/arm/s5l8700/fmradio-i2c-meizu.c b/firmware/target/arm/s5l8700/fmradio-i2c-meizu.c deleted file mode 100644 index d260a72f8b..0000000000 --- a/firmware/target/arm/s5l8700/fmradio-i2c-meizu.c +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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. - * - ****************************************************************************/ - -/* - FM radio i2c interface, allows the radio driver to talk to the tuner chip. - - It is implemented using the generic i2c driver, which does "bit-banged" - I2C with a couple of GPIO pins. - */ - -#include "config.h" - -#include "inttypes.h" -#include "s5l87xx.h" -#include "generic_i2c.h" -#include "fmradio_i2c.h" - -#define I2C_GPIO PDAT3 -#define I2C_GPIO_DIR PCON3 -#define I2C_SCL_PIN 4 -#define I2C_SDA_PIN 2 - -#define SCL_DIR_MASK (0xF<<(4*I2C_SCL_PIN)) -#define SCL_DIR_OUT (1<<(4*I2C_SCL_PIN)) -#define SCL_DIR_IN 0 -#define SDA_DIR_MASK (0xF<<(4*I2C_SDA_PIN)) -#define SDA_DIR_OUT (1<<(4*I2C_SDA_PIN)) -#define SDA_DIR_IN 0 - -static int fm_i2c_bus; - -static void fm_scl_hi(void) -{ - I2C_GPIO |= 1 << I2C_SCL_PIN; -} - -static void fm_scl_lo(void) -{ - I2C_GPIO &= ~(1 << I2C_SCL_PIN); -} - -static void fm_sda_hi(void) -{ - I2C_GPIO |= 1 << I2C_SDA_PIN; -} - -static void fm_sda_lo(void) -{ - I2C_GPIO &= ~(1 << I2C_SDA_PIN); -} - -static void fm_sda_input(void) -{ - I2C_GPIO_DIR = (I2C_GPIO_DIR & ~SDA_DIR_MASK) | SDA_DIR_IN; -} - -static void fm_sda_output(void) -{ - I2C_GPIO_DIR = (I2C_GPIO_DIR & ~SDA_DIR_MASK) | SDA_DIR_OUT; -} - -static void fm_scl_input(void) -{ - I2C_GPIO_DIR = (I2C_GPIO_DIR & ~SCL_DIR_MASK) | SCL_DIR_IN; -} - -static void fm_scl_output(void) -{ - I2C_GPIO_DIR = (I2C_GPIO_DIR & ~SCL_DIR_MASK) | SCL_DIR_OUT; -} - -static int fm_sda(void) -{ - return (I2C_GPIO & (1 << I2C_SDA_PIN)); -} - -static int fm_scl(void) -{ - return (I2C_GPIO & (1 << I2C_SCL_PIN)); -} - -/* simple and crude delay, used for all delays in the generic i2c driver */ -static void fm_delay(void) -{ - volatile int i; - - /* this loop is uncalibrated and could use more sophistication */ - for (i = 0; i < 20; i++) { - } -} - -/* interface towards the generic i2c driver */ -static const struct i2c_interface fm_i2c_interface = { - .scl_hi = fm_scl_hi, - .scl_lo = fm_scl_lo, - .sda_hi = fm_sda_hi, - .sda_lo = fm_sda_lo, - .sda_input = fm_sda_input, - .sda_output = fm_sda_output, - .scl_input = fm_scl_input, - .scl_output = fm_scl_output, - .scl = fm_scl, - .sda = fm_sda, - - .delay_hd_sta = fm_delay, - .delay_hd_dat = fm_delay, - .delay_su_dat = fm_delay, - .delay_su_sto = fm_delay, - .delay_su_sta = fm_delay, - .delay_thigh = fm_delay -}; - -/* initialise i2c for fmradio */ -void fmradio_i2c_init(void) -{ - fm_i2c_bus = i2c_add_node(&fm_i2c_interface); -} - -int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) -{ - return i2c_write_data(fm_i2c_bus, address, -1, buf, count); -} - -int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) -{ - return i2c_read_data(fm_i2c_bus, address, -1, buf, count); -} - diff --git a/firmware/target/arm/s5l8700/ftl-meizu.c b/firmware/target/arm/s5l8700/ftl-meizu.c deleted file mode 100644 index abc30e93b9..0000000000 --- a/firmware/target/arm/s5l8700/ftl-meizu.c +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2010 by Bertrik Sikken - * - * 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 "ftl-target.h" - -uint32_t ftl_init(void) -{ - /* TODO implement */ - return 0; -} - -uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer) -{ - /* TODO implement */ - return 0; -} - -uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer) -{ - /* TODO implement */ - return 0; -} - -uint32_t ftl_sync(void) -{ - /* TODO implement */ - return 0; -} - diff --git a/firmware/target/arm/s5l8700/meizu-m3/button-m3.c b/firmware/target/arm/s5l8700/meizu-m3/button-m3.c deleted file mode 100644 index 2cbb5b4ffc..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m3/button-m3.c +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bertrik Sikken - * - * 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 -#include "config.h" - -#include "inttypes.h" -#include "s5l87xx.h" -#include "button-target.h" - -/* Button driver for the meizu M3 - - TODO: implement buttons based on on touch strip events, for example - short touch (select), slide up and down, touching the <> button, etc. - */ - - -void button_init_device(void) -{ - PCON0 &= ~(3 << 10); /* P0.5 hold switch */ - PCON1 &= ~(0xF << 0); /* P1.0 menu button */ - PCON1 &= ~(0xF << 16); /* P1.4 play button */ - PCON3 &= ~(0xF << 12); /* P3.3 <> button */ -} - -int button_read_device(void) -{ - int buttons = 0; - - if (button_hold()) { - return 0; - } - - if ((PDAT1 & (1 << 0)) == 0) { - buttons |= BUTTON_MENU; - } - if ((PDAT1 & (1 << 4)) == 0) { - buttons |= BUTTON_PLAY; - } - if ((PDAT3 & (1 << 3)) == 0) { - buttons |= BUTTON_PREVNEXT; - } - - return buttons; -} - -bool button_hold(void) -{ - return ((PDAT0 & (1 << 5)) != 0); -} - diff --git a/firmware/target/arm/s5l8700/meizu-m3/button-target.h b/firmware/target/arm/s5l8700/meizu-m3/button-target.h deleted file mode 100644 index c438628cc9..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m3/button-target.h +++ /dev/null @@ -1,37 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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_ - -#define HAS_BUTTON_HOLD - -/* Meizu M3 specific button codes */ -#define BUTTON_PREVNEXT 0x00000001 -#define BUTTON_MENU 0x00000002 -#define BUTTON_PLAY 0x00000004 - -#define BUTTON_MAIN (BUTTON_PREVNEXT|BUTTON_MENU|BUTTON_PLAY) - -#define POWEROFF_BUTTON BUTTON_PLAY -#define POWEROFF_COUNT 10 - -#endif /* _BUTTON_TARGET_H_ */ - diff --git a/firmware/target/arm/s5l8700/meizu-m3/ftl-target.h b/firmware/target/arm/s5l8700/meizu-m3/ftl-target.h deleted file mode 100644 index ad4dc04db1..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m3/ftl-target.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __FTL_TARGET_H__ -#define __FTL_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - -#ifdef BOOTLOADER -/* Bootloaders don't need write access */ -#define FTL_READONLY -#endif - -/* Pointer to an info structure regarding the flash type used */ -const struct nand_device_info_type* ftl_nand_type; - -/* Number of banks we detected a chip on */ -uint32_t ftl_banks; - -uint32_t ftl_init(void); -uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer); -uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer); -uint32_t ftl_sync(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c deleted file mode 100644 index 1fbdc5bd0c..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c +++ /dev/null @@ -1,321 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Denes Balatoni - * - * 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" -#include "inttypes.h" -#include "s5l87xx.h" - -/*** definitions ***/ -#define STAT_BUS_IDLE (1<<8) /* Data bus idle */ -#define STAT_FULL (1<<4) /* FIFO full */ -#define STAT_READON (1<<0) /* Read operation done */ - -/** globals **/ -static uint8_t lcd_type; -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; - } -} - -static void lcd_sleep(uint32_t t) -{ - volatile uint32_t i; - for(i=0;i> 8; - while (LCD_STATUS & STAT_FULL); - LCD_WCMD = reg & 0xff; - while (LCD_STATUS & STAT_FULL); - LCD_WDATA = data >> 8; - while (LCD_STATUS & STAT_FULL); - LCD_WDATA = data & 0xff; -} - -void lcd_on(void) { - if (lcd_type == 1) { - LCD_WCMD = 0x29; - } else { - lcd_writereg(0x7, 0x21); - lcd_writereg(0x12, 0x137); - lcd_sleep(70000); - lcd_writereg(0x7, 0x21); - lcd_writereg(0x12, 0x1137); - lcd_sleep(700000); - lcd_writereg(0x7, 0x233); - } -} - -void lcd_off(void) { - /* FIXME wait for DMA to finnish */ - if (lcd_type == 1) { - LCD_WCMD = 0x28; - LCD_WDATA = 0; - } else { - - } -} - -/* LCD init */ -void lcd_init_device(void) -{ - uint8_t data[5]; - int i; - -/* init basic things */ - PWRCON &= ~0x800; - PCON_ASRAM = 0x2; - PCON7 = 0x12222233; - - LCD_CON = 0xca0; - LCD_PHTIME = 0; - LCD_INTCON = 0; - LCD_RST_TIME = 0x7ff; - -/* detect lcd type, it's not detected the first time for some reason */ - for(i=0;i<3;++i) { - LCD_WCMD = 0x1; - lcd_sleep(166670); - LCD_WCMD = 0x11; - lcd_sleep(2000040); - lcd_readdata(); - LCD_WCMD = 0x4; - lcd_sleep(100); - data[0]=lcd_readdata(); - data[1]=lcd_readdata(); - data[2]=lcd_readdata(); - data[3]=lcd_readdata(); - data[4]=lcd_readdata(); - - lcd_type=0; - if (((data[1]==0x38) && ((data[2] & 0xf0) == 0x80)) || - ((data[2]==0x38) && ((data[3] & 0xf0) == 0x80))) - lcd_type=1; - } -/* init lcd */ - if (lcd_type == 1) { - LCD_WCMD = 0x3a; - LCD_WDATA = 0x6; - LCD_WCMD = 0xab; - LCD_WCMD = 0x35; - LCD_WDATA = 0; - LCD_WCMD=0x13; - LCD_WCMD = 0x2a; - LCD_WDATA = 0; - LCD_WDATA = 0; - LCD_WCMD = 0x2b; - LCD_WDATA = 0; - LCD_WDATA = 0; - LCD_WCMD = 0x29; - } else { - LCD_WCMD = 0x0; - LCD_WCMD = 0x0; - LCD_WCMD = 0x0; - LCD_WCMD = 0x0; - lcd_sleep(700000); - lcd_writereg(0xa4, 0x1); - lcd_sleep(1100000); - lcd_writereg(0x1, 0x100); - lcd_writereg(0x2, 0x300); - lcd_writereg(0x3, 0x9230); - lcd_writereg(0x8, 0x404); - lcd_writereg(0xe, 0x10); - lcd_writereg(0x70, 0x1000); - lcd_writereg(0x71, 0x1); - lcd_writereg(0x30, 0x2); - lcd_writereg(0x31, 0x400); - lcd_writereg(0x32, 0x7); - lcd_writereg(0x33, 0x500); - lcd_writereg(0x34, 0x7); - lcd_writereg(0x35, 0x703); - lcd_writereg(0x36, 0x507); - lcd_writereg(0x37, 0x5); - lcd_writereg(0x38, 0x1404); - lcd_writereg(0x39, 0xe); - lcd_writereg(0x40, 0x202); - lcd_writereg(0x41, 0x3); - lcd_writereg(0x42, 0x0); - lcd_writereg(0x43, 0x200); - lcd_writereg(0x44, 0x707); - lcd_writereg(0x45, 0x407); - lcd_writereg(0x46, 0x505); - lcd_writereg(0x47, 0x2); - lcd_writereg(0x48, 0x4); - lcd_writereg(0x49, 0x4); - lcd_writereg(0x60, 0x202); - lcd_writereg(0x61, 0x3); - lcd_writereg(0x62, 0x0); - lcd_writereg(0x63, 0x200); - lcd_writereg(0x64, 0x707); - lcd_writereg(0x65, 0x407); - lcd_writereg(0x66, 0x505); - lcd_writereg(0x67, 0x2); - lcd_writereg(0x68, 0x4); - lcd_writereg(0x69, 0x4); - lcd_writereg(0x7, 0x1); - lcd_writereg(0x18, 0x1); - lcd_writereg(0x10, 0x1690); - lcd_writereg(0x11, 0x100); - lcd_writereg(0x12, 0x117); - lcd_writereg(0x13, 0xf80); - lcd_writereg(0x12, 0x137); - lcd_writereg(0x20, 0x0); - lcd_writereg(0x21, 0x0); - lcd_writereg(0x50, 0x0); - lcd_writereg(0x51, 0xaf); - lcd_writereg(0x52, 0x0); - lcd_writereg(0x53, 0x83); - lcd_writereg(0x90, 0x0); - lcd_writereg(0x91, 0x0); - lcd_writereg(0x92, 0x0); - lcd_writereg(0x98, 0x0); - lcd_writereg(0x99, 0x903); - lcd_writereg(0x9a, 0x502); - lcd_writereg(0x9b, 0x300); - LCD_WCMD = 0x0; - LCD_WCMD = 0x22; - lcd_sleep(700000); - lcd_on(); - } -} - -/*** 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 i; - fb_data *p; - - /* Copy display bitmap to hardware */ - if (lcd_type == 1) { - LCD_WCMD = 0x2a; - LCD_WDATA = 0; - LCD_WDATA = 0; - LCD_WDATA = 0; - LCD_WDATA = 0xaf; - LCD_WCMD = 0x2b; - LCD_WDATA = 0; - LCD_WDATA = 0; - LCD_WDATA = 0; - LCD_WDATA = 0x83; - LCD_WCMD = 0x2c; - } else { - lcd_writereg(0x20, 0x0); - lcd_writereg(0x21, 0x0); - LCD_WCMD = 0; - LCD_WCMD = 0x22; - } - for(p=FBADDR(0,0), i=0;i ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __NAND_TARGET_H__ -#define __NAND_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - - -struct nand_device_info_type -{ - uint32_t id; - uint16_t blocks; - uint16_t userblocks; - uint16_t pagesperblock; - uint8_t blocksizeexponent; - uint8_t tunk1; - uint8_t twp; - uint8_t tunk2; - uint8_t tunk3; -} __attribute__((packed)); - -uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc, - uint32_t checkempty); -uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc); -uint32_t nand_block_erase(uint32_t bank, uint32_t page); - -const struct nand_device_info_type* nand_get_device_type(uint32_t bank); -uint32_t nand_reset(uint32_t bank); -uint32_t nand_device_init(void); -void nand_set_active(void); -long nand_last_activity(void); -void nand_power_up(void); -void nand_power_down(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m3/powermgmt-m3.c b/firmware/target/arm/s5l8700/meizu-m3/powermgmt-m3.c deleted file mode 100644 index 32426f53f6..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m3/powermgmt-m3.c +++ /dev/null @@ -1,59 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright © 2009 Bertrik Sikken - * - * 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 "adc.h" -#include "adc-target.h" -#include "powermgmt.h" - -/* Battery voltage calculation and discharge/charge curves for the Meizu M3. - - Battery voltage is calculated under the assumption that the adc full-scale - readout represents 3.00V and that the battery ADC channel is fed with - exactly half of the battery voltage (through a resistive divider). - Discharge and charge curves have not been calibrated yet. -*/ - -unsigned short battery_level_disksafe = 3400; /* TODO: this is just an initial guess */ - -unsigned short battery_level_shutoff = 3300; /* TODO: this is just an initial guess */ - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -unsigned short percent_to_volt_discharge[11] = -{ - /* TODO: simple uncalibrated curve, linear except for first 10% */ - 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185 -}; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ -unsigned short percent_to_volt_charge[11] = - /* TODO: simple uncalibrated curve, linear except for first 10% */ - { 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185 }; - -/* full-scale ADC readout (2^10) in millivolt */ -#define BATTERY_SCALE_FACTOR 6000 - -/* Returns battery voltage from ADC [millivolts] */ -int _battery_voltage(void) -{ - return (adc_read(ADC_BATTERY) * BATTERY_SCALE_FACTOR) >> 10; -} - diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/button-target.h b/firmware/target/arm/s5l8700/meizu-m6sl/button-target.h deleted file mode 100644 index 022a0b61f1..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sl/button-target.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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_ - -#define HAS_BUTTON_HOLD - -/* 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 POWEROFF_BUTTON BUTTON_PLAY -#define POWEROFF_COUNT 10 - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/ftl-target.h b/firmware/target/arm/s5l8700/meizu-m6sl/ftl-target.h deleted file mode 100644 index ad4dc04db1..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sl/ftl-target.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __FTL_TARGET_H__ -#define __FTL_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - -#ifdef BOOTLOADER -/* Bootloaders don't need write access */ -#define FTL_READONLY -#endif - -/* Pointer to an info structure regarding the flash type used */ -const struct nand_device_info_type* ftl_nand_type; - -/* Number of banks we detected a chip on */ -uint32_t ftl_banks; - -uint32_t ftl_init(void); -uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer); -uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer); -uint32_t ftl_sync(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c b/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c deleted file mode 100644 index e6e14b5e57..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sl/lcd-m6sl.c +++ /dev/null @@ -1,321 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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" -#include "s6d0154.h" - -/*** definitions ***/ - - -#define SPIDELAY(_x) void(_x); - -#define SETMOSI() (PDAT4 |= (1 << 3)) -#define CLRMOSI() (PDAT4 &= ~(1 << 3)) - -#define MISO ((PDAT1 >> 1) & 1) - -#define SETCLK() (PDAT4 |= (1 << 2)) -#define CLRCLK() (PDAT4 &= ~(1 << 2)) - -#define SETSS() (PDAT7 |= (1 << 1)) -#define CLRSS() (PDAT7 &= ~(1 << 1)) - -static unsigned short controller_type = 0; - -void init_lcd_spi(void) -{ - int oldval; - - oldval = PCON1; - //Set P1.1 to input - PCON1 = ((oldval & ~(0xf << 4))); - - oldval = PCON4; - //Set P4.2 and 4.3 to output - PCON4 = ((oldval & ~(0xf << 8 | 0xf << 12)) | (1 << 8 | 1 << 12)); - - oldval = PCON4; - //Set P4.2 and 4.3 to output - PCON4 = ((oldval & ~(0xf << 8 | 0xf << 12)) | (1 << 8 | 1 << 12)); - - oldval = PCON7; - //Set P7.0 and 7.1 to output - PCON7 = ((oldval & ~(0xf << 0 | 0xf << 4)) | (1 << 0 | 1 << 4)); - - SETSS(); - SETCLK(); -} - -static inline void delay(int duration) -{ - volatile int i; - for(i=0;i 22 us - - for (i = 0; i < bits+inskip; i++) { - - CLRCLK(); - - if(i> 6.7 us - - SETCLK(); - - if(i>=inskip) - { - input <<= 1; - input |= MISO; - } - - //delay(20); // >> 6.7 us - } - - SETSS(); - - return (input); -} - -void spi_set_reg(unsigned char reg,unsigned short value) -{ - lcd_spi_io(0x700000|reg,24,0); // possibly 0x74 - lcd_spi_io(0x720000|value,24,0); // possibly 0x77 -} - -unsigned int lcd_read_id(void) -{ - unsigned int device_code; - lcd_spi_io(0x700000,24,0); // possibly 0x74 - - device_code=lcd_spi_io(0x7300,16,24); // possibly 0x77 - return device_code; -} - -/** 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; - } -} - - - -void lcd_off(void) -{ - switch(controller_type) - { - case 0x0154: - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x12); - delay(20); - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x00); - break; - } -} - -void lcd_on(void) -{ - switch(controller_type) - { - case 0x0154: - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x12); - delay(20); - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0x13); - break; - } -} -/* LCD init */ -void lcd_init_device(void) -{ - init_lcd_spi(); - controller_type = lcd_read_id(); - switch(controller_type) - { - case 0x0154: - spi_set_reg(S6D0154_REG_EXTERNAL_INTERFACE_CONTROL, 0x130); // RGB interface, RGB interface for PNP mode - spi_set_reg(S6D0154_REG_MTP_TEST_KEY, 0x8d); // ?? - spi_set_reg(0x92, 0x10); - /* See also datasheet 11.3 Set up Flow of Generated Power Supply */ - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x1b); // VC1IEN, 2.76V - spi_set_reg(S6D0154_REG_POWER_CONTROL_3, 0x3101);// VGH=6*VCI1, VGL=-4*VCI1, f(DCCLK):f(DCCLK1)=1:0.5, f(DCCLK) : f(DCCLK3)= 1:0.5 - spi_set_reg(S6D0154_REG_POWER_CONTROL_4, 0x105f);//DCR_EX=1(Use dotclock) - spi_set_reg(S6D0154_REG_POWER_CONTROL_5, 0x667f); - spi_set_reg(S6D0154_REG_POWER_CONTROL_1, 0x800); - delay(20); // >10ms - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x11b); - delay(20); // >10ms - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x31b); - delay(20); // >10ms - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0x71b); - delay(20); // >10ms - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0xf1b); - delay(20); // >10ms - spi_set_reg(S6D0154_REG_POWER_CONTROL_2, 0xf3b); - delay(30); // >30ms - spi_set_reg(S6D0154_REG_DRIVER_OUTPUT_CONTROL, 0x2128); - spi_set_reg(S6D0154_REG_LCD_DRIVING_WAVEFORM_CONTROL, 0x100); - spi_set_reg(S6D0154_REG_ENTRY_MODE, 0x1030);//{DB [17:12], DB [11:6], DB [5:0]} is assigned to {B, G, R}. Horizontal first, auto increment address, write from 0x0000 to 0xdbaf - spi_set_reg(S6D0154_REG_DISPLAY_CONTROL, 0); // all off - spi_set_reg(S6D0154_REG_BLANK_PERIOD_CONTROL, 0x808); - spi_set_reg(S6D0154_REG_FRAME_CYCLE_CONTROL, 0x1100); - spi_set_reg(S6D0154_REG_START_OSCILLATION, 0xf01);// Start oscillator, X 1.25 - spi_set_reg(S6D0154_REG_VCI_RECYCLING, 0); - spi_set_reg(S6D0154_REG_GATE_SCAN_POSITION, 0); - /* Set things up to write to the entire screen */ - spi_set_reg(S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_1, 319); // end of partial screen - spi_set_reg(S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_2, 0); // start of partial screen - spi_set_reg(S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_1, 239); // end of window - spi_set_reg(S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_2, 0); // start of window - spi_set_reg(S6D0154_REG_VERTICAL_WINDOW_ADDRESS_1, 319); // end of window - spi_set_reg(S6D0154_REG_VERTICAL_WINDOW_ADDRESS_2, 0); // start of window - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_1, 0); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_2, 0xf00); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_3, 0xa03); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_4, 0x300); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_5, 0xc05); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_6, 0xf00); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_7, 0xf00); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_8, 3); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_9, 0x1f07); - spi_set_reg(S6D0154_REG_GAMMA_CONTROL_10, 0x71f); - delay(20); - lcd_on(); - break; - } -} - - -/*** 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-m6sl/nand-target.h b/firmware/target/arm/s5l8700/meizu-m6sl/nand-target.h deleted file mode 100644 index dee690e5e6..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sl/nand-target.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __NAND_TARGET_H__ -#define __NAND_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - - -struct nand_device_info_type -{ - uint32_t id; - uint16_t blocks; - uint16_t userblocks; - uint16_t pagesperblock; - uint8_t blocksizeexponent; - uint8_t tunk1; - uint8_t twp; - uint8_t tunk2; - uint8_t tunk3; -} __attribute__((packed)); - -uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc, - uint32_t checkempty); -uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc); -uint32_t nand_block_erase(uint32_t bank, uint32_t page); - -const struct nand_device_info_type* nand_get_device_type(uint32_t bank); -uint32_t nand_reset(uint32_t bank); -uint32_t nand_device_init(void); -void nand_set_active(void); -long nand_last_activity(void); -void nand_power_up(void); -void nand_power_down(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sl/s6d0154.h b/firmware/target/arm/s5l8700/meizu-m6sl/s6d0154.h deleted file mode 100644 index 70d312ed6d..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sl/s6d0154.h +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Frank Gevaerts - * - * 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 _S6D0154_H_ -#define _S6D0154_H_ - -#define S6D0154_REG_VERSION 0x00 -#define S6D0154_REG_DRIVER_OUTPUT_CONTROL 0x01 -#define S6D0154_REG_LCD_DRIVING_WAVEFORM_CONTROL 0x02 -#define S6D0154_REG_ENTRY_MODE 0x03 -#define S6D0154_REG_DISPLAY_CONTROL 0x07 -#define S6D0154_REG_BLANK_PERIOD_CONTROL 0x08 -#define S6D0154_REG_FRAME_CYCLE_CONTROL 0x0B -#define S6D0154_REG_EXTERNAL_INTERFACE_CONTROL 0x0C -#define S6D0154_REG_START_OSCILLATION 0x0F -#define S6D0154_REG_POWER_CONTROL_1 0x10 -#define S6D0154_REG_POWER_CONTROL_2 0x11 -#define S6D0154_REG_POWER_CONTROL_3 0x12 -#define S6D0154_REG_POWER_CONTROL_4 0x13 -#define S6D0154_REG_POWER_CONTROL_5 0x14 -#define S6D0154_REG_VCI_RECYCLING 0x15 -#define S6D0154_REG_RAM_ADDRESS_REGISTER_1 0x20 -#define S6D0154_REG_RAM_ADDRESS_REGISTER_2 0x21 -#define S6D0154_REG_GRAM_READ_WRITE 0x22 -#define S6D0154_REG_RESET 0x28 -#define S6D0154_REG_FLM_FUNCTION 0x29 -#define S6D0154_REG_GATE_SCAN_POSITION 0x30 -#define S6D0154_REG_VERTICAL_SCROLL_CONTROL_1A 0x31 -#define S6D0154_REG_VERTICAL_SCROLL_CONTROL_1B 0x32 -#define S6D0154_REG_VERTICAL_SCROLL_CONTROL_2 0x33 -#define S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_1 0x34 -#define S6D0154_REG_PARTIAL_SCREEN_DRIVING_POSITION_2 0x35 -#define S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_1 0x36 -#define S6D0154_REG_HORIZONTAL_WINDOW_ADDRESS_2 0x37 -#define S6D0154_REG_VERTICAL_WINDOW_ADDRESS_1 0x38 -#define S6D0154_REG_VERTICAL_WINDOW_ADDRESS_2 0x39 -#define S6D0154_REG_SUB_PANEL_CONTROL 0x40 -#define S6D0154_REG_MDDI_LINK_WAKEUP_START_POSITION 0x41 -#define S6D0154_REG_SUB_PANEL_SELECTION_INDEX 0x42 -#define S6D0154_REG_SUB_PANEL_DATA_WRITE_INDEX 0x43 -#define S6D0154_REG_GPIO_VALUE 0x44 -#define S6D0154_REG_GPIO_IO_CONTROL 0x45 -#define S6D0154_REG_GPIO_CLEAR 0x46 -#define S6D0154_REG_GPIO_INTERRUPT_ENABLE 0x47 -#define S6D0154_REG_GPIO_POLARITY_SELECTION 0x48 - -#define S6D0154_REG_GAMMA_CONTROL_1 0x50 -#define S6D0154_REG_GAMMA_CONTROL_2 0x51 -#define S6D0154_REG_GAMMA_CONTROL_3 0x52 -#define S6D0154_REG_GAMMA_CONTROL_4 0x53 -#define S6D0154_REG_GAMMA_CONTROL_5 0x54 -#define S6D0154_REG_GAMMA_CONTROL_6 0x55 -#define S6D0154_REG_GAMMA_CONTROL_7 0x56 -#define S6D0154_REG_GAMMA_CONTROL_8 0x57 -#define S6D0154_REG_GAMMA_CONTROL_9 0x58 -#define S6D0154_REG_GAMMA_CONTROL_10 0x59 - -#define S6D0154_REG_MTP_TEST_KEY 0x80 -#define S6D0154_REG_MTP_CONTROL_REGISTERS 0x81 -#define S6D0154_REG_MTP_DATA_READ_WRITE 0x82 -#define S6D0154_REG_PRODUCT_NAME_VERSION_WRITE 0x83 - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/button-m6sp.c b/firmware/target/arm/s5l8700/meizu-m6sp/button-m6sp.c deleted file mode 100644 index 5373179208..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sp/button-m6sp.c +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bertrik Sikken - * - * 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 -#include "config.h" - -#include "inttypes.h" -#include "s5l87xx.h" -#include "button-target.h" - -/* Button driver for the meizu M6SP - - Future improvements: - * touch strip support - * left/right buttons (probably read out with ADC0) - * unify with m3/m6sl button driver if possible - - */ - - -void button_init_device(void) -{ - PCON0 &= ~(0x3 << 10); /* P0.5 hold switch */ - PCON0 &= ~(0x3 << 14); /* P0.7 enter button */ - PCON1 &= ~(0xF << 16); /* P1.4 play/power button */ -} - -int button_read_device(void) -{ - int buttons = 0; - - if (button_hold()) { - return 0; - } - - if ((PDAT1 & (1 << 4)) == 0) { - buttons |= BUTTON_PLAY; - } - if ((PDAT0 & (1 << 7)) == 0) { - buttons |= BUTTON_ENTER; - } - - return buttons; -} - -bool button_hold(void) -{ - return ((PDAT0 & (1 << 5)) != 0); -} - diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/button-target.h b/firmware/target/arm/s5l8700/meizu-m6sp/button-target.h deleted file mode 100644 index 58d19d177c..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sp/button-target.h +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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_ - -#define HAS_BUTTON_HOLD - -/* Meizu M6 specific button codes */ - -#define BUTTON_LEFT 0x00000001 -#define BUTTON_RIGHT 0x00000002 -#define BUTTON_PLAY 0x00000004 -#define BUTTON_MENU 0x00000008 -#define BUTTON_SELECT 0x00000010 /* TODO: tap on the touch strip */ -#define BUTTON_ENTER 0x00000020 - - -#define BUTTON_MAIN (BUTTON_LEFT|BUTTON_RIGHT|BUTTON_PLAY|BUTTON_MENU\ - |BUTTON_SELECT|BUTTON_ENTER) - -#define POWEROFF_BUTTON BUTTON_PLAY -#define POWEROFF_COUNT 10 - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/ftl-target.h b/firmware/target/arm/s5l8700/meizu-m6sp/ftl-target.h deleted file mode 100644 index ad4dc04db1..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sp/ftl-target.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __FTL_TARGET_H__ -#define __FTL_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - -#ifdef BOOTLOADER -/* Bootloaders don't need write access */ -#define FTL_READONLY -#endif - -/* Pointer to an info structure regarding the flash type used */ -const struct nand_device_info_type* ftl_nand_type; - -/* Number of banks we detected a chip on */ -uint32_t ftl_banks; - -uint32_t ftl_init(void); -uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer); -uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer); -uint32_t ftl_sync(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c deleted file mode 100644 index 622408a4d4..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c +++ /dev/null @@ -1,494 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bertrik Sikken - * - * 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 - -#include "config.h" -#include "s5l87xx.h" -#include "lcd.h" - -/* LCD driver for the Meizu M6 SP using the CLCD controller in the S5L8700 - - The Meizu M6 SP can have two different LCDs, the S6D0139 and another - (yet unknown) type, the exact type is detected at run-time. - - Open issues: - * LCD is currently in portrait mode instead of landscape mode - * This LCD driver accesses the Rockbox framebuffer directly, so any changes - to the framebuffer as shown directly even before lcd_update is called. - * Sometimes part of the top of the screen appears at the bottom - * The Meizu seems to hang after LCD initialisation - * The driver for the S6D0139 LCD has not been tested yet - - */ - -/* LCD SPI connections */ -#define LCD_SPI_SSn (1<<1) /* on PDAT7 */ -#define LCD_SPI_MISO (1<<2) /* on PDAT3 */ -#define LCD_SPI_MOSI (1<<6) /* on PDAT3 */ -#define LCD_SPI_SCLK (1<<7) /* on PDAT3 */ - -/* LCD SPI communication definitions */ -#define LCD_SPI_DEVICE_ID (0x1D<<2) -#define LCD_SPI_INDEX_WRITE (LCD_SPI_DEVICE_ID|0) -#define LCD_SPI_STATUS_READ (LCD_SPI_DEVICE_ID|1) -#define LCD_SPI_DATA_WRITE (LCD_SPI_DEVICE_ID|2) -#define LCD_SPI_DATA_READ (LCD_SPI_DEVICE_ID|3) - -#define LCD_TYPE1_ID 0x139 /* id for LCD type S6D0139 */ - -static int lcd_type = 0; -static bool lcd_is_active = false; - -/* simple and crude delay */ -static void lcd_delay(int count) -{ - volatile int i; - for (i = 0; i < count; i++); -} - -/* write 'data_out' of length 'bits' over SPI and return received data */ -static unsigned int lcd_spi_transfer(int bits, unsigned int data_out) -{ - unsigned int data_in = 0; - - /* SSn active */ - PDAT7 &= ~LCD_SPI_SSn; - lcd_delay(10); - - /* send and receive data */ - while (bits--) { - /* CLK low */ - PDAT3 &= ~LCD_SPI_SCLK; - - /* set MOSI */ - if (data_out & (1 << bits)) { - PDAT3 |= LCD_SPI_MOSI; - } - else { - PDAT3 &= ~LCD_SPI_MOSI; - } - - /* delay */ - lcd_delay(10); - - /* sample MISO */ - data_in <<= 1; - if (PDAT3 & LCD_SPI_MISO) { - data_in |= 1; - } - - /* CLK high */ - PDAT3 |= LCD_SPI_SCLK; - - /* delay */ - lcd_delay(10); - } - - /* SSn inactive */ - PDAT7 |= LCD_SPI_SSn; - lcd_delay(10); - - return data_in; -} - -/* initialize the lcd SPI port interface */ -static void lcd_spi_init(void) -{ - /* configure SSn (P7.1) as output */ - PCON7 = (PCON7 & ~0x000000F0) | 0x00000010; - - /* configure MISO (P3.2) input, MOSI (P3.6) output, SCLK (P3.7) output */ - PCON3 = (PCON3 & ~0xFF000F00) | 0x11000000; - - /* set all outputs high */ - PDAT7 |= LCD_SPI_SSn; - PDAT3 |= (LCD_SPI_MOSI | LCD_SPI_SCLK); -} - -/* read LCD identification word over SPI */ -static unsigned int lcd_read_reg(unsigned reg) -{ - unsigned int data; - - lcd_spi_transfer(24, (LCD_SPI_INDEX_WRITE << 16) | reg); - data = lcd_spi_transfer(24, (LCD_SPI_DATA_READ << 16)); - return data & 0xFFFF; -} - -/* write LCD register over SPI */ -static void lcd_write_reg(unsigned char reg, unsigned int data) -{ - lcd_spi_transfer(24, (LCD_SPI_INDEX_WRITE << 16) | reg); - lcd_spi_transfer(24, (LCD_SPI_DATA_WRITE << 16) | data); -} - -/* enable/disable clock signals towards the lcd */ -static void lcd_controller_power(bool on) -{ - if (on) { - LCDCON1 |= 0x80003; - } - else { - LCDCON1 &= ~0x80003; - } -} - -/* lcd init configuration for lcd type 1 */ -static void lcd_init1(void) -{ - lcd_write_reg(0x07, 0x0000); /* display control */ - lcd_write_reg(0x13, 0x0000); /* power control 3 */ - lcd_delay(166670); - - lcd_write_reg(0x11, 0x3304); /* power control 2 */ - lcd_write_reg(0x14, 0x1300); /* power control 4 */ - lcd_write_reg(0x10, 0x1A20); /* power control 1 */ - lcd_write_reg(0x13, 0x0040); /* power control 3 */ - lcd_delay(833350); - - lcd_write_reg(0x13, 0x0060); /* power control 3 */ - lcd_write_reg(0x13, 0x0070); /* power control 3 */ - lcd_delay(3333400); - - lcd_write_reg(0x01, 0x0127); /* driver output control */ - lcd_write_reg(0x02, 0x0700); /* lcd driving waveform control */ - lcd_write_reg(0x03, 0x1030); /* entry mode */ - lcd_write_reg(0x08, 0x0208); /* blank period control 1 */ - lcd_write_reg(0x0B, 0x0620); /* frame cycle control */ - lcd_write_reg(0x0C, 0x0110); /* external interface control */ - lcd_write_reg(0x30, 0x0120); /* gamma control 1 */ - lcd_write_reg(0x31, 0x0117); /* gamma control 2 */ - lcd_write_reg(0x32, 0x0000); /* gamma control 3 */ - lcd_write_reg(0x33, 0x0305); /* gamma control 4 */ - lcd_write_reg(0x34, 0x0717); /* gamma control 5 */ - lcd_write_reg(0x35, 0x0124); /* gamma control 6 */ - lcd_write_reg(0x36, 0x0706); /* gamma control 7 */ - lcd_write_reg(0x37, 0x0503); /* gamma control 8 */ - lcd_write_reg(0x38, 0x1F03); /* gamma control 9 */ - lcd_write_reg(0x39, 0x0009); /* gamma control 10 */ - lcd_write_reg(0x40, 0x0000); /* gate scan position */ - lcd_write_reg(0x41, 0x0000); /* vertical scroll control */ - lcd_write_reg(0x42, 0x013F); /* 1st screen driving position (end) */ - lcd_write_reg(0x43, 0x0000); /* 1st screen driving position (start) */ - lcd_write_reg(0x44, 0x013F); /* 2nd screen driving position (end) */ - lcd_write_reg(0x45, 0x0000); /* 2nd screen driving position (start) */ - lcd_write_reg(0x46, 0xEF00); /* horizontal window address */ - lcd_write_reg(0x47, 0x013F); /* vertical window address (end) */ - lcd_write_reg(0x48, 0x0000); /* vertical window address (start) */ - - lcd_write_reg(0x07, 0x0015); /* display control */ - lcd_delay(500000); - lcd_write_reg(0x07, 0x0017); /* display control */ - - lcd_write_reg(0x20, 0x0000); /* RAM address set (low part) */ - lcd_write_reg(0x21, 0x0000); /* RAM address set (high part) */ - lcd_write_reg(0x22, 0x0000); /* write data to GRAM */ -} - -/* lcd init configuration for lcd type 2 */ -static void lcd_init2(void) -{ - lcd_write_reg(0x07, 0x0000); - lcd_write_reg(0x12, 0x0000); - lcd_delay(166670); - - lcd_write_reg(0x11, 0x000C); - lcd_write_reg(0x12, 0x0A1C); - lcd_write_reg(0x13, 0x0022); - lcd_write_reg(0x14, 0x0000); - - lcd_write_reg(0x10, 0x7404); - lcd_write_reg(0x11, 0x0738); - lcd_write_reg(0x10, 0x7404); - lcd_delay(833350); - - lcd_write_reg(0x07, 0x0009); - lcd_write_reg(0x12, 0x065C); - lcd_delay(3333400); - - lcd_write_reg(0x01, 0xE127); - lcd_write_reg(0x02, 0x0300); - lcd_write_reg(0x03, 0x1100); - lcd_write_reg(0x08, 0x0008); - lcd_write_reg(0x0B, 0x0000); - lcd_write_reg(0x0C, 0x0000); - lcd_write_reg(0x0D, 0x0007); - lcd_write_reg(0x15, 0x0003); - lcd_write_reg(0x16, 0x0014); - lcd_write_reg(0x17, 0x0000); - - lcd_write_reg(0x30, 0x0503); /* gamma? */ - lcd_write_reg(0x31, 0x0303); - lcd_write_reg(0x32, 0x0305); - lcd_write_reg(0x33, 0x0202); - lcd_write_reg(0x34, 0x0204); - lcd_write_reg(0x35, 0x0404); - lcd_write_reg(0x36, 0x0402); - lcd_write_reg(0x37, 0x0202); - lcd_write_reg(0x38, 0x1000); - lcd_write_reg(0x39, 0x1000); - - lcd_write_reg(0x07, 0x0009); - lcd_delay(666680); - - lcd_write_reg(0x07, 0x0109); - lcd_delay(666680); - - lcd_write_reg(0x07, 0x010B); -} - -/* lcd enable for lcd type 1 */ -static void lcd_enable1(bool on) -{ - if (on) { - lcd_write_reg(0x00, 0x0001); /* start oscillation */ - lcd_delay(166670); - lcd_write_reg(0x10, 0x0000); /* power control 1 */ - lcd_delay(166670); - - lcd_write_reg(0x11, 0x3304); /* power control 2 */ - lcd_write_reg(0x14, 0x1300); /* power control 4 */ - lcd_write_reg(0x10, 0x1A20); /* power control 1 */ - lcd_write_reg(0x07, 0x0015); /* display control */ - lcd_delay(500000); - - lcd_write_reg(0x20, 0x0000); /* RAM address set (low part) */ - lcd_write_reg(0x21, 0x0000); /* RAM address set (high part) */ - lcd_write_reg(0x22, 0x0000); /* write data to GRAM */ - } - else { - lcd_write_reg(0x07, 0x0016); /* display control */ - lcd_delay(166670 * 4); - lcd_write_reg(0x07, 0x0004); /* display control */ - lcd_delay(166670 * 4); - - lcd_write_reg(0x10, 0x1E21); /* power control 1 */ - lcd_delay(166670); - } -} - -/* lcd enable for lcd type 2 */ -static void lcd_enable2(bool on) -{ - if (on) { - lcd_write_reg(0x10, 0x0400); - lcd_delay(666680); - - lcd_write_reg(0x07, 0x0000); - lcd_write_reg(0x12, 0x0000); - lcd_delay(166670); - - lcd_write_reg(0x11, 0x000C); - lcd_write_reg(0x12, 0x0A1C); - lcd_write_reg(0x13, 0x0022); - lcd_write_reg(0x14, 0x0000); - lcd_write_reg(0x10, 0x7404); - lcd_write_reg(0x11, 0x0738); - lcd_write_reg(0x10, 0x7404); - lcd_delay(833350); - - lcd_write_reg(0x07, 0x0009); - lcd_write_reg(0x12, 0x065C); - lcd_delay(3333400); - - lcd_write_reg(0x0B, 0x0000); - lcd_write_reg(0x07, 0x0009); - lcd_delay(666680); - - lcd_write_reg(0x07, 0x0109); - lcd_delay(666680); - - lcd_write_reg(0x07, 0x010B); - } - else { - lcd_write_reg(0x0B, 0x0109); - lcd_write_reg(0x07, 0x0009); - lcd_delay(666680); - - lcd_write_reg(0x07, 0x0008); - lcd_delay(666680); - - lcd_write_reg(0x10, 0x0400); - lcd_write_reg(0x10, 0x0401); - lcd_delay(166670); - } -} - -/* turn both the lcd controller and the lcd itself on or off */ -void lcd_enable(bool on) -{ - if (on) { - /* enable controller clock */ - PWRCON &= ~(1 << 18); - - lcd_controller_power(true); - lcd_delay(166670); - } - - /* call type specific power function */ - if (lcd_type == 1) { - lcd_enable1(on); - } - else { - lcd_enable2(on); - } - - if (!on) { - lcd_controller_power(false); - - /* disable controller clock */ - PWRCON |= (1 << 18); - } - - lcd_is_active = on; -} - -bool lcd_active(void) -{ - return lcd_is_active; -} - -/* initialise the lcd controller inside the s5l8700 */ -static void lcd_controller_init(void) -{ - PWRCON &= ~(1 << 18); - - LCDCON1 = (0 << 28) | /* BURSTLEN */ - (0 << 19) | /* DIVEN */ - (12 << 13) | /* CLKVAL */ - (1 << 12) | /* CLKDIR, 1=divided clock */ - (0 << 11) | /* CLKSEL, 0=HCLK, 1=PLL */ - (5 << 6) | /* BPPMODEF, 5=rgb565, 7=raw24 */ - (5 << 2) | /* BPPMODEB, 5=rgb565, 7=raw24 */ - (0 << 0); /* ENVID */ - LCDCON2 = (2 << 9) | /* PALFRM, 2=rgb565 palette */ - (1 << 7) | /* IVCLK */ - (1 << 6) | /* IHSYNC */ - (1 << 5) | /* IVSYNC */ - (1 << 3); /* IVDEN */ - LCDTCON1 = (lcd_type == 1) ? 0x070103 : 0x030303; - LCDTCON2 = (lcd_type == 1) ? 0x070103 : 0x030703; - LCDTCON3 = ((LCD_HEIGHT - 1) << 11) | (LCD_WIDTH - 1); - LCDOSD1 = 0; - LCDOSD2 = 0; - LCDOSD3 = 0; - - LCDB1SADDR1 = 0; - LCDB2SADDR1 = 0; - LCDF1SADDR1 = 0; - LCDF2SADDR1 = 0; - LCDB1SADDR2 = 0; - LCDB2SADDR2 = 0; - LCDF1SADDR2 = 0; - LCDF2SADDR2 = 0; - LCDB1SADDR3 = 0; - LCDB2SADDR3 = 0; - LCDF1SADDR3 = 0; - LCDF2SADDR3 = 0; - - LCDKEYCON = 0; - LCDCOLVAL = 0; - LCDBGCON = 0; - LCDFGCON = 0; - LCDDITHMODE = 0; - - LCDINTCON = 0; -} - -void lcd_init_device(void) -{ - unsigned int lcd_id; - uint32_t fb, fb_end, window; - - /* configure LCD SPI pins */ - lcd_spi_init(); - - /* identify display through SPI */ - lcd_id = lcd_read_reg(0); - lcd_type = (lcd_id == LCD_TYPE1_ID) ? 1 : 2; - - /* display specific init sequence */ - if (lcd_type == 1) { - lcd_init1(); - } - else { - lcd_init2(); - } - - /* init LCD controller */ - lcd_controller_init(); - - /* set framebuffer addresses */ - fb = (uint32_t) FBADDR(0,0); - fb_end = (uint32_t) FBADDR(0,LCD_HEIGHT); - window = 2 * LCD_WIDTH; - - LCDB1SADDR1 = fb; - LCDB2SADDR1 = fb; - LCDF1SADDR1 = fb; - LCDF2SADDR1 = fb; - - LCDB1SADDR2 = fb_end; - LCDB2SADDR2 = fb_end; - LCDF1SADDR2 = fb_end; - LCDF2SADDR2 = fb_end; - - LCDB1SADDR3 = window; - LCDB2SADDR3 = window; - LCDF1SADDR3 = window; - LCDF2SADDR3 = window; - - lcd_enable(true); - - /* configure LCD pins */ - PCON_ASRAM = 1; -} - -void lcd_update_rect(int x, int y, int width, int height) -{ - /* not implemented yet, LCD controller accesses framebuffer directly */ - (void) x; - (void) y; - (void) width; - (void) height; -} - -void lcd_update(void) -{ - lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); -} - -void lcd_blit_yuv(unsigned char * const src[3], - int src_x, int src_y, int stride, - int x, int y, int width, int height) -{ - (void)src; - (void)src_x; - (void)src_y; - (void)stride; - (void)x; - (void)y; - (void)width; - (void)height; - /* TODO: not implemented yet */ -} - diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/nand-target.h b/firmware/target/arm/s5l8700/meizu-m6sp/nand-target.h deleted file mode 100644 index dee690e5e6..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sp/nand-target.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __NAND_TARGET_H__ -#define __NAND_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - - -struct nand_device_info_type -{ - uint32_t id; - uint16_t blocks; - uint16_t userblocks; - uint16_t pagesperblock; - uint8_t blocksizeexponent; - uint8_t tunk1; - uint8_t twp; - uint8_t tunk2; - uint8_t tunk3; -} __attribute__((packed)); - -uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc, - uint32_t checkempty); -uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc); -uint32_t nand_block_erase(uint32_t bank, uint32_t page); - -const struct nand_device_info_type* nand_get_device_type(uint32_t bank); -uint32_t nand_reset(uint32_t bank); -uint32_t nand_device_init(void); -void nand_set_active(void); -long nand_last_activity(void); -void nand_power_up(void); -void nand_power_down(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/powermgmt-m6sp.c b/firmware/target/arm/s5l8700/meizu-m6sp/powermgmt-m6sp.c deleted file mode 100644 index 8147d75a37..0000000000 --- a/firmware/target/arm/s5l8700/meizu-m6sp/powermgmt-m6sp.c +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright © 2008 Rafaël Carré - * - * 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 "powermgmt.h" -#include "adc.h" -#include "adc-target.h" - -unsigned short battery_level_disksafe = 3400;/* TODO: this is just an initial guess */ - -unsigned short battery_level_shutoff = 3300; /* TODO: this is just an initial guess */ - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -unsigned short percent_to_volt_discharge[11] = -{ - /* TODO: simple uncalibrated curve, linear except for first 10% */ - 3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200 -}; - -#if CONFIG_CHARGING -/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ -unsigned short percent_to_volt_charge[11] = -{ - /* TODO: simple uncalibrated curve, linear except for first 10% */ - 3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200 -}; -#endif /* CONFIG_CHARGING */ - -/* ADC should read 0x3ff=6.00V */ -#define BATTERY_SCALE_FACTOR 6000 -/* full-scale ADC readout (2^10) in millivolt */ - - -/* Returns battery voltage from ADC [millivolts] */ -int _battery_voltage(void) -{ - return (adc_read(ADC_BATTERY) * BATTERY_SCALE_FACTOR) >> 10; -} diff --git a/firmware/target/arm/s5l8700/nand-meizu.c b/firmware/target/arm/s5l8700/nand-meizu.c deleted file mode 100644 index 382a147286..0000000000 --- a/firmware/target/arm/s5l8700/nand-meizu.c +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2010 by Bertrik Sikken - * - * 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 "nand-target.h" - -const struct nand_device_info_type* nand_get_device_type(uint32_t bank); - - -uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc, - uint32_t checkempty) -{ - /* TODO implement */ - return 0; -} - -uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer, - void* sparebuffer, uint32_t doecc) -{ - /* TODO implement */ - return 0; -} - -uint32_t nand_block_erase(uint32_t bank, uint32_t page) -{ - /* TODO implement */ - return 0; -} - -uint32_t nand_reset(uint32_t bank) -{ - /* TODO implement */ - return 0; -} - -uint32_t nand_device_init(void) -{ - /* TODO implement */ - return 0; -} - -void nand_power_up(void) -{ - /* TODO implement */ -} - -void nand_power_down(void) -{ - /* TODO implement */ -} - -void nand_set_active(void) -{ - /* TODO implement */ -} - -long nand_last_activity(void) -{ - /* TODO implement */ - return 0; -} - diff --git a/firmware/target/arm/s5l8700/power-meizu.c b/firmware/target/arm/s5l8700/power-meizu.c deleted file mode 100644 index 709847e599..0000000000 --- a/firmware/target/arm/s5l8700/power-meizu.c +++ /dev/null @@ -1,92 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright © 2009 Bertrik Sikken - * - * 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 -#include "config.h" -#include "inttypes.h" -#include "s5l87xx.h" -#include "power.h" - -/* Power handling for S5L8700 based Meizu players - - The M3 and M6 players appear to use the same pins for power, USB detection - and charging status. -*/ - -void power_off(void) -{ - /* take down PWRON_M (P1.3) */ - PDAT1 &= ~(1 << 3); -} - -void power_init(void) -{ - /* configure PWRON_M (P1.3) as output and set it to keep power turned on */ - PCON1 = (PCON1 & ~(0xF << 12)) | (0x1 << 12); - PDAT1 |= (1 << 3); - - /* configure PBSTAT (P1.4) as input */ - PCON1 &= ~(0xF << 16); - - /* configure CHRG (P5.7) as input to monitor charging state */ - PCON5 &= ~(0xF << 28); - - /* enable USB2.0 function controller to allow VBUS monitoring */ - PWRCON &= ~(1 << 15); -} - -#if CONFIG_CHARGING -unsigned int power_input_status(void) -{ - /* check VBUS in the USB2.0 function controller */ - if (USB_TR & (1 << 15)) { - return POWER_INPUT_USB; - } - - return POWER_INPUT_NONE; -} - -bool charging_state(void) -{ - /* CHRG pin goes low when charging */ - return ((PDAT5 & (1 << 7)) == 0); -} -#endif /* CONFIG_CHARGING */ - -#if CONFIG_TUNER -static bool tuner_on = false; - -bool tuner_power(bool status) -{ - if (status != tuner_on) - { - tuner_on = status; - status = !status; - } - - return status; -} - -bool tuner_powered(void) -{ - return tuner_on; /* No debug info */ -} -#endif /* CONFIG_TUNER */ - diff --git a/firmware/target/arm/s5l8700/system-s5l8700.c b/firmware/target/arm/s5l8700/system-s5l8700.c index 226464fb08..c442b74971 100644 --- a/firmware/target/arm/s5l8700/system-s5l8700.c +++ b/firmware/target/arm/s5l8700/system-s5l8700.c @@ -35,12 +35,6 @@ #if defined(IPOD_NANO2G) #define MIUSDPARA_BOOST 0x006A49A5 #define MIUSDPARA_UNBOOST 0x006124D1 -#elif defined(MEIZU_M3) - #define MIUSDPARA_BOOST 0x006A491D - #define MIUSDPARA_UNBOOST 0x0061248D -#elif defined(MEIZU_M6SP) - #define MIUSDPARA_BOOST 0x006A4965 - #define MIUSDPARA_UNBOOST 0x00612491 #endif #define default_interrupt(name) \ diff --git a/firmware/target/arm/s5l8700/udacodec-meizu.c b/firmware/target/arm/s5l8700/udacodec-meizu.c deleted file mode 100644 index e0d4346370..0000000000 --- a/firmware/target/arm/s5l8700/udacodec-meizu.c +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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 "kernel.h" -#include "s5l87xx.h" -#include "i2c-s5l8700.h" -#include "uda1380.h" -#include "udacodec.h" - -void udacodec_reset(void) -{ - /* Reset codec using GPIO P5.0 */ - PCON5 = (PCON5 & ~0xF) | 1; - PDAT5 |= (1 << 0); - sleep(HZ/100); - - /* Set codec reset pin inactive */ - PDAT5 &= ~(1 << 0); -} - -int udacodec_write(unsigned char reg, unsigned short value) -{ - unsigned char data[2]; - - data[0] = value >> 8; - data[1] = value & 0xFF; - - return i2c_write(UDA1380_ADDR, reg, 2, data); -} - -int udacodec_write2(unsigned char reg, - unsigned short value1, unsigned short value2) -{ - unsigned char data[4]; - - data[0] = value1 >> 8; - data[1] = value1 & 0xFF; - data[2] = value2 >> 8; - data[3] = value2 & 0xFF; - - return i2c_write(UDA1380_ADDR, reg, 4, data); -} - diff --git a/firmware/target/arm/s5l8700/yps3/backlight-target.h b/firmware/target/arm/s5l8700/yps3/backlight-target.h deleted file mode 100644 index 74ea0aa035..0000000000 --- a/firmware/target/arm/s5l8700/yps3/backlight-target.h +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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_hw_init(void); -void backlight_hw_on(void); -void backlight_hw_off(void); -void backlight_hw_brightness(int brightness); - -void buttonlight_hw_on(void); -void buttonlight_hw_off(void); - -#endif /* BACKLIGHT_TARGET_H */ - diff --git a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c deleted file mode 100644 index ae3cc3b0a1..0000000000 --- a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c +++ /dev/null @@ -1,100 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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 - -#include "config.h" -#include "backlight.h" -#include "backlight-target.h" -#include "system.h" - -/* - Backlight driver using the PWM mode of a hardware timer. - - The PWM duty cycle depends exponentially on the configured brightness - level. This makes the brightness curve more linear to the human eye. - - The button LEDs are all activated at the same time (even though there - are three individually controllable groups: menu/back, cursor, middle). - */ - -void backlight_hw_brightness(int brightness) -{ - /* pwm = round(16 * 16**(x/16)), where brightness level x = 1..16 */ - static const unsigned int logtable[] = - {19, 23, 27, 32, 38, 45, 54, 64, 76, 91, 108, 128, 152, 181, 215, 256}; - - /* set PWM width */ - TADATA0 = logtable[brightness]; -} - -void backlight_hw_on(void) -{ - /* configure backlight pin P0.0 as timer PWM output */ - PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0)); - - backlight_hw_brightness(backlight_brightness); -} - -void backlight_hw_off(void) -{ - /* configure backlight pin P0.0 as GPIO and switch off */ - PCON0 = ((PCON0 & ~(3 << 0)) | (1 << 0)); - PDAT0 &= ~(1 << 0); -} - -void buttonlight_hw_on(void) -{ - PDAT3 |= (3 << 2); - PDAT4 |= (1 << 2); -} - -void buttonlight_hw_off(void) -{ - PDAT3 &= ~(3 << 2); - PDAT4 &= ~(1 << 2); -} - -bool backlight_hw_init(void) -{ - /* Enable button LEDs: P3.2 (menu/back), P3.3 (cursor), P4.2 (middle) */ - PCON3 = (PCON3 & ~0x0000FF00) | 0x00001100; - PCON4 = (PCON4 & ~0x00000F00) | 0x00000100; - buttonlight_hw_off(); - - /* enable timer clock */ - PWRCON &= ~(1 << 4); - - /* configure timer */ - TACMD = (1 << 1); /* TA_CLR */ - TACON = (0 << 13) | /* TA_INT1_EN */ - (0 << 12) | /* TA_INT0_EN */ - (1 << 11) | /* TA_START */ - (3 << 8) | /* TA_CS = PCLK / 64 */ - (1 << 4); /* TA_MODE_SEL = PWM mode */ - TADATA1 = 256; /* set PWM period */ - TAPRE = 20; /* prescaler */ - TACMD = (1 << 0); /* TA_EN */ - - backlight_hw_on(); - - return true; -} - diff --git a/firmware/target/arm/s5l8700/yps3/button-target.h b/firmware/target/arm/s5l8700/yps3/button-target.h deleted file mode 100644 index 4b3ffa4a76..0000000000 --- a/firmware/target/arm/s5l8700/yps3/button-target.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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_ - -#define HAS_BUTTON_HOLD - -#define BUTTON_BACK 0x00000001 -#define BUTTON_MENU 0x00000002 -#define BUTTON_UP 0x00000004 -#define BUTTON_DOWN 0x00000008 -#define BUTTON_LEFT 0x00000010 -#define BUTTON_RIGHT 0x00000020 -#define BUTTON_SELECT 0x00000040 -#define BUTTON_POWER 0x00000080 - -#define BUTTON_MAIN (BUTTON_BACK|BUTTON_MENU|BUTTON_UP|BUTTON_DOWN|BUTTON_LEFT|\ - BUTTON_RIGHT|BUTTON_SELECT) - -#define POWEROFF_BUTTON BUTTON_POWER -#define POWEROFF_COUNT 10 - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/s5l8700/yps3/button-yps3.c b/firmware/target/arm/s5l8700/yps3/button-yps3.c deleted file mode 100644 index 23b71a4675..0000000000 --- a/firmware/target/arm/s5l8700/yps3/button-yps3.c +++ /dev/null @@ -1,156 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bertrik Sikken - * - * 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 -#include "config.h" - -#include "inttypes.h" -#include "s5l87xx.h" -#include "button.h" -#include "button-target.h" - -/* Button driver for the touch keys on the Samsung YP-S3 - - The exact controller is not known, but it is likely from Melfas. - - The protocol is as follows: - * the communication is done using three signals: DRDY, DCLK and DOUT - * in the idle state these signals are all high. - * when a key is touched or released, the key controller pulls down DRDY - and outputs the first bit of a 20-bit word on its DOUT signal. - * the CPU stores the bit, then acknowledges it by toggling the DCLK signal. - * the key controller prepares the next bit, then toggles its DRDY output, - unless all 20 bits have been transferred (in that case it stays high). - * the 20-bit word contains separate bits for each button, some fixed bits - and a bit indicating the number of keys pressed (modulo 2). - */ - - -void button_init_device(void) -{ - /* P0.5/P1.0 power switch input */ - PCON0 &= ~(3 << 10); - PCON1 &= ~0x0000000F; - - /* P1.3 headphones detect input */ - PCON1 &= ~0x0000F000; - - /* P1.5 DATA, P1.6 DRDY inputs (touch key controller) */ - PCON1 &= ~0x0FF00000; - - /* P3.4 DCLK output (touch key controller) */ - PCON3 = (PCON3 & ~0x000F0000) | 0x00010000; - PDAT3 |= (1 << 4); - - /* P4.3 hold switch input */ - PCON4 &= ~0x0000F000; -} - -/* returns the raw 20-bit word from the touch key controller */ -static int tkey_read(void) -{ - static int value = 0; - int i; - - /* check activity */ - if (PDAT1 & (1 << 6)) { - return value; - } - - /* get key bits */ - value = 0; - for (i = 0; i < 10; i++) { - /* sample bit from falling edge of DRDY */ - while ((PDAT1 & (1 << 6)) != 0); - value <<= 1; - if (PDAT1 & (1 << 5)) { - value |= 1; - } - - /* acknowledge on DCLK */ - PDAT3 &= ~(1 << 4); - - /* sample bit from rising edge of DRDY */ - while ((PDAT1 & (1 << 6)) == 0); - value <<= 1; - if (PDAT1 & (1 << 5)) { - value |= 1; - } - - /* acknowledge on DCLK */ - PDAT3 |= (1 << 4); - } - return value; -} - - -int button_read_device(void) -{ - int buttons = 0; - int tkey_data; - - /* hold switch */ - if (button_hold()) { - return 0; - } - - /* power button */ - if (PDAT1 & (1 << 0)) { - buttons |= BUTTON_POWER; - } - - /* touch keys */ - tkey_data = tkey_read(); - if (tkey_data & (1 << 9)) { - buttons |= BUTTON_BACK; - } - if (tkey_data & (1 << 8)) { - buttons |= BUTTON_UP; - } - if (tkey_data & (1 << 7)) { - buttons |= BUTTON_MENU; - } - if (tkey_data & (1 << 6)) { - buttons |= BUTTON_LEFT; - } - if (tkey_data & (1 << 5)) { - buttons |= BUTTON_SELECT; - } - if (tkey_data & (1 << 4)) { - buttons |= BUTTON_RIGHT; - } - if (tkey_data & (1 << 3)) { - buttons |= BUTTON_DOWN; - } - - return buttons; -} - -bool button_hold(void) -{ - return (PDAT4 & (1 << 3)); -} - -bool headphones_inserted(void) -{ - return ((PDAT1 & (1 << 3)) == 0); -} - diff --git a/firmware/target/arm/s5l8700/yps3/fmradio-i2c-yps3.c b/firmware/target/arm/s5l8700/yps3/fmradio-i2c-yps3.c deleted file mode 100644 index 29261b8265..0000000000 --- a/firmware/target/arm/s5l8700/yps3/fmradio-i2c-yps3.c +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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. - * - ****************************************************************************/ - -/* - FM radio i2c interface, allows the radio driver to talk to the tuner chip. - - */ - -#include "config.h" - -#include "i2c-s5l8700.h" -#include "fmradio_i2c.h" - -void fmradio_i2c_init(void) -{ - /* nothing to do */ -} - -int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) -{ - return i2c_write(address, -1, count, buf); -} - -int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) -{ - return i2c_read(address, -1, count, buf); -} - diff --git a/firmware/target/arm/s5l8700/yps3/ftl-target.h b/firmware/target/arm/s5l8700/yps3/ftl-target.h deleted file mode 100644 index cb943e34f2..0000000000 --- a/firmware/target/arm/s5l8700/yps3/ftl-target.h +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * 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 __FTL_TARGET_H__ -#define __FTL_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - -#ifdef BOOTLOADER -/* Bootloaders don't need write access */ -#define FTL_READONLY -#endif - -uint32_t ftl_init(void); -uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer); -uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer); -uint32_t ftl_sync(void); - - -#endif diff --git a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c deleted file mode 100644 index 2445198c65..0000000000 --- a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c +++ /dev/null @@ -1,337 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Bertrik Sikken - * - * 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 "s5l87xx.h" -#include "lcd.h" - -/* LCD driver for the Samsung YP-S3 - - It appears that this player can contain two display types. - Detection of the display type is done by looking at the level of pin P0.4. - Currently only display "type 2" has been implemented and tested. - - This driver could use DMA to do the screen updates, but currently writes - the data to the LCD using the processor instead. -*/ - - -static int lcd_type = 0; - - -static void lcd_delay(int delay) -{ - volatile int i; - for (i = 0; i < delay; i++); -} - -static void lcd_reset_delay(void) -{ - lcd_delay(10000); -} - -static void lcd_reset(void) -{ - LCD_CON = 0xDB8; - LCD_PHTIME = 0x22; - LCD_RST_TIME = 0x7FFF; - - lcd_reset_delay(); - LCD_DRV_RST = 0; - lcd_reset_delay(); - LCD_DRV_RST = 1; - lcd_reset_delay(); - LCD_DRV_RST = 0; - lcd_reset_delay(); - LCD_DRV_RST = 1; - - LCD_INTCON = 0; -} - -static void lcd_wcmd(unsigned int cmd) -{ - while ((LCD_STATUS & 0x10) != 0); - LCD_WCMD = cmd; -} - -static void lcd_wdata(unsigned int data) -{ - while ((LCD_STATUS & 0x10) != 0); - LCD_WDATA = data; -} - -static void lcd_wcmd_data(unsigned int cmd, unsigned int data) -{ - lcd_wcmd(cmd); - lcd_wdata(data); -} - -static void lcd_init1(void) -{ - lcd_wcmd(0x11); - lcd_delay(10000); - - lcd_wcmd(0xF0); - lcd_wdata(0x5A); - - lcd_wcmd(0xC0); - lcd_wdata(0x05); - lcd_wdata(0x01); - - lcd_wcmd(0xC1); - lcd_wdata(0x04); - - lcd_wcmd(0xC5); - lcd_wdata(0xB0); - - lcd_wcmd(0xC6); - lcd_wdata(0x0); - - lcd_wcmd(0xB1); - lcd_wdata(0x02); - lcd_wdata(0x0E); - lcd_wdata(0x00); - - lcd_wcmd(0xF2); - lcd_wdata(0x01); - - lcd_wcmd(0xE0); - lcd_wdata(0x09); - lcd_wdata(0x00); - lcd_wdata(0x06); - lcd_wdata(0x2E); - lcd_wdata(0x2B); - lcd_wdata(0x0B); - lcd_wdata(0x1A); - lcd_wdata(0x02); - lcd_wdata(0x06); - lcd_wdata(0x0C); - lcd_wdata(0x0D); - lcd_wdata(0x00); - lcd_wdata(0x05); - lcd_wdata(0x02); - lcd_wdata(0x05); - - lcd_wcmd(0xE1); - lcd_wdata(0x06); - lcd_wdata(0x23); - lcd_wdata(0x25); - lcd_wdata(0x0F); - lcd_wdata(0x0A); - lcd_wdata(0x04); - lcd_wdata(0x02); - lcd_wdata(0x1A); - lcd_wdata(0x05); - lcd_wdata(0x03); - lcd_wdata(0x06); - lcd_wdata(0x01); - lcd_wdata(0x0C); - lcd_wdata(0x0B); - lcd_wdata(0x05); - lcd_wdata(0x05); - - lcd_wcmd(0x3A); - lcd_wdata(0x05); - - lcd_wcmd(0x29); - - lcd_wcmd(0x2C); -} - -static void lcd_init2(void) -{ - lcd_wcmd_data(0x00, 0x0001); - lcd_delay(50000); - - lcd_wcmd_data(0x07, 0x0000); - lcd_wcmd_data(0x12, 0x0000); - lcd_delay(10000); - - lcd_wcmd(0); - lcd_wcmd(0); - lcd_wcmd(0); - lcd_wcmd(0); - - lcd_wcmd_data(0xA4, 0x0001); - lcd_delay(10000); - - lcd_wcmd_data(0x70, 0x1B00); - lcd_wcmd_data(0x08, 0x030A); - lcd_wcmd_data(0x30, 0x0000); - lcd_wcmd_data(0x31, 0x0305); - lcd_wcmd_data(0x32, 0x0304); - lcd_wcmd_data(0x33, 0x0107); - lcd_wcmd_data(0x34, 0x0304); - - lcd_wcmd_data(0x35, 0x0204); - lcd_wcmd_data(0x36, 0x0707); - lcd_wcmd_data(0x37, 0x0701); - lcd_wcmd_data(0x38, 0x1B08); - lcd_wcmd_data(0x39, 0x030F); - lcd_wcmd_data(0x3A, 0x0E0E); - - lcd_wcmd_data(0x07, 0x0001); - lcd_delay(50000); - - lcd_wcmd_data(0x18, 0x0001); - lcd_wcmd_data(0x10, 0x12B0); - lcd_wcmd_data(0x11, 0x0001); - - lcd_wcmd_data(0x12, 0x0114); - lcd_wcmd_data(0x13, 0x8D0F); - lcd_wcmd_data(0x12, 0x0134); - lcd_delay(1000); - lcd_wcmd_data(0x01, 0x0100); - lcd_wcmd_data(0x02, 0x0700); - lcd_wcmd_data(0x03, 0x5030); - - lcd_wcmd_data(0x04, 0x0000); - lcd_wcmd_data(0x09, 0x0000); - lcd_wcmd_data(0x0C, 0x0000); - lcd_wcmd_data(0x0F, 0x0000); - - lcd_wcmd_data(0x14, 0x8000); - lcd_wcmd_data(0x20, 0x0000); - lcd_wcmd_data(0x21, 0x0000); - lcd_wcmd_data(0x71, 0x0001); - lcd_wcmd_data(0x7A, 0x0000); - lcd_wcmd_data(0x90, 0x0000); - lcd_wcmd_data(0x91, 0x0100); - lcd_wcmd_data(0x92, 0x0000); - lcd_wcmd_data(0x98, 0x0001); - lcd_wcmd_data(0x99, 0x030C); - lcd_wcmd_data(0x9A, 0x030C); - - lcd_delay(50000); - lcd_wcmd_data(0x07, 0x0001); - lcd_delay(30000); - lcd_wcmd_data(0x07, 0x0021); - - lcd_wcmd_data(0x12, 0x1134); - lcd_delay(10000); - - lcd_wcmd_data(0x07, 0x0233); - lcd_delay(30000); -} - - -static void lcd_set_window1(int x, int y, int width, int height) -{ - (void)x; - (void)width; - - lcd_wcmd(0x2A); - lcd_wdata(0); - lcd_wdata(y); - lcd_wdata(0); - - lcd_wcmd(0x2B); - lcd_wdata(0); - lcd_wdata(y + height - 1); - lcd_wdata(0); -} - -static void lcd_set_window2(int x, int y, int width, int height) -{ - lcd_wcmd_data(0x50, x); - lcd_wcmd_data(0x51, x + width - 1); - lcd_wcmd_data(0x52, y); - lcd_wcmd_data(0x53, y + height - 1); -} - - -static void lcd_set_position1(int x, int y) -{ - (void)x; - (void)y; -} - -static void lcd_set_position2(int x, int y) -{ - lcd_wcmd_data(0x20, x); - lcd_wcmd_data(0x21, y); - lcd_wcmd(0x22); -} - -void lcd_init_device(void) -{ - /* enable LCD clock */ - PWRCON &= ~(1 << 18); - - /* configure LCD pins */ - PCON0 &= ~(3 << 8); - PCON7 = (PCON7 & ~(0x000000FF)) | 0x00000033; - PCON_ASRAM = 2; - - lcd_reset(); - - /* detect LCD type on P0.4 */ - lcd_type = (PDAT0 & (1 << 4)) ? 1 : 2; - - /* initialise display */ - if (lcd_type == 1) { - lcd_init1(); - } else { - lcd_init2(); - } -} - -void lcd_update_rect(int x, int y, int width, int height) -{ - fb_data* p; - int h, w; - - void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; - if (lcd_type == 1) { - /* TODO implement and test */ - lcd_set_window1(x, y, width, height); - lcd_set_position1(x, y); - - for (h = 0; h < height; h++) { - p = fbaddr(0,y); - for (w = 0; w < LCD_WIDTH; w++) { - while (LCD_STATUS & 0x10); - LCD_WDATA = *p++; - } - y++; - } - } - else { - lcd_set_window2(x, y, width, height); - lcd_set_position2(x, y); - - for (h = 0; h < height; h++) { - p = fbaddr(x,y); - for (w = 0; w < width; w++) { - while (LCD_STATUS & 0x10); - LCD_WDATA = *p++; - } - y++; - } - } -} - -void lcd_update(void) -{ - lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); -} - diff --git a/firmware/target/arm/s5l8700/yps3/nand-target.h b/firmware/target/arm/s5l8700/yps3/nand-target.h deleted file mode 100644 index b617c2c27f..0000000000 --- a/firmware/target/arm/s5l8700/yps3/nand-target.h +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bertrik Sikken - * - * 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 _NAND_TARGET_H_ -#define _NAND_TARGET_H_ - -#include "config.h" - -void nand_ll_init(void); -unsigned int nand_ll_read_id(int bank); - -/* TODO later: create nand_ll_read/write/erase prototypes */ - -#endif /* _NAND_TARGET_H_ */ - diff --git a/firmware/target/arm/s5l8700/yps3/nand-yps3.c b/firmware/target/arm/s5l8700/yps3/nand-yps3.c deleted file mode 100644 index 86098ae8b0..0000000000 --- a/firmware/target/arm/s5l8700/yps3/nand-yps3.c +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 Bertrik Sikken - * - * 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 - -#include "config.h" -#include "s5l87xx.h" -#include "nand-target.h" - -/* Driver for the S5L8700 flash memory controller for low-level access to the - NAND flash of the Samsung YP-S3. - - The YP-S3 seems to use the pins P6.5 and P6.6 as chip selects in GPIO mode - instead of using the regular pins P6.3 and P6.4. -*/ - -#define FMSTAT_RBB (1<<0) -#define FMSTAT_RBBDone (1<<1) -#define FMSTAT_CMDDone (1<<2) -#define FMSTAT_AddrDone (1<<3) -#define FMSTAT_TransDone (1<<4) -#define FMSTAT_WFIFO_HEMPTY (1<<5) -#define FMSTAT_RFIFO_HFULL (1<<6) -#define FMSTAT_WFIFO_EMPTY (1<<8) -#define FMSTAT_RFIFO_FULL (1<<9) -#define FMSTAT_EndECC (1<<10) - -#define FMCTRL1_DoTransAddr (1<<0) -#define FMCTRL1_DoReadData (1<<1) -#define FMCTRL1_DoWriteData (1<<2) -#define FMCTRL1_WriteREQSEL (1<<4) -#define FMCTRL1_ClearSyndPtr (1<<5) -#define FMCTRL1_ClearWFIFO (1<<6) -#define FMCTRL1_ClearRFIFO (1<<7) -#define FMCTRL1_ParityPtr (1<<8) -#define FMCTRL1_SyndPtr (1<<9) - -static void nand_chip_select(int bank) -{ - unsigned int select; - - select = (1 << bank); - FMCTRL0 = 0x1821 | ((select & 3) << 1); - PDAT6 = (PDAT6 & ~0x60) | ((~select & 0xC) << 3); -} - -void nand_ll_init(void) -{ - /* enable flash memory controller */ - PWRCON &= ~(1 << 1); - - /* P2.X is SMC I/O */ - PCON2 = 0x55555555; - /* P4.1 = CLE, P4.4 = nWR, P4.5 = nRD */ - PCON4 = (PCON4 & ~0x00FF00F0) | 0x00550050; - /* P6.0 = nf_rbn, P6.1 = smc_ce0, P6.2 = smc_ce1, - P6.5 = smc_ce2 (as GPIO), P6.6 = smc_ce3 (as GPIO), P6.7 = ALE */ - PCON6 = (PCON6 & ~0xFFF00FFF) | 0x51100555; - PDAT6 |= 0x60; -} - -unsigned int nand_ll_read_id(int bank) -{ - unsigned int nand_id; - - nand_chip_select(bank); - - /* send "read id" command */ - FMCMD = 0x90; - while ((FMCSTAT & FMSTAT_CMDDone) == 0); - FMCSTAT = FMSTAT_CMDDone; - - /* transfer address */ - FMANUM = 0; - FMADDR0 = 0; - FMCTRL1 = FMCTRL1_DoTransAddr; - while ((FMCSTAT & FMSTAT_AddrDone) == 0); - FMCSTAT = FMSTAT_AddrDone; - - /* read back data */ - FMDNUM = 3; - FMCTRL1 = FMCTRL1_DoReadData; - while ((FMCSTAT & FMSTAT_TransDone) == 0); - FMCSTAT = FMSTAT_TransDone; - nand_id = FMFIFO; - - /* clear read FIFO */ - FMCTRL1 = FMCTRL1_ClearRFIFO; - - return nand_id; -} - diff --git a/firmware/target/arm/s5l8700/yps3/power-yps3.c b/firmware/target/arm/s5l8700/yps3/power-yps3.c deleted file mode 100644 index 6f845bd5ff..0000000000 --- a/firmware/target/arm/s5l8700/yps3/power-yps3.c +++ /dev/null @@ -1,104 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright © 2009 Bertrik Sikken - * - * 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 -#include "config.h" -#include "s5l87xx.h" -#include "power.h" - -/* Power handling for the S5L8700 based Samsung YP-S3 - - Pins involved in power management: - * P0.1: stay powered up (even with the USB cable unplugged) - * P1.1: USB power detect - * P4.7: tuner power/enable - * P5.2: unknown output - * P5.3: unknown output, related to charging (perhaps charge current?) - * P5.4: charge status input (only valid if charger enabled) - * P5.6: charger enable -*/ - -void power_off(void) -{ - /* take down P0.1 to power off (plugged USB cable overrides this though) */ - PDAT0 &= ~(1 << 1); - - while(1); /* wait for system to shut down */ -} - -void power_init(void) -{ - /* configure P0.1 as output for power-up and stay powered up */ - PCON0 = (PCON0 & ~(3 << 2)) | (1 << 2); - PDAT0 |= (1 << 1); - - /* configure P1.1 as input for USB power detect */ - PCON1 = (PCON1 & ~0x000000F0) | 0x00000000; - - /* configure P4.7 as output for tuner power and turn power off */ - PCON4 = (PCON4 & ~0xF0000000) | 0x10000000; - PDAT4 &= ~(1 << 7); - - /* configure P5.2 / P5.3 / P5.6 as output, P5.4 as input */ - PCON5 = (PCON5 & ~0x0F0FFF00) | 0x01001100; - PDAT5 &= ~((1 << 2) | (1 << 3) | (1 << 6)); -} - -#if CONFIG_CHARGING -unsigned int power_input_status(void) -{ - /* check USB power on P1.1 */ - if (PDAT1 & (1 << 1)) { - return POWER_INPUT_USB; - } - - return POWER_INPUT_NONE; -} - -bool charging_state(void) -{ - /* check if charger is enabled */ - if (PDAT5 & (1 << 6)) { - /* check if charging is busy */ - return (PDAT5 & (1 << 4)); - } - return false; -} -#endif /* CONFIG_CHARGING */ - -#if CONFIG_TUNER -bool tuner_power(bool status) -{ - if (status) { - PDAT4 |= (1 << 7); - } - else { - PDAT4 &= ~(1 << 7); - } - /* TODO what should we return here? */ - return status; -} - -bool tuner_powered(void) -{ - return (PDAT4 & (1 << 7)); -} -#endif /* CONFIG_TUNER */ - diff --git a/firmware/target/arm/s5l8702/ipodnano3g/adc-nano3g.c b/firmware/target/arm/s5l8702/ipodnano3g/adc-nano3g.c index 24a2bc88e9..42c5518210 100644 --- a/firmware/target/arm/s5l8702/ipodnano3g/adc-nano3g.c +++ b/firmware/target/arm/s5l8702/ipodnano3g/adc-nano3g.c @@ -41,6 +41,23 @@ unsigned short adc_read(int channel) return 0; } +int adc_read_accessory_resistor(void) +{ + return 0; +} + +unsigned int adc_read_usbdata_voltage(bool dp) +{ + (void)dp; + return 0; +} + +const char *adc_name(int channel) +{ + (void) channel; + return ""; +} + void adc_init(void) { } diff --git a/firmware/target/arm/s5l8702/ipodnano3g/nand-nano3g.c b/firmware/target/arm/s5l8702/ipodnano3g/nand-nano3g.c index 9115df03aa..9eede7b074 100644 --- a/firmware/target/arm/s5l8702/ipodnano3g/nand-nano3g.c +++ b/firmware/target/arm/s5l8702/ipodnano3g/nand-nano3g.c @@ -28,6 +28,22 @@ int nand_init(void) return 0; } +void nand_spindown(int seconds) +{ + (void)seconds; +} + +void nand_spin(void) +{ +} + +#ifdef HAVE_STORAGE_FLUSH +int nand_flush(void) +{ + return 0; +} +#endif + int nand_read_sectors(IF_MD(int drive,) sector_t start, int incount, void* inbuf) { @@ -74,3 +90,9 @@ void nand_get_info(IF_MD(int drive,) struct storage_info *info) info->revision = ""; } #endif + +long nand_last_disk_activity(void) +{ + // TODO + return 0; +} diff --git a/firmware/target/arm/s5l8702/ipodnano3g/pmu-nano3g.c b/firmware/target/arm/s5l8702/ipodnano3g/pmu-nano3g.c index c485877fa8..1de7a0918e 100644 --- a/firmware/target/arm/s5l8702/ipodnano3g/pmu-nano3g.c +++ b/firmware/target/arm/s5l8702/ipodnano3g/pmu-nano3g.c @@ -202,7 +202,7 @@ int pmu_firewire_present(void) } #endif -#if 1 // XXX: from usb-s5l8702.c +#if defined(BOOTLOADER) // XXX: from usb-s5l8702.c #include "usb.h" static int usb_status = USB_EXTRACTED; diff --git a/firmware/target/arm/s5l8702/ipodnano3g/powermgmt-nano3g.c b/firmware/target/arm/s5l8702/ipodnano3g/powermgmt-nano3g.c index 732046e74a..e126fdabab 100644 --- a/firmware/target/arm/s5l8702/ipodnano3g/powermgmt-nano3g.c +++ b/firmware/target/arm/s5l8702/ipodnano3g/powermgmt-nano3g.c @@ -26,20 +26,13 @@ #include "audiohw.h" #include "adc-target.h" -const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = -{ - 3500 -}; - -const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = -{ - 3300 -}; +const unsigned short battery_level_disksafe = 3500; +const unsigned short battery_level_shutoff = 3300; /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = +const unsigned short percent_to_volt_discharge[11] = { - { 3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170 } + 3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170 }; #if CONFIG_CHARGING diff --git a/firmware/target/arm/s5l8702/ipodnano4g/adc-nano4g.c b/firmware/target/arm/s5l8702/ipodnano4g/adc-nano4g.c index 24a2bc88e9..42c5518210 100644 --- a/firmware/target/arm/s5l8702/ipodnano4g/adc-nano4g.c +++ b/firmware/target/arm/s5l8702/ipodnano4g/adc-nano4g.c @@ -41,6 +41,23 @@ unsigned short adc_read(int channel) return 0; } +int adc_read_accessory_resistor(void) +{ + return 0; +} + +unsigned int adc_read_usbdata_voltage(bool dp) +{ + (void)dp; + return 0; +} + +const char *adc_name(int channel) +{ + (void) channel; + return ""; +} + void adc_init(void) { } diff --git a/firmware/target/arm/s5l8702/ipodnano4g/cscodec-nano4g.c b/firmware/target/arm/s5l8702/ipodnano4g/cscodec-nano4g.c index 9daca61f5c..ea80cd177e 100644 --- a/firmware/target/arm/s5l8702/ipodnano4g/cscodec-nano4g.c +++ b/firmware/target/arm/s5l8702/ipodnano4g/cscodec-nano4g.c @@ -55,6 +55,7 @@ void cscodec_power(bool state) void cscodec_reset(bool state) { + (void)state; // TODO: not tested // if (state) PDAT(3) &= ~8; // else PDAT(3) |= 8; diff --git a/firmware/target/arm/s5l8702/ipodnano4g/nand-nano4g.c b/firmware/target/arm/s5l8702/ipodnano4g/nand-nano4g.c index 9115df03aa..9eede7b074 100644 --- a/firmware/target/arm/s5l8702/ipodnano4g/nand-nano4g.c +++ b/firmware/target/arm/s5l8702/ipodnano4g/nand-nano4g.c @@ -28,6 +28,22 @@ int nand_init(void) return 0; } +void nand_spindown(int seconds) +{ + (void)seconds; +} + +void nand_spin(void) +{ +} + +#ifdef HAVE_STORAGE_FLUSH +int nand_flush(void) +{ + return 0; +} +#endif + int nand_read_sectors(IF_MD(int drive,) sector_t start, int incount, void* inbuf) { @@ -74,3 +90,9 @@ void nand_get_info(IF_MD(int drive,) struct storage_info *info) info->revision = ""; } #endif + +long nand_last_disk_activity(void) +{ + // TODO + return 0; +} diff --git a/firmware/target/arm/s5l8702/ipodnano4g/pmu-nano4g.c b/firmware/target/arm/s5l8702/ipodnano4g/pmu-nano4g.c index d5b7ecb1bf..8b15bf6e86 100644 --- a/firmware/target/arm/s5l8702/ipodnano4g/pmu-nano4g.c +++ b/firmware/target/arm/s5l8702/ipodnano4g/pmu-nano4g.c @@ -201,7 +201,7 @@ int pmu_firewire_present(void) } #endif -#if 1 // XXX: from usb-s5l8702.c +#if defined(BOOTLOADER) // XXX: from usb-s5l8702.c #include "usb.h" static int usb_status = USB_EXTRACTED; diff --git a/firmware/target/arm/s5l8702/ipodnano4g/powermgmt-nano4g.c b/firmware/target/arm/s5l8702/ipodnano4g/powermgmt-nano4g.c index 7cafe4fe66..652ccff1d8 100644 --- a/firmware/target/arm/s5l8702/ipodnano4g/powermgmt-nano4g.c +++ b/firmware/target/arm/s5l8702/ipodnano4g/powermgmt-nano4g.c @@ -26,20 +26,13 @@ #include "audiohw.h" #include "adc-target.h" -const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = -{ - 3500 -}; - -const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = -{ - 3300 -}; +const unsigned short battery_level_disksafe = 3500; +const unsigned short battery_level_shutoff = 3300; /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = +const unsigned short percent_to_volt_discharge[11] = { - { 3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170 } + 3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170 }; #if CONFIG_CHARGING diff --git a/firmware/target/arm/s5l8702/ipodnano4g/serial-nano4g.c b/firmware/target/arm/s5l8702/ipodnano4g/serial-nano4g.c index 03b9a61024..c08107c096 100644 --- a/firmware/target/arm/s5l8702/ipodnano4g/serial-nano4g.c +++ b/firmware/target/arm/s5l8702/ipodnano4g/serial-nano4g.c @@ -26,7 +26,7 @@ #include "system.h" #include "serial.h" -#include "s5l87x.h" +#include "s5l87xx.h" #include "uc87xx.h" /* Define LOGF_ENABLE to enable logf output in this file */ diff --git a/firmware/target/arm/s5l8702/lcd-s5l8702.c b/firmware/target/arm/s5l8702/lcd-s5l8702.c index 3dcb788a43..cc0fa37605 100644 --- a/firmware/target/arm/s5l8702/lcd-s5l8702.c +++ b/firmware/target/arm/s5l8702/lcd-s5l8702.c @@ -567,7 +567,7 @@ void lcd_init_device(void) lcd_target_enable_clocks(true); #if defined(IPOD_6G) || defined(IPOD_NANO3G) LCD_PHTIME = 0x33; -#elif defined(IPOD_NANO4G) +#elif defined(IPOD_NANO4G) && defined(BOOTLOADER) cg16_config(&CG16_LCD, true, CG16_SEL_PLL0, 16, 1, 0x0); s5l_lcd_write_config(LCD_MODE_S9); cg16_config(&CG16_LCD, false, CG16_SEL_PLL0, 16, 1, 0x0); diff --git a/firmware/target/arm/sandisk/sansa-view/adc-view.c b/firmware/target/arm/sandisk/sansa-view/adc-view.c deleted file mode 100644 index deb8de2471..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/adc-view.c +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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 "adc-target.h" - -void adc_init(void) -{ -} - -/* Called to get the recent ADC reading */ -inline unsigned short adc_read(int channel) -{ - (void)channel; - return 0; -} diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-target.h b/firmware/target/arm/sandisk/sansa-view/backlight-target.h deleted file mode 100644 index c51875754d..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/backlight-target.h +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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 - -#include - -void backlight_hw_on(void); -void backlight_hw_off(void); - -void buttonlight_hw_on(void); -void buttonlight_hw_off(void); - -#endif diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-view.c b/firmware/target/arm/sandisk/sansa-view/backlight-view.c deleted file mode 100644 index 637e5b4269..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/backlight-view.c +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * Copyright (C) 2014 by Szymon Dziok - * - * 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 "backlight-target.h" -#include "system.h" -#include "lcd.h" -#include "backlight.h" - -bool backlight_hw_init(void) -{ - GPIO_SET_BITWISE(GPIOD_ENABLE, 0x01); - GPIO_SET_BITWISE(GPIOD_OUTPUT_EN, 0x01); - GPIO_SET_BITWISE(GPIOA_ENABLE, 0x01); - GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x01); - GPIO_SET_BITWISE(GPIOA_ENABLE, 0x02); - GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x02); - GPIO_SET_BITWISE(GPIOR_ENABLE, 0x10); - GPIO_SET_BITWISE(GPIOR_ENABLE, 0x20); - GPIO_SET_BITWISE(GPIOR_ENABLE, 0x40); - GPIO_SET_BITWISE(GPIOR_ENABLE, 0x80); - GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x10); - GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x20); - GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x40); - GPIO_SET_BITWISE(GPIOA_OUTPUT_EN, 0x80); - return true; -} - -void backlight_hw_brightness(int brightness) -{ - (void)brightness; -} - -void backlight_hw_off(void) -{ - GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x01); -} - -void backlight_hw_on(void) -{ - GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01); -} - -void buttonlight_hw_off(void) -{ - GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */ - GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ - - GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */ - GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */ - GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x20); /* scrollwheel top led */ - GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */ -} - -void buttonlight_hw_on(void) -{ - GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); /* vertical buttonlight */ - GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */ - - GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */ - GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */ - GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x20); /* scrollwheel top led */ - GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */ -} diff --git a/firmware/target/arm/sandisk/sansa-view/button-target.h b/firmware/target/arm/sandisk/sansa-view/button-target.h deleted file mode 100644 index 6b49f9053b..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/button-target.h +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * 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 _BUTTON_TARGET_H_ -#define _BUTTON_TARGET_H_ - -#define HAS_BUTTON_HOLD - -/* Sandisk Sansa View button codes */ - -/* Main unit's buttons */ -#define BUTTON_HOME 0x00000001 - -#define BUTTON_DOWN 0x00000002 -#define BUTTON_RIGHT 0x00000004 - -#define BUTTON_LEFT 0x00000008 -#define BUTTON_SELECT 0x00000010 -#define BUTTON_UP 0x00000020 -#define BUTTON_POWER 0x00000040 - -#define BUTTON_SCROLL_BACK 0x00000080 -#define BUTTON_SCROLL_FWD 0x00000100 - -#define BUTTON_HOLD 0x00000400 - -#define BUTTON_MAIN (BUTTON_HOME|BUTTON_DOWN|BUTTON_RIGHT|BUTTON_LEFT \ - |BUTTON_SELECT|BUTTON_UP|BUTTON_POWER \ - |BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD \ - |BUTTON_HOLD) - -#define POWEROFF_BUTTON BUTTON_POWER -#define POWEROFF_COUNT 10 - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/sandisk/sansa-view/button-view.c b/firmware/target/arm/sandisk/sansa-view/button-view.c deleted file mode 100644 index e1a0bbbcaf..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/button-view.c +++ /dev/null @@ -1,37 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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 "button.h" - -void button_init_device(void) -{ - -} - -bool button_hold(void) -{ - return false; -} - -int button_read_device(void) -{ - return 0; -} diff --git a/firmware/target/arm/sandisk/sansa-view/i2c-view.c b/firmware/target/arm/sandisk/sansa-view/i2c-view.c deleted file mode 100644 index a8ded7d2bf..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/i2c-view.c +++ /dev/null @@ -1,26 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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 "i2c.h" - -void i2c_init(void) -{ -} diff --git a/firmware/target/arm/sandisk/sansa-view/lcd-view.c b/firmware/target/arm/sandisk/sansa-view/lcd-view.c deleted file mode 100644 index 6b24aadc8c..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/lcd-view.c +++ /dev/null @@ -1,340 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Rockbox driver for Sansa View LCDs - * - * Copyright (c) 2009 Robert Keevil - * - * 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 -#include "cpu.h" -#include "kernel.h" -#include "system.h" -#include "backlight-target.h" -#include "lcd.h" - -static bool display_on SHAREDBSS_ATTR = true; -static int lcd_type; - -#define LCD_DATA_OUT_GPIO GPIOH_OUTPUT_VAL -#define LCD_DATA_OUT_PIN 4 - -#define LCD_CLOCK_GPIO GPIOH_OUTPUT_VAL -#define LCD_CLOCK_PIN 6 - -#define LCD_CS_GPIO GPIOH_OUTPUT_VAL -#define LCD_CS_PIN 7 - - - -static void lcd_init_gpio(void) -{ - DEV_INIT1 |= 0xfc000000; - DEV_INIT3 |= 0xc300000; - - GPIOE_ENABLE = 0; - GPIOM_ENABLE &= ~0x3; - GPIOF_ENABLE = 0; - GPIOJ_ENABLE &= ~0x1a; - // reset low - GPIOB_ENABLE &= ~0x8; - // SPI chip select - GPIOH_OUTPUT_VAL |= 0x80; - GPIOH_OUTPUT_EN |= 0x80; - GPIOH_ENABLE |= 0x80; - // SPI clock - GPIOH_OUTPUT_VAL |= 0x40; - GPIOH_OUTPUT_EN |= 0x40; - GPIOH_ENABLE |= 0x40; - // unk - GPIOH_OUTPUT_VAL |= 0x20; - GPIOH_OUTPUT_EN |= 0x20; - GPIOH_ENABLE |= 0x20; - // SPI data - GPIOH_OUTPUT_VAL |= 0x10; - GPIOH_OUTPUT_EN |= 0x10; - GPIOH_ENABLE |= 0x10; - // LCD reset - GPIOB_OUTPUT_VAL |= 0x4; - GPIOB_ENABLE |= 0x4; - GPIOB_OUTPUT_EN |= 0x4; - DEV_INIT2 = 0x40000000; - // LCD type - GPIOG_ENABLE |= 0x8; - GPIOG_OUTPUT_EN &= ~0x8; - - if(GPIOG_INPUT_VAL & 0x8) - lcd_type = 0; - else - lcd_type = 1; -} - -static void lcd_send_msg(unsigned char count, unsigned int data) -{ - GPIO_SET_BITWISE(LCD_CLOCK_GPIO, 1 << LCD_CLOCK_PIN); - GPIO_CLEAR_BITWISE(LCD_CS_GPIO, 1 << LCD_CS_PIN); - - for(int i = count - 1; i >= 0; i--) - { - if(data & (1 << i)) - GPIO_SET_BITWISE(LCD_DATA_OUT_GPIO, 1 << LCD_DATA_OUT_PIN); - else - GPIO_CLEAR_BITWISE(LCD_DATA_OUT_GPIO, 1 << LCD_DATA_OUT_PIN); - GPIO_CLEAR_BITWISE(LCD_CLOCK_GPIO, 1 << LCD_CLOCK_PIN); - udelay(1); - GPIO_SET_BITWISE(LCD_CLOCK_GPIO, 1 << LCD_CLOCK_PIN); - udelay(2); - } - - GPIO_SET_BITWISE(LCD_CS_GPIO, 1 << LCD_CS_PIN); -} - -static void lcd_send_cmd(unsigned int cmd) -{ - lcd_send_msg(24, (0x700000 | cmd)); -} - -static void lcd_send_data(unsigned int data) -{ - lcd_send_msg(24, (0x720000 | data)); -} - -static void lcd_write_reg(unsigned int cmd, unsigned int data) -{ - lcd_send_cmd(cmd); - lcd_send_data(data); -} - -void lcd_reset(void) -{ - GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x4); - udelay(1000); - GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x4); - udelay(10000); - GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x4); - udelay(50000); -} - -/* Run the powerup sequence for the driver IC */ -static void lcd_power_on(void) -{ - lcd_init_gpio(); - lcd_reset(); - - lcd_write_reg(0xE5, 0x8000); - lcd_write_reg(0x0, 0x1); - lcd_write_reg(0x1, 0x100); - lcd_write_reg(0x2, 0x700); - lcd_write_reg(0x3, 0x5230); - lcd_write_reg(0x4, 0x0); - lcd_write_reg(0x8, 0x408); /* back porch = 8, front porch = 4 */ - lcd_write_reg(0x9, 0x0); - lcd_write_reg(0xa, 0x0); - lcd_write_reg(0xd, 0x0); - lcd_write_reg(0xf, 0x2); - lcd_write_reg(0x10, 0x0); - lcd_write_reg(0x11, 0x0); - lcd_write_reg(0x12, 0x0); - lcd_write_reg(0x13, 0x0); - sleep(HZ/5); - lcd_write_reg(0x10, 0x17B0); - lcd_write_reg(0x11, 0x7); - sleep(HZ/20); - lcd_write_reg(0x12, 0x13c); - sleep(HZ/20); - - if (lcd_type == 0) - { - lcd_write_reg(0x13, 0x1700); - lcd_write_reg(0x29, 0x10); - sleep(HZ/10); - lcd_write_reg(0x20, 0x0); - lcd_write_reg(0x21, 0x0); - - lcd_write_reg(0x30, 0x7); - lcd_write_reg(0x31, 0x403); - lcd_write_reg(0x32, 0x400); - lcd_write_reg(0x35, 0x3); - lcd_write_reg(0x36, 0xF07); - lcd_write_reg(0x37, 0x606); - lcd_write_reg(0x38, 0x106); - lcd_write_reg(0x39, 0x7); - } - else - { - lcd_write_reg(0x13, 0x1800); - lcd_write_reg(0x29, 0x13); - sleep(HZ/10); - lcd_write_reg(0x20, 0x0); - lcd_write_reg(0x21, 0x0); - - lcd_write_reg(0x30, 0x2); - lcd_write_reg(0x31, 0x606); - lcd_write_reg(0x32, 0x501); - lcd_write_reg(0x35, 0x206); - lcd_write_reg(0x36, 0x504); - lcd_write_reg(0x37, 0x707); - lcd_write_reg(0x38, 0x306); - lcd_write_reg(0x39, 0x7); - } - - lcd_write_reg(0x3c, 0x700); - lcd_write_reg(0x3d, 0x700); - - lcd_write_reg(0x50, 0x0); - lcd_write_reg(0x51, 0xef); - lcd_write_reg(0x52, 0x0); - lcd_write_reg(0x53, 0x13f); - - lcd_write_reg(0x60, 0x2700); - lcd_write_reg(0x61, 0x1); - lcd_write_reg(0x6a, 0x0); - - lcd_write_reg(0x80, 0x0); - lcd_write_reg(0x81, 0x0); - lcd_write_reg(0x82, 0x0); - lcd_write_reg(0x83, 0x0); - lcd_write_reg(0x84, 0x0); - lcd_write_reg(0x85, 0x0); - - lcd_write_reg(0x90, 0x10); - lcd_write_reg(0x92, 0x0); - lcd_write_reg(0x93, 0x3); - lcd_write_reg(0x95, 0x110); - lcd_write_reg(0x97, 0x0); - lcd_write_reg(0x98, 0x0); - - lcd_write_reg(0xc, 0x000); // SYSTEM mode - lcd_write_reg(0x7, 0x173); - sleep(HZ/10); -} - -{ - - lcd_power_on(); - - lcd_write_reg(0x7, 0x160); - lcd_write_reg(0x10, 0x17B1); -} - -void unknown03(bool r0) -{ - if (r0) - GPIOJ_ENABLE &= ~0x2; - else - { - GPIOJ_ENABLE |= 0x2; - GPIOJ_OUTPUT_EN |= 0x2; - GPIOJ_OUTPUT_VAL &= ~0x02; - } -} - -void lcd_init_device(void) -{ - lcd_power_on(); -} - -#if defined(HAVE_LCD_ENABLE) -bool lcd_active(void) -{ - return display_on; -} - -void lcd_enable(bool on) -{ - display_on = on; - if(on) - { - lcd_write_reg(0x10, 0x17B0); - udelay(100); - lcd_write_reg(0x7, 0x173); - } - else - { - lcd_write_reg(0x7, 0x160); - lcd_write_reg(0x10, 0x17B1); - } -} -#endif - -static inline void lcd_send_frame_byte(unsigned char data) -{ - for(int bit = 0; bit < 8; bit++) - { - if(data & 0x80) - GPIO_SET_BITWISE(LCD_DATA_OUT_GPIO, 1 << LCD_DATA_OUT_PIN); - else - GPIO_CLEAR_BITWISE(LCD_DATA_OUT_GPIO, 1 << LCD_DATA_OUT_PIN); - data <<= 1; - GPIO_CLEAR_BITWISE(LCD_CLOCK_GPIO, 1 << LCD_CLOCK_PIN); - GPIO_SET_BITWISE(LCD_CLOCK_GPIO, 1 << LCD_CLOCK_PIN); - } -} - -static void lcd_send_frame(const fb_data *addr, int count) -{ - GPIO_SET_BITWISE(LCD_CLOCK_GPIO, 1 << LCD_CLOCK_PIN); - GPIO_CLEAR_BITWISE(LCD_CS_GPIO, 1 << LCD_CS_PIN); - - lcd_send_frame_byte(0x72); - while(count-- > 0) - { - lcd_send_frame_byte(*addr >> 8); - lcd_send_frame_byte(*addr++ & 0xff); - } - - GPIO_SET_BITWISE(LCD_CS_GPIO, 1 << LCD_CS_PIN); -} - -void lcd_update(void) -{ - if(!display_on) - return; - lcd_write_reg(0x20, 0x0); - lcd_write_reg(0x21, 0x0); - lcd_send_cmd(0x22); - lcd_send_frame(FBADDR(0, 0), LCD_WIDTH * LCD_HEIGHT); -} - -/* Update a fraction of the display. */ -void lcd_update_rect(int x, int y, int width, int height) -{ - (void)x; - (void)y; - (void)width; - (void)height; - lcd_update(); -} - - -/*** hardware configuration ***/ - -void lcd_set_contrast(int val) -{ - (void)val; -} - -void lcd_set_invert_display(bool yesno) -{ - (void)yesno; -} - -/* turn the display upside down (call lcd_update() afterwards) */ -void lcd_set_flip(bool yesno) -{ - (void)yesno; -} diff --git a/firmware/target/arm/sandisk/sansa-view/power-view.c b/firmware/target/arm/sandisk/sansa-view/power-view.c deleted file mode 100644 index 7df7296718..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/power-view.c +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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. - * - ****************************************************************************/ - -void power_init(void) -{ -} - -void power_off(void) -{ -} diff --git a/firmware/target/arm/sandisk/sansa-view/powermgmt-view.c b/firmware/target/arm/sandisk/sansa-view/powermgmt-view.c deleted file mode 100644 index 649e667707..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/powermgmt-view.c +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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 "adc.h" -#include "powermgmt.h" - -int _battery_voltage(void) -{ - return 0; -} - -/* FIXME - next 4 functions taken from e200 - last 2 will need - to be updated */ -unsigned short battery_level_disksafe = 3400; - -unsigned short battery_level_shutoff = 3300; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -unsigned short percent_to_volt_discharge[11] = -{ - /* Sansa Li Ion 750mAH FIXME */ - 3300, 3680, 3740, 3760, 3780, 3810, 3870, 3930, 3970, 4070, 4160 -}; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ -unsigned short percent_to_volt_charge[11] = -{ - /* Sansa Li Ion 750mAH FIXME */ - 3300, 3680, 3740, 3760, 3780, 3810, 3870, 3930, 3970, 4070, 4160 -}; diff --git a/firmware/target/arm/sandisk/sansa-view/usb-view.c b/firmware/target/arm/sandisk/sansa-view/usb-view.c deleted file mode 100644 index 6356ee6ffd..0000000000 --- a/firmware/target/arm/sandisk/sansa-view/usb-view.c +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Robert Keevil - * - * 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 "usb.h" - -int usb_detect(void) -{ - return.0; -} - -void usb_enable(bool on) -{ - (void)on; -} - -void usb_init_device(void) -{ -} diff --git a/firmware/target/arm/stm32/debug-stm32h7.c b/firmware/target/arm/stm32/debug-stm32h7.c index e7ffd1c37a..99a3849b41 100644 --- a/firmware/target/arm/stm32/debug-stm32h7.c +++ b/firmware/target/arm/stm32/debug-stm32h7.c @@ -19,10 +19,115 @@ * ****************************************************************************/ #include "system.h" +#include "kernel.h" +#include "button.h" +#include "lcd.h" +#include "font.h" +#include "action.h" +#include "list.h" +#include "regs/stm32h743/dbgmcu.h" +#include "regs/cortex-m/cm_debug.h" +#include + +enum +{ + SWD_MENU_IS_ENABLED, + SWD_MENU_IS_ATTACHED, + SWD_MENU_NUM_ENTRIES +}; + +static int swd_menu_action_cb(int action, struct gui_synclist *lists) +{ + int sel = gui_synclist_get_sel_pos(lists); + + if (sel == SWD_MENU_IS_ENABLED && action == ACTION_STD_OK) + { + if (reg_readf(DBGMCU_CR, DBGSLEEP_D1)) + system_debug_enable(false); + else + system_debug_enable(true); + + action = ACTION_REDRAW; + } + + if (action == ACTION_NONE) + action = ACTION_REDRAW; + + return action; +} + +static const char *swd_menu_get_name(int item, void *data, char *buf, size_t bufsz) +{ + (void)data; + + switch (item) + { + case SWD_MENU_IS_ENABLED: + snprintf(buf, bufsz, "System debug enabled: %d", + (int)!!reg_readf(DBGMCU_CR, DBGSLEEP_D1)); + return buf; + + case SWD_MENU_IS_ATTACHED: + snprintf(buf, bufsz, "DHCSR.C_DEBUGEN bit: %d", + (int)!!reg_readf(CM_DEBUG_DHCSR, C_DEBUGEN)); + return buf; + + default: + return ""; + } +} + +static bool swd_menu(void) +{ + struct simplelist_info info; + simplelist_info_init(&info, "SWD/JTAG", SWD_MENU_NUM_ENTRIES, NULL); + info.action_callback = swd_menu_action_cb; + info.get_name = swd_menu_get_name; + return simplelist_show_list(&info); +} + +/* Menu definition */ +static const struct { + const char *name; + bool (*function) (void); +} menuitems[] = { + {"SWD/JTAG", swd_menu}, +}; + +static int hw_info_menu_action_cb(int btn, struct gui_synclist *lists) +{ + if (btn == ACTION_STD_OK) + { + int sel = gui_synclist_get_sel_pos(lists); + FOR_NB_SCREENS(i) + viewportmanager_theme_enable(i, false, NULL); + + menuitems[sel].function(); + btn = ACTION_REDRAW; + + FOR_NB_SCREENS(i) + viewportmanager_theme_undo(i, false); + } + + return btn; +} + +static const char* hw_info_menu_get_name(int item, void *data, char *buf, size_t bufsz) +{ + (void)buf; + (void)bufsz; + (void)data; + return menuitems[item].name; +} bool dbg_hw_info(void) { - return false; + struct simplelist_info info; + simplelist_info_init(&info, MODEL_NAME " debug menu", + ARRAYLEN(menuitems), NULL); + info.action_callback = hw_info_menu_action_cb; + info.get_name = hw_info_menu_get_name; + return simplelist_show_list(&info); } bool dbg_ports(void) diff --git a/firmware/target/arm/stm32/echoplayer/lcd-echoplayer.c b/firmware/target/arm/stm32/echoplayer/lcd-echoplayer.c index bd7ead842c..e68b0d9b0e 100644 --- a/firmware/target/arm/stm32/echoplayer/lcd-echoplayer.c +++ b/firmware/target/arm/stm32/echoplayer/lcd-echoplayer.c @@ -30,17 +30,13 @@ #include "regs/stm32h743/rcc.h" #include "regs/stm32h743/spi.h" #include "regs/stm32h743/ltdc.h" +#include #define MS_TO_TICKS(x) \ (((x) + (1000 / HZ - 1)) / (1000 / HZ)) -/* - * ILI9342C specifies 10 MHz max - * - * Use 12MHz for now -- for some reason using 6 MHz doesn't work - * to enable RGB mode, but works fine to send graphics in SPI mode? - */ -#define LCD_SPI_FREQ 12000000 +/* ILI9342C specifies 10 MHz max */ +#define LCD_SPI_FREQ 10000000 #define ili_cmd(cmd, ...) \ do { \ @@ -60,7 +56,8 @@ struct stm_spi_config spi_cfg = { .hw_cs_output = true, }; -struct stm_spi spi; +static struct stm_spi spi; +static fb_data shadowfb[LCD_WIDTH*LCD_HEIGHT] IRAM_LCDFRAMEBUFFER; enum lcd_controller_state { @@ -101,7 +98,7 @@ static void enable_ltdc(void) reg_assignf(LTDC_LAYER_WHPCR(0), WHSPPOS(ahbp + LCD_HAW), WHSTPOS(ahbp + 1)); reg_assignf(LTDC_LAYER_WVPCR(0), WVSPPOS(avbp + LCD_VAH), WVSTPOS(avbp + 1)); reg_assignf(LTDC_LAYER_PFCR(0), PF(BV_LTDC_LAYER_PFCR_PF_RGB565)); - reg_var(LTDC_LAYER_CFBAR(0)) = (uintptr_t)FBADDR(0, 0); + reg_var(LTDC_LAYER_CFBAR(0)) = (uintptr_t)&shadowfb[0]; reg_assignf(LTDC_LAYER_CFBLR(0), CFBP(row_bytes), CFBLL(row_bytes + 7)); reg_assignf(LTDC_LAYER_CFBLNR(0), CFBLNBR(LCD_HEIGHT)); reg_assignf(LTDC_LAYER_CR(0), LEN(1)); @@ -244,6 +241,8 @@ void lcd_update(void) if (!lcd_active()) return; + /* TODO: optimize using DMA2D */ + memcpy(shadowfb, FBADDR(0, 0), sizeof(shadowfb)); commit_dcache(); } @@ -268,8 +267,13 @@ void lcd_update_rect(int x, int y, int width, int height) if (height > LCD_HEIGHT - y) height = LCD_HEIGHT - y; + /* TODO: optimize using DMA2D */ for (int dy = 0; dy < height; ++dy) - commit_dcache_range(FBADDR(x, y+dy), FB_DATA_SZ * width); + { + fb_data *shaddr = &shadowfb[(y+dy)*LCD_WIDTH + x]; + memcpy(shaddr, FBADDR(x, y+dy), FB_DATA_SZ * width); + commit_dcache_range(shaddr, FB_DATA_SZ * width); + } } void spi5_irq_handler(void) diff --git a/firmware/target/arm/stm32/echoplayer/sdmmc-echoplayer.c b/firmware/target/arm/stm32/echoplayer/sdmmc-echoplayer.c index 7a192bc914..803b7cae2b 100644 --- a/firmware/target/arm/stm32/echoplayer/sdmmc-echoplayer.c +++ b/firmware/target/arm/stm32/echoplayer/sdmmc-echoplayer.c @@ -48,6 +48,7 @@ static const struct sdmmc_host_config sdmmc_config INITDATA_ATTR = { .bus_clocks = SDMMC_BUS_CLOCK_400KHZ | SDMMC_BUS_CLOCK_25MHZ | SDMMC_BUS_CLOCK_50MHZ, + .max_nr_blocks = 65535, .is_removable = true, }; diff --git a/firmware/target/arm/stm32/echoplayer/system-echoplayer.c b/firmware/target/arm/stm32/echoplayer/system-echoplayer.c index 88f7b27720..0dc45ecbda 100644 --- a/firmware/target/arm/stm32/echoplayer/system-echoplayer.c +++ b/firmware/target/arm/stm32/echoplayer/system-echoplayer.c @@ -44,9 +44,9 @@ #define F_SDMMC1 GPIOF_FUNCTION(12, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_MEDIUM, GPIO_PULL_UP) #define F_SDMMC1CK GPIOF_FUNCTION(12, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_MEDIUM, GPIO_PULL_DISABLED) #define F_SAI1 GPIOF_FUNCTION(6, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_VERYHIGH, GPIO_PULL_DISABLED) -#define F_SPI5 GPIOF_FUNCTION(5, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_VERYHIGH, GPIO_PULL_DISABLED) -#define F_LCD_AF14 GPIOF_FUNCTION(14, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_VERYHIGH, GPIO_PULL_DISABLED) -#define F_LCD_AF9 GPIOF_FUNCTION(9, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_VERYHIGH, GPIO_PULL_DISABLED) +#define F_SPI5 GPIOF_FUNCTION(5, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_MEDIUM, GPIO_PULL_DISABLED) +#define F_LCD_AF14 GPIOF_FUNCTION(14, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_MEDIUM, GPIO_PULL_DISABLED) +#define F_LCD_AF9 GPIOF_FUNCTION(9, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_MEDIUM, GPIO_PULL_DISABLED) #define F_LPTIM4_OUT GPIOF_FUNCTION(3, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_LOW, GPIO_PULL_DISABLED) #define F_LPTIM1_OUT GPIOF_FUNCTION(1, GPIO_TYPE_PUSH_PULL, GPIO_SPEED_VERYHIGH, GPIO_PULL_DISABLED) diff --git a/firmware/target/arm/stm32/sdmmc-stm32h7.c b/firmware/target/arm/stm32/sdmmc-stm32h7.c index 0fdad1156a..56e7d70e4c 100644 --- a/firmware/target/arm/stm32/sdmmc-stm32h7.c +++ b/firmware/target/arm/stm32/sdmmc-stm32h7.c @@ -28,6 +28,7 @@ /* cmd_wait flags */ #define WAIT_CMD 0x01 #define WAIT_DATA 0x02 +#define WAIT_BUSY 0x04 /* Maximum number of bytes for 1 transfer */ #define MAX_DATA_LEN \ @@ -49,6 +50,14 @@ #define DATA_END_BITS \ (DATA_SUCCESS_BITS | DATA_ERROR_BITS) +/* IRQs for busy wait phase */ +#define BUSY_SUCCESS_BITS \ + __reg_orm(SDMMC_STAR, BUSYD0END) +#define BUSY_ERROR_BITS \ + __reg_orm(SDMMC_STAR, DTIMEOUT) +#define BUSY_END_BITS \ + (BUSY_SUCCESS_BITS | DATA_ERROR_BITS) + static size_t get_sdmmc_bus_freq(uint32_t clock) { switch (clock) @@ -262,6 +271,13 @@ int stm32h7_sdmmc_submit_command(void *controller, break; } + /* For R1b responses we need to wait for the busy signal. */ + if (cmd->flags & SDMMC_RESP_BUSY) + { + maskr |= BUSY_END_BITS; + cmd_wait |= WAIT_BUSY; + } + /* * Handle commands with data transfers */ @@ -313,9 +329,14 @@ int stm32h7_sdmmc_submit_command(void *controller, { /* Disable data transfer */ reg_assignlf(ctl->regs, SDMMC_IDMACTRLR, IDMAEN(0)); - reg_varl(ctl->regs, SDMMC_DTIMER) = 0; reg_varl(ctl->regs, SDMMC_DLENR) = 0; reg_varl(ctl->regs, SDMMC_DCTRL) = 0; + + /* DTIMER is the wait time for the busy signal */ + if (cmd->flags & SDMMC_RESP_BUSY) + reg_varl(ctl->regs, SDMMC_DTIMER) = 1 * ctl->bus_freq; + else + reg_varl(ctl->regs, SDMMC_DTIMER) = 0; } /* @@ -407,14 +428,19 @@ void stm32h7_sdmmc_irq_handler(struct stm32h7_sdmmc_controller *ctl) uint32_t icr = 0; if (!ctl->cmd_wait) - panicf("sdmmc_irq: not waiting: %08lx", star); + { + if (star != 0) + panicf("sdmmc_irq: not waiting: %08lx", star); + + return; + } /* * Ignore interrupts which we haven't enabled; this is needed * to ensure the correct interrupt is used to detect command * completion (CMDSENT or CMDREND). */ - star &= maskr; + star &= maskr | __reg_orm(SDMMC_STAR, BUSYD0); if (ctl->cmd_wait & WAIT_CMD) { @@ -473,6 +499,32 @@ void stm32h7_sdmmc_irq_handler(struct stm32h7_sdmmc_controller *ctl) } } + if (ctl->cmd_wait & WAIT_BUSY) + { + if (reg_vreadf(star, SDMMC_STAR, CMDREND) && + !reg_vreadf(star, SDMMC_STAR, BUSYD0)) + { + /* + * Skip waiting if the busy signal is not asserted by + * the card when the command ends; in this case we'll + * never receive a BUSYD0END interrupt because it is + * only raised on a transition from busy -> not busy. + */ + ctl->cmd_wait &= ~WAIT_BUSY; + } + else if ((star & BUSY_END_BITS) || ctl->cmd_error) + { + if (!ctl->cmd_error) + { + if (reg_vreadf(star, SDMMC_STAR, DTIMEOUT)) + ctl->cmd_error = SDMMC_STATUS_TIMEOUT; + } + + ctl->cmd_wait &= ~WAIT_BUSY; + icr |= BUSY_END_BITS; + } + } + /* * Each interrupt should complete at least one phase * but in error cases we can get spurious interrupts. diff --git a/firmware/target/arm/stm32/spi-stm32h7.c b/firmware/target/arm/stm32/spi-stm32h7.c index fc4d87eafc..b7741e0182 100644 --- a/firmware/target/arm/stm32/spi-stm32h7.c +++ b/firmware/target/arm/stm32/spi-stm32h7.c @@ -130,6 +130,7 @@ void stm_spi_init(struct stm_spi *spi, spi->clock = config->clock; spi->mode = config->mode; spi->set_cs = config->set_cs; + spi->eot_delay_us = 1 + (1000000 / config->freq); semaphore_init(&spi->sem, 1, 0); @@ -164,7 +165,6 @@ void stm_spi_init(struct stm_spi *spi, stm32_clock_enable(spi->clock); - /* TODO: allow setting MBR here */ reg_writelf(spi->regs, SPI_CFG1, MBR(mbr), CRCEN(0), @@ -225,6 +225,8 @@ int stm_spi_xfer(struct stm_spi *spi, size_t size, spi->rx_buf = rx_buf; spi->rx_size = rx_buf ? size : 0; + membarrier(); + stm_spi_enable(spi, hd_tx, size); semaphore_wait(&spi->sem, TIMEOUT_BLOCK); @@ -236,10 +238,8 @@ int stm_spi_xfer(struct stm_spi *spi, size_t size, * For 2.22.2 we need to wait at least 1 SCK cycle before starting the * next transaction. For 2.22.6, waiting 1/2 SCK cycle should be enough * since the EOT event is raised on a clock edge. - * - * TODO: calculate this delay time. doesn't seem to match assumptions above */ - udelay(5); + udelay(spi->eot_delay_us); stm_spi_disable(spi); return 0; @@ -251,9 +251,13 @@ void stm_spi_irq_handler(struct stm_spi *spi) { uint32_t sr = reg_readl(spi->regs, SPI_SR); - if (spi->tx_size == 0 && spi->rx_size == 0) + if (spi->tx_size == 0 && + spi->rx_size == 0 && + reg_vreadf(sr, SPI_SR, EOT)) { semaphore_release(&spi->sem); + + reg_writelf(spi->regs, SPI_IFCR, EOTC(1)); reg_varl(spi->regs, SPI_IER) = 0; return; } @@ -261,6 +265,8 @@ void stm_spi_irq_handler(struct stm_spi *spi) if (spi->tx_size > 0 && reg_vreadf(sr, SPI_SR, TXP)) { uint32_t data = stm_spi_pack(&spi->tx_buf, &spi->tx_size); + if (spi->tx_size == 0) + reg_writelf(spi->regs, SPI_IER, TXPIE(0)); reg_varl(spi->regs, SPI_DR) = data; continue; @@ -272,6 +278,9 @@ void stm_spi_irq_handler(struct stm_spi *spi) uint32_t data = reg_readl(spi->regs, SPI_DR); stm_spi_unpack(&spi->rx_buf, &spi->rx_size, data); + if (spi->rx_size == 0) + reg_writelf(spi->regs, SPI_IER, RXPIE(0)); + continue; } diff --git a/firmware/target/arm/stm32/spi-stm32h7.h b/firmware/target/arm/stm32/spi-stm32h7.h index a6b0ef11d0..f7871a3969 100644 --- a/firmware/target/arm/stm32/spi-stm32h7.h +++ b/firmware/target/arm/stm32/spi-stm32h7.h @@ -81,6 +81,7 @@ struct stm_spi enum stm_spi_mode mode; stm_spi_set_cs_t set_cs; uint32_t frame_size; + uint32_t eot_delay_us; const void *tx_buf; size_t tx_size; diff --git a/firmware/target/arm/system-arm-classic.h b/firmware/target/arm/system-arm-classic.h index bc648e43ed..a941a36a7e 100644 --- a/firmware/target/arm/system-arm-classic.h +++ b/firmware/target/arm/system-arm-classic.h @@ -104,18 +104,6 @@ static inline int set_interrupt_status(int status, int mask) unsigned long cpsr; int oldstatus; /* Read the old levels and set the new ones */ -#if defined(CREATIVE_ZVx) && defined(BOOTLOADER) -// FIXME: This workaround is for a problem with inlining; -// for some reason 'mask' gets treated as a variable/non-immediate constant -// but only on this build. All others (including the nearly-identical mrobe500boot) are fine - 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]"r,i"(mask)); -#else asm volatile ( "mrs %1, cpsr \n" "bic %0, %1, %[mask] \n" @@ -123,7 +111,6 @@ static inline int set_interrupt_status(int status, int mask) "msr cpsr_c, %0 \n" : "=&r,r"(cpsr), "=&r,r"(oldstatus) : "r,i"(status & mask), [mask]"i,i"(mask)); -#endif return oldstatus; } diff --git a/firmware/target/arm/tcc780x/crt0.S b/firmware/target/arm/tcc780x/crt0.S index 5d271616d0..bbdbf96f17 100644 --- a/firmware/target/arm/tcc780x/crt0.S +++ b/firmware/target/arm/tcc780x/crt0.S @@ -179,8 +179,6 @@ copied_start: mcr p15, 0, r0, c7, c6, 0 /* Invalidate Dcache */ mcr p15, 0, r1, c8, c7, 0 /* Invalidate TLB */ -#ifndef STUB - /* Copy exception handler code to address 0 */ mov r2, #0x0 ldr r3, =vectors_start @@ -231,7 +229,6 @@ copied_start: strhi r5, [r3], #4 bhi 1b #endif /* !BOOTLOADER */ -#endif /* !STUB */ /* Initialise bss section to zero */ ldr r2, =_edata diff --git a/firmware/target/arm/tms320dm320/creative-zvm/adc-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/adc-creativezvm.c deleted file mode 100644 index e891b98eac..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/adc-creativezvm.c +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id: adc-mr500.c 14817 2007-09-22 15:43:38Z kkurbjun $ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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 "cpu.h" -#include "adc.h" -#include "adc-target.h" -#include "kernel.h" - -void adc_init(void) -{ -} - -/* Called to get the recent ADC reading */ -inline unsigned short adc_read(int channel) -{ - return (short)channel; -} diff --git a/firmware/target/arm/tms320dm320/creative-zvm/adc-target.h b/firmware/target/arm/tms320dm320/creative-zvm/adc-target.h deleted file mode 100644 index bf2c5dfc08..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/adc-target.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id: adc-target.h 14817 2007-09-22 15:43:38Z kkurbjun $ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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 2 - -#define ADC_BATTERY 0 -#define ADC_HPREMOTE 1 -#define ADC_UNKNOWN_3 2 -#define ADC_UNKNOWN_4 3 -#define ADC_UNKNOWN_5 4 -#define ADC_UNKNOWN_6 5 -#define ADC_UNKNOWN_7 6 -#define ADC_UNKNOWN_8 7 - -#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ -#define ADC_READ_ERROR 0xFFFF - -#endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c deleted file mode 100644 index 6936a24873..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ /dev/null @@ -1,544 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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 "cpu.h" -#include "kernel.h" -#include "thread.h" -#include "system.h" -#include "power.h" -#include "panic.h" -#include "ata-driver.h" -#include "dm320.h" -#include "ata.h" -#include "string.h" -#include "core_alloc.h" -#include "logf.h" -#include "ata-defines.h" - -#undef ata_read_sectors -#undef ata_write_sectors - -static void sleep_ms(int ms) -{ - sleep(ms*HZ/1000); -} - -void ide_power_enable(bool on) -{ -/* Disabled until figured out what's wrong */ -#if 0 - int old_level = disable_irq_save(); - if(on) - { - IO_GIO_BITSET0 = (1 << 14); - ata_reset(); - } - else - IO_GIO_BITCLR0 = (1 << 14); - restore_irq(old_level); -#else - (void)on; -#endif -} - -inline bool ide_powered() -{ -#if 0 - return (IO_GIO_BITSET0 & (1 << 14)); -#else - return true; -#endif -} - -void ata_reset(void) -{ - int old_level = disable_irq_save(); - if(!ide_powered()) - { - ide_power_enable(true); - sleep_ms(150); - } - else - { - IO_GIO_BITSET0 = (1 << 5); - IO_GIO_BITCLR0 = (1 << 3); - sleep_ms(1); - } - IO_GIO_BITCLR0 = (1 << 5); - sleep_ms(10); - IO_GIO_BITSET0 = (1 << 3); - while(!(ATA_COMMAND & STATUS_RDY)) - sleep_ms(10); - restore_irq(old_level); -} - -void ata_enable(bool on) -{ - (void)on; - return; -} - -bool ata_is_coldstart(void) -{ - return true; -} - -void ata_device_init(void) -{ - IO_INTC_EINT1 |= INTR_EINT1_EXT2; /* enable GIO2 interrupt */ - /* TODO: mimic OF inits... */ - return; -} - -void GIO2(void) -{ -#ifdef DEBUG - logf("GIO2 interrupt..."); -#endif - IO_INTC_IRQ1 = INTR_IRQ1_EXT2; /* Mask GIO2 interrupt */ - return; -} - -/* - --------------------------------------------------------------------------- - CreativeFileSystem parsing/handling code - --------------------------------------------------------------------------- - */ - -#define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */ - -extern int ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); -extern int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); - -// XXX 64-bit: Due to this it's not likely that this target will ever handle 64-bit storage. - -struct main_header -{ - char mblk[4]; - unsigned int sector_size; - long long disk_size; - struct partition_header - { - unsigned long end; - unsigned long start; - char name[8]; - } partitions[31]; -}; - -struct cfs_header -{ - unsigned int unk; - unsigned int unk2; - unsigned int sector_size; - unsigned int unk4; - unsigned int unk5; - char identifier[4]; - unsigned int first_inode; - unsigned int unk8; - unsigned int unk9; - unsigned int unk10; - unsigned int unk11; -}; - -struct cfs_inode -{ - unsigned char magic[4]; - unsigned int number; - unsigned int parent; - unsigned int unk; - unsigned int type; - unsigned int created_time; - unsigned int lastmodified_time; - unsigned int unk2; - unsigned int first_class_chain[12]; - unsigned int unk3; - unsigned int unk4; - unsigned int second_class_chain_first_cluster; - unsigned int unk9; - unsigned int unk10; - unsigned int second_class_chain_second_cluster; - unsigned int unk11; - unsigned int unk12; - unsigned int unk13; - unsigned int filesize; - unsigned int serial_number; - unsigned int number_of_metadata_records; -}; - -struct cfs_direntry -{ - unsigned char identifier[4]; - unsigned int unk; - unsigned int items; - unsigned int unk2; - unsigned char maxlen[2]; - unsigned char padding[202]; - /* struct cfs_direntry_item _items[items]; */ -}; -struct cfs_direntry_item -{ - unsigned int inode_number; - unsigned short strlen; - unsigned short bytesperchar; - char string[32]; -}; - -static bool cfs_inited = false; -static unsigned long cfs_start; -#ifdef BOOTLOADER -static unsigned long *sectors; -#else -static int sectors_handle; -#endif - -#define CFS_START ( ((hdr->partitions[1].start*hdr->sector_size) & ~0xFFFF) + 0x10000 ) -#define CFS_CLUSTER2CLUSTER(x) ( (CFS_START/512)+((x)-1)*64 ) - -/* Limited version of UCS -> ASCII */ -static char* ucs2letostring(unsigned char* s) -{ - static char res[256]; - int i; - - for(i=0; (s[i] == 0 && s[i+1] == 0 && i<256); i++) - res[i] = s[i*2]; - - return (char*)&res; -} - -static void cfs_init(void) -{ - struct main_header *hdr; - struct cfs_header *cfs; - struct cfs_inode *root_inode, *vfat_inode, *inode; - struct cfs_direntry *root_direntry, *vfat_direntry; - struct cfs_direntry_item *root_direntry_items, *vfat_direntry_items; - unsigned int i, j, k, vfat_inode_nr=0, vfat_inodes_nr[10], vfat_sector_count; - unsigned char sector[512]; - static unsigned int vfat_data[2][0x8000]; - static unsigned char sector2[0x8000]; - - if(cfs_inited) - return; - - /* Read MBLK */ - _ata_read_sectors(0, 1, §or); - hdr = (struct main_header*)§or; - - logf("CFS is at 0x%x [0x%x]", CFS_START, CFS_START/512); - - /* Read CFS header */ - _ata_read_sectors(CFS_START/512, 64, §or2); - cfs = (struct cfs_header*)§or2; - - logf("First inode = 0x%x", cfs->first_inode); - - /* Read root inode */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(cfs->first_inode), 64, §or2); - root_inode = (struct cfs_inode*)§or2; - - logf("Root inode = 0x%x", root_inode); - - logf("0x%x 0x%x", CFS_CLUSTER2CLUSTER(root_inode->first_class_chain[0]), root_inode->first_class_chain[0]); - - /* Read root inode's first sector */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(root_inode->first_class_chain[0]), 64, §or2); - root_direntry = (struct cfs_direntry*)§or2; - root_direntry_items = (struct cfs_direntry_item*)(§or2[0]+sizeof(struct cfs_direntry)); - - logf("0x%x", root_direntry->identifier); - - logf("%d", root_direntry->items); - - /* Search VFAT inode */ - for(i=0; i < root_direntry->items; i++) - { - if(root_direntry_items[i].inode_number != 0) - { - //logf(" * [%s] at 0x%x", ucs2letostring(&root_direntry_items[i].string[0]), root_direntry_items[i].inode_number); - if(strcmp(ucs2letostring(&root_direntry_items[i].string[0]), "VFAT") == 0) - vfat_inode_nr = root_direntry_items[i].inode_number; - } - } - - logf("VFAT inode = 0x%x", vfat_inode_nr); - - if(vfat_inode_nr != 0) - { - /* Read VFAT inode */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inode_nr), 64, §or2); - vfat_inode = (struct cfs_inode*)§or2; - - /* Read VFAT inode's first sector */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inode->first_class_chain[0]), 64, §or2); - vfat_direntry = (struct cfs_direntry*)§or2; - vfat_direntry_items = (struct cfs_direntry_item*)(§or2[0]+sizeof(struct cfs_direntry)); - - /* Search for VFAT's subinodes */ - for(i=0; i < vfat_direntry->items; i++) - { - logf(" * [%s] at 0x%x\n", ucs2letostring(&vfat_direntry_items[i].string[0]), vfat_direntry_items[i].inode_number); - if(i > 0) - vfat_inodes_nr[i-1] = vfat_direntry_items[i].inode_number; - } - - /* Determine size of VFAT file */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inodes_nr[1]), 1, §or); - inode = (struct cfs_inode*)§or; -#ifndef BOOTLOADER - sectors_handle = core_alloc(VFAT_SECTOR_SIZE(inode->filesize)); - unsigned long *sectors = core_get_data(sectors_handle); -#else - static unsigned long _sector[VFAT_SECTOR_SIZE(1024*1024*1024)]; /* 1GB guess */ - sectors = _sector; -#endif - - logf("VFAT file size: 0x%x", inode->filesize); - - /* Clear data sectors */ - memset(§ors, 0, VFAT_SECTOR_SIZE(inode->filesize)*sizeof(unsigned long)); - - /* Read all data sectors' addresses in memory */ - vfat_sector_count = 0; - for(i=0; vfat_inodes_nr[i] != 0; i++) - { - _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inodes_nr[i]), 1, §or); - inode = (struct cfs_inode*)§or; - - /* Read second & third class chain */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(inode->second_class_chain_first_cluster), 64, &vfat_data[0]); - _ata_read_sectors(CFS_CLUSTER2CLUSTER(inode->second_class_chain_second_cluster), 64, &vfat_data[1]); - - /* First class chain */ -#ifndef BOOTLOADER - sectors = core_get_data(sectors_handle); -#endif - for(j=0; j<12; j++) - { - if( (inode->first_class_chain[j] & 0xFFFF) != 0xFFFF && - inode->first_class_chain[j] != 0 - ) - sectors[vfat_sector_count++] = inode->first_class_chain[j]; - } - - /* Second class chain */ -#ifndef BOOTLOADER - sectors = core_get_data(sectors_handle); -#endif - for(j=0; j<0x8000/4; j++) - { - if( (vfat_data[0][j] & 0xFFFF) != 0xFFFF && - vfat_data[0][j] != 0 - ) - sectors[vfat_sector_count++] = vfat_data[0][j]; - } - - /* Third class chain */ - for(j=0; j<0x8000/4; j++) - { - if( (vfat_data[1][j] & 0xFFFF) != 0xFFFF && - vfat_data[1][j] != 0 - ) - { - memset(&vfat_data[0], 0, 0x8000*sizeof(unsigned int)); - - /* Read third class subchain(s) */ - _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_data[1][j]), 64, &vfat_data[0]); - -#ifndef BOOTLOADER - sectors = core_get_data(sectors_handle); -#endif - for(k=0; k<0x8000/4; k++) - { - if( (vfat_data[0][k] & 0xFFFF) != 0xFFFF && - vfat_data[0][k] != 0 - ) - sectors[vfat_sector_count++] = vfat_data[0][k]; - } - } - } - } - - logf("Sector count: %d 0x%x", vfat_sector_count, vfat_sector_count); - } - else - panicf("Cannot find virtual FAT filesystem!"); - - cfs_inited = true; -} - -static inline sector_t map_sector(sector_t sector) -{ - /* - * Sector mapping: start of CFS + FAT_SECTOR2CFS_SECTOR(sector) + missing part - * FAT works with sectors of 0x200 bytes, CFS with sectors of 0x8000 bytes. - */ -#ifndef BOOTLOADER - sector_t *sectors = core_get_data(sectors_handle); -#endif - return cfs_start+sectors[sector/64]*64+sector%64; -} - -int ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf) -{ - if(!cfs_inited) - cfs_init(); - - /* Check if count is lesser than or equal to 1 native CFS sector */ - if(count <= 64) - return _ata_read_sectors(IF_MD(drive,) map_sector(start), count, buf); - else - { - int i; - unsigned char* dest = (unsigned char*)buf; - - /* Read sectors in parts of 0x8000 */ - for(i=0; i= 64 ? 64 : count-i), (void*)dest); - if(ret != 0) - return ret; - - dest += (count-i >= 64 ? 0x8000 : (count-i)*512); - } - - return 0; - } -} - -int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf) -{ - if(!cfs_inited) - cfs_init(); - -#if 0 /* Disabled for now */ - /* Check if count is lesser than or equal to 1 native CFS sector */ - if(count <= 64) - return _ata_write_sectors(IF_MD(drive,) map_sector(start), count, buf); - else - { - int i, ret; - unsigned char* dest = (unsigned char*)buf; - - /* Read sectors in parts of 0x8000 */ - for(i=0; i= 64 ? 64 : count-i), (const void*)dest); - if(ret != 0) - return ret; - - dest += (count-i >= 64 ? 0x8000 : (count-i)*512); - } - - return ret; - } -#else - (void)start; - (void)count; - (void)buf; - return 0; -#endif -} - -#ifdef BOOTLOADER - -/* - --------------------------------------------------------------------------- - MiniFileSystem parsing code - --------------------------------------------------------------------------- - */ - -struct minifs_file -{ - char name[0x10]; - unsigned int unk; - unsigned long size; - unsigned int chain1; - unsigned int chain2; -}; - -struct minifs_chain -{ - unsigned int unknown; - unsigned short chain[0x27FE]; - unsigned int unknown2; - unsigned long length; -}; - - -#define DIR_BITMAP_START 0x0143 -#define DIR_START 0x0144 -#define DATASPACE_BITMAP_START 0x0145 -#define DATASPACE_START 0x0146 - -#define CLUSTER_CHAIN_SIZE 0x5008 -#define CLUSTER_CHAIN_HEAD 0x0000 -#define CLUSTER_CHAIN_BITMAP 0x0001 -#define CLUSTER_CHAIN_CHAIN 0x0002 - - -int load_minifs_file(char* filename, unsigned char* location) -{ - struct main_header *hdr; - static struct minifs_file files[128]; - struct minifs_chain *chain; - unsigned int i; - int found = -1; - unsigned char sector[512]; - static unsigned char chain_data[42*512]; /* stack overflow if not static */ - - /* Read MBLK */ - _ata_read_sectors(0, 1, §or); - hdr = (struct main_header*)§or; - - /* Read directory listing */ -#define CLUSTER2SECTOR(x) ( (hdr->partitions[0].start + (x)*8) ) - _ata_read_sectors(CLUSTER2SECTOR(DIR_START), 8, &files); - - for(i=0; i<127; i++) - { - if(strcmp(files[i].name, filename) == 0) - found = i; - } - - if(found == -1) - return -1; - -#define GET_CHAIN(x) ( CLUSTER2SECTOR(CLUSTER_CHAIN_CHAIN)*512 + (x)*CLUSTER_CHAIN_SIZE ) -#define FILE2SECTOR(x) ( CLUSTER2SECTOR(DATASPACE_START + (x)) ) - - /* Read chain list */ - _ata_read_sectors(GET_CHAIN(files[found].chain1)/512, 41, &chain_data[0]); - - chain = (struct minifs_chain*)&chain_data[GET_CHAIN(files[found].chain1)%512]; - - /* Copy data */ - for(i=0; ilength; i++) - { - _ata_read_sectors(FILE2SECTOR(chain->chain[i]), 8, location); - location += 0x1000; - } - - return files[found].size; -} - -#endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h deleted file mode 100644 index 41b8e73ad4..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Maurus Cuelenaere - * - * 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 ATA_TARGET_H -#define ATA_TARGET_H - -#include "ata.h" - -/* DMA optimized reading and writing */ -#define ATA_OPTIMIZED_READING -#define ATA_OPTIMIZED_WRITING -/* -#include "dma-target.h" -#define copy_read_sectors dma_ata_read -#define copy_write_sectors dma_ata_write -*/ - -/* Nasty hack, but Creative is nasty... */ -#define ata_read_sectors _ata_read_sectors -#define ata_write_sectors _ata_write_sectors -extern int _ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); -extern int _ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); - -/* General purpose memory region #1 */ -#define ATA_IOBASE 0x50FEE000 -#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE))) -#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE+0x2))) -#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE+0x4))) -#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE+0x6))) -#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE+0x8))) -#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE+0xA))) -#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE+0xC))) -#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE+0xE))) -#define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE+0x800C))) - -#ifdef BOOTLOADER -int load_minifs_file(char* filename, unsigned char* location); -#endif - -#endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h b/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h deleted file mode 100644 index 4ebe3144cf..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/backlight-target.h +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id: backlight-target.h 15599 2007-11-12 18:49:53Z amiconn $ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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_hw_init(void); -void backlight_hw_on(void); -void backlight_hw_off(void); -void backlight_hw_brightness(int brightness); - -/* true: backlight fades off - false: backlight fades on */ -void __backlight_dim(bool dim); - -#endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/button-target.h b/firmware/target/arm/tms320dm320/creative-zvm/button-target.h deleted file mode 100644 index 50a182a210..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/button-target.h +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* Open \______ \ ____ ____ | | _\_ |__ _______ ___ -* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -* \/ \/ \/ \/ \/ -* $Id$ -* -* Copyright (C) 2008 by Maurus Cuelenaere -* -* 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 "config.h" - -#define BUTTON_BACK (1 << 0) -#define BUTTON_CUSTOM (1 << 1) -#define BUTTON_MENU (1 << 2) - -#define BUTTON_LEFT (1 << 3) -#define BUTTON_RIGHT (1 << 4) -#define BUTTON_UP (1 << 5) -#define BUTTON_DOWN (1 << 6) -#define BUTTON_SELECT (1 << 7) - -#define BUTTON_POWER (1 << 8) -#define BUTTON_PLAY (1 << 9) - -#define BUTTON_HOLD (1 << 10) - -#ifdef CREATIVE_ZV -#define BUTTON_PREV (1 << 11) -#define BUTTON_NEXT (1 << 12) - -#define BUTTON_VOL_UP (1 << 13) -#define BUTTON_VOL_DOWN (1 << 14) -#endif - -#ifndef CREATIVE_ZV -#define BUTTON_MAIN ( BUTTON_BACK | BUTTON_MENU | BUTTON_LEFT | BUTTON_RIGHT \ - | BUTTON_UP | BUTTON_DOWN | BUTTON_SELECT | BUTTON_POWER \ - | BUTTON_PLAY | BUTTON_HOLD | BUTTON_CUSTOM ) -#else -#define BUTTON_MAIN ( BUTTON_BACK | BUTTON_MENU | BUTTON_LEFT | BUTTON_RIGHT \ - | BUTTON_UP | BUTTON_DOWN | BUTTON_SELECT | BUTTON_POWER \ - | BUTTON_PLAY | BUTTON_HOLD | BUTTON_NEXT | BUTTON_PREV \ - | BUTTON_VOL_UP | BUTTON_VOL_DOWN ) -#endif - -#define POWEROFF_BUTTON BUTTON_POWER -#define POWEROFF_COUNT 10 - -#define HAS_BUTTON_HOLD - -bool button_usb_connected(void); - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c deleted file mode 100644 index 418a28ff09..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c +++ /dev/null @@ -1,132 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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 "kernel.h" -#include "thread.h" -#include "system.h" -#include "dma-target.h" -#include "dm320.h" -#include "ata.h" -#include "ata-driver.h" -#include "ata-defines.h" -#include - -#define CS1_START 0x50000000 -#define CS2_START 0x60000000 -#define SDRAM_START 0x00900000 -#define FLASH_START 0x00100000 -#define CF_START 0x40000000 -#define SSFDC_START 0x48000000 - -static struct semaphore transfer_completion_signal; - -static bool dma_in_progress = false; - -void MTC0(void) -{ - IO_INTC_IRQ1 = INTR_IRQ1_MTC0; - semaphore_release(&transfer_completion_signal); - dma_in_progress = false; -} - -void dma_start(const void* addr, size_t size) -{ - /* Compatibility with Gigabeat S in dma_start.c */ - (void) addr; - (void) size; -} - -#define ATA_DEST (ATA_IOBASE-CS1_START) -void dma_ata_read(unsigned char* buf, int shortcount) -{ - if(dma_in_progress) - semaphore_wait(&transfer_completion_signal, TIMEOUT_BLOCK); - - while((unsigned long)buf & 0x1F) - { - unsigned short tmp; - tmp = ATA_IN16(ATA_DATA); - *buf++ = tmp & 0xFF; - *buf++ = tmp >> 8; - shortcount--; - } - - if (!shortcount) - return; - - IO_SDRAM_SDDMASEL = 0x0820; /* 32-byte burst mode transfer */ - IO_EMIF_DMAMTCSEL = 1; /* Select CS1 */ - IO_EMIF_AHBADDH = ((unsigned long)buf >> 16) & 0x7FFF; /* Set variable address */ - IO_EMIF_AHBADDL = (unsigned long)buf & 0xFFFF; - IO_EMIF_MTCADDH = ( (1 << 15) | (ATA_DEST >> 16) ); /* Set fixed address */ - IO_EMIF_MTCADDL = ATA_DEST & 0xFFFF; - IO_EMIF_DMASIZE = shortcount/2; /* 16-bits *2 = 1 word */ - IO_EMIF_DMACTL = 3; /* Select MTC->AHB and start transfer */ - - dma_in_progress = true; - semaphore_wait(&transfer_completion_signal, TIMEOUT_BLOCK); - - if(shortcount % 2) - { - unsigned short tmp; - tmp = ATA_IN16(ATA_DATA); - *buf++ = tmp & 0xFF; - *buf++ = tmp >> 8; - } -} - -void dma_ata_write(unsigned char* buf, int wordcount) -{ - if(dma_in_progress) - semaphore_wait(&transfer_completion_signal, TIMEOUT_BLOCK); - - while((unsigned long)buf & 0x1F) - { - unsigned short tmp; - tmp = (unsigned short) *buf++; - tmp |= (unsigned short) *buf++ << 8; - ATA_OUT16(ATA_DATA, tmp); - wordcount--; - } - - if (!wordcount) - return; - - IO_SDRAM_SDDMASEL = 0x0830; /* 32-byte burst mode transfer */ - IO_EMIF_DMAMTCSEL = 1; /* Select CS1 */ - IO_EMIF_AHBADDH = ((unsigned long)buf >> 16) & ~(1 << 15); /* Set variable address */ - IO_EMIF_AHBADDL = (unsigned long)buf & 0xFFFF; - IO_EMIF_MTCADDH = ( (1 << 15) | (ATA_DEST >> 16) ); /* Set fixed address */ - IO_EMIF_MTCADDL = ATA_DEST & 0xFFFF; - IO_EMIF_DMASIZE = (wordcount+1)/2; - IO_EMIF_DMACTL = 1; /* Select AHB->MTC and start transfer */ - - dma_in_progress = true; - semaphore_wait(&transfer_completion_signal, TIMEOUT_BLOCK); -} - -void dma_init(void) -{ - IO_INTC_EINT1 |= INTR_EINT1_MTC0; /* enable MTC interrupt */ - semaphore_init(&transfer_completion_signal, 1, 0); - dma_in_progress = false; -} diff --git a/firmware/target/arm/tms320dm320/creative-zvm/dma-target.h b/firmware/target/arm/tms320dm320/creative-zvm/dma-target.h deleted file mode 100644 index f7e1d76626..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/dma-target.h +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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 DMA_TARGET_H -#define DMA_TARGET_H - -void dma_start(const void* addr, size_t size); /* Compatibility with Gigabeat S in dma_start.c */ -void dma_ata_read(unsigned char* buf, int wordcount); -void dma_ata_write(unsigned char* buf, int wordcount); -void dma_init(void); - -#endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c deleted file mode 100644 index 9621b532fe..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c +++ /dev/null @@ -1,427 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* Open \______ \ ____ ____ | | _\_ |__ _______ ___ -* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -* \/ \/ \/ \/ \/ -* $Id$ -* -* Copyright (C) 2008 by Maurus Cuelenaere -* -* 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 -#include "config.h" - -#include "hwcompat.h" -#include "kernel.h" -#include "lcd.h" -#include "system.h" -#include "string-extra.h" /* memset16() */ -#include "cpu.h" -#include "spi.h" -#include "lcd-target.h" -#include "ltv350qv.h" - -/* Power and display status */ -extern bool lcd_on; /* lcd-memframe.c */ -static bool direct_fb_access = false; /* Does the DM320 has direct access to the FB? */ - -/* Copies a rectangle from one framebuffer to another. Can be used in - single transfer mode with width = num pixels, and height = 1 which - allows a full-width rectangle to be copied more efficiently. */ -extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src, - int width, int height); - -int lcd_default_contrast(void) -{ - return 0x1f; -} - -void lcd_set_contrast(int val) -{ - /* find S6F2002 controller datasheet first */ - (void)val; -} - -void lcd_set_invert_display(bool yesno) { - (void) yesno; - /* TODO: */ -} - -void lcd_set_flip(bool yesno) { - (void) yesno; - /* TODO: */ -} - -static void enable_venc(bool enable) -{ - if(enable) - { - /* Set OSD clock */ - IO_CLK_MOD1 &= ~(CLK_MOD1_VENC | CLK_MOD1_OSD); /* disable OSD clock and VENC clock */ - IO_CLK_O2DIV = 3; - - IO_CLK_OSEL &= ~CLK_OSEL_O2SEL(0xF); /* reset 'General purpose clock output (GIO26, GIO34)' and */ - IO_CLK_OSEL |= CLK_OSEL_O2SEL(4); /* set to 'PLLIN clock' */ - - IO_CLK_SEL1 |= (CLK_SEL1_OSD | CLK_SEL1_VENC(7)); /* set to 'GP clock output 2 (GIO26, GIO34)' and turn on 'VENC clock' */ - IO_CLK_MOD1 |= (CLK_MOD1_VENC | CLK_MOD1_OSD); /* enable OSD clock and VENC clock */ - } - else - { - /* Disable video encoder */ - IO_VID_ENC_VMOD &= ~VENC_VMOD_VENC; - /* Disable clock for power saving */ - IO_CLK_MOD1 &= ~(CLK_MOD1_VENC | CLK_MOD1_OSD); - } -} - -/* LTV250QV panel functions */ -static void lcd_write_reg(unsigned char reg, unsigned short val) -{ - unsigned char block[3] = {LTV_OPC_INDEX, 0, reg | 0xFF}; - spi_block_transfer(SPI_target_LTV250QV, block, sizeof(block), NULL, 0); - block[0] = LTV_OPC_DATA; - block[1] = val >> 8; - block[2] = val & 0xFF; - spi_block_transfer(SPI_target_LTV250QV, block, sizeof(block), NULL, 0); -} - -static void sleep_ms(unsigned int ms) -{ - sleep(ms*HZ/1000); -} - -static void lcd_display_on(bool reset) -{ - /* Enable main power */ - IO_GIO_BITSET2 |= (1 << 3); - - /* power on sequence as per the ZVM firmware */ - sleep_ms(250); - IO_GIO_BITSET1 = (1 << 13); - sleep_ms(5); - IO_GIO_BITSET2 = (1 << 5); - IO_GIO_BITSET2 = (1 << 8); - sleep_ms(1); - - /*Init SPI here... */ - sleep_ms(32); - - IO_GIO_BITSET2 = (1 << 0); - sleep_ms(5); - IO_GIO_BITSET2 = (1 << 7); - sleep_ms(5); - IO_GIO_BITSET2 = (1 << 4); - sleep_ms(5); - IO_GIO_BITCLR2 = (1 << 8); - /*TODO: figure out what OF does after this... */ - IO_GIO_BITSET2 = (1 << 8); - sleep_ms(1); - - lcd_write_reg(LTV_IFCTL, LTV_NL(29)); - lcd_write_reg(LTV_DATACTL, 0); - lcd_write_reg(LTV_ENTRY_MODE,0); - lcd_write_reg(LTV_GATECTL1, 0); - lcd_write_reg(LTV_GATECTL2, (LTV_NW_INV_1LINE | LTV_FHN | LTV_FTI(2) | LTV_FWI(3))); - lcd_write_reg(LTV_VBP, 0); - lcd_write_reg(LTV_HBP, 0); - lcd_write_reg(LTV_SOTCTL, 0); - lcd_write_reg(LTV_PWRCTL1, 0); - lcd_write_reg(LTV_PWRCTL2, 0); - lcd_write_reg(LTV_GAMMA(0), 0); - lcd_write_reg(LTV_GAMMA(1), 0); - lcd_write_reg(LTV_GAMMA(2), 0); - lcd_write_reg(LTV_GAMMA(3), 0); - lcd_write_reg(LTV_GAMMA(4), 0); - lcd_write_reg(LTV_GAMMA(5), 0); - lcd_write_reg(LTV_GAMMA(6), 0); - lcd_write_reg(LTV_GAMMA(7), 0); - lcd_write_reg(LTV_GAMMA(8), 0); - lcd_write_reg(LTV_GAMMA(9), 0); - sleep_ms(10); - - lcd_write_reg(LTV_PWRCTL1, (LTV_VCOM_DISABLE | LTV_DRIVE_CURRENT(5) | LTV_SUPPLY_CURRENT(5))); - lcd_write_reg(LTV_PWRCTL2, 0); - sleep_ms(40); - - lcd_write_reg(LTV_PWRCTL2, LTV_VCOML_ENABLE); - sleep_ms(40); - - lcd_write_reg(LTV_IFCTL, (LTV_NMD | LTV_NL(29))); - lcd_write_reg(LTV_DATACTL, (LTV_DS_SAME | LTV_CHS_480 | LTV_DF_RGB | LTV_RGB_BGR)); - lcd_write_reg(LTV_ENTRY_MODE,(LTV_VSPL_ACTIVE_LOW | LTV_HSPL_ACTIVE_LOW | LTV_DPL_SAMPLE_RISING | LTV_EPL_ACTIVE_LOW | LTV_SS_RIGHT_TO_LEFT)); - lcd_write_reg(LTV_GATECTL1, LTV_CLW(1)); - lcd_write_reg(LTV_GATECTL2, (LTV_NW_INV_1LINE | LTV_DSC | LTV_FTI(3) | LTV_FWI(3))); - lcd_write_reg(LTV_VBP, 0x5); - lcd_write_reg(LTV_HBP, 0x1B); - lcd_write_reg(LTV_SOTCTL, LTV_SDT(2)); - lcd_write_reg(LTV_GAMMA(0), 0x203); - lcd_write_reg(LTV_GAMMA(1), 0x302); - lcd_write_reg(LTV_GAMMA(2), 0xC08); - lcd_write_reg(LTV_GAMMA(3), 0xC08); - lcd_write_reg(LTV_GAMMA(4), 0x707); - lcd_write_reg(LTV_GAMMA(5), 0x707); - lcd_write_reg(LTV_GAMMA(6), 0x104); - lcd_write_reg(LTV_GAMMA(7), 0x306); - lcd_write_reg(LTV_GAMMA(8), 0); - lcd_write_reg(LTV_GAMMA(9), 0); - sleep_ms(60); - - lcd_write_reg(LTV_PWRCTL1, (LTV_VCOMOUT_ENABLE | LTV_POWER_ON | LTV_DRIVE_CURRENT(5) | LTV_SUPPLY_CURRENT(5))); - lcd_write_reg(LTV_PWRCTL2, (LTV_VCOML_VOLTAGE(17) | LTV_VCOMH_VOLTAGE(26))); /* VCOML=0,0625V VCOMH=1,21875V */ - sleep_ms(10); - - if(!reset) - { - enable_venc(true); - /* Re-enable video encoder */ - IO_VID_ENC_VMOD |= VENC_VMOD_VENC; - } - /* tell that we're on now */ - lcd_on = true; -} - -#ifdef HAVE_LCD_ENABLE -static void lcd_display_off(void) -{ - /* LQV shutdown sequence */ - lcd_write_reg(LTV_PWRCTL1, (LTV_VCOMOUT_ENABLE | LTV_DRIVE_CURRENT(5) | LTV_SUPPLY_CURRENT(5))); - sleep_ms(20); - - lcd_write_reg(LTV_PWRCTL1, (LTV_DRIVE_CURRENT(5) | LTV_SUPPLY_CURRENT(5))); - lcd_write_reg(LTV_GATECTL2, (LTV_NW_INV_1LINE | LTV_FTI(3) | LTV_FWI(3))); - lcd_write_reg(LTV_PWRCTL2, 0); - sleep_ms(20); - - lcd_write_reg(LTV_PWRCTL1, 0); - sleep_ms(10); - unsigned char temp[1]; - temp[0] = 0; - spi_block_transfer(SPI_target_LTV250QV, temp, sizeof(temp), NULL, 0); - - IO_GIO_BITCLR2 = (1 << 4); - sleep_ms(5); - IO_GIO_BITCLR2 = (1 << 7); - sleep_ms(5); - IO_GIO_BITCLR2 = (1 << 0); - sleep_ms(2); - IO_GIO_BITCLR2 = (1 << 8); - IO_GIO_BITCLR2 = (1 << 5); - - /* Disable main power */ - IO_GIO_BITCLR2 |= (1 << 3); - - enable_venc(false); - - lcd_on = false; -} - -void lcd_enable(bool on) -{ -/* Disabled until properly working */ -return; - if (on == lcd_on) - return; - - if (on) - { - lcd_display_on(false); /* Turn on display */ - lcd_update(); /* Resync display */ - send_event(LCD_EVENT_ACTIVATION, NULL); - } - else - { - lcd_display_off(); /* Turn off display */ - } -} -#endif - -void lcd_set_direct_fb(bool yes) -{ - unsigned int addr; - direct_fb_access = yes; - if(yes) - addr = ((unsigned int)FBADDR(0,0)-CONFIG_SDRAM_START) / 32; - else - addr = ((unsigned int)FRAME-CONFIG_SDRAM_START) / 32; - IO_OSD_OSDWINADH = addr >> 16; - IO_OSD_OSDWIN0ADL = addr & 0xFFFF; -} - -bool lcd_get_direct_fb(void) -{ - return direct_fb_access; -} - -static bool _lcd_enabled(void) -{ - /* Needed to detect if VENC/LCD already is initialized... */ - if(IO_VID_ENC_VDCTL & VENC_VDCTL_VCLKE) - return true; - else if(!(IO_VID_ENC_VDCTL & VENC_VDCTL_YCDC)) - return true; - else if(IO_CLK_MOD1 & CLK_MOD1_VENC) - return true; - else if(IO_CLK_MOD1 & CLK_MOD1_OSD) - return true; - else - return false; -} - -void lcd_init_device(void) -{ - if(!_lcd_enabled()) - { - lcd_display_on(true); - - enable_venc(true); - - /* Set LCD values in Video Encoder */ - IO_VID_ENC_VMOD &= 0x8800; /* Clear all values */ - IO_VID_ENC_VMOD |= (VENC_VMOD_DACPD | VENC_VMOD_VMD | VENC_VMOD_ITLC | VENC_VMOD_VDMD(2)); /* set mode to RGB666 parallel 16 bit */ - IO_VID_ENC_VDCTL &= 0x8FE8; /* Clear all values */ - IO_VID_ENC_VDCTL |= (VENC_VDCTL_VCLKP | VENC_VDCTL_DOMD(2)), - IO_VID_ENC_VDPRO = VENC_VDPRO_PFLTR; - IO_VID_ENC_SYNCTL &= 0xE000; /* Clear all values */ - IO_VID_ENC_SYNCTL |= (VENC_SYNCTL_VPL | VENC_SYNCTL_HPL); - IO_VID_ENC_HSDLY = 0; - IO_VID_ENC_HSPLS = 0x12; - IO_VID_ENC_HSTART = 0x1B; - IO_VID_ENC_HVALID = 0x140; - IO_VID_ENC_HINT = 0x168; - IO_VID_ENC_VSDLY = 0; - IO_VID_ENC_VSPLS = 3; - IO_VID_ENC_VSTART = 5; - IO_VID_ENC_VVALID = 0xF0; - IO_VID_ENC_VINT = 0x118; - IO_VID_ENC_RGBCTL &= 0x088; /* Clear all values */ - IO_VID_ENC_RGBCTL |= VENC_RGBCTL_DFLTR; - IO_VID_ENC_RGBCLP = VENC_RGBCLP_UCLIP(0xFF); - IO_VID_ENC_LCDOUT &= 0xFE00; /* Clear all values */ - IO_VID_ENC_LCDOUT |= (VENC_LCDOUT_OEE | VENC_LCDOUT_FIDS); - IO_VID_ENC_DCLKCTL &= 0xC0C0; /* Clear all values */ - IO_VID_ENC_DCLKCTL |= VENC_DCLKCTL_DCKEC; - IO_VID_ENC_DCLKPTN0 = 1; - DM320_REG(0x0864) = 0; /* ???? */ - } - else - lcd_on = true; - - /* Based on lcd-mr500.c from Catalin Patulea */ - /* Clear the Frame */ - memset16(FRAME, 0x0000, LCD_WIDTH*LCD_HEIGHT); - - IO_OSD_MODE = 0x00ff; - IO_OSD_VIDWINMD = 0x0002; - IO_OSD_OSDWINMD0 = 0x2001; - IO_OSD_OSDWINMD1 = 0x0002; - IO_OSD_ATRMD = 0x0000; - IO_OSD_RECTCUR = 0x0000; - - unsigned int addr; - IO_OSD_OSDWIN0OFST = (LCD_WIDTH*16) / 256; - addr = ((unsigned int)FRAME-CONFIG_SDRAM_START) / 32; - IO_OSD_OSDWINADH = addr >> 16; - IO_OSD_OSDWIN0ADL = addr & 0xFFFF; - -#ifndef ZEN_VISION - IO_OSD_BASEPX = 26; - IO_OSD_BASEPY = 5; -#else - IO_OSD_BASEPX = 80; - IO_OSD_BASEPY = 0; -#endif - - IO_OSD_OSDWIN0XP = 0; - IO_OSD_OSDWIN0YP = 0; - IO_OSD_OSDWIN0XL = LCD_WIDTH; - IO_OSD_OSDWIN0YL = LCD_HEIGHT; - - IO_VID_ENC_VDCTL |= VENC_VDCTL_VCLKE; /* Enable VCLK */ - IO_VID_ENC_VMOD |= VENC_VMOD_VENC; /* Enable video encoder */ - IO_VID_ENC_SYNCTL |= VENC_SYNCTL_SYE; /* Enable sync output */ - IO_VID_ENC_VDCTL &= ~VENC_VDCTL_DOMD(3); /* Normal digital data output */ -} - - -/*** Update functions ***/ - -/* Update a fraction of the display. */ -void lcd_update_rect(int x, int y, int width, int height) -{ - register fb_data *dst, *src; - - if (!lcd_on || direct_fb_access) - return; - - if (x + width > LCD_WIDTH) - width = LCD_WIDTH - x; /* Clip right */ - if (x < 0) - width += x, x = 0; /* Clip left */ - if (width <= 0) - return; /* nothing left to do */ - - if (y + height > LCD_HEIGHT) - height = LCD_HEIGHT - y; /* Clip bottom */ - if (y < 0) - height += y, y = 0; /* Clip top */ - if (height <= 0) - return; /* nothing left to do */ - -#if CONFIG_ORIENTATION == SCREEN_PORTRAIT - dst = (fb_data *)FRAME + LCD_WIDTH*y + x; - src = FBADDR(x,y); - - /* Copy part of the Rockbox framebuffer to the second framebuffer */ - if (width < LCD_WIDTH) - { - /* Not full width - do line-by-line */ - lcd_copy_buffer_rect(dst, src, width, height); - } - else - { - /* Full width - copy as one line */ - lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1); - } -#else - src = FBADDR(x,y); - - register int xc, yc; - register fb_data *start=FRAME + LCD_HEIGHT*(LCD_WIDTH-x-1) + y + 1; - - for(yc=0;yc ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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 LCD_TARGET_H -#define LCD_TARGET_H - -void lcd_set_direct_fb(bool yes); -bool lcd_get_direct_fb(void); - -/* Direct FB access disables regular updates */ -#define lcd_write_enabled() \ - ({ lcd_on && !lcd_get_direct_fb(); }) - -/* Very strange functions */ -#define LCD_OPTIMIZED_UPDATE -#define LCD_OPTIMIZED_UPDATE_RECT - -#define LCD_FRAMEBUF_ADDR(col, row) ((fb_data *)FRAME + (row)*LCD_WIDTH + (col)) - -#endif /* LCD_TARGET_H */ diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c deleted file mode 100644 index fa1eb2481f..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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 "system.h" -#include "kernel.h" -#include "logf.h" -#include "audio.h" -#include "sound.h" -#include "file.h" -#include "dm320.h" -#include "audiohw.h" -#include "dsp-target.h" -#include "pcm-internal.h" - -void pcm_play_dma_init(void) -{ - IO_CLK_O1DIV = 3; - /* Set GIO25 to CLKOUT1A */ - IO_GIO_FSEL2 |= 3; - sleep(5); - - audiohw_init(); - - audiohw_set_frequency(HW_FREQ_DEFAULT); - - /* init DSP */ -// dsp_init(); -} - -void pcm_play_dma_postinit(void) -{ - audiohw_postinit(); - - /* wake DSP */ -// dsp_wake(); -} - -void pcm_dma_apply_settings(void) -{ - audiohw_set_frequency(pcm_fsel); -} - -void pcm_play_dma_start(const void *addr, size_t size) -{ - (void)addr; - (void)size; - DEBUGF("pcm_play_dma_start(0x%x, %d)", addr, size); -} - -void pcm_play_dma_stop(void) -{ - -} - -void pcm_play_lock(void) -{ - -} - -void pcm_play_unlock(void) -{ - -} diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c deleted file mode 100644 index ab5462fa90..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c +++ /dev/null @@ -1,380 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* Open \______ \ ____ ____ | | _\_ |__ _______ ___ -* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -* \/ \/ \/ \/ \/ -* $Id$ -* -* Copyright (C) 2008 by Maurus Cuelenaere -* -* Creative Zen Vision:M interrupt based PIC driver -* -* 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 -#include "config.h" -#include "system.h" -#include "kernel.h" -#include "button-target.h" -#include "i2c-dm320.h" -#include "logf.h" - -#ifdef BUTTON_DEBUG -#include "lcd-target.h" -#include "lcd.h" -#include "font.h" -#endif - -#ifndef ZEN_VISION -/* Creative Zen Vision:M */ -#define BTN_LEFT 0xAF00 -#define BTN_RIGHT 0xA700 -#define BTN_BACK 0xDF00 -#define BTN_CUSTOM 0xC700 -#define BTN_PLAY 0x9700 -#define BTN_POWER 0x8700 -#define BTN_MENU 0xCF00 -#define BTN_HOLD 0xCF07 -#define BTN_UNHOLD 0xD707 - -#define BTN_REL 1 - -#define BTN_TOUCHPAD_PRESS 0x8F00 -#define BTN_TOUCHPAD_SCROLL_DOWN 0x0F03 -#define BTN_TOUCHPAD_CORNER_DOWN 0xD700 -#define BTN_TOUCHPAD_CORNER_UP 0x9F00 -#define BTN_TOUCHPAD_SCROLL_UP 0x0F04 - -#define HEADPHONE_PLUGIN_A 0x5707 -#define HEADPHONE_PLUGIN_B 0x5F07 -#define HEADPHONE_UNPLUG_A 0x3707 -#define HEADPHONE_UNPLUG_B 0x3F07 - -#define DOCK_INSERT 0x6707 -#define DOCK_UNPLUG 0xDF06 -#define DOCK_USB_INSERT 0x2F06 -#define DOCK_USB_UNPLUG 0x3F06 -#define DOCK_POWER_INSERT 0x1707 -#define DOCK_POWER_UNPLUG 0x1F07 - -#else -/* Creative Zen Vision */ -#define BTN_LEFT 0xCF00 -#define BTN_RIGHT 0xEF00 -#define BTN_BACK 0xBF00 -#define BTN_CUSTOM 0x0 -#define BTN_PLAY 0x2F00 -#define BTN_POWER 0x0F00 -#define BTN_MENU 0x9F00 -#define BTN_HOLD 0x9F06 -#define BTN_UNHOLD 0xAF06 - - -/* TODO: other values - -First number is just pressing it, second is when you release it or keep it -pressed a bit longer - -On/Off = 0F00 && 0F01 -Hold = 9F06 && AF06 -Volume Up = 6F00 && 6F01 -Vol Down = 7F00 && 7F01 -Up = DF00 && DF01 -Right = EF00 && EF01 -Down = FF00 && FF01 -Left = CF00 && CF01 -Back = BF00 && BF01 -Menu = 9F00 && Etcetera -Ok = 1F00 -Play = 2F00 -Next = 4F00 -Prev = 5F00 - -USB = 2F06 -USB ouot = 3F06 -Headphones= AF06 -Hdphns out= BF06 -Charger = 4F06 -> 9F05 -Chgrout = 5F06 -> 8F05 -AV in = 8F06 -AV out = 9F06 */ - -#define BTN_REL 1 - -#define BTN_TOUCHPAD_PRESS 0x1F00 -#define BTN_TOUCHPAD_LONG_PRESS 0x1F01 -#define BTN_TOUCHPAD_CORNER_DOWN 0xFF00 -#define BTN_TOUCHPAD_SCROLL_DOWN 0xFF01 -#define BTN_TOUCHPAD_CORNER_UP 0xDF00 -#define BTN_TOUCHPAD_SCROLL_UP 0xDF01 - -#define HEADPHONE_PLUGIN_A 0xAF06 -#define HEADPHONE_PLUGIN_B 0x00AF06 //Dummy Value -#define HEADPHONE_UNPLUG_A 0x00BF06 //Dummy Value -#define HEADPHONE_UNPLUG_B 0x00BF061 //Dummy Value - -#define DOCK_INSERT 0x00003 //Dummy Value -#define DOCK_UNPLUG 0x00002 //Dummy Value -#define DOCK_USB_INSERT 0x2F06 -#define DOCK_USB_UNPLUG 0x3F06 -#define DOCK_POWER_INSERT 0x4F06 -#define DOCK_POWER_UNPLUG 0x5F06 -#define DOCK_AV_INSERT 0x8F06 -#define DOCK_AV_UNPLUG 0x9F06 -#endif - -#define PIC_ADR 0x07 - -#define MASK_TV_OUT(x) ((x >> 14) & 1) -#define MASK_xx1(x) ((x >> 9) & 3) -#define MASK_xx2(x) ((x >> 4) & 1) -#define MASK_xx3(x) ((x >> 5) & 1) -#define MASK_xx4(x) ((x >> 6) & 1) -#define MASK_xx5(x) ((x >> 13) & 1) -#define MASK_xx6(x) ((x >> 12) & 1) -#define MASK_xx7(x) ((x >> 11) & 1) - -#define NONBUTTON_HEADPHONE (1 << 0) -#define NONBUTTON_DOCK (1 << 1) -#define NONBUTTON_USB (1 << 2) -#define NONBUTTON_POWER (1 << 3) -#define NONBUTTON_VIDEOUT (1 << 4) - -static unsigned int btn; -static bool hold_switch; -static unsigned char nonbtn; -static unsigned int pic_init_value; -static unsigned int pic_init2_value; -static unsigned int last_btn; -static long last_tick; -static int tick_diff; - -#define TICK_MIN 0x33 -#define TICK_MAX 0x34 - -/* Taken from scramble.c and modified */ -static inline unsigned short le2short(unsigned char* buf) -{ - return (unsigned short)((buf[1] << 8) | buf[0]); -} - -#define map_button(BtN,BtN2) case BtN: \ - btn ^= BtN2; \ - btn &= BtN2; \ - break; \ - case BtN ^ BTN_REL: \ - btn ^= BtN2; \ - btn &= BtN2; \ - break; - -#ifdef BUTTON_DEBUG -static bool sw = false; -#endif - -void GIO0(void) -{ - /* Mask GIO0 interrupt */ - IO_INTC_IRQ1 = INTR_IRQ1_EXT0; - - unsigned char msg[4]; - i2c_read(PIC_ADR, msg, sizeof(msg)); - tick_diff = current_tick - last_tick; - last_tick = current_tick; - unsigned short btn_press = le2short(msg); - if(tick_diff >= TICK_MIN && tick_diff <= TICK_MAX) - { - /* Ignore this, as it is a hold event */ - return; - } - last_btn = btn_press; - switch(btn_press) - { - map_button(BTN_LEFT, BUTTON_LEFT); - map_button(BTN_RIGHT, BUTTON_RIGHT); - map_button(BTN_BACK, BUTTON_BACK); - map_button(BTN_CUSTOM, BUTTON_CUSTOM); - map_button(BTN_MENU, BUTTON_MENU); - map_button(BTN_PLAY, BUTTON_PLAY); - map_button(BTN_POWER, BUTTON_POWER); - map_button(BTN_TOUCHPAD_PRESS, BUTTON_SELECT); - map_button(BTN_TOUCHPAD_CORNER_DOWN, BUTTON_DOWN); - map_button(BTN_TOUCHPAD_CORNER_UP, BUTTON_UP); - #ifndef ZEN_VISION - /* These don't seem to work for some reason on the Zen Vision.. */ - case BTN_TOUCHPAD_SCROLL_DOWN: - btn = BUTTON_DOWN; - break; - case BTN_TOUCHPAD_SCROLL_UP: - btn = BUTTON_UP; - break; - #endif - case BTN_HOLD: - hold_switch = true; - break; - case BTN_UNHOLD: - hold_switch = false; - break; - #ifndef ZEN_VISION - /* These don't seem to work for some reason.. */ - case HEADPHONE_PLUGIN_A: - case HEADPHONE_PLUGIN_B: - nonbtn |= NONBUTTON_HEADPHONE; - break; - case HEADPHONE_UNPLUG_A: - case HEADPHONE_UNPLUG_B: - nonbtn &= ~NONBUTTON_HEADPHONE; - break; - #endif - case DOCK_INSERT: - nonbtn |= NONBUTTON_DOCK; - break; - case DOCK_UNPLUG: - nonbtn &= ~(NONBUTTON_DOCK | NONBUTTON_USB | NONBUTTON_POWER); - break; - case DOCK_USB_INSERT: - nonbtn |= NONBUTTON_USB; - break; - case DOCK_USB_UNPLUG: - nonbtn &= ~NONBUTTON_USB; - break; - case DOCK_POWER_INSERT: - nonbtn |= NONBUTTON_POWER; - break; - case DOCK_POWER_UNPLUG: - nonbtn &= ~NONBUTTON_POWER; - break; - } -#ifdef BUTTON_DEBUG -#ifdef BOOTLOADER - lcd_set_foreground((sw ? LCD_RGBPACK(255,0,0) : LCD_RGBPACK(0,255,0) )); -#endif - lcd_putsxyf(LCD_WIDTH-SYSFONT_WIDTH*10, LCD_HEIGHT-SYSFONT_HEIGHT*10, "%x", - (unsigned int)((msg[3] << 24) | - (msg[2] << 16) | (msg[1] << 8) | msg[0])); - lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*10, LCD_HEIGHT-SYSFONT_HEIGHT*7, "%x", - btn); -#ifdef BOOTLOADER - lcd_set_foreground(LCD_BLACK); -#endif - lcd_update(); - sw = !sw; -#endif - logf("PIC: 0x%x", (unsigned int)((msg[3] << 24) | - (msg[2] << 16) | (msg[1] << 8) | msg[0])); -} - -static void send_command_to_pic(const unsigned char in, unsigned char* out, - const unsigned int length) -{ - /* Disable GIO0 interrupt */ - IO_INTC_EINT1 &= ~INTR_EINT1_EXT0; - /* Clear EXT0 interrupt */ - IO_INTC_IRQ1 = INTR_IRQ1_EXT0; - /* Write command to I²C */ - restart: - i2c_write(PIC_ADR, &in, 1); - /* Wait for PIC */ - int i = 0; - while(!(IO_INTC_IRQ1 & INTR_IRQ1_EXT0)) - { - sleep(0); - i++; - if(i > 50) - goto restart; - } - /* Read return from I²C */ - i2c_read(PIC_ADR, out, length); - /* Re-enable GIO0 interrupt */ - IO_INTC_EINT1 |= INTR_EINT1_EXT0; -} - -bool headphones_inserted(void) -{ - return (bool)(nonbtn & NONBUTTON_HEADPHONE); -} - -void button_init_device(void) -{ - /* TODO: I suppose GIO0 has to be set to input and enable interrupts on - it? */ - /* Enable GIO0 interrupt */ - IO_INTC_EINT1 |= INTR_EINT1_EXT0; - btn=nonbtn=pic_init_value=pic_init2_value=last_btn=hold_switch=0; - /* Initialize PIC */ - send_command_to_pic(1, (unsigned char *)&pic_init_value, - sizeof(pic_init_value)); - send_command_to_pic(2, (unsigned char *)&pic_init2_value, - sizeof(pic_init2_value)); -} - -int button_read_device(void) -{ - if(hold_switch) - return 0; - else - return btn; -} - -bool button_hold(void) -{ - return hold_switch; -} - -bool button_usb_connected(void) -{ - return (bool)(nonbtn & NONBUTTON_USB); -} - -#ifndef BOOTLOADER -int pic_dbg_num_items(void) -{ - return 13; -} - -const char* pic_dbg_item(int selected_item, void *data, - char *buffer, size_t buffer_len) -{ - (void)data; - switch(selected_item) - { - case 0: - snprintf(buffer, buffer_len, "Init value 1: 0x%04x", pic_init_value); - return buffer; - case 1: - snprintf(buffer, buffer_len, "Init value 2: 0x%04x", pic_init2_value); - return buffer; - case 2: - snprintf(buffer, buffer_len, "Last button value: 0x%04x Raw value: 0x%04x", last_btn, btn); - return buffer; - case 3: - snprintf(buffer, buffer_len, "Last button differs in ticks: 0x%04x", tick_diff); - return buffer; - case 4: - snprintf(buffer, buffer_len, "Dock values: 0x%04x", nonbtn); - return buffer; - #define B(n,w,b) case n: \ - snprintf(buffer, buffer_len, "%s: 0x%04x", w, b); \ - return buffer; - B(5, "MASK_TV_OUT", MASK_TV_OUT(pic_init_value)); - B(6, "MASK_xx1", MASK_xx1(pic_init_value)); - B(7, "MASK_xx2", MASK_xx2(pic_init_value)); - B(8, "MASK_xx3", MASK_xx3(pic_init_value)); - B(9, "MASK_xx4", MASK_xx4(pic_init_value)); - B(10, "MASK_xx5", MASK_xx5(pic_init_value)); - B(11, "MASK_xx6", MASK_xx6(pic_init_value)); - B(12, "MASK_xx7", MASK_xx7(pic_init_value)); - #undef B - } - return NULL; -} -#endif diff --git a/firmware/target/arm/tms320dm320/creative-zvm/power-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/power-creativezvm.c deleted file mode 100644 index 90c30d326c..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/power-creativezvm.c +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id: power-mr500.c 15599 2007-11-12 18:49:53Z amiconn $ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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 "cpu.h" -#include -#include "kernel.h" -#include "system.h" -#include "power.h" -#include "backlight.h" -#include "backlight-target.h" - -void power_init(void) -{ - /* Initialize IDE power pin */ - /* set ATA power on and output */ - /* Charger detect */ -} - -#if CONFIG_CHARGING -unsigned int power_input_status(void) -{ - return POWER_INPUT_NONE; -} - -/* Returns true if the unit is charging the batteries. */ -bool charging_state(void) -{ - return false; -} -#endif - -void power_off(void) -{ -} diff --git a/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c deleted file mode 100644 index 69b29a3e64..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * 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 "adc.h" -#include "powermgmt.h" -#include "kernel.h" - -/* THIS CONTAINS CURRENTLY DUMMY CODE! */ - -static const unsigned short current_voltage = 3910; -unsigned short battery_level_disksafe = 0; - -unsigned short battery_level_shutoff = 0; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -unsigned short percent_to_volt_discharge[11] = -{ - 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320 -}; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ -unsigned short percent_to_volt_charge[11] = -{ - 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320, -}; - -/* Returns battery voltage from ADC [millivolts] */ -int _battery_voltage(void) -{ - return current_voltage; -} diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c deleted file mode 100644 index 82a59d792a..0000000000 --- a/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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 "system.h" -#include "kernel.h" -#include "usb.h" -#include "usb_drv.h" -#include "usb_core.h" -#include "isp1583.h" - -#define printf - -bool usb_drv_connected(void) -{ - return button_usb_connected(); -} - -int usb_detect(void) -{ - if(usb_drv_connected()) - return USB_INSERTED; - else - return USB_EXTRACTED; -} - -void usb_init_device(void) -{ - return; -} - -void usb_enable(bool on) -{ - if(on) - usb_core_init(); - else - usb_core_exit(); -} - -void usb_attach(void) -{ - usb_enable(true); -} - -void IRAM_ATTR GIO7(void) -{ -#ifdef DEBUG - //printf("GIO7 interrupt... [%d]", current_tick); -#endif - usb_drv_int(); - - IO_INTC_IRQ1 = INTR_IRQ1_EXT7; -} diff --git a/firmware/target/arm/tms320dm320/crt0.S b/firmware/target/arm/tms320dm320/crt0.S index e57e28a470..4abf1e5e30 100644 --- a/firmware/target/arm/tms320dm320/crt0.S +++ b/firmware/target/arm/tms320dm320/crt0.S @@ -111,7 +111,7 @@ _start: mov r0, #0x20 bl _delay_cycles -#if defined(BOOTLOADER) && !defined(CREATIVE_ZVx) +#if defined(BOOTLOADER) bl _init_board #endif diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c index 37e48d16a2..a82984f90b 100644 --- a/firmware/target/arm/tms320dm320/debug-dm320.c +++ b/firmware/target/arm/tms320dm320/debug-dm320.c @@ -370,17 +370,6 @@ bool dbg_hw_info(void) button = button_get_w_tmo(1); if(button & BUTTON_POWER) done = true; -#if defined(CREATIVE_ZVx) - else if(button & BUTTON_LEFT) - lcd_set_direct_fb(false); - else if(button & BUTTON_RIGHT) - lcd_set_direct_fb(true); - - lcd_puts(0, line++, "LCD info:"); - lcd_putsf(0, line++, " LCD direct FB access? %s", - (lcd_get_direct_fb() ? "yes" : "no")); - line++; -#endif #endif lcd_puts(0, line++, "[Rockbox info]"); lcd_putsf(0, line++, "current tick: %08x Seconds running: %08d", diff --git a/firmware/target/arm/tms320dm320/dsp/Makefile b/firmware/target/arm/tms320dm320/dsp/Makefile index 8cc1bd98c0..42cd01254b 100644 --- a/firmware/target/arm/tms320dm320/dsp/Makefile +++ b/firmware/target/arm/tms320dm320/dsp/Makefile @@ -16,18 +16,12 @@ LDFLAGS = -w OBJDIR=./build -OBJS = arm.obj main.obj vectors.obj dma.obj - -ifeq ($(findstring -DCREATIVE_ZV,$(TARGET)), -DCREATIVE_ZV) -OBJS += aic23.obj -else -OBJS += tsc2100.obj -endif +OBJS = arm.obj main.obj vectors.obj dma.obj tsc2100.obj OBJS := $(patsubst %.obj, $(OBJDIR)/%.obj, $(OBJS)) all: dsp-image.h - + clean: $(call PRINTS,cleaning DSP firmware)rm -f $(OBJS) $(OBJDIR)/dsp-image.out $(OBJDIR)/dsp-image.xml rmdir $(OBJDIR) diff --git a/firmware/target/arm/tms320dm320/dsp/aic23.c b/firmware/target/arm/tms320dm320/dsp/aic23.c deleted file mode 100644 index 8ffa5d4e70..0000000000 --- a/firmware/target/arm/tms320dm320/dsp/aic23.c +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Maurus Cuelenaere - * - * 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 "audio.h" -#include "registers.h" - -/* based on http://archopen.svn.sourceforge.net/viewvc/archopen/ArchOpen/trunk/libdsp/aic23.c?revision=213&view=markup */ -void audiohw_init(void) -{ - /* port config */ -#if 0 - SPCR10 = 0; /* DLB = 0 ** RJUST = 0 ** CLKSTP = 0 ** DXENA = 0 ** ABIS = 0 ** RINTM = 0 ** RSYNCER = 0 ** RFULL = 0 ** RRDY = 0 ** RRST = 0 */ - SPCR20 = (1 << 9); /* FREE = 1 ** SOFT = 0 ** FRST = 0 ** GRST = 0 ** XINTM = 0 ** XSYNCER = 0 ** XEMPTY = 0 ** XRDY = 0 ** XRST = 0 */ - RCR10 = (1 << 8) | (2 << 5); /* RFRLEN1 = 1 ** RWDLEN1 = 2 */ - RCR20 = 0; /* RPHASE = 0 ** RFRLEN2 = 0 ** RWDLEN2 = 0 ** RCOMPAND = 0 ** RFIG = 0 ** RDATDLY = 0 */ - XCR10 = (1 << 8) | (2 << 5); /* XFRLEN1 = 1 ** XWDLEN1 = 2 */ - XCR20 = 0; /* XPHASE = 0 ** XFRLEN2 = 0 ** XWDLEN2 = 0 ** XCOMPAND = 0 ** XFIG = 0 ** XDATDLY = 0 */ - SRGR10 = 0; /* FWID = 0 ** CLKGDV = 0 */ - SRGR20 = 0; /* FREE = 0 ** CLKSP = 0 ** CLKSM = 0 ** FSGM = 0 ** FPER = 0 */ - PCR0 = (1 << 1) | 1; /* IDLEEN = 0 ** XIOEN = 0 ** RIOEN = 0 ** FSXM = 0 ** FSRM = 0 ** SCLKME = 0 ** CLKSSTAT = 0 ** DXSTAT = 0 ** DRSTAT = 0 ** CLKXM = 0 ** CLKRM = 0 ** FSXP = 0 ** FSRP = 0 ** CLKXP = 1 ** CLKRP = 1 */ -#else - SPCR10 = 0; - SPCR20 = 0x0200; /* SPCR : free running mode */ - - RCR10 = 0x00A0; - RCR20 = 0x00A1; /* RCR : 32 bit receive data length */ - - XCR10 = 0x00A0; - XCR20 = 0x00A0; /* XCR : 32 bit transmit data length */ - - SRGR10 = 0; - SRGR20 = 0x3000; /* SRGR 1 & 2 */ - - PCR0 = 0x000E - 8; /* PCR : FSX, FSR active low, external FS/CLK source */ -#endif -} - -void audiohw_postinit(void) -{ - /* Trigger first XEVT0 */ - SPCR20 |= 1; -} diff --git a/firmware/target/arm/tms320dm320/i2c-dm320.c b/firmware/target/arm/tms320dm320/i2c-dm320.c index 364d3b5c17..d552ba6b68 100644 --- a/firmware/target/arm/tms320dm320/i2c-dm320.c +++ b/firmware/target/arm/tms320dm320/i2c-dm320.c @@ -156,13 +156,6 @@ void i2c_init(void) { mutex_init(&i2c_mtx); -#ifdef CREATIVE_ZVx //TODO: mimic OF I2C clock settings; currently this is done by the bootloader - IO_CLK_MOD2 &= ~CLK_MOD2_I2C; // turn I²C clock off (just to be sure) - IO_CLK_LPCTL1 &= ~1; // set Powerdown mode to off - IO_CLK_SEL0 &= ~0x800; // set I²C clock to PLLA - IO_CLK_DIV4 &= ~0x1F; // I²C clock division = 1 - IO_CLK_MOD2 |= CLK_MOD2_I2C; // enable I²C clock -#endif IO_I2C_SCS &= ~0x8; //set clock to 100 kHz IO_INTC_EINT2 &= ~INTR_EINT2_I2C; // disable I²C interrupt } diff --git a/firmware/target/arm/tms320dm320/spi-dm320.c b/firmware/target/arm/tms320dm320/spi-dm320.c index 2dca324664..f1f5828430 100644 --- a/firmware/target/arm/tms320dm320/spi-dm320.c +++ b/firmware/target/arm/tms320dm320/spi-dm320.c @@ -43,10 +43,7 @@ struct SPI_info { static const struct SPI_info spi_targets[SPI_MAX_TARGETS] = { -#if defined(CREATIVE_ZVx) - [SPI_target_LTV250QV] = { &IO_GIO_BITCLR2, &IO_GIO_BITSET2, - GIO_LCD_ENABLE, true, 0x07}, -#elif defined(MROBE_500) +#if defined(MROBE_500) [SPI_target_TSC2100] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, GIO_TS_ENABLE, 0x260D, true}, /* RTC seems to have timing problems if the CLK idles low */ diff --git a/firmware/target/arm/tms320dm320/spi-target.h b/firmware/target/arm/tms320dm320/spi-target.h index 965d499377..16fb2ff01b 100644 --- a/firmware/target/arm/tms320dm320/spi-target.h +++ b/firmware/target/arm/tms320dm320/spi-target.h @@ -23,9 +23,7 @@ #define SPI_TARGET_H enum SPI_target { -#if defined(CREATIVE_ZVx) - SPI_target_LTV250QV = 0, -#elif defined(MROBE_500) +#if defined(MROBE_500) SPI_target_TSC2100 = 0, SPI_target_RX5X348AB, SPI_target_BACKLIGHT, diff --git a/firmware/target/arm/tms320dm320/system-dm320.c b/firmware/target/arm/tms320dm320/system-dm320.c index 6df9868f1c..ae8472ca53 100644 --- a/firmware/target/arm/tms320dm320/system-dm320.c +++ b/firmware/target/arm/tms320dm320/system-dm320.c @@ -27,9 +27,6 @@ #include "system-arm.h" #include "spi.h" #include "i2c.h" -#ifdef CREATIVE_ZVx -#include "dma-target.h" -#endif #ifdef MROBE_500 #include "usb-mr500.h" #endif @@ -370,10 +367,6 @@ void system_init(void) IO_GIO_BITCLR2 = 0x0001; #endif -#ifdef CREATIVE_ZVx - dma_init(); -#endif - #ifdef SANSA_CONNECT #ifndef HAVE_WIFI /* keep WIFI CS and reset high to save power */ diff --git a/firmware/target/arm/tms320dm320/system-target.h b/firmware/target/arm/tms320dm320/system-target.h index d228129e0f..cf5a278dc2 100644 --- a/firmware/target/arm/tms320dm320/system-target.h +++ b/firmware/target/arm/tms320dm320/system-target.h @@ -38,16 +38,6 @@ void udelay(int usec); void mdelay(int msec); -#if defined(CREATIVE_ZVx) && defined(BOOTLOADER) - /* hacky.. */ -#define SLEEP_KERNEL_HOOK(ticks) \ - ({ \ - long _sleep_ticks = current_tick + (ticks) + 1; \ - while (TIME_BEFORE(current_tick, _sleep_ticks)) \ - switch_thread(); \ - true; }) /* handled here */ -#endif - #ifdef BOOTLOADER void tick_stop(void); void system_prepare_fw_start(void); diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h index 5f336d6bc8..c29c4e0be7 100644 --- a/firmware/target/hosted/sdl/sim-ui-defines.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h @@ -219,31 +219,6 @@ #define UI_LCD_POSX 58 /* x position of lcd */ #define UI_LCD_POSY 67 /* y position of lcd */ -#elif defined(CREATIVE_ZVM) || defined(CREATIVE_ZVM60GB) -#ifdef CREATIVE_ZVM - #define UI_TITLE "Creative Zen Vision:M 30GB" -#else - #define UI_TITLE "Creative Zen Vision:M 60GB" -#endif -#define UI_WIDTH 383 /* width of GUI window */ -#define UI_HEIGHT 643 /* height of GUI window */ -#define UI_LCD_POSX 31 /* x position of lcd */ -#define UI_LCD_POSY 62 /* y position of lcd */ - -#elif defined(CREATIVE_ZV) -#define UI_TITLE "Creative Zen Vision" -#define UI_WIDTH 1054 /* width of GUI window */ -#define UI_HEIGHT 643 /* height of GUI window */ -#define UI_LCD_POSX 129 /* x position of lcd */ -#define UI_LCD_POSY 85 /* y position of lcd */ - -#elif defined(MEIZU_M6SL) -#define UI_TITLE "Meizu M6" -#define UI_WIDTH 512 /* width of GUI window */ -#define UI_HEIGHT 322 /* height of GUI window */ -#define UI_LCD_POSX 39 /* x position of lcd */ -#define UI_LCD_POSY 38 /* y position of lcd */ - #elif defined(SANSA_FUZEPLUS) #define UI_TITLE "Sansa Fuze+" #define UI_WIDTH 322 /* width of GUI window */ @@ -353,13 +328,6 @@ #define UI_LCD_POSX 124 /* x position of lcd */ #define UI_LCD_POSY 42 /* y position of lcd */ -#elif defined(MINI2440) -#define UI_TITLE "Mini2440" -#define UI_WIDTH 441 /* width of GUI window */ -#define UI_HEIGHT 436 /* height of GUI window */ -#define UI_LCD_POSX 148 /* x position of lcd */ -#define UI_LCD_POSY 50 /* y position of lcd */ - #elif defined(PBELL_VIBE500) #define UI_TITLE "Packard Bell Vibe 500" #define UI_WIDTH 287 /* width of GUI window */ diff --git a/firmware/target/mips/ingenic_jz47xx/app.lds b/firmware/target/mips/ingenic_jz47xx/app.lds index 29a973a0ca..701c9b4b58 100644 --- a/firmware/target/mips/ingenic_jz47xx/app.lds +++ b/firmware/target/mips/ingenic_jz47xx/app.lds @@ -9,12 +9,10 @@ STARTUP(target/mips/ingenic_jz47xx/crt0.o) INPUT(target/mips/exception-mips.o) INPUT(target/mips/system-mips.o) -#define STUBOFFSET 0x4000 - -#define DRAMORIG (0x80000000 + STUBOFFSET) -#define DRAMSIZE (MEMORYSIZE * 0x100000 - STUBOFFSET) #define IRAMORIG 0x80000000 -#define IRAMSIZE 16K +#define IRAMSIZE 0x4000 +#define DRAMORIG (IRAMORIG + IRAMSIZE) +#define DRAMSIZE (MEMORYSIZE * 0x100000 - IRAMSIZE) /* End of the audio buffer, where the codec buffer starts */ #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE) diff --git a/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c index 3187c28952..8d928ff27e 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c @@ -84,7 +84,7 @@ struct nand_param * */ -static volatile sector_t nand_address; +static volatile unsigned long nand_address; #define NAND_DATAPORT (nand_address) #define NAND_ADDRPORT (nand_address+0x10000) #define NAND_COMMPORT (nand_address+0x08000) diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c index 066be4e987..9883f2bf39 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c @@ -41,7 +41,7 @@ static struct mutex sd_mtx; //static struct semaphore sd_wakeup; static int use_4bit; -static int num_6; +static int use_sbc; //#define SD_DMA_ENABLE #define SD_DMA_INTERRUPT 0 @@ -84,6 +84,7 @@ enum sd_result_t SD_ERROR_TIMEOUT, SD_ERROR_CRC, SD_ERROR_DRIVER_FAILURE, + SD_ERROR_ACMD_REJECT, }; /* Standard MMC/SD clock speeds */ @@ -91,10 +92,6 @@ enum sd_result_t #define SD_CLOCK_FAST 24000000 /* 24 MHz for SD Cards */ #define SD_CLOCK_HIGH 48000000 /* 48 MHz for SD Cards */ -/* Extra commands for state control */ -/* Use negative numbers to disambiguate */ -#define SD_CIM_RESET -1 - /* Proprietary commands, illegal/reserved according to SD Specification 2.00 */ /* class 1 */ #define SD_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ @@ -109,19 +106,17 @@ enum sd_result_t /* class 9 */ #define SD_GO_IRQ_STATE 40 /* bcr R5 */ -/* Don't change the order of these; they are used in dispatch tables */ enum sd_rsp_t { RESPONSE_NONE = 0, RESPONSE_R1 = 1, RESPONSE_R1B = 2, - RESPONSE_R2_CID = 3, - RESPONSE_R2_CSD = 4, - RESPONSE_R3 = 5, - RESPONSE_R4 = 6, - RESPONSE_R5 = 7, - RESPONSE_R6 = 8, - RESPONSE_R7 = 9, + RESPONSE_R2 = 3, + RESPONSE_R3 = 4, + RESPONSE_R4 = 5, + RESPONSE_R5 = 6, + RESPONSE_R6 = 7, + RESPONSE_R7 = 8, }; /* @@ -179,10 +174,9 @@ struct sd_response_r3 struct sd_request { - int index; /* Slot index - used for CS lines */ int cmd; /* Command to send */ unsigned int arg; /* Argument to send */ - enum sd_rsp_t rtype; /* Response type expected */ + enum sd_rsp_t rtype; /* Response type expected */ /* Data transfer (these may be modified at the low level) */ unsigned short nob; /* Number of blocks to transfer*/ @@ -195,16 +189,6 @@ struct sd_request enum sd_result_t result; }; -#define SD_OCR_ARG 0x00ff8000 /* Argument of OCR */ - -/*********************************************************************** - * SD Events - */ -#define SD_EVENT_NONE 0x00 /* No events */ -#define SD_EVENT_RX_DATA_DONE 0x01 /* Rx data done */ -#define SD_EVENT_TX_DATA_DONE 0x02 /* Tx data done */ -#define SD_EVENT_PROG_DONE 0x04 /* Programming is done */ - /************************************************************************** * Utility functions **************************************************************************/ @@ -262,6 +246,9 @@ static int sd_unpack_r6(struct sd_request *request, struct sd_response_r1 *r1, u if (request->result) return request->result; + if (buf[0] != 0x03) + return SD_ERROR_HEADER_MISMATCH; + *rca = PARSE_U16(buf,1); /* Save RCA returned by the SD Card */ *(buf+1) = 0; @@ -298,7 +285,7 @@ static inline int jz_sd_stop_clock(void) timeout--; if (timeout == 0) { - DEBUG("Timeout on stop clock waiting"); + logf("Timeout on stop clock waiting"); return SD_ERROR_TIMEOUT; } udelay(1); @@ -322,7 +309,7 @@ static int jz_sd_check_status(struct sd_request *request) /* Checking for response or data timeout */ if (status & (MSC_STAT_TIME_OUT_RES | MSC_STAT_TIME_OUT_READ)) { - DEBUG("SD timeout, MSC_STAT 0x%x CMD %d", status, + logf("SD timeout, MSC_STAT 0x%x CMD %d", status, request->cmd); return SD_ERROR_TIMEOUT; } @@ -332,7 +319,7 @@ static int jz_sd_check_status(struct sd_request *request) (MSC_STAT_CRC_READ_ERROR | MSC_STAT_CRC_WRITE_ERROR | MSC_STAT_CRC_RES_ERR)) { - DEBUG("SD CRC error, MSC_STAT 0x%x", status); + logf("SD CRC error, MSC_STAT 0x%x", status); return SD_ERROR_CRC; } @@ -341,7 +328,7 @@ static int jz_sd_check_status(struct sd_request *request) /* Checking for FIFO empty */ /*if(status & MSC_STAT_DATA_FIFO_EMPTY && request->rtype != RESPONSE_NONE) { - DEBUG("SD FIFO empty, MSC_STAT 0x%x", status); + logf("SD FIFO empty, MSC_STAT 0x%x", status); return SD_ERROR_UNDERRUN; }*/ @@ -360,16 +347,14 @@ static void jz_sd_get_response(struct sd_request *request) buf = request->response; request->result = SD_NO_ERROR; - switch (request->rtype) - { + switch (request->rtype) { case RESPONSE_R1: case RESPONSE_R1B: - case RESPONSE_R7: - case RESPONSE_R6: case RESPONSE_R3: case RESPONSE_R4: case RESPONSE_R5: - { + case RESPONSE_R6: + case RESPONSE_R7: data = REG_MSC_RES; buf[0] = (data >> 8) & 0xff; buf[1] = data & 0xff; @@ -383,10 +368,7 @@ static void jz_sd_get_response(struct sd_request *request) request->rtype, buf[0], buf[1], buf[2], buf[3], buf[4]); break; - } - case RESPONSE_R2_CID: - case RESPONSE_R2_CSD: - { + case RESPONSE_R2: for (i = 0; i < 16; i += 2) { data = REG_MSC_RES; @@ -395,7 +377,6 @@ static void jz_sd_get_response(struct sd_request *request) } DEBUG("request %d, response []", request->rtype); break; - } case RESPONSE_NONE: DEBUG("No response"); break; @@ -441,6 +422,9 @@ static void jz_sd_receive_data_dma(struct sd_request *req) /* clear status and disable channel */ REG_DMAC_DCCSR(DMA_SD_RX_CHANNEL) = 0; + + /* flush dcache again */ + discard_dcache_range(req->buffer, req->cnt); } static void jz_mmc_transmit_data_dma(struct mmc_request *req) @@ -488,6 +472,12 @@ static int jz_sd_receive_data(struct sd_request *req) unsigned int waligned = (((unsigned int) buf & 0x3) == 0); /* word aligned ? */ unsigned int stat, timeout, data, cnt; +#ifdef SD_DMA_ENABLE + if (waligned) + jz_sd_reveive_data_dma(request); + return SD_NO_ERROR; +#endif + for (; nob >= 1; nob--) { timeout = 0x3FFFFFF; @@ -546,6 +536,12 @@ static int jz_sd_transmit_data(struct sd_request *req) unsigned int waligned = (((unsigned int) buf & 0x3) == 0); /* word aligned ? */ unsigned int stat, timeout, data, cnt; +#ifdef SD_DMA_ENABLE + if (waligned) + jz_sd_transmit_data_dma(request); + return SD_NO_ERROR; +#endif + for (; nob >= 1; nob--) { timeout = 0x3FFFFFF; @@ -640,58 +636,45 @@ static void jz_sd_set_clock(unsigned int rate) ********************************************************************************************************************/ static int jz_sd_exec_cmd(struct sd_request *request) { - unsigned int cmdat = 0, events = 0; + unsigned int cmdat = 0; int retval, timeout = 0x3fffff; + bool has_data = (request->buffer != NULL); /* Indicate we have no result yet */ request->result = SD_NO_RESPONSE; - if (request->cmd == SD_CIM_RESET) { - /* On reset, 1-bit bus width */ - use_4bit = 0; + /* Stop clock when programming things */ + jz_sd_stop_clock(); /* stop SD clock */ - /* Reset MMC/SD controller */ - __msc_reset(); - - /* On reset, drop SD clock down */ - jz_sd_set_clock(MMC_CLOCK_SLOW); - - /* On reset, stop SD clock */ - jz_sd_stop_clock(); - } - if (request->cmd == SD_SET_BUS_WIDTH) - { - if (request->arg == 0x2) - { - DEBUG("Use 4-bit bus width"); - use_4bit = 1; - } - else - { - DEBUG("Use 1-bit bus width"); - use_4bit = 0; - } + /* Generic handling for all requests with data rx/tx */ + if (has_data) { + cmdat |= MSC_CMDAT_DATA_EN; +// if (request->nob > 1 && use_sbc) +// cmdat |= MSC_CMDAT_SEND_AS_STOP; +#ifdef SD_DMA_ENABLE + if (request->cnt >= 512) + cmdat |= MSC_CMDAT_DMA_EN; +#endif } /* mask all interrupts */ - //REG_MSC_IMASK = 0xffff; + REG_MSC_IMASK = 0xffff; /* clear status */ REG_MSC_IREG = 0xffff; - /*open interrupt */ - REG_MSC_IMASK = (~7); + /* unmask interrupts we care about */ + REG_MSC_IMASK = ~(MSC_IMASK_END_CMD_RES | MSC_IMASK_DATA_TRAN_DONE | MSC_IMASK_PRG_DONE); + /* use 4-bit bus width when possible */ if (use_4bit) cmdat |= MSC_CMDAT_BUS_WIDTH_4BIT; - /* Set command type and events */ + /* Per-command type handling */ switch (request->cmd) { - /* SD core extra command */ - case SD_CIM_RESET: - cmdat |= MSC_CMDAT_INIT; /* Initialization sequence sent prior to command */ - break; /* bc - broadcast - no response */ case SD_GO_IDLE_STATE: + cmdat |= MSC_CMDAT_INIT; /* Initialization sequence sent prior to command */ + /* Intentional Fallthrough */ case SD_SET_DSR: break; @@ -706,27 +689,8 @@ static int jz_sd_exec_cmd(struct sd_request *request) case SD_READ_SINGLE_BLOCK: case SD_READ_MULTIPLE_BLOCK: case SD_SEND_SCR: -#if defined(SD_DMA_ENABLE) - cmdat |= - MSC_CMDAT_DATA_EN | MSC_CMDAT_READ | MSC_CMDAT_DMA_EN; -#else - cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_READ; -#endif - events = SD_EVENT_RX_DATA_DONE; - break; - case SD_SWITCH_FUNC: - if (num_6 < 2) - { -#if defined(SD_DMA_ENABLE) - cmdat |= - MSC_CMDAT_DATA_EN | MSC_CMDAT_READ | - MSC_CMDAT_DMA_EN; -#else - cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_READ; -#endif - events = SD_EVENT_RX_DATA_DONE; - } + /* These READ data */ break; case SD_WRITE_DAT_UNTIL_STOP: @@ -734,18 +698,14 @@ static int jz_sd_exec_cmd(struct sd_request *request) case SD_WRITE_MULTIPLE_BLOCK: case SD_PROGRAM_CID: case SD_PROGRAM_CSD: - case SD_LOCK_UNLOCK: -#if defined(SD_DMA_ENABLE) - cmdat |= - MSC_CMDAT_DATA_EN | MSC_CMDAT_WRITE | MSC_CMDAT_DMA_EN; -#else - cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_WRITE; -#endif - events = SD_EVENT_TX_DATA_DONE | SD_EVENT_PROG_DONE; + /* These WRITE data */ + cmdat |= MSC_CMDAT_WRITE; break; +// case SD_LOCK_UNLOCK: // can be a read or write, needs busy too. + case SD_STOP_TRANSMISSION: - events = SD_EVENT_PROG_DONE; + // cmdat |= MSC_CMDAT_STOP_ABORT; break; /* ac - no data transfer */ @@ -762,11 +722,9 @@ static int jz_sd_exec_cmd(struct sd_request *request) cmdat |= MSC_CMDAT_BUSY; /* FALLTHRU */ case RESPONSE_R1: - case RESPONSE_R7: cmdat |= MSC_CMDAT_RESPONSE_R1; break; - case RESPONSE_R2_CID: - case RESPONSE_R2_CSD: + case RESPONSE_R2: cmdat |= MSC_CMDAT_RESPONSE_R2; break; case RESPONSE_R3: @@ -781,27 +739,21 @@ static int jz_sd_exec_cmd(struct sd_request *request) case RESPONSE_R6: cmdat |= MSC_CMDAT_RESPONSE_R6; break; + case RESPONSE_R7: + cmdat |= MSC_CMDAT_RESPONSE_R1; /* 4740 lacks R7 */ + break; default: break; } /* Set command index */ - if (request->cmd == SD_CIM_RESET) - REG_MSC_CMD = SD_GO_IDLE_STATE; - else - REG_MSC_CMD = request->cmd; + REG_MSC_CMD = request->cmd; /* Set argument */ REG_MSC_ARG = request->arg; - /* Set block length and nob */ - if (request->cmd == SD_SEND_SCR) - { /* get SCR from DataFIFO */ - REG_MSC_BLKLEN = 8; - REG_MSC_NOB = 1; - } - else - { + /* Set block length and nob if there is data */ + if (has_data) { REG_MSC_BLKLEN = request->block_len; REG_MSC_NOB = request->nob; } @@ -816,18 +768,15 @@ static int jz_sd_exec_cmd(struct sd_request *request) jz_sd_start_clock(); /* Wait for command completion */ - //__intc_unmask_irq(IRQ_MSC); //semaphore_wait(&sd_wakeup, 100); while (timeout-- && !(REG_MSC_STAT & MSC_STAT_END_CMD_RES)); - if (timeout == 0) return SD_ERROR_TIMEOUT; - REG_MSC_IREG = MSC_IREG_END_CMD_RES; /* clear flag */ - /* Check for status */ retval = jz_sd_check_status(request); + REG_MSC_IREG = MSC_IREG_END_CMD_RES; /* clear flag */ if (retval) return retval; @@ -839,46 +788,28 @@ static int jz_sd_exec_cmd(struct sd_request *request) jz_sd_get_response(request); /* Start data operation */ - if (events & (SD_EVENT_RX_DATA_DONE | SD_EVENT_TX_DATA_DONE)) - { - if (events & SD_EVENT_RX_DATA_DONE) - { - if (request->cmd == SD_SEND_SCR) - { - /* SD card returns SCR register as data. - SD core expect it in the response buffer, - after normal response. */ - request->buffer = - (unsigned char *) ((unsigned int) request->response + 5); - } -#ifdef SD_DMA_ENABLE - jz_sd_receive_data_dma(request); -#else - jz_sd_receive_data(request); -#endif + if (has_data) { + if (cmdat & MSC_CMDAT_WRITE) { + retval = jz_sd_transmit_data(request); + } else { + retval = jz_sd_receive_data(request); } + if (retval) + return retval; - if (events & SD_EVENT_TX_DATA_DONE) - { -#ifdef SD_DMA_ENABLE - jz_sd_transmit_data_dma(request); -#else - jz_sd_transmit_data(request); -#endif - } - //__intc_unmask_irq(IRQ_MSC); //semaphore_wait(&sd_wakeup, 100); /* Wait for Data Done */ - while (!(REG_MSC_IREG & MSC_IREG_DATA_TRAN_DONE)); + while (!(REG_MSC_IREG & MSC_IREG_DATA_TRAN_DONE)) + yield(); REG_MSC_IREG = MSC_IREG_DATA_TRAN_DONE; /* clear status */ } - /* Wait for Prog Done event */ - if (events & SD_EVENT_PROG_DONE) + /* Wait for Prog Done event if necessary */ + if (cmdat & (MSC_CMDAT_BUSY | MSC_CMDAT_WRITE)) { - //__intc_unmask_irq(IRQ_MSC); //semaphore_wait(&sd_wakeup, 100); - while (!(REG_MSC_IREG & MSC_IREG_PRG_DONE)); + while (!(REG_MSC_IREG & MSC_IREG_PRG_DONE)) + yield(); REG_MSC_IREG = MSC_IREG_PRG_DONE; /* clear status */ } @@ -904,7 +835,7 @@ static void jz_sd_tx_handler(unsigned int arg) { if (__dmac_channel_address_error_detected(arg)) { - DEBUG("%s: DMAC address error.", __FUNCTION__); + logf("%s: DMAC address error.", __FUNCTION__); __dmac_channel_clear_address_error(arg); } if (__dmac_channel_transmit_end_detected(arg)) @@ -918,7 +849,7 @@ static void jz_sd_rx_handler(unsigned int arg) { if (__dmac_channel_address_error_detected(arg)) { - DEBUG("%s: DMAC address error.", __FUNCTION__); + logf("%s: DMAC address error.", __FUNCTION__); __dmac_channel_clear_address_error(arg); } if (__dmac_channel_transmit_end_detected(arg)) @@ -961,6 +892,7 @@ static void jz_sd_hardware_init(void) SD_RESET(); /* reset mmc/sd controller */ SD_IRQ_MASK(); /* mask all IRQs */ jz_sd_stop_clock(); /* stop SD clock */ + jz_sd_set_clock(MMC_CLOCK_SLOW); /* Drop to lowest speed */ #ifdef SD_DMA_ENABLE // __cpm_start_dmac(); // __dmac_enable_module(); @@ -976,10 +908,12 @@ static void jz_sd_hardware_init(void) #endif } -static int sd_send_cmd(struct sd_request *request, int cmd, unsigned int arg, +static void sd_send_cmd(struct sd_request *request, int cmd, unsigned int arg, unsigned short nob, unsigned short block_len, enum sd_rsp_t rtype, unsigned char* buffer) { + int retval; + request->cmd = cmd; request->arg = arg; request->rtype = rtype; @@ -987,8 +921,13 @@ static int sd_send_cmd(struct sd_request *request, int cmd, unsigned int arg, request->block_len = block_len; request->buffer = buffer; request->cnt = nob * block_len; + memset(&request->response, 0xa5, sizeof(request->response)); + request->result = SD_NO_RESPONSE; + + retval = jz_sd_exec_cmd(request); + if (retval) + request->result = retval; - return jz_sd_exec_cmd(request); } static void sd_simple_cmd(struct sd_request *request, int cmd, unsigned int arg, @@ -997,6 +936,46 @@ static void sd_simple_cmd(struct sd_request *request, int cmd, unsigned int arg, sd_send_cmd(request, cmd, arg, 0, 0, rtype, NULL); } +static int sd_exec_acmd(struct sd_request *request, int cmd, unsigned int arg) +{ + struct sd_response_r1 r1; + int retval; + + sd_simple_cmd(request, SD_APP_CMD, card.rca, RESPONSE_R1); + retval = sd_unpack_r1(request, &r1); + + if (retval) + return retval; + + if (!(r1.status & SD_R1_APP_CMD)) { + logf("ACMD not accepted\n"); + return SD_ERROR_ACMD_REJECT; + } + + sd_simple_cmd(request, cmd, arg, RESPONSE_R1); + return sd_unpack_r1(request, &r1); +} + +static int sd_exec_acmd_buf(struct sd_request *request, int cmd, unsigned int arg, enum sd_rsp_t rtype, unsigned short nob, unsigned short block_len, unsigned char *buffer) +{ + struct sd_response_r1 r1; + int retval; + + sd_simple_cmd(request, SD_APP_CMD, card.rca, RESPONSE_R1); + retval = sd_unpack_r1(request, &r1); + if (retval) + return retval; + + if (!(r1.status & SD_R1_APP_CMD)) { + logf("ACMD not accepted\n"); + return SD_ERROR_ACMD_REJECT; + } + + sd_send_cmd(request, cmd, arg, + nob, block_len, rtype, buffer); + return SD_NO_ERROR; +} + #define SD_INIT_DOING 0 #define SD_INIT_PASSED 1 #define SD_INIT_FAILED 2 @@ -1004,59 +983,50 @@ static int sd_init_card_state(struct sd_request *request) { struct sd_response_r1 r1; struct sd_response_r3 r3; - int retval, i, ocr = 0x40300000, limit_41 = 0; + int retval, i, ocr = 0x40300000 /* SDXC, 3.2-3.4v */; + +#ifdef HAVE_SDUC + ocr |= 0x08000000; /* Add on SDUC */ +#endif switch (request->cmd) { case SD_GO_IDLE_STATE: /* No response to parse */ sd_simple_cmd(request, SD_SEND_IF_COND, 0x1AA, RESPONSE_R1); break; - case SD_SEND_IF_COND: retval = sd_unpack_r1(request, &r1); - sd_simple_cmd(request, SD_APP_CMD, 0, RESPONSE_R1); - break; +// if (retval) +// return SD_INIT_FAILED; - case SD_APP_CMD: - retval = sd_unpack_r1(request, &r1); - if (retval & (limit_41 < 100)) - { - DEBUG("sd_init_card_state: unable to SD_APP_CMD error=%d", - retval); - limit_41++; - sd_simple_cmd(request, SD_APP_OP_COND, ocr, RESPONSE_R3); - } - else if (limit_41 < 100) - { - limit_41++; - sd_simple_cmd(request, SD_APP_OP_COND, ocr, RESPONSE_R3); - } - else - /* reset the card to idle*/ - sd_simple_cmd(request, SD_GO_IDLE_STATE, 0, RESPONSE_NONE); + retval = sd_exec_acmd_buf(request, SD_APP_OP_COND, ocr, + RESPONSE_R3, 0, 0, NULL); + if (retval) + return SD_INIT_FAILED; break; - case SD_APP_OP_COND: retval = sd_unpack_r3(request, &r3); if (retval) - break; + return SD_INIT_FAILED; - DEBUG("sd_init_card_state: read ocr value = 0x%08x", r3.ocr); + DEBUG("read ocr value = 0x%08x", r3.ocr); card.ocr = r3.ocr; + // XXX for SDUC, check that B27+B30 of OCR are set. if(!(r3.ocr & SD_CARD_BUSY || ocr == 0)) { + /* Re-issue AP_OP_COND */ sleep(HZ / 100); - sd_simple_cmd(request, SD_APP_CMD, 0, RESPONSE_R1); + retval = sd_exec_acmd_buf(request, SD_APP_OP_COND, ocr, + RESPONSE_R3, 0, 0, NULL); + if (retval) + return SD_INIT_FAILED; } else { - /* Set the data bus width to 4 bits */ - use_4bit = 1; - sd_simple_cmd(request, SD_ALL_SEND_CID, 0, RESPONSE_R2_CID); + sd_simple_cmd(request, SD_ALL_SEND_CID, 0, RESPONSE_R2); } break; - case SD_ALL_SEND_CID: for(i=0; i<4; i++) card.cid[i] = ((request->response[1+i*4]<<24) | (request->response[2+i*4]<<16) | @@ -1067,16 +1037,16 @@ static int sd_init_card_state(struct sd_request *request) break; case SD_SEND_RELATIVE_ADDR: retval = sd_unpack_r6(request, &r1, &card.rca); - card.rca = card.rca << 16; DEBUG("sd_init_card_state: Get RCA from SD: 0x%04lx Status: %x", card.rca, r1.status); + card.rca = card.rca << 16; if (retval) { - DEBUG("sd_init_card_state: unable to SET_RELATIVE_ADDR error=%d", + logf("sd_init_card_state: unable to SET_RELATIVE_ADDR error=%d", retval); return SD_INIT_FAILED; } - sd_simple_cmd(request, SD_SEND_CSD, card.rca, RESPONSE_R2_CSD); + sd_simple_cmd(request, SD_SEND_CSD, card.rca, RESPONSE_R2); break; case SD_SEND_CSD: @@ -1087,12 +1057,31 @@ static int sd_init_card_state(struct sd_request *request) sd_parse_csd(&card); logf("CSD: %08lx%08lx%08lx%08lx", card.csd[0], card.csd[1], card.csd[2], card.csd[3]); + +#if 0 // XXX SCR is not working yet + retval = sd_exec_acmd_buf(request, SD_SEND_SCR, 0, RESPONSE_R1, + 1, 8, &request->response[5]); + if (!retval) + retval = sd_unpack_r1(request, &r1); + // XXX check retval? + break; + case SD_SEND_SCR: +// if (request->result) +// return SD_INIT_FAILED; + for(i=0; i<2; i++) + card.scr[i] = ((request->buffer[0+i*4]<<24) | (request->buffer[1+i*4]<<16) | + (request->buffer[2+i*4]<< 8) | request->buffer[3+i*4]); + + logf("SCR: %08lx%08lx", card.scr[0], card.scr[1]); + + use_sbc = card.scr[0] & 2; +#endif DEBUG("SD card is ready"); jz_sd_set_clock(SD_CLOCK_FAST); return SD_INIT_PASSED; default: - DEBUG("sd_init_card_state: error! Illegal last cmd %d", request->cmd); + logf("sd_init_card_state: error! Illegal last cmd %d", request->cmd); return SD_INIT_FAILED; } @@ -1107,8 +1096,11 @@ static int sd_switch(struct sd_request *request, int mode, int group, mode = !!mode; value &= 0xF; arg = (mode << 31 | 0x00FFFFFF); - arg &= ~(0xF << (group * 4)); - arg |= value << (group * 4); + if (mode) { + group--; + arg &= ~(0xF << (group * 4)); + arg |= value << (group * 4); + } sd_send_cmd(request, 6, arg, 1, 64, RESPONSE_R1, resp); return 0; @@ -1137,7 +1129,7 @@ static int sd_switch_hs(struct sd_request *request) { unsigned int status[64 / 4]; - sd_switch(request, 1, 0, 1, (unsigned char*) status); + sd_switch(request, 1, 1, 1, (unsigned char*) status); return 0; } @@ -1162,14 +1154,17 @@ static int sd_select_card(void) jz_sd_set_clock(SD_CLOCK_HIGH); } } - num_6 = 3; - sd_simple_cmd(&request, SD_APP_CMD, card.rca, - RESPONSE_R1); - retval = sd_unpack_r1(&request, &r1); - if (retval) - return retval; - sd_simple_cmd(&request, SD_SET_BUS_WIDTH, 2, RESPONSE_R1); - retval = sd_unpack_r1(&request, &r1); + + bool sup_4bit = 1; // XXX check against SCR + + if (sup_4bit) { + retval = sd_exec_acmd(&request, SD_SET_BUS_WIDTH, 2); + if (retval) + return retval; + use_4bit = 2; + DEBUG("Use 4-bit bus width"); + } + retval = sd_exec_acmd(&request, SD_SET_CLR_CARD_DETECT, 0); if (retval) return retval; @@ -1178,6 +1173,11 @@ static int sd_select_card(void) return 0; } +static inline bool card_detect_target(void) +{ + return (jz_sd_chkcard() == 1); +} + static int __sd_init_device(void) { int retval; @@ -1186,13 +1186,15 @@ static int __sd_init_device(void) /* Initialise card data as blank */ memset(&card, 0, sizeof(tCardInfo)); - num_6 = 0; use_4bit = 0; + use_sbc = 0; /* reset mmc/sd controller */ jz_sd_hardware_init(); - sd_simple_cmd(&init_req, SD_CIM_RESET, 0, RESPONSE_NONE); + if (!card_detect_target()) + return 0; + sd_simple_cmd(&init_req, SD_GO_IDLE_STATE, 0, RESPONSE_NONE); sleep(HZ/2); /* Give the card/controller some rest */ @@ -1211,6 +1213,7 @@ int sd_init(void) if(!inited) { // semaphore_init(&sd_wakeup, 1, 0); + //__intc_unmask_irq(IRQ_MSC); mutex_init(&sd_mtx); inited = true; } @@ -1222,11 +1225,6 @@ int sd_init(void) return ret; } -static inline bool card_detect_target(void) -{ - return (jz_sd_chkcard() == 1); -} - tCardInfo* card_get_info_target(int card_no) { (void)card_no; @@ -1247,7 +1245,7 @@ static inline void sd_stop_transfer(void) mutex_unlock(&sd_mtx); } -int sd_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf) +int sd_transfer_sectors(IF_MD(int drive,) sector_t start, int count, void* buf, bool write) { #ifdef HAVE_MULTIDRIVE (void)drive; @@ -1273,26 +1271,35 @@ int sd_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf) if ((retval = sd_unpack_r1(&request, &r1))) goto err; - // XXX 64-bit - if (card.sd2plus) - { - sd_send_cmd(&request, SD_READ_MULTIPLE_BLOCK, start, - count, SD_BLOCK_SIZE, RESPONSE_R1, buf); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; - } - else - { - sd_send_cmd(&request, SD_READ_MULTIPLE_BLOCK, - start * SD_BLOCK_SIZE, count, - SD_BLOCK_SIZE, RESPONSE_R1, buf); + if (use_sbc && count > 1) { + sd_simple_cmd(&request, SD_SET_BLOCK_COUNT, count, RESPONSE_R1); if ((retval = sd_unpack_r1(&request, &r1))) goto err; } - sd_simple_cmd(&request, SD_STOP_TRANSMISSION, 0, RESPONSE_R1B); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; +#ifdef STORAGE_64BIT_SECTOR + // XXX check card[drive].ocr, b27+b30 == 11 + if (card.numblocks > 0xffffffffULL) { + uint32_t upper = start >> 32; + sd_simple_cmd(&request, SD_UC_ADDRESS_EXTENSION, upper, RESPONSE_R1); + if ((retval = sd_unpack_r1(&request, &r1))) + goto err; + } +#endif + + sd_send_cmd(&request, + (count > 1) ? + (write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK) : + (write ? SD_WRITE_BLOCK : SD_READ_SINGLE_BLOCK), + card.sd2plus ? start : (start * SD_BLOCK_SIZE), + count, SD_BLOCK_SIZE, RESPONSE_R1, buf); + retval = sd_unpack_r1(&request, &r1); + + if (retval || (!use_sbc && count > 1)) { + sd_simple_cmd(&request, SD_STOP_TRANSMISSION, 0, RESPONSE_R1B); + if ((retval = sd_unpack_r1(&request, &r1))) + goto err; + } err: last_disk_activity = current_tick; @@ -1301,60 +1308,14 @@ err: return retval; } +int sd_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf) +{ + return sd_transfer_sectors(IF_MD(drive,) start, count, buf, false); +} + int sd_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf) { -#ifdef HAVE_MULTIDRIVE - (void)drive; -#endif - sd_start_transfer(); - - struct sd_request request; - struct sd_response_r1 r1; - int retval = -1; - - if (!card_detect_target() || count == 0 || start > card.numblocks) - goto err; - - if(card.initialized == 0 && !__sd_init_device()) - goto err; - - sd_simple_cmd(&request, SD_SEND_STATUS, card.rca, RESPONSE_R1); - retval = sd_unpack_r1(&request, &r1); - if (retval && (retval != SD_ERROR_STATE_MISMATCH)) - goto err; - - sd_simple_cmd(&request, SD_SET_BLOCKLEN, SD_BLOCK_SIZE, RESPONSE_R1); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; - - // XXX 64-bit - if (card.sd2plus) - { - sd_send_cmd(&request, SD_WRITE_MULTIPLE_BLOCK, start, - count, SD_BLOCK_SIZE, RESPONSE_R1, - (void*)buf); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; - } - else - { - sd_send_cmd(&request, SD_WRITE_MULTIPLE_BLOCK, - start * SD_BLOCK_SIZE, count, - SD_BLOCK_SIZE, RESPONSE_R1, (void*)buf); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; - } - - last_disk_activity = current_tick; - - sd_simple_cmd(&request, SD_STOP_TRANSMISSION, 0, RESPONSE_R1B); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; - -err: - sd_stop_transfer(); - - return retval; + return sd_transfer_sectors(IF_MD(drive,) start, count, (void*)buf, true); } long sd_last_disk_activity(void) diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4760.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4760.c index db09c740cf..4b9e0387b2 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4760.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4760.c @@ -56,7 +56,7 @@ static struct semaphore sd_wakeup[NUM_DRIVES]; #endif static int use_4bit[NUM_DRIVES]; -static int num_6[NUM_DRIVES]; +static int use_sbc[NUM_DRIVES]; //#define DEBUG(x...) logf(x) #define DEBUG(x, ...) @@ -99,6 +99,7 @@ enum sd_result_t SD_ERROR_TIMEOUT, SD_ERROR_CRC, SD_ERROR_DRIVER_FAILURE, + SD_ERROR_ACMD_REJECT, }; /* Standard MMC/SD clock speeds */ @@ -106,10 +107,6 @@ enum sd_result_t #define SD_CLOCK_FAST 24000000 /* 24 MHz for SD Cards */ #define SD_CLOCK_HIGH 48000000 /* 48 MHz for SD Cards */ -/* Extra commands for state control */ -/* Use negative numbers to disambiguate */ -#define SD_CIM_RESET -1 - /* Proprietary commands, illegal/reserved according to SD Specification 2.00 */ /* class 1 */ #define SD_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ @@ -124,19 +121,17 @@ enum sd_result_t /* class 9 */ #define SD_GO_IRQ_STATE 40 /* bcr R5 */ -/* Don't change the order of these; they are used in dispatch tables */ enum sd_rsp_t { RESPONSE_NONE = 0, RESPONSE_R1 = 1, RESPONSE_R1B = 2, - RESPONSE_R2_CID = 3, - RESPONSE_R2_CSD = 4, - RESPONSE_R3 = 5, - RESPONSE_R4 = 6, - RESPONSE_R5 = 7, - RESPONSE_R6 = 8, - RESPONSE_R7 = 9, + RESPONSE_R2 = 3, + RESPONSE_R3 = 4, + RESPONSE_R4 = 5, + RESPONSE_R5 = 6, + RESPONSE_R6 = 7, + RESPONSE_R7 = 8, }; /* These are unpacked versions of the actual responses */ @@ -155,10 +150,9 @@ struct sd_response_r3 struct sd_request { - int index; /* Slot index - used for CS lines */ int cmd; /* Command to send */ unsigned int arg; /* Argument to send */ - enum sd_rsp_t rtype; /* Response type expected */ + enum sd_rsp_t rtype; /* Response type expected */ /* Data transfer (these may be modified at the low level) */ unsigned short nob; /* Number of blocks to transfer*/ @@ -171,16 +165,6 @@ struct sd_request enum sd_result_t result; }; -#define SD_OCR_ARG 0x00ff8000 /* Argument of OCR */ - -/*********************************************************************** - * SD Events - */ -#define SD_EVENT_NONE 0x00 /* No events */ -#define SD_EVENT_RX_DATA_DONE 0x01 /* Rx data done */ -#define SD_EVENT_TX_DATA_DONE 0x02 /* Tx data done */ -#define SD_EVENT_PROG_DONE 0x04 /* Programming is done */ - /************************************************************************** * Utility functions **************************************************************************/ @@ -238,6 +222,9 @@ static int sd_unpack_r6(struct sd_request *request, struct sd_response_r1 *r1, u if (request->result) return request->result; + if (buf[0] != 0x03) + return SD_ERROR_HEADER_MISMATCH; + *rca = PARSE_U16(buf,1); /* Save RCA returned by the SD Card */ *(buf+1) = 0; @@ -282,7 +269,7 @@ static inline int jz_sd_stop_clock(const int drive) timeout--; if (timeout == 0) { - DEBUG("Timeout on stop clock waiting"); + logf("Timeout on stop clock waiting"); return SD_ERROR_TIMEOUT; } udelay(1); @@ -311,7 +298,7 @@ static int jz_sd_check_status(const int drive, struct sd_request *request) /* Checking for response or data timeout */ if (status & (MSC_STAT_TIME_OUT_RES | MSC_STAT_TIME_OUT_READ)) { - DEBUG("SD timeout, MSC_STAT 0x%x CMD %d", status, + logf("%d SD timeout, MSC_STAT 0x%x CMD %d", drive, status, request->cmd); return SD_ERROR_TIMEOUT; } @@ -321,14 +308,14 @@ static int jz_sd_check_status(const int drive, struct sd_request *request) (MSC_STAT_CRC_READ_ERROR | MSC_STAT_CRC_WRITE_ERROR | MSC_STAT_CRC_RES_ERR)) { - DEBUG("SD CRC error, MSC_STAT 0x%x", status); + logf("SD CRC error, MSC_STAT 0x%x", status); return SD_ERROR_CRC; } /* Checking for FIFO empty */ /*if(status & MSC_STAT_DATA_FIFO_EMPTY && request->rtype != RESPONSE_NONE) { - DEBUG("SD FIFO empty, MSC_STAT 0x%x", status); + logf("SD FIFO empty, MSC_STAT 0x%x", status); return SD_ERROR_UNDERRUN; }*/ @@ -350,16 +337,14 @@ static void jz_sd_get_response(const int drive, struct sd_request *request) buf = request->response; request->result = SD_NO_ERROR; - switch (request->rtype) - { + switch (request->rtype) { case RESPONSE_R1: case RESPONSE_R1B: - case RESPONSE_R7: - case RESPONSE_R6: case RESPONSE_R3: case RESPONSE_R4: case RESPONSE_R5: - { + case RESPONSE_R6: + case RESPONSE_R7: data = REG_MSC_RES(MSC_CHN(drive)); buf[0] = (data >> 8) & 0xff; buf[1] = data & 0xff; @@ -369,14 +354,11 @@ static void jz_sd_get_response(const int drive, struct sd_request *request) data = REG_MSC_RES(MSC_CHN(drive)); buf[4] = data & 0xff; - DEBUG("request %d, response [%02x %02x %02x %02x %02x]", + DEBUG("%d request %d, response [%02x %02x %02x %02x %02x]", drive, request->rtype, buf[0], buf[1], buf[2], buf[3], buf[4]); break; - } - case RESPONSE_R2_CID: - case RESPONSE_R2_CSD: - { + case RESPONSE_R2: for (i = 0; i < 16; i += 2) { data = REG_MSC_RES(MSC_CHN(drive)); @@ -385,7 +367,6 @@ static void jz_sd_get_response(const int drive, struct sd_request *request) } DEBUG("request %d, response []", request->rtype); break; - } case RESPONSE_NONE: DEBUG("No response"); break; @@ -413,7 +394,7 @@ static int jz_sd_receive_data(const int drive, struct sd_request *req) #if SD_DMA_ENABLE /* Use DMA if we can */ - if ((int)req->buffer & 0x3 == 0) + if ((int)req->buffer & 0x3 == 0 && req->cnt >= 512) return jz_sd_receive_data_dma(drive, req); #endif @@ -476,7 +457,7 @@ static int jz_sd_transmit_data(const int drive, struct sd_request *req) #if SD_DMA_ENABLE /* Use DMA if we can */ - if ((int)req->buffer & 0x3 == 0) + if ((int)req->buffer & 0x3 == 0 && req->cnt >= 512) return jz_sd_transmit_data_dma(drive, req); #endif @@ -559,6 +540,9 @@ static int jz_sd_receive_data_dma(const int drive, struct sd_request *req) /* clear status and disable channel */ REG_DMAC_DCCSR(DMA_SD_RX_CHANNEL(drive)) = 0; + /* flush dcache again */ + discard_dcache_range(req->buffer, req->cnt); + return SD_NO_ERROR; } @@ -726,50 +710,48 @@ static void jz_sd_set_clock(const int drive, unsigned int rate) ********************************************************************************************************************/ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) { - unsigned int cmdat = 0, events = 0; + unsigned int cmdat = 0; int retval; #if !SD_INTERRUPT long deadline = current_tick + (HZ * 5); #endif + bool has_data = (request->buffer != NULL); /* Indicate we have no result yet */ request->result = SD_NO_RESPONSE; - if (request->cmd == SD_CIM_RESET) { - /* On reset, 1-bit bus width */ - use_4bit[drive] = 0; +#if !SD_AUTO_CLOCK + /* Stop clock when programming things */ + jz_sd_stop_clock(drive); /* stop SD clock */ +#endif - /* On reset, stop SD clock */ - jz_sd_stop_clock(drive); - - /* Reset MMC/SD controller */ - __msc_reset(MSC_CHN(drive)); - - /* Drop SD clock down to lowest speed */ - jz_sd_set_clock(drive, MMC_CLOCK_SLOW); - -#if SD_AUTO_CLOCK - /* Re-enable clocks */ - REG_MSC_STRPCL(MSC_CHN(drive)) = MSC_STRPCL_CLOCK_CONTROL_START; - REG_MSC_LPM(drive) = MSC_SET_LPM; + /* Generic handling for all requests with data rx/tx */ + if (has_data) { + cmdat |= MSC_CMDAT_DATA_EN; +// if (request->nob > 1 && use_sbc[drive]) +// cmdat |= MSC_CMDAT_SEND_AS_STOP; +#if SD_DMA_ENABLE + if (request->cnt >= 512) + cmdat |= MSC_CMDAT_DMA_EN; #endif } /* mask all interrupts and clear status */ SD_IRQ_MASK(MSC_CHN(drive)); - /* open interrupt */ +#if SD_INTERRUPT + /* unmask interrupts we care about */ REG_MSC_IMASK(MSC_CHN(drive)) = ~(MSC_IMASK_END_CMD_RES | MSC_IMASK_DATA_TRAN_DONE | MSC_IMASK_PRG_DONE); +#endif - /* Set command type and events */ + /* Per-command type handling */ switch (request->cmd) { - /* SD core extra command */ - case SD_CIM_RESET: - cmdat |= MSC_CMDAT_INIT; /* Initialization sequence sent prior to command */ - break; /* bc - broadcast - no response */ case SD_GO_IDLE_STATE: + cmdat |= MSC_CMDAT_INIT; /* Initialization sequence sent prior to command */ + /* Intentional Fallthrough */ + case SD_SET_DSR: break; @@ -781,48 +763,11 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) /* adtc - addressed with data transfer */ case SD_SEND_SCR: - /* SD card returns SCR register as data. - SD core expect it in the response buffer, - after normal response. */ - request->buffer = - (unsigned char *) ((unsigned int) request->response + 5); - request->block_len = 8; - request->nob = 1; - /* fallthrough */ case SD_READ_DAT_UNTIL_STOP: case SD_READ_SINGLE_BLOCK: case SD_READ_MULTIPLE_BLOCK: -#if SD_DMA_ENABLE - cmdat |= - MSC_CMDAT_DATA_EN | MSC_CMDAT_READ | MSC_CMDAT_DMA_EN; -#else - cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_READ; -#endif - events = SD_EVENT_RX_DATA_DONE; - break; - case SD_SWITCH_FUNC: - if (request->arg == 0x2) - { - DEBUG("Use 4-bit bus width"); - use_4bit[drive] = 1; - } - else - { - DEBUG("Use 1-bit bus width"); - use_4bit[drive] = 0; - } - if (num_6[drive] < 2) - { -#if SD_DMA_ENABLE - cmdat |= - MSC_CMDAT_DATA_EN | MSC_CMDAT_READ | - MSC_CMDAT_DMA_EN; -#else - cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_READ; -#endif - events = SD_EVENT_RX_DATA_DONE; - } + /* These READ data */ break; case SD_WRITE_DAT_UNTIL_STOP: @@ -830,18 +775,14 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) case SD_WRITE_MULTIPLE_BLOCK: case SD_PROGRAM_CID: case SD_PROGRAM_CSD: -// case SD_LOCK_UNLOCK: -#if SD_DMA_ENABLE - cmdat |= - MSC_CMDAT_DATA_EN | MSC_CMDAT_WRITE | MSC_CMDAT_DMA_EN; -#else - cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_WRITE; -#endif - events = SD_EVENT_TX_DATA_DONE | SD_EVENT_PROG_DONE; + /* These WRITE data */ + cmdat |= MSC_CMDAT_WRITE; break; +// case SD_LOCK_UNLOCK: // can be a read or write, needs busy too. + case SD_STOP_TRANSMISSION: - events = SD_EVENT_PROG_DONE; + // cmdat |= MSC_CMDAT_STOP_ABORT; break; /* ac - no data transfer */ @@ -858,11 +799,9 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) cmdat |= MSC_CMDAT_BUSY; /* FALLTHRU */ case RESPONSE_R1: - case RESPONSE_R7: cmdat |= MSC_CMDAT_RESPONSE_R1; break; - case RESPONSE_R2_CID: - case RESPONSE_R2_CSD: + case RESPONSE_R2: cmdat |= MSC_CMDAT_RESPONSE_R2; break; case RESPONSE_R3: @@ -877,6 +816,9 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) case RESPONSE_R6: cmdat |= MSC_CMDAT_RESPONSE_R6; break; + case RESPONSE_R7: + cmdat |= MSC_CMDAT_RESPONSE_R7; + break; default: break; } @@ -885,23 +827,22 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) if (use_4bit[drive]) cmdat |= MSC_CMDAT_BUS_WIDTH_4BIT; + /* Set block length and nob if there is data */ + if (has_data) { + REG_MSC_BLKLEN(MSC_CHN(drive)) = request->block_len; + REG_MSC_NOB(MSC_CHN(drive)) = request->nob; + } + /* Set command index */ - if (request->cmd == SD_CIM_RESET) - REG_MSC_CMD(MSC_CHN(drive)) = SD_GO_IDLE_STATE; - else - REG_MSC_CMD(MSC_CHN(drive)) = request->cmd; + REG_MSC_CMD(MSC_CHN(drive)) = request->cmd; /* Set argument */ REG_MSC_ARG(MSC_CHN(drive)) = request->arg; - /* Set block length and nob */ - REG_MSC_BLKLEN(MSC_CHN(drive)) = request->block_len; - REG_MSC_NOB(MSC_CHN(drive)) = request->nob; - /* Set command */ REG_MSC_CMDAT(MSC_CHN(drive)) = cmdat; - DEBUG("Send cmd %d cmdat: %x arg: %x resp %d", request->cmd, + DEBUG("%d Send cmd %d cmdat: %x arg: %x resp %d", drive, request->cmd, cmdat, request->arg, request->rtype); /* Start SD clock and send command to card */ @@ -917,11 +858,13 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) return SD_ERROR_TIMEOUT; yield(); } - REG_MSC_IREG(MSC_CHN(drive)) = MSC_IREG_END_CMD_RES; /* clear flag */ #endif /* Check for status */ retval = jz_sd_check_status(drive, request); +#if SD_INTERRUPT + REG_MSC_IREG(MSC_CHN(drive)) = MSC_IREG_END_CMD_RES; /* clear flag */ +#endif if (retval) return retval; @@ -933,18 +876,11 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) jz_sd_get_response(drive, request); /* Start data operation */ - if (events & (SD_EVENT_RX_DATA_DONE | SD_EVENT_TX_DATA_DONE)) - { - if (events & SD_EVENT_RX_DATA_DONE) - { - retval = jz_sd_receive_data(drive, request); - } - if (retval) - return retval; - - if (events & SD_EVENT_TX_DATA_DONE) - { + if (has_data) { + if (cmdat & MSC_CMDAT_WRITE) { retval = jz_sd_transmit_data(drive, request); + } else { + retval = jz_sd_receive_data(drive, request); } if (retval) return retval; @@ -959,8 +895,8 @@ static int jz_sd_exec_cmd(const int drive, struct sd_request *request) #endif } - /* Wait for Prog Done event */ - if (events & SD_EVENT_PROG_DONE) + /* Wait for Prog Done event if necessary */ + if (cmdat & (MSC_CMDAT_BUSY | MSC_CMDAT_WRITE)) { #if SD_INTERRUPT semaphore_wait(&sd_wakeup[drive], HZ * 5); @@ -994,7 +930,7 @@ static int jz_sd_chkcard(const int drive) #if SD_INTERRUPT void MSC2(void) /* SD_SLOT_1 */ { - logf("MSC2 interrupt"); + DEBUG("MSC2 interrupt"); if (REG_MSC_IREG(MSC_CHN(SD_SLOT_1)) & MSC_IREG_END_CMD_RES) { REG_MSC_IREG(MSC_CHN(SD_SLOT_1)) = MSC_IREG_END_CMD_RES; /* clear flag */ @@ -1013,7 +949,7 @@ void MSC2(void) /* SD_SLOT_1 */ /* MSC interrupt handlers */ void MSC1(void) /* SD_SLOT_2 */ { - logf("MSC1 interrupt"); + DEBUG("MSC1 interrupt"); if (REG_MSC_IREG(MSC_CHN(SD_SLOT_2)) & MSC_IREG_END_CMD_RES) { REG_MSC_IREG(MSC_CHN(SD_SLOT_2)) = MSC_IREG_END_CMD_RES; /* clear flag */ semaphore_release(&sd_wakeup[SD_SLOT_2]); @@ -1065,6 +1001,7 @@ static void jz_sd_hardware_init(const int drive) #else jz_sd_stop_clock(drive); /* stop SD clock */ #endif + jz_sd_set_clock(drive, MMC_CLOCK_SLOW); /* Drop to lowest speed */ } static void sd_send_cmd(const int drive, struct sd_request *request, int cmd, unsigned int arg, @@ -1080,10 +1017,12 @@ static void sd_send_cmd(const int drive, struct sd_request *request, int cmd, un request->block_len = block_len; request->buffer = buffer; request->cnt = nob * block_len; + memset(&request->response, 0xa5, sizeof(request->response)); + request->result = SD_NO_RESPONSE; retval = jz_sd_exec_cmd(drive, request); if (retval) - request->result = retval; + request->result = retval; } static void sd_simple_cmd(const int drive, struct sd_request *request, int cmd, unsigned int arg, @@ -1099,14 +1038,36 @@ static int sd_exec_acmd(const int drive, struct sd_request *request, int cmd, un sd_simple_cmd(drive, request, SD_APP_CMD, card[drive].rca, RESPONSE_R1); retval = sd_unpack_r1(request, &r1); + if (retval) + return retval; - if (!retval) - { - sd_simple_cmd(drive, request, cmd, arg, RESPONSE_R1); - retval = sd_unpack_r1(request, &r1); + if (!(r1.status & SD_R1_APP_CMD)) { + logf("ACMD not accepted\n"); + return SD_ERROR_ACMD_REJECT; } - return retval; + sd_simple_cmd(drive, request, cmd, arg, RESPONSE_R1); + return sd_unpack_r1(request, &r1); +} + +static int sd_exec_acmd_buf(const int drive, struct sd_request *request, int cmd, unsigned int arg, enum sd_rsp_t rtype, unsigned short nob, unsigned short block_len, unsigned char *buffer) +{ + struct sd_response_r1 r1; + int retval; + + sd_simple_cmd(drive, request, SD_APP_CMD, card[drive].rca, RESPONSE_R1); + retval = sd_unpack_r1(request, &r1); + if (retval) + return retval; + + if (!(r1.status & SD_R1_APP_CMD)) { + logf("ACMD not accepted\n"); + return SD_ERROR_ACMD_REJECT; + } + + sd_send_cmd(drive, request, cmd, arg, + nob, block_len, rtype, buffer); + return SD_NO_ERROR; } #define SD_INIT_DOING 0 @@ -1116,7 +1077,11 @@ static int sd_init_card_state(const int drive, struct sd_request *request) { struct sd_response_r1 r1; struct sd_response_r3 r3; - int retval, i, ocr = 0x40300000; + int retval, i, ocr = 0x40300000; /* SDXC, 3.2-3.4v */ + +#ifdef HAVE_SDUC + ocr |= 0x08000000; /* Add on SDUC */ +#endif switch (request->cmd) { @@ -1126,36 +1091,37 @@ static int sd_init_card_state(const int drive, struct sd_request *request) case SD_SEND_IF_COND: retval = sd_unpack_r1(request, &r1); - sd_simple_cmd(drive, request, SD_APP_CMD, 0, RESPONSE_R1); - break; +// if (retval) +// return SD_INIT_FAILED; - case SD_APP_CMD: - if (sd_unpack_r1(request, &r1)) + retval = sd_exec_acmd_buf(drive, request, SD_APP_OP_COND, ocr, + RESPONSE_R3, 0, 0, NULL); + if (retval) return SD_INIT_FAILED; - sd_simple_cmd(drive, request, SD_APP_OP_COND, ocr, RESPONSE_R3); break; - case SD_APP_OP_COND: retval = sd_unpack_r3(request, &r3); if (retval) return SD_INIT_FAILED; - DEBUG("sd_init_card_state: read ocr value = 0x%08x", r3.ocr); + DEBUG("%d: read ocr value = 0x%08x", drive, r3.ocr); card[drive].ocr = r3.ocr; + // XXX for SDUC, check that B27+B30 of OCR are set. if(!(r3.ocr & SD_CARD_BUSY || ocr == 0)) { + /* Re-issue AP_OP_COND */ sleep(HZ / 100); - sd_simple_cmd(drive, request, SD_APP_CMD, 0, RESPONSE_R1); + retval = sd_exec_acmd_buf(drive, request, SD_APP_OP_COND, ocr, + RESPONSE_R3, 0, 0, NULL); + if (retval) + return SD_INIT_FAILED; } else { - /* Set the data bus width to 4 bits */ - use_4bit[drive] = 1; - sd_simple_cmd(drive, request, SD_ALL_SEND_CID, 0, RESPONSE_R2_CID); + sd_simple_cmd(drive, request, SD_ALL_SEND_CID, 0, RESPONSE_R2); } break; - case SD_ALL_SEND_CID: if (request->result) return SD_INIT_FAILED; @@ -1164,22 +1130,22 @@ static int sd_init_card_state(const int drive, struct sd_request *request) card[drive].cid[i] = ((request->response[1+i*4]<<24) | (request->response[2+i*4]<<16) | (request->response[3+i*4]<< 8) | request->response[4+i*4]); - logf("CID: %08lx%08lx%08lx%08lx", card[drive].cid[0], card[drive].cid[1], card[drive].cid[2], card[drive].cid[3]); + logf("%d CID: %08lx%08lx%08lx%08lx", drive, card[drive].cid[0], card[drive].cid[1], card[drive].cid[2], card[drive].cid[3]); sd_simple_cmd(drive, request, SD_SEND_RELATIVE_ADDR, 0, RESPONSE_R6); break; case SD_SEND_RELATIVE_ADDR: retval = sd_unpack_r6(request, &r1, &card[drive].rca); - card[drive].rca = card[drive].rca << 16; DEBUG("sd_init_card_state: Get RCA from SD: 0x%04lx Status: %x", card[drive].rca, r1.status); + card[drive].rca = card[drive].rca << 16; if (retval) { - DEBUG("sd_init_card_state: unable to SET_RELATIVE_ADDR error=%d", + logf("sd_init_card_state: unable to SET_RELATIVE_ADDR error=%d", retval); return SD_INIT_FAILED; } - sd_simple_cmd(drive, request, SD_SEND_CSD, card[drive].rca, RESPONSE_R2_CSD); + sd_simple_cmd(drive, request, SD_SEND_CSD, card[drive].rca, RESPONSE_R2); break; case SD_SEND_CSD: @@ -1191,13 +1157,33 @@ static int sd_init_card_state(const int drive, struct sd_request *request) sd_parse_csd(&card[drive]); - logf("CSD: %08lx%08lx%08lx%08lx", card[drive].csd[0], card[drive].csd[1], card[drive].csd[2], card[drive].csd[3]); - DEBUG("SD card is ready"); + logf("%d CSD: %08lx%08lx%08lx%08lx", drive, card[drive].csd[0], card[drive].csd[1], card[drive].csd[2], card[drive].csd[3]); + +#if 0 // XXX SCR is not working yet + retval = sd_exec_acmd_buf(drive, request, SD_SEND_SCR, 0, + RESPONSE_R1, + 1, 8, &request->response[5]); + if (!retval) + retval = sd_unpack_r1(request, &r1); + // XXX check retval? + break; + case SD_SEND_SCR: +// if (request->result) +// return SD_INIT_FAILED; + for(i=0; i<2; i++) + card[drive].scr[i] = ((request->buffer[0+i*4]<<24) | (request->buffer[1+i*4]<<16) | + (request->buffer[2+i*4]<< 8) | request->buffer[3+i*4]); + + DEBUG("%d SCR: %08lx%08lx", drive, card[drive].scr[0], card[drive].scr[1]); + + use_sbc[drive] = card[drive].scr[0] & 2; +#endif + + logf("SD card %d is ready", drive); jz_sd_set_clock(drive, SD_CLOCK_FAST); return SD_INIT_PASSED; - default: - DEBUG("sd_init_card_state: error! Illegal last cmd %d", request->cmd); + logf("sd_init_card_state: error! Illegal last cmd %d", request->cmd); return SD_INIT_FAILED; } @@ -1212,8 +1198,11 @@ static int sd_switch(const int drive, struct sd_request *request, int mode, int mode = !!mode; value &= 0xF; arg = (mode << 31 | 0x00FFFFFF); - arg &= ~(0xF << (group * 4)); - arg |= value << (group * 4); + if (mode) { + group--; + arg &= ~(0xF << (group * 4)); + arg |= value << (group * 4); + } sd_send_cmd(drive, request, SD_SWITCH_FUNC, arg, 1, 64, RESPONSE_R1, resp); return 0; @@ -1242,7 +1231,7 @@ static int sd_switch_hs(const int drive, struct sd_request *request) { unsigned int status[64 / 4]; - sd_switch(drive, request, 1, 0, 1, (unsigned char*) status); + sd_switch(drive, request, 1, 1, 1, (unsigned char*) status); return 0; } @@ -1267,10 +1256,16 @@ static int sd_select_card(const int drive) jz_sd_set_clock(drive, SD_CLOCK_HIGH); } } - num_6[drive] = 3; - retval = sd_exec_acmd(drive, &request, SD_SET_BUS_WIDTH, 2); - if (retval) - return retval; + + bool sup_4bit = 1; // XXX check against SCR + + if (sup_4bit) { + retval = sd_exec_acmd(drive, &request, SD_SET_BUS_WIDTH, 2); + if (retval) + return retval; + use_4bit[drive] = 2; + DEBUG("Use 4-bit bus width"); + } retval = sd_exec_acmd(drive, &request, SD_SET_CLR_CARD_DETECT, 0); if (retval) return retval; @@ -1280,6 +1275,11 @@ static int sd_select_card(const int drive) return 0; } +static inline bool card_detect_target(const int drive) +{ + return (jz_sd_chkcard(drive) == 1); +} + static int __sd_init_device(const int drive) { int retval = 0; @@ -1289,14 +1289,17 @@ static int __sd_init_device(const int drive) /* Initialise card data as blank */ memset(&card[drive], 0, sizeof(tCardInfo)); - num_6[drive] = 0; use_4bit[drive] = 0; + use_sbc[drive] = 0; active[drive] = 0; /* reset mmc/sd controller */ jz_sd_hardware_init(drive); - sd_simple_cmd(drive, &init_req, SD_CIM_RESET, 0, RESPONSE_NONE); + /* Don't bother if card isn't present */ + if (!card_detect_target(drive)) + return 0; + sd_simple_cmd(drive, &init_req, SD_GO_IDLE_STATE, 0, RESPONSE_NONE); sleep(HZ/2); /* Give the card/controller some rest */ @@ -1364,11 +1367,6 @@ int sd_init(void) return 0; } -static inline bool card_detect_target(const int drive) -{ - return (jz_sd_chkcard(drive) == 1); -} - tCardInfo* card_get_info_target(const int drive) { return &card[drive]; @@ -1423,18 +1421,31 @@ int sd_transfer_sectors(IF_MD(const int drive,) sector_t start, int count, void* if ((retval = sd_unpack_r1(&request, &r1))) goto err; - // XXX 64-bit + if (use_sbc[drive] && count > 1) { + sd_simple_cmd(drive, &request, SD_SET_BLOCK_COUNT, count, RESPONSE_R1); + if ((retval = sd_unpack_r1(&request, &r1))) + goto err; + } + +#ifdef STORAGE_64BIT_SECTOR + // XXX check card[drive].ocr, b27+b30 == 11 + if (card[drive].numblocks > 0xffffffffULL) { + uint32_t upper = start >> 32; + sd_simple_cmd(drive, &request, SD_UC_ADDRESS_EXTENSION, upper, RESPONSE_R1); + if ((retval = sd_unpack_r1(&request, &r1))) + goto err; + } +#endif + sd_send_cmd(drive, &request, (count > 1) ? (write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK) : (write ? SD_WRITE_BLOCK : SD_READ_SINGLE_BLOCK), card[drive].sd2plus ? start : (start * SD_BLOCK_SIZE), count, SD_BLOCK_SIZE, RESPONSE_R1, buf); - if ((retval = sd_unpack_r1(&request, &r1))) - goto err; + retval = sd_unpack_r1(&request, &r1); - if (count > 1) - { + if (retval || (!use_sbc[drive] && count > 1)) { sd_simple_cmd(drive, &request, SD_STOP_TRANSMISSION, 0, RESPONSE_R1B); retval = sd_unpack_r1(&request, &r1); if (!write && retval == SD_ERROR_OUT_OF_RANGE) diff --git a/firmware/target/mips/ingenic_x1000/app.lds b/firmware/target/mips/ingenic_x1000/app.lds index a1e84fb9cf..1df0295d63 100644 --- a/firmware/target/mips/ingenic_x1000/app.lds +++ b/firmware/target/mips/ingenic_x1000/app.lds @@ -71,11 +71,11 @@ SECTIONS * The following sections are loaded after normal DRAM sections * but are copied elsewhere by the startup code. */ - _noloaddram = .; + _noloaddram = ALIGN(4); .iram : { - _iramstart = .; + _iramstart = ALIGN(4); . = 0x000; /* TLB refill */ KEEP(*(.vectors.1)); . = 0x100; /* Cache error */ @@ -89,24 +89,24 @@ SECTIONS *(.icode*); *(.irodata); *(.idata); - _iramend = .; + _iramend = ALIGN(4); } > IRAM AT> DRAM _iramcopy = LOADADDR(.iram); .tcsm : { - _tcsmstart = .; + _tcsmstart = ALIGN(4); KEEP(*(.tcsm*)); - _tcsmend = .; + _tcsmend = ALIGN(4); } > TCSM AT> DRAM _tcsmcopy = LOADADDR(.tcsm); #ifdef HAVE_INIT_ATTR .init : { - _initstart = .; + _initstart = ALIGN(4); *(.init*); - _initend = .; + _initend = ALIGN(4); } > INIT AT> DRAM _initcopy = LOADADDR(.init); #endif @@ -117,22 +117,22 @@ SECTIONS .stack (NOLOAD) : { *(.stack); - stackbegin = .; + stackbegin = ALIGN(4); . += X1000_STACKSIZE; - stackend = .; - _irqstackbegin = .; + stackend = ALIGN(4); + _irqstackbegin = ALIGN(4); . += X1000_IRQSTACKSIZE; - _irqstackend = .; + _irqstackend = ALIGN(4); } > IRAM .bss _noloaddram (NOLOAD) : { - _bssbegin = .; + _bssbegin = ALIGN(4); *(.sbss*); *(.bss*); *(COMMON); *(.scommon*); - _bssend = .; + _bssend = ALIGN(4); _end = .; } > DRAM diff --git a/firmware/target/mips/ingenic_x1000/msc-x1000.h b/firmware/target/mips/ingenic_x1000/msc-x1000.h index 3ebdd3adc3..119b754358 100644 --- a/firmware/target/mips/ingenic_x1000/msc-x1000.h +++ b/firmware/target/mips/ingenic_x1000/msc-x1000.h @@ -48,6 +48,7 @@ #define MSC_DF_READY (1 << 1) #define MSC_DF_HCS_CARD (1 << 2) #define MSC_DF_V2_CARD (1 << 3) +#define MSC_DF_HAS_SBC (1 << 4) /* Request status codes */ #define MSC_REQ_SUCCESS 0 diff --git a/firmware/target/mips/ingenic_x1000/nand-x1000.c b/firmware/target/mips/ingenic_x1000/nand-x1000.c index 7c5547f947..e3175ca0d9 100644 --- a/firmware/target/mips/ingenic_x1000/nand-x1000.c +++ b/firmware/target/mips/ingenic_x1000/nand-x1000.c @@ -61,13 +61,13 @@ static const struct nand_chip chip_w25n01gvxx = { TSH(11), TSETUP(0), THOLD(0), STA_TYPE_V(1BYTE), CMD_TYPE_V(8BITS), SMP_DELAY(1)), - .flags = NAND_CHIPFLAG_ON_DIE_ECC, - /* TODO: quad mode? */ + .flags = NAND_CHIPFLAG_QUAD | NAND_CHIPFLAG_HAS_QE_BIT | + NAND_CHIPFLAG_ON_DIE_ECC, .cmd_page_read = NANDCMD_PAGE_READ, .cmd_program_execute = NANDCMD_PROGRAM_EXECUTE, .cmd_block_erase = NANDCMD_BLOCK_ERASE, - .cmd_read_cache = NANDCMD_READ_CACHE_SLOW, - .cmd_program_load = NANDCMD_PROGRAM_LOAD, + .cmd_read_cache = NANDCMD_READ_CACHE_x4, + .cmd_program_load = NANDCMD_PROGRAM_LOAD_x4, .setup_chip = winbond_setup_chip, }; @@ -99,7 +99,7 @@ static const struct nand_chip chip_xt26g01cwsiga = { .oob_size = 128, .nr_blocks = 1024, .bbm_pos = 2048, - .clock_freq = 150000000, + .clock_freq = 104000000, .dev_conf = jz_orf(SFC_DEV_CONF, CE_DL(1), HOLD_DL(1), WP_DL(1), CPHA(0), CPOL(0), diff --git a/firmware/target/mips/ingenic_x1000/nand-x1000.h b/firmware/target/mips/ingenic_x1000/nand-x1000.h index 0ccd075079..f2e5ffa478 100644 --- a/firmware/target/mips/ingenic_x1000/nand-x1000.h +++ b/firmware/target/mips/ingenic_x1000/nand-x1000.h @@ -36,7 +36,7 @@ /* keep max page size in sync with the NAND chip table in the .c file */ #define NAND_DRV_SCRATCHSIZE 32 -#define NAND_DRV_MAXPAGESIZE 2112 +#define NAND_DRV_MAXPAGESIZE (2048+128) /* Quad I/O support bit */ #define NAND_CHIPFLAG_QUAD 0x0001 diff --git a/firmware/target/mips/ingenic_x1000/sd-x1000.c b/firmware/target/mips/ingenic_x1000/sd-x1000.c index c1aec59aa3..f7313cebfa 100644 --- a/firmware/target/mips/ingenic_x1000/sd-x1000.c +++ b/firmware/target/mips/ingenic_x1000/sd-x1000.c @@ -19,6 +19,7 @@ * ****************************************************************************/ +#include "system.h" #include "storage.h" #include "sdmmc.h" #include "sd.h" @@ -32,6 +33,25 @@ static msc_drv* sd_to_msc[MSC_COUNT]; static long _sd_last_disk_activity = 0; +static void sd_probe_set_block_count(msc_drv* d) +{ + uint8_t scr[CACHEALIGN_SIZE] CACHEALIGN_ATTR; + msc_req req = {0}; + req.command = SD_SEND_SCR; + req.resptype = MSC_RESP_R1; + req.flags = MSC_RF_DATA; + req.data = scr; + req.nr_blocks = 1; + req.block_len = 8; + + if(msc_app_cmd_exec(d, &req) == MSC_REQ_SUCCESS) { + if(scr[3] & 0x02) + d->driver_flags |= MSC_DF_HAS_SBC; + else + d->driver_flags &= ~MSC_DF_HAS_SBC; + } +} + static int sd_init_card(msc_drv* d) { int s; @@ -45,6 +65,7 @@ static int sd_init_card(msc_drv* d) if(s = msc_cmd_set_clr_card_detect(d, 0)) return -170 - s; if(s = msc_cmd_set_bus_width(d, 4)) return -180 - s; if(s = msc_cmd_switch_freq(d)) return -190 - s; + sd_probe_set_block_count(d); d->driver_flags |= MSC_DF_READY; d->cardinfo.initialized = 1; return 0; @@ -92,19 +113,35 @@ static int sd_transfer(msc_drv* d, bool write, if(status = msc_cmd_set_block_len(d, SD_BLOCK_SIZE)) goto _exit; - /* TODO - look into using CMD23 to improve transfer performance. - * This specifies the number of blocks ahead of time, instead of - * relying on CMD12 to stop transmission. CMD12 is still needed - * in the event of errors though. - */ + bool use_sbc = false; + if(xfer_count > 1 && (d->driver_flags & MSC_DF_HAS_SBC)) { + msc_req sbc_req = {0}; + sbc_req.command = 23; /* CMD23: SET_BLOCK_COUNT (SBC) */ + sbc_req.argument = xfer_count; + sbc_req.resptype = MSC_RESP_R1; + status = msc_cmd_exec(d, &sbc_req); + if(status == MSC_REQ_SUCCESS) { + use_sbc = true; + } else if(status == MSC_REQ_CARD_ERR && + (sbc_req.response[0] & SD_R1_ILLEGAL_COMMAND)) { + d->driver_flags &= ~MSC_DF_HAS_SBC; + } else { + goto _exit; + } + } + msc_req req = {0}; req.data = buf; req.nr_blocks = xfer_count; req.block_len = SD_BLOCK_SIZE; req.resptype = MSC_RESP_R1; req.flags = MSC_RF_DATA; - if(xfer_count > 1) - req.flags |= MSC_RF_AUTO_CMD12; + if(xfer_count > 1) { + if(use_sbc) + req.flags |= MSC_RF_ERR_CMD12; + else + req.flags |= MSC_RF_AUTO_CMD12; + } if(write) { req.command = xfer_count == 1 ? SD_WRITE_BLOCK : SD_WRITE_MULTIPLE_BLOCK; diff --git a/firmware/target/mips/ingenic_x1000/sfc-x1000.h b/firmware/target/mips/ingenic_x1000/sfc-x1000.h index afb4aa3ce6..92430880be 100644 --- a/firmware/target/mips/ingenic_x1000/sfc-x1000.h +++ b/firmware/target/mips/ingenic_x1000/sfc-x1000.h @@ -36,9 +36,10 @@ #define SFC_TMODE_1_1_2 1 #define SFC_TMODE_1_2_2 2 #define SFC_TMODE_2_2_2 3 -#define SFC_TMODE_1_1_4 4 -#define SFC_TMODE_1_4_4 5 -#define SFC_TMODE_4_4_4 6 +#define SFC_TMODE_RESERVED 4 // See 10.7.3.6 SFC Transfer Configure Register MODE Field +#define SFC_TMODE_1_1_4 5 +#define SFC_TMODE_1_4_4 6 +#define SFC_TMODE_4_4_4 7 /* Phase format * _____________________ diff --git a/firmware/usb.c b/firmware/usb.c index c088db4ef1..2645d3b290 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -705,33 +705,7 @@ void usb_acknowledge(long id, intptr_t seqnum) { queue_post(&usb_queue, id, seqnum); } -#else /* !USB_FULL_INIT */ -/* TODO: All of this can go away once usb_core.c is no longer built - with BOOTLOADER && !HAVE_USB_BOOTLOADER_MODE */ -#ifdef HAVE_USBSTACK -void usb_signal_transfer_completion( - struct usb_transfer_completion_event_data* event_data) -{ - (void)event_data; -} -#endif -void usb_clear_pending_transfer_completion_events(void) -{ -} -void usb_release_exclusive_storage(void) -{ -} -void usb_signal_notify(long id, intptr_t data) -{ - (void)id; - (void)data; -} -void usb_acknowledge(long id, intptr_t seqnum) -{ - (void)id; - (void)seqnum; -} -#endif /* !USB_FULL_INIT */ +#endif /* USB_FULL_INIT */ void usb_init(void) { @@ -877,6 +851,7 @@ void usb_request_exclusive_storage(void) void usb_release_exclusive_storage(void) { + int bccount; if(!exclusive_storage_requested) { return; } @@ -887,10 +862,12 @@ void usb_release_exclusive_storage(void) } exclusive_storage_enabled = false; -#ifdef DEBUG /* Tell all threads that we are back in business */ - int bccount = queue_broadcast(SYS_USB_DISCONNECTED, 0) - 1; + bccount = queue_broadcast(SYS_USB_DISCONNECTED, 0) - 1; +#ifdef DEBUG DEBUGF("USB extracted. Broadcast to %d threads...\n", bccount); +#else + (void)bccount; #endif return; } diff --git a/gdb/Makefile b/gdb/Makefile deleted file mode 100644 index 0a52e8b5b0..0000000000 --- a/gdb/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# __________ __ ___. -# Open \______ \ ____ ____ | | _\_ |__ _______ ___ -# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -# \/ \/ \/ \/ \/ -# $Id$ -# - -ifeq ($(MODELNAME),EXAMPLE) - -INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \ - -I$(BUILDDIR) - -DEPFILE = $(OBJDIR)/dep-stub -LDS := linker.cfg - -SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) -DIRS = . - -ifdef APPEXTRA - DIRS += $(subst :, ,$(APPEXTRA)) - INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA))) -endif - -ifndef VERSION -VERSION=$(shell date +%y%m%d-%H%M) -endif - -CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \ - $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} - -OBJS := $(SRC:%.c=$(OBJDIR)/%.o) -SOURCES = $(SRC) -LINKFILE = $(OBJDIR)/linkage.lds - -LIBROCKBOX = $(BUILDDIR)/librockbox.a - -all: $(BUILDDIR)/$(BINARY) $(FLASHFILE) - -dep: $(DEPFILE) - -$(LINKFILE): $(LDS) - $(call PRINTS,Build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ - -$(OBJDIR)/stub.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) - $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/stub.map - -$(OBJDIR)/stub.bin : $(OBJDIR)/stub.elf - $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ - -$(BUILDDIR)/$(BINARY) : $(OBJDIR)/stub.bin - $(call PRINTS,Build stub file)$(MKFIRMWARE) $< $@ - -include $(TOOLSDIR)/make.inc - -clean: - $(call PRINTS,cleaning stub)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) \ - $(OBJDIR)/stub.bin $(OBJDIR)/stub.elf $(OBJDIR)/*.map \ - $(LINKFILE) $(DEPFILE) - --include $(DEPFILE) - -endif diff --git a/gdb/README b/gdb/README deleted file mode 100644 index e61c930ea8..0000000000 --- a/gdb/README +++ /dev/null @@ -1,95 +0,0 @@ --------------------------------------------------------------------- - __________ __ ___. - Open \______ \ ____ ____ | | _\_ |__ _______ ___ - Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - \/ \/ \/ \/ \/ - $Id$ - - Copyright (C) 2002 by Linus Nielsen Feltzing - --------------------------------------------------------------------- - -Debugging the Archos Jukebox ----------------------------- - -To debug using the serial port on the Jukebox, you need to do the following: - -1) Connect the serial port to the PC. This is best done with the "serial - port mod" described on the home page, along with a serial port converter - for the 3V signals from the Jukebox. - -2) Build or download a GDB SH1 cross debugger - -3) Compile the GDB stub from the CVS "gdb" archive - For Player models, just type: - # make - - For Recorder, type - #make RECORDER=1 - -4) Copy the newly built ARCHOS.MOD to the Jukebox. - -5) Start the Jukebox and fire up the GDB with the elf file you want to debug - as an argument along with the baud rate: - - For Player: - # sh-elf-gdb -b 38400 test.elf - - For Recorder: - # sh-elf-gdb -b 115200 test.elf - -6) In GDB, type: - - (gdb) target remote /dev/ttyS0 - - /dev/ttyS0 is the serial port you want to use. I guess Windows users - would type COM1 or something like that. - - GDB should answer with a message like: - - Remote debugging using /dev/ttyS0 - 0x090014b6 in ?? () - (gdb) - -7) Load the code from the elf file you specified on the command line: - - (gdb) load - - GDB should answer like this: - - Loading section .text, size 0x6b00 lma 0x9018000 - Loading section .data, size 0x738 lma 0x901eb00 - Start address 0x9018290, load size 29240 - Transfer rate: 11696 bits/sec, 102 bytes/write. - (gdb) - -8) You're set. Now try to set a breakpoint and run: - - (gdb) b main - Breakpoint 1 at 0x9011b2a: file main.c, line 192. - (gdb) c - Continuing. - - Breakpoint 1, main () at main.c:192 - 192 app_main(); - (gdb) - - Good luck! - - -Technical details: - - As for now, the GDB stub occupies the memory from 0x900000 up to - 0x9018000. - - Compile and link your test program at 0x9018000 and up, and it will work. - - The baud rate is 38400 for Player, 115200 for Recorder, and the settings - are 8N1. - - Note that you may have to change the ATA I/O address in the ATA_CONTROL - macro in sh-stub.c. go to Menu->Debug (keep out)->View HW info to find out. - - Linus Nielsen Feltzing diff --git a/gdb/SOURCES b/gdb/SOURCES deleted file mode 100644 index 9668d12dc8..0000000000 --- a/gdb/SOURCES +++ /dev/null @@ -1,3 +0,0 @@ -#ifdef CPU_ARM -arm-stub.c -#endif diff --git a/gdb/arm-stub.c b/gdb/arm-stub.c deleted file mode 100644 index 3a6076ebfe..0000000000 --- a/gdb/arm-stub.c +++ /dev/null @@ -1,716 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2006 by Tomasz Malesinski - * - * 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 -#include -#include "sscanf.h" -#include "gdb_api.h" - -#define BUFMAX 1024 - -#define VEC_UND 1 -#define VEC_SWI 2 -#define VEC_PABT 3 -#define VEC_DABT 4 - -static char packet_buf[BUFMAX]; -static char reply_buf[BUFMAX]; - -static const char hexchars[] = "0123456789abcdef"; -static int gdb_exception_no, gdb_mem_access; -static unsigned char watchdog_enabled; -static unsigned long registers[17]; - -void gdb_api_breakpoint(void); -static void gdb_api_log(char *msg); - -__attribute__((section(".gdbapi"))) struct gdb_api gdb_api = -{ - GDB_API_MAGIC, - {gdb_api_breakpoint, gdb_api_log} -}; - -static void watchdog_enable(int on) -{ - (*(volatile unsigned long *)0x80002804) = on; - watchdog_enabled = on; -} - -static void watchdog_service(void) -{ - if (watchdog_enabled) - { - (*(volatile unsigned long *)0x80002804) = 0; - (*(volatile unsigned long *)0x80002808) = 0; - (*(volatile unsigned long *)0x80002804) = 1; - } -} - -static inline bool isxdigit(char c) -{ - return ((c >= '0') && (c <= '9')) - || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F')); -} - -static int hex(char ch) { - if ((ch >= 'a') && (ch <= 'f')) - return ch - 'a' + 10; - if ((ch >= '0') && (ch <= '9')) - return ch - '0'; - if ((ch >= 'A') && (ch <= 'F')) - return ch - 'A' + 10; - return -1; -} - -static void hex_byte(char *s, int byte) { - s[0] = hexchars[(byte >> 4) & 0xf]; - s[1] = hexchars[byte & 0xf]; -} - -static void hex_word(char *s, unsigned long val) { - int i; - for (i = 0; i < 4; i++) - hex_byte(s + i * 2, (val >> (i * 8)) & 0xff); -} - -static void hex_string(char *d, char *s) { - while (*s) { - hex_byte(d, *s++); - d += 2; - } - *d = 0; -} - -static int get_hex_byte(char *s) { - return (hex(s[0]) << 4) + hex(s[1]); -} - -static unsigned long get_hex_word(char *s) { - int i; - unsigned long r = 0; - for (i = 3; i >= 0; i--) - r = (r << 8) + get_hex_byte(s + i * 2); - return r; -} - -static void reply_error(int n, char *reply) { - reply[0] = 'E'; - hex_byte(reply + 1, n); - reply[3] = 0; -} - -static void reply_signal(int n, char *reply) { - int signal; - reply[0] = 'S'; - switch (n) - { - case VEC_UND: - signal = 4; - break; - case VEC_PABT: - case VEC_DABT: - signal = 7; - break; - default: - signal = 5; - break; - } - hex_byte(reply + 1, signal); - reply[3] = 0; -} - -static void reply_ok(char *reply) { - strcpy(reply, "OK"); -} - -static int get_byte(void) { - int b; - while ((b = usb_serial_try_get_byte()) < 0) - watchdog_service(); - watchdog_service(); - return b; -} - -static void put_byte(unsigned char ch) { - while (usb_serial_try_put_byte(ch) < 0) - watchdog_service(); - watchdog_service(); -} - -static void serial_write(unsigned char *buf, int len) { - int i; - for (i = 0; i < len; i++) - put_byte(buf[i]); -} - -static void get_packet(char *buf, int len) { - int count, checksum, escaped; - int ch; - - while (1) { - do { - ch = get_byte(); - } while (ch != '$'); - - checksum = 0; - count = 0; - escaped = 0; - while (count < len) { - ch = get_byte(); - if (!escaped) { - if (ch == '$') { - checksum = 0; - count = 0; - } else if (ch == '#') - break; - else if (ch == 0x7d) { - escaped = 1; - checksum += ch; - } else { - checksum += ch; - buf[count] = ch; - count++; - } - } else { - escaped = 0; - checksum += ch; - buf[count] = ch ^ 0x20; - count++; - } - } - buf[count] = 0; - - if (ch == '#') { - int rchksum; - - ch = get_byte(); - rchksum = hex(ch) << 4; - ch = get_byte(); - rchksum += hex(ch); - - if ((checksum & 0xff) != rchksum) - put_byte('-'); - else { - put_byte('+'); - return; - } - } - } -} - -static void put_packet(char *buf) { - int i, checksum; - int ch; - char tmp[3]; - - do { - put_byte('$'); - - checksum = 0; - for (i = 0; buf[i]; i++) - checksum += buf[i]; - - serial_write(buf, i); - - tmp[0] = '#'; - hex_byte(tmp + 1, checksum & 0xff); - serial_write(tmp, 3); - - ch = get_byte(); - - } while (ch != '+'); -} - -static inline unsigned long get_general_reg(int n) -{ - return registers[n + 1]; -} - -static inline void set_general_reg(int n, unsigned long v) -{ - registers[n + 1] = v; -} - -static inline unsigned long get_cpsr(void) -{ - return registers[0]; -} - -static inline void set_cpsr(unsigned long v) -{ - registers[0] = v; -} - -static void g_reply(char *buf) { - int i; - char *p; - - p = buf; - for (i = 0; i < 16; i++) { - hex_word(p, get_general_reg(i)); - p += 8; - } - - for (i = 0; i < 8; i++) { - memset(p, '0', 16); - p += 16; - } - - hex_word(p, 0); - p += 8; - hex_word(p, get_cpsr()); - p[8] = 0; -} - -static void cmd_get_register(char *args, char *reply) { - int r; - - if (sscanf(args, "%x", &r) != 1) { - reply_error(0, reply); - return; - } - - if (r >= 0 && r < 16) { - hex_word(reply, get_general_reg(r)); - reply[8] = 0; - } else if (r == 25) { - hex_word(reply, get_cpsr()); - reply[8] = 0; - } else { - hex_word(reply, 0); - reply[8] = 0; - } -} - -static void cmd_set_register(char *args, char *reply) { - int r, p; - unsigned long v; - - p = -1; - sscanf(args, "%x=%n", &r, &p); - if (p == -1) { - reply_error(0, reply); - return; - } - - v = get_hex_word(args + p); - if (r >= 0 && r < 16) - set_general_reg(r, v); - else if (r == 25) - set_cpsr(v); - reply_ok(reply); -} - -static void cmd_set_registers(char *args, char *reply) { - char *p; - int i, len; - - len = strlen(args); - - p = args; - for (i = 0; i < 16 && len >= (i + 1) * 8; i++) { - set_general_reg(i, get_hex_word(p)); - p += 8; - } - - if (len >= 16 * 8 + 8 * 16 + 2 * 8) - { - p += 8 * 16 + 8; - set_cpsr(get_hex_word(p)); - } - - reply_ok(reply); -} - -static void cmd_get_memory(char *args, char *reply) { - unsigned long addr, len, i; - - if (sscanf(args, "%lx,%lx", &addr, &len) != 2) { - reply_error(0, reply); - return; - } - - if (len > (BUFMAX - 16) / 2) { - reply_error(1, reply); - return; - } - - gdb_mem_access = 1; - for (i = 0; i < len; i++) - hex_byte(reply + i * 2, *((unsigned char *)(addr + i))); - gdb_mem_access = 0; - - reply[len * 2] = 0; -} - -static void cmd_put_memory(char *args, char *reply) { - unsigned long addr, len, i; - int pos; - - pos = -1; - sscanf(args, "%lx,%lx:%n", &addr, &len, &pos); - if (pos == -1) { - reply_error(0, reply); - return; - } - - gdb_mem_access = 1; - for (i = 0; i < len; i++) - *((unsigned char *)(addr + i)) = get_hex_byte(args + pos + i * 2); - gdb_mem_access = 0; - - reply_ok(reply); -} - -static void cmd_put_memory_binary(char *args, char *reply) { - unsigned long addr, len, i; - int pos; - - pos = -1; - sscanf(args, "%lx,%lx:%n", &addr, &len, &pos); - if (pos == -1) { - reply_error(0, reply); - return; - } - - gdb_mem_access = 1; - for (i = 0; i < len; i++) - *((unsigned char *)(addr + i)) = args[pos + i]; - gdb_mem_access = 0; - - reply_ok(reply); -} - -static void parse_continue_args(char *args) { - int sig; - unsigned long addr; - - if (sscanf(args, "%x;%lx", &sig, &addr) == 2) { - set_general_reg(15, addr); - } else if (sscanf(args, "%lx", &addr) == 1) { - set_general_reg(15, addr); - } -} - -static void cmd_go(char *args) { - parse_continue_args(args); - - asm volatile( - " mov r1, %0\n" - " ldr r12, [r1], #4\n" - " mov r0, r12\n" - " and r0, r0, #0x1f\n" - " cmp r0, #0x10\n" - " bne 1f\n" - " ldr r14, [r1, #60]\n" - " msr spsr_fsxc, r12\n" - " ldmia r1, {r0-r14}^\n" - " movs r15, r14\n" - "1:\n" - " msr cpsr_fsxc, r12\n" - " ldmia r1, {r0-r15}\n" - : : "r" (registers)); -} - -static void remote_cmd(char *cmd, char *reply) { - int i, err; - i = 0; - err = 0; - while ((cmd[i] >= 'a' && cmd[i] <= 'z') || cmd[i] == '_') - i++; - if (!strncmp(cmd, "reboot", i)) - { - reply_ok(reply); - put_packet(reply); - watchdog_enable(1); - (*(volatile unsigned long *)0x80002804) = 1; - while (1); - } - else if (!strncmp(cmd, "power_off", i)) - { - reply_ok(reply); - put_packet(reply); - GPIO1_CLR = 1 << 16; - GPIO2_SET = 1; - while (1); - } - else if (!strncmp(cmd, "watchdog", i)) - { - int t; - if (sscanf(cmd + i, "%d", &t) == 1) - watchdog_enable(t != 0); - else - err = 1; - reply_ok(reply); - } - else - hex_string(reply, "Unrecognized command\n"); - if (err) - reply_error(err, reply); -} - -static void cmd_query(char *args, char *reply) { - if (!strncmp(args, "Rcmd,", 5)) { - unsigned i = 0; - char *s = args + 5; - char cmd[200]; - while (isxdigit(s[0]) && isxdigit(s[1]) && i < sizeof(cmd) - 1) { - cmd[i++] = get_hex_byte(s); - s += 2; - } - cmd[i] = 0; - remote_cmd(cmd, reply); - } else - reply[0] = 0; -} - -void gdb_loop(void) { - int no_reply; - - gdb_mem_access = 0; - - while (1) { - get_packet(packet_buf, sizeof(packet_buf) - 1); - - no_reply = 0; - switch (packet_buf[0]) { - case '?': - reply_signal(gdb_exception_no, reply_buf); - break; - - case 'p': - cmd_get_register(packet_buf + 1, reply_buf); - break; - - case 'P': - cmd_set_register(packet_buf + 1, reply_buf); - break; - - case 'g': - g_reply(reply_buf); - break; - - case 'G': - cmd_set_registers(packet_buf + 1, reply_buf); - break; - - case 'm': - cmd_get_memory(packet_buf + 1, reply_buf); - break; - - case 'M': - cmd_put_memory(packet_buf + 1, reply_buf); - break; - - case 'X': - cmd_put_memory_binary(packet_buf + 1, reply_buf); - break; - - case 'q': - cmd_query(packet_buf + 1, reply_buf); - break; - - case 'c': - cmd_go(packet_buf + 1); - reply_error(1, reply_buf); - break; - -/* case 's': */ -/* cmd_go(packet_buf + 1); */ -/* break; */ - - default: - reply_buf[0] = 0; - } - - if (!no_reply) - put_packet(reply_buf); - } -} - -extern void *vectors[]; - -static void gdb_set_vector(int n, void *p) -{ - vectors[n] = p; -} - -void gdb_und_exc(void); -void gdb_swi_exc(void); -void gdb_pabt_exc(void); -void gdb_dabt_exc(void); - -static void gdb_set_vectors(void) -{ - gdb_set_vector(VEC_UND, gdb_und_exc); - gdb_set_vector(VEC_SWI, gdb_swi_exc); - gdb_set_vector(VEC_PABT, gdb_pabt_exc); - gdb_set_vector(VEC_DABT, gdb_dabt_exc); -} - -void gdb_loop_from_exc(void) -{ - if (gdb_mem_access) - reply_error(1, reply_buf); - else - reply_signal(gdb_exception_no, reply_buf); - put_packet(reply_buf); - gdb_loop(); -} - -#define IRQ_REG(reg) (*(volatile unsigned long *)(0x80300000 + (reg))) - -static inline unsigned long irq_read(int reg) -{ - unsigned long v, v2; - do - { - v = IRQ_REG(reg); - v2 = IRQ_REG(reg); - } while (v != v2); - return v; -} - -#define IRQ_WRITE_WAIT(reg, val, cond) \ - do { unsigned long v, v2; \ - do { \ - IRQ_REG(reg) = (val); \ - v = IRQ_REG(reg); \ - v2 = IRQ_REG(reg); \ - } while ((v != v2) || !(cond)); \ - } while (0); - -void fiq(void) -{ -} - -static void system_init(void) -{ - int i; - - watchdog_enable(0); - - for (i = 0; i < 0x1c; i++) - { - IRQ_WRITE_WAIT(0x404 + i * 4, 0x1e000001, (v & 0x3010f) == 1); - IRQ_WRITE_WAIT(0x404 + i * 4, 0x4000000, (v & 0x10000) == 0); - IRQ_WRITE_WAIT(0x404 + i * 4, 0x10000001, (v & 0xf) == 1); - } - - GPIO3_CLR = 1; -} - -static void gdb_api_log(char *msg) -{ - int i; - - reply_buf[0] = 'O'; - i = 1; - while (*msg && i + 2 <= BUFMAX - 1) - { - hex_byte(reply_buf + i, *msg++); - i += 2; - } - reply_buf[i] = 0; - put_packet(reply_buf); -} - -void main(void) -{ - system_init(); - usb_serial_init(); - gdb_mem_access = 0; - gdb_set_vectors(); - gdb_api_breakpoint(); - while (1); -} - -#define str(s) #s -#define xstr(s) str(s) - -asm (".text\n" - "gdb_und_exc:\n" - " ldr sp, =_stub_stack\n" - " sub r14, r14, #4\n" - " stmfd sp!, {r0-r3, r12, r14}\n" - " mov r0, #" xstr(VEC_UND) "\n" - " b gdb_handle_exception\n" - "gdb_swi_exc:\n" - " ldr sp, =_stub_stack\n" - " stmfd sp!, {r0-r3, r12, r14}\n" - " mov r0, #" xstr(VEC_SWI) "\n" - " b gdb_handle_exception\n" - "gdb_pabt_exc:\n" - " ldr sp, =_stub_stack\n" - " stmfd sp!, {r0-r3, r12, r14}\n" - " mov r0, #" xstr(VEC_PABT) "\n" - " b gdb_handle_exception\n" - "gdb_dabt_exc:\n" - " ldr sp, =_stub_stack\n" - " sub r14, r14, #4\n" - " stmfd sp!, {r0-r3, r12, r14}\n" - " ldr r0, =gdb_mem_access\n" - " ldr r0, [r0]\n" - " tst r0, r0\n" - " bne gdb_data_abort\n" - " mov r0, #" xstr(VEC_DABT) "\n" - " b gdb_handle_exception\n" - "gdb_handle_exception:\n" - " ldr r1, =gdb_exception_no\n" - " str r0, [r1]\n" - " ldr r0, =registers\n" - " mrs r12, spsr\n" - " str r12, [r0], #4\n" - " ldmfd sp!, {r2, r3}\n" - " stmia r0!, {r2, r3}\n" - " ldmfd sp!, {r2, r3, r12, r14}\n" - " str r14, [r0, #52]\n" - " stmia r0!, {r2-r12}\n" - " mrs r1, spsr\n" - " and r2, r1, #0x1f\n" - " cmp r2, #0x10\n" - " bne 1f\n" - " stmia r0, {r13, r14}^\n" - " b gdb_data_abort\n" - "1:\n" - " msr cpsr_c, r1\n" - " stmia r0, {r13, r14}\n" - "gdb_data_abort:\n" - " msr cpsr_c, #0xd3\n" - " ldr sp, =_stub_stack\n" - " b gdb_loop_from_exc\n" - "gdb_api_breakpoint:\n" - " stmfd sp!, {r0-r1}\n" - " ldr r0, =registers\n" - " mrs r1, cpsr\n" - " str r1, [r0], #4\n" - " ldmfd sp!, {r1}\n" - " str r1, [r0], #4\n" - " ldmfd sp!, {r1}\n" - " str r1, [r0], #4\n" - " stmia r0!, {r2-r14}\n" - " str r14, [r0]\n" - " msr cpsr_c, #0xd3\n" - " ldr sp, =_stub_stack\n" - " ldr r0, =gdb_exception_no\n" - " mov r1, #5\n" - " str r1, [r0]\n" - " b gdb_loop_from_exc\n"); diff --git a/gdb/linker.cfg b/gdb/linker.cfg deleted file mode 100644 index 053323b9d4..0000000000 --- a/gdb/linker.cfg +++ /dev/null @@ -1,95 +0,0 @@ -#include "config.h" - -#ifdef CPU_ARM -ENTRY(start) -STARTUP(crt0.o) -OUTPUT_FORMAT(elf32-littlearm) -#else -#error "Unsupported CPU!" -#endif - -#ifdef EXAMPLE -MEMORY -{ - IRAM : ORIGIN = 0, LENGTH = 0x10000 - DRAM : ORIGIN = 0xc00000, LENGTH = 0x6000 - DRAM_API : ORIGIN = 0xc06000, LENGTH = 0x100 -} - -SECTIONS -{ - .text : - { - *(.init*) - *(.text) - *(.text*) - *(.rodata) - *(.rodata*) - *(.glue_7) - *(.glue_7t) - } >DRAM - - .gdbapi : - { - *(.gdbapi) - } >DRAM_API - - .data : - { - *(.data) - } >DRAM - - .vectors : - { - _vectorsstart = .; - *(.vectors) - _vectorsend = .; - } >IRAM AT>DRAM - _vectorscopy = LOADADDR(.vectors); - - .stack (NOLOAD) : - { - stackbegin = .; - . += 0x400; - _stub_stack = .; - . += 0x200; - stackend = .; - } >DRAM - - .bss (NOLOAD) : - { - _edata = .; - *(.bss) - _end = .; - } >DRAM -} -#else - -SECTIONS -{ - .vectors 0x09000000 : - { - *(.vectors); - . = ALIGN(0x200); - start.o(.text) - *(.rodata) - } - - .text : - { - *(.text) - } - - .bss : - { - _stack = . + 0x1000; - _stub_stack = _stack + 0x1000; - } - - .pad 0x0900C800 : - { - LONG(0); - } -} - -#endif diff --git a/gdb/setjmp.S b/gdb/setjmp.S deleted file mode 100644 index 89ad16f0f9..0000000000 --- a/gdb/setjmp.S +++ /dev/null @@ -1,61 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Red Hat Inc - * - * 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. - * - ****************************************************************************/ - .type _setjmp,@function - .global _setjmp -_setjmp: - add #(9*4),r4 - - sts.l pr,@-r4 - - mov.l r15,@-r4 - mov.l r14,@-r4 - mov.l r13,@-r4 - mov.l r12,@-r4 - - mov.l r11,@-r4 - mov.l r10,@-r4 - mov.l r9,@-r4 - mov.l r8,@-r4 - - rts - mov #0,r0 - - .type _longjmp,@function - .global _longjmp -_longjmp: - mov.l @r4+,r8 - mov.l @r4+,r9 - mov.l @r4+,r10 - mov.l @r4+,r11 - - mov.l @r4+,r12 - mov.l @r4+,r13 - mov.l @r4+,r14 - mov.l @r4+,r15 - - lds.l @r4+,pr - - mov r5,r0 - tst r0,r0 - bf retr4 - movt r0 -retr4: rts - nop diff --git a/lib/rbcodec/codecs/codecs.make b/lib/rbcodec/codecs/codecs.make index 6d790f5d9a..6f20a8c101 100644 --- a/lib/rbcodec/codecs/codecs.make +++ b/lib/rbcodec/codecs/codecs.make @@ -245,4 +245,4 @@ $(CODECDIR)/%.codec: $(CODECDIR)/%.o $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(CODECLDFLAGS) - $(SILENT)$(call objcopy,$(CODECDIR)/$*.elf,$@) + $(SILENT)$(call objcopy_plugin,$(CODECDIR)/$*.elf,$@) diff --git a/lib/rbcodec/codecs/libwma/wmadata.h b/lib/rbcodec/codecs/libwma/wmadata.h old mode 100755 new mode 100644 diff --git a/lib/rbcodec/codecs/libwma/wmadeci.c b/lib/rbcodec/codecs/libwma/wmadeci.c old mode 100755 new mode 100644 diff --git a/lib/rbcodec/codecs/libwmapro/quant.h b/lib/rbcodec/codecs/libwmapro/quant.h old mode 100755 new mode 100644 diff --git a/lib/rbcodec/codecs/libwmapro/wmaprodec.c b/lib/rbcodec/codecs/libwmapro/wmaprodec.c old mode 100755 new mode 100644 diff --git a/manual/getting_started/hibyos_nativeinstall.tex b/manual/getting_started/hibyos_nativeinstall.tex index bd311444f6..197733c1dc 100644 --- a/manual/getting_started/hibyos_nativeinstall.tex +++ b/manual/getting_started/hibyos_nativeinstall.tex @@ -59,7 +59,7 @@ may not be the most up to date, please see the wiki page at \hfill{} \begin{itemize} \item Aigo Eros Q V2.2 - \item Hifiwalker H2 V1.9 - V2.0 + \item Hifiwalker H2 V1.9 - V2.3 \item Surfans F20 V3.4 \end{itemize} These players use \fname{erosqnative-hw4-erosq\_2024.upt} as the update file. diff --git a/manual/plugins/xworld.tex b/manual/plugins/xworld.tex index 36585615db..29e97e4f99 100644 --- a/manual/plugins/xworld.tex +++ b/manual/plugins/xworld.tex @@ -49,12 +49,12 @@ Additionally, ``extra'' data files that modify the in-game strings and font can \opt{SAMSUNG_YH92X_PAD}{\ButtonFF} \opt{IRIVER_H300_PAD,SANSA_E200_PAD,SAMSUNG_YH820_PAD,IAUDIO_X5M5_PAD}{\ButtonRec} \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD,CREATIVE_ZEN_PAD,SANSA_CLIP_PAD}{\ButtonSelect} - \opt{SONY_NWZ_PAD,CREATIVEZVM_PAD}{\ButtonPlay} + \opt{SONY_NWZ_PAD}{\ButtonPlay} \opt{ONDAVX777_PAD,MROBE500_PAD,PBELL_VIBE500_PAD}{\ButtonPower} \opt{SAMSUNG_YPR0_PAD}{\ButtonUser} \opt{IRIVER_H10_PAD}{\ButtonRew} \opt{HM801_PAD}{\ButtonPrev} - \opt{SONY_NWZ_PAD,CREATIVEZVM_PAD}{\ButtonPlay} + \opt{SONY_NWZ_PAD}{\ButtonPlay} \opt{MROBE500_PAD}{\ButtonPower} \opt{DX50_PAD,ONDAVX747_PAD,PHILIPS_HDD1630_PAD,PHILIPS_HDD6330_PAD,PHILIPS_SA9200_PAD% ,CREATIVE_ZENXFI2_PAD,CREATIVE_ZENXFI3_PAD,SANSA_CONNECT_PAD,SANSA_C200_PAD% @@ -73,7 +73,7 @@ Additionally, ``extra'' data files that modify the in-game strings and font can \opt{SAMSUNG_YH820_PAD,IAUDIO_X5M5_PAD}{\ButtonPlay} \opt{SANSA_E200_PAD,SANSA_CLIP_PAD}{\ButtonPower} \opt{CREATIVE_ZEN_PAD,SONY_NWZ_PAD}{\ButtonBack} - \opt{CREATIVEZVM_PAD,SAMSUNG_YPR0_PAD}{\ButtonMenu} + \opt{SAMSUNG_YPR0_PAD}{\ButtonMenu} \opt{IRIVER_H300_PAD}{\ButtonMode} \opt{HM801_PAD}{\ButtonNext} \opt{PBELL_VIBE500_PAD}{\ButtonRec} diff --git a/manual/rockbox_interface/images/mini2440-front.svg b/manual/rockbox_interface/images/mini2440-front.svg deleted file mode 100644 index 12aa85ab4c..0000000000 --- a/manual/rockbox_interface/images/mini2440-front.svg +++ /dev/null @@ -1,1466 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/manual/rockbox_interface/images/zenvision-front.pdf b/manual/rockbox_interface/images/zenvision-front.pdf deleted file mode 100644 index 386fa7ac5a..0000000000 Binary files a/manual/rockbox_interface/images/zenvision-front.pdf and /dev/null differ diff --git a/manual/rockbox_interface/images/zenvision-front.png b/manual/rockbox_interface/images/zenvision-front.png deleted file mode 100644 index 5b35fd01f1..0000000000 Binary files a/manual/rockbox_interface/images/zenvision-front.png and /dev/null differ diff --git a/manual/rockbox_interface/images/zenvision-front.svg b/manual/rockbox_interface/images/zenvision-front.svg deleted file mode 100644 index 9d86fafe91..0000000000 --- a/manual/rockbox_interface/images/zenvision-front.svg +++ /dev/null @@ -1,4979 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Menu - - Back - - Play - - Down - - Select - - Left - - Right - - Up - - Power - Vol -/+ - Hold - Next - - Prev - - - - - diff --git a/manual/rockbox_interface/images/zenvisionm-front.pdf b/manual/rockbox_interface/images/zenvisionm-front.pdf deleted file mode 100644 index db4d73032e..0000000000 Binary files a/manual/rockbox_interface/images/zenvisionm-front.pdf and /dev/null differ diff --git a/manual/rockbox_interface/images/zenvisionm-front.png b/manual/rockbox_interface/images/zenvisionm-front.png deleted file mode 100644 index 778ef7a3b7..0000000000 Binary files a/manual/rockbox_interface/images/zenvisionm-front.png and /dev/null differ diff --git a/manual/rockbox_interface/images/zenvisionm-front.svg b/manual/rockbox_interface/images/zenvisionm-front.svg deleted file mode 100644 index 9218ad2417..0000000000 --- a/manual/rockbox_interface/images/zenvisionm-front.svg +++ /dev/null @@ -1,1368 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Menu - Left - Right - Down - Up - Power - Play - Shortcut - Back - - - - - - - - - Hold - - - - - - - - - - - - - - - - - - diff --git a/tools/builds.pm b/tools/builds.pm index e2af574df4..1a283dd9b1 100644 --- a/tools/builds.pm +++ b/tools/builds.pm @@ -199,26 +199,6 @@ $releasenotes="/wiki/ReleaseNotes400"; name => 'iriver H320/340', status => 3, }, - 'lyreproto1' => { - name => 'Lyre Prototype 1', - status => 1, - }, - 'mini2440' => { - name => 'Mini 2440', - status => 1, - }, - 'meizum3' => { - name => 'Meizu M3', - status => 1, - }, - 'meizum6sl' => { - name => 'Meizu M6SL', - status => 1, - }, - 'meizum6sp' => { - name => 'Meizu M6SP', - status => 1, - }, 'mrobe100' => { name => 'Olympus M-Robe 100', status => 3, @@ -276,10 +256,6 @@ $releasenotes="/wiki/ReleaseNotes400"; sim => 0, status => 2, }, - 'samsungyps3' => { - name => 'Samsung YP-S3', - status => 1, - }, 'sansac200' => { name => 'SanDisk Sansa c200', status => 3, @@ -338,29 +314,10 @@ $releasenotes="/wiki/ReleaseNotes400"; status => 1, sim => 1, }, - 'sansaview' => { - name => 'SanDisk Sansa View', - status => 1, - }, 'vibe500' => { name => 'Packard Bell Vibe 500', status => 3, }, - 'zenvision' => { - name => 'Creative Zen Vision', - status => 1, - sim => 1, - }, - 'zenvisionm30gb' => { - name => 'Creative Zen Vision:M 30GB', - status => 1, - sim => 1, - }, - 'zenvisionm60gb' => { - name => 'Creative Zen Vision:M 60GB', - status => 1, - sim => 1, - }, 'mpiohd200' => { name => 'MPIO HD200', status => 2, diff --git a/tools/configure b/tools/configure index 5d1cd44791..b68709b90a 100755 --- a/tools/configure +++ b/tools/configure @@ -566,13 +566,6 @@ arm9tdmicc () { endian="little" } -arm940tbecc () { - findarmgcc - GCCOPTS="$CCOPTS -mbig-endian -mcpu=arm940t" - GCCOPTIMIZE="-fomit-frame-pointer" - endian="big" -} - arm940tcc () { findarmgcc GCCOPTS="$CCOPTS -mcpu=arm940t" @@ -1564,6 +1557,7 @@ ARG_THREAD_SUPPORT= ARG_32BIT= ARG_ADDR_SAN= ARG_UBSAN= +ARG_PLUGINS= err= for arg in "$@"; do case "$arg" in @@ -1580,6 +1574,7 @@ for arg in "$@"; do --ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;; --type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;; --voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;; + --plugins=*) ARG_PLUGINS=`echo "$arg" | cut -d = -f 2`;; --thumb) ARG_ARM_THUMB=1;; --no-thumb) ARG_ARM_THUMB=0;; --32-bit) ARG_32BIT=1;; @@ -1694,53 +1689,47 @@ cat < Makefile <&2' ERR + ################################################################################ ### init ################################################################################ diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh index e06b3afbef..8b8d4d204a 100755 --- a/tools/rockboxdev.sh +++ b/tools/rockboxdev.sh @@ -391,15 +391,22 @@ buildtool () { cflags='-U_FORTIFY_SOURCE -fgnu89-inline -O2' if [ "$tool" == "glibc" ]; then cflags="$cflags -fcommon" # glibc < 2.30 needs -fcommon for gcc10+ - elif [ "$tool" == "glib" ]; then - run_cmd "$logfile" $SED -i -e 's/m4_copy/m4_copy_force/g' "$cfg_dir/m4macros/glib-gettext.m4" - run_cmd "$logfile" autoreconf -fiv "$cfg_dir" + elif [ "$tool" == "glib" ]; then + # glib < 2.47.5 requires this hack on newer systems to fix legacy python related build failure + # Note: autoreconf call adds dependency on gtk-doc-tools + if version_lt "$version" "2.47.5"; then + run_cmd "$logfile" $SED -i -e 's/m4_copy/m4_copy_force/g' "$cfg_dir/m4macros/glib-gettext.m4" + run_cmd "$logfile" $SED -i 's/tests//' "$cfg_dir/gio/Makefile.am" + run_cmd "$logfile" autoreconf -fiv "$cfg_dir" + config_opt="$config_opt --disable-gtk-doc" + fi + cflags="$cflags -Wno-format-nonliteral -Wno-format-overflow" fi # NOTE glibc requires to be compiled with optimization CFLAGS="$cflags" CXXFLAGS="$CXXFLAGS" run_cmd "$logfile" \ "$cfg_dir/configure" "--prefix=$prefix" \ - --disable-docs $config_opt + --disable-docs --disable-tests $config_opt fi if [ "$make_opts" != "NO_MAKE" ]; then diff --git a/tools/sapi_voice.vbs b/tools/sapi_voice.vbs index c6c2c69372..515252f8b3 100644 --- a/tools/sapi_voice.vbs +++ b/tools/sapi_voice.vbs @@ -392,6 +392,8 @@ Function LangIDs(ByRef sLanguage) LangIDs = Array(&h41f) Case "ukrainian" LangIDs = Array(&h422) + Case "vietnamese" + LangIDs = Array(&h42a) Case "wallisertitsch" LangIDs = Array(&h807) ' Swiss German Case "walon" diff --git a/tools/scramble.c b/tools/scramble.c index 45cf92dc16..2ec8cfb7b5 100644 --- a/tools/scramble.c +++ b/tools/scramble.c @@ -85,8 +85,7 @@ void usage(void) "\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-creative=X [-no-ciff] Creative firmware structure format\n" - "\t (X values: zvm, zvm60, zenvision, zenv, zen,\n" - "\t zenxfi, zenmozaic)\n"); + "\t (X values: zenv, zen, zenxfi, zenmozaic)\n"); printf("\t-gigabeat Toshiba Gigabeat F/X format\n" "\t-gigabeats Toshiba Gigabeat S format\n" "\t-mi4v2 PortalPlayer .mi4 format (revision 010201)\n" @@ -416,13 +415,7 @@ int main (int argc, char** argv) iname = argv[2]; oname = argv[3]; } - if(!strcmp(&argv[1][10], "zvm")) - return zvm_encode(iname, oname, ZENVISIONM, creative_enable_ciff); - else if(!strcmp(&argv[1][10], "zvm60")) - return zvm_encode(iname, oname, ZENVISIONM60, creative_enable_ciff); - else if(!strcmp(&argv[1][10], "zenvision")) - return zvm_encode(iname, oname, ZENVISION, creative_enable_ciff); - else if(!strcmp(&argv[1][10], "zenv")) + if(!strcmp(&argv[1][10], "zenv")) return zvm_encode(iname, oname, ZENV, creative_enable_ciff); else if(!strcmp(&argv[1][10], "zen")) return zvm_encode(iname, oname, ZEN, creative_enable_ciff); diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index 3c7a602298..4efbdee874 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES @@ -31,12 +31,6 @@ mrobe500.c mrobe100.c #elif CONFIG_KEYPAD == COWON_D2_PAD cowon-d2.c -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -creative-zvm.c -#elif CONFIG_KEYPAD == CREATIVEZV_PAD -creative-zv.c -#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD -meizu-m6sl.c #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD gogear-sa9200.c #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 55e5b7991f..31f142f913 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -84,6 +84,40 @@ if(APPLE) endif() +find_package(QuaZip-Qt${QT_VERSION_MAJOR} QUIET) +if(QuaZip-Qt${QT_VERSION_MAJOR}_FOUND) + message("-- Found QuaZip") + set(QUAZIP_LIBRARY QuaZip::QuaZip) +else() + message("-- QuaZip not found, building our own") + # TODO: Upstream has cmake support, use that instead. + add_library(quazip + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/ioapi.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/minizip_crypt.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/qioapi.cpp + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazip.cpp + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazipfile.cpp + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazipfile.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazipfileinfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazipfileinfo.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazip_global.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazip.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazipnewinfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/quazipnewinfo.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/unzip.c + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/unzip.h + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/zip.c + ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip/zip.h) + target_include_directories(quazip PUBLIC ${CMAKE_CURRENT_LIST_DIR}/rbutilqt/quazip) + target_link_libraries(quazip z Qt${QT_VERSION_MAJOR}::Core) + if(QT_VERSION_MAJOR EQUAL 6) + target_link_libraries(quazip Qt${QT_VERSION_MAJOR}::Core5Compat) + endif() + target_compile_definitions(quazip PUBLIC QUAZIP_STATIC) + set_property(TARGET quazip PROPERTY AUTOMOC ON) + set(QUAZIP_LIBRARY quazip) +endif() + add_executable(ipodpatcher-bin ipodpatcher/main.c ipodpatcher/ipodpatcher-aupd.c @@ -392,4 +426,3 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/deploy.cmake) include(${CMAKE_CURRENT_LIST_DIR}/cmake/QtTest.cmake) add_subdirectory(rbutilqt) add_subdirectory(themeeditor) - diff --git a/utils/cmake/QtTest.cmake b/utils/cmake/QtTest.cmake old mode 100755 new mode 100644 diff --git a/utils/cmake/QtTestAddTests.cmake b/utils/cmake/QtTestAddTests.cmake old mode 100755 new mode 100644 diff --git a/utils/meizu_dfu/Makefile b/utils/meizu_dfu/Makefile deleted file mode 100644 index fdd765daa1..0000000000 --- a/utils/meizu_dfu/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -CFLAGS = -W -Wall -LDFLAGS = -lusb - -all: meizu_dfu - -meizu_dfu: meizu_dfu.c - -.PHONY: clean -clean: - rm -f meizu_dfu - diff --git a/utils/meizu_dfu/README b/utils/meizu_dfu/README deleted file mode 100644 index c96870b369..0000000000 --- a/utils/meizu_dfu/README +++ /dev/null @@ -1,9 +0,0 @@ -Meizu DFU tool for Linux - -This tool can restore the firmware on M3, M6 SP, M6 TP and M6 SL. -It can also run a single provided file from RAM. - -Notes: -1. SST39VF800.dfu is taken from the official dfu tool provided by Meizu. -2. updateNAND_BE_070831.dfu is taken from the unofficial dfu tool for M6 SL. -3. To compile, just run `make'. diff --git a/utils/meizu_dfu/meizu_dfu.c b/utils/meizu_dfu/meizu_dfu.c deleted file mode 100644 index 36f38478bc..0000000000 --- a/utils/meizu_dfu/meizu_dfu.c +++ /dev/null @@ -1,441 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by William Poetra Yoga Hadisoeseno and Frank Gevaerts - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define bswap_16(value) \ - ((((value) & 0xff) << 8) | ((value) >> 8)) - -#define bswap_32(value) \ - (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ - (uint32_t)bswap_16((uint16_t)((value) >> 16))) - -#define host_to_le32(_x) bswap_32(htonl(_x)) -#define host_to_le16(_x) bswap_16(htons(_x)) - -void usage() -{ - fprintf(stderr, "usage: meizu_dfu m3 [SST39VF800.dfu] \n"); - fprintf(stderr, " meizu_dfu m6 [SST39VF800.dfu] \n"); - fprintf(stderr, " meizu_dfu m6sl [updateNAND_BE_070831.dfu] \n"); - exit(1); -} - -uint32_t crc32(char *data, int len, uint32_t poly, uint32_t init) -{ - uint32_t crc_table[256]; - uint32_t crc, t; - int i, j; - - // generate the table - for (i = 0; i < 256; ++i) { - t = i; - for (j = 0; j < 8; ++j) - if (t & 1) - t = (t >> 1) ^ poly; - else - t >>= 1; - crc_table[i] = t; - } - - // calculate the crc - crc = init; - for (i = 0; i < len; ++i) - crc = (crc >> 8) ^ crc_table[(crc^data[i]) & 0xff]; - - return crc; -} - -typedef struct { - char *name; - char *data; - int len; -} image_data_t; - -typedef struct { - int delay; - int pre_off; - uint32_t pre_sig; - uint16_t suf_dev; - uint16_t suf_prod; - uint16_t suf_ven; - uint16_t suf_dfu; - char suf_sig[3]; - uint8_t suf_len; -} image_attr_t; - -#define BLOCK_SIZE 2048 -#define DFU_TIMEOUT 0xa000 -#define DFU_CRC_POLY 0xedb88320 -#define DFU_INIT_CRC 0xffffffff - -#define USB_VID_SAMSUNG 0x0419 -#define USB_PID_M6SL 0x0145 -#define USB_PID_M3_M6 0x0141 - -void init_img(image_data_t *img, const char *filename, image_attr_t *attr) -{ - int fd, len, i, readlen; - struct stat statbuf; - char buf[BLOCK_SIZE]; - uint32_t dfu_crc; - uint32_t le_len; - - printf("Reading %s...", filename); - - if (stat(filename, &statbuf) < 0) { - printf("\nCould not stat file, exiting.\n"); - exit(1); - } - len = statbuf.st_size; - - img->name = basename(strdup(filename)); - img->data = malloc(len + 16); - img->len = len + 16; - - fd = open(filename, O_RDONLY); - for (i = 0; i < len; i += BLOCK_SIZE) { - readlen = ((len - i) < BLOCK_SIZE) ? (len - i) : BLOCK_SIZE; - read(fd, buf, readlen); - memcpy(img->data + i, buf, readlen); - } - close(fd); - - le_len = host_to_le32(img->len); - // patch the data size in after the signature - memcpy(img->data + attr->pre_off + 4, &le_len, 4); - - /* convert to little endian */ - attr->suf_dev = host_to_le16(attr->suf_dev); - attr->suf_prod = host_to_le16(attr->suf_prod); - attr->suf_ven = host_to_le16(attr->suf_ven); - attr->suf_dfu = host_to_le16(attr->suf_dfu); - - // append the suffix (excluding the checksum) - memcpy(img->data + len, &attr->suf_dev, 2); - memcpy(img->data + len + 2, &attr->suf_prod, 2); - memcpy(img->data + len + 4, &attr->suf_ven, 2); - memcpy(img->data + len + 6, &attr->suf_dfu, 2); - memcpy(img->data + len + 8, &attr->suf_sig, 3); - memcpy(img->data + len + 11, &attr->suf_len, 1); - - dfu_crc = host_to_le32(crc32(img->data, len + 12, DFU_CRC_POLY, DFU_INIT_CRC)); - memcpy(img->data + len + 12, &dfu_crc, 4); - -#if 0 - FILE *f = fopen(img->name, "w"); - fwrite(img->data, len + 16, 1, f); - fclose(f); -#endif - - printf("OK\n"); -} - -usb_dev_handle *usb_dev_open(uint16_t dfu_vid, uint16_t dfu_pid) -{ - struct usb_bus *bus; - struct usb_device *dev; - usb_dev_handle *device; - - printf("USB initialization..."); - - usb_init(); - usb_find_busses(); - usb_find_devices(); - - for (bus = usb_get_busses(); bus != NULL; bus = bus->next) - for (dev = bus->devices; dev != NULL; dev = dev->next) - if (dev->descriptor.idVendor == dfu_vid - && dev->descriptor.idProduct == dfu_pid) - goto found; - - printf("\nNo device found, exiting.\n"); - exit(1); - -found: - printf(" Device found.\n"); - device = usb_open(dev); - usb_claim_interface(device, 0); - return device; -} - -void usb_mimic_windows(usb_dev_handle *device) -{ - char data[1024]; - - usb_control_msg(device, 0x80, 0x06, 0x0100, 0x0000, data, 0x0012, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0200, 0x0000, data, 0x0009, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0200, 0x0000, data, 0x001b, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0100, 0x0000, data, 0x0040, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0100, 0x0000, data, 0x0012, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0200, 0x0000, data, 0x0009, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0300, 0x0000, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0303, 0x0409, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0200, 0x0000, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0300, 0x0000, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0302, 0x0409, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0300, 0x0000, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0302, 0x0409, data, 0x00ff, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0100, 0x0000, data, 0x0012, DFU_TIMEOUT); - usb_control_msg(device, 0x80, 0x06, 0x0200, 0x0000, data, 0x0209, DFU_TIMEOUT); -} - -void usb_dev_close(usb_dev_handle *device) -{ - printf("Releasing interface..."); - - usb_release_interface(device, 0); - - printf(" OK\n"); -} - -enum DFU_REQUEST { - DFU_DETACH = 0, - DFU_DOWNLOAD, - DFU_UPLOAD, - DFU_GETSTATUS, - DFU_CLRSTATUS, - DFU_GETSTATE, - DFU_ABORT -}; - -void get_cpu(usb_dev_handle *device) -{ - char data[64]; - int req_out_if = USB_ENDPOINT_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE; - int len; - - printf("GET CPU"); - - // check for "S5L8700 Rev.1" - len = usb_control_msg(device, req_out_if, 0xff, 0x0002, 0, data, 0x003f, DFU_TIMEOUT); - if (len < 0) { - printf("\nError trying to get CPU model, exiting.\n"); - exit(1); - } - - memset(data + len, 0, 64 - len); - printf(", got: %s\n", data); -} - -void send_file(usb_dev_handle *device, image_data_t *img) -{ - char dfu_ret[6]; - char *data; - int req_out_if = USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE; - int req_in_if = USB_ENDPOINT_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE; - int len, idx, writelen, i; - - printf("Sending %s... ", img->name); - - len = img->len; - data = img->data; - - // loop for the file - for (i = 0, idx = 0; i < len; i += BLOCK_SIZE, ++idx) { - writelen = ((len - i) < BLOCK_SIZE) ? (len - i) : BLOCK_SIZE; - usb_control_msg(device, req_out_if, DFU_DOWNLOAD, idx, 0, data + i, writelen, DFU_TIMEOUT); - dfu_ret[4] = 0x00; - while (dfu_ret[4] != 0x05) - usb_control_msg(device, req_in_if, DFU_GETSTATUS, 0, 0, dfu_ret, 6, DFU_TIMEOUT); - printf("#"); - } - - usb_control_msg(device, req_out_if, DFU_DOWNLOAD, idx, 0, NULL, 0, DFU_TIMEOUT); - dfu_ret[4] = 0x00; - while (dfu_ret[4] != 0x07) - usb_control_msg(device, req_in_if, DFU_GETSTATUS, 0, 0, dfu_ret, 6, DFU_TIMEOUT); - - printf(" OK\n"); -} - -void clear_status(usb_dev_handle *device) -{ - char dfu_ret[6]; - int usb_in_if = USB_ENDPOINT_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE; - int usb_out_if = USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE; - - printf("Clearing status..."); - - dfu_ret[4] = 0x00; - while (dfu_ret[4] != 0x08) - usb_control_msg(device, usb_in_if, DFU_GETSTATUS, 0, 0, dfu_ret, 6, DFU_TIMEOUT); - usb_control_msg(device, usb_out_if, DFU_CLRSTATUS, 0, 0, NULL, 0, DFU_TIMEOUT); - - printf(" OK\n"); -} - -void dfu_detach(usb_dev_handle *device) -{ - char usb_ret[4]; - int usb_in_oth = USB_ENDPOINT_IN | USB_TYPE_CLASS | USB_RECIP_OTHER; - int usb_out_oth = USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_OTHER; - - printf("Detaching..."); - - usb_control_msg(device, usb_in_oth, DFU_DETACH, 0x0000, 3, usb_ret, 4, DFU_TIMEOUT); - usb_control_msg(device, usb_out_oth, DFU_DOWNLOAD, 0x0010, 3, NULL, 0, DFU_TIMEOUT); - usb_control_msg(device, usb_in_oth, DFU_DETACH, 0x0000, 3, usb_ret, 4, DFU_TIMEOUT); - usb_control_msg(device, usb_in_oth, DFU_DETACH, 0x0000, 3, usb_ret, 4, DFU_TIMEOUT); - usb_control_msg(device, usb_in_oth, DFU_DETACH, 0x0000, 3, usb_ret, 4, DFU_TIMEOUT); - usb_control_msg(device, usb_in_oth, DFU_DETACH, 0x0000, 3, usb_ret, 4, DFU_TIMEOUT); - usb_control_msg(device, usb_in_oth, DFU_DETACH, 0x0000, 3, usb_ret, 4, DFU_TIMEOUT); - - printf(" OK\n"); -} - -void dfu_m3_m6(char *file1, char *file2) -{ - image_data_t img1, img2; - image_attr_t attr1, attr2; - usb_dev_handle *device; - - attr1.delay = 1000; - attr1.pre_off = 0x20; - attr1.pre_sig = 0x44465543; - attr1.suf_dev = 0x0100; - attr1.suf_prod = 0x0140; - attr1.suf_ven = 0x0419; - attr1.suf_dfu = 0x0100; - memcpy(attr1.suf_sig, "RON", 3); - attr1.suf_len = 0x10; - - init_img(&img1, file1, &attr1); - - if (file2) { - attr2.delay = 1000; - attr2.pre_off = 0x20; - attr2.pre_sig = 0x44465543; - attr2.suf_dev = 0x0100; - attr2.suf_prod = 0x0140; - attr2.suf_ven = 0x0419; - attr2.suf_dfu = 0x0100; - memcpy(attr2.suf_sig, "UFD", 3); - attr2.suf_len = 0x10; - - init_img(&img2, file2, &attr2); - } - - device = usb_dev_open(USB_VID_SAMSUNG, USB_PID_M3_M6); -// usb_mimic_windows(); - get_cpu(device); - get_cpu(device); - send_file(device, &img1); - - if (file2) { - printf("Wait a sec (literally)..."); - sleep(1); - printf(" OK\n"); - - clear_status(device); - get_cpu(device); - send_file(device, &img2); - dfu_detach(device); - } - - usb_dev_close(device); -} - -void dfu_m6sl(char *file1, char *file2) -{ - image_data_t img1, img2; - image_attr_t attr1, attr2; - usb_dev_handle *device; - - attr1.delay = 1000; - attr1.pre_off = 0x20; - attr1.pre_sig = 0x44465543; - attr1.suf_dev = 0x0100; - attr1.suf_prod = 0x0140; - attr1.suf_ven = 0x0419; - attr1.suf_dfu = 0x0100; - memcpy(attr1.suf_sig, "UFD", 3); - attr1.suf_len = 0x10; - - init_img(&img1, file1, &attr1); - - if (file2) { - attr2.delay = 1000; - attr2.pre_off = 0x20; - attr2.pre_sig = 0x44465543; - attr2.suf_dev = 0x0100; - attr2.suf_prod = 0x0140; - attr2.suf_ven = 0x0419; - attr2.suf_dfu = 0x0100; - memcpy(attr2.suf_sig, "UFD", 3); - attr2.suf_len = 0x10; - - init_img(&img2, file2, &attr2); - } - - device = usb_dev_open(USB_VID_SAMSUNG, USB_PID_M6SL); - get_cpu(device); - get_cpu(device); - send_file(device, &img1); - - if (file2) { - printf("Wait a sec (literally)..."); - sleep(1); - printf(" OK\n"); - usb_dev_close(device); - - device = usb_dev_open(USB_VID_SAMSUNG, USB_PID_M6SL); - get_cpu(device); - get_cpu(device); - send_file(device, &img2); - dfu_detach(device); - } - - usb_dev_close(device); -} - - -int main(int argc, char **argv) -{ - if (argc < 3 || argc > 4) - usage(); - - setvbuf(stdout, NULL, _IONBF, 0); - - char *second_file = (argc == 4) ? argv[3] : NULL; - - if (!strcmp(argv[1], "m3")) - dfu_m3_m6(argv[2], second_file); - else if (!strcmp(argv[1], "m6")) - dfu_m3_m6(argv[2], second_file); - else if (!strcmp(argv[1], "m6sl")) - dfu_m6sl(argv[2], second_file); - else - usage(); - - return 0; -} - diff --git a/utils/rbutilqt/CMakeLists.txt b/utils/rbutilqt/CMakeLists.txt index 4addc8d54c..a160279189 100644 --- a/utils/rbutilqt/CMakeLists.txt +++ b/utils/rbutilqt/CMakeLists.txt @@ -256,41 +256,6 @@ if(APPLE) ${CMAKE_CURRENT_LIST_DIR}/base/ttscarbon.h) endif() -find_package(QuaZip-Qt${QT_VERSION_MAJOR} QUIET) -if(QuaZip-Qt${QT_VERSION_MAJOR}_FOUND) - message("-- Found QuaZip") - set(QUAZIP_LIBRARY QuaZip::QuaZip) -else() - message("-- QuaZip not found, building our own") - # TODO: Upstream has cmake support, use that instead. - add_library(quazip - ${CMAKE_CURRENT_LIST_DIR}/quazip/ioapi.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/minizip_crypt.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/qioapi.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip_global.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.c - ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.c - ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.h - ) - target_include_directories(quazip PUBLIC ${CMAKE_CURRENT_LIST_DIR}/quazip) - target_link_libraries(quazip z Qt${QT_VERSION_MAJOR}::Core) - if(QT_VERSION_MAJOR EQUAL 6) - target_link_libraries(quazip Qt${QT_VERSION_MAJOR}::Core5Compat) - endif() - target_compile_definitions(quazip PUBLIC QUAZIP_STATIC) - set_property(TARGET quazip PROPERTY AUTOMOC ON) - set(QUAZIP_LIBRARY quazip) -endif() - target_link_libraries(rbbase cutelogger ${QUAZIP_LIBRARY} mspack bspatch rbspeex voicefont sansapatcher ipodpatcher chinachippatcher diff --git a/utils/rbutilqt/Info.plist b/utils/rbutilqt/Info.plist index 15a5dc5313..26c22003a6 100644 --- a/utils/rbutilqt/Info.plist +++ b/utils/rbutilqt/Info.plist @@ -7,7 +7,7 @@ CFBundleName Rockbox Utility CFBundleShortVersionString - 1.5.1 + 1.5.2 CFBundleIconFile rbutilqt.icns CFBundleIdentifier diff --git a/utils/rbutilqt/changelog.txt b/utils/rbutilqt/changelog.txt index 1f6c6f58a3..e2eb98cc76 100644 --- a/utils/rbutilqt/changelog.txt +++ b/utils/rbutilqt/changelog.txt @@ -50,7 +50,7 @@ Version 1.5.1 Version 1.5.2 * Add support for Native Port to AIGO Eros Q and various clones -* Make Hosted Port to AIGO Eros Q and various clones "disabled" (can be reenabled by checking the "show disabled targets" checkbox) +* Mark hosted port to AIGO Eros Q and various clones "disabled" (can be reenabled by checking the "show disabled targets" checkbox) * Talk clip generation now respects 'talkclips.ignore' files * Generate additional talk clips for language name and 'invalid voice file' * When installing development builds, fall back to daily artefacts for non-firmware files diff --git a/utils/rbutilqt/quazip/README.ROCKBOX b/utils/rbutilqt/quazip/README.ROCKBOX index a168b2a079..2e1dca737f 100644 --- a/utils/rbutilqt/quazip/README.ROCKBOX +++ b/utils/rbutilqt/quazip/README.ROCKBOX @@ -3,7 +3,7 @@ These files are distributed under the LGPL v2.1 or later. Only source files actually used in Rockbox Utility are included, further sources have been left out. Check the quazip source distribution for those. -The source files have been last synced with the projects release 0.9.1 at -https://github.com/stachenov/quazip/ on June 8, 2020. +The source files have been last synced with the project's release 1.1 at +https://github.com/stachenov/quazip/ on October 11, 2020. diff --git a/utils/rbutilqt/quazip/qioapi.cpp b/utils/rbutilqt/quazip/qioapi.cpp index 3932ebeef0..60f101d7e9 100644 --- a/utils/rbutilqt/quazip/qioapi.cpp +++ b/utils/rbutilqt/quazip/qioapi.cpp @@ -16,12 +16,7 @@ #include "ioapi.h" #include "quazip_global.h" #include -#if (QT_VERSION >= 0x050100) -#define QUAZIP_QSAVEFILE_BUG_WORKAROUND -#endif -#ifdef QUAZIP_QSAVEFILE_BUG_WORKAROUND -#include -#endif +#include "quazip_qt_compat.h" /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ @@ -39,7 +34,7 @@ voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,voidpf file,int mode) { - if (pfilefunc->zfile_func64.zopen64_file != NULL) + if (pfilefunc->zfile_func64.zopen64_file != nullptr) return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,file,mode); else { @@ -49,7 +44,7 @@ voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,voidpf file,int mod int call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) { - if (pfilefunc->zfile_func64.zseek64_file != NULL) + if (pfilefunc->zfile_func64.zseek64_file != nullptr) return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); else { @@ -63,7 +58,7 @@ int call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPO ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) { - if (pfilefunc->zfile_func64.zseek64_file != NULL) + if (pfilefunc->zfile_func64.zseek64_file != nullptr) return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); else { @@ -105,7 +100,7 @@ voidpf ZCALLBACK qiodevice_open_file_func ( && iodevice->isSequential()) { // We can use sequential devices only for writing. delete d; - return NULL; + return nullptr; } else { if ((desiredMode & QIODevice::WriteOnly) != 0) { // open for writing, need to seek existing device @@ -119,7 +114,7 @@ voidpf ZCALLBACK qiodevice_open_file_func ( return iodevice; } else { delete d; - return NULL; + return nullptr; } } iodevice->open(desiredMode); @@ -128,13 +123,13 @@ voidpf ZCALLBACK qiodevice_open_file_func ( // We can use sequential devices only for writing. iodevice->close(); delete d; - return NULL; + return nullptr; } else { return iodevice; } } else { delete d; - return NULL; + return nullptr; } } @@ -287,17 +282,7 @@ int ZCALLBACK qiodevice_close_file_func ( QIODevice_descriptor *d = reinterpret_cast(opaque); delete d; QIODevice *device = reinterpret_cast(stream); -#ifdef QUAZIP_QSAVEFILE_BUG_WORKAROUND - // QSaveFile terribly breaks the is-a idiom: - // it IS a QIODevice, but it is NOT compatible with it: close() is private - QSaveFile *file = qobject_cast(device); - if (file != NULL) { - // We have to call the ugly commit() instead: - return file->commit() ? 0 : -1; - } -#endif - device->close(); - return 0; + return quazip_close(device) ? 0 : -1; } int ZCALLBACK qiodevice_fakeclose_file_func ( @@ -347,17 +332,17 @@ void fill_qiodevice64_filefunc ( void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) { - p_filefunc64_32->zfile_func64.zopen64_file = NULL; + p_filefunc64_32->zfile_func64.zopen64_file = nullptr; p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; - p_filefunc64_32->zfile_func64.ztell64_file = NULL; - p_filefunc64_32->zfile_func64.zseek64_file = NULL; + p_filefunc64_32->zfile_func64.ztell64_file = nullptr; + p_filefunc64_32->zfile_func64.zseek64_file = nullptr; p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; - p_filefunc64_32->zfile_func64.zfakeclose_file = NULL; + p_filefunc64_32->zfile_func64.zfakeclose_file = nullptr; p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; } diff --git a/utils/rbutilqt/quazip/quazip.cpp b/utils/rbutilqt/quazip/quazip.cpp index 61c2ea87eb..29a278da29 100644 --- a/utils/rbutilqt/quazip/quazip.cpp +++ b/utils/rbutilqt/quazip/quazip.cpp @@ -1,20 +1,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -78,7 +78,7 @@ class QuaZipPrivate { uint osCode; inline QTextCodec *getDefaultFileNameCodec() { - if (defaultFileNameCodec == NULL) { + if (defaultFileNameCodec == nullptr) { return QTextCodec::codecForLocale(); } else { return defaultFileNameCodec; @@ -89,7 +89,7 @@ class QuaZipPrivate { q(q), fileNameCodec(getDefaultFileNameCodec()), commentCodec(QTextCodec::codecForLocale()), - ioDevice(NULL), + ioDevice(nullptr), mode(QuaZip::mdNotOpen), hasCurrentFile_f(false), zipError(UNZ_OK), @@ -99,8 +99,8 @@ class QuaZipPrivate { utf8(false), osCode(defaultOsCode) { - unzFile_f = NULL; - zipFile_f = NULL; + unzFile_f = nullptr; + zipFile_f = nullptr; lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } @@ -110,7 +110,7 @@ class QuaZipPrivate { fileNameCodec(getDefaultFileNameCodec()), commentCodec(QTextCodec::codecForLocale()), zipName(zipName), - ioDevice(NULL), + ioDevice(nullptr), mode(QuaZip::mdNotOpen), hasCurrentFile_f(false), zipError(UNZ_OK), @@ -120,8 +120,8 @@ class QuaZipPrivate { utf8(false), osCode(defaultOsCode) { - unzFile_f = NULL; - zipFile_f = NULL; + unzFile_f = nullptr; + zipFile_f = nullptr; lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } @@ -140,8 +140,8 @@ class QuaZipPrivate { utf8(false), osCode(defaultOsCode) { - unzFile_f = NULL; - zipFile_f = NULL; + unzFile_f = nullptr; + zipFile_f = nullptr; lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } @@ -160,7 +160,7 @@ class QuaZipPrivate { static uint defaultOsCode; }; -QTextCodec *QuaZipPrivate::defaultFileNameCodec = NULL; +QTextCodec *QuaZipPrivate::defaultFileNameCodec = nullptr; uint QuaZipPrivate::defaultOsCode = QUAZIP_OS_UNIX; void QuaZipPrivate::clearDirectoryMap() @@ -241,7 +241,7 @@ bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) return false; } QIODevice *ioDevice = p->ioDevice; - if (ioDevice == NULL) { + if (ioDevice == nullptr) { if (p->zipName.isEmpty()) { qWarning("QuaZip::open(): set either ZIP file name or IO device first"); return false; @@ -252,14 +252,14 @@ bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) unsigned flags = 0; switch(mode) { case mdUnzip: - if (ioApi == NULL) { + if (ioApi == nullptr) { if (p->autoClose) flags |= UNZ_AUTO_CLOSE; - p->unzFile_f=unzOpenInternal(ioDevice, NULL, 1, flags); + p->unzFile_f=unzOpenInternal(ioDevice, nullptr, 1, flags); } else { - // QuaZIP pre-zip64 compatibility mode + // QuaZip pre-zip64 compatibility mode p->unzFile_f=unzOpen2(ioDevice, ioApi); - if (p->unzFile_f != NULL) { + if (p->unzFile_f != nullptr) { if (p->autoClose) { unzSetFlags(p->unzFile_f, UNZ_AUTO_CLOSE); } else { @@ -267,7 +267,7 @@ bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) } } } - if(p->unzFile_f!=NULL) { + if(p->unzFile_f!=nullptr) { if (ioDevice->isSequential()) { unzClose(p->unzFile_f); if (!p->zipName.isEmpty()) @@ -289,7 +289,7 @@ bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) case mdCreate: case mdAppend: case mdAdd: - if (ioApi == NULL) { + if (ioApi == nullptr) { if (p->autoClose) flags |= ZIP_AUTO_CLOSE; if (p->dataDescriptorWritingEnabled) @@ -300,23 +300,23 @@ bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) mode==mdCreate?APPEND_STATUS_CREATE: mode==mdAppend?APPEND_STATUS_CREATEAFTER: APPEND_STATUS_ADDINZIP, - NULL, NULL, flags); + nullptr, nullptr, flags); } else { - // QuaZIP pre-zip64 compatibility mode + // QuaZip pre-zip64 compatibility mode p->zipFile_f=zipOpen2(ioDevice, mode==mdCreate?APPEND_STATUS_CREATE: mode==mdAppend?APPEND_STATUS_CREATEAFTER: APPEND_STATUS_ADDINZIP, - NULL, + nullptr, ioApi); - if (p->zipFile_f != NULL) { + if (p->zipFile_f != nullptr) { zipSetFlags(p->zipFile_f, flags); } } - if(p->zipFile_f!=NULL) { + if(p->zipFile_f!=nullptr) { if (ioDevice->isSequential()) { if (mode != mdCreate) { - zipClose(p->zipFile_f, NULL); + zipClose(p->zipFile_f, nullptr); qWarning("QuaZip::open(): " "only mdCreate can be used with " "sequential devices"); @@ -357,7 +357,7 @@ void QuaZip::close() case mdCreate: case mdAppend: case mdAdd: - p->zipError=zipClose(p->zipFile_f, p->comment.isNull() ? NULL : isUtf8Enabled() + p->zipError=zipClose(p->zipFile_f, p->comment.isNull() ? nullptr : isUtf8Enabled() ? p->comment.toUtf8().constData() : p->commentCodec->fromUnicode(p->comment).constData()); break; @@ -368,7 +368,7 @@ void QuaZip::close() // opened by name, need to delete the internal IO device if (!p->zipName.isEmpty()) { delete p->ioDevice; - p->ioDevice = NULL; + p->ioDevice = nullptr; } p->clearDirectoryMap(); if(p->zipError==UNZ_OK) @@ -382,7 +382,7 @@ void QuaZip::setZipName(const QString& zipName) return; } p->zipName=zipName; - p->ioDevice = NULL; + p->ioDevice = nullptr; } void QuaZip::setIoDevice(QIODevice *ioDevice) @@ -442,7 +442,7 @@ bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs) return true; } // Unicode-aware reimplementation of the unzLocateFile function - if(p->unzFile_f==NULL) { + if(p->unzFile_f==nullptr) { p->zipError=UNZ_PARAMERROR; return false; } @@ -517,7 +517,7 @@ bool QuaZip::goToNextFile() bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const { QuaZipFileInfo64 info64; - if (info == NULL) { // Very unlikely because of the overloads + if (info == nullptr) { // Very unlikely because of the overloads return false; } if (getCurrentFileInfo(&info64)) { @@ -540,14 +540,14 @@ bool QuaZip::getCurrentFileInfo(QuaZipFileInfo64 *info)const QByteArray fileName; QByteArray extra; QByteArray comment; - if(info==NULL) return false; + if(info==nullptr) return false; if(!isOpen()||!hasCurrentFile()) return false; - if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK) + if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, &info_z, nullptr, 0, nullptr, 0, nullptr, 0))!=UNZ_OK) return false; fileName.resize(info_z.size_filename); extra.resize(info_z.size_file_extra); comment.resize(info_z.size_file_comment); - if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, NULL, + if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, nullptr, fileName.data(), fileName.size(), extra.data(), extra.size(), comment.data(), comment.size()))!=UNZ_OK) @@ -585,7 +585,7 @@ QString QuaZip::getCurrentFileName()const QByteArray fileName(MAX_FILE_NAME_LENGTH, 0); unz_file_info64 file_info; if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, &file_info, fileName.data(), fileName.size(), - NULL, 0, NULL, 0))!=UNZ_OK) + nullptr, 0, nullptr, 0))!=UNZ_OK) return QString(); fileName.resize(file_info.size_filename); QString result = (file_info.flag & UNZ_ENCODING_UTF8) @@ -645,7 +645,7 @@ QString QuaZip::getZipName() const QIODevice *QuaZip::getIoDevice() const { if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice - return NULL; + return nullptr; return p->ioDevice; } diff --git a/utils/rbutilqt/quazip/quazip.h b/utils/rbutilqt/quazip/quazip.h index 8ff0756254..486d5885bf 100644 --- a/utils/rbutilqt/quazip/quazip.h +++ b/utils/rbutilqt/quazip/quazip.h @@ -4,20 +4,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -27,7 +27,7 @@ quazip/(un)zip.h files for details, basically it's zlib license. #include #include -#include +#include "quazip_qt_compat.h" #include "zip.h" #include "unzip.h" @@ -116,7 +116,7 @@ class QUAZIP_EXPORT QuaZip { csSensitive=1, ///< Case sensitive. csInsensitive=2 ///< Case insensitive. }; - /// Returns the actual case sensitivity for the specified QuaZIP one. + /// Returns the actual case sensitivity for the specified QuaZip one. /** \param cs The value to convert. \returns If CaseSensitivity::csDefault, then returns the default @@ -153,17 +153,17 @@ class QUAZIP_EXPORT QuaZip { * * If the ZIP file is accessed via explicitly set QIODevice, then * this device is opened in the necessary mode. If the device was - * already opened by some other means, then QuaZIP checks if the + * already opened by some other means, then QuaZip checks if the * open mode is compatible to the mode needed for the requested operation. * If necessary, seeking is performed to position the device properly. * * \return \c true if successful, \c false otherwise. * * \note ZIP/UNZIP API open calls do not return error code - they - * just return \c NULL indicating an error. But to make things + * just return \c null indicating an error. But to make things * easier, quazip.h header defines additional error code \c * UNZ_ERROROPEN and getZipError() will return it if the open call - * of the ZIP/UNZIP API returns \c NULL. + * of the ZIP/UNZIP API returns \c null. * * Argument \a ioApi specifies IO function set for ZIP/UNZIP * package to use. See unzip.h, zip.h and ioapi.h for details. Note @@ -177,12 +177,12 @@ class QUAZIP_EXPORT QuaZip { * QIODevice instead of file name, but also has a nice side effect * of raising the file size limit from 2G to 4G (in non-zip64 archives). * - * \note If the zip64 support is needed, the ioApi argument \em must be NULL + * \note If the zip64 support is needed, the ioApi argument \em must be null * because due to the backwards compatibility issues it can be used to * provide a 32-bit API only. * * \note If the \ref QuaZip::setAutoClose() "no-auto-close" feature is used, - * then the \a ioApi argument \em should be NULL because the old API + * then the \a ioApi argument \em should be null because the old API * doesn't support the 'fake close' operation, causing slight memory leaks * and other possible troubles (like closing the output device in case * when an error occurs during opening). @@ -190,7 +190,7 @@ class QUAZIP_EXPORT QuaZip { * In short: just forget about the \a ioApi argument and you'll be * fine. **/ - bool open(Mode mode, zlib_filefunc_def *ioApi =NULL); + bool open(Mode mode, zlib_filefunc_def *ioApi =nullptr); /// Closes ZIP file. /** Call getZipError() to determine if the close was successful. * @@ -206,7 +206,7 @@ class QUAZIP_EXPORT QuaZip { * by making close() private and crashing the application if it is called * from the base class where it is public. It is an excellent example * of poor design that illustrates why you should never ever break - * an is-a relationship between the base class and a subclass. QuaZIP + * an is-a relationship between the base class and a subclass. QuaZip * works around this bug by checking if the QIODevice is an instance * of QSaveFile, using qobject_cast<>, and if it is, calls * QSaveFile::commit() instead of close(). It is a really ugly hack, @@ -427,7 +427,7 @@ class QUAZIP_EXPORT QuaZip { According to the ZIP format specification, a file inside archive may have a data descriptor immediately following the file data. This is reflected by a special flag in the local file header - and in the central directory. By default, QuaZIP sets this flag + and in the central directory. By default, QuaZip sets this flag and writes the data descriptor unless both method and level were set to 0, in which case it operates in 1.0-compatible mode and never writes data descriptors. @@ -539,14 +539,14 @@ class QUAZIP_EXPORT QuaZip { bool isAutoClose() const; /// Sets or unsets the auto-close flag. /** - By default, QuaZIP opens the underlying QIODevice when open() is called, + By default, QuaZip opens the underlying QIODevice when open() is called, and closes it when close() is called. In some cases, when the device is set explicitly using setIoDevice(), it may be desirable to leave the device open. If the auto-close flag is unset using this method, then the device isn't closed automatically if it was set explicitly. If it is needed to clear this flag, it is recommended to do so before - opening the archive because otherwise QuaZIP may close the device + opening the archive because otherwise QuaZip may close the device during the open() call if an error is encountered after the device is opened. @@ -567,7 +567,7 @@ class QUAZIP_EXPORT QuaZip { * The codec specified here can be overriden by calling setFileNameCodec(). * If neither function is called, QTextCodec::codecForLocale() will be used * to decode or encode file names. Use this function with caution if - * the application uses other libraries that depend on QuaZIP. Those + * the application uses other libraries that depend on QuaZip. Those * libraries can either call this function by themselves, thus overriding * your setting or can rely on the default encoding, thus failing * mysteriously if you change it. For these reasons, it isn't recommended @@ -576,7 +576,7 @@ class QUAZIP_EXPORT QuaZip { * encoding. * * In most cases, using setFileNameCodec() instead is the right choice. - * However, if you depend on third-party code that uses QuaZIP, then the + * However, if you depend on third-party code that uses QuaZip, then the * reasons stated above can actually become a reason to use this function * in case the third-party code in question fails because it doesn't * understand the encoding you need and doesn't provide a way to specify it. @@ -587,7 +587,7 @@ class QUAZIP_EXPORT QuaZip { * setDefaultFileNameCodec() when you don't have access to the QuaZip * instance. * - * @param codec The codec to use by default. If NULL, resets to default. + * @param codec The codec to use by default. If null, resets to default. */ static void setDefaultFileNameCodec(QTextCodec *codec); /** diff --git a/utils/rbutilqt/quazip/quazip.pri b/utils/rbutilqt/quazip/quazip.pri deleted file mode 100644 index 3a82bd0275..0000000000 --- a/utils/rbutilqt/quazip/quazip.pri +++ /dev/null @@ -1,25 +0,0 @@ - -SOURCES += \ - $$PWD/quazip.cpp \ - $$PWD/quazipfile.cpp \ - $$PWD/quazipnewinfo.cpp \ - $$PWD/quazipfileinfo.cpp \ - $$PWD/qioapi.cpp \ - $$PWD/unzip.c \ - $$PWD/zip.c \ - -HEADERS += \ - $$PWD/minizip_crypt.h \ - $$PWD/ioapi.h \ - $$PWD/quazipfile.h \ - $$PWD/quazipfileinfo.h \ - $$PWD/quazipnewinfo.h \ - $$PWD/quazip.h \ - $$PWD/quazipnewinfo.h \ - $$PWD/quazip_global.h \ - $$PWD/unzip.h \ - $$PWD/zip.h \ - -DEFINES += \ - QUAZIP_STATIC - diff --git a/utils/rbutilqt/quazip/quazip_qt_compat.h b/utils/rbutilqt/quazip/quazip_qt_compat.h new file mode 100644 index 0000000000..d1c912a04d --- /dev/null +++ b/utils/rbutilqt/quazip/quazip_qt_compat.h @@ -0,0 +1,120 @@ +#ifndef QUAZIP_QT_COMPAT_H +#define QUAZIP_QT_COMPAT_H + +/* + * For some reason, Qt 5.14 and 5.15 introduced a whole mess of seemingly random + * moves and deprecations. To avoid populating code with #ifs, + * we handle this stuff here, as well as some other compatibility issues. + * + * Some includes are repeated just in case we want to split this file later. + */ + +#include +#include + +// Legacy encodings are still everywhere, but the Qt team decided we +// don't need them anymore and moved them out of Core in Qt 6. +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +# include +#else +# include +#endif + +// QSaveFile terribly breaks the is-a idiom (Liskov substitution principle): +// QSaveFile is-a QIODevice, but it makes close() private and aborts +// if you call it through the base class. Hence this ugly hack: +#if (QT_VERSION >= 0x050100) +#include +inline bool quazip_close(QIODevice *device) { + QSaveFile *file = qobject_cast(device); + if (file != nullptr) { + // We have to call the ugly commit() instead: + return file->commit(); + } else { + device->close(); + return true; + } +} +#else +inline bool quazip_close(QIODevice *device) { + device->close(); + return true; +} +#endif + +// this is yet another stupid move and deprecation +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) +using Qt::SkipEmptyParts; +#else +#include +const auto SkipEmptyParts = QString::SplitBehavior::SkipEmptyParts; +#endif + +// and yet another... (why didn't they just make qSort delegate to std::sort?) +#include +#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) +#include +template +inline void quazip_sort(T begin, T end, C comparator) { + std::sort(begin, end, comparator); +} +#else +#include +template +inline void quazip_sort(T begin, T end, C comparator) { + qSort(begin, end, comparator); +} +#endif + +// this is a stupid rename... +#include +#include +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) +inline QDateTime quazip_ctime(const QFileInfo &fi) { + return fi.birthTime(); +} +#else +inline QDateTime quazip_ctime(const QFileInfo &fi) { + return fi.created(); +} +#endif + +// this is not a deprecation but an improvement, for a change +#include +#if (QT_VERSION >= 0x040700) +inline quint64 quazip_ntfs_ticks(const QDateTime &time, int fineTicks) { + QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC); + return base.msecsTo(time) * 10000 + fineTicks; +} +#else +inline quint64 quazip_ntfs_ticks(const QDateTime &time, int fineTicks) { + QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC); + QDateTime utc = time.toUTC(); + return (static_cast(base.date().daysTo(utc.date())) + * Q_INT64_C(86400000) + + static_cast(base.time().msecsTo(utc.time()))) + * Q_INT64_C(10000) + fineTicks; +} +#endif + +// yet another improvement... +#include +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) // Yay! Finally a way to get time as qint64! +inline qint64 quazip_to_time64_t(const QDateTime &time) { + return time.toSecsSinceEpoch(); +} +#else +inline qint64 quazip_to_time64_t(const QDateTime &time) { + return static_cast(time.toTime_t()); // 32 bits only, but better than nothing +} +#endif + +#include +// and another stupid move +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) +const auto quazip_endl = Qt::endl; +#else +const auto quazip_endl = endl; +#endif + +#endif // QUAZIP_QT_COMPAT_H diff --git a/utils/rbutilqt/quazip/quazipfile.cpp b/utils/rbutilqt/quazip/quazipfile.cpp index b984de7279..d70acf7fe3 100644 --- a/utils/rbutilqt/quazip/quazipfile.cpp +++ b/utils/rbutilqt/quazip/quazipfile.cpp @@ -1,20 +1,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -82,7 +82,7 @@ class QuaZipFilePrivate { /// The constructor for the corresponding QuaZipFile constructor. inline QuaZipFilePrivate(QuaZipFile *q): q(q), - zip(NULL), + zip(nullptr), caseSensitivity(QuaZip::csDefault), raw(false), writePos(0), @@ -177,18 +177,18 @@ QuaZipFile::~QuaZipFile() QString QuaZipFile::getZipName() const { - return p->zip==NULL ? QString() : p->zip->getZipName(); + return p->zip==nullptr ? QString() : p->zip->getZipName(); } QuaZip *QuaZipFile::getZip() const { - return p->internal ? NULL : p->zip; + return p->internal ? nullptr : p->zip; } QString QuaZipFile::getActualFileName()const { p->setZipError(UNZ_OK); - if (p->zip == NULL || (openMode() & WriteOnly)) + if (p->zip == nullptr || (openMode() & WriteOnly)) return QString(); QString name=p->zip->getCurrentFileName(); if(name.isNull()) @@ -202,7 +202,7 @@ void QuaZipFile::setZipName(const QString& zipName) qWarning("QuaZipFile::setZipName(): file is already open - can not set ZIP name"); return; } - if(p->zip!=NULL && p->internal) + if(p->zip!=nullptr && p->internal) delete p->zip; p->zip=new QuaZip(zipName); p->internal=true; @@ -214,7 +214,7 @@ void QuaZipFile::setZip(QuaZip *zip) qWarning("QuaZipFile::setZip(): file is already open - can not set ZIP"); return; } - if(p->zip!=NULL && p->internal) + if(p->zip!=nullptr && p->internal) delete p->zip; p->zip=zip; p->fileName=QString(); @@ -223,7 +223,7 @@ void QuaZipFile::setZip(QuaZip *zip) void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs) { - if(p->zip==NULL) { + if(p->zip==nullptr) { qWarning("QuaZipFile::setFileName(): call setZipName() first"); return; } @@ -253,7 +253,7 @@ void QuaZipFilePrivate::setZipError(int zipError) const bool QuaZipFile::open(OpenMode mode) { - return open(mode, NULL); + return open(mode, nullptr); } bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const char *password) @@ -279,8 +279,8 @@ bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const ch return false; } } else { - if(p->zip==NULL) { - qWarning("QuaZipFile::open(): zip is NULL"); + if(p->zip==nullptr) { + qWarning("QuaZipFile::open(): zip is null"); return false; } if(p->zip->getMode()!=QuaZip::mdUnzip) { @@ -321,8 +321,8 @@ bool QuaZipFile::open(OpenMode mode, const QuaZipNewInfo& info, qWarning("QuaZipFile::open(): write mode is incompatible with internal QuaZip approach"); return false; } - if(p->zip==NULL) { - qWarning("QuaZipFile::open(): zip is NULL"); + if(p->zip==nullptr) { + qWarning("QuaZipFile::open(): zip is null"); return false; } if(p->zip->getMode()!=QuaZip::mdCreate&&p->zip->getMode()!=QuaZip::mdAppend&&p->zip->getMode()!=QuaZip::mdAdd) { @@ -382,7 +382,7 @@ bool QuaZipFile::isSequential()const qint64 QuaZipFile::pos()const { - if(p->zip==NULL) { + if(p->zip==nullptr) { qWarning("QuaZipFile::pos(): call setZipName() or setZip() first"); return -1; } @@ -401,7 +401,7 @@ qint64 QuaZipFile::pos()const bool QuaZipFile::atEnd()const { - if(p->zip==NULL) { + if(p->zip==nullptr) { qWarning("QuaZipFile::atEnd(): call setZipName() or setZip() first"); return false; } @@ -433,8 +433,8 @@ qint64 QuaZipFile::csize()const { unz_file_info64 info_z; p->setZipError(UNZ_OK); - if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; - p->setZipError(unzGetCurrentFileInfo64(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); + if(p->zip==nullptr||p->zip->getMode()!=QuaZip::mdUnzip) return -1; + p->setZipError(unzGetCurrentFileInfo64(p->zip->getUnzFile(), &info_z, nullptr, 0, nullptr, 0, nullptr, 0)); if(p->zipError!=UNZ_OK) return -1; return info_z.compressed_size; @@ -444,8 +444,8 @@ qint64 QuaZipFile::usize()const { unz_file_info64 info_z; p->setZipError(UNZ_OK); - if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; - p->setZipError(unzGetCurrentFileInfo64(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); + if(p->zip==nullptr||p->zip->getMode()!=QuaZip::mdUnzip) return -1; + p->setZipError(unzGetCurrentFileInfo64(p->zip->getUnzFile(), &info_z, nullptr, 0, nullptr, 0, nullptr, 0)); if(p->zipError!=UNZ_OK) return -1; return info_z.uncompressed_size; @@ -464,7 +464,7 @@ bool QuaZipFile::getFileInfo(QuaZipFileInfo *info) bool QuaZipFile::getFileInfo(QuaZipFileInfo64 *info) { - if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return false; + if(p->zip==nullptr||p->zip->getMode()!=QuaZip::mdUnzip) return false; p->zip->getCurrentFileInfo(info); p->setZipError(p->zip->getZipError()); return p->zipError==UNZ_OK; @@ -473,7 +473,7 @@ bool QuaZipFile::getFileInfo(QuaZipFileInfo64 *info) void QuaZipFile::close() { p->resetZipError(); - if(p->zip==NULL||!p->zip->isOpen()) return; + if(p->zip==nullptr||!p->zip->isOpen()) return; if(!isOpen()) { qWarning("QuaZipFile::close(): file isn't open"); return; @@ -544,7 +544,7 @@ qint64 QuaZipFile::bytesAvailable() const QByteArray QuaZipFile::getLocalExtraField() { - int size = unzGetLocalExtrafield(p->zip->getUnzFile(), NULL, 0); + int size = unzGetLocalExtrafield(p->zip->getUnzFile(), nullptr, 0); QByteArray extra(size, '\0'); int err = unzGetLocalExtrafield(p->zip->getUnzFile(), extra.data(), static_cast(extra.size())); if (err < 0) { diff --git a/utils/rbutilqt/quazip/quazipfile.h b/utils/rbutilqt/quazip/quazipfile.h index 0fd6829f36..b49c50b9f3 100644 --- a/utils/rbutilqt/quazip/quazipfile.h +++ b/utils/rbutilqt/quazip/quazipfile.h @@ -4,20 +4,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -39,7 +39,7 @@ class QuaZipFilePrivate; * interface to the ZIP/UNZIP package, but also integrates it with Qt by * subclassing QIODevice. This makes possible to access files inside ZIP * archive using QTextStream or QDataStream, for example. Actually, this - * is the main purpose of the whole QuaZIP library. + * is the main purpose of the whole QuaZip library. * * You can either use existing QuaZip instance to create instance of * this class or pass ZIP archive file name to this class, in which case @@ -107,7 +107,7 @@ class QUAZIP_EXPORT QuaZipFile: public QIODevice { * QuaZipFile constructed by this constructor can be used for read * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. **/ - QuaZipFile(const QString& zipName, QObject *parent =NULL); + QuaZipFile(const QString& zipName, QObject *parent =nullptr); /// Constructs a QuaZipFile instance. /** \a parent argument specifies this object's parent object, \a * zipName specifies ZIP archive file name and \a fileName and \a cs @@ -119,7 +119,7 @@ class QUAZIP_EXPORT QuaZipFile: public QIODevice { * \sa QuaZip::setCurrentFile() **/ QuaZipFile(const QString& zipName, const QString& fileName, - QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL); + QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =nullptr); /// Constructs a QuaZipFile instance. /** \a parent argument specifies this object's parent object. * @@ -169,7 +169,7 @@ class QUAZIP_EXPORT QuaZipFile: public QIODevice { * zip.close(); * \endcode **/ - QuaZipFile(QuaZip *zip, QObject *parent =NULL); + QuaZipFile(QuaZip *zip, QObject *parent =nullptr); /// Destroys a QuaZipFile instance. /** Closes file if open, destructs internal QuaZip object (if it * exists and \em is internal, of course). @@ -296,7 +296,7 @@ class QUAZIP_EXPORT QuaZipFile: public QIODevice { * it is NULL then this function behaves just like open(OpenMode). **/ inline bool open(OpenMode mode, const char *password) - {return open(mode, NULL, NULL, false, password);} + {return open(mode, nullptr, nullptr, false, password);} /// Opens a file for reading. /** \overload * Argument \a password specifies a password to decrypt the file. @@ -309,7 +309,7 @@ class QUAZIP_EXPORT QuaZipFile: public QIODevice { * \a method should not be \c NULL. \a level can be \c NULL if you * don't want to know the compression level. **/ - bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL); + bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =nullptr); /// Opens a file for writing. /** \a info argument specifies information about file. It should at * least specify a correct file name. Also, it is a good idea to @@ -339,7 +339,7 @@ class QUAZIP_EXPORT QuaZipFile: public QIODevice { * algorithms tuning. See deflateInit2() in zlib. **/ bool open(OpenMode mode, const QuaZipNewInfo& info, - const char *password =NULL, quint32 crc =0, + const char *password =nullptr, quint32 crc =0, int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false, int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY); /// Returns \c true, but \ref quazipfile-sequential "beware"! diff --git a/utils/rbutilqt/quazip/quazipfileinfo.cpp b/utils/rbutilqt/quazip/quazipfileinfo.cpp index d5798ea771..3f58b40216 100644 --- a/utils/rbutilqt/quazip/quazipfileinfo.cpp +++ b/utils/rbutilqt/quazip/quazipfileinfo.cpp @@ -1,20 +1,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -28,7 +28,7 @@ see quazip/(un)zip.h files for details. Basically it's the zlib license. static QFile::Permissions permissionsFromExternalAttr(quint32 externalAttr) { quint32 uPerm = (externalAttr & 0xFFFF0000u) >> 16; - QFile::Permissions perm = QFile::Permissions(); + QFile::Permissions perm; if ((uPerm & 0400) != 0) perm |= QFile::ReadOwner; if ((uPerm & 0200) != 0) @@ -115,9 +115,11 @@ static QDateTime getNTFSTime(const QByteArray &extra, int position, timeReader.device()->seek(position); quint64 time; timeReader >> time; + if (time == 0) + return dateTime; QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC); dateTime = base.addMSecs(time / 10000); - if (fineTicks != NULL) { + if (fineTicks != nullptr) { *fineTicks = static_cast(time % 10000); } return dateTime; diff --git a/utils/rbutilqt/quazip/quazipfileinfo.h b/utils/rbutilqt/quazip/quazipfileinfo.h index 43665b4ac2..4812fc2db0 100644 --- a/utils/rbutilqt/quazip/quazipfileinfo.h +++ b/utils/rbutilqt/quazip/quazipfileinfo.h @@ -4,20 +4,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -140,7 +140,7 @@ struct QUAZIP_EXPORT QuaZipFileInfo64 { /** * The getNTFS*Time() functions only work if there is an NTFS extra field * present. Otherwise, they all return invalid null timestamps. - * @param fineTicks If not NULL, the fractional part of milliseconds returned + * @param fineTicks If not null, the fractional part of milliseconds returned * there, measured in 100-nanosecond ticks. Will be set to * zero if there is no NTFS extra field. * @sa dateTime @@ -148,12 +148,12 @@ struct QUAZIP_EXPORT QuaZipFileInfo64 { * @sa getNTFScTime() * @return The NTFS modification time, UTC */ - QDateTime getNTFSmTime(int *fineTicks = NULL) const; + QDateTime getNTFSmTime(int *fineTicks = nullptr) const; /// Returns the NTFS access time /** * The getNTFS*Time() functions only work if there is an NTFS extra field * present. Otherwise, they all return invalid null timestamps. - * @param fineTicks If not NULL, the fractional part of milliseconds returned + * @param fineTicks If not null, the fractional part of milliseconds returned * there, measured in 100-nanosecond ticks. Will be set to * zero if there is no NTFS extra field. * @sa dateTime @@ -161,12 +161,12 @@ struct QUAZIP_EXPORT QuaZipFileInfo64 { * @sa getNTFScTime() * @return The NTFS access time, UTC */ - QDateTime getNTFSaTime(int *fineTicks = NULL) const; + QDateTime getNTFSaTime(int *fineTicks = nullptr) const; /// Returns the NTFS creation time /** * The getNTFS*Time() functions only work if there is an NTFS extra field * present. Otherwise, they all return invalid null timestamps. - * @param fineTicks If not NULL, the fractional part of milliseconds returned + * @param fineTicks If not null, the fractional part of milliseconds returned * there, measured in 100-nanosecond ticks. Will be set to * zero if there is no NTFS extra field. * @sa dateTime @@ -174,7 +174,7 @@ struct QUAZIP_EXPORT QuaZipFileInfo64 { * @sa getNTFSaTime() * @return The NTFS creation time, UTC */ - QDateTime getNTFScTime(int *fineTicks = NULL) const; + QDateTime getNTFScTime(int *fineTicks = nullptr) const; /// Returns the extended modification timestamp /** * The getExt*Time() functions only work if there is an extended timestamp diff --git a/utils/rbutilqt/quazip/quazipnewinfo.cpp b/utils/rbutilqt/quazip/quazipnewinfo.cpp index 98630e086a..659e4f7720 100644 --- a/utils/rbutilqt/quazip/quazipnewinfo.cpp +++ b/utils/rbutilqt/quazip/quazipnewinfo.cpp @@ -1,20 +1,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. @@ -25,6 +25,7 @@ see quazip/(un)zip.h files for details. Basically it's the zlib license. #include #include "quazipnewinfo.h" +#include "quazip_qt_compat.h" #include @@ -134,11 +135,7 @@ void QuaZipNewInfo::setFileNTFSTimes(const QString &fileName) } setFileNTFSmTime(fi.lastModified()); setFileNTFSaTime(fi.lastRead()); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) - setFileNTFScTime(fi.birthTime()); -#else - setFileNTFScTime(fi.created()); -#endif + setFileNTFScTime(quazip_ctime(fi)); } static void setNTFSTime(QByteArray &extra, const QDateTime &time, int position, @@ -251,16 +248,7 @@ static void setNTFSTime(QByteArray &extra, const QDateTime &time, int position, extra[timesPos + 2] = static_cast(ntfsTimesLength); extra[timesPos + 3] = static_cast(ntfsTimesLength >> 8); } - QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC); -#if (QT_VERSION >= 0x040700) - quint64 ticks = base.msecsTo(time) * 10000 + fineTicks; -#else - QDateTime utc = time.toUTC(); - quint64 ticks = (static_cast(base.date().daysTo(utc.date())) - * Q_INT64_C(86400000) - + static_cast(base.time().msecsTo(utc.time()))) - * Q_INT64_C(10000) + fineTicks; -#endif + quint64 ticks = quazip_ntfs_ticks(time, fineTicks); extra[timesPos + 4 + position] = static_cast(ticks); extra[timesPos + 5 + position] = static_cast(ticks >> 8); extra[timesPos + 6 + position] = static_cast(ticks >> 16); diff --git a/utils/rbutilqt/quazip/quazipnewinfo.h b/utils/rbutilqt/quazip/quazipnewinfo.h index 43a1e6fd08..bad70c27d3 100644 --- a/utils/rbutilqt/quazip/quazipnewinfo.h +++ b/utils/rbutilqt/quazip/quazipnewinfo.h @@ -4,20 +4,20 @@ /* Copyright (C) 2005-2014 Sergey A. Tachenov -This file is part of QuaZIP. +This file is part of QuaZip. -QuaZIP is free software: you can redistribute it and/or modify +QuaZip is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. -QuaZIP is distributed in the hope that it will be useful, +QuaZip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with QuaZIP. If not, see . +along with QuaZip. If not, see . See COPYING file for the full LGPL text. diff --git a/utils/rbutilqt/quazip/unzip.c b/utils/rbutilqt/quazip/unzip.c index 6aaeba6930..3e147d7d82 100644 --- a/utils/rbutilqt/quazip/unzip.c +++ b/utils/rbutilqt/quazip/unzip.c @@ -10,7 +10,7 @@ Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - Modifications for QIODevice support and other QuaZIP fixes + Modifications for QIODevice support and other QuaZip fixes Copyright (C) 2005-2014 Sergey A. Tachenov For more info read MiniZip_info.txt diff --git a/utils/rbutilqt/quazip/unzip.h b/utils/rbutilqt/quazip/unzip.h index fdefa2217a..e898332f94 100644 --- a/utils/rbutilqt/quazip/unzip.h +++ b/utils/rbutilqt/quazip/unzip.h @@ -206,7 +206,7 @@ extern unzFile ZEXPORT unzOpen2_64 OF((voidpf file, /* - * Exported by Sergey A. Tachenov to implement some QuaZIP features. This + * Exported by Sergey A. Tachenov to implement some QuaZip features. This * function MAY change signature in order to implement even more features. * You have been warned! * */ diff --git a/utils/rbutilqt/quazip/zip.c b/utils/rbutilqt/quazip/zip.c index 0f3deb04c1..dc8e15fc21 100644 --- a/utils/rbutilqt/quazip/zip.c +++ b/utils/rbutilqt/quazip/zip.c @@ -9,7 +9,7 @@ For more info read MiniZip_info.txt - Modifications for QIODevice support and other QuaZIP fixes + Modifications for QIODevice support and other QuaZip fixes Copyright (C) 2005-2014 Sergey A. Tachenov Fixing static code analysis issues diff --git a/utils/rbutilqt/quazip/zip.h b/utils/rbutilqt/quazip/zip.h index 114a1bf6e7..5837d95ade 100644 --- a/utils/rbutilqt/quazip/zip.h +++ b/utils/rbutilqt/quazip/zip.h @@ -129,7 +129,7 @@ extern zipFile ZEXPORT zipOpen OF((voidpf file, int append)); extern zipFile ZEXPORT zipOpen64 OF((voidpf file, int append)); /* Create a zipfile. - the file argument depends on the API used, for QuaZIP it's a QIODevice + the file argument depends on the API used, for QuaZip it's a QIODevice pointer. if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip will be created at the end of the file. @@ -157,9 +157,9 @@ extern zipFile ZEXPORT zipOpen2_64 OF((voidpf file, zlib_filefunc64_def* pzlib_filefunc_def)); /* - * Exported by Sergey A. Tachenov to suit the needs of QuaZIP. + * Exported by Sergey A. Tachenov to suit the needs of QuaZip. * Note that this function MAY change signature in order to - * provide new QuaZIP features. You have been warned! + * provide new QuaZip features. You have been warned! * */ extern zipFile ZEXPORT zipOpen3 (voidpf file, int append, diff --git a/utils/themeeditor/CMakeLists.txt b/utils/themeeditor/CMakeLists.txt index 8d239b55f1..42a3e19c1b 100644 --- a/utils/themeeditor/CMakeLists.txt +++ b/utils/themeeditor/CMakeLists.txt @@ -13,13 +13,6 @@ # KIND, either express or implied. # -find_package(QuaZip-Qt${QT_VERSION_MAJOR} QUIET) -if(QuaZip-Qt${QT_VERSION_MAJOR}_FOUND) - set(QUAZIP_LIBRARY QuaZip::QuaZip) -else() - set(QUAZIP_LIBRARY quazip) -endif() - add_executable(RockboxThemeEditor WIN32 MACOSX_BUNDLE graphics/rbalbumart.cpp graphics/rbalbumart.h diff --git a/utils/themeeditor/resources/targetdb b/utils/themeeditor/resources/targetdb index 4d94992953..010bafde83 100644 --- a/utils/themeeditor/resources/targetdb +++ b/utils/themeeditor/resources/targetdb @@ -445,33 +445,6 @@ creativezen record : yes } -zenvision -{ - name : Creative Zen Vision - screen : 320 x 240 @ rgb - remote : no - fm : no - record : no -} - -zenvisionm30gb -{ - name : Creative Zen Vision%:M 30GB - screen : 320 x 240 @ rgb - remote : no - fm : no - record : no -} - -zenvisionm60gb -{ - name : Creative Zen Vision%:M 60GB - screen : 320 x 240 @ rgb - remote : no - fm : no - record : no -} - creativezenxfi2 { name : Creative Zen X-Fi2 @@ -580,51 +553,6 @@ logikdax record : no } -lyreproto1 -{ - name : Lyre Prototype 1 - screen : 128 x 128 @ rgb - remote : no - fm : no - record : no -} - -meizum3 -{ - name : Meizu M3 - screen : 176 x 132 @ rgb - remote : no - fm : yes - record : no -} - -meizum6sl -{ - name : Meizu M6SL - screen : 320 x 240 @ rgb - remote : no - fm : yes - record : no -} - -meizum6sp -{ - name : Meizu M6SP - screen : 240 x 320 @ rgb - remote : no - fm : yes - record : no -} - -mini2440 -{ - name : Mini 2440 - screen : 240 x 320 @ rgb - remote : no - fm : no - record : no -} - mpiohd200 { name : MPIO HD200 @@ -688,15 +616,6 @@ samsungypr0 record : no } -samsungyps3 -{ - name : Samsung YP-S3 - screen : 176 x 220 @ rgb - remote : no - fm : yes - record : no -} - sansac100 { name : SanDisk Sansa c100 @@ -724,15 +643,6 @@ sansam200v4 record : yes } -sansaview -{ - name : SanDisk Sansa View - screen : 240 x 320 @ rgb - remote : no - fm : no - record : no -} - sonynwa20 { name : Sony NW-A20