From: Michael Walle <michael@walle.cc>
To: malc <av1474@comtv.ru>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 01/14] lm32: add Milkymist AC97 support
Date: Thu, 17 Mar 2011 00:02:04 +0100 [thread overview]
Message-ID: <201103170002.05143.michael@walle.cc> (raw)
In-Reply-To: <alpine.LNX.2.00.1103162108310.2479@linmac>
Am Mittwoch 16 März 2011, 19:12:44 schrieb malc:
> > > diff --git a/hw/milkymist-ac97.c b/hw/milkymist-ac97.c
> > > new file mode 100644
> > > index 0000000..6c9e318
> > > --- /dev/null
> > > +++ b/hw/milkymist-ac97.c
> > > @@ -0,0 +1,335 @@
> > > +/*
> > > + * QEMU model of the Milkymist System Controller.
> > > + *
> > > + * Copyright (c) 2010 Michael Walle<michael@walle.cc>
> > > + *
> > > + * This library is free software; you can redistribute it and/or
> > > + * modify it under the terms of the GNU Lesser General Public
> > > + * License as published by the Free Software Foundation; either
> > > + * version 2 of the License, or (at your option) any later version.
> > > + *
> > > + * This library is distributed in the hope that it will be useful,
> > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> > > + * Lesser General Public License for more details.
> > > + *
> > > + * You should have received a copy of the GNU Lesser General Public
> > > + * License along with this library; if not,
> > > see<http://www.gnu.org/licenses/>.
> > > + *
> > > + *
> > > + * Specification available at:
> > > + * http://www.milkymist.org/socdoc/ac97.pdf
> > > + */
> > > +
> > > +#include "hw.h"
> > > +#include "sysbus.h"
> > > +#include "trace.h"
> > > +#include "audio/audio.h"
> > > +#include "qemu-error.h"
> > > +
> > > +enum {
> > > + R_AC97_CTRL = 0,
>
> Unneeded..
I wanted to point out, that the registers begin at offset 0. If i change this,
i'll need to change all other models, too. Including the ones that have been
committed.
> > > + R_AC97_ADDR,
> > > + R_AC97_DATAOUT,
> > > + R_AC97_DATAIN,
> > > + R_D_CTRL,
> > > + R_D_ADDR,
> > > + R_D_REMAINING,
> > > + R_RESERVED,
> > > + R_U_CTRL,
> > > + R_U_ADDR,
> > > + R_U_REMAINING,
> > > + R_MAX
> > > +};
> > > +
> > > +enum {
> > > + AC97_CTRL_RQEN = (1<<0),
>
> Oookay..
>
> > > + AC97_CTRL_WRITE = (1<<1),
>
> Incinsistent(with previous enum formatting) comma (and C99 only at that)
>
> > > +};
> > > +
> > > +enum {
> > > + CTRL_EN = (1<<0),
>
> Ditto x2
Ok, but it has a hidden agenda. R_MAX must always be the last entry, therefore
i omitted the comma. Whereas the bit flags could still be extended. Again if
this is a concern for you, i'll change that and all other models too.
> > > +};
> > > +
> > > +struct MilkymistAC97State {
> > > + SysBusDevice busdev;
> > > +
> > > + QEMUSoundCard card;
> > > + SWVoiceIn *voice_in;
> > > + SWVoiceOut *voice_out;
> > > +
> > > + uint32_t regs[R_MAX];
> > > +
> > > + qemu_irq crrequest_irq;
> > > + qemu_irq crreply_irq;
> > > + qemu_irq dmar_irq;
> > > + qemu_irq dmaw_irq;
> > > +};
> > > +typedef struct MilkymistAC97State MilkymistAC97State;
> > > +
> > > +static void update_voices(MilkymistAC97State *s)
> > > +{
> > > + if (s->regs[R_D_CTRL]& CTRL_EN) {
>
> Space before ampersand would be nice.
mh i think Alex email client messed this up. At least for me, there is one
space before and one space after the ampersand in my original email.
--
Michael
next prev parent reply other threads:[~2011-03-16 23:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-07 22:32 [Qemu-devel] [PATCH 00/14] lm32: Milkymist board support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 01/14] lm32: add Milkymist AC97 support Michael Walle
2011-03-16 16:50 ` [Qemu-devel] " Alexander Graf
2011-03-16 18:12 ` malc
2011-03-16 23:02 ` Michael Walle [this message]
2011-03-16 23:49 ` Alexander Graf
2011-03-17 0:10 ` malc
2011-03-07 22:32 ` [Qemu-devel] [PATCH 02/14] lm32: add Milkymist HPDMC support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 03/14] lm32: add Milkymist memory card support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 04/14] lm32: add Milkymist Minimac support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 05/14] lm32: add Milkymist PFPU support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 06/14] lm32: add Milkymist SoftUSB support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 07/14] lm32: add Milkymist System Controller support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 08/14] configure: add opengl detection Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 09/14] lm32: add Milkymist TMU2 support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 10/14] lm32: add Milkymist UART support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 11/14] lm32: add Milkymist VGAFB support Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 12/14] lm32: add milkymist hw support functions Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 13/14] lm32: add support for the Milkymist board Michael Walle
2011-03-07 22:32 ` [Qemu-devel] [PATCH 14/14] MAINTAINERS: add " Michael Walle
2011-03-16 17:08 ` [Qemu-devel] Re: [PATCH 00/14] lm32: Milkymist board support Alexander Graf
2011-03-24 9:28 ` Alexander Graf
2011-04-04 8:46 ` Edgar E. Iglesias
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201103170002.05143.michael@walle.cc \
--to=michael@walle.cc \
--cc=agraf@suse.de \
--cc=av1474@comtv.ru \
--cc=edgar.iglesias@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.