diff options
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/bitmaps/native/SOURCES | 4 | ||||
-rw-r--r-- | apps/debug_menu.c | 3 | ||||
-rw-r--r-- | apps/lang/english.lang | 6 | ||||
-rw-r--r-- | bootloader/SOURCES | 3 | ||||
-rw-r--r-- | bootloader/main-pp.c | 6 | ||||
-rw-r--r-- | firmware/SOURCES | 16 | ||||
-rw-r--r-- | firmware/app.lds | 1 | ||||
-rw-r--r-- | firmware/common/disk.c | 7 | ||||
-rw-r--r-- | firmware/export/config.h | 16 | ||||
-rw-r--r-- | firmware/export/usb.h | 3 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/adc-mr100.c | 141 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/adc-target.h | 39 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | 57 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-target.h | 41 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/button-mr100.c | 60 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/button-target.h | 64 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/lcd-mr100.c | 192 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/power-mr100.c | 62 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c | 59 | ||||
-rwxr-xr-x | tools/configure | 29 | ||||
-rw-r--r-- | tools/scramble.c | 4 |
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 | |||
162 | keymaps/keymap-av300.c | 162 | keymaps/keymap-av300.c |
163 | #elif CONFIG_KEYPAD == MROBE500_PAD | 163 | #elif CONFIG_KEYPAD == MROBE500_PAD |
164 | keymaps/keymap-mr500.c | 164 | keymaps/keymap-mr500.c |
165 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
166 | keymaps/keymap-mr100.c | ||
165 | #endif | 167 | #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 @@ | |||
2 | 2 | ||
3 | /* Rockbox logo */ | 3 | /* Rockbox logo */ |
4 | #if (LCD_DEPTH == 1) | 4 | #if (LCD_DEPTH == 1) |
5 | #if (LCD_WIDTH == 160) | ||
6 | rockboxlogo.160x53x1.bmp | ||
7 | #else | ||
5 | rockboxlogo.112x30x1.bmp | 8 | rockboxlogo.112x30x1.bmp |
9 | #endif | ||
6 | #elif (LCD_WIDTH == 128) && (LCD_DEPTH == 16) | 10 | #elif (LCD_WIDTH == 128) && (LCD_DEPTH == 16) |
7 | rockboxlogo.128x40x16.bmp | 11 | rockboxlogo.128x40x16.bmp |
8 | #elif (LCD_WIDTH == 132) && (LCD_DEPTH == 16) | 12 | #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) | |||
983 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | 983 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD |
984 | # define DEBUG_CANCEL BUTTON_REC | 984 | # define DEBUG_CANCEL BUTTON_REC |
985 | 985 | ||
986 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | 986 | #elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \ |
987 | (CONFIG_KEYPAD == MROBE100_PAD) | ||
987 | # define DEBUG_CANCEL BUTTON_REW | 988 | # define DEBUG_CANCEL BUTTON_REW |
988 | 989 | ||
989 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ | 990 | #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 @@ | |||
3888 | <source> | 3888 | <source> |
3889 | *: none | 3889 | *: none |
3890 | e200: "Wheel Light Timeout" | 3890 | e200: "Wheel Light Timeout" |
3891 | c200,gigabeatf: "Button Light Timeout" | 3891 | c200,gigabeatf,mrobe100: "Button Light Timeout" |
3892 | </source> | 3892 | </source> |
3893 | <dest> | 3893 | <dest> |
3894 | *: none | 3894 | *: none |
3895 | e200: "Wheel Light Timeout" | 3895 | e200: "Wheel Light Timeout" |
3896 | c200,gigabeatf: "Button Light Timeout" | 3896 | c200,gigabeatf,mrobe100: "Button Light Timeout" |
3897 | </dest> | 3897 | </dest> |
3898 | <voice> | 3898 | <voice> |
3899 | *: none | 3899 | *: none |
3900 | e200: "Wheel Light Timeout" | 3900 | e200: "Wheel Light Timeout" |
3901 | c200,gigabeatf: "Button Light Timeout" | 3901 | c200,gigabeatf,mrobe100: "Button Light Timeout" |
3902 | </voice> | 3902 | </voice> |
3903 | </phrase> | 3903 | </phrase> |
3904 | <phrase> | 3904 | <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 | |||
8 | gigabeat-s.c | 8 | gigabeat-s.c |
9 | ../firmware/target/arm/imx31/gigabeat-s/mmu-imx31.c | 9 | ../firmware/target/arm/imx31/gigabeat-s/mmu-imx31.c |
10 | #elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \ | 10 | #elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \ |
11 | defined(SANSA_E200) || defined(SANSA_C200) | 11 | defined(SANSA_E200) || defined(SANSA_C200) || \ |
12 | defined(MROBE_100) | ||
12 | #ifdef E200R_INSTALLER | 13 | #ifdef E200R_INSTALLER |
13 | main-e200r-installer.c | 14 | main-e200r-installer.c |
14 | #else | 15 | #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 @@ | |||
54 | #elif CONFIG_KEYPAD == SANSA_C200_PAD | 54 | #elif CONFIG_KEYPAD == SANSA_C200_PAD |
55 | #define BOOTLOADER_BOOT_OF BUTTON_LEFT | 55 | #define BOOTLOADER_BOOT_OF BUTTON_LEFT |
56 | 56 | ||
57 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
58 | #define BOOTLOADER_BOOT_OF BUTTON_LEFT | ||
59 | |||
57 | #endif | 60 | #endif |
58 | 61 | ||
59 | /* Maximum allowed firmware image size. 10MB is more than enough */ | 62 | /* Maximum allowed firmware image size. 10MB is more than enough */ |
@@ -444,8 +447,11 @@ void* main(void) | |||
444 | i2c_init(); | 447 | i2c_init(); |
445 | _backlight_on(); | 448 | _backlight_on(); |
446 | #endif | 449 | #endif |
450 | |||
451 | #if LCD_DEPTH > 1 | ||
447 | lcd_set_foreground(LCD_WHITE); | 452 | lcd_set_foreground(LCD_WHITE); |
448 | lcd_set_background(LCD_BLACK); | 453 | lcd_set_background(LCD_BLACK); |
454 | #endif | ||
449 | lcd_clear_display(); | 455 | lcd_clear_display(); |
450 | 456 | ||
451 | if (button_hold()) | 457 | 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 | |||
652 | #endif /* SIMULATOR */ | 652 | #endif /* SIMULATOR */ |
653 | #endif /* MROBE_500 */ | 653 | #endif /* MROBE_500 */ |
654 | 654 | ||
655 | #ifdef MROBE_100 | ||
656 | #ifndef SIMULATOR | ||
657 | target/arm/ata-as-arm.S | ||
658 | target/arm/ata-pp5020.c | ||
659 | target/arm/wmcodec-pp.c | ||
660 | target/arm/i2s-pp.c | ||
661 | target/arm/olympus/mrobe-100/adc-mr100.c | ||
662 | target/arm/olympus/mrobe-100/backlight-mr100.c | ||
663 | target/arm/olympus/mrobe-100/button-mr100.c | ||
664 | target/arm/olympus/mrobe-100/lcd-mr100.c | ||
665 | target/arm/olympus/mrobe-100/power-mr100.c | ||
666 | target/arm/olympus/mrobe-100/powermgmt-mr100.c | ||
667 | target/arm/usb-fw-pp502x.c | ||
668 | #endif /* SIMULATOR */ | ||
669 | #endif /* MROBE_100 */ | ||
670 | |||
655 | #ifdef ELIO_TPJ1022 | 671 | #ifdef ELIO_TPJ1022 |
656 | #ifndef SIMULATOR | 672 | #ifndef SIMULATOR |
657 | target/arm/ata-as-arm.S | 673 | 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 | |||
156 | *(.icode) | 156 | *(.icode) |
157 | *(.irodata) | 157 | *(.irodata) |
158 | *(.idata) | 158 | *(.idata) |
159 | . = ALIGN(0x4); | ||
159 | _iramend = .; | 160 | _iramend = .; |
160 | } > IRAM AT> DRAM | 161 | } > IRAM AT> DRAM |
161 | 162 | ||
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) | |||
137 | 137 | ||
138 | int disk_mount(int drive) | 138 | int disk_mount(int drive) |
139 | { | 139 | { |
140 | int i; | ||
141 | int mounted = 0; /* reset partition-on-drive flag */ | 140 | int mounted = 0; /* reset partition-on-drive flag */ |
142 | int volume = get_free_volume(); | 141 | int volume = get_free_volume(); |
143 | struct partinfo* pinfo = disk_init(IF_MV(drive)); | 142 | struct partinfo* pinfo = disk_init(IF_MV(drive)); |
@@ -146,14 +145,14 @@ int disk_mount(int drive) | |||
146 | { | 145 | { |
147 | return 0; | 146 | return 0; |
148 | } | 147 | } |
149 | #ifndef ELIO_TPJ1022 | 148 | #if !defined(ELIO_TPJ1022) && !defined(MROBE_100) |
150 | /* The Elio's hard drive has no partition table and probing for partitions causes | 149 | /* The Elio's hard drive has no partition table and probing for partitions causes |
151 | Rockbox to crash - so we temporarily disable the probing until we fix the | 150 | Rockbox to crash - so we temporarily disable the probing until we fix the |
152 | real problem. */ | 151 | real problem. */ |
153 | #ifdef TOSHIBA_GIGABEAT_S | 152 | #ifdef TOSHIBA_GIGABEAT_S |
154 | i = 1; /* For the Gigabeat S, we mount the second partition */ | 153 | int i = 1; /* For the Gigabeat S, we mount the second partition */ |
155 | #else | 154 | #else |
156 | i = 0; | 155 | int i = 0; |
157 | #endif | 156 | #endif |
158 | for (; volume != -1 && i<4; i++) | 157 | for (; volume != -1 && i<4; i++) |
159 | { | 158 | { |
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 @@ | |||
71 | #define SANSA_C200_PAD 14 | 71 | #define SANSA_C200_PAD 14 |
72 | #define ELIO_TPJ1022_PAD 15 | 72 | #define ELIO_TPJ1022_PAD 15 |
73 | #define ARCHOS_AV300_PAD 16 | 73 | #define ARCHOS_AV300_PAD 16 |
74 | #define MROBE500_PAD 17 | 74 | #define MROBE100_PAD 17 |
75 | #define GIGABEAT_S_PAD 18 | 75 | #define MROBE500_PAD 18 |
76 | #define LOGIK_DAX_PAD 19 | 76 | #define GIGABEAT_S_PAD 19 |
77 | #define IAUDIO67_PAD 20 | 77 | #define LOGIK_DAX_PAD 20 |
78 | #define IAUDIO67_PAD 21 | ||
78 | 79 | ||
79 | /* CONFIG_REMOTE_KEYPAD */ | 80 | /* CONFIG_REMOTE_KEYPAD */ |
80 | #define H100_REMOTE 1 | 81 | #define H100_REMOTE 1 |
@@ -107,8 +108,9 @@ | |||
107 | #define LCD_DSC25 16 /* as used by Archos AV300 */ | 108 | #define LCD_DSC25 16 /* as used by Archos AV300 */ |
108 | #define LCD_C200 17 /* as used by Sandisk Sansa c200 */ | 109 | #define LCD_C200 17 /* as used by Sandisk Sansa c200 */ |
109 | #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */ | 110 | #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */ |
110 | #define LCD_LOGIKDAX 19 /* as used by Logik DAX - SSD1815 */ | 111 | #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */ |
111 | #define LCD_IAUDIO67 20 /* as used by iAudio 6/7 - unknown */ | 112 | #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */ |
113 | #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */ | ||
112 | 114 | ||
113 | /* LCD_PIXELFORMAT */ | 115 | /* LCD_PIXELFORMAT */ |
114 | #define HORIZONTAL_PACKING 1 | 116 | #define HORIZONTAL_PACKING 1 |
@@ -221,6 +223,8 @@ | |||
221 | #include "config-c200.h" | 223 | #include "config-c200.h" |
222 | #elif defined(ELIO_TPJ1022) | 224 | #elif defined(ELIO_TPJ1022) |
223 | #include "config-tpj1022.h" | 225 | #include "config-tpj1022.h" |
226 | #elif defined(MROBE_100) | ||
227 | #include "config-mrobe100.h" | ||
224 | #elif defined(MROBE_500) | 228 | #elif defined(MROBE_500) |
225 | #include "config-mrobe500.h" | 229 | #include "config-mrobe500.h" |
226 | #elif defined(LOGIK_DAX) | 230 | #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 @@ | |||
50 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD | 50 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD |
51 | #define USBPOWER_BUTTON BUTTON_MENU | 51 | #define USBPOWER_BUTTON BUTTON_MENU |
52 | #define USBPOWER_BTN_IGNORE BUTTON_BACK | 52 | #define USBPOWER_BTN_IGNORE BUTTON_BACK |
53 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | 53 | #elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \ |
54 | (CONFIG_KEYPAD == MROBE100_PAD) | ||
54 | #define USBPOWER_BUTTON BUTTON_RIGHT | 55 | #define USBPOWER_BUTTON BUTTON_RIGHT |
55 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | 56 | #define USBPOWER_BTN_IGNORE BUTTON_POWER |
56 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ | 57 | #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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "config.h" | ||
20 | #include "cpu.h" | ||
21 | #include "system.h" | ||
22 | #include "kernel.h" | ||
23 | #include "thread.h" | ||
24 | #include "adc.h" | ||
25 | |||
26 | static unsigned short adcdata[NUM_ADC_CHANNELS]; | ||
27 | |||
28 | /* Scan ADC so that adcdata[channel] gets updated. */ | ||
29 | unsigned short adc_scan(int channel) | ||
30 | { | ||
31 | unsigned int adc_data_1; | ||
32 | unsigned int adc_data_2; | ||
33 | |||
34 | /* Start conversion */ | ||
35 | ADC_ADDR |= 0x80000000; | ||
36 | |||
37 | /* Wait for conversion to complete */ | ||
38 | while((ADC_STATUS & (0x40<<8*channel))==0); | ||
39 | |||
40 | /* Stop conversion */ | ||
41 | ADC_ADDR &=~ 0x80000000; | ||
42 | |||
43 | /* ADC_DATA_1 and ADC_DATA_2 are both four bytes, one byte per channel. | ||
44 | For each channel, ADC_DATA_1 stores the 8-bit msb, ADC_DATA_2 stores the | ||
45 | 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */ | ||
46 | adc_data_1 = ((ADC_DATA_1 >> (8*channel)) & 0xff); | ||
47 | adc_data_2 = ((ADC_DATA_2 >> (8*channel+6)) & 0x3); | ||
48 | |||
49 | adcdata[channel] = (adc_data_1<<2 | adc_data_2); | ||
50 | |||
51 | /* ADC values read low if PLL is enabled */ | ||
52 | if(PLL_CONTROL & 0x80000000){ | ||
53 | adcdata[channel] += 0x14; | ||
54 | if(adcdata[channel] > 0x400) | ||
55 | adcdata[channel] = 0x400; | ||
56 | } | ||
57 | |||
58 | return adcdata[channel]; | ||
59 | } | ||
60 | |||
61 | /* Read 10-bit channel data */ | ||
62 | unsigned short adc_read(int channel) | ||
63 | { | ||
64 | return adcdata[channel]; | ||
65 | } | ||
66 | |||
67 | static int adc_counter; | ||
68 | |||
69 | static void adc_tick(void) | ||
70 | { | ||
71 | if(++adc_counter == HZ) | ||
72 | { | ||
73 | adc_counter = 0; | ||
74 | adc_scan(ADC_BATTERY); | ||
75 | adc_scan(ADC_UNKNOWN_1); | ||
76 | adc_scan(ADC_REMOTE); | ||
77 | adc_scan(ADC_SCROLLPAD); | ||
78 | } | ||
79 | } | ||
80 | |||
81 | /* Figured out from how the OF does things */ | ||
82 | void adc_init(void) | ||
83 | { | ||
84 | ADC_INIT |= 1; | ||
85 | ADC_INIT |= 0x40000000; | ||
86 | udelay(100); | ||
87 | |||
88 | /* Reset ADC */ | ||
89 | DEV_RS2 |= 0x20; | ||
90 | udelay(100); | ||
91 | |||
92 | DEV_RS2 &=~ 0x20; | ||
93 | udelay(100); | ||
94 | |||
95 | /* Enable ADC */ | ||
96 | DEV_EN2 |= 0x20; | ||
97 | udelay(100); | ||
98 | |||
99 | ADC_CLOCK_SRC |= 0x3; | ||
100 | udelay(100); | ||
101 | |||
102 | ADC_ADDR |= 0x40; | ||
103 | ADC_ADDR |= 0x20000000; | ||
104 | udelay(100); | ||
105 | |||
106 | ADC_INIT; | ||
107 | ADC_INIT = 0; | ||
108 | udelay(100); | ||
109 | |||
110 | ADC_STATUS = 0; | ||
111 | |||
112 | /* Enable channel 0 (battery) */ | ||
113 | DEV_INIT1 &=~0x3; | ||
114 | ADC_ADDR |= 0x1000000; | ||
115 | ADC_STATUS |= 0x20; | ||
116 | |||
117 | /* Enable channel 1 (unknown, temperature?) */ | ||
118 | DEV_INIT1 &=~30; | ||
119 | ADC_ADDR |= 0x2000000; | ||
120 | ADC_STATUS |= 0x2000; | ||
121 | |||
122 | /* Enable channel 2 (remote) */ | ||
123 | DEV_INIT1 &=~0x300; | ||
124 | DEV_INIT1 |= 0x100; | ||
125 | ADC_ADDR |= 0x4000000; | ||
126 | ADC_STATUS |= 0x200000; | ||
127 | |||
128 | /* Enable channel 3 (scroll pad) */ | ||
129 | DEV_INIT1 &=~0x3000; | ||
130 | DEV_INIT1 |= 0x1000; | ||
131 | ADC_ADDR |= 0x8000000; | ||
132 | ADC_STATUS |= 0x20000000; | ||
133 | |||
134 | /* Force a scan of all channels to get initial values */ | ||
135 | adc_scan(ADC_BATTERY); | ||
136 | adc_scan(ADC_UNKNOWN_1); | ||
137 | adc_scan(ADC_REMOTE); | ||
138 | adc_scan(ADC_SCROLLPAD); | ||
139 | |||
140 | tick_add_task(adc_tick); | ||
141 | } | ||
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _ADC_TARGET_H_ | ||
20 | #define _ADC_TARGET_H_ | ||
21 | |||
22 | #define ADC_ADDR (*(volatile unsigned long*)(0x7000ad00)) | ||
23 | #define ADC_STATUS (*(volatile unsigned long*)(0x7000ad04)) | ||
24 | #define ADC_DATA_1 (*(volatile unsigned long*)(0x7000ad20)) | ||
25 | #define ADC_DATA_2 (*(volatile unsigned long*)(0x7000ad24)) | ||
26 | #define ADC_INIT (*(volatile unsigned long*)(0x7000ad2c)) | ||
27 | |||
28 | #define NUM_ADC_CHANNELS 4 | ||
29 | |||
30 | #define ADC_BATTERY 0 | ||
31 | #define ADC_UNKNOWN_1 1 | ||
32 | #define ADC_REMOTE 2 | ||
33 | #define ADC_SCROLLPAD 3 | ||
34 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | ||
35 | |||
36 | /* Force a scan now */ | ||
37 | unsigned short adc_scan(int channel); | ||
38 | |||
39 | #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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "backlight-target.h" | ||
21 | #include "system.h" | ||
22 | #include "lcd.h" | ||
23 | #include "backlight.h" | ||
24 | #include "i2c-pp.h" | ||
25 | |||
26 | void _backlight_on(void) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | void _backlight_off(void) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | void _buttonlight_on(void) | ||
35 | { | ||
36 | /* turn on all touchpad leds */ | ||
37 | GPIOA_OUTPUT_VAL |= BUTTONLIGHT_ALL; | ||
38 | |||
39 | #if 0 | ||
40 | /* Writing to 0x7000a010 controls the brightness of the leds. | ||
41 | This routine fades the leds from dim to bright, like when | ||
42 | you first turn the unit on. */ | ||
43 | unsigned long val = 0x80ff08ff; | ||
44 | int i = 0; | ||
45 | for (i = 0; i < 16; i++) | ||
46 | outl(val, 0x7000a010); | ||
47 | udelay(100000); | ||
48 | val -= 0x110000; | ||
49 | } | ||
50 | #endif | ||
51 | } | ||
52 | |||
53 | void _buttonlight_off(void) | ||
54 | { | ||
55 | /* turn off all touchpad leds */ | ||
56 | GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL; | ||
57 | } | ||
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef BACKLIGHT_TARGET_H | ||
21 | #define BACKLIGHT_TARGET_H | ||
22 | |||
23 | #define _backlight_init() true | ||
24 | void _backlight_on(void); | ||
25 | void _backlight_off(void); | ||
26 | |||
27 | /* Button lights are controlled by GPIOA_OUTPUT_VAL */ | ||
28 | #define BUTTONLIGHT_PLAY 0x01 | ||
29 | #define BUTTONLIGHT_MENU 0x02 | ||
30 | #define BUTTONLIGHT_DISPLAY 0x04 | ||
31 | #define BUTTONLIGHT_LEFT 0x08 | ||
32 | #define BUTTONLIGHT_RIGHT 0x10 | ||
33 | #define BUTTONLIGHT_SCROLL 0x20 | ||
34 | #define BUTTONLIGHT_ALL (BUTTONLIGHT_PLAY | BUTTONLIGHT_MENU | \ | ||
35 | BUTTONLIGHT_DISPLAY | BUTTONLIGHT_LEFT | \ | ||
36 | BUTTONLIGHT_RIGHT | BUTTONLIGHT_SCROLL) | ||
37 | |||
38 | void _buttonlight_on(void); | ||
39 | void _buttonlight_off(void); | ||
40 | |||
41 | #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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include <stdlib.h> | ||
21 | #include "config.h" | ||
22 | #include "cpu.h" | ||
23 | #include "system.h" | ||
24 | #include "button.h" | ||
25 | #include "kernel.h" | ||
26 | #include "backlight.h" | ||
27 | #include "backlight-target.h" | ||
28 | #include "system.h" | ||
29 | |||
30 | void button_int(void) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | void button_init_device(void) | ||
35 | { | ||
36 | /* taken from the mr-100 bootloader (offset 0x1e72) */ | ||
37 | //~ DEV_EN |= 0x20000; /* enable the touchpad ?? */ | ||
38 | |||
39 | /* enable touchpad leds */ | ||
40 | GPIOA_ENABLE |= 0xff; | ||
41 | GPIOA_OUTPUT_EN |= BUTTONLIGHT_ALL; | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * Get button pressed from hardware | ||
46 | */ | ||
47 | int button_read_device(void) | ||
48 | { | ||
49 | return BUTTON_NONE; | ||
50 | } | ||
51 | |||
52 | bool button_hold(void) | ||
53 | { | ||
54 | return (GPIOD_INPUT_VAL & BUTTON_HOLD) ? false : true; | ||
55 | } | ||
56 | |||
57 | bool headphones_inserted(void) | ||
58 | { | ||
59 | return (GPIOD_INPUT_VAL & 0x80) ? true : false; | ||
60 | } | ||
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _BUTTON_TARGET_H_ | ||
21 | #define _BUTTON_TARGET_H_ | ||
22 | |||
23 | #include <stdbool.h> | ||
24 | #include "config.h" | ||
25 | |||
26 | #define HAS_BUTTON_HOLD | ||
27 | |||
28 | bool button_hold(void); | ||
29 | void button_init_device(void); | ||
30 | int button_read_device(void); | ||
31 | |||
32 | /* Power button is on GPIOA */ | ||
33 | #define BUTTON_POWER 0x80 | ||
34 | #define POWEROFF_BUTTON BUTTON_POWER | ||
35 | #define POWEROFF_COUNT 10 | ||
36 | |||
37 | /* Hold button is on GPIOD */ | ||
38 | #define BUTTON_HOLD 0x10 | ||
39 | |||
40 | /* FIXME: Until the buttons are figured out, we use the button definitions | ||
41 | for the H10 keypad & remote. THESE ARE NOT CORRECT! */ | ||
42 | |||
43 | /* Main unit's buttons */ | ||
44 | #define BUTTON_LEFT 0x00000002 | ||
45 | #define BUTTON_RIGHT 0x00000004 | ||
46 | #define BUTTON_REW 0x00000008 | ||
47 | #define BUTTON_PLAY 0x00000010 | ||
48 | #define BUTTON_FF 0x00000020 | ||
49 | #define BUTTON_SCROLL_UP 0x00000040 | ||
50 | #define BUTTON_SCROLL_DOWN 0x00000080 | ||
51 | #define BUTTON_MAIN (BUTTON_POWER|BUTTON_O|BUTTON_BACK|BUTTON_REW\ | ||
52 | |BUTTON_PLAY|BUTTON_FF) | ||
53 | |||
54 | /* Remote control's buttons */ | ||
55 | #define BUTTON_RC_REW 0x00080000 | ||
56 | #define BUTTON_RC_PLAY 0x00100000 | ||
57 | #define BUTTON_RC_FF 0x00200000 | ||
58 | #define BUTTON_RC_VOL_UP 0x00400000 | ||
59 | #define BUTTON_RC_VOL_DOWN 0x00800000 | ||
60 | #define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN\ | ||
61 | |BUTTON_RC_REW|BUTTON_RC_FF) | ||
62 | #define RC_POWEROFF_BUTTON BUTTON_RC_PLAY | ||
63 | |||
64 | #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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "config.h" | ||
20 | #include "cpu.h" | ||
21 | #include "lcd.h" | ||
22 | #include "kernel.h" | ||
23 | #include "system.h" | ||
24 | |||
25 | /* send LCD data */ | ||
26 | static void lcd_send_data(unsigned data) | ||
27 | { | ||
28 | while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */ | ||
29 | LCD1_DATA = data; | ||
30 | } | ||
31 | |||
32 | /* send LCD command */ | ||
33 | static void lcd_send_command(unsigned cmd) | ||
34 | { | ||
35 | while (LCD1_CONTROL & LCD1_BUSY_MASK); /* wait for LCD */ | ||
36 | LCD1_CMD = cmd; | ||
37 | } | ||
38 | |||
39 | /* LCD init */ | ||
40 | void lcd_init_device(void) | ||
41 | { | ||
42 | int i; | ||
43 | |||
44 | DEV_INIT1 &= ~0xfc000000; | ||
45 | |||
46 | i = DEV_INIT1; | ||
47 | DEV_INIT1 = i; | ||
48 | |||
49 | DEV_INIT2 &= ~0x400; | ||
50 | udelay(10000); | ||
51 | |||
52 | LCD1_CONTROL &= ~0x4; | ||
53 | udelay(15); | ||
54 | |||
55 | LCD1_CONTROL |= 0x4; | ||
56 | udelay(10); | ||
57 | |||
58 | LCD1_CONTROL = 0x690; | ||
59 | LCD1_CONTROL = 0x694; | ||
60 | |||
61 | /* OF just reads these */ | ||
62 | i = LCD1_CONTROL; | ||
63 | i = inl(0x70003004); | ||
64 | i = LCD1_CMD; | ||
65 | i = inl(0x7000300c); | ||
66 | |||
67 | #if 0 | ||
68 | /* this is skipped in the OF */ | ||
69 | LCD1_CONTROL &= ~0x200; | ||
70 | LCD1_CONTROL &= ~0x800; | ||
71 | LCD1_CONTROL &= ~0x400; | ||
72 | #endif | ||
73 | |||
74 | LCD1_CONTROL |= 0x1; | ||
75 | udelay(15000); | ||
76 | |||
77 | lcd_send_command(0xe2); | ||
78 | lcd_send_command(0x2f); | ||
79 | lcd_send_command(0x26); | ||
80 | lcd_send_command(0xcc); | ||
81 | lcd_send_command(0xe8); | ||
82 | lcd_send_command(0x81); | ||
83 | lcd_send_command(0); | ||
84 | lcd_send_command(0x40); | ||
85 | lcd_send_command(0xa6); | ||
86 | lcd_send_command(0x88); | ||
87 | lcd_send_command(0xb0); | ||
88 | lcd_send_command(0x10); | ||
89 | lcd_send_command(0); | ||
90 | } | ||
91 | |||
92 | /*** hardware configuration ***/ | ||
93 | int lcd_default_contrast(void) | ||
94 | { | ||
95 | return DEFAULT_CONTRAST_SETTING; | ||
96 | } | ||
97 | |||
98 | void lcd_set_contrast(int val) | ||
99 | { | ||
100 | lcd_send_command(0x81); | ||
101 | lcd_send_command(val); | ||
102 | } | ||
103 | |||
104 | void lcd_set_invert_display(bool yesno) | ||
105 | { | ||
106 | /* TODO: Implement lcd_set_invert_display() */ | ||
107 | (void)yesno; | ||
108 | } | ||
109 | |||
110 | /* turn the display upside down (call lcd_update() afterwards) */ | ||
111 | void lcd_set_flip(bool yesno) | ||
112 | { | ||
113 | /* TODO: Implement lcd_set_flip() */ | ||
114 | (void)yesno; | ||
115 | } | ||
116 | |||
117 | /*** update functions ***/ | ||
118 | |||
119 | /* Performance function that works with an external buffer | ||
120 | note that by and bheight are in 4-pixel units! */ | ||
121 | void lcd_blit(const fb_data* data, int x, int by, int width, | ||
122 | int bheight, int stride) | ||
123 | { | ||
124 | /* TODO: Implement lcd_blit() */ | ||
125 | (void)data; | ||
126 | (void)x; | ||
127 | (void)by; | ||
128 | (void)width; | ||
129 | (void)bheight; | ||
130 | (void)stride; | ||
131 | } | ||
132 | |||
133 | /* Performance function to blit a YUV bitmap directly to the LCD */ | ||
134 | void lcd_yuv_blit(unsigned char * const src[3], | ||
135 | int src_x, int src_y, int stride, | ||
136 | int x, int y, int width, int height) | ||
137 | { | ||
138 | (void)src; | ||
139 | (void)src_x; | ||
140 | (void)src_y; | ||
141 | (void)stride; | ||
142 | (void)x; | ||
143 | (void)y; | ||
144 | (void)width; | ||
145 | (void)height; | ||
146 | } | ||
147 | |||
148 | /* Update the display. | ||
149 | This must be called after all other LCD functions that change the display. */ | ||
150 | void lcd_update(void) | ||
151 | { | ||
152 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); | ||
153 | } | ||
154 | |||
155 | /* Update a fraction of the display. */ | ||
156 | void lcd_update_rect(int x0, int y0, int width, int height) | ||
157 | { | ||
158 | unsigned char *addr; | ||
159 | unsigned int cmd0, cmd1, cmd2; | ||
160 | int r, c, x1, y1, start_row, last_row; | ||
161 | |||
162 | x1 = (x0 + width) - 1; | ||
163 | y1 = (y0 + height) - 1; | ||
164 | if ((x1 <= 0) || (y1 <= 0)) | ||
165 | return; | ||
166 | |||
167 | if(x1 >= LCD_WIDTH) | ||
168 | x1 = LCD_WIDTH - 1; | ||
169 | |||
170 | if(y1 >= LCD_HEIGHT) | ||
171 | y1 = LCD_HEIGHT - 1; | ||
172 | |||
173 | start_row = y0/8; | ||
174 | last_row = y1/8; | ||
175 | |||
176 | cmd1 = (x0 & 0xff) >> 4; | ||
177 | cmd1 = (cmd1 + 5) | 0x10; | ||
178 | cmd2 = x0 & 0xf; | ||
179 | |||
180 | for (r = start_row; r <= last_row; r++) { | ||
181 | cmd0 = (r & 0xff) | 0xb0; | ||
182 | lcd_send_command(cmd0); | ||
183 | lcd_send_command(cmd1); | ||
184 | lcd_send_command(cmd2); | ||
185 | |||
186 | addr = (unsigned char*)&lcd_framebuffer[r][x0]; | ||
187 | for (c = x0; c <= x1; c++) | ||
188 | lcd_send_data(*(addr++)); | ||
189 | } | ||
190 | |||
191 | lcd_send_command(0xaf); | ||
192 | } | ||
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "config.h" | ||
21 | #include "cpu.h" | ||
22 | #include <stdbool.h> | ||
23 | #include "adc.h" | ||
24 | #include "kernel.h" | ||
25 | #include "system.h" | ||
26 | #include "power.h" | ||
27 | #include "logf.h" | ||
28 | #include "usb.h" | ||
29 | |||
30 | #if CONFIG_CHARGING == CHARGING_CONTROL | ||
31 | bool charger_enabled; | ||
32 | #endif | ||
33 | |||
34 | void power_init(void) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | bool charger_inserted(void) | ||
39 | { | ||
40 | return false; | ||
41 | } | ||
42 | |||
43 | void ide_power_enable(bool on) | ||
44 | { | ||
45 | (void)on; | ||
46 | /* We do nothing on the iPod */ | ||
47 | } | ||
48 | |||
49 | |||
50 | bool ide_powered(void) | ||
51 | { | ||
52 | /* pretend we are always powered - we don't turn it off on the ipod */ | ||
53 | return true; | ||
54 | } | ||
55 | |||
56 | void power_off(void) | ||
57 | { | ||
58 | /* Give things a second to settle before cutting power */ | ||
59 | sleep(HZ); | ||
60 | |||
61 | //GPIOF_OUTPUT_VAL &=~ 0x20; | ||
62 | } | ||
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese | ||
11 | * Revisions copyright (C) 2005 by Gerald Van Baren | ||
12 | * | ||
13 | * All files in this archive are subject to the GNU General Public License. | ||
14 | * See the file COPYING in the source tree root for full license agreement. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #include "config.h" | ||
22 | #include "adc.h" | ||
23 | #include "powermgmt.h" | ||
24 | |||
25 | /* FIXME: All voltages copied from H10/Tatung Elio. This will need changing | ||
26 | proper power management. */ | ||
27 | |||
28 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | ||
29 | { | ||
30 | 3760 | ||
31 | }; | ||
32 | |||
33 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | ||
34 | { | ||
35 | 3650 | ||
36 | }; | ||
37 | |||
38 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | ||
39 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | ||
40 | { | ||
41 | { 3760, 3800, 3850, 3870, 3900, 3950, 4020, 4070, 4110, 4180, 4240 } | ||
42 | }; | ||
43 | |||
44 | #if CONFIG_CHARGING | ||
45 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | ||
46 | const unsigned short percent_to_volt_charge[11] = | ||
47 | { | ||
48 | 3990, 4030, 4060, 4080, 4100, 4120, 4150, 4180, 4220, 4260, 4310 | ||
49 | }; | ||
50 | #endif /* CONFIG_CHARGING */ | ||
51 | |||
52 | #define BATTERY_SCALE_FACTOR 4650 | ||
53 | /* full-scale ADC readout (2^10) in millivolt */ | ||
54 | |||
55 | /* Returns battery voltage from ADC [millivolts] */ | ||
56 | unsigned int battery_adc_voltage(void) | ||
57 | { | ||
58 | return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; | ||
59 | } | ||
diff --git a/tools/configure b/tools/configure index c2c9dca845..5055a0f465 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -603,6 +603,7 @@ cat <<EOF | |||
603 | 603 | ||
604 | ==Tatung== ==Olympus== ==Logik== | 604 | ==Tatung== ==Olympus== ==Logik== |
605 | 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB | 605 | 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB |
606 | 71) M:Robe 100 | ||
606 | EOF | 607 | EOF |
607 | 608 | ||
608 | buildfor=`input`; | 609 | buildfor=`input`; |
@@ -1292,6 +1293,34 @@ EOF | |||
1292 | t_model="mrobe-500" | 1293 | t_model="mrobe-500" |
1293 | ;; | 1294 | ;; |
1294 | 1295 | ||
1296 | 71|mrobe100) | ||
1297 | target_id=31 | ||
1298 | archos="mrobe100" | ||
1299 | target="-DMROBE_100" | ||
1300 | memory=32 # always | ||
1301 | arm7tdmicc | ||
1302 | tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS" | ||
1303 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
1304 | bmp2rb_native="$rootdir/tools/bmp2rb -f 0" | ||
1305 | bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" | ||
1306 | bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" | ||
1307 | output="rockbox.mi4" | ||
1308 | appextra="recorder:gui" | ||
1309 | archosrom="" | ||
1310 | flash="" | ||
1311 | plugins="" | ||
1312 | swcodec="yes" | ||
1313 | boottool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBBL" | ||
1314 | bootoutput="pp5020.mi4" | ||
1315 | # toolset is the tools within the tools directory that we build for | ||
1316 | # this particular target. | ||
1317 | toolset="$genericbitmaptools scramble" | ||
1318 | # architecture, manufacturer and model for the target-tree build | ||
1319 | t_cpu="arm" | ||
1320 | t_manufacturer="olympus" | ||
1321 | t_model="mrobe-100" | ||
1322 | ;; | ||
1323 | |||
1295 | 80|logikdax) | 1324 | 80|logikdax) |
1296 | target_id=31 | 1325 | target_id=31 |
1297 | archos="logikdax" | 1326 | 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) | |||
107 | "\t-add=X Rockbox generic \"add-up\" checksum format\n" | 107 | "\t-add=X Rockbox generic \"add-up\" checksum format\n" |
108 | "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n" | 108 | "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n" |
109 | "\t ip3g, ip4g, mini, iax5, h10, h10_5gb, tpj2,\n" | 109 | "\t ip3g, ip4g, mini, iax5, h10, h10_5gb, tpj2,\n" |
110 | "\t c200, e200, giga, m500)\n" | 110 | "\t c200, e200, giga, m100, m500)\n" |
111 | "\nNo option results in Archos standard player/recorder format.\n"); | 111 | "\nNo option results in Archos standard player/recorder format.\n"); |
112 | 112 | ||
113 | exit(1); | 113 | exit(1); |
@@ -253,6 +253,8 @@ int main (int argc, char** argv) | |||
253 | modelnum = 21; | 253 | modelnum = 21; |
254 | else if(!strcmp(&argv[1][5], "m500")) | 254 | else if(!strcmp(&argv[1][5], "m500")) |
255 | modelnum = 22; | 255 | modelnum = 22; |
256 | else if(!strcmp(&argv[1][5], "m100")) | ||
257 | modelnum = 23; | ||
256 | else { | 258 | else { |
257 | fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); | 259 | fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); |
258 | return 2; | 260 | return 2; |