]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blame - arch/powerpc/platforms/pseries/firmware.c
powerpc: Enable the Watchdog vector for 405
[mirror_ubuntu-kernels.git] / arch / powerpc / platforms / pseries / firmware.c
CommitLineData
1965746b
ME
1/*
2 * pSeries firmware setup code.
3 *
4 * Portions from arch/powerpc/platforms/pseries/setup.c:
5 * Copyright (C) 1995 Linus Torvalds
6 * Adapted from 'alpha' version by Gary Thomas
7 * Modified by Cort Dougan (cort@cs.nmt.edu)
8 * Modified by PPC64 Team, IBM Corp
9 *
10 * Portions from arch/powerpc/kernel/firmware.c
11 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
12 * Modifications for ppc64:
13 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
14 * Copyright (C) 2005 Stephen Rothwell, IBM Corporation
15 *
16 * Copyright 2006 IBM Corporation.
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 */
23
1965746b
ME
24
25#include <asm/firmware.h>
26#include <asm/prom.h>
aa39be09 27#include <asm/udbg.h>
1965746b 28
3ff1999b 29#include "pseries.h"
1965746b
ME
30
31typedef struct {
32 unsigned long val;
33 char * name;
34} firmware_feature_t;
35
36static __initdata firmware_feature_t
37firmware_features_table[FIRMWARE_MAX_FEATURES] = {
38 {FW_FEATURE_PFT, "hcall-pft"},
39 {FW_FEATURE_TCE, "hcall-tce"},
40 {FW_FEATURE_SPRG0, "hcall-sprg0"},
41 {FW_FEATURE_DABR, "hcall-dabr"},
42 {FW_FEATURE_COPY, "hcall-copy"},
43 {FW_FEATURE_ASR, "hcall-asr"},
44 {FW_FEATURE_DEBUG, "hcall-debug"},
45 {FW_FEATURE_PERF, "hcall-perf"},
46 {FW_FEATURE_DUMP, "hcall-dump"},
47 {FW_FEATURE_INTERRUPT, "hcall-interrupt"},
48 {FW_FEATURE_MIGRATE, "hcall-migrate"},
49 {FW_FEATURE_PERFMON, "hcall-perfmon"},
50 {FW_FEATURE_CRQ, "hcall-crq"},
51 {FW_FEATURE_VIO, "hcall-vio"},
52 {FW_FEATURE_RDMA, "hcall-rdma"},
53 {FW_FEATURE_LLAN, "hcall-lLAN"},
b6dcde5c 54 {FW_FEATURE_BULK_REMOVE, "hcall-bulk"},
1965746b
ME
55 {FW_FEATURE_XDABR, "hcall-xdabr"},
56 {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
57 {FW_FEATURE_SPLPAR, "hcall-splpar"},
36f567b4 58 {FW_FEATURE_VPHN, "hcall-vphn"},
d8f48ecc 59 {FW_FEATURE_SET_MODE, "hcall-set-mode"},
1965746b
ME
60};
61
62/* Build up the firmware features bitmask using the contents of
63 * device-tree/ibm,hypertas-functions. Ultimately this functionality may
64 * be moved into prom.c prom_init().
65 */
ca8ffc97 66void __init fw_feature_init(const char *hypertas, unsigned long len)
1965746b 67{
ca8ffc97
MN
68 const char *s;
69 int i;
1965746b 70
f7ebf352 71 pr_debug(" -> fw_feature_init()\n");
1965746b 72
1965746b
ME
73 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
74 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
75 /* check value against table of strings */
76 if (!firmware_features_table[i].name ||
77 strcmp(firmware_features_table[i].name, s))
78 continue;
79
80 /* we have a match */
d0160bf0 81 powerpc_firmware_features |=
1965746b
ME
82 firmware_features_table[i].val;
83 break;
84 }
85 }
86
f7ebf352 87 pr_debug(" <- fw_feature_init()\n");
1965746b 88}