Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/mips/adm5120/dev/if_admswvar.h
RevisionDateAuthorComments
 1.9  29-Sep-2022  skrll Remove unnecessary include of <sys/malloc.h>.
 1.8  16-Apr-2020  rin Revert previous for now:
http://mail-index.netbsd.org/source-changes/2020/04/16/msg116278.html

The reasoning turned out to be wrong; __KERNEL_RCSID() in header files
does *not* overwrite RCSID in main source files. The real problem is that
it inserts its RCSID into *every* object files. However, it can be still
useful even if heavily duplicated.
 1.7  16-Apr-2020  rin Stop using __KERNEL_RCSID() in header files; it confuses ident(1) by
overwriting RCSID in main source files.

XXX
The first argument of __KERNEL_RCSID() is neglected for ELF. If we wish
to have RCSID of header files in kernel binary, we need something like
__FBSDID() macro in FreeBSD.
 1.6  03-Sep-2018  riastradh branches: 1.6.10;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.5  27-Oct-2012  chs branches: 1.5.36; 1.5.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4  10-Jul-2011  matt branches: 1.4.2; 1.4.12;
Fix machine/ includes
 1.3  01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.2  19-Jan-2010  pooka Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.1  20-Mar-2007  dyoung branches: 1.1.2; 1.1.8; 1.1.20; 1.1.44;
Add a port to the Infineon ADM5120.

Basics: the ADM5120 is a 175 MHz MIPS32 4Kc processor featuring a
6-port ethernet 10/100 switch with Auto MDI/X, a PCI controller,
USB 1.1 controller, UART, watchdog timer, eight GPIO pins, and a
multiport memory controller with both NOR and NAND flash support.
This code supports most of the devices on the ADM5120, including
the 6-port switch (each port attaches as an ethernet, admsw0 through
admsw5), the PCI controller, USB controller, GPIO, watchdog, and
UART.

Remaining work: the port includes no NOR/NAND flash drivers. No
bootloader is included. I have only tested the PCI bus driver with
the use of one PCI slot on the RouterBOARD 153. It is not possible
to exploit the capabilities of the ethernet switch using bridge(4).
I have only netbooted the ADM5120 on the RB153. Booting other
boards, and booting from flash memory, remains to be done.

Hardware availability: many low-cost routers, including the
RouterBOARD 100 series at RouterBOARD.com, use the Infineon ADM5120
processor.

Credits: Ruslan Ermilov and Vsevolod Lobko ported to the ADM5120,
and they wrote device drivers for the UART, USB controller, and
10/100 switch. Matt Isaacs brought the port up-to-date with
NetBSD-current, made it compile, and ran it first on the RB153.
I added drivers for the PCI controller, GPIO, and watchdog timer.
I produced the bus attachment for the CompactFlash slot with advice
from Mikrotik technical support and from Matt Thomas.
 1.1.44.1  11-Mar-2010  yamt sync with head
 1.1.20.2  03-Sep-2007  yamt sync with head.
 1.1.20.1  20-Mar-2007  yamt file if_admswvar.h was added on branch yamt-lazymbuf on 2007-09-03 14:27:49 +0000
 1.1.8.2  09-Jun-2007  ad Sync with head.
 1.1.8.1  20-Mar-2007  ad file if_admswvar.h was added on branch vmlocking on 2007-06-09 21:36:57 +0000
 1.1.2.2  24-Mar-2007  yamt sync with head.
 1.1.2.1  20-Mar-2007  yamt file if_admswvar.h was added on branch yamt-idlelwp on 2007-03-24 14:54:52 +0000
 1.4.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.1  30-Oct-2012  yamt sync with head
 1.5.38.1  10-Jun-2019  christos Sync with HEAD
 1.5.36.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.6.10.1  20-Apr-2020  bouyer Sync with HEAD

RSS XML Feed