freemyipod r278 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r277‎ | r278 | r279 >
Date:12:03, 23 November 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Optimize s5l8702/s5l8720 LCD drivers a bit.
Modified paths:
  • /embios/trunk/target/ipodnano3g/lcd.c (modified) (history)
  • /embios/trunk/target/ipodnano3g/s5l8702.h (modified) (history)
  • /embios/trunk/target/ipodnano4g/lcd.c (modified) (history)
  • /embios/trunk/target/ipodnano4g/s5l8720.h (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodnano3g/lcd.c
@@ -27,13 +27,8 @@
2828 #include "util.h"
2929
3030
31 -static struct dma_lli
32 -{
33 - void* srcaddr;
34 - void* dstaddr;
35 - struct dma_lli* nextlli;
36 - uint32_t control;
37 -} lcd_lli[(LCD_WIDTH * LCD_HEIGHT - 1) / 0xfff] IDATA_ATTR __attribute__((aligned(16)));
 31+static struct dma_lli lcd_lli[(LCD_WIDTH * LCD_HEIGHT - 1) / 0xfff]
 32+ IDATA_ATTR __attribute__((aligned(16)));
3833
3934 static uint16_t lcd_color IDATA_ATTR;
4035
@@ -128,25 +123,19 @@
129124 lcd_send_cmd(0x2c);
130125 }
131126 int pixels = (endx - startx + 1) * (endy - starty + 1);
 127+ if (pixels <= 0) return;
132128 int i;
133129 bool solid = (int)data == -1;
134 - bool last = !ARRAYLEN(lcd_lli) || pixels <= 0xfff;
135130 if (solid) lcd_color = color;
136 - DMAC0C0SRCADDR = solid ? &lcd_color : data;
137 - DMAC0C0DESTADDR = (void*)((int)&LCDWDATA);
138 - DMAC0C0LLI = last ? (void*)0 : lcd_lli;
139 - DMAC0C0CONTROL = 0x70240000 | (last ? pixels : 0xfff)
140 - | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
141 - void* origdata=data;
142 - data = (void*)(((uint32_t)data) + 0x1ffe);
143 - for (i = 0, pixels -= 0xfff; i < ARRAYLEN(lcd_lli) && pixels > 0; i++, pixels -= 0xfff)
 131+ for (i = -1; i < (int)ARRAYLEN(lcd_lli) && pixels > 0; i++, pixels -= 0xfff)
144132 {
145 - last = i + 1 >= ARRAYLEN(lcd_lli) || pixels <= 0xfff;
146 - lcd_lli[i].srcaddr = solid ? &lcd_color : data;
147 - lcd_lli[i].dstaddr = (void*)((int)&LCDWDATA);
148 - lcd_lli[i].nextlli = last ? (void*)0 : &lcd_lli[i + 1];
149 - lcd_lli[i].control = 0x70240000 | (last ? pixels : 0xfff)
150 - | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
 133+ bool last = i + 1 >= ARRAYLEN(lcd_lli) || pixels <= 0xfff;
 134+ struct dma_lli* lli = i < 0 ? (struct dma_lli*)((int)&DMAC0C0LLI) : &lcd_lli[i];
 135+ lli->srcaddr = solid ? &lcd_color : data;
 136+ lli->dstaddr = (void*)((int)&LCDWDATA);
 137+ lli->nextlli = last ? NULL : &lcd_lli[i + 1];
 138+ lli->control = 0x70240000 | (last ? pixels : 0xfff)
 139+ | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
151140 data = (void*)(((uint32_t)data) + 0x1ffe);
152141 }
153142 clean_dcache();
Index: embios/trunk/target/ipodnano3g/s5l8702.h
@@ -359,6 +359,13 @@
360360
361361
362362 /////DMA/////
 363+struct dma_lli
 364+{
 365+ void* srcaddr;
 366+ void* dstaddr;
 367+ const struct dma_lli* nextlli;
 368+ uint32_t control;
 369+};
363370 #define DMACINTSTS(d) (*((uint32_t volatile*)(0x38200000 + 0x1700000 * (d))))
364371 #define DMACINTTCSTS(d) (*((uint32_t volatile*)(0x38200004 + 0x1700000 * (d))))
365372 #define DMACINTTCCLR(d) (*((uint32_t volatile*)(0x38200008 + 0x1700000 * (d))))
@@ -373,9 +380,10 @@
374381 #define DMACSOFTLSREQ(d) (*((uint32_t volatile*)(0x3820002c + 0x1700000 * (d))))
375382 #define DMACCONFIG(d) (*((uint32_t volatile*)(0x38200030 + 0x1700000 * (d))))
376383 #define DMACSYNC(d) (*((uint32_t volatile*)(0x38200034 + 0x1700000 * (d))))
 384+#define DMACCLLI(d, c) (*((struct dma_lli volatile*)(0x38200100 + 0x1700000 * (d) + 0x20 * (c))))
