db0ef555a8ae2310e6bb0b354dddb5d7aca9ca4c
[openwrt/staging/dedeckeh.git] / target / linux / brcm63xx / files / arch / mips / bcm63xx / prom.c
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9 #include <linux/init.h>
10 #include <linux/bootmem.h>
11 #include <asm/bootinfo.h>
12 #include <bcm63xx_board.h>
13 #include <bcm63xx_cpu.h>
14 #include <bcm63xx_io.h>
15 #include <bcm63xx_regs.h>
16
17 void __init prom_init(void)
18 {
19 u32 reg, mask;
20
21 bcm63xx_cpu_init();
22
23 /* stop any running watchdog */
24 bcm_wdt_writel(WDT_STOP_1, WDT_CTL_REG);
25 bcm_wdt_writel(WDT_STOP_2, WDT_CTL_REG);
26
27 /* disable all hardware blocks clock for now */
28 if (BCMCPU_IS_6338())
29 mask = CKCTL_6338_ALL_SAFE_EN;
30 else if (BCMCPU_IS_6345())
31 mask = CKCTL_6345_UART_EN;
32 else if (BCMCPU_IS_6348())
33 mask = CKCTL_6348_ALL_SAFE_EN;
34 else
35 /* BCMCPU_IS_6358() */
36 mask = CKCTL_6358_ALL_SAFE_EN;
37
38 reg = bcm_perf_readl(PERF_CKCTL_REG);
39 reg &= ~mask;
40 bcm_perf_writel(reg, PERF_CKCTL_REG);
41
42 /* assign command line from kernel config */
43 strcpy(arcs_cmdline, CONFIG_CMDLINE);
44
45 /* do low level board init */
46 board_prom_init();
47 }
48
49 void __init prom_free_prom_memory(void)
50 {
51 }