forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: n2_crypto: Attach on Niagara-T3. n2rng: Attach on Niagara-T3. sparc: Detect and handle UltraSPARC-T3 cpu types. sparc: Don't do expensive hypervisor PCR write unless necessary. sparc: Add T3 sun4v cpu type and hypervisor group defines. sparc: Don't leave sparc_pmu_type NULL on sun4v.
- Loading branch information
Showing
13 changed files
with
95 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* n2-drv.c: Niagara-2 RNG driver. | ||
* | ||
* Copyright (C) 2008 David S. Miller <[email protected]> | ||
* Copyright (C) 2008, 2011 David S. Miller <[email protected]> | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
|
@@ -22,8 +22,8 @@ | |
|
||
#define DRV_MODULE_NAME "n2rng" | ||
#define PFX DRV_MODULE_NAME ": " | ||
#define DRV_MODULE_VERSION "0.1" | ||
#define DRV_MODULE_RELDATE "May 15, 2008" | ||
#define DRV_MODULE_VERSION "0.2" | ||
#define DRV_MODULE_RELDATE "July 27, 2011" | ||
|
||
static char version[] __devinitdata = | ||
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | ||
|
@@ -623,14 +623,14 @@ static const struct of_device_id n2rng_match[]; | |
static int __devinit n2rng_probe(struct platform_device *op) | ||
{ | ||
const struct of_device_id *match; | ||
int victoria_falls; | ||
int multi_capable; | ||
int err = -ENOMEM; | ||
struct n2rng *np; | ||
|
||
match = of_match_device(n2rng_match, &op->dev); | ||
if (!match) | ||
return -EINVAL; | ||
victoria_falls = (match->data != NULL); | ||
multi_capable = (match->data != NULL); | ||
|
||
n2rng_driver_version(); | ||
np = kzalloc(sizeof(*np), GFP_KERNEL); | ||
|
@@ -640,8 +640,8 @@ static int __devinit n2rng_probe(struct platform_device *op) | |
|
||
INIT_DELAYED_WORK(&np->work, n2rng_work); | ||
|
||
if (victoria_falls) | ||
np->flags |= N2RNG_FLAG_VF; | ||
if (multi_capable) | ||
np->flags |= N2RNG_FLAG_MULTI; | ||
|
||
err = -ENODEV; | ||
np->hvapi_major = 2; | ||
|
@@ -658,10 +658,10 @@ static int __devinit n2rng_probe(struct platform_device *op) | |
} | ||
} | ||
|
||
if (np->flags & N2RNG_FLAG_VF) { | ||
if (np->flags & N2RNG_FLAG_MULTI) { | ||
if (np->hvapi_major < 2) { | ||
dev_err(&op->dev, "VF RNG requires HVAPI major " | ||
"version 2 or later, got %lu\n", | ||
dev_err(&op->dev, "multi-unit-capable RNG requires " | ||
"HVAPI major version 2 or later, got %lu\n", | ||
np->hvapi_major); | ||
goto out_hvapi_unregister; | ||
} | ||
|
@@ -688,8 +688,8 @@ static int __devinit n2rng_probe(struct platform_device *op) | |
goto out_free_units; | ||
|
||
dev_info(&op->dev, "Found %s RNG, units: %d\n", | ||
((np->flags & N2RNG_FLAG_VF) ? | ||
"Victoria Falls" : "Niagara2"), | ||
((np->flags & N2RNG_FLAG_MULTI) ? | ||
"multi-unit-capable" : "single-unit"), | ||
np->num_units); | ||
|
||
np->hwrng.name = "n2rng"; | ||
|
@@ -751,6 +751,11 @@ static const struct of_device_id n2rng_match[] = { | |
.compatible = "SUNW,vf-rng", | ||
.data = (void *) 1, | ||
}, | ||
{ | ||
.name = "random-number-generator", | ||
.compatible = "SUNW,kt-rng", | ||
.data = (void *) 1, | ||
}, | ||
{}, | ||
}; | ||
MODULE_DEVICE_TABLE(of, n2rng_match); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* n2_core.c: Niagara2 Stream Processing Unit (SPU) crypto support. | ||
* | ||
* Copyright (C) 2010 David S. Miller <[email protected]> | ||
* Copyright (C) 2010, 2011 David S. Miller <[email protected]> | ||
*/ | ||
|
||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
|
@@ -31,8 +31,8 @@ | |
#include "n2_core.h" | ||
|
||
#define DRV_MODULE_NAME "n2_crypto" | ||
#define DRV_MODULE_VERSION "0.1" | ||
#define DRV_MODULE_RELDATE "April 29, 2010" | ||
#define DRV_MODULE_VERSION "0.2" | ||
#define DRV_MODULE_RELDATE "July 28, 2011" | ||
|
||
static char version[] __devinitdata = | ||
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | ||
|
@@ -1823,22 +1823,17 @@ static int spu_mdesc_scan(struct mdesc_handle *mdesc, struct platform_device *de | |
static int __devinit get_irq_props(struct mdesc_handle *mdesc, u64 node, | ||
struct spu_mdesc_info *ip) | ||
{ | ||
const u64 *intr, *ino; | ||
int intr_len, ino_len; | ||
const u64 *ino; | ||
int ino_len; | ||
int i; | ||
|
||
intr = mdesc_get_property(mdesc, node, "intr", &intr_len); | ||
if (!intr) | ||
return -ENODEV; | ||
|
||
ino = mdesc_get_property(mdesc, node, "ino", &ino_len); | ||
if (!ino) | ||
if (!ino) { | ||
printk("NO 'ino'\n"); | ||
return -ENODEV; | ||
} | ||
|
||
if (intr_len != ino_len) | ||
return -EINVAL; | ||
|
||
ip->num_intrs = intr_len / sizeof(u64); | ||
ip->num_intrs = ino_len / sizeof(u64); | ||
ip->ino_table = kzalloc((sizeof(struct ino_blob) * | ||
ip->num_intrs), | ||
GFP_KERNEL); | ||
|
@@ -1847,7 +1842,7 @@ static int __devinit get_irq_props(struct mdesc_handle *mdesc, u64 node, | |
|
||
for (i = 0; i < ip->num_intrs; i++) { | ||
struct ino_blob *b = &ip->ino_table[i]; | ||
b->intr = intr[i]; | ||
b->intr = i + 1; | ||
b->ino = ino[i]; | ||
} | ||
|
||
|
@@ -2204,6 +2199,10 @@ static struct of_device_id n2_crypto_match[] = { | |
.name = "n2cp", | ||
.compatible = "SUNW,vf-cwq", | ||
}, | ||
{ | ||
.name = "n2cp", | ||
.compatible = "SUNW,kt-cwq", | ||
}, | ||
{}, | ||
}; | ||
|
||
|
@@ -2228,6 +2227,10 @@ static struct of_device_id n2_mau_match[] = { | |
.name = "ncp", | ||
.compatible = "SUNW,vf-mau", | ||
}, | ||
{ | ||
.name = "ncp", | ||
.compatible = "SUNW,kt-mau", | ||
}, | ||
{}, | ||
}; | ||
|
||
|