- fix an indentation error in atawd.c

- use partition 'e' for a disk with no NetBSD slice.
- add Linux ATAG to feature ELF Linux kernel booting. Commented out for now.
- fix errors to retrieve iospace BARs.
This commit is contained in:
nisimura 2008-04-09 16:26:29 +00:00
parent 14395bf943
commit e11b7f14dc
4 changed files with 59 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: atawd.c,v 1.4 2008/04/09 06:07:57 nisimura Exp $ */
/* $NetBSD: atawd.c,v 1.5 2008/04/09 16:26:29 nisimura Exp $ */
#include <sys/types.h>
#include <sys/param.h>
@ -256,7 +256,7 @@ wdgetdisklabel(struct wd_softc *wd)
lp->d_secperunit = UINT32_MAX;
else
lp->d_secperunit = wd->sc_capacity;
lp->d_rpm = 3600;
lp->d_rpm = 3600;
lp->d_interleave = 1;
lp->d_flags = 0;
lp->d_partitions[RAW_PART].p_offset = 0;
@ -268,7 +268,7 @@ wdgetdisklabel(struct wd_softc *wd)
lp->d_checksum = dkcksum(lp);
dp = (struct mbr_partition *)(buf + MBR_PART_OFFSET);
n = RAW_PART + 1;
n = 'e' - 'a';
for (i = 0; i < MBR_PART_COUNT; i++, dp++) {
if (dp->mbrp_type == MBR_PTYPE_UNUSED)
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.14 2008/04/09 00:20:35 nisimura Exp $ */
/* $NetBSD: main.c,v 1.15 2008/04/09 16:26:29 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -726,3 +726,52 @@ pcifixup()
break;
}
}
#if 0
static const char *cmdln[] = {
"console=ttyS0,115200 root=/dev/sda1 rw initrd=0x200000,2M",
"console=ttyS0,115200 root=/dev/nfs ip=dhcp"
};
void
mkatagparams(addr, kcmd)
unsigned addr;
char *kcmd;
{
struct tag {
unsigned siz;
unsigned tag;
unsigned val[1];
};
struct tag *p;
#define ATAG_CORE 0x54410001
#define ATAG_MEM 0x54410002
#define ATAG_INITRD 0x54410005
#define ATAG_CMDLINE 0x54410009
#define ATAG_NONE 0x00000000
#define tagnext(p) (struct tag *)((unsigned *)(p) + (p)->siz)
#define tagsize(n) (2 + (n))
p = (struct tag *)addr;
p->tag = ATAG_CORE;
p->siz = tagsize(3);
p->val[0] = 0; /* flags */
p->val[1] = 0; /* pagesize */
p->val[2] = 0; /* rootdev */
p = tagnext(p);
p->tag = ATAG_MEM;
p->siz = tagsize(2);
p->val[0] = 64 * 1024 * 1024;
p->val[1] = 0; /* start */
p = tagnext(p);
if (kcmd != NULL) {
p = tagnext(p);
p->tag = ATAG_CMDLINE;
p->siz = tagsize((strlen(kcmd) + 1 + 3) >> 2);
strcpy((void *)p->val, kcmd);
}
p = tagnext(p);
p->tag = ATAG_NONE;
p->siz = 0;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciide.c,v 1.4 2008/04/09 01:08:39 nisimura Exp $ */
/* $NetBSD: pciide.c,v 1.5 2008/04/09 16:26:29 nisimura Exp $ */
#include <sys/param.h>
#include <sys/disklabel.h>
@ -65,9 +65,9 @@ pciide_init(unsigned tag, unsigned data)
cp = &l->channel[ch];
if (PCIIDE_INTERFACE_PCI(ch) & val) {
cp->c_cmdbase =
(void *)DEVTOV(pcicfgread(tag, pcibar[ch].cmd));
(void *)DEVTOV(~03 & pcicfgread(tag, pcibar[ch].cmd));
cp->c_ctlbase =
(void *)DEVTOV(pcicfgread(tag, pcibar[ch].ctl));
(void *)DEVTOV(~03 & pcicfgread(tag, pcibar[ch].ctl));
cp->c_data = (u_int16_t *)(cp->c_cmdbase + wd_data);
for (i = 0; i < 8; i++)
cp->c_cmdreg[i] = cp->c_cmdbase + i;

View File

@ -1,4 +1,4 @@
/* $NetBSD: siisata.c,v 1.5 2008/04/09 01:08:39 nisimura Exp $ */
/* $NetBSD: siisata.c,v 1.6 2008/04/09 16:26:29 nisimura Exp $ */
#include <sys/param.h>
#include <sys/disklabel.h>
@ -69,8 +69,8 @@ map3112chan(unsigned tag, int ch, struct atac_channel *cp)
{
int i;
cp->c_cmdbase = (void *)DEVTOV(pcicfgread(tag, regstd[ch].cmd));
cp->c_ctlbase = (void *)DEVTOV(pcicfgread(tag, regstd[ch].ctl));
cp->c_cmdbase = (void *)DEVTOV(~07 & pcicfgread(tag, regstd[ch].cmd));
cp->c_ctlbase = (void *)DEVTOV(~03 & pcicfgread(tag, regstd[ch].ctl));
cp->c_data = (u_int16_t *)(cp->c_cmdbase + wd_data);
for (i = 0; i < 8; i++)
cp->c_cmdreg[i] = cp->c_cmdbase + i;