Skip to content

Commit

Permalink
Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/olof/pasemi into for-2.6.25
  • Loading branch information
Paul Mackerras committed Jan 17, 2008
2 parents 0173d42 + 9cd55be commit 52920df
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 180 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/configs/pasemi_defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24-rc6
# Fri Dec 28 11:01:53 2007
# Tue Jan 15 10:26:10 2008
#
CONFIG_PPC64=y

Expand Down Expand Up @@ -152,7 +152,6 @@ CONFIG_PPC_PASEMI=y
CONFIG_PPC_PASEMI_IOMMU=y
# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
CONFIG_PPC_PASEMI_MDIO=y
CONFIG_ELECTRA_IDE=y
# CONFIG_PPC_CELLEB is not set
# CONFIG_PPC_PS3 is not set
# CONFIG_PPC_CELL is not set
Expand Down Expand Up @@ -663,6 +662,7 @@ CONFIG_PATA_PCMCIA=y
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=y
Expand Down
9 changes: 0 additions & 9 deletions arch/powerpc/platforms/pasemi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,4 @@ config PPC_PASEMI_MDIO
help
Driver for MDIO via GPIO on PWRficient platforms

config ELECTRA_IDE
tristate "Electra IDE driver"
default y
depends on PPC_PASEMI && ATA
select PATA_PLATFORM
help
This includes driver support for the Electra on-board IDE
interface.

endmenu
1 change: 0 additions & 1 deletion arch/powerpc/platforms/pasemi/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
obj-y += setup.o pci.o time.o idle.o powersave.o iommu.o
obj-$(CONFIG_PPC_PASEMI_MDIO) += gpio_mdio.o
obj-$(CONFIG_ELECTRA_IDE) += electra_ide.o
obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o
96 changes: 0 additions & 96 deletions arch/powerpc/platforms/pasemi/electra_ide.c

This file was deleted.

5 changes: 1 addition & 4 deletions arch/powerpc/platforms/pasemi/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)

static int __init pasemi_idle_init(void)
{
if (!machine_is(pasemi))
return -ENODEV;

#ifndef CONFIG_PPC_PASEMI_CPUFREQ
printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
current_mode = 0;
Expand All @@ -88,7 +85,7 @@ static int __init pasemi_idle_init(void)

return 0;
}
late_initcall(pasemi_idle_init);
machine_late_initcall(pasemi, pasemi_idle_init);

static int __init idle_param(char *p)
{
Expand Down
12 changes: 3 additions & 9 deletions arch/powerpc/platforms/pasemi/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ static int __init pas_setup_mce_regs(void)
struct pci_dev *dev;
int reg;

if (!machine_is(pasemi))
return -ENODEV;

/* Remap various SoC status registers for use by the MCE handler */

reg = 0;
Expand Down Expand Up @@ -181,7 +178,7 @@ static int __init pas_setup_mce_regs(void)

return 0;
}
device_initcall(pas_setup_mce_regs);
machine_device_initcall(pasemi, pas_setup_mce_regs);

