net/mlx4: Move Ethernet related functionality from mlx4_core to mlx4_en
[linux-2.6/btrfs-unstable.git] / drivers / bcma / driver_chipcommon_nflash.c
blob1f0b83e18f6827f5003669b4015c2a89b2d369c5
1 /*
2 * Broadcom specific AMBA
3 * ChipCommon NAND flash interface
5 * Licensed under the GNU/GPL. See COPYING for details.
6 */
8 #include <linux/platform_device.h>
9 #include <linux/bcma/bcma.h>
11 #include "bcma_private.h"
13 struct platform_device bcma_nflash_dev = {
14 .name = "bcma_nflash",
15 .num_resources = 0,
18 /* Initialize NAND flash access */
19 int bcma_nflash_init(struct bcma_drv_cc *cc)
21 struct bcma_bus *bus = cc->core->bus;
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;
29 if (!(cc->capabilities & BCMA_CC_CAP_NFLASH)) {
30 bcma_err(bus, "NAND flash not present according to ChipCommon\n");
31 return -ENODEV;
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;
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;
43 return 0;