Exemplo n.º 1
0
static void __init mpc82xx_ads_pic_init(void)
{
	struct device_node *np = of_find_compatible_node(NULL, "cpm-pic", "CPM2");
	struct resource r;
	cpm2_map_t *cpm_reg;

	if (np == NULL) {
		printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
		return;
	}
	if (of_address_to_resource(np, 0, &r)) {
		printk(KERN_ERR "PIC init: invalid resource\n");
		of_node_put(np);
		return;
	}
	cpm2_pic_init(np);
	of_node_put(np);

	/* Initialize the default interrupt mapping priorities,
	 * in case the boot rom changed something on us.
	 */
	cpm_reg = (cpm2_map_t *) ioremap(get_immrbase(), sizeof(cpm2_map_t));
	cpm_reg->im_intctl.ic_siprr = 0x05309770;
	iounmap(cpm_reg);
#ifdef CONFIG_PCI
	/* Initialize stuff for the 82xx CPLD IC and install demux  */
	m82xx_pci_init_irq();
#endif
}
Exemplo n.º 2
0
static void __init ep8248e_pic_init(void)
{
	struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
	if (!np) {
		printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
		return;
	}

	cpm2_pic_init(np);
	of_node_put(np);
}
static void __init pq2fads_pic_init(void)
{
	struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
	if (!np) {
		printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
		return;
	}

	cpm2_pic_init(np);
	of_node_put(np);

	/* Initialize stuff for the 82xx CPLD IC and install demux  */
	pq2ads_pci_init_irq();
}
Exemplo n.º 4
0
static void __init stx_gp3_pic_init(void)
{
	struct mpic *mpic;
	struct resource r;
	struct device_node *np;
#ifdef CONFIG_CPM2
	int irq;
#endif

	np = of_find_node_by_type(NULL, "open-pic");
	if (!np) {
		printk(KERN_ERR "Could not find open-pic node\n");
		return;
	}

	if (of_address_to_resource(np, 0, &r)) {
		printk(KERN_ERR "Could not map mpic register space\n");
		of_node_put(np);
		return;
	}

	mpic = mpic_alloc(np, r.start,
			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
			0, 256, " OpenPIC  ");
	BUG_ON(mpic == NULL);
	of_node_put(np);

	mpic_init(mpic);

#ifdef CONFIG_CPM2
	/* Setup CPM2 PIC */
	np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
	if (np == NULL) {
		printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
		return;
	}
	irq = irq_of_parse_and_map(np, 0);

	if (irq == NO_IRQ) {
		of_node_put(np);
		printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
		return;
	}

	cpm2_pic_init(np);
	of_node_put(np);
	set_irq_chained_handler(irq, cpm2_cascade);
#endif
}
Exemplo n.º 5
0
void __init mpc85xx_cpm2_pic_init(void)
{
	struct device_node *np;
	int irq;

	/* Setup CPM2 PIC */
	np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
	if (np == NULL) {
		printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
		return;
	}
	irq = irq_of_parse_and_map(np, 0);
	if (irq == NO_IRQ) {
		of_node_put(np);
		printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n");
		return;
	}

	cpm2_pic_init(np);
	of_node_put(np);
	irq_set_chained_handler(irq, cpm2_cascade);
}
Exemplo n.º 6
0
static void __init mpc85xx_ads_pic_init(void)
{
    struct mpic *mpic;
    struct resource r;
    struct device_node *np = NULL;
#ifdef CONFIG_CPM2
    int irq;
#endif

    np = of_find_node_by_type(np, "open-pic");

    if (np == NULL) {
        printk(KERN_ERR "Could not find open-pic node\n");
        return;
    }

    if(of_address_to_resource(np, 0, &r)) {
        printk(KERN_ERR "Could not map mpic register space\n");
        of_node_put(np);
        return;
    }

    mpic = mpic_alloc(np, r.start,
                      MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
                      4, 0, " OpenPIC  ");
    BUG_ON(mpic == NULL);
    of_node_put(np);

    mpic_assign_isu(mpic, 0, r.start + 0x10200);
    mpic_assign_isu(mpic, 1, r.start + 0x10280);
    mpic_assign_isu(mpic, 2, r.start + 0x10300);
    mpic_assign_isu(mpic, 3, r.start + 0x10380);
    mpic_assign_isu(mpic, 4, r.start + 0x10400);
    mpic_assign_isu(mpic, 5, r.start + 0x10480);
    mpic_assign_isu(mpic, 6, r.start + 0x10500);
    mpic_assign_isu(mpic, 7, r.start + 0x10580);

    /* Unused on this platform (leave room for 8548) */
    mpic_assign_isu(mpic, 8, r.start + 0x10600);
    mpic_assign_isu(mpic, 9, r.start + 0x10680);
    mpic_assign_isu(mpic, 10, r.start + 0x10700);
    mpic_assign_isu(mpic, 11, r.start + 0x10780);

    /* External Interrupts */
    mpic_assign_isu(mpic, 12, r.start + 0x10000);
    mpic_assign_isu(mpic, 13, r.start + 0x10080);
    mpic_assign_isu(mpic, 14, r.start + 0x10100);

    mpic_init(mpic);

#ifdef CONFIG_CPM2
    /* Setup CPM2 PIC */
    np = of_find_node_by_type(NULL, "cpm-pic");
    if (np == NULL) {
        printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
        return;
    }
    irq = irq_of_parse_and_map(np, 0);

    cpm2_pic_init(np);
    set_irq_chained_handler(irq, cpm2_cascade);
#endif
}