summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/ondavx747.c60
1 files changed, 10 insertions, 50 deletions
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 1f6e3cbeac..d8fefd4f48 100644
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -42,48 +42,6 @@ static void audiotest(void)
42 __aic_enable_loopback(); 42 __aic_enable_loopback();
43} 43}
44 44
45/* CP0 hazard avoidance. */
46#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
47 "nop; nop; nop; nop; nop; nop;\n\t" \
48 ".set reorder\n\t")
49static void show_tlb(void)
50{
51#define ASID_MASK 0xFF
52
53 unsigned int old_ctx;
54 unsigned int entry;
55 unsigned int entrylo0, entrylo1, entryhi;
56 unsigned int pagemask;
57
58 cli();
59
60 /* Save old context */
61 old_ctx = (read_c0_entryhi() & 0xff);
62
63 printf("TLB content:");
64 for(entry = 0; entry < 32; entry++)
65 {
66 write_c0_index(entry);
67 BARRIER;
68 tlb_read();
69 BARRIER;
70 entryhi = read_c0_entryhi();
71 entrylo0 = read_c0_entrylo0();
72 entrylo1 = read_c0_entrylo1();
73 pagemask = read_c0_pagemask();
74 printf("%02d: ASID=%02d%s VA=0x%08x", entry, entryhi & ASID_MASK, (entrylo0 & entrylo1 & 1) ? "(G)" : " ", entryhi & ~ASID_MASK);
75 printf("PA0=0x%08x C0=%x %s%s%s", (entrylo0>>6)<<12, (entrylo0>>3) & 7, (entrylo0 & 4) ? "Dirty " : "", (entrylo0 & 2) ? "Valid " : "Invalid ", (entrylo0 & 1) ? "Global" : "");
76 printf("PA1=0x%08x C1=%x %s%s%s", (entrylo1>>6)<<12, (entrylo1>>3) & 7, (entrylo1 & 4) ? "Dirty " : "", (entrylo1 & 2) ? "Valid " : "Invalid ", (entrylo1 & 1) ? "Global" : "");
77
78 printf("pagemask=0x%08x entryhi=0x%08x", pagemask, entryhi);
79 printf("entrylo0=0x%08x entrylo1=0x%08x", entrylo0, entrylo1);
80 }
81 BARRIER;
82 write_c0_entryhi(old_ctx);
83
84 sti();
85}
86
87int main(void) 45int main(void)
88{ 46{
89 kernel_init(); 47 kernel_init();
@@ -135,12 +93,15 @@ int main(void)
135 { 93 {
136 memset(testdata, 0, 4096); 94 memset(testdata, 0, 4096);
137 reset_screen(); 95 reset_screen();
138 jz_nand_read(2, j, &testdata); 96 jz_nand_read(0, j, &testdata);
139 printf("Page %d", j); 97 printf("Page %d", j);
140 int i; 98 int i;
141 for(i=0; i<256; i+=8) 99 for(i=0; i<768; i+=16)
142 { 100 {
143 snprintf(msg, 30, "%02c%02c%02c%02c%02c%02c%02c%02c", testdata[i], testdata[i+1], testdata[i+2], testdata[i+3], testdata[i+4], testdata[i+5], testdata[i+6], testdata[i+7]); 101 snprintf(msg, 30, "%02x%02x%02x%02x%02x%02x%02x%02x %02x%02x%02x%02x%02x%02x%02x%02x",
102 testdata[i], testdata[i+1], testdata[i+2], testdata[i+3], testdata[i+4], testdata[i+5], testdata[i+6], testdata[i+7],
103 testdata[i+8], testdata[i+9], testdata[i+10], testdata[i+11], testdata[i+12], testdata[i+13], testdata[i+14], testdata[i+15]
104 );
144 printf(msg); 105 printf(msg);
145 } 106 }
146 while(!((btn = button_read_device(&touch)) & (BUTTON_VOL_UP|BUTTON_VOL_DOWN))); 107 while(!((btn = button_read_device(&touch)) & (BUTTON_VOL_UP|BUTTON_VOL_DOWN)));
@@ -155,9 +116,13 @@ int main(void)
155 while(1) 116 while(1)
156 { 117 {
157#ifdef ONDA_VX747 118#ifdef ONDA_VX747
119#if 1
158 btn = button_get(false); 120 btn = button_get(false);
159 touch = button_get_data(); 121 touch = button_get_data();
160#else 122#else
123 btn = button_read_device(&touch);
124#endif
125#else
161 btn = button_read_device(); 126 btn = button_read_device();
162#endif 127#endif
163#define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \ 128#define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \
@@ -174,11 +139,6 @@ int main(void)
174 printf("BUTTON_HOLD"); 139 printf("BUTTON_HOLD");
175 asm("break 0x7"); 140 asm("break 0x7");
176 } 141 }
177 if(btn & BUTTON_VOL_DOWN)
178 {
179 reset_screen();
180 show_tlb();
181 }
182 if(btn & BUTTON_POWER) 142 if(btn & BUTTON_POWER)
183 { 143 {
184 power_off(); 144 power_off();