Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
/* $NetBSD: sec.c,v 1.17 2017/01/20 12:25:07 maya Exp $ */

/*-
 * Copyright (c) 2000, 2001, 2006 Ben Harris
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
/*
 * sec.c -- driver for Acorn SCSI expansion cards (AKA30, AKA31, AKA32)
 *
 * These cards are documented in:
 * Acorn Archimedes 500 series / Acorn R200 series Technical Reference Manual
 * Published by Acorn Computers Limited
 * ISBN 1 85250 086 7
 * Part number 0486,052
 * Issue 1, November 1990
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sec.c,v 1.17 2017/01/20 12:25:07 maya Exp $");

#include <sys/param.h>

#include <sys/buf.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/reboot.h>	/* For bootverbose */
#include <sys/syslog.h>
#include <sys/systm.h>

#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>

#include <sys/bus.h>

#include <dev/ic/wd33c93reg.h>
#include <dev/ic/wd33c93var.h>
#include <dev/ic/nec71071reg.h>

#include <dev/podulebus/podulebus.h>
#include <dev/podulebus/podules.h>
#include <dev/podulebus/powerromreg.h>
#include <dev/podulebus/secreg.h>

#include "opt_ddb.h"

struct sec_softc {
	struct	wd33c93_softc sc_sbic;
	bus_space_tag_t		sc_pod_t;
	bus_space_handle_t	sc_pod_h;
	bus_space_tag_t		sc_mod_t;
	bus_space_handle_t	sc_mod_h;
	void			*sc_ih;
	struct		evcnt	sc_intrcnt;
	uint8_t			sc_mpr;

	/* Details of the current DMA transfer */
	bool			sc_dmaactive;
	void *			sc_dmaaddr;
	int			sc_dmaoff;
	size_t			sc_dmalen;
	bool			sc_dmain;
	/* Details of the current block within the above transfer */
	size_t			sc_dmablk;
};

#define SEC_DMABLK	16384
#define SEC_NBLKS	3
#define SEC_DMAMODE	MODE_TMODE_DMD

/* autoconfiguration glue */
static int sec_match(device_t, cfdata_t, void *);
static void sec_attach(device_t, device_t, void *);

/* shutdown hook */
static bool sec_shutdown(device_t, int);

/* callbacks from MI WD33C93 driver */
static int sec_dmasetup(struct wd33c93_softc *, void **, size_t *, int,
    size_t *);
static int sec_dmago(struct wd33c93_softc *);
static void sec_dmastop(struct wd33c93_softc *);
static void sec_reset(struct wd33c93_softc *);

static int sec_intr(void *);
static int sec_dmatc(struct sec_softc *sc);

void sec_dumpdma(void *arg);

CFATTACH_DECL_NEW(sec, sizeof(struct sec_softc),
    sec_match, sec_attach, NULL, NULL);

static inline void
sec_setpage(struct sec_softc *sc, int page)
{

	sc->sc_mpr = (sc->sc_mpr & ~SEC_MPR_PAGE) | page;
	bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, sc->sc_mpr);
}

static inline void
sec_cli(struct sec_softc *sc)
{

	bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_CLRINT, 0);
}

static inline void
dmac_write(struct sec_softc *sc, int reg, uint8_t val)
{

	bus_space_write_1(sc->sc_mod_t, sc->sc_mod_h,
	    SEC_DMAC + DMAC(reg), val);
}

static inline uint8_t
dmac_read(struct sec_softc *sc, int reg)
{

	return bus_space_read_1(sc->sc_mod_t, sc->sc_mod_h,
	    SEC_DMAC + DMAC(reg));
}

