2 * Sonics Silicon Backplane
3 * PCMCIA-Hostbus related functions
5 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
6 * Copyright 2007-2008 Michael Buesch <m@bues.ch>
8 * Licensed under the GNU/GPL. See COPYING for details.
11 #include "ssb_private.h"
13 #include <linux/ssb/ssb.h>
14 #include <linux/delay.h>
16 #include <linux/etherdevice.h>
18 #include <pcmcia/cistpl.h>
19 #include <pcmcia/ciscode.h>
20 #include <pcmcia/ds.h>
21 #include <pcmcia/cisreg.h>
24 /* Define the following to 1 to enable a printk on each coreswitch. */
25 #define SSB_VERBOSE_PCMCIACORESWITCH_DEBUG 0
28 /* PCMCIA configuration registers */
29 #define SSB_PCMCIA_ADDRESS0 0x2E
30 #define SSB_PCMCIA_ADDRESS1 0x30
31 #define SSB_PCMCIA_ADDRESS2 0x32
32 #define SSB_PCMCIA_MEMSEG 0x34
33 #define SSB_PCMCIA_SPROMCTL 0x36
34 #define SSB_PCMCIA_SPROMCTL_IDLE 0
35 #define SSB_PCMCIA_SPROMCTL_WRITE 1
36 #define SSB_PCMCIA_SPROMCTL_READ 2
37 #define SSB_PCMCIA_SPROMCTL_WRITEEN 4
38 #define SSB_PCMCIA_SPROMCTL_WRITEDIS 7
39 #define SSB_PCMCIA_SPROMCTL_DONE 8
40 #define SSB_PCMCIA_SPROM_DATALO 0x38
41 #define SSB_PCMCIA_SPROM_DATAHI 0x3A
42 #define SSB_PCMCIA_SPROM_ADDRLO 0x3C
43 #define SSB_PCMCIA_SPROM_ADDRHI 0x3E
45 /* Hardware invariants CIS tuples */
46 #define SSB_PCMCIA_CIS 0x80
47 #define SSB_PCMCIA_CIS_ID 0x01
48 #define SSB_PCMCIA_CIS_BOARDREV 0x02
49 #define SSB_PCMCIA_CIS_PA 0x03
50 #define SSB_PCMCIA_CIS_PA_PA0B0_LO 0
51 #define SSB_PCMCIA_CIS_PA_PA0B0_HI 1
52 #define SSB_PCMCIA_CIS_PA_PA0B1_LO 2
53 #define SSB_PCMCIA_CIS_PA_PA0B1_HI 3
54 #define SSB_PCMCIA_CIS_PA_PA0B2_LO 4
55 #define SSB_PCMCIA_CIS_PA_PA0B2_HI 5
56 #define SSB_PCMCIA_CIS_PA_ITSSI 6
57 #define SSB_PCMCIA_CIS_PA_MAXPOW 7
58 #define SSB_PCMCIA_CIS_OEMNAME 0x04
59 #define SSB_PCMCIA_CIS_CCODE 0x05
60 #define SSB_PCMCIA_CIS_ANTENNA 0x06
61 #define SSB_PCMCIA_CIS_ANTGAIN 0x07
62 #define SSB_PCMCIA_CIS_BFLAGS 0x08
63 #define SSB_PCMCIA_CIS_LEDS 0x09
65 /* PCMCIA SPROM size. */
66 #define SSB_PCMCIA_SPROM_SIZE 256
67 #define SSB_PCMCIA_SPROM_SIZE_BYTES (SSB_PCMCIA_SPROM_SIZE * sizeof(u16))
70 /* Write to a PCMCIA configuration register. */
71 static int ssb_pcmcia_cfg_write(struct ssb_bus
*bus
, u8 offset
, u8 value
)
75 res
= pcmcia_write_config_byte(bus
->host_pcmcia
, offset
, value
);
76 if (unlikely(res
!= 0))
82 /* Read from a PCMCIA configuration register. */
83 static int ssb_pcmcia_cfg_read(struct ssb_bus
*bus
, u8 offset
, u8
*value
)
87 res
= pcmcia_read_config_byte(bus
->host_pcmcia
, offset
, value
);
88 if (unlikely(res
!= 0))
94 int ssb_pcmcia_switch_coreidx(struct ssb_bus
*bus
,
104 addr
= (coreidx
* SSB_CORE_SIZE
) + SSB_ENUM_BASE
;
106 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_ADDRESS0
,
107 (addr
& 0x0000F000) >> 12);
110 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_ADDRESS1
,
111 (addr
& 0x00FF0000) >> 16);
114 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_ADDRESS2
,
115 (addr
& 0xFF000000) >> 24);
121 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_ADDRESS0
, &val
);
124 read_addr
|= ((u32
)(val
& 0x0F)) << 12;
125 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_ADDRESS1
, &val
);
128 read_addr
|= ((u32
)val
) << 16;
129 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_ADDRESS2
, &val
);
132 read_addr
|= ((u32
)val
) << 24;
134 cur_core
= (read_addr
- SSB_ENUM_BASE
) / SSB_CORE_SIZE
;
135 if (cur_core
== coreidx
)
139 if (attempts
++ > SSB_BAR0_MAX_RETRIES
)
146 pr_err("Failed to switch to core %u\n", coreidx
);
150 static int ssb_pcmcia_switch_core(struct ssb_bus
*bus
, struct ssb_device
*dev
)
154 #if SSB_VERBOSE_PCMCIACORESWITCH_DEBUG
155 pr_info("Switching to %s core, index %d\n",
156 ssb_core_name(dev
->id
.coreid
), dev
->core_index
);
159 err
= ssb_pcmcia_switch_coreidx(bus
, dev
->core_index
);
161 bus
->mapped_device
= dev
;
166 int ssb_pcmcia_switch_segment(struct ssb_bus
*bus
, u8 seg
)
172 WARN_ON((seg
!= 0) && (seg
!= 1));
174 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_MEMSEG
, seg
);
177 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_MEMSEG
, &val
);
184 if (unlikely(attempts
++ > SSB_BAR0_MAX_RETRIES
))
188 bus
->mapped_pcmcia_seg
= seg
;
192 pr_err("Failed to switch pcmcia segment\n");
196 static int select_core_and_segment(struct ssb_device
*dev
,
199 struct ssb_bus
*bus
= dev
->bus
;
203 if (*offset
>= 0x800) {
209 if (unlikely(dev
!= bus
->mapped_device
)) {
210 err
= ssb_pcmcia_switch_core(bus
, dev
);
214 if (unlikely(need_segment
!= bus
->mapped_pcmcia_seg
)) {
215 err
= ssb_pcmcia_switch_segment(bus
, need_segment
);
223 static u8
ssb_pcmcia_read8(struct ssb_device
*dev
, u16 offset
)
225 struct ssb_bus
*bus
= dev
->bus
;
230 spin_lock_irqsave(&bus
->bar_lock
, flags
);
231 err
= select_core_and_segment(dev
, &offset
);
233 value
= readb(bus
->mmio
+ offset
);
234 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
239 static u16
ssb_pcmcia_read16(struct ssb_device
*dev
, u16 offset
)
241 struct ssb_bus
*bus
= dev
->bus
;
246 spin_lock_irqsave(&bus
->bar_lock
, flags
);
247 err
= select_core_and_segment(dev
, &offset
);
249 value
= readw(bus
->mmio
+ offset
);
250 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
255 static u32
ssb_pcmcia_read32(struct ssb_device
*dev
, u16 offset
)
257 struct ssb_bus
*bus
= dev
->bus
;
260 u32 lo
= 0xFFFFFFFF, hi
= 0xFFFFFFFF;
262 spin_lock_irqsave(&bus
->bar_lock
, flags
);
263 err
= select_core_and_segment(dev
, &offset
);
265 lo
= readw(bus
->mmio
+ offset
);
266 hi
= readw(bus
->mmio
+ offset
+ 2);
268 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
270 return (lo
| (hi
<< 16));
273 #ifdef CONFIG_SSB_BLOCKIO
274 static void ssb_pcmcia_block_read(struct ssb_device
*dev
, void *buffer
,
275 size_t count
, u16 offset
, u8 reg_width
)
277 struct ssb_bus
*bus
= dev
->bus
;
279 void __iomem
*addr
= bus
->mmio
+ offset
;
282 spin_lock_irqsave(&bus
->bar_lock
, flags
);
283 err
= select_core_and_segment(dev
, &offset
);
285 memset(buffer
, 0xFF, count
);
293 *buf
= __raw_readb(addr
);
300 __le16
*buf
= buffer
;
304 *buf
= (__force __le16
)__raw_readw(addr
);
311 __le16
*buf
= buffer
;
315 *buf
= (__force __le16
)__raw_readw(addr
);
317 *buf
= (__force __le16
)__raw_readw(addr
+ 2);
327 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
329 #endif /* CONFIG_SSB_BLOCKIO */
331 static void ssb_pcmcia_write8(struct ssb_device
*dev
, u16 offset
, u8 value
)
333 struct ssb_bus
*bus
= dev
->bus
;
337 spin_lock_irqsave(&bus
->bar_lock
, flags
);
338 err
= select_core_and_segment(dev
, &offset
);
340 writeb(value
, bus
->mmio
+ offset
);
342 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
345 static void ssb_pcmcia_write16(struct ssb_device
*dev
, u16 offset
, u16 value
)
347 struct ssb_bus
*bus
= dev
->bus
;
351 spin_lock_irqsave(&bus
->bar_lock
, flags
);
352 err
= select_core_and_segment(dev
, &offset
);
354 writew(value
, bus
->mmio
+ offset
);
356 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
359 static void ssb_pcmcia_write32(struct ssb_device
*dev
, u16 offset
, u32 value
)
361 struct ssb_bus
*bus
= dev
->bus
;
365 spin_lock_irqsave(&bus
->bar_lock
, flags
);
366 err
= select_core_and_segment(dev
, &offset
);
368 writew((value
& 0x0000FFFF), bus
->mmio
+ offset
);
369 writew(((value
& 0xFFFF0000) >> 16), bus
->mmio
+ offset
+ 2);
372 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
375 #ifdef CONFIG_SSB_BLOCKIO
376 static void ssb_pcmcia_block_write(struct ssb_device
*dev
, const void *buffer
,
377 size_t count
, u16 offset
, u8 reg_width
)
379 struct ssb_bus
*bus
= dev
->bus
;
381 void __iomem
*addr
= bus
->mmio
+ offset
;
384 spin_lock_irqsave(&bus
->bar_lock
, flags
);
385 err
= select_core_and_segment(dev
, &offset
);
390 const u8
*buf
= buffer
;
393 __raw_writeb(*buf
, addr
);
400 const __le16
*buf
= buffer
;
404 __raw_writew((__force u16
)(*buf
), addr
);
411 const __le16
*buf
= buffer
;
415 __raw_writew((__force u16
)(*buf
), addr
);
417 __raw_writew((__force u16
)(*buf
), addr
+ 2);
428 spin_unlock_irqrestore(&bus
->bar_lock
, flags
);
430 #endif /* CONFIG_SSB_BLOCKIO */
432 /* Not "static", as it's used in main.c */
433 const struct ssb_bus_ops ssb_pcmcia_ops
= {
434 .read8
= ssb_pcmcia_read8
,
435 .read16
= ssb_pcmcia_read16
,
436 .read32
= ssb_pcmcia_read32
,
437 .write8
= ssb_pcmcia_write8
,
438 .write16
= ssb_pcmcia_write16
,
439 .write32
= ssb_pcmcia_write32
,
440 #ifdef CONFIG_SSB_BLOCKIO
441 .block_read
= ssb_pcmcia_block_read
,
442 .block_write
= ssb_pcmcia_block_write
,
446 static int ssb_pcmcia_sprom_command(struct ssb_bus
*bus
, u8 command
)
452 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROMCTL
, command
);
455 for (i
= 0; i
< 1000; i
++) {
456 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_SPROMCTL
, &value
);
459 if (value
& SSB_PCMCIA_SPROMCTL_DONE
)
467 /* offset is the 16bit word offset */
468 static int ssb_pcmcia_sprom_read(struct ssb_bus
*bus
, u16 offset
, u16
*value
)
473 offset
*= 2; /* Make byte offset */
475 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROM_ADDRLO
,
479 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROM_ADDRHI
,
480 (offset
& 0xFF00) >> 8);
483 err
= ssb_pcmcia_sprom_command(bus
, SSB_PCMCIA_SPROMCTL_READ
);
486 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_SPROM_DATALO
, &lo
);
489 err
= ssb_pcmcia_cfg_read(bus
, SSB_PCMCIA_SPROM_DATAHI
, &hi
);
492 *value
= (lo
| (((u16
)hi
) << 8));
497 /* offset is the 16bit word offset */
498 static int ssb_pcmcia_sprom_write(struct ssb_bus
*bus
, u16 offset
, u16 value
)
502 offset
*= 2; /* Make byte offset */
504 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROM_ADDRLO
,
508 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROM_ADDRHI
,
509 (offset
& 0xFF00) >> 8);
512 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROM_DATALO
,
516 err
= ssb_pcmcia_cfg_write(bus
, SSB_PCMCIA_SPROM_DATAHI
,
517 (value
& 0xFF00) >> 8);
520 err
= ssb_pcmcia_sprom_command(bus
, SSB_PCMCIA_SPROMCTL_WRITE
);
528 /* Read the SPROM image. bufsize is in 16bit words. */
529 static int ssb_pcmcia_sprom_read_all(struct ssb_bus
*bus
, u16
*sprom
)
533 for (i
= 0; i
< SSB_PCMCIA_SPROM_SIZE
; i
++) {
534 err
= ssb_pcmcia_sprom_read(bus
, i
, &sprom
[i
]);
542 /* Write the SPROM image. size is in 16bit words. */
543 static int ssb_pcmcia_sprom_write_all(struct ssb_bus
*bus
, const u16
*sprom
)
547 size_t size
= SSB_PCMCIA_SPROM_SIZE
;
549 pr_notice("Writing SPROM. Do NOT turn off the power! Please stand by...\n");
550 err
= ssb_pcmcia_sprom_command(bus
, SSB_PCMCIA_SPROMCTL_WRITEEN
);
552 pr_notice("Could not enable SPROM write access\n");
557 for (i
= 0; i
< size
; i
++) {
560 else if (i
== size
/ 2)
562 else if (i
== (size
* 3) / 4)
566 err
= ssb_pcmcia_sprom_write(bus
, i
, sprom
[i
]);
568 pr_notice("Failed to write to SPROM\n");
573 err
= ssb_pcmcia_sprom_command(bus
, SSB_PCMCIA_SPROMCTL_WRITEDIS
);
575 pr_notice("Could not disable SPROM write access\n");
580 pr_cont("100%% ]\n");
581 pr_notice("SPROM written\n");
584 return failed
? -EBUSY
: 0;
587 static int ssb_pcmcia_sprom_check_crc(const u16
*sprom
, size_t size
)
593 #define GOTO_ERROR_ON(condition, description) do { \
594 if (unlikely(condition)) { \
595 error_description = description; \
600 static int ssb_pcmcia_get_mac(struct pcmcia_device
*p_dev
,
604 struct ssb_sprom
*sprom
= priv
;
606 if (tuple
->TupleData
[0] != CISTPL_FUNCE_LAN_NODE_ID
)
608 if (tuple
->TupleDataLen
!= ETH_ALEN
+ 2)
610 if (tuple
->TupleData
[1] != ETH_ALEN
)
612 memcpy(sprom
->il0mac
, &tuple
->TupleData
[2], ETH_ALEN
);
616 static int ssb_pcmcia_do_get_invariants(struct pcmcia_device
*p_dev
,
620 struct ssb_init_invariants
*iv
= priv
;
621 struct ssb_sprom
*sprom
= &iv
->sprom
;
622 struct ssb_boardinfo
*bi
= &iv
->boardinfo
;
623 const char *error_description
;
625 GOTO_ERROR_ON(tuple
->TupleDataLen
< 1, "VEN tpl < 1");
626 switch (tuple
->TupleData
[0]) {
627 case SSB_PCMCIA_CIS_ID
:
628 GOTO_ERROR_ON((tuple
->TupleDataLen
!= 5) &&
629 (tuple
->TupleDataLen
!= 7),
631 bi
->vendor
= tuple
->TupleData
[1] |
632 ((u16
)tuple
->TupleData
[2] << 8);
634 case SSB_PCMCIA_CIS_BOARDREV
:
635 GOTO_ERROR_ON(tuple
->TupleDataLen
!= 2,
636 "boardrev tpl size");
637 sprom
->board_rev
= tuple
->TupleData
[1];
639 case SSB_PCMCIA_CIS_PA
:
640 GOTO_ERROR_ON((tuple
->TupleDataLen
!= 9) &&
641 (tuple
->TupleDataLen
!= 10),
643 sprom
->pa0b0
= tuple
->TupleData
[1] |
644 ((u16
)tuple
->TupleData
[2] << 8);
645 sprom
->pa0b1
= tuple
->TupleData
[3] |
646 ((u16
)tuple
->TupleData
[4] << 8);
647 sprom
->pa0b2
= tuple
->TupleData
[5] |
648 ((u16
)tuple
->TupleData
[6] << 8);
649 sprom
->itssi_a
= tuple
->TupleData
[7];
650 sprom
->itssi_bg
= tuple
->TupleData
[7];
651 sprom
->maxpwr_a
= tuple
->TupleData
[8];
652 sprom
->maxpwr_bg
= tuple
->TupleData
[8];
654 case SSB_PCMCIA_CIS_OEMNAME
:
655 /* We ignore this. */
657 case SSB_PCMCIA_CIS_CCODE
:
658 GOTO_ERROR_ON(tuple
->TupleDataLen
!= 2,
660 sprom
->country_code
= tuple
->TupleData
[1];
662 case SSB_PCMCIA_CIS_ANTENNA
:
663 GOTO_ERROR_ON(tuple
->TupleDataLen
!= 2,
665 sprom
->ant_available_a
= tuple
->TupleData
[1];
666 sprom
->ant_available_bg
= tuple
->TupleData
[1];
668 case SSB_PCMCIA_CIS_ANTGAIN
:
669 GOTO_ERROR_ON(tuple
->TupleDataLen
!= 2,
671 sprom
->antenna_gain
.a0
= tuple
->TupleData
[1];
672 sprom
->antenna_gain
.a1
= tuple
->TupleData
[1];
673 sprom
->antenna_gain
.a2
= tuple
->TupleData
[1];
674 sprom
->antenna_gain
.a3
= tuple
->TupleData
[1];
676 case SSB_PCMCIA_CIS_BFLAGS
:
677 GOTO_ERROR_ON((tuple
->TupleDataLen
!= 3) &&
678 (tuple
->TupleDataLen
!= 5),
680 sprom
->boardflags_lo
= tuple
->TupleData
[1] |
681 ((u16
)tuple
->TupleData
[2] << 8);
683 case SSB_PCMCIA_CIS_LEDS
:
684 GOTO_ERROR_ON(tuple
->TupleDataLen
!= 5,
686 sprom
->gpio0
= tuple
->TupleData
[1];
687 sprom
->gpio1
= tuple
->TupleData
[2];
688 sprom
->gpio2
= tuple
->TupleData
[3];
689 sprom
->gpio3
= tuple
->TupleData
[4];
692 return -ENOSPC
; /* continue with next entry */
695 pr_err("PCMCIA: Failed to fetch device invariants: %s\n",
701 int ssb_pcmcia_get_invariants(struct ssb_bus
*bus
,
702 struct ssb_init_invariants
*iv
)
704 struct ssb_sprom
*sprom
= &iv
->sprom
;
707 memset(sprom
, 0xFF, sizeof(*sprom
));
709 sprom
->boardflags_lo
= 0;
710 sprom
->boardflags_hi
= 0;
712 /* First fetch the MAC address. */
713 res
= pcmcia_loop_tuple(bus
->host_pcmcia
, CISTPL_FUNCE
,
714 ssb_pcmcia_get_mac
, sprom
);
716 pr_err("PCMCIA: Failed to fetch MAC address\n");
720 /* Fetch the vendor specific tuples. */
721 res
= pcmcia_loop_tuple(bus
->host_pcmcia
, SSB_PCMCIA_CIS
,
722 ssb_pcmcia_do_get_invariants
, iv
);
723 if ((res
== 0) || (res
== -ENOSPC
))
726 pr_err("PCMCIA: Failed to fetch device invariants\n");
730 static ssize_t
ssb_pcmcia_attr_sprom_show(struct device
*pcmciadev
,
731 struct device_attribute
*attr
,
734 struct pcmcia_device
*pdev
=
735 container_of(pcmciadev
, struct pcmcia_device
, dev
);
738 bus
= ssb_pcmcia_dev_to_bus(pdev
);
742 return ssb_attr_sprom_show(bus
, buf
,
743 ssb_pcmcia_sprom_read_all
);
746 static ssize_t
ssb_pcmcia_attr_sprom_store(struct device
*pcmciadev
,
747 struct device_attribute
*attr
,
748 const char *buf
, size_t count
)
750 struct pcmcia_device
*pdev
=
751 container_of(pcmciadev
, struct pcmcia_device
, dev
);
754 bus
= ssb_pcmcia_dev_to_bus(pdev
);
758 return ssb_attr_sprom_store(bus
, buf
, count
,
759 ssb_pcmcia_sprom_check_crc
,
760 ssb_pcmcia_sprom_write_all
);
763 static DEVICE_ATTR(ssb_sprom
, 0600,
764 ssb_pcmcia_attr_sprom_show
,
765 ssb_pcmcia_attr_sprom_store
);
767 static int ssb_pcmcia_cor_setup(struct ssb_bus
*bus
, u8 cor
)
772 err
= ssb_pcmcia_cfg_read(bus
, cor
, &val
);
775 val
&= ~COR_SOFT_RESET
;
776 val
|= COR_FUNC_ENA
| COR_IREQ_ENA
| COR_LEVEL_REQ
;
777 err
= ssb_pcmcia_cfg_write(bus
, cor
, val
);
785 /* Initialize the PCMCIA hardware. This is called on Init and Resume. */
786 int ssb_pcmcia_hardware_setup(struct ssb_bus
*bus
)
790 if (bus
->bustype
!= SSB_BUSTYPE_PCMCIA
)
793 /* Switch segment to a known state and sync
794 * bus->mapped_pcmcia_seg with hardware state. */
795 ssb_pcmcia_switch_segment(bus
, 0);
796 /* Init the COR register. */
797 err
= ssb_pcmcia_cor_setup(bus
, CISREG_COR
);
800 /* Some cards also need this register to get poked. */
801 err
= ssb_pcmcia_cor_setup(bus
, CISREG_COR
+ 0x80);
808 void ssb_pcmcia_exit(struct ssb_bus
*bus
)
810 if (bus
->bustype
!= SSB_BUSTYPE_PCMCIA
)
813 device_remove_file(&bus
->host_pcmcia
->dev
, &dev_attr_ssb_sprom
);
816 int ssb_pcmcia_init(struct ssb_bus
*bus
)
820 if (bus
->bustype
!= SSB_BUSTYPE_PCMCIA
)
823 err
= ssb_pcmcia_hardware_setup(bus
);
827 bus
->sprom_size
= SSB_PCMCIA_SPROM_SIZE
;
828 mutex_init(&bus
->sprom_mutex
);
829 err
= device_create_file(&bus
->host_pcmcia
->dev
, &dev_attr_ssb_sprom
);
835 pr_err("Failed to initialize PCMCIA host device\n");