diff options
-rw-r--r-- | bootloader/ondavx747.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c index 6400ccd9cd..dd1852a162 100644 --- a/bootloader/ondavx747.c +++ b/bootloader/ondavx747.c | |||
@@ -148,27 +148,41 @@ int main(void) | |||
148 | printf("REG_EMC_SACR4: 0x%x", REG_EMC_SACR4 >> EMC_SACR_BASE_BIT); | 148 | printf("REG_EMC_SACR4: 0x%x", REG_EMC_SACR4 >> EMC_SACR_BASE_BIT); |
149 | printf("REG_EMC_DMAR0: 0x%x", REG_EMC_DMAR0 >> EMC_DMAR_BASE_BIT); | 149 | printf("REG_EMC_DMAR0: 0x%x", REG_EMC_DMAR0 >> EMC_DMAR_BASE_BIT); |
150 | unsigned int cpu_id = read_c0_prid(); | 150 | unsigned int cpu_id = read_c0_prid(); |
151 | printf("CPU_ID: (0x%x)", cpu_id); | 151 | printf("CPU_ID: 0x%x", cpu_id); |
152 | printf(" * Company ID: 0x%x", (cpu_id >> 16) & 7); | 152 | printf(" * Company ID: 0x%x", (cpu_id >> 16) & 7); |
153 | printf(" * Processor ID: 0x%x", (cpu_id >> 8) & 7); | 153 | printf(" * Processor ID: 0x%x", (cpu_id >> 8) & 7); |
154 | printf(" * Revision ID: 0x%x", cpu_id & 7); | 154 | printf(" * Revision ID: 0x%x", cpu_id & 7); |
155 | unsigned int config_data = read_c0_config(); | ||
156 | printf("C0_CONFIG: 0x%x", config_data); | ||
157 | printf(" * Architecture type: 0x%x", (config_data >> 13) & 3); | ||
158 | printf(" * Architecture revision: 0x%x", (config_data >> 10) & 7); | ||
159 | printf(" * MMU type: 0x%x", (config_data >> 7) & 7); | ||
160 | printf("C0_CONFIG1: 0x%x", read_c0_config1()); | ||
161 | if(read_c0_config1() & (1 << 0)) printf(" * FP available"); | ||
162 | if(read_c0_config1() & (1 << 1)) printf(" * EJTAG available"); | ||
163 | if(read_c0_config1() & (1 << 2)) printf(" * MIPS-16 available"); | ||
164 | if(read_c0_config1() & (1 << 4)) printf(" * Performace counters available"); | ||
165 | if(read_c0_config1() & (1 << 5)) printf(" * MDMX available"); | ||
166 | if(read_c0_config1() & (1 << 6)) printf(" * CP2 available"); | ||
167 | printf("C0_STATUS: 0x%x", read_c0_status()); | ||
155 | while(1) | 168 | while(1) |
156 | { | 169 | { |
157 | btn = button_read_device(&touch); | 170 | btn = button_read_device(&touch); |
158 | if(btn & BUTTON_VOL_DOWN) | 171 | #define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \ |
159 | printf("BUTTON_VOL_DOWN"); | 172 | if(btn & x) \ |
160 | if(btn & BUTTON_MENU) | 173 | lcd_set_foreground(LCD_WHITE); \ |
161 | printf("BUTTON_MENU"); | 174 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(#x), LCD_HEIGHT-SYSFONT_HEIGHT*y, #x); |
162 | if(btn & BUTTON_VOL_UP) | 175 | KNOP(BUTTON_VOL_UP, 5); |
163 | printf("BUTTON_VOL_UP"); | 176 | KNOP(BUTTON_VOL_DOWN, 6); |
164 | if(btn & BUTTON_POWER) | 177 | KNOP(BUTTON_MENU, 7); |
165 | printf("BUTTON_POWER"); | 178 | KNOP(BUTTON_POWER, 8); |
179 | lcd_set_foreground(LCD_WHITE); | ||
166 | if(button_hold()) | 180 | if(button_hold()) |
167 | { | 181 | { |
168 | printf("BUTTON_HOLD"); | 182 | printf("BUTTON_HOLD"); |
169 | asm("break 7"); | 183 | asm("break 7"); |
170 | } | 184 | } |
171 | if(touch != 0) | 185 | if(btn & BUTTON_TOUCH) |
172 | { | 186 | { |
173 | lcd_set_foreground(LCD_RGBPACK(touch & 0xFF, (touch >> 8)&0xFF, (touch >> 16)&0xFF)); | 187 | lcd_set_foreground(LCD_RGBPACK(touch & 0xFF, (touch >> 8)&0xFF, (touch >> 16)&0xFF)); |
174 | lcd_fillrect((touch>>16)-5, (touch&0xFFFF)-5, 10, 10); | 188 | lcd_fillrect((touch>>16)-5, (touch&0xFFFF)-5, 10, 10); |
@@ -180,6 +194,10 @@ int main(void) | |||
180 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(datetime), LCD_HEIGHT-SYSFONT_HEIGHT, datetime); | 194 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(datetime), LCD_HEIGHT-SYSFONT_HEIGHT, datetime); |
181 | snprintf(datetime, 30, "%d", REG_TCU_TCNT0); | 195 | snprintf(datetime, 30, "%d", REG_TCU_TCNT0); |
182 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(datetime), LCD_HEIGHT-SYSFONT_HEIGHT*2, datetime); | 196 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(datetime), LCD_HEIGHT-SYSFONT_HEIGHT*2, datetime); |
197 | snprintf(datetime, 30, "X: %d Y: %d", touch>>16, touch & 0xFFFF); | ||
198 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(datetime), LCD_HEIGHT-SYSFONT_HEIGHT*3, datetime); | ||
199 | snprintf(datetime, 30, "%d", read_c0_count()); | ||
200 | lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*strlen(datetime), LCD_HEIGHT-SYSFONT_HEIGHT*4, datetime); | ||
183 | lcd_update(); | 201 | lcd_update(); |
184 | } | 202 | } |
185 | 203 | ||