static int
sec_match(device_t parent, cfdata_t cf, void *aux)
{
	struct podulebus_attach_args *pa = aux;

	/* Standard ROM, skipping the MCS card that used the same ID. */
	if (pa->pa_product == PODULE_ACORN_SCSI &&
	    strncmp(pa->pa_descr, "MCS", 3) != 0)
		return 1;

	/* PowerROM */
        if (pa->pa_product == PODULE_ALSYSTEMS_SCSI &&
            podulebus_initloader(pa) == 0 &&
            podloader_callloader(pa, 0, 0) == PRID_ACORN_SCSI1)
                return 1;

	return 0;
}

static void
sec_attach(device_t parent, device_t self, void *aux)
{
	struct podulebus_attach_args *pa = aux;
	struct sec_softc *sc = device_private(self);
	int i;

	sc->sc_sbic.sc_dev = self;
	/* Set up bus spaces */
	sc->sc_pod_t = pa->pa_fast_t;
	bus_space_map(pa->pa_fast_t, pa->pa_fast_base, 0x1000, 0,
	    &sc->sc_pod_h);
	sc->sc_mod_t = pa->pa_mod_t;
	bus_space_map(pa->pa_mod_t, pa->pa_mod_base, 0x1000, 0,
	    &sc->sc_mod_h);

	sc->sc_sbic.sc_regt = sc->sc_mod_t;
	bus_space_subregion(sc->sc_mod_t, sc->sc_mod_h, SEC_SBIC + 0, 1,
	    &sc->sc_sbic.sc_asr_regh);
	bus_space_subregion(sc->sc_mod_t, sc->sc_mod_h, SEC_SBIC + 1, 1,
	    &sc->sc_sbic.sc_data_regh);

	sc->sc_sbic.sc_id = 7;
	sc->sc_sbic.sc_clkfreq = SEC_CLKFREQ;
	sc->sc_sbic.sc_dmamode = SBIC_CTL_BURST_DMA;

	sc->sc_sbic.sc_adapter.adapt_request = wd33c93_scsi_request;
	sc->sc_sbic.sc_adapter.adapt_minphys = minphys;

	sc->sc_sbic.sc_dmasetup = sec_dmasetup;
	sc->sc_sbic.sc_dmago = sec_dmago;
	sc->sc_sbic.sc_dmastop = sec_dmastop;
	sc->sc_sbic.sc_reset = sec_reset;

	sc->sc_mpr = 0;
	bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, sc->sc_mpr);

	for (i = 0; i < SEC_NPAGES; i++) {
		sec_setpage(sc, i);
		bus_space_set_region_2(sc->sc_mod_t, sc->sc_mod_h,
				       SEC_SRAM, 0, SEC_PAGESIZE / 2);
	}

	wd33c93_attach(&sc->sc_sbic);

	evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
	    device_xname(self), "intr");
	sc->sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_BIO, sec_intr,
	    sc, &sc->sc_intrcnt);
	sec_cli(sc);
	sc->sc_mpr |= SEC_MPR_IE;
	bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, sc->sc_mpr);
	if (!pmf_device_register1(sc->sc_sbic.sc_dev, NULL, NULL, sec_shutdown))
		aprint_error_dev(sc->sc_sbic.sc_dev,
		    "couldn't establish power handler\n");
}

/*
 * Before reboot, reset the page register to 0 so that RISC OS can see
 * the podule ROM.
 */
static bool
sec_shutdown(device_t dev, int howto)
{
	struct sec_softc *sc = device_private(dev);

	sec_setpage(sc, 0);
	return true;
}

