ksi8560.c (94bd217e2d683719ab21a4ac117d8a1b91cbedc9) ksi8560.c (543a07b17389d751dbe2683d34e79be7c10ab6ac)
1/*
2 * Board setup routines for the Emerson KSI8560
3 *
4 * Author: Alexandr Smirnov <asmirnov@ru.mvista.com>
5 *
6 * Based on mpc85xx_ads.c maintained by Kumar Gala
7 *
8 * 2008 (c) MontaVista, Software, Inc. This file is licensed under

--- 21 unchanged lines hidden (view full) ---

30#include <asm/prom.h>
31
32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h>
34
35#include <asm/cpm2.h>
36#include <sysdev/cpm2_pic.h>
37
1/*
2 * Board setup routines for the Emerson KSI8560
3 *
4 * Author: Alexandr Smirnov <asmirnov@ru.mvista.com>
5 *
6 * Based on mpc85xx_ads.c maintained by Kumar Gala
7 *
8 * 2008 (c) MontaVista, Software, Inc. This file is licensed under

--- 21 unchanged lines hidden (view full) ---

30#include <asm/prom.h>
31
32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h>
34
35#include <asm/cpm2.h>
36#include <sysdev/cpm2_pic.h>
37
38#include "mpc85xx.h"
38
39#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */
40#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
41#define KSI8560_CPLD_RCR1 0x30 /* Reset Command Register 1 */
42
43#define KSI8560_CPLD_RCR1_CPUHR 0x80 /* CPU Hard Reset */
44
45static void __iomem *cpld_base = NULL;
46
47static void machine_restart(char *cmd)
48{
49 if (cpld_base)
50 out_8(cpld_base + KSI8560_CPLD_RCR1, KSI8560_CPLD_RCR1_CPUHR);
51 else
52 printk(KERN_ERR "Can't find CPLD base, hang forever\n");
53
54 for (;;);
55}
56
39
40#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */
41#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
42#define KSI8560_CPLD_RCR1 0x30 /* Reset Command Register 1 */
43
44#define KSI8560_CPLD_RCR1_CPUHR 0x80 /* CPU Hard Reset */
45
46static void __iomem *cpld_base = NULL;
47
48static void machine_restart(char *cmd)
49{
50 if (cpld_base)
51 out_8(cpld_base + KSI8560_CPLD_RCR1, KSI8560_CPLD_RCR1_CPUHR);
52 else
53 printk(KERN_ERR "Can't find CPLD base, hang forever\n");
54
55 for (;;);
56}
57
57static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
58{
59 struct irq_chip *chip = irq_desc_get_chip(desc);
60 int cascade_irq;
61
62 while ((cascade_irq = cpm2_get_irq()) >= 0)
63 generic_handle_irq(cascade_irq);
64
65 chip->irq_eoi(&desc->irq_data);
66}
67
68static void __init ksi8560_pic_init(void)
69{
70 struct mpic *mpic;
71 struct resource r;
72 struct device_node *np;
58static void __init ksi8560_pic_init(void)
59{
60 struct mpic *mpic;
61 struct resource r;
62 struct device_node *np;
73#ifdef CONFIG_CPM2
74 int irq;
75#endif
76
77 np = of_find_node_by_type(NULL, "open-pic");
78
79 if (np == NULL) {
80 printk(KERN_ERR "Could not find open-pic node\n");
81 return;
82 }
83

--- 6 unchanged lines hidden (view full) ---

90 mpic = mpic_alloc(np, r.start,
91 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
92 0, 256, " OpenPIC ");
93 BUG_ON(mpic == NULL);
94 of_node_put(np);
95
96 mpic_init(mpic);
97
63
64 np = of_find_node_by_type(NULL, "open-pic");
65
66 if (np == NULL) {
67 printk(KERN_ERR "Could not find open-pic node\n");
68 return;
69 }
70

--- 6 unchanged lines hidden (view full) ---

77 mpic = mpic_alloc(np, r.start,
78 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
79 0, 256, " OpenPIC ");
80 BUG_ON(mpic == NULL);
81 of_node_put(np);
82
83 mpic_init(mpic);
84
98#ifdef CONFIG_CPM2
99 /* Setup CPM2 PIC */
100 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
101 if (np == NULL) {
102 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
103 return;
104 }
105 irq = irq_of_parse_and_map(np, 0);
106
107 cpm2_pic_init(np);
108 of_node_put(np);
109 irq_set_chained_handler(irq, cpm2_cascade);
110#endif
85 mpc85xx_cpm2_pic_init();
111}
112
113#ifdef CONFIG_CPM2
114/*
115 * Setup I/O ports
116 */
117struct cpm_pin {
118 int port, pin, flags;

--- 136 unchanged lines hidden ---
86}
87
88#ifdef CONFIG_CPM2
89/*
90 * Setup I/O ports
91 */
92struct cpm_pin {
93 int port, pin, flags;

--- 136 unchanged lines hidden ---