diff options
-rw-r--r-- | sys/arch/aviion/aviion/av400_machdep.c | 23 | ||||
-rw-r--r-- | sys/arch/aviion/aviion/av530_machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/aviion/aviion/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/aviion/aviion/rtc_clock.c | 12 | ||||
-rw-r--r-- | sys/arch/aviion/include/board.h | 6 |
5 files changed, 33 insertions, 26 deletions
diff --git a/sys/arch/aviion/aviion/av400_machdep.c b/sys/arch/aviion/aviion/av400_machdep.c index 41d00f47fbc..4e1b2b8c819 100644 --- a/sys/arch/aviion/aviion/av400_machdep.c +++ b/sys/arch/aviion/aviion/av400_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: av400_machdep.c,v 1.22 2013/10/07 19:09:07 miod Exp $ */ +/* $OpenBSD: av400_machdep.c,v 1.23 2013/10/07 19:11:39 miod Exp $ */ /* * Copyright (c) 2006, 2007, Miodrag Vallat. * @@ -260,7 +260,7 @@ av400_startup() { } -void +u_int av400_bootstrap() { extern const struct cmmu_p cmmu8820x; @@ -287,6 +287,25 @@ av400_bootstrap() * we can still use it. */ scm_getenaddr(hostaddr); + + /* + * Return the delay const value to use (which matches the CPU speed). + */ + switch (cputyp) { + case AVIION_300_310: + case AVIION_400_4000: + case AVIION_300C_310C: + case AVIION_300CD_310CD: + case AVIION_300D_310D: + case AVIION_4300_16: + return 16; + case AVIION_410_4100: + case AVIION_4300_20: + return 20; + default: + case AVIION_4300_25: + return 25; + } } /* diff --git a/sys/arch/aviion/aviion/av530_machdep.c b/sys/arch/aviion/aviion/av530_machdep.c index 70796223722..b829d7c73f3 100644 --- a/sys/arch/aviion/aviion/av530_machdep.c +++ b/sys/arch/aviion/aviion/av530_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: av530_machdep.c,v 1.8 2013/10/07 19:09:08 miod Exp $ */ +/* $OpenBSD: av530_machdep.c,v 1.9 2013/10/07 19:11:39 miod Exp $ */ /* * Copyright (c) 2006, 2007, 2010 Miodrag Vallat. * @@ -148,13 +148,10 @@ av530_startup() { } -void +u_int av530_bootstrap() { extern const struct cmmu_p cmmu8820x; -#if 0 - extern u_char hostaddr[6]; -#endif uint32_t whoami; /* @@ -192,13 +189,10 @@ av530_bootstrap() *(volatile u_int32_t *)AV_IENALL = 0; *(volatile u_int32_t *)AV_EXIENALL = 0; -#if 0 /* - * Get all the information we'll need later from the PROM, while - * we can still use it. + * Return the delay const value to use (which matches the CPU speed). */ - scm_getenaddr(hostaddr); -#endif + return 33; } /* diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c index e80f4b724f1..6e9febe5673 100644 --- a/sys/arch/aviion/aviion/machdep.c +++ b/sys/arch/aviion/aviion/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.55 2013/10/07 19:10:40 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.56 2013/10/07 19:11:39 miod Exp $ */ /* * Copyright (c) 2007 Miodrag Vallat. * @@ -700,7 +700,7 @@ aviion_bootstrap() aviion_identify(); cn_tab = &bootcons; - platform->bootstrap(); + aviion_delay_const = platform->bootstrap(); /* we can use printf() from here. */ /* Parse the commandline */ diff --git a/sys/arch/aviion/aviion/rtc_clock.c b/sys/arch/aviion/aviion/rtc_clock.c index dc153a6a842..097198319c1 100644 --- a/sys/arch/aviion/aviion/rtc_clock.c +++ b/sys/arch/aviion/aviion/rtc_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtc_clock.c,v 1.2 2010/04/24 18:46:51 miod Exp $ */ +/* $OpenBSD: rtc_clock.c,v 1.3 2013/10/07 19:11:39 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -31,8 +31,6 @@ #include <aviion/dev/sysconvar.h> -extern u_int aviion_delay_const; - struct intrhand rtc_clock_ih; int rtc_clockintr(void *); @@ -63,13 +61,9 @@ rtc_init_clocks() profhz = stathz = 0; /* - * According to the documentation, systems of this family run - * at 33MHz; however other sources seem to imply model 530 - * runs at 25Mhz only. - * If this turns out to be the case, proper calibration of the - * system clock will be necessary. + * According to the documentation, all systems of this family run + * at 33MHz. */ - aviion_delay_const = 33; rtc_speed = 33333333 / 2; /* apparently RTC runs at half CPUCLK */ /* diff --git a/sys/arch/aviion/include/board.h b/sys/arch/aviion/include/board.h index 4c843947bd3..74b3cc7ca38 100644 --- a/sys/arch/aviion/include/board.h +++ b/sys/arch/aviion/include/board.h @@ -1,4 +1,4 @@ -/* $OpenBSD: board.h,v 1.10 2013/10/07 19:09:11 miod Exp $ */ +/* $OpenBSD: board.h,v 1.11 2013/10/07 19:11:42 miod Exp $ */ /* * Copyright (c) 2006, 2007, Miodrag Vallat * @@ -75,7 +75,7 @@ struct pmap_table; struct vme_range; struct board { - void (*bootstrap)(void); + u_int (*bootstrap)(void); vaddr_t (*memsize)(void); void (*startup)(void); @@ -100,7 +100,7 @@ struct board { #define DECLARE_BOARD(b) \ extern const struct board board_av##b; \ -void av##b##_bootstrap(void); \ +u_int av##b##_bootstrap(void); \ vaddr_t av##b##_memsize(void); \ void av##b##_startup(void); \ void av##b##_intr(struct trapframe *); \ |