Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm - Make the compile-time selection of ixdp425...
details: https://anonhg.NetBSD.org/src/rev/28095107cfb2
branches: trunk
changeset: 553951:28095107cfb2
user: scw <scw%NetBSD.org@localhost>
date: Thu Oct 23 10:50:01 2003 +0000
description:
- Make the compile-time selection of ixdp425 vs. zao425 actually work.
- Flesh out cpu_reboot() to jump to Redboot via cpu_reset().
(See XXX comment in code regarding a problem with this).
diffstat:
sys/arch/evbarm/conf/IXDP425 | 3 +-
sys/arch/evbarm/conf/ZAO425 | 3 +-
sys/arch/evbarm/ixdp425/ixdp425_machdep.c | 40 ++++++++++++++++++++++++------
sys/arch/evbarm/ixdp425/ixdp425reg.h | 15 +++++++---
4 files changed, 46 insertions(+), 15 deletions(-)
diffs (164 lines):
diff -r 901bd0bb9f56 -r 28095107cfb2 sys/arch/evbarm/conf/IXDP425
--- a/sys/arch/evbarm/conf/IXDP425 Thu Oct 23 10:05:53 2003 +0000
+++ b/sys/arch/evbarm/conf/IXDP425 Thu Oct 23 10:50:01 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: IXDP425,v 1.2 2003/10/08 14:55:04 scw Exp $
+# $NetBSD: IXDP425,v 1.3 2003/10/23 10:50:01 scw Exp $
#
# ZAO425 -- Intel IXP425
#
@@ -28,6 +28,7 @@
# Board Type
makeoptions BOARDTYPE="ixdp425"
+options EVBARM_BOARDTYPE=ixdp425
# File systems
diff -r 901bd0bb9f56 -r 28095107cfb2 sys/arch/evbarm/conf/ZAO425
--- a/sys/arch/evbarm/conf/ZAO425 Thu Oct 23 10:05:53 2003 +0000
+++ b/sys/arch/evbarm/conf/ZAO425 Thu Oct 23 10:50:01 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ZAO425,v 1.11 2003/10/08 14:55:04 scw Exp $
+# $NetBSD: ZAO425,v 1.12 2003/10/23 10:50:01 scw Exp $
#
# ZAO425 -- Intel IXP425
#
@@ -28,6 +28,7 @@
# Board Type
makeoptions BOARDTYPE="zao425"
+options EVBARM_BOARDTYPE=zao425
# File systems
diff -r 901bd0bb9f56 -r 28095107cfb2 sys/arch/evbarm/ixdp425/ixdp425_machdep.c
--- a/sys/arch/evbarm/ixdp425/ixdp425_machdep.c Thu Oct 23 10:05:53 2003 +0000
+++ b/sys/arch/evbarm/ixdp425/ixdp425_machdep.c Thu Oct 23 10:50:01 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixdp425_machdep.c,v 1.8 2003/10/08 14:55:04 scw Exp $ */
+/* $NetBSD: ixdp425_machdep.c,v 1.9 2003/10/23 10:50:01 scw Exp $ */
/*
* Copyright (c) 2003
* Ichiro FUKUHARA <ichiro%ichiro.org@localhost>.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixdp425_machdep.c,v 1.8 2003/10/08 14:55:04 scw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixdp425_machdep.c,v 1.9 2003/10/23 10:50:01 scw Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -107,6 +107,8 @@
#include <arm/xscale/ixp425var.h>
#include <arm/xscale/ixp425_sipvar.h>
+#include <evbarm/ixdp425/ixdp425reg.h>
+
#include "com.h"
#if NCOM > 0
#include <dev/ic/comreg.h>
@@ -247,6 +249,8 @@
void
cpu_reboot(int howto, char *bootstr)
{
+ u_int32_t reg;
+
#ifdef DIAGNOSTIC
/* info */
printf("boot: howto=%08x curproc=%p\n", howto, curproc);
@@ -302,10 +306,30 @@
* Make really really sure that all interrupts are disabled,
*/
(void) disable_interrupts(I32_bit|F32_bit);
-/*
- * XXX system reset routine
- */
- (void) disable_interrupts(I32_bit|F32_bit);
+ IXPREG(IXP425_INT_ENABLE) = 0;
+
+ /*
+ * Map the boot Flash device down at physical address 0.
+ * This is safe since NetBSD runs out of an alias of
+ * SDRAM at 0x10000000.
+ */
+ reg = EXP_CSR_READ_4(ixp425_softc, EXP_CNFG0_OFFSET);
+ reg |= EXP_CNFG0_MEM_MAP;
+ EXP_CSR_WRITE_4(ixp425_softc, EXP_CNFG0_OFFSET, reg);
+
+ /*
+ * Jump into the bootcode's reset vector
+ *
+ * XXX:
+ * Redboot doesn't like the state in which we leave the PCI
+ * ethernet card, and so fails to detect it on reboot. This
+ * pretty much necessitates a hard reset/power cycle to be
+ * able to download a new kernel image over ethernet.
+ *
+ * I suspect this is due to a bug in Redboot's i82557 driver.
+ */
+ cpu_reset();
+
/* ...and if that didn't work, just croak. */
printf("RESET FAILED!\n");
for (;;);
@@ -410,9 +434,9 @@
bootconfig.dramblocks = 1;
bootconfig.dram[0].address = 0x10000000;
/* XXX */
-#if BOARDTYPE == zao425
+#if EVBARM_BOARDTYPE == zao425
bootconfig.dram[0].pages = 0x04000000 / PAGE_SIZE; /* SDRAM 64MB */
-#elif BOARDTYPE == ixdp425
+#elif EVBARM_BOARDTYPE == ixdp425
bootconfig.dram[0].pages = 0x10000000 / PAGE_SIZE; /* SDRAM 256MB */
#endif
diff -r 901bd0bb9f56 -r 28095107cfb2 sys/arch/evbarm/ixdp425/ixdp425reg.h
--- a/sys/arch/evbarm/ixdp425/ixdp425reg.h Thu Oct 23 10:05:53 2003 +0000
+++ b/sys/arch/evbarm/ixdp425/ixdp425reg.h Thu Oct 23 10:50:01 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixdp425reg.h,v 1.3 2003/09/25 14:11:18 ichiro Exp $ */
+/* $NetBSD: ixdp425reg.h,v 1.4 2003/10/23 10:50:01 scw Exp $ */
/*
* Copyright (c) 2003
* Ichiro FUKUHARA <ichiro%ichiro.org@localhost>.
@@ -35,11 +35,16 @@
#ifndef _IXDP425REG_H_
#define _IXDP425REG_H_
+#include "opt_evbarm_boardtype.h"
+
+#define ixdp425 1
+#define zao425 2
+
/*
* Interrupt & GPIO
*/
-#if BOARDTYPE == ixdp425
+#if EVBARM_BOARDTYPE == ixdp425
/* GPIOs */
#define GPIO_PCI_CLK 14
#define GPIO_PCI_RESET 13
@@ -54,9 +59,9 @@
#define PCI_INT_D IXP425_INT_GPIO_8
#define I2C_SDA IXP425_INT_GPIO_7
#define I2C_SCL IXP425_INT_GPIO_6
-#endif /* BOARDTYPE == ixdp425 */
+#endif /* EVBARM_BOARDTYPE == ixdp425 */
-#if BOARDTYPE == zao425 /* conf/ZAO425 */
+#if EVBARM_BOARDTYPE == zao425 /* conf/ZAO425 */
/* GPIOs */
#define GPIO_PCI_CLK 14
#define GPIO_PCI_RESET 13
@@ -78,6 +83,6 @@
#define HSS0_SDI IXP425_INT_GPIO_2
#define HSS0_SDO IXP425_INT_GPIO_1
#define HSS0_CS IXP425_INT_GPIO_0
-#endif /* BOARDTYPE == zao425 */
+#endif /* EVBARM_BOARDTYPE == zao425 */
#endif /* _IXDP425REG_H_ */
Home |
Main Index |
Thread Index |
Old Index