You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM updates from Russell King:
"Included in this series are:
1. BE8 (modern big endian) changes for ARM from Ben Dooks
2. big.Little support from Nicolas Pitre and Dave Martin
3. support for LPAE systems with all system memory above 4GB
4. Perf updates from Will Deacon
5. Additional prefetching and other performance improvements from Will.
6. Neon-optimised AES implementation fro Ard.
7. A number of smaller fixes scattered around the place.
There is a rather horrid merge conflict in tools/perf - I was never
notified of the conflict because it originally occurred between Will's
tree and other stuff. Consequently I have a resolution which Will
forwarded me, which I'll forward on immediately after sending this
mail.
The other notable thing is I'm expecting some build breakage in the
crypto stuff on ARM only with Ard's AES patches. These were merged
into a stable git branch which others had already pulled, so there's
little I can do about this. The problem is caused because these
patches have a dependency on some code in the crypto git tree - I
tried requesting a branch I can pull to resolve these, and all I got
each time from the crypto people was "we'll revert our patches then"
which would only make things worse since I still don't have the
dependent patches. I've no idea what's going on there or how to
resolve that, and since I can't split these patches from the rest of
this pull request, I'm rather stuck with pushing this as-is or
reverting Ard's patches.
Since it should "come out in the wash" I've left them in - the only
build problems they seem to cause at the moment are with randconfigs,
and since it's a new feature anyway. However, if by -rc1 the
dependencies aren't in, I think it'd be best to revert Ard's patches"
I resolved the perf conflict roughly as per the patch sent by Russell,
but there may be some differences. Any errors are likely mine. Let's
see how the crypto issues work out..
* 'for-linus' of git://git.linaro.org/people/rmk/linux-arm: (110 commits)
ARM: 7868/1: arm/arm64: remove atomic_clear_mask() in "include/asm/atomic.h"
ARM: 7867/1: include: asm: use 'int' instead of 'unsigned long' for 'oldval' in atomic_cmpxchg().
ARM: 7866/1: include: asm: use 'long long' instead of 'u64' within atomic.h
ARM: 7871/1: amba: Extend number of IRQS
ARM: 7887/1: Don't smp_cross_call() on UP devices in arch_irq_work_raise()
ARM: 7872/1: Support arch_irq_work_raise() via self IPIs
ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode
ARM: 7878/1: nommu: Implement dummy early_paging_init()
ARM: 7876/1: clear Thumb-2 IT state on exception handling
ARM: 7874/2: bL_switcher: Remove cpu_hotplug_driver_{lock,unlock}()
ARM: footbridge: fix build warnings for netwinder
ARM: 7873/1: vfp: clear vfp_current_hw_state for dying cpu
ARM: fix misplaced arch_virt_to_idmap()
ARM: 7848/1: mcpm: Implement cpu_kill() to synchronise on powerdown
ARM: 7847/1: mcpm: Factor out logical-to-physical CPU translation
ARM: 7869/1: remove unused XSCALE_PMU Kconfig param
ARM: 7864/1: Handle 64-bit memory in case of 32-bit phys_addr_t
ARM: 7863/1: Let arm_add_memory() always use 64-bit arguments
ARM: 7862/1: pcpu: replace __get_cpu_var_uses
ARM: 7861/1: cacheflush: consolidate single-CPU ARMv7 cache disabling code
...
This commit is contained in:
+30
-6
@@ -5,6 +5,7 @@ config ARM
|
|||||||
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
|
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
|
||||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||||
select ARCH_HAVE_CUSTOM_GPIO_H
|
select ARCH_HAVE_CUSTOM_GPIO_H
|
||||||
|
select ARCH_USE_CMPXCHG_LOCKREF
|
||||||
select ARCH_WANT_IPC_PARSE_VERSION
|
select ARCH_WANT_IPC_PARSE_VERSION
|
||||||
select BUILDTIME_EXTABLE_SORT if MMU
|
select BUILDTIME_EXTABLE_SORT if MMU
|
||||||
select CLONE_BACKWARDS
|
select CLONE_BACKWARDS
|
||||||
@@ -51,6 +52,8 @@ config ARM
|
|||||||
select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
|
select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
|
||||||
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
|
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
|
||||||
select HAVE_PERF_EVENTS
|
select HAVE_PERF_EVENTS
|
||||||
|
select HAVE_PERF_REGS
|
||||||
|
select HAVE_PERF_USER_STACK_DUMP
|
||||||
select HAVE_REGS_AND_STACK_ACCESS_API
|
select HAVE_REGS_AND_STACK_ACCESS_API
|
||||||
select HAVE_SYSCALL_TRACEPOINTS
|
select HAVE_SYSCALL_TRACEPOINTS
|
||||||
select HAVE_UID16
|
select HAVE_UID16
|
||||||
@@ -481,6 +484,7 @@ config ARCH_IXP4XX
|
|||||||
bool "IXP4xx-based"
|
bool "IXP4xx-based"
|
||||||
depends on MMU
|
depends on MMU
|
||||||
select ARCH_HAS_DMA_SET_COHERENT_MASK
|
select ARCH_HAS_DMA_SET_COHERENT_MASK
|
||||||
|
select ARCH_SUPPORTS_BIG_ENDIAN
|
||||||
select ARCH_REQUIRE_GPIOLIB
|
select ARCH_REQUIRE_GPIOLIB
|
||||||
select CLKSRC_MMIO
|
select CLKSRC_MMIO
|
||||||
select CPU_XSCALE
|
select CPU_XSCALE
|
||||||
@@ -688,7 +692,6 @@ config ARCH_SA1100
|
|||||||
select GENERIC_CLOCKEVENTS
|
select GENERIC_CLOCKEVENTS
|
||||||
select HAVE_IDE
|
select HAVE_IDE
|
||||||
select ISA
|
select ISA
|
||||||
select NEED_MACH_GPIO_H
|
|
||||||
select NEED_MACH_MEMORY_H
|
select NEED_MACH_MEMORY_H
|
||||||
select SPARSE_IRQ
|
select SPARSE_IRQ
|
||||||
help
|
help
|
||||||
@@ -1064,11 +1067,6 @@ config IWMMXT
|
|||||||
Enable support for iWMMXt context switching at run time if
|
Enable support for iWMMXt context switching at run time if
|
||||||
running on a CPU that supports it.
|
running on a CPU that supports it.
|
||||||
|
|
||||||
config XSCALE_PMU
|
|
||||||
bool
|
|
||||||
depends on CPU_XSCALE
|
|
||||||
default y
|
|
||||||
|
|
||||||
config MULTI_IRQ_HANDLER
|
config MULTI_IRQ_HANDLER
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
@@ -1516,6 +1514,32 @@ config MCPM
|
|||||||
for (multi-)cluster based systems, such as big.LITTLE based
|
for (multi-)cluster based systems, such as big.LITTLE based
|
||||||
systems.
|
systems.
|
||||||
|
|
||||||
|
config BIG_LITTLE
|
||||||
|
bool "big.LITTLE support (Experimental)"
|
||||||
|
depends on CPU_V7 && SMP
|
||||||
|
select MCPM
|
||||||
|
help
|
||||||
|
This option enables support selections for the big.LITTLE
|
||||||
|
system architecture.
|
||||||
|
|
||||||
|
config BL_SWITCHER
|
||||||
|
bool "big.LITTLE switcher support"
|
||||||
|
depends on BIG_LITTLE && MCPM && HOTPLUG_CPU
|
||||||
|
select CPU_PM
|
||||||
|
select ARM_CPU_SUSPEND
|
||||||
|
help
|
||||||
|
The big.LITTLE "switcher" provides the core functionality to
|
||||||
|
transparently handle transition between a cluster of A15's
|
||||||
|
and a cluster of A7's in a big.LITTLE system.
|
||||||
|
|
||||||
|
config BL_SWITCHER_DUMMY_IF
|
||||||
|
tristate "Simple big.LITTLE switcher user interface"
|
||||||
|
depends on BL_SWITCHER && DEBUG_KERNEL
|
||||||
|
help
|
||||||
|
This is a simple and dummy char dev interface to control
|
||||||
|
the big.LITTLE switcher core code. It is meant for
|
||||||
|
debugging purposes only.
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Memory split"
|
prompt "Memory split"
|
||||||
default VMSPLIT_3G
|
default VMSPLIT_3G
|
||||||
|
|||||||
+36
-5
@@ -318,6 +318,7 @@ choice
|
|||||||
config DEBUG_MSM_UART1
|
config DEBUG_MSM_UART1
|
||||||
bool "Kernel low-level debugging messages via MSM UART1"
|
bool "Kernel low-level debugging messages via MSM UART1"
|
||||||
depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
|
depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
|
||||||
|
select DEBUG_MSM_UART
|
||||||
help
|
help
|
||||||
Say Y here if you want the debug print routines to direct
|
Say Y here if you want the debug print routines to direct
|
||||||
their output to the first serial port on MSM devices.
|
their output to the first serial port on MSM devices.
|
||||||
@@ -325,6 +326,7 @@ choice
|
|||||||
config DEBUG_MSM_UART2
|
config DEBUG_MSM_UART2
|
||||||
bool "Kernel low-level debugging messages via MSM UART2"
|
bool "Kernel low-level debugging messages via MSM UART2"
|
||||||
depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
|
depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
|
||||||
|
select DEBUG_MSM_UART
|
||||||
help
|
help
|
||||||
Say Y here if you want the debug print routines to direct
|
Say Y here if you want the debug print routines to direct
|
||||||
their output to the second serial port on MSM devices.
|
their output to the second serial port on MSM devices.
|
||||||
@@ -332,6 +334,7 @@ choice
|
|||||||
config DEBUG_MSM_UART3
|
config DEBUG_MSM_UART3
|
||||||
bool "Kernel low-level debugging messages via MSM UART3"
|
bool "Kernel low-level debugging messages via MSM UART3"
|
||||||
depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
|
depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
|
||||||
|
select DEBUG_MSM_UART
|
||||||
help
|
help
|
||||||
Say Y here if you want the debug print routines to direct
|
Say Y here if you want the debug print routines to direct
|
||||||
their output to the third serial port on MSM devices.
|
their output to the third serial port on MSM devices.
|
||||||
@@ -340,6 +343,7 @@ choice
|
|||||||
bool "Kernel low-level debugging messages via MSM 8660 UART"
|
bool "Kernel low-level debugging messages via MSM 8660 UART"
|
||||||
depends on ARCH_MSM8X60
|
depends on ARCH_MSM8X60
|
||||||
select MSM_HAS_DEBUG_UART_HS
|
select MSM_HAS_DEBUG_UART_HS
|
||||||
|
select DEBUG_MSM_UART
|
||||||
help
|
help
|
||||||
Say Y here if you want the debug print routines to direct
|
Say Y here if you want the debug print routines to direct
|
||||||
their output to the serial port on MSM 8660 devices.
|
their output to the serial port on MSM 8660 devices.
|
||||||
@@ -348,10 +352,20 @@ choice
|
|||||||
bool "Kernel low-level debugging messages via MSM 8960 UART"
|
bool "Kernel low-level debugging messages via MSM 8960 UART"
|
||||||
depends on ARCH_MSM8960
|
depends on ARCH_MSM8960
|
||||||
select MSM_HAS_DEBUG_UART_HS
|
select MSM_HAS_DEBUG_UART_HS
|
||||||
|
select DEBUG_MSM_UART
|
||||||
help
|
help
|
||||||
Say Y here if you want the debug print routines to direct
|
Say Y here if you want the debug print routines to direct
|
||||||
their output to the serial port on MSM 8960 devices.
|
their output to the serial port on MSM 8960 devices.
|
||||||
|
|
||||||
|
config DEBUG_MSM8974_UART
|
||||||
|
bool "Kernel low-level debugging messages via MSM 8974 UART"
|
||||||
|
depends on ARCH_MSM8974
|
||||||
|
select MSM_HAS_DEBUG_UART_HS
|
||||||
|
select DEBUG_MSM_UART
|
||||||
|
help
|
||||||
|
Say Y here if you want the debug print routines to direct
|
||||||
|
their output to the serial port on MSM 8974 devices.
|
||||||
|
|
||||||
config DEBUG_MVEBU_UART
|
config DEBUG_MVEBU_UART
|
||||||
bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)"
|
bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)"
|
||||||
depends on ARCH_MVEBU
|
depends on ARCH_MVEBU
|
||||||
@@ -841,6 +855,20 @@ choice
|
|||||||
options; the platform specific options are deprecated
|
options; the platform specific options are deprecated
|
||||||
and will be soon removed.
|
and will be soon removed.
|
||||||
|
|
||||||
|
config DEBUG_LL_UART_EFM32
|
||||||
|
bool "Kernel low-level debugging via efm32 UART"
|
||||||
|
depends on ARCH_EFM32
|
||||||
|
help
|
||||||
|
Say Y here if you want the debug print routines to direct
|
||||||
|
their output to an UART or USART port on efm32 based
|
||||||
|
machines. Use the following addresses for DEBUG_UART_PHYS:
|
||||||
|
|
||||||
|
0x4000c000 | USART0
|
||||||
|
0x4000c400 | USART1
|
||||||
|
0x4000c800 | USART2
|
||||||
|
0x4000e000 | UART0
|
||||||
|
0x4000e400 | UART1
|
||||||
|
|
||||||
config DEBUG_LL_UART_PL01X
|
config DEBUG_LL_UART_PL01X
|
||||||
bool "Kernel low-level debugging via ARM Ltd PL01x Primecell UART"
|
bool "Kernel low-level debugging via ARM Ltd PL01x Primecell UART"
|
||||||
help
|
help
|
||||||
@@ -887,11 +915,16 @@ config DEBUG_STI_UART
|
|||||||
bool
|
bool
|
||||||
depends on ARCH_STI
|
depends on ARCH_STI
|
||||||
|
|
||||||
|
config DEBUG_MSM_UART
|
||||||
|
bool
|
||||||
|
depends on ARCH_MSM
|
||||||
|
|
||||||
config DEBUG_LL_INCLUDE
|
config DEBUG_LL_INCLUDE
|
||||||
string
|
string
|
||||||
default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
|
default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
|
||||||
default "debug/pl01x.S" if DEBUG_LL_UART_PL01X || DEBUG_UART_PL01X
|
default "debug/pl01x.S" if DEBUG_LL_UART_PL01X || DEBUG_UART_PL01X
|
||||||
default "debug/exynos.S" if DEBUG_EXYNOS_UART
|
default "debug/exynos.S" if DEBUG_EXYNOS_UART
|
||||||
|
default "debug/efm32.S" if DEBUG_LL_UART_EFM32
|
||||||
default "debug/icedcc.S" if DEBUG_ICEDCC
|
default "debug/icedcc.S" if DEBUG_ICEDCC
|
||||||
default "debug/imx.S" if DEBUG_IMX1_UART || \
|
default "debug/imx.S" if DEBUG_IMX1_UART || \
|
||||||
DEBUG_IMX25_UART || \
|
DEBUG_IMX25_UART || \
|
||||||
@@ -902,11 +935,7 @@ config DEBUG_LL_INCLUDE
|
|||||||
DEBUG_IMX53_UART ||\
|
DEBUG_IMX53_UART ||\
|
||||||
DEBUG_IMX6Q_UART || \
|
DEBUG_IMX6Q_UART || \
|
||||||
DEBUG_IMX6SL_UART
|
DEBUG_IMX6SL_UART
|
||||||
default "debug/msm.S" if DEBUG_MSM_UART1 || \
|
default "debug/msm.S" if DEBUG_MSM_UART
|
||||||
DEBUG_MSM_UART2 || \
|
|
||||||
DEBUG_MSM_UART3 || \
|
|
||||||
DEBUG_MSM8660_UART || \
|
|
||||||
DEBUG_MSM8960_UART
|
|
||||||
default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
|
default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
|
||||||
default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
|
default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
|
||||||
default "debug/sti.S" if DEBUG_STI_UART
|
default "debug/sti.S" if DEBUG_STI_UART
|
||||||
@@ -959,6 +988,7 @@ config DEBUG_UART_PHYS
|
|||||||
default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
|
default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
|
||||||
default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3
|
default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3
|
||||||
default 0x20201000 if DEBUG_BCM2835
|
default 0x20201000 if DEBUG_BCM2835
|
||||||
|
default 0x4000e400 if DEBUG_LL_UART_EFM32
|
||||||
default 0x40090000 if ARCH_LPC32XX
|
default 0x40090000 if ARCH_LPC32XX
|
||||||
default 0x40100000 if DEBUG_PXA_UART1
|
default 0x40100000 if DEBUG_PXA_UART1
|
||||||
default 0x42000000 if ARCH_GEMINI
|
default 0x42000000 if ARCH_GEMINI
|
||||||
@@ -989,6 +1019,7 @@ config DEBUG_UART_PHYS
|
|||||||
default 0xfff36000 if DEBUG_HIGHBANK_UART
|
default 0xfff36000 if DEBUG_HIGHBANK_UART
|
||||||
default 0xfffff700 if ARCH_IOP33X
|
default 0xfffff700 if ARCH_IOP33X
|
||||||
depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
|
depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
|
||||||
|
DEBUG_LL_UART_EFM32 || \
|
||||||
DEBUG_UART_8250 || DEBUG_UART_PL01X
|
DEBUG_UART_8250 || DEBUG_UART_PL01X
|
||||||
|
|
||||||
config DEBUG_UART_VIRT
|
config DEBUG_UART_VIRT
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ LDFLAGS :=
|
|||||||
LDFLAGS_vmlinux :=-p --no-undefined -X
|
LDFLAGS_vmlinux :=-p --no-undefined -X
|
||||||
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
||||||
LDFLAGS_vmlinux += --be8
|
LDFLAGS_vmlinux += --be8
|
||||||
|
LDFLAGS_MODULE += --be8
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJCOPYFLAGS :=-O binary -R .comment -S
|
OBJCOPYFLAGS :=-O binary -R .comment -S
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ start:
|
|||||||
.word _edata @ zImage end address
|
.word _edata @ zImage end address
|
||||||
THUMB( .thumb )
|
THUMB( .thumb )
|
||||||
1:
|
1:
|
||||||
|
ARM_BE8( setend be ) @ go BE8 if compiled for BE8
|
||||||
mrs r9, cpsr
|
mrs r9, cpsr
|
||||||
#ifdef CONFIG_ARM_VIRT_EXT
|
#ifdef CONFIG_ARM_VIRT_EXT
|
||||||
bl __hyp_stub_install @ get into SVC mode, reversibly
|
bl __hyp_stub_install @ get into SVC mode, reversibly
|
||||||
@@ -699,9 +700,7 @@ __armv4_mmu_cache_on:
|
|||||||
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
||||||
orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
|
orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
|
||||||
orr r0, r0, #0x0030
|
orr r0, r0, #0x0030
|
||||||
#ifdef CONFIG_CPU_ENDIAN_BE8
|
ARM_BE8( orr r0, r0, #1 << 25 ) @ big-endian page tables
|
||||||
orr r0, r0, #1 << 25 @ big-endian page tables
|
|
||||||
#endif
|
|
||||||
bl __common_mmu_cache_on
|
bl __common_mmu_cache_on
|
||||||
mov r0, #0
|
mov r0, #0
|
||||||
mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
|
mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
|
||||||
@@ -728,9 +727,7 @@ __armv7_mmu_cache_on:
|
|||||||
orr r0, r0, #1 << 22 @ U (v6 unaligned access model)
|
orr r0, r0, #1 << 22 @ U (v6 unaligned access model)
|
||||||
@ (needed for ARM1176)
|
@ (needed for ARM1176)
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
#ifdef CONFIG_CPU_ENDIAN_BE8
|
ARM_BE8( orr r0, r0, #1 << 25 ) @ big-endian page tables
|
||||||
orr r0, r0, #1 << 25 @ big-endian page tables
|
|
||||||
#endif
|
|
||||||
mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg
|
mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg
|
||||||
orrne r0, r0, #1 @ MMU enabled
|
orrne r0, r0, #1 @ MMU enabled
|
||||||
movne r1, #0xfffffffd @ domain 0 = client
|
movne r1, #0xfffffffd @ domain 0 = client
|
||||||
|
|||||||
@@ -16,3 +16,5 @@ obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o
|
|||||||
AFLAGS_mcpm_head.o := -march=armv7-a
|
AFLAGS_mcpm_head.o := -march=armv7-a
|
||||||
AFLAGS_vlock.o := -march=armv7-a
|
AFLAGS_vlock.o := -march=armv7-a
|
||||||
obj-$(CONFIG_TI_PRIV_EDMA) += edma.o
|
obj-$(CONFIG_TI_PRIV_EDMA) += edma.o
|
||||||
|
obj-$(CONFIG_BL_SWITCHER) += bL_switcher.o
|
||||||
|
obj-$(CONFIG_BL_SWITCHER_DUMMY_IF) += bL_switcher_dummy_if.o
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* arch/arm/common/bL_switcher_dummy_if.c -- b.L switcher dummy interface
|
||||||
|
*
|
||||||
|
* Created by: Nicolas Pitre, November 2012
|
||||||
|
* Copyright: (C) 2012-2013 Linaro Limited
|
||||||
|
*
|
||||||
|
* Dummy interface to user space for debugging purpose only.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/miscdevice.h>
|
||||||
|
#include <asm/uaccess.h>
|
||||||
|
#include <asm/bL_switcher.h>
|
||||||
|
|
||||||
|
static ssize_t bL_switcher_write(struct file *file, const char __user *buf,
|
||||||
|
size_t len, loff_t *pos)
|
||||||
|
{
|
||||||
|
unsigned char val[3];
|
||||||
|
unsigned int cpu, cluster;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
pr_debug("%s\n", __func__);
|
||||||
|
|
||||||
|
if (len < 3)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (copy_from_user(val, buf, 3))
|
||||||
|
return -EFAULT;
|
||||||
|
|
||||||
|
/* format: <cpu#>,<cluster#> */
|
||||||
|
if (val[0] < '0' || val[0] > '9' ||
|
||||||
|
val[1] != ',' ||
|
||||||
|
val[2] < '0' || val[2] > '1')
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
cpu = val[0] - '0';
|
||||||
|
cluster = val[2] - '0';
|
||||||
|
ret = bL_switch_request(cpu, cluster);
|
||||||
|
|
||||||
|
return ret ? : len;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct file_operations bL_switcher_fops = {
|
||||||
|
.write = bL_switcher_write,
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct miscdevice bL_switcher_device = {
|
||||||
|
MISC_DYNAMIC_MINOR,
|
||||||
|
"b.L_switcher",
|
||||||
|
&bL_switcher_fops
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init bL_switcher_dummy_if_init(void)
|
||||||
|
{
|
||||||
|
return misc_register(&bL_switcher_device);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __exit bL_switcher_dummy_if_exit(void)
|
||||||
|
{
|
||||||
|
misc_deregister(&bL_switcher_device);
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(bL_switcher_dummy_if_init);
|
||||||
|
module_exit(bL_switcher_dummy_if_exit);
|
||||||
@@ -27,6 +27,18 @@ void mcpm_set_entry_vector(unsigned cpu, unsigned cluster, void *ptr)
|
|||||||
sync_cache_w(&mcpm_entry_vectors[cluster][cpu]);
|
sync_cache_w(&mcpm_entry_vectors[cluster][cpu]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern unsigned long mcpm_entry_early_pokes[MAX_NR_CLUSTERS][MAX_CPUS_PER_CLUSTER][2];
|
||||||
|
|
||||||
|
void mcpm_set_early_poke(unsigned cpu, unsigned cluster,
|
||||||
|
unsigned long poke_phys_addr, unsigned long poke_val)
|
||||||
|
{
|
||||||
|
unsigned long *poke = &mcpm_entry_early_pokes[cluster][cpu][0];
|
||||||
|
poke[0] = poke_phys_addr;
|
||||||
|
poke[1] = poke_val;
|
||||||
|
__cpuc_flush_dcache_area((void *)poke, 8);
|
||||||
|
outer_clean_range(__pa(poke), __pa(poke + 2));
|
||||||
|
}
|
||||||
|
|
||||||
static const struct mcpm_platform_ops *platform_ops;
|
static const struct mcpm_platform_ops *platform_ops;
|
||||||
|
|
||||||
int __init mcpm_platform_register(const struct mcpm_platform_ops *ops)
|
int __init mcpm_platform_register(const struct mcpm_platform_ops *ops)
|
||||||
@@ -90,6 +102,21 @@ void mcpm_cpu_power_down(void)
|
|||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mcpm_cpu_power_down_finish(unsigned int cpu, unsigned int cluster)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down_finish))
|
||||||
|
return -EUNATCH;
|
||||||
|
|
||||||
|
ret = platform_ops->power_down_finish(cpu, cluster);
|
||||||
|
if (ret)
|
||||||
|
pr_warn("%s: cpu %u, cluster %u failed to power down (%d)\n",
|
||||||
|
__func__, cpu, cluster, ret);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void mcpm_cpu_suspend(u64 expected_residency)
|
void mcpm_cpu_suspend(u64 expected_residency)
|
||||||
{
|
{
|
||||||
phys_reset_t phys_reset;
|
phys_reset_t phys_reset;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
#include <asm/mcpm.h>
|
#include <asm/mcpm.h>
|
||||||
|
#include <asm/assembler.h>
|
||||||
|
|
||||||
#include "vlock.h"
|
#include "vlock.h"
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
|
|
||||||
ENTRY(mcpm_entry_point)
|
ENTRY(mcpm_entry_point)
|
||||||
|
|
||||||
|
ARM_BE8(setend be)
|
||||||
THUMB( adr r12, BSYM(1f) )
|
THUMB( adr r12, BSYM(1f) )
|
||||||
THUMB( bx r12 )
|
THUMB( bx r12 )
|
||||||
THUMB( .thumb )
|
THUMB( .thumb )
|
||||||
@@ -71,12 +73,19 @@ ENTRY(mcpm_entry_point)
|
|||||||
* position independent way.
|
* position independent way.
|
||||||
*/
|
*/
|
||||||
adr r5, 3f
|
adr r5, 3f
|
||||||
ldmia r5, {r6, r7, r8, r11}
|
ldmia r5, {r0, r6, r7, r8, r11}
|
||||||
|
add r0, r5, r0 @ r0 = mcpm_entry_early_pokes
|
||||||
add r6, r5, r6 @ r6 = mcpm_entry_vectors
|
add r6, r5, r6 @ r6 = mcpm_entry_vectors
|
||||||
ldr r7, [r5, r7] @ r7 = mcpm_power_up_setup_phys
|
ldr r7, [r5, r7] @ r7 = mcpm_power_up_setup_phys
|
||||||
add r8, r5, r8 @ r8 = mcpm_sync
|
add r8, r5, r8 @ r8 = mcpm_sync
|
||||||
add r11, r5, r11 @ r11 = first_man_locks
|
add r11, r5, r11 @ r11 = first_man_locks
|
||||||
|
|
||||||
|
@ Perform an early poke, if any
|
||||||
|
add r0, r0, r4, lsl #3
|
||||||
|
ldmia r0, {r0, r1}
|
||||||
|
teq r0, #0
|
||||||
|
strne r1, [r0]
|
||||||
|
|
||||||
mov r0, #MCPM_SYNC_CLUSTER_SIZE
|
mov r0, #MCPM_SYNC_CLUSTER_SIZE
|
||||||
mla r8, r0, r10, r8 @ r8 = sync cluster base
|
mla r8, r0, r10, r8 @ r8 = sync cluster base
|
||||||
|
|
||||||
@@ -195,7 +204,8 @@ mcpm_entry_gated:
|
|||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
|
|
||||||
3: .word mcpm_entry_vectors - .
|
3: .word mcpm_entry_early_pokes - .
|
||||||
|
.word mcpm_entry_vectors - 3b
|
||||||
.word mcpm_power_up_setup_phys - 3b
|
.word mcpm_power_up_setup_phys - 3b
|
||||||
.word mcpm_sync - 3b
|
.word mcpm_sync - 3b
|
||||||
.word first_man_locks - 3b
|
.word first_man_locks - 3b
|
||||||
@@ -214,6 +224,10 @@ first_man_locks:
|
|||||||
ENTRY(mcpm_entry_vectors)
|
ENTRY(mcpm_entry_vectors)
|
||||||
.space 4 * MAX_NR_CLUSTERS * MAX_CPUS_PER_CLUSTER
|
.space 4 * MAX_NR_CLUSTERS * MAX_CPUS_PER_CLUSTER
|
||||||
|
|
||||||
|
.type mcpm_entry_early_pokes, #object
|
||||||
|
ENTRY(mcpm_entry_early_pokes)
|
||||||
|
.space 8 * MAX_NR_CLUSTERS * MAX_CPUS_PER_CLUSTER
|
||||||
|
|
||||||
.type mcpm_power_up_setup_phys, #object
|
.type mcpm_power_up_setup_phys, #object
|
||||||
ENTRY(mcpm_power_up_setup_phys)
|
ENTRY(mcpm_power_up_setup_phys)
|
||||||
.space 4 @ set by mcpm_sync_init()
|
.space 4 @ set by mcpm_sync_init()
|
||||||
|
|||||||
@@ -19,14 +19,23 @@
|
|||||||
#include <asm/smp.h>
|
#include <asm/smp.h>
|
||||||
#include <asm/smp_plat.h>
|
#include <asm/smp_plat.h>
|
||||||
|
|
||||||
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
static void cpu_to_pcpu(unsigned int cpu,
|
||||||
|
unsigned int *pcpu, unsigned int *pcluster)
|
||||||
{
|
{
|
||||||
unsigned int mpidr, pcpu, pcluster, ret;
|
unsigned int mpidr;
|
||||||
extern void secondary_startup(void);
|
|
||||||
|
|
||||||
mpidr = cpu_logical_map(cpu);
|
mpidr = cpu_logical_map(cpu);
|
||||||
pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
|
*pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
|
||||||
pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
|
*pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||||
|
{
|
||||||
|
unsigned int pcpu, pcluster, ret;
|
||||||
|
extern void secondary_startup(void);
|
||||||
|
|
||||||
|
cpu_to_pcpu(cpu, &pcpu, &pcluster);
|
||||||
|
|
||||||
pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
|
pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
|
||||||
__func__, cpu, pcpu, pcluster);
|
__func__, cpu, pcpu, pcluster);
|
||||||
|
|
||||||
@@ -47,6 +56,15 @@ static void mcpm_secondary_init(unsigned int cpu)
|
|||||||
|
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
|
|
||||||
|
static int mcpm_cpu_kill(unsigned int cpu)
|
||||||
|
{
|
||||||
|
unsigned int pcpu, pcluster;
|
||||||
|
|
||||||
|
cpu_to_pcpu(cpu, &pcpu, &pcluster);
|
||||||
|
|
||||||
|
return !mcpm_cpu_power_down_finish(pcpu, pcluster);
|
||||||
|
}
|
||||||
|
|
||||||
static int mcpm_cpu_disable(unsigned int cpu)
|
static int mcpm_cpu_disable(unsigned int cpu)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -73,6 +91,7 @@ static struct smp_operations __initdata mcpm_smp_ops = {
|
|||||||
.smp_boot_secondary = mcpm_boot_secondary,
|
.smp_boot_secondary = mcpm_boot_secondary,
|
||||||
.smp_secondary_init = mcpm_secondary_init,
|
.smp_secondary_init = mcpm_secondary_init,
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
|
.cpu_kill = mcpm_cpu_kill,
|
||||||
.cpu_disable = mcpm_cpu_disable,
|
.cpu_disable = mcpm_cpu_disable,
|
||||||
.cpu_die = mcpm_cpu_die,
|
.cpu_die = mcpm_cpu_die,
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ static struct clock_event_device sp804_clockevent = {
|
|||||||
|
|
||||||
static struct irqaction sp804_timer_irq = {
|
static struct irqaction sp804_timer_irq = {
|
||||||
.name = "timer",
|
.name = "timer",
|
||||||
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
.flags = IRQF_TIMER | IRQF_IRQPOLL,
|
||||||
.handler = sp804_timer_interrupt,
|
.handler = sp804_timer_interrupt,
|
||||||
.dev_id = &sp804_clockevent,
|
.dev_id = &sp804_clockevent,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
CONFIG_EXPERIMENTAL=y
|
|
||||||
CONFIG_SYSVIPC=y
|
CONFIG_SYSVIPC=y
|
||||||
|
CONFIG_NO_HZ_IDLE=y
|
||||||
|
CONFIG_HIGH_RES_TIMERS=y
|
||||||
CONFIG_LOG_BUF_SHIFT=14
|
CONFIG_LOG_BUF_SHIFT=14
|
||||||
CONFIG_BLK_DEV_INITRD=y
|
CONFIG_BLK_DEV_INITRD=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
@@ -11,11 +12,11 @@ CONFIG_ARCH_SA1100=y
|
|||||||
CONFIG_SA1100_H3600=y
|
CONFIG_SA1100_H3600=y
|
||||||
CONFIG_PCCARD=y
|
CONFIG_PCCARD=y
|
||||||
CONFIG_PCMCIA_SA1100=y
|
CONFIG_PCMCIA_SA1100=y
|
||||||
|
CONFIG_PREEMPT=y
|
||||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||||
# CONFIG_CPU_FREQ_STAT is not set
|
# CONFIG_CPU_FREQ_STAT is not set
|
||||||
CONFIG_FPE_NWFPE=y
|
CONFIG_FPE_NWFPE=y
|
||||||
CONFIG_PM=y
|
|
||||||
CONFIG_NET=y
|
CONFIG_NET=y
|
||||||
CONFIG_UNIX=y
|
CONFIG_UNIX=y
|
||||||
CONFIG_INET=y
|
CONFIG_INET=y
|
||||||
@@ -24,13 +25,10 @@ CONFIG_IRDA=m
|
|||||||
CONFIG_IRLAN=m
|
CONFIG_IRLAN=m
|
||||||
CONFIG_IRNET=m
|
CONFIG_IRNET=m
|
||||||
CONFIG_IRCOMM=m
|
CONFIG_IRCOMM=m
|
||||||
CONFIG_SA1100_FIR=m
|
|
||||||
# CONFIG_WIRELESS is not set
|
# CONFIG_WIRELESS is not set
|
||||||
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
||||||
CONFIG_MTD=y
|
CONFIG_MTD=y
|
||||||
CONFIG_MTD_PARTITIONS=y
|
|
||||||
CONFIG_MTD_REDBOOT_PARTS=y
|
CONFIG_MTD_REDBOOT_PARTS=y
|
||||||
CONFIG_MTD_CHAR=y
|
|
||||||
CONFIG_MTD_BLOCK=y
|
CONFIG_MTD_BLOCK=y
|
||||||
CONFIG_MTD_CFI=y
|
CONFIG_MTD_CFI=y
|
||||||
CONFIG_MTD_CFI_ADV_OPTIONS=y
|
CONFIG_MTD_CFI_ADV_OPTIONS=y
|
||||||
@@ -41,19 +39,15 @@ CONFIG_MTD_SA1100=y
|
|||||||
CONFIG_BLK_DEV_LOOP=m
|
CONFIG_BLK_DEV_LOOP=m
|
||||||
CONFIG_BLK_DEV_RAM=y
|
CONFIG_BLK_DEV_RAM=y
|
||||||
CONFIG_BLK_DEV_RAM_SIZE=8192
|
CONFIG_BLK_DEV_RAM_SIZE=8192
|
||||||
# CONFIG_MISC_DEVICES is not set
|
|
||||||
CONFIG_IDE=y
|
CONFIG_IDE=y
|
||||||
CONFIG_BLK_DEV_IDECS=y
|
CONFIG_BLK_DEV_IDECS=y
|
||||||
CONFIG_NETDEVICES=y
|
CONFIG_NETDEVICES=y
|
||||||
# CONFIG_NETDEV_1000 is not set
|
|
||||||
# CONFIG_NETDEV_10000 is not set
|
|
||||||
# CONFIG_WLAN is not set
|
|
||||||
CONFIG_NET_PCMCIA=y
|
|
||||||
CONFIG_PCMCIA_PCNET=y
|
CONFIG_PCMCIA_PCNET=y
|
||||||
CONFIG_PPP=m
|
CONFIG_PPP=m
|
||||||
CONFIG_PPP_ASYNC=m
|
|
||||||
CONFIG_PPP_DEFLATE=m
|
|
||||||
CONFIG_PPP_BSDCOMP=m
|
CONFIG_PPP_BSDCOMP=m
|
||||||
|
CONFIG_PPP_DEFLATE=m
|
||||||
|
CONFIG_PPP_ASYNC=m
|
||||||
|
# CONFIG_WLAN is not set
|
||||||
# CONFIG_KEYBOARD_ATKBD is not set
|
# CONFIG_KEYBOARD_ATKBD is not set
|
||||||
CONFIG_KEYBOARD_GPIO=y
|
CONFIG_KEYBOARD_GPIO=y
|
||||||
# CONFIG_INPUT_MOUSE is not set
|
# CONFIG_INPUT_MOUSE is not set
|
||||||
@@ -64,8 +58,6 @@ CONFIG_SERIAL_SA1100_CONSOLE=y
|
|||||||
# CONFIG_HWMON is not set
|
# CONFIG_HWMON is not set
|
||||||
CONFIG_FB=y
|
CONFIG_FB=y
|
||||||
CONFIG_FB_SA1100=y
|
CONFIG_FB_SA1100=y
|
||||||
# CONFIG_VGA_CONSOLE is not set
|
|
||||||
# CONFIG_HID_SUPPORT is not set
|
|
||||||
# CONFIG_USB_SUPPORT is not set
|
# CONFIG_USB_SUPPORT is not set
|
||||||
CONFIG_EXT2_FS=y
|
CONFIG_EXT2_FS=y
|
||||||
CONFIG_MSDOS_FS=m
|
CONFIG_MSDOS_FS=m
|
||||||
@@ -74,6 +66,4 @@ CONFIG_JFFS2_FS=y
|
|||||||
CONFIG_CRAMFS=m
|
CONFIG_CRAMFS=m
|
||||||
CONFIG_NFS_FS=y
|
CONFIG_NFS_FS=y
|
||||||
CONFIG_NFSD=m
|
CONFIG_NFSD=m
|
||||||
CONFIG_SMB_FS=m
|
|
||||||
CONFIG_NLS=y
|
CONFIG_NLS=y
|
||||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
aesbs-core.S
|
||||||
@@ -3,7 +3,17 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o
|
obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o
|
||||||
|
obj-$(CONFIG_CRYPTO_AES_ARM_BS) += aes-arm-bs.o
|
||||||
obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o
|
obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o
|
||||||
|
|
||||||
aes-arm-y := aes-armv4.o aes_glue.o
|
aes-arm-y := aes-armv4.o aes_glue.o
|
||||||
sha1-arm-y := sha1-armv4-large.o sha1_glue.o
|
aes-arm-bs-y := aesbs-core.o aesbs-glue.o
|
||||||
|
sha1-arm-y := sha1-armv4-large.o sha1_glue.o
|
||||||
|
|
||||||
|
quiet_cmd_perl = PERL $@
|
||||||
|
cmd_perl = $(PERL) $(<) > $(@)
|
||||||
|
|
||||||
|
$(src)/aesbs-core.S_shipped: $(src)/bsaes-armv7.pl
|
||||||
|
$(call cmd,perl)
|
||||||
|
|
||||||
|
.PRECIOUS: $(obj)/aesbs-core.S
|
||||||
|
|||||||
@@ -6,22 +6,12 @@
|
|||||||
#include <linux/crypto.h>
|
#include <linux/crypto.h>
|
||||||
#include <crypto/aes.h>
|
#include <crypto/aes.h>
|
||||||
|
|
||||||
#define AES_MAXNR 14
|
#include "aes_glue.h"
|
||||||
|
|
||||||
typedef struct {
|
EXPORT_SYMBOL(AES_encrypt);
|
||||||
unsigned int rd_key[4 *(AES_MAXNR + 1)];
|
EXPORT_SYMBOL(AES_decrypt);
|
||||||
int rounds;
|
EXPORT_SYMBOL(private_AES_set_encrypt_key);
|
||||||
} AES_KEY;
|
EXPORT_SYMBOL(private_AES_set_decrypt_key);
|
||||||
|
|
||||||
struct AES_CTX {
|
|
||||||
AES_KEY enc_key;
|
|
||||||
AES_KEY dec_key;
|
|
||||||
};
|
|
||||||
|
|
||||||
asmlinkage void AES_encrypt(const u8 *in, u8 *out, AES_KEY *ctx);
|
|
||||||
asmlinkage void AES_decrypt(const u8 *in, u8 *out, AES_KEY *ctx);
|
|
||||||
asmlinkage int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key);
|
|
||||||
asmlinkage int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key);
|
|
||||||
|
|
||||||
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
|
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
|
||||||
{
|
{
|
||||||
@@ -81,7 +71,7 @@ static struct crypto_alg aes_alg = {
|
|||||||
.cipher = {
|
.cipher = {
|
||||||
.cia_min_keysize = AES_MIN_KEY_SIZE,
|
.cia_min_keysize = AES_MIN_KEY_SIZE,
|
||||||
.cia_max_keysize = AES_MAX_KEY_SIZE,
|
.cia_max_keysize = AES_MAX_KEY_SIZE,
|
||||||
.cia_setkey = aes_set_key,
|
.cia_setkey = aes_set_key,
|
||||||
.cia_encrypt = aes_encrypt,
|
.cia_encrypt = aes_encrypt,
|
||||||
.cia_decrypt = aes_decrypt
|
.cia_decrypt = aes_decrypt
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
#define AES_MAXNR 14
|
||||||
|
|
||||||
|
struct AES_KEY {
|
||||||
|
unsigned int rd_key[4 * (AES_MAXNR + 1)];
|
||||||
|
int rounds;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AES_CTX {
|
||||||
|
struct AES_KEY enc_key;
|
||||||
|
struct AES_KEY dec_key;
|
||||||
|
};
|
||||||
|
|
||||||
|
asmlinkage void AES_encrypt(const u8 *in, u8 *out, struct AES_KEY *ctx);
|
||||||
|
asmlinkage void AES_decrypt(const u8 *in, u8 *out, struct AES_KEY *ctx);
|
||||||
|
asmlinkage int private_AES_set_decrypt_key(const unsigned char *userKey,
|
||||||
|
const int bits, struct AES_KEY *key);
|
||||||
|
asmlinkage int private_AES_set_encrypt_key(const unsigned char *userKey,
|
||||||
|
const int bits, struct AES_KEY *key);
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,434 @@
|
|||||||
|
/*
|
||||||
|
* linux/arch/arm/crypto/aesbs-glue.c - glue code for NEON bit sliced AES
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <asm/neon.h>
|
||||||
|
#include <crypto/aes.h>
|
||||||
|
#include <crypto/ablk_helper.h>
|
||||||
|
#include <crypto/algapi.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
|
||||||
|
#include "aes_glue.h"
|
||||||
|
|
||||||
|
#define BIT_SLICED_KEY_MAXSIZE (128 * (AES_MAXNR - 1) + 2 * AES_BLOCK_SIZE)
|
||||||
|
|
||||||
|
struct BS_KEY {
|
||||||
|
struct AES_KEY rk;
|
||||||
|
int converted;
|
||||||
|
u8 __aligned(8) bs[BIT_SLICED_KEY_MAXSIZE];
|
||||||
|
} __aligned(8);
|
||||||
|
|
||||||
|
asmlinkage void bsaes_enc_key_convert(u8 out[], struct AES_KEY const *in);
|
||||||
|
asmlinkage void bsaes_dec_key_convert(u8 out[], struct AES_KEY const *in);
|
||||||
|
|
||||||
|
asmlinkage void bsaes_cbc_encrypt(u8 const in[], u8 out[], u32 bytes,
|
||||||
|
struct BS_KEY *key, u8 iv[]);
|
||||||
|
|
||||||
|
asmlinkage void bsaes_ctr32_encrypt_blocks(u8 const in[], u8 out[], u32 blocks,
|
||||||
|
struct BS_KEY *key, u8 const iv[]);
|
||||||
|
|
||||||
|
asmlinkage void bsaes_xts_encrypt(u8 const in[], u8 out[], u32 bytes,
|
||||||
|
struct BS_KEY *key, u8 tweak[]);
|
||||||
|
|
||||||
|
asmlinkage void bsaes_xts_decrypt(u8 const in[], u8 out[], u32 bytes,
|
||||||
|
struct BS_KEY *key, u8 tweak[]);
|
||||||
|
|
||||||
|
struct aesbs_cbc_ctx {
|
||||||
|
struct AES_KEY enc;
|
||||||
|
struct BS_KEY dec;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct aesbs_ctr_ctx {
|
||||||
|
struct BS_KEY enc;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct aesbs_xts_ctx {
|
||||||
|
struct BS_KEY enc;
|
||||||
|
struct BS_KEY dec;
|
||||||
|
struct AES_KEY twkey;
|
||||||
|
};
|
||||||
|
|
||||||
|
static int aesbs_cbc_set_key(struct crypto_tfm *tfm, const u8 *in_key,
|
||||||
|
unsigned int key_len)
|
||||||
|
{
|
||||||
|
struct aesbs_cbc_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
int bits = key_len * 8;
|
||||||
|
|
||||||
|
if (private_AES_set_encrypt_key(in_key, bits, &ctx->enc)) {
|
||||||
|
tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
ctx->dec.rk = ctx->enc;
|
||||||
|
private_AES_set_decrypt_key(in_key, bits, &ctx->dec.rk);
|
||||||
|
ctx->dec.converted = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_ctr_set_key(struct crypto_tfm *tfm, const u8 *in_key,
|
||||||
|
unsigned int key_len)
|
||||||
|
{
|
||||||
|
struct aesbs_ctr_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
int bits = key_len * 8;
|
||||||
|
|
||||||
|
if (private_AES_set_encrypt_key(in_key, bits, &ctx->enc.rk)) {
|
||||||
|
tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
ctx->enc.converted = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_xts_set_key(struct crypto_tfm *tfm, const u8 *in_key,
|
||||||
|
unsigned int key_len)
|
||||||
|
{
|
||||||
|
struct aesbs_xts_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
int bits = key_len * 4;
|
||||||
|
|
||||||
|
if (private_AES_set_encrypt_key(in_key, bits, &ctx->enc.rk)) {
|
||||||
|
tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
ctx->dec.rk = ctx->enc.rk;
|
||||||
|
private_AES_set_decrypt_key(in_key, bits, &ctx->dec.rk);
|
||||||
|
private_AES_set_encrypt_key(in_key + key_len / 2, bits, &ctx->twkey);
|
||||||
|
ctx->enc.converted = ctx->dec.converted = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_cbc_encrypt(struct blkcipher_desc *desc,
|
||||||
|
struct scatterlist *dst,
|
||||||
|
struct scatterlist *src, unsigned int nbytes)
|
||||||
|
{
|
||||||
|
struct aesbs_cbc_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
||||||
|
struct blkcipher_walk walk;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||||
|
err = blkcipher_walk_virt(desc, &walk);
|
||||||
|
|
||||||
|
while (walk.nbytes) {
|
||||||
|
u32 blocks = walk.nbytes / AES_BLOCK_SIZE;
|
||||||
|
u8 *src = walk.src.virt.addr;
|
||||||
|
|
||||||
|
if (walk.dst.virt.addr == walk.src.virt.addr) {
|
||||||
|
u8 *iv = walk.iv;
|
||||||
|
|
||||||
|
do {
|
||||||
|
crypto_xor(src, iv, AES_BLOCK_SIZE);
|
||||||
|
AES_encrypt(src, src, &ctx->enc);
|
||||||
|
iv = src;
|
||||||
|
src += AES_BLOCK_SIZE;
|
||||||
|
} while (--blocks);
|
||||||
|
memcpy(walk.iv, iv, AES_BLOCK_SIZE);
|
||||||
|
} else {
|
||||||
|
u8 *dst = walk.dst.virt.addr;
|
||||||
|
|
||||||
|
do {
|
||||||
|
crypto_xor(walk.iv, src, AES_BLOCK_SIZE);
|
||||||
|
AES_encrypt(walk.iv, dst, &ctx->enc);
|
||||||
|
memcpy(walk.iv, dst, AES_BLOCK_SIZE);
|
||||||
|
src += AES_BLOCK_SIZE;
|
||||||
|
dst += AES_BLOCK_SIZE;
|
||||||
|
} while (--blocks);
|
||||||
|
}
|
||||||
|
err = blkcipher_walk_done(desc, &walk, 0);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_cbc_decrypt(struct blkcipher_desc *desc,
|
||||||
|
struct scatterlist *dst,
|
||||||
|
struct scatterlist *src, unsigned int nbytes)
|
||||||
|
{
|
||||||
|
struct aesbs_cbc_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
||||||
|
struct blkcipher_walk walk;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||||
|
err = blkcipher_walk_virt_block(desc, &walk, 8 * AES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
while ((walk.nbytes / AES_BLOCK_SIZE) >= 8) {
|
||||||
|
kernel_neon_begin();
|
||||||
|
bsaes_cbc_encrypt(walk.src.virt.addr, walk.dst.virt.addr,
|
||||||
|
walk.nbytes, &ctx->dec, walk.iv);
|
||||||
|
kernel_neon_end();
|
||||||
|
err = blkcipher_walk_done(desc, &walk, 0);
|
||||||
|
}
|
||||||
|
while (walk.nbytes) {
|
||||||
|
u32 blocks = walk.nbytes / AES_BLOCK_SIZE;
|
||||||
|
u8 *dst = walk.dst.virt.addr;
|
||||||
|
u8 *src = walk.src.virt.addr;
|
||||||
|
u8 bk[2][AES_BLOCK_SIZE];
|
||||||
|
u8 *iv = walk.iv;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (walk.dst.virt.addr == walk.src.virt.addr)
|
||||||
|
memcpy(bk[blocks & 1], src, AES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
AES_decrypt(src, dst, &ctx->dec.rk);
|
||||||
|
crypto_xor(dst, iv, AES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
if (walk.dst.virt.addr == walk.src.virt.addr)
|
||||||
|
iv = bk[blocks & 1];
|
||||||
|
else
|
||||||
|
iv = src;
|
||||||
|
|
||||||
|
dst += AES_BLOCK_SIZE;
|
||||||
|
src += AES_BLOCK_SIZE;
|
||||||
|
} while (--blocks);
|
||||||
|
err = blkcipher_walk_done(desc, &walk, 0);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void inc_be128_ctr(__be32 ctr[], u32 addend)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 3; i >= 0; i--, addend = 1) {
|
||||||
|
u32 n = be32_to_cpu(ctr[i]) + addend;
|
||||||
|
|
||||||
|
ctr[i] = cpu_to_be32(n);
|
||||||
|
if (n >= addend)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_ctr_encrypt(struct blkcipher_desc *desc,
|
||||||
|
struct scatterlist *dst, struct scatterlist *src,
|
||||||
|
unsigned int nbytes)
|
||||||
|
{
|
||||||
|
struct aesbs_ctr_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
||||||
|
struct blkcipher_walk walk;
|
||||||
|
u32 blocks;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||||
|
err = blkcipher_walk_virt_block(desc, &walk, 8 * AES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
while ((blocks = walk.nbytes / AES_BLOCK_SIZE)) {
|
||||||
|
u32 tail = walk.nbytes % AES_BLOCK_SIZE;
|
||||||
|
__be32 *ctr = (__be32 *)walk.iv;
|
||||||
|
u32 headroom = UINT_MAX - be32_to_cpu(ctr[3]);
|
||||||
|
|
||||||
|
/* avoid 32 bit counter overflow in the NEON code */
|
||||||
|
if (unlikely(headroom < blocks)) {
|
||||||
|
blocks = headroom + 1;
|
||||||
|
tail = walk.nbytes - blocks * AES_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
kernel_neon_begin();
|
||||||
|
bsaes_ctr32_encrypt_blocks(walk.src.virt.addr,
|
||||||
|
walk.dst.virt.addr, blocks,
|
||||||
|
&ctx->enc, walk.iv);
|
||||||
|
kernel_neon_end();
|
||||||
|
inc_be128_ctr(ctr, blocks);
|
||||||
|
|
||||||
|
nbytes -= blocks * AES_BLOCK_SIZE;
|
||||||
|
if (nbytes && nbytes == tail && nbytes <= AES_BLOCK_SIZE)
|
||||||
|
break;
|
||||||
|
|
||||||
|
err = blkcipher_walk_done(desc, &walk, tail);
|
||||||
|
}
|
||||||
|
if (walk.nbytes) {
|
||||||
|
u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
|
||||||
|
u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
|
||||||
|
u8 ks[AES_BLOCK_SIZE];
|
||||||
|
|
||||||
|
AES_encrypt(walk.iv, ks, &ctx->enc.rk);
|
||||||
|
if (tdst != tsrc)
|
||||||
|
memcpy(tdst, tsrc, nbytes);
|
||||||
|
crypto_xor(tdst, ks, nbytes);
|
||||||
|
err = blkcipher_walk_done(desc, &walk, 0);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_xts_encrypt(struct blkcipher_desc *desc,
|
||||||
|
struct scatterlist *dst,
|
||||||
|
struct scatterlist *src, unsigned int nbytes)
|
||||||
|
{
|
||||||
|
struct aesbs_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
||||||
|
struct blkcipher_walk walk;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||||
|
err = blkcipher_walk_virt_block(desc, &walk, 8 * AES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
/* generate the initial tweak */
|
||||||
|
AES_encrypt(walk.iv, walk.iv, &ctx->twkey);
|
||||||
|
|
||||||
|
while (walk.nbytes) {
|
||||||
|
kernel_neon_begin();
|
||||||
|
bsaes_xts_encrypt(walk.src.virt.addr, walk.dst.virt.addr,
|
||||||
|
walk.nbytes, &ctx->enc, walk.iv);
|
||||||
|
kernel_neon_end();
|
||||||
|
err = blkcipher_walk_done(desc, &walk, 0);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int aesbs_xts_decrypt(struct blkcipher_desc *desc,
|
||||||
|
struct scatterlist *dst,
|
||||||
|
struct scatterlist *src, unsigned int nbytes)
|
||||||
|
{
|
||||||
|
struct aesbs_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
|
||||||
|
struct blkcipher_walk walk;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
blkcipher_walk_init(&walk, dst, src, nbytes);
|
||||||
|
err = blkcipher_walk_virt_block(desc, &walk, 8 * AES_BLOCK_SIZE);
|
||||||
|
|
||||||
|
/* generate the initial tweak */
|
||||||
|
AES_encrypt(walk.iv, walk.iv, &ctx->twkey);
|
||||||
|
|
||||||
|
while (walk.nbytes) {
|
||||||
|
kernel_neon_begin();
|
||||||
|
bsaes_xts_decrypt(walk.src.virt.addr, walk.dst.virt.addr,
|
||||||
|
walk.nbytes, &ctx->dec, walk.iv);
|
||||||
|
kernel_neon_end();
|
||||||
|
err = blkcipher_walk_done(desc, &walk, 0);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct crypto_alg aesbs_algs[] = { {
|
||||||
|
.cra_name = "__cbc-aes-neonbs",
|
||||||
|
.cra_driver_name = "__driver-cbc-aes-neonbs",
|
||||||
|
.cra_priority = 0,
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
|
||||||
|
.cra_blocksize = AES_BLOCK_SIZE,
|
||||||
|
.cra_ctxsize = sizeof(struct aesbs_cbc_ctx),
|
||||||
|
.cra_alignmask = 7,
|
||||||
|
.cra_type = &crypto_blkcipher_type,
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_blkcipher = {
|
||||||
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
|
.setkey = aesbs_cbc_set_key,
|
||||||
|
.encrypt = aesbs_cbc_encrypt,
|
||||||
|
.decrypt = aesbs_cbc_decrypt,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
.cra_name = "__ctr-aes-neonbs",
|
||||||
|
.cra_driver_name = "__driver-ctr-aes-neonbs",
|
||||||
|
.cra_priority = 0,
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
|
||||||
|
.cra_blocksize = 1,
|
||||||
|
.cra_ctxsize = sizeof(struct aesbs_ctr_ctx),
|
||||||
|
.cra_alignmask = 7,
|
||||||
|
.cra_type = &crypto_blkcipher_type,
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_blkcipher = {
|
||||||
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
|
.setkey = aesbs_ctr_set_key,
|
||||||
|
.encrypt = aesbs_ctr_encrypt,
|
||||||
|
.decrypt = aesbs_ctr_encrypt,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
.cra_name = "__xts-aes-neonbs",
|
||||||
|
.cra_driver_name = "__driver-xts-aes-neonbs",
|
||||||
|
.cra_priority = 0,
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
|
||||||
|
.cra_blocksize = AES_BLOCK_SIZE,
|
||||||
|
.cra_ctxsize = sizeof(struct aesbs_xts_ctx),
|
||||||
|
.cra_alignmask = 7,
|
||||||
|
.cra_type = &crypto_blkcipher_type,
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_blkcipher = {
|
||||||
|
.min_keysize = 2 * AES_MIN_KEY_SIZE,
|
||||||
|
.max_keysize = 2 * AES_MAX_KEY_SIZE,
|
||||||
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
|
.setkey = aesbs_xts_set_key,
|
||||||
|
.encrypt = aesbs_xts_encrypt,
|
||||||
|
.decrypt = aesbs_xts_decrypt,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
.cra_name = "cbc(aes)",
|
||||||
|
.cra_driver_name = "cbc-aes-neonbs",
|
||||||
|
.cra_priority = 300,
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
|
||||||
|
.cra_blocksize = AES_BLOCK_SIZE,
|
||||||
|
.cra_ctxsize = sizeof(struct async_helper_ctx),
|
||||||
|
.cra_alignmask = 7,
|
||||||
|
.cra_type = &crypto_ablkcipher_type,
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_init = ablk_init,
|
||||||
|
.cra_exit = ablk_exit,
|
||||||
|
.cra_ablkcipher = {
|
||||||
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
|
.setkey = ablk_set_key,
|
||||||
|
.encrypt = __ablk_encrypt,
|
||||||
|
.decrypt = ablk_decrypt,
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
.cra_name = "ctr(aes)",
|
||||||
|
.cra_driver_name = "ctr-aes-neonbs",
|
||||||
|
.cra_priority = 300,
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
|
||||||
|
.cra_blocksize = 1,
|
||||||
|
.cra_ctxsize = sizeof(struct async_helper_ctx),
|
||||||
|
.cra_alignmask = 7,
|
||||||
|
.cra_type = &crypto_ablkcipher_type,
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_init = ablk_init,
|
||||||
|
.cra_exit = ablk_exit,
|
||||||
|
.cra_ablkcipher = {
|
||||||
|
.min_keysize = AES_MIN_KEY_SIZE,
|
||||||
|
.max_keysize = AES_MAX_KEY_SIZE,
|
||||||
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
|
.setkey = ablk_set_key,
|
||||||
|
.encrypt = ablk_encrypt,
|
||||||
|
.decrypt = ablk_decrypt,
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
.cra_name = "xts(aes)",
|
||||||
|
.cra_driver_name = "xts-aes-neonbs",
|
||||||
|
.cra_priority = 300,
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
|
||||||
|
.cra_blocksize = AES_BLOCK_SIZE,
|
||||||
|
.cra_ctxsize = sizeof(struct async_helper_ctx),
|
||||||
|
.cra_alignmask = 7,
|
||||||
|
.cra_type = &crypto_ablkcipher_type,
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_init = ablk_init,
|
||||||
|
.cra_exit = ablk_exit,
|
||||||
|
.cra_ablkcipher = {
|
||||||
|
.min_keysize = 2 * AES_MIN_KEY_SIZE,
|
||||||
|
.max_keysize = 2 * AES_MAX_KEY_SIZE,
|
||||||
|
.ivsize = AES_BLOCK_SIZE,
|
||||||
|
.setkey = ablk_set_key,
|
||||||
|
.encrypt = ablk_encrypt,
|
||||||
|
.decrypt = ablk_decrypt,
|
||||||
|
}
|
||||||
|
} };
|
||||||
|
|
||||||
|
static int __init aesbs_mod_init(void)
|
||||||
|
{
|
||||||
|
if (!cpu_has_neon())
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
return crypto_register_algs(aesbs_algs, ARRAY_SIZE(aesbs_algs));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __exit aesbs_mod_exit(void)
|
||||||
|
{
|
||||||
|
crypto_unregister_algs(aesbs_algs, ARRAY_SIZE(aesbs_algs));
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(aesbs_mod_init);
|
||||||
|
module_exit(aesbs_mod_exit);
|
||||||
|
|
||||||
|
MODULE_DESCRIPTION("Bit sliced AES in CBC/CTR/XTS modes using NEON");
|
||||||
|
MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,7 @@ generic-y += sembuf.h
|
|||||||
generic-y += serial.h
|
generic-y += serial.h
|
||||||
generic-y += shmbuf.h
|
generic-y += shmbuf.h
|
||||||
generic-y += siginfo.h
|
generic-y += siginfo.h
|
||||||
|
generic-y += simd.h
|
||||||
generic-y += sizes.h
|
generic-y += sizes.h
|
||||||
generic-y += socket.h
|
generic-y += socket.h
|
||||||
generic-y += sockios.h
|
generic-y += sockios.h
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user