377385 #define DMACCSRCADDR(d, c) (*((const void* volatile*)(0x38200100 + 0x1700000 * (d) + 0x20 * (c))))
378386 #define DMACCDESTADDR(d, c) (*((void* volatile*)(0x38200104 + 0x1700000 * (d) + 0x20 * (c))))
379 -#define DMACCLLI(d, c) (*((const void* volatile*)(0x38200108 + 0x1700000 * (d) + 0x20 * (c))))
 387+#define DMACCNEXTLLI(d, c) (*((const void* volatile*)(0x38200108 + 0x1700000 * (d) + 0x20 * (c))))
380388 #define DMACCCONTROL(d, c) (*((uint32_t volatile*)(0x3820010c + 0x1700000 * (d) + 0x20 * (c))))
381389 #define DMACCCONFIG(d, c) (*((uint32_t volatile*)(0x38200110 + 0x1700000 * (d) + 0x20 * (c))))
382390 #define DMAC0INTSTS (*((uint32_t volatile*)(0x38200000)))
@@ -392,49 +400,58 @@
393401 #define DMAC0SOFTLSREQ (*((uint32_t volatile*)(0x3820002c)))
394402 #define DMAC0CONFIG (*((uint32_t volatile*)(0x38200030)))
395403 #define DMAC0SYNC (*((uint32_t volatile*)(0x38200034)))
 404+#define DMAC0CLLI(c) (*((struct dma_lli volatile*)(0x38200100 + 0x20 * (c))))
396405 #define DMAC0CSRCADDR(c) (*((const void* volatile*)(0x38200100 + 0x20 * (c))))
397406 #define DMAC0CDESTADDR(c) (*((void* volatile*)(0x38200104 + 0x20 * (c))))
398 -#define DMAC0CLLI(c) (*((const void* volatile*)(0x38200108 + 0x20 * (c))))
 407+#define DMAC0CNEXTLLI(c) (*((const void* volatile*)(0x38200108 + 0x20 * (c))))
399408 #define DMAC0CCONTROL(c) (*((uint32_t volatile*)(0x3820010c + 0x20 * (c))))
400409 #define DMAC0CCONFIG(c) (*((uint32_t volatile*)(0x38200110 + 0x20 * (c))))
 410+#define DMAC0C0LLI (*((struct dma_lli volatile*)(0x38200100)))
401411 #define DMAC0C0SRCADDR (*((const void* volatile*)(0x38200100)))
402412 #define DMAC0C0DESTADDR (*((void* volatile*)(0x38200104)))
403 -#define DMAC0C0LLI (*((const void* volatile*)(0x38200108)))
 413+#define DMAC0C0NEXTLLI (*((const struct dma_lli* volatile*)(0x38200108)))
404414 #define DMAC0C0CONTROL (*((uint32_t volatile*)(0x3820010c)))
405415 #define DMAC0C0CONFIG (*((uint32_t volatile*)(0x38200110)))
 416+#define DMAC0C1LLI (*((struct dma_lli volatile*)(0x38200120)))
406417 #define DMAC0C1SRCADDR (*((const void* volatile*)(0x38200120)))
407418 #define DMAC0C1DESTADDR (*((void* volatile*)(0x38200124)))
408 -#define DMAC0C1LLI (*((const void* volatile*)(0x38200128)))
 419+#define DMAC0C1NEXTLLI (*((const struct dma_lli* volatile*)(0x38200128)))
409420 #define DMAC0C1CONTROL (*((uint32_t volatile*)(0x3820012c)))
410421 #define DMAC0C1CONFIG (*((uint32_t volatile*)(0x38200130)))
 422+#define DMAC0C2LLI (*((struct dma_lli volatile*)(0x38200140)))
411423 #define DMAC0C2SRCADDR (*((const void* volatile*)(0x38200140)))
412424 #define DMAC0C2DESTADDR (*((void* volatile*)(0x38200144)))
413 -#define DMAC0C2LLI (*((const void* volatile*)(0x38200148)))
 425+#define DMAC0C2NEXTLLI (*((const struct dma_lli* volatile*)(0x38200148)))
414426 #define DMAC0C2CONTROL (*((uint32_t volatile*)(0x3820014c)))
415427 #define DMAC0C2CONFIG (*((uint32_t volatile*)(0x38200150)))
 428+#define DMAC0C3LLI (*((struct dma_lli volatile*)(0x38200160)))
416429 #define DMAC0C3SRCADDR (*((const void* volatile*)(0x38200160)))
417430 #define DMAC0C3DESTADDR (*((void* volatile*)(0x38200164)))
418 -#define DMAC0C3LLI (*((const void* volatile*)(0x38200168)))
 431+#define DMAC0C3NEXTLLI (*((const struct dma_lli* volatile*)(0x38200168)))
