| .. | .. |
|---|
| 5 | 5 | * Copyright (C) 2008 Magnus Damm |
|---|
| 6 | 6 | */ |
|---|
| 7 | 7 | #include <linux/clkdev.h> |
|---|
| 8 | | -#include <linux/dma-mapping.h> |
|---|
| 8 | +#include <linux/dma-map-ops.h> |
|---|
| 9 | 9 | #include <linux/init.h> |
|---|
| 10 | 10 | #include <linux/platform_device.h> |
|---|
| 11 | 11 | #include <linux/interrupt.h> |
|---|
| .. | .. |
|---|
| 15 | 15 | #include <linux/mmc/host.h> |
|---|
| 16 | 16 | #include <linux/mtd/physmap.h> |
|---|
| 17 | 17 | #include <linux/mfd/tmio.h> |
|---|
| 18 | | -#include <linux/mtd/rawnand.h> |
|---|
| 18 | +#include <linux/mtd/platnand.h> |
|---|
| 19 | 19 | #include <linux/i2c.h> |
|---|
| 20 | 20 | #include <linux/regulator/fixed.h> |
|---|
| 21 | 21 | #include <linux/regulator/machine.h> |
|---|
| .. | .. |
|---|
| 166 | 166 | }, |
|---|
| 167 | 167 | }; |
|---|
| 168 | 168 | |
|---|
| 169 | | -static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd, |
|---|
| 169 | +static void migor_nand_flash_cmd_ctl(struct nand_chip *chip, int cmd, |
|---|
| 170 | 170 | unsigned int ctrl) |
|---|
| 171 | 171 | { |
|---|
| 172 | | - struct nand_chip *chip = mtd_to_nand(mtd); |
|---|
| 173 | | - |
|---|
| 174 | 172 | if (cmd == NAND_CMD_NONE) |
|---|
| 175 | 173 | return; |
|---|
| 176 | 174 | |
|---|
| 177 | 175 | if (ctrl & NAND_CLE) |
|---|
| 178 | | - writeb(cmd, chip->IO_ADDR_W + 0x00400000); |
|---|
| 176 | + writeb(cmd, chip->legacy.IO_ADDR_W + 0x00400000); |
|---|
| 179 | 177 | else if (ctrl & NAND_ALE) |
|---|
| 180 | | - writeb(cmd, chip->IO_ADDR_W + 0x00800000); |
|---|
| 178 | + writeb(cmd, chip->legacy.IO_ADDR_W + 0x00800000); |
|---|
| 181 | 179 | else |
|---|
| 182 | | - writeb(cmd, chip->IO_ADDR_W); |
|---|
| 180 | + writeb(cmd, chip->legacy.IO_ADDR_W); |
|---|
| 183 | 181 | } |
|---|
| 184 | 182 | |
|---|
| 185 | | -static int migor_nand_flash_ready(struct mtd_info *mtd) |
|---|
| 183 | +static int migor_nand_flash_ready(struct nand_chip *chip) |
|---|
| 186 | 184 | { |
|---|
| 187 | 185 | return gpio_get_value(GPIO_PTA1); /* NAND_RBn */ |
|---|
| 188 | 186 | } |
|---|
| .. | .. |
|---|
| 604 | 602 | |
|---|
| 605 | 603 | /* Initialize CEU platform device separately to map memory first */ |
|---|
| 606 | 604 | device_initialize(&migor_ceu_device.dev); |
|---|
| 607 | | - arch_setup_pdev_archdata(&migor_ceu_device); |
|---|
| 608 | 605 | dma_declare_coherent_memory(&migor_ceu_device.dev, |
|---|
| 609 | | - ceu_dma_membase, ceu_dma_membase, |
|---|
| 610 | | - ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1, |
|---|
| 611 | | - DMA_MEMORY_EXCLUSIVE); |
|---|
| 606 | + ceu_dma_membase, ceu_dma_membase, |
|---|
| 607 | + CEU_BUFFER_MEMORY_SIZE); |
|---|
| 612 | 608 | |
|---|
| 613 | 609 | platform_device_add(&migor_ceu_device); |
|---|
| 614 | 610 | |
|---|
| .. | .. |
|---|
| 633 | 629 | phys_addr_t phys; |
|---|
| 634 | 630 | phys_addr_t size = CEU_BUFFER_MEMORY_SIZE; |
|---|
| 635 | 631 | |
|---|
| 636 | | - phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE); |
|---|
| 632 | + phys = memblock_phys_alloc(size, PAGE_SIZE); |
|---|
| 633 | + if (!phys) |
|---|
| 634 | + panic("Failed to allocate CEU memory\n"); |
|---|
| 635 | + |
|---|
| 637 | 636 | memblock_free(phys, size); |
|---|
| 638 | 637 | memblock_remove(phys, size); |
|---|
| 639 | 638 | |
|---|