Beispiel #1
0
static MACHINE_START( juicebox )
{
	juicebox_state *juicebox = machine.driver_data<juicebox_state>();
	juicebox->s3c44b0 = machine.device( "s3c44b0");
	smc_init( machine);
	juicebox->dac = machine.device<dac_device>( "dac");
}
Beispiel #2
0
static int lubbock_coredevice_init(void)
{
	barebox_set_model("Lubbock PXA25x");
	barebox_set_hostname("lubbock");
	pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config));
	smc_init();
	return 0;
}
/*! \brief This example shows how to access an external RAM connected to the SMC module.
 */
int main(void)
{
	// Get base address of SRAM module
	volatile uint32_t *sram = SRAM;

	// Switch to external oscillator 0.
	pm_switch_to_osc0(&AVR32_PM, FOSC0, OSC0_STARTUP);

	// Initialize debug serial line
	init_dbg_rs232(FOSC0);

	// Display a header to user
	print_dbg("\x1B[2J\x1B[H\r\nSMC Example\r\n");

	print_dbg("Board running at ");
	print_dbg_ulong(FOSC0 / 1000000);
	print_dbg(" MHz\r\n");

	print_dbg("Initializing SRAM...");

	// Initialize the external SRAM chip.
	smc_init(FOSC0);
	print_dbg("done\r\n\r\n");

	print_dbg("Testing SRAM...\r\n");

	// Test each address location inside the chip with a write/readback
	uint32_t total_tests  = 0;
	uint32_t total_errors = 0;

	for (uint32_t total_tests = 0; total_tests < SRAM_SIZE; total_tests++) {
		sram[total_tests] = total_tests;

		if (total_tests != sram[total_tests]) {
			total_errors++;

			print_dbg("Error at 0x");
			print_dbg_hex((uint32_t)&sram[total_tests]);
			print_dbg("\r\n");
		}
    }

	if (total_errors == 0) {
		print_dbg("SRAM test successfully completed\r\n");
	}
	else {
		print_dbg("SRAM test completed with ");
		print_dbg_ulong(total_errors);
		print_dbg(" errors out of ");
		print_dbg_ulong(total_tests);
		print_dbg(" tests\r\n");
	}

	while (true);

	return 0;
}
Beispiel #4
0
//! \brief Initializes the Nand Flash Controller and low level driver.
//!
//! \param hsb_f_hz HSB frequency in Hertz
//!
void nf_init( U32 hsb_f_hz /*U8 nb_dev, U16 lpb*/ )
{
  static const gpio_map_t SMC_NF_EBI_GPIO_MAP =
  {
    {ATPASTE2(EBI_NANDOE,_PIN),ATPASTE2(EBI_NANDOE,_FUNCTION)},
    {ATPASTE2(EBI_NANDWE,_PIN),ATPASTE2(EBI_NANDWE,_FUNCTION)},
 };

  gpio_enable_module(SMC_NF_EBI_GPIO_MAP, sizeof(SMC_NF_EBI_GPIO_MAP) / sizeof(SMC_NF_EBI_GPIO_MAP[0]));
  smc_init(hsb_f_hz);

  // Enable Nand Flash Chip Select
  AVR32_HMATRIX.sfr[AVR32_EBI_HMATRIX_NR] |= (1 << AVR32_EBI_NAND_CS);

/*
   Nfc_disable();           // Reset the macro
   Nfc_enable();
   Nfc_ecc_disable();
   Nfc_spzone_disable();
#if (defined NF_TIMING_READ)
   Nfc_set_read_timing( NF_TIMING_READ );
#endif
*/
}
Beispiel #5
0
static int
ethif_probe(struct device *dev)
{
    u_long base_addr = dev->base_addr;

    if ((base_addr == 0xffe0)  ||  (base_addr == 1))
	return 1;		/* ENXIO */

    if (1
	/* All PCI probes are safe, and thus should be first. */
#ifdef CONFIG_DE4X5             /* DEC DE425, DE434, DE435 adapters */
	&& de4x5_probe(dev)
#endif
#ifdef CONFIG_DGRS
	&& dgrs_probe(dev)
#endif
#ifdef CONFIG_EEXPRESS_PRO100B	/* Intel EtherExpress Pro100B */
	&& eepro100_probe(dev)
#endif
#ifdef CONFIG_EPIC
	&& epic100_probe(dev)
#endif
#if defined(CONFIG_HP100)
	&& hp100_probe(dev)
#endif	
#if defined(CONFIG_NE2K_PCI)
	&& ne2k_pci_probe(dev)
#endif
#ifdef CONFIG_PCNET32
	&& pcnet32_probe(dev)
#endif
#ifdef CONFIG_RTL8139
	&& rtl8139_probe(dev)
#endif
#if defined(CONFIG_VIA_RHINE)
	&& via_rhine_probe(dev)
#endif
#if defined(CONFIG_VORTEX)
	&& tc59x_probe(dev)
#endif
#if defined(CONFIG_DEC_ELCP)
	&& tulip_probe(dev)
#endif
#ifdef CONFIG_YELLOWFIN
	&& yellowfin_probe(dev)
#endif
	/* Next mostly-safe EISA-only drivers. */
#ifdef CONFIG_AC3200		/* Ansel Communications EISA 3200. */
	&& ac3200_probe(dev)
#endif
#if defined(CONFIG_ULTRA32)
	&& ultra32_probe(dev)
#endif
	/* Third, sensitive ISA boards. */
#ifdef CONFIG_AT1700
	&& at1700_probe(dev)
#endif
#if defined(CONFIG_ULTRA)
	&& ultra_probe(dev)
#endif
#if defined(CONFIG_SMC9194)
	&& smc_init(dev)
#endif
#if defined(CONFIG_WD80x3)
	&& wd_probe(dev)
#endif
#if defined(CONFIG_EL2)		/* 3c503 */
	&& el2_probe(dev)
#endif
#if defined(CONFIG_HPLAN)
	&& hp_probe(dev)
#endif
#if defined(CONFIG_HPLAN_PLUS)
	&& hp_plus_probe(dev)
#endif
#if defined(CONFIG_SEEQ8005)
	&& seeq8005_probe(dev)
#endif
#ifdef CONFIG_E2100		/* Cabletron E21xx series. */
	&& e2100_probe(dev)
#endif
#if defined(CONFIG_NE2000)
	&& ne_probe(dev)
#endif
#ifdef CONFIG_AT1500
	&& at1500_probe(dev)
#endif
#ifdef CONFIG_FMV18X		/* Fujitsu FMV-181/182 */
	&& fmv18x_probe(dev)
#endif
#ifdef CONFIG_ETH16I
	&& eth16i_probe(dev)	/* ICL EtherTeam 16i/32 */
#endif
#ifdef CONFIG_EL3		/* 3c509 */
	&& el3_probe(dev)
#endif
#ifdef CONFIG_3C515		/* 3c515 */
	&& tc515_probe(dev)
#endif
#ifdef CONFIG_ZNET		/* Zenith Z-Note and some IBM Thinkpads. */
	&& znet_probe(dev)
#endif
#ifdef CONFIG_EEXPRESS		/* Intel EtherExpress */
	&& express_probe(dev)
#endif
#ifdef CONFIG_EEXPRESS_PRO	/* Intel EtherExpress Pro/10 */
	&& eepro_probe(dev)
#endif
#ifdef CONFIG_DEPCA		/* DEC DEPCA */
	&& depca_probe(dev)
#endif
#ifdef CONFIG_EWRK3             /* DEC EtherWORKS 3 */
        && ewrk3_probe(dev)
#endif
#ifdef CONFIG_APRICOT		/* Apricot I82596 */
	&& apricot_probe(dev)
#endif
#ifdef CONFIG_EL1		/* 3c501 */
	&& el1_probe(dev)
#endif
#if	defined(CONFIG_WAVELAN)	/* WaveLAN */
	&& wavelan_probe(dev)
#endif	/* defined(CONFIG_WAVELAN) */
#ifdef CONFIG_EL16		/* 3c507 */
	&& el16_probe(dev)
#endif
#ifdef CONFIG_ELPLUS		/* 3c505 */
	&& elplus_probe(dev)
#endif
#ifdef CONFIG_DE600		/* D-Link DE-600 adapter */
	&& de600_probe(dev)
#endif
#ifdef CONFIG_DE620		/* D-Link DE-620 adapter */
	&& de620_probe(dev)
#endif
#if defined(CONFIG_SK_G16)
	&& SK_init(dev)
#endif
#ifdef CONFIG_NI52
	&& ni52_probe(dev)
#endif
#ifdef CONFIG_NI65
	&& ni65_probe(dev)
#endif
#ifdef CONFIG_LANCE	/* ISA LANCE boards */
	&& lance_probe(dev)
#endif
#ifdef CONFIG_ATARILANCE	/* Lance-based Atari ethernet boards */
	&& atarilance_probe(dev)
#endif
#ifdef CONFIG_A2065		/* Commodore/Ameristar A2065 Ethernet Board */
	&& a2065_probe(dev)
#endif
#ifdef CONFIG_APNE		/* Amiga 1200 PCMCIA NEx000 Ethernet Board */
	&& apne_probe(dev)
#endif
#ifdef CONFIG_ARIADNE		/* Village Tronic Ariadne Ethernet Board */
	&& ariadne_probe(dev)
#endif
#ifdef CONFIG_ARIADNE2		/* Village Tronic Ariadne II Ethernet Board */
	&& ariadne2_probe(dev)
#endif
#ifdef CONFIG_HYDRA		/* Hydra Systems Amiganet Ethernet board */
	&& hydra_probe(dev)
#endif
#ifdef CONFIG_ATARI_BIONET	/* Atari Bionet Ethernet board */
	&& bionet_probe(dev)
#endif
#ifdef CONFIG_ATARI_PAMSNET	/* Atari PAMsNet Ethernet board */
	&& pamsnet_probe(dev)
#endif
#ifdef CONFIG_SUNLANCE
	&& sparc_lance_probe(dev)
#endif
#ifdef CONFIG_TLAN
	&& tlan_probe(dev)
#endif
#ifdef CONFIG_LANCE
	&& lance_probe(dev)
#endif
	&& 1 ) {
	return 1;	/* -ENODEV or -EAGAIN would be more accurate. */
    }
    return 0;
}
static void
neponset_init(void)
{
	smc_init();
}
Beispiel #7
0
// top-level peripheral init
static void init_avr32(void) {
  volatile avr32_tc_t *tc = APP_TC;
  // clocks
  // setup clocks
  sysclk_init();

  // not sure why but when need to explictly enable clock for static mem ctlr
  sysclk_enable_pbb_module(SYSCLK_SMC_REGS);
  flashc_set_bus_freq(FCPU_HZ);
  // need this for high-speed operation
  flashc_set_wait_state(1);

  /// interrupts
  //  print_dbg("\r\n  irq_initialize_vectors() ");
  irq_initialize_vectors();
  // disable all interrupts for now
  //  print_dbg("\r\n  cpu_irq_disable() ");
  cpu_irq_disable();

  // serial usb
  print_dbg("\r\n  init_ftdi_usart() ");
  init_ftdi_usart();
  // external sram
  print_dbg("\r\n  smc_init(FHSB_HZ) ");
  smc_init(FHSB_HZ);

  // initialize spi1: OLED, ADC, SD/MMC
  print_dbg("\r\n  init_spi1() ");
  init_spi1();
  // initialize PDCA controller

  print_dbg("\r\n  init_local_pdca() ");
  init_local_pdca();

  // initialize blackfin resources
  print_dbg("\r\n  init_bfin_resources() ");
  init_bfin_resources();

  // initialize application timer
  print_dbg("\r\n  init_tc(tc) ");
  init_tc(tc);

  // initialize other GPIO
  print_dbg("\r\n  init_gpio() ");
  init_gpio();

  // register interrupts
  print_dbg("\r\n  register_interrupts() ");
  register_interrupts();

  // initialize the OLED screen
  print_dbg("\r\n  init_oled() ");
  init_oled();

  // enable interrupts
  print_dbg("\r\n  cpu_irq_enable() ");
  cpu_irq_enable();

  // usb host controller
  init_usb_host();
  // initialize usb classes
  print_dbg("\r\n init_monome ");
  init_monome();
  //  init_midi();
  //  init_hid();
}
Beispiel #8
0
static int
ethif_probe(struct device *dev)
{
    u_long base_addr = dev->base_addr;

    if ((base_addr == 0xffe0)  ||  (base_addr == 1))
	return 1;		/* ENXIO */

    if (1
#if defined(CONFIG_OSFMACH3)
	&& osfmach3_ethif_probe(dev)
#endif
#ifdef CONFIG_DGRS
	&& dgrs_probe(dev)
#endif
#if defined(CONFIG_VORTEX)
	&& tc59x_probe(dev)
#endif
#if defined(CONFIG_SEEQ8005)
	&& seeq8005_probe(dev)
#endif
#if defined(CONFIG_DEC_ELCP)
	&& tulip_probe(dev)
#endif
#if defined(CONFIG_HP100)
	&& hp100_probe(dev)
#endif	
#if defined(CONFIG_ULTRA)
	&& ultra_probe(dev)
#endif
#if defined(CONFIG_ULTRA32)
	&& ultra32_probe(dev)
#endif
#if defined(CONFIG_SMC9194)
	&& smc_init(dev)
#endif
#if defined(CONFIG_WD80x3) || defined(WD80x3)
	&& wd_probe(dev)
#endif
#if defined(CONFIG_EL2) || defined(EL2)	/* 3c503 */
	&& el2_probe(dev)
#endif
#if defined(CONFIG_HPLAN) || defined(HPLAN)
	&& hp_probe(dev)
#endif
#if defined(CONFIG_HPLAN_PLUS)
	&& hp_plus_probe(dev)
#endif
#ifdef CONFIG_AC3200		/* Ansel Communications EISA 3200. */
	&& ac3200_probe(dev)
#endif
#ifdef CONFIG_E2100		/* Cabletron E21xx series. */
	&& e2100_probe(dev)
#endif
#if defined(CONFIG_NE2000) || defined(NE2000)
	&& ne_probe(dev)
#endif
#ifdef CONFIG_AT1500
	&& at1500_probe(dev)
#endif
#ifdef CONFIG_AT1700
	&& at1700_probe(dev)
#endif
#ifdef CONFIG_FMV18X		/* Fujitsu FMV-181/182 */
	&& fmv18x_probe(dev)
#endif
#ifdef CONFIG_ETH16I
	&& eth16i_probe(dev)	/* ICL EtherTeam 16i/32 */
#endif
#ifdef CONFIG_EL3		/* 3c509 */
	&& el3_probe(dev)
#endif
#ifdef CONFIG_ZNET		/* Zenith Z-Note and some IBM Thinkpads. */
	&& znet_probe(dev)
#endif
#ifdef CONFIG_EEXPRESS		/* Intel EtherExpress */
	&& express_probe(dev)
#endif
#ifdef CONFIG_EEXPRESS_PRO	/* Intel EtherExpress Pro/10 */
	&& eepro_probe(dev)
#endif
#ifdef CONFIG_EEXPRESS_PRO100B	/* Intel EtherExpress Pro100B */
	&& eepro100_probe(dev)
#endif
#ifdef CONFIG_DEPCA		/* DEC DEPCA */
	&& depca_probe(dev)
#endif
#ifdef CONFIG_EWRK3             /* DEC EtherWORKS 3 */
        && ewrk3_probe(dev)
#endif
#ifdef CONFIG_DE4X5             /* DEC DE425, DE434, DE435 adapters */
        && de4x5_probe(dev)
#endif
#ifdef CONFIG_APRICOT		/* Apricot I82596 */
	&& apricot_probe(dev)
#endif
#ifdef CONFIG_EL1		/* 3c501 */
	&& el1_probe(dev)
#endif
#if	defined(CONFIG_WAVELAN)	/* WaveLAN */
	&& wavelan_probe(dev)
#endif	/* defined(CONFIG_WAVELAN) */
#ifdef CONFIG_EL16		/* 3c507 */
	&& el16_probe(dev)
#endif
#ifdef CONFIG_ELPLUS		/* 3c505 */
	&& elplus_probe(dev)
#endif
#ifdef CONFIG_DE600		/* D-Link DE-600 adapter */
	&& de600_probe(dev)
#endif
#ifdef CONFIG_DE620		/* D-Link DE-620 adapter */
	&& de620_probe(dev)
#endif
#if defined(CONFIG_SK_G16)
	&& SK_init(dev)
#endif
#ifdef CONFIG_NI52
	&& ni52_probe(dev)
#endif
#ifdef CONFIG_NI65
	&& ni65_probe(dev)
#endif
#ifdef CONFIG_ATARILANCE	/* Lance-based Atari ethernet boards */
	&& atarilance_probe(dev)
#endif
#ifdef CONFIG_A2065		/* Commodore/Ameristar A2065 Ethernet Board */
	&& a2065_probe(dev)
#endif
#ifdef CONFIG_ARIADNE		/* Village Tronic Ariadne Ethernet Board */
	&& ariadne_probe(dev)
#endif
#ifdef CONFIG_HYDRA		/* Hydra Systems Amiganet Ethernet board */
	&& hydra_probe(dev)
#endif
#ifdef CONFIG_SUNLANCE
	&& sparc_lance_probe(dev)
#endif
	&& 1 ) {
	return 1;	/* -ENODEV or -EAGAIN would be more accurate. */
    }
    return 0;
}
Beispiel #9
0
/*
 考虑到升级是个非常重要但又较少依赖其他模块的功能,因此即使大部分模块初始化失败,也一样要继续运行,只要组播功能正常即可。
*/
void *main_thread()
{	
	DEBUG("main thread start...\n");
	compile_timeprint();
        
	_wLBM_zyzdmb(13578642);
   	
   	smarthome_gw_sn_init();
   	
	if(-1==setting_init()){
		DEBUG("setting init failed\n");
		//return NULL;
	}
	
	if(-1==push_decoder_buf_init()){
		DEBUG("push decoder buf init failed\n");
		//return NULL;
	}
	
	chanFilterInit();
    smc_init();
	
	if(-1==sqlite_init()){
		DEBUG("sqlite init failed\n");
		//return NULL;
	}
	
	setting_init_with_database();
	
	maintenance_thread_init();
	
	if(-1==xmlparser_init()){
		DEBUG("xmlparser init failed\n");
		//return NULL;
	}
	
//	return parse_xml("pushroot/pushinfo/1/ProductDesc.xml", PRODUCTDESC_XML, NULL);
	
	if(0!=drm_init()){
		DEBUG("drm init failed\n");
		//return NULL;
	}
	
	upgrade_info_init();
	
// 根据首次开机标记"/data/data/com.dbstar/files/flag"决定是否要重置国电网关序列号
	smarthome_sn_init_when_network_init();
	
	
#if 0
/*
 慎用:只有在需要清理已有授权、重新接收授权时使用,正式版本不能调用。
*/
DEBUG("\n\nWarning: you call function CDCASTB_FormatBuffer, it is an unnormal action\n\n\n");
CDCASTB_FormatBuffer();
#endif


	if(-1==mid_push_init(PUSH_CONF)){
		DEBUG("push model init with \"%s\" failed\n", PUSH_CONF);
		//return NULL;
	}
	
	if(-1==igmp_init()){
		DEBUG("igmp init failed\n");
		//return NULL;
	}
	
	if(-1==softdvb_init()){
		DEBUG("dvb init with failed\n");
		//return NULL;
	}
	
	smartlife_connect_init();
	
	DEBUG("OK ================================ OK\n");
	msg_send2_UI(STATUS_DVBPUSH_INIT_SUCCESS, NULL, 0);
	
	int main_running = 1;
	while(1==main_running)
	{
		pthread_mutex_lock(&mtx_main);
		/*
		需要本线程先运行到这里,再在其他非父线程中执行pthread_cond_signal(&cond_push_monitor)才能生效。
		*/
		pthread_cond_wait(&cond_main,&mtx_main);
		DEBUG("main thread is closed by external call\n");
		main_running = 0;
		pthread_mutex_unlock(&mtx_main);
	}
	DEBUG("exit from main thread\n");
	
	return NULL;
}
Beispiel #10
0
void juicebox_state::machine_start()
{
	s3c44b0 = machine().device( "s3c44b0");
	smc_init( machine());
	dac = machine().device<dac_device>( "dac");
}