summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/SOURCES2
-rw-r--r--apps/bitmaps/native/SOURCES4
-rw-r--r--apps/debug_menu.c3
-rw-r--r--apps/lang/english.lang6
-rw-r--r--bootloader/SOURCES3
-rw-r--r--bootloader/main-pp.c6
-rw-r--r--firmware/SOURCES16
-rw-r--r--firmware/app.lds1
-rw-r--r--firmware/common/disk.c7
-rw-r--r--firmware/export/config.h16
-rw-r--r--firmware/export/usb.h3
-rw-r--r--firmware/target/arm/olympus/mrobe-100/adc-mr100.c141
-rw-r--r--firmware/target/arm/olympus/mrobe-100/adc-target.h39
-rw-r--r--firmware/target/arm/olympus/mrobe-100/backlight-mr100.c57
-rw-r--r--firmware/target/arm/olympus/mrobe-100/backlight-target.h41
-rw-r--r--firmware/target/arm/olympus/mrobe-100/button-mr100.c60
-rw-r--r--firmware/target/arm/olympus/mrobe-100/button-target.h64
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-mr100.c192
-rw-r--r--firmware/target/arm/olympus/mrobe-100/power-mr100.c62
-rw-r--r--firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c59
-rwxr-xr-xtools/configure29
-rw-r--r--tools/scramble.c4
22 files changed, 798 insertions, 17 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 9b29605a83..38192316a6 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -162,4 +162,6 @@ keymaps/keymap-c200.c
keymaps/keymap-av300.c
#elif CONFIG_KEYPAD == MROBE500_PAD
keymaps/keymap-mr500.c
+#elif CONFIG_KEYPAD == MROBE100_PAD
+keymaps/keymap-mr100.c
#endif
diff --git a/apps/bitmaps/native/SOURCES b/apps/bitmaps/native/SOURCES
index 88b60e0654..a64c209672 100644
--- a/apps/bitmaps/native/SOURCES
+++ b/apps/bitmaps/native/SOURCES
@@ -2,7 +2,11 @@
/* Rockbox logo */
#if (LCD_DEPTH == 1)
+#if (LCD_WIDTH == 160)
+rockboxlogo.160x53x1.bmp
+#else
rockboxlogo.112x30x1.bmp
+#endif
#elif (LCD_WIDTH == 128) && (LCD_DEPTH == 16)
rockboxlogo.128x40x16.bmp
#elif (LCD_WIDTH == 132) && (LCD_DEPTH == 16)
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 8f24ac95f6..f5dbbf17a5 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -983,7 +983,8 @@ static bool dbg_spdif(void)
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
# define DEBUG_CANCEL BUTTON_REC
-#elif CONFIG_KEYPAD == IRIVER_H10_PAD
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
+ (CONFIG_KEYPAD == MROBE100_PAD)
# define DEBUG_CANCEL BUTTON_REW
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 34eaed5343..3e918ff62e 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3888,17 +3888,17 @@
<source>
*: none
e200: "Wheel Light Timeout"
- c200,gigabeatf: "Button Light Timeout"
+ c200,gigabeatf,mrobe100: "Button Light Timeout"
</source>
<dest>
*: none
e200: "Wheel Light Timeout"
- c200,gigabeatf: "Button Light Timeout"
+ c200,gigabeatf,mrobe100: "Button Light Timeout"
</dest>
<voice>
*: none
e200: "Wheel Light Timeout"
- c200,gigabeatf: "Button Light Timeout"
+ c200,gigabeatf,mrobe100: "Button Light Timeout"
</voice>
</phrase>
<phrase>
diff --git a/bootloader/SOURCES b/bootloader/SOURCES
index 11dfb667ae..b8d8d3ca6b 100644
--- a/bootloader/SOURCES
+++ b/bootloader/SOURCES
@@ -8,7 +8,8 @@ gigabeat.c
gigabeat-s.c
../firmware/target/arm/imx31/gigabeat-s/mmu-imx31.c
#elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \
- defined(SANSA_E200) || defined(SANSA_C200)
+ defined(SANSA_E200) || defined(SANSA_C200) || \
+ defined(MROBE_100)
#ifdef E200R_INSTALLER
main-e200r-installer.c
#else
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 3cf7691870..74c66233c0 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -54,6 +54,9 @@
#elif CONFIG_KEYPAD == SANSA_C200_PAD
#define BOOTLOADER_BOOT_OF BUTTON_LEFT
+#elif CONFIG_KEYPAD == MROBE100_PAD
+#define BOOTLOADER_BOOT_OF BUTTON_LEFT
+
#endif
/* Maximum allowed firmware image size. 10MB is more than enough */
@@ -444,8 +447,11 @@ void* main(void)
i2c_init();
_backlight_on();
#endif
+
+#if LCD_DEPTH > 1
lcd_set_foreground(LCD_WHITE);
lcd_set_background(LCD_BLACK);
+#endif
lcd_clear_display();
if (button_hold())
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 5424ed910e..ca06d8602f 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -652,6 +652,22 @@ target/arm/tms320dm320/dsp-dm320.c
#endif /* SIMULATOR */
#endif /* MROBE_500 */
+#ifdef MROBE_100
+#ifndef SIMULATOR
+target/arm/ata-as-arm.S
+target/arm/ata-pp5020.c
+target/arm/wmcodec-pp.c
+target/arm/i2s-pp.c
+target/arm/olympus/mrobe-100/adc-mr100.c
+target/arm/olympus/mrobe-100/backlight-mr100.c
+target/arm/olympus/mrobe-100/button-mr100.c
+target/arm/olympus/mrobe-100/lcd-mr100.c
+target/arm/olympus/mrobe-100/power-mr100.c
+target/arm/olympus/mrobe-100/powermgmt-mr100.c
+target/arm/usb-fw-pp502x.c
+#endif /* SIMULATOR */
+#endif /* MROBE_100 */
+
#ifdef ELIO_TPJ1022
#ifndef SIMULATOR
target/arm/ata-as-arm.S
diff --git a/firmware/app.lds b/firmware/app.lds
index 552b4bac45..9b83537dfe 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -156,6 +156,7 @@ SECTIONS
*(.icode)
*(.irodata)
*(.idata)
+ . = ALIGN(0x4);
_iramend = .;
} > IRAM AT> DRAM
diff --git a/firmware/common/disk.c b/firmware/common/disk.c
index cb35a8d7b0..9fb73f0070 100644
--- a/firmware/common/disk.c
+++ b/firmware/common/disk.c
@@ -137,7 +137,6 @@ static int get_free_volume(void)
int disk_mount(int drive)
{
- int i;
int mounted = 0; /* reset partition-on-drive flag */
int volume = get_free_volume();
struct partinfo* pinfo = disk_init(IF_MV(drive));
@@ -146,14 +145,14 @@ int disk_mount(int drive)
{
return 0;
}
-#ifndef ELIO_TPJ1022
+#if !defined(ELIO_TPJ1022) && !defined(MROBE_100)
/* The Elio's hard drive has no partition table and probing for partitions causes
Rockbox to crash - so we temporarily disable the probing until we fix the
real problem. */
#ifdef TOSHIBA_GIGABEAT_S
- i = 1; /* For the Gigabeat S, we mount the second partition */
+ int i = 1; /* For the Gigabeat S, we mount the second partition */
#else
- i = 0;
+ int i = 0;
#endif
for (; volume != -1 && i<4; i++)
{
diff --git a/firmware/export/config.h b/firmware/export/config.h
index f377697b70..a3c2390f84 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -71,10 +71,11 @@
#define SANSA_C200_PAD 14
#define ELIO_TPJ1022_PAD 15
#define ARCHOS_AV300_PAD 16
-#define MROBE500_PAD 17
-#define GIGABEAT_S_PAD 18
-#define LOGIK_DAX_PAD 19
-#define IAUDIO67_PAD 20
+#define MROBE100_PAD 17
+#define MROBE500_PAD 18
+#define GIGABEAT_S_PAD 19
+#define LOGIK_DAX_PAD 20
+#define IAUDIO67_PAD 21
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@@ -107,8 +108,9 @@
#define LCD_DSC25 16 /* as used by Archos AV300 */
#define LCD_C200 17 /* as used by Sandisk Sansa c200 */
#define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
-#define LCD_LOGIKDAX 19 /* as used by Logik DAX - SSD1815 */
-#define LCD_IAUDIO67 20 /* as used by iAudio 6/7 - unknown */
+#define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
+#define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
+#define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@@ -221,6 +223,8 @@
#include "config-c200.h"
#elif defined(ELIO_TPJ1022)
#include "config-tpj1022.h"
+#elif defined(MROBE_100)
+#include "config-mrobe100.h"
#elif defined(MROBE_500)
#include "config-mrobe500.h"
#elif defined(LOGIK_DAX)
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 0977ff4d7d..c2487f3563 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -50,7 +50,8 @@
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
#define USBPOWER_BUTTON BUTTON_MENU
#define USBPOWER_BTN_IGNORE BUTTON_BACK
-#elif CONFIG_KEYPAD == IRIVER_H10_PAD
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
+ (CONFIG_KEYPAD == MROBE100_PAD)
#define USBPOWER_BUTTON BUTTON_RIGHT
#define USBPOWER_BTN_IGNORE BUTTON_POWER
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
diff --git a/firmware/target/arm/olympus/mrobe-100/adc-mr100.c b/firmware/target/arm/olympus/mrobe-100/adc-mr100.c
new file mode 100644
index 0000000000..f63e8b8013
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/adc-mr100.c
@@ -0,0 +1,141 @@
+/***************************************************************************
+ * __________ __ ___.
+ * 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.
+ *
+ ****************************************************************************/
+#include "config.h"
+#include "cpu.h"
+#include "system.h"
+#include "kernel.h"
+#include "thread.h"
+#include "adc.h"
+
+static unsigned short adcdata[NUM_ADC_CHANNELS];
+
+/* Scan ADC so that adcdata[channel] gets updated. */
+unsigned short adc_scan(int channel)
+{
+ unsigned int adc_data_1;
+ unsigned int adc_data_2;
+
+ /* Start conversion */
+ ADC_ADDR |= 0x80000000;
+
+ /* Wait for conversion to complete */
+ while((ADC_STATUS & (0x40<<8*channel))==0);
+
+ /* Stop conversion */
+ ADC_ADDR &=~ 0x80000000;
+
+ /* ADC_DATA_1 and ADC_DATA_2 are both four bytes, one byte per channel.
+ For each channel, ADC_DATA_1 stores the 8-bit msb, ADC_DATA_2 stores the
+ 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */
+ adc_data_1 = ((ADC_DATA_1 >> (8*channel)) & 0xff);
+ adc_data_2 = ((ADC_DATA_2 >> (8*channel+6)) & 0x3);
+
+ adcdata[channel] = (adc_data_1<<2 | adc_data_2);
+
+ /* ADC values read low if PLL is enabled */
+ if(PLL_CONTROL & 0x80000000){
+ adcdata[channel] += 0x14;
+ if(adcdata[channel] > 0x400)
+ adcdata[channel] = 0x400;
+ }
+
+ return adcdata[channel];
+}
+
+/* Read 10-bit channel data */
+unsigned short adc_read(int channel)
+{
+ return adcdata[channel];
+}
+
+static int adc_counter;
+
+static void adc_tick(void)
+{
+ if(++adc_counter == HZ)
+ {
+ adc_counter = 0;
+ adc_scan(ADC_BATTERY);
+ adc_scan(ADC_UNKNOWN_1);
+ adc_scan(ADC_REMOTE);
+ adc_scan(ADC_SCROLLPAD);
+ }
+}
+
+/* Figured out from how the OF does things */
+void adc_init(void)
+{
+ ADC_INIT |= 1;
+ ADC_INIT |= 0x40000000;
+ udelay(100);
+
+ /* Reset ADC */
+ DEV_RS2 |= 0x20;
+ udelay(100);
+
+ DEV_RS2 &=~ 0x20;
+ udelay(100);
+
+ /* Enable ADC */
+ DEV_EN2 |= 0x20;
+ udelay(100);
+
+ ADC_CLOCK_SRC |= 0x3;
+ udelay(100);
+
+ ADC_ADDR |= 0x40;
+ ADC_ADDR |= 0x20000000;
+ udelay(100);
+
+ ADC_INIT;
+ ADC_INIT = 0;
+ udelay(100);
+
+ ADC_STATUS = 0;
+
+ /* Enable channel 0 (battery) */
+ DEV_INIT1 &=~0x3;
+ ADC_ADDR |= 0x1000000;
+ ADC_STATUS |= 0x20;
+
+ /* Enable channel 1 (unknown, temperature?) */
+ DEV_INIT1 &=~30;
+ ADC_ADDR |= 0x2000000;
+ ADC_STATUS |= 0x2000;
+
+ /* Enable channel 2 (remote) */
+ DEV_INIT1 &=~0x300;
+ DEV_INIT1 |= 0x100;
+ ADC_ADDR |= 0x4000000;
+ ADC_STATUS |= 0x200000;
+
+ /* Enable channel 3 (scroll pad) */
+ DEV_INIT1 &=~0x3000;
+ DEV_INIT1 |= 0x1000;
+ ADC_ADDR |= 0x8000000;
+ ADC_STATUS |= 0x20000000;
+
+ /* Force a scan of all channels to get initial values */
+ adc_scan(ADC_BATTERY);
+ adc_scan(ADC_UNKNOWN_1);
+ adc_scan(ADC_REMOTE);
+ adc_scan(ADC_SCROLLPAD);
+
+ tick_add_task(adc_tick);
+}
diff --git a/firmware/target/arm/olympus/mrobe-100/adc-target.h b/firmware/target/arm/olympus/mrobe-100/adc-target.h
new file mode 100644
index 0000000000..f761e761ef
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/adc-target.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * __________ __ ___.
+ * 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.
+ *
+ ****************************************************************************/
+#ifndef _ADC_TARGET_H_
+#define _ADC_TARGET_H_
+
+#define ADC_ADDR (*(volatile unsigned long*)(0x7000ad00))
+#define ADC_STATUS (*(volatile unsigned long*)(0x7000ad04))
+#define ADC_DATA_1 (*(volatile unsigned long*)(0x7000ad20))
+#define ADC_DATA_2 (*(volatile unsigned long*)(0x7000ad24))
+#define ADC_INIT (*(volatile unsigned long*)(0x7000ad2c))
+
+#define NUM_ADC_CHANNELS 4
+
+#define ADC_BATTERY 0
+#define ADC_UNKNOWN_1 1
+#define ADC_REMOTE 2
+#define ADC_SCROLLPAD 3
+#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
+
+/* Force a scan now */
+unsigned short adc_scan(int channel);
+
+#endif
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c
new file mode 100644
index 0000000000..10a7f666e5
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Mark Arigo
+ *
+ * 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 "backlight-target.h"
+#include "system.h"
+#include "lcd.h"
+#include "backlight.h"
+#include "i2c-pp.h"
+
+void _backlight_on(void)
+{
+}
+
+void _backlight_off(void)
+{
+}
+
+void _buttonlight_on(void)
+{
+ /* turn on all touchpad leds */
+ GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL;
+
+#if 0
+ /* Writing to 0x7000a010 controls the brightness of the leds.
+ This routine fades the leds from dim to bright, like when
+ you first turn the unit on. */
+ unsigned long val = 0x80ff08ff;
+ int i = 0;
+ for (i = 0; i < 16; i++)
+ outl(val, 0x7000a010);
+ udelay(100000);
+ val -= 0x110000;
+ }
+#endif
+}
+
+void _buttonlight_off(void)
+{
+ /* turn off all touchpad leds */
+ GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL;
+}
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-target.h b/firmware/target/arm/olympus/mrobe-100/backlight-target.h
new file mode 100644
index 0000000000..e6c8387222
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/backlight-target.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Mark Arigo
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef BACKLIGHT_TARGET_H
+#define BACKLIGHT_TARGET_H
+
+#define _backlight_init() true
+void _backlight_on(void);
+void _backlight_off(void);
+
+/* Button lights are controlled by GPIOA_OUTPUT_VAL */
+#define BUTTONLIGHT_PLAY 0x01
+#define BUTTONLIGHT_MENU 0x02
+#define BUTTONLIGHT_DISPLAY 0x04
+#define BUTTONLIGHT_LEFT 0x08
+#define BUTTONLIGHT_RIGHT 0x10
+#define BUTTONLIGHT_SCROLL 0x20
+#define BUTTONLIGHT_ALL (BUTTONLIGHT_PLAY | BUTTONLIGHT_MENU | \
+ BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \
+ BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL)
+
+void _buttonlight_on(void);
+void _buttonlight_off(void);
+
+#endif
diff --git a/firmware/target/arm/olympus/mrobe-100/button-mr100.c b/firmware/target/arm/olympus/mrobe-100/button-mr100.c
new file mode 100644
index 0000000000..141a6d5b0c
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/button-mr100.c
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Mark Arigo
+ *
+ * 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 <stdlib.h>
+#include "config.h"
+#include "cpu.h"
+#include "system.h"
+#include "button.h"
+#include "kernel.h"
+#include "backlight.h"
+#include "backlight-target.h"
+#include "system.h"
+
+void button_int(void)
+{
+}
+
+void button_init_device(void)
+{
+ /* taken from the mr-100 bootloader (offset 0x1e72) */
+ //~ DEV_EN |= 0x20000; /* enable the touchpad ?? */
+
+ /* enable touchpad leds */
+ GPIOA_ENABLE |= 0xff;
+ GPIOA_OUTPUT_EN |= BUTTONLIGHT_ALL;
+}
+
+/*
+ * Get button pressed from hardware
+ */
+int button_read_device(void)
+{
+ return BUTTON_NONE;
+}
+
+bool button_hold(void)
+{
+ return (GPIOD_INPUT_VAL & BUTTON_HOLD) ? false : true;
+}
+
+bool headphones_inserted(void)
+{
+ return (GPIOD_INPUT_VAL & 0x80) ? true : false;
+}
diff --git a/firmware/target/arm/olympus/mrobe-100/button-target.h b/firmware/target/arm/olympus/mrobe-100/button-target.h
new file mode 100644
index 0000000000..99f17bb09b
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/button-target.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Mark Arigo
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef _BUTTON_TARGET_H_
+#define _BUTTON_TARGET_H_
+
+#include <stdbool.h>
+#include "config.h"
+
+#define HAS_BUTTON_HOLD
+
+bool button_hold(void);
+void button_init_device(void);
+int button_read_device(void);
+
+/* Power button is on GPIOA */
+#define BUTTON_POWER 0x80
+#define POWEROFF_BUTTON BUTTON_POWER
+#define POWEROFF_COUNT 10
+
+/* Hold button is on GPIOD */
+#define BUTTON_HOLD 0x10
+
+/* FIXME: Until the buttons are figured out, we use the button definitions
+ for the H10 keypad & remote. THESE ARE NOT CORRECT! */
+
+/* Main unit's buttons */
+#define BUTTON_LEFT 0x00000002
+#define BUTTON_RIGHT 0x00000004
+#define BUTTON_REW 0x00000008
+#define BUTTON_PLAY 0x00000010
+#define BUTTON_FF 0x00000020
+#define BUTTON_SCROLL_UP 0x00000040
+#define BUTTON_SCROLL_DOWN 0x00000080
+#define BUTTON_MAIN (BUTTON_POWER|BUTTON_O|BUTTON_BACK|BUTTON_REW\
+ |BUTTON_PLAY|BUTTON_FF)
+
+/* Remote control's buttons */
+#define BUTTON_RC_REW 0x00080000
+#define BUTTON_RC_PLAY 0x00100000
+#define BUTTON_RC_FF 0x00200000
+#define BUTTON_RC_VOL_UP 0x00400000
+#define BUTTON_RC_VOL_DOWN 0x00800000
+#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN\
+ |BUTTON_RC_REW|BUTTON_RC_FF)
+#define RC_POWEROFF_BUTTON BUTTON_RC_PLAY
+
+#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
new file mode 100644
index 0000000000..501a0942e5
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
@@ -0,0 +1,192 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Mark Arigo
+ *
+ * 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 "cpu.h"
+#include "lcd.h"
+#include "kernel.h"
+#include "system.h"
+
+/* send LCD data */
+static void lcd_send_data(unsigned data)
+{
+ while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */
+ LCD1_DATA = data;
+}
+
+/* send LCD command */
+static void lcd_send_command(unsigned cmd)
+{
+ while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */
+ LCD1_CMD = cmd;
+}
+
+/* LCD init */
+void lcd_init_device(void)
+{
+ int i;
+
+ DEV_INIT1 &= ~0xfc000000;
+
+ i = DEV_INIT1;
+ DEV_INIT1 = i;
+
+ DEV_INIT2 &= ~0x400;
+ udelay(10000);
+
+ LCD1_CONTROL &= ~0x4;
+ udelay(15);
+
+ LCD1_CONTROL |= 0x4;
+ udelay(10);
+
+ LCD1_CONTROL = 0x690;
+ LCD1_CONTROL = 0x694;
+
+ /* OF just reads these */
+ i = LCD1_CONTROL;
+ i = inl(0x70003004);
+ i = LCD1_CMD;
+ i = inl(0x7000300c);
+
+#if 0
+ /* this is skipped in the OF */
+ LCD1_CONTROL &= ~0x200;
+ LCD1_CONTROL &= ~0x800;
+ LCD1_CONTROL &= ~0x400;
+#endif
+
+ LCD1_CONTROL |= 0x1;
+ udelay(15000);
+
+ lcd_send_command(0xe2);
+ lcd_send_command(0x2f);
+ lcd_send_command(0x26);
+ lcd_send_command(0xcc);
+ lcd_send_command(0xe8);
+ lcd_send_command(0x81);
+ lcd_send_command(0);
+ lcd_send_command(0x40);
+ lcd_send_command(0xa6);
+ lcd_send_command(0x88);
+ lcd_send_command(0xb0);
+ lcd_send_command(0x10);
+ lcd_send_command(0);
+}
+
+/*** hardware configuration ***/
+int lcd_default_contrast(void)
+{
+ return DEFAULT_CONTRAST_SETTING;
+}
+
+void lcd_set_contrast(int val)
+{
+ lcd_send_command(0x81);
+ lcd_send_command(val);
+}
+
+void lcd_set_invert_display(bool yesno)
+{
+ /* TODO: Implement lcd_set_invert_display() */
+ (void)yesno;
+}
+
+/* turn the display upside down (call lcd_update() afterwards) */
+void lcd_set_flip(bool yesno)
+{
+ /* TODO: Implement lcd_set_flip() */
+ (void)yesno;
+}
+
+/*** update functions ***/
+
+/* Performance function that works with an external buffer
+ note that by and bheight are in 4-pixel units! */
+void lcd_blit(const fb_data* data, int x, int by, int width,
+ int bheight, int stride)
+{
+ /* TODO: Implement lcd_blit() */
+ (void)data;
+ (void)x;
+ (void)by;
+ (void)width;
+ (void)bheight;
+ (void)stride;
+}
+
+/* Performance function to blit a YUV bitmap directly to the LCD */
+void lcd_yuv_blit(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;
+}
+
+/* Update the display.
+ This must be called after all other LCD functions that change the display. */
+void lcd_update(void)
+{
+ lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
+}
+
+/* Update a fraction of the display. */
+void lcd_update_rect(int x0, int y0, int width, int height)
+{
+ unsigned char *addr;
+ unsigned int cmd0, cmd1, cmd2;
+ int r, c, x1, y1, start_row, last_row;
+
+ x1 = (x0 + width) - 1;
+ y1 = (y0 + height) - 1;
+ if ((x1 <= 0) || (y1 <= 0))
+ return;
+
+ if(x1 >= LCD_WIDTH)
+ x1 = LCD_WIDTH - 1;
+
+ if(y1 >= LCD_HEIGHT)
+ y1 = LCD_HEIGHT - 1;
+
+ start_row = y0/8;
+ last_row = y1/8;
+
+ cmd1 = (x0 & 0xff) >> 4;
+ cmd1 = (cmd1 + 5) | 0x10;
+ cmd2 = x0 & 0xf;
+
+ for (r = start_row; r <= last_row; r++) {
+ cmd0 = (r & 0xff) | 0xb0;
+ lcd_send_command(cmd0);
+ lcd_send_command(cmd1);
+ lcd_send_command(cmd2);
+
+ addr = (unsigned char*)&lcd_framebuffer[r][x0];
+ for (c = x0; c <= x1; c++)
+ lcd_send_data(*(addr++));
+ }
+
+ lcd_send_command(0xaf);
+}
diff --git a/firmware/target/arm/olympus/mrobe-100/power-mr100.c b/firmware/target/arm/olympus/mrobe-100/power-mr100.c
new file mode 100644
index 0000000000..1fb2ecb958
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/power-mr100.c
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * __________ __ ___.
+ * 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.
+ *
+ ****************************************************************************/
+
+#include "config.h"
+#include "cpu.h"
+#include <stdbool.h>
+#include "adc.h"
+#include "kernel.h"
+#include "system.h"
+#include "power.h"
+#include "logf.h"
+#include "usb.h"
+
+#if CONFIG_CHARGING == CHARGING_CONTROL
+bool charger_enabled;
+#endif
+
+void power_init(void)
+{
+}
+
+bool charger_inserted(void)
+{
+ return false;
+}
+
+void ide_power_enable(bool on)
+{
+ (void)on;
+ /* We do nothing on the iPod */
+}
+
+
+bool ide_powered(void)
+{
+ /* pretend we are always powered - we don't turn it off on the ipod */
+ return true;
+}
+
+void power_off(void)
+{
+ /* Give things a second to settle before cutting power */
+ sleep(HZ);
+
+ //GPIOF_OUTPUT_VAL &=~ 0x20;
+}
diff --git a/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c b/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c
new file mode 100644
index 0000000000..1b6a52f517
--- /dev/null
+++ b/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
+ * Revisions copyright (C) 2005 by Gerald Van Baren
+ *
+ * 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 "adc.h"
+#include "powermgmt.h"
+
+/* FIXME: All voltages copied from H10/Tatung Elio. This will need changing
+ proper power management. */
+
+const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
+{
+ 3760
+};
+
+const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
+{
+ 3650
+};
+
+/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
+const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
+{
+ { 3760, 3800, 3850, 3870, 3900, 3950, 4020, 4070, 4110, 4180, 4240 }
+};
+
+#if CONFIG_CHARGING
+/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
+const unsigned short percent_to_volt_charge[11] =
+{
+ 3990, 4030, 4060, 4080, 4100, 4120, 4150, 4180, 4220, 4260, 4310
+};
+#endif /* CONFIG_CHARGING */
+
+#define BATTERY_SCALE_FACTOR 4650
+/* full-scale ADC readout (2^10) in millivolt */
+
+/* Returns battery voltage from ADC [millivolts] */
+unsigned int battery_adc_voltage(void)
+{
+ return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
+}
diff --git a/tools/configure b/tools/configure
index c2c9dca845..5055a0f465 100755
--- a/tools/configure
+++ b/tools/configure
@@ -603,6 +603,7 @@ cat <<EOF
==Tatung== ==Olympus== ==Logik==
60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB
+ 71) M:Robe 100
EOF
buildfor=`input`;
@@ -1292,6 +1293,34 @@ EOF
t_model="mrobe-500"
;;
+ 71|mrobe100)
+ target_id=31
+ archos="mrobe100"
+ target="-DMROBE_100"
+ memory=32 # always
+ arm7tdmicc
+ tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS"
+ bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
+ bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
+ bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
+ bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
+ output="rockbox.mi4"
+ appextra="recorder:gui"
+ archosrom=""
+ flash=""
+ plugins=""
+ swcodec="yes"
+ boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL"
+ bootoutput="pp5020.mi4"
+ # toolset is the tools within the tools directory that we build for
+ # this particular target.
+ toolset="$genericbitmaptools scramble"
+ # architecture, manufacturer and model for the target-tree build
+ t_cpu="arm"
+ t_manufacturer="olympus"
+ t_model="mrobe-100"
+ ;;
+
80|logikdax)
target_id=31
archos="logikdax"
diff --git a/tools/scramble.c b/tools/scramble.c
index ba0eda338a..b5aba3fbaa 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -107,7 +107,7 @@ void usage(void)
"\t-add=X Rockbox generic \"add-up\" checksum format\n"
"\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n"
"\t ip3g, ip4g, mini, iax5, h10, h10_5gb, tpj2,\n"
- "\t c200, e200, giga, m500)\n"
+ "\t c200, e200, giga, m100, m500)\n"
"\nNo option results in Archos standard player/recorder format.\n");
exit(1);
@@ -253,6 +253,8 @@ int main (int argc, char** argv)
modelnum = 21;
else if(!strcmp(&argv[1][5], "m500"))
modelnum = 22;
+ else if(!strcmp(&argv[1][5], "m100"))
+ modelnum = 23;
else {
fprintf(stderr, "unsupported model: %s\n", &argv[1][5]);
return 2;