7 #ifdef CONFIG_BOOTTOOLS_HIMEMLOADER_EMULATE_CHIP_RESET
8 #include <linux/config.h>
10 #include <asm/MC68EZ328.h>
12 #ifdef CONFIG_M68VZ328
13 #include <asm/MC68VZ328.h>
18 #define HIMEM_LOCATION 0x00600000
20 char spinner[] = { 8, '|' , 8, '\\' , 8, '-', 8, '/'};
23 __asm__ __volatile__ ("oriw #0x2700,%sp@; rte;");
26 int main(int argc,char* argv[]) {
30 unsigned char *himem, buf[BUFSIZE];
33 printf("usage: himemloader <image.bin>\n");
39 fd=open(file,O_RDONLY);
41 printf("error opening file [%s]\n",file);
45 printf("Loading file [%s]\n", file);
47 himem=(char*)HIMEM_LOCATION;
49 while((cnt=read(fd,buf,BUFSIZE))) {
50 write(1, &spinner[(b++ & 3) << 1], 2);
58 // switch to supervisor mode
59 *((int*)0x000000a8)=(int)trap;
60 __asm__ __volatile__ ("trap #10");
62 #if CONFIG_BOOTTOOLS_HIMEMLOADER_EMULATE_CHIP_RESET
147 RTCTIME = 0x00000000;
148 RTCALRM = 0x00000000;
155 // DRAMMC = 0x00000000;
156 // DRAMC = 0x00000000;
157 ICEMACR = 0x00000000;
158 ICEMAMR = 0x00000000;
165 // start loaded kernel
166 __asm__ __volatile__ ("movel #0x00600004,%a0; jmp (%a0);");