forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/mach-ep93xx/snappercl15.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * arch/arm/mach-ep93xx/snappercl15.c
34 * Bluewater Systems Snapper CL15 system module
....@@ -8,12 +9,6 @@
89 * NAND code adapted from driver by:
910 * Andre Renaud <andre@bluewatersys.com>
1011 * 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
- *
1712 */
1813
1914 #include <linux/platform_device.h>
....@@ -23,12 +18,11 @@
2318 #include <linux/i2c.h>
2419 #include <linux/fb.h>
2520
26
-#include <linux/mtd/partitions.h>
27
-#include <linux/mtd/rawnand.h>
21
+#include <linux/mtd/platnand.h>
2822
29
-#include <mach/hardware.h>
23
+#include "hardware.h"
3024 #include <linux/platform_data/video-ep93xx.h>
31
-#include <mach/gpio-ep93xx.h>
25
+#include "gpio-ep93xx.h"
3226
3327 #include <asm/mach-types.h>
3428 #include <asm/mach/arch.h>
....@@ -43,12 +37,11 @@
4337 #define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */
4438 #define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */
4539
46
-#define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40)
40
+#define NAND_CTRL_ADDR(chip) (chip->legacy.IO_ADDR_W + 0x40)
4741
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,
4943 unsigned int ctrl)
5044 {
51
- struct nand_chip *chip = mtd_to_nand(mtd);
5245 static u16 nand_state = SNAPPERCL15_NAND_WPN;
5346 u16 set;
5447
....@@ -70,13 +63,12 @@
7063 }
7164
7265 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);
7468 }
7569
76
-static int snappercl15_nand_dev_ready(struct mtd_info *mtd)
70
+static int snappercl15_nand_dev_ready(struct nand_chip *chip)
7771 {
78
- struct nand_chip *chip = mtd_to_nand(mtd);
79
-
8072 return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY);
8173 }
8274