static void __init qnap_ts41x_init(void)
{
	u32 dev, rev;

	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_init();
	kirkwood_mpp_conf(qnap_ts41x_mpp_config);

	kirkwood_uart0_init();
	kirkwood_uart1_init(); /* A PIC controller is connected here. */
	qnap_tsx1x_register_flash();
	kirkwood_i2c_init();
	i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1);

	kirkwood_pcie_id(&dev, &rev);
	if (dev == MV88F6282_DEV_ID) {
		qnap_ts41x_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
		qnap_ts41x_ge01_data.phy_addr = MV643XX_ETH_PHY_ADDR(1);
	}
	kirkwood_ge00_init(&qnap_ts41x_ge00_data);
	kirkwood_ge01_init(&qnap_ts41x_ge01_data);

	kirkwood_sata_init(&qnap_ts41x_sata_data);
	kirkwood_ehci_init();
	platform_device_register(&qnap_ts41x_button_device);

	pm_power_off = qnap_tsx1x_power_off;

	if (gpio_request(QNAP_TS41X_JUMPER_JP1, "JP1") == 0)
		gpio_export(QNAP_TS41X_JUMPER_JP1, 0);
}
示例#2
0
文件: common.c 项目: E-LLP/n900
/*
 * Identify device ID and revision.
 */