419432 #define DMAC0C3CONTROL (*((uint32_t volatile*)(0x3820016c)))
420433 #define DMAC0C3CONFIG (*((uint32_t volatile*)(0x38200170)))
 434+#define DMAC0C4LLI (*((struct dma_lli volatile*)(0x38200180)))
421435 #define DMAC0C4SRCADDR (*((const void* volatile*)(0x38200180)))
422436 #define DMAC0C4DESTADDR (*((void* volatile*)(0x38200184)))
423 -#define DMAC0C4LLI (*((const void* volatile*)(0x38200188)))
 437+#define DMAC0C4NEXTLLI (*((const struct dma_lli* volatile*)(0x38200188)))
424438 #define DMAC0C4CONTROL (*((uint32_t volatile*)(0x3820018c)))
425439 #define DMAC0C4CONFIG (*((uint32_t volatile*)(0x38200190)))
 440+#define DMAC0C5LLI (*((struct dma_lli volatile*)(0x382001a0)))
426441 #define DMAC0C5SRCADDR (*((const void* volatile*)(0x382001a0)))
427442 #define DMAC0C5DESTADDR (*((void* volatile*)(0x382001a4)))
428 -#define DMAC0C5LLI (*((const void* volatile*)(0x382001a8)))
 443+#define DMAC0C5NEXTLLI (*((const struct dma_lli* volatile*)(0x382001a8)))
429444 #define DMAC0C5CONTROL (*((uint32_t volatile*)(0x382001ac)))
430445 #define DMAC0C5CONFIG (*((uint32_t volatile*)(0x382001b0)))
 446+#define DMAC0C6LLI (*((struct dma_lli volatile*)(0x382001c0)))
431447 #define DMAC0C6SRCADDR (*((const void* volatile*)(0x382001c0)))
432448 #define DMAC0C6DESTADDR (*((void* volatile*)(0x382001c4)))
433 -#define DMAC0C6LLI (*((const void* volatile*)(0x382001c8)))
 449+#define DMAC0C6NEXTLLI (*((const struct dma_lli* volatile*)(0x382001c8)))
434450 #define DMAC0C6CONTROL (*((uint32_t volatile*)(0x382001cc)))
435451 #define DMAC0C6CONFIG (*((uint32_t volatile*)(0x382001d0)))
 452+#define DMAC0C7LLI (*((struct dma_lli volatile*)(0x382001e0)))
436453 #define DMAC0C7SRCADDR (*((const void* volatile*)(0x382001e0)))
437454 #define DMAC0C7DESTADDR (*((void* volatile*)(0x382001e4)))
438 -#define DMAC0C7LLI (*((const void* volatile*)(0x382001e8)))
 455+#define DMAC0C7NEXTLLI (*((const struct dma_lli* volatile*)(0x382001e8)))
439456 #define DMAC0C7CONTROL (*((uint32_t volatile*)(0x382001ec)))
440457 #define DMAC0C7CONFIG (*((uint32_t volatile*)(0x382001f0)))
441458 #define DMAC1INTSTS (*((uint32_t volatile*)(0x39900000)))
@@ -451,49 +468,58 @@
452469 #define DMAC1SOFTLSREQ (*((uint32_t volatile*)(0x3990002c)))
453470 #define DMAC1CONFIG (*((uint32_t volatile*)(0x39900030)))
454471 #define DMAC1SYNC (*((uint32_t volatile*)(0x39900034)))
 472+#define DMAC1CLLI(c) (*((struct dma_lli volatile*)(0x39900100 + 0x20 * (c))))
455473 #define DMAC1CSRCADDR(c) (*((const void* volatile*)(0x39900100 + 0x20 * (c))))
456474 #define DMAC1CDESTADDR(c) (*((void* volatile*)(0x39900104 + 0x20 * (c))))
457 -#define DMAC1CLLI(c) (*((const void* volatile*)(0x39900108 + 0x20 * (c))))
 475+#define DMAC1CNEXTLLI(c) (*((const void* volatile*)(0x39900108 + 0x20 * (c))))
458476 #define DMAC1CCONTROL(c) (*((uint32_t volatile*)(0x3990010c + 0x20 * (c))))
459477 #define DMAC1CCONFIG(c) (*((uint32_t volatile*)(0x39900110 + 0x20 * (c))))
 478+#define DMAC1C0LLI (*((struct dma_lli volatile*)(0x39900100)))
460479 #define DMAC1C0SRCADDR (*((const void* volatile*)(0x39900100)))
461480 #define DMAC1C0DESTADDR (*((void* volatile*)(0x39900104)))
462 -#define DMAC1C0LLI (*((const void* volatile*)(0x39900108)))
 481+#define DMAC1C0NEXTLLI (*((const struct dma_lli* volatile*)(0x39900108)))
