Update of /cvsroot/blob/blob/src/blob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12321
Modified Files:
ra_alpha.c
Log Message:
Update ra alpha support.
Index: ra_alpha.c
===================================================================
RCS file: /cvsroot/blob/blob/src/blob/ra_alpha.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ra_alpha.c 10 Nov 2003 20:54:25 -0000 1.2
+++ ra_alpha.c 9 Feb 2004 16:32:01 -0000 1.3
@@ -29,6 +29,7 @@
#include <blob/arch.h>
#include <blob/errno.h>
#include <blob/error.h>
+#include <blob/debug.h>
#include <blob/util.h>
#include <blob/reboot.h>
#include <blob/serial.h>
@@ -39,6 +40,7 @@
#include <blob/led.h>
#include <blob/partition.h>
#include <blob/time.h>
+#include <net/ether.h>
static void rt_alpha_init_driver (void)
{
@@ -126,6 +128,8 @@
flash_driver = &intel32_flash_driver;
led_driver = &pxa_gpio_led_driver;
timer_driver = &intelarm_timer_driver;
+ ether_driver = &smc9196_ether_driver;
+ ether_driver->base = PXA_CS3_PHYS;
default_partition_table = partitions;
flash_partition_table = (blob_partition_t *) 0x00000000;
@@ -133,3 +137,122 @@
__initlist (rt_alpha_init_driver,INIT_LEVEL_DRIVER_SELECTION);
+static void ra_alpha_init_hardware(void)
+{
+ /* init on-board CPLD */
+ MEM(RA_CTRL0) = 0x00;
+ MEM(RA_CTRL1) = 0x00;
+
+ printf( "MDREFR_VALUE=0x%08x\n", MDREFR_VALUE );
+ printf( "MDCNFG_VALUE=0x%08x\n", MDCNFG_VALUE );
+ printf( "CCCR_VALUE=0x%08x\n", CCCR_VALUE );
+
+ printf( "MDREFR=0x%08x\n", MDREFR );
+ printf( "MDCNFG=0x%08x\n", MDCNFG );
+ printf( "CCCR=0x%08x\n", CCCR );
+
+ printf( "RA_CTRL0=0x%08x\n", MEM(RA_CTRL0));
+ printf( "RA_CTRL1=0x%08x\n", MEM(RA_CTRL1));
+
+ MEM(0x9708) = 0x00600060;
+ MEM(0x9708) = 0x00030003;
+ SXCNFG = 0x60f1;
+
+ /* tweak blob config */
+ blob_status.boot_delay = 1;
+}
+__initlist(ra_alpha_init_hardware, INIT_LEVEL_OTHER_HARDWARE);
+
+/**********************************************************************/
+void * my_memcpy(void * dest,const void *src,size_t count)
+{
+ u32 *tmp=dest, *s=src;
+
+ count>>=4;
+ while (count--) {
+ *tmp++ = *s++;
+ *tmp++ = *s++;
+ *tmp++ = *s++;
+ *tmp++ = *s++;
+ }
+
+ return dest;
+}
+
+int mtest_cmd(int argc, char *argv[])
+{
+ u32 start, end, tps;
+ unsigned long src=0x00300000;
+ unsigned long dst=0xa2000000;
+ size_t size=4272128;
+
+ int ret = EINVAL;
+
+ tps = timer_tps();
+
+ start = timer_read();
+ memcpy( dst, src, size );
+ end = timer_read();
+ printf( "memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000 );
+
+ start = timer_read();
+ my_memcpy( dst, src, size );
+ end = timer_read();
+ printf( "my_memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000 );
+
+ ret = 0;
+DONE:
+ return ret;
+}
+char mtest_help[] = "memcpy timing test\n";
+__commandlist(mtest_cmd, "mtest", mtest_help);
+
+int mtest8_cmd(int argc, char *argv[])
+{
+ u32 start, end, tps;
+ unsigned long src=0x00300000;
+ unsigned long dst=0xa2000000;
+ size_t size=4272128;
+
+ int ret = EINVAL;
+
+ tps = timer_tps();
+
+ while ( 1 ) {
+ start = timer_read();
+ memcpy( dst, src, size );
+ end = timer_read();
+ printf( "memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000 );
+ }
+
+ ret = 0;
+DONE:
+ return ret;
+}
+char mtest8_help[] = "memcpy test 8\n";
+__commandlist(mtest8_cmd, "mtest8", mtest8_help);
+
+int mtest32_cmd(int argc, char *argv[])
+{
+ u32 start, end, tps;
+ unsigned long src=0x00300000;
+ unsigned long dst=0xa2000000;
+ size_t size=4272128;
+
+ int ret = EINVAL;
+
+ tps = timer_tps();
+
+ while ( 1 ) {
+ start = timer_read();
+ my_memcpy( dst, src, size );
+ end = timer_read();
+ printf( "my_memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000);
+ }
+
+ ret = 0;
+DONE:
+ return ret;
+}
+char mtest32_help[] = "memcpy test 32\n";
+__commandlist(mtest32_cmd, "mtest32", mtest32_help);
|