static void __init kurobox_pro_init(void)
{
	orion5x_init();

	orion5x_mpp_conf(kurobox_pro_mpp_modes);

	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&kurobox_pro_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&kurobox_pro_sata_data);
	orion5x_uart0_init();
	orion5x_uart1_init();
	orion5x_xor_init();

	orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
				   KUROBOX_PRO_NOR_BOOT_SIZE);
	platform_device_register(&kurobox_pro_nor_flash);

	if (machine_is_kurobox_pro()) {
		orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE,
				       KUROBOX_PRO_NAND_SIZE);
		platform_device_register(&kurobox_pro_nand_flash);
	}

	i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);

	
	pm_power_off = kurobox_pro_power_off;
}
示例#2
0
文件: dt2-setup.c 项目: 7LK/McWRT
static void __init dt2_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(dt2_mpp_modes);

	/*
	 * Configure peripherals.
	 */

	orion5x_uart0_init();
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_i2c_init();
	orion5x_sata_init(&dt2_sata_data);
	orion5x_xor_init();

	printk(KERN_INFO "U-Boot parameters:\n");
	printk(KERN_INFO "Sys Clk = %d, Tclk = %d, BoardID = 0x%02x\n", mvSysclk, mvTclk, gBoardId);

	printk(KERN_INFO "Serial: %s\n", dt2_eeprom.fc.dt2_serial_number);
	printk(KERN_INFO "Revision: %016x\n", dt2_eeprom.fc.dt2_revision);
	printk(KERN_INFO "DT2: Using MAC address %pM for port 0\n",
	       dt2_eeprom.gw.mac_addr[0]);
	printk(KERN_INFO "DT2: Using MAC address %pM for port 1\n",
	       dt2_eeprom.gw.mac_addr[1]);

	orion5x_eth_init(&dt2_eth_data);
	memcpy(dt2_eth_data.mac_addr, dt2_eeprom.gw.mac_addr[0], 6);
	orion5x_eth_switch_init(&dt2_switch_plat_data, NO_IRQ);

	i2c_register_board_info(0, &dt2_i2c_rtc, 1);

	mvebu_mbus_add_window("devbus-boot", DT2_NOR_BOOT_BASE,
			      DT2_NOR_BOOT_SIZE);

	platform_device_register(&dt2_nor_flash);

	mvebu_mbus_add_window("devbus-cs0", DT2_LEDS_BASE, DT2_LEDS_SIZE);
	platform_device_register(&dt2_leds);

	if (request_irq(gpio_to_irq(DT2_PIN_GPIO_RESET), &dt2_reset_handler,
			IRQF_DISABLED | IRQF_TRIGGER_LOW,
			"DT2: Reset button", NULL) < 0) {

		printk("DT2: Reset Button IRQ %d not available\n",
			gpio_to_irq(DT2_PIN_GPIO_RESET));
	}

	if (request_irq(gpio_to_irq(DT2_PIN_GPIO_POWER), &dt2_power_handler,
			IRQF_DISABLED | IRQF_TRIGGER_LOW,
			"DT2: Power button", NULL) < 0) {

		printk(KERN_DEBUG "DT2: Power Button IRQ %d not available\n",
			gpio_to_irq(DT2_PIN_GPIO_POWER));
	}
}
示例#3
0
static void __init qnap_ts209_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(ts209_mpp_modes);

	/*
	 * MPP[20] PCI clock 0
	 * MPP[21] PCI clock 1
	 * MPP[22] USB 0 over current
	 * MPP[23-25] Reserved
	 */

	/*
	 * Configure peripherals.
	 */
	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
				    ORION_MBUS_DEVBUS_BOOT_ATTR,
				    QNAP_TS209_NOR_BOOT_BASE,
				    QNAP_TS209_NOR_BOOT_SIZE);
	platform_device_register(&qnap_ts209_nor_flash);

	orion5x_ehci0_init();
	orion5x_ehci1_init();
	qnap_tsx09_find_mac_addr(QNAP_TS209_NOR_BOOT_BASE +
				 qnap_ts209_partitions[5].offset,
				 qnap_ts209_partitions[5].size);
	orion5x_eth_init(&qnap_tsx09_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&qnap_ts209_sata_data);
	orion5x_uart0_init();
	orion5x_uart1_init();
	orion5x_xor_init();

	platform_device_register(&qnap_ts209_button_device);

	/* Get RTC IRQ and register the chip */
	if (gpio_request(TS209_RTC_GPIO, "rtc") == 0) {
		if (gpio_direction_input(TS209_RTC_GPIO) == 0)
			qnap_ts209_i2c_rtc.irq = gpio_to_irq(TS209_RTC_GPIO);
		else
			gpio_free(TS209_RTC_GPIO);
	}
	if (qnap_ts209_i2c_rtc.irq == 0)
		pr_warning("qnap_ts209_init: failed to get RTC IRQ\n");
	i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);

	/* register tsx09 specific power-off method */
	pm_power_off = qnap_tsx09_power_off;
}
示例#4
0
static void __init mss2_init(void)
{
	/* Setup basic Orion functions. Need to be called early. */
	orion5x_init();

	orion5x_mpp_conf(mss2_mpp_modes);

	/*
	 * MPP[20] Unused
	 * MPP[21] PCI clock
	 * MPP[22] USB 0 over current
	 * MPP[23] USB 1 over current
	 */

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&mss2_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&mss2_sata_data);
	orion5x_uart0_init();
	orion5x_xor_init();

	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
				    ORION_MBUS_DEVBUS_BOOT_ATTR,
				    MSS2_NOR_BOOT_BASE,
				    MSS2_NOR_BOOT_SIZE);
	platform_device_register(&mss2_nor_flash);

	platform_device_register(&mss2_button_device);

	if (gpio_request(MSS2_GPIO_RTC_IRQ, "rtc") == 0) {
		if (gpio_direction_input(MSS2_GPIO_RTC_IRQ) == 0)
			mss2_i2c_rtc.irq = gpio_to_irq(MSS2_GPIO_RTC_IRQ);
		else
			gpio_free(MSS2_GPIO_RTC_IRQ);
	}
	i2c_register_board_info(0, &mss2_i2c_rtc, 1);

	/* register mss2 specific power-off method */
	pm_power_off = mss2_power_off;
}
static void __init net2big_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(net2big_mpp_modes);

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&net2big_eth_data);
	orion5x_i2c_init();
	orion5x_uart0_init();
	orion5x_xor_init();

	net2big_sata_power_init();
	orion5x_sata_init(&net2big_sata_data);

	orion5x_setup_dev_boot_win(NET2BIG_NOR_BOOT_BASE,
				   NET2BIG_NOR_BOOT_SIZE);
	platform_device_register(&net2big_nor_flash);

	platform_device_register(&net2big_gpio_buttons);
	net2big_gpio_leds_init();

	i2c_register_board_info(0, net2big_i2c_devices,
				ARRAY_SIZE(net2big_i2c_devices));

	orion_gpio_set_valid(NET2BIG_GPIO_POWER_OFF, 1);

	if (gpio_request(NET2BIG_GPIO_POWER_OFF, "power-off") == 0 &&
	    gpio_direction_output(NET2BIG_GPIO_POWER_OFF, 0) == 0)
		pm_power_off = net2big_power_off;
	else
		pr_err("net2big: failed to configure power-off GPIO\n");

	pr_notice("net2big: Flash writing is not yet supported.\n");
}
示例#6
0
static void __init rd88f5182_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(rd88f5182_mpp_modes);

	/*
	 * MPP[20] PCI Clock to MV88F5182
	 * MPP[21] PCI Clock to mini PCI CON11
	 * MPP[22] USB 0 over current indication
	 * MPP[23] USB 1 over current indication
	 * MPP[24] USB 1 over current enable
	 * MPP[25] USB 0 over current enable
	 */

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&rd88f5182_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&rd88f5182_sata_data);
	orion5x_uart0_init();
	orion5x_xor_init();

	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
				    ORION_MBUS_DEVBUS_BOOT_ATTR,
				    RD88F5182_NOR_BOOT_BASE,
				    RD88F5182_NOR_BOOT_SIZE);
	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(1),
				    ORION_MBUS_DEVBUS_ATTR(1),
				    RD88F5182_NOR_BASE,
				    RD88F5182_NOR_SIZE);
	platform_device_register(&rd88f5182_nor_flash);
	platform_device_register(&rd88f5182_gpio_leds);

	i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1);
}
示例#7
0
static void __init lschl_init(void)
{
	/*
	 * Setup basic Orion functions. Needs to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(lschl_mpp_modes);

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&lschl_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&lschl_sata_data);
	orion5x_uart0_init();
	orion5x_xor_init();

	orion5x_setup_dev_boot_win(LSCHL_NOR_BOOT_BASE,
				   LSCHL_NOR_BOOT_SIZE);
	platform_device_register(&lschl_nor_flash);

	platform_device_register(&lschl_leds);

	platform_device_register(&lschl_button_device);

	platform_device_register(&lschl_fan_device);

	i2c_register_board_info(0, &lschl_i2c_rtc, 1);

	/* usb power on */
	gpio_set_value(LSCHL_GPIO_USB_POWER, 1);

	/* register power-off method */
	pm_power_off = lschl_power_off;

	pr_info("%s: finished\n", __func__);
}
示例#8
0
static void __init lsmini_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(lsmini_mpp_modes);

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&lsmini_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&lsmini_sata_data);
	orion5x_uart0_init();
	orion5x_xor_init();

	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
				    ORION_MBUS_DEVBUS_BOOT_ATTR,
				    LSMINI_NOR_BOOT_BASE,
				    LSMINI_NOR_BOOT_SIZE);
	platform_device_register(&lsmini_nor_flash);

	platform_device_register(&lsmini_button_device);

	platform_device_register(&lsmini_leds);

	i2c_register_board_info(0, &lsmini_i2c_rtc, 1);

	/* enable USB power */
	gpio_set_value(LSMINI_GPIO_USB_POWER, 1);

	/* register power-off method */
	pm_power_off = lsmini_power_off;

	pr_info("%s: finished\n", __func__);
}
示例#9
0
static void __init mv2120_init(void)
{
	/* Setup basic Orion functions. Need to be called early. */
	orion5x_init();

	orion5x_mpp_conf(mv2120_mpp_modes);

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&mv2120_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&mv2120_sata_data);
	orion5x_uart0_init();
	orion5x_xor_init();

	orion5x_setup_dev_boot_win(MV2120_NOR_BOOT_BASE, MV2120_NOR_BOOT_SIZE);
	platform_device_register(&mv2120_nor_flash);

	platform_device_register(&mv2120_button_device);

	if (gpio_request(MV2120_GPIO_RTC_IRQ, "rtc") == 0) {
		if (gpio_direction_input(MV2120_GPIO_RTC_IRQ) == 0)
			mv2120_i2c_rtc.irq = gpio_to_irq(MV2120_GPIO_RTC_IRQ);
		else
			gpio_free(MV2120_GPIO_RTC_IRQ);
	}
	i2c_register_board_info(0, &mv2120_i2c_rtc, 1);
	platform_device_register(&mv2120_leds);

	/* register mv2120 specific power-off method */
	if (gpio_request(MV2120_GPIO_POWER_OFF, "POWEROFF") != 0 ||
	    gpio_direction_output(MV2120_GPIO_POWER_OFF, 1) != 0)
		pr_err("mv2120: failed to setup power-off GPIO\n");
	pm_power_off = mv2120_power_off;
}
static void __init rd88f5182_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(rd88f5182_mpp_modes);

	/*
	 * MPP[20] PCI Clock to MV88F5182
	 * MPP[21] PCI Clock to mini PCI CON11
	 * MPP[22] USB 0 over current indication
	 * MPP[23] USB 1 over current indication
	 * MPP[24] USB 1 over current enable
	 * MPP[25] USB 0 over current enable
	 */

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&rd88f5182_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&rd88f5182_sata_data);
	orion5x_uart0_init();
	orion5x_xor_init();

	orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE,
				   RD88F5182_NOR_BOOT_SIZE);

	orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE);
	platform_device_register(&rd88f5182_nor_flash);

	i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1);
}
示例#11
0
static void __init kurobox_pro_init(void)
{
	/*
	 * Setup basic Orion functions. Need to be called early.
	 */
	orion5x_init();

	orion5x_mpp_conf(kurobox_pro_mpp_modes);

	/*
	 * Configure peripherals.
	 */
	orion5x_ehci0_init();
	orion5x_ehci1_init();
	orion5x_eth_init(&kurobox_pro_eth_data);
	orion5x_i2c_init();
	orion5x_sata_init(&kurobox_pro_sata_data);
	orion5x_uart0_init();
	orion5x_uart1_init();
	orion5x_xor_init();

	orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
				   KUROBOX_PRO_NOR_BOOT_SIZE);
	platform_device_register(&kurobox_pro_nor_flash);

	if (machine_is_kurobox_pro()) {
		orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE,
				       KUROBOX_PRO_NAND_SIZE);
		platform_device_register(&kurobox_pro_nand_flash);
	}

	i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);

	/* register Kurobox Pro specific power-off method */
	pm_power_off = kurobox_pro_power_off;
}