463482 #define DMAC1C0CONTROL (*((uint32_t volatile*)(0x3990010c)))
464483 #define DMAC1C0CONFIG (*((uint32_t volatile*)(0x39900110)))
 484+#define DMAC1C1LLI (*((struct dma_lli volatile*)(0x39900120)))
465485 #define DMAC1C1SRCADDR (*((const void* volatile*)(0x39900120)))
466486 #define DMAC1C1DESTADDR (*((void* volatile*)(0x39900124)))
467 -#define DMAC1C1LLI (*((const void* volatile*)(0x39900128)))
 487+#define DMAC1C1NEXTLLI (*((const struct dma_lli* volatile*)(0x39900128)))
468488 #define DMAC1C1CONTROL (*((uint32_t volatile*)(0x3990012c)))
469489 #define DMAC1C1CONFIG (*((uint32_t volatile*)(0x39900130)))
 490+#define DMAC1C2LLI (*((struct dma_lli volatile*)(0x39900140)))
470491 #define DMAC1C2SRCADDR (*((const void* volatile*)(0x39900140)))
471492 #define DMAC1C2DESTADDR (*((void* volatile*)(0x39900144)))
472 -#define DMAC1C2LLI (*((const void* volatile*)(0x39900148)))
 493+#define DMAC1C2NEXTLLI (*((const struct dma_lli* volatile*)(0x39900148)))
473494 #define DMAC1C2CONTROL (*((uint32_t volatile*)(0x3990014c)))
474495 #define DMAC1C2CONFIG (*((uint32_t volatile*)(0x39900150)))
 496+#define DMAC1C3LLI (*((struct dma_lli volatile*)(0x39900160)))
475497 #define DMAC1C3SRCADDR (*((const void* volatile*)(0x39900160)))
476498 #define DMAC1C3DESTADDR (*((void* volatile*)(0x39900164)))
477 -#define DMAC1C3LLI (*((volatile vvoid**)(0x39900168)))
 499+#define DMAC1C3NEXTLLI (*((volatile void**)(0x39900168)))
478500 #define DMAC1C3CONTROL (*((uint32_t volatile*)(0x3990016c)))
479501 #define DMAC1C3CONFIG (*((uint32_t volatile*)(0x39900170)))
 502+#define DMAC1C4LLI (*((struct dma_lli volatile*)(0x39900180)))
480503 #define DMAC1C4SRCADDR (*((const void* volatile*)(0x39900180)))
481504 #define DMAC1C4DESTADDR (*((void* volatile*)(0x39900184)))
482 -#define DMAC1C4LLI (*((const void* volatile*)(0x39900188)))
 505+#define DMAC1C4NEXTLLI (*((const struct dma_lli* volatile*)(0x39900188)))
483506 #define DMAC1C4CONTROL (*((uint32_t volatile*)(0x3990018c)))
484507 #define DMAC1C4CONFIG (*((uint32_t volatile*)(0x39900190)))
 508+#define DMAC1C5LLI (*((struct dma_lli volatile*)(0x399001a0)))
485509 #define DMAC1C5SRCADDR (*((const void* volatile*)(0x399001a0)))
486510 #define DMAC1C5DESTADDR (*((void* volatile*)(0x399001a4)))
487 -#define DMAC1C5LLI (*((const void* volatile*)(0x399001a8)))
 511+#define DMAC1C5NEXTLLI (*((const struct dma_lli* volatile*)(0x399001a8)))
488512 #define DMAC1C5CONTROL (*((uint32_t volatile*)(0x399001ac)))
489513 #define DMAC1C5CONFIG (*((uint32_t volatile*)(0x399001b0)))
 514+#define DMAC1C6LLI (*((struct dma_lli volatile*)(0x399001c0)))
490515 #define DMAC1C6SRCADDR (*((const void* volatile*)(0x399001c0)))
491516 #define DMAC1C6DESTADDR (*((void* volatile*)(0x399001c4)))
492 -#define DMAC1C6LLI (*((const void* volatile*)(0x399001c8)))
 517+#define DMAC1C6NEXTLLI (*((const struct dma_lli* volatile*)(0x399001c8)))
493518 #define DMAC1C6CONTROL (*((uint32_t volatile*)(0x399001cc)))
494519 #define DMAC1C6CONFIG (*((uint32_t volatile*)(0x399001d0)))
 520+#define DMAC1C7LLI (*((struct dma_lli volatile*)(0x399001e0)))
495521 #define DMAC1C7SRCADDR (*((const void* volatile*)(0x399001e0)))
496522 #define DMAC1C7DESTADDR (*((void* volatile*)(0x399001e4)))
497 -#define DMAC1C7LLI (*((const void* volatile*)(0x399001e8)))
 523+#define DMAC1C7NEXTLLI (*((const struct dma_lli* volatile*)(0x399001e8)))