static char * __init kirkwood_id(void)
{
	u32 dev, rev;

	kirkwood_pcie_id(&dev, &rev);

	if (dev == MV88F6281_DEV_ID) {
		if (rev == MV88F6281_REV_Z0)
			return "MV88F6281-Z0";
		else if (rev == MV88F6281_REV_A0)
			return "MV88F6281-A0";
		else
			return "MV88F6281-Rev-Unsupported";
	} else if (dev == MV88F6192_DEV_ID) {
		if (rev == MV88F6192_REV_Z0)
			return "MV88F6192-Z0";
		else if (rev == MV88F6192_REV_A0)
			return "MV88F6192-A0";
		else
			return "MV88F6192-Rev-Unsupported";
	} else if (dev == MV88F6180_DEV_ID) {
		if (rev == MV88F6180_REV_A0)
			return "MV88F6180-Rev-A0";
		else
			return "MV88F6180-Rev-Unsupported";
	} else {
		return "Device-Unknown";
	}
}
示例#3
0
static void __init rd88f6281_init(void)
{
	u32 dev, rev;

	
	kirkwood_init();
	kirkwood_mpp_conf(rd88f6281_mpp_config);

	kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
	kirkwood_ehci_init();

	kirkwood_ge00_init(&rd88f6281_ge00_data);
	kirkwood_pcie_id(&dev, &rev);
	if (rev == MV88F6281_REV_A0) {
		rd88f6281_switch_chip_data.sw_addr = 10;
		kirkwood_ge01_init(&rd88f6281_ge01_data);
	} else {
		rd88f6281_switch_chip_data.port_names[4] = "wan";
	}
	kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);

	kirkwood_sata_init(&rd88f6281_sata_data);
	kirkwood_sdio_init(&rd88f6281_mvsdio_data);
	kirkwood_uart0_init();
}
static void __init iconnect_init(void)
{
	u32 dev, rev;

	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_init();
	kirkwood_mpp_conf(iconnect_mpp_config);

	kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
	kirkwood_ehci_init();

	kirkwood_ge00_init(&iconnect_ge00_data);
	kirkwood_pcie_id(&dev, &rev);

	kirkwood_uart0_init();

	platform_device_register(&iconnect_leds);
	platform_device_register(&iconnect_button_device);
       
	kirkwood_i2c_init();
	i2c_register_board_info(0, &iconnect_i2c_rtc, 1);

}
示例#5
0
文件: ts219-setup.c 项目: 08opt/linux
static void __init qnap_ts219_init(void)
{
	u32 dev, rev;

	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_init();
	kirkwood_mpp_conf(qnap_ts219_mpp_config);

	kirkwood_uart0_init();
	kirkwood_uart1_init(); /* A PIC controller is connected here. */
	qnap_tsx1x_register_flash();
	kirkwood_i2c_init();
	i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1);

	kirkwood_pcie_id(&dev, &rev);
	if (dev == MV88F6282_DEV_ID) {
		qnap_ts219_buttons[0].gpio = 43; /* USB Copy button */
		qnap_ts219_buttons[1].gpio = 37; /* Reset button */
		qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
	}

	kirkwood_ge00_init(&qnap_ts219_ge00_data);
	kirkwood_sata_init(&qnap_ts219_sata_data);
	kirkwood_ehci_init();
	platform_device_register(&qnap_ts219_button_device);

	pm_power_off = qnap_tsx1x_power_off;

}
static void __init rd88f6281_init(void)
{
	u32 dev, rev;

	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_init();
	kirkwood_mpp_conf(rd88f6281_mpp_config);

	kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
	kirkwood_ehci_init();

	kirkwood_ge00_init(&rd88f6281_ge00_data);
	kirkwood_pcie_id(&dev, &rev);
	if (rev == MV88F6281_REV_A0) {
		rd88f6281_switch_chip_data.sw_addr = 10;
		kirkwood_ge01_init(&rd88f6281_ge01_data);
	} else {
		rd88f6281_switch_chip_data.port_names[4] = "wan";
	}
	kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);

	kirkwood_sata_init(&rd88f6281_sata_data);
	kirkwood_sdio_init(&rd88f6281_mvsdio_data);
	kirkwood_uart0_init();
	kirkwood_uart1_init();
	kirkwood_i2c_init();
	i2c_register_board_info(0, &i2c_a2d, 1);
	kirkwood_i2s_init();
}
示例#7
0
文件: common.c 项目: E-LLP/n900
int __init kirkwood_find_tclk(void)
{
	u32 dev, rev;

	kirkwood_pcie_id(&dev, &rev);
	if (dev == MV88F6281_DEV_ID && rev == MV88F6281_REV_A0)
		return 200000000;

	return 166666667;
}
示例#8
0
static void __init nsa310_init(void)
{
	u32 dev, rev;

	kirkwood_init();

	kirkwood_mpp_conf(nsa310_mpp_config);
	kirkwood_nand_init(ARRAY_AND_SIZE(nsa310_nand_parts), 40);
	kirkwood_pcie_id(&dev, &rev);

	kirkwood_sata_init(&nsa310_sata_data);
	kirkwood_uart0_init();
	kirkwood_i2c_init();

	platform_device_register(&nsa310_leds);
	platform_device_register(&nsa310_buttons);
	
	kirkwood_ehci_init();
//	USB Power delay for 20 sec	
	timer.function = nsa310_timerfunc;
        timer.data = 0;
	timer.expires = jiffies + msecs_to_jiffies(20000);
	add_timer(&timer);


/*  Power resume control */
	    gpio_request(49, "Power-clk");
	    gpio_direction_output(49, 1);
	    gpio_request(47, "Power-data");
// Clear power resume
//	    gpio_direction_output(47, 0);
// Set power resume
	    gpio_direction_output(47, 1);
	    udelay(1000);
//	    gpio_direction_output(49, 0);
	    gpio_set_value(49, 0);
// release GPIO?
//test
	    gpio_free(47);
	    gpio_free(49);
    	    printk(KERN_INFO "NSA310: Power resume enabled\n");


// Activate Power-off GPIO
	if (gpio_request(48, "Power-off") == 0 && gpio_direction_output(48, 0) == 0) {
//    	    gpio_free(48);
            pm_power_off = nsa310_power_off;
    	    printk(KERN_INFO "NSA310: Power-off GPIO enabled\n");
    	} else
		printk(KERN_ERR "NSA310: Failed to configure Power-off GPIO\n");

};
示例#9
0
void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
{
	u32 dev, rev;

	kirkwood_pcie_id(&dev, &rev);
	if (rev == 0)  /* catch all Kirkwood Z0's */
		mvsdio_data->clock = 100000000;
	else
		mvsdio_data->clock = 200000000;
	mvsdio_data->dram = &kirkwood_mbus_dram_info;
	kirkwood_sdio.dev.platform_data = mvsdio_data;
	platform_device_register(&kirkwood_sdio);
}
示例#10
0
static int __init db88f6281_pci_init(void)
{
	if (machine_is_db88f6281_bp()) {
		u32 dev, rev;

		kirkwood_pcie_id(&dev, &rev);
		if (dev == MV88F6282_DEV_ID)
			kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0);
		else
			kirkwood_pcie_init(KW_PCIE0);
	}
	return 0;
}
示例#11
0
void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
{
	u32 dev, rev;

	kirkwood_pcie_id(&dev, &rev);
	if (rev == 0)  
		mvsdio_data->clock = 100000000;
	else
		mvsdio_data->clock = 200000000;
	mvsdio_data->dram = &kirkwood_mbus_dram_info;
	kirkwood_clk_ctrl |= CGC_SDIO;
	kirkwood_sdio.dev.platform_data = mvsdio_data;
	platform_device_register(&kirkwood_sdio);
}
示例#12
0
文件: board-ts219.c 项目: 7L/pi_plus
void __init qnap_dt_ts219_init(void)
{
	u32 dev, rev;

	kirkwood_mpp_conf(qnap_ts219_mpp_config);

	kirkwood_pcie_id(&dev, &rev);
	if (dev == MV88F6282_DEV_ID)
		qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);

	kirkwood_ge00_init(&qnap_ts219_ge00_data);
	kirkwood_ehci_init();

	pm_power_off = qnap_tsx1x_power_off;
}
示例#13
0
文件: mpp.c 项目: BinVul/linux2.6.32
static unsigned int __init kirkwood_variant(void)
{
	u32 dev, rev;

	kirkwood_pcie_id(&dev, &rev);

	if (dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0)
		return MPP_F6281_MASK;
	if (dev == MV88F6192_DEV_ID && rev >= MV88F6192_REV_A0)
		return MPP_F6192_MASK;
	if (dev == MV88F6180_DEV_ID)
		return MPP_F6180_MASK;

	printk(KERN_ERR "MPP setup: unknown kirkwood variant "
			"(dev %#x rev %#x)\n", dev, rev);
	return 0;
}
static int __init ts41x_pci_init(void)
{
	if (machine_is_ts41x()) {
		u32 dev, rev;

		/*
		 * Without this explicit reset, the PCIe SATA controller
		 * (Marvell 88sx7042/sata_mv) is known to stop working
		 * after a few minutes.
		 */
		orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);

		kirkwood_pcie_id(&dev, &rev);
		if (dev == MV88F6282_DEV_ID)
			kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0);
		else
			kirkwood_pcie_init(KW_PCIE0);
	}

   return 0;
}
static void __init csb1724_init(void)
{
	
	u32 dev, rev;
	
	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_init();
	kirkwood_mpp_conf(csb1724_mpp_config);
	kirkwood_uart0_init();
	kirkwood_nand_init(ARRAY_AND_SIZE(csb1724_nand_parts), 25);
	kirkwood_ehci_init();
	kirkwood_pcie_id(&dev, &rev);
	kirkwood_ge00_init(&csb1724_ge00_data);
	kirkwood_ge01_init(&csb1724_ge01_data);
/*	csb1724_switch_chip_data.sw_addr = 10; */
/*	kirkwood_ge00_switch_init(&csb1724_switch_plat_data, NO_IRQ); */
	kirkwood_sata_init(&csb1724_sata_data);
/*	platform_device_register(&csb1724_leds); */
}