kbuild: Fix instrumentation removal breakage on avr32
[wrt350n-kernel.git] / arch / powerpc / platforms / 44x / warp-nand.c
blob84ab78ff8c0301cd92a6500e53fea1719c65663e
1 /*
2 * PIKA Warp(tm) NAND flash specific routines
4 * Copyright (c) 2008 PIKA Technologies
5 * Sean MacLennan <smaclennan@pikatech.com>
6 */
8 #include <linux/platform_device.h>
9 #include <linux/mtd/mtd.h>
10 #include <linux/mtd/map.h>
11 #include <linux/mtd/partitions.h>
12 #include <linux/mtd/nand.h>
13 #include <linux/mtd/ndfc.h>
15 #ifdef CONFIG_MTD_NAND_NDFC
17 #define CS_NAND_0 1 /* use chip select 1 for NAND device 0 */
19 #define WARP_NAND_FLASH_REG_ADDR 0xD0000000UL
20 #define WARP_NAND_FLASH_REG_SIZE 0x2000
22 static struct resource warp_ndfc = {
23 .start = WARP_NAND_FLASH_REG_ADDR,
24 .end = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE,
25 .flags = IORESOURCE_MEM,
28 static struct mtd_partition nand_parts[] = {
30 .name = "kernel",
31 .offset = 0,
32 .size = 0x0200000
35 .name = "root",
36 .offset = 0x0200000,
37 .size = 0x3400000
40 .name = "user",
41 .offset = 0x3600000,
42 .size = 0x0A00000
46 struct ndfc_controller_settings warp_ndfc_settings = {
47 .ccr_settings = (NDFC_CCR_BS(CS_NAND_0) | NDFC_CCR_ARAC1),
48 .ndfc_erpn = 0,
51 static struct ndfc_chip_settings warp_chip0_settings = {
52 .bank_settings = 0x80002222,
55 struct platform_nand_ctrl warp_nand_ctrl = {
56 .priv = &warp_ndfc_settings,
59 static struct platform_device warp_ndfc_device = {
60 .name = "ndfc-nand",
61 .id = 0,
62 .dev = {
63 .platform_data = &warp_nand_ctrl,
65 .num_resources = 1,
66 .resource = &warp_ndfc,
69 static struct nand_ecclayout nand_oob_16 = {
70 .eccbytes = 3,
71 .eccpos = { 0, 1, 2, 3, 6, 7 },
72 .oobfree = { {.offset = 8, .length = 16} }
75 static struct platform_nand_chip warp_nand_chip0 = {
76 .nr_chips = 1,
77 .chip_offset = CS_NAND_0,
78 .nr_partitions = ARRAY_SIZE(nand_parts),
79 .partitions = nand_parts,
80 .chip_delay = 50,
81 .ecclayout = &nand_oob_16,
82 .priv = &warp_chip0_settings,
85 static struct platform_device warp_nand_device = {
86 .name = "ndfc-chip",
87 .id = 0,
88 .num_resources = 1,
89 .resource = &warp_ndfc,
90 .dev = {
91 .platform_data = &warp_nand_chip0,
92 .parent = &warp_ndfc_device.dev,
96 static int warp_setup_nand_flash(void)
98 platform_device_register(&warp_ndfc_device);
99 platform_device_register(&warp_nand_device);
101 return 0;
103 device_initcall(warp_setup_nand_flash);
105 #endif