498524 #define DMAC1C7CONTROL (*((uint32_t volatile*)(0x399001ec)))
499525 #define DMAC1C7CONFIG (*((uint32_t volatile*)(0x399001f0)))
500526
Index: embios/trunk/target/ipodnano4g/lcd.c
@@ -27,13 +27,8 @@
2828 #include "util.h"
2929
3030
31 -static struct dma_lli
32 -{
33 - void* srcaddr;
34 - void* dstaddr;
35 - struct dma_lli* nextlli;
36 - uint32_t control;
37 -} lcd_lli[(LCD_WIDTH * LCD_HEIGHT - 1) / 0xfff] IDATA_ATTR __attribute__((aligned(16)));
 31+static struct dma_lli lcd_lli[(LCD_WIDTH * LCD_HEIGHT - 1) / 0xfff]
 32+ IDATA_ATTR __attribute__((aligned(16)));
3833
3934 static uint16_t lcd_color IDATA_ATTR;
4035
@@ -102,23 +97,16 @@
10398 int pixels = (endx - startx + 1) * (endy - starty + 1);
10499 int i;
105100 bool solid = (int)data == -1;
106 - bool last = !ARRAYLEN(lcd_lli) || pixels <= 0xfff;
107101 if (solid) lcd_color = color;
108 - DMAC0C0SRCADDR = solid ? &lcd_color : data;
109 - DMAC0C0DESTADDR = (void*)((int)&LCDWDATA);
110 - DMAC0C0LLI = last ? (void*)0 : lcd_lli;
111 - DMAC0C0CONTROL = 0x70240000 | (last ? pixels : 0xfff)
112 - | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
113 - void* origdata=data;
114 - data = (void*)(((uint32_t)data) + 0x1ffe);
115 - for (i = 0, pixels -= 0xfff; i < ARRAYLEN(lcd_lli) && pixels > 0; i++, pixels -= 0xfff)
 102+ for (i = -1; i < (int)ARRAYLEN(lcd_lli) && pixels > 0; i++, pixels -= 0xfff)
116103 {
117 - last = i + 1 >= ARRAYLEN(lcd_lli) || pixels <= 0xfff;
118 - lcd_lli[i].srcaddr = solid ? &lcd_color : data;
119 - lcd_lli[i].dstaddr = (void*)((int)&LCDWDATA);
120 - lcd_lli[i].nextlli = last ? (void*)0 : &lcd_lli[i + 1];
121 - lcd_lli[i].control = 0x70240000 | (last ? pixels : 0xfff)
122 - | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
 104+ bool last = i + 1 >= ARRAYLEN(lcd_lli) || pixels <= 0xfff;
 105+ struct dma_lli* lli = i < 0 ? (struct dma_lli*)((int)&DMAC0C0LLI) : &lcd_lli[i];
 106+ lli->srcaddr = solid ? &lcd_color : data;
 107+ lli->dstaddr = (void*)((int)&LCDWDATA);
 108+ lli->nextlli = last ? NULL : &lcd_lli[i + 1];
 109+ lli->control = 0x70240000 | (last ? pixels : 0xfff)
 110+ | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
123111 data = (void*)(((uint32_t)data) + 0x1ffe);
124112 }
125113 clean_dcache();
Index: embios/trunk/target/ipodnano4g/s5l8720.h
@@ -359,6 +359,13 @@
360360
361361
362362 /////DMA/////
 363+struct dma_lli
 364+{
 365+ void* srcaddr;
 366+ void* dstaddr;
 367+ const struct dma_lli* nextlli;
 368+ uint32_t control;
 369+};
363370 #define DMACINTSTS(d) (*((uint32_t volatile*)(0x38200000 + 0x1700000 * (d))))
364371 #define DMACINTTCSTS(d) (*((uint32_t volatile*)(0x38200004 + 0x1700000 * (d))))
365372 #define DMACINTTCCLR(d) (*((uint32_t volatile*)(0x38200008 + 0x1700000 * (d))))
@@ -373,9 +380,10 @@
374381 #define DMACSOFTLSREQ(d) (*((uint32_t volatile*)(0x3820002c + 0x1700000 * (d))))
375382 #define DMACCONFIG(d) (*((uint32_t volatile*)(0x38200030 + 0x1700000 * (d))))
376383 #define DMACSYNC(d) (*((uint32_t volatile*)(0x38200034 + 0x1700000 * (d))))
 384+#define DMACCLLI(d, c) (*((struct dma_lli volatile*)(0x38200100 + 0x1700000 * (d) + 0x20 * (c))))
