From 1a08f46329e9f6d7bd55a8a9ad45db27df8a7593 Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Tue, 16 Sep 2008 08:09:44 +0000 Subject: [PATCH] Commit fs#9404 (iAudio 7 updates by vitja). Also fixes play/pause behaviour on D2. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18528 a1c6a512-1295-4272-9138-f99709370657 --- apps/keymaps/keymap-iaudio67.c | 12 ++++++----- apps/plugins/doom/i_video.c | 9 ++++++++ firmware/export/config-iaudio7.h | 21 ++++++++----------- firmware/export/hd66789r.h | 2 +- firmware/target/arm/pcm-telechips.c | 17 +++++++++++---- firmware/target/arm/tcc77x/crt0.S | 9 ++++++++ firmware/target/arm/tcc77x/iaudio7/ata2501.c | 4 ++-- .../target/arm/tcc77x/iaudio7/lcd-iaudio7.c | 10 ++++++++- .../target/arm/tcc77x/iaudio7/power-iaudio7.c | 1 + firmware/thread.c | 8 +------ tools/configure | 2 +- 11 files changed, 62 insertions(+), 33 deletions(-) diff --git a/apps/keymaps/keymap-iaudio67.c b/apps/keymaps/keymap-iaudio67.c index b97a5602c9..b0dac93386 100644 --- a/apps/keymaps/keymap-iaudio67.c +++ b/apps/keymaps/keymap-iaudio67.c @@ -40,11 +40,12 @@ static const struct button_mapping button_context_standard[] = { { ACTION_STD_NEXT, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_NEXTREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_STOP, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_STOP, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, - { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, + { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, { ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, // { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_PLAY, BUTTON_NONE }, @@ -69,7 +70,8 @@ static const struct button_mapping button_context_wps[] = { { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, - { ACTION_WPS_STOP, BUTTON_STOP, BUTTON_NONE }, + { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_WPS_STOP, BUTTON_STOP, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_wps */ diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index f0aacc47ec..15d0166733 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -268,6 +268,15 @@ void I_ShutdownGraphics(void) #define DOOMBUTTON_ESC BUTTON_POWER #define DOOMBUTTON_ENTER BUTTON_MENU #define DOOMBUTTON_WEAPON BUTTON_DISPLAY +#elif CONFIG_KEYPAD == IAUDIO67_PAD +#define DOOMBUTTON_ESC BUTTON_POWER +#define DOOMBUTTON_UP BUTTON_STOP +#define DOOMBUTTON_DOWN BUTTON_PLAY +#define DOOMBUTTON_LEFT BUTTON_LEFT +#define DOOMBUTTON_RIGHT BUTTON_RIGHT +#define DOOMBUTTON_SHOOT BUTTON_VOLUP +#define DOOMBUTTON_OPEN BUTTON_VOLDOWN +#define DOOMBUTTON_ENTER BUTTON_MENU #else #error Keymap not defined! #endif diff --git a/firmware/export/config-iaudio7.h b/firmware/export/config-iaudio7.h index 8bc73fa41c..881dc0d1b2 100644 --- a/firmware/export/config-iaudio7.h +++ b/firmware/export/config-iaudio7.h @@ -13,7 +13,7 @@ explicitly if different */ #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) -/* define hardware samples rate caps mask */ +/* define hardware samples rate caps mask */ #define HW_SAMPR_CAPS (/*SAMPR_CAP_88 | */SAMPR_CAP_44/* | SAMPR_CAP_22 | SAMPR_CAP_11*/) /* define the bitmask of recording sample rates */ @@ -31,6 +31,9 @@ /* define this if you can invert the colours on your LCD */ //#define HAVE_LCD_INVERT +/* define this if you want album art for this target */ +#define HAVE_ALBUMART + /* define this if you have access to the quickscreen */ #define HAVE_QUICKSCREEN @@ -100,11 +103,8 @@ /* Codec is slave on serial bus */ #define CODEC_SLAVE -/* Define this if you have the TLV320 audio codec */ -//#define HAVE_TLV320 - -/* TLV320 has no tone controls, so we use the software ones */ -//#define HAVE_SW_TONE_CONTROLS +/* WM8731 has no tone controls, so we use the software ones */ +#define HAVE_SW_TONE_CONTROLS /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT @@ -132,9 +132,6 @@ /* Define this to the CPU frequency */ #define CPU_FREQ 120000000 -/* Offset ( in the firmware file's header ) to the file length */ -//#define FIRMWARE_OFFSET_FILE_LENGTH 0 - /* Offset ( in the firmware file's header ) to the file CRC */ #define FIRMWARE_OFFSET_FILE_CRC 0 @@ -146,12 +143,12 @@ #define CONFIG_LCD LCD_IAUDIO67 -/* FM Tuner */ +/* FM Tuner */ #define CONFIG_TUNER LV24020LP #define HAVE_TUNER_PWR_CTRL -/* Define this for FM radio input available */ -#define HAVE_FMRADIO_IN +/* Define this for FM radio input available */ +#define HAVE_FMRADIO_IN #define BOOTFILE_EXT "iaudio" #define BOOTFILE "rockbox." BOOTFILE_EXT diff --git a/firmware/export/hd66789r.h b/firmware/export/hd66789r.h index 464ddbab4f..f0b2c2bb71 100644 --- a/firmware/export/hd66789r.h +++ b/firmware/export/hd66789r.h @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2008 Vitja Makarov + * Copyright (C) 2004 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 diff --git a/firmware/target/arm/pcm-telechips.c b/firmware/target/arm/pcm-telechips.c index a0ad00eb22..63f50f7d78 100644 --- a/firmware/target/arm/pcm-telechips.c +++ b/firmware/target/arm/pcm-telechips.c @@ -207,7 +207,11 @@ void pcm_play_unlock(void) void pcm_play_dma_pause(bool pause) { - (void) pause; + if (pause) { + play_stop_pcm(); + } else { + play_start_pcm(); + } } size_t pcm_get_bytes_waiting(void) @@ -251,11 +255,12 @@ const void * pcm_rec_dma_get_peak_buffer(int *count) void pcm_record_more(void *start, size_t size) { + (void) start; + (void) size; } #endif -#if defined(COWON_D2) -/* TODO: hardcoded hex values differs for tcc7xx and tcc8xx */ +#if defined(CPU_TCC77X) || defined(CPU_TCC780X) void fiq_handler(void) ICODE_ATTR __attribute__((naked)); void fiq_handler(void) { @@ -266,10 +271,14 @@ void fiq_handler(void) * r0-r3 and r12 is a working register. */ asm volatile ( +#if defined(CPU_TCC780X) "mov r8, #0xc000 \n" /* DAI_TX_IRQ_MASK | DAI_RX_IRQ_MASK */ "ldr r9, =0xf3001004 \n" /* CREQ */ +#elif defined(CPU_TCC77X) + "mov r8, #0x0030 \n" /* DAI_TX_IRQ_MASK | DAI_RX_IRQ_MASK */ + "ldr r9, =0x80000104 \n" /* CREQ */ +#endif "str r8, [r9] \n" /* clear DAI IRQs */ - "ldmia r11, { r8-r9 } \n" /* r8 = p, r9 = size */ "cmp r9, #0x10 \n" /* is size <16? */ "blt .more_data \n" /* if so, ask pcmbuf for more data */ diff --git a/firmware/target/arm/tcc77x/crt0.S b/firmware/target/arm/tcc77x/crt0.S index 569930352a..03dc2a9771 100644 --- a/firmware/target/arm/tcc77x/crt0.S +++ b/firmware/target/arm/tcc77x/crt0.S @@ -131,6 +131,15 @@ copied_start: msr cpsr, r0 ldr sp, =fiq_stack +#ifndef BOOTLOADER + /* Load the banked FIQ mode registers with useful values here. + These values will be used in the FIQ handler in pcm-telechips.c */ + .equ DADO_BASE, 0x80000020 + + ldr r10, =DADO_BASE + ldr r11, =dma_play_data +#endif + /* Let abort and undefined modes use IRQ stack */ mov r0,#0xd7 msr cpsr, r0 diff --git a/firmware/target/arm/tcc77x/iaudio7/ata2501.c b/firmware/target/arm/tcc77x/iaudio7/ata2501.c index fa165d9d0d..bc39872de6 100644 --- a/firmware/target/arm/tcc77x/iaudio7/ata2501.c +++ b/firmware/target/arm/tcc77x/iaudio7/ata2501.c @@ -86,7 +86,7 @@ unsigned short ata2501_read(void) return ret; } -#define ATA2501_TEST +//#define ATA2501_TEST #ifdef ATA2501_TEST #include "lcd.h" #include "sprintf.h" @@ -108,7 +108,7 @@ void ata2501_test(void) while (1) { unsigned short data; - int i, line = 0; + int line = 0; data = ata2501_read(); lcd_clear_display(); diff --git a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c index bbc20b6860..0ca18bee67 100644 --- a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c +++ b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "hd66789r.h" @@ -142,7 +143,7 @@ void lcd_enable(bool on) if (on) { _display_on(); -// lcd_call_enable_hook(); + lcd_call_enable_hook(); } else { /** Off sequence according to datasheet, p. 130 **/ lcd_write_reg(R_FRAME_CYCLE_CONTROL, 0x0002); /* EQ=0, 18 clks/line */ @@ -242,6 +243,13 @@ 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; + if (!display_on) return; diff --git a/firmware/target/arm/tcc77x/iaudio7/power-iaudio7.c b/firmware/target/arm/tcc77x/iaudio7/power-iaudio7.c index ef012cbbdf..ce7175ef55 100644 --- a/firmware/target/arm/tcc77x/iaudio7/power-iaudio7.c +++ b/firmware/target/arm/tcc77x/iaudio7/power-iaudio7.c @@ -73,6 +73,7 @@ void power_touch_panel(bool on) void ide_power_enable(bool on) { + (void) on; } bool ide_powered(void) diff --git a/firmware/thread.c b/firmware/thread.c index 6ba3bd9231..4e22c51689 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -777,13 +777,7 @@ static inline void core_sleep(void) "msr cpsr_c, r0 \n" /* Enable IRQ, restore FIQ */ : : : "r0", "r1", "r2"); } -#elif defined(CPU_TCC77X) -static inline void core_sleep(void) -{ - #warning TODO: Implement core_sleep - enable_irq(); -} -#elif defined(CPU_TCC780X) +#elif defined(CPU_TCC780X) || defined(CPU_TCC77X) static inline void core_sleep(void) { /* Single core only for now. Use the generic ARMv5 wait for IRQ */ diff --git a/tools/configure b/tools/configure index 319b20ebc5..2cb50a940b 100755 --- a/tools/configure +++ b/tools/configure @@ -1294,7 +1294,7 @@ fi tool="$rootdir/tools/scramble -add=i7" boottool="$rootdir/tools/scramble -tcc=crc" bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" - bmp2rb_native="$rootdir/tools/bmp2rb -f 5" + bmp2rb_native="$rootdir/tools/bmp2rb -f 4" output="rockbox.iaudio" appextra="recorder:gui" plugins="yes"