/* procesor H8S/2638 ver 1.1 */
-#include <types.h>
+#include <stdint.h>
#include <cpu_def.h>
#include <h8s2638h.h>
#include <system_def.h>
DEB_LED_OFF(3);
}
+/* Provided by linker script */
+extern char __boot_fn_load;
+extern char __boot_fn_start;
+extern char __boot_fn_end;
+
+static void relocate_boot_fn()
+{
+ size_t reloc_size=&__boot_fn_end-&__boot_fn_start;
+
+ if(&__boot_fn_load != &__boot_fn_start) {
+ memcpy(&__boot_fn_start,&__boot_fn_load,reloc_size);
+ }
+}
+
void _setup_board()
{
//int i, j;// POE-100
DEB_LED_INIT();
+ relocate_boot_fn();
+
/* show something on debug leds */
deb_led_out(0);
FlWait(1*100000);