377385 #define DMACCSRCADDR(d, c) (*((const void* volatile*)(0x38200100 + 0x1700000 * (d) + 0x20 * (c))))
378386 #define DMACCDESTADDR(d, c) (*((void* volatile*)(0x38200104 + 0x1700000 * (d) + 0x20 * (c))))
379 -#define DMACCLLI(d, c) (*((const void* volatile*)(0x38200108 + 0x1700000 * (d) + 0x20 * (c))))
 387+#define DMACCNEXTLLI(d, c) (*((const void* volatile*)(0x38200108 + 0x1700000 * (d) + 0x20 * (c))))
380388 #define DMACCCONTROL(d, c) (*((uint32_t volatile*)(0x3820010c + 0x1700000 * (d) + 0x20 * (c))))
381389 #define DMACCCONFIG(d, c) (*((uint32_t volatile*)(0x38200110 + 0x1700000 * (d) + 0x20 * (c))))
382390 #define DMAC0INTSTS (*((uint32_t volatile*)(0x38200000)))
@@ -392,49 +400,58 @@
393401 #define DMAC0SOFTLSREQ (*((uint32_t volatile*)(0x3820002c)))
394402 #define DMAC0CONFIG (*((uint32_t volatile*)(0x38200030)))
395403 #define DMAC0SYNC (*((uint32_t volatile*)(0x38200034)))
 404+#define DMAC0CLLI(c) (*((struct dma_lli volatile*)(0x38200100 + 0x20 * (c))))
396405 #define DMAC0CSRCADDR(c) (*((const void* volatile*)(0x38200100 + 0x20 * (c))))
397406 #define DMAC0CDESTADDR(c) (*((void* volatile*)(0x38200104 + 0x20 * (c))))
398 -#define DMAC0CLLI(c) (*((const void* volatile*)(0x38200108 + 0x20 * (c))))
 407+#define DMAC0CNEXTLLI(c) (*((const void* volatile*)(0x38200108 + 0x20 * (c))))
399408 #define DMAC0CCONTROL(c) (*((uint32_t volatile*)(0x3820010c + 0x20 * (c))))
400409 #define DMAC0CCONFIG(c) (*((uint32_t volatile*)(0x38200110 + 0x20 * (c))))
 410+#define DMAC0C0LLI (*((struct dma_lli volatile*)(0x38200100)))
401411 #define DMAC0C0SRCADDR (*((const void* volatile*)(0x38200100)))
402412 #define DMAC0C0DESTADDR (*((void* volatile*)(0x38200104)))
403 -#define DMAC0C0LLI (*((const void* volatile*)(0x38200108)))
 413+#define DMAC0C0NEXTLLI (*((const struct dma_lli* volatile*)(0x38200108)))
404414 #define DMAC0C0CONTROL (*((uint32_t volatile*)(0x3820010c)))
405415 #define DMAC0C0CONFIG (*((uint32_t volatile*)(0x38200110)))
 416+#define DMAC0C1LLI (*((struct dma_lli volatile*)(0x38200120)))
406417 #define DMAC0C1SRCADDR (*((const void* volatile*)(0x38200120)))
407418 #define DMAC0C1DESTADDR (*((void* volatile*)(0x38200124)))
408 -#define DMAC0C1LLI (*((const void* volatile*)(0x38200128)))
 419+#define DMAC0C1NEXTLLI (*((const struct dma_lli* volatile*)(0x38200128)))
409420 #define DMAC0C1CONTROL (*((uint32_t volatile*)(0x3820012c)))
410421 #define DMAC0C1CONFIG (*((uint32_t volatile*)(0x38200130)))
 422+#define DMAC0C2LLI (*((struct dma_lli volatile*)(0x38200140)))
411423 #define DMAC0C2SRCADDR (*((const void* volatile*)(0x38200140)))
412424 #define DMAC0C2DESTADDR (*((void* volatile*)(0x38200144)))
413 -#define DMAC0C2LLI (*((const void* volatile*)(0x38200148)))
 425+#define DMAC0C2NEXTLLI (*((const struct dma_lli* volatile*)(0x38200148)))
414426 #define DMAC0C2CONTROL (*((uint32_t volatile*)(0x3820014c)))
415427 #define DMAC0C2CONFIG (*((uint32_t volatile*)(0x38200150)))
 428+#define DMAC0C3LLI (*((struct dma_lli volatile*)(0x38200160)))
416429 #define DMAC0C3SRCADDR (*((const void* volatile*)(0x38200160)))
417430 #define DMAC0C3DESTADDR (*((void* volatile*)(0x38200164)))
418 -#define DMAC0C3LLI (*((const void* volatile*)(0x38200168)))
 431+#define DMAC0C3NEXTLLI (*((const struct dma_lli* volatile*)(0x38200168)))
419432 #define DMAC0C3CONTROL (*((uint32_t volatile*)(0x3820016c)))
420433 #define DMAC0C3CONFIG (*((uint32_t volatile*)(0x38200170)))
 434+#define DMAC0C4LLI (*((struct dma_lli volatile*)(0x38200180)))