static __init void pas_init_IRQ(void)
{
Expand Down Expand Up @@ -264,7 +261,7 @@ static int pas_machine_check_handler(struct pt_regs *regs)
srr0 = regs->nip;
srr1 = regs->msr;

if (mpic_get_mcirq() == nmi_virq) {
if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) {
printk(KERN_ERR "NMI delivered\n");
debugger(regs);
mpic_end_irq(nmi_virq);
Expand Down Expand Up @@ -405,17 +402,14 @@ static struct of_device_id pasemi_bus_ids[] = {

static int __init pasemi_publish_devices(void)
{
if (!machine_is(pasemi))
return 0;

pasemi_pcmcia_init();

/* Publish OF platform devices for SDC and other non-PCI devices */
of_platform_bus_probe(NULL, pasemi_bus_ids, NULL);

return 0;
}
device_initcall(pasemi_publish_devices);
machine_device_initcall(pasemi, pasemi_publish_devices);


/*
Expand Down
12 changes: 11 additions & 1 deletion drivers/ata/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -607,13 +607,23 @@ config PATA_WINBOND_VLB

config PATA_PLATFORM
tristate "Generic platform device PATA support"
depends on EMBEDDED || ARCH_RPC
depends on EMBEDDED || ARCH_RPC || PPC
help
This option enables support for generic directly connected ATA
devices commonly found on embedded systems.

If unsure, say N.

config PATA_OF_PLATFORM
tristate "OpenFirmware platform device PATA support"
depends on PATA_PLATFORM && PPC_OF
help
This option enables support for generic directly connected ATA
devices commonly found on embedded systems with OpenFirmware
bindings.

If unsure, say N.

config PATA_ICSIDE
tristate "Acorn ICS PATA support"
depends on ARM && ARCH_ACORN
Expand Down
1 change: 1 addition & 0 deletions drivers/ata/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ obj-$(CONFIG_PATA_IXP4XX_CF) += pata_ixp4xx_cf.o
obj-$(CONFIG_PATA_SCC) += pata_scc.o
obj-$(CONFIG_PATA_BF54X) += pata_bf54x.o
obj-$(CONFIG_PATA_PLATFORM) += pata_platform.o
obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
obj-$(CONFIG_PATA_ICSIDE) += pata_icside.o
# Should be last but two libata driver
obj-$(CONFIG_PATA_ACPI) += pata_acpi.o
Expand Down
114 changes: 114 additions & 0 deletions drivers/ata/pata_of_platform.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* OF-platform PATA driver
*
* Copyright (c) 2007 MontaVista Software, Inc.
* Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
*/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/pata_platform.h>

static int __devinit pata_of_platform_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
int ret;
struct device_node *dn = ofdev->node;
struct resource io_res;
struct resource ctl_res;
struct resource irq_res;
unsigned int reg_shift = 0;
int pio_mode = 0;
int pio_mask;
const u32 *prop;

ret = of_address_to_resource(dn, 0, &io_res);
if (ret) {
dev_err(&ofdev->dev, "can't get IO address from "
"device tree\n");
return -EINVAL;
}

if (of_device_is_compatible(dn, "electra-ide")) {
/* Altstatus is really at offset 0x3f6 from the primary window
* on electra-ide. Adjust ctl_res and io_res accordingly.
*/
ctl_res = io_res;
ctl_res.start = ctl_res.start+0x3f6;
io_res.end = ctl_res.start-1;
} else {
ret = of_address_to_resource(dn, 1, &ctl_res);
if (ret) {
dev_err(&ofdev->dev, "can't get CTL address from "
"device tree\n");
return -EINVAL;
}
}

ret = of_irq_to_resource(dn, 0, &irq_res);
if (ret == NO_IRQ)
irq_res.start = irq_res.end = -1;
else
irq_res.flags = 0;

prop = of_get_property(dn, "reg-shift", NULL);
if (prop)
reg_shift = *prop;

prop = of_get_property(dn, "pio-mode", NULL);
if (prop) {
pio_mode = *prop;
if (pio_mode > 6) {
dev_err(&ofdev->dev, "invalid pio-mode\n");
return -EINVAL;
}
} else {
dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
}

pio_mask = 1 << pio_mode;
pio_mask |= (1 << pio_mode) - 1;

return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res,
reg_shift, pio_mask);
}

static int __devexit pata_of_platform_remove(struct of_device *ofdev)
{
return __pata_platform_remove(&ofdev->dev);
}

static struct of_device_id pata_of_platform_match[] = {
{ .compatible = "ata-generic", },
{ .compatible = "electra-ide", },
{},
};
MODULE_DEVICE_TABLE(of, pata_of_platform_match);

static struct of_platform_driver pata_of_platform_driver = {
.name = "pata_of_platform",
.match_table = pata_of_platform_match,
.probe = pata_of_platform_probe,
.remove = __devexit_p(pata_of_platform_remove),
};

static int __init pata_of_platform_init(void)
{
return of_register_platform_driver(&pata_of_platform_driver);
}
module_init(pata_of_platform_init);

static void __exit pata_of_platform_exit(void)
{
of_unregister_platform_driver(&pata_of_platform_driver);
}
module_exit(pata_of_platform_exit);

MODULE_DESCRIPTION("OF-platform PATA driver");
MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
MODULE_LICENSE("GPL");
Loading

0 comments on commit 52920df

Please sign in to comment.