Update of /cvsroot/gc-linux/ipl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5953 Modified Files: Makefile main.c Removed Files: cache.S console.c console_font.c console_font_8x8.c crt0.s ctype.c dol.c dvd.c elf.c exception.S exceptionc.c exi.c flash.c ipl.c ipl_tmb.h irq.c loadapp.c lowmem.h network.c pad.c string.c string_asm.S time.c video.c vsprintf.c Log Message: Sorted all source files int / into the following directories: io, lowlevel, loadand ipl Did some cleaning in the source files, but there is still much to be done Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/ipl/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 30 Dec 2004 10:21:15 -0000 1.2 +++ Makefile 9 Jan 2005 11:40:45 -0000 1.3 @@ -42,33 +42,49 @@ #-Werror # Files -IPL_OBJS = main.o string_asm.o string.o ctype.o video.o console.o exi.o \ - cache.o vsprintf.o pad.o irq.o console_font.o elf.o dvd.o dol.o \ - network.o loadapp.o exception.o exceptionc.o \ - time.o ipl.o flash.o dolup/dolup.o +MAIN_OBJS = \ + main.o -DISK_OBJS = disk/sd.o disk/fat.o disk/file.o +IO_OBJS = \ + io/video.o io/console.o io/console_font.o io/vsprintf.o \ + io/exi.o io/dvd.o io/network.o io/sram.o + +IPL_OBJS = \ + ipl/ipl.o ipl/flash.o + +LOWLEVEL_OBJS = \ + lowlevel/cache.o lowlevel/exception.o lowlevel/exceptionc.o \ + lowlevel/irq.o lowlevel/string_asm.o lowlevel/string.o \ + lowlevel/ctype.o lowlevel/time.o + +LOAD_OBJS = \ + load/elf.o load/dol.o load/dolup.o load/loadapp.o + +DISK_OBJS = \ + disk/sd.o disk/fat.o disk/file.o io/pad.o LWIP_OBJS = \ - lwip/core/tcp_in.o \ - lwip/core/inet.o lwip/core/mem.o lwip/core/memp.o \ - lwip/core/netif.o lwip/core/pbuf.o lwip/core/raw.o lwip/core/stats.o \ - lwip/core/sys.o lwip/core/tcp.o lwip/core/ipv4/ip_addr.o \ - lwip/core/ipv4/icmp.o lwip/core/ipv4/ip.o lwip/core/ipv4/ip_frag.o \ - lwip/core/tcp_out.o lwip/core/udp.o lwip/netif/etharp.o \ + lwip/core/tcp_in.o \ + lwip/core/inet.o lwip/core/mem.o lwip/core/memp.o \ + lwip/core/netif.o lwip/core/pbuf.o lwip/core/raw.o lwip/core/stats.o \ + lwip/core/sys.o lwip/core/tcp.o lwip/core/ipv4/ip_addr.o \ + lwip/core/ipv4/icmp.o lwip/core/ipv4/ip.o lwip/core/ipv4/ip_frag.o \ + lwip/core/tcp_out.o lwip/core/udp.o lwip/netif/etharp.o \ ./lwip/arch/gc/lib.o ./lwip/arch/gc/netif/gcif.o \ ./lwip/arch/gc/lib_arch.o \ #lwip/core/dhcp.o -HTTPD_OBJS = httpd/vfs.o httpd/httpd.o httpd/flash_put.o +HTTPD_OBJS = \ + httpd/vfs.o httpd/httpd.o httpd/flash_put.o LIBRARIES = # gdbstub/libgdbstub.a # ./lwip/core/dhcp.o -OBJS = crt0.o $(IPL_OBJS) $(LWIP_OBJS) $(HTTPD_OBJS) $(DISK_OBJS) $(LIBRARIES) +OBJS = lowlevel/crt0.o $(MAIN_OBJS) $(IPL_OBJS) $(IO_OBJS) $(LOWLEVEL_OBJS) \ + $(DISK_OBJS) $(LOAD_OBJS) $(LWIP_OBJS) $(HTTPD_OBJS) $(LIBRARIES) # Build rules all: main.dol main_boot.bin @@ -77,13 +93,15 @@ rm -rf $(OBJS) realclean: - find -name *.o | xargs -r rm - find -name *.a | xargs -r rm - find -name *~ | xargs -r rm - find -name *.bin | xargs -r rm - find -name *.dol | xargs -r rm - find -name *.elf | xargs -r rm - + find -name '*.o' | xargs -r rm + find -name '*.a' | xargs -r rm + find -name '*~' | xargs -r rm + find -name '*.bin' | xargs -r rm + find -name '*.dol' | xargs -r rm + find -name '*.elf' | xargs -r rm + find -name '*.map' | xargs -r rm + find -name '*.tmp' | xargs -r rm + .c.o: $(CC) $(CFLAGS) -c -o $@ $*.c @@ -107,8 +125,8 @@ $(OBJCOPY) -O binary $< $@ main.elf: $(OBJS) - $(CC) $(LDFLAGS) -Wl,-n -o $@ -Wl,-Ttext=0x80D00000 $(OBJS) -Wl,-Map -Wl,main.map -# $(CC) $(LDFLAGS) -Wl,-n -o $@ -Wl,-Ttext=0x80003100 $(OBJS) -Wl,-Map -Wl,main.map +# $(CC) $(LDFLAGS) -Wl,-n -o $@ -Wl,-Ttext=0x80D00000 $(OBJS) -Wl,-Map -Wl,main.map + $(CC) $(LDFLAGS) -Wl,-n -o $@ -Wl,-Ttext=0x80003100 $(OBJS) -Wl,-Map -Wl,main.map $(CC) $(LDFLAGS) -Wl,-n -o main_high.elf -Wl,-Ttext=0x817c0000 $(OBJS) -Wl,-Map -Wl,main_high.map main_boot.elf: $(OBJS) Index: main.c =================================================================== RCS file: /cvsroot/gc-linux/ipl/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- main.c 29 Dec 2004 11:49:28 -0000 1.2 +++ main.c 9 Jan 2005 11:40:46 -0000 1.3 @@ -8,7 +8,8 @@ #include "video.h" #include "color.h" #include "time.h" -#include "disk/sd.h" +#include "sram.h" +#include "sd.h" #include <linux/string.h> #include <network.h> #include <dvd.h> @@ -29,47 +30,6 @@ void load_app(my_dvd_read *dvd); extern void _start(), _end(); -void pad_init() -{ - *(volatile unsigned long*)0xCC006430 = 0x00000000; - *(volatile unsigned long*)0xCC006438 = 0x80000000; - *(volatile unsigned long*)0xCC006430 = 0x00f70200; - *(volatile unsigned long*)0xCC006438 = 0x80000000; - *(volatile unsigned long*)0xCC006480 = 0x00000000; - *(volatile unsigned long*)0xCC006434 = 0xc0010301; - *(volatile unsigned long*)0xCC006438 = 0x00000000; - - (void)*(volatile unsigned long*)0xCC006434; - - *(volatile unsigned long*)0xCC006430 |= 0xF0; // enable all four controller ports - - *(volatile unsigned long*)0xCC006400 = 0x00400300; - *(volatile unsigned long*)0xCC00640C = 0x00400300; - *(volatile unsigned long*)0xCC006418 = 0x00400300; - *(volatile unsigned long*)0xCC006424 = 0x00400300; - - udelay(1000); - - *(volatile unsigned long*)0xCC006430 = 0x00000000; - *(volatile unsigned long*)0xCC006438 = 0x80000000; - *(volatile unsigned long*)0xCC006430 = 0x00f70200; - *(volatile unsigned long*)0xCC006438 = 0x80000000; - *(volatile unsigned long*)0xCC006480 = 0x00000000; - *(volatile unsigned long*)0xCC006434 = 0xc0010301; - *(volatile unsigned long*)0xCC006438 = 0x00000000; - - (void)*(volatile unsigned long*)0xCC006434; - - *(volatile unsigned long*)0xCC006430 |= 0xF0; // enable all four controller ports - - *(volatile unsigned long*)0xCC006400 = 0x00400300; - *(volatile unsigned long*)0xCC00640C = 0x00400300; - *(volatile unsigned long*)0xCC006418 = 0x00400300; - *(volatile unsigned long*)0xCC006424 = 0x00400300; - *(volatile unsigned long*)0xCC006430 = 0x000701f0; - *(volatile unsigned long*)0xCC006438 = 0x80000000; - while (!((*(volatile unsigned long*) 0xCC006438)&0x20000000)); -} void lowmem_init() { @@ -117,61 +77,6 @@ static struct console_data_s console; -void sram_set_videomode(int v) -{ - sram_data[33] = v; -} - -int sram_get_videomode(void) -{ - return sram_data[33]; -} - -void sram_set_autoboot(int v) -{ - sram_data[34] = v; -} - -int sram_get_autoboot(void) -{ - return sram_data[34]; -} - -struct ip_addr *sram_get_ip(int w) -{ - return (struct ip_addr*)(sram_data + 0x24 + w * 4); -} - -void sram_load_defaults(void) -{ - sram_data[32] = '!'; - - sram_set_autoboot(0); - sram_set_videomode(1); - IP4_ADDR(sram_get_ip(0), 10,0,0,203); - IP4_ADDR(sram_get_ip(1), 255,255,255,0); - IP4_ADDR(sram_get_ip(2), 10,0,0,1); -} - -void read_sram(void) -{ - struct PAD pad; - PAD_ReadState(&pad, 0); - - if (!pad.Digital.Start) - exi_sram_read(sram_data); - else - memset(sram_data + 32, 0, 32); - - if (sram_data[32] != '!') - sram_load_defaults(); -} - -void write_sram(void) -{ - exi_sram_write(sram_data); -} - /* the menu stuff. */ struct menuentry_s; @@ -183,6 +88,7 @@ void menu_boot_game(struct menuentry_s *entry, int event, int data); void menu_boot_auto(struct menuentry_s *entry, int event, int data); void menu_boot_sd(struct menuentry_s *entry, int event, int data); +void menu_debug(struct menuentry_s *entry, int event, int data); #define EVENT_INIT 0 #define EVENT_REDRAW 1 @@ -216,9 +122,21 @@ {"Loader at 1MB", 0, menu_boot_ipl, 8}, {"Autoboot", 0, menu_boot_auto}, {"Boot from SD", 0, menu_boot_sd}, + {"Debug",0,menu_debug}, {0,0,0}, }; +void menu_debug(struct menuentry_s *entry, int event, int data) +{ + unsigned char buffer[256]; + if ((event == EVENT_BUTTON) && (data == BUTTON_A)) { + ipl_rob_read(buffer,0,256); + int i; + for (i=0;i<256;i++) printf("%02x ",buffer[i]); + for(;;); + } +} + void menu_boot_sd(struct menuentry_s *entry, int event, int data) { if ((event == EVENT_BUTTON) && (data == BUTTON_A)) { @@ -393,6 +311,8 @@ lowmem_init(); printf("pad "); pad_init(); + printf("exi "); + exi_init(); printf("sram "); read_sram(); printf("video "); @@ -430,7 +350,6 @@ // printf("--- display offset: %i\n", (s8)sram_data[0x10]); // printf("--- language: %i\n", sram_data[0x12]); - exi_init(); // setup network interface network_init(); @@ -453,6 +372,10 @@ "Y for original IPL\n" "Z for alternative BIOS (at 1MB)\n"); #endif +/* if (ipl_rob_test()) + printf(" Rob's IPL chip found\n"); + else + printf(" Rob's IPL chip not found\n");*/ printf( " - To upload a binary using BBA, just upload it to port 4000.\n" --- cache.S DELETED --- --- console.c DELETED --- --- console_font.c DELETED --- --- console_font_8x8.c DELETED --- --- crt0.s DELETED --- --- ctype.c DELETED --- --- dol.c DELETED --- --- dvd.c DELETED --- --- elf.c DELETED --- --- exception.S DELETED --- --- exceptionc.c DELETED --- --- exi.c DELETED --- --- flash.c DELETED --- --- ipl.c DELETED --- --- ipl_tmb.h DELETED --- --- irq.c DELETED --- --- loadapp.c DELETED --- --- lowmem.h DELETED --- --- network.c DELETED --- --- pad.c DELETED --- --- string.c DELETED --- --- string_asm.S DELETED --- --- time.c DELETED --- --- video.c DELETED --- --- vsprintf.c DELETED --- |