421435 #define DMAC0C4SRCADDR (*((const void* volatile*)(0x38200180)))
422436 #define DMAC0C4DESTADDR (*((void* volatile*)(0x38200184)))
423 -#define DMAC0C4LLI (*((const void* volatile*)(0x38200188)))
 437+#define DMAC0C4NEXTLLI (*((const struct dma_lli* volatile*)(0x38200188)))
424438 #define DMAC0C4CONTROL (*((uint32_t volatile*)(0x3820018c)))
425439 #define DMAC0C4CONFIG (*((uint32_t volatile*)(0x38200190)))
 440+#define DMAC0C5LLI (*((struct dma_lli volatile*)(0x382001a0)))
426441 #define DMAC0C5SRCADDR (*((const void* volatile*)(0x382001a0)))
427442 #define DMAC0C5DESTADDR (*((void* volatile*)(0x382001a4)))
428 -#define DMAC0C5LLI (*((const void* volatile*)(0x382001a8)))
 443+#define DMAC0C5NEXTLLI (*((const struct dma_lli* volatile*)(0x382001a8)))
429444 #define DMAC0C5CONTROL (*((uint32_t volatile*)(0x382001ac)))
430445 #define DMAC0C5CONFIG (*((uint32_t volatile*)(0x382001b0)))
 446+#define DMAC0C6LLI (*((struct dma_lli volatile*)(0x382001c0)))
431447 #define DMAC0C6SRCADDR (*((const void* volatile*)(0x382001c0)))
432448 #define DMAC0C6DESTADDR (*((void* volatile*)(0x382001c4)))
433 -#define DMAC0C6LLI (*((const void* volatile*)(0x382001c8)))
 449+#define DMAC0C6NEXTLLI (*((const struct dma_lli* volatile*)(0x382001c8)))
434450 #define DMAC0C6CONTROL (*((uint32_t volatile*)(0x382001cc)))
435451 #define DMAC0C6CONFIG (*((uint32_t volatile*)(0x382001d0)))
 452+#define DMAC0C7LLI (*((struct dma_lli volatile*)(0x382001e0)))
436453 #define DMAC0C7SRCADDR (*((const void* volatile*)(0x382001e0)))
437454 #define DMAC0C7DESTADDR (*((void* volatile*)(0x382001e4)))
438 -#define DMAC0C7LLI (*((const void* volatile*)(0x382001e8)))
 455+#define DMAC0C7NEXTLLI (*((const struct dma_lli* volatile*)(0x382001e8)))
439456 #define DMAC0C7CONTROL (*((uint32_t volatile*)(0x382001ec)))
440457 #define DMAC0C7CONFIG (*((uint32_t volatile*)(0x382001f0)))
441458 #define DMAC1INTSTS (*((uint32_t volatile*)(0x39900000)))
@@ -451,49 +468,58 @@
452469 #define DMAC1SOFTLSREQ (*((uint32_t volatile*)(0x3990002c)))
453470 #define DMAC1CONFIG (*((uint32_t volatile*)(0x39900030)))
454471 #define DMAC1SYNC (*((uint32_t volatile*)(0x39900034)))
 472+#define DMAC1CLLI(c) (*((struct dma_lli volatile*)(0x39900100 + 0x20 * (c))))
455473 #define DMAC1CSRCADDR(c) (*((const void* volatile*)(0x39900100 + 0x20 * (c))))
456474 #define DMAC1CDESTADDR(c) (*((void* volatile*)(0x39900104 + 0x20 * (c))))
457 -#define DMAC1CLLI(c) (*((const void* volatile*)(0x39900108 + 0x20 * (c))))
 475+#define DMAC1CNEXTLLI(c) (*((const void* volatile*)(0x39900108 + 0x20 * (c))))
458476 #define DMAC1CCONTROL(c) (*((uint32_t volatile*)(0x3990010c + 0x20 * (c))))
459477 #define DMAC1CCONFIG(c) (*((uint32_t volatile*)(0x39900110 + 0x20 * (c))))
 478+#define DMAC1C0LLI (*((struct dma_lli volatile*)(0x39900100)))
460479 #define DMAC1C0SRCADDR (*((const void* volatile*)(0x39900100)))
461480 #define DMAC1C0DESTADDR (*((void* volatile*)(0x39900104)))
462 -#define DMAC1C0LLI (*((const void* volatile*)(0x39900108)))
 481+#define DMAC1C0NEXTLLI (*((const struct dma_lli* volatile*)(0x39900108)))
463482 #define DMAC1C0CONTROL (*((uint32_t volatile*)(0x3990010c)))
464483 #define DMAC1C0CONFIG (*((uint32_t volatile*)(0x39900110)))
 484+#define DMAC1C1LLI (*((struct dma_lli volatile*)(0x39900120)))
