.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * arch/arm/mach-ep93xx/snappercl15.c |
---|
3 | 4 | * Bluewater Systems Snapper CL15 system module |
---|
.. | .. |
---|
8 | 9 | * NAND code adapted from driver by: |
---|
9 | 10 | * Andre Renaud <andre@bluewatersys.com> |
---|
10 | 11 | * James R. McKaskill |
---|
11 | | - * |
---|
12 | | - * This program is free software; you can redistribute it and/or modify |
---|
13 | | - * it under the terms of the GNU General Public License as published by |
---|
14 | | - * the Free Software Foundation; either version 2 of the License, or (at |
---|
15 | | - * your option) any later version. |
---|
16 | | - * |
---|
17 | 12 | */ |
---|
18 | 13 | |
---|
19 | 14 | #include <linux/platform_device.h> |
---|
.. | .. |
---|
23 | 18 | #include <linux/i2c.h> |
---|
24 | 19 | #include <linux/fb.h> |
---|
25 | 20 | |
---|
26 | | -#include <linux/mtd/partitions.h> |
---|
27 | | -#include <linux/mtd/rawnand.h> |
---|
| 21 | +#include <linux/mtd/platnand.h> |
---|
28 | 22 | |
---|
29 | | -#include <mach/hardware.h> |
---|
| 23 | +#include "hardware.h" |
---|
30 | 24 | #include <linux/platform_data/video-ep93xx.h> |
---|
31 | | -#include <mach/gpio-ep93xx.h> |
---|
| 25 | +#include "gpio-ep93xx.h" |
---|
32 | 26 | |
---|
33 | 27 | #include <asm/mach-types.h> |
---|
34 | 28 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
43 | 37 | #define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */ |
---|
44 | 38 | #define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */ |
---|
45 | 39 | |
---|
46 | | -#define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40) |
---|
| 40 | +#define NAND_CTRL_ADDR(chip) (chip->legacy.IO_ADDR_W + 0x40) |
---|
47 | 41 | |
---|
48 | | -static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, |
---|
| 42 | +static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd, |
---|
49 | 43 | unsigned int ctrl) |
---|
50 | 44 | { |
---|
51 | | - struct nand_chip *chip = mtd_to_nand(mtd); |
---|
52 | 45 | static u16 nand_state = SNAPPERCL15_NAND_WPN; |
---|
53 | 46 | u16 set; |
---|
54 | 47 | |
---|
.. | .. |
---|
70 | 63 | } |
---|
71 | 64 | |
---|
72 | 65 | if (cmd != NAND_CMD_NONE) |
---|
73 | | - __raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W); |
---|
| 66 | + __raw_writew((cmd & 0xff) | nand_state, |
---|
| 67 | + chip->legacy.IO_ADDR_W); |
---|
74 | 68 | } |
---|
75 | 69 | |
---|
76 | | -static int snappercl15_nand_dev_ready(struct mtd_info *mtd) |
---|
| 70 | +static int snappercl15_nand_dev_ready(struct nand_chip *chip) |
---|
77 | 71 | { |
---|
78 | | - struct nand_chip *chip = mtd_to_nand(mtd); |
---|
79 | | - |
---|
80 | 72 | return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY); |
---|
81 | 73 | } |
---|
82 | 74 | |
---|