Esempio n. 1
0
/*
 * Name: bkeyInit
 * Description: Initialize the keys in the 740 board.
 *
 * No parameter.
 * No return value.
 */
VOID bkeyInit(VOID)
{
	UINT32 gpio_cfg = PINT32(GPIO_CFG);
	gpio_cfg &= 0xFFFFFFF0;

	PINT32(GPIO_CFG) = gpio_cfg;
	sysPrintf("Initialize onboard keys.\n");
}
Esempio n. 2
0
int smSwitchSize(int numSwitches, int numPorts, int numActivePorts, int numSwitches2, int numFIs, int lmc, int mlidTableCap) {
	int size;
    int    sizelft;

    sizelft = (numSwitches + numSwitches2 + numFIs) * (1 << lmc) + 64;
	//sysPrintf("The size of a Switch LFT table is %d bytes\n", sizelft);
    size = sizeof(Node_t);
    size += ((numPorts + 1) * (sizeof(Port_t))) + ((numActivePorts+1) * sizeof(PortData_t));
    size += 16 + sizelft + sizeof(uint16_t * ) * mlidTableCap + sizeof(uint16_t) * mlidTableCap * 16;
	sysPrintf("The average size of this type Switch in the topology is %d bytes\n", size);
	return size;
}
Esempio n. 3
0
static VOID sysInitCFI(VOID)
{
	D_TRACE (0, "sysInitCFI\n");
	/* enable the external I/O bank, set byte address alignment, set 32 bit data bus */
	*((unsigned int volatile *) EXTIO_BANK) = (unsigned int) (EXTIO_BASE_ADDR | EXTIO_SIZE |
											   EXTIO_BUS_WIDTH_32 | EXTIO_tACC | EXTIO_tCOH |
											   EXTIO_tACS | EXTIO_tCOS
											   );

	{
		sysPrintf ("reg = %x\n", *(volatile UINT32 *)0xFFF01018);
	}
}
Esempio n. 4
0
BOOL sysInitialize(VOID)
{
	INT32 nReturn;

	/* Initialize UART. */
	{
		WB_UART tUART =
		{
			15000000,		//freq
			115200,			//baud_rate
			WB_DATA_BITS_8,	//data_bits
			WB_STOP_BITS_1,	//stop_bits
			WB_PARITY_NONE,	//parity
			LEVEL_1_BYTE,	//rx_trigger_level
		};
		nReturn = WB_InitializeUART(&tUART);
		if (nReturn != Successful) return FALSE;
	}

	sysPrintf("Uart..ok\n");

	/* IRQ for W99702. */
	WB_SetInterruptType (W90N740_nIRQ0, LOW_LEVEL_SENSITIVE);
	
	/* Initialize TIMER1. */
	{
		WB_SetTimerReferenceClock(TIMER1, 15000000);
		WB_StartTimer(TIMER1, 1000, PERIODIC_MODE);
	}
	
	sysPrintf("Timer..ok\n");

	sysInitCFI();

	sysPrintf("CFI..ok\n");
	return TRUE;
}
Esempio n. 5
0
UINT32 bkeyReadKeyTimeout(int *piMilliSecond)
{
	static UINT32 key_last = 0;
	UINT32 key;
	int i;
	while (piMilliSecond == NULL
			|| *piMilliSecond >= 0)
	{
		//loops about 51 times per millisecond.
		//for (i = 0; i < 1524; i++)
		for (i = 0; i < 51; i++)
		{
			key = bkeyGetKey();
			if (key != key_last)
			{
				sysMSleep(1);
				key_last = key;
sysPrintf("Key: %x\n", key);				
				if (IS_KEY_UP_PRESSED(key))
					return ONBOARD_KEY_UP;
				else if (IS_KEY_DOWN_PRESSED(key))
					return ONBOARD_KEY_DOWN;
				else if (IS_KEY_LEFT_PRESSED(key))
					return ONBOARD_KEY_LEFT;
				else if (IS_KEY_RIGHT_PRESSED(key))
					return ONBOARD_KEY_RIGHT;
				else if (IS_KEY_MIDDLE_PRESSED(key))
					return ONBOARD_KEY_MIDDLE;
				else if (IS_KEY_LEFT_UP_PRESSED(key))
					return ONBOARD_KEY_LEFT_UP;
				else if (IS_KEY_RIGHT_DOWN_PRESSED(key))
					return ONBOARD_KEY_RIGHT_DOWN;
			}
		}
		(*piMilliSecond)--;
	}
	return 0;
}
Esempio n. 6
0
//
// available on both embeded and HSM
//
int saSubscriberSize(void) {
	int size = sizeof(InformRecord_t);
	sysPrintf("An SA Subscriber is %d bytes\n", size);
	return size;
}
Esempio n. 7
0
uint64_t smFabricSize(void) {
    int numTopologies = 2;
    int numMcGroups = 4;
    int numCaSubscriptions = 4;
    int numManagers = 4; // PM, BM, FE, PSM
    int numSmSubs = 7; // PM, BM, FE all do GID IN/OUT, FE does PortState
    int numStandbys = 2;
    int numHostServices = 2;

    int      sizelft = (numSwChips + numSwChips2 + numFIs) * (1 << Lmc) + 64;
    uint64_t caSize = smCASize() * numTopologies;
    uint64_t switchSize = smSwitchSize(numSwChips, numPortsPerSwChip, numPortsPerSwChip, numSwChips2, numFIs, Lmc, DEFAULT_SW_MLID_TABLE_CAP) * numTopologies;
    uint64_t switchSize2 = smSwitchSize(numSwChips2, numPortsPerSwChip2, numActivPortsPerSwChip2, numSwChips, numFIs, Lmc, DEFAULT_SW_MLID_TABLE_CAP) * numTopologies;
    uint64_t subscriberSize = saSubscriberSize();
    uint64_t serviceRecordSize = saServiceRecordSize();
    uint64_t groupSize = saMcGroupSize();
    uint64_t memberSize = saMcMemberSize();
    uint64_t pathArraySize = sizeof(uint8_t) * numTopologies;
    uint64_t costArraySize = sizeof(uint8_t) * numTopologies;
    uint64_t maxResponseSize = saMaxResponseSize();
    uint64_t nodeRecordSize = saNodeRecordSize();
    uint64_t lidMapSize = smLidmapSize();
    uint64_t smSize = numSmSubs * subscriberSize + numManagers * serviceRecordSize;
    uint64_t standbySize = smSize * numStandbys;
    uint64_t guidInfoSize = sizeof(GuidInfo_t) * (numFIs+numSwChips+numSwChips2) * numTopologies;
    uint64_t size = 0;
    caSize += numHostServices * serviceRecordSize + numCaSubscriptions * subscriberSize + numMcGroups * memberSize;
    caSize *= numFIs;
 
    switchSize *= numSwChips;
    switchSize2 *= numSwChips2;
    /* now for total switch size */
    switchSize += switchSize2;

    groupSize *= numMcGroups;
    
    costArraySize *= (numSwChips+numSwChips2) * (numSwChips+numSwChips2);
    pathArraySize *= (numSwChips+numSwChips2) * (numSwChips+numSwChips2);

    nodeRecordSize *= numFIs * (numFIs / 4);

    size = caSize + switchSize + smSize + standbySize + groupSize +
           costArraySize + pathArraySize + maxResponseSize +
           nodeRecordSize + lidMapSize + guidInfoSize;

    // add in 10% fudge factor
    size += size/10;

	sysPrintf("The size of a Switch LFT table is %d bytes\n", sizelft);
    sysPrintf("The total for FIs in the fabric is %"CS64"d bytes\n", caSize);
    sysPrintf("The total for switches in the fabric is %"CS64"d bytes\n", switchSize);
    sysPrintf("The total for the master SM is %"CS64"d bytes\n", smSize);
    sysPrintf("The total for %d standby SMs is %"CS64"d bytes\n", numStandbys, standbySize);
    sysPrintf("The total for %d multicast groups is %"CS64"d bytes\n", numMcGroups, groupSize);
    sysPrintf("The total for the cost array is %"CS64"d bytes\n", costArraySize);
    sysPrintf("The total for the path array is %"CS64"d bytes\n", pathArraySize);
    sysPrintf("The total for the LidMap is %"CS64"d bytes\n", lidMapSize);
    sysPrintf("The total for SA max response is %"CS64"d bytes\n", maxResponseSize);
    sysPrintf("The total for sending all node records to 1/4 the nodes at once is %"CS64"d bytes\n", nodeRecordSize);

	sysPrintf("The topology size of a fabric with %d FIs and %d %d port switches and %d %d port (%d active) switches is %"CS64"d bytes\n",
			  numFIs, numSwChips, numPortsPerSwChip, numSwChips2, numPortsPerSwChip2, numActivPortsPerSwChip2, size);
	return size;	
}
Esempio n. 8
0
int smLidmapSize(void) {
	int size = sizeof(LidMap_t) * SIZE_LFT;
	sysPrintf("The size LidMap in the topology is %d bytes\n", size);
	return size;
}
Esempio n. 9
0
int smPortSize(void) {
	int size = sizeof(Port_t) + sizeof(PortData_t);
	sysPrintf("The size of one port in the topology is %d bytes\n", size);
	return size;
}
Esempio n. 10
0
//
// the following are available on both embebded and HSM
//
int smCASize(void) {
	int size = sizeof(Node_t) + (3 * sizeof(Port_t)) + sizeof(PortData_t);
	sysPrintf("The size of one FI in the topology is %d bytes\n", size);
	return size;
}
Esempio n. 11
0
int saPathRecordSize(void) {
    int size = sizeof(IB_PATH_RECORD) + Calculate_Padding(sizeof(IB_PATH_RECORD));
    sysPrintf("An SA Path Record is %d bytes\n", size);
    return size;
}
Esempio n. 12
0
int saNodeRecordSize(void) {
    int size = sizeof(STL_NODE_RECORD) + Calculate_Padding(sizeof(STL_NODE_RECORD));
    sysPrintf("An SA Node Record is %d bytes\n", size);
    return size;
}
Esempio n. 13
0
int saMcMemberSize(void) {
    int size = sizeof(McMember_t) + 16;
    sysPrintf("An SA Multicast Member is %d bytes\n", size);
    return size;
}
Esempio n. 14
0
int saMcGroupSize(void) {
    int size = sizeof(McGroup_t) + 16;
    sysPrintf("An SA Multicast Group is %d bytes\n", size);
    return size;
}
Esempio n. 15
0
int saServiceRecordSize(void) {
	int size = sizeof(OpaServiceRecord_t);
	sysPrintf("An SA Service Record is %d bytes\n", size);
	return size;
}
Esempio n. 16
0
int saSubscriberSize() {
	size_t size = sizeof(SubscriberKey_t) + sizeof(InformRecord_t);;
	sysPrintf("An SA Subscriber is %d bytes\n", size);
	return size;
}