亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sb_common.c

?? 友善mini2440嵌入式
?? C
字號:
/* *  Copyright (C) 2005 Sandburst Corporation * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */#include <config.h>#include <common.h>#include <command.h>#include <asm/processor.h>#include <asm/io.h>#include <spd_sdram.h>#include <i2c.h>#include "ppc440gx_i2c.h"#include "sb_common.h"DECLARE_GLOBAL_DATA_PTR;long int fixed_sdram (void);/************************************************************************* *  metrobox_get_master * *  PRI_N - active low signal.	If the GPIO pin is low we are the master * ************************************************************************/int sbcommon_get_master(void){	ppc440_gpio_regs_t *gpio_regs;	gpio_regs = (ppc440_gpio_regs_t *)CFG_GPIO_BASE;	if (gpio_regs->in & SBCOMMON_GPIO_PRI_N) {		return 0;	}	else {		return 1;	}}/************************************************************************* *  metrobox_secondary_present * *  Figure out if secondary/slave board is present * ************************************************************************/int sbcommon_secondary_present(void){	ppc440_gpio_regs_t *gpio_regs;	gpio_regs = (ppc440_gpio_regs_t *)CFG_GPIO_BASE;	if (gpio_regs->in & SBCOMMON_GPIO_SEC_PRES)		return 0;	else		return 1;}/************************************************************************* *  sbcommon_get_serial_number * *  Retrieve the board serial number via the mac address in eeprom * ************************************************************************/unsigned short sbcommon_get_serial_number(void){	unsigned char buff[0x100];	unsigned short sernum;	/* Get the board serial number from eeprom */	/* Initialize I2C */	i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);	/* Read 256 bytes in EEPROM */	i2c_read (0x50, 0, 1, buff, 0x100);	memcpy(&sernum, &buff[0xF4], 2);	sernum /= 32;	return (sernum);}/************************************************************************* *  sbcommon_fans * *  Spin up fans 2 & 3 to get some air moving.	OS will take care *  of the rest.  This is mostly a precaution... * *  Assumes i2c bus 1 is ready. * ************************************************************************/void sbcommon_fans(void){	/*	 * Attempt to turn on 2 of the fans...	 * Need to go through the bridge	 */	puts ("FANS:  ");	/* select fan4 through the bridge */	i2c_reg_write1(0x73, /* addr */		       0x00, /* reg */		       0x08); /* val = bus 4 */	/* Turn on FAN 4 */	i2c_reg_write1(0x2e,		       1,		       0x80);	i2c_reg_write1(0x2e,		       0,		       0x19);	/* Deselect bus 4 on the bridge */	i2c_reg_write1(0x73,		       0x00,		       0x00);	/* select fan3 through the bridge */	i2c_reg_write1(0x73, /* addr */		       0x00, /* reg */		       0x04); /* val = bus 3 */	/* Turn on FAN 3 */	i2c_reg_write1(0x2e,		       1,		       0x80);	i2c_reg_write1(0x2e,		       0,		       0x19);	/* Deselect bus 3 on the bridge */	i2c_reg_write1(0x73,		       0x00,		       0x00);	/* select fan2 through the bridge */	i2c_reg_write1(0x73, /* addr */		       0x00, /* reg */		       0x02); /* val = bus 4 */	/* Turn on FAN 2 */	i2c_reg_write1(0x2e,		       1,		       0x80);	i2c_reg_write1(0x2e,		       0,		       0x19);	/* Deselect bus 2 on the bridge */	i2c_reg_write1(0x73,		       0x00,		       0x00);	/* select fan1 through the bridge */	i2c_reg_write1(0x73, /* addr */		       0x00, /* reg */		       0x01); /* val = bus 0 */	/* Turn on FAN 1 */	i2c_reg_write1(0x2e,		       1,		       0x80);	i2c_reg_write1(0x2e,		       0,		       0x19);	/* Deselect bus 1 on the bridge */	i2c_reg_write1(0x73,		       0x00,		       0x00);	puts ("on\n");	return;}/************************************************************************* *  initdram * *  Initialize sdram * ************************************************************************/long int initdram (int board_type){	long dram_size = 0;#if defined(CONFIG_SPD_EEPROM)	dram_size = spd_sdram ();#else	dram_size = fixed_sdram ();#endif	return dram_size;}/************************************************************************* *  testdram * * ************************************************************************/#if defined(CFG_DRAM_TEST)int testdram (void){	uint *pstart = (uint *) CFG_MEMTEST_START;	uint *pend = (uint *) CFG_MEMTEST_END;	uint *p;	printf("Testing SDRAM: ");	for (p = pstart; p < pend; p++)		*p = 0xaaaaaaaa;	for (p = pstart; p < pend; p++) {		if (*p != 0xaaaaaaaa) {			printf ("SDRAM test fails at: %08x\n", (uint) p);			return 1;		}	}	for (p = pstart; p < pend; p++)		*p = 0x55555555;	for (p = pstart; p < pend; p++) {		if (*p != 0x55555555) {			printf ("SDRAM test fails at: %08x\n", (uint) p);			return 1;		}	}	printf("OK\n");	return 0;}#endif#if !defined(CONFIG_SPD_EEPROM)/************************************************************************* *  fixed sdram init -- doesn't use serial presence detect. * *  Assumes:	128 MB, non-ECC, non-registered *		PLB @ 133 MHz * ************************************************************************/long int fixed_sdram (void){	uint reg;	/*--------------------------------------------------------------------	 * Setup some default	 *------------------------------------------------------------------*/	mtsdram (mem_uabba, 0x00000000);	/* ubba=0 (default)		*/	mtsdram (mem_slio, 0x00000000);		/* rdre=0 wrre=0 rarw=0		*/	mtsdram (mem_devopt, 0x00000000);	/* dll=0 ds=0 (normal)		*/	mtsdram (mem_wddctr, 0x00000000);	/* wrcp=0 dcd=0			*/	mtsdram (mem_clktr, 0x40000000);	/* clkp=1 (90 deg wr) dcdt=0	*/	/*--------------------------------------------------------------------	 * Setup for board-specific specific mem	 *------------------------------------------------------------------*/	/*	 * Following for CAS Latency = 2.5 @ 133 MHz PLB	 */	mtsdram (mem_b0cr, 0x000a4001); /* SDBA=0x000 128MB, Mode 3, enabled */	mtsdram (mem_tr0, 0x410a4012);	/* WR=2	 WD=1 CL=2.5 PA=3 CP=4 LD=2 */	/* RA=10 RD=3			    */	mtsdram (mem_tr1, 0x8080082f);	/* SS=T2 SL=STAGE 3 CD=1 CT=0x02f   */	mtsdram (mem_rtr, 0x08200000);	/* Rate 15.625 ns @ 133 MHz PLB	    */	mtsdram (mem_cfg1, 0x00000000); /* Self-refresh exit, disable PM    */	udelay (400);			/* Delay 200 usecs (min)	    */	/*--------------------------------------------------------------------	 * Enable the controller, then wait for DCEN to complete	 *------------------------------------------------------------------*/	mtsdram (mem_cfg0, 0x86000000); /* DCEN=1, PMUD=1, 64-bit	    */	for (;;) {		mfsdram (mem_mcsts, reg);		if (reg & 0x80000000)			break;	}	return (128 * 1024 * 1024);	/* 128 MB			    */}#endif	/* !defined(CONFIG_SPD_EEPROM) *//************************************************************************* *  pci_pre_init * *  This routine is called just prior to registering the hose and gives *  the board the opportunity to check things. Returning a value of zero *  indicates that things are bad & PCI initialization should be aborted. * *	Different boards may wish to customize the pci controller structure *	(add regions, override default access routines, etc) or perform *	certain pre-initialization actions. * ************************************************************************/#if defined(CONFIG_PCI) && defined(CFG_PCI_PRE_INIT)int pci_pre_init(struct pci_controller * hose ){	unsigned long strap;	/*--------------------------------------------------------------------------+	 *	The metrobox is always configured as the host & requires the	 *	PCI arbiter to be enabled.	 *--------------------------------------------------------------------------*/	mfsdr(sdr_sdstp1, strap);	if( (strap & SDR0_SDSTP1_PAE_MASK) == 0 ){		printf("PCI: SDR0_STRP1[%08lX] - PCI Arbiter disabled.\n",strap);		return 0;	}	return 1;}#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_PRE_INIT) *//************************************************************************* *  pci_target_init * *	The bootstrap configuration provides default settings for the pci *	inbound map (PIM). But the bootstrap config choices are limited and *	may not be sufficient for a given board. * ************************************************************************/#if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)void pci_target_init(struct pci_controller * hose ){	/*--------------------------------------------------------------------------+	 * Disable everything	 *--------------------------------------------------------------------------*/	out32r( PCIX0_PIM0SA, 0 ); /* disable */	out32r( PCIX0_PIM1SA, 0 ); /* disable */	out32r( PCIX0_PIM2SA, 0 ); /* disable */	out32r( PCIX0_EROMBA, 0 ); /* disable expansion rom */	/*--------------------------------------------------------------------------+	 * Map all of SDRAM to PCI address 0x0000_0000. Note that the 440 strapping	 * options to not support sizes such as 128/256 MB.	 *--------------------------------------------------------------------------*/	out32r( PCIX0_PIM0LAL, CFG_SDRAM_BASE );	out32r( PCIX0_PIM0LAH, 0 );	out32r( PCIX0_PIM0SA, ~(gd->ram_size - 1) | 1 );	out32r( PCIX0_BAR0, 0 );	/*--------------------------------------------------------------------------+	 * Program the board's subsystem id/vendor id	 *--------------------------------------------------------------------------*/	out16r( PCIX0_SBSYSVID, CFG_PCI_SUBSYS_VENDORID );	out16r( PCIX0_SBSYSID, CFG_PCI_SUBSYS_DEVICEID );	out16r( PCIX0_CMD, in16r(PCIX0_CMD) | PCI_COMMAND_MEMORY );}#endif /* defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT) *//************************************************************************* *  is_pci_host * * ************************************************************************/#if defined(CONFIG_PCI)int is_pci_host(struct pci_controller *hose){    /* The metrobox is always configured as host. */    return(1);}#endif /* defined(CONFIG_PCI) *//************************************************************************* *  board_get_enetaddr * *  Get the ethernet MAC address for the management ethernet from the *  strap EEPROM.  Note that is the BASE address for the range of *  external ethernet MACs on the board.  The base + 31 is the actual *  mgmt mac address. * ************************************************************************/static int macaddr_idx = 0;void board_get_enetaddr (uchar * enet){	int i;	unsigned short tmp;	unsigned char buff[0x100], *cp;	if (0 == macaddr_idx) {		/* Initialize I2C */		i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);		/* Read 256 bytes in EEPROM */		i2c_read (0x50, 0, 1, buff, 0x100);		cp = &buff[0xF0];		for (i = 0; i < 6; i++,cp++)			enet[i] = *cp;		memcpy(&tmp, &enet[4], 2);		tmp += 31;		memcpy(&enet[4], &tmp, 2);		macaddr_idx++;	} else {		enet[0] = 0x02;		enet[1] = 0x00;		enet[2] = 0x00;		enet[3] = 0x00;		enet[4] = 0x00;		if (1 == sbcommon_get_master() ) {			/* Master/Primary card */			enet[5] = 0x01;		} else {			/* Slave/Secondary card */			enet [5] = 0x02;		}	}	return;}#ifdef CONFIG_POST/* * Returns 1 if keys pressed to start the power-on long-running tests * Called from board_init_f(). */int post_hotkeys_pressed(void){	return (ctrlc());}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情一区在线| 亚洲成人av中文| 国产精品综合二区| 精品国产乱码久久久久久牛牛| 蜜臀a∨国产成人精品| 欧美一区二区免费视频| 麻豆91精品91久久久的内涵| 日韩欧美国产综合一区| 国产一区二区三区不卡在线观看| 久久精品亚洲麻豆av一区二区| 国产99久久久精品| 亚洲三级电影网站| 欧美人与禽zozo性伦| 久久国产剧场电影| 国产精品美女视频| 91福利精品第一导航| 日韩国产欧美视频| 久久九九全国免费| 91福利国产精品| 麻豆精品在线视频| 国产精品嫩草99a| 欧美日韩一区二区三区四区| 国产真实精品久久二三区| 亚洲私人黄色宅男| 3d成人动漫网站| 99久久精品免费看| 美女任你摸久久| 中文字幕亚洲区| 欧美xxxx在线观看| 91伊人久久大香线蕉| 另类成人小视频在线| 中文字幕人成不卡一区| 欧美一级国产精品| 亚洲人吸女人奶水| 日本三级韩国三级欧美三级| 欧美日韩第一区日日骚| 亚洲日本va午夜在线影院| 精品一区二区三区的国产在线播放| 国产a精品视频| 欧美videos中文字幕| 亚洲综合网站在线观看| 色综合欧美在线视频区| 国产精品免费久久| 久久久99久久精品欧美| 综合久久综合久久| 日韩一区二区精品在线观看| www.av亚洲| 狠狠色伊人亚洲综合成人| 最新高清无码专区| 2019国产精品| 欧美日本不卡视频| 在线视频一区二区三| 高清成人免费视频| 久久精品国产一区二区| 亚洲国产欧美日韩另类综合| 国产精品三级av在线播放| 精品国产乱码91久久久久久网站| 在线亚洲欧美专区二区| 成人福利视频网站| 国产精品影视在线| 精品一二线国产| 日本三级亚洲精品| 午夜成人免费视频| 亚洲一区二区三区不卡国产欧美| 国产精品乱人伦中文| 久久色.com| 精品va天堂亚洲国产| 日韩一区二区视频在线观看| 欧美另类变人与禽xxxxx| 在线视频一区二区三| 日本韩国精品在线| 91老司机福利 在线| 91亚洲国产成人精品一区二区三| 北条麻妃一区二区三区| 成人的网站免费观看| 国产成人在线看| 国产高清无密码一区二区三区| 精品一区二区在线视频| 国产成人亚洲精品狼色在线 | 欧美大胆人体bbbb| 在线不卡中文字幕播放| 欧美精品视频www在线观看| 欧美四级电影网| 欧美日本一区二区在线观看| 欧美日韩一区二区三区高清| 欧美一区日韩一区| 欧美一区二区三区在线视频| 色综合天天综合网天天看片| 日韩国产欧美在线播放| 97aⅴ精品视频一二三区| 国产在线不卡一区| 奇米精品一区二区三区在线观看 | 色欧美乱欧美15图片| 尤物在线观看一区| 国产精品情趣视频| 久久综合久色欧美综合狠狠| 国产日产精品1区| 国产精品卡一卡二| 一色屋精品亚洲香蕉网站| 国产精品福利一区二区三区| 亚洲伦理在线精品| 亚洲va国产va欧美va观看| 午夜久久久久久| 国产一区二区在线免费观看| 成人精品视频一区二区三区| 91久久人澡人人添人人爽欧美| 欧美伊人久久久久久久久影院| 欧美挠脚心视频网站| 久久综合九色综合欧美98| 亚洲国产高清在线观看视频| 一区二区三区美女| 麻豆免费看一区二区三区| 成人av网站在线观看| 欧美日韩一级大片网址| 久久精品视频一区二区三区| 亚洲欧美一区二区三区久本道91| 午夜一区二区三区视频| 国产综合久久久久久久久久久久 | 日韩一区二区三区视频在线| 国产欧美精品一区二区三区四区| 亚洲日韩欧美一区二区在线| 午夜亚洲福利老司机| 国产aⅴ综合色| 欧美日韩国产另类不卡| 欧美国产日韩亚洲一区| 亚瑟在线精品视频| 国产aⅴ综合色| 91精品国产欧美一区二区| 国产精品午夜久久| 天天操天天干天天综合网| yourporn久久国产精品| 欧美一区二区三区日韩| 1区2区3区欧美| 精品一区二区三区香蕉蜜桃 | 国产老妇另类xxxxx| 欧美日韩一区在线观看| 国产免费成人在线视频| 日韩二区三区四区| 色综合欧美在线| 久久亚洲综合色| 石原莉奈在线亚洲三区| 97精品久久久久中文字幕 | 精品一区二区在线免费观看| 欧美伊人久久久久久午夜久久久久| 国产亚洲精品aa午夜观看| 99国产精品国产精品久久| 亚洲精品高清视频在线观看| 91麻豆精品国产综合久久久久久| 国产精品亲子伦对白| 青娱乐精品视频| 欧美色区777第一页| 久久久午夜精品理论片中文字幕| 欧美成人免费网站| 亚洲丰满少妇videoshd| 成人精品一区二区三区中文字幕| 精品乱人伦小说| 蜜乳av一区二区| 欧美一区二区三区四区五区| caoporn国产精品| 亚洲欧美日韩在线不卡| 亚洲人成7777| 中文一区一区三区高中清不卡| 狠狠色综合播放一区二区| 久久夜色精品国产噜噜av| 从欧美一区二区三区| 综合久久给合久久狠狠狠97色 | 欧美成人vr18sexvr| 久久国产精品色婷婷| 国产精品传媒在线| 欧美一级国产精品| 精品国产乱码久久久久久夜甘婷婷 | 久久综合狠狠综合久久综合88| 奇米在线7777在线精品| 51久久夜色精品国产麻豆| 丝袜诱惑制服诱惑色一区在线观看| 欧美亚洲综合一区| 视频一区中文字幕| 日韩欧美久久久| 国产麻豆精品视频| 国产精品久久午夜| 91在线观看成人| 亚洲一区二区四区蜜桃| 欧美日韩大陆在线| 男男视频亚洲欧美| 久久色在线视频| 波波电影院一区二区三区| 一区二区三区四区av| 欧美色视频在线观看| 日韩精品视频网站| 久久综合色天天久久综合图片| 国产成人激情av| 亚洲高清视频中文字幕| 日韩三区在线观看| 国产伦精一区二区三区| 亚洲美女视频在线| 欧美精品第一页| 国产精品羞羞答答xxdd| 综合在线观看色| 在线成人av网站| 丁香网亚洲国际|