kernel: fix gint[HWURAM] not being set on fx-9860G

When switching to dynamic TLB the counting of mapped memory was no
longer required at boot time. This was restored weirdly for fx-CG 50 and
not at all for fx-9860G; this is now fixed.
This commit is contained in:
Lephe 2021-01-31 15:11:13 +01:00
parent dce5ade4e1
commit 293532024d
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
3 changed files with 9 additions and 4 deletions

3
TODO
View File

@ -1,4 +1,5 @@
Extensions on existing code:
* stdio: support %f in printf
* project: add license file
* kernel: group linker script symbols in a single header file
* kernel: be consistent about *tlb_mapped_memory() in hw_detect()
@ -20,3 +21,5 @@ Future directions.
* USB communication, using Yatis' reverse-engineering of the module
* Make fx9860g projects work out of the box on fxcg50
* Use the DSP to enhance parallel computation
* Dynamic memory allocation
* Base for Yatis' threads library

View File

@ -98,10 +98,12 @@ void hw_detect(void)
*R4 = b4;
gint[HWRAM] = ext ? (512 << 10) : (256 << 10);
/* Will be detected later on */
gint[HWURAM] = -1;
/* Traditionally 4 MiB, Graph 35+E II has 8 MiB */
gint[HWROM] = (gint[HWCALC] == HWCALC_G35PE2) ? (8 << 20) : (4 << 20);
/* Mapped memory */
if(isSH3()) tlb_mapped_memory(NULL, NULL);
else utlb_mapped_memory(NULL, NULL);
}
#endif /* FX9860G and platform-agnostic */
@ -130,8 +132,7 @@ void hw_detect(void)
gint[HWROM] = (32 << 20);
/* Mapped memory */
if(isSH3()) tlb_mapped_memory(NULL, NULL);
else utlb_mapped_memory(NULL, NULL);
utlb_mapped_memory(NULL, NULL);
}
#endif /* FXCG50 */

View File

@ -32,6 +32,7 @@ __attribute__((constructor))
static void init_vram(void)
{
/* On Prizm and fx-CG Manager, move address to 0xa8000000 */
/* TODO: Detect base RAM address in BSC rather than hardcoding it */
if(gint[HWCALC] == HWCALC_PRIZM || gint[HWCALC] == HWCALC_FXCG_MANAGER)
{
main = (void *)main - 0x04000000;