| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bhab_3112.c $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/6 $ |
|---|
| 12 | * $brcm_Date: 5/27/11 4:42p $ |
|---|
| 13 | * |
|---|
| 14 | * |
|---|
| 15 | * Revision History: |
|---|
| 16 | * |
|---|
| 17 | * $brcm_Log: /magnum/basemodules/hab/3112/bhab_3112.c $ |
|---|
| 18 | * |
|---|
| 19 | * Hydra_Software_Devel/6 5/27/11 4:42p atanugul |
|---|
| 20 | * SW3461-3: Initializer for BHAB_3461_GetConfigSettings and |
|---|
| 21 | * BHAB_3461_SetConfigSettings |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/5 5/6/11 3:49p atanugul |
|---|
| 24 | * SW3128-2: Added support to configure TM_MTSIF_CTRL - Transport Control |
|---|
| 25 | * Register for BCM3128 |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/4 5/3/11 5:58p mward |
|---|
| 28 | * SW3128-8: missing initializer for isSpi. |
|---|
| 29 | * |
|---|
| 30 | * Hydra_Software_Devel/3 12/2/10 7:30p VISHK |
|---|
| 31 | * SW7405-5037: To make the i2c address programmable for the slave |
|---|
| 32 | * device(LNA) of 31xx frontend chip. |
|---|
| 33 | * |
|---|
| 34 | * Hydra_Software_Devel/2 10/14/09 1:40p mward |
|---|
| 35 | * SW7125-34: 31xx: Add support to configure the Watchdog feature of 31xx. |
|---|
| 36 | * |
|---|
| 37 | * Hydra_Software_Devel/1 3/10/09 1:57p vishk |
|---|
| 38 | * PR 46431: Add support for BCM3117, BCM3114, and BCM3112 |
|---|
| 39 | * |
|---|
| 40 | * |
|---|
| 41 | ***************************************************************************/ |
|---|
| 42 | |
|---|
| 43 | #include "bhab.h" |
|---|
| 44 | #include "bhab_priv.h" |
|---|
| 45 | #include "bhab_3112.h" |
|---|
| 46 | #include "bhab_31xx_priv.h" |
|---|
| 47 | |
|---|
| 48 | BDBG_MODULE(bhab_3112); |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | static const BHAB_Settings defDevSettings = |
|---|
| 52 | { |
|---|
| 53 | 0x66, /* chipAddr */ |
|---|
| 54 | NULL, /* interruptEnableFunc */ |
|---|
| 55 | NULL, /* interruptEnableFuncParam */ |
|---|
| 56 | /* API function table */ |
|---|
| 57 | { |
|---|
| 58 | BHAB_31xx_Open, |
|---|
| 59 | BHAB_31xx_Close, |
|---|
| 60 | BHAB_31xx_InitAp, |
|---|
| 61 | BHAB_31xx_GetApStatus, |
|---|
| 62 | BHAB_31xx_GetApVersion, |
|---|
| 63 | BHAB_31xx_ReadRegister, |
|---|
| 64 | BHAB_31xx_WriteRegister, |
|---|
| 65 | BHAB_31xx_ReadMemory, |
|---|
| 66 | BHAB_31xx_WriteMemory, |
|---|
| 67 | BHAB_31xx_ReadMbox, |
|---|
| 68 | BHAB_31xx_WriteMbox, |
|---|
| 69 | BHAB_31xx_HandleInterrupt_isr, |
|---|
| 70 | BHAB_31xx_ProcessInterruptEvent, |
|---|
| 71 | BHAB_31xx_EnableLockInterrupt, |
|---|
| 72 | BHAB_31xx_InstallInterruptCallback, |
|---|
| 73 | BHAB_31xx_UnInstallInterruptCallback, |
|---|
| 74 | BHAB_31xx_SendHabCommand, |
|---|
| 75 | BHAB_31xx_GetInterruptEventHandle, |
|---|
| 76 | BHAB_31xx_GetWatchDogTimer, |
|---|
| 77 | BHAB_31xx_SetWatchDogTimer, |
|---|
| 78 | BHAB_31xx_GetNmiConfig, |
|---|
| 79 | BHAB_31xx_SetNmiConfig, |
|---|
| 80 | NULL, /* BHAB_3461_GetConfigSettings */ |
|---|
| 81 | NULL /* BHAB_3461_SetConfigSettings */ |
|---|
| 82 | }, |
|---|
| 83 | 0x60, /* slaveChipAddr */ |
|---|
| 84 | false, /* isSpi */ |
|---|
| 85 | false /* isMtsif */ |
|---|
| 86 | }; |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | /****************************************************************************** |
|---|
| 90 | BHAB_3112_GetDefaultSettings() |
|---|
| 91 | ******************************************************************************/ |
|---|
| 92 | BERR_Code BHAB_3112_GetDefaultSettings( |
|---|
| 93 | BHAB_Settings *pDefSettings /* [out] default settings */ |
|---|
| 94 | ) |
|---|
| 95 | { |
|---|
| 96 | *pDefSettings = defDevSettings; |
|---|
| 97 | return BERR_SUCCESS; |
|---|
| 98 | } |
|---|