Skip to content

Commit ccce710

Browse files
Bartosz Golaszewskimiquelraynal
authored andcommitted
mtd: rawnand: davinci: make platform_data private
There are no longer any users of the platform data for davinci rawnand in board files. We can remove the public pdata headers and move the structures that are still used into the driver compilation unit while removing the rest. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 1824520 commit ccce710

File tree

3 files changed

+65
-129
lines changed

3 files changed

+65
-129
lines changed

drivers/mtd/nand/raw/davinci_nand.c

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,71 @@
2020
#include <linux/slab.h>
2121
#include <linux/of.h>
2222

23-
#include <linux/platform_data/mtd-davinci.h>
24-
#include <linux/platform_data/mtd-davinci-aemif.h>
23+
#define NRCSR_OFFSET 0x00
24+
#define NANDFCR_OFFSET 0x60
25+
#define NANDFSR_OFFSET 0x64
26+
#define NANDF1ECC_OFFSET 0x70
27+
28+
/* 4-bit ECC syndrome registers */
29+
#define NAND_4BIT_ECC_LOAD_OFFSET 0xbc
30+
#define NAND_4BIT_ECC1_OFFSET 0xc0
31+
#define NAND_4BIT_ECC2_OFFSET 0xc4
32+
#define NAND_4BIT_ECC3_OFFSET 0xc8
33+
#define NAND_4BIT_ECC4_OFFSET 0xcc
34+
#define NAND_ERR_ADD1_OFFSET 0xd0
35+
#define NAND_ERR_ADD2_OFFSET 0xd4
36+
#define NAND_ERR_ERRVAL1_OFFSET 0xd8
37+
#define NAND_ERR_ERRVAL2_OFFSET 0xdc
38+
39+
/* NOTE: boards don't need to use these address bits
40+
* for ALE/CLE unless they support booting from NAND.
41+
* They're used unless platform data overrides them.
42+
*/
43+
#define MASK_ALE 0x08
44+
#define MASK_CLE 0x10
45+
46+
struct davinci_nand_pdata {
47+
uint32_t mask_ale;
48+
uint32_t mask_cle;
49+
50+
/*
51+
* 0-indexed chip-select number of the asynchronous
52+
* interface to which the NAND device has been connected.
53+
*
54+
* So, if you have NAND connected to CS3 of DA850, you
55+
* will pass '1' here. Since the asynchronous interface
56+
* on DA850 starts from CS2.
57+
*/
58+
uint32_t core_chipsel;
59+
60+
/* for packages using two chipselects */
61+
uint32_t mask_chipsel;
62+
63+
/* board's default static partition info */
64+
struct mtd_partition *parts;
65+
unsigned int nr_parts;
66+
67+
/* none == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!)
68+
* soft == NAND_ECC_ENGINE_TYPE_SOFT
69+
* else == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits
70+
*
71+
* All DaVinci-family chips support 1-bit hardware ECC.
72+
* Newer ones also support 4-bit ECC, but are awkward
73+
* using it with large page chips.
74+
*/
75+
enum nand_ecc_engine_type engine_type;
76+
enum nand_ecc_placement ecc_placement;
77+
u8 ecc_bits;
78+
79+
/* e.g. NAND_BUSWIDTH_16 */
80+
unsigned int options;
81+
/* e.g. NAND_BBT_USE_FLASH */
82+
unsigned int bbt_options;
83+
84+
/* Main and mirror bbt descriptor overrides */
85+
struct nand_bbt_descr *bbt_td;
86+
struct nand_bbt_descr *bbt_md;
87+
};
2588

2689
/*
2790
* This is a device driver for the NAND flash controller found on the
@@ -54,8 +117,6 @@ struct davinci_nand_info {
54117
uint32_t mask_cle;
55118

56119
uint32_t core_chipsel;
57-
58-
struct davinci_aemif_timing *timing;
59120
};
60121

61122
static DEFINE_SPINLOCK(davinci_nand_lock);
@@ -775,7 +836,6 @@ static int nand_davinci_probe(struct platform_device *pdev)
775836
info->chip.options = pdata->options;
776837
info->chip.bbt_td = pdata->bbt_td;
777838
info->chip.bbt_md = pdata->bbt_md;
778-
info->timing = pdata->timing;
779839

780840
info->current_cs = info->vaddr;
781841
info->core_chipsel = pdata->core_chipsel;

include/linux/platform_data/mtd-davinci-aemif.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

include/linux/platform_data/mtd-davinci.h

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)