merged trunk changes
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "sysinit.h"
|
||||
#include "bas_printf.h"
|
||||
#include "bas_types.h"
|
||||
#include <wait.h>
|
||||
|
||||
extern void xprintf_before_copy(const char *fmt, ...);
|
||||
#define xprintf xprintf_before_copy
|
||||
@@ -44,32 +45,7 @@ extern volatile long _VRAM; /* start address of video ram from linker script */
|
||||
static const int MAJOR_VERSION = 0;
|
||||
static const int MINOR_VERSION = 1;
|
||||
|
||||
/*
|
||||
* wait for the specified number of us on slice timer 0. Replaces the original routines that had
|
||||
* the number of useconds to wait for hardcoded in their name.
|
||||
*/
|
||||
inline void wait(uint32_t us)
|
||||
{
|
||||
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
|
||||
|
||||
while (MCF_SLT_SCNT(0) > target);
|
||||
}
|
||||
|
||||
/*
|
||||
* the same as above, with a checker function which gets called while
|
||||
* busy waiting and allows for an early return if it returns true
|
||||
*/
|
||||
inline bool waitfor(uint32_t us, int (*condition)(void))
|
||||
{
|
||||
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
|
||||
|
||||
do
|
||||
{
|
||||
if ((*condition)())
|
||||
return TRUE;
|
||||
} while (MCF_SLT_SCNT(0) > target);
|
||||
return FALSE;
|
||||
}
|
||||
/*
|
||||
* init SLICE TIMER 0
|
||||
* all = 32.538 sec = 30.736mHz
|
||||
@@ -803,22 +779,11 @@ void initialize_hardware(void) {
|
||||
init_slt();
|
||||
|
||||
xprintf("\r\nBaS_gcc for FireBee v %d.%d\r\n", MAJOR_VERSION, MINOR_VERSION);
|
||||
xprintf("initializing hardware...\r\n");
|
||||
|
||||
init_fbcs();
|
||||
init_ddram();
|
||||
init_fpga();
|
||||
|
||||
/* FireTOS seems to have trouble to initialize the ST-RAM by itself, so... */
|
||||
/* Validate ST RAM */
|
||||
* (volatile uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */
|
||||
* (volatile uint32_t *) 0x420 = 0x752019f3; /* memvalid TOS system variable */
|
||||
* (volatile uint32_t *) 0x43a = 0x237698aa; /* memval2 TOS system variable */
|
||||
* (volatile uint32_t *) 0x51a = 0x5555aaaa; /* memval3 TOS system variable */
|
||||
|
||||
/* Jump into FireTOS */
|
||||
typedef void void_func(void);
|
||||
void_func* FireTOS = (void_func*)FIRETOS;
|
||||
void_func* FireTOS = (void_func*) FIRETOS;
|
||||
FireTOS(); // Should never return
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user