Update of /cvsroot/blob/blob/src/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv25225/src/lib
Modified Files:
Makefile.am reboot.c
Added Files:
reboot-pxa.c reboot-sa11x0.c
Log Message:
Make a special reboot driver so SA11x0 and PXA can have different reboot
methods. Note that I don't have the PXA manual with me right here, so
somebody has to fill out a real PXA reboot driver at a later stage.
--- NEW FILE: reboot-pxa.c ---
/*
* reboot-pxa.c: Reboot PXA 250 board
*
* Copyright (C) 2003 Erik Mouw (J.A...@it...)
*
* $Id: reboot-pxa.c,v 1.1 2003/01/04 02:11:43 erikm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ident "$Id: reboot-pxa.c,v 1.1 2003/01/04 02:11:43 erikm Exp $"
#ifdef HAVE_CONFIG_H
# include <blob/config.h>
#endif
#include <blob/util.h>
#include <blob/reboot.h>
#include <blob/serial.h>
void pxa_reboot(void)
{
#warning "FIXME: add real PXA reboot code here! -- Erik"
printf("FIXME: add PXA-250 reboot code here!\n");
printf("Going into endless loop, just use your reset button...\n");
serial_flush_output();
for(;;);
}
/* export reboot driver */
reboot_driver_t pxa_reboot_driver = {
reboot: pxa_reboot
};
--- NEW FILE: reboot-sa11x0.c ---
/*
* reboot-sa11x0.c: Reboot SA11x0 board
*
* Copyright (C) 2001 2003 Erik Mouw (J.A...@it...)
*
* $Id: reboot-sa11x0.c,v 1.1 2003/01/04 02:11:43 erikm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ident "$Id: reboot-sa11x0.c,v 1.1 2003/01/04 02:11:43 erikm Exp $"
#ifdef HAVE_CONFIG_H
# include <blob/config.h>
#endif
#include <blob/sa1100.h>
#include <blob/reboot.h>
void sa11x0_reboot(void)
{
RCSR = 0;
RSRR = 1;
}
/* export reboot driver */
reboot_driver_t sa11x0_reboot_driver = {
reboot: sa11x0_reboot
};
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- Makefile.am 14 Aug 2002 21:13:45 -0000 1.22
+++ Makefile.am 4 Jan 2003 02:11:43 -0000 1.23
@@ -50,10 +50,18 @@
time.c \
util.c
+EXTRA_libblob_a_SOURCES = \
+ reboot-pxa.c \
+ reboot-sa11x0.c \
+ serial-pxa.c \
+ serial-sa11x0.c
+
libblob_a_DEPENDENCIES = \
+ @BLOB_REBOOT_DRIVER_OBJS@ \
@BLOB_SERIAL_DRIVER_OBJS@
libblob_a_LIBADD = \
+ @BLOB_REBOOT_DRIVER_OBJS@ \
@BLOB_SERIAL_DRIVER_OBJS@
INCLUDES += \
Index: reboot.c
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/reboot.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- reboot.c 17 Feb 2002 19:54:47 -0000 1.4
+++ reboot.c 4 Jan 2003 02:11:43 -0000 1.5
@@ -1,7 +1,7 @@
/*
* reboot.c: Reboot board
*
- * Copyright (C) 2001 Erik Mouw (J.A...@it...)
+ * Copyright (C) 2001-2003 Erik Mouw (J.A...@it...)
*
* $Id$
*
@@ -27,14 +27,22 @@
# include <blob/config.h>
#endif
-#include <blob/sa1100.h>
+#include <blob/debug.h>
#include <blob/util.h>
+#include <blob/reboot.h>
+
+
+
+
+reboot_driver_t *reboot_driver;
void reboot_system(void)
{
- RCSR = 0;
- RSRR = 1;
+ if(reboot_driver == NULL)
+ deprintf("reboot_driver == NULL, can't reboot!\n");
+
+ reboot_driver->reboot();
}
|