static void
sec_copyin(struct sec_softc *sc, void *dest, int src, size_t size)
{
	uint16_t tmp, *wptr;
	int cnt, extra_byte;

	KASSERT(src >= 0);
	KASSERT(src + size <= SEC_MEMSIZE);
	if (src % 2 != 0) {
		/*
		 * There's a stray byte at the start.  Read the word
		 * containing it.
		 */
		sec_setpage(sc, src / SEC_PAGESIZE);
		tmp = bus_space_read_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + (src % SEC_PAGESIZE / 2));
		*(uint8_t *)dest = tmp >> 8;
		dest = ((uint8_t *)dest) + 1;
		src++; size--;
	}
	KASSERT(src % 2 == 0);
	KASSERT(ALIGNED_POINTER(dest, uint16_t));
	wptr = dest;
	extra_byte = size % 2;
	size -= extra_byte;
	while (size > 0) {
		cnt = SEC_PAGESIZE - src % SEC_PAGESIZE;
		if (cnt > size)
			cnt = size;
		sec_setpage(sc, src / SEC_PAGESIZE);
		/* bus ops are in words */
		bus_space_read_region_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + src % SEC_PAGESIZE / 2, wptr, cnt / 2);
		src += cnt;
		wptr += cnt / 2;
		size -= cnt;
	}
	if (extra_byte) {
		sec_setpage(sc, src / SEC_PAGESIZE);
		*(u_int8_t *)wptr =
		    bus_space_read_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + src % SEC_PAGESIZE / 2) & 0xff;
	}
}	

static void
sec_copyout(struct sec_softc *sc, const void *src, int dest, size_t size)
{
	int cnt, extra_byte;
	const uint16_t *wptr;
	uint16_t tmp;

	KASSERT(dest >= 0);
	KASSERT(dest + size <= SEC_MEMSIZE);
	if (dest % 2 != 0) {
		/*
		 * There's a stray byte at the start.  Read the word
		 * containing it.
		 */
		sec_setpage(sc, dest / SEC_PAGESIZE);
		tmp = bus_space_read_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + (dest % SEC_PAGESIZE / 2));
		tmp &= 0xff;
		tmp |= *(uint8_t const *)src << 8;
		bus_space_write_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + (dest % SEC_PAGESIZE / 2), tmp);
		src = ((uint8_t const *)src) + 1;
		dest++; size--;
	}
	KASSERT(dest % 2 == 0);
	KASSERT(ALIGNED_POINTER(src, uint16_t));
	wptr = src;
	extra_byte = size % 2;
	size -= extra_byte;
	while (size > 0) {
		cnt = SEC_PAGESIZE - dest % SEC_PAGESIZE;
		if (cnt > size)
			cnt = size;
		sec_setpage(sc, dest / SEC_PAGESIZE);
		/* bus ops are in words */
		bus_space_write_region_2(sc->sc_mod_t, sc->sc_mod_h,
		    dest % SEC_PAGESIZE / 2, wptr, cnt / 2);
		wptr += cnt / 2;
		dest += cnt;
		size -= cnt;
	}
	if (extra_byte) {
		/*
		 * There's a stray byte at the end.  Read the word
		 * containing it.
		 */
		sec_setpage(sc, dest / SEC_PAGESIZE);
		tmp = bus_space_read_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + (dest % SEC_PAGESIZE / 2));
		tmp &= 0xff00;
		tmp |= *(uint8_t const *)wptr;
		bus_space_write_2(sc->sc_mod_t, sc->sc_mod_h,
		    SEC_SRAM + (dest % SEC_PAGESIZE / 2), tmp);
	}
}

static void
sec_dmablk(struct sec_softc *sc, int blk)
{
	int off;
	size_t len;

	KASSERT(blk >= 0);
	KASSERT(blk * SEC_DMABLK < sc->sc_dmalen);
	off = (blk % SEC_NBLKS) * SEC_DMABLK + sc->sc_dmaoff;
	len = MIN(SEC_DMABLK, sc->sc_dmalen - (blk * SEC_DMABLK));
	dmac_write(sc, NEC71071_ADDRLO, off & 0xff);
	dmac_write(sc, NEC71071_ADDRMID, off >> 8);
	dmac_write(sc, NEC71071_ADDRHI, 0);
	/*
	 * "Note: The number of DMA transfer cycles is actually the
	 * value of the current count register + 1.  Therefore, when
	 * programming the count register, specify the number of DMA
	 * transfers minus one." -- uPD71071 datasheet
	 */
	dmac_write(sc, NEC71071_COUNTLO, (len - 1) & 0xff);
	dmac_write(sc, NEC71071_COUNTHI, (len - 1) >> 8);
}