465485 #define DMAC1C1SRCADDR (*((const void* volatile*)(0x39900120)))
466486 #define DMAC1C1DESTADDR (*((void* volatile*)(0x39900124)))
467 -#define DMAC1C1LLI (*((const void* volatile*)(0x39900128)))
 487+#define DMAC1C1NEXTLLI (*((const struct dma_lli* volatile*)(0x39900128)))
468488 #define DMAC1C1CONTROL (*((uint32_t volatile*)(0x3990012c)))
469489 #define DMAC1C1CONFIG (*((uint32_t volatile*)(0x39900130)))
 490+#define DMAC1C2LLI (*((struct dma_lli volatile*)(0x39900140)))
470491 #define DMAC1C2SRCADDR (*((const void* volatile*)(0x39900140)))
471492 #define DMAC1C2DESTADDR (*((void* volatile*)(0x39900144)))
472 -#define DMAC1C2LLI (*((const void* volatile*)(0x39900148)))
 493+#define DMAC1C2NEXTLLI (*((const struct dma_lli* volatile*)(0x39900148)))
473494 #define DMAC1C2CONTROL (*((uint32_t volatile*)(0x3990014c)))
474495 #define DMAC1C2CONFIG (*((uint32_t volatile*)(0x39900150)))
 496+#define DMAC1C3LLI (*((struct dma_lli volatile*)(0x39900160)))
475497 #define DMAC1C3SRCADDR (*((const void* volatile*)(0x39900160)))
476498 #define DMAC1C3DESTADDR (*((void* volatile*)(0x39900164)))
477 -#define DMAC1C3LLI (*((volatile vvoid**)(0x39900168)))
 499+#define DMAC1C3NEXTLLI (*((volatile void**)(0x39900168)))
478500 #define DMAC1C3CONTROL (*((uint32_t volatile*)(0x3990016c)))
479501 #define DMAC1C3CONFIG (*((uint32_t volatile*)(0x39900170)))
 502+#define DMAC1C4LLI (*((struct dma_lli volatile*)(0x39900180)))
480503 #define DMAC1C4SRCADDR (*((const void* volatile*)(0x39900180)))
481504 #define DMAC1C4DESTADDR (*((void* volatile*)(0x39900184)))
482 -#define DMAC1C4LLI (*((const void* volatile*)(0x39900188)))
 505+#define DMAC1C4NEXTLLI (*((const struct dma_lli* volatile*)(0x39900188)))
483506 #define DMAC1C4CONTROL (*((uint32_t volatile*)(0x3990018c)))
484507 #define DMAC1C4CONFIG (*((uint32_t volatile*)(0x39900190)))
 508+#define DMAC1C5LLI (*((struct dma_lli volatile*)(0x399001a0)))
485509 #define DMAC1C5SRCADDR (*((const void* volatile*)(0x399001a0)))
486510 #define DMAC1C5DESTADDR (*((void* volatile*)(0x399001a4)))
487 -#define DMAC1C5LLI (*((const void* volatile*)(0x399001a8)))
 511+#define DMAC1C5NEXTLLI (*((const struct dma_lli* volatile*)(0x399001a8)))
488512 #define DMAC1C5CONTROL (*((uint32_t volatile*)(0x399001ac)))
489513 #define DMAC1C5CONFIG (*((uint32_t volatile*)(0x399001b0)))
 514+#define DMAC1C6LLI (*((struct dma_lli volatile*)(0x399001c0)))
490515 #define DMAC1C6SRCADDR (*((const void* volatile*)(0x399001c0)))
491516 #define DMAC1C6DESTADDR (*((void* volatile*)(0x399001c4)))
492 -#define DMAC1C6LLI (*((const void* volatile*)(0x399001c8)))
 517+#define DMAC1C6NEXTLLI (*((const struct dma_lli* volatile*)(0x399001c8)))
493518 #define DMAC1C6CONTROL (*((uint32_t volatile*)(0x399001cc)))
494519 #define DMAC1C6CONFIG (*((uint32_t volatile*)(0x399001d0)))
 520+#define DMAC1C7LLI (*((struct dma_lli volatile*)(0x399001e0)))
495521 #define DMAC1C7SRCADDR (*((const void* volatile*)(0x399001e0)))
496522 #define DMAC1C7DESTADDR (*((void* volatile*)(0x399001e4)))
497 -#define DMAC1C7LLI (*((const void* volatile*)(0x399001e8)))
 523+#define DMAC1C7NEXTLLI (*((const struct dma_lli* volatile*)(0x399001e8)))
498524 #define DMAC1C7CONTROL (*((uint32_t volatile*)(0x399001ec)))
499525 #define DMAC1C7CONFIG (*((uint32_t volatile*)(0x399001f0)))
500526