diff options
Diffstat (limited to 'arch/ppc/syslib')
-rw-r--r-- | arch/ppc/syslib/m8xx_setup.c | 63 | ||||
-rw-r--r-- | arch/ppc/syslib/m8xx_wdt.c | 3 |
2 files changed, 58 insertions, 8 deletions
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index 688616de3cde..cdb73a23a538 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c | |||
@@ -34,6 +34,13 @@ | |||
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/root_dev.h> | 35 | #include <linux/root_dev.h> |
36 | 36 | ||
37 | #if defined(CONFIG_MTD) && defined(CONFIG_MTD_PHYSMAP) | ||
38 | #include <linux/mtd/partitions.h> | ||
39 | #include <linux/mtd/physmap.h> | ||
40 | #include <linux/mtd/mtd.h> | ||
41 | #include <linux/mtd/map.h> | ||
42 | #endif | ||
43 | |||
37 | #include <asm/mmu.h> | 44 | #include <asm/mmu.h> |
38 | #include <asm/reg.h> | 45 | #include <asm/reg.h> |
39 | #include <asm/residual.h> | 46 | #include <asm/residual.h> |
@@ -49,6 +56,34 @@ | |||
49 | 56 | ||
50 | #include "ppc8xx_pic.h" | 57 | #include "ppc8xx_pic.h" |
51 | 58 | ||
59 | #ifdef CONFIG_MTD_PHYSMAP | ||
60 | #define MPC8xxADS_BANK_WIDTH 4 | ||
61 | #endif | ||
62 | |||
63 | #define MPC8xxADS_U_BOOT_SIZE 0x80000 | ||
64 | #define MPC8xxADS_FREE_AREA_OFFSET MPC8xxADS_U_BOOT_SIZE | ||
65 | |||
66 | #if defined(CONFIG_MTD_PARTITIONS) | ||
67 | /* | ||
68 | NOTE: bank width and interleave relative to the installed flash | ||
69 | should have been chosen within MTD_CFI_GEOMETRY options. | ||
70 | */ | ||
71 | static struct mtd_partition mpc8xxads_partitions[] = { | ||
72 | { | ||
73 | .name = "bootloader", | ||
74 | .size = MPC8xxADS_U_BOOT_SIZE, | ||
75 | .offset = 0, | ||
76 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
77 | }, { | ||
78 | .name = "User FS", | ||
79 | .offset = MPC8xxADS_FREE_AREA_OFFSET | ||
80 | } | ||
81 | }; | ||
82 | |||
83 | #define mpc8xxads_part_num (sizeof (mpc8xxads_partitions) / sizeof (mpc8xxads_partitions[0])) | ||
84 | |||
85 | #endif | ||
86 | |||
52 | static int m8xx_set_rtc_time(unsigned long time); | 87 | static int m8xx_set_rtc_time(unsigned long time); |
53 | static unsigned long m8xx_get_rtc_time(void); | 88 | static unsigned long m8xx_get_rtc_time(void); |
54 | void m8xx_calibrate_decr(void); | 89 | void m8xx_calibrate_decr(void); |
@@ -71,6 +106,10 @@ board_init(void) | |||
71 | void __init | 106 | void __init |
72 | m8xx_setup_arch(void) | 107 | m8xx_setup_arch(void) |
73 | { | 108 | { |
109 | #if defined(CONFIG_MTD) && defined(CONFIG_MTD_PHYSMAP) | ||
110 | bd_t *binfo = (bd_t *)__res; | ||
111 | #endif | ||
112 | |||
74 | /* Reset the Communication Processor Module. | 113 | /* Reset the Communication Processor Module. |
75 | */ | 114 | */ |
76 | m8xx_cpm_reset(); | 115 | m8xx_cpm_reset(); |
@@ -106,6 +145,17 @@ m8xx_setup_arch(void) | |||
106 | } | 145 | } |
107 | #endif | 146 | #endif |
108 | #endif | 147 | #endif |
148 | |||
149 | #if defined (CONFIG_MPC86XADS) || defined (CONFIG_MPC885ADS) | ||
150 | #if defined(CONFIG_MTD_PHYSMAP) | ||
151 | physmap_configure(binfo->bi_flashstart, binfo->bi_flashsize, | ||
152 | MPC8xxADS_BANK_WIDTH, NULL); | ||
153 | #ifdef CONFIG_MTD_PARTITIONS | ||
154 | physmap_set_partitions(mpc8xxads_partitions, mpc8xxads_part_num); | ||
155 | #endif /* CONFIG_MTD_PARTITIONS */ | ||
156 | #endif /* CONFIG_MTD_PHYSMAP */ | ||
157 | #endif | ||
158 | |||
109 | board_init(); | 159 | board_init(); |
110 | } | 160 | } |
111 | 161 | ||
@@ -140,9 +190,11 @@ void __init __attribute__ ((weak)) | |||
140 | init_internal_rtc(void) | 190 | init_internal_rtc(void) |
141 | { | 191 | { |
142 | /* Disable the RTC one second and alarm interrupts. */ | 192 | /* Disable the RTC one second and alarm interrupts. */ |
143 | out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) & ~(RTCSC_SIE | RTCSC_ALE)); | 193 | clrbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE)); |
194 | |||
144 | /* Enable the RTC */ | 195 | /* Enable the RTC */ |
145 | out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) | (RTCSC_RTF | RTCSC_RTE)); | 196 | setbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE)); |
197 | |||
146 | } | 198 | } |
147 | 199 | ||
148 | /* The decrementer counts at the system (internal) clock frequency divided by | 200 | /* The decrementer counts at the system (internal) clock frequency divided by |
@@ -159,8 +211,7 @@ void __init m8xx_calibrate_decr(void) | |||
159 | out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY); | 211 | out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY); |
160 | 212 | ||
161 | /* Force all 8xx processors to use divide by 16 processor clock. */ | 213 | /* Force all 8xx processors to use divide by 16 processor clock. */ |
162 | out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, | 214 | setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 0x02000000); |
163 | in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr)|0x02000000); | ||
164 | /* Processor frequency is MHz. | 215 | /* Processor frequency is MHz. |
165 | * The value 'fp' is the number of decrementer ticks per second. | 216 | * The value 'fp' is the number of decrementer ticks per second. |
166 | */ | 217 | */ |
@@ -239,8 +290,8 @@ m8xx_restart(char *cmd) | |||
239 | __volatile__ unsigned char dummy; | 290 | __volatile__ unsigned char dummy; |
240 | 291 | ||
241 | local_irq_disable(); | 292 | local_irq_disable(); |
242 | out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr) | 0x00000080); | ||
243 | 293 | ||
294 | setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, 0x00000080); | ||
244 | /* Clear the ME bit in MSR to cause checkstop on machine check | 295 | /* Clear the ME bit in MSR to cause checkstop on machine check |
245 | */ | 296 | */ |
246 | mtmsr(mfmsr() & ~0x1000); | 297 | mtmsr(mfmsr() & ~0x1000); |
@@ -310,8 +361,8 @@ m8xx_init_IRQ(void) | |||
310 | i8259_init(0); | 361 | i8259_init(0); |
311 | 362 | ||
312 | /* The i8259 cascade interrupt must be level sensitive. */ | 363 | /* The i8259 cascade interrupt must be level sensitive. */ |
313 | out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel & ~(0x80000000 >> ISA_BRIDGE_INT))); | ||
314 | 364 | ||
365 | clrbits32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, (0x80000000 >> ISA_BRIDGE_INT)); | ||
315 | if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction)) | 366 | if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction)) |
316 | enable_irq(ISA_BRIDGE_INT); | 367 | enable_irq(ISA_BRIDGE_INT); |
317 | #endif /* CONFIG_PCI */ | 368 | #endif /* CONFIG_PCI */ |
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c index df6c9557b86a..ac11d7bab443 100644 --- a/arch/ppc/syslib/m8xx_wdt.c +++ b/arch/ppc/syslib/m8xx_wdt.c | |||
@@ -41,8 +41,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) | |||
41 | 41 | ||
42 | m8xx_wdt_reset(); | 42 | m8xx_wdt_reset(); |
43 | 43 | ||
44 | out_be16(&imap->im_sit.sit_piscr, in_be16(&imap->im_sit.sit_piscr) | PISCR_PS); /* clear irq */ | 44 | setbits16(&imap->im_sit.sit_piscr, PISCR_PS); |
45 | |||
46 | return IRQ_HANDLED; | 45 | return IRQ_HANDLED; |
47 | } | 46 | } |
48 | 47 | ||