1 From 89b904335338c86ef2c40e7cc51e19673feb62c1 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 17 Jul 2011 15:02:10 +0200
4 Subject: [PATCH 17/22] bcm47xx: register flash drivers
7 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
9 arch/mips/bcm47xx/setup.c | 50 +++++++++++++++++++++++++++++++++++++++++++++
10 1 files changed, 50 insertions(+), 0 deletions(-)
12 --- a/arch/mips/bcm47xx/setup.c
13 +++ b/arch/mips/bcm47xx/setup.c
15 #include <linux/ssb/ssb.h>
16 #include <linux/ssb/ssb_embedded.h>
17 #include <linux/bcma/bcma_soc.h>
18 +#include <linux/platform_device.h>
19 #include <asm/bootinfo.h>
20 #include <asm/reboot.h>
22 @@ -357,3 +358,52 @@ static int __init bcm47xx_register_bus_c
25 device_initcall(bcm47xx_register_bus_complete);
27 +static struct resource bcm47xx_pflash_resource = {
34 +static struct platform_device bcm47xx_pflash = {
35 + .name = "bcm47xx_pflash",
36 + .resource = &bcm47xx_pflash_resource,
40 +static struct resource bcm47xx_sflash_resource = {
47 +static struct platform_device bcm47xx_sflash = {
48 + .name = "bcm47xx_sflash",
49 + .resource = &bcm47xx_sflash_resource,
53 +static int __init bcm47xx_register_flash(void)
55 + switch (bcm47xx_active_bus_type) {
56 +#ifdef CONFIG_BCM47XX_SSB
57 + case BCM47XX_BUS_TYPE_SSB:
58 + return platform_device_register(&bcm47xx_pflash);
60 +#ifdef CONFIG_BCM47XX_BCMA
61 + case BCM47XX_BUS_TYPE_BCMA:
62 + if (bcm47xx_bus.bcma.bus.drv_cc.flash_type == BCMA_PFLASH) {
63 + return platform_device_register(&bcm47xx_pflash);
64 + } else if (bcm47xx_bus.bcma.bus.drv_cc.flash_type == BCMA_SFLASH) {
65 + return platform_device_register(&bcm47xx_sflash);
67 + printk(KERN_ERR "No flash device found\n");
74 +fs_initcall(bcm47xx_register_flash);