fixed a typo in linker script
avoid copy of BaS if linked to RAM
This commit is contained in:
@@ -115,7 +115,7 @@ $(FLASH_EXEC): TARGET_ADDRESS=0xe0000000
|
|||||||
$(FLASH_EXEC): LDCFILE=bas.lk
|
$(FLASH_EXEC): LDCFILE=bas.lk
|
||||||
$(FLASH_EXEC): MAPFILE=bas.map
|
$(FLASH_EXEC): MAPFILE=bas.map
|
||||||
|
|
||||||
$(RAM_EXEC): TARGET_ADDRESS=0x1e000000
|
$(RAM_EXEC): TARGET_ADDRESS=0x1f000000
|
||||||
$(RAM_EXEC): LDCFILE=ram.lk
|
$(RAM_EXEC): LDCFILE=ram.lk
|
||||||
$(RAM_EXEC): MAPFILE=ram.map
|
$(RAM_EXEC): MAPFILE=ram.map
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000
|
bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000
|
||||||
bas_ram (WX) : ORIGIN = 0x1FE00000, LENGTH = 0x00100000 /* target to copy BaS to */
|
/*
|
||||||
|
* target to copy BaS data segment to. 16k should be enough for now
|
||||||
|
*/
|
||||||
|
bas_ram (WX) : ORIGIN = 0x1FFC000, LENGTH = 0x004000
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
@@ -37,23 +40,13 @@ SECTIONS
|
|||||||
mcdapi/MCD_tasks.o(.text)
|
mcdapi/MCD_tasks.o(.text)
|
||||||
mcdapi/MCD_tasksInit.o(.text)
|
mcdapi/MCD_tasksInit.o(.text)
|
||||||
objs/xhdi_sd.o(.text)
|
objs/xhdi_sd.o(.text)
|
||||||
objs/xhdi_interface.o(text)
|
objs/xhdi_interface.o(.text)
|
||||||
objs/xhdi_vec.o(text)
|
objs/xhdi_vec.o(.text)
|
||||||
#if (FORMAT == elf32-m68k)
|
|
||||||
*(.rodata)
|
/*
|
||||||
*(.rodata.*)
|
* if we compile to RAM anyway, there is no need to copy anything
|
||||||
#endif
|
|
||||||
} > bas_rom
|
|
||||||
|
|
||||||
/* BaS in RAM */
|
|
||||||
.bas :
|
|
||||||
/* The BaS is stored in the flash, just after the init part.
|
|
||||||
* Then it will be copied to its final location in the RAM.
|
|
||||||
* This data must be aligned for optimal copy loop speed.
|
|
||||||
*/
|
*/
|
||||||
AT (ALIGN(ADDR(.text) + SIZEOF(.text), 4))
|
#if (TARGET_ADDRESS < 0x1FFFFFFF && TARGET_ADDRESS > 0)
|
||||||
{
|
|
||||||
. = ALIGN(16);
|
|
||||||
. = ALIGN(16);
|
. = ALIGN(16);
|
||||||
__BAS_DATA_START = .;
|
__BAS_DATA_START = .;
|
||||||
*(.data)
|
*(.data)
|
||||||
@@ -64,7 +57,36 @@ SECTIONS
|
|||||||
* is a multiple of the following value.
|
* is a multiple of the following value.
|
||||||
*/
|
*/
|
||||||
. = ALIGN(16);
|
. = ALIGN(16);
|
||||||
} > bas_ram
|
#endif /* TARGET_ADDRESS */
|
||||||
|
#if (FORMAT == elf32-m68k)
|
||||||
|
*(.rodata)
|
||||||
|
*(.rodata.*)
|
||||||
|
#endif
|
||||||
|
} > bas_rom
|
||||||
|
|
||||||
|
#if (TARGET_ADDRESS == 0xe0000000)
|
||||||
|
/* BaS in RAM */
|
||||||
|
.bas :
|
||||||
|
/*
|
||||||
|
* The BaS is stored in the flash, just after the init part.
|
||||||
|
* Then it will be copied to its final location in the RAM.
|
||||||
|
* This data must be aligned for optimal copy loop speed.
|
||||||
|
*/
|
||||||
|
AT (ALIGN(ADDR(.text) + SIZEOF(.text), 4))
|
||||||
|
{
|
||||||
|
. = ALIGN(16);
|
||||||
|
. = ALIGN(16);
|
||||||
|
__BAS_DATA_START = .;
|
||||||
|
*(.data)
|
||||||
|
__BAS_DATA_END = .;
|
||||||
|
*(.bss)
|
||||||
|
|
||||||
|
/* The BaS copy routine assumes that tha BaS size
|
||||||
|
* is a multiple of the following value.
|
||||||
|
*/
|
||||||
|
. = ALIGN(16);
|
||||||
|
} > bas_ram
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global memory map
|
* Global memory map
|
||||||
@@ -84,16 +106,29 @@ SECTIONS
|
|||||||
|
|
||||||
/* FastRAM */
|
/* FastRAM */
|
||||||
__FASTRAM = 0x10000000;
|
__FASTRAM = 0x10000000;
|
||||||
|
__TARGET_ADDRESS = TARGET_ADDRESS;
|
||||||
|
|
||||||
|
#if TARGET_ADDRESS == 0xe0000000
|
||||||
__FASTRAM_END = __BAS_IN_RAM;
|
__FASTRAM_END = __BAS_IN_RAM;
|
||||||
|
#else
|
||||||
|
__FASTRAM_END = TARGET_ADDRESS;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes) */
|
/* Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes) */
|
||||||
___BOOT_FLASH = 0xe0000000;
|
___BOOT_FLASH = 0xe0000000;
|
||||||
___BOOT_FLASH_SIZE = 0x00800000;
|
___BOOT_FLASH_SIZE = 0x00800000;
|
||||||
|
|
||||||
|
#if TARGET_ADDRESS == 0xe0000000
|
||||||
/* BaS */
|
/* BaS */
|
||||||
__BAS_LMA = LOADADDR(.bas);
|
__BAS_LMA = LOADADDR(.bas);
|
||||||
__BAS_IN_RAM = ADDR(.bas);
|
__BAS_IN_RAM = ADDR(.bas);
|
||||||
__BAS_SIZE = SIZEOF(.bas);
|
__BAS_SIZE = SIZEOF(.bas);
|
||||||
|
#else
|
||||||
|
/* BaS is already in RAM - no need to copy anything */
|
||||||
|
__BAS_IN_RAM = __FASTRAM_END;
|
||||||
|
__BAS_SIZE = 0;
|
||||||
|
__BAS_LMA = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Other flash components */
|
/* Other flash components */
|
||||||
__FIRETOS = 0xe0400000;
|
__FIRETOS = 0xe0400000;
|
||||||
|
|||||||
@@ -78,13 +78,18 @@
|
|||||||
.global _mmu_init
|
.global _mmu_init
|
||||||
.global _mmutr_miss
|
.global _mmutr_miss
|
||||||
|
|
||||||
|
//
|
||||||
|
// to avoid chicken and egg situations, we need to make sure that MMU TLB miss exceptions do not end up in a memory
|
||||||
|
// area that in turn cause a TLB miss exception themself after the MMU is enabled. At least the exception handler must live
|
||||||
|
// in an area that's either covered by one of the ACR's or a locked MMU TLB entry.
|
||||||
|
//
|
||||||
.text
|
.text
|
||||||
_mmu_init:
|
_mmu_init:
|
||||||
move.l d3,-(sp) // Backup registers
|
move.l d3,-(sp) // Backup registers
|
||||||
move.l d2,-(sp)
|
move.l d2,-(sp)
|
||||||
|
|
||||||
clr.l d0
|
clr.l d0
|
||||||
movec d0,ASID // ASID allways 0
|
movec d0,ASID // ASID always 0
|
||||||
move.l d0,_rt_asid // save shadow register
|
move.l d0,_rt_asid // save shadow register
|
||||||
|
|
||||||
move.l #0xC03FC040,d0 // data r/w precise c000'0000-ffff'ffff
|
move.l #0xC03FC040,d0 // data r/w precise c000'0000-ffff'ffff
|
||||||
|
|||||||
@@ -961,14 +961,22 @@ void initialize_hardware(void) {
|
|||||||
//video_1280_1024();
|
//video_1280_1024();
|
||||||
init_ac97();
|
init_ac97();
|
||||||
|
|
||||||
xprintf("copying BaS (%p - %p) to RAM (%p - %p)\r\n", BAS_LMA, BAS_LMA + BAS_SIZE, BAS_IN_RAM, BAS_IN_RAM + BAS_SIZE);
|
if (BAS_LMA != BAS_IN_RAM)
|
||||||
memcpy((void *) BAS_IN_RAM, BAS_LMA, BAS_SIZE);
|
{
|
||||||
xprintf("finished.\r\n");
|
xprintf("copying BaS (%p - %p) to RAM (%p - %p)\r\n", BAS_LMA, BAS_LMA + BAS_SIZE, BAS_IN_RAM, BAS_IN_RAM + BAS_SIZE);
|
||||||
|
memcpy((void *) BAS_IN_RAM, BAS_LMA, BAS_SIZE);
|
||||||
|
xprintf("finished.\r\n");
|
||||||
|
|
||||||
/* we have copied a code area, so flush the caches */
|
/* we have copied a code area, so flush the caches */
|
||||||
flush_and_invalidate_caches();
|
flush_and_invalidate_caches();
|
||||||
|
|
||||||
/* jump into the BaS in RAM */
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xprintf("no BaS copy necessary - running from RAM already\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* jump into the BaS */
|
||||||
extern void BaS(void);
|
extern void BaS(void);
|
||||||
BaS();
|
BaS();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user