Пример #1
0
/*
 * Setup the architecture
 */
static void __init mpc82xx_ads_setup_arch(void)
{
#ifdef CONFIG_PCI
	struct device_node *np;
#endif

	if (ppc_md.progress)
		ppc_md.progress("mpc82xx_ads_setup_arch()", 0);
	cpm2_reset();

	/* Map I/O region to a 256MB BAT */

	m82xx_board_setup();

#ifdef CONFIG_PCI
	ppc_md.pci_exclude_device = m82xx_pci_exclude_device;
	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
		add_bridge(np);

	of_node_put(np);
#endif

#ifdef  CONFIG_ROOT_NFS
	ROOT_DEV = Root_NFS;
#else
	ROOT_DEV = Root_HDA1;
#endif

	if (ppc_md.progress)
		ppc_md.progress("mpc82xx_ads_setup_arch(), finish", 0);
}
Пример #2
0
/* ************************************************************************
 *
 * Setup the architecture
 *
 */
static void __init mpc834x_itx_setup_arch(void)
{
    struct device_node *np;

    if (ppc_md.progress)
        ppc_md.progress("mpc834x_itx_setup_arch()", 0);

    np = of_find_node_by_type(NULL, "cpu");
    if (np != 0) {
        unsigned int *fp =
            (int *)get_property(np, "clock-frequency", NULL);
        if (fp != 0)
            loops_per_jiffy = *fp / HZ;
        else
            loops_per_jiffy = 50000000 / HZ;
        of_node_put(np);
    }
#ifdef CONFIG_PCI
    for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
        add_bridge(np);

    ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif

#ifdef  CONFIG_ROOT_NFS
    ROOT_DEV = Root_NFS;
#else
    ROOT_DEV = Root_HDA1;
#endif
}
Пример #3
0
static void __init mpc85xx_ads_setup_arch(void)
{
    struct device_node *cpu;
#ifdef CONFIG_PCI
    struct device_node *np;
#endif

    if (ppc_md.progress)
        ppc_md.progress("mpc85xx_ads_setup_arch()", 0);

    cpu = of_find_node_by_type(NULL, "cpu");
    if (cpu != 0) {
        const unsigned int *fp;

        fp = get_property(cpu, "clock-frequency", NULL);
        if (fp != 0)
            loops_per_jiffy = *fp / HZ;
        else
            loops_per_jiffy = 50000000 / HZ;
        of_node_put(cpu);
    }

#ifdef CONFIG_CPM2
    cpm2_reset();
#endif

#ifdef CONFIG_PCI
    for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
        add_bridge(np);
    ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
Пример #4
0
static void __init linkstation_setup_arch(void)
{
	struct device_node *np;
#ifdef CONFIG_MTD_PHYSMAP
	physmap_set_partitions(linkstation_physmap_partitions,
			       ARRAY_SIZE(linkstation_physmap_partitions));
#endif

#ifdef CONFIG_BLK_DEV_INITRD
	if (initrd_start)
		ROOT_DEV = Root_RAM0;
	else
#endif
#ifdef	CONFIG_ROOT_NFS
		ROOT_DEV = Root_NFS;
#else
		ROOT_DEV = Root_HDA1;
#endif

	/* Lookup PCI host bridges */
	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
		add_bridge(np);

	printk(KERN_INFO "BUFFALO Network Attached Storage Series\n");
	printk(KERN_INFO "(C) 2002-2005 BUFFALO INC.\n");
}
Пример #5
0
/* ************************************************************************
 *
 * Setup the architecture
 *
 */
static void __init mpc834x_itx_setup_arch(void)
{
#ifdef CONFIG_PCI
	struct device_node *np;
#endif

	if (ppc_md.progress)
		ppc_md.progress("mpc834x_itx_setup_arch()", 0);

#ifdef CONFIG_PCI
	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
		add_bridge(np);

	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
}
Пример #6
0
/* ************************************************************************
 *
 * Setup the architecture
 *
 */
static void __init mpc836x_mds_setup_arch(void)
{
    struct device_node *np;

    if (ppc_md.progress)
        ppc_md.progress("mpc836x_mds_setup_arch()", 0);

    /* Map BCSR area */
    np = of_find_node_by_name(NULL, "bcsr");
    if (np != 0) {
        struct resource res;

        of_address_to_resource(np, 0, &res);
        bcsr_regs = ioremap(res.start, res.end - res.start +1);
        of_node_put(np);
    }

#ifdef CONFIG_PCI
    for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
        add_bridge(np);
    ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif

#ifdef CONFIG_QUICC_ENGINE
    qe_reset();

    if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
        par_io_init(np);
        of_node_put(np);

        for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
            par_io_of_config(np);
    }

    if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
            != NULL) {
        /* Reset the Ethernet PHY */
        bcsr_regs[9] &= ~0x20;
        udelay(1000);
        bcsr_regs[9] |= 0x20;
        iounmap(bcsr_regs);
        of_node_put(np);
    }

#endif				/* CONFIG_QUICC_ENGINE */
}
Пример #7
0
void search(int v, bool root) {
  int w, child = 0;

  low[v] = df_num[v] = count++;

  for (int i = 0; i < alist[v].deg; ++i) {
    w = alist[v].adj[i];

    if (df_num[w] == -1) {
      father[w] = v;
      ++child;
      search(w, false);
      if (low[w] > df_num[v]) add_bridge(v, w);
      if (low[w] >= df_num[v] && !root) art[v] = true;
      low[v] = min(low[v], low[w]);
    }
    else if (w != father[v]) {
      low[v] = min(low[v], df_num[w]);
    }
  }

  if (root && child > 1) art[v] = true;
}
Пример #8
0
int main(int argc, char **argv)
{
	int ret = 1;
	struct sockaddr_in6 addr;
	int sk;

	test_init(argc, argv);

	if (add_bridge() < 0)
		return 1;

	sk = socket(AF_INET6, SOCK_DGRAM, 0);
	if (sk < 0) {
		fail("can't get socket");
		goto out;
	}

	memset(&addr, 0, sizeof(addr));
	addr.sin6_port = htons(0);
	addr.sin6_family = AF_INET6;
	if (inet_pton(AF_INET6, "fe80:4567::1", &addr.sin6_addr) < 0) {
		fail("can't convert inet6 addr");
		goto out;
	}
	addr.sin6_scope_id = if_nametoindex(BRIDGE_NAME);

	if (bind(sk, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
		fail("can't bind");
		goto out;
	}

	/* Here, we grep for inet because some of the IPV6 DAD stuff can be
	 * racy, and all we really care about is that the bridge got restored
	 * with the right MAC, since we know DAD will succeed eventually.
	 *
	 * (I got this race with zdtm.py, but not with zdtm.sh; not quite sure
	 * what the environment difference is/was.)
	 */
	if (system("ip addr list dev " BRIDGE_NAME " | grep inet | sort > bridge.dump.test")) {
		pr_perror("can't save net config");
		fail("Can't save net config");
		goto out;
	}

	test_daemon();
	test_waitsig();

	if (system("ip addr list dev " BRIDGE_NAME " | grep inet | sort > bridge.rst.test")) {
		fail("Can't get net config");
		goto out;
	}

	if (system("diff bridge.rst.test bridge.dump.test")) {
		fail("Net config differs after restore");
		goto out;
	}

	pass();

	ret = 0;

out:
	del_bridge();
	return ret;
}