mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Patch #5731 by Barry Wardell: more iriver h10 work. Thanks!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10521 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2c3fd0ce7e
commit
9dc0e62229
15 changed files with 367 additions and 110 deletions
|
|
@ -116,6 +116,16 @@ PLUGIN_HEADER
|
||||||
#define BUBBLES_SELECT BUTTON_UP
|
#define BUBBLES_SELECT BUTTON_UP
|
||||||
#define BUBBLES_RESUME BUTTON_DOWN
|
#define BUBBLES_RESUME BUTTON_DOWN
|
||||||
|
|
||||||
|
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
||||||
|
#define BUBBLES_LEFT BUTTON_LEFT
|
||||||
|
#define BUBBLES_RIGHT BUTTON_RIGHT
|
||||||
|
#define BUBBLES_UP BUTTON_SCROLL_UP
|
||||||
|
#define BUBBLES_DOWN BUTTON_SCROLL_DOWN
|
||||||
|
#define BUBBLES_QUIT BUTTON_POWER
|
||||||
|
#define BUBBLES_START BUTTON_PLAY
|
||||||
|
#define BUBBLES_SELECT BUTTON_REW
|
||||||
|
#define BUBBLES_RESUME BUTTON_FF
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error BUBBLES: Unsupported keypad
|
#error BUBBLES: Unsupported keypad
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,12 @@ enum tidy_system
|
||||||
#define TIDY_LEFT BUTTON_LEFT
|
#define TIDY_LEFT BUTTON_LEFT
|
||||||
#define TIDY_RIGHT BUTTON_RIGHT
|
#define TIDY_RIGHT BUTTON_RIGHT
|
||||||
|
|
||||||
|
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
|
||||||
|
#define TIDY_DO BUTTON_PLAY
|
||||||
|
#define TIDY_STOP BUTTON_POWER
|
||||||
|
#define TIDY_LEFT BUTTON_LEFT
|
||||||
|
#define TIDY_RIGHT BUTTON_RIGHT
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error DISKTIDY: Unsupported keypad
|
#error DISKTIDY: Unsupported keypad
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -374,6 +380,9 @@ void tidy_lcd_menu(enum tidy_system system)
|
||||||
#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
|
#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
|
||||||
rb->lcd_puts(0, 0, "[Select] to clean up");
|
rb->lcd_puts(0, 0, "[Select] to clean up");
|
||||||
rb->lcd_puts(0, 1, "[A] to exit/abort");
|
rb->lcd_puts(0, 1, "[A] to exit/abort");
|
||||||
|
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
|
||||||
|
rb->lcd_puts(0, 0, "[Play] to clean up");
|
||||||
|
rb->lcd_puts(0, 1, "[Power] to exit/abort");
|
||||||
#else
|
#else
|
||||||
#error DISKTIDY: Unsupported model
|
#error DISKTIDY: Unsupported model
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,10 @@ extern vo_open_t vo_rockbox_open;
|
||||||
#define MPEG_STOP BUTTON_A
|
#define MPEG_STOP BUTTON_A
|
||||||
#define MPEG_PAUSE BUTTON_SELECT
|
#define MPEG_PAUSE BUTTON_SELECT
|
||||||
|
|
||||||
|
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
||||||
|
#define MPEG_STOP BUTTON_POWER
|
||||||
|
#define MPEG_PAUSE BUTTON_PLAY
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error MPEGPLAYER: Unsupported keypad
|
#error MPEGPLAYER: Unsupported keypad
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,25 @@ static struct plugin_api* rb;
|
||||||
# define HK_CUR2STACK "SELECT.."
|
# define HK_CUR2STACK "SELECT.."
|
||||||
# define HK_REM2STACK "POWER+RIGHT"
|
# define HK_REM2STACK "POWER+RIGHT"
|
||||||
|
|
||||||
|
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
|
||||||
|
#define SOL_QUIT BUTTON_POWER
|
||||||
|
#define SOL_UP BUTTON_SCROLL_UP
|
||||||
|
#define SOL_DOWN BUTTON_SCROLL_DOWN
|
||||||
|
#define SOL_LEFT BUTTON_LEFT
|
||||||
|
#define SOL_RIGHT BUTTON_RIGHT
|
||||||
|
#define SOL_MOVE BUTTON_REW
|
||||||
|
#define SOL_DRAW BUTTON_PLAY
|
||||||
|
#define SOL_REM2CUR (BUTTON_FF | BUTTON_LEFT)
|
||||||
|
#define SOL_CUR2STACK (BUTTON_FF | BUTTON_SCROLL_UP)
|
||||||
|
#define SOL_REM2STACK (BUTTON_FF | BUTTON_SCROLL_DOWN)
|
||||||
|
#define SOL_MENU_RUN BUTTON_REW
|
||||||
|
#define SOL_MENU_INFO BUTTON_PLAY
|
||||||
|
#define HK_MOVE "REW"
|
||||||
|
#define HK_DRAW "PLAY"
|
||||||
|
#define HK_REM2CUR "REW+LEFT"
|
||||||
|
#define HK_CUR2STACK "REW+UP.."
|
||||||
|
#define HK_REM2STACK "REW+DOWN"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# error "Unknown keypad"
|
# error "Unknown keypad"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
262
bootloader/h10.c
Normal file
262
bootloader/h10.c
Normal file
|
|
@ -0,0 +1,262 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006 by Barry Wardell
|
||||||
|
*
|
||||||
|
* Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
|
||||||
|
* and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
|
||||||
|
*
|
||||||
|
* 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 "config.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "cpu.h"
|
||||||
|
#include "system.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "kernel.h"
|
||||||
|
#include "thread.h"
|
||||||
|
#include "ata.h"
|
||||||
|
#include "fat.h"
|
||||||
|
#include "disk.h"
|
||||||
|
#include "font.h"
|
||||||
|
#include "adc.h"
|
||||||
|
#include "backlight.h"
|
||||||
|
#include "button.h"
|
||||||
|
#include "panic.h"
|
||||||
|
#include "power.h"
|
||||||
|
#include "file.h"
|
||||||
|
|
||||||
|
/* Size of the buffer to store the loaded Rockbox/iriver image */
|
||||||
|
#define MAX_LOADSIZE (5*1024*1024)
|
||||||
|
|
||||||
|
/* This is identical to the function used in the iPod bootloader */
|
||||||
|
static void memmove16(void *dest, const void *src, unsigned count)
|
||||||
|
{
|
||||||
|
struct bufstr {
|
||||||
|
unsigned _buf[4];
|
||||||
|
} *d, *s;
|
||||||
|
|
||||||
|
if (src >= dest) {
|
||||||
|
count = (count + 15) >> 4;
|
||||||
|
d = (struct bufstr *) dest;
|
||||||
|
s = (struct bufstr *) src;
|
||||||
|
while (count--)
|
||||||
|
*d++ = *s++;
|
||||||
|
} else {
|
||||||
|
count = (count + 15) >> 4;
|
||||||
|
d = (struct bufstr *)(dest + (count <<4));
|
||||||
|
s = (struct bufstr *)(src + (count <<4));
|
||||||
|
while (count--)
|
||||||
|
*--d = *--s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Load original iriver firmware. This function expects a file called "H10_20GC.mi4" in
|
||||||
|
the root directory of the player. It should be decrypted and have the header stripped
|
||||||
|
using mi4code. It reads the file in to a memory buffer called buf. The rest of the
|
||||||
|
loading is done in main()
|
||||||
|
*/
|
||||||
|
int load_iriver(unsigned char* buf)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
int rc;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
fd = open("/H10_20GC.mi4", O_RDONLY);
|
||||||
|
|
||||||
|
len = filesize(fd);
|
||||||
|
rc = read(fd, buf, len);
|
||||||
|
if(rc < len)
|
||||||
|
return -4;
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A buffer to load the iriver firmware or Rockbox into */
|
||||||
|
unsigned char loadbuffer[MAX_LOADSIZE];
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
/* Attempt to load original iriver firmware. Successfully starts loading the iriver
|
||||||
|
firmware but then locks up once the "System Initialising" screen is displayed.
|
||||||
|
|
||||||
|
The iriver firmware was decrypted and the header removed. It was then appended to
|
||||||
|
the end of bootloader.bin and an mi4 file was created from the resulting file.
|
||||||
|
|
||||||
|
The original firmware starts at 0xd800 in the file and is of length 0x47da00.
|
||||||
|
|
||||||
|
The whole file (bootloader.bin + decrypted mi4) are loaded to memory by the
|
||||||
|
original iriver bootloader on startup. This copies the mi4 part to the start
|
||||||
|
of DRAM and passes execution to there.
|
||||||
|
|
||||||
|
memmove16((void*)DRAMORIG, (void*)(DRAMORIG + 0xd800), 0x47da00);
|
||||||
|
asm volatile(
|
||||||
|
"mov r0, #" SC(DRAMORIG) "\n"
|
||||||
|
"mov pc, r0 \n"
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
|
int i;
|
||||||
|
int rc;
|
||||||
|
int btn;
|
||||||
|
|
||||||
|
i=ata_init();
|
||||||
|
disk_init();
|
||||||
|
rc = disk_mount_all();
|
||||||
|
|
||||||
|
/* Load original iriver firmware. Uses load_iriver(buf) to load the decrypted mi4 file from
|
||||||
|
disk to DRAM. This then copies that part of DRAM to the start of DRAM and passes
|
||||||
|
execution to there.
|
||||||
|
|
||||||
|
rc=load_iriver(loadbuffer);
|
||||||
|
memcpy((void*)DRAMORIG,loadbuffer,rc);
|
||||||
|
asm volatile(
|
||||||
|
"mov r0, #" SC(DRAMORIG) "\n"
|
||||||
|
"mov pc, r0 \n"
|
||||||
|
);*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This assumes that /test.txt exists */
|
||||||
|
int fd;
|
||||||
|
char buffer[24];
|
||||||
|
fd=open("/test.txt",O_RDWR);
|
||||||
|
|
||||||
|
|
||||||
|
/* WARNING: Running this code on the H10 caused permanent damage to my H10's hdd
|
||||||
|
I strongly recommend against trying it.
|
||||||
|
|
||||||
|
for(i=0;i<100;i++){
|
||||||
|
btn = button_read_device();
|
||||||
|
switch(btn){
|
||||||
|
case BUTTON_LEFT:
|
||||||
|
snprintf(buffer, sizeof(buffer), "Left");
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
break;
|
||||||
|
case BUTTON_RIGHT:
|
||||||
|
break;
|
||||||
|
case BUTTON_REW:
|
||||||
|
break;
|
||||||
|
case BUTTON_FF:
|
||||||
|
break;
|
||||||
|
case BUTTON_PLAY:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Investigate gpio
|
||||||
|
|
||||||
|
unsigned int gpio_a, gpio_b, gpio_c, gpio_d;
|
||||||
|
unsigned int gpio_e, gpio_f, gpio_g, gpio_h;
|
||||||
|
unsigned int gpio_i, gpio_j, gpio_k, gpio_l;
|
||||||
|
|
||||||
|
gpio_a = GPIOA_INPUT_VAL;
|
||||||
|
gpio_b = GPIOB_INPUT_VAL;
|
||||||
|
gpio_c = GPIOC_INPUT_VAL;
|
||||||
|
|
||||||
|
gpio_g = GPIOG_INPUT_VAL;
|
||||||
|
gpio_h = GPIOH_INPUT_VAL;
|
||||||
|
gpio_i = GPIOI_INPUT_VAL;
|
||||||
|
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_A: %02x GPIO_G: %02x\n", gpio_a, gpio_g);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_B: %02x GPIO_H: %02x\n", gpio_b, gpio_h);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_C: %02x GPIO_I: %02x\n", gpio_c, gpio_i);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
|
||||||
|
gpio_d = GPIOD_INPUT_VAL;
|
||||||
|
gpio_e = GPIOE_INPUT_VAL;
|
||||||
|
gpio_f = GPIOF_INPUT_VAL;
|
||||||
|
|
||||||
|
gpio_j = GPIOJ_INPUT_VAL;
|
||||||
|
gpio_k = GPIOK_INPUT_VAL;
|
||||||
|
gpio_l = GPIOL_INPUT_VAL;
|
||||||
|
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_D: %02x GPIO_J: %02x\n", gpio_d, gpio_j);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_E: %02x GPIO_K: %02x\n", gpio_e, gpio_k);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_F: %02x GPIO_L: %02x\n", gpio_f, gpio_l);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Detect the scroller being touched
|
||||||
|
|
||||||
|
int j = 0;
|
||||||
|
for(j=0;j<1000;j++){
|
||||||
|
if(gpio_c!=0xF7){
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_C: %02x\n", gpio_c);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
}
|
||||||
|
if(gpio_d!=0xDD){
|
||||||
|
snprintf(buffer, sizeof(buffer), "GPIO_D: %02x\n", gpio_d);
|
||||||
|
write(fd,buffer,sizeof(buffer));
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Apparently necessary for the data to be actually written to file */
|
||||||
|
fsync(fd);
|
||||||
|
udelay(1000000);
|
||||||
|
|
||||||
|
/* This causes the device to shut off instantly
|
||||||
|
|
||||||
|
GPIOF_OUTPUT_VAL = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
udelay(1000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* These functions are present in the firmware library, but we reimplement
|
||||||
|
them here because the originals do a lot more than we want */
|
||||||
|
|
||||||
|
void reset_poweroff_timer(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int dbg_ports(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mpeg_stop(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void usb_acknowledge(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void usb_wait_for_disconnect(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void sys_poweroff(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -250,7 +250,7 @@ target/coldfire/iaudio/x5/lcd-remote-x5.c
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
target/arm/iriver/h10/backlight-h10.c
|
target/arm/iriver/h10/backlight-h10.c
|
||||||
target/arm/iriver/h10/button-h10.c
|
target/arm/iriver/h10/button-h10.c
|
||||||
target/arm/iriver/h10/ata-h10.c
|
target/arm/ata-pp5020.c
|
||||||
target/arm/iriver/h10/power-h10.c
|
target/arm/iriver/h10/power-h10.c
|
||||||
target/arm/iriver/h10/usb-h10.c
|
target/arm/iriver/h10/usb-h10.c
|
||||||
target/arm/iriver/h10/lcd-h10.c
|
target/arm/iriver/h10/lcd-h10.c
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
|
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
|
||||||
because of 'target' stuff */
|
because of 'target' stuff */
|
||||||
|
|
||||||
#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity
|
#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity
|
||||||
TODO: check this, probably different
|
TODO: check this, probably different
|
||||||
for different models too */
|
for different models too */
|
||||||
|
|
||||||
|
|
|
||||||
23
firmware/target/arm/ata-target.h
Normal file
23
firmware/target/arm/ata-target.h
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006 by Barry Wardell
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void ata_reset(void);
|
||||||
|
void ata_enable(bool on);
|
||||||
|
bool ata_is_coldstart(void);
|
||||||
|
void ata_device_init(void);
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006 by Barry Wardell
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* ATA stuff was taken from the iPod code */
|
|
||||||
|
|
||||||
/* Plain C read & write loops */
|
|
||||||
#define PREFER_C_READING
|
|
||||||
#define PREFER_C_WRITING
|
|
||||||
|
|
||||||
#if (CONFIG_CPU == PP5002)
|
|
||||||
#define ATA_IOBASE 0xc00031e0
|
|
||||||
#define ATA_CONTROL (*((volatile unsigned char*)(0xc00033f8)))
|
|
||||||
#elif (CONFIG_CPU == PP5020)
|
|
||||||
#define ATA_IOBASE 0xc30001e0
|
|
||||||
#define ATA_CONTROL (*((volatile unsigned char*)(0xc30003f8)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
|
|
||||||
#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
|
|
||||||
#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
|
|
||||||
#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x0c)))
|
|
||||||
#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
|
|
||||||
#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
|
|
||||||
#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x18)))
|
|
||||||
#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x1c)))
|
|
||||||
|
|
||||||
#define STATUS_BSY 0x80
|
|
||||||
#define STATUS_RDY 0x40
|
|
||||||
#define STATUS_DF 0x20
|
|
||||||
#define STATUS_DRQ 0x08
|
|
||||||
#define STATUS_ERR 0x01
|
|
||||||
#define ERROR_ABRT 0x04
|
|
||||||
|
|
||||||
#define WRITE_PATTERN1 0xa5
|
|
||||||
#define WRITE_PATTERN2 0x5a
|
|
||||||
#define WRITE_PATTERN3 0xaa
|
|
||||||
#define WRITE_PATTERN4 0x55
|
|
||||||
|
|
||||||
#define READ_PATTERN1 0xa5
|
|
||||||
#define READ_PATTERN2 0x5a
|
|
||||||
#define READ_PATTERN3 0xaa
|
|
||||||
#define READ_PATTERN4 0x55
|
|
||||||
|
|
||||||
#define READ_PATTERN1_MASK 0xff
|
|
||||||
#define READ_PATTERN2_MASK 0xff
|
|
||||||
#define READ_PATTERN3_MASK 0xff
|
|
||||||
#define READ_PATTERN4_MASK 0xff
|
|
||||||
|
|
||||||
#define SET_REG(reg,val) reg = (val)
|
|
||||||
#define SET_16BITREG(reg,val) reg = (val)
|
|
||||||
|
|
||||||
|
|
||||||
void ata_reset(void);
|
|
||||||
void ata_enable(bool on);
|
|
||||||
bool ata_is_coldstart(void);
|
|
||||||
void ata_device_init(void);
|
|
||||||
|
|
@ -49,6 +49,7 @@ int button_read_device(void)
|
||||||
int btn = BUTTON_NONE;
|
int btn = BUTTON_NONE;
|
||||||
unsigned char state;
|
unsigned char state;
|
||||||
static bool hold_button = false;
|
static bool hold_button = false;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* light handling */
|
/* light handling */
|
||||||
if (hold_button && !button_hold())
|
if (hold_button && !button_hold())
|
||||||
|
|
@ -58,12 +59,25 @@ int button_read_device(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hold_button = button_hold();
|
hold_button = button_hold();
|
||||||
state = GPIOA_INPUT_VAL & 0xf8;
|
if (!hold_button)
|
||||||
if ((state & 0x8) == 0) btn |= BUTTON_FF;
|
{
|
||||||
if ((state & 0x16) == 0) btn |= BUTTON_PLAY;
|
/* Read normal buttons */
|
||||||
if ((state & 0x32) == 0) btn |= BUTTON_REW;
|
state = GPIOA_INPUT_VAL & 0xf8;
|
||||||
if ((state & 0x64) == 0) btn |= BUTTON_RIGHT;
|
if ((state & 0x8) == 0) btn |= BUTTON_FF;
|
||||||
if ((state & 0x128) == 0) btn |= BUTTON_LEFT;
|
if ((state & 0x10) == 0) btn |= BUTTON_PLAY;
|
||||||
|
if ((state & 0x20) == 0) btn |= BUTTON_REW;
|
||||||
|
if ((state & 0x40) == 0) btn |= BUTTON_RIGHT;
|
||||||
|
if ((state & 0x80) == 0) btn |= BUTTON_LEFT;
|
||||||
|
|
||||||
|
/* Read power button */
|
||||||
|
if ((GPIOB_INPUT_VAL & 0x1) == 0) btn |= BUTTON_POWER;
|
||||||
|
|
||||||
|
/* Read scroller */
|
||||||
|
if ( ((GPIOC_INPUT_VAL & 0x4)==1) && ((GPIOD_INPUT_VAL & 0x10)==1) )
|
||||||
|
{
|
||||||
|
/* Scroller is pressed */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return btn;
|
return btn;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@
|
||||||
|
|
||||||
static bool display_on=false; /* is the display turned on? */
|
static bool display_on=false; /* is the display turned on? */
|
||||||
|
|
||||||
#define LCD_CMD *(volatile unsigned short *)0xf0008000
|
#define LCD_CMD *(volatile unsigned short *)0x70003008 /* or maybe 0x70008a0c */
|
||||||
#define LCD_DATA *(volatile unsigned short *)0xf0008002
|
#define LCD_DATA *(volatile unsigned short *)0x70003010
|
||||||
|
|
||||||
/* register defines for the Renesas HD66773R */
|
/* register defines for the Renesas HD66773R */
|
||||||
#define R_HORIZ_RAM_ADDR_POS 0x16
|
#define R_HORIZ_RAM_ADDR_POS 0x16
|
||||||
|
|
@ -98,30 +98,23 @@ const short high8to9[] ICONST_ATTR = {
|
||||||
/* called very frequently - inline! */
|
/* called very frequently - inline! */
|
||||||
inline void lcd_write_reg(int reg, int val)
|
inline void lcd_write_reg(int reg, int val)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
LCD_CMD = (reg >> 8) << 1;
|
LCD_CMD = (reg >> 8) << 1;
|
||||||
LCD_CMD = (reg & 0xff) << 1;
|
LCD_CMD = (reg & 0xff) << 1;
|
||||||
LCD_DATA = (val >> 8) << 1;
|
LCD_DATA = (val >> 8) << 1;
|
||||||
LCD_DATA = (val & 0xff) << 1;
|
LCD_DATA = (val & 0xff) << 1;
|
||||||
#endif
|
|
||||||
(void)reg;
|
|
||||||
(void)val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called very frequently - inline! */
|
/* called very frequently - inline! */
|
||||||
inline void lcd_begin_write_gram(void)
|
inline void lcd_begin_write_gram(void)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
LCD_CMD = (R_WRITE_DATA_2_GRAM >> 8) << 1;
|
LCD_CMD = (R_WRITE_DATA_2_GRAM >> 8) << 1;
|
||||||
LCD_CMD = (R_WRITE_DATA_2_GRAM & 0xff) << 1;
|
LCD_CMD = (R_WRITE_DATA_2_GRAM & 0xff) << 1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called very frequently - inline! */
|
/* called very frequently - inline! */
|
||||||
inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR;
|
inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR;
|
||||||
inline void lcd_write_data(const unsigned short* p_bytes, int count)
|
inline void lcd_write_data(const unsigned short* p_bytes, int count)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
unsigned int *ptr = (unsigned int *)p_bytes;
|
unsigned int *ptr = (unsigned int *)p_bytes;
|
||||||
bool extra;
|
bool extra;
|
||||||
|
|
@ -144,9 +137,6 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count)
|
||||||
LCD_DATA = high8to9[read >> 8];
|
LCD_DATA = high8to9[read >> 8];
|
||||||
LCD_DATA = read<<1;
|
LCD_DATA = read<<1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
(void)p_bytes;
|
|
||||||
(void)count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** hardware configuration ***/
|
/*** hardware configuration ***/
|
||||||
|
|
@ -158,15 +148,12 @@ int lcd_default_contrast(void)
|
||||||
|
|
||||||
void lcd_set_contrast(int val)
|
void lcd_set_contrast(int val)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if (val >= 15) // val must'nt be 15 or 31
|
if (val >= 15) // val must'nt be 15 or 31
|
||||||
++val;
|
++val;
|
||||||
if (val > 30)
|
if (val > 30)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lcd_write_reg(0x0e, 0x201e + (val << 8));
|
lcd_write_reg(0x0e, 0x201e + (val << 8));
|
||||||
#endif
|
|
||||||
(void)val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_set_invert_display(bool yesno)
|
void lcd_set_invert_display(bool yesno)
|
||||||
|
|
@ -197,9 +184,9 @@ void lcd_roll(int lines)
|
||||||
*/
|
*/
|
||||||
void lcd_init_device(void)
|
void lcd_init_device(void)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
display_on=true;
|
display_on=true;
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* LCD Reset */
|
/* LCD Reset */
|
||||||
and_l(~0x00000010, &GPIO1_OUT);
|
and_l(~0x00000010, &GPIO1_OUT);
|
||||||
or_l(0x00000010, &GPIO1_ENABLE);
|
or_l(0x00000010, &GPIO1_ENABLE);
|
||||||
|
|
@ -268,10 +255,7 @@ void lcd_init_device(void)
|
||||||
|
|
||||||
void lcd_enable(bool on)
|
void lcd_enable(bool on)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
display_on = on;
|
display_on = on;
|
||||||
#endif
|
|
||||||
(void)on;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** update functions ***/
|
/*** update functions ***/
|
||||||
|
|
@ -297,7 +281,6 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
|
||||||
void lcd_update(void) ICODE_ATTR;
|
void lcd_update(void) ICODE_ATTR;
|
||||||
void lcd_update(void)
|
void lcd_update(void)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if(display_on){
|
if(display_on){
|
||||||
|
|
||||||
/* Copy display bitmap to hardware */
|
/* Copy display bitmap to hardware */
|
||||||
|
|
@ -305,14 +288,12 @@ void lcd_update(void)
|
||||||
lcd_begin_write_gram();
|
lcd_begin_write_gram();
|
||||||
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
|
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update a fraction of the display. */
|
/* Update a fraction of the display. */
|
||||||
void lcd_update_rect(int, int, int, int) ICODE_ATTR;
|
void lcd_update_rect(int, int, int, int) ICODE_ATTR;
|
||||||
void lcd_update_rect(int x, int y, int width, int height)
|
void lcd_update_rect(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if(display_on) {
|
if(display_on) {
|
||||||
int ymax = y + height;
|
int ymax = y + height;
|
||||||
|
|
||||||
|
|
@ -343,9 +324,4 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 0x7f00);
|
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 0x7f00);
|
||||||
lcd_write_reg(R_VERT_RAM_ADDR_POS, 0x9f00);
|
lcd_write_reg(R_VERT_RAM_ADDR_POS, 0x9f00);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
(void)x;
|
|
||||||
(void)y;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
tools/configure
vendored
5
tools/configure
vendored
|
|
@ -897,11 +897,10 @@ toolsdir='\$(ROOTDIR)/tools'
|
||||||
target="-DIRIVER_H10"
|
target="-DIRIVER_H10"
|
||||||
memory=32 # always
|
memory=32 # always
|
||||||
arm7tdmicc
|
arm7tdmicc
|
||||||
#tool="$rootdir/tools/ -add=iax5"
|
tool="$rootdir/tools/mkmi4.sh h10"
|
||||||
tool="$rootdir/tools/mi4code build"
|
|
||||||
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
||||||
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
|
bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
|
||||||
output="rockbox.iriver"
|
output="H10_20GC.mi4"
|
||||||
appextra="recorder:gui"
|
appextra="recorder:gui"
|
||||||
archosrom=""
|
archosrom=""
|
||||||
flash=""
|
flash=""
|
||||||
|
|
|
||||||
BIN
uisimulator/sdl/UI-h10.bmp
Normal file
BIN
uisimulator/sdl/UI-h10.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 599 KiB |
|
|
@ -89,6 +89,8 @@ void button_event(int key, bool pressed)
|
||||||
new_btn = BUTTON_UP;
|
new_btn = BUTTON_UP;
|
||||||
#elif defined BUTTON_SCROLL_BACK
|
#elif defined BUTTON_SCROLL_BACK
|
||||||
new_btn = BUTTON_SCROLL_BACK;
|
new_btn = BUTTON_SCROLL_BACK;
|
||||||
|
#elif defined BUTTON_SCROLL_UP
|
||||||
|
new_btn = BUTTON_SCROLL_UP;
|
||||||
#elif defined BUTTON_PLAY
|
#elif defined BUTTON_PLAY
|
||||||
new_btn = BUTTON_PLAY;
|
new_btn = BUTTON_PLAY;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -100,6 +102,8 @@ void button_event(int key, bool pressed)
|
||||||
new_btn = BUTTON_DOWN;
|
new_btn = BUTTON_DOWN;
|
||||||
#elif defined BUTTON_SCROLL_FWD
|
#elif defined BUTTON_SCROLL_FWD
|
||||||
new_btn = BUTTON_SCROLL_FWD;
|
new_btn = BUTTON_SCROLL_FWD;
|
||||||
|
#elif defined BUTTON_SCROLL_DOWN
|
||||||
|
new_btn = BUTTON_SCROLL_DOWN;
|
||||||
#elif defined BUTTON_STOP
|
#elif defined BUTTON_STOP
|
||||||
new_btn = BUTTON_STOP;
|
new_btn = BUTTON_STOP;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -150,6 +154,15 @@ void button_event(int key, bool pressed)
|
||||||
case SDLK_F1:
|
case SDLK_F1:
|
||||||
new_btn = BUTTON_REC;
|
new_btn = BUTTON_REC;
|
||||||
break;
|
break;
|
||||||
|
#elif defined BUTTON_REW
|
||||||
|
case SDLK_KP_DIVIDE:
|
||||||
|
case SDLK_F1:
|
||||||
|
new_btn = BUTTON_REW;
|
||||||
|
break;
|
||||||
|
case SDLK_KP_MULTIPLY:
|
||||||
|
case SDLK_F2:
|
||||||
|
new_btn = BUTTON_FF;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case SDLK_KP5:
|
case SDLK_KP5:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue