summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootloader/common.c3
-rw-r--r--bootloader/mrobe500.c145
-rw-r--r--firmware/target/arm/tms320dm320/boot.lds115
-rwxr-xr-xfirmware/target/arm/tms320dm320/crt0.S2
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c4
5 files changed, 79 insertions, 190 deletions
diff --git a/bootloader/common.c b/bootloader/common.c
index 7159faaa8f..c9309a67db 100644
--- a/bootloader/common.c
+++ b/bootloader/common.c
@@ -40,7 +40,8 @@
40#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \ 40#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \
41 || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \ 41 || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \
42 || defined(PHILIPS_SA9200) || (CONFIG_CPU == AS3525) || defined(COWON_D2) \ 42 || defined(PHILIPS_SA9200) || (CONFIG_CPU == AS3525) || defined(COWON_D2) \
43 || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(ONDA_VX747) 43 || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(ONDA_VX747) \
44 || defined(MROBE_500)
44bool verbose = false; 45bool verbose = false;
45#else 46#else
46bool verbose = true; 47bool verbose = true;
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index e503baa01d..9052cbdc3c 100644
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -46,147 +46,6 @@
46#include "time.h" 46#include "time.h"
47#include "system-arm.h" 47#include "system-arm.h"
48 48
49//#define MRDEBUG
50
51#if defined(MRDEBUG)
52
53extern int line;
54#if 0
55struct touch_calibration_point tl, br;
56
57void touchscreen_get_one_point(struct touch_calibration_point *p)
58{
59 int data = 0;
60 int start = current_tick;
61 while (TIME_AFTER(start+(HZ/3), current_tick))
62 {
63 if (button_read_device()&BUTTON_TOUCHSCREEN)
64 {
65 data = button_get_last_touch();
66 p->val_x = data>>16;
67 p->val_y = data&0xffff;
68 start = current_tick;
69 }
70 else if (data == 0)
71 start = current_tick;
72 }
73}
74
75#define MARGIN 25
76#define LEN 7
77void touchscreen_calibrate_screen(void)
78{
79 reset_screen();
80 printf("touch the center of the crosshairs to calibrate");
81 /* get the topleft value */
82 lcd_hline(MARGIN-LEN, MARGIN+LEN, MARGIN);
83 lcd_vline(MARGIN, MARGIN-LEN, MARGIN+LEN);
84 lcd_update();
85 tl.px_x = MARGIN; tl.px_y = MARGIN;
86 touchscreen_get_one_point(&tl);
87 reset_screen();
88 printf("touch the center of the crosshairs to calibrate");
89 /* get the topright value */
90 lcd_hline(LCD_WIDTH-MARGIN-LEN, LCD_WIDTH-MARGIN+LEN, LCD_HEIGHT-MARGIN);
91 lcd_vline(LCD_WIDTH-MARGIN, LCD_HEIGHT-MARGIN-LEN, LCD_HEIGHT-MARGIN+LEN);
92 lcd_update();
93 br.px_x = LCD_WIDTH-MARGIN; br.px_y = LCD_HEIGHT-MARGIN;
94 touchscreen_get_one_point(&br);
95 reset_screen();
96 line++;
97 printf("tl %d %d", tl.val_x, tl.val_y);
98 printf("br %d %d", br.val_x, br.val_y);
99 line++;
100 set_calibration_points(&tl, &br);
101}
102#endif
103static uint8_t bl_command[] = {0xa4, 0x00, 0x00, 0xbb};
104int brightness = 0;
105
106void mrdebug(void)
107{
108 int button=0;
109#if 0
110 use_calibration(false);
111 touchscreen_calibrate_screen();
112 use_calibration(true);
113#endif
114
115 while(true)
116 {
117#if 0
118 struct tm *t = get_time();
119 printf("%d:%d:%d %d %d %d", t->tm_hour, t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon, t->tm_year);
120 printf("time: %d", mktime(t));
121#endif
122 button = button_get(false);
123 if (button == BUTTON_POWER)
124 {
125 printf("reset");
126 IO_GIO_BITSET1|=1<<10;
127 }
128 if (button==BUTTON_RC_VOL_DOWN)
129 {
130 brightness = (brightness - 5) & 0x7f;
131 bl_command[2] = brightness;
132 spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
133 }
134 else if (button==BUTTON_RC_VOL_UP)
135 {
136 brightness = (brightness + 5) & 0x7f;
137 bl_command[2] = brightness;
138 spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
139 }
140// {
141// short x,y,z1,z2;
142// tsc2100_read_values(&x, &y, &z1, &z2);
143// printf("x: %04x y: %04x z1: %04x z2: %04x", x, y, z1, z2);
144// printf("tsadc: %4x", tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS)&0xffff);
145// // tsc2100_keyclick(); /* doesnt work :( */
146// line -= 6;
147// }
148 else if (button == BUTTON_RC_HEART)
149 {
150 printf("POINT");
151 touchscreen_set_mode(TOUCHSCREEN_POINT);
152 }
153 else if (button == BUTTON_RC_MODE)
154 {
155 printf("BUTTON");
156 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
157 }
158#if 1
159 else if (button&BUTTON_TOUCHSCREEN)
160 {
161 if (button&BUTTON_REL)
162 continue;
163 unsigned int data = button_get_data();
164 int x = (data&0xffff0000)>>16, y = data&0x0000ffff;
165 reset_screen();
166 line = 9;
167 printf("BB: %x %d %d", button, x,y);
168 lcd_hline(x-5, x+5, y);
169 lcd_vline(x, y-5, y+5);
170 lcd_update();
171 }
172 else if (button == BUTTON_RC_PLAY)
173 {
174 reset_screen();
175 }
176
177 else if (button)
178 {
179 // if (button&BUTTON_REL)
180 {
181 printf("%08x %s\n", button, (button&BUTTON_REL)?"yes":"no");
182 }
183 }
184
185#endif
186 }
187}
188#endif
189
190void main(void) 49void main(void)
191{ 50{
192 unsigned char* loadbuffer; 51 unsigned char* loadbuffer;
@@ -252,10 +111,6 @@ void main(void)
252 lcd_update(); 111 lcd_update();
253 } 112 }
254 113
255#if defined(MRDEBUG)
256 mrdebug();
257#endif
258
259 sleep(50); 114 sleep(50);
260 115
261 printf("ATA"); 116 printf("ATA");
diff --git a/firmware/target/arm/tms320dm320/boot.lds b/firmware/target/arm/tms320dm320/boot.lds
index e391526dc5..ff8203ccd8 100644
--- a/firmware/target/arm/tms320dm320/boot.lds
+++ b/firmware/target/arm/tms320dm320/boot.lds
@@ -6,24 +6,42 @@ OUTPUT_FORMAT(elf32-littlearm)
6OUTPUT_ARCH(arm) 6OUTPUT_ARCH(arm)
7STARTUP(target/arm/tms320dm320/crt0.o) 7STARTUP(target/arm/tms320dm320/crt0.o)
8 8
9#define LCD_BUFFER_SIZE (LCD_WIDTH*LCD_HEIGHT*2) 9#ifdef DEBUG
10#define STUBOFFSET 0x10000
11#else
12#define STUBOFFSET 0
13#endif
14
15#ifndef LCD_NATIVE_WIDTH
16#define LCD_NATIVE_WIDTH LCD_WIDTH
17#endif
18
19#ifndef LCD_NATIVE_HEIGHT
20#define LCD_NATIVE_HEIGHT LCD_HEIGHT
21#endif
22
23#define LCD_FUDGE LCD_NATIVE_WIDTH%32
24
25#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
10 26
11/* must be 16Kb (0x4000) aligned */ 27/* must be 16Kb (0x4000) aligned */
12#define TTB_SIZE (0x4000) 28#define TTB_SIZE (0x4000)
13 29
14#define DRAMSIZE (MEMORYSIZE * 0x100000) - TTB_SIZE - LCD_BUFFER_SIZE 30/* Give this 1 meg to allow it to align to the MMU boundary */
31#define LCD_TTB_AREA 0x100000
32
33#define BOOT_OFFSET 0x1000000
15 34
16#define DRAMORIG 0x01900000 /* actually it's 0x00900000 */ 35#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - BOOT_OFFSET
17#define IRAMORIG 0x00000000
18#define IRAMSIZE 16K
19#define FLASHORIG 0x00100000
20#define FLASHSIZE 8M
21 36
22/* Now we have the LCD buffer */ 37#define DRAMORIG (0x00900000+BOOT_OFFSET) /* actually it's 0x00900000 */
23#define LCDBEGIN (DRAMSIZE+0x00900000) 38#define IRAMORIG 0x00000000
39#define IRAMSIZE 0x4000
40#define FLASHORIG 0x00100000
41#define FLASHSIZE 8M
24 42
25/* Finally the TTB table */ 43/* End of the audio buffer, where the codec buffer starts */
26#define TTBBEGIN (LCDBEGIN + LCD_BUFFER_SIZE) 44#define TTB_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA)
27 45
28MEMORY 46MEMORY
29{ 47{
@@ -40,7 +58,6 @@ SECTIONS
40 loadaddress = .; 58 loadaddress = .;
41 _loadaddress = .; 59 _loadaddress = .;
42 *(.init.text) 60 *(.init.text)
43 *(.icode)
44 *(.text*) 61 *(.text*)
45 *(.glue_7) 62 *(.glue_7)
46 *(.glue_7t) 63 *(.glue_7t)
@@ -53,7 +70,6 @@ SECTIONS
53 *(.rodata*) 70 *(.rodata*)
54 *(.rodata.str1.1) 71 *(.rodata.str1.1)
55 *(.rodata.str1.4) 72 *(.rodata.str1.4)
56 *(.irodata)
57 . = ALIGN(0x4); 73 . = ALIGN(0x4);
58 74
59 /* Pseudo-allocate the copies of the data sections */ 75 /* Pseudo-allocate the copies of the data sections */
@@ -61,31 +77,11 @@ SECTIONS
61 } > DRAM 77 } > DRAM
62 78
63 .data : { 79 .data : {
64 *(.idata)
65 *(.data*) 80 *(.data*)
66 . = ALIGN(0x4); 81 . = ALIGN(0x4);
67 _dataend = . ; 82 _dataend = . ;
68 } > DRAM 83 } > DRAM
69 84
70 .stack :
71 {
72 *(.stack)
73 _stackbegin = .;
74 stackbegin = .;
75 . += 0x2000;
76 _stackend = .;
77 stackend = .;
78 } > DRAM
79
80 .bss :
81 {
82 _edata = .;
83 *(.bss*);
84 *(.ibss);
85 *(COMMON)
86 _end = .;
87 } > DRAM
88
89 .vectors IRAMORIG : 85 .vectors IRAMORIG :
90 { 86 {
91 _vectorsstart = .; 87 _vectorsstart = .;
@@ -94,16 +90,57 @@ SECTIONS
94 KEEP(*(.vectors)); 90 KEEP(*(.vectors));
95 *(.vectors); 91 *(.vectors);
96 _vectorsend = .; 92 _vectorsend = .;
97 } AT > DRAM 93 } > IRAM AT > DRAM
98 _vectorscopy = LOADADDR(.vectors); 94 _vectorscopy = LOADADDR(.vectors);
99 95
100 .lcdbuffer LCDBEGIN (NOLOAD) : 96 .iram :
101 { 97 {
102 _lcdbuf = .; 98 _iramstart = .;
103 } 99 *(.icode)
100 *(.irodata*)
101 *(.idata)
102 . = ALIGN(0x4);
103 _iramend = .;
104 } > IRAM AT> DRAM
105
106 _iramcopy = LOADADDR(.iram);
107
108 .ibss (NOLOAD) :
109 {
110 _iedata = .;
111 *(.ibss)
112 . = ALIGN(0x4);
113 _iend = .;
114 } > IRAM
115
116 .stack (NOLOAD) :
117 {
118 *(.stack)
119 stackbegin = .;
120 . += 0x2000;
121 stackend = .;
122 } > IRAM
123
124 .bss (NOLOAD) :
125 {
126 . = ADDR(.data) + SIZEOF(.data) + SIZEOF(.vectors) + SIZEOF(.iram);
127 _edata = .;
128 *(.bss*)
129 *(COMMON)
130 . = ALIGN(0x4);
131 _end = .;
132 } > DRAM
104 133
105 .ttbtable TTBBEGIN (NOLOAD) : 134 .ttbtable TTB_BEGIN (NOLOAD) :
106 { 135 {
136 . = ALIGN (0x4000);
107 _ttbstart = .; 137 _ttbstart = .;
108 } 138 . += TTB_SIZE;
139 } > DRAM
140
141 .lcdbuffer (NOLOAD) :
142 {
143 _lcdbuf = .;
144 . += LCD_BUFFER_SIZE;
145 } > DRAM
109} 146}
diff --git a/firmware/target/arm/tms320dm320/crt0.S b/firmware/target/arm/tms320dm320/crt0.S
index a5a965b9c2..0243c13971 100755
--- a/firmware/target/arm/tms320dm320/crt0.S
+++ b/firmware/target/arm/tms320dm320/crt0.S
@@ -54,7 +54,7 @@ start:
54 orr r0, r0, #0x00000002 54 orr r0, r0, #0x00000002
55 mcr p15, 0, r0, c1, c0, 0 55 mcr p15, 0, r0, c1, c0, 0
56 56
57#if !defined(BOOTLOADER) && !defined(STUB) 57#if !defined(STUB)
58 /* Zero out IBSS */ 58 /* Zero out IBSS */
59 ldr r2, =_iedata 59 ldr r2, =_iedata
60 ldr r3, =_iend 60 ldr r3, =_iend
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 1334eeaf8d..54e1dc0cf2 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -127,8 +127,6 @@ void lcd_init_device(void)
127 /* Clear the Frame */ 127 /* Clear the Frame */
128 memset16(FRAME, 0x0000, LCD_WIDTH*LCD_HEIGHT); 128 memset16(FRAME, 0x0000, LCD_WIDTH*LCD_HEIGHT);
129 129
130 lcd_sleep();
131
132 IO_OSD_OSDWINMD0&=~(0x0001); 130 IO_OSD_OSDWINMD0&=~(0x0001);
133 IO_OSD_VIDWINMD&=~(0x0001); 131 IO_OSD_VIDWINMD&=~(0x0001);
134 132
@@ -242,8 +240,6 @@ void lcd_init_device(void)
242 240
243 IO_OSD_OSDWINMD0|=0x01; 241 IO_OSD_OSDWINMD0|=0x01;
244 IO_VID_ENC_VMOD|=0x01; 242 IO_VID_ENC_VMOD|=0x01;
245
246 lcd_enable(true);
247} 243}
248 244
249/* Update a fraction of the display. */ 245/* Update a fraction of the display. */