Root/
1 | /* |
2 | * Broadcom specific AMBA |
3 | * ChipCommon NAND flash interface |
4 | * |
5 | * Licensed under the GNU/GPL. See COPYING for details. |
6 | */ |
7 | |
8 | #include "bcma_private.h" |
9 | |
10 | #include <linux/platform_device.h> |
11 | #include <linux/bcma/bcma.h> |
12 | |
13 | struct platform_device bcma_nflash_dev = { |
14 | .name = "bcma_nflash", |
15 | .num_resources = 0, |
16 | }; |
17 | |
18 | /* Initialize NAND flash access */ |
19 | int bcma_nflash_init(struct bcma_drv_cc *cc) |
20 | { |
21 | struct bcma_bus *bus = cc->core->bus; |
22 | |
23 | if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 && |
24 | cc->core->id.rev != 38) { |
25 | bcma_err(bus, "NAND flash on unsupported board!\n"); |
26 | return -ENOTSUPP; |
27 | } |
28 | |
29 | if (!(cc->capabilities & BCMA_CC_CAP_NFLASH)) { |
30 | bcma_err(bus, "NAND flash not present according to ChipCommon\n"); |
31 | return -ENODEV; |
32 | } |
33 | |
34 | cc->nflash.present = true; |
35 | if (cc->core->id.rev == 38 && |
36 | (cc->status & BCMA_CC_CHIPST_5357_NAND_BOOT)) |
37 | cc->nflash.boot = true; |
38 | |
39 | /* Prepare platform device, but don't register it yet. It's too early, |
40 | * malloc (required by device_private_init) is not available yet. */ |
41 | bcma_nflash_dev.dev.platform_data = &cc->nflash; |
42 | |
43 | return 0; |
44 | } |
45 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9