2 * Broadcom specific AMBA
5 * Licensed under the GNU/GPL. See COPYING for details.
8 #include "bcma_private.h"
9 #include <linux/bcma/bcma.h>
11 bool bcma_core_is_enabled(struct bcma_device
*core
)
13 if ((bcma_aread32(core
, BCMA_IOCTL
) & (BCMA_IOCTL_CLK
| BCMA_IOCTL_FGC
))
16 if (bcma_aread32(core
, BCMA_RESET_CTL
) & BCMA_RESET_CTL_RESET
)
20 EXPORT_SYMBOL_GPL(bcma_core_is_enabled
);
22 static void bcma_core_disable(struct bcma_device
*core
, u32 flags
)
24 if (bcma_aread32(core
, BCMA_RESET_CTL
) & BCMA_RESET_CTL_RESET
)
27 bcma_awrite32(core
, BCMA_IOCTL
, flags
);
28 bcma_aread32(core
, BCMA_IOCTL
);
31 bcma_awrite32(core
, BCMA_RESET_CTL
, BCMA_RESET_CTL_RESET
);
35 int bcma_core_enable(struct bcma_device
*core
, u32 flags
)
37 bcma_core_disable(core
, flags
);
39 bcma_awrite32(core
, BCMA_IOCTL
, (BCMA_IOCTL_CLK
| BCMA_IOCTL_FGC
| flags
));
40 bcma_aread32(core
, BCMA_IOCTL
);
42 bcma_awrite32(core
, BCMA_RESET_CTL
, 0);
45 bcma_awrite32(core
, BCMA_IOCTL
, (BCMA_IOCTL_CLK
| flags
));
46 bcma_aread32(core
, BCMA_IOCTL
);
51 EXPORT_SYMBOL_GPL(bcma_core_enable
);