2018-04-19 13:24:26 +02:00
|
|
|
//---
|
|
|
|
// gint:core:bootlog - Boot-time on-screen log for extreme debugging
|
|
|
|
//---
|
|
|
|
|
2019-02-21 20:58:38 +01:00
|
|
|
/* TODO: Review, enhance and fix bootlog */
|
|
|
|
|
|
|
|
#include <gint/defs/types.h>
|
|
|
|
#include <gint/mpu.h>
|
|
|
|
#include <gint/mpu/intc.h>
|
2018-04-19 13:24:26 +02:00
|
|
|
#include <core/mmu.h>
|
|
|
|
#include <gint/gint.h>
|
2019-02-22 15:08:51 +01:00
|
|
|
#include <gint/display.h>
|
|
|
|
|
|
|
|
#ifdef FXCG50
|
|
|
|
#define dclear(c) Bdisp_AllClr_VRAM()
|
|
|
|
#define dupdate() Bdisp_PutDisp_DD()
|
|
|
|
#endif
|
2018-04-19 13:24:26 +02:00
|
|
|
|
|
|
|
/* Linker script symbols - see core/start.c for details */
|
|
|
|
extern char
|
|
|
|
brom, srom,
|
|
|
|
sgdata, sgbss, sdata, sbss,
|
|
|
|
btors, mtors, etors;
|
|
|
|
|
2018-08-01 20:41:36 +02:00
|
|
|
/* bootlog_loaded() - section loading stage */
|
2018-04-19 13:24:26 +02:00
|
|
|
void bootlog_loaded(void)
|
|
|
|
{
|
|
|
|
/* Version string - the string constant resides in ROM */
|
2019-02-22 15:08:51 +01:00
|
|
|
const char *base = "gint @";
|
|
|
|
const char *hexa = "0123456789abcdef";
|
2018-04-19 13:24:26 +02:00
|
|
|
char str[14];
|
|
|
|
|
2019-02-22 15:08:51 +01:00
|
|
|
for(int i = 0; i < 6; i++) str[i] = base[i];
|
|
|
|
str[13] = 0;
|
2018-04-19 13:24:26 +02:00
|
|
|
|
2019-02-22 15:08:51 +01:00
|
|
|
/* Retrieve the commit number */
|
|
|
|
for(int i = 0; i < 7; i++)
|
|
|
|
{
|
|
|
|
int shift = 24 - (i << 2);
|
|
|
|
str[i + 6] = hexa[(GINT_VERSION >> shift) & 0xf];
|
|
|
|
}
|
2018-04-19 13:24:26 +02:00
|
|
|
|
|
|
|
/* Size of memory sections */
|
|
|
|
uint32_t rom_size = (uint32_t)&srom;
|
|
|
|
uint32_t ram_size = (uint32_t)&sdata + (uint32_t)&sbss;
|
|
|
|
uint32_t gint_size = (uint32_t)&sgdata + (uint32_t)&sgbss;
|
|
|
|
|
|
|
|
/* MPU type */
|
2019-02-21 20:58:38 +01:00
|
|
|
mpu_t mpu = gint_mpu();
|
2018-04-19 13:24:26 +02:00
|
|
|
const char *names = "SH7337\0 SH7305\0 SH7355\0 SH7724";
|
|
|
|
|
|
|
|
/* TODO: Use a solid API for boot-time printing */
|
2019-02-22 15:08:51 +01:00
|
|
|
dclear(color_white);
|
2018-04-19 13:24:26 +02:00
|
|
|
print(1, 1, str);
|
|
|
|
print(15, 1, " Loaded");
|
|
|
|
|
|
|
|
if((uint)mpu < 4) print(16, 2, names + 8 * (mpu - 1));
|
|
|
|
else print_dec(16, 2, mpu, 6);
|
|
|
|
|
|
|
|
print(1, 2, "ROM RAM GINT");
|
|
|
|
print(4, 3, "k c d");
|
|
|
|
print_dec(1, 3, (rom_size + 0x3ff) >> 10, 3);
|
|
|
|
print_dec(6, 3, ram_size, 4);
|
|
|
|
print_dec(11, 3, gint_size, 4);
|
|
|
|
print_dec(17, 3, &mtors - &btors, 2);
|
|
|
|
print_dec(20, 3, &etors - &mtors, 2);
|
2018-08-01 20:41:36 +02:00
|
|
|
|
2019-02-22 15:08:51 +01:00
|
|
|
dupdate();
|
2018-04-19 13:24:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* bootlog_mapped() - ROM mapping stage */
|
|
|
|
void bootlog_mapped(int rom, int ram)
|
|
|
|
{
|
|
|
|
rom = (rom + 0x3ff) >> 10;
|
|
|
|
ram = (ram + 0x3ff) >> 10;
|
|
|
|
|
|
|
|
print(15, 1, " Mapped");
|
|
|
|
print(1, 4, "MMU ROM: k RAM: k");
|
|
|
|
(rom < 0) ? print(9, 4, "???") : print_dec(9, 4, rom, 3);
|
|
|
|
(ram < 0) ? print(18, 4, "???") : print_dec(18, 4, ram, 3);
|
2018-08-01 20:41:36 +02:00
|
|
|
|
2019-02-22 15:08:51 +01:00
|
|
|
dupdate();
|
2018-04-19 13:24:26 +02:00
|
|
|
}
|
|
|
|
|
2018-08-01 20:41:36 +02:00
|
|
|
/* bootlog_kernel() - gint loading stage */
|
2018-04-19 13:24:26 +02:00
|
|
|
void bootlog_kernel(void)
|
|
|
|
{
|
2018-08-01 20:41:36 +02:00
|
|
|
print(15, 1, " Kernel");
|
2018-04-19 13:24:26 +02:00
|
|
|
|
2018-08-19 17:11:37 +02:00
|
|
|
if(isSH3())
|
|
|
|
{
|
2018-04-19 13:24:26 +02:00
|
|
|
print(1, 5, "ABCD");
|
2019-02-21 20:58:38 +01:00
|
|
|
print_hex( 6, 5, SH7705_INTC._.IPRA->word, 4);
|
|
|
|
print_hex(10, 5, SH7705_INTC._.IPRB->word, 4);
|
|
|
|
print_hex(14, 5, SH7705_INTC._.IPRC->word, 4);
|
|
|
|
print_hex(18, 5, SH7705_INTC._.IPRD->word, 4);
|
2018-04-19 13:24:26 +02:00
|
|
|
print(1, 6, "EFGH");
|
2019-02-21 20:58:38 +01:00
|
|
|
print_hex( 6, 6, SH7705_INTC._.IPRE->word, 4);
|
|
|
|
print_hex(10, 6, SH7705_INTC._.IPRF->word, 4);
|
|
|
|
print_hex(14, 6, SH7705_INTC._.IPRG->word, 4);
|
|
|
|
print_hex(18, 6, SH7705_INTC._.IPRH->word, 4);
|
2018-08-19 17:11:37 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-04-19 13:24:26 +02:00
|
|
|
print(1, 5, "ACFG");
|
2019-02-21 20:58:38 +01:00
|
|
|
print_hex( 6, 5, SH7305_INTC._->IPRA.word, 4);
|
|
|
|
print_hex(10, 5, SH7305_INTC._->IPRC.word, 4);
|
|
|
|
print_hex(14, 5, SH7305_INTC._->IPRF.word, 4);
|
|
|
|
print_hex(18, 5, SH7305_INTC._->IPRG.word, 4);
|
2018-04-19 13:24:26 +02:00
|
|
|
print(1, 6, "HJKL");
|
2019-02-21 20:58:38 +01:00
|
|
|
print_hex( 6, 6, SH7305_INTC._->IPRH.word, 4);
|
|
|
|
print_hex(10, 6, SH7305_INTC._->IPRJ.word, 4);
|
|
|
|
print_hex(14, 6, SH7305_INTC._->IPRK.word, 4);
|
|
|
|
print_hex(18, 6, SH7305_INTC._->IPRL.word, 4);
|
2018-08-19 17:11:37 +02:00
|
|
|
}
|
2018-04-19 13:24:26 +02:00
|
|
|
|
2019-02-22 15:08:51 +01:00
|
|
|
dupdate();
|
2018-04-19 13:24:26 +02:00
|
|
|
}
|