r1746 - in trunk

dslinux_amadeus at dslinux.in-berlin.de dslinux_amadeus at dslinux.in-berlin.de
Sat Apr 28 18:32:00 CEST 2007


Author: amadeus
Date: 2007-04-28 18:31:55 +0200 (Sat, 28 Apr 2007)
New Revision: 1746

Log:
Integration of RAM and DLDI build into DLDI

Modified: trunk/bulkbuild.sh
===================================================================
--- trunk/bulkbuild.sh	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/bulkbuild.sh	2007-04-28 16:31:55 UTC (rev 1746)
@@ -38,7 +38,7 @@
 
 OUTDIR=${OUTDIR:-"./bulkbuild"}
 
-for build in DSGBA DSMEM GBAMP GBAMP_EXT2 NDS RAM DLDI
+for build in DSGBA DSMEM GBAMP GBAMP_EXT2 NDS DLDI
 do
 	if [ "$build" = "GBAMP_EXT2" ]
 	then
@@ -74,9 +74,6 @@
 		NDS)
 			distfile=dslinux.nds
 		;;	
-		RAM)
-			distfile=dslinux-ram.tgz
-		;;	
 		DLDI)
 			distfile=dslinux-dldi.tgz
 		;;

Modified: trunk/linux-2.6.x/arch/arm/mach-nds/Makefile
===================================================================
--- trunk/linux-2.6.x/arch/arm/mach-nds/Makefile	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/linux-2.6.x/arch/arm/mach-nds/Makefile	2007-04-28 16:31:55 UTC (rev 1746)
@@ -10,6 +10,8 @@
 obj-$(CONFIG_NDS_SOUNDTEST) += soundtest.o
 obj-$(CONFIG_NDS_BLK_M3CF) += m3cf.o
 obj-$(CONFIG_NDS_BLK_SCCF) += sccf.o
+obj-$(CONFIG_NDS_ROM8BIT) += gbaram.o
+
 m3cf-y := m3cf_c.o m3cf_s.o
 sccf-y := sccf_c.o sccf_s.o
 

Modified: trunk/linux-2.6.x/arch/arm/mach-nds/arch.c
===================================================================
--- trunk/linux-2.6.x/arch/arm/mach-nds/arch.c	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/linux-2.6.x/arch/arm/mach-nds/arch.c	2007-04-28 16:31:55 UTC (rev 1746)
@@ -43,6 +43,7 @@
 
 #include <asm/arch/power.h>
 #include <asm/arch/fifo.h>
+#include <asm/arch/gbaram.h>
 
 #define WAIT_CR 	0x04000204
 
@@ -80,26 +81,13 @@
 	mi->bank[0].node  = 0;
 	mi->nr_banks = 1;
 #ifdef CONFIG_NDS_ROM8BIT
-#ifdef CONFIG_NDS_DLDI
-	{
-		/* test for opera RAM extension.
-		   If OK, continue to enabling the RAM.
-		   If not, simply return. */
-		volatile u16 *test = (volatile u16 *) 0x09000000;
-		u16 old = *test;
-		u16 new;
-		*test = 0xF00D;
-		new = *test;
-		*test = old;
-		if (new != 0xF00D)
-			return;
+	if (gba_activate_ram()) {
+		mi->bank[1].start = gba_start;
+		mi->bank[1].size  = gba_length;
+		mi->bank[1].node  = 0;
+		mi->nr_banks = 2;
 	}
 #endif
-	mi->bank[1].start = CONFIG_FLASH_MEM_BASE;
-	mi->bank[1].size  = CONFIG_FLASH_SIZE;
-	mi->bank[1].node  = 0;
-	mi->nr_banks = 2;
-#endif
 }
 
 MACHINE_START(NDS, "Nintendo DS")

Added: trunk/linux-2.6.x/arch/arm/mach-nds/gbaram.c

