From 1a2238d1bddc823df06f67312d96ccf9de2893cc Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Dec 2015 13:13:57 +0000 Subject: CFE from danitool [without hostTools dir]: https://mega.nz/#!mwZyFK7a!CPT3BKC8dEw29kubtdYxhB91G9vIIismTkgzQ3iUy3k --- shared/opensource/boardparms/bcm963xx/Makefile | 16 + shared/opensource/boardparms/bcm963xx/boardparms.c | 3712 +++++++++ .../boardparms/bcm963xx/boardparms_voice.c | 8804 ++++++++++++++++++++ shared/opensource/flash/Makefile | 41 + shared/opensource/flash/cfiflash.c | 1112 +++ shared/opensource/flash/flash_api.c | 350 + shared/opensource/flash/flash_common.c | 280 + shared/opensource/flash/nandflash.c | 1260 +++ shared/opensource/flash/spiflash.c | 969 +++ shared/opensource/include/bcm963xx/6328_cpu.h | 150 + shared/opensource/include/bcm963xx/6328_intr.h | 120 + shared/opensource/include/bcm963xx/6328_map_part.h | 1325 +++ shared/opensource/include/bcm963xx/6362_cpu.h | 150 + shared/opensource/include/bcm963xx/6362_intr.h | 123 + shared/opensource/include/bcm963xx/6362_map_part.h | 1478 ++++ shared/opensource/include/bcm963xx/6368_cpu.h | 150 + shared/opensource/include/bcm963xx/6368_intr.h | 123 + shared/opensource/include/bcm963xx/6368_map_part.h | 1035 +++ shared/opensource/include/bcm963xx/6816_cpu.h | 150 + shared/opensource/include/bcm963xx/6816_intr.h | 116 + shared/opensource/include/bcm963xx/6816_map_part.h | 1487 ++++ shared/opensource/include/bcm963xx/bcmSpi.h | 55 + shared/opensource/include/bcm963xx/bcmSpiRes.h | 101 + shared/opensource/include/bcm963xx/bcmTag.h | 175 + shared/opensource/include/bcm963xx/bcm_hwdefs.h | 193 + shared/opensource/include/bcm963xx/bcmnetlink.h | 47 + shared/opensource/include/bcm963xx/boardparms.h | 453 + .../opensource/include/bcm963xx/boardparms_voice.h | 392 + shared/opensource/include/bcm963xx/fap_mod_size.h | 2 + shared/opensource/include/bcm963xx/flash_api.h | 90 + shared/opensource/include/bcm963xx/flash_common.h | 103 + shared/opensource/include/bcm963xx/gpio_drv.h | 40 + shared/opensource/include/bcm963xx/wan_det.h | 245 + shared/opensource/include/bcm963xx/wps_led.h | 28 + shared/opensource/spi/Makefile | 30 + shared/opensource/spi/bcmHsSpi.c | 898 ++ shared/opensource/spi/bcmLegSpi.c | 774 ++ shared/opensource/spi/bcmSpiRes.c | 660 ++ 38 files changed, 27237 insertions(+) create mode 100755 shared/opensource/boardparms/bcm963xx/Makefile create mode 100755 shared/opensource/boardparms/bcm963xx/boardparms.c create mode 100755 shared/opensource/boardparms/bcm963xx/boardparms_voice.c create mode 100755 shared/opensource/flash/Makefile create mode 100755 shared/opensource/flash/cfiflash.c create mode 100755 shared/opensource/flash/flash_api.c create mode 100755 shared/opensource/flash/flash_common.c create mode 100755 shared/opensource/flash/nandflash.c create mode 100755 shared/opensource/flash/spiflash.c create mode 100755 shared/opensource/include/bcm963xx/6328_cpu.h create mode 100755 shared/opensource/include/bcm963xx/6328_intr.h create mode 100755 shared/opensource/include/bcm963xx/6328_map_part.h create mode 100755 shared/opensource/include/bcm963xx/6362_cpu.h create mode 100755 shared/opensource/include/bcm963xx/6362_intr.h create mode 100755 shared/opensource/include/bcm963xx/6362_map_part.h create mode 100755 shared/opensource/include/bcm963xx/6368_cpu.h create mode 100755 shared/opensource/include/bcm963xx/6368_intr.h create mode 100755 shared/opensource/include/bcm963xx/6368_map_part.h create mode 100755 shared/opensource/include/bcm963xx/6816_cpu.h create mode 100755 shared/opensource/include/bcm963xx/6816_intr.h create mode 100755 shared/opensource/include/bcm963xx/6816_map_part.h create mode 100755 shared/opensource/include/bcm963xx/bcmSpi.h create mode 100755 shared/opensource/include/bcm963xx/bcmSpiRes.h create mode 100755 shared/opensource/include/bcm963xx/bcmTag.h create mode 100755 shared/opensource/include/bcm963xx/bcm_hwdefs.h create mode 100755 shared/opensource/include/bcm963xx/bcmnetlink.h create mode 100755 shared/opensource/include/bcm963xx/boardparms.h create mode 100755 shared/opensource/include/bcm963xx/boardparms_voice.h create mode 100644 shared/opensource/include/bcm963xx/fap_mod_size.h create mode 100755 shared/opensource/include/bcm963xx/flash_api.h create mode 100755 shared/opensource/include/bcm963xx/flash_common.h create mode 100755 shared/opensource/include/bcm963xx/gpio_drv.h create mode 100755 shared/opensource/include/bcm963xx/wan_det.h create mode 100755 shared/opensource/include/bcm963xx/wps_led.h create mode 100755 shared/opensource/spi/Makefile create mode 100755 shared/opensource/spi/bcmHsSpi.c create mode 100755 shared/opensource/spi/bcmLegSpi.c create mode 100755 shared/opensource/spi/bcmSpiRes.c (limited to 'shared/opensource') diff --git a/shared/opensource/boardparms/bcm963xx/Makefile b/shared/opensource/boardparms/bcm963xx/Makefile new file mode 100755 index 0000000..8d2573c --- /dev/null +++ b/shared/opensource/boardparms/bcm963xx/Makefile @@ -0,0 +1,16 @@ + +ifeq ($(CONFIG_MIPS_BRCM),y) + +# Linux +obj-y += boardparms.o + +ifneq ($(strip $(VOXXXLOAD)),) +obj-y += boardparms_voice.o +endif + +EXTRA_CFLAGS += -DCONFIG_BCM9$(BRCM_CHIP) -I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) +-include $(TOPDIR)/Rules.make + +endif + + diff --git a/shared/opensource/boardparms/bcm963xx/boardparms.c b/shared/opensource/boardparms/bcm963xx/boardparms.c new file mode 100755 index 0000000..23ab3ef --- /dev/null +++ b/shared/opensource/boardparms/bcm963xx/boardparms.c @@ -0,0 +1,3712 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/************************************************************************** +* File Name : boardparms.c +* +* Description: This file contains the implementation for the BCM63xx board +* parameter access functions. +* +* Updates : 07/14/2003 Created. +***************************************************************************/ + +/* Includes. */ +#include "boardparms.h" +#include "boardparms_voice.h" + +/* Typedefs */ +typedef struct boardparameters +{ + char szBoardId[BP_BOARD_ID_LEN]; /* board id string */ + unsigned short usGPIOOverlay; /* enabled interfaces */ + + unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */ + unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */ + unsigned short usGpioUartRts; /* GPIO pin or not defined */ + unsigned short usGpioUartCts; /* GPIO pin or not defined */ + + unsigned short usGpioLedAdsl; /* GPIO pin or not defined */ + unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */ + unsigned short usGpioSecLedAdsl; /* GPIO pin or not defined */ + unsigned short usGpioSecLedAdslFail; /* GPIO pin or not defined */ + unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */ + unsigned short usGpioLedHpna; /* GPIO pin or not defined */ + unsigned short usGpioLedWanData; /* GPIO pin or not defined */ + unsigned short usGpioLedWanError; /* GPIO pin or not defined */ + unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */ + unsigned short usGpioLedBlStop; /* GPIO pin or not defined */ + unsigned short usGpioFpgaReset; /* GPIO pin or not defined */ + unsigned short usGpioLedGpon; /* GPIO pin or not defined */ + unsigned short usGpioLedGponFail; /* GPIO pin or not defined */ + + unsigned short usGpioLedMoCA; /* GPIO pin or not defined */ + unsigned short usGpioLedMoCAFail; /* GPIO pin or not defined */ + + unsigned short usExtIntrResetToDefault; /* ext intr or not defined */ + unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */ + unsigned short usExtIntrHpna; /* ext intr or not defined */ + + unsigned short usCsHpna; /* HPNA chip select or not defined */ + + unsigned short usAntInUseWireless; /* antenna in use or not defined */ + unsigned short usWirelessFlags; /* WLAN flags */ + + ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS]; + VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP]; + unsigned short usGpioWirelessPowerDown; /* WLAN_PD control or not defined */ + unsigned long ulAfeIds[2]; /* DSL AFE Ids */ + unsigned short usGpioExtAFEReset; /* GPIO pin or not defined */ + unsigned short usGpioExtAFELDPwr; /* GPIO pin or not defined */ + unsigned short usGpioExtAFELDMode; /* GPIO pin or not defined */ +} BOARD_PARAMETERS, *PBOARD_PARAMETERS; + +#define SW_INFO_DEFAULT(n) { \ + (0x00000001 << (n)) - 1, /* port_map */ \ +{0, 0, 0, 0, 0, 0, 0, 0} /* phy_id */ \ +} + +/* Variables */ +#if defined(_BCM96362_) || defined(CONFIG_BCM96362) + +static BOARD_PARAMETERS g_bcm96362advnx = +{ + "96362ADVNX", /* szBoardId */ + (BP_OVERLAY_USB_LED | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_SERIAL_LEDS | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_SERIAL_GPIO_14_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_SERIAL_GPIO_15_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_1_AL, /* usGpioLedWanData */ + BP_SERIAL_GPIO_10_AL, /* usGpioLedWanError */ + BP_SERIAL_GPIO_12_AL, /* usGpioLedBlPowerOn */ + BP_SERIAL_GPIO_13_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_WLAN_EXCLUDE_ONBOARD, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_SERIAL_GPIO_8_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_SERIAL_GPIO_9_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96362advngr = +{ + "96362ADVNgr", /* szBoardId */ + (BP_OVERLAY_USB_LED | + BP_OVERLAY_SPI_EXT_CS | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_SERIAL_LEDS | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_SERIAL_GPIO_14_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_SERIAL_GPIO_15_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_1_AL, /* usGpioLedWanData */ + BP_SERIAL_GPIO_10_AL, /* usGpioLedWanError */ + BP_SERIAL_GPIO_12_AL, /* usGpioLedBlPowerOn */ + BP_SERIAL_GPIO_13_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_WLAN_EXCLUDE_ONBOARD, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x3f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x19, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_SERIAL_GPIO_8_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_SERIAL_GPIO_9_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96362advngr2 = +{ + "96362ADVNgr2", /* szBoardId */ + (BP_OVERLAY_USB_LED | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_SERIAL_LEDS | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_SERIAL_GPIO_14_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_SERIAL_GPIO_15_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_1_AL, /* usGpioLedWanData */ + BP_SERIAL_GPIO_10_AL, /* usGpioLedWanError */ + BP_SERIAL_GPIO_12_AL, /* usGpioLedBlPowerOn */ + BP_SERIAL_GPIO_13_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_WLAN_EXCLUDE_ONBOARD, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_SERIAL_GPIO_8_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_SERIAL_GPIO_9_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_SERIAL_GPIO_11_AL, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6302_REV_5_2_2, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcm96362advnx, &g_bcm96362advngr, &g_bcm96362advngr2, 0}; +#endif + +#if defined(_BCM96368_) || defined(CONFIG_BCM96368) + +static BOARD_PARAMETERS g_bcm96368vvw = +{ + "96368VVW", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_24_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_33_AH, /* usGpioLedWanError */ + BP_GPIO_0_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_1_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_GPIO_25_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_GPIO_26_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_GPIO_27_AL, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368vvwb = +{ + "96368VVWB", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_24_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_33_AH, /* usGpioLedWanError */ + BP_GPIO_0_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_1_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_GPIO_25_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_GPIO_26_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_GPIO_27_AL, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXB| BP_AFE_FE_REV_ISIL_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368ntr = +{ + "96368NTR", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_33_AH, /* usGpioLedWanError */ + BP_GPIO_0_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_1_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + BP_NOT_DEFINED, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_GPIO_25_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_GPIO_26_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_GPIO_27_AL, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368sv2 = +{ + "96368SV2", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_33_AH, /* usGpioLedWanError */ + BP_GPIO_30_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_31_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x3f, {0x01, 0x02, 0x03, 0x04, 0x12, 0x11, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_GPIO_25_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_GPIO_26_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_GPIO_27_AL, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mvwg = +{ + "96368MVWG", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_22_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x36, {0x00, 0x02, 0x03, 0x00, 0x12, 0x11, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mvwgb = +{ + "96368MVWGB", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_22_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x36, {0x00, 0x02, 0x03, 0x00, 0x12, 0x11, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXB| BP_AFE_FE_REV_6302_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mvwgj = +{ + "96368MVWGJ", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_22_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x36, {0x00, 0x02, 0x03, 0x00, 0x12, 0x11, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXJ | BP_AFE_FE_REV_6302_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mbg = +{ + "96368MBG", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_NOT_DEFINED, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1, + BP_AFE_CHIP_6306 | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1}, /* ulAfeIds */ + BP_GPIO_35_AL, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mbg6b = +{ + "96368MBG6b", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_NOT_DEFINED, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_6306 | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_GPIO_35_AL, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mbg6302 = +{ + "96368MBG6302", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_NOT_DEFINED, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1, + BP_AFE_CHIP_6306 | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1}, /* ulAfeIds */ + BP_GPIO_35_AL, /* usGpioExtAFEReset */ + BP_GPIO_37_AH, /* usGpioExtAFELDPwr */ + BP_GPIO_36_AH /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mng = +{ + "96368MNG", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + BP_NOT_DEFINED, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x20, {0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00}}}, /* sw */ + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */ + {0x0f, {0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00}}}}, /* sw */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_6306 | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_GPIO_37_AL, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96367avng = +{ + "96367AVNG", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_23_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_GPIO_31_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x2f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x11, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mvngr = +{ + "96368MVNgr", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_SPI_EXT_CS | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_23_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AH, /* usGpioLedWanData */ + BP_GPIO_3_AH, /* usGpioLedWanError */ + BP_GPIO_22_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96368mvngrP2 = +{ + "96368MVNgrP2", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_PHY | + BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_INET_LED | + BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_2_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_23_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_5_AL, /* usGpioLedWanData */ + BP_GPIO_3_AL, /* usGpioLedWanError */ + BP_GPIO_22_AL, /* usGpioLedBlPowerOn */ + BP_GPIO_24_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_0, /* usExtIntrResetToDefault */ + BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1, + BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static PBOARD_PARAMETERS g_BoardParms[] = +{&g_bcm96368vvw, &g_bcm96368mvwg, &g_bcm96368sv2, &g_bcm96368mbg, +&g_bcm96368ntr, &g_bcm96368mbg6b, &g_bcm96368vvwb, &g_bcm96368mvwgb, +&g_bcm96368mng, &g_bcm96368mbg6302, &g_bcm96368mvwgj, &g_bcm96367avng, +&g_bcm96368mvngr, &g_bcm96368mvngrP2, 0}; +#endif + +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) + +static BOARD_PARAMETERS g_bcm96816sv = +{ + "96816SV", /* szBoardId */ + (BP_OVERLAY_PCI | + BP_OVERLAY_GPHY_LED_0 | + BP_OVERLAY_GPHY_LED_1 | + BP_OVERLAY_MOCA_LED ), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_NOT_DEFINED, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_GPIO_3_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_4_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_GPIO_8_AH, /* usGpioLedGpon */ + BP_GPIO_16_AH, /* usGpioLedGponFail */ + BP_GPIO_5_AH, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0xbf, {0x00, 0x01, 0x14, 0x12, 0x18, 0xff, 0x00, 0xff}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_NO_DSP}, /* ucDspType */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96816pvwm = +{ + "96816PVWM", /* szBoardId */ + (BP_OVERLAY_GPHY_LED_0 | + BP_OVERLAY_GPHY_LED_1 | + BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_NOT_DEFINED, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_GPIO_3_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_4_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_GPIO_8_AH, /* usGpioLedGpon */ + BP_GPIO_2_AH, /* usGpioLedGponFail */ + BP_GPIO_5_AH, /* usGpioLedMoCA */ + BP_GPIO_37_AH, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0xaf, {0x00, 0x01, 0x11, 0x12, 0x00, 0xff, 0x00, 0xff}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_NOT_DEFINED, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_NOT_DEFINED, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96829rg = +{ + "96829RG", /* szBoardId */ + (BP_OVERLAY_GPHY_LED_0 | + BP_OVERLAY_GPHY_LED_1 | + BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_NOT_DEFINED, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_GPIO_3_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_4_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_GPIO_5_AL, /* usGpioLedMoCA */ + BP_GPIO_37_AH, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0xaf, {0x00, 0x01, 0x11, 0x12, 0x00, 0xff, 0x00, 0xff}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_NO_DSP}, /* ucDspType */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96816p2og = +{ + "96816P2OG", /* szBoardId */ + (BP_OVERLAY_GPHY_LED_0 | + BP_OVERLAY_GPHY_LED_1 | + BP_OVERLAY_PCI | + BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_NOT_DEFINED, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */ + BP_NOT_DEFINED, /* usGpioLedBlStop */ + BP_GPIO_2_AH, /* usGpioFpgaReset */ + BP_GPIO_8_AH, /* usGpioLedGpon */ + BP_GPIO_16_AH, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0xaf, {0x00, 0x01, 0x11, 0xff, 0x00, 0xff, 0x00, 0xff}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_NO_DSP}, /* ucDspType */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96812pg = +{ + "96812PG" , /* szBoardId */ + (BP_OVERLAY_GPHY_LED_0 | + BP_OVERLAY_GPHY_LED_1), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_NOT_DEFINED, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_GPIO_3_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_4_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_GPIO_8_AH, /* usGpioLedGpon */ + BP_GPIO_2_AH, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0xaf, {0x00, 0x01, 0x11, 0x12, 0x00, 0xff, 0x00, 0xff}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_NO_DSP}, /* ucDspType */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96819bhr = +{ + "96819BHR", /* szBoardId */ + (BP_OVERLAY_GPHY_LED_0 | + BP_OVERLAY_GPHY_LED_1 | + BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_NOT_DEFINED, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_GPIO_3_AH, /* usGpioLedBlPowerOn */ + BP_GPIO_4_AH, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_GPIO_5_AL, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_EXT_INTR_3, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_NOT_DEFINED, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x3f, {0x00, 0x01, 0x14, 0x12, 0xA1, 0xff, 0x00, 0xff}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_NO_DSP}, /* ucDspType */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */ + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED, /* usGpioExtAFELDMode */ +}; + +static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcm96816sv, &g_bcm96816pvwm, &g_bcm96829rg, &g_bcm96816p2og, &g_bcm96812pg, &g_bcm96819bhr, 0}; +#endif + +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) +static BOARD_PARAMETERS g_bcm96328avng = +{ + "96328avng", /* szBoardId */ + (BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_3_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_GPIO_9_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + // **** Set to BP_GPIO_0_AL when WanData LED is connected to GPIO11 + BP_GPIO_0_AL, /* usGpioLedWanData */ + BP_GPIO_2_AL, /* usGpioLedWanError */ + BP_GPIO_4_AL, /* usGpioLedBlPowerOn */ + BP_GPIO_8_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_GPIO_6_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_GPIO_7_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_GPIO_5_AL, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96328avngrP1 = +{ + "96328avngrP1", /* szBoardId */ + (BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_SERIAL_LEDS), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_SERIAL_GPIO_10_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_SERIAL_GPIO_11_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_SERIAL_GPIO_1_AL, /* usGpioLedWanData */ + BP_SERIAL_GPIO_13_AL, /* usGpioLedWanError */ + BP_SERIAL_GPIO_8_AL, /* usGpioLedBlPowerOn */ + BP_SERIAL_GPIO_15_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_SERIAL_GPIO_12_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_SERIAL_GPIO_14_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm96328avngr = +{ + "96328avngr", /* szBoardId */ + (BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 | + BP_OVERLAY_SERIAL_LEDS), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_SERIAL_GPIO_10_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_SERIAL_GPIO_11_AL, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_GPIO_1_AL, /* usGpioLedWanData */ + BP_SERIAL_GPIO_13_AL, /* usGpioLedWanError */ + BP_SERIAL_GPIO_8_AL, /* usGpioLedBlPowerOn */ + BP_SERIAL_GPIO_15_AL, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_MIPS, /* ucDspType */ + 0, /* ucDspAddress */ + BP_NOT_DEFINED, /* usGpioLedVoip */ + BP_SERIAL_GPIO_12_AL, /* usGpioVoip1Led */ + BP_NOT_DEFINED, /* usGpioVoip1LedFail */ + BP_SERIAL_GPIO_14_AL, /* usGpioVoip2Led */ + BP_NOT_DEFINED, /* usGpioVoip2LedFail */ + BP_NOT_DEFINED, /* usGpioPotsLed */ + BP_NOT_DEFINED}, /* usGpioDectLed */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static BOARD_PARAMETERS g_bcm963281TAN = +{ + "963281TAN", /* szBoardId */ + + (BP_OVERLAY_EPHY_LED_0 | + BP_OVERLAY_EPHY_LED_1 | + BP_OVERLAY_EPHY_LED_2 | + BP_OVERLAY_EPHY_LED_3 ), /* usGPIOOverlay */ + + BP_NOT_DEFINED, /* usGpioRj11InnerPair */ + BP_NOT_DEFINED, /* usGpioRj11OuterPair */ + BP_NOT_DEFINED, /* usGpioUartRts */ + BP_NOT_DEFINED, /* usGpioUartCts */ + + BP_GPIO_20_AL, /* usGpioLedAdsl */ + BP_NOT_DEFINED, /* usGpioLedAdslFail */ + BP_NOT_DEFINED, /* usGpioSecLedAdsl */ + BP_NOT_DEFINED, /* usGpioSecLedAdslFail */ + BP_NOT_DEFINED, /* usGpioLedSesWireless */ + BP_NOT_DEFINED, /* usGpioLedHpna */ + BP_NOT_DEFINED, /* usGpioLedWanData */ + BP_NOT_DEFINED, /* usGpioLedWanError */ + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */ + BP_NOT_DEFINED, /* usGpioLedBlStop */ + BP_NOT_DEFINED, /* usGpioFpgaReset */ + BP_NOT_DEFINED, /* usGpioLedGpon */ + BP_NOT_DEFINED, /* usGpioLedGponFail */ + BP_NOT_DEFINED, /* usGpioLedMoCA */ + BP_NOT_DEFINED, /* usGpioLedMoCAFail */ + + BP_NOT_DEFINED, /* usExtIntrResetToDefault */ + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ + BP_NOT_DEFINED, /* usExtIntrHpna */ + + BP_NOT_DEFINED, /* usCsHpna */ + + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ + 0, /* WLAN flags */ + + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ + 0x0, /* ucPhyAddress */ + BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */ + BP_ENET_CONFIG_MMAP, /* usConfigType */ + {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */ + {BP_ENET_NO_PHY}}, /* ucPhyType */ + {{BP_VOIP_NO_DSP}, /* ucDspType */ + {BP_VOIP_NO_DSP}}, /* ucDspType */ + BP_NOT_DEFINED, /* usGpioWirelessPowerDown */ + {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */ + BP_AFE_DEFAULT}, + BP_NOT_DEFINED, /* usGpioExtAFEReset */ + BP_NOT_DEFINED, /* usGpioExtAFELDPwr */ + BP_NOT_DEFINED /* usGpioExtAFELDMode */ +}; + +static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcm96328avng, &g_bcm96328avngrP1, &g_bcm96328avngr, &g_bcm963281TAN, 0}; +#endif + +static PBOARD_PARAMETERS g_pCurrentBp = 0; + +/************************************************************************** +* Name : bpstrcmp +* +* Description: String compare for this file so it does not depend on an OS. +* (Linux kernel and CFE share this source file.) +* +* Parameters : [IN] dest - destination string +* [IN] src - source string +* +* Returns : -1 - dest < src, 1 - dest > src, 0 dest == src +***************************************************************************/ +int bpstrcmp(const char *dest,const char *src) +{ + while (*src && *dest) + { + if (*dest < *src) return -1; + if (*dest > *src) return 1; + dest++; + src++; + } + + if (*dest && !*src) return 1; + if (!*dest && *src) return -1; + return 0; +} /* bpstrcmp */ + +/************************************************************************** +* Name : BpGetVoipDspConfig +* +* Description: Gets the DSP configuration from the board parameter +* structure for a given DSP index. +* +* Parameters : [IN] dspNum - DSP index (number) +* +* Returns : Pointer to DSP configuration block if found/valid, NULL +* otherwise. +***************************************************************************/ +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum ) +{ + VOIP_DSP_INFO *pDspConfig = 0; + int i; + + if( g_pCurrentBp ) + { + for( i = 0 ; i < BP_MAX_VOIP_DSP ; i++ ) + { + if( g_pCurrentBp->VoIPDspInfo[i].ucDspType != BP_VOIP_NO_DSP && + g_pCurrentBp->VoIPDspInfo[i].ucDspAddress == dspNum ) + { + pDspConfig = &g_pCurrentBp->VoIPDspInfo[i]; + break; + } + } + } + + return pDspConfig; +} + + +/************************************************************************** +* Name : BpSetBoardId +* +* Description: This function find the BOARD_PARAMETERS structure for the +* specified board id string and assigns it to a global, static +* variable. +* +* Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_FOUND - Error, board id input string does not +* have a board parameters configuration record. +***************************************************************************/ +int BpSetBoardId( char *pszBoardId ) +{ + int nRet = BP_BOARD_ID_NOT_FOUND; + PBOARD_PARAMETERS *ppBp; + + for( ppBp = g_BoardParms; *ppBp; ppBp++ ) + { + if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) ) + { + g_pCurrentBp = *ppBp; + nRet = BP_SUCCESS; + break; + } + } + + return( nRet ); +} /* BpSetBoardId */ + +/************************************************************************** +* Name : BpGetBoardId +* +* Description: This function returns the current board id strings. +* +* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id +* string is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +***************************************************************************/ + +int BpGetBoardId( char *pszBoardId ) +{ + int i; + + if (g_pCurrentBp == 0) + return -1; + + for (i = 0; i < BP_BOARD_ID_LEN; i++) + pszBoardId[i] = g_pCurrentBp->szBoardId[i]; + + return 0; +} + +/************************************************************************** +* Name : BpGetBoardIds +* +* Description: This function returns all of the supported board id strings. +* +* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id +* strings are returned in. Each id starts at BP_BOARD_ID_LEN +* boundary. +* [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that +* were allocated in pszBoardIds. +* +* Returns : Number of board id strings returned. +***************************************************************************/ +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize ) +{ + PBOARD_PARAMETERS *ppBp; + int i; + char *src; + char *dest; + + for( i = 0, ppBp = g_BoardParms; *ppBp && nBoardIdsSize; + i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN ) + { + dest = pszBoardIds; + src = (*ppBp)->szBoardId; + while( *src ) + *dest++ = *src++; + *dest = '\0'; + } + + return( i ); +} /* BpGetBoardIds */ + +/************************************************************************** +* Name : BpGetGPIOverlays +* +* Description: This function GPIO overlay configuration +* +* Parameters : [OUT] pusValue - Address of short word that interfaces in use. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetGPIOverlays( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGPIOOverlay; + + if( g_pCurrentBp->usGPIOOverlay != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetGPIOverlays */ + +/************************************************************************** +* Name : BpGetEthernetMacInfo +* +* Description: This function returns all of the supported board id strings. +* +* Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO +* buffers. +* [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that +* are pointed to by pEnetInfos. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +***************************************************************************/ +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos ) +{ + int i, nRet; + + if( g_pCurrentBp ) + { + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ ) + { + if( i < BP_MAX_ENET_MACS ) + { + unsigned char *src = (unsigned char *) + &g_pCurrentBp->EnetMacInfos[i]; + unsigned char *dest = (unsigned char *) pEnetInfos; + int len = sizeof(ETHERNET_MAC_INFO); + while( len-- ) + *dest++ = *src++; + } + else + pEnetInfos->ucPhyType = BP_ENET_NO_PHY; + } + + nRet = BP_SUCCESS; + } + else + { + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ ) + pEnetInfos->ucPhyType = BP_ENET_NO_PHY; + + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetEthernetMacInfo */ + +/************************************************************************** +* Name : BpGetRj11InnerOuterPairGpios +* +* Description: This function returns the GPIO pin assignments for changing +* between the RJ11 inner pair and RJ11 outer pair. +* +* Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair +* GPIO pin is returned in. +* [OUT] pusOuter - Address of short word that the RJ11 outer pair +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, values are returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner, + unsigned short *pusOuter ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusInner = g_pCurrentBp->usGpioRj11InnerPair; + *pusOuter = g_pCurrentBp->usGpioRj11OuterPair; + + if( g_pCurrentBp->usGpioRj11InnerPair != BP_NOT_DEFINED && + g_pCurrentBp->usGpioRj11OuterPair != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusInner = *pusOuter = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetRj11InnerOuterPairGpios */ + +/************************************************************************** +* Name : BpGetUartRtsCtsGpios +* +* Description: This function returns the GPIO pin assignments for RTS and CTS +* UART signals. +* +* Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO +* pin is returned in. +* [OUT] pusCts - Address of short word that the UART CTS GPIO +* pin is returned in. +* +* Returns : BP_SUCCESS - Success, values are returned. +* BP_BOARD_ID_NOT_SET - Error, board id input string does not +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusRts = g_pCurrentBp->usGpioUartRts; + *pusCts = g_pCurrentBp->usGpioUartCts; + + if( g_pCurrentBp->usGpioUartRts != BP_NOT_DEFINED && + g_pCurrentBp->usGpioUartCts != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusRts = *pusCts = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetUartRtsCtsGpios */ + +/************************************************************************** +* Name : BpGetAdslLedGpio +* +* Description: This function returns the GPIO pin assignment for the ADSL +* LED. +* +* Parameters : [OUT] pusValue - Address of short word that the ADSL LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetAdslLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedAdsl; + + if( g_pCurrentBp->usGpioLedAdsl != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetAdslLedGpio */ + +/************************************************************************** +* Name : BpGetAdslFailLedGpio +* +* Description: This function returns the GPIO pin assignment for the ADSL +* LED that is used when there is a DSL connection failure. +* +* Parameters : [OUT] pusValue - Address of short word that the ADSL LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetAdslFailLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedAdslFail; + + if( g_pCurrentBp->usGpioLedAdslFail != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetAdslFailLedGpio */ + +/************************************************************************** +* Name : BpGetSecAdslLedGpio +* +* Description: This function returns the GPIO pin assignment for the ADSL +* LED of the Secondary line, applicable more for bonding. +* +* Parameters : [OUT] pusValue - Address of short word that the ADSL LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetSecAdslLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioSecLedAdsl; + + if( g_pCurrentBp->usGpioSecLedAdsl != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetSecAdslLedGpio */ + +/************************************************************************** +* Name : BpGetSecAdslFailLedGpio +* +* Description: This function returns the GPIO pin assignment for the ADSL +* LED of the Secondary ADSL line, that is used when there is +* a DSL connection failure. +* +* Parameters : [OUT] pusValue - Address of short word that the ADSL LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetSecAdslFailLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioSecLedAdslFail; + + if( g_pCurrentBp->usGpioSecLedAdslFail != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetSecAdslFailLedGpio */ + +/************************************************************************** +* Name : BpGetWirelessAntInUse +* +* Description: This function returns the antennas in use for wireless +* +* Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna +* is in use. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWirelessAntInUse( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usAntInUseWireless; + + if( g_pCurrentBp->usAntInUseWireless != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetWirelessAntInUse */ + +/************************************************************************** +* Name : BpGetWirelessFlags +* +* Description: This function returns optional control flags for wireless +* +* Parameters : [OUT] pusValue - Address of short word control flags +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWirelessFlags( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usWirelessFlags; + + if( g_pCurrentBp->usWirelessFlags != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetWirelessAntInUse */ + +/************************************************************************** +* Name : BpGetWirelessSesExtIntr +* +* Description: This function returns the external interrupt number for the +* Wireless Ses Button. +* +* Parameters : [OUT] pusValue - Address of short word that the Wireless Ses +* external interrup is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWirelessSesExtIntr( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usExtIntrSesBtnWireless; + + if( g_pCurrentBp->usExtIntrSesBtnWireless != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); + +} /* BpGetWirelessSesExtIntr */ + +/************************************************************************** +* Name : BpGetWirelessSesLedGpio +* +* Description: This function returns the GPIO pin assignment for the Wireless +* Ses Led. +* +* Parameters : [OUT] pusValue - Address of short word that the Wireless Ses +* Led GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWirelessSesLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedSesWireless; + + if( g_pCurrentBp->usGpioLedSesWireless != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); + +} /* BpGetWirelessSesLedGpio */ + +/* this data structure could be moved to boardparams structure in the future */ +/* does not require to rebuild cfe here if more srom entries are needed */ +static WLAN_SROM_PATCH_INFO wlanPaInfo[]={ +#if defined(_BCM96362_) || defined(CONFIG_BCM96362) + /* this is the patch to srom map for 96362ADVNX */ + {"96362ADVNX", 0x6362, 220, + {{"boardrev", 65, 0x1100}, + {"fem2g", 87, 0x0319}, + {"ittmaxp2ga0", 96, 0x2058}, + {"pa2gw0a0", 97, 0xfe6f}, + {"pa2gw1a0", 98, 0x1785}, + {"pa2gw2a0", 99, 0xfa21}, + {"ittmaxp2ga1", 112, 0x2058}, + {"pa2gw0a0", 113, 0xfe77}, + {"pa2gw1a0", 114, 0x17e0}, + {"pa2gw2a0", 115, 0xfa16}, + {"ofdm2gpo0", 161, 0x5555}, + {"ofdm2gpo1", 162, 0x5555}, + {"mcs2gpo0", 169, 0x5555}, + {"mcs2gpo1", 170, 0x5555}, + {"mcs2gpo2", 171, 0x5555}, + {"mcs2gpo3", 172, 0x5555}, + {"mcs2gpo4", 173, 0x3333}, + {"mcs2gpo5", 174, 0x3333}, + {"mcs2gpo6", 175, 0x3333}, + {"mcs2gpo7", 176, 0x3333}, + {"", 0, 0}}}, + /* this is the patch to srom map for 6362SDVNgr2 */ + {"96362ADVNgr2", 0x6362, 220, + {{"ittmaxp2ga0", 96, 0x2048}, + {"pa2gw0a0", 97, 0xfeff}, + {"pa2gw1a0", 98, 0x160e}, + {"pa2gw2a0", 99, 0xfabf}, + {"ittmaxp2ga1", 112, 0x2048}, + {"pa2gw0a0", 113, 0xff13}, + {"pa2gw1a0", 114, 0x161e}, + {"pa2gw2a0", 115, 0xfacc}, + {"mcs2gpo0", 169, 0x2222}, + {"mcs2gpo1", 170, 0x2222}, + {"mcs2gpo2", 171, 0x2222}, + {"mcs2gpo3", 172, 0x2222}, + {"mcs2gpo4", 173, 0x4444}, + {"mcs2gpo5", 174, 0x4444}, + {"mcs2gpo6", 175, 0x4444}, + {"mcs2gpo7", 176, 0x4444}, + {"", 0, 0}}}, +#endif +#if 0 //defined(_BCM96328_) || defined(CONFIG_BCM96328) + {"963281TAN", 0xa8d9, 220, + {{"pa2gw0a0", 97, 0xfed9}, + {"pa2gw1a0", 98, 0x15c7}, + {"pa2gw2a0", 99, 0xfaee}, + {"pa2gw0a0", 113, 0xfed7}, + {"pa2gw1a0", 114, 0x1540}, + {"pa2gw2a0", 115, 0xfafc}, + {"", 0, 0}}}, +#endif + {"", 0, 0, {{"", 0, 0}}}, /* last entry*/ +}; + +/************************************************************************** +* Name : BpUpdateWirelessSromMap +* +* Description: This function patch wireless PA values +* +* Parameters : [IN] unsigned short chipID +* [IN/OUT] unsigned short* pBase - base of srom map +* [IN/OUT] int size - size of srom map +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpUpdateWirelessSromMap(unsigned short chipID, unsigned short* pBase, int sizeInWords) +{ + int nRet = BP_BOARD_ID_NOT_FOUND; + int i = 0; + int j = 0; + + if(chipID == 0 || pBase == 0 || sizeInWords <= 0 ) + return nRet; + + i = 0; + while ( wlanPaInfo[i].szboardId[0] != 0 ) { + /* check boardId */ + if ( !bpstrcmp(g_pCurrentBp->szBoardId, wlanPaInfo[i].szboardId) ) { + /* check chipId */ + if ( (wlanPaInfo[i].usWirelessChipId == chipID) && (wlanPaInfo[i].usNeededSize <= sizeInWords) ){ + /* valid , patch entry */ + while ( wlanPaInfo[i].entries[j].name[0] ) { + pBase[wlanPaInfo[i].entries[j].wordOffset] = wlanPaInfo[i].entries[j].value; + j++; + } + nRet = BP_SUCCESS; + goto srom_update_done; + } + } + i++; + } + +srom_update_done: + + return( nRet ); + +} /* BpUpdateWirelessSromMap */ + + +static WLAN_PCI_PATCH_INFO wlanPciInfo[]={ +#if defined(_BCM96362_) || defined(CONFIG_BCM96362) + /* this is the patch to boardtype(boardid) for internal PA */ + {"96362ADVNX", 0x435f14e4, 64, + {{"subpciids", 11, 0x53614e4}, + {"", 0, 0}}}, +#endif + {"", 0, 0, {{"", 0, 0}}}, /* last entry*/ +}; + +/************************************************************************** +* Name : BpUpdateWirelessPciConfig +* +* Description: This function patch wireless PCI Config Header +* This is not functional critial/necessary but for dvt database maintenance +* +* Parameters : [IN] unsigned int pciID +* [IN/OUT] unsigned int* pBase - base of pci config header +* [IN/OUT] int sizeInDWords - size of pci config header +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpUpdateWirelessPciConfig (unsigned long pciID, unsigned long* pBase, int sizeInDWords) +{ + int nRet = BP_BOARD_ID_NOT_FOUND; + int i = 0; + int j = 0; + + if(pciID == 0 || pBase == 0 || sizeInDWords <= 0 ) + return nRet; + + i = 0; + while ( wlanPciInfo[i].szboardId[0] != 0 ) { + /* check boardId */ + if ( !bpstrcmp(g_pCurrentBp->szBoardId, wlanPciInfo[i].szboardId) ) { + /* check pciId */ + if ( (wlanPciInfo[i].usWirelessPciId == pciID) && (wlanPciInfo[i].usNeededSize <= sizeInDWords) ){ + /* valid , patch entry */ + while ( wlanPciInfo[i].entries[j].name[0] ) { + pBase[wlanPciInfo[i].entries[j].dwordOffset] = wlanPciInfo[i].entries[j].value; + j++; + } + nRet = BP_SUCCESS; + goto pciconfig_update_done; + } + } + i++; + } + +pciconfig_update_done: + + return( nRet ); + +} + +/************************************************************************** +* Name : BpGetHpnaLedGpio +* +* Description: This function returns the GPIO pin assignment for the HPNA +* LED. +* +* Parameters : [OUT] pusValue - Address of short word that the HPNA LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetHpnaLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedHpna; + + if( g_pCurrentBp->usGpioLedHpna != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetHpnaLedGpio */ + +/************************************************************************** +* Name : BpGetWanDataLedGpio +* +* Description: This function returns the GPIO pin assignment for the WAN Data +* LED. +* +* Parameters : [OUT] pusValue - Address of short word that the WAN Data LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWanDataLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedWanData; + + if( g_pCurrentBp->usGpioLedWanData != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetWanDataLedGpio */ + +/************************************************************************** +* Name : BpGetWanErrorLedGpio +* +* Description: This function returns the GPIO pin assignment for the WAN +* LED that is used when there is a WAN connection failure. +* +* Parameters : [OUT] pusValue - Address of short word that the WAN LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWanErrorLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedWanError; + + if( g_pCurrentBp->usGpioLedWanError != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetWanErrorLedGpio */ + +/************************************************************************** +* Name : BpGetBootloaderPowerOnLedGpio +* +* Description: This function returns the GPIO pin assignment for the power +* on LED that is set by the bootloader. +* +* Parameters : [OUT] pusValue - Address of short word that the alarm LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedBlPowerOn; + + if( g_pCurrentBp->usGpioLedBlPowerOn != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetBootloaderPowerOn */ + +/************************************************************************** +* Name : BpGetBootloaderStopLedGpio +* +* Description: This function returns the GPIO pin assignment for the break +* into bootloader LED that is set by the bootloader. +* +* Parameters : [OUT] pusValue - Address of short word that the break into +* bootloader LED GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetBootloaderStopLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedBlStop; + + if( g_pCurrentBp->usGpioLedBlStop != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetBootloaderStopLedGpio */ + +/************************************************************************** +* Name : BpGetVoipLedGpio +* +* Description: This function returns the GPIO pin assignment for the VOIP +* LED. +* +* Parameters : [OUT] pusValue - Address of short word that the VOIP LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +* +* Note : The VoIP structure would allow for having one LED per DSP +* however, the board initialization function assumes only one +* LED per functionality (ie one LED for VoIP). Therefore in +* order to keep this tidy and simple we do not make usage of the +* one-LED-per-DSP function. Instead, we assume that the LED for +* VoIP is unique and associated with DSP 0 (always present on +* any VoIP platform). If changing this to a LED-per-DSP function +* then one need to update the board initialization driver in +* bcmdrivers\opensource\char\board\bcm963xx\impl1 +***************************************************************************/ +int BpGetVoipLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( 0 ); + + if( pDspInfo ) + { + *pusValue = pDspInfo->usGpioLedVoip; + + if( *pusValue != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_FOUND; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetVoipLedGpio */ + +/************************************************************************** +* Name : BpGetVoip1LedGpio +* +* Description: This function returns the GPIO pin assignment for the VoIP1. +* LED which is used when FXS0 is active +* Parameters : [OUT] pusValue - Address of short word that the VoIP1 +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetVoip1LedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0]; + + if( pDspInfo->ucDspType != BP_VOIP_NO_DSP) + { + *pusValue = pDspInfo->usGpioVoip1Led; + + if( pDspInfo->usGpioVoip1Led != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetVoip1LedGpio */ + +/************************************************************************** +* Name : BpGetVoip1FailLedGpio +* +* Description: This function returns the GPIO pin assignment for the VoIP1 +* Fail LED which is used when there's an error with FXS0 +* Parameters : [OUT] pusValue - Address of short word that the VoIP1 +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetVoip1FailLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0]; + + if( pDspInfo->ucDspType != BP_VOIP_NO_DSP) + { + *pusValue = pDspInfo->usGpioVoip1LedFail; + + if( pDspInfo->usGpioVoip1LedFail != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetVoip1FailLedGpio */ + +/************************************************************************** +* Name : BpGetVoip2LedGpio +* +* Description: This function returns the GPIO pin assignment for the VoIP2. +* LED which is used when FXS1 is active +* Parameters : [OUT] pusValue - Address of short word that the VoIP2 +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetVoip2LedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0]; + + if( pDspInfo->ucDspType != BP_VOIP_NO_DSP) + { + *pusValue = pDspInfo->usGpioVoip2Led; + + if( pDspInfo->usGpioVoip2Led != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetVoip2LedGpio */ + +/************************************************************************** +* Name : BpGetVoip2FailLedGpio +* +* Description: This function returns the GPIO pin assignment for the VoIP2 +* Fail LED which is used when there's an error with FXS1 +* Parameters : [OUT] pusValue - Address of short word that the VoIP2 +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetVoip2FailLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0]; + + if( pDspInfo->ucDspType != BP_VOIP_NO_DSP) + { + *pusValue = pDspInfo->usGpioVoip2LedFail; + + if( pDspInfo->usGpioVoip2LedFail != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetVoip2FailLedGpio */ + +/************************************************************************** +* Name : BpGetPotsLedGpio +* +* Description: This function returns the GPIO pin assignment for the POTS1. +* LED which is used when DAA is active +* Parameters : [OUT] pusValue - Address of short word that the POTS11 +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetPotsLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0]; + + if( pDspInfo->ucDspType != BP_VOIP_NO_DSP) + { + *pusValue = pDspInfo->usGpioPotsLed; + + if( pDspInfo->usGpioPotsLed != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetPotsLedGpio */ + +/************************************************************************** +* Name : BpGetDectLedGpio +* +* Description: This function returns the GPIO pin assignment for the DECT. +* LED which is used when DECT is active +* Parameters : [OUT] pusValue - Address of short word that the DECT +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetDectLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0]; + + if( pDspInfo->ucDspType != BP_VOIP_NO_DSP) + { + *pusValue = pDspInfo->usGpioDectLed; + + if( pDspInfo->usGpioDectLed != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetDectLedGpio */ + +/************************************************************************** +* Name : BpGetFpgaResetGpio +* +* Description: This function returns the GPIO pin assignment for the FPGA +* Reset signal. +* +* Parameters : [OUT] pusValue - Address of short word that the FPGA Reset +* signal GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetFpgaResetGpio( unsigned short *pusValue ) { + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioFpgaReset; + + if( g_pCurrentBp->usGpioFpgaReset != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); + +} /*BpGetFpgaResetGpio*/ + +/************************************************************************** +* Name : BpGetGponLedGpio +* +* Description: This function returns the GPIO pin assignment for the GPON +* LED. +* +* Parameters : [OUT] pusValue - Address of short word that the GPON LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetGponLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedGpon; + + if( g_pCurrentBp->usGpioLedGpon != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetGponLedGpio */ + +/************************************************************************** +* Name : BpGetGponFailLedGpio +* +* Description: This function returns the GPIO pin assignment for the GPON +* LED that is used when there is a GPON connection failure. +* +* Parameters : [OUT] pusValue - Address of short word that the GPON LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetGponFailLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedGponFail; + + if( g_pCurrentBp->usGpioLedGponFail != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetGponFailLedGpio */ + + +/************************************************************************** +* Name : BpGetMoCALedGpio +* +* Description: This function returns the GPIO pin assignment for the MoCA +* LED. +* +* Parameters : [OUT] pusValue - Address of short word that the MoCA LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetMoCALedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedMoCA; + + if( g_pCurrentBp->usGpioLedMoCA != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetMoCALedGpio */ + +/************************************************************************** +* Name : BpGetMoCAFailLedGpio +* +* Description: This function returns the GPIO pin assignment for the MoCA +* LED that is used when there is a MoCA connection failure. +* +* Parameters : [OUT] pusValue - Address of short word that the MoCA LED +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetMoCAFailLedGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioLedMoCAFail; + + if( g_pCurrentBp->usGpioLedMoCAFail != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetMoCAFailLedGpio */ + +/************************************************************************** +* Name : BpGetHpnaExtIntr +* +* Description: This function returns the HPNA external interrupt number. +* +* Parameters : [OUT] pulValue - Address of short word that the HPNA +* external interrupt number is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetHpnaExtIntr( unsigned long *pulValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pulValue = g_pCurrentBp->usExtIntrHpna; + + if( g_pCurrentBp->usExtIntrHpna != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pulValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetHpnaExtIntr */ + +/************************************************************************** +* Name : BpGetHpnaChipSelect +* +* Description: This function returns the HPNA chip select number. +* +* Parameters : [OUT] pulValue - Address of short word that the HPNA +* chip select number is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetHpnaChipSelect( unsigned long *pulValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pulValue = g_pCurrentBp->usCsHpna; + + if( g_pCurrentBp->usCsHpna != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pulValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetHpnaChipSelect */ + +/************************************************************************** +* Name : BpGetResetToDefaultExtIntr +* +* Description: This function returns the external interrupt number for the +* reset to default button. +* +* Parameters : [OUT] pusValue - Address of short word that reset to default +* external interrupt is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetResetToDefaultExtIntr( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usExtIntrResetToDefault; + + if( g_pCurrentBp->usExtIntrResetToDefault != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); + +} /* BpGetResetToDefaultExtIntr */ + +/************************************************************************** +* Name : BpGetWirelessPowerDownGpio +* +* Description: This function returns the GPIO pin assignment for WLAN_PD +* +* +* Parameters : [OUT] pusValue - Address of short word that the WLAN_PD +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - At least one return value is not defined +* for the board. +***************************************************************************/ +int BpGetWirelessPowerDownGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioWirelessPowerDown; + + if( g_pCurrentBp->usGpioWirelessPowerDown != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* usGpioWirelessPowerDown */ + +/************************************************************************** +* Name : BpGetDslPhyAfeIds +* +* Description: This function returns the DSL PHY AFE ids for primary and +* secondary PHYs. +* +* Parameters : [OUT] pulValues-Address of an array of two long words where +* AFE Id for the primary and secondary PHYs are returned. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET-Error, BpSetBoardId hasn't been called. +* BP_VALUE_NOT_DEFINED - No defined AFE Ids. +**************************************************************************/ +int BpGetDslPhyAfeIds( unsigned long *pulValues ) +{ + int nRet; + + if( g_pCurrentBp ) + { + pulValues[0] = g_pCurrentBp->ulAfeIds[0]; + pulValues[1] = g_pCurrentBp->ulAfeIds[1]; + nRet = BP_SUCCESS; + } + else + { + pulValues[0] = BP_AFE_DEFAULT; + pulValues[1] = BP_AFE_DEFAULT; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetDslPhyAfeIds */ + +/************************************************************************** +* Name : BpGetExtAFEResetGpio +* +* Description: This function returns the GPIO pin assignment for resetting the external AFE chip +* +* +* Parameters : [OUT] pusValue - Address of short word that the ExtAFEReset +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - Not defined +***************************************************************************/ +int BpGetExtAFEResetGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioExtAFEReset; + + if( g_pCurrentBp->usGpioExtAFEReset != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetExtAFEResetGpio */ + +/************************************************************************** +* Name : BpGetExtAFELDModeGpio +* +* Description: This function returns the GPIO pin assignment for setting LD Mode to ADSL/VDSL +* +* +* Parameters : [OUT] pusValue - Address of short word that the usGpioExtAFELDMode +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - Not defined +***************************************************************************/ +int BpGetExtAFELDModeGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioExtAFELDMode; + + if( g_pCurrentBp->usGpioExtAFELDMode != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetExtAFELDModeGpio */ + +/************************************************************************** +* Name : BpGetExtAFELDPwrGpio +* +* Description: This function returns the GPIO pin assignment for turning on/off the external AFE LD +* +* +* Parameters : [OUT] pusValue - Address of short word that the usGpioExtAFELDPwr +* GPIO pin is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - Not defined +***************************************************************************/ +int BpGetExtAFELDPwrGpio( unsigned short *pusValue ) +{ + int nRet; + + if( g_pCurrentBp ) + { + *pusValue = g_pCurrentBp->usGpioExtAFELDPwr; + + if( g_pCurrentBp->usGpioExtAFELDPwr != BP_NOT_DEFINED ) + { + nRet = BP_SUCCESS; + } + else + { + nRet = BP_VALUE_NOT_DEFINED; + } + } + else + { + *pusValue = BP_NOT_DEFINED; + nRet = BP_BOARD_ID_NOT_SET; + } + + return( nRet ); +} /* BpGetExtAFELDPwrGpio */ + + +/************************************************************************** +* Name : BpGet6829PortInfo +* +* Description: This function checks the ENET MAC info to see if a 6829 +* is connected +* +* Parameters : [OUT] portInfo6829 - 0 if 6829 is not present +* - 6829 port information otherwise +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called. +* BP_VALUE_NOT_DEFINED - Not defined +***************************************************************************/ +int BpGet6829PortInfo( unsigned char *portInfo6829 ) +{ + ETHERNET_MAC_INFO enetMacInfo; + ETHERNET_SW_INFO *pSwInfo; + int retVal; + int i; + + *portInfo6829 = 0; + retVal = BpGetEthernetMacInfo( &enetMacInfo, 1 ); + if ( BP_SUCCESS == retVal ) + { + pSwInfo = &enetMacInfo.sw; + for (i = 0; i < BP_MAX_SWITCH_PORTS; i++) + { + if ( (pSwInfo->phy_id[i] != 0xFF) && + (pSwInfo->phy_id[i] & 0x80) ) + { + *portInfo6829 = pSwInfo->phy_id[i]; + retVal = BP_SUCCESS; + break; + } + } + } + + return retVal; + +} + diff --git a/shared/opensource/boardparms/bcm963xx/boardparms_voice.c b/shared/opensource/boardparms/bcm963xx/boardparms_voice.c new file mode 100755 index 0000000..72161cd --- /dev/null +++ b/shared/opensource/boardparms/bcm963xx/boardparms_voice.c @@ -0,0 +1,8804 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/************************************************************************** +* File Name : boardparms_voice.c +* +* Description: This file contains the implementation for the BCM63xx board +* parameter voice access functions. +* +***************************************************************************/ + +/* ---- Include Files ---------------------------------------------------- */ + +#include "boardparms_voice.h" + +/* ---- Public Variables ------------------------------------------------- */ + +/* ---- Private Constants and Types -------------------------------------- */ + +/* Always end the device list in VOICE_BOARD_PARMS with this macro */ +#define BP_NULL_DEVICE_MACRO \ +{ \ + BP_VD_NONE, \ + { 0, BP_NOT_DEFINED }, \ + 0, \ + BP_NOT_DEFINED, \ + { \ + { BP_VOICE_CHANNEL_INACTIVE, BP_VCTYPE_NONE, BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, BP_VOICE_CHANNEL_NARROWBAND, BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, BP_VOICE_CHANNEL_ENDIAN_BIG, BP_TIMESLOT_INVALID, BP_TIMESLOT_INVALID }, \ + { BP_VOICE_CHANNEL_INACTIVE, BP_VCTYPE_NONE, BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, BP_VOICE_CHANNEL_NARROWBAND, BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, BP_VOICE_CHANNEL_ENDIAN_BIG, BP_TIMESLOT_INVALID, BP_TIMESLOT_INVALID }, \ + } \ +} + +#define BP_NULL_CHANNEL_MACRO \ +{ BP_VOICE_CHANNEL_INACTIVE, \ + BP_VCTYPE_NONE, \ + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, \ + BP_VOICE_CHANNEL_NARROWBAND, \ + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, \ + BP_VOICE_CHANNEL_ENDIAN_BIG, \ + BP_TIMESLOT_INVALID, \ + BP_TIMESLOT_INVALID \ +}, + + +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276 = +{ + VOICECFG_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3226 = +{ + VOICECFG_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890 = +{ + VOICECFG_VE890_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_30_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3217X = +{ + VOICECFG_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_30_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88506 = +{ + VOICECFG_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI32267 = +{ + VOICECFG_6328AVNG_SI32267_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32267, + + /* SPI control */ + { + /* SPI dev id */ + 6, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( BP_FLAG_ISI_SUPPORT ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276_NTR = +{ + VOICECFG_6328AVNG_LE88276_NTR_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV_Partial = +{ + VOICECFG_6328AVNG_VE890HV_PARTIAL_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89336, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */ + + /* Reset pin */ + BP_GPIO_30_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV = +{ + VOICECFG_6328AVNG_VE890HV_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89136, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89336, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */ + + /* Reset pin */ + BP_GPIO_30_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_31_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI32176 = +{ + VOICECFG_6328AVNGR_SI32176_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNGR_LE89116 = +{ + VOICECFG_6328AVNGR_LE89116_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI3217X = +{ + VOICECFG_6328AVNGR_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, /* Reset line shared to one line only for AVNGR board */ + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +static PVOICE_BOARD_PARMS g_VoiceBoardParms[] = +{ + &voiceBoard_96328AVNG_LE88276, + &voiceBoard_96328AVNG_SI3226, + &voiceBoard_96328AVNG_VE890, + &voiceBoard_96328AVNG_SI3217X, + &voiceBoard_96328AVNG_LE88506, +#ifdef SI32267ENABLE + &voiceBoard_96328AVNG_SI32267, +#endif + &voiceBoard_96328AVNG_LE88276_NTR, + &voiceBoard_96328AVNG_VE890HV_Partial, + &voiceBoard_96328AVNG_VE890HV, + + &voiceBoard_96328AVNGR_SI32176, + &voiceBoard_96328AVNGR_LE89116, + &voiceBoard_96328AVNGR_SI3217X, + 0 +}; + + +#endif + +#if defined(_BCM96362_) || defined(CONFIG_BCM96362) + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_NOSLIC = +{ + VOICECFG_6362ADVNGP5_NOSLIC_STR, /* szBoardId */ + 0, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_VE890 = +{ + VOICECFG_6362ADVNGP5_VE890_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89116 = +{ + VOICECFG_6362ADVNGP5_LE89116_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89316 = +{ + VOICECFG_6362ADVNGP5_LE89316_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3217X = +{ + VOICECFG_6362ADVNGP5_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 32176 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32176 = +{ + VOICECFG_6362ADVNGP5_SI32176_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32178 = +{ + VOICECFG_6362ADVNGP5_SI32178_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88276 = +{ + VOICECFG_6362ADVNGP5_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3226 = +{ + VOICECFG_6362ADVNGP5_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88506 = +{ + VOICECFG_6362ADVNGP5_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_6_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_0_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_10_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X = +{ + VOICECFG_6362ADVNGR_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32176 = +{ + VOICECFG_6362ADVNGR_SI32176_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32178 = +{ + VOICECFG_6362ADVNGR_SI32178_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X_NOFXO = +{ + VOICECFG_6362ADVNGR_SI3217X_NOFXO_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 32176 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890 = +{ + VOICECFG_6362ADVNGR_VE890_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 5, + 5 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 6, + 6 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89116 = +{ + VOICECFG_6362ADVNGR_LE89116_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89316 = +{ + VOICECFG_6362ADVNGR_LE89316_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 5, + 5 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88506 = +{ + VOICECFG_6362ADVNGR_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88276 = +{ + VOICECFG_6362ADVNGR_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3226 = +{ + VOICECFG_6362ADVNGR_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32261 = +{ + VOICECFG_6362ADVNGR_SI32261_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32261, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32267 = +{ + VOICECFG_6362ADVNGR_SI32267_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32267, + + /* SPI control */ + { + /* SPI dev id */ + 3, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( BP_FLAG_ISI_SUPPORT ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HVP = +{ + VOICECFG_6362ADVNGR_VE890HV_PARTIAL_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89336, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */ + + /* Reset pin */ + BP_GPIO_28_AL, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */ + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 5, + 5 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 6, + 6 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HV = +{ + VOICECFG_6362ADVNGR_VE890HV_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89136, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89336, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 5, + 5 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 6, + 6 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3217X = +{ + VOICECFG_6362ADVNGR2_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_44_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_VE890 = +{ + VOICECFG_6362ADVNGR2_VE890_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice3 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_31_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 5, + 5 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 6, + 6 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_44_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88506 = +{ + VOICECFG_6362ADVNGR2_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_44_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88276 = +{ + VOICECFG_6362ADVNGR2_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_44_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3226 = +{ + VOICECFG_6362ADVNGR2_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 4, /* numDectLines */ + 1, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_29_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_28_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_44_AH, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +static PVOICE_BOARD_PARMS g_VoiceBoardParms[] = +{ + &voiceBoard_96362ADVNGP5_NOSLIC, +// &voiceBoard_96362ADVNGP5_VE890, +// &voiceBoard_96362ADVNGP5_LE89116, +// &voiceBoard_96362ADVNGP5_LE89316, +// &voiceBoard_96362ADVNGP5_SI3217X, +// &voiceBoard_96362ADVNGP5_SI32176, +// &voiceBoard_96362ADVNGP5_SI32178, +// &voiceBoard_96362ADVNGP5_LE88276, +// &voiceBoard_96362ADVNGP5_SI3226, +// &voiceBoard_96362ADVNGP5_LE88506, + &voiceBoard_96362ADVNgr_SI3217X, + &voiceBoard_96362ADVNgr_SI32176, + &voiceBoard_96362ADVNgr_SI32178, + &voiceBoard_96362ADVNgr_SI3217X_NOFXO, + &voiceBoard_96362ADVNgr_VE890, + &voiceBoard_96362ADVNgr_LE89116, + &voiceBoard_96362ADVNgr_LE89316, + &voiceBoard_96362ADVNgr_LE88506, + &voiceBoard_96362ADVNgr_LE88276, + &voiceBoard_96362ADVNgr_SI3226, +#ifdef SI32261ENABLE + &voiceBoard_96362ADVNgr_SI32261, +#endif +#ifdef SI32267ENABLE + &voiceBoard_96362ADVNgr_SI32267, +#endif + &voiceBoard_96362ADVNgr_VE890HVP, + &voiceBoard_96362ADVNgr_VE890HV, + &voiceBoard_96362ADVNGR2_SI3217X, + &voiceBoard_96362ADVNGR2_VE890, + &voiceBoard_96362ADVNGR2_LE88506, + &voiceBoard_96362ADVNGR2_LE88276, + &voiceBoard_96362ADVNGR2_SI3226, + 0 +}; + +#endif + +#if defined(_BCM96368_) || defined(CONFIG_BCM96368) + +VOICE_BOARD_PARMS voiceBoard_96368MVWG = +{ + VOICECFG_6368MVWG_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 2, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_10_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 4, + 4 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 3, + /* SPI GPIO */ + BP_GPIO_29_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, + + /* Reset pin */ + BP_GPIO_10_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 5, + 5 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 6, + 6 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_GPIO_3_AH, BP_GPIO_13_AH } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_VE890 = +{ + VOICECFG_6368MBG_VE890_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + +{ + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89116 = +{ + VOICECFG_6368MBG_LE89116_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89316 = +{ + VOICECFG_6368MBG_LE89316_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3217X = +{ + VOICECFG_6368MBG_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32176 = +{ + VOICECFG_6368MBG_SI32176_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32178 = +{ + VOICECFG_6368MBG_SI32178_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1}, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88276 = +{ + VOICECFG_6368MBG_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88506 = +{ + VOICECFG_6368MBG_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3226 = +{ + VOICECFG_6368MBG_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_3_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X = +{ + VOICECFG_6368MVNGR_SI3217X_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_17_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32176 = +{ + VOICECFG_6368MVNGR_SI32176_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32178 = +{ + VOICECFG_6368MVNGR_SI32178_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_17_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X_NOFXO = +{ + VOICECFG_6368MVNGR_SI3217X_NOFXO_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_32176, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_SILABS_32178, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_17_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890 = +{ + VOICECFG_6368MVNGR_VE890_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_17_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89116 = +{ + VOICECFG_6368MVNGR_LE89116_STR, /* szBoardId */ + 1, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89316 = +{ + VOICECFG_6368MVNGR_LE89316_STR, /* szBoardId */ + 1, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89316, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_17_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88506 = +{ + VOICECFG_6368MVNGR_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88276 = +{ + VOICECFG_6368MVNGR_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3226 = +{ + VOICECFG_6368MVNGR_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV_Partial = +{ + VOICECFG_6368MVNGR_VE890HV_PARTIAL_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89116, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89336, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */ + + /* Reset pin */ + BP_GPIO_16_AL, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */ + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV = +{ + VOICECFG_6368MVNGR_VE890HV_STR, /* szBoardId */ + 2, /* numFxsLines */ + 1, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_IDECT1, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID + }, + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_DECT, + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_WIDEBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice1 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89136, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_16_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* There is no second channel on 89116 so mark it as inactive */ + { BP_VOICE_CHANNEL_INACTIVE, + BP_VCTYPE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_TIMESLOT_INVALID, + BP_TIMESLOT_INVALID}, + } + }, + + /* voiceDevice2 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_89336, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_17_AL, + + /* Channel description */ + { + /* Channel 0 on device 0 */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_DAA, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 2, + 2 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + +static PVOICE_BOARD_PARMS g_VoiceBoardParms[] = +{ + &voiceBoard_96368MVWG, + &voiceBoard_96368MBG_LE88276, + &voiceBoard_96368MBG_LE88506, + &voiceBoard_96368MBG_VE890, + &voiceBoard_96368MBG_LE89116, + &voiceBoard_96368MBG_LE89316, + &voiceBoard_96368MBG_SI3217X, + &voiceBoard_96368MBG_SI32176, + &voiceBoard_96368MBG_SI32178, + &voiceBoard_96368MBG_SI3226, + &voiceBoard_96368MVNgr_SI3217X, + &voiceBoard_96368MVNgr_SI32176, + &voiceBoard_96368MVNgr_SI32178, + &voiceBoard_96368MVNgr_SI3217X_NOFXO, + &voiceBoard_96368MVNgr_VE890, +// &voiceBoard_96368MVNgr_LE89116, /* Temporarily remove */ +// &voiceBoard_96368MVNgr_LE89316, /* Temporarily remove */ + &voiceBoard_96368MVNgr_VE890HV_Partial, + &voiceBoard_96368MVNgr_VE890HV, + &voiceBoard_96368MVNgr_LE88506, + &voiceBoard_96368MVNgr_LE88276, + &voiceBoard_96368MVNgr_SI3226, + 0 +}; + +#endif + +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) + +VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE9530 = +{ + VOICECFG_LE9530_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_9530, + + /* SPI control */ + { + /* SPI dev id */ + 0, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 0, + + /* Reset pin */ + BP_NOT_DEFINED, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( BP_FLAG_DSP_APMHAL_ENABLE ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88276 = +{ + VOICECFG_LE88276_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88276, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96816PVWM_SI3226 = +{ + VOICECFG_SI3226_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_SILABS_3226, + + /* SPI control */ + { + /* SPI dev id */ + 2, + /* SPI GPIO */ + BP_GPIO_28_AL, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + +VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88506 = +{ + VOICECFG_LE88506_STR, /* szBoardId */ + 2, /* numFxsLines */ + 0, /* numFxoLines */ + 0, /* numDectLines */ + 0, /* numFailoverRelayPins */ + + { + /* voiceDevice0 parameters */ + { + /* Device type */ + BP_VD_ZARLINK_88506, + + /* SPI control */ + { + /* SPI dev id */ + 1, + /* SPI GPIO */ + BP_NOT_DEFINED, + }, + + /* Reset required (1 for yes, 0 for no) */ + 1, + + /* Reset pin */ + BP_GPIO_14_AL, + + /* Channel description */ + { + /* Channel 0 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 0, + 0 + }, + /* Channel 1 on device */ + { BP_VOICE_CHANNEL_ACTIVE, + BP_VCTYPE_SLIC, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_ENDIAN_BIG, + 1, + 1 + }, + } + }, + + /* Always end the device list with BP_NULL_DEVICE_MACRO */ + BP_NULL_DEVICE_MACRO, + }, + + /* Relay control pins */ + { { BP_NOT_DEFINED, BP_NOT_DEFINED } }, + + /* DECT UART control pins */ + { BP_NOT_DEFINED, BP_NOT_DEFINED }, + + /* General-purpose flags */ + ( 0 ) + +}; + + + +static PVOICE_BOARD_PARMS g_VoiceBoardParms[] = +{ &voiceBoard_96816PVWM_LE88276, + &voiceBoard_96816PVWM_SI3226, + &voiceBoard_96816PVWM_LE88506, + &voiceBoard_96816PVWM_LE9530, + 0 +}; + +#endif + + +static PVOICE_BOARD_PARMS g_pCurrentVoiceBp = 0; + +static void bpmemcpy( void* dstptr, const void* srcptr, int size ); +static void bpmemcpy( void* dstptr, const void* srcptr, int size ) +{ + char* dstp = dstptr; + const char* srcp = srcptr; + int i; + for( i=0; i < size; i++ ) + { + *dstp++ = *srcp++; + } +} + +int BpGetVoiceParms( char* pszBoardId, VOICE_BOARD_PARMS* voiceParms ) +{ + int nRet = BP_BOARD_ID_NOT_FOUND; + PVOICE_BOARD_PARMS *ppBp; + + for( ppBp = g_VoiceBoardParms; *ppBp; ppBp++ ) + { + if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) ) + { + g_pCurrentVoiceBp = *ppBp; + bpmemcpy( voiceParms, g_pCurrentVoiceBp, sizeof(VOICE_BOARD_PARMS) ); + nRet = BP_SUCCESS; + break; + } + } + + return( nRet ); +} + + +/************************************************************************** +* Name : BpSetVoiceBoardId +* +* Description: This function find the BOARD_PARAMETERS structure for the +* specified board id string and assigns it to a global, static +* variable. +* +* Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM. +* +* Returns : BP_SUCCESS - Success, value is returned. +* BP_BOARD_ID_NOT_FOUND - Error, board id input string does not +* have a board parameters configuration record. +***************************************************************************/ +int BpSetVoiceBoardId( char *pszBoardId ) +{ + int nRet = BP_BOARD_ID_NOT_FOUND; + PVOICE_BOARD_PARMS *ppBp; + + for( ppBp = g_VoiceBoardParms; *ppBp; ppBp++ ) + { + if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) ) + { + g_pCurrentVoiceBp = *ppBp; + nRet = BP_SUCCESS; + break; + } + } + + return( nRet ); +} /* BpSetVoiceBoardId */ + + +/************************************************************************** +* Name : BpGetVoiceBoardId +* +* Description: This function returns the current board id strings. +* +* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id +* string is returned in. +* +* Returns : BP_SUCCESS - Success, value is returned. +***************************************************************************/ + +int BpGetVoiceBoardId( char *pszBoardId ) +{ + int i; + + if (g_pCurrentVoiceBp == 0) + return -1; + + for (i = 0; i < BP_BOARD_ID_LEN; i++) + pszBoardId[i] = g_pCurrentVoiceBp->szBoardId[i]; + + return 0; +} + + +/************************************************************************** +* Name : BpGetVoiceBoardIds +* +* Description: This function returns all of the supported voice board id strings. +* +* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id +* strings are returned in. Each id starts at BP_BOARD_ID_LEN +* boundary. +* [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that +* were allocated in pszBoardIds. +* +* Returns : Number of board id strings returned. +***************************************************************************/ +int BpGetVoiceBoardIds( char *pszBoardIds, int nBoardIdsSize ) +{ + PVOICE_BOARD_PARMS *ppBp; + int i; + char *src; + char *dest; + + for( i = 0, ppBp = g_VoiceBoardParms; *ppBp && nBoardIdsSize; + i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN ) + { + dest = pszBoardIds; + src = (*ppBp)->szBoardId; + while( *src ) + *dest++ = *src++; + *dest = '\0'; + } + + return( i ); +} /* BpGetVoiceBoardIds */ diff --git a/shared/opensource/flash/Makefile b/shared/opensource/flash/Makefile new file mode 100755 index 0000000..b7a9812 --- /dev/null +++ b/shared/opensource/flash/Makefile @@ -0,0 +1,41 @@ + +ifeq ($(CONFIG_MIPS_BRCM),y) + +# Linux + +obj-y += flash_api.o flash_common.o + +ifeq ($(strip $(BRCM_CHIP)),6368) +INC_CFI_FLASH_DRIVER=1 +INC_SPI_FLASH_DRIVER=1 +endif +ifeq ($(strip $(BRCM_CHIP)),6816) +INC_CFI_FLASH_DRIVER=1 +INC_SPI_FLASH_DRIVER=1 +endif +ifeq ($(strip $(BRCM_CHIP)),6362) +INC_CFI_FLASH_DRIVER=0 +INC_SPI_FLASH_DRIVER=1 +endif +ifeq ($(strip $(BRCM_CHIP)),6328) +INC_CFI_FLASH_DRIVER=0 +INC_SPI_FLASH_DRIVER=1 +endif + +ifeq ($(strip $(INC_CFI_FLASH_DRIVER)),1) +obj-y += cfiflash.o +endif +ifeq ($(strip $(INC_SPI_FLASH_DRIVER)),1) +obj-y += spiflash.o +endif + +EXTRA_CFLAGS += -DCONFIG_BCM9$(BRCM_CHIP) -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) -I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) -DINC_CFI_FLASH_DRIVER=$(INC_CFI_FLASH_DRIVER) -DINC_SPI_FLASH_DRIVER=$(INC_SPI_FLASH_DRIVER) + +endif + + + + + + + diff --git a/shared/opensource/flash/cfiflash.c b/shared/opensource/flash/cfiflash.c new file mode 100755 index 0000000..efd08de --- /dev/null +++ b/shared/opensource/flash/cfiflash.c @@ -0,0 +1,1112 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/** Includes. */ +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "cfe_timer.h" +#include "bcm_map.h" +#define CFI_USLEEP(x) cfe_usleep(x) +#define printk printf +#else // linux +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) +#include +#else +#include +#endif +#include +#include +#define CFI_USLEEP(x) udelay(x) +#endif + +#include "bcmtypes.h" +#include "bcm_hwdefs.h" +#include "flash_api.h" + +/** Defines. **/ +#ifndef NULL +#define NULL 0 +#endif + +#ifndef _CFE_ +static DECLARE_MUTEX(cfi_flash_lock); +#define CF_FLASH_SCHED_BYTES 512 +static int cfi_flash_sched = 0; /* voluntary schedule() disabled by default */ +#endif + +#define MAXSECTORS 1024 /* maximum number of sectors supported */ + +/* Standard Boolean declarations */ +#define TRUE 1 +#define FALSE 0 + +/* Define different type of flash */ +#define FLASH_UNDEFINED 0 +#define FLASH_AMD 1 +#define FLASH_INTEL 2 +#define FLASH_SST 3 + +/* Command codes for the flash_command routine */ +#define FLASH_RESET 0 /* reset to read mode */ +#define FLASH_READ_ID 1 /* read device ID */ +#define FLASH_CFIQUERY 2 /* CFI query */ +#define FLASH_UB 3 /* go into unlock bypass mode */ +#define FLASH_PROG 4 /* program a unsigned short */ +#define FLASH_UBRESET 5 /* reset to read mode from unlock bypass mode */ +#define FLASH_SERASE 6 /* sector erase */ +#define FLASH_WRITE_BUF 7 /* write to buffer */ + +/* Return codes from flash_status */ +#define STATUS_READY 0 /* ready for action */ +#define STATUS_TIMEOUT 1 /* operation timed out */ + +/* A list of AMD compatible device ID's - add others as needed */ +#define ID_AM29DL800T 0x224A +#define ID_AM29DL800B 0x22CB +#define ID_AM29LV800T 0x22DA +#define ID_AM29LV800B 0x225B +#define ID_AM29LV400B 0x22BA +#define ID_AM29LV200BT 0x223B + +#define ID_AM29LV160B 0x2249 +#define ID_AM29LV160T 0x22C4 + +#define ID_AM29LV320T 0x22F6 +#define ID_MX29LV320AT 0x22A7 +#define ID_AM29LV320B 0x22F9 +#define ID_MX29LV320AB 0x22A8 +#define ID_MX29LV640BT 0x22C9 + +#define ID_AM29LV320M 0x227E +#define ID_AM29LV320MB 0x2200 +#define ID_AM29LV320MT 0x2201 + +#define ID_SST39VF200A 0x2789 +#define ID_SST39VF400A 0x2780 +#define ID_SST39VF800A 0x2781 +#define ID_SST39VF1601 0x234B +#define ID_SST39VF3201 0x235B +#define ID_SST39VF6401 0x236B + +/* A list of Intel compatible device ID's - add others as needed */ +#define ID_I28F160C3T 0x88C2 +#define ID_I28F160C3B 0x88C3 +#define ID_I28F320C3T 0x88C4 +#define ID_I28F320C3B 0x88C5 +#define ID_I28F640J3 0x8916 + +#define ID_M29W640FB 0x22FD + +#define CFI_FLASH_DEVICES \ + {{ID_AM29DL800T, "AM29DL800T"}, \ + {ID_AM29DL800B, "AM29DL800B"}, \ + {ID_AM29LV800T, "AM29LV800T"}, \ + {ID_AM29LV800B, "AM29LV800B"}, \ + {ID_AM29LV400B, "AM29LV400B"}, \ + {ID_AM29LV200BT, "AM29LV200BT"}, \ + {ID_AM29LV160B, "AM29LV160B"}, \ + {ID_AM29LV160T, "AM29LV160T"}, \ + {ID_AM29LV320T, "AM29LV320T"}, \ + {ID_MX29LV320AT, "MX29LV320AT"}, \ + {ID_AM29LV320B, "AM29LV320B"}, \ + {ID_MX29LV320AB, "MX29LV320AB"}, \ + {ID_AM29LV320M, "AM29LV320M"}, \ + {ID_AM29LV320MB, "AM29LV320MB"}, \ + {ID_AM29LV320MT, "AM29LV320MT"}, \ + {ID_MX29LV640BT, "MX29LV640BT"}, \ + {ID_SST39VF200A, "SST39VF200A"}, \ + {ID_SST39VF400A, "SST39VF400A"}, \ + {ID_SST39VF800A, "SST39VF800A"}, \ + {ID_SST39VF1601, "SST39VF1601"}, \ + {ID_SST39VF3201, "SST39VF3201"}, \ + {ID_SST39VF6401, "SST39VF6401"}, \ + {ID_I28F160C3T, "I28F160C3T"}, \ + {ID_I28F160C3B, "I28F160C3B"}, \ + {ID_I28F320C3T, "I28F320C3T"}, \ + {ID_I28F320C3B, "I28F320C3B"}, \ + {ID_I28F640J3, "I28F640J3"}, \ + {ID_M29W640FB, "STM29W640FB"}, \ + {0, ""} \ + } + +/** Structs. **/ +/* A structure for identifying a flash part. There is one for each + * of the flash part definitions. We need to keep track of the + * sector organization, the address register used, and the size + * of the sectors. + */ +struct flashinfo { + char *name; /* "Am29DL800T", etc. */ + unsigned long addr; /* physical address, once translated */ + int areg; /* Can be set to zero for all parts */ + int nsect; /* # of sectors -- 19 in LV, 22 in DL */ + int bank1start; /* first sector # in bank 1 */ + int bank2start; /* first sector # in bank 2, if DL part */ + struct { + long size; /* # of bytes in this sector */ + long base; /* offset from beginning of device */ + int bank; /* 1 or 2 for DL; 1 for LV */ + } sec[MAXSECTORS]; /* per-sector info */ + int write_buffer_size; /* max size of multi byte write */ +}; + +/* + * This structure holds all CFI query information as defined + * in the JEDEC standard. All information up to + * primary_extended_query is standard among all manufactures + * with CFI enabled devices. + */ + +struct cfi_query { + int num_erase_blocks; /* Number of sector defs. */ + long device_size; /* Device size in bytes */ + struct { + unsigned long sector_size; /* byte size of sector */ + int num_sectors; /* Num sectors of this size */ + } erase_block[8]; /* Max of 256, but 8 is good */ + int write_buffer_size; /* max size of multi byte write */ +}; + +struct flash_name_from_id { + unsigned short fnfi_id; + char fnfi_name[30]; +}; + + +/** Prototypes. **/ +int cfi_flash_init(flash_device_info_t **flash_info); +static int cfi_flash_sector_erase_int(unsigned short sector); +static int cfi_flash_read_buf(unsigned short sector, int offset, + unsigned char *buffer, int numbytes); +static int cfi_flash_write_buf(unsigned short sector, int offset, + unsigned char *buffer, int numbytes); +static int cfi_flash_get_numsectors(void); +static int cfi_flash_get_sector_size(unsigned short sector); +static unsigned char *cfi_flash_get_memptr(unsigned short sector); +static int cfi_flash_get_blk(int addr); +static int cfi_flash_get_total_size(void); +static void cfi_flash_command(int command, unsigned short sector, int offset, + unsigned short data, unsigned short *); +static int cfi_flash_write(unsigned short sector, int offset, unsigned char *buf, + int nbytes); +static int cfi_flash_write_to_buffer(unsigned short sector, unsigned char *buf); +static int cfi_flash_wait(unsigned short sector, int offset,unsigned short data); +static unsigned short cfi_flash_get_device_id(void); +static int cfi_flash_get_cfi(struct cfi_query *query, unsigned short *cfi_struct, + int flashFamily); +static int cfi_memcmp_sched(unsigned char *s1, unsigned char *s2, int nbytes); + +/** Variables. **/ +static flash_device_info_t flash_cfi_dev = + { + 0xffff, + FLASH_IFC_PARALLEL, + "", + cfi_flash_sector_erase_int, + cfi_flash_read_buf, + cfi_flash_write_buf, + cfi_flash_get_numsectors, + cfi_flash_get_sector_size, + cfi_flash_get_memptr, + cfi_flash_get_blk, + cfi_flash_get_total_size + }; + +/*********************************************************************/ +/* 'meminfo' should be a pointer, but most C compilers will not */ +/* allocate static storage for a pointer without calling */ +/* non-portable functions such as 'new'. We also want to avoid */ +/* the overhead of passing this pointer for every driver call. */ +/* Systems with limited heap space will need to do this. */ +/*********************************************************************/ +static struct flashinfo meminfo; /* Flash information structure */ +static int flashFamily = FLASH_UNDEFINED; +static int totalSize = 0; +static struct cfi_query query; + +static unsigned short cfi_data_struct_29W160[] = { + 0x0020, 0x0049, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0x0051, 0x0052, 0x0059, 0x0002, 0x0000, 0x0040, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0027, 0x0036, 0x0000, 0x0000, 0x0004, + 0x0000, 0x000a, 0x0000, 0x0004, 0x0000, 0x0003, 0x0000, 0x0015, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0040, + 0x0000, 0x0001, 0x0000, 0x0020, 0x0000, 0x0000, 0x0000, 0x0080, + 0x0000, 0x001e, 0x0000, 0x0000, 0x0001, 0xffff, 0xffff, 0xffff, + 0x0050, 0x0052, 0x0049, 0x0031, 0x0030, 0x0000, 0x0002, 0x0001, + 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0x0002, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0x0888, 0x252b, 0x8c84, 0x7dbc, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff +}; + +static UINT16 cfi_data_struct_29W200[] = { + 0x0020, 0x0049, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0x0051, 0x0052, 0x0059, 0x0002, 0x0000, 0x0040, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0027, 0x0036, 0x0000, 0x0000, 0x0004, + 0x0000, 0x000a, 0x0000, 0x0004, 0x0000, 0x0003, 0x0000, 0x0015, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0040, + 0x0000, 0x0001, 0x0000, 0x0020, 0x0000, 0x0000, 0x0000, 0x0080, + 0x0000, 0x0002, 0x0000, 0x0000, 0x0001, 0xffff, 0xffff, 0xffff, + 0x0050, 0x0052, 0x0049, 0x0031, 0x0030, 0x0000, 0x0002, 0x0001, + 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0x0002, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0x0888, 0x252b, 0x8c84, 0x7dbc, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff +}; + +static UINT16 cfi_data_struct_26LV800B[] = { + 0x0020, 0x0049, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0x0051, 0x0052, 0x0059, 0x0002, 0x0000, 0x0040, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0027, 0x0036, 0x0000, 0x0000, 0x0004, + 0x0000, 0x000a, 0x0000, 0x0004, 0x0000, 0x0003, 0x0000, 0x0015, + 0x0002, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0040, + 0x0000, 0x0001, 0x0000, 0x0020, 0x0000, 0x0000, 0x0000, 0x0080, + 0x0000, 0x000e, 0x0000, 0x0000, 0x0001, 0xffff, 0xffff, 0xffff, + 0x0050, 0x0052, 0x0049, 0x0031, 0x0030, 0x0000, 0x0002, 0x0001, + 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0x0002, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0x0888, 0x252b, 0x8c84, 0x7dbc, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff +}; + +static struct flash_name_from_id fnfi[] = CFI_FLASH_DEVICES; + +/*********************************************************************/ +/* Init_flash is used to build a sector table from the information */ +/* provided through the CFI query. This information is translated */ +/* from erase_block information to base:offset information for each */ +/* individual sector. This information is then stored in the meminfo */ +/* structure, and used throughout the driver to access sector */ +/* information. */ +/* */ +/* This is more efficient than deriving the sector base:offset */ +/* information every time the memory map switches (since on the */ +/* development platform can only map 64k at a time). If the entire */ +/* flash memory array can be mapped in, then the addition static */ +/* allocation for the meminfo structure can be eliminated, but the */ +/* drivers will have to be re-written. */ +/* */ +/* The meminfo struct occupies 653 bytes of heap space, depending */ +/* on the value of the define MAXSECTORS. Adjust to suit */ +/* application */ +/*********************************************************************/ +int cfi_flash_init(flash_device_info_t **flash_info) +{ + struct flash_name_from_id *fnfi_ptr; + int i=0, j=0, count=0; + int basecount=0L; + unsigned short device_id; + int flipCFIGeometry = FALSE; + + *flash_info = &flash_cfi_dev; + + /* First, assume + * a single 8k sector for sector 0. This is to allow + * the system to perform memory mapping to the device, + * even though the actual physical layout is unknown. + * Once mapped in, the CFI query will produce all + * relevant information. + */ + meminfo.addr = 0L; + meminfo.areg = 0; + meminfo.nsect = 1; + meminfo.bank1start = 0; + meminfo.bank2start = 0; + + meminfo.sec[0].size = 8192; + meminfo.sec[0].base = 0x00000; + meminfo.sec[0].bank = 1; + + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + + flash_cfi_dev.flash_device_id = device_id = cfi_flash_get_device_id(); + flash_cfi_dev.flash_device_name[0] = '\0'; + switch (device_id) { + case ID_I28F160C3B: + case ID_I28F320C3B: + case ID_I28F160C3T: + case ID_I28F320C3T: + case ID_I28F640J3: + flashFamily = FLASH_INTEL; + break; + case ID_AM29DL800B: + case ID_AM29LV800B: + case ID_AM29LV400B: + case ID_AM29LV160B: + case ID_AM29LV320B: + case ID_MX29LV320AB: + case ID_AM29LV320MB: + case ID_AM29DL800T: + case ID_AM29LV800T: + case ID_AM29LV160T: + case ID_AM29LV320T: + case ID_MX29LV320AT: + case ID_AM29LV320MT: + case ID_AM29LV200BT: + case ID_MX29LV640BT: + case ID_M29W640FB: + flashFamily = FLASH_AMD; + break; + case ID_SST39VF200A: + case ID_SST39VF400A: + case ID_SST39VF800A: + case ID_SST39VF1601: + case ID_SST39VF3201: + case ID_SST39VF6401: + flashFamily = FLASH_SST; + break; + default: + return FLASH_API_ERROR; + } + + if (cfi_flash_get_cfi(&query, 0, flashFamily) == -1) { + switch(device_id) { + case ID_AM29LV160T: + case ID_AM29LV160B: + cfi_flash_get_cfi(&query, cfi_data_struct_29W160, flashFamily); + break; + case ID_AM29LV200BT: + cfi_flash_get_cfi(&query, cfi_data_struct_29W200, flashFamily); + break; + case ID_AM29LV800B: + cfi_flash_get_cfi(&query, cfi_data_struct_26LV800B, flashFamily); + strcpy( flash_cfi_dev.flash_device_name, "MX26LV800B" ); + break; + default: + return FLASH_API_ERROR; + } + } + + // need to determine if it top or bottom boot here + switch (device_id) + { + case ID_AM29DL800B: + case ID_AM29LV800B: + case ID_AM29LV400B: + case ID_AM29LV160B: + case ID_AM29LV320B: + case ID_MX29LV320AB: + case ID_AM29LV320MB: + case ID_I28F160C3B: + case ID_I28F320C3B: + case ID_I28F640J3: + case ID_I28F160C3T: + case ID_I28F320C3T: + case ID_SST39VF3201: + case ID_SST39VF6401: + case ID_SST39VF200A: + case ID_SST39VF400A: + case ID_SST39VF800A: + case ID_M29W640FB: + flipCFIGeometry = FALSE; + break; + case ID_AM29DL800T: + case ID_AM29LV800T: + case ID_AM29LV160T: + case ID_AM29LV320T: + case ID_MX29LV320AT: + case ID_AM29LV320MT: + case ID_AM29LV200BT: + case ID_SST39VF1601: + case ID_MX29LV640BT: + flipCFIGeometry = TRUE; + break; + default: + return FLASH_API_ERROR; + } + + count=0;basecount=0L; + + if (!flipCFIGeometry) + { + + for (i=0; i= 0 && basecount < query.device_size; i--) { + for(j=0; jfnfi_id != 0; fnfi_ptr++ ) { + if( fnfi_ptr->fnfi_id == device_id ) { + strcpy( flash_cfi_dev.flash_device_name, fnfi_ptr->fnfi_name ); + break; + } + } + } + + meminfo.write_buffer_size = query.write_buffer_size; + + return (FLASH_API_OK); +} + +/*********************************************************************/ +/* Flash_sector_erase_int() is identical to flash_sector_erase(), */ +/* except it will wait until the erase is completed before returning */ +/* control to the calling function. This can be used in cases which */ +/* require the program to hold until a sector is erased, without */ +/* adding the wait check external to this function. */ +/*********************************************************************/ +static int cfi_flash_sector_erase_int(unsigned short sector) +{ + int i; + +#ifndef _CFE_ + down(&cfi_flash_lock); +#endif + + for( i = 0; i < 3; i++ ) { + cfi_flash_command(FLASH_SERASE, sector, 0, 0, NULL); + if (cfi_flash_wait(sector, 0, 0xffff) == STATUS_READY) + break; + } + +#ifndef _CFE_ + up(&cfi_flash_lock); +#endif + + return(FLASH_API_OK); +} + +/*********************************************************************/ +/* flash_read_buf() reads buffer of data from the specified */ +/* offset from the sector parameter. */ +/*********************************************************************/ +static int cfi_flash_read_buf(unsigned short sector, int offset, + unsigned char *buffer, int numbytes) +{ + unsigned char *fwp; +#ifndef _CFE_ + unsigned int bytes_read = CF_FLASH_SCHED_BYTES; + + down(&cfi_flash_lock); +#endif + + fwp = (unsigned char *) cfi_flash_get_memptr(sector); + + while (numbytes) { + *buffer++ = *(fwp + offset); + numbytes--; + fwp++; +#ifndef _CFE_ + if (!in_interrupt()) { + /* Voluntary schedule() if task tagged as need_sched or 512 bytes read */ + /* Must force need_resched or else schedule() is in-effective */ + if ( cfi_flash_sched ) { + if ( (need_resched()) || (bytes_read >= CF_FLASH_SCHED_BYTES) ) { + bytes_read=0; + set_tsk_need_resched(current); /* fake need_resched() to force schedule() */ + schedule(); + } + else + bytes_read++; + } + } +#endif + } + +#ifndef _CFE_ + up(&cfi_flash_lock); +#endif + + return (FLASH_API_OK); +} + +/*********************************************************************/ +/* cfi_memcmp_sched: invokes memcmp with schedule() invocations */ +/*********************************************************************/ +static int cfi_memcmp_sched(unsigned char *s1, unsigned char *s2, int nb) +{ +#ifndef _CFE_ + const unsigned int sched_chunk = 4 * 1024; + size_t nbytes; + int ret = 0; + + while ( nb > 0 ) + { + if (!in_interrupt()) { + set_tsk_need_resched(current); + schedule(); + } + + nbytes = (nb > sched_chunk) ? sched_chunk : nb; + + if ( (ret = memcmp( s1, s2, nbytes )) != 0 ) + break; + + s1 += sched_chunk; + s2 += sched_chunk; + nb -= sched_chunk; + } + + return ret; +#else + return memcmp( s1, s2, nb ); +#endif +} + +/*********************************************************************/ +/* flash_write_buf() utilizes */ +/* the unlock bypass mode of the flash device. This can remove */ +/* significant overhead from the bulk programming operation, and */ +/* when programming bulk data a sizeable performance increase can be */ +/* observed. */ +/*********************************************************************/ +static int cfi_flash_write_buf(unsigned short sector, int offset, + unsigned char *buffer, int numbytes) +{ + int ret = FLASH_API_ERROR; + int i; + unsigned char *p = cfi_flash_get_memptr(sector) + offset; + int write_buf_method = 0; + + if( meminfo.write_buffer_size != 0 && offset == 0 && + (ID_M29W640FB != cfi_flash_get_device_id()) && + numbytes == cfi_flash_get_sector_size(sector) ) + { + write_buf_method = 1; + } + + /* After writing the flash block, compare the contents to the source + * buffer. Try to write the sector successfully up to three times. + */ + for( i = 0; i < 3; i++ ) { + if( write_buf_method ) + ret = cfi_flash_write_to_buffer(sector, buffer); + else + ret = cfi_flash_write(sector, offset, buffer, numbytes); + if( !cfi_memcmp_sched( p, buffer, numbytes ) ) + break; + /* Erase and try again */ + cfi_flash_sector_erase_int(sector); + ret = FLASH_API_ERROR; + } + + if( ret == FLASH_API_ERROR ) + printk( "Flash write error. Verify failed\n" ); + + return( ret ); +} + +/*********************************************************************/ +/* Usefull funtion to return the number of sectors in the device. */ +/* Can be used for functions which need to loop among all the */ +/* sectors, or wish to know the number of the last sector. */ +/*********************************************************************/ +static int cfi_flash_get_numsectors(void) +{ + return meminfo.nsect; +} + +/*********************************************************************/ +/* flash_get_sector_size() is provided for cases in which the size */ +/* of a sector is required by a host application. The sector size */ +/* (in bytes) is returned in the data location pointed to by the */ +/* 'size' parameter. */ +/*********************************************************************/ +static int cfi_flash_get_sector_size(unsigned short sector) +{ + return meminfo.sec[sector].size; +} + +/*********************************************************************/ +/* The purpose of flash_get_memptr() is to return a memory pointer */ +/* which points to the beginning of memory space allocated for the */ +/* flash. All function pointers are then referenced from this */ +/* pointer. */ +/* */ +/* Different systems will implement this in different ways: */ +/* possibilities include: */ +/* - A direct memory pointer */ +/* - A pointer to a memory map */ +/* - A pointer to a hardware port from which the linear */ +/* address is translated */ +/* - Output of an MMU function / service */ +/* */ +/* Also note that this function expects the pointer to a specific */ +/* sector of the device. This can be provided by dereferencing */ +/* the pointer from a translated offset of the sector from a */ +/* global base pointer (e.g. flashptr = base_pointer + sector_offset)*/ +/* */ +/* Important: Many AMD flash devices need both bank and or sector */ +/* address bits to be correctly set (bank address bits are A18-A16, */ +/* and sector address bits are A18-A12, or A12-A15). Flash parts */ +/* which do not need these bits will ignore them, so it is safe to */ +/* assume that every part will require these bits to be set. */ +/*********************************************************************/ +static unsigned char *cfi_flash_get_memptr(unsigned short sector) +{ + unsigned char *memptr = (unsigned char*) + (FLASH_BASE + meminfo.sec[sector].base); + + return (memptr); +} + +/*********************************************************************/ +/* The purpose of flash_get_blk() is to return a the block number */ +/* for a given memory address. */ +/*********************************************************************/ +static int cfi_flash_get_blk(int addr) +{ + int blk_start, i; + int last_blk = cfi_flash_get_numsectors(); + int relative_addr = addr - (int) FLASH_BASE; + + for(blk_start=0, i=0; i < relative_addr && blk_start < last_blk; blk_start++) + i += cfi_flash_get_sector_size(blk_start); + + if( i > relative_addr ) + { + blk_start--; // last blk, dec by 1 + } + else + if( blk_start == last_blk ) + { + printk("Address is too big.\n"); + blk_start = -1; + } + + return( blk_start ); +} + +/************************************************************************/ +/* The purpose of flash_get_total_size() is to return the total size of */ +/* the flash */ +/************************************************************************/ +static int cfi_flash_get_total_size(void) +{ + return totalSize; +} + +/*********************************************************************/ +/* Flash_command() is the main driver function. It performs */ +/* every possible command available to AMD B revision */ +/* flash parts. Note that this command is not used directly, but */ +/* rather called through the API wrapper functions provided below. */ +/*********************************************************************/ +static void cfi_flash_command(int command, unsigned short sector, int offset, + unsigned short data, unsigned short *dataptr) +{ + volatile unsigned short *flashptr; + volatile unsigned short *flashbase; + unsigned short i, len; + + flashptr = (unsigned short *) cfi_flash_get_memptr(sector); + flashbase = (unsigned short *) cfi_flash_get_memptr(0); + + switch (flashFamily) { + case FLASH_UNDEFINED: + /* These commands should work for AMD, Intel and SST flashes */ + switch (command) { + case FLASH_RESET: + flashptr[0] = 0xF0; + flashptr[0] = 0xFF; + break; + case FLASH_READ_ID: + flashptr[0x5555] = 0xAA; /* unlock 1 */ + flashptr[0x2AAA] = 0x55; /* unlock 2 */ + flashptr[0x5555] = 0x90; + break; + case FLASH_CFIQUERY: + flashbase[0x5555] = 0xAA; /* unlock 1 */ + flashbase[0x2AAA] = 0x55; /* unlock 2 */ + flashbase[0x5555] = 0x90; + break; + default: + break; + } + break; + case FLASH_AMD: + switch (command) { + case FLASH_RESET: + flashptr[0] = 0xF0; + break; + case FLASH_READ_ID: + flashptr[0x555] = 0xAA; /* unlock 1 */ + flashptr[0x2AA] = 0x55; /* unlock 2 */ + flashptr[0x555] = 0x90; + break; + case FLASH_CFIQUERY: + flashptr[0x55] = 0x98; + break; + case FLASH_UB: + flashptr[0x555] = 0xAA; /* unlock 1 */ + flashptr[0x2AA] = 0x55; /* unlock 2 */ + flashptr[0x555] = 0x20; + break; + case FLASH_PROG: + flashptr[0] = 0xA0; + flashptr[offset/2] = data; + break; + case FLASH_UBRESET: + flashptr[0] = 0x90; + flashptr[0] = 0x00; + break; + case FLASH_SERASE: + flashptr[0x555] = 0xAA; /* unlock 1 */ + flashptr[0x2AA] = 0x55; /* unlock 2 */ + flashptr[0x555] = 0x80; + flashptr[0x555] = 0xAA; + flashptr[0x2AA] = 0x55; + flashptr[0] = 0x30; + break; + case FLASH_WRITE_BUF: + flashptr[0x555] = 0xAA; /* unlock 1 */ + flashptr[0x2AA] = 0x55; /* unlock 2 */ + flashptr[0] = 0x25; + offset /= 2; + len = data / 2; /* data is bytes to program */ + flashptr[0] = len - 1; + for( i = 0; i < len; i++ ) + flashptr[offset + i] = *dataptr++; + flashptr[0] = 0x29; + break; + default: + break; + } + break; + case FLASH_INTEL: + switch (command) { + case FLASH_RESET: + flashptr[0] = 0xFF; + break; + case FLASH_READ_ID: + flashptr[0] = 0x90; + break; + case FLASH_CFIQUERY: + flashptr[0] = 0x98; + break; + case FLASH_PROG: + flashptr[0] = 0x40; + flashptr[offset/2] = data; + break; + case FLASH_SERASE: + flashptr[0] = 0x60; + flashptr[0] = 0xD0; + flashptr[0] = 0x20; + flashptr[0] = 0xD0; + break; + default: + break; + } + break; + case FLASH_SST: + switch (command) { + case FLASH_RESET: + flashbase[0x5555] = 0xAA; /* unlock 1 */ + flashbase[0x2AAA] = 0x55; /* unlock 2 */ + flashbase[0x5555] = 0xf0; + break; + case FLASH_READ_ID: + flashbase[0x5555] = 0xAA; /* unlock 1 */ + flashbase[0x2AAA] = 0x55; /* unlock 2 */ + flashbase[0x5555] = 0x90; + break; + case FLASH_CFIQUERY: + flashbase[0x5555] = 0xAA; /* unlock 1 */ + flashbase[0x2AAA] = 0x55; /* unlock 2 */ + flashbase[0x5555] = 0x98; + break; + case FLASH_UB: + break; + case FLASH_PROG: + flashbase[0x5555] = 0xAA; /* unlock 1 */ + flashbase[0x2AAA] = 0x55; /* unlock 2 */ + flashbase[0x5555] = 0xa0; + flashptr[offset/2] = data; + break; + case FLASH_UBRESET: + break; + case FLASH_SERASE: + flashbase[0x5555] = 0xAA; /* unlock 1 */ + flashbase[0x2AAA] = 0x55; /* unlock 2 */ + flashbase[0x5555] = 0x80; + flashbase[0x5555] = 0xAA; + flashbase[0x2AAA] = 0x55; + flashptr[0] = 0x30; + break; + default: + break; + } + break; + default: + break; + } +} + +/*********************************************************************/ +/* flash_write extends the functionality of flash_program() by */ +/* providing an faster way to program multiple data words, without */ +/* needing the function overhead of looping algorithms which */ +/* program word by word. This function utilizes fast pointers */ +/* to quickly loop through bulk data. */ +/*********************************************************************/ +static int cfi_flash_write(unsigned short sector, int offset, unsigned char *buf, + int nbytes) +{ + unsigned short *src; + src = (unsigned short *)buf; + +#ifndef _CFE_ + down(&cfi_flash_lock); +#endif + + if ((nbytes | offset) & 1) { +#ifndef _CFE_ + up(&cfi_flash_lock); +#endif + return FLASH_API_ERROR; + } + + cfi_flash_command(FLASH_UB, 0, 0, 0, NULL); + while (nbytes > 0) { + cfi_flash_command(FLASH_PROG, sector, offset, *src, NULL); + if (cfi_flash_wait(sector, offset, *src) != STATUS_READY) + break; + offset +=2; + nbytes -=2; + src++; + } + cfi_flash_command(FLASH_UBRESET, 0, 0, 0, NULL); + +#ifndef _CFE_ + up(&cfi_flash_lock); +#endif + + return (unsigned char*)src - buf; +} + +/*********************************************************************/ +/* flash_write_to_buffer */ +/*********************************************************************/ +static int cfi_flash_write_to_buffer(unsigned short sector, unsigned char *buf) +{ + int nbytes = cfi_flash_get_sector_size(sector); + int offset; + +#ifndef _CFE_ + down(&cfi_flash_lock); +#endif + + for( offset = 0; offset < nbytes; offset += meminfo.write_buffer_size ) { + cfi_flash_command(FLASH_WRITE_BUF, sector, offset, (unsigned short) + meminfo.write_buffer_size, (unsigned short *) &buf[offset]); + if (cfi_flash_wait(sector, 0, 0) != STATUS_READY) + break; + } + +#ifndef _CFE_ + up(&cfi_flash_lock); +#endif + + return offset; +} + +/*********************************************************************/ +/* flash_wait utilizes the DQ6, DQ5, and DQ2 polling algorithms */ +/* described in the flash data book. It can quickly ascertain the */ +/* operational status of the flash device, and return an */ +/* appropriate status code (defined in flash.h) */ +/*********************************************************************/ +static int cfi_flash_wait(unsigned short sector, int offset, unsigned short data) +{ + volatile unsigned short *flashptr; /* flash window */ + unsigned short d1; + + flashptr = (unsigned short *) cfi_flash_get_memptr(sector); + + if (flashFamily == FLASH_AMD || flashFamily == FLASH_SST) { + do { +#ifndef _CFE_ + if (!in_interrupt()) { + set_tsk_need_resched(current); /* fake need_resched() to force schedule() */ + schedule(); + } +#endif + d1 = *flashptr; /* read data */ + d1 ^= *flashptr; /* read it again and see what toggled */ + if (d1 == 0) /* no toggles, nothing's happening */ + return STATUS_READY; + } while (!(d1 & 0x20)); + + d1 = *flashptr; /* read data */ + d1 ^= *flashptr; /* read it again and see what toggled */ + + if (d1 != 0) { + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + return STATUS_TIMEOUT; + } + } else if (flashFamily == FLASH_INTEL) { + flashptr[0] = 0x70; + /* Wait for completion */ + + do { +#ifndef _CFE_ + if (!in_interrupt()) { + set_tsk_need_resched(current); /* fake need_resched() to force schedule() */ + schedule(); + } +#endif + } while (!(*flashptr & 0x80)); + if (*flashptr & 0x30) { + flashptr[0] = 0x50; + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + return STATUS_TIMEOUT; + } + flashptr[0] = 0x50; + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + } + + return STATUS_READY; +} + +/*********************************************************************/ +/* flash_get_device_id() will perform an autoselect sequence on the */ +/* flash device, and return the device id of the component. */ +/* This function automatically resets to read mode. */ +/*********************************************************************/ +static unsigned short cfi_flash_get_device_id(void) +{ + volatile unsigned short *fwp; /* flash window */ + unsigned short answer; + + fwp = (unsigned short *) cfi_flash_get_memptr(0); + + cfi_flash_command(FLASH_READ_ID, 0, 0, 0, NULL); + answer = *(fwp + 1); + if (answer == ID_AM29LV320M) { + answer = *(fwp + 0xe); + answer = *(fwp + 0xf); + } + + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + return( (unsigned short) answer ); +} + +/*********************************************************************/ +/* flash_get_cfi() is the main CFI workhorse function. Due to it's */ +/* complexity and size it need only be called once upon */ +/* initializing the flash system. Once it is called, all operations */ +/* are performed by looking at the meminfo structure. */ +/* All possible care was made to make this algorithm as efficient as */ +/* possible. 90% of all operations are memory reads, and all */ +/* calculations are done using bit-shifts when possible */ +/*********************************************************************/ +static int cfi_flash_get_cfi(struct cfi_query *query, unsigned short *cfi_struct, + int flashFamily) +{ + volatile unsigned short *fwp; /* flash window */ + int i=0, temp=0; + + cfi_flash_command(FLASH_CFIQUERY, 0, 0, 0, NULL); + + if (cfi_struct == 0) + fwp = (unsigned short *) cfi_flash_get_memptr(0); + else + fwp = cfi_struct; + + /* Initial house-cleaning */ + for(i=0; i < 8; i++) { + query->erase_block[i].sector_size = 0; + query->erase_block[i].num_sectors = 0; + } + + /* If not 'QRY', then we dont have a CFI enabled device in the socket */ + if( fwp[0x10] != 'Q' && + fwp[0x11] != 'R' && + fwp[0x12] != 'Y') { + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + return(FLASH_API_ERROR); + } + + temp = fwp[0x27]; + query->device_size = (int) (((int)1) << temp); + + query->num_erase_blocks = fwp[0x2C]; + if(flashFamily == FLASH_SST) + query->num_erase_blocks = 1; + + for(i=0; i < query->num_erase_blocks; i++) { + query->erase_block[i].num_sectors = + fwp[(0x2D+(4*i))] + (fwp[0x2E + (4*i)] << 8); + query->erase_block[i].num_sectors++; + query->erase_block[i].sector_size = + 256 * (256 * fwp[(0x30+(4*i))] + fwp[(0x2F+(4*i))]); + } + + /* TBD. Add support for other flash families. */ + if(flashFamily == FLASH_AMD) + query->write_buffer_size = (1 << fwp[0x2a]); + else + query->write_buffer_size = 0; + + cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL); + return(FLASH_API_OK); +} + +#ifndef _CFE_ +static int __init cfi_flash_sched_init(void) { + cfi_flash_sched = 1; /* voluntary schedule() enabled */ + return 0; +} +late_initcall(cfi_flash_sched_init); +#endif diff --git a/shared/opensource/flash/flash_api.c b/shared/opensource/flash/flash_api.c new file mode 100755 index 0000000..5b0ca76 --- /dev/null +++ b/shared/opensource/flash/flash_api.c @@ -0,0 +1,350 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/*************************************************************************** + * File Name : flash_api.c + * + * Description: This file contains the implementation of the wrapper functions + * for the flash device interface. + ***************************************************************************/ + +/** Includes. */ +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "bcm_map.h" +#define printk printf +#else // Linux +#include +#include "bcm_map_part.h" +#endif + +#include "bcmtypes.h" +#include "bcm_hwdefs.h" +#include "flash_api.h" + +/** Externs. **/ +#if !defined(INC_CFI_FLASH_DRIVER) +#define INC_CFI_FLASH_DRIVER 0 +#endif + +#if !defined(INC_SPI_FLASH_DRIVER) +#define INC_SPI_FLASH_DRIVER 0 +#endif + +#if !defined(INC_NAND_FLASH_DRIVER) +#define INC_NAND_FLASH_DRIVER 0 +#endif + +#if !defined(INC_SPI_PROG_NAND) +#define INC_SPI_PROG_NAND 0 +#endif + +#if (INC_CFI_FLASH_DRIVER==1) +extern int cfi_flash_init(flash_device_info_t **flash_info); +#else +#define cfi_flash_init(x) FLASH_API_ERROR +#endif + +#if (INC_SPI_FLASH_DRIVER==1) +extern int spi_flash_init(flash_device_info_t **flash_info); +#else +#define spi_flash_init(x) FLASH_API_ERROR +#endif + +#if (INC_NAND_FLASH_DRIVER==1) || (INC_SPI_PROG_NAND==1) +extern int nand_flash_init(flash_device_info_t **flash_info); +#else +#define nand_flash_init(x) FLASH_API_ERROR +#endif + +/** Variables. **/ +static flash_device_info_t *g_flash_info = NULL; +#if (INC_SPI_PROG_NAND==1) +static flash_device_info_t *g_nand_flash_info = NULL; +static flash_device_info_t *g_spi_flash_info = NULL; +#endif + +/*************************************************************************** + * Function Name: display_flash_info + * Description : Displays information about the flash part. + * Returns : None. + ***************************************************************************/ +static void display_flash_info(int ret, flash_device_info_t *flash_info) +{ + switch (flash_info->flash_type) { + case FLASH_IFC_PARALLEL: + printk( "Parallel flash device"); + break; + + case FLASH_IFC_SPI: + printk( "Serial flash device"); + break; + + case FLASH_IFC_HS_SPI: + printk( "HS Serial flash device"); + break; + + case FLASH_IFC_NAND: + printk( "NAND flash device"); + break; + } + + if( ret == FLASH_API_OK ) { + printk(": name %s, id 0x%4.4x", + flash_info->flash_device_name, flash_info->flash_device_id); +#if (INC_SPI_PROG_NAND==1) + printk(" block %dKB", flash_info->fn_flash_get_sector_size(0) / 1024); + printk(" size %dKB", (*flash_info->fn_flash_get_total_size) () / 1024); +#else + if (flash_info->flash_type == FLASH_IFC_NAND) + printk(" block %dKB", flash_get_sector_size(0) / 1024); + printk(" size %dKB", flash_get_total_size() / 1024); +#endif + printk("\n"); + } + else { + printk( " id %4.4x is not supported.\n", flash_info->flash_device_id ); + } +} /* display_flash_info */ + +/*************************************************************************** + * Function Name: flash_init + * Description : Initialize flash part. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +int flash_init(void) +{ + int type = FLASH_IFC_UNKNOWN; + int ret = FLASH_API_ERROR; +#if (INC_SPI_PROG_NAND==1) + int ret_nand = FLASH_API_ERROR; +#endif + + /* If available, use bootstrap to decide which flash to use */ +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) || defined(_BCM96368_) || defined(CONFIG_BCM96368) + unsigned int bootsel; +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) + bootsel = MISC->miscStrapBus; +#elif defined(_BCM96368_) || defined(CONFIG_BCM96368) + bootsel = GPIO->StrapBus; +#endif + switch ((bootsel & MISC_STRAP_BUS_BOOT_SEL_MASK)>>MISC_STRAP_BUS_BOOT_SEL_SHIFT) { + case MISC_STRAP_BUS_BOOT_PARALLEL: + type = FLASH_IFC_PARALLEL; + break; + + case MISC_STRAP_BUS_BOOT_SERIAL: + type = FLASH_IFC_SPI; + break; + + case MISC_STRAP_BUS_BOOT_NAND: + type = FLASH_IFC_NAND; + break; + + } +#elif defined(_BCM96362_) || defined(CONFIG_BCM96362) || defined(_BCM96328_) || defined(CONFIG_BCM96328) + if( ((MISC->miscStrapBus & MISC_STRAP_BUS_BOOT_SEL_MASK) >> + MISC_STRAP_BUS_BOOT_SEL_SHIFT) == MISC_STRAP_BUS_BOOT_SERIAL ) + type = FLASH_IFC_SPI; + else + type = FLASH_IFC_NAND; +#endif + + switch (type) { + case FLASH_IFC_PARALLEL: + ret = cfi_flash_init( &g_flash_info ); + break; + + case FLASH_IFC_SPI: + ret = spi_flash_init( &g_flash_info ); +#if (INC_SPI_PROG_NAND==1) + ret_nand = nand_flash_init( &g_nand_flash_info ); +#endif + + break; + + case FLASH_IFC_NAND: + ret = nand_flash_init( &g_flash_info ); + break; + + case FLASH_IFC_UNKNOWN: + /* Try to detect flash chips, give priority to parallel flash */ + /* Our reference design has both, and we usually use parallel. */ + ret = cfi_flash_init( &g_flash_info ); + if (ret != FLASH_API_OK) { + ret = spi_flash_init( &g_flash_info ); + } + break; + } + + if (g_flash_info != NULL) { + display_flash_info(ret, g_flash_info); +#if (INC_SPI_PROG_NAND==1) + display_flash_info(ret_nand, g_nand_flash_info ); +#endif + } + else { + printk( "BCM Flash API. Flash device is not found.\n" ); + } + + return( ret ); +} /* flash_init */ + +/*************************************************************************** + * Function Name: flash_sector_erase_int + * Description : Erase the specfied flash sector. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +int flash_sector_erase_int(unsigned short sector) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_sector_erase_int) (sector) + : FLASH_API_ERROR ); +} /* flash_sector_erase_int */ + +/*************************************************************************** + * Function Name: flash_read_buf + * Description : Reads from flash memory. + * Returns : number of bytes read or FLASH_API_ERROR + ***************************************************************************/ +int flash_read_buf(unsigned short sector, int offset, unsigned char *buffer, + int numbytes) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_read_buf) (sector, offset, buffer, numbytes) + : FLASH_API_ERROR ); +} /* flash_read_buf */ + +/*************************************************************************** + * Function Name: flash_write_buf + * Description : Writes to flash memory. + * Returns : number of bytes written or FLASH_API_ERROR + ***************************************************************************/ +int flash_write_buf(unsigned short sector, int offset, unsigned char *buffer, + int numbytes) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_write_buf) (sector, offset, buffer, numbytes) + : FLASH_API_ERROR ); +} /* flash_write_buf */ + +/*************************************************************************** + * Function Name: flash_get_numsectors + * Description : Returns the number of sectors in the flash device. + * Returns : Number of sectors in the flash device. + ***************************************************************************/ +int flash_get_numsectors(void) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_get_numsectors) () + : FLASH_API_ERROR ); +} /* flash_get_numsectors */ + +/*************************************************************************** + * Function Name: flash_get_sector_size + * Description : Returns the number of bytes in the specfied flash sector. + * Returns : Number of bytes in the specfied flash sector. + ***************************************************************************/ +int flash_get_sector_size(unsigned short sector) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_get_sector_size) (sector) + : FLASH_API_ERROR ); +} /* flash_get_sector_size */ + +/*************************************************************************** + * Function Name: flash_get_memptr + * Description : Returns the base MIPS memory address for the specfied flash + * sector. + * Returns : Base MIPS memory address for the specfied flash sector. + ***************************************************************************/ +unsigned char *flash_get_memptr(unsigned short sector) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_get_memptr) (sector) + : NULL ); +} /* flash_get_memptr */ + +/*************************************************************************** + * Function Name: flash_get_blk + * Description : Returns the flash sector for the specfied MIPS address. + * Returns : Flash sector for the specfied MIPS address. + ***************************************************************************/ +int flash_get_blk(int addr) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_get_blk) (addr) + : FLASH_API_ERROR ); +} /* flash_get_blk */ + +/*************************************************************************** + * Function Name: flash_get_total_size + * Description : Returns the number of bytes in the flash device. + * Returns : Number of bytes in the flash device. + ***************************************************************************/ +int flash_get_total_size(void) +{ + return( (g_flash_info) + ? (*g_flash_info->fn_flash_get_total_size) () + : FLASH_API_ERROR ); +} /* flash_get_total_size */ + +/*************************************************************************** + * Function Name: flash_get_flash_type + * Description : Returns type of the flash memory. + * Returns : Type of the flash memory. + ***************************************************************************/ +int flash_get_flash_type(void) +{ + return( (g_flash_info) + ? (g_flash_info->flash_type) + : FLASH_API_ERROR ); +} /* flash_get_flash_type */ + +#if (INC_SPI_PROG_NAND==1) +/*************************************************************************** + * Function Name: flash_change_flash_type + * Description : change type of the flash memory. + * Returns : none + ***************************************************************************/ +void flash_change_flash_type(int type) +{ + + if (type == FLASH_IFC_NAND) + { + if (g_spi_flash_info == NULL) + g_spi_flash_info = g_flash_info; + g_flash_info = g_nand_flash_info; + } + else + { + if (g_spi_flash_info != NULL) + g_flash_info = g_spi_flash_info; + } +} /* flash_change_flash_type */ + +#endif + diff --git a/shared/opensource/flash/flash_common.c b/shared/opensource/flash/flash_common.c new file mode 100755 index 0000000..0d4a75d --- /dev/null +++ b/shared/opensource/flash/flash_common.c @@ -0,0 +1,280 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/*!\file flash_common.c + * \brief This file contains NOR flash related functions used by both + * CFE and kernel. + * + */ + +/** Includes. */ +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "bcm_map.h" +#define printk printf +#else // Linux +#include +#include "bcm_map_part.h" +#endif + +#include "bcmtypes.h" +#include "bcm_hwdefs.h" +#include "flash_api.h" +#include "flash_common.h" + +// #define DEBUG_FLASH + +void flash_init_info(const NVRAM_DATA *nvRam, FLASH_ADDR_INFO *fInfo) +{ + int i = 0; + int totalBlks = 0; + int totalSize = 0; + int psiStartAddr = 0; + int spStartAddr = 0; + int usedBlkSize = 0; + int needBytes = 0; + + if (flash_get_flash_type() == FLASH_IFC_NAND) + { + /* When using NAND flash disable Bcm_flash */ + totalSize = 0; + } + else { + totalBlks = flash_get_numsectors(); + totalSize = flash_get_total_size(); + printk("Total Flash size: %dK with %d sectors\n", totalSize/1024, totalBlks); + } + + if (totalSize <= FLASH_LENGTH_BOOT_ROM) { + /* NAND flash settings. NAND flash does not use raw flash partitioins + * to store psi, backup psi, scratch pad and syslog. These data items + * are stored as files on a JFFS2 file system. + */ + if ((nvRam->ulPsiSize != -1) && (nvRam->ulPsiSize != 0)) + fInfo->flash_persistent_length = nvRam->ulPsiSize * ONEK; + else + fInfo->flash_persistent_length = DEFAULT_PSI_SIZE * ONEK; + + fInfo->flash_persistent_start_blk = 0; + fInfo->flash_rootfs_start_offset = 0; + fInfo->flash_scratch_pad_length = SP_MAX_LEN; + fInfo->flash_syslog_length = nvRam->ulSyslogSize * 1024; + + /* This is a boolean field for NAND flash. */ + fInfo->flash_backup_psi_number_blk = nvRam->backupPsi; + return; + } + + /* + * calculate mandatory primary PSI size and set its fInfo parameters. + */ + if ((nvRam->ulPsiSize != -1) && (nvRam->ulPsiSize != 0)) + fInfo->flash_persistent_length = nvRam->ulPsiSize * ONEK; + else + fInfo->flash_persistent_length = DEFAULT_PSI_SIZE * ONEK; + + psiStartAddr = totalSize - fInfo->flash_persistent_length; + fInfo->flash_persistent_start_blk = flash_get_blk(FLASH_BASE+psiStartAddr); + fInfo->flash_persistent_number_blk = totalBlks - fInfo->flash_persistent_start_blk; + + usedBlkSize = 0; + for (i = fInfo->flash_persistent_start_blk; + i < (fInfo->flash_persistent_start_blk + fInfo->flash_persistent_number_blk); i++) + { + usedBlkSize += flash_get_sector_size((unsigned short) i); + } + fInfo->flash_persistent_blk_offset = usedBlkSize - fInfo->flash_persistent_length; + fInfo->flash_meta_start_blk = fInfo->flash_persistent_start_blk; + + /* + * Next is the optional scratch pad, which is on top of the primary PSI. + * Old code allowed scratch pad to share a sector with primary PSI. + * That is retained for backward compatibility. (Although depending on your + * NOR flash sector sizes, they may still be in different sectors.) + * If you have a new deployment, consider forcing separate sectors. + */ + if ((fInfo->flash_persistent_blk_offset > 0) && + (fInfo->flash_persistent_blk_offset < SP_MAX_LEN)) + { + /* + * there is some room left in the first persistent sector, but it is + * not big enough for the scratch pad. (Use this line unconditionally + * if you want to guarentee scratch pad and primary PSI are on different + * sectors.) + */ + spStartAddr = psiStartAddr - fInfo->flash_persistent_blk_offset - SP_MAX_LEN; + } + else + { + /* either the primary PSI starts on a sector boundary, or there is + * enough room at the top of the first sector for the scratch pad. */ + spStartAddr = psiStartAddr - SP_MAX_LEN ; + } + + fInfo->flash_scratch_pad_start_blk = flash_get_blk(FLASH_BASE+spStartAddr); + fInfo->flash_scratch_pad_length = SP_MAX_LEN; + + if (fInfo->flash_persistent_start_blk == fInfo->flash_scratch_pad_start_blk) // share blk + { +#if 0 /* do not used scratch pad unless it's in its own sector */ + printk("Scratch pad is not used for this flash part.\n"); + fInfo->flash_scratch_pad_length = 0; // no sp +#else /* allow scratch pad to share a sector with another section such as PSI */ + fInfo->flash_scratch_pad_number_blk = 1; + fInfo->flash_scratch_pad_blk_offset = fInfo->flash_persistent_blk_offset - fInfo->flash_scratch_pad_length; +#endif + } + else // on different blk + { + fInfo->flash_scratch_pad_number_blk = fInfo->flash_persistent_start_blk - fInfo->flash_scratch_pad_start_blk; + // find out the offset in the start_blk + usedBlkSize = 0; + for (i = fInfo->flash_scratch_pad_start_blk; + i < (fInfo->flash_scratch_pad_start_blk + fInfo->flash_scratch_pad_number_blk); i++) + usedBlkSize += flash_get_sector_size((unsigned short) i); + fInfo->flash_scratch_pad_blk_offset = usedBlkSize - fInfo->flash_scratch_pad_length; + } + + if (fInfo->flash_scratch_pad_length > 0) { + + fInfo->flash_meta_start_blk = fInfo->flash_scratch_pad_start_blk; + } + + /* + * Next is the optional backup PSI. + */ + if (nvRam->backupPsi == 0x01) + { + needBytes = fInfo->flash_persistent_length; + i = fInfo->flash_meta_start_blk; + while (needBytes > 0) + { + i--; + needBytes -= flash_get_sector_size((unsigned short) i); + } + fInfo->flash_backup_psi_start_blk = i; + /* calclate how many blocks we actually consumed */ + needBytes = fInfo->flash_persistent_length; + fInfo->flash_backup_psi_number_blk = 0; + while (needBytes > 0) + { + needBytes -= flash_get_sector_size((unsigned short) i); + i++; + fInfo->flash_backup_psi_number_blk++; + } + + fInfo->flash_meta_start_blk = fInfo->flash_backup_psi_start_blk; + } + else + { + fInfo->flash_backup_psi_number_blk = 0; + } + + /* + * Next is the optional persistent syslog. + */ + if (nvRam->ulSyslogSize != 0 && nvRam->ulSyslogSize != -1) + { + fInfo->flash_syslog_length = nvRam->ulSyslogSize * 1024; + needBytes = fInfo->flash_syslog_length; + i = fInfo->flash_meta_start_blk; + while (needBytes > 0) + { + i--; + needBytes -= flash_get_sector_size((unsigned short) i); + } + fInfo->flash_syslog_start_blk = i; + /* calclate how many blocks we actually consumed */ + needBytes = fInfo->flash_syslog_length; + fInfo->flash_syslog_number_blk = 0; + while (needBytes > 0) + { + needBytes -= flash_get_sector_size((unsigned short) i); + i++; + fInfo->flash_syslog_number_blk++; + } + + fInfo->flash_meta_start_blk = fInfo->flash_syslog_start_blk; + } + else + { + fInfo->flash_syslog_length = 0; + fInfo->flash_syslog_number_blk = 0; + } + +#ifdef DEBUG_FLASH_TOO_MUCH + /* dump sizes of all sectors in flash */ + for (i=0; iflash_rootfs_start_offset =0x%08x\n\n", (unsigned int)fInfo->flash_rootfs_start_offset); + + printk("fInfo->flash_meta_start_blk = %d\n\n", fInfo->flash_meta_start_blk); + + printk("fInfo->flash_syslog_start_blk = %d\n", fInfo->flash_syslog_start_blk); + printk("fInfo->flash_syslog_number_blk = %d\n", fInfo->flash_syslog_number_blk); + printk("fInfo->flash_syslog_length=0x%x\n\n", (unsigned int)fInfo->flash_syslog_length); + + printk("fInfo->flash_backup_psi_start_blk = %d\n", fInfo->flash_backup_psi_start_blk); + printk("fInfo->flash_backup_psi_number_blk = %d\n\n", fInfo->flash_backup_psi_number_blk); + + printk("sp startAddr = %x\n", (unsigned int) (FLASH_BASE+spStartAddr)); + printk("fInfo->flash_scratch_pad_start_blk = %d\n", fInfo->flash_scratch_pad_start_blk); + printk("fInfo->flash_scratch_pad_number_blk = %d\n", fInfo->flash_scratch_pad_number_blk); + printk("fInfo->flash_scratch_pad_length = 0x%x\n", fInfo->flash_scratch_pad_length); + printk("fInfo->flash_scratch_pad_blk_offset = 0x%x\n\n", (unsigned int)fInfo->flash_scratch_pad_blk_offset); + + printk("psi startAddr = %x\n", (unsigned int) (FLASH_BASE+psiStartAddr)); + printk("fInfo->flash_persistent_start_blk = %d\n", fInfo->flash_persistent_start_blk); + printk("fInfo->flash_persistent_number_blk = %d\n", fInfo->flash_persistent_number_blk); + printk("fInfo->flash_persistent_length=0x%x\n", (unsigned int)fInfo->flash_persistent_length); + printk("fInfo->flash_persistent_blk_offset = 0x%x\n\n", (unsigned int)fInfo->flash_persistent_blk_offset); +#endif +} + +unsigned int flash_get_reserved_bytes_at_end(const FLASH_ADDR_INFO *fInfo) +{ + unsigned int reserved=0; + int i = fInfo->flash_meta_start_blk; + int totalBlks = flash_get_numsectors(); + + while (i < totalBlks) + { + reserved += flash_get_sector_size((unsigned short) i); + i++; + } + +#if defined(DEBUG_FLASH) + printk("reserved at bottom=%dKB\n", reserved/1024); +#endif + + return reserved; +} + diff --git a/shared/opensource/flash/nandflash.c b/shared/opensource/flash/nandflash.c new file mode 100755 index 0000000..b90ad7b --- /dev/null +++ b/shared/opensource/flash/nandflash.c @@ -0,0 +1,1260 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/*************************************************************************** + * File Name : nandflash.c + * + * Description: This file implements the Broadcom DSL defined flash api for + * for NAND flash parts. + ***************************************************************************/ + +/** Includes. **/ + +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "lib_malloc.h" +#include "bcm_map.h" +#include "bcmtypes.h" +#include "bcm_hwdefs.h" +#include "flash_api.h" +#include "jffs2.h" +#if defined(CFG_RAMAPP) && (INC_SPI_FLASH_DRIVER==1) +#include "cfe_timer.h" +#endif + +/* for debugging in jtag */ +#if !defined(CFG_RAMAPP) +#define static +#endif + + +/** Defines. **/ + +#define NR_OOB_SCAN_PAGES 4 +#define SPARE_MAX_SIZE 64 +#define PAGE_MAX_SIZE 2048 +#define CTRLR_SPARE_SIZE 16 +#define CTRLR_CACHE_SIZE 512 + +/* Flash manufacturers. */ +#define FLASHTYPE_SAMSUNG 0xec +#define FLASHTYPE_ST 0x20 +#define FLASHTYPE_MICRON 0x2c + +/* Samsung flash parts. */ +#define SAMSUNG_K9F5608U0A 0x55 + +/* ST flash parts. */ +#define ST_NAND512W3A2CN6 0x76 +#define ST_NAND01GW3B2CN6 0xf1 + +/* Micron flash parts. */ +#define MICRON_MT29F1G08AAC 0xf1 + +/* Flash id to name mapping. */ +#define NAND_MAKE_ID(A,B) \ + (((unsigned short) (A) << 8) | ((unsigned short) B & 0xff)) + +#define NAND_FLASH_DEVICES \ + {{NAND_MAKE_ID(FLASHTYPE_SAMSUNG,SAMSUNG_K9F5608U0A),"Samsung K9F5608U0"}, \ + {NAND_MAKE_ID(FLASHTYPE_ST,ST_NAND512W3A2CN6),"ST NAND512W3A2CN6"}, \ + {NAND_MAKE_ID(FLASHTYPE_ST,ST_NAND01GW3B2CN6),"ST NAND01GW3B2CN6"}, \ + {NAND_MAKE_ID(FLASHTYPE_MICRON,MICRON_MT29F1G08AAC),"Micron MT29F1G08AAC"},\ + {0,""} \ + } + +/* One byte for small page NAND flash parts. */ +#define SPARE_SP_BI_INDEX_1 5 +#define SPARE_SP_BI_INDEX_2 5 + +/* Two bytes for small page NAND flash parts. */ +#define SPARE_LP_BI_INDEX_1 0 +#define SPARE_LP_BI_INDEX_2 1 + +#define SPARE_BI_MARKER 0 +#define SPARE_BI_ECC_MASK \ + {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0} + +#define JFFS2_CLEANMARKER {JFFS2_MAGIC_BITMASK, \ + JFFS2_NODETYPE_CLEANMARKER, 0x0000, 0x0008} + +#undef DEBUG_NAND +#if defined(DEBUG_NAND) && defined(CFG_RAMAPP) +#define DBG_PRINTF printf +#else +#define DBG_PRINTF(...) +#endif + + +/** Externs. **/ + +extern void board_setleds(unsigned long); + + +/** Structs. **/ + +typedef struct CfeNandChip +{ + char *chip_name; + unsigned long chip_device_id; + unsigned long chip_base; + unsigned long chip_total_size; + unsigned long chip_block_size; + unsigned long chip_page_size; + unsigned long chip_spare_size; + unsigned char *chip_spare_mask; + unsigned long chip_bi_index_1; + unsigned long chip_bi_index_2; +} CFE_NAND_CHIP, *PCFE_NAND_CHIP; + +struct flash_name_from_id +{ + unsigned short fnfi_id; + char fnfi_name[30]; +}; + + +#if defined(CFG_RAMAPP) +/** Prototypes for CFE RAM. **/ +int nand_flash_init(flash_device_info_t **flash_info); +int mpinand_flash_init(flash_device_info_t **flash_info); +static void nand_init_cleanmarker(PCFE_NAND_CHIP pchip); +static void nand_read_cfg(PCFE_NAND_CHIP pchip); +static int nand_is_blk_cleanmarker(PCFE_NAND_CHIP pchip, + unsigned long start_addr, int write_if_not); +static int nand_initialize_spare_area(PCFE_NAND_CHIP pchip); +static void nand_mark_bad_blk(PCFE_NAND_CHIP pchip, unsigned long page_addr); +static int nand_flash_sector_erase_int(unsigned short blk); +static int nand_flash_read_buf(unsigned short blk, int offset, + unsigned char *buffer, int len); +static int nand_flash_write_buf(unsigned short blk, int offset, + unsigned char *buffer, int numbytes); +static int nand_flash_get_numsectors(void); +static int nand_flash_get_sector_size(unsigned short sector); +static unsigned char *nand_flash_get_memptr(unsigned short sector); +static int nand_flash_get_blk(int addr); +static int nand_flash_get_total_size(void); +static int nandflash_wait_status(unsigned long status_mask); +static int nandflash_read_spare_area(PCFE_NAND_CHIP pchip, + unsigned long page_addr, unsigned char *buffer, int len); +static int nandflash_write_spare_area(PCFE_NAND_CHIP pchip, + unsigned long page_addr, unsigned char *buffer, int len); +static int nandflash_read_page(PCFE_NAND_CHIP pchip, + unsigned long start_addr, unsigned char *buffer, int len); +static int nandflash_write_page(PCFE_NAND_CHIP pchip, unsigned long start_addr, + unsigned char *buffer, int len); +static int nandflash_block_erase(PCFE_NAND_CHIP pchip, unsigned long blk_addr); +#else +/** Prototypes for CFE ROM. **/ +void rom_nand_flash_init(void); +static int nand_is_blk_cleanmarker(PCFE_NAND_CHIP pchip, + unsigned long start_addr, int write_if_not); +static void nand_read_cfg(PCFE_NAND_CHIP pchip); +int nand_flash_get_sector_size(unsigned short sector); +int nand_flash_get_numsectors(void); +static int nandflash_wait_status(unsigned long status_mask); +static int nandflash_read_spare_area(PCFE_NAND_CHIP pchip, + unsigned long page_addr, unsigned char *buffer, int len); +static int nandflash_read_page(PCFE_NAND_CHIP pchip, unsigned long start_addr, + unsigned char *buffer, int len); +int nand_flash_read_buf(unsigned short blk, int offset, + unsigned char *buffer, int len); +static inline void nandflash_copy_from_cache(unsigned char *buffer, + int offset, int numbytes); +static inline void nandflash_copy_from_spare(unsigned char *buffer, + int numbytes); +static int nandflash_wait_status(unsigned long status_mask); +static inline int nandflash_wait_cmd(void); +static inline int nandflash_wait_device(void); +static inline int nandflash_wait_cache(void); +static inline int nandflash_wait_spare(void); +static int nandflash_check_ecc(void); +#endif + + +#if defined(CFG_RAMAPP) +/** Variables for CFE RAM. **/ +CFE_NAND_CHIP g_chip = {NULL,0,0,0,0,0,0}; +static unsigned char g_spare_mask[] = SPARE_BI_ECC_MASK; +static unsigned char g_spare_cleanmarker[SPARE_MAX_SIZE]; + +static flash_device_info_t flash_nand_dev = + { + 0xffff, + FLASH_IFC_NAND, + "", + nand_flash_sector_erase_int, + nand_flash_read_buf, + nand_flash_write_buf, + nand_flash_get_numsectors, + nand_flash_get_sector_size, + nand_flash_get_memptr, + nand_flash_get_blk, + nand_flash_get_total_size + }; + +#else +/** Variables for CFE ROM. **/ +CFE_NAND_CHIP g_chip; +static unsigned char g_spare_mask[] = SPARE_BI_ECC_MASK; +#endif + + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nand_flash_init + * Description : Initialize flash part. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +int nand_flash_init(flash_device_info_t **flash_info) +{ + static int initialized = 0; + int ret = FLASH_API_OK; + + if( initialized == 0 ) + { + PCFE_NAND_CHIP pchip = &g_chip; + static struct flash_name_from_id fnfi[] = NAND_FLASH_DEVICES; + struct flash_name_from_id *fnfi_ptr; + + DBG_PRINTF(">> nand_flash_init - entry\n"); + + /* Enable NAND data on MII ports. */ +#if !defined(_BCM96328_) + PERF->blkEnables |= NAND_CLK_EN; +#endif +#if defined(_BCM96362_) && (INC_SPI_FLASH_DRIVER==1) + GPIO->GPIOBaseMode |= NAND_GPIO_OVERRIDE; +#endif + NAND->NandNandBootConfig = NBC_AUTO_DEV_ID_CFG | 2; +#if (INC_SPI_FLASH_DRIVER==1) + cfe_usleep(1000); +#endif + /* Read the NAND flash chip id. Only use the most signficant 16 bits.*/ + pchip->chip_device_id = NAND->NandFlashDeviceId >> 16; + flash_nand_dev.flash_device_id = pchip->chip_device_id; + + for( fnfi_ptr = fnfi; fnfi_ptr->fnfi_id != 0; fnfi_ptr++ ) + { + if( fnfi_ptr->fnfi_id == pchip->chip_device_id ) + { + strcpy(flash_nand_dev.flash_device_name, fnfi_ptr->fnfi_name); + break; + } + } + + /* If NAND chip is not in the list of NAND chips, the correct + * configuration maybe still have been set by the NAND controller. + */ + if( flash_nand_dev.flash_device_name[0] == '\0' ) + strcpy(flash_nand_dev.flash_device_name, ""); + + *flash_info = &flash_nand_dev; + + NAND->NandCsNandXor = 0; + pchip->chip_base = 0; + nand_read_cfg(pchip); + nand_init_cleanmarker(pchip); + + /* If the first block's spare area is not a JFFS2 cleanmarker, + * initialize all block's spare area to a cleanmarker. + */ + if( !nand_is_blk_cleanmarker(pchip, 0, 0) ) + ret = nand_initialize_spare_area(pchip); + + DBG_PRINTF(">> nand_flash_init - return %d\n", ret); + + initialized = 1; + } + else + *flash_info = &flash_nand_dev; + + return( ret ); +} /* nand_flash_init */ + +/*************************************************************************** + * Function Name: nand_init_cleanmarker + * Description : Initializes the JFFS2 clean marker buffer. + * Returns : None. + ***************************************************************************/ +static void nand_init_cleanmarker(PCFE_NAND_CHIP pchip) +{ + unsigned short cleanmarker[] = JFFS2_CLEANMARKER; + unsigned char *pcm = (unsigned char *) cleanmarker; + int i, j; + + /* Skip spare area offsets reserved for ECC bytes. */ + for( i = 0, j = 0; i < pchip->chip_spare_size; i++ ) + { + if( pchip->chip_spare_mask[i] == 0 && j < sizeof(cleanmarker)) + g_spare_cleanmarker[i] = pcm[j++]; + else + g_spare_cleanmarker[i] = 0xff; + } +} /* nand_init_cleanmarker */ + +#else +/*************************************************************************** + * Function Name: rom_nand_flash_init + * Description : Initialize flash part just enough to read blocks. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +void rom_nand_flash_init(void) +{ + PCFE_NAND_CHIP pchip = &g_chip; + + /* Enable NAND data on MII ports. */ +#if !defined(_BCM96328_) + PERF->blkEnables |= NAND_CLK_EN; +#endif + NAND->NandNandBootConfig = NBC_AUTO_DEV_ID_CFG | 2; + + pchip->chip_base = 0; + + /* Read the chip id. Only use the most signficant 16 bits. */ + pchip->chip_device_id = NAND->NandFlashDeviceId >> 16; + + if( pchip->chip_device_id > 0 && pchip->chip_device_id < 0xffff ) + nand_read_cfg(pchip); + else + board_setleds(0x4d494532); +} /* nand_flash_init */ +#endif + +/*************************************************************************** + * Function Name: nand_read_cfg + * Description : Reads and stores the chip configuration. + * Returns : None. + ***************************************************************************/ +static void nand_read_cfg(PCFE_NAND_CHIP pchip) +{ + /* Read chip configuration. */ + unsigned long cfg = NAND->NandConfig; + + pchip->chip_total_size = + (4 * (1 << ((cfg & NC_DEV_SIZE_MASK) >> NC_DEV_SIZE_SHIFT))) << 20; + + switch( (cfg & NC_BLK_SIZE_MASK) ) + { + case NC_BLK_SIZE_512K: + pchip->chip_block_size = 512 * 1024; + break; + + case NC_BLK_SIZE_128K: + pchip->chip_block_size = 128 * 1024; + break; + + case NC_BLK_SIZE_16K: + pchip->chip_block_size = 16 * 1024; + break; + + case NC_BLK_SIZE_8K: + pchip->chip_block_size = 8 * 1024; + break; + } + + if( (cfg & NC_PG_SIZE_MASK) == NC_PG_SIZE_512B ) + { + pchip->chip_page_size = 512; + pchip->chip_bi_index_1 = SPARE_SP_BI_INDEX_1; + pchip->chip_bi_index_2 = SPARE_SP_BI_INDEX_2; + } + else + { + pchip->chip_page_size = 2048; + pchip->chip_bi_index_1 = SPARE_LP_BI_INDEX_1; + pchip->chip_bi_index_2 = SPARE_LP_BI_INDEX_2; + } + + pchip->chip_spare_mask = g_spare_mask; + pchip->chip_spare_mask[pchip->chip_bi_index_1] = 1; + pchip->chip_spare_mask[pchip->chip_bi_index_2] = 1; + + pchip->chip_spare_size = pchip->chip_page_size >> 5; + + DBG_PRINTF(">> nand_read_cfg - size=%luMB, block=%luKB, page=%luB, " + "spare=%lu\n", pchip->chip_total_size / (1024 * 1024), + pchip->chip_block_size / 1024, pchip->chip_page_size, + pchip->chip_spare_size); +} /* nand_read_cfg */ + +/*************************************************************************** + * Function Name: nand_is_blk_cleanmarker + * Description : Compares a buffer to see if it a JFFS2 cleanmarker. + * Returns : 1 - is cleanmarker, 0 - is not cleanmarker + ***************************************************************************/ +static int nand_is_blk_cleanmarker(PCFE_NAND_CHIP pchip, + unsigned long start_addr, int write_if_not) +{ + unsigned short cleanmarker[] = JFFS2_CLEANMARKER; + unsigned char *pcm = (unsigned char *) cleanmarker; + unsigned char spare[SPARE_MAX_SIZE], comparebuf[SPARE_MAX_SIZE]; + unsigned long i, j; + int ret = 0; + + if( nandflash_read_spare_area( pchip, start_addr, spare, + pchip->chip_spare_size) == FLASH_API_OK ) + { + /* Skip spare offsets that are reserved for the ECC. Make spare data + * bytes contiguous in the spare buffer. + */ + for( i = 0, j = 0; i < pchip->chip_spare_size; i++ ) + if( pchip->chip_spare_mask[i] == 0 ) + comparebuf[j++] = spare[i]; + + /* Compare spare area data to the JFFS2 cleanmarker. */ + for( i = 0, ret = 1; i < sizeof(cleanmarker) && ret == 1; i++ ) + if( comparebuf[i] != pcm[i]) + ret = 0; + } + +#if defined(CFG_RAMAPP) + if( ret == 0 && spare[pchip->chip_bi_index_1] != SPARE_BI_MARKER && + spare[pchip->chip_bi_index_2] != SPARE_BI_MARKER && write_if_not ) + { + /* The spare area is not a clean marker but the block is not bad. + * Write a clean marker to this block. (Assumes the block is erased.) + */ + if( nandflash_write_spare_area(pchip, start_addr, (unsigned char *) + g_spare_cleanmarker, pchip->chip_spare_size) == FLASH_API_OK ) + { + ret = nand_is_blk_cleanmarker(pchip, start_addr, 0); + } + } +#endif + + return( ret ); +} /* nand_is_blk_cleanmarker */ + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nand_initialize_spare_area + * Description : Initializes the spare area of the first page of each block + * to a cleanmarker. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nand_initialize_spare_area(PCFE_NAND_CHIP pchip) +{ + unsigned char spare[SPARE_MAX_SIZE]; + unsigned long i; + int ret; + + DBG_PRINTF(">> nand_initialize_spare_area - entry\n"); + + for( i = 0; i < pchip->chip_total_size; i += pchip->chip_block_size ) + { + /* Read the current spare area. */ + ret = nandflash_read_spare_area(pchip,0,spare,pchip->chip_spare_size); + if(ret == FLASH_API_OK + /*&& spare[pchip->chip_bi_index_1] != SPARE_BI_MARKER*/ + /*&& spare[pchip->chip_bi_index_2] != SPARE_BI_MARKER*/) + { + if( nandflash_block_erase(pchip, i) == FLASH_API_OK ) + { + nandflash_write_spare_area(pchip, i, (unsigned char *) + g_spare_cleanmarker, pchip->chip_spare_size); + } + } + } + + return( FLASH_API_OK ); +} /* nand_initialize_spare_area */ + + +/*************************************************************************** + * Function Name: nand_mark_bad_blk + * Description : Marks the specified block as bad by writing 0xFFs to the + * spare area and updating the in memory bad block table. + * Returns : None. + ***************************************************************************/ +static void nand_mark_bad_blk(PCFE_NAND_CHIP pchip, unsigned long page_addr) +{ + static int marking_bad_blk = 0; + + unsigned char spare[SPARE_MAX_SIZE]; + + if( marking_bad_blk == 0 ) + { + marking_bad_blk = 1; + DBG_PRINTF(">> nand_mark_bad_blk - addr=0x%8.8lx, block=0x%8.8lx\n", + page_addr, page_addr / pchip->chip_block_size); + + nandflash_block_erase(pchip, page_addr); + memset(spare, 0xff, pchip->chip_spare_size); + spare[pchip->chip_bi_index_1] = SPARE_BI_MARKER; + spare[pchip->chip_bi_index_2] = SPARE_BI_MARKER; + nandflash_write_spare_area(pchip,page_addr,spare,pchip->chip_spare_size); + marking_bad_blk = 0; + } +} /* nand_mark_bad_blk */ + + +/*************************************************************************** + * Function Name: nand_flash_sector_erase_int + * Description : Erase the specfied flash sector. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nand_flash_sector_erase_int(unsigned short blk) +{ + int ret = FLASH_API_OK; + PCFE_NAND_CHIP pchip = &g_chip; + + if( blk == NAND_REINIT_FLASH ) + nand_initialize_spare_area(pchip); + else + { + unsigned long page_addr = blk * pchip->chip_block_size; + + /* Only erase the block if the spare area is a JFFS2 cleanmarker. + * Assume that the only the CFE boot loader only touches JFFS2 blocks. + * This check prevents the Linux NAND MTD driver bad block block table + * from being erased. The NAND_REINIT_FLASH option unconditionally + * erases all NAND flash blocks. + */ + if( nand_is_blk_cleanmarker(pchip, page_addr, 0) ) + { + ret = nandflash_block_erase(pchip, page_addr); + nandflash_write_spare_area(pchip, page_addr, g_spare_cleanmarker, + pchip->chip_spare_size); + } + + DBG_PRINTF(">> nand_flash_sector_erase_int - blk=0x%8.8lx, ret=%d\n", + blk, ret); + } + + return( ret ); +} /* nand_flash_sector_erase_int */ +#endif + +/*************************************************************************** + * Function Name: nand_flash_read_buf + * Description : Reads from flash memory. + * Returns : number of bytes read or FLASH_API_ERROR + ***************************************************************************/ +#if defined(CFG_RAMAPP) +static +#endif +int nand_flash_read_buf(unsigned short blk, int offset, unsigned char *buffer, + int len) +{ + int ret = len; + PCFE_NAND_CHIP pchip = &g_chip; + UINT32 start_addr; + UINT32 blk_addr; + UINT32 blk_offset; + UINT32 size; + + DBG_PRINTF(">> nand_flash_read_buf - 1 blk=0x%8.8lx, offset=%d, len=%lu\n", + blk, offset, len); + + start_addr = (blk * pchip->chip_block_size) + offset; + blk_addr = start_addr & ~(pchip->chip_block_size - 1); + blk_offset = start_addr - blk_addr; + size = pchip->chip_block_size - blk_offset; + + if(size > len) + size = len; + + do + { + if(nandflash_read_page(pchip,start_addr,buffer,size) != FLASH_API_OK) + { + ret = FLASH_API_ERROR; + break; + } + + len -= size; + if( len ) + { + blk++; + + DBG_PRINTF(">> nand_flash_read_buf - 2 blk=0x%8.8lx, len=%lu\n", + blk, len); + + start_addr = blk * pchip->chip_block_size; + buffer += size; + if(len > pchip->chip_block_size) + size = pchip->chip_block_size; + else + size = len; + } + } while(len); + + DBG_PRINTF(">> nand_flash_read_buf - ret=%d\n", ret); + + return( ret ) ; +} /* nand_flash_read_buf */ + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nand_flash_write_buf + * Description : Writes to flash memory. + * Returns : number of bytes written or FLASH_API_ERROR + ***************************************************************************/ +static int nand_flash_write_buf(unsigned short blk, int offset, + unsigned char *buffer, int len) +{ + int ret = len; + PCFE_NAND_CHIP pchip = &g_chip; + UINT32 start_addr; + UINT32 blk_addr; + UINT32 blk_offset; + UINT32 size; + + DBG_PRINTF(">> nand_flash_write_buf - 1 blk=0x%8.8lx, offset=%d, len=%d\n", + blk, offset, len); + + start_addr = (blk * pchip->chip_block_size) + offset; + blk_addr = start_addr & ~(pchip->chip_block_size - 1); + blk_offset = start_addr - blk_addr; + size = pchip->chip_block_size - blk_offset; + + if(size > len) + size = len; + + do + { + if(nandflash_write_page(pchip,start_addr,buffer,size) != FLASH_API_OK) + { + ret = ret - len; + break; + } + else + { + len -= size; + if( len ) + { + blk++; + + DBG_PRINTF(">> nand_flash_write_buf- 2 blk=0x%8.8lx, len=%d\n", + blk, len); + + offset = 0; + start_addr = blk * pchip->chip_block_size; + buffer += size; + if(len > pchip->chip_block_size) + size = pchip->chip_block_size; + else + size = len; + } + } + } while(len); + + DBG_PRINTF(">> nand_flash_write_buf - ret=%d\n", ret); + + return( ret ) ; +} /* nand_flash_write_buf */ + +/*************************************************************************** + * Function Name: nand_flash_get_memptr + * Description : Returns the base MIPS memory address for the specfied flash + * sector. + * Returns : Base MIPS memory address for the specfied flash sector. + ***************************************************************************/ +static unsigned char *nand_flash_get_memptr(unsigned short sector) +{ + /* Bad things will happen if this pointer is referenced. But it can + * be used for pointer arithmetic to deterine sizes. + */ + return((unsigned char *) (FLASH_BASE + (sector * g_chip.chip_block_size))); +} /* nand_flash_get_memptr */ + +/*************************************************************************** + * Function Name: nand_flash_get_blk + * Description : Returns the flash sector for the specfied MIPS address. + * Returns : Flash sector for the specfied MIPS address. + ***************************************************************************/ +static int nand_flash_get_blk(int addr) +{ + return( (addr - FLASH_BASE) / g_chip.chip_block_size ); +} /* nand_flash_get_blk */ + +/*************************************************************************** + * Function Name: nand_flash_get_total_size + * Description : Returns the number of bytes in the "CFE Linux code" + * partition. + * Returns : Number of bytes + ***************************************************************************/ +static int nand_flash_get_total_size(void) +{ + return(g_chip.chip_total_size); +} /* nand_flash_get_total_size */ +#endif + +/*************************************************************************** + * Function Name: nand_flash_get_sector_size + * Description : Returns the number of bytes in the specfied flash sector. + * Returns : Number of bytes in the specfied flash sector. + ***************************************************************************/ +#if defined(CFG_RAMAPP) +static +#endif +int nand_flash_get_sector_size(unsigned short sector) +{ + return(g_chip.chip_block_size); +} /* nand_flash_get_sector_size */ + +/*************************************************************************** + * Function Name: nand_flash_get_numsectors + * Description : Returns the number of blocks in the "CFE Linux code" + * partition. + * Returns : Number of blocks + ***************************************************************************/ +#if defined(CFG_RAMAPP) +static +#endif +int nand_flash_get_numsectors(void) +{ + return(g_chip.chip_total_size / g_chip.chip_block_size); +} /* nand_flash_get_numsectors */ + + +/*************************************************************************** + * NAND Flash Implementation Functions + ***************************************************************************/ + +/*************************************************************************** + * Function Name: nandflash_copy_from_cache + * Description : Copies data from the chip NAND cache to a local memory + * buffer. + * Returns : None. + ***************************************************************************/ +static inline void nandflash_copy_from_cache(unsigned char *buffer, + int offset, int numbytes) +{ + unsigned char *cache = (unsigned char *) NAND_CACHE; + + /* XXX memcpy will only work for 32-bit aligned data */ + memcpy(buffer, &cache[offset], numbytes); +} /* nandflash_copy_from_cache */ + +/*************************************************************************** + * Function Name: nandflash_copy_from_spare + * Description : Copies data from the chip NAND spare registers to a local + * memory buffer. + * Returns : None. + ***************************************************************************/ +static inline void nandflash_copy_from_spare(unsigned char *buffer, + int numbytes) +{ + unsigned long *spare_area = (unsigned long *) &NAND->NandSpareAreaReadOfs0; + + /* XXX memcpy will only work for 32-bit aligned data */ + memcpy(buffer, spare_area, numbytes); +} /* nandflash_copy_from_spare */ + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nandflash_copy_to_cache + * Description : Copies data from a local memory buffer to the the chip NAND + * cache. + * Returns : None. + ***************************************************************************/ +static inline void nandflash_copy_to_cache(unsigned char *buffer, int offset, + int numbytes) +{ + unsigned char *cache = (unsigned char *) NAND_CACHE; + unsigned long i; + + for( i = 0; i < numbytes; i += sizeof(long) ) + *(unsigned long *) &cache[i] = + ((unsigned long) buffer[i + 0] << 24) | + ((unsigned long) buffer[i + 1] << 16) | + ((unsigned long) buffer[i + 2] << 8) | + ((unsigned long) buffer[i + 3] << 0); +} /* nandflash_copy_to_cache */ + +/*************************************************************************** + * Function Name: nandflash_copy_to_spare + * Description : Copies data from a local memory buffer to the the chip NAND + * spare registers. + * Returns : None. + ***************************************************************************/ +static inline void nandflash_copy_to_spare(unsigned char *buffer,int numbytes) +{ + unsigned long *spare_area = (unsigned long *) &NAND->NandSpareAreaWriteOfs0; + unsigned long *pbuff = (unsigned long *)buffer; + int i; + + for(i=0; i< numbytes / sizeof(unsigned long); ++i) + spare_area[i] = pbuff[i]; +} /* nandflash_copy_to_spare */ +#endif + +/*************************************************************************** + * Function Name: nandflash_wait_status + * Description : Polls the NAND status register waiting for a condition. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_wait_status(unsigned long status_mask) +{ + + const unsigned long nand_poll_max = 1000000; + unsigned long data; + unsigned long poll_count = 0; + int ret = FLASH_API_OK; + + do + { + data = NAND->NandIntfcStatus; + } while(!(status_mask & data) && (++poll_count < nand_poll_max)); + + if(poll_count >= nand_poll_max) + { + printf("Status wait timeout: nandsts=0x%8.8lx mask=0x%8.8lx, count=" + "%lu\n", NAND->NandIntfcStatus, status_mask, poll_count); + ret = FLASH_API_ERROR; + } + + return( ret ); +} /* nandflash_wait_status */ + +static inline int nandflash_wait_cmd(void) +{ + return nandflash_wait_status(NIS_CTLR_READY); +} /* nandflash_wait_cmd */ + +static inline int nandflash_wait_device(void) +{ + return nandflash_wait_status(NIS_FLASH_READY); +} /* nandflash_wait_device */ + +static inline int nandflash_wait_cache(void) +{ + return nandflash_wait_status(NIS_CACHE_VALID); +} /* nandflash_wait_cache */ + +static inline int nandflash_wait_spare(void) +{ + return nandflash_wait_status(NIS_SPARE_VALID); +} /* nandflash_wait_spare */ + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nandflash_check_ecc + * Description : Reads ECC status. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_check_ecc(void) +{ + int ret = FLASH_API_OK; + UINT32 intrCtrl; + UINT32 accessCtrl; + + /* read interrupt status */ + intrCtrl = NAND_INTR->NandInterrupt; + accessCtrl = NAND->NandAccControl; + + + if( (intrCtrl & NINT_ECC_ERROR_UNC) != 0 ) + { + printf("Uncorrectable ECC Error detected: addr=0x%8.8lx, intrCtrl=0x" + "%08X, accessCtrl=0x%08X\n", NAND->NandEccUncAddr, (UINT)intrCtrl, + (UINT)accessCtrl); + ret = FLASH_API_ERROR; + } + + if( (intrCtrl & NINT_ECC_ERROR_CORR) != 0 ) + { + printf("Correctable ECC Error detected: addr=0x%8.8lx, intrCtrl=0x" + "%08X, accessCtrl=0x%08X\n", NAND->NandEccCorrAddr, (UINT)intrCtrl, + (UINT)accessCtrl); + } + + return( ret ); +} +#else +static int nandflash_check_ecc(void) +{ + return( FLASH_API_OK ); +} +#endif + +/*************************************************************************** + * Function Name: nandflash_read_spare_area + * Description : Reads the spare area for the specified page. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_read_spare_area(PCFE_NAND_CHIP pchip, + unsigned long page_addr, unsigned char *buffer, int len) +{ + int ret = FLASH_API_ERROR; + + if( len >= pchip->chip_spare_size ) + { + UINT32 steps = pchip->chip_spare_size / CTRLR_SPARE_SIZE; + UINT32 i; + + for( i = 0; i < steps; i++ ) + { + NAND->NandCmdAddr = pchip->chip_base + page_addr + + (i * CTRLR_CACHE_SIZE); + NAND->NandCmdExtAddr = 0; + NAND->NandCmdStart = NCMD_SPARE_READ; + + if( (ret = nandflash_wait_cmd()) == FLASH_API_OK ) + { + /* wait until data is available in the spare area registers */ + if( (ret = nandflash_wait_spare()) == FLASH_API_OK ) + nandflash_copy_from_spare(buffer + (i * CTRLR_SPARE_SIZE), + CTRLR_SPARE_SIZE); + else + break; + } + else + break; + } + } + + return ret; +} /* nandflash_read_spare_area */ + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nandflash_write_spare_area + * Description : Reads the spare area for the specified page. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_write_spare_area(PCFE_NAND_CHIP pchip, + unsigned long page_addr, unsigned char *buffer, int len) +{ + int ret = FLASH_API_OK; + unsigned char spare[SPARE_MAX_SIZE]; + + if( len <= pchip->chip_spare_size ) + { + UINT32 steps = pchip->chip_spare_size / CTRLR_SPARE_SIZE; + UINT32 i; + + memset(spare, 0xff, pchip->chip_spare_size); + memcpy(spare, buffer, len); + + for( i = 0; i < steps; i++ ) + { + NAND->NandCmdAddr = pchip->chip_base + page_addr + + (i * CTRLR_CACHE_SIZE); + NAND->NandCmdExtAddr = 0; + + nandflash_copy_to_spare(spare + (i * CTRLR_SPARE_SIZE), + CTRLR_SPARE_SIZE); + + NAND->NandCmdStart = NCMD_PROGRAM_SPARE; + if( (ret = nandflash_wait_cmd()) == FLASH_API_OK ) + { + unsigned long sts = NAND->NandIntfcStatus; + + if( (sts & NIS_PGM_ERASE_ERROR) != 0 ) + { + printf("Error writing to spare area, sts=0x%8.8lx\n", sts); + nand_mark_bad_blk(pchip, page_addr); + ret = FLASH_API_ERROR; + } + } + } + } + else + ret = FLASH_API_ERROR; + + /* Reset spare area to default value. */ + memset(spare, 0xff, CTRLR_SPARE_SIZE); + nandflash_copy_to_spare(spare, CTRLR_SPARE_SIZE); + + return( ret ); +} /* nandflash_write_spare_area */ +#endif + +/*************************************************************************** + * Function Name: nandflash_read_page + * Description : Reads up to a NAND block of pages into the specified buffer. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_read_page(PCFE_NAND_CHIP pchip, unsigned long start_addr, + unsigned char *buffer, int len) +{ + int ret = FLASH_API_ERROR; + + if( len <= pchip->chip_block_size ) + { + UINT32 page_addr = start_addr & ~(pchip->chip_page_size - 1); + UINT32 page_offset = start_addr - page_addr; + UINT32 size = pchip->chip_page_size - page_offset; + UINT32 index = 0; + + /* Verify that the spare area contains a JFFS2 cleanmarker. */ + if( nand_is_blk_cleanmarker(pchip, page_addr, 0) ) + { + UINT32 i; + + if(size > len) + size = len; + + do + { + for( i = 0, ret = FLASH_API_OK; i < pchip->chip_page_size && + ret == FLASH_API_OK; i += CTRLR_CACHE_SIZE) + { + /* clear interrupts, so we can check later for ECC errors */ + NAND_INTR->NandInterrupt = NINT_STS_MASK; + + /* send command */ + NAND->NandCmdAddr = pchip->chip_base + page_addr + i; + NAND->NandCmdExtAddr = 0; + NAND->NandCmdStart = NCMD_PAGE_READ; + + if( (ret = nandflash_wait_cmd()) == FLASH_API_OK ) + { + /* wait until data is available in the cache */ + if( (ret = nandflash_wait_cache()) == FLASH_API_OK ) + { + /* TBD. get return status for ECC errors and + * process them. + */ + nandflash_check_ecc(); /* check for ECC errors */ + } + + if( ret == FLASH_API_OK ) + { + if( i < size ) + { + UINT32 copy_size = + (i + CTRLR_CACHE_SIZE <= size) + ? CTRLR_CACHE_SIZE : size - i; + + nandflash_copy_from_cache(&buffer[index + i], + page_offset, copy_size); + } + } + else + { + /* TBD. Do something. */ + } + } + } + + if(ret != FLASH_API_OK) + break; + + page_offset = 0; + page_addr += pchip->chip_page_size; + index += size; + len -= size; + if(len > pchip->chip_page_size) + size = pchip->chip_page_size; + else + size = len; + } while(len); + } + else + { + DBG_PRINTF("nandflash_read_page: cleanmarker not found at 0x%8.8lx\n", + page_addr); + } + } + + return( ret ) ; +} /* nandflash_read_page */ + +#if defined(CFG_RAMAPP) +/*************************************************************************** + * Function Name: nandflash_write_page + * Description : Writes up to a NAND block of pages from the specified buffer. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_write_page(PCFE_NAND_CHIP pchip, unsigned long start_addr, + unsigned char *buffer, int len) +{ + int ret = FLASH_API_ERROR; + + if( len <= pchip->chip_block_size ) + { + unsigned char xfer_buf[CTRLR_CACHE_SIZE]; + UINT32 page_addr = start_addr & ~(pchip->chip_page_size - 1); + UINT32 page_offset = start_addr - page_addr; + UINT32 size = pchip->chip_page_size - page_offset; + UINT32 index = 0; + + /* Verify that the spare area contains a JFFS2 cleanmarker. */ + if( nand_is_blk_cleanmarker(pchip, page_addr, 1) ) + { + UINT32 steps = pchip->chip_page_size / CTRLR_CACHE_SIZE; + UINT32 i, xfer_ofs, xfer_size; + + if(size > len) + size = len; + + do + { + for( i = 0, xfer_ofs = 0, xfer_size = 0, ret = FLASH_API_OK; + i < steps && ret==FLASH_API_OK; i++) + { + memset(xfer_buf, 0xff, sizeof(xfer_buf)); + + if(size - xfer_ofs > CTRLR_CACHE_SIZE) + xfer_size = CTRLR_CACHE_SIZE; + else + xfer_size = size - xfer_ofs; + + if( xfer_size ) + memcpy(xfer_buf + page_offset, buffer + index + + xfer_ofs, xfer_size); + + xfer_ofs += xfer_size; + + NAND->NandCmdAddr = pchip->chip_base + page_addr + + (i * CTRLR_CACHE_SIZE); + NAND->NandCmdExtAddr = 0; + + nandflash_copy_to_cache(xfer_buf, 0, CTRLR_CACHE_SIZE); + + NAND->NandCmdStart = NCMD_PROGRAM_PAGE; + if( (ret = nandflash_wait_cmd()) == FLASH_API_OK ) + { + unsigned long sts = NAND->NandIntfcStatus; + + if( (sts & NIS_PGM_ERASE_ERROR) != 0 ) + { + printf("Error writing to block, sts=0x%8.8lx\n", sts); + nand_mark_bad_blk(pchip, + start_addr & ~(pchip->chip_page_size - 1)); + ret = FLASH_API_ERROR; + } + } + } + + if(ret != FLASH_API_OK) + break; + + page_offset = 0; + page_addr += pchip->chip_page_size; + index += size; + len -= size; + if(len > pchip->chip_page_size) + size = pchip->chip_page_size; + else + size = len; + } while(len); + } + else + DBG_PRINTF("nandflash_write_page: cleanmarker not found at 0x%8.8lx\n", + page_addr); + } + + return( ret ); +} /* nandflash_write_page */ + +/*************************************************************************** + * Function Name: nandflash_block_erase + * Description : Erases a block. + * Returns : FLASH_API_OK or FLASH_API_ERROR + ***************************************************************************/ +static int nandflash_block_erase(PCFE_NAND_CHIP pchip, unsigned long blk_addr ) +{ + + int ret = FLASH_API_OK; + + /* send command */ + NAND->NandCmdAddr = pchip->chip_base + blk_addr; + NAND->NandCmdExtAddr = 0; + NAND->NandCmdStart = NCMD_BLOCK_ERASE; + if( (ret = nandflash_wait_cmd()) == FLASH_API_OK ) + { + unsigned long sts = NAND->NandIntfcStatus; + + if( (sts & NIS_PGM_ERASE_ERROR) != 0 ) + { + printf("Error erasing block 0x%8.8lx, sts=0x%8.8lx\n", + blk_addr, sts); + nand_mark_bad_blk(pchip, blk_addr); + ret = FLASH_API_ERROR; + } + } + + DBG_PRINTF(">> nandflash_block_erase - addr=0x%8.8lx, ret=%d\n", blk_addr, + ret); + + return( ret ); +} /* nandflash_block_erase */ + +void dump_spare(void); +void dump_spare(void) +{ + PCFE_NAND_CHIP pchip = &g_chip; + unsigned char spare[SPARE_MAX_SIZE]; + unsigned long i; + + for( i = 0; i < pchip->chip_total_size; i += pchip->chip_block_size ) + { + if( nandflash_read_spare_area(pchip, i, spare, + pchip->chip_spare_size) == FLASH_API_OK ) + { + printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i, + *(unsigned long *) &spare[0], *(unsigned long *) &spare[4], + *(unsigned long *) &spare[8], *(unsigned long *) &spare[12]); + if( pchip->chip_spare_size == SPARE_MAX_SIZE ) + { + printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i, + *(unsigned long *)&spare[16],*(unsigned long *)&spare[20], + *(unsigned long *)&spare[24],*(unsigned long *)&spare[28]); + printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i, + *(unsigned long *)&spare[32],*(unsigned long *)&spare[36], + *(unsigned long *)&spare[40],*(unsigned long *)&spare[44]); + printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i, + *(unsigned long *)&spare[48],*(unsigned long *)&spare[52], + *(unsigned long *)&spare[56],*(unsigned long *)&spare[60]); + } + } + else + printf("Error reading spare 0x%8.8lx\n", i); + } +} + +int read_spare_data(int blk, unsigned char *buf, int bufsize); +int read_spare_data(int blk, unsigned char *buf, int bufsize) +{ + PCFE_NAND_CHIP pchip = &g_chip; + unsigned char spare[SPARE_MAX_SIZE]; + unsigned long page_addr = blk * pchip->chip_block_size; + unsigned long i, j; + int ret; + + if( (ret = nandflash_read_spare_area( pchip, page_addr, spare, + pchip->chip_spare_size)) == FLASH_API_OK ) + { + /* Skip spare offsets that are reserved for the ECC. Make spare data + * bytes contiguous in the spare buffer. + */ + for( i = 0, j = 0; i < pchip->chip_spare_size; i++ ) + if( pchip->chip_spare_mask[i] == 0 && j < bufsize ) + buf[j++] = spare[i]; + } + + return(ret); +} + +#endif + diff --git a/shared/opensource/flash/spiflash.c b/shared/opensource/flash/spiflash.c new file mode 100755 index 0000000..38f4648 --- /dev/null +++ b/shared/opensource/flash/spiflash.c @@ -0,0 +1,969 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/** Includes. **/ +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "bcm_map.h" +#define printk printf +#else // linux +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) +#include +#endif +#include + +#include +#endif + +#include "bcmtypes.h" +#include "bcm_hwdefs.h" +#include "flash_api.h" +#include "bcmSpiRes.h" + + +/** Defines. **/ +#define OSL_DELAY(X) \ + do { { int i; for( i = 0; i < (X) * 500; i++ ) ; } } while(0) + +#define MAX_RETRY 3 + +#ifndef NULL +#define NULL 0 +#endif + +#define MAXSECTORS 8192 /* maximum number of sectors supported */ + +#define FLASH_PAGE_256 256 +#define SECTOR_SIZE_4K (4 * 1024) +#define SECTOR_SIZE_64K (64 * 1024) + +/* Standard Boolean declarations */ +#define TRUE 1 +#define FALSE 0 + +/* Command codes for the flash_command routine */ +#define FLASH_WRST 0x01 /* write status register */ +#define FLASH_PROG 0x02 /* program data into memory array */ +#define FLASH_READ 0x03 /* read data from memory array */ +#define FLASH_WRDI 0x04 /* reset write enable latch */ +#define FLASH_RDSR 0x05 /* read status register */ +#define FLASH_WREN 0x06 /* set write enable latch */ +#define FLASH_READ_FAST 0x0B /* read data from memory array */ +#define FLASH_SERASE 0x20 /* erase one sector in memory array */ +#define FLASH_BERASE 0xD8 /* erase one block in memory array */ +#define FLASH_RDID 0x9F /* read manufacturer and product id */ +#define FLASH_EN4B 0xB7 /* Enable 4 byte address mode */ + +/* RDSR return status bit definition */ +#define SR_WPEN 0x80 +#define SR_BP3 0x20 +#define SR_BP2 0x10 +#define SR_BP1 0x08 +#define SR_BP0 0x04 +#define SR_WEN 0x02 +#define SR_RDY 0x01 + +/* Return codes from flash_status */ +#define STATUS_READY 0 /* ready for action */ +#define STATUS_BUSY 1 /* operation in progress */ +#define STATUS_TIMEOUT 2 /* operation timed out */ +#define STATUS_ERROR 3 /* unclassified but unhappy status */ + +/* Define different type of flash */ +#define FLASH_UNDEFINED 0 +#define FLASH_SPAN 2 + +/* SST's manufacturer ID */ +#define SSTPART 0xBF +/* A list of SST device IDs */ +#define ID_SST25VF016 0x41 +#define ID_SST25VF032 0x4A +#define ID_SST25VF064 0x4B + +/* SPANSION manufacturer IDs */ +#define SPANPART 0x01 +/* SPANSION device ID's */ +#define ID_SPAN25FL016 0x14 +#define ID_SPAN25FL032 0x15 +#define ID_SPAN25FL064 0x16 +#define ID_SPAN25FL128 0x18 + +/* EON manufacturer ID */ +#define EONPART 0x1C +/* NUMONYX manufacturer ID */ +#define NUMONYXPART 0x20 +/* AMIC manufacturer ID */ +#define AMICPART 0x37 +/* Macronix manufacturer ID */ +#define MACRONIXPART 0xC2 +/* Winbond's manufacturer ID */ +#define WBPART 0xEF + +/* JEDEC device IDs */ +#define ID_M25P16 0x15 +#define ID_M25P32 0x16 +#define ID_M25P64 0x17 +#define ID_M25P128 0x18 +#define ID_M25P256 0x19 + +#define SPI_MAKE_ID(A,B) \ + (((unsigned short) (A) << 8) | ((unsigned short) B & 0xff)) + +#define SPI_FLASH_DEVICES \ + {{SPI_MAKE_ID(SSTPART, ID_SST25VF016), "SST25VF016"}, \ + {SPI_MAKE_ID(SSTPART, ID_SST25VF032), "SST25VF032"}, \ + {SPI_MAKE_ID(SSTPART, ID_SST25VF064), "SST25VF064"}, \ + {SPI_MAKE_ID(SPANPART, ID_SPAN25FL016), "S25FL016"}, \ + {SPI_MAKE_ID(SPANPART, ID_SPAN25FL032), "S25FL032"}, \ + {SPI_MAKE_ID(SPANPART, ID_SPAN25FL064), "S25FL064"}, \ + {SPI_MAKE_ID(SPANPART, ID_SPAN25FL128), "S25FL128"}, \ + {SPI_MAKE_ID(WBPART, ID_M25P16), "ID_W25X16"}, \ + {SPI_MAKE_ID(WBPART, ID_M25P32), "ID_W25X32"}, \ + {SPI_MAKE_ID(WBPART, ID_M25P64), "ID_W25X64"}, \ + {SPI_MAKE_ID(WBPART, ID_M25P128), "ID_W25X128"}, \ + {SPI_MAKE_ID(EONPART, ID_M25P16), "EN25P16"}, \ + {SPI_MAKE_ID(EONPART, ID_M25P32), "EN25P32"}, \ + {SPI_MAKE_ID(EONPART, ID_M25P64), "EN25P64"}, \ + {SPI_MAKE_ID(EONPART, ID_M25P128), "EN25P128"}, \ + {SPI_MAKE_ID(AMICPART, ID_M25P16), "A25L016"}, \ + {SPI_MAKE_ID(AMICPART, ID_M25P32), "A25L032"}, \ + {SPI_MAKE_ID(NUMONYXPART, ID_M25P16), "NMNXM25P16"}, \ + {SPI_MAKE_ID(NUMONYXPART, ID_M25P32), "NMNXM25P32"}, \ + {SPI_MAKE_ID(NUMONYXPART, ID_M25P64), "NMNXM25P64"}, \ + {SPI_MAKE_ID(NUMONYXPART, ID_M25P128), "NMNXM25P128"}, \ + {SPI_MAKE_ID(MACRONIXPART, ID_M25P16), "MX25L16"}, \ + {SPI_MAKE_ID(MACRONIXPART, ID_M25P32), "MX25L32"}, \ + {SPI_MAKE_ID(MACRONIXPART, ID_M25P64), "MX25L64"}, \ + {SPI_MAKE_ID(MACRONIXPART, ID_M25P128), "MX25L128"}, \ + {SPI_MAKE_ID(MACRONIXPART, ID_M25P256), "MX25L256"}, \ + {0,""} \ + } + +/** Structs. **/ +/* A structure for identifying a flash part. There is one for each + * of the flash part definitions. We need to keep track of the + * sector organization, the address register used, and the size + * of the sectors. + */ +struct flashinfo { + char *name; /* "AT25F512", etc. */ + unsigned long addr; /* physical address, once translated */ + int nsect; /* # of sectors */ + struct { + long size; /* # of bytes in this sector */ + long base; /* offset from beginning of device */ + } sec[MAXSECTORS]; /* per-sector info */ +}; + +struct flash_name_from_id { + unsigned short fnfi_id; + char fnfi_name[30]; +}; + + +/** Prototypes. **/ +static int my_spi_read( unsigned char *msg_buf, int prependcnt, int nbytes ); +static int my_spi_write( unsigned char *msg_buf, int nbytes ); + +int spi_flash_init(flash_device_info_t **flash_info); +static int spi_flash_sector_erase_int(unsigned short sector); +static int spi_flash_reset(void); +static int spi_flash_read_buf(unsigned short sector, int offset, + unsigned char *buffer, int nbytes); +static int spi_flash_ub(unsigned short sector); +static int spi_flash_write(unsigned short sector, int offset, + unsigned char *buffer, int nbytes); +static int spi_flash_write_buf(unsigned short sector, int offset, + unsigned char *buffer, int nbytes); +static int spi_flash_get_numsectors(void); +static int spi_flash_get_sector_size(unsigned short sector); +static unsigned char *spi_get_flash_memptr(unsigned short sector); +static unsigned char *spi_flash_get_memptr(unsigned short sector); +static int spi_flash_status(void); +static unsigned short spi_flash_get_device_id(unsigned short sector); +static int spi_flash_get_blk(int addr); +static int spi_flash_get_total_size(void); +static int spi_flash_en4b(void); + +/** Variables. **/ +static flash_device_info_t flash_spi_dev = + { + 0xffff, + FLASH_IFC_SPI, + "", + spi_flash_sector_erase_int, + spi_flash_read_buf, + spi_flash_write_buf, + spi_flash_get_numsectors, + spi_flash_get_sector_size, + spi_flash_get_memptr, + spi_flash_get_blk, + spi_flash_get_total_size + }; + +static struct flash_name_from_id fnfi[] = SPI_FLASH_DEVICES; + +/* the controller will handle operati0ns that are greater than the FIFO size + code that relies on READ_BUF_LEN_MAX, READ_BUF_LEN_MIN or spi_max_op_len + could be changed */ +#define READ_BUF_LEN_MAX 544 /* largest of the maximum transaction sizes for SPI */ +#define READ_BUF_LEN_MIN 60 /* smallest of the maximum transaction sizes for SPI */ +/* this is the slave ID of the SPI flash for use with the SPI controller */ +#define SPI_FLASH_SLAVE_DEV_ID 0 +/* clock defines for the flash */ +#define SPI_FLASH_DEF_CLOCK 781000 + +/* default to smallest transaction size - updated later */ +static int spi_max_op_len = READ_BUF_LEN_MIN; +static int fastRead = TRUE; +static int flash_page_size = FLASH_PAGE_256; + +/* default to legacy controller - updated later */ +static int spi_flash_clock = SPI_FLASH_DEF_CLOCK; +static int spi_flash_busnum = LEG_SPI_BUS_NUM; + +#ifndef _CFE_ +static DECLARE_MUTEX(spi_flash_lock); +static bool bSpiFlashSlaveRes = FALSE; +#endif + +static struct flashinfo meminfo; /* Flash information structure */ +static int totalSize = 0; +static int addr32 = FALSE; + +static int my_spi_read(unsigned char *msg_buf, int prependcnt, int nbytes) +{ + int status; + +#ifndef _CFE_ + if ( FALSE == bSpiFlashSlaveRes ) +#endif + { + status = BcmSpi_Read(msg_buf, prependcnt, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock); + } +#ifndef _CFE_ + else + { + /* the Linux SPI framework provides a non blocking mechanism for SPI transfers. While waiting for a spi + transaction to complete the kernel will look to see if another process can run. This scheduling + can only occur if kernel preemption is active. The SPI flash interfaces can be run when kernel + preemption is enabled or disabled. When kernel preemption is disabled we cannot use the framework */ + if ( in_atomic() ) + status = BcmSpi_Read(msg_buf, prependcnt, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock); + else + status = BcmSpiSyncTrans(NULL, msg_buf, prependcnt, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID); + } +#endif + + return status; +} + +static int my_spi_write(unsigned char *msg_buf, int nbytes) +{ + int status; + +#ifndef _CFE_ + if ( FALSE == bSpiFlashSlaveRes ) +#endif + { + status = BcmSpi_Write(msg_buf, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock); + } +#ifndef _CFE_ + else + { + /* the Linux SPI framework provides a non blocking mechanism for SPI transfers. While waiting for a spi + transaction to complete the kernel will look to see if another process can run. This scheduling + can only occur if kernel preemtion is active. The SPI flash interfaces can be run when kernel + preemption is enabled or disabled. When kernel preemption is disabled we cannot use the framework */ + if ( in_atomic() ) + status = BcmSpi_Write(msg_buf, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock); + else + status = BcmSpiSyncTrans(msg_buf, NULL, 0, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID); + } +#endif + return status; +} + + +/*********************************************************************/ +/* Init_flash is used to build a sector table. This information is */ +/* translated from erase_block information to base:offset information*/ +/* for each individual sector. This information is then stored */ +/* in the meminfo structure, and used throughout the driver to access*/ +/* sector information. */ +/* */ +/* This is more efficient than deriving the sector base:offset */ +/* information every time the memory map switches (since on the */ +/* development platform can only map 64k at a time). If the entire */ +/* flash memory array can be mapped in, then the addition static */ +/* allocation for the meminfo structure can be eliminated, but the */ +/* drivers will have to be re-written. */ +/* */ +/* The meminfo struct occupies 44 bytes of heap space, depending */ +/* on the value of the define MAXSECTORS. Adjust to suit */ +/* application */ +/*********************************************************************/ + +int spi_flash_init(flash_device_info_t **flash_info) +{ + struct flash_name_from_id *fnfi_ptr; + int i=0, count=0; + int basecount=0L; + unsigned short device_id; + int sectorsize = 0; + int numsector = 0; + +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) + uint32 miscStrapBus = MISC->miscStrapBus; + + if ( miscStrapBus & MISC_STRAP_BUS_LS_SPIM_ENABLED ) + { + spi_flash_busnum = LEG_SPI_BUS_NUM; + if ( miscStrapBus & MISC_STRAP_BUS_SPI_CLK_FAST ) + { + spi_flash_clock = 20000000; + } + else + { + spi_flash_clock = 781000; + } + } + else + { + spi_flash_busnum = HS_SPI_BUS_NUM; + if ( miscStrapBus & MISC_STRAP_BUS_SPI_CLK_FAST ) + { + spi_flash_clock = 40000000; + } + else + { + spi_flash_clock = 20000000; + } + } +#endif +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362) + spi_flash_busnum = HS_SPI_BUS_NUM; + spi_flash_clock = 40000000; +#endif +#if defined(_BCM96368_) || defined(CONFIG_BCM96368) + uint32 miscStrapBus = GPIO->StrapBus; + + if ( miscStrapBus & (1 << 6) ) + spi_flash_clock = 20000000; + else + spi_flash_clock = 781000; +#endif + + /* retrieve the maximum read/write transaction length from the SPI controller */ + spi_max_op_len = BcmSpi_GetMaxRWSize( spi_flash_busnum ); + + if (HS_SPI_BUS_NUM == spi_flash_busnum) + flash_spi_dev.flash_type = FLASH_IFC_HS_SPI; + + *flash_info = &flash_spi_dev; + +#if 0 + /* + * in case of flash corrupt, the following steps can erase the flash + * 1. jumper USE_SPI_SLAVE to make SPI in slave mode + * 2. start up JTAG debuger and remove the USE_SPI_SLAVE jumper + * 3. run the following code to erase the flash + */ + flash_sector_erase_int(0); + flash_sector_erase_int(1); + printk("flash_init: erase all sectors\n"); + return FLASH_API_OK; +#endif + + flash_spi_dev.flash_device_id = device_id = spi_flash_get_device_id(0); + + switch( device_id >> 8 ) { + case SSTPART: + sectorsize = SECTOR_SIZE_4K; + switch ((unsigned char)(device_id & 0x00ff)) { + case ID_SST25VF016: + numsector = 512; + break; + case ID_SST25VF032: + numsector = 1024; + break; + case ID_SST25VF064: + numsector = 2048; + break; + } + break; + + case SPANPART: + sectorsize = SECTOR_SIZE_64K; + switch ((unsigned short)(device_id & 0x00ff)) { + case ID_SPAN25FL016: + numsector = 32; + break; + case ID_SPAN25FL032: + numsector = 64; + break; + case ID_SPAN25FL064: + numsector = 128; + break; + case ID_SPAN25FL128: + numsector = 256; + break; + } + break; + + case EONPART: + sectorsize = SECTOR_SIZE_64K; + switch ((unsigned short)(device_id & 0x00ff)) { + case ID_M25P16: + numsector = 32; + break; + case ID_M25P32: + numsector = 64; + break; + case ID_M25P64: + numsector = 128; + break; + case ID_M25P128: + numsector = 256; + break; + } + break; + + case NUMONYXPART: + case MACRONIXPART: + case WBPART: + case AMICPART: + sectorsize = SECTOR_SIZE_4K; + switch ((unsigned short)(device_id & 0x00ff)) { + case ID_M25P16: + numsector = 512; + break; + case ID_M25P32: + numsector = 1024; + break; + case ID_M25P64: + numsector = 2048; + break; + case ID_M25P128: + numsector = 4096; + break; + case ID_M25P256: + addr32 = TRUE; + numsector = 8192; + break; + } + break; + + default: + meminfo.addr = 0L; + meminfo.nsect = 1; + meminfo.sec[0].size = SECTOR_SIZE_4K; + meminfo.sec[0].base = 0x00000; + return FLASH_API_ERROR; + } + + if ( addr32 ) { + /* Enable 4 byte mode */ + spi_flash_en4b(); + } + + meminfo.addr = 0L; + meminfo.nsect = numsector; + for (i = 0; i < numsector; i++) { + meminfo.sec[i].size = sectorsize; + meminfo.sec[i].base = basecount; + basecount += meminfo.sec[i].size; + count++; + } + totalSize = meminfo.sec[count-1].base + meminfo.sec[count-1].size; + + for( fnfi_ptr = fnfi; fnfi_ptr->fnfi_id != 0; fnfi_ptr++ ) { + if( fnfi_ptr->fnfi_id == device_id ) { + strcpy( flash_spi_dev.flash_device_name, fnfi_ptr->fnfi_name ); + break; + } + } + + if ( fastRead ) + BcmSpi_SetFlashCtrl(FLASH_READ_FAST, 1, 1, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID); + else + BcmSpi_SetFlashCtrl(FLASH_READ, 1, 0, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID); + + return (FLASH_API_OK); +} + +/*********************************************************************/ +/* Flash_sector_erase_int() wait until the erase is completed before */ +/* returning control to the calling function. This can be used in */ +/* cases which require the program to hold until a sector is erased, */ +/* without adding the wait check external to this function. */ +/*********************************************************************/ + +static int spi_flash_sector_erase_int(unsigned short sector) +{ + unsigned char buf[6]; + unsigned int cmd_length; + unsigned int addr; + +#ifndef _CFE_ + down(&spi_flash_lock); +#endif + + /* set device to write enabled */ + spi_flash_ub(sector); + + /* erase the sector */ + addr = (unsigned int) spi_get_flash_memptr(sector); + + cmd_length = 0; + if (meminfo.sec[sector].size == SECTOR_SIZE_4K) + buf[cmd_length++] = FLASH_SERASE; + else + buf[cmd_length++] = FLASH_BERASE; + + if ( addr32 ) + buf[cmd_length++] = (unsigned char)((addr & 0xff000000) >> 24); + buf[cmd_length++] = (unsigned char)((addr & 0x00ff0000) >> 16); + buf[cmd_length++] = (unsigned char)((addr & 0x0000ff00) >> 8); + buf[cmd_length++] = (unsigned char)(addr & 0x000000ff); + + /* check device is ready */ + if (my_spi_write(buf, cmd_length) == SPI_STATUS_OK) { + while (spi_flash_status() != STATUS_READY); + } + + spi_flash_reset(); + +#ifndef _CFE_ + up(&spi_flash_lock); +#endif + + return(FLASH_API_OK); +} + +/*********************************************************************/ +/* flash_reset() will reset the flash device to reading array data. */ +/* It is good practice to call this function after autoselect */ +/* sequences had been performed. */ +/*********************************************************************/ + +static int spi_flash_en4b(void) +{ + unsigned char buf[4]; + + /* set device to write disabled */ + buf[0] = FLASH_EN4B; + my_spi_write(buf, 1); + while (spi_flash_status() != STATUS_READY); + + return(FLASH_API_OK); +} + +/*********************************************************************/ +/* flash_reset() will reset the flash device to reading array data. */ +/* It is good practice to call this function after autoselect */ +/* sequences had been performed. */ +/*********************************************************************/ + +static int spi_flash_reset(void) +{ + unsigned char buf[4]; + + /* set device to write disabled */ + buf[0] = FLASH_WRDI; + my_spi_write(buf, 1); + while (spi_flash_status() != STATUS_READY); + + return(FLASH_API_OK); +} + +/*********************************************************************/ +/* flash_read_buf() reads buffer of data from the specified */ +/* offset from the sector parameter. */ +/*********************************************************************/ + +static int spi_flash_read_buf(unsigned short sector, int offset, + unsigned char *buffer, int nbytes) +{ + unsigned char buf[READ_BUF_LEN_MAX]; + unsigned int cmd_length; + unsigned int addr; + int maxread; + +#ifndef _CFE_ + down(&spi_flash_lock); +#endif + + addr = (unsigned int) spi_get_flash_memptr(sector); + addr += offset; + + while (nbytes > 0) { + maxread = (nbytes < spi_max_op_len) ? nbytes : spi_max_op_len; + + cmd_length = 0; + if ( fastRead ) + buf[cmd_length++] = FLASH_READ_FAST; + else + buf[cmd_length++] = FLASH_READ; + if ( addr32 ) + buf[cmd_length++] = (unsigned char)((addr & 0xff000000) >> 24); + buf[cmd_length++] = (unsigned char)((addr & 0x00ff0000) >> 16); + buf[cmd_length++] = (unsigned char)((addr & 0x0000ff00) >> 8); + buf[cmd_length++] = (unsigned char)(addr & 0x000000ff); + + /* Send dummy byte for Fast Read */ + if ( fastRead ) + buf[cmd_length++] = (unsigned char)0xff; + + my_spi_read(buf, cmd_length, maxread); + + while (spi_flash_status() != STATUS_READY); + + memcpy(buffer, buf, maxread); + buffer += maxread; + nbytes -= maxread; + addr += maxread; + } + +#ifndef _CFE_ + up(&spi_flash_lock); +#endif + + return (FLASH_API_OK); +} + +/*********************************************************************/ +/* flash_ub() places the flash into unlock bypass mode. This */ +/* is REQUIRED to be called before any of the other unlock bypass */ +/* commands will become valid (most will be ignored without first */ +/* calling this function. */ +/*********************************************************************/ + +static int spi_flash_ub(unsigned short sector) +{ + unsigned char buf[4]; + + do { + buf[0] = FLASH_RDSR; + if (my_spi_read(buf, 1, 1) == SPI_STATUS_OK) { + while (spi_flash_status() != STATUS_READY); + if (buf[0] & (SR_BP3|SR_BP2|SR_BP1|SR_BP0)) { + /* Sector is write protected. Unprotect it */ + buf[0] = FLASH_WREN; + if (my_spi_write(buf, 1) == SPI_STATUS_OK) { + buf[0] = FLASH_WRST; + buf[1] = 0; + if (my_spi_write(buf, 2) == SPI_STATUS_OK) + while (spi_flash_status() != STATUS_READY); + } + } + else { + break; + } + } + else { + break; + } + } while (1); + + /* set device to write enabled */ + buf[0] = FLASH_WREN; + + /* check device is ready */ + if (my_spi_write(buf, 1) == SPI_STATUS_OK) { + while (spi_flash_status() != STATUS_READY); + do { + buf[0] = FLASH_RDSR; + if (my_spi_read(buf, 1, 1) == SPI_STATUS_OK) { + while (spi_flash_status() != STATUS_READY); + if (buf[0] & SR_WEN) { + break; + } + } + else { + break; + } + } while (1); + } + + return(FLASH_API_OK); +} + +/*********************************************************************/ +/* flash_write_buf() utilizes */ +/* the unlock bypass mode of the flash device. This can remove */ +/* significant overhead from the bulk programming operation, and */ +/* when programming bulk data a sizeable performance increase can be */ +/* observed. */ +/*********************************************************************/ + +static int spi_flash_write(unsigned short sector, int offset, + unsigned char *buffer, int nbytes) +{ + unsigned char buf[FLASH_PAGE_256 + 6]; + unsigned int cmd_length; + unsigned int addr; + int maxwrite; + int pagelimit; + int bytes_written = 0; + +#ifndef _CFE_ + down(&spi_flash_lock); +#endif + + addr = (unsigned int) spi_get_flash_memptr(sector); + addr += offset; + + while (nbytes > 0) { + spi_flash_ub(sector); /* enable write */ + + cmd_length = 0; + buf[cmd_length++] = FLASH_PROG; + if ( addr32 ) + buf[cmd_length++] = (unsigned char)((addr & 0xff000000) >> 24); + buf[cmd_length++] = (unsigned char)((addr & 0x00ff0000) >> 16); + buf[cmd_length++] = (unsigned char)((addr & 0x0000ff00) >> 8); + buf[cmd_length++] = (unsigned char)(addr & 0x000000ff); + + /* set length to the smaller of controller limit (spi_max_op_len) or nbytes + spi_max_op_len considers both controllers */ + maxwrite = (nbytes < (spi_max_op_len - cmd_length)) ? nbytes : (spi_max_op_len - cmd_length); + /* maxwrite is limit to page boundary */ + pagelimit = flash_page_size - (addr & (flash_page_size - 1)); + maxwrite = (maxwrite < pagelimit) ? maxwrite : pagelimit; + + memcpy(&buf[cmd_length], buffer, maxwrite); + my_spi_write(buf, maxwrite + cmd_length); + + while (spi_flash_status() != STATUS_READY); + + buffer += maxwrite; + nbytes -= maxwrite; + addr += maxwrite; + bytes_written += maxwrite; + } + + spi_flash_reset(); + +#ifndef _CFE_ + up(&spi_flash_lock); +#endif + + return( bytes_written ); +} + +/*********************************************************************/ +/* flash_write_buf() utilizes */ +/* the unlock bypass mode of the flash device. This can remove */ +/* significant overhead from the bulk programming operation, and */ +/* when programming bulk data a sizeable performance increase can be */ +/* observed. */ +/*********************************************************************/ +static int spi_flash_write_buf(unsigned short sector, int offset, + unsigned char *buffer, int nbytes) +{ + int ret; + + ret = spi_flash_write(sector, offset, buffer, nbytes); + + if( ret == FLASH_API_ERROR ) + printk( "Flash write error. Verify failed\n" ); + + return( ret ); +} + +/*********************************************************************/ +/* Usefull funtion to return the number of sectors in the device. */ +/* Can be used for functions which need to loop among all the */ +/* sectors, or wish to know the number of the last sector. */ +/*********************************************************************/ + +static int spi_flash_get_numsectors(void) +{ + return meminfo.nsect; +} + +/*********************************************************************/ +/* flash_get_sector_size() is provided for cases in which the size */ +/* of a sector is required by a host application. The sector size */ +/* (in bytes) is returned in the data location pointed to by the */ +/* 'size' parameter. */ +/*********************************************************************/ + +static int spi_flash_get_sector_size(unsigned short sector) +{ + return meminfo.sec[sector].size; +} + +/*********************************************************************/ +/* The purpose of get_flash_memptr() is to return a memory pointer */ +/* which points to the beginning of memory space allocated for the */ +/* flash. All function pointers are then referenced from this */ +/* pointer. */ +/* */ +/* Different systems will implement this in different ways: */ +/* possibilities include: */ +/* - A direct memory pointer */ +/* - A pointer to a memory map */ +/* - A pointer to a hardware port from which the linear */ +/* address is translated */ +/* - Output of an MMU function / service */ +/* */ +/* Also note that this function expects the pointer to a specific */ +/* sector of the device. This can be provided by dereferencing */ +/* the pointer from a translated offset of the sector from a */ +/* global base pointer (e.g. flashptr = base_pointer + sector_offset)*/ +/* */ +/* Important: Many AMD flash devices need both bank and or sector */ +/* address bits to be correctly set (bank address bits are A18-A16, */ +/* and sector address bits are A18-A12, or A12-A15). Flash parts */ +/* which do not need these bits will ignore them, so it is safe to */ +/* assume that every part will require these bits to be set. */ +/*********************************************************************/ + +static unsigned char *spi_get_flash_memptr(unsigned short sector) +{ + unsigned char *memptr = (unsigned char*) + (FLASH_BASE + meminfo.sec[sector].base); + + return (memptr); +} + +static unsigned char *spi_flash_get_memptr(unsigned short sector) +{ + return( spi_get_flash_memptr(sector) ); +} + +/*********************************************************************/ +/* Flash_status return an appropriate status code */ +/*********************************************************************/ + +static int spi_flash_status(void) +{ + unsigned char buf[4]; + int retry = 10; + + /* check device is ready */ + do { + buf[0] = FLASH_RDSR; + if (my_spi_read(buf, 1, 1) == SPI_STATUS_OK) { + if (!(buf[0] & SR_RDY)) { + return STATUS_READY; + } + } else { + return STATUS_ERROR; + } + OSL_DELAY(10); + } while (retry--); + + return STATUS_TIMEOUT; +} + +/*********************************************************************/ +/* flash_get_device_id() return the device id of the component. */ +/*********************************************************************/ + +static unsigned short spi_flash_get_device_id(unsigned short sector) +{ + unsigned char buf[4]; + + buf[0] = FLASH_RDID; + my_spi_read(buf, 1, 3); + while (spi_flash_status() != STATUS_READY); + buf[1] = buf[2]; + + /* return manufacturer code and device code */ + return( *(unsigned short *)&buf[0] ); +} + +/*********************************************************************/ +/* The purpose of flash_get_blk() is to return a the block number */ +/* for a given memory address. */ +/*********************************************************************/ + +static int spi_flash_get_blk(int addr) +{ + int blk_start, i; + int last_blk = spi_flash_get_numsectors(); + int relative_addr = addr - (int) FLASH_BASE; + + for(blk_start=0, i=0; i < relative_addr && blk_start < last_blk; blk_start++) + i += spi_flash_get_sector_size(blk_start); + + if( (unsigned int)i > (unsigned int)relative_addr ) { + blk_start--; // last blk, dec by 1 + } else { + if( blk_start == last_blk ) + { + printk("Address is too big.\n"); + blk_start = -1; + } + } + + return( blk_start ); +} + +/************************************************************************/ +/* The purpose of flash_get_total_size() is to return the total size of */ +/* the flash */ +/************************************************************************/ +static int spi_flash_get_total_size(void) +{ + return totalSize; +} + + +#ifndef _CFE_ +static int __init BcmSpiflash_init(void) +{ + int flashType; + + /* If serial flash is present then register the device. Otherwise do nothing */ + flashType = flash_get_flash_type(); + if ((FLASH_IFC_SPI == flashType) || (FLASH_IFC_HS_SPI == flashType)) + { + /* register the device */ + BcmSpiReserveSlave(spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock); + bSpiFlashSlaveRes = TRUE; + } + + return 0; +} +module_init(BcmSpiflash_init); + +static void __exit BcmSpiflash_exit(void) +{ + bSpiFlashSlaveRes = FALSE; +} +module_exit(BcmSpiflash_exit); +#endif + diff --git a/shared/opensource/include/bcm963xx/6328_cpu.h b/shared/opensource/include/bcm963xx/6328_cpu.h new file mode 100755 index 0000000..8dfef4c --- /dev/null +++ b/shared/opensource/include/bcm963xx/6328_cpu.h @@ -0,0 +1,150 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifndef __BCM6328_CPU_H +#define __BCM6328_CPU_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* +#************************************************************************ +#* Coprocessor 0 Register Names +#************************************************************************ +*/ +#define C0_BCM_CONFIG $22 + +/* +# Select 1 +# Bit 31: unused +# Bits 30:25 MMU Size (Num TLB entries-1) +# Bits 24:22 ICache sets/way (2^n * 64) +# Bits 21:19 ICache Line size (2^(n+1) bytes) 0=No Icache +# Bits 18:16 ICache Associativity (n+1) way +# Bits 15:13 DCache sets/way (2^n * 64) +# Bits 12:10 DCache Line size (2^(n+1) bytes) 0=No Dcache +# Bits 9:7 DCache Associativity (n+1) way +# Bits 6:4 unused +# Bit 3: 1=At least 1 watch register +# Bit 2: 1=MIPS16 code compression implemented +# Bit 1: 1=EJTAG implemented +# Bit 0: 1=FPU implemented +*/ +#define CP0_CFG_ISMSK (0x7 << 22) +#define CP0_CFG_ISSHF 22 +#define CP0_CFG_ILMSK (0x7 << 19) +#define CP0_CFG_ILSHF 19 +#define CP0_CFG_IAMSK (0x7 << 16) +#define CP0_CFG_IASHF 16 +#define CP0_CFG_DSMSK (0x7 << 13) +#define CP0_CFG_DSSHF 13 +#define CP0_CFG_DLMSK (0x7 << 10) +#define CP0_CFG_DLSHF 10 +#define CP0_CFG_DAMSK (0x7 << 7) +#define CP0_CFG_DASHF 7 + +/* +#************************************************************************ +#* Coprocessor 0 Broadcom Config Register Bits +#************************************************************************ +*/ +#define CP0_BCM_CFG_ICSHEN (0x1 << 31) +#define CP0_BCM_CFG_DCSHEN (0x1 << 30) +#define CP0_BCM_CFG_BTHD (0x1 << 21) +#define CP0_BCM_CFG_CLF (0x1 << 20) +#define CP0_BCM_CFG_NBK (0x1 << 17) + +/* +#************************************************************************ +#* Coprocessor 0 CMT Interrupt Register +#************************************************************************ +*/ +#define CP0_CMT_XIR_4 (0x1 << 31) +#define CP0_CMT_XIR_3 (0x1 << 30) +#define CP0_CMT_XIR_2 (0x1 << 29) +#define CP0_CMT_XIR_1 (0x1 << 28) +#define CP0_CMT_XIR_0 (0x1 << 27) +#define CP0_CMT_SIR_1 (0x1 << 16) +#define CP0_CMT_SIR_0 (0x1 << 15) +#define CP0_CMT_NMIR_TP1 (0x1 << 1) +#define CP0_CMT_NMIR_TP0 (0x1 << 0) + +/* +#************************************************************************ +#* Coprocessor 0 CMT Control Register +#************************************************************************ +*/ +#define CP0_CMT_DSU_TP1 (0x1 << 30) +#define CP0_CMT_TPS_SHFT 16 +#define CP0_CMT_TPS_MASK (0xF << CP0_CMT_TPS_SHFT) +#define CP0_CMT_PRIO_TP1 (0x1 << 5) +#define CP0_CMT_PRIO_TP0 (0x1 << 4) +#define CP0_CMT_RSTSE (0x1 << 0) + +/* +#************************************************************************ +#* Coprocessor 0 CMT Local Register +#************************************************************************ +*/ +#define CP0_CMT_TPID (0x1 << 31) + +/* +#************************************************************************ +#* MIPS Registers +#************************************************************************ +*/ + +#define MIPS_BASE_BOOT 0xbfa00000 +#define MIPS_BASE 0xff400000 + +#define MIPS_RAC_CR0 0x00 // RAC Configuration Register +#define MIPS_RAC_CR1 0x08 // RAC Configuration Register 1 +#define RAC_FLH (1 << 8) +#define RAC_DPF (1 << 6) +#define RAC_NCH (1 << 5) +#define RAC_C_INV (1 << 4) +#define RAC_PF_D (1 << 3) +#define RAC_PF_I (1 << 2) +#define RAC_D (1 << 1) +#define RAC_I (1 << 0) + +#define MIPS_RAC_ARR 0x04 // RAC Address Range Register +#define RAC_UPB_SHFT 16 +#define RAC_LWB_SHFT 0 + +#define MIPS_LMB_CR 0x1C // LMB Control Register +#define LMB_EN (1 << 0) + +#define MIPS_SBR 0x20 // System Base Register + +#define MIPS_TP0_ALT_BV 0x30000 +#define MIPS_TP1_ALT_BV 0x38000 +#define ENABLE_ALT_BV (1 << 19) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/shared/opensource/include/bcm963xx/6328_intr.h b/shared/opensource/include/bcm963xx/6328_intr.h new file mode 100755 index 0000000..e4197d1 --- /dev/null +++ b/shared/opensource/include/bcm963xx/6328_intr.h @@ -0,0 +1,120 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifndef __6328_INTR_H +#define __6328_INTR_H + +#ifdef __cplusplus + extern "C" { +#endif + +#define INTERRUPT_ID_SOFTWARE_0 0 +#define INTERRUPT_ID_SOFTWARE_1 1 + +/*=====================================================================*/ +/* BCM6328 Timer Interrupt Level Assignments */ +/*=====================================================================*/ +#define MIPS_TIMER_INT 7 + +/*=====================================================================*/ +/* Peripheral ISR Table Offset */ +/*=====================================================================*/ +#define INTERNAL_ISR_TABLE_OFFSET 8 +#define INTERNAL_HIGH_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 32) + +/*=====================================================================*/ +/* Logical Peripheral Interrupt IDs */ +/*=====================================================================*/ + +#define INTERRUPT_ID_NAND (INTERNAL_ISR_TABLE_OFFSET + 0) +#define INTERRUPT_ID_PCM (INTERNAL_ISR_TABLE_OFFSET + 1) +#define INTERRUPT_ID_PCM_DMA_0 (INTERNAL_ISR_TABLE_OFFSET + 2) +#define INTERRUPT_ID_PCM_DMA_1 (INTERNAL_ISR_TABLE_OFFSET + 3) +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 4) +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 5) +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 6) +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 7) +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 8) +#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 9) +#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 10) +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 11) +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 12) +#define INTERRUPT_ID_EPHY_ENERGY_0_N (INTERNAL_ISR_TABLE_OFFSET + 13) +#define INTERRUPT_ID_EPHY_ENERGY_1_N (INTERNAL_ISR_TABLE_OFFSET + 14) +#define INTERRUPT_ID_EPHY_ENERGY_2_N (INTERNAL_ISR_TABLE_OFFSET + 15) +#define INTERRUPT_ID_EPHY_ENERGY_3_N (INTERNAL_ISR_TABLE_OFFSET + 16) +#define INTERRUPT_ID_EPHY_ENERGY_0 (INTERNAL_ISR_TABLE_OFFSET + 17) +#define INTERRUPT_ID_EPHY_ENERGY_1 (INTERNAL_ISR_TABLE_OFFSET + 18) +#define INTERRUPT_ID_EPHY_ENERGY_2 (INTERNAL_ISR_TABLE_OFFSET + 19) +#define INTERRUPT_ID_EPHY_ENERGY_3 (INTERNAL_ISR_TABLE_OFFSET + 20) +#define INTERRUPT_ID_XDSL (INTERNAL_ISR_TABLE_OFFSET + 21) +#define INTERRUPT_ID_PCIE_EP (INTERNAL_ISR_TABLE_OFFSET + 22) +#define INTERRUPT_ID_PCIE_RC (INTERNAL_ISR_TABLE_OFFSET + 23) +#define INTERRUPT_ID_EXTERNAL_0 (INTERNAL_ISR_TABLE_OFFSET + 24) +#define INTERRUPT_ID_EXTERNAL_1 (INTERNAL_ISR_TABLE_OFFSET + 25) +#define INTERRUPT_ID_EXTERNAL_2 (INTERNAL_ISR_TABLE_OFFSET + 26) +#define INTERRUPT_ID_EXTERNAL_3 (INTERNAL_ISR_TABLE_OFFSET + 27) +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 28) +#define INTERRUPT_ID_HS_SPIM (INTERNAL_ISR_TABLE_OFFSET + 29) +#define INTERRUPT_ID_WAKE_ON_IRQ (INTERNAL_ISR_TABLE_OFFSET + 30) +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 31) +#define INTERRUPT_ID_ENETSW_RX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 0) +#define INTERRUPT_ID_ENETSW_RX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 1) +#define INTERRUPT_ID_ENETSW_RX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 2) +#define INTERRUPT_ID_ENETSW_RX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 3) +#define INTERRUPT_ID_UART1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 7) +#define INTERRUPT_ID_ENETSW_SYS (INTERNAL_HIGH_ISR_TABLE_OFFSET + 8) +#define INTERRUPT_ID_USBH (INTERNAL_HIGH_ISR_TABLE_OFFSET + 9) +#define INTERRUPT_ID_USBH20 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 10) +#define INTERRUPT_ID_ATM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 11) +#define INTERRUPT_ID_ATM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 12) +#define INTERRUPT_ID_ATM_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 13) +#define INTERRUPT_ID_ATM_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 14) +#define INTERRUPT_ID_ATM_DMA_4 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 15) +#define INTERRUPT_ID_ATM_DMA_5 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 16) +#define INTERRUPT_ID_ATM_DMA_6 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 17) +#define INTERRUPT_ID_ATM_DMA_7 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 18) +#define INTERRUPT_ID_ATM_DMA_8 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 19) +#define INTERRUPT_ID_ATM_DMA_9 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 20) +#define INTERRUPT_ID_ATM_DMA_10 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 21) +#define INTERRUPT_ID_ATM_DMA_11 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 22) +#define INTERRUPT_ID_ATM_DMA_12 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 23) +#define INTERRUPT_ID_ATM_DMA_13 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 24) +#define INTERRUPT_ID_ATM_DMA_14 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 25) +#define INTERRUPT_ID_ATM_DMA_15 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 26) +#define INTERRUPT_ID_ATM_DMA_16 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 27) +#define INTERRUPT_ID_ATM_DMA_17 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 28) +#define INTERRUPT_ID_ATM_DMA_18 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 29) +#define INTERRUPT_ID_ATM_DMA_19 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 30) +#define INTERRUPT_ID_SAR (INTERNAL_HIGH_ISR_TABLE_OFFSET + 31) + +#define INTERRUPT_ID_LAST INTERRUPT_ID_SAR + +#ifdef __cplusplus + } +#endif + +#endif /* __BCM6328_H */ + + diff --git a/shared/opensource/include/bcm963xx/6328_map_part.h b/shared/opensource/include/bcm963xx/6328_map_part.h new file mode 100755 index 0000000..be199a5 --- /dev/null +++ b/shared/opensource/include/bcm963xx/6328_map_part.h @@ -0,0 +1,1325 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifndef __BCM6328_MAP_H +#define __BCM6328_MAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bcmtypes.h" + +#define PERF_BASE 0xb0000000 /* chip control registers */ +#define TIMR_BASE 0xb0000040 /* timer registers */ +#define GPIO_BASE 0xb0000080 /* gpio registers */ +#define UART_BASE 0xb0000100 /* uart registers */ +#define UART1_BASE 0xb0000120 /* uart registers */ +#define NAND_REG_BASE 0xb0000200 /* NAND registers */ +#define NAND_CACHE_BASE 0xb0000400 +#define LED_BASE 0xb0000800 /* LED control registers */ +#define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */ +#define MISC_BASE 0xb0001800 /* Miscellaneous Registers */ +#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */ +#define USB_EHCI_BASE 0x10002500 /* USB host registers */ +#define USB_OHCI_BASE 0x10002600 /* USB host registers */ +#define USBH_CFG_BASE 0xb0002700 +#define DDR_BASE 0xb0003000 /* Memory control registers */ +#define SAR_DMA_BASE 0xb000b800 /* ATM SAR DMA control registers */ +#define PCIE_BASE 0xb0e40000 + +typedef struct DDRPhyControl { + uint32 REVISION; /* 0x00 */ + uint32 CLK_PM_CTRL; /* 0x04 */ + uint32 unused0[2]; /* 0x08-0x10 */ + uint32 PLL_STATUS; /* 0x10 */ + uint32 PLL_CONFIG; /* 0x14 */ + uint32 PLL_PRE_DIVIDER; /* 0x18 */ + uint32 PLL_DIVIDER; /* 0x1c */ + uint32 PLL_CONTROL1; /* 0x20 */ + uint32 PLL_CONTROL2; /* 0x24 */ + uint32 PLL_SS_EN; /* 0x28 */ + uint32 PLL_SS_CFG; /* 0x2c */ + uint32 STATIC_VDL_OVERRIDE; /* 0x30 */ + uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */ + uint32 IDLE_PAD_CONTROL; /* 0x38 */ + uint32 ZQ_PVT_COMP_CTL; /* 0x3c */ + uint32 DRIVE_PAD_CTL; /* 0x40 */ + uint32 CLOCK_REG_CONTROL; /* 0x44 */ + uint32 unused1[46]; +} DDRPhyControl; + +typedef struct DDRPhyByteLaneControl { + uint32 REVISION; /* 0x00 */ + uint32 VDL_CALIBRATE; /* 0x04 */ + uint32 VDL_STATUS; /* 0x08 */ + uint32 unused; /* 0x0c */ + uint32 VDL_OVERRIDE_0; /* 0x10 */ + uint32 VDL_OVERRIDE_1; /* 0x14 */ + uint32 VDL_OVERRIDE_2; /* 0x18 */ + uint32 VDL_OVERRIDE_3; /* 0x1c */ + uint32 VDL_OVERRIDE_4; /* 0x20 */ + uint32 VDL_OVERRIDE_5; /* 0x24 */ + uint32 VDL_OVERRIDE_6; /* 0x28 */ + uint32 VDL_OVERRIDE_7; /* 0x2c */ + uint32 READ_CONTROL; /* 0x30 */ + uint32 READ_FIFO_STATUS; /* 0x34 */ + uint32 READ_FIFO_CLEAR; /* 0x38 */ + uint32 IDLE_PAD_CONTROL; /* 0x3c */ + uint32 DRIVE_PAD_CTL; /* 0x40 */ + uint32 CLOCK_PAD_DISABLE; /* 0x44 */ + uint32 WR_PREAMBLE_MODE; /* 0x48 */ + uint32 CLOCK_REG_CONTROL; /* 0x4C */ + uint32 unused0[44]; +} DDRPhyByteLaneControl; + +typedef struct DDRControl { + uint32 CNFG; /* 0x000 */ + uint32 CSST; /* 0x004 */ + uint32 CSEND; /* 0x008 */ + uint32 unused; /* 0x00c */ + uint32 ROW00_0; /* 0x010 */ + uint32 ROW00_1; /* 0x014 */ + uint32 ROW01_0; /* 0x018 */ + uint32 ROW01_1; /* 0x01c */ + uint32 unused0[4]; + uint32 ROW20_0; /* 0x030 */ + uint32 ROW20_1; /* 0x034 */ + uint32 ROW21_0; /* 0x038 */ + uint32 ROW21_1; /* 0x03c */ + uint32 unused1[4]; + uint32 COL00_0; /* 0x050 */ + uint32 COL00_1; /* 0x054 */ + uint32 COL01_0; /* 0x058 */ + uint32 COL01_1; /* 0x05c */ + uint32 unused2[4]; + uint32 COL20_0; /* 0x070 */ + uint32 COL20_1; /* 0x074 */ + uint32 COL21_0; /* 0x078 */ + uint32 COL21_1; /* 0x07c */ + uint32 unused3[4]; + uint32 BNK10; /* 0x090 */ + uint32 BNK32; /* 0x094 */ + uint32 unused4[26]; + uint32 DCMD; /* 0x100 */ +#define DCMD_CS1 (1 << 5) +#define DCMD_CS0 (1 << 4) +#define DCMD_SET_SREF 4 + uint32 DMODE_0; /* 0x104 */ + uint32 DMODE_1; /* 0x108 */ +#define DMODE_1_DRAMSLEEP (1 << 11) + uint32 CLKS; /* 0x10c */ + uint32 ODT; /* 0x110 */ + uint32 TIM1_0; /* 0x114 */ + uint32 TIM1_1; /* 0x118 */ + uint32 TIM2; /* 0x11c */ + uint32 CTL_CRC; /* 0x120 */ + uint32 DOUT_CRC; /* 0x124 */ + uint32 DIN_CRC; /* 0x128 */ + uint32 unused5[53]; + + DDRPhyControl PhyControl; /* 0x200 */ + DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */ + DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */ + DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */ + DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */ + uint32 unused6[64]; + + uint32 GCFG; /* 0x800 */ + uint32 LBIST_CFG; /* 0x804 */ + uint32 LBIST_SEED; /* 0x808 */ + uint32 ARB; /* 0x80c */ + uint32 PI_GCF; /* 0x810 */ + uint32 PI_UBUS_CTL; /* 0x814 */ + uint32 PI_MIPS_CTL; /* 0x818 */ + uint32 PI_DSL_MIPS_CTL; /* 0x81c */ + uint32 PI_DSL_PHY_CTL; /* 0x820 */ + uint32 PI_UBUS_ST; /* 0x824 */ + uint32 PI_MIPS_ST; /* 0x828 */ + uint32 PI_DSL_MIPS_ST; /* 0x82c */ + uint32 PI_DSL_PHY_ST; /* 0x830 */ + uint32 PI_UBUS_SMPL; /* 0x834 */ + uint32 TESTMODE; /* 0x838 */ + uint32 TEST_CFG1; /* 0x83c */ + uint32 TEST_PAT; /* 0x840 */ + uint32 TEST_COUNT; /* 0x844 */ + uint32 TEST_CURR_COUNT; /* 0x848 */ + uint32 TEST_ADDR_UPDT; /* 0x84c */ + uint32 TEST_ADDR; /* 0x850 */ + uint32 TEST_DATA0; /* 0x854 */ + uint32 TEST_DATA1; /* 0x858 */ + uint32 TEST_DATA2; /* 0x85c */ + uint32 TEST_DATA3; /* 0x860 */ +} DDRControl; + +#define DDR ((volatile DDRControl * const) DDR_BASE) + +/* +** Peripheral Controller +*/ + +#define IRQ_BITS 64 +typedef struct { + uint64 IrqMask; + uint64 IrqStatus; +} IrqControl_t; + +typedef struct PerfControl { + uint32 RevID; /* (00) word 0 */ + uint32 blkEnables; /* (04) word 1 */ +#define ROBOSW_CLK_EN (1 << 11) +#define PCIE_CLK_EN (1 << 10) +#define HS_SPI_CLK_EN (1 << 9) +#define USBH_CLK_EN (1 << 8) +#define USBD_CLK_EN (1 << 7) +#define PCM_CLK_EN (1 << 6) +#define SAR_CLK_EN (1 << 5) +#define MIPS_CLK_EN (1 << 4) +#define ADSL_CLK_EN (1 << 3) +#define ADSL_AFE_EN (1 << 2) +#define ADSL_QPROC_EN (1 << 1) +#define PHYMIPS_CLK_EN (1 << 0) + + uint32 unused0; /* (08) word 2 */ + uint32 deviceTimeoutEn; /* (0c) word 3 */ + uint32 softResetB; /* (10) word 4 */ +#define SOFT_RST_PCIE_HARD (1 << 10) +#define SOFT_RST_PCIE_EXT (1 << 9) +#define SOFT_RST_PCIE (1 << 8) +#define SOFT_RST_PCIE_CORE (1 << 7) +#define SOFT_RST_PCM (1 << 6) +#define SOFT_RST_USBH (1 << 5) +#define SOFT_RST_USBD (1 << 4) +#define SOFT_RST_SWITCH (1 << 3) +#define SOFT_RST_SAR (1 << 2) +#define SOFT_RST_EPHY (1 << 1) +#define SOFT_RST_SPI (1 << 0) + + uint32 diagControl; /* (14) word 5 */ + uint32 ExtIrqCfg; /* (18) word 6*/ + uint32 unused1; /* (1c) word 7 */ +#define EI_SENSE_SHFT 0 +#define EI_STATUS_SHFT 4 +#define EI_CLEAR_SHFT 8 +#define EI_MASK_SHFT 12 +#define EI_INSENS_SHFT 16 +#define EI_LEVEL_SHFT 20 + + IrqControl_t IrqControl[2]; +} PerfControl; + +#define PERF ((volatile PerfControl * const) PERF_BASE) + +/* +** Timer +*/ +typedef struct Timer { + uint16 unused0; + byte TimerMask; +#define TIMER0EN 0x01 +#define TIMER1EN 0x02 +#define TIMER2EN 0x04 + byte TimerInts; +#define TIMER0 0x01 +#define TIMER1 0x02 +#define TIMER2 0x04 +#define WATCHDOG 0x08 + uint32 TimerCtl0; + uint32 TimerCtl1; + uint32 TimerCtl2; +#define TIMERENABLE 0x80000000 +#define RSTCNTCLR 0x40000000 + uint32 TimerCnt0; + uint32 TimerCnt1; + uint32 TimerCnt2; + uint32 WatchDogDefCount; + + /* Write 0xff00 0x00ff to Start timer + * Write 0xee00 0x00ee to Stop and re-load default count + * Read from this register returns current watch dog count + */ + uint32 WatchDogCtl; + + /* Number of 50-MHz ticks for WD Reset pulse to last */ + uint32 WDResetCount; + + uint32 SoftRst; +#define SOFT_RESET 0x00000001 // 0 +} Timer; + +#define TIMER ((volatile Timer * const) TIMR_BASE) + +/* +** UART +*/ +typedef struct UartChannel { + byte unused0; + byte control; +#define BRGEN 0x80 /* Control register bit defs */ +#define TXEN 0x40 +#define RXEN 0x20 +#define LOOPBK 0x10 +#define TXPARITYEN 0x08 +#define TXPARITYEVEN 0x04 +#define RXPARITYEN 0x02 +#define RXPARITYEVEN 0x01 + + byte config; +#define XMITBREAK 0x40 +#define BITS5SYM 0x00 +#define BITS6SYM 0x10 +#define BITS7SYM 0x20 +#define BITS8SYM 0x30 +#define ONESTOP 0x07 +#define TWOSTOP 0x0f + /* 4-LSBS represent STOP bits/char + * in 1/8 bit-time intervals. Zero + * represents 1/8 stop bit interval. + * Fifteen represents 2 stop bits. + */ + byte fifoctl; +#define RSTTXFIFOS 0x80 +#define RSTRXFIFOS 0x40 + /* 5-bit TimeoutCnt is in low bits of this register. + * This count represents the number of characters + * idle times before setting receive Irq when below threshold + */ + uint32 baudword; + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate + */ + + byte txf_levl; /* Read-only fifo depth */ + byte rxf_levl; /* Read-only fifo depth */ + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are + * RxThreshold. Irq can be asserted + * when rx fifo> thresh, txfifo thresh, txfifo thresh, txfifo thresh, txfifo +#include +#include +#include +#include +#include + +struct bcmspi +{ + spinlock_t lock; + char * devName; + int irq; + unsigned bus_num; + unsigned num_chipselect; + u8 stopping; + struct list_head queue; + struct platform_device *pdev; + struct spi_transfer *curTrans; +}; +#endif + +#define BCM_SPI_READ 0 +#define BCM_SPI_WRITE 1 +#define BCM_SPI_FULL 2 + +#endif /* __BCM_SPI_H__ */ + diff --git a/shared/opensource/include/bcm963xx/bcmSpiRes.h b/shared/opensource/include/bcm963xx/bcmSpiRes.h new file mode 100755 index 0000000..cb39756 --- /dev/null +++ b/shared/opensource/include/bcm963xx/bcmSpiRes.h @@ -0,0 +1,101 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifndef __BCMSPIRES_H__ +#define __BCMSPIRES_H__ + +#ifndef _CFE_ +#include +#endif + +#define SPI_STATUS_OK (0) +#define SPI_STATUS_INVALID_LEN (-1) +#define SPI_STATUS_ERR (-2) + +/* legacy and HS controllers can coexist - use bus num to differentiate */ +#define LEG_SPI_BUS_NUM 0 +#define HS_SPI_BUS_NUM 1 + +#define LEG_SPI_CLOCK_DEF 2 + +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) || defined(_BCM96362_) || defined(CONFIG_BCM96362) +#define HS_SPI_PLL_FREQ 400000000 +#else +#define HS_SPI_PLL_FREQ 133333333 +#endif +#define HS_SPI_CLOCK_DEF 40000000 +#define HS_SPI_BUFFER_LEN 512 + +/* used to specify ctrlState for the interface BcmSpiReserveSlave2 + SPI_CONTROLLER_STATE_SET is used to differentiate a value of 0 which results in + the controller using default values and the case where CPHA_EXT, GATE_CLK_SSOFF, + CLK_POLARITY, and ASYNC_CLOCK all need to be 0 + + SPI MODE sets the values for CPOL and CPHA + SPI_CONTROLLER_STATE_CPHA_EXT will extend these modes +CPOL = 0 -> base value of clock is 0 +CPHA = 0, CPHA_EXT = 0 -> latch data on rising edge, launch data on falling edge +CPHA = 1, CPHA_EXT = 0 -> latch data on falling edge, launch data on rising edge +CPHA = 0, CPHA_EXT = 1 -> latch data on rising edge, launch data on rising edge +CPHA = 1, CPHA_EXT = 1 -> latch data on falling edge, launch data on falling edge + +CPOL = 1 -> base value of clock is 1 +CPHA = 0, CPHA_EXT = 0 -> latch data on falling edge, launch data on rising edge +CPHA = 1, CPHA_EXT = 0 -> latch data on rising edge, launch data on falling edge +CPHA = 0, CPHA_EXT = 1 -> latch data on falling edge, launch data on falling edge +CPHA = 1, CPHA_EXT = 1 -> latch data on rising edge, launch data on rising edge +*/ +#define SPI_CONTROLLER_STATE_SET (1 << 31) +#define SPI_CONTROLLER_STATE_CPHA_EXT (1 << 30) +#define SPI_CONTROLLER_STATE_GATE_CLK_SSOFF (1 << 29) +#define SPI_CONTROLLER_STATE_CLK_POLARITY (1 << 28) +#define SPI_CONTROLLER_STATE_ASYNC_CLOCK (1 << 27) + +/* set mode and controller state based on CHIP defaults + these values do not matter for the legacy controller */ +#if defined(CONFIG_BCM96816) +#define SPI_MODE_DEFAULT SPI_MODE_1 +#define SPI_CONTROLLER_STATE_DEFAULT (SPI_CONTROLLER_STATE_GATE_CLK_SSOFF | SPI_CONTROLLER_STATE_CPHA_EXT) +#elif (defined(CONFIG_BCM96362) || defined(CONFIG_BCM96328)) +#define SPI_MODE_DEFAULT SPI_MODE_0 +#define SPI_CONTROLLER_STATE_DEFAULT (SPI_CONTROLLER_STATE_GATE_CLK_SSOFF) +#else +#define SPI_MODE_DEFAULT SPI_MODE_3 +#define SPI_CONTROLLER_STATE_DEFAULT (0) +#endif + +#ifndef _CFE_ +int BcmSpiReserveSlave(int busNum, int slaveId, int maxFreq); +int BcmSpiReserveSlave2(int busNum, int slaveId, int maxFreq, int mode, int ctrlState); +int BcmSpiReleaseSlave(int busNum, int slaveId); +int BcmSpiSyncTrans(unsigned char *txBuf, unsigned char *rxBuf, int prependcnt, int nbytes, int busNum, int slaveId); +#endif + +int BcmSpi_SetFlashCtrl( int, int, int, int, int ); +int BcmSpi_GetMaxRWSize( int ); +int BcmSpi_Read(unsigned char *, int, int, int, int, int); +int BcmSpi_Write(unsigned char *, int, int, int, int); + +#endif /* __BCMSPIRES_H__ */ + diff --git a/shared/opensource/include/bcm963xx/bcmTag.h b/shared/opensource/include/bcm963xx/bcmTag.h new file mode 100755 index 0000000..8a1ca24 --- /dev/null +++ b/shared/opensource/include/bcm963xx/bcmTag.h @@ -0,0 +1,175 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +//************************************************************************************** +// File Name : bcmTag.h +// +// Description: add tag with validation system to the firmware image file to be uploaded +// via http +// +// Created : 02/28/2002 seanl +//************************************************************************************** + +#ifndef _BCMTAG_H_ +#define _BCMTAG_H_ + + +#define BCM_SIG_1 "Broadcom Corporation" +#define BCM_SIG_2 "ver. 2.0" // was "firmware version 2.0" now it is split 6 char out for chip id. + +#define BCM_TAG_VER "6" + +// file tag (head) structure all is in clear text except validationTokens (crc, md5, sha1, etc). Total: 128 unsigned chars +#define TAG_LEN 256 +#define TAG_VER_LEN 4 +#define SIG_LEN 20 +#define SIG_LEN_2 14 // Original second SIG = 20 is now devided into 14 for SIG_LEN_2 and 6 for CHIP_ID +#define CHIP_ID_LEN 6 +#define IMAGE_LEN 10 +#define ADDRESS_LEN 12 +#define FLAG_LEN 2 +#define TOKEN_LEN 20 +#define BOARD_ID_LEN 16 +#define RESERVED_LEN (TAG_LEN - TAG_VER_LEN - SIG_LEN - SIG_LEN_2 - CHIP_ID_LEN - BOARD_ID_LEN - \ + (4*IMAGE_LEN) - (3*ADDRESS_LEN) - (3*FLAG_LEN) - (2*TOKEN_LEN)) + + +// TAG for downloadable image (kernel plus file system) +typedef struct _FILE_TAG +{ + char tagVersion[TAG_VER_LEN]; // tag version. Will be 2 here. + char signiture_1[SIG_LEN]; // text line for company info + char signiture_2[SIG_LEN_2]; // additional info (can be version number) + char chipId[CHIP_ID_LEN]; // chip id + char boardId[BOARD_ID_LEN]; // board id + char bigEndian[FLAG_LEN]; // if = 1 - big, = 0 - little endia of the host + char totalImageLen[IMAGE_LEN]; // the sum of all the following length + char cfeAddress[ADDRESS_LEN]; // if non zero, cfe starting address + char cfeLen[IMAGE_LEN]; // if non zero, cfe size in clear ASCII text. + char rootfsAddress[ADDRESS_LEN]; // if non zero, filesystem starting address + char rootfsLen[IMAGE_LEN]; // if non zero, filesystem size in clear ASCII text. + char kernelAddress[ADDRESS_LEN]; // if non zero, kernel starting address + char kernelLen[IMAGE_LEN]; // if non zero, kernel size in clear ASCII text. + char imageSequence[FLAG_LEN * 2]; // incrments everytime an image is flashed + char reserved[RESERVED_LEN]; // reserved for later use + char imageValidationToken[TOKEN_LEN];// image validation token - can be crc, md5, sha; for + // now will be 4 unsigned char crc + char tagValidationToken[TOKEN_LEN]; // validation token for tag(from signiture_1 to end of // mageValidationToken) +} FILE_TAG, *PFILE_TAG; + +/* Whole flash image TAG definitions. */ +#define WFI_VERSION 0x00005731 +#define WFI_ANY_VERS_MASK 0x0000ff00 +#define WFI_ANY_VERS 0x00005700 +#define WFI_NOR_FLASH 1 +#define WFI_NAND16_FLASH 2 +#define WFI_NAND128_FLASH 3 + +/* TAG at end of whole flash ".w" image. Size must be TOKEN_LEN. */ +typedef struct _WFI_TAG +{ + unsigned long wfiCrc; + unsigned long wfiVersion; + unsigned long wfiChipId; + unsigned long wfiFlashType; + unsigned long wfiReserved; +} WFI_TAG, *PWFI_TAG; + +#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */ +#define CRC_LEN 4 + +// only included if for bcmTag.exe program +#ifdef BCMTAG_EXE_USE + +static unsigned long Crc32_table[256] = { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +}; +#endif // BCMTAG_USE + + +#endif // _BCMTAG_H_ + diff --git a/shared/opensource/include/bcm963xx/bcm_hwdefs.h b/shared/opensource/include/bcm963xx/bcm_hwdefs.h new file mode 100755 index 0000000..07ecc29 --- /dev/null +++ b/shared/opensource/include/bcm963xx/bcm_hwdefs.h @@ -0,0 +1,193 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/***********************************************************************/ +/* */ +/* MODULE: bcm_hwdefs.h */ +/* PURPOSE: Define all base device addresses and HW specific macros. */ +/* */ +/***********************************************************************/ +#ifndef _BCM_HWDEFS_H +#define _BCM_HWDEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define DYING_GASP_API + +/*****************************************************************************/ +/* Physical Memory Map */ +/*****************************************************************************/ + +#define PHYS_DRAM_BASE 0x00000000 /* Dynamic RAM Base */ +#if defined(CONFIG_BRCM_IKOS) +#define PHYS_FLASH_BASE 0x18000000 /* Flash Memory */ +#else +#define PHYS_FLASH_BASE 0x1FC00000 /* Flash Memory */ +#endif + +/*****************************************************************************/ +/* Note that the addresses above are physical addresses and that programs */ +/* have to use converted addresses defined below: */ +/*****************************************************************************/ +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */ +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */ + +/* Binary images are always built for a standard MIPS boot address */ +#define IMAGE_BASE (0xA0000000 | PHYS_FLASH_BASE) + +/* Some chips don't support alternative boot vector */ +#if defined(CONFIG_BRCM_IKOS) +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */ +#define BOOT_OFFSET 0 +#else +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362) +#define FLASH_BASE 0xB8000000 +#else +#define FLASH_BASE (0xA0000000 | (MPI->cs[0].base & 0xFFFFFF00)) +#endif +#define BOOT_OFFSET (FLASH_BASE - IMAGE_BASE) +#endif + +/*****************************************************************************/ +/* Select the PLL value to get the desired CPU clock frequency. */ +/*****************************************************************************/ +#define FPERIPH 50000000 + +/*****************************************************************************/ +/* Board memory type offset */ +/*****************************************************************************/ +#define ONEK 1024 +#define FLASH_LENGTH_BOOT_ROM (64*ONEK) + +#define PROJECT_ID_LEN 7 /* Foxconn added by zacker, 02/29/2008, strlen("U12H094") */ +#ifdef _CFE_ +#define FLASH_SIZE 32 * 1024 * 1024 +#endif +#define BOARD_DATA_ADDR (FLASH_BASE + FLASH_SIZE - 0x20000) +#define BOARD_FOXNVRAM_ADDR (FLASH_BASE + FLASH_SIZE - 0x10000) +#define FOX_BOARD_ID_MAX_LEN 64 +#define BOARD_ID "U12L161" +/*****************************************************************************/ +/* NVRAM Offset and definition */ +/*****************************************************************************/ +#define NVRAM_SECTOR 0 +#define NVRAM_DATA_OFFSET 0x0580 +#define NVRAM_DATA_ID 0x0f1e2d3c // This is only for backwards compatability + +#define NVRAM_LENGTH ONEK // 1k nvram +#define NVRAM_VERSION_NUMBER 6 +#define NVRAM_FULL_LEN_VERSION_NUMBER 5 /* version in which the checksum was + placed at the end of the NVRAM + structure */ + +#define NVRAM_BOOTLINE_LEN 256 +#define NVRAM_BOARD_ID_STRING_LEN 16 +#define NVRAM_MAC_ADDRESS_LEN 6 + +#define NVRAM_GPON_SERIAL_NUMBER_LEN 13 +#define NVRAM_GPON_PASSWORD_LEN 11 + +#define NVRAM_WLAN_PARAMS_LEN 256 +#define NVRAM_WPS_DEVICE_PIN_LEN 8 + +#define THREAD_NUM_ADDRESS_OFFSET (NVRAM_DATA_OFFSET + 4 + NVRAM_BOOTLINE_LEN + NVRAM_BOARD_ID_STRING_LEN) +#define THREAD_NUM_ADDRESS (0x80000000 + THREAD_NUM_ADDRESS_OFFSET) + +#define DEFAULT_BOOTLINE "e=192.168.1.1:ffffff00 h=192.168.1.100 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 " +#define DEFAULT_BOARD_IP "192.168.1.1" +#define DEFAULT_MAC_NUM 10 +#define DEFAULT_BOARD_MAC "00:10:18:00:00:00" +#define DEFAULT_TP_NUM 0 +#define DEFAULT_PSI_SIZE 24 +#define DEFAULT_GPON_SN "BRCM12345678" +#define DEFAULT_GPON_PW " " + +#define DEFAULT_WPS_DEVICE_PIN "12345670" + +#define DEFAULT_VOICE_BOARD_ID "NONE" + +#define NVRAM_MAC_COUNT_MAX 32 +#define NVRAM_MAX_PSI_SIZE 64 +#define NVRAM_MAX_SYSLOG_SIZE 256 + +#define NP_BOOT 0 +#define NP_ROOTFS_1 1 +#define NP_ROOTFS_2 2 +#define NP_DATA 3 +#define NP_BBT 4 +#define NP_TOTAL 5 + +#define NAND_DATA_SIZE_KB 1024 +#define NAND_BBT_THRESHOLD_KB (512 * 1024) +#define NAND_BBT_SMALL_SIZE_KB 1024 +#define NAND_BBT_BIG_SIZE_KB 4096 + +#define NAND_CFE_RAM_NAME "cferam.000" + +#ifndef _LANGUAGE_ASSEMBLY +typedef struct +{ + unsigned long ulVersion; + char szBootline[NVRAM_BOOTLINE_LEN]; + char szBoardId[NVRAM_BOARD_ID_STRING_LEN]; + unsigned long ulMainTpNum; + unsigned long ulPsiSize; + unsigned long ulNumMacAddrs; + unsigned char ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN]; + char pad; + char backupPsi; /**< if 0x01, allocate space for a backup PSI */ + unsigned long ulCheckSumV4; + char gponSerialNumber[NVRAM_GPON_SERIAL_NUMBER_LEN]; + char gponPassword[NVRAM_GPON_PASSWORD_LEN]; + char wpsDevicePin[NVRAM_WPS_DEVICE_PIN_LEN]; + char wlanParams[NVRAM_WLAN_PARAMS_LEN]; + unsigned long ulSyslogSize; /**< number of KB to allocate for persistent syslog */ + unsigned long ulNandPartOfsKb[NP_TOTAL]; + unsigned long ulNandPartSizeKb[NP_TOTAL]; + char szVoiceBoardId[NVRAM_BOARD_ID_STRING_LEN]; + unsigned long afeId[2]; + char szFirmwareUpgradeBoardId[32]; /* foxconn added Bob, 07/12/2010, for TFTP firmware upgrade */ + char chUnused[332]; /* reduce array size from 364 to 332, total size of NVRAM_DATA is unchanged, Bob, 07/12/2010 */ + unsigned long ulCheckSum; +} NVRAM_DATA, *PNVRAM_DATA; +#endif + +#define BOOT_LATEST_IMAGE '0' +#define BOOT_PREVIOUS_IMAGE '1' + +/*****************************************************************************/ +/* Misc Offsets */ +/*****************************************************************************/ +#define CFE_VERSION_OFFSET 0x0570 +#define CFE_VERSION_MARK_SIZE 5 +#define CFE_VERSION_SIZE 5 + +#ifdef __cplusplus +} +#endif + +#endif /* _BCM_HWDEFS_H */ + diff --git a/shared/opensource/include/bcm963xx/bcmnetlink.h b/shared/opensource/include/bcm963xx/bcmnetlink.h new file mode 100755 index 0000000..e5fc77f --- /dev/null +++ b/shared/opensource/include/bcm963xx/bcmnetlink.h @@ -0,0 +1,47 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/************************************************************************** + * File Name : bcmnetlink.h + * + * Description: This file defines broadcom specific netlink message types + ***************************************************************************/ +#ifndef _BCMNETLINK_H +#define _BCMNETLINK_H + +#include + +#ifndef NETLINK_BRCM_MONITOR +#define NETLINK_BRCM_MONITOR 25 +#endif + +/* message types exchanged using NETLINK_BRCM_MONITOR */ +#define MSG_NETLINK_BRCM_WAKEUP_MONITOR_TASK 0X1000 + +#define MSG_NETLINK_BRCM_LINK_STATUS_CHANGED 0X2000 + + +extern void kerSysSendtoMonitorTask(int msgType, char *msgData, int msgDataLen); + +#endif /*_BCMNETLINK_H */ diff --git a/shared/opensource/include/bcm963xx/boardparms.h b/shared/opensource/include/bcm963xx/boardparms.h new file mode 100755 index 0000000..7fec91c --- /dev/null +++ b/shared/opensource/include/bcm963xx/boardparms.h @@ -0,0 +1,453 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/************************************************************************** + * File Name : boardparms.h + * + * Description: This file contains definitions and function prototypes for + * the BCM63xx board parameter access functions. + * + * Updates : 07/14/2003 Created. + ***************************************************************************/ + +#if !defined(_BOARDPARMS_H) +#define _BOARDPARMS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return codes. */ +#define BP_SUCCESS 0 +#define BP_BOARD_ID_NOT_FOUND 1 +#define BP_VALUE_NOT_DEFINED 2 +#define BP_BOARD_ID_NOT_SET 3 + +/* Values for EthernetMacInfo PhyType. */ +#define BP_ENET_NO_PHY 0 +#define BP_ENET_INTERNAL_PHY 1 +#define BP_ENET_EXTERNAL_SWITCH 2 +#define BP_ENET_SWITCH_VIA_INTERNAL_PHY 3 /* it is for cpu internal phy connects to port 4 of 5325e */ + +/* Values for EthernetMacInfo Configuration type. */ +#define BP_ENET_CONFIG_MDIO 0 /* Internal PHY, External PHY, Switch+(no GPIO, no SPI, no MDIO Pseudo phy */ +#define BP_ENET_CONFIG_MDIO_PSEUDO_PHY 1 +#define BP_ENET_CONFIG_SPI_SSB_0 2 +#define BP_ENET_CONFIG_SPI_SSB_1 3 +#define BP_ENET_CONFIG_SPI_SSB_2 4 +#define BP_ENET_CONFIG_SPI_SSB_3 5 +#define BP_ENET_CONFIG_MMAP 6 +#define BP_ENET_CONFIG_GPIO_MDIO 7 /* use GPIO to simulate MDC/MDIO */ + +/* Values for VoIPDSPInfo DSPType. */ +#define BP_VOIP_NO_DSP 0 +#define BP_VOIP_DSP 1 +#define BP_VOIP_MIPS 2 + +/* Values for GPIO pin assignments (AH = Active High, AL = Active Low). */ +#define BP_GPIO_NUM_MASK 0x00FF +#define BP_ACTIVE_MASK 0x8000 +#define BP_ACTIVE_HIGH 0x0000 +#define BP_ACTIVE_LOW 0x8000 +#define BP_GPIO_SERIAL 0x4000 + +#define BP_GPIO_0_AH (0) +#define BP_GPIO_0_AL (0 | BP_ACTIVE_LOW) +#define BP_GPIO_1_AH (1) +#define BP_GPIO_1_AL (1 | BP_ACTIVE_LOW) +#define BP_GPIO_2_AH (2) +#define BP_GPIO_2_AL (2 | BP_ACTIVE_LOW) +#define BP_GPIO_3_AH (3) +#define BP_GPIO_3_AL (3 | BP_ACTIVE_LOW) +#define BP_GPIO_4_AH (4) +#define BP_GPIO_4_AL (4 | BP_ACTIVE_LOW) +#define BP_GPIO_5_AH (5) +#define BP_GPIO_5_AL (5 | BP_ACTIVE_LOW) +#define BP_GPIO_6_AH (6) +#define BP_GPIO_6_AL (6 | BP_ACTIVE_LOW) +#define BP_GPIO_7_AH (7) +#define BP_GPIO_7_AL (7 | BP_ACTIVE_LOW) +#define BP_GPIO_8_AH (8) +#define BP_GPIO_8_AL (8 | BP_ACTIVE_LOW) +#define BP_GPIO_9_AH (9) +#define BP_GPIO_9_AL (9 | BP_ACTIVE_LOW) +#define BP_GPIO_10_AH (10) +#define BP_GPIO_10_AL (10 | BP_ACTIVE_LOW) +#define BP_GPIO_11_AH (11) +#define BP_GPIO_11_AL (11 | BP_ACTIVE_LOW) +#define BP_GPIO_12_AH (12) +#define BP_GPIO_12_AL (12 | BP_ACTIVE_LOW) +#define BP_GPIO_13_AH (13) +#define BP_GPIO_13_AL (13 | BP_ACTIVE_LOW) +#define BP_GPIO_14_AH (14) +#define BP_GPIO_14_AL (14 | BP_ACTIVE_LOW) +#define BP_GPIO_15_AH (15) +#define BP_GPIO_15_AL (15 | BP_ACTIVE_LOW) +#define BP_GPIO_16_AH (16) +#define BP_GPIO_16_AL (16 | BP_ACTIVE_LOW) +#define BP_GPIO_17_AH (17) +#define BP_GPIO_17_AL (17 | BP_ACTIVE_LOW) +#define BP_GPIO_18_AH (18) +#define BP_GPIO_18_AL (18 | BP_ACTIVE_LOW) +#define BP_GPIO_19_AH (19) +#define BP_GPIO_19_AL (19 | BP_ACTIVE_LOW) +#define BP_GPIO_20_AH (20) +#define BP_GPIO_20_AL (20 | BP_ACTIVE_LOW) +#define BP_GPIO_21_AH (21) +#define BP_GPIO_21_AL (21 | BP_ACTIVE_LOW) +#define BP_GPIO_22_AH (22) +#define BP_GPIO_22_AL (22 | BP_ACTIVE_LOW) +#define BP_GPIO_23_AH (23) +#define BP_GPIO_23_AL (23 | BP_ACTIVE_LOW) +#define BP_GPIO_24_AH (24) +#define BP_GPIO_24_AL (24 | BP_ACTIVE_LOW) +#define BP_GPIO_25_AH (25) +#define BP_GPIO_25_AL (25 | BP_ACTIVE_LOW) +#define BP_GPIO_26_AH (26) +#define BP_GPIO_26_AL (26 | BP_ACTIVE_LOW) +#define BP_GPIO_27_AH (27) +#define BP_GPIO_27_AL (27 | BP_ACTIVE_LOW) +#define BP_GPIO_28_AH (28) +#define BP_GPIO_28_AL (28 | BP_ACTIVE_LOW) +#define BP_GPIO_29_AH (29) +#define BP_GPIO_29_AL (29 | BP_ACTIVE_LOW) +#define BP_GPIO_30_AH (30) +#define BP_GPIO_30_AL (30 | BP_ACTIVE_LOW) +#define BP_GPIO_31_AH (31) +#define BP_GPIO_31_AL (31 | BP_ACTIVE_LOW) +#define BP_GPIO_32_AH (32) +#define BP_GPIO_32_AL (32 | BP_ACTIVE_LOW) +#define BP_GPIO_33_AH (33) +#define BP_GPIO_33_AL (33 | BP_ACTIVE_LOW) +#define BP_GPIO_34_AH (34) +#define BP_GPIO_34_AL (34 | BP_ACTIVE_LOW) +#define BP_GPIO_35_AH (35) +#define BP_GPIO_35_AL (35 | BP_ACTIVE_LOW) +#define BP_GPIO_36_AH (36) +#define BP_GPIO_36_AL (36 | BP_ACTIVE_LOW) +#define BP_GPIO_37_AH (37) +#define BP_GPIO_37_AL (37 | BP_ACTIVE_LOW) +#define BP_GPIO_38_AH (38) +#define BP_GPIO_38_AL (38 | BP_ACTIVE_LOW) +#define BP_GPIO_39_AH (39) +#define BP_GPIO_39_AL (39 | BP_ACTIVE_LOW) +#define BP_GPIO_40_AH (40) +#define BP_GPIO_40_AL (40 | BP_ACTIVE_LOW) +#define BP_GPIO_41_AH (41) +#define BP_GPIO_41_AL (41 | BP_ACTIVE_LOW) +#define BP_GPIO_42_AH (42) +#define BP_GPIO_42_AL (42 | BP_ACTIVE_LOW) +#define BP_GPIO_43_AH (43) +#define BP_GPIO_43_AL (43 | BP_ACTIVE_LOW) +#define BP_GPIO_44_AH (44) +#define BP_GPIO_44_AL (44 | BP_ACTIVE_LOW) +#define BP_GPIO_45_AH (45) +#define BP_GPIO_45_AL (45 | BP_ACTIVE_LOW) +#define BP_GPIO_46_AH (46) +#define BP_GPIO_46_AL (46 | BP_ACTIVE_LOW) +#define BP_GPIO_47_AH (47) +#define BP_GPIO_47_AL (47 | BP_ACTIVE_LOW) + +#define BP_SERIAL_GPIO_0_AH (0 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_0_AL (0 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_1_AH (1 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_1_AL (1 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_2_AH (2 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_2_AL (2 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_3_AH (3 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_3_AL (3 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_4_AH (4 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_4_AL (4 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_5_AH (5 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_5_AL (5 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_6_AH (6 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_6_AL (6 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_7_AH (7 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_7_AL (7 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_8_AH (8 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_8_AL (8 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_9_AH (9 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_9_AL (9 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_10_AH (10 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_10_AL (10 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_11_AH (11 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_11_AL (11 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_12_AH (12 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_12_AL (12 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_13_AH (13 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_13_AL (13 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_14_AH (14 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_14_AL (14 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_15_AH (15 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_15_AL (15 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_16_AH (16 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_16_AL (16 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_17_AH (17 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_17_AL (17 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_18_AH (18 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_18_AL (18 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_19_AH (19 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_19_AL (19 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_20_AH (20 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_20_AL (20 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_21_AH (21 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_21_AL (21 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_22_AH (22 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_22_AL (22 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) +#define BP_SERIAL_GPIO_23_AH (23 | BP_GPIO_SERIAL) +#define BP_SERIAL_GPIO_23_AL (23 | BP_GPIO_SERIAL | BP_ACTIVE_LOW) + +/* Values for external interrupt assignments. */ +#define BP_EXT_INTR_0 0 +#define BP_EXT_INTR_1 1 +#define BP_EXT_INTR_2 2 +#define BP_EXT_INTR_3 3 +#define BP_EXT_INTR_4 4 +#define BP_EXT_INTR_5 5 + +/* Values for chip select assignments. */ +#define BP_CS_0 0 +#define BP_CS_1 1 +#define BP_CS_2 2 +#define BP_CS_3 3 + +#define BP_OVERLAY_GPON_TX_EN_L (1<<0) +#define BP_OVERLAY_PCI (1<<0) +#define BP_OVERLAY_CB (1<<1) +#define BP_OVERLAY_SPI_EXT_CS (1<<2) +#define BP_OVERLAY_UART1 (1<<3) +#define BP_OVERLAY_PHY (1<<4) +#define BP_OVERLAY_SERIAL_LEDS (1<<5) +#define BP_OVERLAY_EPHY_LED_0 (1<<6) +#define BP_OVERLAY_EPHY_LED_1 (1<<7) +#define BP_OVERLAY_GPHY_LED_0 (1<<6) +#define BP_OVERLAY_GPHY_LED_1 (1<<7) +#define BP_OVERLAY_EPHY_LED_2 (1<<8) +#define BP_OVERLAY_EPHY_LED_3 (1<<9) +#define BP_OVERLAY_INET_LED (1<<10) +#define BP_OVERLAY_MOCA_LED (1<<11) +#define BP_OVERLAY_USB_LED (1<<12) +#define BP_OVERLAY_USB_DEVICE (1<<13) + +/* Value for GPIO and external interrupt fields that are not used. */ +#define BP_NOT_DEFINED 0xffff + +/* Maximum size of the board id string. */ +#define BP_BOARD_ID_LEN 16 + +/* Maximum number of Ethernet MACs. */ +#define BP_MAX_ENET_MACS 2 +#define BP_MAX_SWITCH_PORTS 8 +/* Maximum number of VoIP DSPs. */ +#define BP_MAX_VOIP_DSP 2 + +/* Wireless Antenna Settings. */ +#define BP_WLAN_ANT_MAIN 0 +#define BP_WLAN_ANT_AUX 1 +#define BP_WLAN_ANT_BOTH 3 + +/* Wireless FLAGS */ +#define BP_WLAN_MAC_ADDR_OVERRIDE 0x0001 /* use kerSysGetMacAddress for mac address */ +#define BP_WLAN_EXCLUDE_ONBOARD 0x0002 /* exclude onboard wireless */ +#define BP_WLAN_EXCLUDE_ONBOARD_FORCE 0x0004 /* force exclude onboard wireless even without addon card*/ +#define BP_WLAN_USE_OTP 0x0008 /* don't use sw srom map, may fall to OTP or uninitialzed */ + +#define BP_WLAN_NVRAM_NAME_LEN 16 +#define BP_WLAN_MAX_PATCH_ENTRY 32 + +/* AFE IDs */ +#define BP_AFE_DEFAULT 0 + +#define BP_AFE_CHIP_INT (1 << 28) +#define BP_AFE_CHIP_6505 (2 << 28) +#define BP_AFE_CHIP_6306 (3 << 28) + +#define BP_AFE_LD_ISIL1556 (1 << 21) +#define BP_AFE_LD_6301 (2 << 21) +#define BP_AFE_LD_6302 (3 << 21) + +#define BP_AFE_FE_ANNEXA (1 << 15) +#define BP_AFE_FE_ANNEXB (2 << 15) +#define BP_AFE_FE_ANNEXJ (3 << 15) + +#define BP_AFE_FE_AVMODE_COMBO (0 << 13) +#define BP_AFE_FE_AVMODE_ADSL (1 << 13) +#define BP_AFE_FE_AVMODE_VDSL (2 << 13) + +/* VDSL only */ +#define BP_AFE_FE_REV_ISIL_REV1 (1 << 8) +/* Combo */ +#define BP_AFE_FE_REV_6302_REV1 (1 << 8) +#define BP_AFE_FE_REV_6302_REV_7_12 (1 << 8) +#define BP_AFE_FE_REV_6302_REV_7_4 (2 << 8) + +#define BP_AFE_FE_REV_6302_REV_7_2_1 (3 << 8) +#define BP_AFE_FE_REV_6302_REV_7_2 (4 << 8) +#define BP_AFE_FE_REV_6302_REV_7_2_UR2 (5 << 8) +#define BP_AFE_FE_REV_6302_REV_7_2_2 (6 << 8) +/* ADSL only*/ +#define BP_AFE_FE_REV_6302_REV_5_2_1 (1 << 8) +#define BP_AFE_FE_REV_6302_REV_5_2_2 (2 << 8) +#define BP_AFE_FE_REV_6301_REV_5_1_1 (1 << 8) + +#define BP_GET_EXT_AFE_DEFINED + +#if !defined(__ASSEMBLER__) + +/* Information about Ethernet switch */ +typedef struct { + int port_map; + int phy_id[BP_MAX_SWITCH_PORTS]; +} ETHERNET_SW_INFO; + +/* WAN port flag in the phy_id of ETHERNET_SW_INFO */ +#define BCM_WAN_PORT 0x40 +#define IsWanPort(id) (((id) & BCM_WAN_PORT) && ((id) != 0xFF)) + +#define c0(n) (((n) & 0x55555555) + (((n) >> 1) & 0x55555555)) +#define c1(n) (((n) & 0x33333333) + (((n) >> 2) & 0x33333333)) +#define c2(n) (((n) & 0x0f0f0f0f) + (((n) >> 4) & 0x0f0f0f0f)) +#define bitcount(r, n) {r = n; r = c0(r); r = c1(r); r = c2(r); r %= 255;} + +/* Information about an Ethernet MAC. If ucPhyType is BP_ENET_NO_PHY, + * then the other fields are not valid. + */ +typedef struct EthernetMacInfo +{ + unsigned char ucPhyType; /* BP_ENET_xxx */ + unsigned char ucPhyAddress; /* 0 to 31 */ + unsigned short usGpioLedPhyLinkSpeed; /* GPIO pin or not defined */ + unsigned short usConfigType; /* Configuration type */ + ETHERNET_SW_INFO sw; /* switch information */ + unsigned short usGpioMDC; /* GPIO pin to simulate MDC */ + unsigned short usGpioMDIO; /* GPIO pin to simulate MDIO */ +} ETHERNET_MAC_INFO, *PETHERNET_MAC_INFO; + +typedef struct WlanSromEntry { + char name[BP_WLAN_NVRAM_NAME_LEN]; + unsigned short wordOffset; + unsigned short value; +} WLAN_SROM_ENTRY; + +typedef struct WlanSromPatchInfo { + char szboardId[BP_BOARD_ID_LEN]; + unsigned short usWirelessChipId; + unsigned short usNeededSize; + WLAN_SROM_ENTRY entries[BP_WLAN_MAX_PATCH_ENTRY]; +} WLAN_SROM_PATCH_INFO, *PWLAN_SROM_PATCH_INFO; + +typedef struct WlanPciEntry { + char name[BP_WLAN_NVRAM_NAME_LEN]; + unsigned int dwordOffset; + unsigned int value; +} WLAN_PCI_ENTRY; + +typedef struct WlanPciPatchInfo { + char szboardId[BP_BOARD_ID_LEN]; + unsigned int usWirelessPciId; + int usNeededSize; + WLAN_PCI_ENTRY entries[BP_WLAN_MAX_PATCH_ENTRY]; +} WLAN_PCI_PATCH_INFO, *PWLAN_PCI_PATCH_INFO; + +/* Information about VoIP DSPs. If ucDspType is BP_VOIP_NO_DSP, + * then the other fields are not valid. + */ +typedef struct VoIPDspInfo +{ + unsigned char ucDspType; + unsigned char ucDspAddress; + unsigned short usGpioLedVoip; + unsigned short usGpioVoip1Led; + unsigned short usGpioVoip1LedFail; + unsigned short usGpioVoip2Led; + unsigned short usGpioVoip2LedFail; + unsigned short usGpioPotsLed; + unsigned short usGpioDectLed; + +} VOIP_DSP_INFO; + +int BpSetBoardId( char *pszBoardId ); +int BpGetBoardId( char *pszBoardId); +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize ); + +int BpGetGPIOverlays( unsigned short *pusValue ); + +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner, unsigned short *pusOuter ); +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts ); + +int BpGetAdslLedGpio( unsigned short *pusValue ); +int BpGetAdslFailLedGpio( unsigned short *pusValue ); +int BpGetSecAdslLedGpio( unsigned short *pusValue ); +int BpGetSecAdslFailLedGpio( unsigned short *pusValue ); +int BpGetWirelessSesLedGpio( unsigned short *pusValue ); +int BpGetHpnaLedGpio( unsigned short *pusValue ); +int BpGetWanDataLedGpio( unsigned short *pusValue ); +int BpGetWanErrorLedGpio( unsigned short *pusValue ); +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue ); +int BpGetBootloaderStopLedGpio( unsigned short *pusValue ); +int BpGetFpgaResetGpio( unsigned short *pusValue ); +int BpGetGponLedGpio( unsigned short *pusValue ); +int BpGetGponFailLedGpio( unsigned short *pusValue ); +int BpGetMoCALedGpio( unsigned short *pusValue ); +int BpGetMoCAFailLedGpio( unsigned short *pusValue ); + +int BpGetResetToDefaultExtIntr( unsigned short *pusValue ); +int BpGetWirelessSesExtIntr( unsigned short *pusValue ); +int BpGetHpnaExtIntr( unsigned long *pulValue ); + +int BpGetHpnaChipSelect( unsigned long *pulValue ); + +int BpGetWirelessAntInUse( unsigned short *pusValue ); +int BpGetWirelessFlags( unsigned short *pusValue ); +int BpGetWirelessPowerDownGpio( unsigned short *pusValue ); +int BpUpdateWirelessSromMap(unsigned short chipID, unsigned short* pBase, int sizeInWords); +int BpUpdateWirelessPciConfig (unsigned long pciID, unsigned long* pBase, int sizeInDWords); + +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos ); +int BpGet6829PortInfo( unsigned char *portInfo6829 ); +int BpGetDslPhyAfeIds( unsigned long *pulValues ); +int BpGetExtAFEResetGpio( unsigned short *pulValues ); +int BpGetExtAFELDPwrGpio( unsigned short *pulValues ); +int BpGetExtAFELDModeGpio( unsigned short *pulValues ); + +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum ); +int BpGetVoipLedGpio( unsigned short *pusValue ); +int BpGetVoip1LedGpio( unsigned short *pusValue ); +int BpGetVoip1FailLedGpio( unsigned short *pusValue ); +int BpGetVoip2LedGpio( unsigned short *pusValue ); +int BpGetVoip2FailLedGpio( unsigned short *pusValue ); +int BpGetPotsLedGpio( unsigned short *pusValue ); +int BpGetDectLedGpio( unsigned short *pusValue ); + +int bpstrcmp(const char *dest,const char *src); + + +#endif /* __ASSEMBLER__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _BOARDPARMS_H */ + diff --git a/shared/opensource/include/bcm963xx/boardparms_voice.h b/shared/opensource/include/bcm963xx/boardparms_voice.h new file mode 100755 index 0000000..5d3c7e5 --- /dev/null +++ b/shared/opensource/include/bcm963xx/boardparms_voice.h @@ -0,0 +1,392 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/************************************************************************** + * File Name : boardparms_voice.h + * + * Description: This file contains definitions and function prototypes for + * the BCM63xx voice board parameter access functions. + * + ***************************************************************************/ + +#if !defined(_BOARDPARMS_VOICE_H) +#define _BOARDPARMS_VOICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#define SI32261ENABLE /* Temporary #def until fully supported */ +#define SI32267ENABLE /* Temporary #def until fully supported */ + +/* Board string defines */ + +#define VOICECFG_NOSLIC_STR "NOSLIC" +#define VOICECFG_LE88276_STR "LE88276" +#define VOICECFG_LE88506_STR "LE88506" +#define VOICECFG_LE9530_STR "LE9530" +#define VOICECFG_VE890_STR "VE890" +#define VOICECFG_SI32178_STR "SI32178" +#define VOICECFG_SI3217X_STR "SI3217X" +#define VOICECFG_SI3226_STR "SI3226" +#define VOICECFG_6328AVNG_LE88276_NTR_STR "LE88276-NTR" +#define VOICECFG_6328AVNG_SI32267_STR "AVNG_SI32267" +#define VOICECFG_6328AVNG_VE890HV_PARTIAL_STR "AVNG_VE890HVP" +#define VOICECFG_6328AVNG_VE890HV_STR "AVNG_VE890HV" + +#define VOICECFG_6328AVNGR_SI32176_STR "AVNGR_SI32176" +#define VOICECFG_6328AVNGR_LE89116_STR "AVNGR_LE89116" +#define VOICECFG_6328AVNGR_SI3217X_STR "AVNGR_SI3217X" + +#define VOICECFG_6368MVWG_STR "MVWG" +#define VOICECFG_6368MBG_LE88276_STR "MBG_LE88276" +#define VOICECFG_6368MBG_LE88506_STR "MBG_LE88506" +#define VOICECFG_6368MBG_VE890_STR "MBG_VE890" +#define VOICECFG_6368MBG_LE89116_STR "MBG_LE89116" +#define VOICECFG_6368MBG_LE89316_STR "MBG_LE89316" +#define VOICECFG_6368MBG_SI3217X_STR "MBG_SI3217X" +#define VOICECFG_6368MBG_SI32176_STR "MBG_SI32176" +#define VOICECFG_6368MBG_SI32178_STR "MBG_SI32178" +#define VOICECFG_6368MBG_SI3226_STR "MBG_SI3226" + +#define VOICECFG_6362ADVNGP5_NOSLIC_STR "ADVNGP5_NOSLIC" +#define VOICECFG_6362ADVNGP5_SI3217X_STR "ADVNGP5_SI3217X" +#define VOICECFG_6362ADVNGP5_SI32176_STR "ADVNGP5_SI32176" +#define VOICECFG_6362ADVNGP5_SI32178_STR "ADVNGP5_SI32178" +#define VOICECFG_6362ADVNGP5_VE890_STR "ADVNGP5_VE890" +#define VOICECFG_6362ADVNGP5_LE89116_STR "ADVNGP5_LE89116" +#define VOICECFG_6362ADVNGP5_LE89316_STR "ADVNGP5_LE89316" +#define VOICECFG_6362ADVNGP5_LE88506_STR "ADVNGP5_LE88506" +#define VOICECFG_6362ADVNGP5_LE88276_STR "ADVNGP5_LE88276" +#define VOICECFG_6362ADVNGP5_SI3226_STR "ADVNGP5_SI3226" + +#define VOICECFG_6362ADVNGR_SI3217X_STR "ADVNGR_SI3217X" +#define VOICECFG_6362ADVNGR_SI32176_STR "ADVNGR_SI32176" +#define VOICECFG_6362ADVNGR_SI32178_STR "ADVNGR_SI32178" +#define VOICECFG_6362ADVNGR_SI3217X_NOFXO_STR "ADVNGR_SI3217XN" +#define VOICECFG_6362ADVNGR_VE890_STR "ADVNGR_VE890" +#define VOICECFG_6362ADVNGR_LE89116_STR "ADVNGR_LE89116" +#define VOICECFG_6362ADVNGR_LE89316_STR "ADVNGR_LE89316" +#define VOICECFG_6362ADVNGR_LE88506_STR "ADVNGR_LE88506" +#define VOICECFG_6362ADVNGR_LE88276_STR "ADVNGR_LE88276" +#define VOICECFG_6362ADVNGR_SI3226_STR "ADVNGR_SI3226" +#define VOICECFG_6362ADVNGR_SI32261_STR "ADVNGR_SI32261" +#define VOICECFG_6362ADVNGR_SI32267_STR "ADVNGR_SI32267" +#define VOICECFG_6362ADVNGR_VE890HV_PARTIAL_STR "ADVNGR_VE890HVP" +#define VOICECFG_6362ADVNGR_VE890HV_STR "ADVNGR_VE890HV" + +#define VOICECFG_6362ADVNGR2_SI3217X_STR "ADVNGR2_SI3217X" +#define VOICECFG_6362ADVNGR2_VE890_STR "ADVNGR2_VE890" +#define VOICECFG_6362ADVNGR2_LE88506_STR "ADVNGR2_LE88506" +#define VOICECFG_6362ADVNGR2_LE88276_STR "ADVNGR2_LE88276" +#define VOICECFG_6362ADVNGR2_SI3226_STR "ADVNGR2_SI3226" + +#define VOICECFG_6368MVNGR_SI3217X_STR "MVNGR_SI3217X" +#define VOICECFG_6368MVNGR_SI32176_STR "MVNGR_SI32176" +#define VOICECFG_6368MVNGR_SI32178_STR "MVNGR_SI32178" +#define VOICECFG_6368MVNGR_SI3217X_NOFXO_STR "MVNGR_SI3217XN" +#define VOICECFG_6368MVNGR_VE890_STR "MVNGR_VE890" +#define VOICECFG_6368MVNGR_LE89116_STR "MVNGR_LE89116" +#define VOICECFG_6368MVNGR_LE89316_STR "MVNGR_LE89316" +#define VOICECFG_6368MVNGR_LE88506_STR "MVNGR_LE88506" +#define VOICECFG_6368MVNGR_LE88276_STR "MVNGR_LE88276" +#define VOICECFG_6368MVNGR_SI3226_STR "MVNGR_SI3226" +#define VOICECFG_6368MVNGR_VE890HV_PARTIAL_STR "MVNGR_VE890HVP" +#define VOICECFG_6368MVNGR_VE890HV_STR "MVNGR_VE890HV" + + +/* Maximum number of devices in the system (on the board). +** Devices can refer to DECT, SLAC/SLIC, or SLAC/DAA combo. */ +#define BP_MAX_VOICE_DEVICES 5 + +/* Maximum numbers of channels per SLAC. */ +#define BP_MAX_CHANNELS_PER_DEVICE 2 + +/* Maximum number of voice channels in the system. +** This represents the sum of all channels available on the devices in the system */ +#define BP_MAX_VOICE_CHAN (BP_MAX_VOICE_DEVICES * BP_MAX_CHANNELS_PER_DEVICE) + +/* Max number of GPIO pins used for controling PSTN failover relays +** Note: the number of PSTN failover relays can be larger if multiple +** relays are controlled by single GPIO */ +#define BP_MAX_RELAY_PINS 2 + +#define BP_TIMESLOT_INVALID 0xFF + +/* General-purpose flag definitions (rename as appropriate) */ +#define BP_FLAG_DSP_APMHAL_ENABLE (1 << 0) +#define BP_FLAG_ISI_SUPPORT (1 << 1) +#define BP_FLAG_MODNAME_TESTNAME2 (1 << 2) +#define BP_FLAG_MODNAME_TESTNAME3 (1 << 3) +#define BP_FLAG_MODNAME_TESTNAME4 (1 << 4) +#define BP_FLAG_MODNAME_TESTNAME5 (1 << 5) +#define BP_FLAG_MODNAME_TESTNAME6 (1 << 6) +#define BP_FLAG_MODNAME_TESTNAME7 (1 << 7) +#define BP_FLAG_MODNAME_TESTNAME8 (1 << 8) + +/* +** Device-specific definitions +*/ +typedef enum +{ + BP_VD_NONE = -1, + BP_VD_IDECT1, /* Do not move this around, otherwise rebuild dect_driver.bin */ + BP_VD_EDECT1, + BP_VD_SILABS_3050, + BP_VD_SILABS_3215, + BP_VD_SILABS_3216, + BP_VD_SILABS_3217, + BP_VD_SILABS_32176, + BP_VD_SILABS_32178, + BP_VD_SILABS_3226, + BP_VD_SILABS_32261, + BP_VD_SILABS_32267, + BP_VD_ZARLINK_88010, + BP_VD_ZARLINK_88221, + BP_VD_ZARLINK_88276, + BP_VD_ZARLINK_88506, + BP_VD_ZARLINK_89010, + BP_VD_ZARLINK_89116, + BP_VD_ZARLINK_89316, + BP_VD_ZARLINK_9530, + BP_VD_ZARLINK_89136, + BP_VD_ZARLINK_89336, + BP_VD_MAX, +} BP_VOICE_DEVICE_TYPE; + + +/* +** Channel-specific definitions +*/ + +typedef enum +{ + BP_VOICE_CHANNEL_ACTIVE, + BP_VOICE_CHANNEL_INACTIVE, +} BP_VOICE_CHANNEL_STATUS; + +typedef enum +{ + BP_VCTYPE_NONE = -1, + BP_VCTYPE_SLIC, + BP_VCTYPE_DAA, + BP_VCTYPE_DECT +} BP_VOICE_CHANNEL_TYPE; + +typedef enum +{ + BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, + BP_VOICE_CHANNEL_SAMPLE_SIZE_8BITS, +} BP_VOICE_CHANNEL_SAMPLE_SIZE; + +typedef enum +{ + BP_VOICE_CHANNEL_NARROWBAND, + BP_VOICE_CHANNEL_WIDEBAND, +} BP_VOICE_CHANNEL_FREQRANGE; + + +typedef enum +{ + BP_VOICE_CHANNEL_ENDIAN_BIG, + BP_VOICE_CHANNEL_ENDIAN_LITTLE, +} BP_VOICE_CHANNEL_ENDIAN_MODE; + +typedef enum +{ + BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, + BP_VOICE_CHANNEL_PCMCOMP_MODE_ULAW, +} BP_VOICE_CHANNEL_PCMCOMP_MODE; + + +typedef struct +{ + unsigned int status; /* active/inactive */ + unsigned int type; /* SLIC/DAA/DECT */ + unsigned int pcmCompMode; /* u-law/a-law (applicable for 8-bit samples) */ + unsigned int freqRange; /* narrowband/wideband */ + unsigned int sampleSize; /* 8-bit / 16-bit */ + unsigned int endianMode; /* big/little */ + unsigned int rxTimeslot; /* Receive timeslot for the channel */ + unsigned int txTimeslot; /* Sending timeslot for the channel */ + +} BP_VOICE_CHANNEL; + +/* TODO: This structure could possibly be turned into union if needed */ +typedef struct +{ + int spiDevId; /* SPI device id */ + unsigned short spiGpio; /* SPI GPIO (if used for SPI control) */ +} BP_VOICE_SPI_CONTROL; + +typedef struct +{ + unsigned short relayGpio[BP_MAX_RELAY_PINS]; +} BP_PSTN_RELAY_CONTROL; + +typedef struct +{ + unsigned short dectUartGpioTx; + unsigned short dectUartGpioRx; +} BP_DECT_UART_CONTROL; + +typedef struct +{ + unsigned int voiceDeviceType; /* Specific type of device (Le88276, Si32176, etc.) */ + BP_VOICE_SPI_CONTROL spiCtrl; /* SPI control through dedicated SPI pin or GPIO */ + int requiresReset; /* Does the device requires reset (through GPIO) */ + unsigned short resetGpio; /* Reset GPIO */ + BP_VOICE_CHANNEL channel[BP_MAX_CHANNELS_PER_DEVICE]; /* Device channels */ + +} BP_VOICE_DEVICE; + + +/* +** Main structure for defining the board parameters and used by boardHal +** for proper initialization of the DSP and devices (SLACs, DECT, etc.) +*/ +typedef struct VOICE_BOARD_PARMS +{ + char szBoardId[BP_BOARD_ID_LEN]; /* board id string */ + unsigned int numFxsLines; /* Number of FXS lines in the system */ + unsigned int numFxoLines; /* Number of FXO lines in the system */ + unsigned int numDectLines; /* Number of DECT lines in the system */ + unsigned int numFailoverRelayPins; /* Number of GPIO pins controling PSTN failover relays */ + BP_VOICE_DEVICE voiceDevice[BP_MAX_VOICE_DEVICES]; /* Voice devices in the system */ + BP_PSTN_RELAY_CONTROL pstnRelayCtrl; /* Control for PSTN failover relays */ + BP_DECT_UART_CONTROL dectUartControl; /* Control for external DECT UART */ + unsigned int flags; /* General-purpose flags */ +} VOICE_BOARD_PARMS, *PVOICE_BOARD_PARMS; + +/* --- End of voice-specific structures and enums --- */ + +int BpGetVoiceParms( char* pszBoardId, VOICE_BOARD_PARMS* voiceParms ); +int BpSetVoiceBoardId( char *pszBoardId ); +int BpGetVoiceBoardId( char *pszBoardId ); +int BpGetVoiceBoardIds( char *pszBoardIds, int nBoardIdsSize ); + +/* Variable externs */ + +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) + +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3226; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3217X; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88506; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI32267; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276_NTR; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV_Partial; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV; + +extern VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI32176; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNGR_LE89116; +extern VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI3217X; + +#endif + +#if defined(_BCM96362_) || defined(CONFIG_BCM96362) + +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_NOSLIC; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_VE890; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89116; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89316; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3217X; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32176; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32178; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3226; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88506; + +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32176; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32178; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X_NOFXO; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89116; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89316; + +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88506; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3226; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32261; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32267; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HVP; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HV; + +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3217X; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_VE890; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88506; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3226; + +#endif + +#if defined(_BCM96368_) || defined(CONFIG_BCM96368) + +extern VOICE_BOARD_PARMS voiceBoard_96368MVWG; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88506; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_VE890; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89116; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89316; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3217X; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32176; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32178; +extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3226; + +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32176; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32178; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X_NOFXO; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89116; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89316; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88506; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3226; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV_Partial; +extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV; + +#endif + + +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) + +extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88276; +extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_SI3226; +extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88506; +extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE9530; + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _BOARDPARMS_VOICE_H */ + diff --git a/shared/opensource/include/bcm963xx/fap_mod_size.h b/shared/opensource/include/bcm963xx/fap_mod_size.h new file mode 100644 index 0000000..03bb799 --- /dev/null +++ b/shared/opensource/include/bcm963xx/fap_mod_size.h @@ -0,0 +1,2 @@ +#define FAP_CORE_SIZE 0 +#define FAP_INIT_SIZE 0 diff --git a/shared/opensource/include/bcm963xx/flash_api.h b/shared/opensource/include/bcm963xx/flash_api.h new file mode 100755 index 0000000..7ac8022 --- /dev/null +++ b/shared/opensource/include/bcm963xx/flash_api.h @@ -0,0 +1,90 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/*************************************************************************** + * File Name : flash_api.h + * + * Description: This file contains definitions and prototypes for a public + * flash device interface and an internal flash device interface. + ***************************************************************************/ + +#if !defined(_FLASH_API_H) +#define _FLASH_API_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Flash definitions. */ +#define FLASH_API_OK 1 +#define FLASH_API_ERROR -1 + +#define FLASH_IFC_UNKNOWN 0 +#define FLASH_IFC_PARALLEL 1 +#define FLASH_IFC_SPI 2 +#define FLASH_IFC_HS_SPI 3 +#define FLASH_IFC_NAND 4 + +#define NAND_REINIT_FLASH 0xffff + +/* Public Interface Prototypes. */ +int flash_init(void); +int flash_sector_erase_int(unsigned short sector); +int flash_read_buf(unsigned short sector, int offset, unsigned char *buffer, + int numbytes); +int flash_write_buf(unsigned short sector, int offset, unsigned char *buffer, + int numbytes); +int flash_get_numsectors(void); +int flash_get_sector_size(unsigned short sector); +unsigned char *flash_get_memptr(unsigned short sector); +int flash_get_blk(int addr); +int flash_get_total_size(void); +int flash_get_flash_type(void); +void flash_change_flash_type(int type); + +/* Internal Flash Device Driver Information. */ +typedef struct flash_device_info_s +{ + unsigned short flash_device_id; + unsigned short flash_type; + char flash_device_name[30]; + + int (*fn_flash_sector_erase_int) (unsigned short sector); + int (*fn_flash_read_buf) (unsigned short sector, int offset, + unsigned char *buffer, int numbytes); + int (*fn_flash_write_buf) (unsigned short sector, int offset, + unsigned char *buffer, int numbytes); + int (*fn_flash_get_numsectors) (void); + int (*fn_flash_get_sector_size) (unsigned short sector); + unsigned char * (*fn_flash_get_memptr) (unsigned short sector); + int (*fn_flash_get_blk) (int addr); + int (*fn_flash_get_total_size) (void); +} flash_device_info_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _FLASH_API_H */ + diff --git a/shared/opensource/include/bcm963xx/flash_common.h b/shared/opensource/include/bcm963xx/flash_common.h new file mode 100755 index 0000000..4fcceca --- /dev/null +++ b/shared/opensource/include/bcm963xx/flash_common.h @@ -0,0 +1,103 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +/*!\file flash_common.h + * \brief This file contains definitions and prototypes used by both + * CFE and kernel. + * + */ + +#if !defined(_FLASH_COMMON_H) +#define _FLASH_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/** default scratch pad length */ +#define SP_MAX_LEN (8 * 1024) + + +/** Flash storage address information that is determined by the flash driver. + * + * This structure is used by CFE and kernel. + */ +typedef struct flashaddrinfo +{ + int flash_persistent_start_blk; /**< primary psi, for config file */ + int flash_persistent_number_blk; + int flash_persistent_length; /**< in bytes */ + unsigned long flash_persistent_blk_offset; + int flash_scratch_pad_start_blk; /**< start of scratch pad */ + int flash_scratch_pad_number_blk; + int flash_scratch_pad_length; /**< in bytes */ + unsigned long flash_scratch_pad_blk_offset; + unsigned long flash_rootfs_start_offset; /**< offset from start of flash to fs+kernel image */ + int flash_backup_psi_start_blk; /**< starting block of backup psi. Length is + the same as primary psi. + Start at begining of sector, so offset is always 0. + No sharing sectors with anybody else. */ + int flash_backup_psi_number_blk; /**< The number of sectors for primary and backup + * psi may be different due to the irregular + * sector sizes at the end of the flash. */ + int flash_syslog_start_blk; /**< starting block of persistent syslog. */ + int flash_syslog_number_blk; /**< number of blocks */ + int flash_syslog_length; /**< in bytes, set from CFE, note busybox syslogd uses 16KB buffer. + Like backup_psi, always start at beginning of sector, + so offset is 0, and no sharing of sectors. */ + int flash_meta_start_blk; /**< The first block which is used for meta info such + as the psi, scratch pad, syslog, backup psi. + The kernel can use everything above this sector. */ +} FLASH_ADDR_INFO, *PFLASH_ADDR_INFO; + + +/** Fill in the fInfo structure with primary PSI, scratch pad, syslog, secondary PSI info. + * + * @param nvRam (IN) nvram info. + * @param fInfo (OUT) flash addr info that will be filled out by this function. + */ +void flash_init_info(const NVRAM_DATA *nvRam, FLASH_ADDR_INFO *fInfo); + + +/** Get the total number of bytes at the bottom of the flash used for PSI, scratch pad, etc. + * + * Even though this function is returning the number of bytes, it it guaranteed to + * return the number of bytes of whole sectors at the end which are in use. + * If customer enables backup PSI and persistent syslog, the number of bytes + * may go above 64KB. This function replaces the old FLASH_RESERVED_AT_END define. + * + * @param fInfo (IN) Pointer to flash_addr_info struct. + * + * @return number of bytes reserved at the end. + */ +unsigned int flash_get_reserved_bytes_at_end(const FLASH_ADDR_INFO *fInfo); + + +#ifdef __cplusplus +} +#endif + +#endif /* _FLASH_COMMON_H */ + diff --git a/shared/opensource/include/bcm963xx/gpio_drv.h b/shared/opensource/include/bcm963xx/gpio_drv.h new file mode 100755 index 0000000..8131153 --- /dev/null +++ b/shared/opensource/include/bcm963xx/gpio_drv.h @@ -0,0 +1,40 @@ +/*************************************************************************** +*** +*** Copyright 2008 Hon Hai Precision Ind. Co. Ltd. +*** All Rights Reserved. +*** No portions of this material shall be reproduced in any form without the +*** written permission of Hon Hai Precision Ind. Co. Ltd. +*** +*** All information contained in this document is Hon Hai Precision Ind. +*** Co. Ltd. company private, proprietary, and trade secret property and +*** are protected by international intellectual property laws and treaties. +*** +****************************************************************************/ + +#ifndef __GPIO_DRV_H__ +#define __GPIO_DRV_H__ + +#define DEV_GPIO_DRV "gpio_drv" + +#define GPIO_IOCTL_NUM 'W' + +#define IOCTL_LAN_LED_STATE _IOWR(GPIO_IOCTL_NUM, 0, int *) +#define IOCTL_USB_LED_STATE _IOWR(GPIO_IOCTL_NUM, 1, int *) +#define IOCTL_WPS_LED_STATE _IOWR(GPIO_IOCTL_NUM, 2, int *) +#define IOCTL_VOIP_LED_OFF _IOWR(GPIO_IOCTL_NUM, 3, int *) +#define IOCTL_VOIP_LED_ON _IOWR(GPIO_IOCTL_NUM, 4, int *) +#define IOCTL_VOIP_LED_BS _IOWR(GPIO_IOCTL_NUM, 5, int *) +#define IOCTL_VOIP_LED_BF _IOWR(GPIO_IOCTL_NUM, 6, int *) +#define IOCTL_VOIP_LED_BN _IOWR(GPIO_IOCTL_NUM, 7, int *) +#define IOCTL_WAN_LED_STATE _IOWR(GPIO_IOCTL_NUM, 8, int *) +#define IOCTL_LAN_VLAN_ID _IOWR(GPIO_IOCTL_NUM, 9, int *) +#define IOCTL_WAN_VLAN_ID _IOWR(GPIO_IOCTL_NUM, 10, int *) +#define IOCTL_3G_LED_STATE _IOWR(GPIO_IOCTL_NUM, 11, int *) //Foxconn added, Neil Chen, 2009/11/2 +/* Foxconn added start Bob, 01/28/2010, for wan detection */ +#define IOCTL_PVC_DET_START _IOWR(GPIO_IOCTL_NUM, 12, int *) +#define IOCTL_PVC_DET_STOP _IOWR(GPIO_IOCTL_NUM, 13, int *) +#define IOCTL_PVC_DET_RESULT _IOWR(GPIO_IOCTL_NUM, 14, int *) +/* Foxconn added end Bob, 01/28/2010, for wan detection */ +#define IOCTL_LAN_UNTAGGED_VLAN_ID _IOWR(GPIO_IOCTL_NUM, 15, int *) /* Foxconn added Bob, 10/25/2010, for tag based vlan */ + +#endif /* __GPIO_DRV_H__ */ diff --git a/shared/opensource/include/bcm963xx/wan_det.h b/shared/opensource/include/bcm963xx/wan_det.h new file mode 100755 index 0000000..d8a5645 --- /dev/null +++ b/shared/opensource/include/bcm963xx/wan_det.h @@ -0,0 +1,245 @@ +/*************************************************************************** +*** +*** Copyright 2008 Hon Hai Precision Ind. Co. Ltd. +*** All Rights Reserved. +*** No portions of this material shall be reproduced in any form without the +*** written permission of Hon Hai Precision Ind. Co. Ltd. +*** +*** All information contained in this document is Hon Hai Precision Ind. +*** Co. Ltd. company private, proprietary, and trade secret property and +*** are protected by international intellectual property laws and treaties. +*** +****************************************************************************/ + +#ifndef __WAN_DET_H__ +#define __WAN_DET_H__ + +/* Foxconn added start Bob, 01/22/2010 */ + +#define MAX_SCAN_SERVICE 8 + +typedef struct _vpivcitable +{ + int portId; + int vpi; + int vci; +}_VpiVciTable; + + +typedef struct scanResult +{ + _VpiVciTable service[MAX_SCAN_SERVICE]; + _VpiVciTable oam; + _VpiVciTable BPDU; +}SCAN_RESULT; +/* Foxconn added end Bob, 01/22/2010 */ + +typedef unsigned short U16; +typedef unsigned int U32; +typedef unsigned char U8; + +#define PATTERN_ROUTED 0 +#define PATTERN_BRIDGED 1 + +#define ETHER_TYPE_OFFSET 12 +#define ETHERTYPE_IP 0x0800 +#define ETHERTYPE_ARP 0x0806 +#define ETHERTYPE_PPPOE_DISCOVERY 0x8863 +#define ETHERHEADER_LEN 14 + +typedef struct _PacketContent +{ + U32 length; + U8 *data; +}PacketContent; + +typedef struct _Pattern +{ + const char *name; + const PacketContent *payload; + int protoType; + U16 ethertype; + const PacketContent *header; + const PacketContent *expected_payload; + +}Pattern; + + +static U8 dhcp_request_bytes[] = { + + // IP header + 0x45, 0x00, 0x01, 0x48, // version, IHL, TOS, Total Length + 0x00, 0x04, 0x00, 0x00, // ident, flags, frag off + 0x9b, 0x11, 0x1e, 0xa2, // TTL, proto, hdr checksum + 0x00, 0x00, 0x00, 0x00, // source addr + 0xff, 0xff, 0xff, 0xff, // destination addr + + // UDP header + 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, 0xe6, 0x9a, 0x01, 0x01, 0x06, 0x00, + 0xb3, 0x05, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x2b, 0x00, 0x74, 0xb1, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, 0x53, 0x63, 0x35, 0x01, 0x01, 0x33, + 0x04, 0x00, 0x00, 0x1c, 0x20, 0x37, 0x07, 0x01, 0x1c, 0x02, 0x03, 0x0f, 0x06, 0x0c, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +}; + +static PacketContent dhcp_request = { sizeof(dhcp_request_bytes), dhcp_request_bytes +}; + +static U8 pppoe_padi_bytes[] = { + 0x11, 0x09, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +static PacketContent pppoe_padi = { sizeof(pppoe_padi_bytes), pppoe_padi_bytes }; + +/** Sequence of bytes for a PPP LCP Configure-Request (RFC1661). */ +static U8 ppp_lcp_confreq_bytes[] = { + 0xc0, 0x21, // LCP + 0x01, // Configure Request + 0x99, // randomish identifier + 0x00, 0x04, // length +}; +static PacketContent ppp_lcp_confreq = { sizeof(ppp_lcp_confreq_bytes), ppp_lcp_confreq_bytes }; + +/** Expected response from NULL (aka VcMux) encapsulated PPP/LCP */ +static U8 ppp_lcp_response_bytes[] = { 0xc0, 0x21 }; +static PacketContent ppp_lcp_response = { sizeof(ppp_lcp_response_bytes), ppp_lcp_response_bytes }; + +/** SNAP/LLC routed */ +static U8 snap_llc_routed_bytes[] = { 0xaa, 0xaa, 3, 0, 0, 0, 8, 0 }; +static PacketContent snap_llc_routed = { sizeof(snap_llc_routed_bytes), snap_llc_routed_bytes }; + +/** SNAP/LLC bridged, no fcs */ +static U8 snap_llc_bridged_bytes[] = { + 0xaa, 0xaa, 0x3, // LLC + 0x0, 0x80, 0xc2, // OUI + 0x00, 0x07, // PID + 0x00, 0x00 // PAD + }; +static PacketContent snap_llc_bridged = { sizeof(snap_llc_bridged_bytes), snap_llc_bridged_bytes }; + +/* foxconn added start Bob, 12/07/2009, ignore BPDU frame */ +/** SNAP/LLC bridged BPDU */ +static U8 snap_llc_bridged_BPDU_bytes[] = { + 0xaa, 0xaa, 0x3, // LLC + 0x0, 0x80, 0xc2, // OUI + 0x00, 0x0e, // PID + }; + /* foxconn added end Bob, 12/07/2009, ignore BPDU frame */ + +/** LLC for PPPoA. See RFC2364 section 6. */ +static U8 llc_pppoa_bytes[] = { 0xfe, 0xfe, 0x03, 0xcf }; +static PacketContent llc_pppoa = { + sizeof(llc_pppoa_bytes), llc_pppoa_bytes +}; + +static U8 vcmux_bridged_bytes[] = { 0, 0 }; +static PacketContent vcmux_bridged = { sizeof(vcmux_bridged_bytes), vcmux_bridged_bytes }; + +/** +Patterns to be sent to CO side +1. PPPoE LLC Bridged +2. VcMux encapsulated PPPoA +3. LLC encapsulated PPPoA +4. RFC1483 SNAP/LLC Routed +5. RFC1483 VcMux Bridged +6. PPPoE VCMux Bridged +7. RFC1483 SNAP/LLC Bridged +8. RFC1483 VcMux Routed +*/ +static Pattern patterns[] = +{ + { + "PPPoE LLC Bridged", + &pppoe_padi, + PATTERN_BRIDGED, + ETHERTYPE_PPPOE_DISCOVERY, + &snap_llc_bridged, + NULL + }, + { + "VcMux encapsulated PPPoA", + &ppp_lcp_confreq, + PATTERN_ROUTED, + 0, // no need for etherheader! + NULL, + &ppp_lcp_response + }, + + { + "LLC encapsulated PPPoA", + &ppp_lcp_confreq, + PATTERN_ROUTED, + 0, // no need for etherheader! + &llc_pppoa, // encapsulated with PPPoA LLC header + NULL + }, + + /* RFC1483 SNAP/LLC routed */ + { + "RFC1483 SNAP/LLC Routed", + &dhcp_request, + PATTERN_ROUTED, + 0, + &snap_llc_routed, + NULL + }, + + /* RFC1483 VC mux bridged */ + { + "RFC1483 VcMux Bridged", + &dhcp_request, + PATTERN_BRIDGED, + ETHERTYPE_IP, + &vcmux_bridged, + NULL + }, + + /* PPPOE VCMux Bridged*/ + { + "PPPoE VCMux Bridged", + &pppoe_padi, + PATTERN_BRIDGED, + ETHERTYPE_PPPOE_DISCOVERY, + &vcmux_bridged, + NULL + }, + + /* RFC1483 SNAP/LLC bridged */ + { + "RFC1483 SNAP/LLC Bridged", + &dhcp_request, + PATTERN_BRIDGED, + ETHERTYPE_IP, + &snap_llc_bridged, + NULL + }, + + /* RFC1483 VC mux routed */ + { + "RFC1483 VcMux Routed", + &dhcp_request, + PATTERN_ROUTED, + 0, + NULL, + NULL + }, +}; + +#endif /* __WAN_DET_H__ */ diff --git a/shared/opensource/include/bcm963xx/wps_led.h b/shared/opensource/include/bcm963xx/wps_led.h new file mode 100755 index 0000000..69f8682 --- /dev/null +++ b/shared/opensource/include/bcm963xx/wps_led.h @@ -0,0 +1,28 @@ +/*************************************************************************** +*** +*** Copyright 2007 Hon Hai Precision Ind. Co. Ltd. +*** All Rights Reserved. +*** No portions of this material shall be reproduced in any form without the +*** written permission of Hon Hai Precision Ind. Co. Ltd. +*** +*** All information contained in this document is Hon Hai Precision Ind. +*** Co. Ltd. company private, proprietary, and trade secret property and +*** are protected by international intellectual property laws and treaties. +*** +****************************************************************************/ + +#ifndef __WPS_LED_H__ +#define __WPS_LED_H__ + +#define DEV_GPIO_DRV "wps_led" + +#define WPS_LED_IOCTL_NUM 'W' + +#define WPS_LED_BLINK_NORMAL _IOWR(WPS_LED_IOCTL_NUM, 0, int *) +#define WPS_LED_BLINK_QUICK _IOWR(WPS_LED_IOCTL_NUM, 1, int *) +#define WPS_LED_BLINK_OFF _IOWR(WPS_LED_IOCTL_NUM, 2, int *) +#define WPS_LED_CHANGE_GREEN _IOWR(WPS_LED_IOCTL_NUM, 3, int *) +#define WPS_LED_CHANGE_AMBER _IOWR(WPS_LED_IOCTL_NUM, 4, int *) +#define WPS_LED_BLINK_QUICK2 _IOWR(WPS_LED_IOCTL_NUM, 5, int *) + +#endif diff --git a/shared/opensource/spi/Makefile b/shared/opensource/spi/Makefile new file mode 100755 index 0000000..b3eb2b1 --- /dev/null +++ b/shared/opensource/spi/Makefile @@ -0,0 +1,30 @@ + +ifeq ($(CONFIG_MIPS_BRCM),y) + +ifeq ($(strip $(BRCM_CHIP)),6362) +obj-y += \ + bcmHsSpi.o +else +ifeq ($(strip $(BRCM_CHIP)),6816) +obj-y += \ + bcmHsSpi.o +else +ifeq ($(strip $(BRCM_CHIP)),6328) +obj-y += \ + bcmHsSpi.o +endif +endif +endif + +ifneq ($(strip $(BRCM_CHIP)),6328) +obj-y += \ + bcmLegSpi.o +endif + +obj-y += \ + bcmSpiRes.o + +EXTRA_CFLAGS += -DCONFIG_BCM9$(BRCM_CHIP) -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) -I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) + +endif + diff --git a/shared/opensource/spi/bcmHsSpi.c b/shared/opensource/spi/bcmHsSpi.c new file mode 100755 index 0000000..b32e9fc --- /dev/null +++ b/shared/opensource/spi/bcmHsSpi.c @@ -0,0 +1,898 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "bcm_map.h" +#define printk printf +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#endif + +/* if HS_SPI is defined then the HS SPI controller is available, otherwise do not compile this code */ + +#ifdef HS_SPI + +#include "bcmSpiRes.h" +#include "bcmSpi.h" + +int BcmHsSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz); +int BcmHsSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz); + +#define HS_SPI_STATE_CLOCK_POLARITY (1 << 31) +#define HS_SPI_STATE_GATE_CLOCK_SSOFF (1 << 30) +#define HS_SPI_STATE_LAUNCH_RISING (1 << 29) +#define HS_SPI_STATE_LATCH_RISING (1 << 28) +#define HS_SPI_STATE_ASYNC_CLOCK (1 << 27) +#if defined(_BCM96816_) || defined(CONFIG_BCM96816) +#define HS_SPI_CONTROLLER_STATE_DEF (HS_SPI_STATE_GATE_CLOCK_SSOFF) +#endif +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) +#define HS_SPI_CONTROLLER_STATE_DEF (HS_SPI_STATE_GATE_CLOCK_SSOFF | HS_SPI_STATE_LATCH_RISING) +#endif +#if defined(_BCM96362_) || defined(CONFIG_BCM96362) +#define HS_SPI_CONTROLLER_STATE_DEF (HS_SPI_STATE_GATE_CLOCK_SSOFF | HS_SPI_STATE_LATCH_RISING | HS_SPI_STATE_ASYNC_CLOCK) +#endif + + +#ifndef _CFE_ +//#define HS_SPI_USE_INTERRUPTS /* define this to use interrupts instead of polling */ +static struct bcmspi BcmHsSpi = { SPIN_LOCK_UNLOCKED, + "bcmHsSpiDev", + }; +#else +#define udelay(X) \ + do { { int i; for( i = 0; i < (X) * 500; i++ ) ; } } while(0) +#endif + +static int hsSpiRead( unsigned char *pRxBuf, int prependcnt, int nbytes, int devId ) +{ + uint16 msgCtrl; + + HS_SPI_PROFILES[devId].mode_ctrl = prependcnt<command = devId<command = devId<0; wait--) + { + if (!(HS_SPI_PINGPONG0->status & 1<hs_spiIntStatus = HS_SPI_INTR_CLEAR_ALL; +} + +#ifdef HS_SPI_USE_INTERRUPTS +static void hsSpiEnableInt(bool bEnable) +{ + if ( bEnable ) + { + HS_SPI->hs_spiIntMask = HS_SPI_IRQ_PING0_CMD_DONE; + } + else + { + HS_SPI->hs_spiIntMask = 0; + } +} +#endif + +#ifndef _CFE_ +static int hsSpiSetClock( int clockHz, int profile ) +{ + int clock; + + clock = HS_SPI_PLL_FREQ/clockHz; + if (HS_SPI_PLL_FREQ%HS_SPI_CLOCK_DEF) + clock++; + + clock = 2048/clock; + if (2048%(clock)) + clock++; + + HS_SPI_PROFILES[profile].clk_ctrl = 1<hs_spiGlobalCtrl; + if ( 0 == (ctrlState & HS_SPI_STATE_GATE_CLOCK_SSOFF) ) + { + temp32 &= ~HS_SPI_CLK_GATE_SSOFF; + } + else + { + temp32 |= HS_SPI_CLK_GATE_SSOFF; + } +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362) + if ( 0 == (ctrlState & HS_SPI_STATE_CLOCK_POLARITY) ) + { + temp32 &= ~HS_SPI_CLK_POLARITY; + } + else + { + temp32 |= HS_SPI_CLK_POLARITY; + } +#endif + /* write value if required */ + if ( temp32 != HS_SPI->hs_spiGlobalCtrl ) + { + HS_SPI->hs_spiGlobalCtrl = temp32; + } + + temp32 = HS_SPI_PROFILES[devId].signal_ctrl; + if ( 0 == (ctrlState & HS_SPI_STATE_LATCH_RISING) ) + { + temp32 &= ~HS_SPI_LATCH_RISING; + } + else + { + temp32 |= HS_SPI_LATCH_RISING; + } + if ( 0 == (ctrlState & HS_SPI_STATE_LAUNCH_RISING) ) + { + temp32 &= ~HS_SPI_LAUNCH_RISING; + } + else + { + temp32 |= HS_SPI_LAUNCH_RISING; + } + +#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362) + if ( 0 == (ctrlState & HS_SPI_STATE_ASYNC_CLOCK) ) + { + temp32 &= ~HS_SPI_ASYNC_INPUT_PATH; + } + else + { + temp32 |= HS_SPI_ASYNC_INPUT_PATH; + } +#endif + + /* write value if required */ + if ( temp32 != HS_SPI_PROFILES[devId].signal_ctrl ) + { + HS_SPI_PROFILES[devId].signal_ctrl = temp32; + } + +} +#endif + +/* these interfaces are availble for the CFE and spi flash driver only + all modules must use the linux kernel framework + if this is called by a module and interrupts are being used there will + be a problem */ +int BcmHsSpiRead( unsigned char *msg_buf, int prependcnt, int nbytes, int devId, int freqHz ) +{ +#ifndef _CFE_ + struct bcmspi *pBcmSpi = &BcmHsSpi; + + if ( pBcmSpi->irq ) + { + printk("BcmHsSpiRead error - Interrupts are enabled\n"); + return( SPI_STATUS_ERR ); + } + + spin_lock(&pBcmSpi->lock); + hsSpiSetControllerState(HS_SPI_CONTROLLER_STATE_DEF, devId); + hsSpiSetClock(freqHz, devId); +#endif + hsSpiClearIntStatus(); + hsSpiRead(msg_buf, prependcnt, nbytes, devId); + hsSpiTransPoll(); + hsSpiTransEnd(msg_buf, nbytes); + hsSpiClearIntStatus(); +#ifndef _CFE_ + spin_unlock(&pBcmSpi->lock); +#endif + + return( SPI_STATUS_OK ); +} + +int BcmHsSpiWrite( unsigned char *msg_buf, int nbytes, int devId, int freqHz ) +{ +#ifndef _CFE_ + struct bcmspi *pBcmSpi = &BcmHsSpi; + + if ( pBcmSpi->irq ) + { + printk("BcmHsSpiWrite error - Interrupts are enabled\n"); + return( SPI_STATUS_ERR ); + } + + spin_lock(&pBcmSpi->lock); + hsSpiSetControllerState(HS_SPI_CONTROLLER_STATE_DEF, devId); + hsSpiSetClock(freqHz, devId); +#endif + hsSpiClearIntStatus(); + hsSpiWriteFull(msg_buf, nbytes, devId, BCM_SPI_WRITE); + hsSpiTransPoll(); + hsSpiTransEnd(msg_buf, nbytes); + hsSpiClearIntStatus(); +#ifndef _CFE_ + spin_unlock(&pBcmSpi->lock); +#endif + + return( SPI_STATUS_OK ); +} + + +#ifndef _CFE_ +static void hsSpiNextMessage(struct bcmspi *pBcmSpi); + +static void hsSpiMsgDone(struct bcmspi *pBcmSpi, struct spi_message *msg, int status) +{ + list_del(&msg->queue); + msg->status = status; + + spin_unlock(&pBcmSpi->lock); + msg->complete(msg->context); + spin_lock(&pBcmSpi->lock); + + pBcmSpi->curTrans = NULL; + + /* continue if needed */ + if (list_empty(&pBcmSpi->queue) || pBcmSpi->stopping) + { + // disable controler ... + } + else + { + hsSpiNextMessage(pBcmSpi); + } +} + +#ifdef HS_SPI_USE_INTERRUPTS +static void hsSpiIntXfer(struct bcmspi *pBcmSpi, struct spi_message *msg) +{ + struct spi_transfer *xfer; + struct spi_transfer *nextXfer; + int length; + int prependCnt; + char *pTxBuf; + char *pRxBuf; + int opCode; + + xfer = pBcmSpi->curTrans; + if ( NULL == xfer) + { + xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list); + } + else + { + xfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list); + } + pBcmSpi->curTrans = xfer; + + length = xfer->len; + prependCnt = 0; + pRxBuf = xfer->rx_buf; + pTxBuf = (unsigned char *)xfer->tx_buf; + + if ( (NULL != pRxBuf) && (NULL != pTxBuf) ) + { + opCode = BCM_SPI_FULL; + } + else if ( NULL != pRxBuf ) + { + opCode = BCM_SPI_READ; + } + else + { + opCode = BCM_SPI_WRITE; + } + + if ( msg->state ) + { + /* this controller does not support keeping the chip select active for all transfers + non NULL state indicates that we need to combine the transfers */ + nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list); + prependCnt = length; + length = nextXfer->len; + pRxBuf = nextXfer->rx_buf; + opCode = BCM_SPI_READ; + pBcmSpi->curTrans = nextXfer; + } + + hsSpiSetClock(xfer->speed_hz, msg->spi->chip_select); + + hsSpiClearIntStatus(); + hsSpiEnableInt(TRUE); + if ( BCM_SPI_READ == opCode ) + { + hsSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select); + } + else + { + hsSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode); + } + + return; + +} +#endif + +static void hsSpiPollXfer(struct bcmspi *pBcmSpi, struct spi_message *msg) +{ + struct spi_transfer *xfer; + struct spi_transfer *nextXfer; + int length; + int prependCnt; + char *pTxBuf; + char *pRxBuf; + int opCode; + + list_for_each_entry(xfer, &msg->transfers, transfer_list) + { + pBcmSpi->curTrans = xfer; + length = xfer->len; + prependCnt = 0; + pRxBuf = xfer->rx_buf; + pTxBuf = (unsigned char *)xfer->tx_buf; + + if ( (NULL != pRxBuf) && (NULL != pTxBuf) ) + { + opCode = BCM_SPI_FULL; + } + else if ( NULL != pRxBuf ) + { + opCode = BCM_SPI_READ; + } + else + { + opCode = BCM_SPI_WRITE; + } + + if ( msg->state ) + { + /* this controller does not support keeping the chip select active for all transfers + non NULL state indicates that we need to combine the transfers */ + nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list); + prependCnt = length; + length = nextXfer->len; + pRxBuf = nextXfer->rx_buf; + opCode = BCM_SPI_READ; + xfer = nextXfer; + } + + hsSpiSetClock(xfer->speed_hz, msg->spi->chip_select); + + hsSpiClearIntStatus(); + if ( BCM_SPI_READ == opCode ) + { + hsSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select); + } + else + { + hsSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode); + } + + hsSpiTransPoll(); + hsSpiTransEnd(pRxBuf, length); + hsSpiClearIntStatus(); + + if (xfer->delay_usecs) + { + udelay(xfer->delay_usecs); + } + + msg->actual_length += length; + } + + hsSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK); + +} + + +static void hsSpiNextXfer(struct bcmspi *pBcmSpi, struct spi_message *msg) +{ +#ifdef HS_SPI_USE_INTERRUPTS + if (pBcmSpi->irq) + hsSpiIntXfer(pBcmSpi, msg); + else +#endif + hsSpiPollXfer(pBcmSpi, msg); +} + +static void hsSpiNextMessage(struct bcmspi *pBcmSpi) +{ + struct spi_message *msg; + unsigned int ctrlState; + + BUG_ON(pBcmSpi->curTrans); + + msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue); + + /* set the controller state for this message */ + ctrlState = (unsigned int)spi_get_ctldata(msg->spi); + hsSpiSetControllerState(ctrlState, msg->spi->chip_select); + + /* there will always be one transfer in a given message */ + hsSpiNextXfer(pBcmSpi, msg); + +} + + +static int hsSpiSetup(struct spi_device *spi) +{ + struct bcmspi *pBcmSpi; + unsigned int spiCtrlData; + unsigned int spiCtrlState = 0; + + pBcmSpi = spi_master_get_devdata(spi->master); + + if (pBcmSpi->stopping) + return -ESHUTDOWN; + + spiCtrlData = (unsigned int)spi->controller_data; + if ( 0 == spiCtrlData ) + { + spiCtrlState = HS_SPI_CONTROLLER_STATE_DEF; + } + else + { + spiCtrlState = 0; + /* note that in HW, the meaning of latch and launch bits changes when CPOl = 1 */ + if ( (0 == (spi->mode & SPI_CPHA)) && + (0 == (spiCtrlData & SPI_CONTROLLER_STATE_CPHA_EXT)) ) + { + /* latch rising, launch falling */ + spiCtrlState = HS_SPI_STATE_LATCH_RISING; + } + else if ( (0 == (spi->mode & SPI_CPHA)) && + (0 != (spiCtrlData & SPI_CONTROLLER_STATE_CPHA_EXT)) ) + { + /* latch rising, launch rising */ + spiCtrlState = HS_SPI_STATE_LATCH_RISING | HS_SPI_STATE_LAUNCH_RISING; + } + else if ( (0 != (spi->mode & SPI_CPHA)) && + (0 == (spiCtrlData & SPI_CONTROLLER_STATE_CPHA_EXT)) ) + { + /* latch falling, launch rising */ + spiCtrlState = HS_SPI_STATE_LAUNCH_RISING; + } + // else - both set to 0, latch falling, launch falling + + if ( 0 != (spi->mode & SPI_CPOL) ) + { + spiCtrlState |= HS_SPI_STATE_CLOCK_POLARITY; + } + + if ( spiCtrlData & SPI_CONTROLLER_STATE_GATE_CLK_SSOFF ) + { + spiCtrlState |= HS_SPI_STATE_GATE_CLOCK_SSOFF; + } + + if ( spiCtrlData & SPI_CONTROLLER_STATE_ASYNC_CLOCK ) + { + spiCtrlState |= HS_SPI_STATE_ASYNC_CLOCK; + } + } + + spi_set_ctldata(spi, (void *)spiCtrlState); + + return 0; +} + + +static int hsSpiTransfer(struct spi_device *spi, struct spi_message *msg) +{ + struct bcmspi *pBcmSpi = &BcmHsSpi; + struct spi_transfer *xfer; + struct spi_transfer *nextXfer; + int xferCnt; + int bCsChange; + int xferLen; + + if (unlikely(list_empty(&msg->transfers))) + return -EINVAL; + + if (pBcmSpi->stopping) + return -ESHUTDOWN; + + /* make sure a completion callback is set */ + if ( NULL == msg->complete ) + { + return -EINVAL; + } + + xferCnt = 0; + bCsChange = 0; + xferLen = 0; + list_for_each_entry(xfer, &msg->transfers, transfer_list) + { + /* check transfer parameters */ + if (!(xfer->tx_buf || xfer->rx_buf)) + { + return -EINVAL; + } + + /* check the clock setting - if it is 0 then set to max clock of the device */ + if ( 0 == xfer->speed_hz ) + { + if ( 0 == spi->max_speed_hz ) + { + return -EINVAL; + } + xfer->speed_hz = spi->max_speed_hz; + } + + xferCnt++; + xferLen += xfer->len; + bCsChange |= xfer->cs_change; + + if ( xfer->len > HS_SPI_BUFFER_LEN ) + { + return -EINVAL; + } + } + + /* this controller does not support keeping the chip select active between + transfers. If a message is detected with a write transfer followed by a + read transfer and cs_change is set to 0 then the two transfers need to be + combined. The message state is used to indicate that the transfers + need to be combined */ + msg->state = NULL; + if ( (2 == xferCnt) && (0 == bCsChange) ) + { + xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list); + if ( (NULL != xfer->tx_buf) && (NULL == xfer->rx_buf)) + { + nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);; + if ( (NULL == nextXfer->tx_buf) && (NULL != nextXfer->rx_buf)) + { + msg->state = (void *)1; + } + } + } + + msg->status = -EINPROGRESS; + msg->actual_length = 0; + +#ifdef HS_SPI_USE_INTERRUPTS + /* disable interrupts for the SPI controller + using spin_lock_irqsave would disable all interrupts */ + if ( pBcmSpi->irq ) + hsSpiEnableInt(FALSE); +#endif + spin_lock(&pBcmSpi->lock); + + list_add_tail(&msg->queue, &pBcmSpi->queue); + if (NULL == pBcmSpi->curTrans) + { + hsSpiNextMessage(pBcmSpi); + } + + spin_unlock(&pBcmSpi->lock); +#ifdef HS_SPI_USE_INTERRUPTS + if ( pBcmSpi->irq ) + hsSpiEnableInt(TRUE); +#endif + + return 0; +} + + +#ifdef HS_SPI_USE_INTERRUPTS +static irqreturn_t hsSpiIntHandler(int irq, void *dev_id) +{ + struct bcmspi *pBcmSpi = dev_id; + struct spi_message *msg; + struct spi_transfer *xfer; + + if ( 0 == HS_SPI->hs_spiIntStatusMasked ) + { + return ( IRQ_NONE ); + } + + hsSpiClearIntStatus(); + hsSpiEnableInt(FALSE); + + spin_lock(&pBcmSpi->lock); + if ( NULL == pBcmSpi->curTrans ) + { + spin_unlock(&pBcmSpi->lock); + return IRQ_HANDLED; + } + + xfer = pBcmSpi->curTrans; + msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue); + + hsSpiTransEnd(xfer->rx_buf, xfer->len); + + /* xfer can specify a delay before the next transfer is started + this delay would be processed here normally. However, delay in the + interrupt handler is bad so it is ignored. It is used for polling + mode */ + + /* check to see if this is the last transfer in the message */ + if (msg->transfers.prev == &xfer->transfer_list) + { + /* report completed message */ + hsSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK); + } + else + { + /* Submit the next transfer */ + hsSpiNextXfer(pBcmSpi, msg); + } + + spin_unlock(&pBcmSpi->lock); + + return IRQ_HANDLED; + +} + +int __init hsSpiIntrInit( void ) +{ + int ret = 0; + struct bcmspi *pBcmSpi = &BcmHsSpi; + + hsSpiEnableInt(FALSE); + ret = request_irq(INTERRUPT_ID_SPI, hsSpiIntHandler, (IRQF_DISABLED | IRQF_SAMPLE_RANDOM | IRQF_SHARED), pBcmSpi->devName, pBcmSpi); + + spin_lock(&pBcmSpi->lock); + pBcmSpi->irq = INTERRUPT_ID_SPI; + spin_unlock(&pBcmSpi->lock); + + BcmHalInterruptEnable(pBcmSpi->irq); + + return( 0 ); + +} +/* we cannot initialize interrupts early + The flash module is intialized before an interrupt handler can be installed + and before the Linux framework can be used. This means it needs direct access + to the controller initially. This conflicts with the interrupt handling so we + need to wait for all modules to intialize */ +late_initcall(hsSpiIntrInit); +#endif + +static void hsSpiCleanup(struct spi_device *spi) +{ + /* would free spi_controller memory here if any was allocated */ + +} + +static int __init hsSpiProbe(struct platform_device *pdev) +{ + int ret; + struct spi_master *master; + struct bcmspi *pBcmSpi; + + ret = -ENOMEM; + master = spi_alloc_master(&pdev->dev, 0); + if (!master) + goto out_free; + + master->bus_num = pdev->id; + master->num_chipselect = 8; + master->setup = hsSpiSetup; + master->transfer = hsSpiTransfer; + master->cleanup = hsSpiCleanup; + platform_set_drvdata(pdev, master); + + spi_master_set_devdata(master, (void *)&BcmHsSpi); + pBcmSpi = spi_master_get_devdata(master); + + INIT_LIST_HEAD(&pBcmSpi->queue); + + pBcmSpi->pdev = pdev; + pBcmSpi->bus_num = HS_SPI_BUS_NUM; + pBcmSpi->num_chipselect = 8; + pBcmSpi->curTrans = NULL; + + /* make sure irq is 0 here + since this is used to identify when interrupts are enabled + the IRQ is initialized in hsSpiIntrInit */ + pBcmSpi->irq = 0; + + /* Initialize the hardware */ + + /* register and we are done */ + ret = spi_register_master(master); + if (ret) + goto out_free; + + return 0; + +out_free: + spi_master_put(master); + + return ret; +} + + +static int __exit hsSpiRemove(struct platform_device *pdev) +{ + struct spi_master *master = platform_get_drvdata(pdev); + struct bcmspi *pBcmSpi = spi_master_get_devdata(master); + struct spi_message *msg; + + /* reset the hardware and block queue progress */ +#ifdef HS_SPI_USE_INTERRUPTS + hsSpiEnableInt(FALSE); +#endif + spin_lock(&pBcmSpi->lock); + pBcmSpi->stopping = 1; + + /* HW shutdown */ + + spin_unlock(&pBcmSpi->lock); + + /* Terminate remaining queued transfers */ + list_for_each_entry(msg, &pBcmSpi->queue, queue) + { + msg->status = -ESHUTDOWN; + msg->complete(msg->context); + } + +#ifdef HS_SPI_USE_INTERRUPTS + if ( pBcmSpi->irq ) + { + free_irq(pBcmSpi->irq, master); + } +#endif + spi_unregister_master(master); + + return 0; +} + +//#ifdef CONFIG_PM +#if 0 +static int hsSpiSuspend(struct platform_device *pdev, pm_message_t mesg) +{ + struct spi_master *master = platform_get_drvdata(pdev); + struct bcmspi *pBcmSpi = spi_master_get_devdata(master); + + return 0; +} + +static int hsSpiResume(struct platform_device *pdev) +{ + struct spi_master *master = platform_get_drvdata(pdev); + struct bcmspi *pBcmSpi = spi_master_get_devdata(master); + + return 0; +} +#else +#define hsSpiSuspend NULL +#define hsSpiResume NULL +#endif + +static struct platform_device bcm_hsspi_device = { + .name = "bcmhs_spi", + .id = HS_SPI_BUS_NUM, +}; + +static struct platform_driver bcm_hsspi_driver = { + .driver = + { + .name = "bcmhs_spi", + .owner = THIS_MODULE, + }, + .suspend = hsSpiSuspend, + .resume = hsSpiResume, + .remove = __exit_p(hsSpiRemove), +}; + +int __init hsSpiModInit( void ) +{ + platform_device_register(&bcm_hsspi_device); + return platform_driver_probe(&bcm_hsspi_driver, hsSpiProbe); + +} +subsys_initcall(hsSpiModInit); +#endif + +#endif /* HS_SPI */ + diff --git a/shared/opensource/spi/bcmLegSpi.c b/shared/opensource/spi/bcmLegSpi.c new file mode 100755 index 0000000..6d1a391 --- /dev/null +++ b/shared/opensource/spi/bcmLegSpi.c @@ -0,0 +1,774 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "bcm_map.h" +#define printk printf +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#endif + +/* if SPI is defined then the legacy SPI controller is available, otherwise do not compile this code */ +#ifdef SPI + +#include "bcmSpiRes.h" +#include "bcmSpi.h" + +int BcmLegSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz); +int BcmLegSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz); + +#ifndef _CFE_ +//#define LEG_SPI_USE_INTERRUPTS /* define this to use interrupts instead of polling */ +static struct bcmspi BcmLegSpi = { SPIN_LOCK_UNLOCKED, + "bcmLegSpiDev", + }; +#endif + +/* following are the frequency tables for the SPI controllers + they are ordered by frequency in descending order with column + 2 represetning the register value */ +#define LEG_SPI_FREQ_TABLE_SIZE 7 +int legSpiClockFreq[LEG_SPI_FREQ_TABLE_SIZE][2] = { + { 20000000, 0}, + { 12500000, 6}, + { 6250000, 5}, + { 3125000, 4}, + { 1563000, 3}, + { 781000, 2}, + { 391000, 1} }; + +static int legSpiRead( unsigned char *pRxBuf, int prependcnt, int nbytes, int devId ) +{ + int i; + + SPI->spiMsgCtl = (HALF_DUPLEX_R << SPI_MSG_TYPE_SHIFT) | (nbytes << SPI_BYTE_CNT_SHIFT); + + for (i = 0; i < prependcnt; i++) + { + SPI->spiMsgData[i] = pRxBuf[i]; + } + + SPI->spiCmd = (SPI_CMD_START_IMMEDIATE << SPI_CMD_COMMAND_SHIFT | + devId << SPI_CMD_DEVICE_ID_SHIFT | + prependcnt << SPI_CMD_PREPEND_BYTE_CNT_SHIFT | + 0 << SPI_CMD_ONE_BYTE_SHIFT); + + return SPI_STATUS_OK; + +} + +static int legSpiWriteFull( unsigned char *pTxBuf, int nbytes, int devId, int opcode ) +{ + int i; + + if ( opcode == BCM_SPI_FULL ) + { + SPI->spiMsgCtl = (FULL_DUPLEX_RW << SPI_MSG_TYPE_SHIFT) | (nbytes << SPI_BYTE_CNT_SHIFT); + } + else + { + SPI->spiMsgCtl = (HALF_DUPLEX_W << SPI_MSG_TYPE_SHIFT) | (nbytes << SPI_BYTE_CNT_SHIFT); + } + + for (i = 0; i < nbytes; i++) + { + SPI->spiMsgData[i] = pTxBuf[i]; + } + + SPI->spiCmd = (SPI_CMD_START_IMMEDIATE << SPI_CMD_COMMAND_SHIFT | + devId << SPI_CMD_DEVICE_ID_SHIFT | + 0 << SPI_CMD_PREPEND_BYTE_CNT_SHIFT | + 0 << SPI_CMD_ONE_BYTE_SHIFT); + + return SPI_STATUS_OK; + +} + + +static int legSpiTransEnd( unsigned char *rxBuf, int nbytes ) +{ + int i; + if ( NULL != rxBuf ) + { + for (i = 0; i < nbytes; i++) + { + rxBuf[i] = SPI->spiRxDataFifo[i]; + } + } + + return SPI_STATUS_OK; + +} + +static int legSpiTransPoll(void) +{ + while ( 1 ) + { + if ( SPI->spiIntStatus & SPI_INTR_CMD_DONE ) + { + break; + } + } + + return SPI_STATUS_OK; +} + +static void legSpiClearIntStatus(void) +{ + SPI->spiIntStatus = SPI_INTR_CLEAR_ALL; +} + +#ifdef LEG_SPI_USE_INTERRUPTS +static void legSpiEnableInt(bool bEnable) +{ + if ( bEnable ) + { + SPI->spiIntMask = SPI_INTR_CMD_DONE; + } + else + { + SPI->spiIntMask = 0; + } +} +#endif + +#ifndef _CFE_ +static int legSpiSetClock( int clockHz ) +{ + int i; + int clock = -1; + + for( i = 0; i < LEG_SPI_FREQ_TABLE_SIZE; i++ ) + { + /* look for the closest frequency that is less than the frequency passed in */ + if ( legSpiClockFreq[i][0] <= clockHz ) + { + clock = legSpiClockFreq[i][1]; + break; + } + } + /* if no clock was found set to default */ + if ( -1 == clock ) + { + clock = LEG_SPI_CLOCK_DEF; + } + SPI->spiClkCfg = (SPI->spiClkCfg & ~SPI_CLK_MASK) | clock; + + return SPI_STATUS_OK; +} +#endif + +/* these interfaces are availble for the CFE and spi flash driver only + all modules must use the linux kernel framework + if this is called by a module and interrupts are being used there will + be a problem */ +int BcmLegSpiRead( unsigned char *msg_buf, int prependcnt, int nbytes, int devId, int freqHz ) +{ +#ifndef _CFE_ + struct bcmspi *pBcmSpi = &BcmLegSpi; + + if ( pBcmSpi->irq ) + { + printk("BcmLegSpiRead error - SPI Interrupts are enabled\n"); + return( SPI_STATUS_ERR ); + } + + spin_lock(&pBcmSpi->lock); + legSpiSetClock(freqHz); +#endif + legSpiClearIntStatus(); + legSpiRead(msg_buf, prependcnt, nbytes, devId); + legSpiTransPoll(); + legSpiTransEnd(msg_buf, nbytes); + legSpiClearIntStatus(); +#ifndef _CFE_ + spin_unlock(&pBcmSpi->lock); +#endif + + return( SPI_STATUS_OK ); +} + +int BcmLegSpiWrite( unsigned char *msg_buf, int nbytes, int devId, int freqHz ) +{ +#ifndef _CFE_ + struct bcmspi *pBcmSpi = &BcmLegSpi; + + if ( pBcmSpi->irq ) + { + printk("BcmLegSpiWrite error - SPI Interrupts are enabled\n"); + return( SPI_STATUS_ERR ); + } + + spin_lock(&pBcmSpi->lock); + legSpiSetClock(freqHz); +#endif + legSpiClearIntStatus(); + legSpiWriteFull(msg_buf, nbytes, devId, BCM_SPI_WRITE); + legSpiTransPoll(); + legSpiTransEnd(msg_buf, nbytes); + legSpiClearIntStatus(); +#ifndef _CFE_ + spin_unlock(&pBcmSpi->lock); +#endif + + return( SPI_STATUS_OK ); +} + + +#ifndef _CFE_ +static void legSpiNextMessage(struct bcmspi *pBcmSpi); + +static void legSpiMsgDone(struct bcmspi *pBcmSpi, struct spi_message *msg, int status) +{ + list_del(&msg->queue); + msg->status = status; + + spin_unlock(&pBcmSpi->lock); + msg->complete(msg->context); + spin_lock(&pBcmSpi->lock); + + pBcmSpi->curTrans = NULL; + + /* continue if needed */ + if (list_empty(&pBcmSpi->queue) || pBcmSpi->stopping) + { + // disable controler ... + } + else + { + legSpiNextMessage(pBcmSpi); + } +} + +#ifdef LEG_SPI_USE_INTERRUPTS +static void legSpiIntXfer(struct bcmspi *pBcmSpi, struct spi_message *msg) +{ + struct spi_transfer *xfer; + struct spi_transfer *nextXfer; + int length; + int prependCnt; + char *pTxBuf; + char *pRxBuf; + int opCode; + + xfer = pBcmSpi->curTrans; + if ( NULL == xfer) + { + xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list); + } + else + { + xfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list); + } + pBcmSpi->curTrans = xfer; + + length = xfer->len; + prependCnt = 0; + pRxBuf = xfer->rx_buf; + pTxBuf = (unsigned char *)xfer->tx_buf; + + if ( (NULL != pRxBuf) && (NULL != pTxBuf) ) + { + opCode = BCM_SPI_FULL; + } + else if ( NULL != pRxBuf ) + { + opCode = BCM_SPI_READ; + } + else + { + opCode = BCM_SPI_WRITE; + } + + if ( msg->state ) + { + /* this controller does not support keeping the chip select active for all transfers + non NULL state indicates that we need to combine the transfers */ + nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list); + prependCnt = length; + length = nextXfer->len; + pRxBuf = nextXfer->rx_buf; + opCode = BCM_SPI_READ; + pBcmSpi->curTrans = nextXfer; + } + + legSpiSetClock(xfer->speed_hz); + + legSpiClearIntStatus(); + legSpiEnableInt(TRUE); + if ( BCM_SPI_READ == opCode ) + { + legSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select); + } + else + { + legSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode); + } + + return; + +} +#endif + +static void legSpiPollXfer(struct bcmspi *pBcmSpi, struct spi_message *msg) +{ + struct spi_transfer *xfer; + struct spi_transfer *nextXfer; + int length; + int prependCnt; + char *pTxBuf; + char *pRxBuf; + int opCode; + + list_for_each_entry(xfer, &msg->transfers, transfer_list) + { + pBcmSpi->curTrans = xfer; + length = xfer->len; + prependCnt = 0; + pRxBuf = xfer->rx_buf; + pTxBuf = (unsigned char *)xfer->tx_buf; + + if ( (NULL != pRxBuf) && (NULL != pTxBuf) ) + { + opCode = BCM_SPI_FULL; + } + else if ( NULL != pRxBuf ) + { + opCode = BCM_SPI_READ; + } + else + { + opCode = BCM_SPI_WRITE; + } + + if ( msg->state ) + { + /* this controller does not support keeping the chip select active for all transfers + non NULL state indicates that we need to combine the transfers */ + nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list); + prependCnt = length; + length = nextXfer->len; + pRxBuf = nextXfer->rx_buf; + opCode = BCM_SPI_READ; + xfer = nextXfer; + } + + legSpiSetClock(xfer->speed_hz); + + legSpiClearIntStatus(); + if ( BCM_SPI_READ == opCode ) + { + legSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select); + } + else + { + legSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode); + } + + legSpiTransPoll(); + legSpiTransEnd(pRxBuf, length); + legSpiClearIntStatus(); + + if (xfer->delay_usecs) + { + udelay(xfer->delay_usecs); + } + + msg->actual_length += length; + } + + legSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK); + +} + + +static void legSpiNextXfer(struct bcmspi *pBcmSpi, struct spi_message *msg) +{ +#ifdef LEG_SPI_USE_INTERRUPTS + if (pBcmSpi->irq) + legSpiIntXfer(pBcmSpi, msg); + else +#endif + legSpiPollXfer(pBcmSpi, msg); + +} + + +static void legSpiNextMessage(struct bcmspi *pBcmSpi) +{ + struct spi_message *msg; + + BUG_ON(pBcmSpi->curTrans); + + msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue); + + /* there will always be one transfer in a given message */ + legSpiNextXfer(pBcmSpi, msg); + +} + + +static int legSpiSetup(struct spi_device *spi) +{ + struct bcmspi *pBcmSpi; + + pBcmSpi = spi_master_get_devdata(spi->master); + + if (pBcmSpi->stopping) + return -ESHUTDOWN; + + /* there is nothing to setup */ + + return 0; +} + + +int legSpiTransfer(struct spi_device *spi, struct spi_message *msg) +{ + struct bcmspi *pBcmSpi = &BcmLegSpi; + struct spi_transfer *xfer; + struct spi_transfer *nextXfer; + int xferCnt; + int bCsChange; + int xferLen; + + if (unlikely(list_empty(&msg->transfers))) + return -EINVAL; + + if (pBcmSpi->stopping) + return -ESHUTDOWN; + + /* make sure a completion callback is set */ + if ( NULL == msg->complete ) + { + return -EINVAL; + } + + xferCnt = 0; + bCsChange = 0; + xferLen = 0; + list_for_each_entry(xfer, &msg->transfers, transfer_list) + { + /* check transfer parameters */ + if (!(xfer->tx_buf || xfer->rx_buf)) + { + return -EINVAL; + } + + /* check the clock setting - if it is 0 then set to max clock of the device */ + if ( 0 == xfer->speed_hz ) + { + if ( 0 == spi->max_speed_hz ) + { + return -EINVAL; + } + xfer->speed_hz = spi->max_speed_hz; + } + + xferCnt++; + xferLen += xfer->len; + bCsChange |= xfer->cs_change; + + if ( xfer->len > (sizeof(SPI->spiMsgData) & ~0x3) ) + { + return -EINVAL; + } + } + + /* this controller does not support keeping the chip select active between + transfers. If a message is detected with a write transfer followed by a + read transfer and cs_change is set to 0 then the two transfers need to be + combined. The message state is used to indicate that the transfers + need to be combined */ + msg->state = NULL; + if ( (2 == xferCnt) && (0 == bCsChange) ) + { + xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list); + if ( (NULL != xfer->tx_buf) && (NULL == xfer->rx_buf)) + { + nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);; + if ( (NULL == nextXfer->tx_buf) && (NULL != nextXfer->rx_buf)) + { + msg->state = (void *)1; + } + } + } + + msg->status = -EINPROGRESS; + msg->actual_length = 0; + +#ifdef LEG_SPI_USE_INTERRUPTS + /* disable interrupts for the SPI controller + using spin_lock_irqsave would disable all interrupts */ + if ( pBcmSpi->irq ) + legSpiEnableInt(FALSE); +#endif + spin_lock(&pBcmSpi->lock); + + list_add_tail(&msg->queue, &pBcmSpi->queue); + if (NULL == pBcmSpi->curTrans) + { + legSpiNextMessage(pBcmSpi); + } + + spin_unlock(&pBcmSpi->lock); +#ifdef LEG_SPI_USE_INTERRUPTS + if ( pBcmSpi->irq ) + legSpiEnableInt(TRUE); +#endif + + return 0; +} + + +#ifdef LEG_SPI_USE_INTERRUPTS +static irqreturn_t legSpiIntHandler(int irq, void *dev_id) +{ + struct bcmspi *pBcmSpi = dev_id; + struct spi_message *msg; + struct spi_transfer *xfer; + + if ( 0 == SPI->spiMaskIntStatus ) + { + return ( IRQ_NONE ); + } + + legSpiClearIntStatus(); + legSpiEnableInt(FALSE); + + spin_lock(&pBcmSpi->lock); + if ( NULL == pBcmSpi->curTrans ) + { + spin_unlock(&pBcmSpi->lock); + return IRQ_HANDLED; + } + + xfer = pBcmSpi->curTrans; + msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue); + + legSpiTransEnd(xfer->rx_buf, xfer->len); + + /* xfer can specify a delay before the next transfer is started + this is only used for polling mode */ + + /* check to see if this is the last transfer in the message */ + if (msg->transfers.prev == &xfer->transfer_list) + { + /* report completed message */ + legSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK); + } + else + { + /* Submit the next transfer */ + legSpiNextXfer(pBcmSpi, msg); + } + + spin_unlock(&pBcmSpi->lock); + + return IRQ_HANDLED; + +} + +int __init legSpiIntrInit( void ) +{ + int ret = 0; + struct bcmspi *pBcmSpi = &BcmLegSpi; + + legSpiEnableInt(FALSE); + ret = request_irq(INTERRUPT_ID_SPI, legSpiIntHandler, (IRQF_DISABLED | IRQF_SAMPLE_RANDOM | IRQF_SHARED), pBcmSpi->devName, pBcmSpi); + + spin_lock(&pBcmSpi->lock); + pBcmSpi->irq = INTERRUPT_ID_SPI; + spin_unlock(&pBcmSpi->lock); + + BcmHalInterruptEnable(pBcmSpi->irq); + + return( 0 ); + +} +/* we cannot initialize interrupts early + The flash module is intialized before an interrupt handler can be installed + and before the Linux framework can be used. This means it needs direct access + to the controller initially. This conflicts with the interrupt handling so we + need to wait for all modules to intialize */ +late_initcall(legSpiIntrInit); +#endif + +static void legSpiCleanup(struct spi_device *spi) +{ + /* would free spi_controller memory here if any was allocated */ + +} + +static int __init legSpiProbe(struct platform_device *pdev) +{ + int ret; + struct spi_master *master; + struct bcmspi *pBcmSpi; + + ret = -ENOMEM; + master = spi_alloc_master(&pdev->dev, 0); + if (!master) + goto out_free; + + master->bus_num = pdev->id; + master->num_chipselect = 8; + master->setup = legSpiSetup; + master->transfer = legSpiTransfer; + master->cleanup = legSpiCleanup; + platform_set_drvdata(pdev, master); + + spi_master_set_devdata(master, (void *)&BcmLegSpi); + pBcmSpi = spi_master_get_devdata(master); + + INIT_LIST_HEAD(&pBcmSpi->queue); + + pBcmSpi->pdev = pdev; + pBcmSpi->bus_num = LEG_SPI_BUS_NUM; + pBcmSpi->num_chipselect = 8; + pBcmSpi->curTrans = NULL; + + /* make sure irq is 0 here + since this is used to identify when interrupts are enabled + the IRQ is initialized in legSpiIntrInit */ + pBcmSpi->irq = 0; + + /* Initialize the hardware */ + + /* register and we are done */ + ret = spi_register_master(master); + if (ret) + goto out_free; + + return 0; + +out_free: + spi_master_put(master); + + return ret; +} + + +static int __exit legSpiRemove(struct platform_device *pdev) +{ + struct spi_master *master = platform_get_drvdata(pdev); + struct bcmspi *pBcmSpi = spi_master_get_devdata(master); + struct spi_message *msg; + + /* reset the hardware and block queue progress */ +#ifdef LEG_SPI_USE_INTERRUPTS + legSpiEnableInt(FALSE); +#endif + spin_lock(&pBcmSpi->lock); + pBcmSpi->stopping = 1; + + /* HW shutdown */ + + spin_unlock(&pBcmSpi->lock); + + /* Terminate remaining queued transfers */ + list_for_each_entry(msg, &pBcmSpi->queue, queue) + { + msg->status = -ESHUTDOWN; + msg->complete(msg->context); + } + +#ifdef LEG_SPI_USE_INTERRUPTS + if ( pBcmSpi->irq ) + { + free_irq(pBcmSpi->irq, master); + } +#endif + spi_unregister_master(master); + + return 0; +} + +//#ifdef CONFIG_PM +#if 0 +static int legSpiSuspend(struct platform_device *pdev, pm_message_t mesg) +{ + struct spi_master *master = platform_get_drvdata(pdev); + struct bcmspi *pBcmSpi = spi_master_get_devdata(master); + + return 0; +} + +static int legSpiResume(struct platform_device *pdev) +{ + struct spi_master *master = platform_get_drvdata(pdev); + struct bcmspi *pBcmSpi = spi_master_get_devdata(master); + + return 0; +} +#else +#define legSpiSuspend NULL +#define legSpiResume NULL +#endif + + +static struct platform_device bcm_legacyspi_device = { + .name = "bcmleg_spi", + .id = LEG_SPI_BUS_NUM, +}; + +static struct platform_driver bcm_legspi_driver = { + .driver = + { + .name = "bcmleg_spi", + .owner = THIS_MODULE, + }, + .suspend = legSpiSuspend, + .resume = legSpiResume, + .remove = __exit_p(legSpiRemove), +}; + + +int __init legSpiModInit( void ) +{ + platform_device_register(&bcm_legacyspi_device); + return platform_driver_probe(&bcm_legspi_driver, legSpiProbe); + +} +subsys_initcall(legSpiModInit); +#endif + +#endif /* SPI */ + diff --git a/shared/opensource/spi/bcmSpiRes.c b/shared/opensource/spi/bcmSpiRes.c new file mode 100755 index 0000000..ed16575 --- /dev/null +++ b/shared/opensource/spi/bcmSpiRes.c @@ -0,0 +1,660 @@ +/* + Copyright 2000-2010 Broadcom Corporation + + Unless you and Broadcom execute a separate written software license + agreement governing use of this software, this software is licensed + to you under the terms of the GNU General Public License version 2 + (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, + with the following added to such license: + + As a special exception, the copyright holders of this software give + you permission to link this software with independent modules, and to + copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent + module, the terms and conditions of the license of that module. + An independent module is a module which is not derived from this + software. The special exception does not apply to any modifications + of the software. + + Notwithstanding the above, under no circumstances may you combine this + software in any way with any other Broadcom software provided under a + license other than the GPL, without Broadcom's express prior written + consent. +*/ + +#ifdef _CFE_ +#include "lib_types.h" +#include "lib_printf.h" +#include "lib_string.h" +#include "bcm_map.h" +#define printk printf +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) +#include +#endif +#include +#include + +#include +#endif +#include "bcmSpiRes.h" + +extern int BcmLegSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz); +extern int BcmLegSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz); +extern int BcmHsSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz); +extern int BcmHsSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz); + +#ifndef _CFE_ +#ifdef SPI +/* the BCM legacy controller supports up to 8 devices */ +static struct spi_board_info bcmLegSpiDevInfo[8] = +{ + { + .modalias = "bcm_LegSpiDev0", + .chip_select = 0, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev1", + .chip_select = 1, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev2", + .chip_select = 2, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev3", + .chip_select = 3, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev4", + .chip_select = 4, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev5", + .chip_select = 5, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev6", + .chip_select = 6, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, + { + .modalias = "bcm_LegSpiDev7", + .chip_select = 7, + .max_speed_hz = 781000, + .bus_num = LEG_SPI_BUS_NUM, + .mode = SPI_MODE_3, + }, +}; + +static struct spi_driver bcmLegSpiDevDrv[8] = +{ + { + .driver = + { + .name = "bcm_LegSpiDev0", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev1", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev2", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev3", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev4", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev5", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev6", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_LegSpiDev7", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, +}; + +static struct spi_device * bcmLegSpiDevices[8]; +#endif + +#ifdef HS_SPI +/* the BCM HS controller supports up to 8 devices */ +static struct spi_board_info bcmHSSpiDevInfo[8] = +{ + { + .modalias = "bcm_HSSpiDev0", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 0, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev1", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 1, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev2", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 2, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev3", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 3, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev4", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 4, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev5", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 5, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev6", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 6, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, + { + .modalias = "bcm_HSSpiDev7", + .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT, + .chip_select = 7, + .max_speed_hz = 781000, + .bus_num = HS_SPI_BUS_NUM, + .mode = SPI_MODE_DEFAULT, + }, +}; + +static struct spi_driver bcmHSSpiDevDrv[8] = +{ + { + .driver = + { + .name = "bcm_HSSpiDev0", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev1", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev2", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev3", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev4", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev5", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev6", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, + { + .driver = + { + .name = "bcm_HSSpiDev7", + .bus = &spi_bus_type, + .owner = THIS_MODULE, + }, + }, +}; + +static struct spi_device * bcmHSSpiDevices[8]; +#endif + + +int BcmSpiReserveSlave2(int busNum, int slaveId, int maxFreq, int spiMode, int ctrlState) +{ + struct spi_master * pSpiMaster; + struct spi_driver * pSpiDriver; + + if ( slaveId > 7 ) + { + return SPI_STATUS_ERR; + } + + if ( LEG_SPI_BUS_NUM == busNum ) + { +#ifndef SPI + return( SPI_STATUS_ERR ); +#else + if ( NULL != bcmLegSpiDevices[slaveId] ) + { + printk(KERN_ERR "BcmSpiReserveSlave - slaveId %d, already registerd\n", slaveId); + return( SPI_STATUS_ERR ); + } + + bcmLegSpiDevInfo[slaveId].max_speed_hz = maxFreq; + bcmLegSpiDevInfo[slaveId].controller_data = (void *)ctrlState; + bcmLegSpiDevInfo[slaveId].mode = spiMode; + + pSpiMaster = spi_busnum_to_master( busNum ); + bcmLegSpiDevices[slaveId] = spi_new_device(pSpiMaster, &bcmLegSpiDevInfo[slaveId]); + pSpiDriver = &bcmLegSpiDevDrv[slaveId]; +#endif + } + else if ( HS_SPI_BUS_NUM == busNum ) + { +#ifndef HS_SPI + return( SPI_STATUS_ERR ); +#else + if ( NULL != bcmHSSpiDevices[slaveId] ) + { + printk(KERN_ERR "BcmSpiReserveSlave - slaveId %d, already registerd\n", slaveId); + return( SPI_STATUS_ERR ); + } + + bcmHSSpiDevInfo[slaveId].max_speed_hz = maxFreq; + bcmHSSpiDevInfo[slaveId].controller_data = (void *)ctrlState; + bcmHSSpiDevInfo[slaveId].mode = spiMode; + + pSpiMaster = spi_busnum_to_master( busNum ); + bcmHSSpiDevices[slaveId] = spi_new_device(pSpiMaster, &bcmHSSpiDevInfo[slaveId]); + pSpiDriver = &bcmHSSpiDevDrv[slaveId]; +#endif + } + else + return( SPI_STATUS_ERR ); + + /* register the SPI driver */ + spi_register_driver(pSpiDriver); + + return 0; + +} +EXPORT_SYMBOL(BcmSpiReserveSlave2); + +int BcmSpiReserveSlave(int busNum, int slaveId, int maxFreq) +{ + return( BcmSpiReserveSlave2(busNum, slaveId, maxFreq, SPI_MODE_DEFAULT, SPI_CONTROLLER_STATE_DEFAULT) ); +} +EXPORT_SYMBOL(BcmSpiReserveSlave); + +int BcmSpiReleaseSlave(int busNum, int slaveId) +{ + if ( slaveId > 7 ) + { + return SPI_STATUS_ERR; + } + + if ( LEG_SPI_BUS_NUM == busNum ) + { +#ifndef SPI + return( SPI_STATUS_ERR ); +#else + if ( NULL == bcmLegSpiDevices[slaveId] ) + { + printk(KERN_ERR "BcmSpiReleaseSlave - slaveId %d, already released\n", slaveId); + return( SPI_STATUS_ERR ); + } + + bcmLegSpiDevInfo[slaveId].max_speed_hz = 781000; + spi_unregister_driver(&bcmLegSpiDevDrv[slaveId]); + spi_unregister_device(bcmLegSpiDevices[slaveId]); + bcmLegSpiDevices[slaveId] = 0; +#endif + } + else if ( HS_SPI_BUS_NUM == busNum ) + { +#ifndef HS_SPI + return( SPI_STATUS_ERR ); +#else + if ( NULL == bcmHSSpiDevices[slaveId] ) + { + printk(KERN_ERR "BcmSpiReleaseSlave - slaveId %d, already released\n", slaveId); + return( SPI_STATUS_ERR ); + } + + bcmHSSpiDevInfo[slaveId].max_speed_hz = 781000; + spi_unregister_driver(&bcmHSSpiDevDrv[slaveId]); + spi_unregister_device(bcmHSSpiDevices[slaveId]); + bcmHSSpiDevices[slaveId] = 0; +#endif + } + else + return( SPI_STATUS_ERR ); + + return 0; + +} +EXPORT_SYMBOL(BcmSpiReleaseSlave); + + +int BcmSpiSyncTrans(unsigned char *txBuf, unsigned char *rxBuf, int prependcnt, int nbytes, int busNum, int slaveId) +{ + struct spi_message msg; + struct spi_transfer xfer[2]; + int status; + int maxLength; + struct spi_device *pSpiDevice; + + maxLength = BcmSpi_GetMaxRWSize(busNum); + if ( (nbytes > maxLength) || (prependcnt > maxLength) ) + { + printk(KERN_ERR "ERROR BcmSpiSyncTrans: invalid length len %d, pre %d, max %d\n", nbytes, prependcnt, maxLength); + return SPI_STATUS_ERR; + } + + if ( slaveId > 7 ) + { + printk(KERN_ERR "ERROR BcmSpiSyncTrans: invalid slave id %d\n", slaveId); + return SPI_STATUS_ERR; + } + + if ( LEG_SPI_BUS_NUM == busNum ) + { +#ifndef SPI + return( SPI_STATUS_ERR ); +#else + if ( NULL == bcmLegSpiDevices[slaveId] ) + { + printk(KERN_ERR "ERROR BcmSpiSyncTrans: device not registered\n"); + return SPI_STATUS_ERR; + } + pSpiDevice = bcmLegSpiDevices[slaveId]; +#endif + } + else if ( HS_SPI_BUS_NUM == busNum ) + { +#ifndef HS_SPI + return( SPI_STATUS_ERR ); +#else + if ( NULL == bcmHSSpiDevices[slaveId] ) + { + printk(KERN_ERR "ERROR BcmSpiSyncTrans: device not registered\n"); + return SPI_STATUS_ERR; + } + pSpiDevice = bcmHSSpiDevices[slaveId]; +#endif + } + else + return( SPI_STATUS_ERR ); + + spi_message_init(&msg); + memset(xfer, 0, (sizeof xfer)); + + if ( prependcnt ) + { + xfer[0].len = prependcnt; + xfer[0].speed_hz = pSpiDevice->max_speed_hz; + if ( txBuf ) + { + xfer[0].tx_buf = txBuf; + } + else + { + xfer[0].tx_buf = rxBuf; + } + spi_message_add_tail(&xfer[0], &msg); + } + + xfer[1].len = nbytes; + xfer[1].speed_hz = pSpiDevice->max_speed_hz; + xfer[1].rx_buf = rxBuf; + + /* for the controller to use the prepend count correctly the first operation must be a read and the second a write + make sure tx is NULL for second transaction */ + if ( 0 == prependcnt ) + { + xfer[1].tx_buf = txBuf; + } + spi_message_add_tail(&xfer[1], &msg); + + status = spi_sync(pSpiDevice, &msg); + if (status >= 0) + { + status = SPI_STATUS_OK; + } + else + { + status = SPI_STATUS_ERR; + } + + return( status ); + +} +EXPORT_SYMBOL(BcmSpiSyncTrans); +#endif + +int BcmSpi_SetFlashCtrl( int opCode, int addrBytes, int dummyBytes, int busNum, int devId ) +{ + if ( HS_SPI_BUS_NUM == busNum ) + { +#ifndef HS_SPI + return SPI_STATUS_ERR; +#else + int clock; + + clock = HS_SPI_PLL_FREQ/HS_SPI_CLOCK_DEF; + if (HS_SPI_PLL_FREQ%HS_SPI_CLOCK_DEF) + clock++; + + clock = 2048/clock; + if (2048%(clock)) + clock++; + + HS_SPI_PROFILES[0].clk_ctrl = 1<hs_spiFlashCtrl = devId<spiMsgData); +#endif + } + + maxRWSize &= ~0x3; + + return(maxRWSize); + +} + + +/* The interface bcmSpi_Read and bcmSpi_Write provide direct access to the SPI controller. + these interfaces should only be called by CFE and early spi flash code */ +int BcmSpi_Read( unsigned char *msg_buf, int prependcnt, int nbytes, int busNum, int devId, int freqHz ) +{ + if ( LEG_SPI_BUS_NUM == busNum ) + { +#ifndef SPI + return SPI_STATUS_ERR; +#else + return BcmLegSpiRead( msg_buf, prependcnt, nbytes, devId, freqHz ); +#endif + } + else if ( HS_SPI_BUS_NUM == busNum ) + { +#ifndef HS_SPI + return SPI_STATUS_ERR; +#else + return BcmHsSpiRead( msg_buf, prependcnt, nbytes, devId, freqHz ); +#endif + } + else + { + return SPI_STATUS_ERR; + } + +} + +int BcmSpi_Write( unsigned char *msg_buf, int nbytes, int busNum, int devId, int freqHz ) +{ + if ( LEG_SPI_BUS_NUM == busNum ) + { +#ifndef SPI + return SPI_STATUS_ERR; +#else + return BcmLegSpiWrite( msg_buf, nbytes, devId, freqHz ); +#endif + } + else if ( HS_SPI_BUS_NUM == busNum ) + { +#ifndef HS_SPI + return SPI_STATUS_ERR; +#else + return BcmHsSpiWrite( msg_buf, nbytes, devId, freqHz ); +#endif + } + else + { + return SPI_STATUS_ERR; + } +} + +#ifndef _CFE_ +EXPORT_SYMBOL(BcmSpi_SetFlashCtrl); +EXPORT_SYMBOL(BcmSpi_GetMaxRWSize); +#endif + -- cgit v1.2.3