summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorGreg White <gwhite@rockbox.org>2007-01-14 03:28:31 +0000
committerGreg White <gwhite@rockbox.org>2007-01-14 03:28:31 +0000
commitb26f4720c8e4f87c4479275323f6e4754da249cc (patch)
tree1862f0d13e66977b43c42ae95dc6d39a3606ffa1 /firmware
parentd4afc4b9b917dd98ab8dc5bf8e1487c62170852d (diff)
downloadrockbox-b26f4720c8e4f87c4479275323f6e4754da249cc.tar.gz
rockbox-b26f4720c8e4f87c4479275323f6e4754da249cc.zip
Idle CPU directly; minor cleanup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12002 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/gigabeat/meg-fx/backlight-meg-fx.c2
-rw-r--r--firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c21
2 files changed, 12 insertions, 11 deletions
diff --git a/firmware/target/arm/gigabeat/meg-fx/backlight-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/backlight-meg-fx.c
index 2f96584515..a1b6a8a583 100644
--- a/firmware/target/arm/gigabeat/meg-fx/backlight-meg-fx.c
+++ b/firmware/target/arm/gigabeat/meg-fx/backlight-meg-fx.c
@@ -127,7 +127,7 @@ bool __backlight_init(void)
127 initial_tick_delay = 400; 127 initial_tick_delay = 400;
128 /* put the led control on the tick list */ 128 /* put the led control on the tick list */
129 tick_add_task(led_control_service); 129 tick_add_task(led_control_service);
130 130
131 return true; 131 return true;
132} 132}
133 133
diff --git a/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c
index c3a17e16cb..3ecd7df4e8 100644
--- a/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c
+++ b/firmware/target/arm/gigabeat/meg-fx/lcd-meg-fx.c
@@ -82,10 +82,10 @@ void lcd_update_rect(int x, int y, int width, int height)
82 { 82 {
83 /* Wait for this controller to stop pending transfer */ 83 /* Wait for this controller to stop pending transfer */
84 while((DSTAT1 & 0x000fffff)) 84 while((DSTAT1 & 0x000fffff))
85 yield(); 85 CLKCON |= (1 << 2); /* set IDLE bit */
86 86
87 /* Flush DCache */ 87 /* Flush DCache */
88 invalidate_dcache_range((void *)(((int) &lcd_framebuffer)+(y * sizeof(fb_data) * LCD_WIDTH)), (height * sizeof(fb_data) * LCD_WIDTH)); 88 invalidate_dcache_range((void *)(((int) &lcd_framebuffer[0][0])+(y * sizeof(fb_data) * LCD_WIDTH)), (height * sizeof(fb_data) * LCD_WIDTH));
89 89
90 /* set DMA dest */ 90 /* set DMA dest */
91 DIDST1 = ((int) FRAME) + (y * sizeof(fb_data) * LCD_WIDTH); 91 DIDST1 = ((int) FRAME) + (y * sizeof(fb_data) * LCD_WIDTH);
@@ -96,7 +96,7 @@ void lcd_update_rect(int x, int y, int width, int height)
96 DCON1 = ((1<<30) | (1<<28) | (1<<27) | (1<<22) | (2<<20)) | ((height * sizeof(fb_data) * LCD_WIDTH) >> 4); 96 DCON1 = ((1<<30) | (1<<28) | (1<<27) | (1<<22) | (2<<20)) | ((height * sizeof(fb_data) * LCD_WIDTH) >> 4);
97 97
98 /* set DMA source */ 98 /* set DMA source */
99 DISRC1 = ((int) &lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH) + 0x30000000; 99 DISRC1 = ((int) &lcd_framebuffer[0][0]) + (y * sizeof(fb_data) * LCD_WIDTH) + 0x30000000;
100 /* memory is on AHB bus, increment addresses */ 100 /* memory is on AHB bus, increment addresses */
101 DISRCC1 = 0x00; 101 DISRCC1 = 0x00;
102 102
@@ -108,7 +108,7 @@ void lcd_update_rect(int x, int y, int width, int height)
108 108
109 /* Wait for transfer to complete */ 109 /* Wait for transfer to complete */
110 while((DSTAT1 & 0x000fffff)) 110 while((DSTAT1 & 0x000fffff))
111 yield(); 111 CLKCON |= (1 << 2); /* set IDLE bit */
112 } 112 }
113 else 113 else
114 memcpy(((char*)FRAME) + (y * sizeof(fb_data) * LCD_WIDTH), ((char *)&lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH), ((height * sizeof(fb_data) * LCD_WIDTH))); 114 memcpy(((char*)FRAME) + (y * sizeof(fb_data) * LCD_WIDTH), ((char *)&lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH), ((height * sizeof(fb_data) * LCD_WIDTH)));
@@ -159,8 +159,9 @@ void lcd_clear_display_dma(void)
159 void *src; 159 void *src;
160 bool inc = false; 160 bool inc = false;
161 161
162 if(!lcd_on) 162 if(!lcd_on) {
163 yield(); 163 sleep(200);
164 }
164 if (lcd_get_drawmode() & DRMODE_INVERSEVID) 165 if (lcd_get_drawmode() & DRMODE_INVERSEVID)
165 src = fg_pattern_blit; 166 src = fg_pattern_blit;
166 else 167 else
@@ -177,16 +178,16 @@ void lcd_clear_display_dma(void)
177 } 178 }
178 /* Wait for any pending transfer to complete */ 179 /* Wait for any pending transfer to complete */
179 while((DSTAT3 & 0x000fffff)) 180 while((DSTAT3 & 0x000fffff))
180 yield(); 181 CLKCON |= (1 << 2); /* set IDLE bit */
181 DMASKTRIG3 |= 0x4; /* Stop controller */ 182 DMASKTRIG3 |= 0x4; /* Stop controller */
182 DIDST3 = ((int) lcd_framebuffer) + 0x30000000; /* set DMA dest, physical address */ 183 DIDST3 = ((int) &lcd_framebuffer[0][0]) + 0x30000000; /* set DMA dest, physical address */
183 DIDSTC3 = 0; /* Dest on AHB, increment */ 184 DIDSTC3 = 0; /* Dest on AHB, increment */
184 185
185 DISRC3 = ((int) src) + 0x30000000; /* Set source, in physical space */ 186 DISRC3 = ((int) src) + 0x30000000; /* Set source, in physical space */
186 DISRCC3 = inc ? 0x00 : 0x01; /* memory is on AHB bus, increment addresses based on backdrop */ 187 DISRCC3 = inc ? 0x00 : 0x01; /* memory is on AHB bus, increment addresses based on backdrop */
187 188
188 /* Handshake on AHB, Burst mode, whole service mode, no reload, move 32-bits */ 189 /* Handshake on AHB, Burst mode, whole service mode, no reload, move 32-bits */
189 DCON3 = ((1<<30) | (1<<28) | (1<<27) | (1<<22) | (2<<20)) | (sizeof(lcd_framebuffer) >> 4); 190 DCON3 = ((1<<30) | (1<<28) | (1<<27) | (1<<22) | (2<<20)) | ((LCD_WIDTH*LCD_HEIGHT*sizeof(fb_data)) >> 4);
190 191
191 /* Dump DCache for dest, we are about to overwrite it with DMA */ 192 /* Dump DCache for dest, we are about to overwrite it with DMA */
192 invalidate_dcache_range((void *)lcd_framebuffer, sizeof(lcd_framebuffer)); 193 invalidate_dcache_range((void *)lcd_framebuffer, sizeof(lcd_framebuffer));
@@ -197,7 +198,7 @@ void lcd_clear_display_dma(void)
197 198
198 /* Wait for transfer to complete */ 199 /* Wait for transfer to complete */
199 while((DSTAT3 & 0x000fffff)) 200 while((DSTAT3 & 0x000fffff))
200 yield(); 201 CLKCON |= (1 << 2); /* set IDLE bit */
201} 202}
202 203
203void lcd_clear_display(void) 204void lcd_clear_display(void)