Modified: trunk/linux-2.6.x/arch/arm/mach-nds/head.S
===================================================================
--- trunk/linux-2.6.x/arch/arm/mach-nds/head.S	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/linux-2.6.x/arch/arm/mach-nds/head.S	2007-04-28 16:31:55 UTC (rev 1746)
@@ -211,14 +211,8 @@
 #if defined(CONFIG_MMC_M3SD) || defined(CONFIG_IDE_NDS_M3) || defined(CONFIG_NDS_BLK_M3CF)
 	m3_set_ram	@ switch to RAM mode
 #endif
-#ifdef CONFIG_NDS_DLDI
-	op_set_ram	@ switch to RAM mode
-	ez_set_ram	@ the EZ-V Expansion pack
 #endif
-	@ more activation for other cards here
 
-#endif
-
 	@-------------------------------------------------------------------------
 	@ Setup memory regions
 	@-------------------------------------------------------------------------
@@ -287,19 +281,9 @@
 	@ Disable data cache for GBA ROM, unless we have full 8bit write support.
 	@	      gGViWDMI
 	@ NOTE: this code must be synchronous with include/asm-arm/arch-nds/gbarom-macros.S
-#ifdef CONFIG_NDS_ROM8BIT
+	@ and with gbaram.c
+#if defined(CONFIG_NDS_ROM8BIT) && !defined(CONFIG_NDS_DLDI) 
 	ldr	r0,=0b10000010
-#ifdef CONFIG_NDS_DLDI
-	@ test if there is actually a RAM-based card in the GBA slot.
-	@ Only enable data cache if there is RAM, because we would totally disable
-	@ the DLDI drivers for non-ram-based slot2 devices.
-	ldr	r1,=0x09000000
-	ldr	r2,=0xF00D
-	strh	r2, [r1]
-	ldrh	r3, [r1]
-	cmp	r2, r3
-	ldrne	r0,=0b00000010
-#endif
 #else
 	ldr	r0,=0b00000010
 #endif

Modified: trunk/linux-2.6.x/drivers/block/dldi_c.c
===================================================================
--- trunk/linux-2.6.x/drivers/block/dldi_c.c	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/linux-2.6.x/drivers/block/dldi_c.c	2007-04-28 16:31:55 UTC (rev 1746)
@@ -53,6 +53,7 @@
 	long para2;
 	long para3;
 	void *function;
+	int result;
 };
 
 extern struct dldi_params _param_dldi;
@@ -345,7 +346,7 @@
 	dev->gd->fops = &dldi_ops;
 	dev->gd->queue = dev->queue;
 	dev->gd->private_data = dev;
-	snprintf (dev->gd->disk_name, 32, "hd%c", which + 'a');
+	snprintf (dev->gd->disk_name, 32, "dldi");
 	set_capacity(dev->gd, nsectors);
 	add_disk(dev->gd);
 	return;

Modified: trunk/linux-2.6.x/drivers/block/dldi_s.S
===================================================================
--- trunk/linux-2.6.x/drivers/block/dldi_s.S	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/linux-2.6.x/drivers/block/dldi_s.S	2007-04-28 16:31:55 UTC (rev 1746)
@@ -1,3 +1,7 @@
+
+/* common macros for all NDS GBA ROM device drivers */
+#include <asm/arch/gbarom-macro.S>
+
 @---------------------------------------------------------------------------------
 	.align	4
 	.arm
@@ -6,12 +10,14 @@
 	.global	_call_dldi
 	.global _buf_dldi
 
+	.global gba_set_io
+	.global gba_set_ram
+
 @---------------------------------------------------------------------------------
 .equ FEATURE_MEDIUM_CANREAD,		0x00000001
 .equ FEATURE_MEDIUM_CANWRITE,		0x00000002
 .equ FEATURE_SLOT_GBA,			0x00000010
 .equ FEATURE_SLOT_NDS,			0x00000020
-.equ NDS_IME,				0x04000208
 
 _dldi_start:
 
@@ -78,44 +84,39 @@
 
 	.align
 _param_dldi:
-	.space	6*4
+	.space	7*4
 
 	.align
 _call_dldi:
-	@ Disable interrupts (problems with stack switching without)
-	ldr	r3, =NDS_IME		@ interrupt mask register
-	mov	ip, #0			@ 0 = disable
-	strh	ip, [r3]
-	mcr	p15, 0, ip, c7, c10, 4	@ drain write buffer for IME to take effect.
-	@ Disable Write Buffer for all except main RAM
-	@	      gGViWDMI
-	ldr	r0,=0b00000010
-	mcr	p15, 0, r0, c3, c0, 0
 	ldr	ip,=_param_dldi		@ ip = IO parameter block
 	str	sp,[ip]			@ store old stack pointer
 	str	lr,[ip,#4]		@ store old link register
+	gba_prefix
+	ldr	sp,=_stack_dldi		@ set new stack (in main memory!)
+	ldr	ip,=gba_set_io		@ retrieve GBA IO switch function
+	ldr	r3,[ip]
+	blx	r3			@ execute the function
+	ldr	ip,=_param_dldi		@ ip = IO parameter block
 	ldr	r0,[ip,#8]		@ read parameter 1
 	ldr	r1,[ip,#12]		@ read parameter 2
 	ldr	r2,[ip,#16]		@ read parameter 3
 	ldr	r3,[ip,#20]		@ read pointer to function
-	ldr	sp,=_stack_dldi		@ set new stack
 	blx	r3			@ execute the function
 	ldr	ip,=_param_dldi		@ ip = IO parameter block
+	str	r0,[ip,#24]		@ store result
+	ldr	ip,=gba_set_ram		@ retrieve GBA RAM switch function
+	ldr	r3,[ip]
+	blx	r3			@ execute the function
+	ldr	ip,=_param_dldi		@ ip = IO parameter block
 	ldr	sp,[ip]			@ restore stack
 	ldr	lr,[ip,#4]		@ restore link register
-	@ Restore Write Buffer
-	@	      gGViWDMI
-	ldr	ip,=0b11111010
-	mcr	p15, 0, ip, c3, c0, 0
-	@ enable interrupts
-	ldr	r3, =NDS_IME		@ interrupt mask register
-	mov	ip, #1			@ 1 = enable
-	strh	ip, [r3]
+	ldr	r0,[ip,#24]		@ restore result
+	gba_suffix
 	bx	lr			@ return
 
 	.pool
 	.align
-	.space	4096			@ maybe better to have some more...
+	.space	1024			@ Allows for 1 physical sector and some more
 _stack_dldi:
 	.space	4			@ for safety
 _buf_dldi:

Added: trunk/linux-2.6.x/include/asm-arm/arch-nds/gbaram.h

Modified: trunk/vendors/Nintendo/DLDI/Makefile
===================================================================
--- trunk/vendors/Nintendo/DLDI/Makefile	2007-04-28 09:59:20 UTC (rev 1745)
+++ trunk/vendors/Nintendo/DLDI/Makefile	2007-04-28 16:31:55 UTC (rev 1746)
@@ -103,10 +103,6 @@
 	-mv $(ROMFSDIR)/$(FATFS)/linux/usr/bin/login $(ROMFSDIR)/bin
 	-mv $(ROMFSDIR)/$(FATFS)/linux/usr/bin/init $(ROMFSDIR)/bin
 	-mv $(ROMFSDIR)/$(FATFS)/linux/usr/bin/autologin $(ROMFSDIR)/bin
-	# move MADPLAY into internal RAM and make it XIP, to gain the processing power
-	# for undisturbed audio.
-	-mv $(ROMFSDIR)/$(FATFS)/linux/usr/bin/madplay $(ROMFSDIR)/bin
-	$(CROSS)flthdr -R $(ROMFSDIR)/bin/madplay
 	$(CROSS_COMPILE)flthdr -Z $(ROMFSDIR)/bin/*
 	-rm -r $(IMAGEDIR)/linux
 	mv $(ROMFSDIR)/$(FATFS)/linux $(IMAGEDIR)




More information about the dslinux-commit mailing list