* GE IMP3a
From: Kumar Gala @ 2012-08-15 21:32 UTC (permalink / raw)
To: Martyn Welch; +Cc: linuxppc-dev@lists.ozlabs.org list
Martyn,
Do you know why ge_imp3a.c has 0x9000 as the 'primary' PCIe bus on the board?
- k
^ permalink raw reply
* Re: [PATCH V7 2/3] powerpc/ge_imp3a: Add ISA node to PCI primary bus
From: Scott Wood @ 2012-08-15 21:05 UTC (permalink / raw)
To: Kumar Gala; +Cc: B07421, linuxppc-dev, Jia Hongtao
In-Reply-To: <62B0A8DA-3EB8-494C-946B-4D2C4510F702@kernel.crashing.org>
On 08/15/2012 04:01 PM, Kumar Gala wrote:
>
> On Aug 15, 2012, at 12:31 PM, Scott Wood wrote:
>
>> On 08/15/2012 03:57 AM, Jia Hongtao wrote:
>>> PCI primary bus will be determined by looking for ISA node in device tree.
>>> Also for board ge_imp3a primary bus is the second PCI controller detected.
>>> So we add ISA node to ge_imp3a's device tree to fit the new determination.
>>>
>>> Adding ISA node to other boards' device tree is not necessary. The situation
>>> that the first bus is primary have already been handled. Please refer to the
>>> following patch:
>>> powerpc/pci: Make sure ISA IO base is not zero
>>>
>>> Signed-off-by: Jia Hongtao <B38951@freescale.com>
>>> Signed-off-by: Li Yang <leoli@freescale.com>
>>> ---
>>> arch/powerpc/boot/dts/ge_imp3a.dts | 4 ++++
>>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/powerpc/boot/dts/ge_imp3a.dts b/arch/powerpc/boot/dts/ge_imp3a.dts
>>> index fefae41..aa2c4b5 100644
>>> --- a/arch/powerpc/boot/dts/ge_imp3a.dts
>>> +++ b/arch/powerpc/boot/dts/ge_imp3a.dts
>>> @@ -248,6 +248,10 @@
>>> 0x1000000 0x0 0x0
>>> 0x1000000 0x0 0x0
>>> 0x0 0x10000>;
>>> +
>>> + isa@1e {
>>> + device_type = "isa";
>>> + };
>>> };
>>> };
>>> };
>>
>> I believe I already said it's not acceptable to break old device trees.
>>
>> -Scott
>>
>
> I agree w/Scott this is NOT an acceptable solution, both because of
> old device tree and its just wrong to list ISA if it doesn't exist in
> the device.
If there isn't actually ISA here, why do we care which bus is primary?
Other than the lack of hardware to sanity test the change on...
-Scott
^ permalink raw reply
* Re: [PATCH V7 2/3] powerpc/ge_imp3a: Add ISA node to PCI primary bus
From: Kumar Gala @ 2012-08-15 21:01 UTC (permalink / raw)
To: Scott Wood; +Cc: B07421, linuxppc-dev, Jia Hongtao
In-Reply-To: <502BDCEE.70007@freescale.com>
On Aug 15, 2012, at 12:31 PM, Scott Wood wrote:
> On 08/15/2012 03:57 AM, Jia Hongtao wrote:
>> PCI primary bus will be determined by looking for ISA node in device =
tree.
>> Also for board ge_imp3a primary bus is the second PCI controller =
detected.
>> So we add ISA node to ge_imp3a's device tree to fit the new =
determination.
>>=20
>> Adding ISA node to other boards' device tree is not necessary. The =
situation
>> that the first bus is primary have already been handled. Please refer =
to the
>> following patch:
>> powerpc/pci: Make sure ISA IO base is not zero
>>=20
>> Signed-off-by: Jia Hongtao <B38951@freescale.com>
>> Signed-off-by: Li Yang <leoli@freescale.com>
>> ---
>> arch/powerpc/boot/dts/ge_imp3a.dts | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>=20
>> diff --git a/arch/powerpc/boot/dts/ge_imp3a.dts =
b/arch/powerpc/boot/dts/ge_imp3a.dts
>> index fefae41..aa2c4b5 100644
>> --- a/arch/powerpc/boot/dts/ge_imp3a.dts
>> +++ b/arch/powerpc/boot/dts/ge_imp3a.dts
>> @@ -248,6 +248,10 @@
>> 0x1000000 0x0 0x0
>> 0x1000000 0x0 0x0
>> 0x0 0x10000>;
>> +
>> + isa@1e {
>> + device_type =3D "isa";
>> + };
>> };
>> };
>> };
>=20
> I believe I already said it's not acceptable to break old device =
trees.
>=20
> -Scott
>=20
I agree w/Scott this is NOT an acceptable solution, both because of old =
device tree and its just wrong to list ISA if it doesn't exist in the =
device.
- k=
^ permalink raw reply
* [PATCH] rapidio/tsi721: fix unused variable compiler warning
From: Alexandre Bounine @ 2012-08-15 20:35 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, linuxppc-dev; +Cc: Alexandre Bounine
Fix unused variable compiler warning when built with CONFIG_RAPIDIO_DEBUG
option off.
This patch is applicable to kernel versions starting from v3.2
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
---
drivers/rapidio/devices/tsi721.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index c0d6a04..5d44252 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2219,7 +2219,7 @@ static int __devinit tsi721_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
struct tsi721_device *priv;
- int i, cap;
+ int cap;
int err;
u32 regval;
@@ -2239,12 +2239,15 @@ static int __devinit tsi721_probe(struct pci_dev *pdev,
priv->pdev = pdev;
#ifdef DEBUG
+ {
+ int i;
for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
dev_dbg(&pdev->dev, "res[%d] @ 0x%llx (0x%lx, 0x%lx)\n",
i, (unsigned long long)pci_resource_start(pdev, i),
(unsigned long)pci_resource_len(pdev, i),
pci_resource_flags(pdev, i));
}
+ }
#endif
/*
* Verify BAR configuration
--
1.7.8.4
^ permalink raw reply related
* [PATCH] rapidio/tsi721: fix inbound doorbell interrupt handling
From: Alexandre Bounine @ 2012-08-15 19:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, linuxppc-dev; +Cc: Alexandre Bounine
Make sure that there is no doorbell messages left behind due to disabled
interrupts during inbound doorbell processing.
The most common case for this bug is loss of rionet JOIN messages in
systems with three or more rionet participants and MSI or MSI-X enabled.
As result, requests for packet transfers may finish with
"destination unreachable" error message.
This patch is applicable to kernel versions starting from v3.2.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
---
drivers/rapidio/devices/tsi721.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 722246c..c0d6a04 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -435,6 +435,9 @@ static void tsi721_db_dpc(struct work_struct *work)
" info %4.4x\n", DBELL_SID(idb.bytes),
DBELL_TID(idb.bytes), DBELL_INF(idb.bytes));
}
+
+ wr_ptr = ioread32(priv->regs +
+ TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
}
iowrite32(rd_ptr & (IDB_QSIZE - 1),
@@ -445,6 +448,10 @@ static void tsi721_db_dpc(struct work_struct *work)
regval |= TSI721_SR_CHINT_IDBQRCV;
iowrite32(regval,
priv->regs + TSI721_SR_CHINTE(IDB_QUEUE));
+
+ wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
+ if (wr_ptr != rd_ptr)
+ schedule_work(&priv->idb_work);
}
/**
--
1.7.8.4
^ permalink raw reply related
* Re: [PATCH V3 0/3] tpm: Add new vTPM device driver for PPC64
From: Kent Yoder @ 2012-08-15 19:59 UTC (permalink / raw)
To: Ashley Lai
Cc: linux-kernel, linux-security-module, tpmdd-devel, adlai, rcj,
linuxppc-dev
In-Reply-To: <1344986638.4430.22.camel@footlong>
On Tue, Aug 14, 2012 at 06:23:58PM -0500, Ashley Lai wrote:
> Change log V3:
> - Replaced TPM_NO_EVENT_LOG macro with stubs
> - Removed tpm_noeventlog.c file
> - Called of_node_put() before return in tpm_of.c
>
> Change log V2:
> - Removed unnecessary tpm_bios_log_setup and tpm_bios_log_teardown
> functions in tpm_eventlog.h (patch 3/3).
> - Added more descriptions on vTPM (patch 1/3).
>
> These patches add support for IBM vTPM for PPC64. This new device driver
> works on firmware that supports vTPM (firmware release 740 or higher).
>
> Tested on Power7+ system with firmware level ZM770_001.
>
> Applied to Kent Yoder tree at:
> https://github.com/shpedoikal/linux/tree/v3.6-rc1-tpmdd-staging
Thanks Ashley, I've added the patches to that tree.
Kent
>
> Ashley Lai (3):
> drivers/char/tpm: Add new device driver to support IBM vTPM
> PPC64: Add support for instantiating SML from Open Firmware
> drivers/char/tpm: Add securityfs support for event log
>
> arch/powerpc/kernel/prom_init.c | 62 ++++
> drivers/char/tpm/Kconfig | 8 +
> drivers/char/tpm/Makefile | 6 +
> drivers/char/tpm/tpm.h | 13 +-
> drivers/char/tpm/tpm_eventlog.h | 15 +
> drivers/char/tpm/tpm_ibmvtpm.c | 749 +++++++++++++++++++++++++++++++++++++++
> drivers/char/tpm/tpm_ibmvtpm.h | 83 +++++
> drivers/char/tpm/tpm_of.c | 73 ++++
> 8 files changed, 997 insertions(+), 12 deletions(-)
> create mode 100644 drivers/char/tpm/tpm_ibmvtpm.c
> create mode 100644 drivers/char/tpm/tpm_ibmvtpm.h
> create mode 100644 drivers/char/tpm/tpm_of.c
>
>
^ permalink raw reply
* therm_pm72 units, interface
From: Jan Engelhardt @ 2012-08-15 17:53 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
About a week ago, an XServe G5 of mine started powering off more or less
randomly (after 1 hour, chances were good it for it to occur). A
problematic UPS has already been cut from the loop, and today I cleaned
the machine inside out with pressurized air. So far it runs, for now at
least, with a load >= 2.0, but I am keeping an eye on whether this is a
thermal issue.
To that end, I wanted to obtain some statistics. Despite
sensors-detect(8) loads lm87.ko for me, running sensors(1) shows no
sensors. Oddly enough, I found a "kfand" process running that seems to
stem from therm_pm72.ko, which brings me to the sysfs files.
Is there a reason sensors(1) is not supported for Rackmac3,1?
Certain sysfs files have a value with an unknown unit.
"current" is likely in Ampere, temperature must be in Celsius
(because there's no way the server room is 54°F=12°C cold).
Is there a way to obtain the trip points for the hardware?
$ cd /sys/devices/temperature; grep '' *;
backside_fan_pwm:32
backside_temperature:54.000
cpu0_current:34.423
cpu0_exhaust_fan_rpm:5340
cpu0_intake_fan_rpm:5340
cpu0_temperature:72.889
cpu0_voltage:1.252
cpu1_current:34.179
cpu1_exhaust_fan_rpm:4584
cpu1_intake_fan_rpm:4584
cpu1_temperature:68.526
cpu1_voltage:1.259
dimms_temperature:53.000
grep: driver: Er en filkatalog
modalias:platform:temperature
grep: power: Er en filkatalog
slots_fan_pwm:20
slots_temperature:38.500
grep: subsystem: Er en filkatalog
uevent:DRIVER=temperature
uevent:OF_NAME=fan
uevent:OF_FULLNAME=/u3@0,f8000000/i2c@f8001000/fan@15e
uevent:OF_TYPE=fcu
uevent:OF_COMPATIBLE_0=fcu
uevent:OF_COMPATIBLE_N=1
uevent:MODALIAS=of:NfanTfcuCfcu
^ permalink raw reply
* Re: [PATCH V5 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
From: Scott Wood @ 2012-08-15 17:45 UTC (permalink / raw)
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421, Gala Kumar-B11780,
linuxppc-dev@lists.ozlabs.org, Li Yang-R58472
In-Reply-To: <412C8208B4A0464FA894C5F0C278CD5D01A54908@039-SN1MPN1-002.039d.mgd.msft.net>
On 08/15/2012 04:22 AM, Jia Hongtao-B38951 wrote:
>
>
>> -----Original Message-----
>> From: Wood Scott-B07421
>> Sent: Saturday, August 11, 2012 12:00 AM
>> To: Jia Hongtao-B38951
>> Cc: Gala Kumar-B11780; Wood Scott-B07421; Li Yang-R58472; linuxppc-
>> dev@lists.ozlabs.org
>> Subject: Re: [PATCH V5 3/3] powerpc/fsl-pci: Unify pci/pcie
>> initialization code
>>
>> On 08/10/2012 03:47 AM, Jia Hongtao-B38951 wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Gala Kumar-B11780
>>>> Sent: Thursday, August 09, 2012 3:04 AM
>>>> To: Wood Scott-B07421
>>>> Cc: Jia Hongtao-B38951; Wood Scott-B07421; Li Yang-R58472; linuxppc-
>>>> dev@lists.ozlabs.org
>>>> Subject: Re: [PATCH V5 3/3] powerpc/fsl-pci: Unify pci/pcie
>>>> initialization code
>>>>
>>>>>>>>>>> As I explained before, this has to be done globally, not from
>>>>>>>>>>> the probe function, so we can assign a default primary bus if
>>>>>>>>>>> there
>>>>>>> isn't any ISA.
>>>>>>>>>>> There are bugs in the Linux PPC PCI code relating to not
>>>>>>>>>>> having any primary bus.
>>>>>>>>>>>
>>>>>>>>>>> -Scott
>>>>>>>>>>
>>>>>>>>>> In my way of searching ISA you can also assign a default
>>>>>>>>>> primary bus in board specific files.
>>>>>>>>>
>>>>>>>>> That was meant for when the board file had an alternate way of
>>>>>>>>> searching for the primary bus (e.g. look for i8259), not as a
>>>>>>>>> replacement for the mechanism that guarantees there's a primary
>> bus.
>>>>>>>>>
>>>>>>>>> You are causing a regression in the qemu_e500.c platform.
>>>>>>>>
>>>>>>>> Can we fix the qemu device tree to address the problem if we do
>>>>>>>> make it a rule to use the ISA node to indicate the primary bus?
>>>>>>>
>>>>>>> No. There is no ISA, and we're not going to lie and say there is.
>>>>>>
>>>>>> But we can assign a default primary for qemu.
>>>>>
>>>>> Not in the device tree. What other mechanism do you propose? And
>>>>> why do you want to fix it only for QEMU and not other boards, where
>>>>> things happen to work but not as designed?
>>>>>
>>>>> Kumar, can you speak up here as maintainer so we can stop going back
>>>>> and forth endlessly?
>>>>
>>>> I'd rather we stick with the code that works for this purpose at this
>>>> point. That would be Scott's current upstream code. Lets get the
>>>> other aspects of this patchset closed (SWIOTLB, conversion to
>>>> platform driver, PM, etc.). The primary bus code Scott wrote does
>>>> NOT need to change at this point.
>>>>
>>>> - k
>>>
>>>
>>> I just submitted a new version of PCI patch in which I improve the
>> primary part.
>>> The reasons I want to change the way of primary assignment listed below:
>>>
>>> 1. This approach is functionally equivalent to the Scott's code. In my
>>> approach there might be no primary assigned but it fixed by "quick fix"
>> introduced by Ben.
>>> Please refer to this link:
>>> https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-June/098586.html
>>
>> You might want to get Ben's input as to whether he actually wants to see
>> that "quick fix" applied.
>>
>>> 2. Scott's and my way could not handle the situation that "the primary
>>> is not the first PCI bus detected". I found that only ge_imp3a got
>>> this problem so I fixed it by adding ISA node to its device tree. By
>>> adding this I think the solution is logically completed.
>>
>> How did my approach not handle this case? As I said, ge_imp3a platform
>> code needs to set fsl_pci_primary manually before PCI init runs.
>>
>> Adding a node to the device tree is not the answer, since that will break
>> compatibility with old device trees.
>>
>
> I assume that kernel image and dtb image are from the same tree.
That's a bad assumption. Device trees get forked off for custom boards,
modified by firmware, generated by firmware, etc.
-Scott
^ permalink raw reply
* Re: [PATCH V7 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
From: Scott Wood @ 2012-08-15 17:35 UTC (permalink / raw)
To: Jia Hongtao; +Cc: linuxppc-dev, B07421
In-Reply-To: <1345021026-10886-4-git-send-email-B38951@freescale.com>
On 08/15/2012 03:57 AM, Jia Hongtao wrote:
> We unified the Freescale pci/pcie initialization by changing the fsl_pci
> to a platform driver. In previous PCI code architecture the initialization
> routine is called at board_setup_arch stage. Now the initialization is done
> in probe function which is architectural better. Also It's convenient for
> adding PM support for PCI controller in later patch.
>
> We also change the way of determining primary bus for fitting platform
> driver. Two previous patches are the preparation for this.
>
> Now we registered pci controllers as platform devices. So we combine two
> initialization code as one platform driver.
>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
> ---
> Changes for V7:
> - Separate V6 to three functional independent patches.
>
> arch/powerpc/platforms/85xx/common.c | 10 +++
> arch/powerpc/platforms/85xx/corenet_ds.c | 31 +--------
> arch/powerpc/platforms/85xx/ge_imp3a.c | 48 +------------
> arch/powerpc/platforms/85xx/mpc8536_ds.c | 36 +---------
> arch/powerpc/platforms/85xx/mpc85xx_ads.c | 9 +--
> arch/powerpc/platforms/85xx/mpc85xx_cds.c | 14 +----
> arch/powerpc/platforms/85xx/mpc85xx_ds.c | 38 ++--------
> arch/powerpc/platforms/85xx/mpc85xx_mds.c | 38 +---------
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 28 +++-----
> arch/powerpc/platforms/85xx/p1010rdb.c | 14 +----
> arch/powerpc/platforms/85xx/p1022_ds.c | 34 +---------
> arch/powerpc/platforms/85xx/p1022_rdk.c | 34 +---------
> arch/powerpc/platforms/85xx/p1023_rds.c | 7 +--
> arch/powerpc/platforms/85xx/p2041_rdb.c | 2 +-
> arch/powerpc/platforms/85xx/p3041_ds.c | 2 +-
> arch/powerpc/platforms/85xx/p4080_ds.c | 2 +-
> arch/powerpc/platforms/85xx/p5020_ds.c | 2 +-
> arch/powerpc/platforms/85xx/p5040_ds.c | 2 +-
> arch/powerpc/platforms/85xx/qemu_e500.c | 3 +-
> arch/powerpc/platforms/85xx/sbc8548.c | 19 +-----
> arch/powerpc/platforms/85xx/socrates.c | 11 +---
> arch/powerpc/platforms/85xx/stx_gp3.c | 11 +---
> arch/powerpc/platforms/85xx/tqm85xx.c | 21 +------
> arch/powerpc/platforms/85xx/xes_mpc85xx.c | 54 ++-------------
> arch/powerpc/platforms/86xx/gef_ppc9a.c | 10 +--
> arch/powerpc/platforms/86xx/gef_sbc310.c | 11 +---
> arch/powerpc/platforms/86xx/gef_sbc610.c | 10 +--
> arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 19 +----
> arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 40 +----------
> arch/powerpc/platforms/86xx/sbc8641d.c | 12 +---
> arch/powerpc/sysdev/fsl_pci.c | 102 +++++++++++++++++-----------
> arch/powerpc/sysdev/fsl_pci.h | 9 ++-
> drivers/edac/mpc85xx_edac.c | 43 +++---------
> 33 files changed, 160 insertions(+), 566 deletions(-)
Please separate the core changes from the conversion of boards. The
easiest way to do this is to convert them to using fsl_pci_init() first.
Which boards have you tested on?
> -void __devinit fsl_pci_init(void)
> +/* Checkout if PCI contains ISA node */
> +static int of_pci_has_isa(struct device_node *pci_node)
> +{
> + struct device_node *np;
> + int ret = 0;
> +
> + if (!pci_node)
> + return 0;
> +
> + read_lock(&devtree_lock);
> + np = pci_node->allnext;
> +
> + /* Only scan the children of PCI node */
> + for (; np != pci_node->sibling; np = np->allnext) {
> + if (np->type && (of_node_cmp(np->type, "isa") == 0)
> + && of_node_get(np)) {
> + ret = 1;
> + break;
> + }
> + }
> +
> + of_node_put(pci_node);
> + read_unlock(&devtree_lock);
> +
> + return ret;
> +}
Didn't Kumar already say to leave this alone? Do you think you'll get
your patches merged by eternal stubornness?
-Scott
^ permalink raw reply
* Re: [PATCH V7 2/3] powerpc/ge_imp3a: Add ISA node to PCI primary bus
From: Scott Wood @ 2012-08-15 17:31 UTC (permalink / raw)
To: Jia Hongtao; +Cc: linuxppc-dev, B07421
In-Reply-To: <1345021026-10886-3-git-send-email-B38951@freescale.com>
On 08/15/2012 03:57 AM, Jia Hongtao wrote:
> PCI primary bus will be determined by looking for ISA node in device tree.
> Also for board ge_imp3a primary bus is the second PCI controller detected.
> So we add ISA node to ge_imp3a's device tree to fit the new determination.
>
> Adding ISA node to other boards' device tree is not necessary. The situation
> that the first bus is primary have already been handled. Please refer to the
> following patch:
> powerpc/pci: Make sure ISA IO base is not zero
>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/boot/dts/ge_imp3a.dts | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/ge_imp3a.dts b/arch/powerpc/boot/dts/ge_imp3a.dts
> index fefae41..aa2c4b5 100644
> --- a/arch/powerpc/boot/dts/ge_imp3a.dts
> +++ b/arch/powerpc/boot/dts/ge_imp3a.dts
> @@ -248,6 +248,10 @@
> 0x1000000 0x0 0x0
> 0x1000000 0x0 0x0
> 0x0 0x10000>;
> +
> + isa@1e {
> + device_type = "isa";
> + };
> };
> };
> };
I believe I already said it's not acceptable to break old device trees.
-Scott
^ permalink raw reply
* Re: [PATCH V7 1/3] powerpc/pci: Make sure ISA IO base is not zero
From: Scott Wood @ 2012-08-15 17:29 UTC (permalink / raw)
To: Jia Hongtao; +Cc: linuxppc-dev, B07421
In-Reply-To: <1345021026-10886-2-git-send-email-B38951@freescale.com>
On 08/15/2012 03:57 AM, Jia Hongtao wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Some platforms like QEMU treat 0 as an invalid address for ISA IO base.
> So we make sure that ISA IO base will never be zero. By functionality this
> is equivalent to assgin the first pci bus detected as a primary bus.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
When did Ben post this?
Suggesting a temporary workaround in an e-mail is *not* the same as
posting a patch, and definitely not the same as providing a
signed-off-by which AFAICT you forged. Don't do that.
> ---
> arch/powerpc/kernel/pci-common.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index 0f75bd5..2a09aa5 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -734,7 +734,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
> hose->io_base_virt = ioremap(cpu_addr, size);
>
> /* Expect trouble if pci_addr is not 0 */
> - if (primary)
> + if (primary || !isa_io_base)
> isa_io_base =
> (unsigned long)hose->io_base_virt;
> #endif /* CONFIG_PPC32 */
>
Didn't I already point out that this has problems when the primary bus
is not the first to be probed? If your answer is that you fix that in a
later patch, that breaks bisectability.
-Scott
^ permalink raw reply
* Re: [PATCH v3 2/2] powerpc: Uprobes port to powerpc
From: Oleg Nesterov @ 2012-08-15 16:59 UTC (permalink / raw)
To: Ananth N Mavinakayanahalli
Cc: Srikar Dronamraju, peterz, lkml, Paul Mackerras, Anton Blanchard,
Ingo Molnar, linuxppc-dev
In-Reply-To: <20120726052029.GB29466@in.ibm.com>
On 07/26, Ananth N Mavinakayanahalli wrote:
>
> From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
>
> This is the port of uprobes to powerpc. Usage is similar to x86.
I am just curious why this series was ignored by powerpc maintainers...
Of course I can not review this code, I know nothing about powerpc,
but the patches look simple/straightforward.
Paul, Benjamin?
Just one question... Shouldn't arch_uprobe_pre_xol() forbid to probe
UPROBE_SWBP_INSN (at least) ?
(I assume that emulate_step() can't handle this case but of course I
do not understand arch/powerpc/lib/sstep.c)
Note that uprobe_pre_sstep_notifier() sets utask->state = UTASK_BP_HIT
without any checks. This doesn't look right if it was UTASK_SSTEP...
But again, I do not know what powepc will actually do if we try to
single-step over UPROBE_SWBP_INSN.
Oleg.
^ permalink raw reply
* [PATCH] powerpc:Update Integrated Flash controller device tree bindings
From: Prabhakar Kushwaha @ 2012-08-15 15:13 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Prabhakar Kushwaha
Freescale's Integrated Flash controller (IFC) may have one or two
interrupts. In case of single interrupt line, it will cover all IFC
interrupts.
Update this information in IFC device tree bindings
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
Base upon git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git
Branch next
.../devicetree/bindings/powerpc/fsl/ifc.txt | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt b/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
index 939a26d..88c7a26 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
+++ b/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
@@ -12,9 +12,12 @@ Properties:
- #size-cells : Either one or two, depending on how large each chipselect
can be.
- reg : Offset and length of the register set for the device
-- interrupts : IFC has two interrupts. The first one is the "common"
- interrupt(CM_EVTER_STAT), and second is the NAND interrupt
- (NAND_EVTER_STAT).
+- interrupts: IFC may have one or two interrupts. If two interrupt
+ specifiers are present, the first is the "common"
+ interrupt (CM_EVTER_STAT), and the second is the NAND
+ interrupt (NAND_EVTER_STAT). If there is only one,
+ that interrupt reports both types of event.
+
- ranges : Each range corresponds to a single chipselect, and covers
the entire access window as configured.
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH V6 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
From: Tabi Timur-B04825 @ 2012-08-15 11:11 UTC (permalink / raw)
To: Jia Hongtao-B38951; +Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <412C8208B4A0464FA894C5F0C278CD5D01A54861@039-SN1MPN1-002.039d.mgd.msft.net>
On Aug 14, 2012, at 10:56 PM, "Jia Hongtao-B38951" <B38951@freescale.com> w=
rote:
>>=20
>>>=20
>>> +EXPORT_SYMBOL_GPL(mpc85xx_pci_err_probe);
>>=20
>> Make this EXPORT_SYMBOL.
>>=20
>=20
> Hi Timur and Kumar:
>=20
> I'm a little confused.
> Should we remove _GPL for upstream version too?
Yes.=20
>=20
> -Hongtao.
^ permalink raw reply
* [PATCH] kconfig: remove CONFIG_MTD_NAND_VERIFY_WRITE
From: Huang Shijie @ 2012-08-15 9:12 UTC (permalink / raw)
To: linux
Cc: linux-mips, linus.walleij, wim, paulus, balbi, mingo, kgene.kim,
FlorianSchandinat, robert.richter, lliubbo, vapier, a.p.zijlstra,
arnd, uclinux-dist-devel, linux-arm-kernel, scott.jiang.linux,
linux-kernel, ralf, Huang Shijie, linux-mtd, akpm, linuxppc-dev
Just as Artem suggested:
"Both UBI and JFFS2 are able to read verify what they wrote already.
There are also MTD tests which do this verification. So I think there
is no reason to keep this in the NAND layer, let alone wasting RAM in
the driver to support this feature."
So kill MTD_NAND_VERIFY_WRITE entirely. Please see the patch:
http://lists.infradead.org/pipermail/linux-mtd/2012-August/043189.html
This patch removes the CONFIG_MTD_NAND_VERIFY_WRITE in the defconfigs.
Signed-off-by: Huang Shijie <b32955@freescale.com>
---
arch/arm/configs/bcmring_defconfig | 1 -
arch/arm/configs/cam60_defconfig | 1 -
arch/arm/configs/corgi_defconfig | 1 -
arch/arm/configs/ep93xx_defconfig | 1 -
arch/arm/configs/mini2440_defconfig | 1 -
arch/arm/configs/mv78xx0_defconfig | 1 -
arch/arm/configs/nhk8815_defconfig | 1 -
arch/arm/configs/orion5x_defconfig | 1 -
arch/arm/configs/pxa3xx_defconfig | 1 -
arch/arm/configs/spitz_defconfig | 1 -
arch/blackfin/configs/BF561-ACVILON_defconfig | 1 -
arch/mips/configs/rb532_defconfig | 1 -
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig | 1 -
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig | 1 -
arch/powerpc/configs/mpc83xx_defconfig | 1 -
15 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/arm/configs/bcmring_defconfig b/arch/arm/configs/bcmring_defconfig
index 9e6a8fe..6c389d9 100644
--- a/arch/arm/configs/bcmring_defconfig
+++ b/arch/arm/configs/bcmring_defconfig
@@ -44,7 +44,6 @@ CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_GEOMETRY=y
# CONFIG_MTD_CFI_I2 is not set
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_BCM_UMI=y
CONFIG_MTD_NAND_BCM_UMI_HWCS=y
# CONFIG_MISC_DEVICES is not set
diff --git a/arch/arm/configs/cam60_defconfig b/arch/arm/configs/cam60_defconfig
index cedc92e..1457971 100644
--- a/arch/arm/configs/cam60_defconfig
+++ b/arch/arm/configs/cam60_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
CONFIG_MTD_PLATRAM=m
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_ATMEL=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
diff --git a/arch/arm/configs/corgi_defconfig b/arch/arm/configs/corgi_defconfig
index e53c475..4b8a25d 100644
--- a/arch/arm/configs/corgi_defconfig
+++ b/arch/arm/configs/corgi_defconfig
@@ -97,7 +97,6 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_ROM=y
CONFIG_MTD_COMPLEX_MAPPINGS=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_SHARPSL=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_IDE=y
diff --git a/arch/arm/configs/ep93xx_defconfig b/arch/arm/configs/ep93xx_defconfig
index 8e97b2f..806005a 100644
--- a/arch/arm/configs/ep93xx_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -61,7 +61,6 @@ CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_ROM=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_BLK_DEV_NBD=y
CONFIG_EEPROM_LEGACY=y
CONFIG_SCSI=y
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig
index 082175c..00630e6 100644
--- a/arch/arm/configs/mini2440_defconfig
+++ b/arch/arm/configs/mini2440_defconfig
@@ -102,7 +102,6 @@ CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_RAM=y
CONFIG_MTD_ROM=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_S3C2410=y
CONFIG_MTD_NAND_PLATFORM=y
CONFIG_MTD_LPDDR=y
diff --git a/arch/arm/configs/mv78xx0_defconfig b/arch/arm/configs/mv78xx0_defconfig
index 7305ebd..1f08219 100644
--- a/arch/arm/configs/mv78xx0_defconfig
+++ b/arch/arm/configs/mv78xx0_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_ORION=y
CONFIG_BLK_DEV_LOOP=y
# CONFIG_SCSI_PROC_FS is not set
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig
index bf123c5..240b25e 100644
--- a/arch/arm/configs/nhk8815_defconfig
+++ b/arch/arm/configs/nhk8815_defconfig
@@ -57,7 +57,6 @@ CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ECC_SMC=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_NOMADIK=y
CONFIG_MTD_ONENAND=y
CONFIG_MTD_ONENAND_VERIFY_WRITE=y
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index a288d70..cd5e6ba 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -72,7 +72,6 @@ CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_PLATFORM=y
CONFIG_MTD_NAND_ORION=y
CONFIG_BLK_DEV_LOOP=y
diff --git a/arch/arm/configs/pxa3xx_defconfig b/arch/arm/configs/pxa3xx_defconfig
index 1677a06..60e3138 100644
--- a/arch/arm/configs/pxa3xx_defconfig
+++ b/arch/arm/configs/pxa3xx_defconfig
@@ -36,7 +36,6 @@ CONFIG_MTD_CONCAT=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_PXA3xx=y
CONFIG_MTD_NAND_PXA3xx_BUILTIN=y
CONFIG_MTD_ONENAND=y
diff --git a/arch/arm/configs/spitz_defconfig b/arch/arm/configs/spitz_defconfig
index 7015827..df77931 100644
--- a/arch/arm/configs/spitz_defconfig
+++ b/arch/arm/configs/spitz_defconfig
@@ -94,7 +94,6 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_ROM=y
CONFIG_MTD_COMPLEX_MAPPINGS=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_SHARPSL=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_IDE=y
diff --git a/arch/blackfin/configs/BF561-ACVILON_defconfig b/arch/blackfin/configs/BF561-ACVILON_defconfig
index 0fdc4ec..9198837 100644
--- a/arch/blackfin/configs/BF561-ACVILON_defconfig
+++ b/arch/blackfin/configs/BF561-ACVILON_defconfig
@@ -57,7 +57,6 @@ CONFIG_MTD_PLATRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_PLATFORM=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
diff --git a/arch/mips/configs/rb532_defconfig b/arch/mips/configs/rb532_defconfig
index 55902d9..b85b121 100644
--- a/arch/mips/configs/rb532_defconfig
+++ b/arch/mips/configs/rb532_defconfig
@@ -119,7 +119,6 @@ CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_PLATFORM=y
CONFIG_ATA=y
# CONFIG_ATA_VERBOSE_ERROR is not set
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index 126ef1b..e4ad2e2 100644
--- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
@@ -38,7 +38,6 @@ CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_FSL_ELBC=y
CONFIG_PROC_DEVICETREE=y
CONFIG_BLK_DEV_LOOP=y
diff --git a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
index abcf00a..34ff568 100644
--- a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
@@ -37,7 +37,6 @@ CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_PROC_DEVICETREE=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
diff --git a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig
index 5aac9a8..f6fc66c 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_defconfig
@@ -52,7 +52,6 @@ CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
CONFIG_MTD_NAND_FSL_ELBC=y
CONFIG_PROC_DEVICETREE=y
CONFIG_BLK_DEV_LOOP=y
--
1.7.0.4
^ permalink raw reply related
* [PATCH V7 1/3] powerpc/pci: Make sure ISA IO base is not zero
From: Jia Hongtao @ 2012-08-15 8:57 UTC (permalink / raw)
To: linuxppc-dev, galak, benh; +Cc: B07421, b38951
In-Reply-To: <1345021026-10886-1-git-send-email-B38951@freescale.com>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Some platforms like QEMU treat 0 as an invalid address for ISA IO base.
So we make sure that ISA IO base will never be zero. By functionality this
is equivalent to assgin the first pci bus detected as a primary bus.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
---
arch/powerpc/kernel/pci-common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 0f75bd5..2a09aa5 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -734,7 +734,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
hose->io_base_virt = ioremap(cpu_addr, size);
/* Expect trouble if pci_addr is not 0 */
- if (primary)
+ if (primary || !isa_io_base)
isa_io_base =
(unsigned long)hose->io_base_virt;
#endif /* CONFIG_PPC32 */
--
1.7.5.1
^ permalink raw reply related
* [PATCH V7 2/3] powerpc/ge_imp3a: Add ISA node to PCI primary bus
From: Jia Hongtao @ 2012-08-15 8:57 UTC (permalink / raw)
To: linuxppc-dev, galak, benh; +Cc: B07421, b38951
In-Reply-To: <1345021026-10886-1-git-send-email-B38951@freescale.com>
PCI primary bus will be determined by looking for ISA node in device tree.
Also for board ge_imp3a primary bus is the second PCI controller detected.
So we add ISA node to ge_imp3a's device tree to fit the new determination.
Adding ISA node to other boards' device tree is not necessary. The situation
that the first bus is primary have already been handled. Please refer to the
following patch:
powerpc/pci: Make sure ISA IO base is not zero
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
arch/powerpc/boot/dts/ge_imp3a.dts | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/ge_imp3a.dts b/arch/powerpc/boot/dts/ge_imp3a.dts
index fefae41..aa2c4b5 100644
--- a/arch/powerpc/boot/dts/ge_imp3a.dts
+++ b/arch/powerpc/boot/dts/ge_imp3a.dts
@@ -248,6 +248,10 @@
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x10000>;
+
+ isa@1e {
+ device_type = "isa";
+ };
};
};
};
--
1.7.5.1
^ permalink raw reply related
* [PATCH V7 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
From: Jia Hongtao @ 2012-08-15 8:57 UTC (permalink / raw)
To: linuxppc-dev, galak, benh; +Cc: B07421, b38951
In-Reply-To: <1345021026-10886-1-git-send-email-B38951@freescale.com>
We unified the Freescale pci/pcie initialization by changing the fsl_pci
to a platform driver. In previous PCI code architecture the initialization
routine is called at board_setup_arch stage. Now the initialization is done
in probe function which is architectural better. Also It's convenient for
adding PM support for PCI controller in later patch.
We also change the way of determining primary bus for fitting platform
driver. Two previous patches are the preparation for this.
Now we registered pci controllers as platform devices. So we combine two
initialization code as one platform driver.
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
---
Changes for V7:
- Separate V6 to three functional independent patches.
arch/powerpc/platforms/85xx/common.c | 10 +++
arch/powerpc/platforms/85xx/corenet_ds.c | 31 +--------
arch/powerpc/platforms/85xx/ge_imp3a.c | 48 +------------
arch/powerpc/platforms/85xx/mpc8536_ds.c | 36 +---------
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 9 +--
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 14 +----
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 38 ++--------
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 38 +---------
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 28 +++-----
arch/powerpc/platforms/85xx/p1010rdb.c | 14 +----
arch/powerpc/platforms/85xx/p1022_ds.c | 34 +---------
arch/powerpc/platforms/85xx/p1022_rdk.c | 34 +---------
arch/powerpc/platforms/85xx/p1023_rds.c | 7 +--
arch/powerpc/platforms/85xx/p2041_rdb.c | 2 +-
arch/powerpc/platforms/85xx/p3041_ds.c | 2 +-
arch/powerpc/platforms/85xx/p4080_ds.c | 2 +-
arch/powerpc/platforms/85xx/p5020_ds.c | 2 +-
arch/powerpc/platforms/85xx/p5040_ds.c | 2 +-
arch/powerpc/platforms/85xx/qemu_e500.c | 3 +-
arch/powerpc/platforms/85xx/sbc8548.c | 19 +-----
arch/powerpc/platforms/85xx/socrates.c | 11 +---
arch/powerpc/platforms/85xx/stx_gp3.c | 11 +---
arch/powerpc/platforms/85xx/tqm85xx.c | 21 +------
arch/powerpc/platforms/85xx/xes_mpc85xx.c | 54 ++-------------
arch/powerpc/platforms/86xx/gef_ppc9a.c | 10 +--
arch/powerpc/platforms/86xx/gef_sbc310.c | 11 +---
arch/powerpc/platforms/86xx/gef_sbc610.c | 10 +--
arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 19 +----
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 40 +----------
arch/powerpc/platforms/86xx/sbc8641d.c | 12 +---
arch/powerpc/sysdev/fsl_pci.c | 102 +++++++++++++++++-----------
arch/powerpc/sysdev/fsl_pci.h | 9 ++-
drivers/edac/mpc85xx_edac.c | 43 +++---------
33 files changed, 160 insertions(+), 566 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
index 67dac22..d0861a0 100644
--- a/arch/powerpc/platforms/85xx/common.c
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -27,6 +27,16 @@ static struct of_device_id __initdata mpc85xx_common_ids[] = {
{ .compatible = "fsl,mpc8548-guts", },
/* Probably unnecessary? */
{ .compatible = "gpio-leds", },
+ /* For all PCI controllers */
+ { .compatible = "fsl,mpc8540-pci", },
+ { .compatible = "fsl,mpc8548-pcie", },
+ { .compatible = "fsl,p1022-pcie", },
+ { .compatible = "fsl,p1010-pcie", },
+ { .compatible = "fsl,p1023-pcie", },
+ { .compatible = "fsl,p4080-pcie", },
+ { .compatible = "fsl,qoriq-pcie-v2.4", },
+ { .compatible = "fsl,qoriq-pcie-v2.3", },
+ { .compatible = "fsl,qoriq-pcie-v2.2", },
{},
};
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index 473d573..84b9d86 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -16,7 +16,6 @@
#include <linux/kdev_t.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
-#include <linux/memblock.h>
#include <asm/time.h>
#include <asm/machdep.h>
@@ -52,39 +51,13 @@ void __init corenet_ds_pic_init(void)
*/
void __init corenet_ds_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
- struct pci_controller *hose;
-#endif
- dma_addr_t max = 0xffffffff;
-
mpc85xx_smp_init();
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,p4080-pcie") ||
- of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2") ||
- of_device_is_compatible(np, "fsl,qoriq-pcie-v2.3") ||
- of_device_is_compatible(np, "fsl,qoriq-pcie-v2.4")) {
- fsl_add_bridge(np, 0);
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
- }
-
-#ifdef CONFIG_PPC64
+#if defined(CONFIG_PCI) && defined(CONFIG_PPC64)
pci_devs_phb_init();
#endif
-#endif
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
}
diff --git a/arch/powerpc/platforms/85xx/ge_imp3a.c b/arch/powerpc/platforms/85xx/ge_imp3a.c
index b6a728b..0483337 100644
--- a/arch/powerpc/platforms/85xx/ge_imp3a.c
+++ b/arch/powerpc/platforms/85xx/ge_imp3a.c
@@ -22,7 +22,6 @@
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
-#include <linux/memblock.h>
#include <asm/time.h>
#include <asm/machdep.h>
@@ -84,53 +83,19 @@ void __init ge_imp3a_pic_init(void)
of_node_put(cascade_node);
}
-#ifdef CONFIG_PCI
-static int primary_phb_addr;
-#endif /* CONFIG_PCI */
-
/*
* Setup the architecture
*/
static void __init ge_imp3a_setup_arch(void)
{
struct device_node *regs;
-#ifdef CONFIG_PCI
- struct device_node *np;
- struct pci_controller *hose;
-#endif
- dma_addr_t max = 0xffffffff;
if (ppc_md.progress)
ppc_md.progress("ge_imp3a_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
- of_device_is_compatible(np, "fsl,p2020-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == primary_phb_addr)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
-
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
- }
-#endif
-
mpc85xx_smp_init();
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
/* Remap basic board registers */
regs = of_find_compatible_node(NULL, NULL, "ge,imp3a-fpga-regs");
@@ -215,17 +180,10 @@ static int __init ge_imp3a_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (of_flat_dt_is_compatible(root, "ge,IMP3A")) {
-#ifdef CONFIG_PCI
- primary_phb_addr = 0x9000;
-#endif
- return 1;
- }
-
- return 0;
+ return of_flat_dt_is_compatible(root, "ge,IMP3A");
}
-machine_device_initcall(ge_imp3a, mpc85xx_common_publish_devices);
+machine_arch_initcall(ge_imp3a, mpc85xx_common_publish_devices);
machine_arch_initcall(ge_imp3a, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index 767c7cf..9bac2c2 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -17,7 +17,6 @@
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
-#include <linux/memblock.h>
#include <asm/time.h>
#include <asm/machdep.h>
@@ -46,46 +45,15 @@ void __init mpc8536_ds_pic_init(void)
*/
static void __init mpc8536_ds_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
- struct pci_controller *hose;
-#endif
- dma_addr_t max = 0xffffffff;
-
if (ppc_md.progress)
ppc_md.progress("mpc8536_ds_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
-
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
- }
-
-#endif
-
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
printk("MPC8536 DS board from Freescale Semiconductor\n");
}
-machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 29ee8fc..ae3ab48 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -137,10 +137,6 @@ static void __init init_ioports(void)
static void __init mpc85xx_ads_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
@@ -150,9 +146,6 @@ static void __init mpc85xx_ads_setup_arch(void)
#endif
#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
- fsl_add_bridge(np, 1);
-
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
@@ -173,7 +166,7 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 11156fb..7b77b7cb 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -309,18 +309,6 @@ static void __init mpc85xx_cds_setup_arch(void)
}
#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
- }
- }
-
ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
@@ -355,7 +343,7 @@ static int __init mpc85xx_cds_probe(void)
return of_flat_dt_is_compatible(root, "MPC85xxCDS");
}
-machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
define_machine(mpc85xx_cds) {
.name = "MPC85xx CDS",
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 56f8c8f..f378253 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -20,7 +20,6 @@
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
-#include <linux/memblock.h>
#include <asm/time.h>
#include <asm/machdep.h>
@@ -117,40 +116,16 @@ void __init mpc85xx_ds_pic_init(void)
extern int uli_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn);
-static struct device_node *pci_with_uli;
-
static int mpc85xx_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn)
{
- if (hose->dn == pci_with_uli)
+ if (hose->dn == fsl_pci_primary)
return uli_exclude_device(hose, bus, devfn);
return PCIBIOS_SUCCESSFUL;
}
#endif /* CONFIG_PCI */
-static void __init mpc85xx_ds_pci_init(void)
-{
-#ifdef CONFIG_PCI
- struct device_node *node;
-
- fsl_pci_init();
-
- /* See if we have a ULI under the primary */
-
- node = of_find_node_by_name(NULL, "uli1575");
- while ((pci_with_uli = of_get_parent(node))) {
- of_node_put(node);
- node = pci_with_uli;
-
- if (pci_with_uli == fsl_pci_primary) {
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
- break;
- }
- }
-#endif
-}
-
/*
* Setup the architecture
*/
@@ -159,8 +134,11 @@ static void __init mpc85xx_ds_setup_arch(void)
if (ppc_md.progress)
ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
+#ifdef CONFIG_PCI
+ ppc_md.pci_exclude_device = mpc85xx_exclude_device;
+#endif
+
swiotlb_detect_4g();
- mpc85xx_ds_pci_init();
mpc85xx_smp_init();
printk("MPC85xx DS board from Freescale Semiconductor\n");
@@ -176,9 +154,9 @@ static int __init mpc8544_ds_probe(void)
return !!of_flat_dt_is_compatible(root, "MPC8544DS");
}
-machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
-machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
-machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
+machine_arch_initcall(p2020_ds, mpc85xx_common_publish_devices);
machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 8e4b094..555b106 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -327,44 +327,14 @@ static void __init mpc85xx_mds_qeic_init(void) { }
static void __init mpc85xx_mds_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct pci_controller *hose;
- struct device_node *np;
-#endif
- dma_addr_t max = 0xffffffff;
-
if (ppc_md.progress)
ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
-
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
- }
-#endif
-
mpc85xx_smp_init();
mpc85xx_mds_qe_init();
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
}
@@ -409,9 +379,9 @@ static int __init mpc85xx_publish_devices(void)
return mpc85xx_common_publish_devices();
}
-machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
-machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
-machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc8568_mds, mpc85xx_publish_devices);
+machine_arch_initcall(mpc8569_mds, mpc85xx_publish_devices);
+machine_arch_initcall(p1021_mds, mpc85xx_common_publish_devices);
machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier);
machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index 1910fdc..f4a0b7a 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -86,21 +86,13 @@ void __init mpc85xx_rdb_pic_init(void)
*/
static void __init mpc85xx_rdb_setup_arch(void)
{
-#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
+#ifdef CONFIG_QUICC_ENGINE
struct device_node *np;
#endif
if (ppc_md.progress)
ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8548-pcie"))
- fsl_add_bridge(np, 0);
- }
-
-#endif
-
mpc85xx_smp_init();
#ifdef CONFIG_QUICC_ENGINE
@@ -161,15 +153,15 @@ qe_fail:
printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
}
-machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices);
-machine_device_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
-machine_device_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
-machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices);
-machine_device_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices);
-machine_device_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
-machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
-machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices);
-machine_device_initcall(p1024_rdb, mpc85xx_common_publish_devices);
+machine_arch_initcall(p2020_rdb, mpc85xx_common_publish_devices);
+machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1025_rdb, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1024_rdb, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index dbaf443..a893bf1 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -46,25 +46,13 @@ void __init p1010_rdb_pic_init(void)
*/
static void __init p1010_rdb_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("p1010_rdb_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,p1010-pcie"))
- fsl_add_bridge(np, 0);
- }
-
-#endif
-
printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
}
-machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1010_rdb, mpc85xx_common_publish_devices);
machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
/*
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 3c732ac..a32efb9 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -18,7 +18,6 @@
#include <linux/pci.h>
#include <linux/of_platform.h>
-#include <linux/memblock.h>
#include <asm/div64.h>
#include <asm/mpic.h>
#include <asm/swiotlb.h>
@@ -507,32 +506,9 @@ early_param("video", early_video_setup);
*/
static void __init p1022_ds_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
- dma_addr_t max = 0xffffffff;
-
if (ppc_md.progress)
ppc_md.progress("p1022_ds_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,p1022-pcie") {
- struct resource rsrc;
- struct pci_controller *hose;
-
- of_address_to_resource(np, 0, &rsrc);
-
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
-
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
-#endif
-
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
diu_ops.get_pixel_format = p1022ds_get_pixel_format;
diu_ops.set_gamma_table = p1022ds_set_gamma_table;
@@ -601,18 +577,12 @@ static void __init p1022_ds_setup_arch(void)
mpc85xx_smp_init();
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
pr_info("Freescale P1022 DS reference board\n");
}
-machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1022_ds, mpc85xx_common_publish_devices);
machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/p1022_rdk.c b/arch/powerpc/platforms/85xx/p1022_rdk.c
index b3cf11b..4d328aa 100644
--- a/arch/powerpc/platforms/85xx/p1022_rdk.c
+++ b/arch/powerpc/platforms/85xx/p1022_rdk.c
@@ -14,7 +14,6 @@
#include <linux/pci.h>
#include <linux/of_platform.h>
-#include <linux/memblock.h>
#include <asm/div64.h>
#include <asm/mpic.h>
#include <asm/swiotlb.h>
@@ -121,32 +120,9 @@ void __init p1022_rdk_pic_init(void)
*/
static void __init p1022_rdk_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
- dma_addr_t max = 0xffffffff;
-
if (ppc_md.progress)
ppc_md.progress("p1022_rdk_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,p1022-pcie") {
- struct resource rsrc;
- struct pci_controller *hose;
-
- of_address_to_resource(np, 0, &rsrc);
-
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
-
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
-#endif
-
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
diu_ops.set_monitor_port = p1022rdk_set_monitor_port;
diu_ops.set_pixel_clock = p1022rdk_set_pixel_clock;
@@ -155,18 +131,12 @@ static void __init p1022_rdk_setup_arch(void)
mpc85xx_smp_init();
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
pr_info("Freescale / iVeia P1022 RDK reference board\n");
}
-machine_device_initcall(p1022_rdk, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1022_rdk, mpc85xx_common_publish_devices);
machine_arch_initcall(p1022_rdk, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 2990e8b..606eff9 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -80,15 +80,10 @@ static void __init mpc85xx_rds_setup_arch(void)
}
}
-#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,p1023-pcie")
- fsl_add_bridge(np, 0);
-#endif
-
mpc85xx_smp_init();
}
-machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1023_rds, mpc85xx_common_publish_devices);
static void __init mpc85xx_rds_pic_init(void)
{
diff --git a/arch/powerpc/platforms/85xx/p2041_rdb.c b/arch/powerpc/platforms/85xx/p2041_rdb.c
index 6541fa2..000c089 100644
--- a/arch/powerpc/platforms/85xx/p2041_rdb.c
+++ b/arch/powerpc/platforms/85xx/p2041_rdb.c
@@ -80,7 +80,7 @@ define_machine(p2041_rdb) {
.power_save = e500_idle,
};
-machine_device_initcall(p2041_rdb, corenet_ds_publish_devices);
+machine_arch_initcall(p2041_rdb, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
machine_arch_initcall(p2041_rdb, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
index f238efa..b3edc20 100644
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ b/arch/powerpc/platforms/85xx/p3041_ds.c
@@ -82,7 +82,7 @@ define_machine(p3041_ds) {
.power_save = e500_idle,
};
-machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
+machine_arch_initcall(p3041_ds, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
machine_arch_initcall(p3041_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/p4080_ds.c
index c92417d..54df106 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/p4080_ds.c
@@ -81,7 +81,7 @@ define_machine(p4080_ds) {
.power_save = e500_idle,
};
-machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
+machine_arch_initcall(p4080_ds, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);
#endif
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c
index 17bef15..753a42c 100644
--- a/arch/powerpc/platforms/85xx/p5020_ds.c
+++ b/arch/powerpc/platforms/85xx/p5020_ds.c
@@ -91,7 +91,7 @@ define_machine(p5020_ds) {
#endif
};
-machine_device_initcall(p5020_ds, corenet_ds_publish_devices);
+machine_arch_initcall(p5020_ds, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
machine_arch_initcall(p5020_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/p5040_ds.c b/arch/powerpc/platforms/85xx/p5040_ds.c
index 8e22a34..1138185 100644
--- a/arch/powerpc/platforms/85xx/p5040_ds.c
+++ b/arch/powerpc/platforms/85xx/p5040_ds.c
@@ -82,7 +82,7 @@ define_machine(p5040_ds) {
#endif
};
-machine_device_initcall(p5040_ds, corenet_ds_publish_devices);
+machine_arch_initcall(p5040_ds, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
machine_arch_initcall(p5040_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c
index 3c5490c..b3f27c5 100644
--- a/arch/powerpc/platforms/85xx/qemu_e500.c
+++ b/arch/powerpc/platforms/85xx/qemu_e500.c
@@ -41,7 +41,6 @@ static void __init qemu_e500_setup_arch(void)
{
ppc_md.progress("qemu_e500_setup_arch()", 0);
- fsl_pci_init();
swiotlb_detect_4g();
mpc85xx_smp_init();
}
@@ -56,7 +55,7 @@ static int __init qemu_e500_probe(void)
return !!of_flat_dt_is_compatible(root, "fsl,qemu-e500");
}
-machine_device_initcall(qemu_e500, mpc85xx_common_publish_devices);
+machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices);
define_machine(qemu_e500) {
.name = "QEMU e500",
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index cd3a66b..2825a62 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -88,26 +88,9 @@ static int __init sbc8548_hw_rev(void)
*/
static void __init sbc8548_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("sbc8548_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
- }
- }
-#endif
sbc_rev = sbc8548_hw_rev();
}
@@ -128,7 +111,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-machine_device_initcall(sbc8548, mpc85xx_common_publish_devices);
+machine_arch_initcall(sbc8548, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index b9c6daa..381463e 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -66,20 +66,11 @@ static void __init socrates_pic_init(void)
*/
static void __init socrates_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("socrates_setup_arch()", 0);
-
-#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
- fsl_add_bridge(np, 1);
-#endif
}
-machine_device_initcall(socrates, mpc85xx_common_publish_devices);
+machine_arch_initcall(socrates, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index e050800..bb1b1a7 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -60,21 +60,12 @@ static void __init stx_gp3_pic_init(void)
*/
static void __init stx_gp3_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("stx_gp3_setup_arch()", 0);
#ifdef CONFIG_CPM2
cpm2_reset();
#endif
-
-#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
- fsl_add_bridge(np, 1);
-#endif
}
static void stx_gp3_show_cpuinfo(struct seq_file *m)
@@ -93,7 +84,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}
-machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices);
+machine_arch_initcall(stx_gp3, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 4d786c2..c8ef526 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -59,31 +59,12 @@ static void __init tqm85xx_pic_init(void)
*/
static void __init tqm85xx_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("tqm85xx_setup_arch()", 0);
#ifdef CONFIG_CPM2
cpm2_reset();
#endif
-
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
- struct resource rsrc;
- if (!of_address_to_resource(np, 0, &rsrc)) {
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
- }
- }
- }
-#endif
}
static void tqm85xx_show_cpuinfo(struct seq_file *m)
@@ -123,7 +104,7 @@ static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
tqm85xx_ti1520_fixup);
-machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices);
+machine_arch_initcall(tqm85xx, mpc85xx_common_publish_devices);
static const char *board[] __initdata = {
"tqc,tqm8540",
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index 41c6875..7c9cf6b 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -111,18 +111,11 @@ static void xes_mpc85xx_fixups(void)
}
}
-#ifdef CONFIG_PCI
-static int primary_phb_addr;
-#endif
-
/*
* Setup the architecture
*/
static void __init xes_mpc85xx_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
struct device_node *root;
const char *model = "Unknown";
@@ -137,26 +130,12 @@ static void __init xes_mpc85xx_setup_arch(void)
xes_mpc85xx_fixups();
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
- of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == primary_phb_addr)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
- }
- }
-#endif
-
mpc85xx_smp_init();
}
-machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
-machine_device_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
-machine_device_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
+machine_arch_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
+machine_arch_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
+machine_arch_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
@@ -165,42 +144,21 @@ static int __init xes_mpc8572_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (of_flat_dt_is_compatible(root, "xes,MPC8572")) {
-#ifdef CONFIG_PCI
- primary_phb_addr = 0x8000;
-#endif
- return 1;
- } else {
- return 0;
- }
+ return of_flat_dt_is_compatible(root, "xes,MPC8572");
}
static int __init xes_mpc8548_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (of_flat_dt_is_compatible(root, "xes,MPC8548")) {
-#ifdef CONFIG_PCI
- primary_phb_addr = 0xb000;
-#endif
- return 1;
- } else {
- return 0;
- }
+ return of_flat_dt_is_compatible(root, "xes,MPC8548");
}
static int __init xes_mpc8540_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (of_flat_dt_is_compatible(root, "xes,MPC8540")) {
-#ifdef CONFIG_PCI
- primary_phb_addr = 0xb000;
-#endif
- return 1;
- } else {
- return 0;
- }
+ return of_flat_dt_is_compatible(root, "xes,MPC8540");
}
define_machine(xes_mpc8572) {
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index 1fca663..6c7ddb3 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -73,13 +73,6 @@ static void __init gef_ppc9a_init_irq(void)
static void __init gef_ppc9a_setup_arch(void)
{
struct device_node *regs;
-#ifdef CONFIG_PCI
- struct device_node *np;
-
- for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
- fsl_add_bridge(np, 1);
- }
-#endif
printk(KERN_INFO "GE Intelligent Platforms PPC9A 6U VME SBC\n");
@@ -221,6 +214,7 @@ static long __init mpc86xx_time_init(void)
static __initdata struct of_device_id of_bus_ids[] = {
{ .compatible = "simple-bus", },
{ .compatible = "gianfar", },
+ { .compatible = "fsl,mpc8641-pcie", },
{},
};
@@ -231,7 +225,7 @@ static int __init declare_of_platform_devices(void)
return 0;
}
-machine_device_initcall(gef_ppc9a, declare_of_platform_devices);
+machine_arch_initcall(gef_ppc9a, declare_of_platform_devices);
define_machine(gef_ppc9a) {
.name = "GE PPC9A",
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index 14e0e576..2195ac7 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -73,14 +73,6 @@ static void __init gef_sbc310_init_irq(void)
static void __init gef_sbc310_setup_arch(void)
{
struct device_node *regs;
-#ifdef CONFIG_PCI
- struct device_node *np;
-
- for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
- fsl_add_bridge(np, 1);
- }
-#endif
-
printk(KERN_INFO "GE Intelligent Platforms SBC310 6U VPX SBC\n");
#ifdef CONFIG_SMP
@@ -209,6 +201,7 @@ static long __init mpc86xx_time_init(void)
static __initdata struct of_device_id of_bus_ids[] = {
{ .compatible = "simple-bus", },
{ .compatible = "gianfar", },
+ { .compatible = "fsl,mpc8641-pcie", },
{},
};
@@ -219,7 +212,7 @@ static int __init declare_of_platform_devices(void)
return 0;
}
-machine_device_initcall(gef_sbc310, declare_of_platform_devices);
+machine_arch_initcall(gef_sbc310, declare_of_platform_devices);
define_machine(gef_sbc310) {
.name = "GE SBC310",
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 1638f43..52fd6d7 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -73,13 +73,6 @@ static void __init gef_sbc610_init_irq(void)
static void __init gef_sbc610_setup_arch(void)
{
struct device_node *regs;
-#ifdef CONFIG_PCI
- struct device_node *np;
-
- for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
- fsl_add_bridge(np, 1);
- }
-#endif
printk(KERN_INFO "GE Intelligent Platforms SBC610 6U VPX SBC\n");
@@ -198,6 +191,7 @@ static long __init mpc86xx_time_init(void)
static __initdata struct of_device_id of_bus_ids[] = {
{ .compatible = "simple-bus", },
{ .compatible = "gianfar", },
+ { .compatible = "fsl,mpc8641-pcie", },
{},
};
@@ -208,7 +202,7 @@ static int __init declare_of_platform_devices(void)
return 0;
}
-machine_device_initcall(gef_sbc610, declare_of_platform_devices);
+machine_arch_initcall(gef_sbc610, declare_of_platform_devices);
define_machine(gef_sbc610) {
.name = "GE SBC610",
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index 62cd3c5..a8229f3 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -91,6 +91,9 @@ static struct of_device_id __initdata mpc8610_ids[] = {
{ .compatible = "simple-bus", },
/* So that the DMA channel nodes can be probed individually: */
{ .compatible = "fsl,eloplus-dma", },
+ /* PCI controllers */
+ { .compatible = "fsl,mpc8610-pci", },
+ { .compatible = "fsl,mpc8641-pcie", },
{}
};
@@ -107,7 +110,7 @@ static int __init mpc8610_declare_of_platform_devices(void)
return 0;
}
-machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
+machine_arch_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
@@ -278,25 +281,11 @@ mpc8610hpcd_valid_monitor_port(enum fsl_diu_monitor_port port)
static void __init mpc86xx_hpcd_setup_arch(void)
{
struct resource r;
- struct device_node *np;
unsigned char *pixis;
if (ppc_md.progress)
ppc_md.progress("mpc86xx_hpcd_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_node_by_type(np, "pci") {
- if (of_device_is_compatible(np, "fsl,mpc8610-pci")
- || of_device_is_compatible(np, "fsl,mpc8641-pcie")) {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == 0xa000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
- }
- }
-#endif
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
diu_ops.get_pixel_format = mpc8610hpcd_get_pixel_format;
diu_ops.set_gamma_table = mpc8610hpcd_set_gamma_table;
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 817245b..182cbe6 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -19,7 +19,6 @@
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <linux/of_platform.h>
-#include <linux/memblock.h>
#include <asm/time.h>
#include <asm/machdep.h>
@@ -51,15 +50,8 @@ extern int uli_exclude_device(struct pci_controller *hose,
static int mpc86xx_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn)
{
- struct device_node* node;
- struct resource rsrc;
-
- node = hose->dn;
- of_address_to_resource(node, 0, &rsrc);
-
- if ((rsrc.start & 0xfffff) == 0x8000) {
+ if (hose->dn == fsl_pci_primary)
return uli_exclude_device(hose, bus, devfn);
- }
return PCIBIOS_SUCCESSFUL;
}
@@ -69,30 +61,11 @@ static int mpc86xx_exclude_device(struct pci_controller *hose,
static void __init
mpc86xx_hpcn_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
- struct pci_controller *hose;
-#endif
- dma_addr_t max = 0xffffffff;
-
if (ppc_md.progress)
ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
- struct resource rsrc;
- of_address_to_resource(np, 0, &rsrc);
- if ((rsrc.start & 0xfffff) == 0x8000)
- fsl_add_bridge(np, 1);
- else
- fsl_add_bridge(np, 0);
- hose = pci_find_hose_for_OF_device(np);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
-
ppc_md.pci_exclude_device = mpc86xx_exclude_device;
-
#endif
printk("MPC86xx HPCN board from Freescale Semiconductor\n");
@@ -101,13 +74,7 @@ mpc86xx_hpcn_setup_arch(void)
mpc86xx_smp_init();
#endif
-#ifdef CONFIG_SWIOTLB
- if ((memblock_end_of_DRAM() - 1) > max) {
- ppc_swiotlb_enable = 1;
- set_pci_dma_ops(&swiotlb_dma_ops);
- ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
- }
-#endif
+ swiotlb_detect_4g();
}
@@ -162,6 +129,7 @@ static __initdata struct of_device_id of_bus_ids[] = {
{ .compatible = "simple-bus", },
{ .compatible = "fsl,srio", },
{ .compatible = "gianfar", },
+ { .compatible = "fsl,mpc8641-pcie", },
{},
};
@@ -171,7 +139,7 @@ static int __init declare_of_platform_devices(void)
return 0;
}
-machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices);
+machine_arch_initcall(mpc86xx_hpcn, declare_of_platform_devices);
machine_arch_initcall(mpc86xx_hpcn, swiotlb_setup_bus_notifier);
define_machine(mpc86xx_hpcn) {
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index e7007d0..52afebf 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -38,18 +38,9 @@
static void __init
sbc8641_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("sbc8641_setup_arch()", 0);
-#ifdef CONFIG_PCI
- for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie")
- fsl_add_bridge(np, 0);
-#endif
-
printk("SBC8641 board from Wind River\n");
#ifdef CONFIG_SMP
@@ -102,6 +93,7 @@ mpc86xx_time_init(void)
static __initdata struct of_device_id of_bus_ids[] = {
{ .compatible = "simple-bus", },
{ .compatible = "gianfar", },
+ { .compatible = "fsl,mpc8641-pcie", },
{},
};
@@ -111,7 +103,7 @@ static int __init declare_of_platform_devices(void)
return 0;
}
-machine_device_initcall(sbc8641, declare_of_platform_devices);
+machine_arch_initcall(sbc8641, declare_of_platform_devices);
define_machine(sbc8641) {
.name = "SBC8641D",
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index da7a3d7..6408d9d 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -826,54 +826,78 @@ static const struct of_device_id pci_ids[] = {
struct device_node *fsl_pci_primary;
-void __devinit fsl_pci_init(void)
+/* Checkout if PCI contains ISA node */
+static int of_pci_has_isa(struct device_node *pci_node)
+{
+ struct device_node *np;
+ int ret = 0;
+
+ if (!pci_node)
+ return 0;
+
+ read_lock(&devtree_lock);
+ np = pci_node->allnext;
+
+ /* Only scan the children of PCI node */
+ for (; np != pci_node->sibling; np = np->allnext) {
+ if (np->type && (of_node_cmp(np->type, "isa") == 0)
+ && of_node_get(np)) {
+ ret = 1;
+ break;
+ }
+ }
+
+ of_node_put(pci_node);
+ read_unlock(&devtree_lock);
+
+ return ret;
+}
+
+static int __devinit fsl_pci_probe(struct platform_device *pdev)
{
int ret;
- struct device_node *node;
struct pci_controller *hose;
- dma_addr_t max = 0xffffffff;
+ int is_primary = 0;
- /* Callers can specify the primary bus using other means. */
if (!fsl_pci_primary) {
- /* If a PCI host bridge contains an ISA node, it's primary. */
- node = of_find_node_by_type(NULL, "isa");
- while ((fsl_pci_primary = of_get_parent(node))) {
- of_node_put(node);
- node = fsl_pci_primary;
-
- if (of_match_node(pci_ids, node))
- break;
- }
+ is_primary = of_pci_has_isa(pdev->dev.of_node);
+ if (is_primary)
+ fsl_pci_primary = pdev->dev.of_node;
}
- node = NULL;
- for_each_node_by_type(node, "pci") {
- if (of_match_node(pci_ids, node)) {
- /*
- * If there's no PCI host bridge with ISA, arbitrarily
- * designate one as primary. This can go away once
- * various bugs with primary-less systems are fixed.
- */
- if (!fsl_pci_primary)
- fsl_pci_primary = node;
-
- ret = fsl_add_bridge(node, fsl_pci_primary == node);
- if (ret == 0) {
- hose = pci_find_hose_for_OF_device(node);
- max = min(max, hose->dma_window_base_cur +
- hose->dma_window_size);
- }
- }
- }
+ ret = fsl_add_bridge(pdev->dev.of_node, is_primary);
#ifdef CONFIG_SWIOTLB
- /*
- * if we couldn't map all of DRAM via the dma windows
- * we need SWIOTLB to handle buffers located outside of
- * dma capable memory region
- */
- if (memblock_end_of_DRAM() - 1 > max)
- ppc_swiotlb_enable = 1;
+ if (ret == 0) {
+ hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+
+ /*
+ * if we couldn't map all of DRAM via the dma windows
+ * we need SWIOTLB to handle buffers located outside of
+ * dma capable memory region
+ */
+ if (memblock_end_of_DRAM() - 1 > hose->dma_window_base_cur +
+ hose->dma_window_size)
+ ppc_swiotlb_enable = 1;
+ }
#endif
+
+ mpc85xx_pci_err_probe(pdev);
+
+ return 0;
+}
+
+static struct platform_driver fsl_pci_driver = {
+ .driver = {
+ .name = "fsl-pci",
+ .of_match_table = pci_ids,
+ },
+ .probe = fsl_pci_probe,
+};
+
+static int __init fsl_pci_init(void)
+{
+ return platform_driver_register(&fsl_pci_driver);
}
+arch_initcall(fsl_pci_init);
#endif
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index baa0fd1..ad54147 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -95,10 +95,13 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose);
extern struct device_node *fsl_pci_primary;
-#ifdef CONFIG_FSL_PCI
-void fsl_pci_init(void);
+#ifdef CONFIG_EDAC_MPC85XX
+int mpc85xx_pci_err_probe(struct platform_device *op);
#else
-static inline void fsl_pci_init(void) {}
+static inline int mpc85xx_pci_err_probe(struct platform_device *op)
+{
+ return -ENOTSUPP;
+}
#endif
#endif /* __POWERPC_FSL_PCI_H */
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 0e37462..2677883 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -200,7 +200,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
+int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
{
struct edac_pci_ctl_info *pci;
struct mpc85xx_pci_pdata *pdata;
@@ -214,6 +214,16 @@ static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
if (!pci)
return -ENOMEM;
+ /* make sure error reporting method is sane */
+ switch (edac_op_state) {
+ case EDAC_OPSTATE_POLL:
+ case EDAC_OPSTATE_INT:
+ break;
+ default:
+ edac_op_state = EDAC_OPSTATE_INT;
+ break;
+ }
+
pdata = pci->pvt_info;
pdata->name = "mpc85xx_pci_err";
pdata->irq = NO_IRQ;
@@ -303,6 +313,7 @@ err:
devres_release_group(&op->dev, mpc85xx_pci_err_probe);
return res;
}
+EXPORT_SYMBOL_GPL(mpc85xx_pci_err_probe);
static int mpc85xx_pci_err_remove(struct platform_device *op)
{
@@ -326,27 +337,6 @@ static int mpc85xx_pci_err_remove(struct platform_device *op)
return 0;
}
-static struct of_device_id mpc85xx_pci_err_of_match[] = {
- {
- .compatible = "fsl,mpc8540-pcix",
- },
- {
- .compatible = "fsl,mpc8540-pci",
- },
- {},
-};
-MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
-
-static struct platform_driver mpc85xx_pci_err_driver = {
- .probe = mpc85xx_pci_err_probe,
- .remove = __devexit_p(mpc85xx_pci_err_remove),
- .driver = {
- .name = "mpc85xx_pci_err",
- .owner = THIS_MODULE,
- .of_match_table = mpc85xx_pci_err_of_match,
- },
-};
-
#endif /* CONFIG_PCI */
/**************************** L2 Err device ***************************/
@@ -1193,12 +1183,6 @@ static int __init mpc85xx_mc_init(void)
if (res)
printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n");
-#ifdef CONFIG_PCI
- res = platform_driver_register(&mpc85xx_pci_err_driver);
- if (res)
- printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
-#endif
-
#ifdef CONFIG_FSL_SOC_BOOKE
pvr = mfspr(SPRN_PVR);
@@ -1235,9 +1219,6 @@ static void __exit mpc85xx_mc_exit(void)
on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
}
#endif
-#ifdef CONFIG_PCI
- platform_driver_unregister(&mpc85xx_pci_err_driver);
-#endif
platform_driver_unregister(&mpc85xx_l2_err_driver);
platform_driver_unregister(&mpc85xx_mc_err_driver);
}
--
1.7.5.1
^ permalink raw reply related
* [PATCH V7 0/3] PCI unification patch description
From: Jia Hongtao @ 2012-08-15 8:57 UTC (permalink / raw)
To: linuxppc-dev, galak, benh; +Cc: B07421, b38951
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
In this patch set we unified the Freescale pci/pcie initialization by
changing the fsl_pci to a platform driver.
We also change the way of determining primary bus for fitting platform
driver. The first two patches are the preparation for this.
Thanks to Ben. For the first patch you can refer to the following link:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-June/098586.html
^ permalink raw reply
* RE: [PATCH V5 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
From: Jia Hongtao-B38951 @ 2012-08-15 9:22 UTC (permalink / raw)
To: Wood Scott-B07421
Cc: Gala Kumar-B11780, linuxppc-dev@lists.ozlabs.org, Li Yang-R58472
In-Reply-To: <50253004.3010808@freescale.com>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogU2F0dXJkYXksIEF1Z3VzdCAxMSwgMjAxMiAxMjowMCBBTQ0KPiBUbzogSmlh
IEhvbmd0YW8tQjM4OTUxDQo+IENjOiBHYWxhIEt1bWFyLUIxMTc4MDsgV29vZCBTY290dC1CMDc0
MjE7IExpIFlhbmctUjU4NDcyOyBsaW51eHBwYy0NCj4gZGV2QGxpc3RzLm96bGFicy5vcmcNCj4g
U3ViamVjdDogUmU6IFtQQVRDSCBWNSAzLzNdIHBvd2VycGMvZnNsLXBjaTogVW5pZnkgcGNpL3Bj
aWUNCj4gaW5pdGlhbGl6YXRpb24gY29kZQ0KPiANCj4gT24gMDgvMTAvMjAxMiAwMzo0NyBBTSwg
SmlhIEhvbmd0YW8tQjM4OTUxIHdyb3RlOg0KPiA+DQo+ID4NCj4gPj4gLS0tLS1PcmlnaW5hbCBN
ZXNzYWdlLS0tLS0NCj4gPj4gRnJvbTogR2FsYSBLdW1hci1CMTE3ODANCj4gPj4gU2VudDogVGh1
cnNkYXksIEF1Z3VzdCAwOSwgMjAxMiAzOjA0IEFNDQo+ID4+IFRvOiBXb29kIFNjb3R0LUIwNzQy
MQ0KPiA+PiBDYzogSmlhIEhvbmd0YW8tQjM4OTUxOyBXb29kIFNjb3R0LUIwNzQyMTsgTGkgWWFu
Zy1SNTg0NzI7IGxpbnV4cHBjLQ0KPiA+PiBkZXZAbGlzdHMub3psYWJzLm9yZw0KPiA+PiBTdWJq
ZWN0OiBSZTogW1BBVENIIFY1IDMvM10gcG93ZXJwYy9mc2wtcGNpOiBVbmlmeSBwY2kvcGNpZQ0K
PiA+PiBpbml0aWFsaXphdGlvbiBjb2RlDQo+ID4+DQo+ID4+Pj4+Pj4+PiBBcyBJIGV4cGxhaW5l
ZCBiZWZvcmUsIHRoaXMgaGFzIHRvIGJlIGRvbmUgZ2xvYmFsbHksIG5vdCBmcm9tDQo+ID4+Pj4+
Pj4+PiB0aGUgcHJvYmUgZnVuY3Rpb24sIHNvIHdlIGNhbiBhc3NpZ24gYSBkZWZhdWx0IHByaW1h
cnkgYnVzIGlmDQo+ID4+Pj4+Pj4+PiB0aGVyZQ0KPiA+Pj4+PiBpc24ndCBhbnkgSVNBLg0KPiA+
Pj4+Pj4+Pj4gVGhlcmUgYXJlIGJ1Z3MgaW4gdGhlIExpbnV4IFBQQyBQQ0kgY29kZSByZWxhdGlu
ZyB0byBub3QNCj4gPj4+Pj4+Pj4+IGhhdmluZyBhbnkgcHJpbWFyeSBidXMuDQo+ID4+Pj4+Pj4+
Pg0KPiA+Pj4+Pj4+Pj4gLVNjb3R0DQo+ID4+Pj4+Pj4+DQo+ID4+Pj4+Pj4+IEluIG15IHdheSBv
ZiBzZWFyY2hpbmcgSVNBIHlvdSBjYW4gYWxzbyBhc3NpZ24gYSBkZWZhdWx0DQo+ID4+Pj4+Pj4+
IHByaW1hcnkgYnVzIGluIGJvYXJkIHNwZWNpZmljIGZpbGVzLg0KPiA+Pj4+Pj4+DQo+ID4+Pj4+
Pj4gVGhhdCB3YXMgbWVhbnQgZm9yIHdoZW4gdGhlIGJvYXJkIGZpbGUgaGFkIGFuIGFsdGVybmF0
ZSB3YXkgb2YNCj4gPj4+Pj4+PiBzZWFyY2hpbmcgZm9yIHRoZSBwcmltYXJ5IGJ1cyAoZS5nLiBs
b29rIGZvciBpODI1OSksIG5vdCBhcyBhDQo+ID4+Pj4+Pj4gcmVwbGFjZW1lbnQgZm9yIHRoZSBt
ZWNoYW5pc20gdGhhdCBndWFyYW50ZWVzIHRoZXJlJ3MgYSBwcmltYXJ5DQo+IGJ1cy4NCj4gPj4+
Pj4+Pg0KPiA+Pj4+Pj4+IFlvdSBhcmUgY2F1c2luZyBhIHJlZ3Jlc3Npb24gaW4gdGhlIHFlbXVf
ZTUwMC5jIHBsYXRmb3JtLg0KPiA+Pj4+Pj4NCj4gPj4+Pj4+IENhbiB3ZSBmaXggdGhlIHFlbXUg
ZGV2aWNlIHRyZWUgdG8gYWRkcmVzcyB0aGUgcHJvYmxlbSBpZiB3ZSBkbw0KPiA+Pj4+Pj4gbWFr
ZSBpdCBhIHJ1bGUgdG8gdXNlIHRoZSBJU0Egbm9kZSB0byBpbmRpY2F0ZSB0aGUgcHJpbWFyeSBi
dXM/DQo+ID4+Pj4+DQo+ID4+Pj4+IE5vLiAgVGhlcmUgaXMgbm8gSVNBLCBhbmQgd2UncmUgbm90
IGdvaW5nIHRvIGxpZSBhbmQgc2F5IHRoZXJlIGlzLg0KPiA+Pj4+DQo+ID4+Pj4gQnV0IHdlIGNh
biBhc3NpZ24gYSBkZWZhdWx0IHByaW1hcnkgZm9yIHFlbXUuDQo+ID4+Pg0KPiA+Pj4gTm90IGlu
IHRoZSBkZXZpY2UgdHJlZS4gIFdoYXQgb3RoZXIgbWVjaGFuaXNtIGRvIHlvdSBwcm9wb3NlPyAg
QW5kDQo+ID4+PiB3aHkgZG8geW91IHdhbnQgdG8gZml4IGl0IG9ubHkgZm9yIFFFTVUgYW5kIG5v
dCBvdGhlciBib2FyZHMsIHdoZXJlDQo+ID4+PiB0aGluZ3MgaGFwcGVuIHRvIHdvcmsgYnV0IG5v
dCBhcyBkZXNpZ25lZD8NCj4gPj4+DQo+ID4+PiBLdW1hciwgY2FuIHlvdSBzcGVhayB1cCBoZXJl
IGFzIG1haW50YWluZXIgc28gd2UgY2FuIHN0b3AgZ29pbmcgYmFjaw0KPiA+Pj4gYW5kIGZvcnRo
IGVuZGxlc3NseT8NCj4gPj4NCj4gPj4gSSdkIHJhdGhlciB3ZSBzdGljayB3aXRoIHRoZSBjb2Rl
IHRoYXQgd29ya3MgZm9yIHRoaXMgcHVycG9zZSBhdCB0aGlzDQo+ID4+IHBvaW50LiAgVGhhdCB3
b3VsZCBiZSBTY290dCdzIGN1cnJlbnQgdXBzdHJlYW0gY29kZS4gIExldHMgZ2V0IHRoZQ0KPiA+
PiBvdGhlciBhc3BlY3RzIG9mIHRoaXMgcGF0Y2hzZXQgY2xvc2VkIChTV0lPVExCLCBjb252ZXJz
aW9uIHRvDQo+ID4+IHBsYXRmb3JtIGRyaXZlciwgUE0sIGV0Yy4pLiAgVGhlIHByaW1hcnkgYnVz
IGNvZGUgU2NvdHQgd3JvdGUgZG9lcw0KPiA+PiBOT1QgbmVlZCB0byBjaGFuZ2UgYXQgdGhpcyBw
b2ludC4NCj4gPj4NCj4gPj4gLSBrDQo+ID4NCj4gPg0KPiA+IEkganVzdCBzdWJtaXR0ZWQgYSBu
ZXcgdmVyc2lvbiBvZiBQQ0kgcGF0Y2ggaW4gd2hpY2ggSSBpbXByb3ZlIHRoZQ0KPiBwcmltYXJ5
IHBhcnQuDQo+ID4gVGhlIHJlYXNvbnMgSSB3YW50IHRvIGNoYW5nZSB0aGUgd2F5IG9mIHByaW1h
cnkgYXNzaWdubWVudCBsaXN0ZWQgYmVsb3c6DQo+ID4NCj4gPiAxLiBUaGlzIGFwcHJvYWNoIGlz
IGZ1bmN0aW9uYWxseSBlcXVpdmFsZW50IHRvIHRoZSBTY290dCdzIGNvZGUuIEluIG15DQo+ID4g
YXBwcm9hY2ggdGhlcmUgbWlnaHQgYmUgbm8gcHJpbWFyeSBhc3NpZ25lZCBidXQgaXQgZml4ZWQg
YnkgInF1aWNrIGZpeCINCj4gaW50cm9kdWNlZCBieSBCZW4uDQo+ID4gUGxlYXNlIHJlZmVyIHRv
IHRoaXMgbGluazoNCj4gPiBodHRwczovL2xpc3RzLm96bGFicy5vcmcvcGlwZXJtYWlsL2xpbnV4
cHBjLWRldi8yMDEyLUp1bmUvMDk4NTg2Lmh0bWwNCj4gDQo+IFlvdSBtaWdodCB3YW50IHRvIGdl
dCBCZW4ncyBpbnB1dCBhcyB0byB3aGV0aGVyIGhlIGFjdHVhbGx5IHdhbnRzIHRvIHNlZQ0KPiB0
aGF0ICJxdWljayBmaXgiIGFwcGxpZWQuDQo+IA0KPiA+IDIuIFNjb3R0J3MgYW5kIG15IHdheSBj
b3VsZCBub3QgaGFuZGxlIHRoZSBzaXR1YXRpb24gdGhhdCAidGhlIHByaW1hcnkNCj4gPiBpcyBu
b3QgdGhlIGZpcnN0IFBDSSBidXMgZGV0ZWN0ZWQiLiBJIGZvdW5kIHRoYXQgb25seSBnZV9pbXAz
YSBnb3QNCj4gPiB0aGlzIHByb2JsZW0gc28gSSBmaXhlZCBpdCBieSBhZGRpbmcgSVNBIG5vZGUg
dG8gaXRzIGRldmljZSB0cmVlLiBCeQ0KPiA+IGFkZGluZyB0aGlzIEkgdGhpbmsgdGhlIHNvbHV0
aW9uIGlzIGxvZ2ljYWxseSBjb21wbGV0ZWQuDQo+IA0KPiBIb3cgZGlkIG15IGFwcHJvYWNoIG5v
dCBoYW5kbGUgdGhpcyBjYXNlPyAgQXMgSSBzYWlkLCBnZV9pbXAzYSBwbGF0Zm9ybQ0KPiBjb2Rl
IG5lZWRzIHRvIHNldCBmc2xfcGNpX3ByaW1hcnkgbWFudWFsbHkgYmVmb3JlIFBDSSBpbml0IHJ1
bnMuDQo+IA0KPiBBZGRpbmcgYSBub2RlIHRvIHRoZSBkZXZpY2UgdHJlZSBpcyBub3QgdGhlIGFu
c3dlciwgc2luY2UgdGhhdCB3aWxsIGJyZWFrDQo+IGNvbXBhdGliaWxpdHkgd2l0aCBvbGQgZGV2
aWNlIHRyZWVzLg0KPiANCg0KSSBhc3N1bWUgdGhhdCBrZXJuZWwgaW1hZ2UgYW5kIGR0YiBpbWFn
ZSBhcmUgZnJvbSB0aGUgc2FtZSB0cmVlLg0KLUhvbmd0YW8uDQo=
^ permalink raw reply
* RE: [PATCH v7 0/8] Raid: enable talitos xor offload for improving performance
From: Liu Qiang-B32616 @ 2012-08-15 7:59 UTC (permalink / raw)
To: Dan Williams, dan.j.williams@gmail.com
Cc: herbert@gondor.apana.org.au, arnd@arndb.de, Ira W. Snyder,
vinod.koul@intel.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <CAA9_cme4tHrx14JaSaHwgcGq79qQK5bv8E205fbC3ega5OpUiQ@mail.gmail.com>
> -----Original Message-----
> From: dan.j.williams@gmail.com [mailto:dan.j.williams@gmail.com] On
> Behalf Of Dan Williams
> Sent: Wednesday, August 15, 2012 4:02 AM
> To: Liu Qiang-B32616
> Cc: dan.j.williams@intel.com; vinod.koul@intel.com; arnd@arndb.de;
> herbert@gondor.apana.org.au; gregkh@linuxfoundation.org; linuxppc-
> dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; linux-
> crypto@vger.kernel.org; Ira W. Snyder
> Subject: Re: [PATCH v7 0/8] Raid: enable talitos xor offload for
> improving performance
>=20
> On Tue, Aug 14, 2012 at 2:04 AM, Liu Qiang-B32616 <B32616@freescale.com>
> wrote:
> > Hi Vinod,
> >
> > Would you like to apply this series from patch 2/8 to 7/8) in your tree=
?
> > The link as below,
> > http://patchwork.ozlabs.org/patch/176023/
> > http://patchwork.ozlabs.org/patch/176024/
> > http://patchwork.ozlabs.org/patch/176025/
> > http://patchwork.ozlabs.org/patch/176026/
> > http://patchwork.ozlabs.org/patch/176027/
> > http://patchwork.ozlabs.org/patch/176028/
> >
>=20
> Hi, sorry for the recent silence I've been transitioning and am now
> just catching up. I'll take a look and then it's fine for these to go
> through Vinod's tree.
Hello Dan,
Please review, this issue has been continued since many years. I hope we ca=
n fix
it this time. Thanks.
>=20
> --
> Dan
^ permalink raw reply
* RE: [PATCH V6 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code
From: Jia Hongtao-B38951 @ 2012-08-15 3:56 UTC (permalink / raw)
To: Tabi Timur-B04825, galak@kernel.crashing.org
Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <CAOZdJXW_mcx89v9hqp21D0baXYpqFtXLmo0VPtQTfMof9wn7UA@mail.gmail.com>
> -----Original Message-----
> From: Tabi Timur-B04825
> Sent: Saturday, August 11, 2012 9:11 PM
> To: Jia Hongtao-B38951
> Cc: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org; Wood Scott-
> B07421
> Subject: Re: [PATCH V6 3/3] powerpc/fsl-pci: Unify pci/pcie
> initialization code
>=20
> On Fri, Aug 10, 2012 at 3:19 AM, Jia Hongtao <B38951@freescale.com> wrote=
:
> >
> > +EXPORT_SYMBOL_GPL(mpc85xx_pci_err_probe);
>=20
> Make this EXPORT_SYMBOL.
>=20
Hi Timur and Kumar:
I'm a little confused.
Should we remove _GPL for upstream version too?
-Hongtao.
^ permalink raw reply
* Re: [PATCH 3/5] drivers/net/ethernet/freescale/fs_enet: fix error return code
From: David Miller @ 2012-08-15 0:01 UTC (permalink / raw)
To: Julia.Lawall; +Cc: netdev, kernel-janitors, linux-kernel, vbordug, linuxppc-dev
In-Reply-To: <1344949115-13266-4-git-send-email-Julia.Lawall@lip6.fr>
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 14 Aug 2012 14:58:33 +0200
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Convert a 0 error return code to a negative one, as returned elsewhere in the
> function.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied.
^ permalink raw reply
* [PATCH V3 2/3] PPC64: Add support for instantiating SML from Open Firmware
From: Ashley Lai @ 2012-08-14 23:34 UTC (permalink / raw)
To: linux-kernel
Cc: rcj, adlai, linux-security-module, tpmdd-devel, adlai, key,
linuxppc-dev
In-Reply-To: <1344986638.4430.22.camel@footlong>
This patch instantiate Stored Measurement Log (SML) and put the
log address and size in the device tree.
Signed-off-by: Ashley Lai <adlai@us.ibm.com>
---
| 62 +++++++++++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
--git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 0794a30..e144498 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1624,6 +1624,63 @@ static void __init prom_instantiate_rtas(void)
#ifdef CONFIG_PPC64
/*
+ * Allocate room for and instantiate Stored Measurement Log (SML)
+ */
+static void __init prom_instantiate_sml(void)
+{
+ phandle ibmvtpm_node;
+ ihandle ibmvtpm_inst;
+ u32 entry = 0, size = 0;
+ u64 base;
+
+ prom_debug("prom_instantiate_sml: start...\n");
+
+ ibmvtpm_node = call_prom("finddevice", 1, 1, ADDR("/ibm,vtpm"));
+ prom_debug("ibmvtpm_node: %x\n", ibmvtpm_node);
+ if (!PHANDLE_VALID(ibmvtpm_node))
+ return;
+
+ ibmvtpm_inst = call_prom("open", 1, 1, ADDR("/ibm,vtpm"));
+ if (!IHANDLE_VALID(ibmvtpm_inst)) {
+ prom_printf("opening vtpm package failed (%x)\n", ibmvtpm_inst);
+ return;
+ }
+
+ if (call_prom_ret("call-method", 2, 2, &size,
+ ADDR("sml-get-handover-size"),
+ ibmvtpm_inst) != 0 || size == 0) {
+ prom_printf("SML get handover size failed\n");
+ return;
+ }
+
+ base = alloc_down(size, PAGE_SIZE, 0);
+ if (base == 0)
+ prom_panic("Could not allocate memory for sml\n");
+
+ prom_printf("instantiating sml at 0x%x...", base);
+
+ if (call_prom_ret("call-method", 4, 2, &entry,
+ ADDR("sml-handover"),
+ ibmvtpm_inst, size, base) != 0 || entry == 0) {
+ prom_printf("SML handover failed\n");
+ return;
+ }
+ prom_printf(" done\n");
+
+ reserve_mem(base, size);
+
+ prom_setprop(ibmvtpm_node, "/ibm,vtpm", "linux,sml-base",
+ &base, sizeof(base));
+ prom_setprop(ibmvtpm_node, "/ibm,vtpm", "linux,sml-size",
+ &size, sizeof(size));
+
+ prom_debug("sml base = 0x%x\n", base);
+ prom_debug("sml size = 0x%x\n", (long)size);
+
+ prom_debug("prom_instantiate_sml: end...\n");
+}
+
+/*
* Allocate room for and initialize TCE tables
*/
static void __init prom_initialize_tce_table(void)
@@ -2916,6 +2973,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
prom_instantiate_opal();
#endif
+#ifdef CONFIG_PPC64
+ /* instantiate sml */
+ prom_instantiate_sml();
+#endif
+
/*
* On non-powermacs, put all CPUs in spin-loops.
*
--
1.7.1
^ permalink raw reply related
* [PATCH V3 3/3] drivers/char/tpm: Add securityfs support for event log
From: Ashley Lai @ 2012-08-14 23:35 UTC (permalink / raw)
To: linux-kernel
Cc: rcj, adlai, linux-security-module, tpmdd-devel, adlai, key,
linuxppc-dev
In-Reply-To: <1344986638.4430.22.camel@footlong>
This patch retrieves the event log data from the device tree
during file open. The event log data will then displayed through
securityfs.
Signed-off-by: Ashley Lai <adlai@us.ibm.com>
---
| 5 +++
| 12 ------
| 15 ++++++++
| 73 +++++++++++++++++++++++++++++++++++++++
4 files changed, 93 insertions(+), 12 deletions(-)
create mode 100644 drivers/char/tpm/tpm_of.c
--git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index 547509d..9080cc4 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -5,6 +5,11 @@ obj-$(CONFIG_TCG_TPM) += tpm.o
ifdef CONFIG_ACPI
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
tpm_bios-objs += tpm_eventlog.o tpm_acpi.o
+else
+ifdef CONFIG_TCG_IBMVTPM
+ obj-$(CONFIG_TCG_TPM) += tpm_bios.o
+ tpm_bios-objs += tpm_eventlog.o tpm_of.o
+endif
endif
obj-$(CONFIG_TCG_TIS) += tpm_tis.o
obj-$(CONFIG_TCG_TIS_I2C_INFINEON) += tpm_i2c_infineon.o
--git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 870fde7..f1af738 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -327,15 +327,3 @@ extern int tpm_pm_suspend(struct device *);
extern int tpm_pm_resume(struct device *);
extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
wait_queue_head_t *);
-#ifdef CONFIG_ACPI
-extern struct dentry ** tpm_bios_log_setup(char *);
-extern void tpm_bios_log_teardown(struct dentry **);
-#else
-static inline struct dentry ** tpm_bios_log_setup(char *name)
-{
- return NULL;
-}
-static inline void tpm_bios_log_teardown(struct dentry **dir)
-{
-}
-#endif
--git a/drivers/char/tpm/tpm_eventlog.h b/drivers/char/tpm/tpm_eventlog.h
index 8e23ccd..e7da086 100644
--- a/drivers/char/tpm/tpm_eventlog.h
+++ b/drivers/char/tpm/tpm_eventlog.h
@@ -68,4 +68,19 @@ enum tcpa_pc_event_ids {
};
int read_log(struct tpm_bios_log *log);
+
+#if defined(CONFIG_TCG_IBMVTPM) || defined(CONFIG_TCG_IBMVTPM_MODULE) || \
+ defined(CONFIG_ACPI)
+extern struct dentry **tpm_bios_log_setup(char *);
+extern void tpm_bios_log_teardown(struct dentry **);
+#else
+static inline struct dentry **tpm_bios_log_setup(char *name)
+{
+ return NULL;
+}
+static inline void tpm_bios_log_teardown(struct dentry **dir)
+{
+}
+#endif
+
#endif
--git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c
new file mode 100644
index 0000000..98ba2bd
--- /dev/null
+++ b/drivers/char/tpm/tpm_of.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2012 IBM Corporation
+ *
+ * Author: Ashley Lai <adlai@us.ibm.com>
+ *
+ * Maintained by: <tpmdd-devel@lists.sourceforge.net>
+ *
+ * Read the event log created by the firmware on PPC64
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/slab.h>
+#include <linux/of.h>
+
+#include "tpm.h"
+#include "tpm_eventlog.h"
+
+int read_log(struct tpm_bios_log *log)
+{
+ struct device_node *np;
+ const u32 *sizep;
+ const __be64 *basep;
+
+ if (log->bios_event_log != NULL) {
+ pr_err("%s: ERROR - Eventlog already initialized\n", __func__);
+ return -EFAULT;
+ }
+
+ np = of_find_node_by_name(NULL, "ibm,vtpm");
+ if (!np) {
+ pr_err("%s: ERROR - IBMVTPM not supported\n", __func__);
+ return -ENODEV;
+ }
+
+ sizep = of_get_property(np, "linux,sml-size", NULL);
+ if (sizep == NULL) {
+ pr_err("%s: ERROR - SML size not found\n", __func__);
+ goto cleanup_eio;
+ }
+ if (*sizep == 0) {
+ pr_err("%s: ERROR - event log area empty\n", __func__);
+ goto cleanup_eio;
+ }
+
+ basep = of_get_property(np, "linux,sml-base", NULL);
+ if (basep == NULL) {
+ pr_err(KERN_ERR "%s: ERROR - SML not found\n", __func__);
+ goto cleanup_eio;
+ }
+
+ of_node_put(np);
+ log->bios_event_log = kmalloc(*sizep, GFP_KERNEL);
+ if (!log->bios_event_log) {
+ pr_err("%s: ERROR - Not enough memory for BIOS measurements\n",
+ __func__);
+ return -ENOMEM;
+ }
+
+ log->bios_event_log_end = log->bios_event_log + *sizep;
+
+ memcpy(log->bios_event_log, __va(be64_to_cpup(basep)), *sizep);
+
+ return 0;
+
+cleanup_eio:
+ of_node_put(np);
+ return -EIO;
+}
--
1.7.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox