* linux-next: manual merge of the mtd tree
@ 2008-11-27 4:15 Stephen Rothwell
2008-11-27 5:25 ` Greg KH
2008-12-10 2:08 ` Stephen Rothwell
0 siblings, 2 replies; 17+ messages in thread
From: Stephen Rothwell @ 2008-11-27 4:15 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-next, Atsushi Nemoto, Andrew Morton, Kay Sievers, Greg KH
Hi David,
Today's linux-next merge of the mtd tree got a conflict in
drivers/mtd/maps/physmap.c between commit
a64cbdb4da5c8482929e7bc9c542e9757ad3e0f1 ("mtd: struct device - replace
bus_id with dev_name(), dev_set_name()") from the driver-core tree and
commit 3136e903fa2d493ebc1b8a8fbdde2d3a17f85acd ("[MTD] physmap: fix
memory leak on physmap_flash_remove by using devres") from the mtd tree.
I fixed it up (see below) and can carry it for a short while.
Dave, you should apply the patch from the driver-core tree (which was
cc:d to you) (and cope with the rejects :-)) and let Greg KH know when
you have.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff --cc drivers/mtd/maps/physmap.c
index 8e2ee92,dfbf3f2..0000000
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@@ -114,10 -105,10 +105,10 @@@ static int physmap_flash_probe(struct p
(unsigned long long)(dev->resource[i].end - dev->resource[i].start + 1),
(unsigned long long)dev->resource[i].start);
- info->res = request_mem_region(dev->resource[i].start,
- dev->resource[i].end - dev->resource[i].start + 1,
- dev_name(&dev->dev));
- if (info->res == NULL) {
+ if (!devm_request_mem_region(&dev->dev,
+ dev->resource[i].start,
+ dev->resource[i].end - dev->resource[i].start + 1,
- dev->dev.bus_id)) {
++ dev_name(&dev->dev))) {
dev_err(&dev->dev, "Could not reserve memory region\n");
err = -ENOMEM;
goto err_out;
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: linux-next: manual merge of the mtd tree 2008-11-27 4:15 linux-next: manual merge of the mtd tree Stephen Rothwell @ 2008-11-27 5:25 ` Greg KH 2008-12-10 2:08 ` Stephen Rothwell 1 sibling, 0 replies; 17+ messages in thread From: Greg KH @ 2008-11-27 5:25 UTC (permalink / raw) To: Stephen Rothwell Cc: David Woodhouse, linux-next, Atsushi Nemoto, Andrew Morton, Kay Sievers On Thu, Nov 27, 2008 at 03:15:48PM +1100, Stephen Rothwell wrote: > Hi David, > > Today's linux-next merge of the mtd tree got a conflict in > drivers/mtd/maps/physmap.c between commit > a64cbdb4da5c8482929e7bc9c542e9757ad3e0f1 ("mtd: struct device - replace > bus_id with dev_name(), dev_set_name()") from the driver-core tree and > commit 3136e903fa2d493ebc1b8a8fbdde2d3a17f85acd ("[MTD] physmap: fix > memory leak on physmap_flash_remove by using devres") from the mtd tree. > > I fixed it up (see below) and can carry it for a short while. > > Dave, you should apply the patch from the driver-core tree (which was > cc:d to you) (and cope with the rejects :-)) and let Greg KH know when > you have. David, the patch is below in case it somehow got lost in your patch queue. Please let me know when you apply it so I can drop it from my tree. thanks, greg k-h ----------- From: Kay Sievers <kay.sievers@vrfy.org> Subject: mtd: struct device - replace bus_id with dev_name(), dev_set_name() CC: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- drivers/mtd/devices/m25p80.c | 16 ++++++++-------- drivers/mtd/devices/mtd_dataflash.c | 30 +++++++++++++++--------------- drivers/mtd/maps/integrator-flash.c | 2 +- drivers/mtd/maps/ixp2000.c | 4 ++-- drivers/mtd/maps/ixp4xx.c | 2 +- drivers/mtd/maps/omap_nor.c | 2 +- drivers/mtd/maps/physmap.c | 6 +++--- drivers/mtd/maps/physmap_of.c | 4 ++-- drivers/mtd/mtdconcat.c | 2 +- drivers/mtd/nand/fsl_upm.c | 2 +- drivers/mtd/nand/plat_nand.c | 2 +- drivers/mtd/nand/tmio_nand.c | 2 +- drivers/mtd/onenand/generic.c | 2 +- drivers/mtd/onenand/omap2.c | 2 +- drivers/mtd/ubi/build.c | 2 +- drivers/mtd/ubi/vmt.c | 4 ++-- include/linux/mtd/concat.h | 2 +- 17 files changed, 43 insertions(+), 43 deletions(-) --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -170,7 +170,7 @@ static int wait_till_ready(struct m25p * static int erase_block(struct m25p *flash) { DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n", - flash->spi->dev.bus_id, __func__, + dev_name(&flash->spi->dev), __func__, flash->mtd.size / 1024); /* Wait until finished previous write command. */ @@ -197,7 +197,7 @@ static int erase_block(struct m25p *flas static int erase_sector(struct m25p *flash, u32 offset) { DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", - flash->spi->dev.bus_id, __func__, + dev_name(&flash->spi->dev), __func__, flash->mtd.erasesize / 1024, offset); /* Wait until finished previous write command. */ @@ -234,7 +234,7 @@ static int m25p80_erase(struct mtd_info u32 addr,len; DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n", - flash->spi->dev.bus_id, __func__, "at", + dev_name(&flash->spi->dev), __func__, "at", (u32)instr->addr, instr->len); /* sanity checks */ @@ -292,7 +292,7 @@ static int m25p80_read(struct mtd_info * struct spi_message m; DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", - flash->spi->dev.bus_id, __func__, "from", + dev_name(&flash->spi->dev), __func__, "from", (u32)from, len); /* sanity checks */ @@ -364,7 +364,7 @@ static int m25p80_write(struct mtd_info struct spi_message m; DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", - flash->spi->dev.bus_id, __func__, "to", + dev_name(&flash->spi->dev), __func__, "to", (u32)to, len); if (retlen) @@ -560,7 +560,7 @@ static struct flash_info *__devinit jede tmp = spi_write_then_read(spi, &code, 1, id, 5); if (tmp < 0) { DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", - spi->dev.bus_id, tmp); + dev_name(&spi->dev), tmp); return NULL; } jedec = id[0]; @@ -613,7 +613,7 @@ static int __devinit m25p_probe(struct s /* unrecognized chip? */ if (i == ARRAY_SIZE(m25p_data)) { DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n", - spi->dev.bus_id, data->type); + dev_name(&spi->dev), data->type); info = NULL; /* recognized; is that chip really what's there? */ @@ -654,7 +654,7 @@ static int __devinit m25p_probe(struct s if (data && data->name) flash->mtd.name = data->name; else - flash->mtd.name = spi->dev.bus_id; + flash->mtd.name = dev_name(&spi->dev); flash->mtd.type = MTD_NORFLASH; flash->mtd.writesize = 1; --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -128,7 +128,7 @@ static int dataflash_waitready(struct sp status = dataflash_status(spi); if (status < 0) { DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", - spi->dev.bus_id, status); + dev_name(&spi->dev), status); status = 0; } @@ -154,7 +154,7 @@ static int dataflash_erase(struct mtd_in uint8_t *command; DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n", - spi->dev.bus_id, + dev_name(&spi->dev), instr->addr, instr->len); /* Sanity checks */ @@ -197,7 +197,7 @@ static int dataflash_erase(struct mtd_in if (status < 0) { printk(KERN_ERR "%s: erase %x, err %d\n", - spi->dev.bus_id, pageaddr, status); + dev_name(&spi->dev), pageaddr, status); /* REVISIT: can retry instr->retries times; or * giveup and instr->fail_addr = instr->addr; */ @@ -239,7 +239,7 @@ static int dataflash_read(struct mtd_inf int status; DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", - priv->spi->dev.bus_id, (unsigned)from, (unsigned)(from + len)); + dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len)); *retlen = 0; @@ -288,7 +288,7 @@ static int dataflash_read(struct mtd_inf status = 0; } else DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", - priv->spi->dev.bus_id, + dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len), status); return status; @@ -315,7 +315,7 @@ static int dataflash_write(struct mtd_in uint8_t *command; DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", - spi->dev.bus_id, (unsigned)to, (unsigned)(to + len)); + dev_name(&spi->dev), (unsigned)to, (unsigned)(to + len)); *retlen = 0; @@ -374,7 +374,7 @@ static int dataflash_write(struct mtd_in status = spi_sync(spi, &msg); if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", - spi->dev.bus_id, addr, status); + dev_name(&spi->dev), addr, status); (void) dataflash_waitready(priv->spi); } @@ -396,7 +396,7 @@ static int dataflash_write(struct mtd_in spi_transfer_del(x + 1); if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", - spi->dev.bus_id, addr, writelen, status); + dev_name(&spi->dev), addr, writelen, status); (void) dataflash_waitready(priv->spi); @@ -416,14 +416,14 @@ static int dataflash_write(struct mtd_in status = spi_sync(spi, &msg); if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", - spi->dev.bus_id, addr, status); + dev_name(&spi->dev), addr, status); status = dataflash_waitready(priv->spi); /* Check result of the compare operation */ if (status & (1 << 6)) { printk(KERN_ERR "%s: compare page %u, err %d\n", - spi->dev.bus_id, pageaddr, status); + dev_name(&spi->dev), pageaddr, status); remaining = 0; status = -EIO; break; @@ -779,7 +779,7 @@ static struct flash_info *__devinit jede tmp = spi_write_then_read(spi, &code, 1, id, 3); if (tmp < 0) { DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", - spi->dev.bus_id, tmp); + dev_name(&spi->dev), tmp); return ERR_PTR(tmp); } if (id[0] != 0x1f) @@ -869,7 +869,7 @@ static int __devinit dataflash_probe(str status = dataflash_status(spi); if (status <= 0 || status == 0xff) { DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", - spi->dev.bus_id, status); + dev_name(&spi->dev), status); if (status == 0 || status == 0xff) status = -ENODEV; return status; @@ -905,13 +905,13 @@ static int __devinit dataflash_probe(str /* obsolete AT45DB1282 not (yet?) supported */ default: DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", - spi->dev.bus_id, status & 0x3c); + dev_name(&spi->dev), status & 0x3c); status = -ENODEV; } if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", - spi->dev.bus_id, status); + dev_name(&spi->dev), status); return status; } @@ -921,7 +921,7 @@ static int __devexit dataflash_remove(st struct dataflash *flash = dev_get_drvdata(&spi->dev); int status; - DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", spi->dev.bus_id); + DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", dev_name(&spi->dev)); if (mtd_has_partitions() && flash->partitioned) status = del_mtd_partitions(&flash->mtd); --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c @@ -105,7 +105,7 @@ static int armflash_probe(struct platfor info->map.bankwidth = plat->width; info->map.phys = res->start; info->map.virt = base; - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.set_vpp = armflash_set_vpp; simple_map_init(&info->map); --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c @@ -188,7 +188,7 @@ static int ixp2000_flash_probe(struct pl */ info->map.map_priv_2 = (unsigned long) ixp_data->bank_setup; - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.read = ixp2000_flash_read8; info->map.write = ixp2000_flash_write8; info->map.copy_from = ixp2000_flash_copy_from; @@ -196,7 +196,7 @@ static int ixp2000_flash_probe(struct pl info->res = request_mem_region(dev->resource->start, dev->resource->end - dev->resource->start + 1, - dev->dev.bus_id); + dev_name(&dev->dev)); if (!info->res) { dev_err(&dev->dev, "Could not reserve memory region\n"); err = -ENOMEM; --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -218,7 +218,7 @@ static int ixp4xx_flash_probe(struct pla * handle that. */ info->map.bankwidth = 2; - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.read = ixp4xx_read16, info->map.write = ixp4xx_probe_write16, info->map.copy_from = ixp4xx_copy_from, --- a/drivers/mtd/maps/omap_nor.c +++ b/drivers/mtd/maps/omap_nor.c @@ -101,7 +101,7 @@ static int __init omapflash_probe(struct err = -ENOMEM; goto out_release_mem_region; } - info->map.name = pdev->dev.bus_id; + info->map.name = dev_name(&pdev->dev); info->map.phys = res->start; info->map.size = size; info->map.bankwidth = pdata->width; --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -116,14 +116,14 @@ static int physmap_flash_probe(struct pl info->res = request_mem_region(dev->resource[i].start, dev->resource[i].end - dev->resource[i].start + 1, - dev->dev.bus_id); + dev_name(&dev->dev)); if (info->res == NULL) { dev_err(&dev->dev, "Could not reserve memory region\n"); err = -ENOMEM; goto err_out; } - info->map[i].name = dev->dev.bus_id; + info->map[i].name = dev_name(&dev->dev); info->map[i].phys = dev->resource[i].start; info->map[i].size = dev->resource[i].end - dev->resource[i].start + 1; info->map[i].bankwidth = physmap_data->width; @@ -158,7 +158,7 @@ static int physmap_flash_probe(struct pl * We detected multiple devices. Concatenate them together. */ #ifdef CONFIG_MTD_CONCAT - info->cmtd = mtd_concat_create(info->mtd, devices_found, dev->dev.bus_id); + info->cmtd = mtd_concat_create(info->mtd, devices_found, dev_name(&dev->dev)); if (info->cmtd == NULL) err = -ENXIO; #else --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -183,7 +183,7 @@ static int __devinit of_flash_probe(stru err = -EBUSY; info->res = request_mem_region(res.start, res.end - res.start + 1, - dev->dev.bus_id); + dev_name(&dev->dev)); if (!info->res) goto err_out; @@ -194,7 +194,7 @@ static int __devinit of_flash_probe(stru goto err_out; } - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.phys = res.start; info->map.size = res.end - res.start + 1; info->map.bankwidth = *width; --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -691,7 +691,7 @@ static int concat_block_markbad(struct m */ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to concatenate */ int num_devs, /* number of subdevices */ - char *name) + const char *name) { /* name for the new device */ int i; size_t size; --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c @@ -220,7 +220,7 @@ static int __devinit fun_probe(struct of fun->rnb_gpio = of_get_gpio(ofdev->node, 0); if (fun->rnb_gpio >= 0) { - ret = gpio_request(fun->rnb_gpio, ofdev->dev.bus_id); + ret = gpio_request(fun->rnb_gpio, dev_name(&ofdev->dev)); if (ret) { dev_err(&ofdev->dev, "can't request RNB gpio\n"); goto err2; --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -54,7 +54,7 @@ static int __init plat_nand_probe(struct data->chip.priv = &data; data->mtd.priv = &data->chip; data->mtd.owner = THIS_MODULE; - data->mtd.name = pdev->dev.bus_id; + data->mtd.name = dev_name(&pdev->dev); data->chip.IO_ADDR_R = data->io_base; data->chip.IO_ADDR_W = data->io_base; --- a/drivers/mtd/nand/tmio_nand.c +++ b/drivers/mtd/nand/tmio_nand.c @@ -433,7 +433,7 @@ static int tmio_probe(struct platform_de nand_chip->chip_delay = 15; retval = request_irq(irq, &tmio_irq, - IRQF_DISABLED, dev->dev.bus_id, tmio); + IRQF_DISABLED, dev_name(&dev->dev), tmio); if (retval) { dev_err(&dev->dev, "request_irq error %d\n", retval); goto err_irq; --- a/drivers/mtd/onenand/generic.c +++ b/drivers/mtd/onenand/generic.c @@ -63,7 +63,7 @@ static int __devinit generic_onenand_pro info->onenand.mmcontrol = pdata->mmcontrol; info->onenand.irq = platform_get_irq(pdev, 0); - info->mtd.name = pdev->dev.bus_id; + info->mtd.name = dev_name(&pdev->dev); info->mtd.priv = &info->onenand; info->mtd.owner = THIS_MODULE; --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -669,7 +669,7 @@ static int __devinit omap2_onenand_probe c->onenand.base); c->pdev = pdev; - c->mtd.name = pdev->dev.bus_id; + c->mtd.name = dev_name(&pdev->dev); c->mtd.priv = &c->onenand; c->mtd.owner = THIS_MODULE; --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -280,7 +280,7 @@ static int ubi_sysfs_init(struct ubi_dev ubi->dev.release = dev_release; ubi->dev.devt = ubi->cdev.dev; ubi->dev.class = ubi_class; - sprintf(&ubi->dev.bus_id[0], UBI_NAME_STR"%d", ubi->ubi_num); + dev_set_name(&ubi->dev, UBI_NAME_STR"%d", ubi->ubi_num); err = device_register(&ubi->dev); if (err) return err; --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -329,7 +329,7 @@ int ubi_create_volume(struct ubi_device vol->dev.devt = dev; vol->dev.class = ubi_class; - sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); + dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id); err = device_register(&vol->dev); if (err) { ubi_err("cannot register device"); @@ -678,7 +678,7 @@ int ubi_add_volume(struct ubi_device *ub vol->dev.parent = &ubi->dev; vol->dev.devt = dev; vol->dev.class = ubi_class; - sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); + dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id); err = device_register(&vol->dev); if (err) goto out_gluebi; --- a/include/linux/mtd/concat.h +++ b/include/linux/mtd/concat.h @@ -13,7 +13,7 @@ struct mtd_info *mtd_concat_create( struct mtd_info *subdev[], /* subdevices to concatenate */ int num_devs, /* number of subdevices */ - char *name); /* name for the new device */ + const char *name); /* name for the new device */ void mtd_concat_destroy(struct mtd_info *mtd); ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-11-27 4:15 linux-next: manual merge of the mtd tree Stephen Rothwell 2008-11-27 5:25 ` Greg KH @ 2008-12-10 2:08 ` Stephen Rothwell 2008-12-10 2:27 ` Greg KH 1 sibling, 1 reply; 17+ messages in thread From: Stephen Rothwell @ 2008-12-10 2:08 UTC (permalink / raw) To: Greg KH Cc: linux-next, David Woodhouse, Atsushi Nemoto, Andrew Morton, Kay Sievers [-- Attachment #1: Type: text/plain, Size: 1832 bytes --] Hi Greg, On Thu, 27 Nov 2008 15:15:48 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Today's linux-next merge of the mtd tree got a conflict in > drivers/mtd/maps/physmap.c between commit > a64cbdb4da5c8482929e7bc9c542e9757ad3e0f1 ("mtd: struct device - replace > bus_id with dev_name(), dev_set_name()") from the driver-core tree and > commit 3136e903fa2d493ebc1b8a8fbdde2d3a17f85acd ("[MTD] physmap: fix > memory leak on physmap_flash_remove by using devres") from the mtd tree. > > I fixed it up (see below) and can carry it for a short while. > > Dave, you should apply the patch from the driver-core tree (which was > cc:d to you) (and cope with the rejects :-)) and let Greg KH know when > you have. > > diff --cc drivers/mtd/maps/physmap.c > index 8e2ee92,dfbf3f2..0000000 > --- a/drivers/mtd/maps/physmap.c > +++ b/drivers/mtd/maps/physmap.c > @@@ -114,10 -105,10 +105,10 @@@ static int physmap_flash_probe(struct p > (unsigned long long)(dev->resource[i].end - dev->resource[i].start + 1), > (unsigned long long)dev->resource[i].start); > > - info->res = request_mem_region(dev->resource[i].start, > - dev->resource[i].end - dev->resource[i].start + 1, > - dev_name(&dev->dev)); > - if (info->res == NULL) { > + if (!devm_request_mem_region(&dev->dev, > + dev->resource[i].start, > + dev->resource[i].end - dev->resource[i].start + 1, > - dev->dev.bus_id)) { > ++ dev_name(&dev->dev))) { > dev_err(&dev->dev, "Could not reserve memory region\n"); > err = -ENOMEM; > goto err_out; This conflict is now in the driver-core tree as the mtd tree has been merged into Linus' tree ... -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-10 2:08 ` Stephen Rothwell @ 2008-12-10 2:27 ` Greg KH 2008-12-10 2:34 ` Stephen Rothwell 0 siblings, 1 reply; 17+ messages in thread From: Greg KH @ 2008-12-10 2:27 UTC (permalink / raw) To: Stephen Rothwell Cc: linux-next, David Woodhouse, Atsushi Nemoto, Andrew Morton, Kay Sievers On Wed, Dec 10, 2008 at 01:08:06PM +1100, Stephen Rothwell wrote: > Hi Greg, > > On Thu, 27 Nov 2008 15:15:48 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > Today's linux-next merge of the mtd tree got a conflict in > > drivers/mtd/maps/physmap.c between commit > > a64cbdb4da5c8482929e7bc9c542e9757ad3e0f1 ("mtd: struct device - replace > > bus_id with dev_name(), dev_set_name()") from the driver-core tree and > > commit 3136e903fa2d493ebc1b8a8fbdde2d3a17f85acd ("[MTD] physmap: fix > > memory leak on physmap_flash_remove by using devres") from the mtd tree. > > > > I fixed it up (see below) and can carry it for a short while. > > > > Dave, you should apply the patch from the driver-core tree (which was > > cc:d to you) (and cope with the rejects :-)) and let Greg KH know when > > you have. > > > > diff --cc drivers/mtd/maps/physmap.c > > index 8e2ee92,dfbf3f2..0000000 > > --- a/drivers/mtd/maps/physmap.c > > +++ b/drivers/mtd/maps/physmap.c > > @@@ -114,10 -105,10 +105,10 @@@ static int physmap_flash_probe(struct p > > (unsigned long long)(dev->resource[i].end - dev->resource[i].start + 1), > > (unsigned long long)dev->resource[i].start); > > > > - info->res = request_mem_region(dev->resource[i].start, > > - dev->resource[i].end - dev->resource[i].start + 1, > > - dev_name(&dev->dev)); > > - if (info->res == NULL) { > > + if (!devm_request_mem_region(&dev->dev, > > + dev->resource[i].start, > > + dev->resource[i].end - dev->resource[i].start + 1, > > - dev->dev.bus_id)) { > > ++ dev_name(&dev->dev))) { > > dev_err(&dev->dev, "Could not reserve memory region\n"); > > err = -ENOMEM; > > goto err_out; > > This conflict is now in the driver-core tree as the mtd tree has been > merged into Linus' tree ... Ah, thanks, will update my tree with this one, didn't realize mtd had merged with Linus. greg k-h ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-10 2:27 ` Greg KH @ 2008-12-10 2:34 ` Stephen Rothwell 2008-12-10 4:04 ` Greg KH 0 siblings, 1 reply; 17+ messages in thread From: Stephen Rothwell @ 2008-12-10 2:34 UTC (permalink / raw) To: Greg KH Cc: linux-next, David Woodhouse, Atsushi Nemoto, Andrew Morton, Kay Sievers [-- Attachment #1: Type: text/plain, Size: 326 bytes --] Hi Greg, On Tue, 9 Dec 2008 18:27:11 -0800 Greg KH <greg@kroah.com> wrote: > > Ah, thanks, will update my tree with this one, didn't realize mtd had > merged with Linus. It only happened last night (my time). -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-10 2:34 ` Stephen Rothwell @ 2008-12-10 4:04 ` Greg KH 0 siblings, 0 replies; 17+ messages in thread From: Greg KH @ 2008-12-10 4:04 UTC (permalink / raw) To: Stephen Rothwell Cc: linux-next, David Woodhouse, Atsushi Nemoto, Andrew Morton, Kay Sievers On Wed, Dec 10, 2008 at 01:34:28PM +1100, Stephen Rothwell wrote: > Hi Greg, > > On Tue, 9 Dec 2008 18:27:11 -0800 Greg KH <greg@kroah.com> wrote: > > > > Ah, thanks, will update my tree with this one, didn't realize mtd had > > merged with Linus. > > It only happened last night (my time). I've now merged it all and pushed it out. thanks, greg k-h > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ ^ permalink raw reply [flat|nested] 17+ messages in thread
* linux-next: manual merge of the mtd tree
@ 2008-12-11 2:43 Stephen Rothwell
2008-12-11 10:11 ` Dmitry Eremin-Solenikov
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2008-12-11 2:43 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-next, Dmitry Baryshkov, Eric Miao, Russell King
[-- Attachment #1: Type: text/plain, Size: 882 bytes --]
Hi David,
Today's linux-next merge of the mtd tree got conflicts in
arch/arm/mach-pxa/corgi.c, arch/arm/mach-pxa/poodle.c and
arch/arm/mach-pxa/spitz.c between commits
4a9295ccb43ead9ec054d0bd374c992c692b2cf4 ("[ARM] pxa/corgi: add physmap
mapping for ROM"), 431a2cff07446b0325ec063e5b401ca7c11e0058 ("[ARM]
pxa/poodle: add physmap mapping for ROM") and
e5d3bf3c106c0557199076a57800adb85206c1ce ("[ARM] pxa/spitz: add physmap
mapping for ROM") from the arm tree and commit
6af7a8eb1eb2b5a0967fccf61e750b085d60ad48 ("[MTD] sharpsl-nand: move
registration to board code") from the mtd tree.
They seem to be overlapping changes. Can you guys rationalise this,
please, as I am in no position to fix these conflicts up.
I have dropped the mtd tree for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: linux-next: manual merge of the mtd tree 2008-12-11 2:43 Stephen Rothwell @ 2008-12-11 10:11 ` Dmitry Eremin-Solenikov 2008-12-11 10:23 ` Stephen Rothwell 0 siblings, 1 reply; 17+ messages in thread From: Dmitry Eremin-Solenikov @ 2008-12-11 10:11 UTC (permalink / raw) To: Stephen Rothwell; +Cc: David Woodhouse, linux-next, Eric Miao, Russell King 2008/12/11 Stephen Rothwell <sfr@canb.auug.org.au>: > Hi David, > > Today's linux-next merge of the mtd tree got conflicts in > arch/arm/mach-pxa/corgi.c, arch/arm/mach-pxa/poodle.c and > arch/arm/mach-pxa/spitz.c between commits > 4a9295ccb43ead9ec054d0bd374c992c692b2cf4 ("[ARM] pxa/corgi: add physmap > mapping for ROM"), 431a2cff07446b0325ec063e5b401ca7c11e0058 ("[ARM] > pxa/poodle: add physmap mapping for ROM") and > e5d3bf3c106c0557199076a57800adb85206c1ce ("[ARM] pxa/spitz: add physmap > mapping for ROM") from the arm tree and commit > 6af7a8eb1eb2b5a0967fccf61e750b085d60ad48 ("[MTD] sharpsl-nand: move > registration to board code") from the mtd tree. > > They seem to be overlapping changes. Can you guys rationalise this, > please, as I am in no position to fix these conflicts up. Unfortunately those changes are independant, so I don't quite understand what to do. If you'd prefer, I can provide merged versions of all 3 files, so that you can use this as merge resolution via git-rerere. Is that suitable for you? > > I have dropped the mtd tree for today. -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-11 10:11 ` Dmitry Eremin-Solenikov @ 2008-12-11 10:23 ` Stephen Rothwell 2008-12-11 10:32 ` Eric Miao 2008-12-12 10:29 ` Dmitry Eremin-Solenikov 0 siblings, 2 replies; 17+ messages in thread From: Stephen Rothwell @ 2008-12-11 10:23 UTC (permalink / raw) To: Dmitry Eremin-Solenikov Cc: David Woodhouse, linux-next, Eric Miao, Russell King [-- Attachment #1: Type: text/plain, Size: 505 bytes --] Hi Dmitry, On Thu, 11 Dec 2008 13:11:20 +0300 "Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com> wrote: > > Unfortunately those changes are independant, so I don't quite > understand what to do. > If you'd prefer, I can provide merged versions of all 3 files, so that > you can use this > as merge resolution via git-rerere. Is that suitable for you? That would be a great help, thanks. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: linux-next: manual merge of the mtd tree 2008-12-11 10:23 ` Stephen Rothwell @ 2008-12-11 10:32 ` Eric Miao 2008-12-12 10:29 ` Dmitry Eremin-Solenikov 1 sibling, 0 replies; 17+ messages in thread From: Eric Miao @ 2008-12-11 10:32 UTC (permalink / raw) To: Stephen Rothwell, Dmitry Eremin-Solenikov Cc: David Woodhouse, linux-next, Russell King > -----Original Message----- > From: Stephen Rothwell [mailto:sfr@canb.auug.org.au] > Sent: 2008年12月11日 18:24 > To: Dmitry Eremin-Solenikov > Cc: David Woodhouse; linux-next@vger.kernel.org; Eric Miao; Russell King > Subject: Re: linux-next: manual merge of the mtd tree > > Hi Dmitry, > > On Thu, 11 Dec 2008 13:11:20 +0300 "Dmitry Eremin-Solenikov" > <dbaryshkov@gmail.com> wrote: > > > > Unfortunately those changes are independant, so I don't quite > > understand what to do. > > If you'd prefer, I can provide merged versions of all 3 files, so that > > you can use this > > as merge resolution via git-rerere. Is that suitable for you? > > That would be a great help, thanks. I can do a trivial merge of mtd tree and resolve this, but it would be more reasonable if the merge can be made within one tree (I don't think cross-merging back-n-forth is something interesting) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-11 10:23 ` Stephen Rothwell 2008-12-11 10:32 ` Eric Miao @ 2008-12-12 10:29 ` Dmitry Eremin-Solenikov 2008-12-12 11:11 ` David Woodhouse 2008-12-12 23:05 ` Stephen Rothwell 1 sibling, 2 replies; 17+ messages in thread From: Dmitry Eremin-Solenikov @ 2008-12-12 10:29 UTC (permalink / raw) To: Stephen Rothwell; +Cc: David Woodhouse, linux-next, Eric Miao, Russell King [-- Attachment #1: Type: text/plain, Size: 712 bytes --] 2008/12/11 Stephen Rothwell <sfr@canb.auug.org.au>: > Hi Dmitry, > > On Thu, 11 Dec 2008 13:11:20 +0300 "Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com> wrote: >> >> Unfortunately those changes are independant, so I don't quite >> understand what to do. >> If you'd prefer, I can provide merged versions of all 3 files, so that >> you can use this >> as merge resolution via git-rerere. Is that suitable for you? > > That would be a great help, thanks. Sorry for the delay. I've attached the files resulting from the merge of today linux-next/master and mtd/master. > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ > -- With best wishes Dmitry [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: corgi.c --] [-- Type: text/x-csrc; name=corgi.c, Size: 16403 bytes --] /* * Support for Sharp SL-C7xx PDAs * Models: SL-C700 (Corgi), SL-C750 (Shepherd), SL-C760 (Husky) * * Copyright (c) 2004-2005 Richard Purdie * * Based on Sharp's 2.4 kernel patches/lubbock.c * * 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/init.h> #include <linux/platform_device.h> #include <linux/major.h> #include <linux/fs.h> #include <linux/interrupt.h> #include <linux/mmc/host.h> #include <linux/mtd/physmap.h> #include <linux/pm.h> #include <linux/gpio.h> #include <linux/backlight.h> #include <linux/io.h> #include <linux/spi/spi.h> #include <linux/spi/ads7846.h> #include <linux/spi/corgi_lcd.h> #include <linux/mtd/sharpsl.h> #include <video/w100fb.h> #include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> #include <mach/hardware.h> #include <asm/irq.h> #include <asm/system.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h> #include <mach/pxa-regs.h> #include <mach/pxa2xx-regs.h> #include <mach/mfp-pxa25x.h> #include <mach/i2c.h> #include <mach/irda.h> #include <mach/mmc.h> #include <mach/udc.h> #include <mach/pxa2xx_spi.h> #include <mach/corgi.h> #include <mach/sharpsl.h> #include <asm/mach/sharpsl_param.h> #include <asm/hardware/scoop.h> #include "generic.h" #include "devices.h" #include "sharpsl.h" static unsigned long corgi_pin_config[] __initdata = { /* Static Memory I/O */ GPIO78_nCS_2, /* w100fb */ GPIO80_nCS_4, /* scoop */ /* SSP1 */ GPIO23_SSP1_SCLK, GPIO25_SSP1_TXD, GPIO26_SSP1_RXD, GPIO24_GPIO, /* CORGI_GPIO_ADS7846_CS - SFRM as chip select */ /* I2S */ GPIO28_I2S_BITCLK_OUT, GPIO29_I2S_SDATA_IN, GPIO30_I2S_SDATA_OUT, GPIO31_I2S_SYNC, GPIO32_I2S_SYSCLK, /* Infra-Red */ GPIO47_FICP_TXD, GPIO46_FICP_RXD, /* FFUART */ GPIO40_FFUART_DTR, GPIO41_FFUART_RTS, GPIO39_FFUART_TXD, GPIO37_FFUART_DSR, GPIO34_FFUART_RXD, GPIO35_FFUART_CTS, /* PC Card */ GPIO48_nPOE, GPIO49_nPWE, GPIO50_nPIOR, GPIO51_nPIOW, GPIO52_nPCE_1, GPIO53_nPCE_2, GPIO54_nPSKTSEL, GPIO55_nPREG, GPIO56_nPWAIT, GPIO57_nIOIS16, /* MMC */ GPIO6_MMC_CLK, GPIO8_MMC_CS0, /* GPIO */ GPIO9_GPIO, /* CORGI_GPIO_nSD_DETECT */ GPIO7_GPIO, /* CORGI_GPIO_nSD_WP */ GPIO33_GPIO, /* CORGI_GPIO_SD_PWR */ GPIO22_GPIO, /* CORGI_GPIO_IR_ON */ GPIO44_GPIO, /* CORGI_GPIO_HSYNC */ GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, }; /* * Corgi SCOOP Device */ static struct resource corgi_scoop_resources[] = { [0] = { .start = 0x10800000, .end = 0x10800fff, .flags = IORESOURCE_MEM, }, }; static struct scoop_config corgi_scoop_setup = { .io_dir = CORGI_SCOOP_IO_DIR, .io_out = CORGI_SCOOP_IO_OUT, .gpio_base = CORGI_SCOOP_GPIO_BASE, }; struct platform_device corgiscoop_device = { .name = "sharp-scoop", .id = -1, .dev = { .platform_data = &corgi_scoop_setup, }, .num_resources = ARRAY_SIZE(corgi_scoop_resources), .resource = corgi_scoop_resources, }; static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = { { .dev = &corgiscoop_device.dev, .irq = CORGI_IRQ_GPIO_CF_IRQ, .cd_irq = CORGI_IRQ_GPIO_CF_CD, .cd_irq_str = "PCMCIA0 CD", }, }; static struct scoop_pcmcia_config corgi_pcmcia_config = { .devs = &corgi_pcmcia_scoop[0], .num_devs = 1, }; EXPORT_SYMBOL(corgiscoop_device); static struct w100_mem_info corgi_fb_mem = { .ext_cntl = 0x00040003, .sdram_mode_reg = 0x00650021, .ext_timing_cntl = 0x10002a4a, .io_cntl = 0x7ff87012, .size = 0x1fffff, }; static struct w100_gen_regs corgi_fb_regs = { .lcd_format = 0x00000003, .lcdd_cntl1 = 0x01CC0000, .lcdd_cntl2 = 0x0003FFFF, .genlcd_cntl1 = 0x00FFFF0D, .genlcd_cntl2 = 0x003F3003, .genlcd_cntl3 = 0x000102aa, }; static struct w100_gpio_regs corgi_fb_gpio = { .init_data1 = 0x000000bf, .init_data2 = 0x00000000, .gpio_dir1 = 0x00000000, .gpio_oe1 = 0x03c0feff, .gpio_dir2 = 0x00000000, .gpio_oe2 = 0x00000000, }; static struct w100_mode corgi_fb_modes[] = { { .xres = 480, .yres = 640, .left_margin = 0x56, .right_margin = 0x55, .upper_margin = 0x03, .lower_margin = 0x00, .crtc_ss = 0x82360056, .crtc_ls = 0xA0280000, .crtc_gs = 0x80280028, .crtc_vpos_gs = 0x02830002, .crtc_rev = 0x00400008, .crtc_dclk = 0xA0000000, .crtc_gclk = 0x8015010F, .crtc_goe = 0x80100110, .crtc_ps1_active = 0x41060010, .pll_freq = 75, .fast_pll_freq = 100, .sysclk_src = CLK_SRC_PLL, .sysclk_divider = 0, .pixclk_src = CLK_SRC_PLL, .pixclk_divider = 2, .pixclk_divider_rotated = 6, },{ .xres = 240, .yres = 320, .left_margin = 0x27, .right_margin = 0x2e, .upper_margin = 0x01, .lower_margin = 0x00, .crtc_ss = 0x81170027, .crtc_ls = 0xA0140000, .crtc_gs = 0xC0140014, .crtc_vpos_gs = 0x00010141, .crtc_rev = 0x00400008, .crtc_dclk = 0xA0000000, .crtc_gclk = 0x8015010F, .crtc_goe = 0x80100110, .crtc_ps1_active = 0x41060010, .pll_freq = 0, .fast_pll_freq = 0, .sysclk_src = CLK_SRC_XTAL, .sysclk_divider = 0, .pixclk_src = CLK_SRC_XTAL, .pixclk_divider = 1, .pixclk_divider_rotated = 1, }, }; static struct w100fb_mach_info corgi_fb_info = { .init_mode = INIT_MODE_ROTATED, .mem = &corgi_fb_mem, .regs = &corgi_fb_regs, .modelist = &corgi_fb_modes[0], .num_modes = 2, .gpio = &corgi_fb_gpio, .xtal_freq = 12500000, .xtal_dbl = 0, }; static struct resource corgi_fb_resources[] = { [0] = { .start = 0x08000000, .end = 0x08ffffff, .flags = IORESOURCE_MEM, }, }; static struct platform_device corgifb_device = { .name = "w100fb", .id = -1, .num_resources = ARRAY_SIZE(corgi_fb_resources), .resource = corgi_fb_resources, .dev = { .platform_data = &corgi_fb_info, }, }; /* * Corgi Keyboard Device */ static struct platform_device corgikbd_device = { .name = "corgi-keyboard", .id = -1, }; /* * Corgi LEDs */ static struct gpio_led corgi_gpio_leds[] = { { .name = "corgi:amber:charge", .default_trigger = "sharpsl-charge", .gpio = CORGI_GPIO_LED_ORANGE, }, { .name = "corgi:green:mail", .default_trigger = "nand-disk", .gpio = CORGI_GPIO_LED_GREEN, }, }; static struct gpio_led_platform_data corgi_gpio_leds_info = { .leds = corgi_gpio_leds, .num_leds = ARRAY_SIZE(corgi_gpio_leds), }; static struct platform_device corgiled_device = { .name = "leds-gpio", .id = -1, .dev = { .platform_data = &corgi_gpio_leds_info, }, }; /* * MMC/SD Device * * The card detect interrupt isn't debounced so we delay it by 250ms * to give the card a chance to fully insert/eject. */ static struct pxamci_platform_data corgi_mci_platform_data; static int corgi_mci_init(struct device *dev, irq_handler_t corgi_detect_int, void *data) { int err; err = gpio_request(CORGI_GPIO_nSD_DETECT, "nSD_DETECT"); if (err) goto err_out; err = gpio_request(CORGI_GPIO_nSD_WP, "nSD_WP"); if (err) goto err_free_1; err = gpio_request(CORGI_GPIO_SD_PWR, "SD_PWR"); if (err) goto err_free_2; gpio_direction_input(CORGI_GPIO_nSD_DETECT); gpio_direction_input(CORGI_GPIO_nSD_WP); gpio_direction_output(CORGI_GPIO_SD_PWR, 0); corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250); err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "MMC card detect", data); if (err) { pr_err("%s: MMC/SD: can't request MMC card detect IRQ\n", __func__); goto err_free_3; } return 0; err_free_3: gpio_free(CORGI_GPIO_SD_PWR); err_free_2: gpio_free(CORGI_GPIO_nSD_WP); err_free_1: gpio_free(CORGI_GPIO_nSD_DETECT); err_out: return err; } static void corgi_mci_setpower(struct device *dev, unsigned int vdd) { struct pxamci_platform_data* p_d = dev->platform_data; gpio_set_value(CORGI_GPIO_SD_PWR, ((1 << vdd) & p_d->ocr_mask)); } static int corgi_mci_get_ro(struct device *dev) { return gpio_get_value(CORGI_GPIO_nSD_WP); } static void corgi_mci_exit(struct device *dev, void *data) { free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data); gpio_free(CORGI_GPIO_SD_PWR); gpio_free(CORGI_GPIO_nSD_WP); gpio_free(CORGI_GPIO_nSD_DETECT); } static struct pxamci_platform_data corgi_mci_platform_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .init = corgi_mci_init, .get_ro = corgi_mci_get_ro, .setpower = corgi_mci_setpower, .exit = corgi_mci_exit, }; /* * Irda */ static void corgi_irda_transceiver_mode(struct device *dev, int mode) { gpio_set_value(CORGI_GPIO_IR_ON, mode & IR_OFF); pxa2xx_transceiver_mode(dev, mode); } static int corgi_irda_startup(struct device *dev) { int err; err = gpio_request(CORGI_GPIO_IR_ON, "IR_ON"); if (err) return err; gpio_direction_output(CORGI_GPIO_IR_ON, 1); return 0; } static void corgi_irda_shutdown(struct device *dev) { gpio_free(CORGI_GPIO_IR_ON); } static struct pxaficp_platform_data corgi_ficp_platform_data = { .transceiver_cap = IR_SIRMODE | IR_OFF, .transceiver_mode = corgi_irda_transceiver_mode, .startup = corgi_irda_startup, .shutdown = corgi_irda_shutdown, }; /* * USB Device Controller */ static struct pxa2xx_udc_mach_info udc_info __initdata = { /* no connect GPIO; corgi can't tell connection status */ .gpio_pullup = CORGI_GPIO_USB_PULLUP, }; #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MASTER) static struct pxa2xx_spi_master corgi_spi_info = { .num_chipselect = 3, }; static struct ads7846_platform_data corgi_ads7846_info = { .model = 7846, .vref_delay_usecs = 100, .x_plate_ohms = 419, .y_plate_ohms = 486, .gpio_pendown = CORGI_GPIO_TP_INT, }; static void corgi_ads7846_cs(u32 command) { gpio_set_value(CORGI_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip corgi_ads7846_chip = { .cs_control = corgi_ads7846_cs, }; static void corgi_bl_kick_battery(void) { void (*kick_batt)(void); kick_batt = symbol_get(sharpsl_battery_kick); if (kick_batt) { kick_batt(); symbol_put(sharpsl_battery_kick); } } static struct corgi_lcd_platform_data corgi_lcdcon_info = { .init_mode = CORGI_LCD_MODE_VGA, .max_intensity = 0x2f, .default_intensity = 0x1f, .limit_mask = 0x0b, .gpio_backlight_cont = CORGI_GPIO_BACKLIGHT_CONT, .gpio_backlight_on = -1, .kick_battery = corgi_bl_kick_battery, }; static void corgi_lcdcon_cs(u32 command) { gpio_set_value(CORGI_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip corgi_lcdcon_chip = { .cs_control = corgi_lcdcon_cs, }; static void corgi_max1111_cs(u32 command) { gpio_set_value(CORGI_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip corgi_max1111_chip = { .cs_control = corgi_max1111_cs, }; static struct spi_board_info corgi_spi_devices[] = { { .modalias = "ads7846", .max_speed_hz = 1200000, .bus_num = 1, .chip_select = 0, .platform_data = &corgi_ads7846_info, .controller_data= &corgi_ads7846_chip, .irq = gpio_to_irq(CORGI_GPIO_TP_INT), }, { .modalias = "corgi-lcd", .max_speed_hz = 50000, .bus_num = 1, .chip_select = 1, .platform_data = &corgi_lcdcon_info, .controller_data= &corgi_lcdcon_chip, }, { .modalias = "max1111", .max_speed_hz = 450000, .bus_num = 1, .chip_select = 2, .controller_data= &corgi_max1111_chip, }, }; static void __init corgi_init_spi(void) { int err; err = gpio_request(CORGI_GPIO_ADS7846_CS, "ADS7846_CS"); if (err) return; err = gpio_request(CORGI_GPIO_LCDCON_CS, "LCDCON_CS"); if (err) goto err_free_1; err = gpio_request(CORGI_GPIO_MAX1111_CS, "MAX1111_CS"); if (err) goto err_free_2; gpio_direction_output(CORGI_GPIO_ADS7846_CS, 1); gpio_direction_output(CORGI_GPIO_LCDCON_CS, 1); gpio_direction_output(CORGI_GPIO_MAX1111_CS, 1); pxa2xx_set_spi_info(1, &corgi_spi_info); spi_register_board_info(ARRAY_AND_SIZE(corgi_spi_devices)); return; err_free_2: gpio_free(CORGI_GPIO_LCDCON_CS); err_free_1: gpio_free(CORGI_GPIO_ADS7846_CS); } #else static inline void corgi_init_spi(void) {} #endif static struct mtd_partition sharpsl_nand_partitions[] = { { .name = "System Area", .offset = 0, .size = 7 * 1024 * 1024, }, { .name = "Root Filesystem", .offset = 7 * 1024 * 1024, .size = 25 * 1024 * 1024, }, { .name = "Home Filesystem", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, }, }; static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr sharpsl_bbt = { .options = 0, .offs = 4, .len = 2, .pattern = scan_ff_pattern }; static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { .badblock_pattern = &sharpsl_bbt, .partitions = sharpsl_nand_partitions, .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), }; static struct resource sharpsl_nand_resources[] = { { .start = 0x0C000000, .end = 0x0C000FFF, .flags = IORESOURCE_MEM, }, }; static struct platform_device sharpsl_nand_device = { .name = "sharpsl-nand", .id = -1, .resource = sharpsl_nand_resources, .num_resources = ARRAY_SIZE(sharpsl_nand_resources), .dev.platform_data = &sharpsl_nand_platform_data, }; static struct mtd_partition sharpsl_rom_parts[] = { { .name ="Boot PROM Filesystem", .offset = 0x00120000, .size = MTDPART_SIZ_FULL, }, }; static struct physmap_flash_data sharpsl_rom_data = { .width = 2, .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), .parts = sharpsl_rom_parts, }; static struct resource sharpsl_rom_resources[] = { { .start = 0x00000000, .end = 0x007fffff, .flags = IORESOURCE_MEM, }, }; static struct platform_device sharpsl_rom_device = { .name = "physmap-flash", .id = -1, .resource = sharpsl_rom_resources, .num_resources = ARRAY_SIZE(sharpsl_rom_resources), .dev.platform_data = &sharpsl_rom_data, }; static struct platform_device *devices[] __initdata = { &corgiscoop_device, &corgifb_device, &corgikbd_device, &corgiled_device, &sharpsl_nand_device, &sharpsl_rom_device, }; static void corgi_poweroff(void) { if (!machine_is_corgi()) /* Green LED off tells the bootloader to halt */ gpio_set_value(CORGI_GPIO_LED_GREEN, 0); arm_machine_restart('h'); } static void corgi_restart(char mode) { if (!machine_is_corgi()) /* Green LED on tells the bootloader to reboot */ gpio_set_value(CORGI_GPIO_LED_GREEN, 1); arm_machine_restart('h'); } static void __init corgi_init(void) { pm_power_off = corgi_poweroff; arm_pm_restart = corgi_restart; /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ PCFR |= PCFR_OPDE; pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config)); corgi_init_spi(); pxa_set_udc_info(&udc_info); pxa_set_mci_info(&corgi_mci_platform_data); pxa_set_ficp_info(&corgi_ficp_platform_data); pxa_set_i2c_info(NULL); platform_scoop_config = &corgi_pcmcia_config; if (machine_is_husky()) sharpsl_nand_partitions[1].size = 53 * 1024 * 1024; platform_add_devices(devices, ARRAY_SIZE(devices)); } static void __init fixup_corgi(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { sharpsl_save_param(); mi->nr_banks=1; mi->bank[0].start = 0xa0000000; mi->bank[0].node = 0; if (machine_is_corgi()) mi->bank[0].size = (32*1024*1024); else mi->bank[0].size = (64*1024*1024); } #ifdef CONFIG_MACH_CORGI MACHINE_START(CORGI, "SHARP Corgi") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, .map_io = pxa_map_io, .init_irq = pxa25x_init_irq, .init_machine = corgi_init, .timer = &pxa_timer, MACHINE_END #endif #ifdef CONFIG_MACH_SHEPHERD MACHINE_START(SHEPHERD, "SHARP Shepherd") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, .map_io = pxa_map_io, .init_irq = pxa25x_init_irq, .init_machine = corgi_init, .timer = &pxa_timer, MACHINE_END #endif #ifdef CONFIG_MACH_HUSKY MACHINE_START(HUSKY, "SHARP Husky") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, .map_io = pxa_map_io, .init_irq = pxa25x_init_irq, .init_machine = corgi_init, .timer = &pxa_timer, MACHINE_END #endif [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: poodle.c --] [-- Type: text/x-csrc; name=poodle.c, Size: 12244 bytes --] /* * linux/arch/arm/mach-pxa/poodle.c * * Support for the SHARP Poodle Board. * * Based on: * linux/arch/arm/mach-pxa/lubbock.c Author: Nicolas Pitre * * 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. * * Change Log * 12-Dec-2002 Sharp Corporation for Poodle * John Lenz <lenz@cs.wisc.edu> updates to 2.6 */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/fb.h> #include <linux/pm.h> #include <linux/delay.h> #include <linux/mtd/physmap.h> #include <linux/gpio.h> #include <linux/spi/spi.h> #include <linux/spi/ads7846.h> #include <linux/mtd/sharpsl.h> #include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/irq.h> #include <asm/setup.h> #include <asm/system.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h> #include <mach/pxa-regs.h> #include <mach/pxa2xx-regs.h> #include <mach/mfp-pxa25x.h> #include <mach/mmc.h> #include <mach/udc.h> #include <mach/i2c.h> #include <mach/irda.h> #include <mach/poodle.h> #include <mach/pxafb.h> #include <mach/sharpsl.h> #include <mach/ssp.h> #include <mach/pxa2xx_spi.h> #include <asm/hardware/scoop.h> #include <asm/hardware/locomo.h> #include <asm/mach/sharpsl_param.h> #include "generic.h" #include "devices.h" #include "sharpsl.h" static unsigned long poodle_pin_config[] __initdata = { /* I/O */ GPIO79_nCS_3, GPIO80_nCS_4, GPIO18_RDY, /* Clock */ GPIO12_32KHz, /* SSP1 */ GPIO23_SSP1_SCLK, GPIO25_SSP1_TXD, GPIO26_SSP1_RXD, GPIO24_GPIO, /* POODLE_GPIO_TP_CS - SFRM as chip select */ /* I2S */ GPIO28_I2S_BITCLK_OUT, GPIO29_I2S_SDATA_IN, GPIO30_I2S_SDATA_OUT, GPIO31_I2S_SYNC, GPIO32_I2S_SYSCLK, /* Infra-Red */ GPIO47_FICP_TXD, GPIO46_FICP_RXD, /* FFUART */ GPIO40_FFUART_DTR, GPIO41_FFUART_RTS, GPIO39_FFUART_TXD, GPIO37_FFUART_DSR, GPIO34_FFUART_RXD, GPIO35_FFUART_CTS, /* LCD */ GPIO58_LCD_LDD_0, GPIO59_LCD_LDD_1, GPIO60_LCD_LDD_2, GPIO61_LCD_LDD_3, GPIO62_LCD_LDD_4, GPIO63_LCD_LDD_5, GPIO64_LCD_LDD_6, GPIO65_LCD_LDD_7, GPIO66_LCD_LDD_8, GPIO67_LCD_LDD_9, GPIO68_LCD_LDD_10, GPIO69_LCD_LDD_11, GPIO70_LCD_LDD_12, GPIO71_LCD_LDD_13, GPIO72_LCD_LDD_14, GPIO73_LCD_LDD_15, GPIO74_LCD_FCLK, GPIO75_LCD_LCLK, GPIO76_LCD_PCLK, GPIO77_LCD_BIAS, /* PC Card */ GPIO48_nPOE, GPIO49_nPWE, GPIO50_nPIOR, GPIO51_nPIOW, GPIO52_nPCE_1, GPIO53_nPCE_2, GPIO54_nPSKTSEL, GPIO55_nPREG, GPIO56_nPWAIT, GPIO57_nIOIS16, /* MMC */ GPIO6_MMC_CLK, GPIO8_MMC_CS0, /* GPIO */ GPIO9_GPIO, /* POODLE_GPIO_nSD_DETECT */ GPIO7_GPIO, /* POODLE_GPIO_nSD_WP */ GPIO3_GPIO, /* POODLE_GPIO_SD_PWR */ GPIO33_GPIO, /* POODLE_GPIO_SD_PWR1 */ GPIO20_GPIO, /* POODLE_GPIO_USB_PULLUP */ GPIO22_GPIO, /* POODLE_GPIO_IR_ON */ }; static struct resource poodle_scoop_resources[] = { [0] = { .start = 0x10800000, .end = 0x10800fff, .flags = IORESOURCE_MEM, }, }; static struct scoop_config poodle_scoop_setup = { .io_dir = POODLE_SCOOP_IO_DIR, .io_out = POODLE_SCOOP_IO_OUT, .gpio_base = POODLE_SCOOP_GPIO_BASE, }; struct platform_device poodle_scoop_device = { .name = "sharp-scoop", .id = -1, .dev = { .platform_data = &poodle_scoop_setup, }, .num_resources = ARRAY_SIZE(poodle_scoop_resources), .resource = poodle_scoop_resources, }; static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = { { .dev = &poodle_scoop_device.dev, .irq = POODLE_IRQ_GPIO_CF_IRQ, .cd_irq = POODLE_IRQ_GPIO_CF_CD, .cd_irq_str = "PCMCIA0 CD", }, }; static struct scoop_pcmcia_config poodle_pcmcia_config = { .devs = &poodle_pcmcia_scoop[0], .num_devs = 1, }; EXPORT_SYMBOL(poodle_scoop_device); /* LoCoMo device */ static struct resource locomo_resources[] = { [0] = { .start = 0x10000000, .end = 0x10001fff, .flags = IORESOURCE_MEM, }, [1] = { .start = IRQ_GPIO(10), .end = IRQ_GPIO(10), .flags = IORESOURCE_IRQ, }, }; struct platform_device poodle_locomo_device = { .name = "locomo", .id = 0, .num_resources = ARRAY_SIZE(locomo_resources), .resource = locomo_resources, }; EXPORT_SYMBOL(poodle_locomo_device); #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) static struct pxa2xx_spi_master poodle_spi_info = { .num_chipselect = 1, }; static struct ads7846_platform_data poodle_ads7846_info = { .model = 7846, .vref_delay_usecs = 100, .x_plate_ohms = 419, .y_plate_ohms = 486, .gpio_pendown = POODLE_GPIO_TP_INT, }; static void ads7846_cs(u32 command) { gpio_set_value(POODLE_GPIO_TP_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip poodle_ads7846_chip = { .cs_control = ads7846_cs, }; static struct spi_board_info poodle_spi_devices[] = { { .modalias = "ads7846", .max_speed_hz = 10000, .bus_num = 1, .platform_data = &poodle_ads7846_info, .controller_data= &poodle_ads7846_chip, .irq = gpio_to_irq(POODLE_GPIO_TP_INT), }, }; static void __init poodle_init_spi(void) { int err; err = gpio_request(POODLE_GPIO_TP_CS, "ADS7846_CS"); if (err) return; gpio_direction_output(POODLE_GPIO_TP_CS, 1); pxa2xx_set_spi_info(1, &poodle_spi_info); spi_register_board_info(ARRAY_AND_SIZE(poodle_spi_devices)); } #else static inline void poodle_init_spi(void) {} #endif /* * MMC/SD Device * * The card detect interrupt isn't debounced so we delay it by 250ms * to give the card a chance to fully insert/eject. */ static struct pxamci_platform_data poodle_mci_platform_data; static int poodle_mci_init(struct device *dev, irq_handler_t poodle_detect_int, void *data) { int err; err = gpio_request(POODLE_GPIO_nSD_DETECT, "nSD_DETECT"); if (err) goto err_out; err = gpio_request(POODLE_GPIO_nSD_WP, "nSD_WP"); if (err) goto err_free_1; err = gpio_request(POODLE_GPIO_SD_PWR, "SD_PWR"); if (err) goto err_free_2; err = gpio_request(POODLE_GPIO_SD_PWR1, "SD_PWR1"); if (err) goto err_free_3; gpio_direction_input(POODLE_GPIO_nSD_DETECT); gpio_direction_input(POODLE_GPIO_nSD_WP); gpio_direction_output(POODLE_GPIO_SD_PWR, 0); gpio_direction_output(POODLE_GPIO_SD_PWR1, 0); poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "MMC card detect", data); if (err) { pr_err("%s: MMC/SD: can't request MMC card detect IRQ\n", __func__); goto err_free_4; } return 0; err_free_4: gpio_free(POODLE_GPIO_SD_PWR1); err_free_3: gpio_free(POODLE_GPIO_SD_PWR); err_free_2: gpio_free(POODLE_GPIO_nSD_WP); err_free_1: gpio_free(POODLE_GPIO_nSD_DETECT); err_out: return err; } static void poodle_mci_setpower(struct device *dev, unsigned int vdd) { struct pxamci_platform_data* p_d = dev->platform_data; if ((1 << vdd) & p_d->ocr_mask) { gpio_set_value(POODLE_GPIO_SD_PWR, 1); mdelay(2); gpio_set_value(POODLE_GPIO_SD_PWR1, 1); } else { gpio_set_value(POODLE_GPIO_SD_PWR1, 0); gpio_set_value(POODLE_GPIO_SD_PWR, 0); } } static int poodle_mci_get_ro(struct device *dev) { return !!gpio_get_value(POODLE_GPIO_nSD_WP); return GPLR(POODLE_GPIO_nSD_WP) & GPIO_bit(POODLE_GPIO_nSD_WP); } static void poodle_mci_exit(struct device *dev, void *data) { free_irq(POODLE_IRQ_GPIO_nSD_DETECT, data); gpio_free(POODLE_GPIO_SD_PWR1); gpio_free(POODLE_GPIO_SD_PWR); gpio_free(POODLE_GPIO_nSD_WP); gpio_free(POODLE_GPIO_nSD_DETECT); } static struct pxamci_platform_data poodle_mci_platform_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .init = poodle_mci_init, .get_ro = poodle_mci_get_ro, .setpower = poodle_mci_setpower, .exit = poodle_mci_exit, }; /* * Irda */ static void poodle_irda_transceiver_mode(struct device *dev, int mode) { gpio_set_value(POODLE_GPIO_IR_ON, mode & IR_OFF); pxa2xx_transceiver_mode(dev, mode); } static int poodle_irda_startup(struct device *dev) { int err; err = gpio_request(POODLE_GPIO_IR_ON, "IR_ON"); if (err) return err; gpio_direction_output(POODLE_GPIO_IR_ON, 1); return 0; } static void poodle_irda_shutdown(struct device *dev) { gpio_free(POODLE_GPIO_IR_ON); } static struct pxaficp_platform_data poodle_ficp_platform_data = { .transceiver_cap = IR_SIRMODE | IR_OFF, .transceiver_mode = poodle_irda_transceiver_mode, .startup = poodle_irda_startup, .shutdown = poodle_irda_shutdown, }; /* * USB Device Controller */ static struct pxa2xx_udc_mach_info udc_info __initdata = { /* no connect GPIO; poodle can't tell connection status */ .gpio_pullup = POODLE_GPIO_USB_PULLUP, }; /* PXAFB device */ static struct pxafb_mode_info poodle_fb_mode = { .pixclock = 144700, .xres = 320, .yres = 240, .bpp = 16, .hsync_len = 7, .left_margin = 11, .right_margin = 30, .vsync_len = 2, .upper_margin = 2, .lower_margin = 0, .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, }; static struct pxafb_mach_info poodle_fb_info = { .modes = &poodle_fb_mode, .num_modes = 1, .lcd_conn = LCD_COLOR_TFT_16BPP, }; static struct mtd_partition sharpsl_nand_partitions[] = { { .name = "System Area", .offset = 0, .size = 7 * 1024 * 1024, }, { .name = "Root Filesystem", .offset = 7 * 1024 * 1024, .size = 22 * 1024 * 1024, }, { .name = "Home Filesystem", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, }, }; static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr sharpsl_bbt = { .options = 0, .offs = 4, .len = 2, .pattern = scan_ff_pattern }; static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { .badblock_pattern = &sharpsl_bbt, .partitions = sharpsl_nand_partitions, .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), }; static struct resource sharpsl_nand_resources[] = { { .start = 0x0C000000, .end = 0x0C000FFF, .flags = IORESOURCE_MEM, }, }; static struct platform_device sharpsl_nand_device = { .name = "sharpsl-nand", .id = -1, .resource = sharpsl_nand_resources, .num_resources = ARRAY_SIZE(sharpsl_nand_resources), .dev.platform_data = &sharpsl_nand_platform_data, }; static struct mtd_partition sharpsl_rom_parts[] = { { .name ="Boot PROM Filesystem", .offset = 0x00120000, .size = MTDPART_SIZ_FULL, }, }; static struct physmap_flash_data sharpsl_rom_data = { .width = 2, .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), .parts = sharpsl_rom_parts, }; static struct resource sharpsl_rom_resources[] = { { .start = 0x00000000, .end = 0x007fffff, .flags = IORESOURCE_MEM, }, }; static struct platform_device sharpsl_rom_device = { .name = "physmap-flash", .id = -1, .resource = sharpsl_rom_resources, .num_resources = ARRAY_SIZE(sharpsl_rom_resources), .dev.platform_data = &sharpsl_rom_data, }; static struct platform_device *devices[] __initdata = { &poodle_locomo_device, &poodle_scoop_device, &sharpsl_nand_device, &sharpsl_rom_device, }; static void poodle_poweroff(void) { arm_machine_restart('h'); } static void poodle_restart(char mode) { arm_machine_restart('h'); } static void __init poodle_init(void) { int ret = 0; pm_power_off = poodle_poweroff; arm_pm_restart = poodle_restart; PCFR |= PCFR_OPDE; pxa2xx_mfp_config(ARRAY_AND_SIZE(poodle_pin_config)); platform_scoop_config = &poodle_pcmcia_config; ret = platform_add_devices(devices, ARRAY_SIZE(devices)); if (ret) pr_warning("poodle: Unable to register LoCoMo device\n"); set_pxa_fb_parent(&poodle_locomo_device.dev); set_pxa_fb_info(&poodle_fb_info); pxa_set_udc_info(&udc_info); pxa_set_mci_info(&poodle_mci_platform_data); pxa_set_ficp_info(&poodle_ficp_platform_data); pxa_set_i2c_info(NULL); poodle_init_spi(); } static void __init fixup_poodle(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { sharpsl_save_param(); mi->nr_banks=1; mi->bank[0].start = 0xa0000000; mi->bank[0].node = 0; mi->bank[0].size = (32*1024*1024); } MACHINE_START(POODLE, "SHARP Poodle") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_poodle, .map_io = pxa_map_io, .init_irq = pxa25x_init_irq, .timer = &pxa_timer, .init_machine = poodle_init, MACHINE_END [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #4: spitz.c --] [-- Type: text/x-csrc; name=spitz.c, Size: 19323 bytes --] /* * Support for Sharp SL-Cxx00 Series of PDAs * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi) * * Copyright (c) 2005 Richard Purdie * * Based on Sharp's 2.4 kernel patches/lubbock.c * * 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/init.h> #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/major.h> #include <linux/fs.h> #include <linux/interrupt.h> #include <linux/gpio.h> #include <linux/leds.h> #include <linux/mmc/host.h> #include <linux/mtd/physmap.h> #include <linux/pm.h> #include <linux/backlight.h> #include <linux/io.h> #include <linux/i2c.h> #include <linux/i2c/pca953x.h> #include <linux/spi/spi.h> #include <linux/spi/ads7846.h> #include <linux/spi/corgi_lcd.h> #include <linux/mtd/sharpsl.h> #include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> #include <mach/hardware.h> #include <asm/irq.h> #include <asm/system.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h> #include <mach/pxa-regs.h> #include <mach/pxa2xx-regs.h> #include <mach/mfp-pxa27x.h> #include <mach/pxa27x-udc.h> #include <mach/reset.h> #include <mach/i2c.h> #include <mach/irda.h> #include <mach/mmc.h> #include <mach/ohci.h> #include <mach/udc.h> #include <mach/pxafb.h> #include <mach/pxa2xx_spi.h> #include <mach/spitz.h> #include <mach/sharpsl.h> #include <asm/mach/sharpsl_param.h> #include <asm/hardware/scoop.h> #include "generic.h" #include "devices.h" #include "sharpsl.h" static unsigned long spitz_pin_config[] __initdata = { /* Chip Selects */ GPIO78_nCS_2, /* SCOOP #2 */ GPIO79_nCS_3, /* NAND */ GPIO80_nCS_4, /* SCOOP #1 */ /* LCD - 16bpp Active TFT */ GPIO58_LCD_LDD_0, GPIO59_LCD_LDD_1, GPIO60_LCD_LDD_2, GPIO61_LCD_LDD_3, GPIO62_LCD_LDD_4, GPIO63_LCD_LDD_5, GPIO64_LCD_LDD_6, GPIO65_LCD_LDD_7, GPIO66_LCD_LDD_8, GPIO67_LCD_LDD_9, GPIO68_LCD_LDD_10, GPIO69_LCD_LDD_11, GPIO70_LCD_LDD_12, GPIO71_LCD_LDD_13, GPIO72_LCD_LDD_14, GPIO73_LCD_LDD_15, GPIO74_LCD_FCLK, GPIO75_LCD_LCLK, GPIO76_LCD_PCLK, /* PC Card */ GPIO48_nPOE, GPIO49_nPWE, GPIO50_nPIOR, GPIO51_nPIOW, GPIO85_nPCE_1, GPIO54_nPCE_2, GPIO55_nPREG, GPIO56_nPWAIT, GPIO57_nIOIS16, GPIO104_PSKTSEL, /* MMC */ GPIO32_MMC_CLK, GPIO112_MMC_CMD, GPIO92_MMC_DAT_0, GPIO109_MMC_DAT_1, GPIO110_MMC_DAT_2, GPIO111_MMC_DAT_3, /* GPIOs */ GPIO9_GPIO, /* SPITZ_GPIO_nSD_DETECT */ GPIO81_GPIO, /* SPITZ_GPIO_nSD_WP */ GPIO41_GPIO, /* SPITZ_GPIO_USB_CONNECT */ GPIO37_GPIO, /* SPITZ_GPIO_USB_HOST */ GPIO35_GPIO, /* SPITZ_GPIO_USB_DEVICE */ GPIO22_GPIO, /* SPITZ_GPIO_HSYNC */ GPIO94_GPIO, /* SPITZ_GPIO_CF_CD */ GPIO105_GPIO, /* SPITZ_GPIO_CF_IRQ */ GPIO106_GPIO, /* SPITZ_GPIO_CF2_IRQ */ /* I2C */ GPIO117_I2C_SCL, GPIO118_I2C_SDA, GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, }; /* * Spitz SCOOP Device #1 */ static struct resource spitz_scoop_resources[] = { [0] = { .start = 0x10800000, .end = 0x10800fff, .flags = IORESOURCE_MEM, }, }; static struct scoop_config spitz_scoop_setup = { .io_dir = SPITZ_SCP_IO_DIR, .io_out = SPITZ_SCP_IO_OUT, .suspend_clr = SPITZ_SCP_SUS_CLR, .suspend_set = SPITZ_SCP_SUS_SET, .gpio_base = SPITZ_SCP_GPIO_BASE, }; struct platform_device spitzscoop_device = { .name = "sharp-scoop", .id = 0, .dev = { .platform_data = &spitz_scoop_setup, }, .num_resources = ARRAY_SIZE(spitz_scoop_resources), .resource = spitz_scoop_resources, }; /* * Spitz SCOOP Device #2 */ static struct resource spitz_scoop2_resources[] = { [0] = { .start = 0x08800040, .end = 0x08800fff, .flags = IORESOURCE_MEM, }, }; static struct scoop_config spitz_scoop2_setup = { .io_dir = SPITZ_SCP2_IO_DIR, .io_out = SPITZ_SCP2_IO_OUT, .suspend_clr = SPITZ_SCP2_SUS_CLR, .suspend_set = SPITZ_SCP2_SUS_SET, .gpio_base = SPITZ_SCP2_GPIO_BASE, }; struct platform_device spitzscoop2_device = { .name = "sharp-scoop", .id = 1, .dev = { .platform_data = &spitz_scoop2_setup, }, .num_resources = ARRAY_SIZE(spitz_scoop2_resources), .resource = spitz_scoop2_resources, }; #define SPITZ_PWR_SD 0x01 #define SPITZ_PWR_CF 0x02 /* Power control is shared with between one of the CF slots and SD */ static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr) { unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR); if (new_cpr & 0x0007) { gpio_set_value(SPITZ_GPIO_CF_POWER, 1); if (!(cpr & 0x0002) && !(cpr & 0x0004)) mdelay(5); if (device == SPITZ_PWR_CF) cpr |= 0x0002; if (device == SPITZ_PWR_SD) cpr |= 0x0004; write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); } else { if (device == SPITZ_PWR_CF) cpr &= ~0x0002; if (device == SPITZ_PWR_SD) cpr &= ~0x0004; if (!(cpr & 0x0002) && !(cpr & 0x0004)) { write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, 0x0000); mdelay(1); gpio_set_value(SPITZ_GPIO_CF_POWER, 0); } else { write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); } } } static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr) { /* Only need to override behaviour for slot 0 */ if (nr == 0) spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr); else write_scoop_reg(scoop, SCOOP_CPR, cpr); } static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = { { .dev = &spitzscoop_device.dev, .irq = SPITZ_IRQ_GPIO_CF_IRQ, .cd_irq = SPITZ_IRQ_GPIO_CF_CD, .cd_irq_str = "PCMCIA0 CD", },{ .dev = &spitzscoop2_device.dev, .irq = SPITZ_IRQ_GPIO_CF2_IRQ, .cd_irq = -1, }, }; static struct scoop_pcmcia_config spitz_pcmcia_config = { .devs = &spitz_pcmcia_scoop[0], .num_devs = 2, .power_ctrl = spitz_pcmcia_pwr, }; EXPORT_SYMBOL(spitzscoop_device); EXPORT_SYMBOL(spitzscoop2_device); /* * Spitz Keyboard Device */ static struct platform_device spitzkbd_device = { .name = "spitz-keyboard", .id = -1, }; /* * Spitz LEDs */ static struct gpio_led spitz_gpio_leds[] = { { .name = "spitz:amber:charge", .default_trigger = "sharpsl-charge", .gpio = SPITZ_GPIO_LED_ORANGE, }, { .name = "spitz:green:hddactivity", .default_trigger = "ide-disk", .gpio = SPITZ_GPIO_LED_GREEN, }, }; static struct gpio_led_platform_data spitz_gpio_leds_info = { .leds = spitz_gpio_leds, .num_leds = ARRAY_SIZE(spitz_gpio_leds), }; static struct platform_device spitzled_device = { .name = "leds-gpio", .id = -1, .dev = { .platform_data = &spitz_gpio_leds_info, }, }; #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) static struct pxa2xx_spi_master spitz_spi_info = { .num_chipselect = 3, }; static struct ads7846_platform_data spitz_ads7846_info = { .model = 7846, .vref_delay_usecs = 100, .x_plate_ohms = 419, .y_plate_ohms = 486, .gpio_pendown = SPITZ_GPIO_TP_INT, }; static void spitz_ads7846_cs(u32 command) { gpio_set_value(SPITZ_GPIO_ADS7846_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip spitz_ads7846_chip = { .cs_control = spitz_ads7846_cs, }; static void spitz_bl_kick_battery(void) { void (*kick_batt)(void); kick_batt = symbol_get(sharpsl_battery_kick); if (kick_batt) { kick_batt(); symbol_put(sharpsl_battery_kick); } } static struct corgi_lcd_platform_data spitz_lcdcon_info = { .init_mode = CORGI_LCD_MODE_VGA, .max_intensity = 0x2f, .default_intensity = 0x1f, .limit_mask = 0x0b, .gpio_backlight_cont = SPITZ_GPIO_BACKLIGHT_CONT, .gpio_backlight_on = SPITZ_GPIO_BACKLIGHT_ON, .kick_battery = spitz_bl_kick_battery, }; static void spitz_lcdcon_cs(u32 command) { gpio_set_value(SPITZ_GPIO_LCDCON_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip spitz_lcdcon_chip = { .cs_control = spitz_lcdcon_cs, }; static void spitz_max1111_cs(u32 command) { gpio_set_value(SPITZ_GPIO_MAX1111_CS, !(command == PXA2XX_CS_ASSERT)); } static struct pxa2xx_spi_chip spitz_max1111_chip = { .cs_control = spitz_max1111_cs, }; static struct spi_board_info spitz_spi_devices[] = { { .modalias = "ads7846", .max_speed_hz = 1200000, .bus_num = 2, .chip_select = 0, .platform_data = &spitz_ads7846_info, .controller_data= &spitz_ads7846_chip, .irq = gpio_to_irq(SPITZ_GPIO_TP_INT), }, { .modalias = "corgi-lcd", .max_speed_hz = 50000, .bus_num = 2, .chip_select = 1, .platform_data = &spitz_lcdcon_info, .controller_data= &spitz_lcdcon_chip, }, { .modalias = "max1111", .max_speed_hz = 450000, .bus_num = 2, .chip_select = 2, .controller_data= &spitz_max1111_chip, }, }; static void __init spitz_init_spi(void) { int err; err = gpio_request(SPITZ_GPIO_ADS7846_CS, "ADS7846_CS"); if (err) return; err = gpio_request(SPITZ_GPIO_LCDCON_CS, "LCDCON_CS"); if (err) goto err_free_1; err = gpio_request(SPITZ_GPIO_MAX1111_CS, "MAX1111_CS"); if (err) goto err_free_2; err = gpio_direction_output(SPITZ_GPIO_ADS7846_CS, 1); if (err) goto err_free_3; err = gpio_direction_output(SPITZ_GPIO_LCDCON_CS, 1); if (err) goto err_free_3; err = gpio_direction_output(SPITZ_GPIO_MAX1111_CS, 1); if (err) goto err_free_3; if (machine_is_akita()) { spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; } pxa2xx_set_spi_info(2, &spitz_spi_info); spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); return; err_free_3: gpio_free(SPITZ_GPIO_MAX1111_CS); err_free_2: gpio_free(SPITZ_GPIO_LCDCON_CS); err_free_1: gpio_free(SPITZ_GPIO_ADS7846_CS); } #else static inline void spitz_init_spi(void) {} #endif /* * MMC/SD Device * * The card detect interrupt isn't debounced so we delay it by 250ms * to give the card a chance to fully insert/eject. */ static struct pxamci_platform_data spitz_mci_platform_data; static int spitz_mci_init(struct device *dev, irq_handler_t spitz_detect_int, void *data) { int err; err = gpio_request(SPITZ_GPIO_nSD_DETECT, "nSD_DETECT"); if (err) goto err_out; err = gpio_request(SPITZ_GPIO_nSD_WP, "nSD_WP"); if (err) goto err_free_1; gpio_direction_input(SPITZ_GPIO_nSD_DETECT); gpio_direction_input(SPITZ_GPIO_nSD_WP); spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "MMC card detect", data); if (err) { pr_err("%s: MMC/SD: can't request MMC card detect IRQ\n", __func__); goto err_free_2; } return 0; err_free_2: gpio_free(SPITZ_GPIO_nSD_WP); err_free_1: gpio_free(SPITZ_GPIO_nSD_DETECT); err_out: return err; } static void spitz_mci_setpower(struct device *dev, unsigned int vdd) { struct pxamci_platform_data* p_d = dev->platform_data; if (( 1 << vdd) & p_d->ocr_mask) spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004); else spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000); } static int spitz_mci_get_ro(struct device *dev) { return gpio_get_value(SPITZ_GPIO_nSD_WP); } static void spitz_mci_exit(struct device *dev, void *data) { free_irq(SPITZ_IRQ_GPIO_nSD_DETECT, data); gpio_free(SPITZ_GPIO_nSD_WP); gpio_free(SPITZ_GPIO_nSD_DETECT); } static struct pxamci_platform_data spitz_mci_platform_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .init = spitz_mci_init, .get_ro = spitz_mci_get_ro, .setpower = spitz_mci_setpower, .exit = spitz_mci_exit, }; /* * USB Host (OHCI) */ static int spitz_ohci_init(struct device *dev) { int err; err = gpio_request(SPITZ_GPIO_USB_HOST, "USB_HOST"); if (err) return err; /* Only Port 2 is connected * Setup USB Port 2 Output Control Register */ UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1); } static struct pxaohci_platform_data spitz_ohci_platform_data = { .port_mode = PMM_NPS_MODE, .init = spitz_ohci_init, .flags = ENABLE_PORT_ALL | NO_OC_PROTECTION, .power_budget = 150, }; /* * Irda */ static int spitz_irda_startup(struct device *dev) { int rc; rc = gpio_request(SPITZ_GPIO_IR_ON, "IrDA on"); if (rc) goto err; rc = gpio_direction_output(SPITZ_GPIO_IR_ON, 1); if (rc) goto err_dir; return 0; err_dir: gpio_free(SPITZ_GPIO_IR_ON); err: return rc; } static void spitz_irda_shutdown(struct device *dev) { gpio_free(SPITZ_GPIO_IR_ON); } static void spitz_irda_transceiver_mode(struct device *dev, int mode) { gpio_set_value(SPITZ_GPIO_IR_ON, mode & IR_OFF); pxa2xx_transceiver_mode(dev, mode); } #ifdef CONFIG_MACH_AKITA static void akita_irda_transceiver_mode(struct device *dev, int mode) { gpio_set_value(AKITA_GPIO_IR_ON, mode & IR_OFF); pxa2xx_transceiver_mode(dev, mode); } #endif static struct pxaficp_platform_data spitz_ficp_platform_data = { .transceiver_cap = IR_SIRMODE | IR_OFF, .transceiver_mode = spitz_irda_transceiver_mode, .startup = spitz_irda_startup, .shutdown = spitz_irda_shutdown, }; /* * Spitz PXA Framebuffer */ static struct pxafb_mode_info spitz_pxafb_modes[] = { { .pixclock = 19231, .xres = 480, .yres = 640, .bpp = 16, .hsync_len = 40, .left_margin = 46, .right_margin = 125, .vsync_len = 3, .upper_margin = 1, .lower_margin = 0, .sync = 0, },{ .pixclock = 134617, .xres = 240, .yres = 320, .bpp = 16, .hsync_len = 20, .left_margin = 20, .right_margin = 46, .vsync_len = 2, .upper_margin = 1, .lower_margin = 0, .sync = 0, }, }; static struct pxafb_mach_info spitz_pxafb_info = { .modes = &spitz_pxafb_modes[0], .num_modes = 2, .fixed_modes = 1, .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, }; static struct mtd_partition sharpsl_nand_partitions[] = { { .name = "System Area", .offset = 0, .size = 7 * 1024 * 1024, }, { .name = "Root Filesystem", .offset = 7 * 1024 * 1024, }, { .name = "Home Filesystem", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, }, }; static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr sharpsl_bbt = { .options = 0, .offs = 4, .len = 2, .pattern = scan_ff_pattern }; static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { .badblock_pattern = &sharpsl_bbt, .partitions = sharpsl_nand_partitions, .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), }; static struct resource sharpsl_nand_resources[] = { { .start = 0x0C000000, .end = 0x0C000FFF, .flags = IORESOURCE_MEM, }, }; static struct platform_device sharpsl_nand_device = { .name = "sharpsl-nand", .id = -1, .resource = sharpsl_nand_resources, .num_resources = ARRAY_SIZE(sharpsl_nand_resources), .dev.platform_data = &sharpsl_nand_platform_data, }; static struct mtd_partition sharpsl_rom_parts[] = { { .name ="Boot PROM Filesystem", .offset = 0x00140000, .size = MTDPART_SIZ_FULL, }, }; static struct physmap_flash_data sharpsl_rom_data = { .width = 2, .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), .parts = sharpsl_rom_parts, }; static struct resource sharpsl_rom_resources[] = { { .start = 0x00000000, .end = 0x007fffff, .flags = IORESOURCE_MEM, }, }; static struct platform_device sharpsl_rom_device = { .name = "physmap-flash", .id = -1, .resource = sharpsl_rom_resources, .num_resources = ARRAY_SIZE(sharpsl_rom_resources), .dev.platform_data = &sharpsl_rom_data, }; static struct platform_device *devices[] __initdata = { &spitzscoop_device, &spitzkbd_device, &spitzled_device, &sharpsl_nand_device, &sharpsl_rom_device, }; static void spitz_poweroff(void) { arm_machine_restart('g'); } static void spitz_restart(char mode) { /* Bootloader magic for a reboot */ if((MSC0 & 0xffff0000) == 0x7ff00000) MSC0 = (MSC0 & 0xffff) | 0x7ee00000; spitz_poweroff(); } static void __init common_init(void) { init_gpio_reset(SPITZ_GPIO_ON_RESET, 1); pm_power_off = spitz_poweroff; arm_pm_restart = spitz_restart; if (machine_is_spitz()) { sharpsl_nand_partitions[1].size = 5 * 1024 * 1024; } else if (machine_is_akita()) { sharpsl_nand_partitions[1].size = 58 * 1024 * 1024; } else if (machine_is_borzoi()) { sharpsl_nand_partitions[1].size = 32 * 1024 * 1024; } PMCR = 0x00; /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ PCFR |= PCFR_OPDE; pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config)); spitz_init_spi(); platform_add_devices(devices, ARRAY_SIZE(devices)); pxa_set_mci_info(&spitz_mci_platform_data); pxa_set_ohci_info(&spitz_ohci_platform_data); pxa_set_ficp_info(&spitz_ficp_platform_data); set_pxa_fb_info(&spitz_pxafb_info); pxa_set_i2c_info(NULL); } #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) static void __init spitz_init(void) { platform_scoop_config = &spitz_pcmcia_config; common_init(); platform_device_register(&spitzscoop2_device); } #endif #ifdef CONFIG_MACH_AKITA /* * Akita IO Expander */ static struct pca953x_platform_data akita_ioexp = { .gpio_base = AKITA_IOEXP_GPIO_BASE, }; static struct i2c_board_info akita_i2c_board_info[] = { { .type = "max7310", .addr = 0x18, .platform_data = &akita_ioexp, }, }; static struct nand_bbt_descr sharpsl_akita_bbt = { .options = 0, .offs = 4, .len = 1, .pattern = scan_ff_pattern }; static struct nand_ecclayout akita_oobinfo = { .eccbytes = 24, .eccpos = { 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, .oobfree = {{0x08, 0x09}} }; static void __init akita_init(void) { spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; /* We just pretend the second element of the array doesn't exist */ spitz_pcmcia_config.num_devs = 1; platform_scoop_config = &spitz_pcmcia_config; i2c_register_board_info(0, ARRAY_AND_SIZE(akita_i2c_board_info)); common_init(); } #endif static void __init fixup_spitz(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { sharpsl_save_param(); mi->nr_banks = 1; mi->bank[0].start = 0xa0000000; mi->bank[0].node = 0; mi->bank[0].size = (64*1024*1024); } #ifdef CONFIG_MACH_SPITZ MACHINE_START(SPITZ, "SHARP Spitz") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, .map_io = pxa_map_io, .init_irq = pxa27x_init_irq, .init_machine = spitz_init, .timer = &pxa_timer, MACHINE_END #endif #ifdef CONFIG_MACH_BORZOI MACHINE_START(BORZOI, "SHARP Borzoi") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, .map_io = pxa_map_io, .init_irq = pxa27x_init_irq, .init_machine = spitz_init, .timer = &pxa_timer, MACHINE_END #endif #ifdef CONFIG_MACH_AKITA MACHINE_START(AKITA, "SHARP Akita") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, .map_io = pxa_map_io, .init_irq = pxa27x_init_irq, .init_machine = akita_init, .timer = &pxa_timer, MACHINE_END #endif ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-12 10:29 ` Dmitry Eremin-Solenikov @ 2008-12-12 11:11 ` David Woodhouse 2008-12-12 23:05 ` Stephen Rothwell 1 sibling, 0 replies; 17+ messages in thread From: David Woodhouse @ 2008-12-12 11:11 UTC (permalink / raw) To: Dmitry Eremin-Solenikov Cc: Stephen Rothwell, linux-next, Eric Miao, Russell King On Fri, 2008-12-12 at 13:29 +0300, Dmitry Eremin-Solenikov wrote: > Sorry for the delay. I've attached the files resulting from the merge > of today linux-next/master and mtd/master. Thanks for doing that. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-12 10:29 ` Dmitry Eremin-Solenikov 2008-12-12 11:11 ` David Woodhouse @ 2008-12-12 23:05 ` Stephen Rothwell 2008-12-15 4:15 ` Stephen Rothwell 1 sibling, 1 reply; 17+ messages in thread From: Stephen Rothwell @ 2008-12-12 23:05 UTC (permalink / raw) To: Dmitry Eremin-Solenikov Cc: David Woodhouse, linux-next, Eric Miao, Russell King [-- Attachment #1: Type: text/plain, Size: 375 bytes --] Hi Dmitry, On Fri, 12 Dec 2008 13:29:01 +0300 "Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com> wrote: > > Sorry for the delay. I've attached the files resulting from the merge > of today linux-next/master and mtd/master. Thanks, I will use them on Monday. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-12 23:05 ` Stephen Rothwell @ 2008-12-15 4:15 ` Stephen Rothwell 2009-01-02 2:07 ` Stephen Rothwell 0 siblings, 1 reply; 17+ messages in thread From: Stephen Rothwell @ 2008-12-15 4:15 UTC (permalink / raw) To: Dmitry Eremin-Solenikov Cc: David Woodhouse, linux-next, Eric Miao, Russell King Hi Dmitry, On Sat, 13 Dec 2008 10:05:13 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > On Fri, 12 Dec 2008 13:29:01 +0300 "Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com> wrote: > > > > Sorry for the delay. I've attached the files resulting from the merge > > of today linux-next/master and mtd/master. > > Thanks, I will use them on Monday. Just copying in these files produced the following diff which I can carry as necessary. Thanks again. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ diff --cc arch/arm/mach-pxa/corgi.c index c5e28a4,b65be8e..0000000 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@@ -542,42 -542,61 +543,92 @@@ err_free_1 static inline void corgi_init_spi(void) {} #endif + static struct mtd_partition sharpsl_nand_partitions[] = { + { + .name = "System Area", + .offset = 0, + .size = 7 * 1024 * 1024, + }, + { + .name = "Root Filesystem", + .offset = 7 * 1024 * 1024, + .size = 25 * 1024 * 1024, + }, + { + .name = "Home Filesystem", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + }, + }; + + static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; + + static struct nand_bbt_descr sharpsl_bbt = { + .options = 0, + .offs = 4, + .len = 2, + .pattern = scan_ff_pattern + }; + + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { + .badblock_pattern = &sharpsl_bbt, + .partitions = sharpsl_nand_partitions, + .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), + }; + + static struct resource sharpsl_nand_resources[] = { + { + .start = 0x0C000000, + .end = 0x0C000FFF, + .flags = IORESOURCE_MEM, + }, + }; + + static struct platform_device sharpsl_nand_device = { + .name = "sharpsl-nand", + .id = -1, + .resource = sharpsl_nand_resources, + .num_resources = ARRAY_SIZE(sharpsl_nand_resources), + .dev.platform_data = &sharpsl_nand_platform_data, + }; + +static struct mtd_partition sharpsl_rom_parts[] = { + { + .name ="Boot PROM Filesystem", + .offset = 0x00120000, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct physmap_flash_data sharpsl_rom_data = { + .width = 2, + .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), + .parts = sharpsl_rom_parts, +}; + +static struct resource sharpsl_rom_resources[] = { + { + .start = 0x00000000, + .end = 0x007fffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device sharpsl_rom_device = { + .name = "physmap-flash", + .id = -1, + .resource = sharpsl_rom_resources, + .num_resources = ARRAY_SIZE(sharpsl_rom_resources), + .dev.platform_data = &sharpsl_rom_data, +}; + static struct platform_device *devices[] __initdata = { &corgiscoop_device, &corgifb_device, &corgikbd_device, &corgiled_device, + &sharpsl_nand_device, + &sharpsl_rom_device, }; static void corgi_poweroff(void) diff --cc arch/arm/mach-pxa/poodle.c index ae88855,a45afdf..0000000 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c @@@ -414,40 -414,59 +415,90 @@@ static struct pxafb_mach_info poodle_fb .lcd_conn = LCD_COLOR_TFT_16BPP, }; + static struct mtd_partition sharpsl_nand_partitions[] = { + { + .name = "System Area", + .offset = 0, + .size = 7 * 1024 * 1024, + }, + { + .name = "Root Filesystem", + .offset = 7 * 1024 * 1024, + .size = 22 * 1024 * 1024, + }, + { + .name = "Home Filesystem", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + }, + }; + + static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; + + static struct nand_bbt_descr sharpsl_bbt = { + .options = 0, + .offs = 4, + .len = 2, + .pattern = scan_ff_pattern + }; + + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { + .badblock_pattern = &sharpsl_bbt, + .partitions = sharpsl_nand_partitions, + .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), + }; + + static struct resource sharpsl_nand_resources[] = { + { + .start = 0x0C000000, + .end = 0x0C000FFF, + .flags = IORESOURCE_MEM, + }, + }; + + static struct platform_device sharpsl_nand_device = { + .name = "sharpsl-nand", + .id = -1, + .resource = sharpsl_nand_resources, + .num_resources = ARRAY_SIZE(sharpsl_nand_resources), + .dev.platform_data = &sharpsl_nand_platform_data, + }; + +static struct mtd_partition sharpsl_rom_parts[] = { + { + .name ="Boot PROM Filesystem", + .offset = 0x00120000, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct physmap_flash_data sharpsl_rom_data = { + .width = 2, + .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), + .parts = sharpsl_rom_parts, +}; + +static struct resource sharpsl_rom_resources[] = { + { + .start = 0x00000000, + .end = 0x007fffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device sharpsl_rom_device = { + .name = "physmap-flash", + .id = -1, + .resource = sharpsl_rom_resources, + .num_resources = ARRAY_SIZE(sharpsl_rom_resources), + .dev.platform_data = &sharpsl_rom_data, +}; + static struct platform_device *devices[] __initdata = { &poodle_locomo_device, &poodle_scoop_device, + &sharpsl_nand_device, + &sharpsl_rom_device, }; static void poodle_poweroff(void) diff --cc arch/arm/mach-pxa/spitz.c index 7299d87,7672b09..0000000 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@@ -613,42 -609,60 +614,91 @@@ static struct pxafb_mach_info spitz_pxa .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, }; + static struct mtd_partition sharpsl_nand_partitions[] = { + { + .name = "System Area", + .offset = 0, + .size = 7 * 1024 * 1024, + }, + { + .name = "Root Filesystem", + .offset = 7 * 1024 * 1024, + }, + { + .name = "Home Filesystem", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + }, + }; + + static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; + + static struct nand_bbt_descr sharpsl_bbt = { + .options = 0, + .offs = 4, + .len = 2, + .pattern = scan_ff_pattern + }; + + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { + .badblock_pattern = &sharpsl_bbt, + .partitions = sharpsl_nand_partitions, + .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), + }; + + static struct resource sharpsl_nand_resources[] = { + { + .start = 0x0C000000, + .end = 0x0C000FFF, + .flags = IORESOURCE_MEM, + }, + }; + + static struct platform_device sharpsl_nand_device = { + .name = "sharpsl-nand", + .id = -1, + .resource = sharpsl_nand_resources, + .num_resources = ARRAY_SIZE(sharpsl_nand_resources), + .dev.platform_data = &sharpsl_nand_platform_data, + }; + +static struct mtd_partition sharpsl_rom_parts[] = { + { + .name ="Boot PROM Filesystem", + .offset = 0x00140000, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct physmap_flash_data sharpsl_rom_data = { + .width = 2, + .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), + .parts = sharpsl_rom_parts, +}; + +static struct resource sharpsl_rom_resources[] = { + { + .start = 0x00000000, + .end = 0x007fffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device sharpsl_rom_device = { + .name = "physmap-flash", + .id = -1, + .resource = sharpsl_rom_resources, + .num_resources = ARRAY_SIZE(sharpsl_rom_resources), + .dev.platform_data = &sharpsl_rom_data, +}; + static struct platform_device *devices[] __initdata = { &spitzscoop_device, &spitzkbd_device, &spitzled_device, + &sharpsl_nand_device, + &sharpsl_rom_device, }; static void spitz_poweroff(void) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: linux-next: manual merge of the mtd tree 2008-12-15 4:15 ` Stephen Rothwell @ 2009-01-02 2:07 ` Stephen Rothwell 0 siblings, 0 replies; 17+ messages in thread From: Stephen Rothwell @ 2009-01-02 2:07 UTC (permalink / raw) To: David Woodhouse Cc: Dmitry Eremin-Solenikov, linux-next, Eric Miao, Russell King [-- Attachment #1: Type: text/plain, Size: 8707 bytes --] Hi David, On Mon, 15 Dec 2008 15:15:37 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > On Sat, 13 Dec 2008 10:05:13 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > On Fri, 12 Dec 2008 13:29:01 +0300 "Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com> wrote: > > > > > > Sorry for the delay. I've attached the files resulting from the merge > > > of today linux-next/master and mtd/master. > > > > Thanks, I will use them on Monday. > > Just copying in these files produced the following diff which I can carry > as necessary. Thanks again. These conflicts are now between the mtd tree and Linus' tree, so could be cleaned up by merging Linus' tree into the mtd tree ... > diff --cc arch/arm/mach-pxa/corgi.c > index c5e28a4,b65be8e..0000000 > --- a/arch/arm/mach-pxa/corgi.c > +++ b/arch/arm/mach-pxa/corgi.c > @@@ -542,42 -542,61 +543,92 @@@ err_free_1 > static inline void corgi_init_spi(void) {} > #endif > > + static struct mtd_partition sharpsl_nand_partitions[] = { > + { > + .name = "System Area", > + .offset = 0, > + .size = 7 * 1024 * 1024, > + }, > + { > + .name = "Root Filesystem", > + .offset = 7 * 1024 * 1024, > + .size = 25 * 1024 * 1024, > + }, > + { > + .name = "Home Filesystem", > + .offset = MTDPART_OFS_APPEND, > + .size = MTDPART_SIZ_FULL, > + }, > + }; > + > + static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; > + > + static struct nand_bbt_descr sharpsl_bbt = { > + .options = 0, > + .offs = 4, > + .len = 2, > + .pattern = scan_ff_pattern > + }; > + > + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { > + .badblock_pattern = &sharpsl_bbt, > + .partitions = sharpsl_nand_partitions, > + .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), > + }; > + > + static struct resource sharpsl_nand_resources[] = { > + { > + .start = 0x0C000000, > + .end = 0x0C000FFF, > + .flags = IORESOURCE_MEM, > + }, > + }; > + > + static struct platform_device sharpsl_nand_device = { > + .name = "sharpsl-nand", > + .id = -1, > + .resource = sharpsl_nand_resources, > + .num_resources = ARRAY_SIZE(sharpsl_nand_resources), > + .dev.platform_data = &sharpsl_nand_platform_data, > + }; > + > +static struct mtd_partition sharpsl_rom_parts[] = { > + { > + .name ="Boot PROM Filesystem", > + .offset = 0x00120000, > + .size = MTDPART_SIZ_FULL, > + }, > +}; > + > +static struct physmap_flash_data sharpsl_rom_data = { > + .width = 2, > + .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), > + .parts = sharpsl_rom_parts, > +}; > + > +static struct resource sharpsl_rom_resources[] = { > + { > + .start = 0x00000000, > + .end = 0x007fffff, > + .flags = IORESOURCE_MEM, > + }, > +}; > + > +static struct platform_device sharpsl_rom_device = { > + .name = "physmap-flash", > + .id = -1, > + .resource = sharpsl_rom_resources, > + .num_resources = ARRAY_SIZE(sharpsl_rom_resources), > + .dev.platform_data = &sharpsl_rom_data, > +}; > + > static struct platform_device *devices[] __initdata = { > &corgiscoop_device, > &corgifb_device, > &corgikbd_device, > &corgiled_device, > + &sharpsl_nand_device, > + &sharpsl_rom_device, > }; > > static void corgi_poweroff(void) > diff --cc arch/arm/mach-pxa/poodle.c > index ae88855,a45afdf..0000000 > --- a/arch/arm/mach-pxa/poodle.c > +++ b/arch/arm/mach-pxa/poodle.c > @@@ -414,40 -414,59 +415,90 @@@ static struct pxafb_mach_info poodle_fb > .lcd_conn = LCD_COLOR_TFT_16BPP, > }; > > + static struct mtd_partition sharpsl_nand_partitions[] = { > + { > + .name = "System Area", > + .offset = 0, > + .size = 7 * 1024 * 1024, > + }, > + { > + .name = "Root Filesystem", > + .offset = 7 * 1024 * 1024, > + .size = 22 * 1024 * 1024, > + }, > + { > + .name = "Home Filesystem", > + .offset = MTDPART_OFS_APPEND, > + .size = MTDPART_SIZ_FULL, > + }, > + }; > + > + static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; > + > + static struct nand_bbt_descr sharpsl_bbt = { > + .options = 0, > + .offs = 4, > + .len = 2, > + .pattern = scan_ff_pattern > + }; > + > + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { > + .badblock_pattern = &sharpsl_bbt, > + .partitions = sharpsl_nand_partitions, > + .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), > + }; > + > + static struct resource sharpsl_nand_resources[] = { > + { > + .start = 0x0C000000, > + .end = 0x0C000FFF, > + .flags = IORESOURCE_MEM, > + }, > + }; > + > + static struct platform_device sharpsl_nand_device = { > + .name = "sharpsl-nand", > + .id = -1, > + .resource = sharpsl_nand_resources, > + .num_resources = ARRAY_SIZE(sharpsl_nand_resources), > + .dev.platform_data = &sharpsl_nand_platform_data, > + }; > + > +static struct mtd_partition sharpsl_rom_parts[] = { > + { > + .name ="Boot PROM Filesystem", > + .offset = 0x00120000, > + .size = MTDPART_SIZ_FULL, > + }, > +}; > + > +static struct physmap_flash_data sharpsl_rom_data = { > + .width = 2, > + .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), > + .parts = sharpsl_rom_parts, > +}; > + > +static struct resource sharpsl_rom_resources[] = { > + { > + .start = 0x00000000, > + .end = 0x007fffff, > + .flags = IORESOURCE_MEM, > + }, > +}; > + > +static struct platform_device sharpsl_rom_device = { > + .name = "physmap-flash", > + .id = -1, > + .resource = sharpsl_rom_resources, > + .num_resources = ARRAY_SIZE(sharpsl_rom_resources), > + .dev.platform_data = &sharpsl_rom_data, > +}; > + > static struct platform_device *devices[] __initdata = { > &poodle_locomo_device, > &poodle_scoop_device, > + &sharpsl_nand_device, > + &sharpsl_rom_device, > }; > > static void poodle_poweroff(void) > diff --cc arch/arm/mach-pxa/spitz.c > index 7299d87,7672b09..0000000 > --- a/arch/arm/mach-pxa/spitz.c > +++ b/arch/arm/mach-pxa/spitz.c > @@@ -613,42 -609,60 +614,91 @@@ static struct pxafb_mach_info spitz_pxa > .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, > }; > > + static struct mtd_partition sharpsl_nand_partitions[] = { > + { > + .name = "System Area", > + .offset = 0, > + .size = 7 * 1024 * 1024, > + }, > + { > + .name = "Root Filesystem", > + .offset = 7 * 1024 * 1024, > + }, > + { > + .name = "Home Filesystem", > + .offset = MTDPART_OFS_APPEND, > + .size = MTDPART_SIZ_FULL, > + }, > + }; > + > + static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; > + > + static struct nand_bbt_descr sharpsl_bbt = { > + .options = 0, > + .offs = 4, > + .len = 2, > + .pattern = scan_ff_pattern > + }; > + > + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { > + .badblock_pattern = &sharpsl_bbt, > + .partitions = sharpsl_nand_partitions, > + .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), > + }; > + > + static struct resource sharpsl_nand_resources[] = { > + { > + .start = 0x0C000000, > + .end = 0x0C000FFF, > + .flags = IORESOURCE_MEM, > + }, > + }; > + > + static struct platform_device sharpsl_nand_device = { > + .name = "sharpsl-nand", > + .id = -1, > + .resource = sharpsl_nand_resources, > + .num_resources = ARRAY_SIZE(sharpsl_nand_resources), > + .dev.platform_data = &sharpsl_nand_platform_data, > + }; > + > > +static struct mtd_partition sharpsl_rom_parts[] = { > + { > + .name ="Boot PROM Filesystem", > + .offset = 0x00140000, > + .size = MTDPART_SIZ_FULL, > + }, > +}; > + > +static struct physmap_flash_data sharpsl_rom_data = { > + .width = 2, > + .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), > + .parts = sharpsl_rom_parts, > +}; > + > +static struct resource sharpsl_rom_resources[] = { > + { > + .start = 0x00000000, > + .end = 0x007fffff, > + .flags = IORESOURCE_MEM, > + }, > +}; > + > +static struct platform_device sharpsl_rom_device = { > + .name = "physmap-flash", > + .id = -1, > + .resource = sharpsl_rom_resources, > + .num_resources = ARRAY_SIZE(sharpsl_rom_resources), > + .dev.platform_data = &sharpsl_rom_data, > +}; > + > static struct platform_device *devices[] __initdata = { > &spitzscoop_device, > &spitzkbd_device, > &spitzled_device, > + &sharpsl_nand_device, > + &sharpsl_rom_device, > }; > > static void spitz_poweroff(void) -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* linux-next: manual merge of the mtd tree
@ 2008-12-22 6:12 Stephen Rothwell
2008-12-23 4:28 ` Greg KH
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2008-12-22 6:12 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-next, Artem Bityutskiy, Kay Sievers, Greg KH
Hi David,
Today's linux-next merge of the mtd tree got a conflict in
drivers/mtd/devices/m25p80.c drivers/mtd/devices/mtd_dataflash.c between
commit 0e02ed3e44ef541e4d684348d9e684ab3bdd9399 ("mtd: struct device -
replace bus_id with dev_name(), dev_set_name()") from the driver-core
tree and commits 5b7f3a500cd097d673a6283fbb748c1e4f87bac6 ("[MTD] fix
dataflash 64-bit divisions") and d85316ac459f1cdd14ea1828eebeac1f1028e167
("[MTD] fix m25p80 64-bit divisions") from the mtd tree.
I fixed it up (see below) and can carry the fix as necessary. However, I
suggest that you apply the patch from the driver-core tree as its
prerequisites are upstream and you were cc'd on it.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff --cc drivers/mtd/devices/m25p80.c
index 5733f06,9be0229..0000000
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@@ -169,9 -170,9 +170,9 @@@ static int wait_till_ready(struct m25p
*/
static int erase_chip(struct m25p *flash)
{
- DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n",
+ DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %lldKiB\n",
- flash->spi->dev.bus_id, __func__,
+ dev_name(&flash->spi->dev), __func__,
- flash->mtd.size / 1024);
+ (long long)(flash->mtd.size >> 10));
/* Wait until finished previous write command. */
if (wait_till_ready(flash))
@@@ -232,10 -233,11 +233,11 @@@ static int m25p80_erase(struct mtd_inf
{
struct m25p *flash = mtd_to_m25p(mtd);
u32 addr,len;
+ uint32_t rem;
- DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n",
+ DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%llx, len %lld\n",
- flash->spi->dev.bus_id, __func__, "at",
+ dev_name(&flash->spi->dev), __func__, "at",
- (u32)instr->addr, instr->len);
+ (long long)instr->addr, (long long)instr->len);
/* sanity checks */
if (instr->addr + instr->len > flash->mtd.size)
diff --cc drivers/mtd/devices/mtd_dataflash.c
index 65126cd,6806897..0000000
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@@ -152,15 -153,20 +153,20 @@@ static int dataflash_erase(struct mtd_i
struct spi_message msg;
unsigned blocksize = priv->page_size << 3;
uint8_t *command;
+ uint32_t rem;
- DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n",
- dev_name(&spi->dev),
- instr->addr, instr->len);
+ DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%llx len 0x%llx\n",
- spi->dev.bus_id, (long long)instr->addr,
++ dev_name(&spi->dev), (long long)instr->addr,
+ (long long)instr->len);
/* Sanity checks */
- if ((instr->addr + instr->len) > mtd->size
- || (instr->len % priv->page_size) != 0
- || (instr->addr % priv->page_size) != 0)
+ if (instr->addr + instr->len > mtd->size)
+ return -EINVAL;
+ div_u64_rem(instr->len, priv->page_size, &rem);
+ if (rem)
+ return -EINVAL;
+ div_u64_rem(instr->addr, priv->page_size, &rem);
+ if (rem)
return -EINVAL;
spi_message_init(&msg);
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: linux-next: manual merge of the mtd tree 2008-12-22 6:12 Stephen Rothwell @ 2008-12-23 4:28 ` Greg KH 0 siblings, 0 replies; 17+ messages in thread From: Greg KH @ 2008-12-23 4:28 UTC (permalink / raw) To: Stephen Rothwell Cc: David Woodhouse, linux-next, Artem Bityutskiy, Kay Sievers On Mon, Dec 22, 2008 at 05:12:01PM +1100, Stephen Rothwell wrote: > Hi David, > > Today's linux-next merge of the mtd tree got a conflict in > drivers/mtd/devices/m25p80.c drivers/mtd/devices/mtd_dataflash.c between > commit 0e02ed3e44ef541e4d684348d9e684ab3bdd9399 ("mtd: struct device - > replace bus_id with dev_name(), dev_set_name()") from the driver-core > tree and commits 5b7f3a500cd097d673a6283fbb748c1e4f87bac6 ("[MTD] fix > dataflash 64-bit divisions") and d85316ac459f1cdd14ea1828eebeac1f1028e167 > ("[MTD] fix m25p80 64-bit divisions") from the mtd tree. > > I fixed it up (see below) and can carry the fix as necessary. However, I > suggest that you apply the patch from the driver-core tree as its > prerequisites are upstream and you were cc'd on it. Yes, David, please apply the following patch to prevent this from happening... thanks, greg k-h -------------- From: Kay Sievers <kay.sievers@vrfy.org> Subject: mtd: struct device - replace bus_id with dev_name(), dev_set_name() CC: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- drivers/mtd/devices/m25p80.c | 16 ++++++++-------- drivers/mtd/devices/mtd_dataflash.c | 30 +++++++++++++++--------------- drivers/mtd/maps/integrator-flash.c | 2 +- drivers/mtd/maps/ixp2000.c | 4 ++-- drivers/mtd/maps/ixp4xx.c | 2 +- drivers/mtd/maps/omap_nor.c | 2 +- drivers/mtd/maps/physmap.c | 6 +++--- drivers/mtd/maps/physmap_of.c | 4 ++-- drivers/mtd/mtdconcat.c | 2 +- drivers/mtd/nand/fsl_upm.c | 2 +- drivers/mtd/nand/plat_nand.c | 2 +- drivers/mtd/nand/tmio_nand.c | 2 +- drivers/mtd/onenand/generic.c | 2 +- drivers/mtd/onenand/omap2.c | 2 +- drivers/mtd/ubi/build.c | 2 +- drivers/mtd/ubi/vmt.c | 4 ++-- include/linux/mtd/concat.h | 2 +- 17 files changed, 43 insertions(+), 43 deletions(-) --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -170,7 +170,7 @@ static int wait_till_ready(struct m25p * static int erase_chip(struct m25p *flash) { DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n", - flash->spi->dev.bus_id, __func__, + dev_name(&flash->spi->dev), __func__, flash->mtd.size / 1024); /* Wait until finished previous write command. */ @@ -197,7 +197,7 @@ static int erase_chip(struct m25p *flash static int erase_sector(struct m25p *flash, u32 offset) { DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", - flash->spi->dev.bus_id, __func__, + dev_name(&flash->spi->dev), __func__, flash->mtd.erasesize / 1024, offset); /* Wait until finished previous write command. */ @@ -234,7 +234,7 @@ static int m25p80_erase(struct mtd_info u32 addr,len; DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n", - flash->spi->dev.bus_id, __func__, "at", + dev_name(&flash->spi->dev), __func__, "at", (u32)instr->addr, instr->len); /* sanity checks */ @@ -295,7 +295,7 @@ static int m25p80_read(struct mtd_info * struct spi_message m; DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", - flash->spi->dev.bus_id, __func__, "from", + dev_name(&flash->spi->dev), __func__, "from", (u32)from, len); /* sanity checks */ @@ -367,7 +367,7 @@ static int m25p80_write(struct mtd_info struct spi_message m; DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", - flash->spi->dev.bus_id, __func__, "to", + dev_name(&flash->spi->dev), __func__, "to", (u32)to, len); if (retlen) @@ -563,7 +563,7 @@ static struct flash_info *__devinit jede tmp = spi_write_then_read(spi, &code, 1, id, 5); if (tmp < 0) { DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", - spi->dev.bus_id, tmp); + dev_name(&spi->dev), tmp); return NULL; } jedec = id[0]; @@ -617,7 +617,7 @@ static int __devinit m25p_probe(struct s /* unrecognized chip? */ if (i == ARRAY_SIZE(m25p_data)) { DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n", - spi->dev.bus_id, data->type); + dev_name(&spi->dev), data->type); info = NULL; /* recognized; is that chip really what's there? */ @@ -658,7 +658,7 @@ static int __devinit m25p_probe(struct s if (data && data->name) flash->mtd.name = data->name; else - flash->mtd.name = spi->dev.bus_id; + flash->mtd.name = dev_name(&spi->dev); flash->mtd.type = MTD_NORFLASH; flash->mtd.writesize = 1; --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -128,7 +128,7 @@ static int dataflash_waitready(struct sp status = dataflash_status(spi); if (status < 0) { DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", - spi->dev.bus_id, status); + dev_name(&spi->dev), status); status = 0; } @@ -154,7 +154,7 @@ static int dataflash_erase(struct mtd_in uint8_t *command; DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n", - spi->dev.bus_id, + dev_name(&spi->dev), instr->addr, instr->len); /* Sanity checks */ @@ -197,7 +197,7 @@ static int dataflash_erase(struct mtd_in if (status < 0) { printk(KERN_ERR "%s: erase %x, err %d\n", - spi->dev.bus_id, pageaddr, status); + dev_name(&spi->dev), pageaddr, status); /* REVISIT: can retry instr->retries times; or * giveup and instr->fail_addr = instr->addr; */ @@ -239,7 +239,7 @@ static int dataflash_read(struct mtd_inf int status; DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", - priv->spi->dev.bus_id, (unsigned)from, (unsigned)(from + len)); + dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len)); *retlen = 0; @@ -288,7 +288,7 @@ static int dataflash_read(struct mtd_inf status = 0; } else DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", - priv->spi->dev.bus_id, + dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len), status); return status; @@ -315,7 +315,7 @@ static int dataflash_write(struct mtd_in uint8_t *command; DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", - spi->dev.bus_id, (unsigned)to, (unsigned)(to + len)); + dev_name(&spi->dev), (unsigned)to, (unsigned)(to + len)); *retlen = 0; @@ -374,7 +374,7 @@ static int dataflash_write(struct mtd_in status = spi_sync(spi, &msg); if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", - spi->dev.bus_id, addr, status); + dev_name(&spi->dev), addr, status); (void) dataflash_waitready(priv->spi); } @@ -396,7 +396,7 @@ static int dataflash_write(struct mtd_in spi_transfer_del(x + 1); if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", - spi->dev.bus_id, addr, writelen, status); + dev_name(&spi->dev), addr, writelen, status); (void) dataflash_waitready(priv->spi); @@ -416,14 +416,14 @@ static int dataflash_write(struct mtd_in status = spi_sync(spi, &msg); if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", - spi->dev.bus_id, addr, status); + dev_name(&spi->dev), addr, status); status = dataflash_waitready(priv->spi); /* Check result of the compare operation */ if (status & (1 << 6)) { printk(KERN_ERR "%s: compare page %u, err %d\n", - spi->dev.bus_id, pageaddr, status); + dev_name(&spi->dev), pageaddr, status); remaining = 0; status = -EIO; break; @@ -779,7 +779,7 @@ static struct flash_info *__devinit jede tmp = spi_write_then_read(spi, &code, 1, id, 3); if (tmp < 0) { DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", - spi->dev.bus_id, tmp); + dev_name(&spi->dev), tmp); return ERR_PTR(tmp); } if (id[0] != 0x1f) @@ -869,7 +869,7 @@ static int __devinit dataflash_probe(str status = dataflash_status(spi); if (status <= 0 || status == 0xff) { DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", - spi->dev.bus_id, status); + dev_name(&spi->dev), status); if (status == 0 || status == 0xff) status = -ENODEV; return status; @@ -905,13 +905,13 @@ static int __devinit dataflash_probe(str /* obsolete AT45DB1282 not (yet?) supported */ default: DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", - spi->dev.bus_id, status & 0x3c); + dev_name(&spi->dev), status & 0x3c); status = -ENODEV; } if (status < 0) DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", - spi->dev.bus_id, status); + dev_name(&spi->dev), status); return status; } @@ -921,7 +921,7 @@ static int __devexit dataflash_remove(st struct dataflash *flash = dev_get_drvdata(&spi->dev); int status; - DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", spi->dev.bus_id); + DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", dev_name(&spi->dev)); if (mtd_has_partitions() && flash->partitioned) status = del_mtd_partitions(&flash->mtd); --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c @@ -105,7 +105,7 @@ static int armflash_probe(struct platfor info->map.bankwidth = plat->width; info->map.phys = res->start; info->map.virt = base; - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.set_vpp = armflash_set_vpp; simple_map_init(&info->map); --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c @@ -188,7 +188,7 @@ static int ixp2000_flash_probe(struct pl */ info->map.map_priv_2 = (unsigned long) ixp_data->bank_setup; - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.read = ixp2000_flash_read8; info->map.write = ixp2000_flash_write8; info->map.copy_from = ixp2000_flash_copy_from; @@ -196,7 +196,7 @@ static int ixp2000_flash_probe(struct pl info->res = request_mem_region(dev->resource->start, dev->resource->end - dev->resource->start + 1, - dev->dev.bus_id); + dev_name(&dev->dev)); if (!info->res) { dev_err(&dev->dev, "Could not reserve memory region\n"); err = -ENOMEM; --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -218,7 +218,7 @@ static int ixp4xx_flash_probe(struct pla * handle that. */ info->map.bankwidth = 2; - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.read = ixp4xx_read16, info->map.write = ixp4xx_probe_write16, info->map.copy_from = ixp4xx_copy_from, --- a/drivers/mtd/maps/omap_nor.c +++ b/drivers/mtd/maps/omap_nor.c @@ -101,7 +101,7 @@ static int __init omapflash_probe(struct err = -ENOMEM; goto out_release_mem_region; } - info->map.name = pdev->dev.bus_id; + info->map.name = dev_name(&pdev->dev); info->map.phys = res->start; info->map.size = size; info->map.bankwidth = pdata->width; --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -108,13 +108,13 @@ static int physmap_flash_probe(struct pl if (!devm_request_mem_region(&dev->dev, dev->resource[i].start, dev->resource[i].end - dev->resource[i].start + 1, - dev->dev.bus_id)) { + dev_name(&dev->dev))) { dev_err(&dev->dev, "Could not reserve memory region\n"); err = -ENOMEM; goto err_out; } - info->map[i].name = dev->dev.bus_id; + info->map[i].name = dev_name(&dev->dev); info->map[i].phys = dev->resource[i].start; info->map[i].size = dev->resource[i].end - dev->resource[i].start + 1; info->map[i].bankwidth = physmap_data->width; @@ -150,7 +150,7 @@ static int physmap_flash_probe(struct pl * We detected multiple devices. Concatenate them together. */ #ifdef CONFIG_MTD_CONCAT - info->cmtd = mtd_concat_create(info->mtd, devices_found, dev->dev.bus_id); + info->cmtd = mtd_concat_create(info->mtd, devices_found, dev_name(&dev->dev)); if (info->cmtd == NULL) err = -ENXIO; #else --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -183,7 +183,7 @@ static int __devinit of_flash_probe(stru err = -EBUSY; info->res = request_mem_region(res.start, res.end - res.start + 1, - dev->dev.bus_id); + dev_name(&dev->dev)); if (!info->res) goto err_out; @@ -194,7 +194,7 @@ static int __devinit of_flash_probe(stru goto err_out; } - info->map.name = dev->dev.bus_id; + info->map.name = dev_name(&dev->dev); info->map.phys = res.start; info->map.size = res.end - res.start + 1; info->map.bankwidth = *width; --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -691,7 +691,7 @@ static int concat_block_markbad(struct m */ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to concatenate */ int num_devs, /* number of subdevices */ - char *name) + const char *name) { /* name for the new device */ int i; size_t size; --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c @@ -222,7 +222,7 @@ static int __devinit fun_probe(struct of fun->rnb_gpio = of_get_gpio(ofdev->node, 0); if (fun->rnb_gpio >= 0) { - ret = gpio_request(fun->rnb_gpio, ofdev->dev.bus_id); + ret = gpio_request(fun->rnb_gpio, dev_name(&ofdev->dev)); if (ret) { dev_err(&ofdev->dev, "can't request RNB gpio\n"); goto err2; --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -54,7 +54,7 @@ static int __init plat_nand_probe(struct data->chip.priv = &data; data->mtd.priv = &data->chip; data->mtd.owner = THIS_MODULE; - data->mtd.name = pdev->dev.bus_id; + data->mtd.name = dev_name(&pdev->dev); data->chip.IO_ADDR_R = data->io_base; data->chip.IO_ADDR_W = data->io_base; --- a/drivers/mtd/nand/tmio_nand.c +++ b/drivers/mtd/nand/tmio_nand.c @@ -433,7 +433,7 @@ static int tmio_probe(struct platform_de nand_chip->chip_delay = 15; retval = request_irq(irq, &tmio_irq, - IRQF_DISABLED, dev->dev.bus_id, tmio); + IRQF_DISABLED, dev_name(&dev->dev), tmio); if (retval) { dev_err(&dev->dev, "request_irq error %d\n", retval); goto err_irq; --- a/drivers/mtd/onenand/generic.c +++ b/drivers/mtd/onenand/generic.c @@ -63,7 +63,7 @@ static int __devinit generic_onenand_pro info->onenand.mmcontrol = pdata->mmcontrol; info->onenand.irq = platform_get_irq(pdev, 0); - info->mtd.name = pdev->dev.bus_id; + info->mtd.name = dev_name(&pdev->dev); info->mtd.priv = &info->onenand; info->mtd.owner = THIS_MODULE; --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -668,7 +668,7 @@ static int __devinit omap2_onenand_probe c->onenand.base); c->pdev = pdev; - c->mtd.name = pdev->dev.bus_id; + c->mtd.name = dev_name(&pdev->dev); c->mtd.priv = &c->onenand; c->mtd.owner = THIS_MODULE; --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -280,7 +280,7 @@ static int ubi_sysfs_init(struct ubi_dev ubi->dev.release = dev_release; ubi->dev.devt = ubi->cdev.dev; ubi->dev.class = ubi_class; - sprintf(&ubi->dev.bus_id[0], UBI_NAME_STR"%d", ubi->ubi_num); + dev_set_name(&ubi->dev, UBI_NAME_STR"%d", ubi->ubi_num); err = device_register(&ubi->dev); if (err) return err; --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -329,7 +329,7 @@ int ubi_create_volume(struct ubi_device vol->dev.devt = dev; vol->dev.class = ubi_class; - sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); + dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id); err = device_register(&vol->dev); if (err) { ubi_err("cannot register device"); @@ -678,7 +678,7 @@ int ubi_add_volume(struct ubi_device *ub vol->dev.parent = &ubi->dev; vol->dev.devt = dev; vol->dev.class = ubi_class; - sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); + dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id); err = device_register(&vol->dev); if (err) goto out_gluebi; --- a/include/linux/mtd/concat.h +++ b/include/linux/mtd/concat.h @@ -13,7 +13,7 @@ struct mtd_info *mtd_concat_create( struct mtd_info *subdev[], /* subdevices to concatenate */ int num_devs, /* number of subdevices */ - char *name); /* name for the new device */ + const char *name); /* name for the new device */ void mtd_concat_destroy(struct mtd_info *mtd); ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2009-01-02 2:07 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-11-27 4:15 linux-next: manual merge of the mtd tree Stephen Rothwell 2008-11-27 5:25 ` Greg KH 2008-12-10 2:08 ` Stephen Rothwell 2008-12-10 2:27 ` Greg KH 2008-12-10 2:34 ` Stephen Rothwell 2008-12-10 4:04 ` Greg KH -- strict thread matches above, loose matches on Subject: below -- 2008-12-11 2:43 Stephen Rothwell 2008-12-11 10:11 ` Dmitry Eremin-Solenikov 2008-12-11 10:23 ` Stephen Rothwell 2008-12-11 10:32 ` Eric Miao 2008-12-12 10:29 ` Dmitry Eremin-Solenikov 2008-12-12 11:11 ` David Woodhouse 2008-12-12 23:05 ` Stephen Rothwell 2008-12-15 4:15 ` Stephen Rothwell 2009-01-02 2:07 ` Stephen Rothwell 2008-12-22 6:12 Stephen Rothwell 2008-12-23 4:28 ` Greg KH
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).