static void
sec_copyoutblk(struct sec_softc *sc, int blk)
{
	int off;
	size_t len;

	KASSERT(blk >= 0);
	KASSERT(blk * SEC_DMABLK < sc->sc_dmalen);
	KASSERT(!sc->sc_dmain);
	off = (blk % SEC_NBLKS) * SEC_DMABLK + sc->sc_dmaoff;
	len = MIN(SEC_DMABLK, sc->sc_dmalen - (blk * SEC_DMABLK));
	sec_copyout(sc, (char*)sc->sc_dmaaddr + (blk * SEC_DMABLK), off, len);
}

static void
sec_copyinblk(struct sec_softc *sc, int blk)
{
	int off;
	size_t len;

	KASSERT(blk >= 0);
	KASSERT(blk * SEC_DMABLK < sc->sc_dmalen);
	KASSERT(sc->sc_dmain);
	off = (blk % SEC_NBLKS) * SEC_DMABLK + sc->sc_dmaoff;
	len = MIN(SEC_DMABLK, sc->sc_dmalen - (blk * SEC_DMABLK));
	sec_copyin(sc, (char*)sc->sc_dmaaddr + (blk * SEC_DMABLK), off, len);
}

static int
sec_dmasetup(struct wd33c93_softc *sc_sbic, void **addr, size_t *len,
    int datain, size_t *dmasize)
{
	struct sec_softc *sc = (struct sec_softc *)sc_sbic;
	uint8_t mode;

	sc->sc_dmaaddr = *addr;
	sc->sc_dmaoff = ALIGNED_POINTER(*addr, uint16_t) ? 0 : 1;
	sc->sc_dmalen = *len;
	sc->sc_dmain = datain;
	sc->sc_dmablk = 0;
	mode = SEC_DMAMODE | (datain ? MODE_TDIR_IOTM : MODE_TDIR_MTIO);
	/* Program first block into DMAC and queue up second. */
	dmac_write(sc, NEC71071_CHANNEL, 0);
	if (!sc->sc_dmain)
		sec_copyoutblk(sc, 0);
	sec_dmablk(sc, 0);
	/* Mode control register */
	dmac_write(sc, NEC71071_MODE, mode);
	return sc->sc_dmalen;
}

static int
sec_dmago(struct wd33c93_softc *sc_sbic)
{
	struct sec_softc *sc = (struct sec_softc *)sc_sbic;

	dmac_write(sc, NEC71071_MASK, 0xe);
	sc->sc_dmaactive = true;
	if (!sc->sc_dmain && sc->sc_dmalen > SEC_DMABLK)
		sec_copyoutblk(sc, 1);
	return sc->sc_dmalen;
}

static void
sec_dmastop(struct wd33c93_softc *sc_sbic)
{
	struct sec_softc *sc = (struct sec_softc *)sc_sbic;

	dmac_write(sc, NEC71071_MASK, 0xf);
	if (sc->sc_dmaactive && sc->sc_dmain)
		sec_copyinblk(sc, sc->sc_dmablk);
	sc->sc_dmaactive = false;
}

/*
 * Reset the SCSI bus, and incidentally the SBIC and DMAC.
 */
static void
sec_reset(struct wd33c93_softc *sc_sbic)
{
	struct sec_softc *sc = (struct sec_softc *)sc_sbic;
	uint8_t asr, csr;

	bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, 
	    sc->sc_mpr | SEC_MPR_UR);
	DELAY(7);
	bus_space_write_1(sc->sc_pod_t, sc->sc_pod_h, SEC_MPR, sc->sc_mpr);
	/* Wait for and clear the reset-complete interrupt */
	do
		GET_SBIC_asr(sc_sbic, asr);
	while (!(asr & SBIC_ASR_INT));
	GET_SBIC_csr(sc_sbic, csr);
	__USE(csr);
	dmac_write(sc, NEC71071_DCTRL1, DCTRL1_CMP | DCTRL1_RQL);
	dmac_write(sc, NEC71071_DCTRL2, 0);
	sec_cli(sc);
}

