| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * DBAu1200/PBAu1200 board platform device registration |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2008-2011 Manuel Lauss |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 19 | 6 | */ |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 29 | 16 | #include <linux/leds.h> |
|---|
| 30 | 17 | #include <linux/mmc/host.h> |
|---|
| 31 | 18 | #include <linux/mtd/mtd.h> |
|---|
| 32 | | -#include <linux/mtd/rawnand.h> |
|---|
| 33 | | -#include <linux/mtd/partitions.h> |
|---|
| 19 | +#include <linux/mtd/platnand.h> |
|---|
| 34 | 20 | #include <linux/platform_device.h> |
|---|
| 35 | 21 | #include <linux/serial_8250.h> |
|---|
| 36 | 22 | #include <linux/spi/spi.h> |
|---|
| .. | .. |
|---|
| 154 | 140 | |
|---|
| 155 | 141 | /******************************************************************************/ |
|---|
| 156 | 142 | |
|---|
| 143 | +static u64 au1200_all_dmamask = DMA_BIT_MASK(32); |
|---|
| 144 | + |
|---|
| 157 | 145 | static struct mtd_partition db1200_spiflash_parts[] = { |
|---|
| 158 | 146 | { |
|---|
| 159 | 147 | .name = "spi_flash", |
|---|
| .. | .. |
|---|
| 197 | 185 | |
|---|
| 198 | 186 | /**********************************************************************/ |
|---|
| 199 | 187 | |
|---|
| 200 | | -static void au1200_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, |
|---|
| 188 | +static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd, |
|---|
| 201 | 189 | unsigned int ctrl) |
|---|
| 202 | 190 | { |
|---|
| 203 | | - struct nand_chip *this = mtd_to_nand(mtd); |
|---|
| 204 | | - unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; |
|---|
| 191 | + unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W; |
|---|
| 205 | 192 | |
|---|
| 206 | 193 | ioaddr &= 0xffffff00; |
|---|
| 207 | 194 | |
|---|
| .. | .. |
|---|
| 213 | 200 | /* assume we want to r/w real data by default */ |
|---|
| 214 | 201 | ioaddr += MEM_STNAND_DATA; |
|---|
| 215 | 202 | } |
|---|
| 216 | | - this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; |
|---|
| 203 | + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr; |
|---|
| 217 | 204 | if (cmd != NAND_CMD_NONE) { |
|---|
| 218 | | - __raw_writeb(cmd, this->IO_ADDR_W); |
|---|
| 205 | + __raw_writeb(cmd, this->legacy.IO_ADDR_W); |
|---|
| 219 | 206 | wmb(); |
|---|
| 220 | 207 | } |
|---|
| 221 | 208 | } |
|---|
| 222 | 209 | |
|---|
| 223 | | -static int au1200_nand_device_ready(struct mtd_info *mtd) |
|---|
| 210 | +static int au1200_nand_device_ready(struct nand_chip *this) |
|---|
| 224 | 211 | { |
|---|
| 225 | 212 | return alchemy_rdsmem(AU1000_MEM_STSTAT) & 1; |
|---|
| 226 | 213 | } |
|---|
| .. | .. |
|---|
| 326 | 313 | }, |
|---|
| 327 | 314 | }; |
|---|
| 328 | 315 | |
|---|
| 329 | | -static u64 au1200_ide_dmamask = DMA_BIT_MASK(32); |
|---|
| 330 | | - |
|---|
| 331 | 316 | static struct platform_device db1200_ide_dev = { |
|---|
| 332 | 317 | .name = "pata_platform", |
|---|
| 333 | 318 | .id = 0, |
|---|
| 334 | 319 | .dev = { |
|---|
| 335 | | - .dma_mask = &au1200_ide_dmamask, |
|---|
| 320 | + .dma_mask = &au1200_all_dmamask, |
|---|
| 336 | 321 | .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 337 | 322 | .platform_data = &db1200_ide_info, |
|---|
| 338 | 323 | }, |
|---|
| .. | .. |
|---|
| 568 | 553 | } |
|---|
| 569 | 554 | }; |
|---|
| 570 | 555 | |
|---|
| 571 | | -static u64 au1xxx_mmc_dmamask = DMA_BIT_MASK(32); |
|---|
| 572 | | - |
|---|
| 573 | 556 | static struct platform_device db1200_mmc0_dev = { |
|---|
| 574 | 557 | .name = "au1xxx-mmc", |
|---|
| 575 | 558 | .id = 0, |
|---|
| 576 | 559 | .dev = { |
|---|
| 577 | | - .dma_mask = &au1xxx_mmc_dmamask, |
|---|
| 560 | + .dma_mask = &au1200_all_dmamask, |
|---|
| 578 | 561 | .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 579 | 562 | .platform_data = &db1200_mmc_platdata[0], |
|---|
| 580 | 563 | }, |
|---|
| .. | .. |
|---|
| 609 | 592 | .name = "au1xxx-mmc", |
|---|
| 610 | 593 | .id = 1, |
|---|
| 611 | 594 | .dev = { |
|---|
| 612 | | - .dma_mask = &au1xxx_mmc_dmamask, |
|---|
| 595 | + .dma_mask = &au1200_all_dmamask, |
|---|
| 613 | 596 | .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 614 | 597 | .platform_data = &db1200_mmc_platdata[1], |
|---|
| 615 | 598 | }, |
|---|
| .. | .. |
|---|
| 659 | 642 | } |
|---|
| 660 | 643 | }; |
|---|
| 661 | 644 | |
|---|
| 662 | | -static u64 au1200_lcd_dmamask = DMA_BIT_MASK(32); |
|---|
| 663 | | - |
|---|
| 664 | 645 | static struct platform_device au1200_lcd_dev = { |
|---|
| 665 | 646 | .name = "au1200-lcd", |
|---|
| 666 | 647 | .id = 0, |
|---|
| 667 | 648 | .dev = { |
|---|
| 668 | | - .dma_mask = &au1200_lcd_dmamask, |
|---|
| 649 | + .dma_mask = &au1200_all_dmamask, |
|---|
| 669 | 650 | .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 670 | 651 | .platform_data = &db1200fb_pd, |
|---|
| 671 | 652 | }, |
|---|
| .. | .. |
|---|
| 719 | 700 | .activate_cs = db1200_spi_cs_en, |
|---|
| 720 | 701 | }; |
|---|
| 721 | 702 | |
|---|
| 722 | | -static u64 spi_dmamask = DMA_BIT_MASK(32); |
|---|
| 723 | | - |
|---|
| 724 | 703 | static struct platform_device db1200_spi_dev = { |
|---|
| 725 | 704 | .dev = { |
|---|
| 726 | | - .dma_mask = &spi_dmamask, |
|---|
| 705 | + .dma_mask = &au1200_all_dmamask, |
|---|
| 727 | 706 | .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 728 | 707 | .platform_data = &db1200_spi_platdata, |
|---|
| 729 | 708 | }, |
|---|
| .. | .. |
|---|
| 768 | 747 | static struct platform_device db1200_sound_dev = { |
|---|
| 769 | 748 | /* name assigned later based on switch setting */ |
|---|
| 770 | 749 | .id = 1, /* PSC ID */ |
|---|
| 750 | + .dev = { |
|---|
| 751 | + .dma_mask = &au1200_all_dmamask, |
|---|
| 752 | + .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 753 | + }, |
|---|
| 771 | 754 | }; |
|---|
| 772 | 755 | |
|---|
| 773 | 756 | static struct platform_device db1200_stac_dev = { |
|---|