Path: blob/master/arch/powerpc/platforms/pseries/firmware.c
10818 views
/*1* pSeries firmware setup code.2*3* Portions from arch/powerpc/platforms/pseries/setup.c:4* Copyright (C) 1995 Linus Torvalds5* Adapted from 'alpha' version by Gary Thomas6* Modified by Cort Dougan ([email protected])7* Modified by PPC64 Team, IBM Corp8*9* Portions from arch/powerpc/kernel/firmware.c10* Copyright (C) 2001 Ben. Herrenschmidt ([email protected])11* Modifications for ppc64:12* Copyright (C) 2003 Dave Engebretsen <[email protected]>13* Copyright (C) 2005 Stephen Rothwell, IBM Corporation14*15* Copyright 2006 IBM Corporation.16*17* This program is free software; you can redistribute it and/or18* modify it under the terms of the GNU General Public License19* as published by the Free Software Foundation; either version20* 2 of the License, or (at your option) any later version.21*/222324#include <asm/firmware.h>25#include <asm/prom.h>26#include <asm/udbg.h>2728#include "pseries.h"2930typedef struct {31unsigned long val;32char * name;33} firmware_feature_t;3435static __initdata firmware_feature_t36firmware_features_table[FIRMWARE_MAX_FEATURES] = {37{FW_FEATURE_PFT, "hcall-pft"},38{FW_FEATURE_TCE, "hcall-tce"},39{FW_FEATURE_SPRG0, "hcall-sprg0"},40{FW_FEATURE_DABR, "hcall-dabr"},41{FW_FEATURE_COPY, "hcall-copy"},42{FW_FEATURE_ASR, "hcall-asr"},43{FW_FEATURE_DEBUG, "hcall-debug"},44{FW_FEATURE_PERF, "hcall-perf"},45{FW_FEATURE_DUMP, "hcall-dump"},46{FW_FEATURE_INTERRUPT, "hcall-interrupt"},47{FW_FEATURE_MIGRATE, "hcall-migrate"},48{FW_FEATURE_PERFMON, "hcall-perfmon"},49{FW_FEATURE_CRQ, "hcall-crq"},50{FW_FEATURE_VIO, "hcall-vio"},51{FW_FEATURE_RDMA, "hcall-rdma"},52{FW_FEATURE_LLAN, "hcall-lLAN"},53{FW_FEATURE_BULK_REMOVE, "hcall-bulk"},54{FW_FEATURE_XDABR, "hcall-xdabr"},55{FW_FEATURE_MULTITCE, "hcall-multi-tce"},56{FW_FEATURE_SPLPAR, "hcall-splpar"},57{FW_FEATURE_VPHN, "hcall-vphn"},58};5960/* Build up the firmware features bitmask using the contents of61* device-tree/ibm,hypertas-functions. Ultimately this functionality may62* be moved into prom.c prom_init().63*/64void __init fw_feature_init(const char *hypertas, unsigned long len)65{66const char *s;67int i;6869pr_debug(" -> fw_feature_init()\n");7071for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {72for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {73/* check value against table of strings */74if (!firmware_features_table[i].name ||75strcmp(firmware_features_table[i].name, s))76continue;7778/* we have a match */79powerpc_firmware_features |=80firmware_features_table[i].val;81break;82}83}8485pr_debug(" <- fw_feature_init()\n");86}878889