static int
sec_intr(void *arg)
{
	struct sec_softc *sc = arg;
	u_int8_t isr;

	isr = bus_space_read_1(sc->sc_pod_t, sc->sc_pod_h, SEC_ISR);
	if (!(isr & SEC_ISR_IRQ))
		return 0;
	if (isr & SEC_ISR_DMAC)
		sec_dmatc(sc);
	if (isr & SEC_ISR_SBIC)
		wd33c93_intr(&sc->sc_sbic);
	return 1;
}

static int
sec_dmatc(struct sec_softc *sc)
{

	sec_cli(sc);
	/* DMAC finished block n-1 and is now working on block n */
	sc->sc_dmablk++;
	if (sc->sc_dmalen > sc->sc_dmablk * SEC_DMABLK) {
		dmac_write(sc, NEC71071_CHANNEL, 0);
		sec_dmablk(sc, sc->sc_dmablk);
		dmac_write(sc, NEC71071_MASK, 0xe);
		if (!sc->sc_dmain &&
		    sc->sc_dmalen > (sc->sc_dmablk + 1) * SEC_DMABLK)
			sec_copyoutblk(sc, sc->sc_dmablk + 1);
	} else {
		/* All blocks fully processed. */
		sc->sc_dmaactive = false;
	}
	if (sc->sc_dmain)
		sec_copyinblk(sc, sc->sc_dmablk - 1);
	return 1;
}

#ifdef DDB
void
sec_dumpdma(void *arg)
{
	struct sec_softc *sc = arg;

	dmac_write(sc, NEC71071_CHANNEL, 0);
	printf("%s: DMA state: cur count %02x%02x cur addr %02x%02x%02x ",
	    device_xname(sc->sc_sbic.sc_dev),
	    dmac_read(sc, NEC71071_COUNTHI), dmac_read(sc, NEC71071_COUNTLO),
	    dmac_read(sc, NEC71071_ADDRHI), dmac_read(sc, NEC71071_ADDRMID),
	    dmac_read(sc, NEC71071_ADDRLO));
	dmac_write(sc, NEC71071_CHANNEL, 0 | CHANNEL_WBASE);
	printf("base count %02x%02x base addr %02x%02x%02x\n",
	    dmac_read(sc, NEC71071_COUNTHI), dmac_read(sc, NEC71071_COUNTLO),
	    dmac_read(sc, NEC71071_ADDRHI), dmac_read(sc, NEC71071_ADDRMID),
	    dmac_read(sc, NEC71071_ADDRLO));
	printf("%s: DMA state: dctrl %1x%02x mode %02x status %02x req %02x "
	    "mask %02x\n",
	    device_xname(sc->sc_sbic.sc_dev), dmac_read(sc, NEC71071_DCTRL2),
	    dmac_read(sc, NEC71071_DCTRL1), dmac_read(sc, NEC71071_MODE),
	    dmac_read(sc, NEC71071_STATUS), dmac_read(sc, NEC71071_REQUEST),
	    dmac_read(sc, NEC71071_MASK));
	printf("%s: soft DMA state: %zd@%p%s%d\n",
	    device_xname(sc->sc_sbic.sc_dev),
	    sc->sc_dmalen, sc->sc_dmaaddr, sc->sc_dmain ? "<-" : "->",
	    sc->sc_dmaoff);
}

void sec_dumpall(void); /* Call from DDB */

extern struct cfdriver sec_cd;

void sec_dumpall(void)
{
	int i;
	struct sec_softc *sc;

	for (i = 0; i < sec_cd.cd_ndevs; ++i) {
		sc = device_lookup_private(&sec_cd, i);
		if (sc != NULL)
			sec_dumpdma(sc);
	}
}
#endif