aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/plat-spear/Kconfig12
-rw-r--r--arch/arm/plat-spear/Makefile5
3 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 047a20780fc1..2aa75b58bf12 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -192,6 +192,8 @@ machine-$(CONFIG_ARCH_VEXPRESS) := vexpress
192machine-$(CONFIG_ARCH_VT8500) := vt8500 192machine-$(CONFIG_ARCH_VT8500) := vt8500
193machine-$(CONFIG_ARCH_W90X900) := w90x900 193machine-$(CONFIG_ARCH_W90X900) := w90x900
194machine-$(CONFIG_FOOTBRIDGE) := footbridge 194machine-$(CONFIG_FOOTBRIDGE) := footbridge
195machine-$(CONFIG_MACH_SPEAR1310) := spear13xx
196machine-$(CONFIG_MACH_SPEAR1340) := spear13xx
195machine-$(CONFIG_MACH_SPEAR300) := spear3xx 197machine-$(CONFIG_MACH_SPEAR300) := spear3xx
196machine-$(CONFIG_MACH_SPEAR310) := spear3xx 198machine-$(CONFIG_MACH_SPEAR310) := spear3xx
197machine-$(CONFIG_MACH_SPEAR320) := spear3xx 199machine-$(CONFIG_MACH_SPEAR320) := spear3xx
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
index 387655b5ce05..4404f82d5979 100644
--- a/arch/arm/plat-spear/Kconfig
+++ b/arch/arm/plat-spear/Kconfig
@@ -8,6 +8,17 @@ choice
8 prompt "ST SPEAr Family" 8 prompt "ST SPEAr Family"
9 default ARCH_SPEAR3XX 9 default ARCH_SPEAR3XX
10 10
11config ARCH_SPEAR13XX
12 bool "ST SPEAr13xx with Device Tree"
13 select ARM_GIC
14 select CPU_V7
15 select USE_OF
16 select HAVE_SMP
17 select MIGHT_HAVE_CACHE_L2X0
18 select PINCTRL
19 help
20 Supports for ARM's SPEAR13XX family
21
11config ARCH_SPEAR3XX 22config ARCH_SPEAR3XX
12 bool "ST SPEAr3xx with Device Tree" 23 bool "ST SPEAr3xx with Device Tree"
13 select ARM_VIC 24 select ARM_VIC
@@ -27,6 +38,7 @@ config ARCH_SPEAR6XX
27endchoice 38endchoice
28 39
29# Adding SPEAr machine specific configuration files 40# Adding SPEAr machine specific configuration files
41source "arch/arm/mach-spear13xx/Kconfig"
30source "arch/arm/mach-spear3xx/Kconfig" 42source "arch/arm/mach-spear3xx/Kconfig"
31source "arch/arm/mach-spear6xx/Kconfig" 43source "arch/arm/mach-spear6xx/Kconfig"
32 44
diff --git a/arch/arm/plat-spear/Makefile b/arch/arm/plat-spear/Makefile
index 38f1235f4632..2607bd05c525 100644
--- a/arch/arm/plat-spear/Makefile
+++ b/arch/arm/plat-spear/Makefile
@@ -3,6 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := restart.o time.o pl080.o 6obj-y := restart.o time.o
7 7
8obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o 8obj-$(CONFIG_ARCH_SPEAR3XX) += pl080.o shirq.o
9obj-$(CONFIG_ARCH_SPEAR6XX) += pl080.o

                                               
                                                 



                                                        
                                        



                                         
                                         



                                    

                              




                                                               
/* 
 * Cryptographic API.
 *
 * Deflate algorithm (RFC 1951), implemented here primarily for use
 * by IPCOMP (RFC 3173 & RFC 2394).
 *
 * Copyright (c) 2003 James Morris <jmorris@intercode.com.au>
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option) 
 * any later version.
 *
 * FIXME: deflate transforms will require up to a total of about 436k of kernel
 * memory on i386 (390k for compression, the rest for decompression), as the
 * current zlib kernel code uses a worst case pre-allocation system by default.
 * This needs to be fixed so that the amount of memory required is properly
 * related to the  winbits and memlevel parameters.
 *
 * The default winbits of 11 should suit most packets, and it may be something
 * to configure on a per-tfm basis in the future.
 *
 * Currently, compression history is not maintained between tfm calls, as
 * it is not needed for IPCOMP and keeps the code simpler.  It can be
 * implemented if someone wants it.
 */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/zlib.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/slab.h>

#define DEFLATE_DEF_LEVEL		Z_DEFAULT_COMPRESSION
#define DEFLATE_DEF_WINBITS		11
#define DEFLATE_DEF_MEMLEVEL		MAX_MEM_LEVEL

struct deflate_ctx {
	struct z_stream_s comp_stream;
	struct z_stream_s decomp_stream;
};

static int deflate_comp_init(struct deflate_ctx *ctx)
{
	int ret = 0;
	struct z_stream_s *stream = &ctx->comp_stream;

	stream->workspace = vmalloc(zlib_deflate_workspacesize());
	if (!stream->workspace ) {
		ret = -ENOMEM;
		goto out;
	}
	memset(stream->workspace, 0, zlib_deflate_workspacesize());
	ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED,
	                        -DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL,
	                        Z_DEFAULT_STRATEGY);
	if (ret != Z_OK) {
		ret = -EINVAL;
		goto out_free;
	}
out:	
	return ret;
out_free:
	vfree(stream->workspace);
	goto out;
}

static int deflate_decomp_init(struct deflate_ctx *ctx)
{
	int ret = 0;
	struct z_stream_s *stream = &ctx->decomp_stream;

	stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
	if (!stream->workspace ) {
		ret = -ENOMEM;
		goto out;
	}
	ret = zlib_inflateInit2(stream, -DEFLATE_DEF_WINBITS);
	if (ret != Z_OK) {
		ret = -EINVAL;
		goto out_free;
	}
out:
	return ret;
out_free:
	kfree(stream->workspace);
	goto out;
}

static void deflate_comp_exit(struct deflate_ctx *ctx)
{
	zlib_deflateEnd(&ctx->comp_stream);
	vfree(ctx->comp_stream.workspace);
}

static void deflate_decomp_exit(struct deflate_ctx *ctx)
{
	zlib_inflateEnd(&ctx->decomp_stream);
	kfree(ctx->decomp_stream.workspace);
}

static int deflate_init(struct crypto_tfm *tfm)
{