diff options
author | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2024-11-28 13:13:05 +0000 |
---|---|---|
committer | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2024-11-28 13:13:05 +0000 |
commit | 04dfe0d40b3f085370c1950a37c5d16b94d852ba (patch) | |
tree | dcae5e436f1d934182263879109ffd2da3fe36f2 /sys/arch | |
parent | 0ff14b7131b1a7ff552ebf5dcf7617a79673453b (diff) |
Replace magic numbers to macro defined values.
Also make it possible to change the amount of 3-port RAM usage by the
kernel option.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/luna88k/conf/GENERIC | 5 | ||||
-rw-r--r-- | sys/arch/luna88k/dev/if_le.c | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/sys/arch/luna88k/conf/GENERIC b/sys/arch/luna88k/conf/GENERIC index 103fce43a75..2737058000f 100644 --- a/sys/arch/luna88k/conf/GENERIC +++ b/sys/arch/luna88k/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.24 2019/12/30 12:16:12 aoyama Exp $ +# $OpenBSD: GENERIC,v 1.25 2024/11/28 13:13:03 aoyama Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -25,6 +25,9 @@ option ERRATA__XXX_USR # Options for luna88k hardware option WSDISPLAY_COMPAT_RAWKBD # Provide raw scancodes; needed for X11 +# In case of limiting LANCE's 3 port RAM allocation to 32KB +#option TRI_PORT_RAM_LANCE_SIZE=0x8000 + config bsd swap generic # diff --git a/sys/arch/luna88k/dev/if_le.c b/sys/arch/luna88k/dev/if_le.c index d5b5f69a65b..20707ebe675 100644 --- a/sys/arch/luna88k/dev/if_le.c +++ b/sys/arch/luna88k/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.12 2017/06/17 00:28:18 aoyama Exp $ */ +/* $OpenBSD: if_le.c,v 1.13 2024/11/28 13:13:04 aoyama Exp $ */ /* $NetBSD: if_le.c,v 1.33 1996/11/20 18:56:52 gwr Exp $ */ /*- @@ -57,6 +57,12 @@ #include <luna88k/luna88k/isr.h> +#define TRI_PORT_RAM_LANCE_OFFSET 0x10000 /* first 64KB is used by XP */ + +#ifndef TRI_PORT_RAM_LANCE_SIZE +#define TRI_PORT_RAM_LANCE_SIZE 0x10000 /* 64KB is the default */ +#endif + /* * LANCE registers. * The real stuff is in dev/ic/am7990reg.h @@ -128,10 +134,10 @@ le_attach(struct device *parent, struct device *self, void *aux) lesc->sc_r1 = (struct lereg1 *)ma->ma_addr; /* LANCE */ - sc->sc_mem = (void *)(TRI_PORT_RAM + 0x10000); /* SRAM */ + sc->sc_mem = (void *)(TRI_PORT_RAM + TRI_PORT_RAM_LANCE_OFFSET); sc->sc_conf3 = LE_C3_BSWP; sc->sc_addr = (u_long)sc->sc_mem & 0xffffff; - sc->sc_memsize = 64 * 1024; /* 64KB */ + sc->sc_memsize = TRI_PORT_RAM_LANCE_SIZE; myetheraddr(sc->sc_arpcom.ac_enaddr); |