From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mpc83xx: Add esd VME8349 board support
Date: Fri, 24 Jul 2009 14:50:20 +0200 [thread overview]
Message-ID: <200907241450.20165.sr@denx.de> (raw)
In-Reply-To: <20090721140825.dc2fbd16.kim.phillips@freescale.com>
On Tuesday 21 July 2009 21:08:25 Kim Phillips wrote:
> > > > diff --git a/board/esd/vme8349/caddy.h b/board/esd/vme8349/caddy.h
> > > >
> > > > +typedef enum {
> > > > + CADDY_CMD_IO_READ_8,
> > > > + CADDY_CMD_IO_READ_16,
> > > > + CADDY_CMD_IO_READ_32,
> > > > + CADDY_CMD_IO_WRITE_8,
> > > > + CADDY_CMD_IO_WRITE_16,
> > > > + CADDY_CMD_IO_WRITE_32,
> > > > + CADDY_CMD_CONFIG_READ_8,
> > > > + CADDY_CMD_CONFIG_READ_16,
> > > > + CADDY_CMD_CONFIG_READ_32,
> > > > + CADDY_CMD_CONFIG_WRITE_8,
> > > > + CADDY_CMD_CONFIG_WRITE_16,
> > > > + CADDY_CMD_CONFIG_WRITE_32,
> > > > +} CADDY_CMDS;
> > > > +
> > > > +
> > > > +typedef struct {
> > > > + uint32_t cmd;
> > > > + uint32_t issue;
> > > > + uint32_t addr;
> > > > + uint32_t par[5];
> > > > +} CADDY_CMD;
> > > > +
> > > > +typedef struct {
> > > > + uint32_t answer;
> > > > + uint32_t issue;
> > > > + uint32_t status;
> > > > + uint32_t par[5];
> > > > +} CADDY_ANSWER;
> > > > +
> > > > +typedef struct {
> > > > + uint8_t magic[16];
> > > > + uint32_t cmd_in;
> > > > + uint32_t cmd_out;
> > > > + uint32_t heartbeat;
> > > > + uint32_t reserved1;
> > > > + CADDY_CMD cmd[CMD_SIZE];
> > > > + uint32_t answer_in;
> > > > + uint32_t answer_out;
> > > > + uint32_t reserved2;
> > > > + uint32_t reserved3;
> > > > + CADDY_ANSWER answer[CMD_SIZE];
> > > > +} CADDY_INTERFACE;
> > >
> > > please remove all typedefs (see CodingStyle Ch. 5). Use 'struct xxx'
> > > in each instance instead.
> >
> > We really would like to keep these typedefs. The reason for this is that
> > multiple customers already are using this header for their work. And
> > maintaining multiple versions of this file doesn't sound like a good
> > idea.
>
> eh? It's a straight violation of CodingStyle and makes the code
> hard to read; STUFF_IN_CAPS to me read as defines, and anyway,
> typedefs, assuming CodingStyle liked them, would be appended with _t.
> But these need to be defined as 'struct <name>', and used in such a way.
>
> Can't they write a header wrapper for "their work"? Can you make them
> realize they won't need to be wasting time on such effort if they
> submit the remainder of their code upstream?
OK, "typedefs" removed in next patch version.
> > > > diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
> > > > index c20b981..393e44d 100644
> > > > --- a/drivers/pci/pci_auto.c
> > > > +++ b/drivers/pci/pci_auto.c
> > > > @@ -403,6 +403,7 @@ int pciauto_config_device(struct pci_controller
> > > > *hose, pci_dev_t dev) PCI_DEV(dev));
> > > > break;
> > > > #endif
> > > > +#ifndef CONFIG_VME8349
> > > > #ifdef CONFIG_MPC834X
> > >
> > > #if defined(CONFIG_MPC834x) && !defined(CONFIG_VME8349)
> > >
> > > I don't know - this might need to be changed to ifdef
> > > CONFIG_MPC8349EMDS...
> >
> > Should I change this to CONFIG_MPC8349EMDS? Or use
> >
> > #if defined(CONFIG_MPC834x) && !defined(CONFIG_VME8349)
> >
> > for now?
>
> hmm...based on commit 6902df56a0b493f369153b09d11afcd74a580561 "Add PCI
> support for the TQM834x board.", it should really be ifdef
> CONFIG_TQM834x...but what does the VME8349 do? does it want to define
> CONFIG_PCIAUTO_SKIP_HOST_BRIDGE instead?
No. From what I know, this code in question is for some earlier MPC834x chip
revisions. The comment in the code also states something like this:
/*
* The host/PCI bridge 1 seems broken in 8349 - it presents
* itself as 'PCI_CLASS_BRIDGE_OTHER' and appears as an _agent_
* device claiming resources io/mem/irq.. we only allow for
* the PIMMR window to be allocated (BAR0 - 1MB size)
*/
You will probably know this better. If this assumption is correct, it would be
best to check for chip revisions and only enable this code for those "buggy"
revisions.
Since I can't really tell for sure, and I don't want to change any other 83xx
systems, I'll keep
#if defined(CONFIG_MPC834x) && !defined(CONFIG_VME8349)
for now. Otherwise our PCI devices won't get enumerated correctly (e.g. PCI
devices with certain PLX bridges).
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
next prev parent reply other threads:[~2009-07-24 12:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 17:09 [U-Boot] [PATCH] mpc83xx: Add esd VME8349 board support Stefan Roese
2009-06-11 15:15 ` Kim Phillips
2009-07-21 9:38 ` Stefan Roese
2009-07-21 19:08 ` Kim Phillips
2009-07-24 12:50 ` Stefan Roese [this message]
2009-07-22 9:28 ` Wolfgang Denk
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=200907241450.20165.sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/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.