From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-dev@ozlabs•org
Cc: Paul Mackerras <paulus@samba•org>
Subject: Re: [PATCH 4/9] [POWERPC] move Efika support files into platforms/52xx
Date: Mon, 27 Nov 2006 22:56:43 +0100 [thread overview]
Message-ID: <200611272256.44623.arnd@arndb.de> (raw)
In-Reply-To: <11646622072999-git-send-email-grant.likely@secretlab.ca>
On Monday 27 November 2006 22:16, Grant Likely wrote:
> +#ifdef CONFIG_PCI
> +/*
> + * Access functions for PCI config space using RTAS calls.
> + */
> +static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int=
offset,
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
=A0 =A0int len, u32 * val)
> +{
> +=A0=A0=A0=A0=A0=A0=A0struct pci_controller *hose =3D bus->sysdata;
> +=A0=A0=A0=A0=A0=A0=A0unsigned long addr =3D (offset & 0xff) | ((devfn & =
0xff) << 8)
> +=A0=A0=A0=A0=A0=A0=A0 =A0 =A0| (((bus->number - hose->first_busno) & 0xf=
f) << 16)
> +=A0=A0=A0=A0=A0=A0=A0 =A0 =A0| (hose->index << 24);
> +=A0=A0=A0=A0=A0=A0=A0int ret =3D -1;
> +=A0=A0=A0=A0=A0=A0=A0int rval;
> +
> +=A0=A0=A0=A0=A0=A0=A0rval =3D rtas_call(rtas_token("read-pci-config"), 2=
, 2, &ret, addr, len);
> +=A0=A0=A0=A0=A0=A0=A0*val =3D ret;
> +=A0=A0=A0=A0=A0=A0=A0return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SU=
CCESSFUL;
> +}
> +
> +static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
=A0 =A0 int offset, int len, u32 val)
> +{
> +=A0=A0=A0=A0=A0=A0=A0struct pci_controller *hose =3D bus->sysdata;
> +=A0=A0=A0=A0=A0=A0=A0unsigned long addr =3D (offset & 0xff) | ((devfn & =
0xff) << 8)
> +=A0=A0=A0=A0=A0=A0=A0 =A0 =A0| (((bus->number - hose->first_busno) & 0xf=
f) << 16)
> +=A0=A0=A0=A0=A0=A0=A0 =A0 =A0| (hose->index << 24);
> +=A0=A0=A0=A0=A0=A0=A0int rval;
> +
> +=A0=A0=A0=A0=A0=A0=A0rval =3D rtas_call(rtas_token("write-pci-config"), =
3, 1, NULL,
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ad=
dr, len, val);
> +=A0=A0=A0=A0=A0=A0=A0return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SU=
CCESSFUL;
> +}
> +
I know you're only moving this code, but shouldn't this really use the
code from arch/powerpc/kernel/rtas_pci.c? If it doesn't work out of
the box, I guess we should rather split out the pseries specific
bits from it and make the common parts more generic.
Arnd <><
next prev parent reply other threads:[~2006-11-27 21:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-27 21:16 MPC52xx support rework for 2.6.20 Grant Likely
2006-11-27 21:16 ` [PATCH 1/9] [POWERPC] Document describing mpc52xx device tree binding conventions Grant Likely
2006-11-27 21:16 ` [PATCH 2/9] [POWERPC] Move MPC52xx PIC driver into arch/powerpc/platforms/52xx Grant Likely
2006-11-27 21:16 ` [PATCH 3/9] [POWERPC] Put mpc52xx support file in platforms/52xx Grant Likely
2006-11-27 21:16 ` [PATCH 4/9] [POWERPC] move Efika support files into platforms/52xx Grant Likely
2006-11-27 21:16 ` [PATCH 5/9] [POWERPC] Separate IRQ config / register set from main header Grant Likely
2006-11-27 21:16 ` [PATCH 6/9] [POWERPC] Add common routines for 52xx support in arch/powerpc Grant Likely
2006-11-27 21:16 ` [PATCH 7/9] [POWERPC] Add lite5200 board support to arch/powerpc Grant Likely
2006-11-27 21:16 ` [PATCH 8/9] [POWERPC] Add device trees for lite5200 and lite5200b eval boards Grant Likely
2006-11-27 21:16 ` [PATCH 9/9] [POWERPC] defconfig for lite5200 board Grant Likely
2006-11-27 21:56 ` Arnd Bergmann [this message]
2006-11-27 22:09 ` [PATCH 4/9] [POWERPC] move Efika support files into platforms/52xx Grant Likely
2006-11-27 22:12 ` Benjamin Herrenschmidt
2006-11-27 22:33 ` Arnd Bergmann
2006-11-27 21:39 ` MPC52xx support rework for 2.6.20 Sylvain Munaut
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=200611272256.44623.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox