X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/62797a4d2475b9eef8f5cbb56efbbaa8a1a808c0..4f345fdc5674f212ef077f01bbc54aa19e633d71:/target/linux/ppc40x/patches/101-pata-magicbox-cf-driver.patch diff --git a/target/linux/ppc40x/patches/101-pata-magicbox-cf-driver.patch b/target/linux/ppc40x/patches/101-pata-magicbox-cf-driver.patch index 48d2d44ee..0b4bb0d3d 100644 --- a/target/linux/ppc40x/patches/101-pata-magicbox-cf-driver.patch +++ b/target/linux/ppc40x/patches/101-pata-magicbox-cf-driver.patch @@ -1,39 +1,39 @@ --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig -@@ -697,6 +697,16 @@ config PATA_IXP4XX_CF +@@ -144,6 +144,16 @@ config PDC_ADMA If unsure, say N. +config PATA_MAGICBOX_CF -+ tristate "Magicbox/OpenRB Compact lash support" -+ depends on MAGICBOXV2 || OPENRB_LIGHT ++ tristate "Magicbox/OpenRB Compact Flash support" ++ depends on MAGICBOX || OPENRB + help -+ This option enables supoort for a Compatc Flash connected on ++ This option enables support for a Compact Flash conected on + the ppc405ep expansion bus. This driver had been written for + the Magicbox v2 and OpenRB boards. + + If unsure, say N. + - config PATA_SCC - tristate "Toshiba's Cell Reference Set IDE support" - depends on PCI && PPC_CELLEB + config PATA_OCTEON_CF + tristate "OCTEON Boot Bus Compact Flash support" + depends on CPU_CAVIUM_OCTEON --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile -@@ -48,6 +48,7 @@ obj-$(CONFIG_PATA_OPTI) += pata_opti.o - obj-$(CONFIG_PATA_OPTIDMA) += pata_optidma.o - obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o - obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o +@@ -81,6 +81,7 @@ obj-$(CONFIG_PATA_AT91) += pata_at91.o + obj-$(CONFIG_PATA_CMD640_PCI) += pata_cmd640.o + obj-$(CONFIG_PATA_ISAPNP) += pata_isapnp.o + obj-$(CONFIG_PATA_IXP4XX_CF) += pata_ixp4xx_cf.o +obj-$(CONFIG_PATA_MAGICBOX_CF) += pata_magicbox_cf.o obj-$(CONFIG_PATA_MPIIX) += pata_mpiix.o - obj-$(CONFIG_PATA_OLDPIIX) += pata_oldpiix.o - obj-$(CONFIG_PATA_PCMCIA) += pata_pcmcia.o + obj-$(CONFIG_PATA_NS87410) += pata_ns87410.o + obj-$(CONFIG_PATA_OPTI) += pata_opti.o --- /dev/null +++ b/drivers/ata/pata_magicbox_cf.c -@@ -0,0 +1,406 @@ +@@ -0,0 +1,401 @@ +/* + * PATA/CompactFlash driver for the MagicBox v2/OpenRB boards. + * -+ * Copyright (C) 2009 Gabor Juhos ++ * Copyright (C) 2009,2012 Gabor Juhos + * + * Based on the IDE driver by Wojtek Kaniewski + * @@ -44,12 +44,13 @@ + +#include +#include ++#include +#include +#include +#include +#include -+#include -+#include ++//#include ++//#include +#include +#include + @@ -92,14 +93,12 @@ +{ + struct ata_device *dev; + -+ ata_link_for_each_dev(dev, link) { -+ if (ata_dev_enabled(dev)) { -+ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); -+ dev->pio_mode = XFER_PIO_0; -+ dev->xfer_mode = XFER_PIO_0; -+ dev->xfer_shift = ATA_SHIFT_PIO; -+ dev->flags |= ATA_DFLAG_PIO; -+ } ++ ata_for_each_dev(dev, link, ENABLED) { ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); ++ dev->pio_mode = XFER_PIO_0; ++ dev->xfer_mode = XFER_PIO_0; ++ dev->xfer_shift = ATA_SHIFT_PIO; ++ dev->flags |= ATA_DFLAG_PIO; + } + + return 0; @@ -263,10 +262,9 @@ + return words << 1; +} + -+static u8 magicbox_cf_irq_on(struct ata_port *ap) ++static void magicbox_cf_irq_on(struct ata_port *ap) +{ + /* Nothing to do. */ -+ return 0; +} + +static void magicbox_cf_irq_clear(struct ata_port *ap) @@ -307,7 +305,7 @@ + + ap->ops = &magicbox_cf_port_ops; + ap->pio_mask = ATA_PIO4; -+ ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; ++ ap->flags |= ATA_FLAG_NO_ATAPI; + + ap->ioaddr.cmd_addr = info->base + MAGICBOX_CF_REG_CMD; + ap->ioaddr.data_addr = info->base + MAGICBOX_CF_REG_DATA; @@ -328,8 +326,7 @@ + ap->ioaddr.ctl_addr); +} + -+static int __devinit magicbox_cf_of_probe(struct of_device *op, -+ const struct of_device_id *match) ++static int __devinit magicbox_cf_of_probe(struct platform_device *op) +{ + struct magicbox_cf_info *info; + struct ata_host *host; @@ -342,20 +339,20 @@ + goto err_exit; + } + -+ irq = irq_of_parse_and_map(op->node, 0); ++ irq = irq_of_parse_and_map(op->dev.of_node, 0); + if (irq < 0) { + dev_err(&op->dev, "invalid irq\n"); + ret = -EINVAL; + goto err_free_info; + } + -+ info->base = of_iomap(op->node, 0); ++ info->base = of_iomap(op->dev.of_node, 0); + if (info->base == NULL) { + ret = -ENOMEM; + goto err_free_info; + } + -+ info->ctrl = of_iomap(op->node, 1); ++ info->ctrl = of_iomap(op->dev.of_node, 1); + if (info->ctrl == NULL) { + ret = -ENOMEM; + goto err_unmap_base; @@ -388,7 +385,7 @@ + return ret; +} + -+static __devexit int magicbox_cf_of_remove(struct of_device *op) ++static __devexit int magicbox_cf_of_remove(struct platform_device *op) +{ + struct ata_host *host = dev_get_drvdata(&op->dev); + struct magicbox_cf_info *info = host->private_data; @@ -406,26 +403,24 @@ + {}, +}; + -+static struct of_platform_driver magicbox_cf_of_platform_driver = { -+ .owner = THIS_MODULE, -+ .name = DRV_NAME, -+ .match_table = magicbox_cf_of_match, ++static struct platform_driver magicbox_cf_of_platform_driver = { + .probe = magicbox_cf_of_probe, + .remove = __devexit_p(magicbox_cf_of_remove), + .driver = { -+ .name = DRV_NAME, -+ .owner = THIS_MODULE, ++ .name = DRV_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = magicbox_cf_of_match, + }, +}; + +static int __init magicbox_cf_init(void) +{ -+ return of_register_platform_driver(&magicbox_cf_of_platform_driver); ++ return platform_driver_register(&magicbox_cf_of_platform_driver); +} + +static void __exit magicbox_cf_exit(void) +{ -+ of_unregister_platform_driver(&magicbox_cf_of_platform_driver); ++ platform_driver_unregister(&magicbox_cf_of_platform_driver); +} + +module_init(magicbox_cf_init);