Update to 2.6.32-rc5.
Incorporate 2.6.31-1 changelog from sid. Move my last changelog addition into the new entry. Remove obsolete patches. Update aufs2, firmware and speakup patches. Update reportoldconfig and version patches. svn path=/dists/trunk/linux-2.6/; revision=14463
This commit is contained in:
parent
5b5812c8a8
commit
92241355b2
|
@ -1,12 +1,18 @@
|
|||
linux-2.6 (2.6.31-1~experimental.3) UNRELEASED; urgency=low
|
||||
linux-2.6 (2.6.32~rc5-1) UNRELEASED; urgency=low
|
||||
|
||||
* New upstream release candidate.
|
||||
* README.Debian: Add brief information about building specific binary
|
||||
packages (Closes: #546182)
|
||||
|
||||
-- Ben Hutchings <ben@decadent.org.uk> Mon, 26 Oct 2009 01:18:26 +0000
|
||||
|
||||
linux-2.6 (2.6.31-1) unstable; urgency=low
|
||||
|
||||
[ Ben Hutchings ]
|
||||
* Include aufs2, marked as staging (Closes: #541828)
|
||||
* Include speakup modules under staging
|
||||
* Add stable release 2.6.31.5
|
||||
* [x86_64] Enable NUMA_EMU (Closes: #541389)
|
||||
* README.Debian: Add brief information about building specific binary
|
||||
packages (Closes: #546182)
|
||||
|
||||
[ Martin Michlmayr ]
|
||||
* CPUidle: always return with interrupts enabled.
|
||||
|
@ -21,7 +27,11 @@ linux-2.6 (2.6.31-1~experimental.3) UNRELEASED; urgency=low
|
|||
ia64 and x86_64 to 65536 otherwise default to 32768.
|
||||
* Unset UEVENT_HELPER_PATH to save some boot cycles.
|
||||
|
||||
-- Ben Hutchings <ben@decadent.org.uk> Tue, 13 Oct 2009 02:18:40 +0100
|
||||
[ Bastian Blank ]
|
||||
* Set ABI to 1.
|
||||
* Enable Apple PMU battery. (closes: #544264)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Sat, 24 Oct 2009 19:17:30 +0200
|
||||
|
||||
linux-2.6 (2.6.31-1~experimental.2) experimental; urgency=low
|
||||
|
||||
|
|
|
@ -1,227 +0,0 @@
|
|||
From aa735263241c7ae1ce9d3b6fd957b02819468f99 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Sat, 15 Aug 2009 19:22:39 +0100
|
||||
Subject: [PATCH] r128: Add test for initialisation to all ioctls that require it
|
||||
|
||||
Almost all r128's private ioctls require that the CCE state has
|
||||
already been initialised. However, most do not test that this has
|
||||
been done, and will proceed to dereference a null pointer. This may
|
||||
result in a security vulnerability, since some ioctls are
|
||||
unprivileged.
|
||||
|
||||
This adds a macro for the common initialisation test and changes all
|
||||
ioctl implementations that require prior initialisation to use that
|
||||
macro.
|
||||
|
||||
Also, r128_do_init_cce() does not test that the CCE state has not
|
||||
been initialised already. Repeated initialisation may lead to a crash
|
||||
or resource leak. This adds that test.
|
||||
---
|
||||
drivers/gpu/drm/r128/r128_cce.c | 18 ++++++++++++++----
|
||||
drivers/gpu/drm/r128/r128_drv.h | 8 ++++++++
|
||||
drivers/gpu/drm/r128/r128_state.c | 36 +++++++++++++++++++-----------------
|
||||
3 files changed, 41 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
|
||||
index c75fd35..ebf9f63 100644
|
||||
--- a/drivers/gpu/drm/r128/r128_cce.c
|
||||
+++ b/drivers/gpu/drm/r128/r128_cce.c
|
||||
@@ -353,6 +353,11 @@ static int r128_do_init_cce(struct drm_device * dev, drm_r128_init_t * init)
|
||||
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
+ if (dev->dev_private) {
|
||||
+ DRM_DEBUG("called when already initialized\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
dev_priv = kzalloc(sizeof(drm_r128_private_t), GFP_KERNEL);
|
||||
if (dev_priv == NULL)
|
||||
return -ENOMEM;
|
||||
@@ -649,6 +654,8 @@ int r128_cce_start(struct drm_device *dev, void *data, struct drm_file *file_pri
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
if (dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4) {
|
||||
DRM_DEBUG("while CCE running\n");
|
||||
return 0;
|
||||
@@ -671,6 +678,8 @@ int r128_cce_stop(struct drm_device *dev, void *data, struct drm_file *file_priv
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
/* Flush any pending CCE commands. This ensures any outstanding
|
||||
* commands are exectuted by the engine before we turn it off.
|
||||
*/
|
||||
@@ -708,10 +717,7 @@ int r128_cce_reset(struct drm_device *dev, void *data, struct drm_file *file_pri
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
- if (!dev_priv) {
|
||||
- DRM_DEBUG("called before init done\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
r128_do_cce_reset(dev_priv);
|
||||
|
||||
@@ -728,6 +734,8 @@ int r128_cce_idle(struct drm_device *dev, void *data, struct drm_file *file_priv
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
if (dev_priv->cce_running) {
|
||||
r128_do_cce_flush(dev_priv);
|
||||
}
|
||||
@@ -741,6 +749,8 @@ int r128_engine_reset(struct drm_device *dev, void *data, struct drm_file *file_
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev->dev_private);
|
||||
+
|
||||
return r128_do_engine_reset(dev);
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/r128/r128_drv.h b/drivers/gpu/drm/r128/r128_drv.h
|
||||
index 797a26c..3c60829 100644
|
||||
--- a/drivers/gpu/drm/r128/r128_drv.h
|
||||
+++ b/drivers/gpu/drm/r128/r128_drv.h
|
||||
@@ -422,6 +422,14 @@ static __inline__ void r128_update_ring_snapshot(drm_r128_private_t * dev_priv)
|
||||
* Misc helper macros
|
||||
*/
|
||||
|
||||
+#define DEV_INIT_TEST_WITH_RETURN(_dev_priv) \
|
||||
+do { \
|
||||
+ if (!_dev_priv) { \
|
||||
+ DRM_ERROR("called with no initialization\n"); \
|
||||
+ return -EINVAL; \
|
||||
+ } \
|
||||
+} while (0)
|
||||
+
|
||||
#define RING_SPACE_TEST_WITH_RETURN( dev_priv ) \
|
||||
do { \
|
||||
drm_r128_ring_buffer_t *ring = &dev_priv->ring; int i; \
|
||||
diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c
|
||||
index 026a48c..af2665c 100644
|
||||
--- a/drivers/gpu/drm/r128/r128_state.c
|
||||
+++ b/drivers/gpu/drm/r128/r128_state.c
|
||||
@@ -1244,14 +1244,18 @@ static void r128_cce_dispatch_stipple(struct drm_device * dev, u32 * stipple)
|
||||
static int r128_cce_clear(struct drm_device *dev, void *data, struct drm_file *file_priv)
|
||||
{
|
||||
drm_r128_private_t *dev_priv = dev->dev_private;
|
||||
- drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
+ drm_r128_sarea_t *sarea_priv;
|
||||
drm_r128_clear_t *clear = data;
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
RING_SPACE_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
+ sarea_priv = dev_priv->sarea_priv;
|
||||
+
|
||||
if (sarea_priv->nbox > R128_NR_SAREA_CLIPRECTS)
|
||||
sarea_priv->nbox = R128_NR_SAREA_CLIPRECTS;
|
||||
|
||||
@@ -1312,6 +1316,8 @@ static int r128_cce_flip(struct drm_device *dev, void *data, struct drm_file *fi
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
RING_SPACE_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
if (!dev_priv->page_flipping)
|
||||
@@ -1331,6 +1337,8 @@ static int r128_cce_swap(struct drm_device *dev, void *data, struct drm_file *fi
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
RING_SPACE_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
if (sarea_priv->nbox > R128_NR_SAREA_CLIPRECTS)
|
||||
@@ -1354,10 +1362,7 @@ static int r128_cce_vertex(struct drm_device *dev, void *data, struct drm_file *
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
- if (!dev_priv) {
|
||||
- DRM_ERROR("called with no initialization\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
DRM_DEBUG("pid=%d index=%d count=%d discard=%d\n",
|
||||
DRM_CURRENTPID, vertex->idx, vertex->count, vertex->discard);
|
||||
@@ -1410,10 +1415,7 @@ static int r128_cce_indices(struct drm_device *dev, void *data, struct drm_file
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
- if (!dev_priv) {
|
||||
- DRM_ERROR("called with no initialization\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
DRM_DEBUG("pid=%d buf=%d s=%d e=%d d=%d\n", DRM_CURRENTPID,
|
||||
elts->idx, elts->start, elts->end, elts->discard);
|
||||
@@ -1476,6 +1478,8 @@ static int r128_cce_blit(struct drm_device *dev, void *data, struct drm_file *fi
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
DRM_DEBUG("pid=%d index=%d\n", DRM_CURRENTPID, blit->idx);
|
||||
|
||||
if (blit->idx < 0 || blit->idx >= dma->buf_count) {
|
||||
@@ -1501,6 +1505,8 @@ static int r128_cce_depth(struct drm_device *dev, void *data, struct drm_file *f
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
RING_SPACE_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
ret = -EINVAL;
|
||||
@@ -1531,6 +1537,8 @@ static int r128_cce_stipple(struct drm_device *dev, void *data, struct drm_file
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
+
|
||||
if (DRM_COPY_FROM_USER(&mask, stipple->mask, 32 * sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
@@ -1555,10 +1563,7 @@ static int r128_cce_indirect(struct drm_device *dev, void *data, struct drm_file
|
||||
|
||||
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
||||
|
||||
- if (!dev_priv) {
|
||||
- DRM_ERROR("called with no initialization\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
DRM_DEBUG("idx=%d s=%d e=%d d=%d\n",
|
||||
indirect->idx, indirect->start, indirect->end,
|
||||
@@ -1620,10 +1625,7 @@ static int r128_getparam(struct drm_device *dev, void *data, struct drm_file *fi
|
||||
drm_r128_getparam_t *param = data;
|
||||
int value;
|
||||
|
||||
- if (!dev_priv) {
|
||||
- DRM_ERROR("called with no initialization\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ DEV_INIT_TEST_WITH_RETURN(dev_priv);
|
||||
|
||||
DRM_DEBUG("pid=%d\n", DRM_CURRENTPID);
|
||||
|
||||
--
|
||||
1.6.3.3
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Sun, 04 Oct 2009 14:25:50 +0100
|
||||
Subject: [PATCH] nfs: Avoid overrun when copying client IP address string
|
||||
|
||||
As seen in <http://bugs.debian.org/549002>, nfs4_init_client() can
|
||||
overrun the source string when copying the client IP address from
|
||||
nfs_parsed_mount_data::client_address to nfs_client::cl_ipaddr. Since
|
||||
these are both treated as null-terminated strings elsewhere, the copy
|
||||
should be done with strlcpy() not memcpy().
|
||||
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
|
||||
index 75c9cd2..f525a2f 100644
|
||||
--- a/fs/nfs/client.c
|
||||
+++ b/fs/nfs/client.c
|
||||
@@ -1073,7 +1073,7 @@ static int nfs4_init_client(struct nfs_client *clp,
|
||||
1, flags & NFS_MOUNT_NORESVPORT);
|
||||
if (error < 0)
|
||||
goto error;
|
||||
- memcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
|
||||
+ strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
|
||||
|
||||
error = nfs_idmap_new(clp);
|
||||
if (error < 0) {
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,24 +0,0 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index d3a69fd..0138557 100644
|
||||
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
|
||||
index 549bd0f..fa4ce67 100644
|
||||
--- a/drivers/char/tty_port.c
|
||||
+++ b/drivers/char/tty_port.c
|
||||
@@ -99,7 +99,7 @@ EXPORT_SYMBOL(tty_port_tty_set);
|
||||
static void tty_port_shutdown(struct tty_port *port)
|
||||
{
|
||||
if (port->ops->shutdown &&
|
||||
- test_and_clear_bit(ASYNC_INITIALIZED, &port->flags))
|
||||
+ test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags))
|
||||
port->ops->shutdown(port);
|
||||
|
||||
}
|
||||
@@ -309,7 +309,7 @@ int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct f
|
||||
port->ops->drop(port);
|
||||
return 0;
|
||||
}
|
||||
- set_bit(ASYNC_CLOSING, &port->flags);
|
||||
+ set_bit(ASYNCB_CLOSING, &port->flags);
|
||||
tty->closing = 1;
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
/* Don't block on a stalled port, just pull the chain */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,65 +0,0 @@
|
|||
commit 48e46b7b311c54525712c28004f0a59f2c931d30
|
||||
Author: Jurij Smakov <jurij@wooyd.org>
|
||||
Date: Sun Aug 16 18:21:47 2009 -0700
|
||||
|
||||
sparc64: build compressed image (zImage) by default
|
||||
|
||||
Besides creating the uncompressed vmlinux image for sparc64, also
|
||||
create a compressed zImage. This is more consistent with other
|
||||
architectures and required to make the 'deb-pkg' target work.
|
||||
|
||||
Signed-off-by: Jurij Smakov <jurij@wooyd.org>
|
||||
Signed-off-by: Frans Pop <elendil@planet.nl>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
|
||||
index 2003ded..467221d 100644
|
||||
--- a/arch/sparc/Makefile
|
||||
+++ b/arch/sparc/Makefile
|
||||
@@ -38,10 +38,6 @@ CPPFLAGS_vmlinux.lds += -m32
|
||||
# Actual linking is done with "make image".
|
||||
LDFLAGS_vmlinux = -r
|
||||
|
||||
-# Default target
|
||||
-all: zImage
|
||||
-
|
||||
-
|
||||
else
|
||||
#####
|
||||
# sparc64
|
||||
@@ -91,6 +87,9 @@ endif
|
||||
|
||||
boot := arch/sparc/boot
|
||||
|
||||
+# Default target
|
||||
+all: zImage
|
||||
+
|
||||
image zImage tftpboot.img vmlinux.aout: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
|
||||
@@ -109,8 +108,9 @@ define archhelp
|
||||
endef
|
||||
else
|
||||
define archhelp
|
||||
- echo '* vmlinux - Standard sparc64 kernel'
|
||||
- echo ' vmlinux.aout - a.out kernel for sparc64'
|
||||
+ echo '* vmlinux - standard sparc64 kernel'
|
||||
+ echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
|
||||
+ echo ' vmlinux.aout - a.out kernel for sparc64'
|
||||
echo ' tftpboot.img - image prepared for tftp'
|
||||
endef
|
||||
endif
|
||||
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
|
||||
index 1ff0fd9..97e3feb 100644
|
||||
--- a/arch/sparc/boot/Makefile
|
||||
+++ b/arch/sparc/boot/Makefile
|
||||
@@ -79,6 +79,9 @@ $(obj)/image: vmlinux FORCE
|
||||
$(call if_changed,strip)
|
||||
@echo ' kernel: $@ is ready'
|
||||
|
||||
+$(obj)/zImage: $(obj)/image
|
||||
+ $(call if_changed,gzip)
|
||||
+
|
||||
$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE
|
||||
$(call if_changed,elftoaout)
|
||||
$(call if_changed,piggy)
|
|
@ -1,80 +0,0 @@
|
|||
Subject: [PATCH v2] x86: Fix code patching for paravirt-alternatives on 486
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
To: x86@kernel.org
|
||||
Cc: "H. Peter Anvin" <hpa@zytor.com>, linux-kernel@vger.kernel.org
|
||||
Date: Thu, 10 Sep 2009 02:53:51 +0100
|
||||
|
||||
As reported in <http://bugs.debian.org/511703> and
|
||||
<http://bugs.debian.org/515982>, kernels with paravirt-alternatives
|
||||
enabled crash in text_poke_early() on at least some 486-class
|
||||
processors.
|
||||
|
||||
The problem is that text_poke_early() itself uses inline functions
|
||||
affected by paravirt-alternatives and so will modify instructions that
|
||||
have already been prefetched. Pentium and later processors will
|
||||
invalidate the prefetched instructions in this case, but 486-class
|
||||
processors do not.
|
||||
|
||||
Change sync_core() to limit prefetching on 486-class (and 386-class)
|
||||
processors, and move the call to sync_core() above the call to the
|
||||
modifiable local_irq_restore().
|
||||
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
Second try, incorporating the jmp into sync_core().
|
||||
|
||||
Also not signed as I know git has trouble with MIME.
|
||||
|
||||
Ben.
|
||||
|
||||
arch/x86/include/asm/processor.h | 16 +++++++++++++---
|
||||
arch/x86/kernel/alternative.c | 2 +-
|
||||
2 files changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
|
||||
index c776826..2db56c5 100644
|
||||
--- a/arch/x86/include/asm/processor.h
|
||||
+++ b/arch/x86/include/asm/processor.h
|
||||
@@ -703,13 +703,23 @@ static inline void cpu_relax(void)
|
||||
rep_nop();
|
||||
}
|
||||
|
||||
-/* Stop speculative execution: */
|
||||
+/* Stop speculative execution and prefetching of modified code. */
|
||||
static inline void sync_core(void)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
- asm volatile("cpuid" : "=a" (tmp) : "0" (1)
|
||||
- : "ebx", "ecx", "edx", "memory");
|
||||
+#if defined(CONFIG_M386) || defined(CONFIG_M486)
|
||||
+ if (boot_cpu_data.x86 < 5)
|
||||
+ /* There is no speculative execution.
|
||||
+ * jmp is a barrier to prefetching. */
|
||||
+ asm volatile("jmp 1f\n1:\n" ::: "memory");
|
||||
+ else
|
||||
+#endif
|
||||
+ /* cpuid is a barrier to speculative execution.
|
||||
+ * Prefetched instructions are automatically
|
||||
+ * invalidated when modified. */
|
||||
+ asm volatile("cpuid" : "=a" (tmp) : "0" (1)
|
||||
+ : "ebx", "ecx", "edx", "memory");
|
||||
}
|
||||
|
||||
static inline void __monitor(const void *eax, unsigned long ecx,
|
||||
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
|
||||
index 4869351..de7353c 100644
|
||||
--- a/arch/x86/kernel/alternative.c
|
||||
+++ b/arch/x86/kernel/alternative.c
|
||||
@@ -498,8 +498,8 @@ static void *__init_or_module text_poke_early(void *addr, const void *opcode,
|
||||
unsigned long flags;
|
||||
local_irq_save(flags);
|
||||
memcpy(addr, opcode, len);
|
||||
- local_irq_restore(flags);
|
||||
sync_core();
|
||||
+ local_irq_restore(flags);
|
||||
/* Could also do a CLFLUSH here to speed up CPU recovery; but
|
||||
that causes hangs on some VIA CPUs. */
|
||||
return addr;
|
||||
--
|
||||
1.6.3.3
|
|
@ -1,113 +0,0 @@
|
|||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Fri, 11 Sep 2009 00:48:48 +0000 (-0700)
|
||||
Subject: agp/intel: Fix the pre-9xx chipset flush.
|
||||
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fanholt%2Fdrm-intel.git;a=commitdiff_plain;h=e517a5e97080bbe52857bd0d7df9b66602d53c4d;hp=8082400327d8d2ca54254b593644942bed0edd25
|
||||
|
||||
agp/intel: Fix the pre-9xx chipset flush.
|
||||
|
||||
Ever since we enabled GEM, the pre-9xx chipsets (particularly 865) have had
|
||||
serious stability issues. Back in May a wbinvd was added to the DRM to
|
||||
work around much of the problem. Some failure remained -- easily visible
|
||||
by dragging a window around on an X -retro desktop, or by looking at bugzilla.
|
||||
|
||||
The chipset flush was on the right track -- hitting the right amount of
|
||||
memory, and it appears to be the only way to flush on these chipsets, but the
|
||||
flush page was mapped uncached. As a result, the writes trying to clear the
|
||||
writeback cache ended up bypassing the cache, and not flushing anything! The
|
||||
wbinvd would flush out other writeback data and often cause the data we wanted
|
||||
to get flushed, but not always. By removing the setting of the page to UC
|
||||
and instead just clflushing the data we write to try to flush it, we get the
|
||||
desired behavior with no wbinvd.
|
||||
|
||||
This exports clflush_cache_range(), which was laying around and happened to
|
||||
basically match the code I was otherwise going to copy from the DRM.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
|
||||
Cc: stable@kernel.org
|
||||
---
|
||||
|
||||
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
|
||||
index 7e600c1..5866b28 100644
|
||||
--- a/arch/x86/mm/pageattr.c
|
||||
+++ b/arch/x86/mm/pageattr.c
|
||||
@@ -143,6 +143,7 @@ void clflush_cache_range(void *vaddr, unsigned int size)
|
||||
|
||||
mb();
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(clflush_cache_range);
|
||||
|
||||
static void __cpa_flush_all(void *arg)
|
||||
{
|
||||
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
|
||||
index c172917..e8dc75f 100644
|
||||
--- a/drivers/char/agp/intel-agp.c
|
||||
+++ b/drivers/char/agp/intel-agp.c
|
||||
@@ -682,23 +682,39 @@ static void intel_i830_setup_flush(void)
|
||||
if (!intel_private.i8xx_page)
|
||||
return;
|
||||
|
||||
- /* make page uncached */
|
||||
- map_page_into_agp(intel_private.i8xx_page);
|
||||
-
|
||||
intel_private.i8xx_flush_page = kmap(intel_private.i8xx_page);
|
||||
if (!intel_private.i8xx_flush_page)
|
||||
intel_i830_fini_flush();
|
||||
}
|
||||
|
||||
+static void
|
||||
+do_wbinvd(void *null)
|
||||
+{
|
||||
+ wbinvd();
|
||||
+}
|
||||
+
|
||||
+/* The chipset_flush interface needs to get data that has already been
|
||||
+ * flushed out of the CPU all the way out to main memory, because the GPU
|
||||
+ * doesn't snoop those buffers.
|
||||
+ *
|
||||
+ * The 8xx series doesn't have the same lovely interface for flushing the
|
||||
+ * chipset write buffers that the later chips do. According to the 865
|
||||
+ * specs, it's 64 octwords, or 1KB. So, to get those previous things in
|
||||
+ * that buffer out, we just fill 1KB and clflush it out, on the assumption
|
||||
+ * that it'll push whatever was in there out. It appears to work.
|
||||
+ */
|
||||
static void intel_i830_chipset_flush(struct agp_bridge_data *bridge)
|
||||
{
|
||||
unsigned int *pg = intel_private.i8xx_flush_page;
|
||||
- int i;
|
||||
|
||||
- for (i = 0; i < 256; i += 2)
|
||||
- *(pg + i) = i;
|
||||
+ memset(pg, 0, 1024);
|
||||
|
||||
- wmb();
|
||||
+ if (cpu_has_clflush) {
|
||||
+ clflush_cache_range(pg, 1024);
|
||||
+ } else {
|
||||
+ if (on_each_cpu(do_wbinvd, NULL, 1) != 0)
|
||||
+ printk(KERN_ERR "Timed out waiting for cache flush.\n");
|
||||
+ }
|
||||
}
|
||||
|
||||
/* The intel i830 automatically initializes the agp aperture during POST.
|
||||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
|
||||
index f3758f9..30ea4b6 100644
|
||||
--- a/drivers/gpu/drm/i915/i915_gem.c
|
||||
+++ b/drivers/gpu/drm/i915/i915_gem.c
|
||||
@@ -2511,16 +2511,6 @@ i915_gem_clflush_object(struct drm_gem_object *obj)
|
||||
if (obj_priv->pages == NULL)
|
||||
return;
|
||||
|
||||
- /* XXX: The 865 in particular appears to be weird in how it handles
|
||||
- * cache flushing. We haven't figured it out, but the
|
||||
- * clflush+agp_chipset_flush doesn't appear to successfully get the
|
||||
- * data visible to the PGU, while wbinvd + agp_chipset_flush does.
|
||||
- */
|
||||
- if (IS_I865G(obj->dev)) {
|
||||
- wbinvd();
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
drm_clflush_pages(obj_priv->pages, obj->size / PAGE_SIZE);
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/drivers/staging/me4000/Kconfig b/drivers/staging/me4000/Kconfig
|
||||
index 5e6c9de..45d2ea9 100644
|
||||
--- a/drivers/staging/me4000/Kconfig
|
||||
+++ b/drivers/staging/me4000/Kconfig
|
||||
@@ -1,6 +1,7 @@
|
||||
config ME4000
|
||||
tristate "Meilhaus ME-4000 support"
|
||||
default n
|
||||
+ depends on BROKEN
|
||||
depends on PCI
|
||||
help
|
||||
This driver supports the Meilhaus ME-4000 family of boards
|
|
@ -1,11 +1,9 @@
|
|||
diff --git a/drivers/staging/rt2870/Kconfig b/drivers/staging/rt2870/Kconfig
|
||||
index 8398d97..cd4f0b6 100644
|
||||
--- a/drivers/staging/rt2870/Kconfig
|
||||
+++ b/drivers/staging/rt2870/Kconfig
|
||||
@@ -1,5 +1,6 @@
|
||||
config RT2870
|
||||
tristate "Ralink 2870 wireless support"
|
||||
tristate "Ralink 2870/3070 wireless support"
|
||||
+ depends on BROKEN
|
||||
depends on USB && X86 && WLAN_80211
|
||||
---help---
|
||||
This is an experimental driver for the Ralink 2870 wireless chip.
|
||||
This is an experimental driver for the Ralink xx70 wireless chips.
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
diff --git a/drivers/staging/rt3070/Kconfig b/drivers/staging/rt3070/Kconfig
|
||||
index b37fb5d..e414305 100644
|
||||
--- a/drivers/staging/rt3070/Kconfig
|
||||
+++ b/drivers/staging/rt3070/Kconfig
|
||||
@@ -1,5 +1,6 @@
|
||||
config RT3070
|
||||
tristate "Ralink 3070 wireless support"
|
||||
+ depends on BROKEN
|
||||
depends on USB && X86 && WLAN_80211
|
||||
---help---
|
||||
This is an experimental driver for the Ralink 3070 wireless chip.
|
|
@ -0,0 +1,9 @@
|
|||
--- a/drivers/staging/rt3090/Kconfig
|
||||
+++ b/drivers/staging/rt3090/Kconfig
|
||||
@@ -1,5 +1,6 @@
|
||||
config RT3090
|
||||
tristate "Ralink 3090 wireless support"
|
||||
+ depends on BROKEN
|
||||
depends on PCI && X86 && WLAN_80211
|
||||
---help---
|
||||
This is an experimental driver for the Ralink 3090 wireless chip.
|
|
@ -34,12 +34,6 @@ rm arch/powerpc/sysdev/micropatch.c
|
|||
|
||||
rm drivers/media/dvb/dvb-usb/af9005-script.h
|
||||
|
||||
rm drivers/gpu/drm/mga/mga_ucode.h
|
||||
|
||||
unifdef drivers/gpu/drm/r128/r128_cce.c -UREMOVE_DFSG
|
||||
|
||||
rm drivers/gpu/drm/radeon/*_microcode.h
|
||||
|
||||
rm drivers/infiniband/hw/ipath/ipath_sd7220_img.c
|
||||
|
||||
rm drivers/net/appletalk/cops.c
|
||||
|
@ -47,23 +41,21 @@ rm drivers/net/appletalk/cops.h
|
|||
rm drivers/net/appletalk/cops_ffdrv.h
|
||||
rm drivers/net/appletalk/cops_ltdrv.h
|
||||
|
||||
unifdef drivers/net/cxgb3/ael1002.c -UREMOVE_DFSG
|
||||
|
||||
rm drivers/staging/me4000/me*_firmware.h
|
||||
|
||||
rm drivers/staging/otus/hal/hp*fw*.c*
|
||||
|
||||
rm drivers/staging/rt2860/common/firmware.h
|
||||
|
||||
rm drivers/staging/rt2870/common/firmware.h
|
||||
|
||||
rm drivers/staging/rt3070/firmware.h
|
||||
|
||||
rm drivers/staging/rt3090/firmware.h
|
||||
|
||||
rm drivers/staging/rtl8192su/r8192S_FwImgDTM.h
|
||||
rm drivers/staging/rtl8192su/r8192SU_HWImg.c
|
||||
rm drivers/staging/rtl8192su/r819xU_firmware_img.c
|
||||
|
||||
rm drivers/staging/sxg/sxgphycode-1.2.h
|
||||
|
||||
rm drivers/staging/vt6656/firmware.c
|
||||
|
||||
rm sound/pci/cs46xx/cs46xx_image.h
|
||||
rm sound/pci/cs46xx/imgs
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
diff --git a/firmware/Makefile b/firmware/Makefile
|
||||
index 25200d1..c3a4fa8 100644
|
||||
--- a/firmware/Makefile
|
||||
+++ b/firmware/Makefile
|
||||
@@ -20,96 +20,11 @@ fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
|
||||
@@ -20,120 +20,13 @@ fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
|
||||
# accurate. In the latter case it doesn't matter -- it'll use $(fw-shipped-all).
|
||||
# But be aware that the config file might not be included at all.
|
||||
|
||||
|
@ -18,24 +16,48 @@ index 25200d1..c3a4fa8 100644
|
|||
- adaptec/starfire_tx.bin
|
||||
fw-shipped-$(CONFIG_ATARI_DSP56K) += dsp56k/bootstrap.bin
|
||||
-fw-shipped-$(CONFIG_ATM_AMBASSADOR) += atmsar11.fw
|
||||
-fw-shipped-$(CONFIG_BNX2X) += bnx2x-e1-4.8.53.0.fw bnx2x-e1h-4.8.53.0.fw
|
||||
-fw-shipped-$(CONFIG_BNX2) += bnx2/bnx2-mips-09-4.6.17.fw \
|
||||
- bnx2/bnx2-rv2p-09-4.6.15.fw \
|
||||
- bnx2/bnx2-mips-06-4.6.16.fw \
|
||||
- bnx2/bnx2-rv2p-06-4.6.16.fw
|
||||
-fw-shipped-$(CONFIG_BNX2X) += bnx2x-e1-5.0.21.0.fw bnx2x-e1h-5.0.21.0.fw
|
||||
-fw-shipped-$(CONFIG_BNX2) += bnx2/bnx2-mips-09-5.0.0.j3.fw \
|
||||
- bnx2/bnx2-rv2p-09-5.0.0.j3.fw \
|
||||
- bnx2/bnx2-rv2p-09ax-5.0.0.j3.fw \
|
||||
- bnx2/bnx2-mips-06-5.0.0.j3.fw \
|
||||
- bnx2/bnx2-rv2p-06-5.0.0.j3.fw
|
||||
-fw-shipped-$(CONFIG_CASSINI) += sun/cassini.bin
|
||||
-fw-shipped-$(CONFIG_COMPUTONE) += intelliport2.bin
|
||||
-fw-shipped-$(CONFIG_CHELSIO_T3) += cxgb3/t3b_psram-1.1.0.bin \
|
||||
- cxgb3/t3c_psram-1.1.0.bin \
|
||||
- cxgb3/t3fw-7.4.0.bin
|
||||
- cxgb3/t3fw-7.4.0.bin \
|
||||
- cxgb3/ael2005_opt_edc.bin \
|
||||
- cxgb3/ael2005_twx_edc.bin \
|
||||
- cxgb3/ael2020_twx_edc.bin
|
||||
-fw-shipped-$(CONFIG_DRM_MGA) += matrox/g200_warp.fw matrox/g400_warp.fw
|
||||
-fw-shipped-$(CONFIG_DRM_R128) += r128/r128_cce.bin
|
||||
-fw-shipped-$(CONFIG_DRM_RADEON) += radeon/R100_cp.bin radeon/R200_cp.bin \
|
||||
- radeon/R300_cp.bin radeon/R420_cp.bin \
|
||||
- radeon/RS690_cp.bin radeon/RS600_cp.bin \
|
||||
- radeon/R520_cp.bin \
|
||||
- radeon/R600_pfp.bin radeon/R600_me.bin \
|
||||
- radeon/RV610_pfp.bin radeon/RV610_me.bin \
|
||||
- radeon/RV630_pfp.bin radeon/RV630_me.bin \
|
||||
- radeon/RV620_pfp.bin radeon/RV620_me.bin \
|
||||
- radeon/RV635_pfp.bin radeon/RV635_me.bin \
|
||||
- radeon/RV670_pfp.bin radeon/RV670_me.bin \
|
||||
- radeon/RS780_pfp.bin radeon/RS780_me.bin \
|
||||
- radeon/RV770_pfp.bin radeon/RV770_me.bin \
|
||||
- radeon/RV730_pfp.bin radeon/RV730_me.bin \
|
||||
- radeon/RV710_pfp.bin radeon/RV710_me.bin
|
||||
fw-shipped-$(CONFIG_DVB_AV7110) += av7110/bootcode.bin
|
||||
-fw-shipped-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin
|
||||
-fw-shipped-$(CONFIG_E100) += e100/d101m_ucode.bin e100/d101s_ucode.bin \
|
||||
- e100/d102e_ucode.bin
|
||||
-fw-shipped-$(CONFIG_MYRI_SBUS) += myricom/lanai.bin
|
||||
fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis
|
||||
fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis cis/PCMLM28.cis \
|
||||
cis/DP83903.cis cis/NE2K.cis \
|
||||
cis/tamarack.cis
|
||||
-fw-shipped-$(CONFIG_PCMCIA_3C589) += cis/3CXEM556.cis
|
||||
-fw-shipped-$(CONFIG_PCMCIA_3C574) += cis/3CCFEM556.cis
|
||||
-fw-shipped-$(CONFIG_SERIAL_8250_CS) += cis/MT5634ZLX.cis cis/RS-COM-2P.cis \
|
||||
- cis/COMpad2.cis cis/COMpad4.cis
|
||||
-fw-shipped-$(CONFIG_PCMCIA_SMC91C92) += ositech/Xilinx7OD.bin
|
||||
-fw-shipped-$(CONFIG_SCSI_ADVANSYS) += advansys/mcode.bin advansys/38C1600.bin \
|
||||
- advansys/3550.bin advansys/38C0800.bin
|
||||
|
|
|
@ -2,12 +2,12 @@ diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
|
|||
index fa8c2dd..7936c57 100644
|
||||
--- a/scripts/kconfig/Makefile
|
||||
+++ b/scripts/kconfig/Makefile
|
||||
@@ -2,7 +2,7 @@
|
||||
# Kernel configuration targets
|
||||
@@ -3,7 +3,7 @@
|
||||
# These targets are used from top-level makefile
|
||||
|
||||
-PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
|
||||
+PHONY += oldconfig xconfig gconfig menuconfig config reportoldconfig silentoldconfig updateoldconfig update-po-config
|
||||
PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
|
||||
- localmodconfig localyesconfig
|
||||
+ localmodconfig localyesconfig reportoldconfig updateoldconfig
|
||||
|
||||
ifdef KBUILD_KCONFIG
|
||||
Kconfig := $(KBUILD_KCONFIG)
|
||||
|
@ -24,9 +24,9 @@ index fa8c2dd..7936c57 100644
|
|||
+updateoldconfig: $(obj)/conf
|
||||
+ $< -U $(Kconfig)
|
||||
+
|
||||
# Create new linux.pot file
|
||||
# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
|
||||
# The symlink is used to repair a deficiency in arch/um
|
||||
localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
|
||||
$(Q)perl $< $(Kconfig) > .tmp.config
|
||||
$(Q)if [ -f .config ]; then \
|
||||
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
|
||||
index 3e1057f..e526d00 100644
|
||||
--- a/scripts/kconfig/conf.c
|
||||
|
|
|
@ -41,7 +41,7 @@ diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
|
|||
index 82d0af4..d8e0d05 100755
|
||||
--- a/scripts/mkcompile_h
|
||||
+++ b/scripts/mkcompile_h
|
||||
@@ -47,15 +47,35 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
|
||||
@@ -47,19 +47,34 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
|
||||
echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
|
||||
|
||||
echo \#define LINUX_COMPILE_TIME \"`date +%T`\"
|
||||
|
@ -49,10 +49,15 @@ index 82d0af4..d8e0d05 100755
|
|||
- echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
|
||||
|
||||
- if [ -x /bin/dnsdomainname ]; then
|
||||
- echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
|
||||
- domain=`dnsdomainname 2> /dev/null`
|
||||
- elif [ -x /bin/domainname ]; then
|
||||
- echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
|
||||
- domain=`domainname 2> /dev/null`
|
||||
- fi
|
||||
-
|
||||
- if [ -n "$domain" ]; then
|
||||
- echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
|
||||
- else
|
||||
- echo \#define LINUX_COMPILE_DOMAIN
|
||||
+ DISTRIBUTION=$(lsb_release -is 2>/dev/null)
|
||||
+ DISTRIBUTION=${DISTRIBUTION:-Debian}
|
||||
+ echo \#define LINUX_COMPILE_DISTRIBUTION \"$DISTRIBUTION\"
|
||||
|
@ -63,7 +68,6 @@ index 82d0af4..d8e0d05 100755
|
|||
+ echo \#define LINUX_COMPILE_DISTRIBUTION_VERSION \"$DISTRIBUTION_VERSION\"
|
||||
+ echo \#define LINUX_COMPILE_BY \"unknown\"
|
||||
+ echo \#define LINUX_COMPILE_HOST \"$DISTRIBUTION\"
|
||||
echo \#define LINUX_COMPILE_DOMAIN
|
||||
+ else
|
||||
+ if [ -e version.$DISTRIBUTION ]; then
|
||||
+ echo \#define LINUX_COMPILE_DISTRIBUTION_VERSION \"$(cut -d" " -f1 version.$DISTRIBUTION)\"
|
||||
|
@ -83,4 +87,4 @@ index 82d0af4..d8e0d05 100755
|
|||
+ fi
|
||||
fi
|
||||
|
||||
echo \#define LINUX_COMPILER \"`LC_ALL=C LANG=C $CC -v 2>&1 | tail -n 1`\"
|
||||
echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
aufs2 kbuild patch for linux-2.6.31
|
||||
|
||||
Trivial update for 2.6.32 by Ben Hutchings <ben@decadent.org.uk>
|
||||
|
||||
diff --git a/fs/Kconfig b/fs/Kconfig
|
||||
index 0e7da7b..a4194da 100644
|
||||
--- a/fs/Kconfig
|
||||
+++ b/fs/Kconfig
|
||||
@@ -187,6 +187,7 @@ source "fs/sysv/Kconfig"
|
||||
source "fs/sysv/Kconfig"
|
||||
source "fs/ufs/Kconfig"
|
||||
source "fs/exofs/Kconfig"
|
||||
source "fs/nilfs2/Kconfig"
|
||||
+source "fs/aufs/Kconfig"
|
||||
|
||||
endif # MISC_FILESYSTEMS
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
aufs2 standalone patch for linux-2.6.31
|
||||
|
||||
Trivial update for 2.6.32 by Ben Hutchings <ben@decadent.org.uk>
|
||||
|
||||
diff --git a/fs/namei.c b/fs/namei.c
|
||||
index b49c2af..4521c70 100644
|
||||
--- a/fs/namei.c
|
||||
|
@ -46,7 +48,7 @@ index dd98e80..04b9aad 100644
|
|||
+++ b/fs/open.c
|
||||
@@ -221,6 +221,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
|
||||
mutex_unlock(&dentry->d_inode->i_mutex);
|
||||
return err;
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(do_truncate);
|
||||
|
||||
|
|
|
@ -1,277 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Subject: mga: Use request_firmware() to load microcode
|
||||
|
||||
Image format is IHEX, one record for each pipe in order (record
|
||||
addresses are ignored).
|
||||
|
||||
Compile-tested only.
|
||||
---
|
||||
drivers/gpu/drm/Kconfig | 2 +-
|
||||
drivers/gpu/drm/mga/mga_dma.c | 4 +-
|
||||
drivers/gpu/drm/mga/mga_drv.h | 1 -
|
||||
drivers/gpu/drm/mga/mga_warp.c | 180 +++++++++++++++++-----------------------
|
||||
include/drm/mga_drm.h | 2 +-
|
||||
5 files changed, 82 insertions(+), 107 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
|
||||
index 853814c..a61d10a 100644
|
||||
--- a/drivers/gpu/drm/Kconfig
|
||||
+++ b/drivers/gpu/drm/Kconfig
|
||||
@@ -81,7 +81,7 @@ endchoice
|
||||
config DRM_MGA
|
||||
tristate "Matrox g200/g400"
|
||||
depends on DRM
|
||||
- depends on BROKEN
|
||||
+ select FW_LOADER
|
||||
help
|
||||
Choose this option if you have a Matrox G200, G400 or G450 graphics
|
||||
card. If M is selected, the module will be called mga. AGP
|
||||
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
|
||||
index b49c5ff..7e0b106 100644
|
||||
--- a/drivers/gpu/drm/mga/mga_dma.c
|
||||
+++ b/drivers/gpu/drm/mga/mga_dma.c
|
||||
@@ -447,7 +447,7 @@ static int mga_do_agp_dma_bootstrap(struct drm_device * dev,
|
||||
{
|
||||
drm_mga_private_t *const dev_priv =
|
||||
(drm_mga_private_t *) dev->dev_private;
|
||||
- unsigned int warp_size = mga_warp_microcode_size(dev_priv);
|
||||
+ unsigned int warp_size = MGA_WARP_UCODE_SIZE;
|
||||
int err;
|
||||
unsigned offset;
|
||||
const unsigned secondary_size = dma_bs->secondary_bin_count
|
||||
@@ -622,7 +622,7 @@ static int mga_do_pci_dma_bootstrap(struct drm_device * dev,
|
||||
{
|
||||
drm_mga_private_t *const dev_priv =
|
||||
(drm_mga_private_t *) dev->dev_private;
|
||||
- unsigned int warp_size = mga_warp_microcode_size(dev_priv);
|
||||
+ unsigned int warp_size = MGA_WARP_UCODE_SIZE;
|
||||
unsigned int primary_size;
|
||||
unsigned int bin_count;
|
||||
int err;
|
||||
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h
|
||||
index 88257c2..9e40226 100644
|
||||
--- a/drivers/gpu/drm/mga/mga_drv.h
|
||||
+++ b/drivers/gpu/drm/mga/mga_drv.h
|
||||
@@ -177,7 +177,6 @@ extern void mga_do_dma_wrap_end(drm_mga_private_t * dev_priv);
|
||||
extern int mga_freelist_put(struct drm_device * dev, struct drm_buf * buf);
|
||||
|
||||
/* mga_warp.c */
|
||||
-extern unsigned int mga_warp_microcode_size(const drm_mga_private_t * dev_priv);
|
||||
extern int mga_warp_install_microcode(drm_mga_private_t * dev_priv);
|
||||
extern int mga_warp_init(drm_mga_private_t * dev_priv);
|
||||
|
||||
diff --git a/drivers/gpu/drm/mga/mga_warp.c b/drivers/gpu/drm/mga/mga_warp.c
|
||||
index 651b93c..9aad484 100644
|
||||
--- a/drivers/gpu/drm/mga/mga_warp.c
|
||||
+++ b/drivers/gpu/drm/mga/mga_warp.c
|
||||
@@ -27,132 +27,108 @@
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
+#include <linux/firmware.h>
|
||||
+#include <linux/ihex.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+
|
||||
#include "drmP.h"
|
||||
#include "drm.h"
|
||||
#include "mga_drm.h"
|
||||
#include "mga_drv.h"
|
||||
-#include "mga_ucode.h"
|
||||
+
|
||||
+#define FIRMWARE_G200 "matrox/g200_warp.fw"
|
||||
+#define FIRMWARE_G400 "matrox/g400_warp.fw"
|
||||
+
|
||||
+MODULE_FIRMWARE(FIRMWARE_G200);
|
||||
+MODULE_FIRMWARE(FIRMWARE_G400);
|
||||
|
||||
#define MGA_WARP_CODE_ALIGN 256 /* in bytes */
|
||||
|
||||
-#define WARP_UCODE_SIZE( which ) \
|
||||
- ((sizeof(which) / MGA_WARP_CODE_ALIGN + 1) * MGA_WARP_CODE_ALIGN)
|
||||
-
|
||||
-#define WARP_UCODE_INSTALL( which, where ) \
|
||||
-do { \
|
||||
- DRM_DEBUG( " pcbase = 0x%08lx vcbase = %p\n", pcbase, vcbase );\
|
||||
- dev_priv->warp_pipe_phys[where] = pcbase; \
|
||||
- memcpy( vcbase, which, sizeof(which) ); \
|
||||
- pcbase += WARP_UCODE_SIZE( which ); \
|
||||
- vcbase += WARP_UCODE_SIZE( which ); \
|
||||
-} while (0)
|
||||
-
|
||||
-static const unsigned int mga_warp_g400_microcode_size =
|
||||
- (WARP_UCODE_SIZE(warp_g400_tgz) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgza) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgzaf) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgzf) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgzs) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgzsa) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgzsaf) +
|
||||
- WARP_UCODE_SIZE(warp_g400_tgzsf) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gz) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gza) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gzaf) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gzf) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gzs) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gzsa) +
|
||||
- WARP_UCODE_SIZE(warp_g400_t2gzsaf) + WARP_UCODE_SIZE(warp_g400_t2gzsf));
|
||||
-
|
||||
-static const unsigned int mga_warp_g200_microcode_size =
|
||||
- (WARP_UCODE_SIZE(warp_g200_tgz) +
|
||||
- WARP_UCODE_SIZE(warp_g200_tgza) +
|
||||
- WARP_UCODE_SIZE(warp_g200_tgzaf) +
|
||||
- WARP_UCODE_SIZE(warp_g200_tgzf) +
|
||||
- WARP_UCODE_SIZE(warp_g200_tgzs) +
|
||||
- WARP_UCODE_SIZE(warp_g200_tgzsa) +
|
||||
- WARP_UCODE_SIZE(warp_g200_tgzsaf) + WARP_UCODE_SIZE(warp_g200_tgzsf));
|
||||
-
|
||||
-unsigned int mga_warp_microcode_size(const drm_mga_private_t * dev_priv)
|
||||
+#define WARP_UCODE_SIZE(size) ALIGN(size, MGA_WARP_CODE_ALIGN)
|
||||
+
|
||||
+int mga_warp_install_microcode(drm_mga_private_t * dev_priv)
|
||||
{
|
||||
+ unsigned char *vcbase = dev_priv->warp->handle;
|
||||
+ unsigned long pcbase = dev_priv->warp->offset;
|
||||
+ const char *firmware_name;
|
||||
+ struct platform_device *pdev;
|
||||
+ const struct firmware *fw = NULL;
|
||||
+ const struct ihex_binrec *rec;
|
||||
+ unsigned int size;
|
||||
+ int n_pipes, where;
|
||||
+ int rc = 0;
|
||||
+
|
||||
switch (dev_priv->chipset) {
|
||||
case MGA_CARD_TYPE_G400:
|
||||
case MGA_CARD_TYPE_G550:
|
||||
- return PAGE_ALIGN(mga_warp_g400_microcode_size);
|
||||
+ firmware_name = FIRMWARE_G400;
|
||||
+ n_pipes = MGA_MAX_G400_PIPES;
|
||||
+ break;
|
||||
case MGA_CARD_TYPE_G200:
|
||||
- return PAGE_ALIGN(mga_warp_g200_microcode_size);
|
||||
+ firmware_name = FIRMWARE_G200;
|
||||
+ n_pipes = MGA_MAX_G200_PIPES;
|
||||
+ break;
|
||||
default:
|
||||
- return 0;
|
||||
+ return -EINVAL;
|
||||
}
|
||||
-}
|
||||
-
|
||||
-static int mga_warp_install_g400_microcode(drm_mga_private_t * dev_priv)
|
||||
-{
|
||||
- unsigned char *vcbase = dev_priv->warp->handle;
|
||||
- unsigned long pcbase = dev_priv->warp->offset;
|
||||
-
|
||||
- memset(dev_priv->warp_pipe_phys, 0, sizeof(dev_priv->warp_pipe_phys));
|
||||
-
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgz, MGA_WARP_TGZ);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgzf, MGA_WARP_TGZF);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgza, MGA_WARP_TGZA);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgzaf, MGA_WARP_TGZAF);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgzs, MGA_WARP_TGZS);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgzsf, MGA_WARP_TGZSF);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgzsa, MGA_WARP_TGZSA);
|
||||
- WARP_UCODE_INSTALL(warp_g400_tgzsaf, MGA_WARP_TGZSAF);
|
||||
-
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gz, MGA_WARP_T2GZ);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gzf, MGA_WARP_T2GZF);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gza, MGA_WARP_T2GZA);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gzaf, MGA_WARP_T2GZAF);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gzs, MGA_WARP_T2GZS);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gzsf, MGA_WARP_T2GZSF);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gzsa, MGA_WARP_T2GZSA);
|
||||
- WARP_UCODE_INSTALL(warp_g400_t2gzsaf, MGA_WARP_T2GZSAF);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int mga_warp_install_g200_microcode(drm_mga_private_t * dev_priv)
|
||||
-{
|
||||
- unsigned char *vcbase = dev_priv->warp->handle;
|
||||
- unsigned long pcbase = dev_priv->warp->offset;
|
||||
-
|
||||
- memset(dev_priv->warp_pipe_phys, 0, sizeof(dev_priv->warp_pipe_phys));
|
||||
-
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgz, MGA_WARP_TGZ);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgzf, MGA_WARP_TGZF);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgza, MGA_WARP_TGZA);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgzaf, MGA_WARP_TGZAF);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgzs, MGA_WARP_TGZS);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgzsf, MGA_WARP_TGZSF);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgzsa, MGA_WARP_TGZSA);
|
||||
- WARP_UCODE_INSTALL(warp_g200_tgzsaf, MGA_WARP_TGZSAF);
|
||||
|
||||
- return 0;
|
||||
-}
|
||||
+ pdev = platform_device_register_simple("mga_warp", 0, NULL, 0);
|
||||
+ if (IS_ERR(pdev)) {
|
||||
+ DRM_ERROR("mga: Failed to register microcode\n");
|
||||
+ return PTR_ERR(pdev);
|
||||
+ }
|
||||
+ rc = request_ihex_firmware(&fw, firmware_name, &pdev->dev);
|
||||
+ platform_device_unregister(pdev);
|
||||
+ if (rc) {
|
||||
+ DRM_ERROR("mga: Failed to load microcode \"%s\"\n",
|
||||
+ firmware_name);
|
||||
+ return rc;
|
||||
+ }
|
||||
|
||||
-int mga_warp_install_microcode(drm_mga_private_t * dev_priv)
|
||||
-{
|
||||
- const unsigned int size = mga_warp_microcode_size(dev_priv);
|
||||
+ size = 0;
|
||||
+ where = 0;
|
||||
+ for (rec = (const struct ihex_binrec *)fw->data;
|
||||
+ rec;
|
||||
+ rec = ihex_next_binrec(rec)) {
|
||||
+ size += WARP_UCODE_SIZE(be16_to_cpu(rec->len));
|
||||
+ where++;
|
||||
+ }
|
||||
|
||||
+ if (where != n_pipes) {
|
||||
+ DRM_ERROR("mga: Invalid microcode \"%s\"\n", firmware_name);
|
||||
+ rc = -EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ size = PAGE_ALIGN(size);
|
||||
DRM_DEBUG("MGA ucode size = %d bytes\n", size);
|
||||
if (size > dev_priv->warp->size) {
|
||||
DRM_ERROR("microcode too large! (%u > %lu)\n",
|
||||
size, dev_priv->warp->size);
|
||||
- return -ENOMEM;
|
||||
+ rc = -ENOMEM;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
- switch (dev_priv->chipset) {
|
||||
- case MGA_CARD_TYPE_G400:
|
||||
- case MGA_CARD_TYPE_G550:
|
||||
- return mga_warp_install_g400_microcode(dev_priv);
|
||||
- case MGA_CARD_TYPE_G200:
|
||||
- return mga_warp_install_g200_microcode(dev_priv);
|
||||
- default:
|
||||
- return -EINVAL;
|
||||
+ memset(dev_priv->warp_pipe_phys, 0, sizeof(dev_priv->warp_pipe_phys));
|
||||
+
|
||||
+ where = 0;
|
||||
+ for (rec = (const struct ihex_binrec *)fw->data;
|
||||
+ rec;
|
||||
+ rec = ihex_next_binrec(rec)) {
|
||||
+ unsigned int src_size, dst_size;
|
||||
+
|
||||
+ DRM_DEBUG(" pcbase = 0x%08lx vcbase = %p\n", pcbase, vcbase);
|
||||
+ dev_priv->warp_pipe_phys[where] = pcbase;
|
||||
+ src_size = be16_to_cpu(rec->len);
|
||||
+ dst_size = WARP_UCODE_SIZE(src_size);
|
||||
+ memcpy(vcbase, rec->data, src_size);
|
||||
+ pcbase += dst_size;
|
||||
+ vcbase += dst_size;
|
||||
+ where++;
|
||||
}
|
||||
+
|
||||
+out:
|
||||
+ release_firmware(fw);
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
#define WMISC_EXPECTED (MGA_WUCODECACHE_ENABLE | MGA_WMASTER_ENABLE)
|
|
@ -1,139 +0,0 @@
|
|||
From 870bed4eea53fbaeb8f585fb9b89d23d9d8c2436 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Sat, 18 Oct 2008 02:27:57 +0100
|
||||
Subject: [PATCH 03/24] r128: Use request_firmware() to load CCE microcode
|
||||
|
||||
Firmware blob looks like this:
|
||||
__be32 datah
|
||||
__be32 datal
|
||||
|
||||
Compile-tested only.
|
||||
---
|
||||
drivers/gpu/drm/Kconfig | 2 +-
|
||||
drivers/gpu/drm/r128/r128_cce.c | 54 ++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 49 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
|
||||
index 725f244..e6f4401 100644
|
||||
--- a/drivers/gpu/drm/Kconfig
|
||||
+++ b/drivers/gpu/drm/Kconfig
|
||||
@@ -26,7 +26,7 @@ config DRM_TDFX
|
||||
config DRM_R128
|
||||
tristate "ATI Rage 128"
|
||||
depends on DRM && PCI
|
||||
- depends on BROKEN
|
||||
+ select FW_LOADER
|
||||
help
|
||||
Choose this option if you have an ATI Rage 128 graphics card. If M
|
||||
is selected, the module will be called r128. AGP support for
|
||||
diff --git a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
|
||||
index a9ee89a..63bed21 100644
|
||||
--- a/drivers/gpu/drm/r128/r128_cce.c
|
||||
+++ b/drivers/gpu/drm/r128/r128_cce.c
|
||||
@@ -29,6 +29,9 @@
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
+#include <linux/firmware.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+
|
||||
#include "drmP.h"
|
||||
#include "drm.h"
|
||||
#include "r128_drm.h"
|
||||
@@ -36,6 +39,9 @@
|
||||
|
||||
#define R128_FIFO_DEBUG 0
|
||||
|
||||
+#define FIRMWARE_NAME "r128/r128_cce.bin"
|
||||
+
|
||||
+MODULE_FIRMWARE(FIRMWARE_NAME);
|
||||
|
||||
static int R128_READ_PLL(struct drm_device * dev, int addr)
|
||||
{
|
||||
@@ -132,20 +138,50 @@ static int r128_do_wait_for_idle(drm_r128_private_t * dev_priv)
|
||||
*/
|
||||
|
||||
/* Load the microcode for the CCE */
|
||||
-static void r128_cce_load_microcode(drm_r128_private_t * dev_priv)
|
||||
+static int r128_cce_load_microcode(drm_r128_private_t *dev_priv)
|
||||
{
|
||||
- int i;
|
||||
+ struct platform_device *pdev;
|
||||
+ const struct firmware *fw;
|
||||
+ const __be32 *fw_data;
|
||||
+ int rc, i;
|
||||
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
+ pdev = platform_device_register_simple("r128_cce", 0, NULL, 0);
|
||||
+ if (IS_ERR(pdev)) {
|
||||
+ printk(KERN_ERR "r128_cce: Failed to register firmware\n");
|
||||
+ return PTR_ERR(pdev);
|
||||
+ }
|
||||
+ rc = request_firmware(&fw, FIRMWARE_NAME, &pdev->dev);
|
||||
+ platform_device_unregister(pdev);
|
||||
+ if (rc) {
|
||||
+ printk(KERN_ERR "r128_cce: Failed to load firmware \"%s\"\n",
|
||||
+ FIRMWARE_NAME);
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
+ if (fw->size != 256 * 8) {
|
||||
+ printk(KERN_ERR
|
||||
+ "r128_cce: Bogus length %zu in firmware \"%s\"\n",
|
||||
+ fw->size, FIRMWARE_NAME);
|
||||
+ rc = -EINVAL;
|
||||
+ goto out_release;
|
||||
+ }
|
||||
+
|
||||
r128_do_wait_for_idle(dev_priv);
|
||||
|
||||
+ fw_data = (const __be32 *)fw->data;
|
||||
R128_WRITE(R128_PM4_MICROCODE_ADDR, 0);
|
||||
for (i = 0; i < 256; i++) {
|
||||
- R128_WRITE(R128_PM4_MICROCODE_DATAH, r128_cce_microcode[i * 2]);
|
||||
+ R128_WRITE(R128_PM4_MICROCODE_DATAH,
|
||||
+ be32_to_cpup(&fw_data[i * 2]));
|
||||
R128_WRITE(R128_PM4_MICROCODE_DATAL,
|
||||
- r128_cce_microcode[i * 2 + 1]);
|
||||
+ be32_to_cpup(&fw_data[i * 2 + 1]));
|
||||
}
|
||||
+
|
||||
+out_release:
|
||||
+ release_firmware(fw);
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
/* Flush any pending commands to the CCE. This should only be used just
|
||||
@@ -306,6 +342,7 @@ static void r128_cce_init_ring_buffer(struct drm_device * dev,
|
||||
static int r128_do_init_cce(struct drm_device * dev, drm_r128_init_t * init)
|
||||
{
|
||||
drm_r128_private_t *dev_priv;
|
||||
+ int rc;
|
||||
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
@@ -532,13 +569,18 @@ static int r128_do_init_cce(struct drm_device * dev, drm_r128_init_t * init)
|
||||
#endif
|
||||
|
||||
r128_cce_init_ring_buffer(dev, dev_priv);
|
||||
- r128_cce_load_microcode(dev_priv);
|
||||
+ rc = r128_cce_load_microcode(dev_priv);
|
||||
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
|
||||
r128_do_engine_reset(dev);
|
||||
|
||||
- return 0;
|
||||
+ if (rc) {
|
||||
+ DRM_ERROR("Failed to load firmware!\n");
|
||||
+ r128_do_cleanup_cce(dev);
|
||||
+ }
|
||||
+
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
int r128_do_cleanup_cce(struct drm_device * dev)
|
||||
--
|
||||
1.6.1.3
|
||||
|
|
@ -1,562 +0,0 @@
|
|||
From fd63ae3af6c8ab1eeb658b501db2a5a593cdd353 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Sun, 12 Apr 2009 04:56:11 +0100
|
||||
Subject: [PATCH] radeon: Use request_firmware() to load CP microcode
|
||||
|
||||
Tested on Radeon 7500 (RV200) with and without firmware installed.
|
||||
---
|
||||
drivers/gpu/drm/Kconfig | 2 +-
|
||||
drivers/gpu/drm/radeon/r600_cp.c | 252 +++++++++++++++--------------------
|
||||
drivers/gpu/drm/radeon/radeon_cp.c | 121 +++++++++++------
|
||||
drivers/gpu/drm/radeon/radeon_drv.h | 5 +
|
||||
4 files changed, 188 insertions(+), 192 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
|
||||
index b0414ee..fb97c8a 100644
|
||||
--- a/drivers/gpu/drm/Kconfig
|
||||
+++ b/drivers/gpu/drm/Kconfig
|
||||
@@ -37,6 +37,6 @@ config DRM_R128
|
||||
config DRM_RADEON
|
||||
tristate "ATI Radeon"
|
||||
- depends on BROKEN
|
||||
depends on DRM && PCI
|
||||
+ select FW_LOADER
|
||||
select FB_CFB_FILLRECT
|
||||
select FB_CFB_COPYAREA
|
||||
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
|
||||
index bc9d09d..4620b1b 100644
|
||||
--- a/drivers/gpu/drm/radeon/r600_cp.c
|
||||
+++ b/drivers/gpu/drm/radeon/r600_cp.c
|
||||
@@ -31,7 +31,22 @@
|
||||
#include "radeon_drm.h"
|
||||
#include "radeon_drv.h"
|
||||
|
||||
-#include "r600_microcode.h"
|
||||
+#define PFP_UCODE_SIZE 576
|
||||
+#define PM4_UCODE_SIZE 1792
|
||||
+#define R700_PFP_UCODE_SIZE 848
|
||||
+#define R700_PM4_UCODE_SIZE 1360
|
||||
+
|
||||
+/* Firmware Names */
|
||||
+MODULE_FIRMWARE("radeon/R600_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV610_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV630_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV620_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV635_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV670_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RS780_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV770_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV730_cp.bin");
|
||||
+MODULE_FIRMWARE("radeon/RV710_cp.bin");
|
||||
|
||||
# define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */
|
||||
# define ATI_PCIGART_PAGE_MASK (~(ATI_PCIGART_PAGE_SIZE-1))
|
||||
@@ -275,11 +290,70 @@ static void r600_vm_init(struct drm_device *dev)
|
||||
r600_vm_flush_gart_range(dev);
|
||||
}
|
||||
|
||||
-/* load r600 microcode */
|
||||
+static int r600_cp_init_microcode(drm_radeon_private_t *dev_priv)
|
||||
+{
|
||||
+ struct platform_device *pdev;
|
||||
+ const char *chip_name;
|
||||
+ size_t required_size;
|
||||
+ char fw_name[30];
|
||||
+ int err;
|
||||
+
|
||||
+ pdev = platform_device_register_simple("r600_cp", 0, NULL, 0);
|
||||
+ err = IS_ERR(pdev);
|
||||
+ if (err) {
|
||||
+ printk(KERN_ERR "r600_cp: Failed to register firmware\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ switch (dev_priv->flags & RADEON_FAMILY_MASK) {
|
||||
+ case CHIP_R600: chip_name = "R600"; break;
|
||||
+ case CHIP_RV610: chip_name = "RV610"; break;
|
||||
+ case CHIP_RV630: chip_name = "RV630"; break;
|
||||
+ case CHIP_RV620: chip_name = "RV620"; break;
|
||||
+ case CHIP_RV635: chip_name = "RV635"; break;
|
||||
+ case CHIP_RV670: chip_name = "RV670"; break;
|
||||
+ case CHIP_RS780:
|
||||
+ case CHIP_RS880: chip_name = "RS780"; break;
|
||||
+ case CHIP_RV770: chip_name = "RV770"; break;
|
||||
+ case CHIP_RV740:
|
||||
+ case CHIP_RV730: chip_name = "RV730"; break;
|
||||
+ case CHIP_RV710: chip_name = "RV710"; break;
|
||||
+ default: BUG();
|
||||
+ }
|
||||
+
|
||||
+ if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV770)
|
||||
+ required_size = (R700_PM4_UCODE_SIZE * 4 +
|
||||
+ R700_PFP_UCODE_SIZE * 4);
|
||||
+ else
|
||||
+ required_size = PM4_UCODE_SIZE * 12 + PFP_UCODE_SIZE * 4;
|
||||
+
|
||||
+ DRM_INFO("Loading %s CP Microcode\n", chip_name);
|
||||
+ snprintf(fw_name, sizeof(fw_name), "radeon/%s_cp.bin", chip_name);
|
||||
+
|
||||
+ err = request_firmware(&dev_priv->fw, fw_name, &pdev->dev);
|
||||
+ platform_device_unregister(pdev);
|
||||
+ if (err) {
|
||||
+ printk(KERN_ERR "r600_cp: Failed to load firmware \"%s\"\n",
|
||||
+ fw_name);
|
||||
+ } else if (dev_priv->fw->size != required_size) {
|
||||
+ printk(KERN_ERR
|
||||
+ "r600_cp: Bogus length %zu in firmware \"%s\"\n",
|
||||
+ dev_priv->fw->size, fw_name);
|
||||
+ err = -EINVAL;
|
||||
+ release_firmware(dev_priv->fw);
|
||||
+ dev_priv->fw = NULL;
|
||||
+ }
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv)
|
||||
{
|
||||
+ const __be32 *fw_data;
|
||||
int i;
|
||||
|
||||
+ if (!dev_priv->fw)
|
||||
+ return;
|
||||
+
|
||||
r600_do_cp_stop(dev_priv);
|
||||
|
||||
RADEON_WRITE(R600_CP_RB_CNTL,
|
||||
@@ -292,115 +364,18 @@ static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv)
|
||||
DRM_UDELAY(15000);
|
||||
RADEON_WRITE(R600_GRBM_SOFT_RESET, 0);
|
||||
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
-
|
||||
- if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R600)) {
|
||||
- DRM_INFO("Loading R600 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- R600_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- R600_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- R600_cp_microcode[i][2]);
|
||||
- }
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading R600 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, R600_pfp_microcode[i]);
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610)) {
|
||||
- DRM_INFO("Loading RV610 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV610_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV610_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV610_cp_microcode[i][2]);
|
||||
- }
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV610 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV610_pfp_microcode[i]);
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV630)) {
|
||||
- DRM_INFO("Loading RV630 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV630_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV630_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV630_cp_microcode[i][2]);
|
||||
- }
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV630 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV630_pfp_microcode[i]);
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620)) {
|
||||
- DRM_INFO("Loading RV620 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV620_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV620_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV620_cp_microcode[i][2]);
|
||||
- }
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV620 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV620_pfp_microcode[i]);
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV635)) {
|
||||
- DRM_INFO("Loading RV635 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV635_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV635_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV635_cp_microcode[i][2]);
|
||||
- }
|
||||
+ fw_data = (const __be32 *)dev_priv->fw->data;
|
||||
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV635 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV635_pfp_microcode[i]);
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV670)) {
|
||||
- DRM_INFO("Loading RV670 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV670_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV670_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RV670_cp_microcode[i][2]);
|
||||
- }
|
||||
+ RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
+ for (i = 0; i < PM4_UCODE_SIZE * 3; i++)
|
||||
+ RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
+ be32_to_cpup(fw_data++));
|
||||
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV670 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]);
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
|
||||
- ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) {
|
||||
- DRM_INFO("Loading RS780/RS880 CP Microcode\n");
|
||||
- for (i = 0; i < PM4_UCODE_SIZE; i++) {
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RS780_cp_microcode[i][0]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RS780_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA,
|
||||
- RS780_cp_microcode[i][2]);
|
||||
- }
|
||||
+ RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
+ for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
+ RADEON_WRITE(R600_CP_PFP_UCODE_DATA,
|
||||
+ be32_to_cpup(fw_data++));
|
||||
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RS780/RS880 PFP Microcode\n");
|
||||
- for (i = 0; i < PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]);
|
||||
- }
|
||||
RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
RADEON_WRITE(R600_CP_ME_RAM_RADDR, 0);
|
||||
@@ -458,11 +434,14 @@ static void r700_vm_init(struct drm_device *dev)
|
||||
r600_vm_flush_gart_range(dev);
|
||||
}
|
||||
|
||||
-/* load r600 microcode */
|
||||
static void r700_cp_load_microcode(drm_radeon_private_t *dev_priv)
|
||||
{
|
||||
+ const __be32 *fw_data;
|
||||
int i;
|
||||
|
||||
+ if (!dev_priv->fw)
|
||||
+ return;
|
||||
+
|
||||
r600_do_cp_stop(dev_priv);
|
||||
|
||||
RADEON_WRITE(R600_CP_RB_CNTL,
|
||||
@@ -475,48 +454,18 @@ static void r700_cp_load_microcode(drm_radeon_private_t *dev_priv)
|
||||
DRM_UDELAY(15000);
|
||||
RADEON_WRITE(R600_GRBM_SOFT_RESET, 0);
|
||||
|
||||
+ fw_data = (const __be32 *)dev_priv->fw->data + R700_PM4_UCODE_SIZE;
|
||||
+ RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
+ for (i = 0; i < R700_PFP_UCODE_SIZE; i++)
|
||||
+ RADEON_WRITE(R600_CP_PFP_UCODE_DATA, be32_to_cpup(fw_data++));
|
||||
+ RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
|
||||
- if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV770)) {
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV770/RV790 PFP Microcode\n");
|
||||
- for (i = 0; i < R700_PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV770_pfp_microcode[i]);
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
- DRM_INFO("Loading RV770/RV790 CP Microcode\n");
|
||||
- for (i = 0; i < R700_PM4_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA, RV770_cp_microcode[i]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
-
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV730) ||
|
||||
- ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV740)) {
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV730/RV740 PFP Microcode\n");
|
||||
- for (i = 0; i < R700_PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV730_pfp_microcode[i]);
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
- DRM_INFO("Loading RV730/RV740 CP Microcode\n");
|
||||
- for (i = 0; i < R700_PM4_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA, RV730_cp_microcode[i]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
-
|
||||
- } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV710)) {
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
- DRM_INFO("Loading RV710 PFP Microcode\n");
|
||||
- for (i = 0; i < R700_PFP_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV710_pfp_microcode[i]);
|
||||
- RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
-
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
- DRM_INFO("Loading RV710 CP Microcode\n");
|
||||
- for (i = 0; i < R700_PM4_UCODE_SIZE; i++)
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_DATA, RV710_cp_microcode[i]);
|
||||
- RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
+ fw_data = (const __be32 *)dev_priv->fw->data;
|
||||
+ RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
+ for (i = 0; i < R700_PM4_UCODE_SIZE; i++)
|
||||
+ RADEON_WRITE(R600_CP_ME_RAM_DATA, be32_to_cpup(fw_data++));
|
||||
+ RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
|
||||
- }
|
||||
RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
|
||||
RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0);
|
||||
RADEON_WRITE(R600_CP_ME_RAM_RADDR, 0);
|
||||
@@ -2107,6 +2057,14 @@ int r600_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
|
||||
r600_vm_init(dev);
|
||||
}
|
||||
|
||||
+ if (!dev_priv->fw) {
|
||||
+ int err = r600_cp_init_microcode(dev_priv);
|
||||
+ if (err) {
|
||||
+ DRM_ERROR("Failed to load firmware!\n");
|
||||
+ r600_do_cleanup_cp(dev);
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
if (((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV770))
|
||||
r700_cp_load_microcode(dev_priv);
|
||||
else
|
||||
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
|
||||
index 77a7a4d..e9894ac 100644
|
||||
--- a/drivers/gpu/drm/radeon/radeon_cp.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
|
||||
@@ -36,10 +36,25 @@
|
||||
#include "radeon_drv.h"
|
||||
#include "r300_reg.h"
|
||||
|
||||
-#include "radeon_microcode.h"
|
||||
-
|
||||
#define RADEON_FIFO_DEBUG 0
|
||||
|
||||
+/* Firmware Names */
|
||||
+#define FIRMWARE_R100 "radeon/R100_cp.bin"
|
||||
+#define FIRMWARE_R200 "radeon/R200_cp.bin"
|
||||
+#define FIRMWARE_R300 "radeon/R300_cp.bin"
|
||||
+#define FIRMWARE_R420 "radeon/R420_cp.bin"
|
||||
+#define FIRMWARE_RS690 "radeon/RS690_cp.bin"
|
||||
+#define FIRMWARE_RS600 "radeon/RS600_cp.bin"
|
||||
+#define FIRMWARE_R520 "radeon/R520_cp.bin"
|
||||
+
|
||||
+MODULE_FIRMWARE(FIRMWARE_R100);
|
||||
+MODULE_FIRMWARE(FIRMWARE_R200);
|
||||
+MODULE_FIRMWARE(FIRMWARE_R300);
|
||||
+MODULE_FIRMWARE(FIRMWARE_R420);
|
||||
+MODULE_FIRMWARE(FIRMWARE_RS690);
|
||||
+MODULE_FIRMWARE(FIRMWARE_RS600);
|
||||
+MODULE_FIRMWARE(FIRMWARE_R520);
|
||||
+
|
||||
static int radeon_do_cleanup_cp(struct drm_device * dev);
|
||||
static void radeon_do_cp_start(drm_radeon_private_t * dev_priv);
|
||||
|
||||
@@ -451,37 +466,34 @@ static void radeon_init_pipes(drm_radeon_private_t *dev_priv)
|
||||
*/
|
||||
|
||||
/* Load the microcode for the CP */
|
||||
-static void radeon_cp_load_microcode(drm_radeon_private_t * dev_priv)
|
||||
+static int radeon_cp_init_microcode(drm_radeon_private_t *dev_priv)
|
||||
{
|
||||
- int i;
|
||||
+ struct platform_device *pdev;
|
||||
+ const char *fw_name = NULL;
|
||||
+ int err;
|
||||
+
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
- radeon_do_wait_for_idle(dev_priv);
|
||||
+ pdev = platform_device_register_simple("radeon_cp", 0, NULL, 0);
|
||||
+ err = IS_ERR(pdev);
|
||||
+ if (err) {
|
||||
+ printk(KERN_ERR "radeon_cp: Failed to register firmware\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0);
|
||||
if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R100) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV100) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV200) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS100) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS200)) {
|
||||
DRM_INFO("Loading R100 Microcode\n");
|
||||
- for (i = 0; i < 256; i++) {
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- R100_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- R100_cp_microcode[i][0]);
|
||||
- }
|
||||
+ fw_name = FIRMWARE_R100;
|
||||
} else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R200) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV250) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV280) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS300)) {
|
||||
DRM_INFO("Loading R200 Microcode\n");
|
||||
- for (i = 0; i < 256; i++) {
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- R200_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- R200_cp_microcode[i][0]);
|
||||
- }
|
||||
+ fw_name = FIRMWARE_R200;
|
||||
} else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R300) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R350) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV350) ||
|
||||
@@ -489,39 +501,19 @@ static void radeon_cp_load_microcode(drm_radeon_private_t * dev_priv)
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS400) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS480)) {
|
||||
DRM_INFO("Loading R300 Microcode\n");
|
||||
- for (i = 0; i < 256; i++) {
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- R300_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- R300_cp_microcode[i][0]);
|
||||
- }
|
||||
+ fw_name = FIRMWARE_R300;
|
||||
} else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R423) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV410)) {
|
||||
DRM_INFO("Loading R400 Microcode\n");
|
||||
- for (i = 0; i < 256; i++) {
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- R420_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- R420_cp_microcode[i][0]);
|
||||
- }
|
||||
+ fw_name = FIRMWARE_R420;
|
||||
} else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS740)) {
|
||||
DRM_INFO("Loading RS690/RS740 Microcode\n");
|
||||
- for (i = 0; i < 256; i++) {
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- RS690_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- RS690_cp_microcode[i][0]);
|
||||
- }
|
||||
+ fw_name = FIRMWARE_RS690;
|
||||
} else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS600) {
|
||||
DRM_INFO("Loading RS600 Microcode\n");
|
||||
- for (i = 0; i < 256; i++) {
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- RS600_cp_microcode[i][1]);
|
||||
- RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- RS600_cp_microcode[i][0]);
|
||||
- }
|
||||
+ fw_name = FIRMWARE_RS600;
|
||||
} else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R520) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) ||
|
||||
@@ -529,11 +521,40 @@ static void radeon_cp_load_microcode(drm_radeon_private_t * dev_priv)
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV560) ||
|
||||
((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV570)) {
|
||||
DRM_INFO("Loading R500 Microcode\n");
|
||||
+ fw_name = FIRMWARE_R520;
|
||||
+ }
|
||||
+
|
||||
+ err = request_firmware(&dev_priv->fw, fw_name, &pdev->dev);
|
||||
+ platform_device_unregister(pdev);
|
||||
+ if (err) {
|
||||
+ printk(KERN_ERR "radeon_cp: Failed to load firmware \"%s\"\n",
|
||||
+ fw_name);
|
||||
+ } else if (dev_priv->fw->size != 256 * 8) {
|
||||
+ printk(KERN_ERR
|
||||
+ "radeon_cp: Bogus length %zu in firmware \"%s\"\n",
|
||||
+ dev_priv->fw->size, fw_name);
|
||||
+ err = -EINVAL;
|
||||
+ release_firmware(dev_priv->fw);
|
||||
+ dev_priv->fw = NULL;
|
||||
+ }
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static void radeon_cp_load_microcode(drm_radeon_private_t *dev_priv)
|
||||
+{
|
||||
+ const __be32 *fw_data;
|
||||
+ int i;
|
||||
+
|
||||
+ radeon_do_wait_for_idle(dev_priv);
|
||||
+
|
||||
+ if (dev_priv->fw) {
|
||||
+ fw_data = (const __be32 *)&dev_priv->fw->data[0];
|
||||
+ RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0);
|
||||
for (i = 0; i < 256; i++) {
|
||||
RADEON_WRITE(RADEON_CP_ME_RAM_DATAH,
|
||||
- R520_cp_microcode[i][1]);
|
||||
+ be32_to_cpup(fw_data++));
|
||||
RADEON_WRITE(RADEON_CP_ME_RAM_DATAL,
|
||||
- R520_cp_microcode[i][0]);
|
||||
+ be32_to_cpup(fw_data++));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1486,6 +1507,14 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
|
||||
radeon_set_pcigart(dev_priv, 1);
|
||||
}
|
||||
|
||||
+ if (!dev_priv->fw) {
|
||||
+ int err = radeon_cp_init_microcode(dev_priv);
|
||||
+ if (err) {
|
||||
+ DRM_ERROR("Failed to load firmware!\n");
|
||||
+ radeon_do_cleanup_cp(dev);
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
radeon_cp_load_microcode(dev_priv);
|
||||
radeon_cp_init_ring_buffer(dev, dev_priv, file_priv);
|
||||
|
||||
@@ -1755,6 +1784,10 @@ void radeon_do_release(struct drm_device * dev)
|
||||
r600_do_cleanup_cp(dev);
|
||||
else
|
||||
radeon_do_cleanup_cp(dev);
|
||||
+ if (dev_priv->fw) {
|
||||
+ release_firmware(dev_priv->fw);
|
||||
+ dev_priv->fw = NULL;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
|
||||
index ed4d27e..829eefa 100644
|
||||
--- a/drivers/gpu/drm/radeon/radeon_drv.h
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_drv.h
|
||||
@@ -31,6 +31,9 @@
|
||||
#ifndef __RADEON_DRV_H__
|
||||
#define __RADEON_DRV_H__
|
||||
|
||||
+#include <linux/firmware.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+
|
||||
/* General customization:
|
||||
*/
|
||||
|
||||
@@ -348,6 +351,8 @@ typedef struct drm_radeon_private {
|
||||
int r700_sc_hiz_tile_fifo_size;
|
||||
int r700_sc_earlyz_tile_fifo_fize;
|
||||
|
||||
+ /* firmware */
|
||||
+ const struct firmware *fw;
|
||||
} drm_radeon_private_t;
|
||||
|
||||
typedef struct drm_radeon_buf_priv {
|
||||
--
|
||||
1.5.6.5
|
||||
|
|
@ -1,213 +0,0 @@
|
|||
From 70824840b09935e8df8cc9123f1c09400e00b7b5 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Thu, 9 Jul 2009 00:25:04 +0100
|
||||
Subject: [PATCH 3/3] cxgb3: Use request_firmware() for EDC PHY code
|
||||
|
||||
Adapted from work by Divy Le Ray <divy@chelsio.com>.
|
||||
---
|
||||
drivers/net/Kconfig | 1 -
|
||||
drivers/net/cxgb3/adapter.h | 2 +
|
||||
drivers/net/cxgb3/ael1002.c | 40 +++++++++++++++++------
|
||||
drivers/net/cxgb3/common.h | 10 ++++++
|
||||
drivers/net/cxgb3/cxgb3_main.c | 69 ++++++++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 111 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
|
||||
index 183479d..c155bd3 100644
|
||||
--- a/drivers/net/Kconfig
|
||||
+++ b/drivers/net/Kconfig
|
||||
@@ -2511,7 +2511,6 @@ config CHELSIO_T3_DEPENDS
|
||||
|
||||
config CHELSIO_T3
|
||||
tristate "Chelsio Communications T3 10Gb Ethernet support"
|
||||
- depends on BROKEN
|
||||
depends on CHELSIO_T3_DEPENDS
|
||||
select FW_LOADER
|
||||
select MDIO
|
||||
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
|
||||
index 1694fad..9241c88 100644
|
||||
--- a/drivers/net/cxgb3/adapter.h
|
||||
+++ b/drivers/net/cxgb3/adapter.h
|
||||
@@ -312,4 +312,6 @@ int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
|
||||
unsigned char *data);
|
||||
irqreturn_t t3_sge_intr_msix(int irq, void *cookie);
|
||||
|
||||
+int t3_get_edc_fw(struct cphy *phy, int edc_idx, int size);
|
||||
+
|
||||
#endif /* __T3_ADAPTER_H__ */
|
||||
diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c
|
||||
index 7b0d445..5a4ff80 100644
|
||||
--- a/drivers/net/cxgb3/ael1002.c
|
||||
+++ b/drivers/net/cxgb3/ael1002.c
|
||||
@@ -312,9 +312,16 @@ static int ael2005_setup_sr_edc(struct cphy *phy)
|
||||
|
||||
msleep(50);
|
||||
|
||||
- for (i = 0; i < ARRAY_SIZE(sr_edc) && !err; i += 2)
|
||||
- err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, sr_edc[i],
|
||||
- sr_edc[i + 1]);
|
||||
+ if (phy->priv != edc_sr)
|
||||
+ err = t3_get_edc_fw(phy, EDC_OPT_AEL2005,
|
||||
+ EDC_OPT_AEL2005_SIZE);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ for (i = 0; i < EDC_OPT_AEL2005_SIZE / sizeof(u16) && !err; i += 2)
|
||||
+ err = t3_mdio_write(phy, MDIO_MMD_PMAPMD,
|
||||
+ phy->phy_cache[i],
|
||||
+ phy->phy_cache[i + 1]);
|
||||
if (!err)
|
||||
phy->priv = edc_sr;
|
||||
return err;
|
||||
@@ -341,9 +348,16 @@ static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype)
|
||||
|
||||
msleep(50);
|
||||
|
||||
- for (i = 0; i < ARRAY_SIZE(twinax_edc) && !err; i += 2)
|
||||
- err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, twinax_edc[i],
|
||||
- twinax_edc[i + 1]);
|
||||
+ if (phy->priv != edc_twinax)
|
||||
+ err = t3_get_edc_fw(phy, EDC_TWX_AEL2005,
|
||||
+ EDC_TWX_AEL2005_SIZE);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ for (i = 0; i < EDC_TWX_AEL2005_SIZE / sizeof(u16) && !err; i += 2)
|
||||
+ err = t3_mdio_write(phy, MDIO_MMD_PMAPMD,
|
||||
+ phy->phy_cache[i],
|
||||
+ phy->phy_cache[i + 1]);
|
||||
if (!err)
|
||||
phy->priv = edc_twinax;
|
||||
return err;
|
||||
@@ -573,10 +587,16 @@ static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- /* write TWINAX EDC firmware into PHY */
|
||||
- for (i = 0; i < ARRAY_SIZE(twinax_edc) && !err; i += 2)
|
||||
- err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, twinax_edc[i],
|
||||
- twinax_edc[i + 1]);
|
||||
+ if (phy->priv != edc_twinax)
|
||||
+ err = t3_get_edc_fw(phy, EDC_TWX_AEL2020,
|
||||
+ EDC_TWX_AEL2020_SIZE);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ for (i = 0; i < EDC_TWX_AEL2020_SIZE / sizeof(u16) && !err; i += 2)
|
||||
+ err = t3_mdio_write(phy, MDIO_MMD_PMAPMD,
|
||||
+ phy->phy_cache[i],
|
||||
+ phy->phy_cache[i + 1]);
|
||||
/* activate uC */
|
||||
err = set_phy_regs(phy, uCactivate);
|
||||
if (!err)
|
||||
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
|
||||
index d21b705..1b2c305 100644
|
||||
--- a/drivers/net/cxgb3/common.h
|
||||
+++ b/drivers/net/cxgb3/common.h
|
||||
@@ -566,6 +566,15 @@ struct cphy_ops {
|
||||
|
||||
u32 mmds;
|
||||
};
|
||||
+enum {
|
||||
+ EDC_OPT_AEL2005 = 0,
|
||||
+ EDC_OPT_AEL2005_SIZE = 1084,
|
||||
+ EDC_TWX_AEL2005 = 1,
|
||||
+ EDC_TWX_AEL2005_SIZE = 1464,
|
||||
+ EDC_TWX_AEL2020 = 2,
|
||||
+ EDC_TWX_AEL2020_SIZE = 1628,
|
||||
+ EDC_MAX_SIZE = EDC_TWX_AEL2020_SIZE, /* Max cache size */
|
||||
+};
|
||||
|
||||
/* A PHY instance */
|
||||
struct cphy {
|
||||
@@ -577,6 +586,7 @@ struct cphy {
|
||||
unsigned long fifo_errors; /* FIFO over/under-flows */
|
||||
const struct cphy_ops *ops; /* PHY operations */
|
||||
struct mdio_if_info mdio;
|
||||
+ u16 phy_cache[EDC_MAX_SIZE]; /* EDC cache */
|
||||
};
|
||||
|
||||
/* Convenience MDIO read/write wrappers */
|
||||
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
|
||||
index 538dda4..27e7ef5 100644
|
||||
--- a/drivers/net/cxgb3/cxgb3_main.c
|
||||
+++ b/drivers/net/cxgb3/cxgb3_main.c
|
||||
@@ -964,6 +964,75 @@ static int bind_qsets(struct adapter *adap)
|
||||
|
||||
#define FW_FNAME "cxgb3/t3fw-%d.%d.%d.bin"
|
||||
#define TPSRAM_NAME "cxgb3/t3%c_psram-%d.%d.%d.bin"
|
||||
+#define AEL2005_OPT_EDC_NAME "cxgb3/ael2005_opt_edc.bin"
|
||||
+#define AEL2005_TWX_EDC_NAME "cxgb3/ael2005_twx_edc.bin"
|
||||
+#define AEL2020_TWX_EDC_NAME "cxgb3/ael2020_twx_edc.bin"
|
||||
+
|
||||
+static inline const char *get_edc_fw_name(int edc_idx)
|
||||
+{
|
||||
+ const char *fw_name = NULL;
|
||||
+
|
||||
+ switch (edc_idx) {
|
||||
+ case EDC_OPT_AEL2005:
|
||||
+ fw_name = AEL2005_OPT_EDC_NAME;
|
||||
+ break;
|
||||
+ case EDC_TWX_AEL2005:
|
||||
+ fw_name = AEL2005_TWX_EDC_NAME;
|
||||
+ break;
|
||||
+ case EDC_TWX_AEL2020:
|
||||
+ fw_name = AEL2020_TWX_EDC_NAME;
|
||||
+ break;
|
||||
+ }
|
||||
+ return fw_name;
|
||||
+}
|
||||
+
|
||||
+int t3_get_edc_fw(struct cphy *phy, int edc_idx, int size)
|
||||
+{
|
||||
+ struct adapter *adapter = phy->adapter;
|
||||
+ const struct firmware *fw;
|
||||
+ char buf[64];
|
||||
+ u32 csum;
|
||||
+ const __be32 *p;
|
||||
+ u16 *cache = phy->phy_cache;
|
||||
+ int i, ret;
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf), get_edc_fw_name(edc_idx));
|
||||
+
|
||||
+ ret = request_firmware(&fw, buf, &adapter->pdev->dev);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&adapter->pdev->dev,
|
||||
+ "could not upgrade firmware: unable to load %s\n",
|
||||
+ buf);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ /* check size, take checksum in account */
|
||||
+ if (fw->size > size + 4) {
|
||||
+ CH_ERR(adapter, "firmware image too large %u, expected %d\n",
|
||||
+ (unsigned int)fw->size, size + 4);
|
||||
+ ret = -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ /* compute checksum */
|
||||
+ p = (const __be32 *)fw->data;
|
||||
+ for (csum = 0, i = 0; i < fw->size / sizeof(csum); i++)
|
||||
+ csum += ntohl(p[i]);
|
||||
+
|
||||
+ if (csum != 0xffffffff) {
|
||||
+ CH_ERR(adapter, "corrupted firmware image, checksum %u\n",
|
||||
+ csum);
|
||||
+ ret = -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < size / 4 ; i++) {
|
||||
+ *cache++ = (be32_to_cpu(p[i]) & 0xffff0000) >> 16;
|
||||
+ *cache++ = be32_to_cpu(p[i]) & 0xffff;
|
||||
+ }
|
||||
+
|
||||
+ release_firmware(fw);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
|
||||
static int upgrade_fw(struct adapter *adap)
|
||||
{
|
||||
--
|
||||
1.6.3.3
|
||||
|
|
@ -1,18 +1,9 @@
|
|||
From a504b7009265d58543dcb3446421da51424241d4 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Sun, 28 Jun 2009 15:51:07 +0100
|
||||
Subject: [PATCH] rt2860/2870/3070: use the firmware loader interface and library CRC code
|
||||
|
||||
Based on work by Darren Salt <linux@youmustbejoking.demon.co.uk>.
|
||||
---
|
||||
drivers/staging/rt2860/Kconfig | 3 +-
|
||||
drivers/staging/rt2860/common/rtmp_init.c | 159 ++++++++++++-----------------
|
||||
drivers/staging/rt2870/Kconfig | 3 +-
|
||||
drivers/staging/rt3070/Kconfig | 3 +-
|
||||
4 files changed, 70 insertions(+), 98 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/rt2860/Kconfig b/drivers/staging/rt2860/Kconfig
|
||||
index 9fb130d..d75a87a 100644
|
||||
--- a/drivers/staging/rt2860/Kconfig
|
||||
+++ b/drivers/staging/rt2860/Kconfig
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -24,91 +15,24 @@ index 9fb130d..d75a87a 100644
|
|||
+ select FW_LOADER
|
||||
---help---
|
||||
This is an experimental driver for the Ralink 2860 wireless chip.
|
||||
diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c
|
||||
index 004f530..f34011c 100644
|
||||
--- a/drivers/staging/rt2860/common/rtmp_init.c
|
||||
+++ b/drivers/staging/rt2860/common/rtmp_init.c
|
||||
@@ -38,18 +38,8 @@
|
||||
@@ -38,14 +38,7 @@
|
||||
Jan Lee 2006-09-15 RT2860. Change for 802.11n , EEPROM, Led, BA, HT.
|
||||
*/
|
||||
#include "../rt_config.h"
|
||||
-#ifndef RT30xx
|
||||
-#ifdef RT2860
|
||||
-#include "firmware.h"
|
||||
-#include <linux/bitrev.h>
|
||||
-#endif
|
||||
-#ifdef RT2870
|
||||
-#include "../../rt2870/common/firmware.h"
|
||||
-#endif
|
||||
-#endif
|
||||
-#ifdef RT30xx
|
||||
-/* New firmware handles both RT2870 and RT3070. */
|
||||
-#include "../../rt3070/firmware.h"
|
||||
-#endif
|
||||
+#include <linux/firmware.h>
|
||||
+#include <linux/crc-ccitt.h>
|
||||
|
||||
UCHAR BIT8[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
|
||||
ULONG BIT32[] = {0x00000001, 0x00000002, 0x00000004, 0x00000008,
|
||||
@@ -63,59 +53,6 @@ ULONG BIT32[] = {0x00000001, 0x00000002, 0x00000004, 0x00000008,
|
||||
|
||||
char* CipherName[] = {"none","wep64","wep128","TKIP","AES","CKIP64","CKIP128"};
|
||||
|
||||
-const unsigned short ccitt_16Table[] = {
|
||||
- 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
|
||||
- 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
|
||||
- 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
|
||||
- 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
|
||||
- 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
|
||||
- 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
|
||||
- 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
|
||||
- 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
|
||||
- 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
|
||||
- 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
|
||||
- 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
|
||||
- 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
|
||||
- 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
|
||||
- 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
|
||||
- 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
|
||||
- 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
|
||||
- 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
|
||||
- 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
|
||||
- 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
|
||||
- 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
|
||||
- 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
|
||||
- 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
||||
- 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
|
||||
- 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
|
||||
- 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
|
||||
- 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
|
||||
- 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
|
||||
- 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
|
||||
- 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
|
||||
- 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
|
||||
- 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
|
||||
- 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
|
||||
-};
|
||||
-#define ByteCRC16(v, crc) \
|
||||
- (unsigned short)((crc << 8) ^ ccitt_16Table[((crc >> 8) ^ (v)) & 255])
|
||||
-
|
||||
-#ifdef RT2870
|
||||
-unsigned char BitReverse(unsigned char x)
|
||||
-{
|
||||
- int i;
|
||||
- unsigned char Temp=0;
|
||||
- for(i=0; ; i++)
|
||||
- {
|
||||
- if(x & 0x80) Temp |= 0x80;
|
||||
- if(i==7) break;
|
||||
- x <<= 1;
|
||||
- Temp >>= 1;
|
||||
- }
|
||||
- return Temp;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
//
|
||||
// BBP register initialization set
|
||||
//
|
||||
@@ -243,12 +180,14 @@ RTMP_REG_PAIR STAMACRegTable[] = {
|
||||
// RT2870 Firmware Spec only used 1 oct for version expression
|
||||
//
|
||||
|
@ -245,34 +169,27 @@ index 004f530..f34011c 100644
|
|||
} /* End of NICLoadFirmware */
|
||||
|
||||
|
||||
diff --git a/drivers/staging/rt2870/Kconfig b/drivers/staging/rt2870/Kconfig
|
||||
index cd4f0b6..59d533d 100644
|
||||
--- a/drivers/staging/rt2870/Kconfig
|
||||
+++ b/drivers/staging/rt2870/Kconfig
|
||||
@@ -1,7 +1,8 @@
|
||||
config RT2870
|
||||
tristate "Ralink 2870 wireless support"
|
||||
tristate "Ralink 2870/3070 wireless support"
|
||||
- depends on BROKEN
|
||||
depends on USB && X86 && WLAN_80211
|
||||
+ select CRC_CCITT
|
||||
+ select FW_LOADER
|
||||
---help---
|
||||
This is an experimental driver for the Ralink 2870 wireless chip.
|
||||
This is an experimental driver for the Ralink xx70 wireless chips.
|
||||
|
||||
diff --git a/drivers/staging/rt3070/Kconfig b/drivers/staging/rt3070/Kconfig
|
||||
index e414305..7242d5e 100644
|
||||
--- a/drivers/staging/rt3070/Kconfig
|
||||
+++ b/drivers/staging/rt3070/Kconfig
|
||||
--- a/drivers/staging/rt3090/Kconfig
|
||||
+++ b/drivers/staging/rt3090/Kconfig
|
||||
@@ -1,7 +1,8 @@
|
||||
config RT3070
|
||||
tristate "Ralink 3070 wireless support"
|
||||
config RT3090
|
||||
tristate "Ralink 3090 wireless support"
|
||||
- depends on BROKEN
|
||||
depends on USB && X86 && WLAN_80211
|
||||
depends on PCI && X86 && WLAN_80211
|
||||
+ select CRC_CCITT
|
||||
+ select FW_LOADER
|
||||
---help---
|
||||
This is an experimental driver for the Ralink 3070 wireless chip.
|
||||
This is an experimental driver for the Ralink 3090 wireless chip.
|
||||
|
||||
--
|
||||
1.6.3.1
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ Subject: [PATCH] speakup: integrate into kbuild
|
|||
--- a/drivers/staging/Kconfig
|
||||
+++ b/drivers/staging/Kconfig
|
||||
@@ -126,6 +126,8 @@
|
||||
source "drivers/staging/pata_rdc/Kconfig"
|
||||
source "drivers/staging/sep/Kconfig"
|
||||
|
||||
source "drivers/staging/udlfb/Kconfig"
|
||||
source "drivers/staging/iio/Kconfig"
|
||||
+
|
||||
+source "drivers/staging/speakup/Kconfig"
|
||||
|
||||
|
@ -15,9 +15,9 @@ Subject: [PATCH] speakup: integrate into kbuild
|
|||
--- a/drivers/staging/Makefile
|
||||
+++ b/drivers/staging/Makefile
|
||||
@@ -45,3 +45,4 @@
|
||||
obj-$(CONFIG_USB_CPC) += cpc-usb/
|
||||
obj-$(CONFIG_RDC_17F3101X) += pata_rdc/
|
||||
obj-$(CONFIG_FB_UDL) += udlfb/
|
||||
obj-$(CONFIG_RAR_REGISTER) += rar/
|
||||
obj-$(CONFIG_DX_SEP) += sep/
|
||||
obj-$(CONFIG_IIO) += iio/
|
||||
+obj-$(CONFIG_SPEAKUP) += speakup/
|
||||
--- a/drivers/staging/speakup/Kbuild
|
||||
+++ b/drivers/staging/speakup/Kbuild
|
||||
|
|
|
@ -1,789 +0,0 @@
|
|||
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
|
||||
Date: Mon, 10 Aug 2009 02:50:03 +0000 (+1000)
|
||||
Subject: crypto: mv_cesa - Add support for Orion5X crypto engine
|
||||
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=85a7f0ac5370901916a21935e1fafbe397b70f80
|
||||
|
||||
crypto: mv_cesa - Add support for Orion5X crypto engine
|
||||
|
||||
This adds support for Marvell's Cryptographic Engines and Security
|
||||
Accelerator (CESA) which can be found on a few SoC.
|
||||
Tested with dm-crypt.
|
||||
|
||||
Acked-by: Nicolas Pitre <nico@marvell.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
|
||||
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
---
|
||||
|
||||
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
|
||||
index 1bb4b7f..b08403d 100644
|
||||
--- a/drivers/crypto/Kconfig
|
||||
+++ b/drivers/crypto/Kconfig
|
||||
@@ -157,6 +157,19 @@ config S390_PRNG
|
||||
ANSI X9.17 standard. The PRNG is usable via the char device
|
||||
/dev/prandom.
|
||||
|
||||
+config CRYPTO_DEV_MV_CESA
|
||||
+ tristate "Marvell's Cryptographic Engine"
|
||||
+ depends on PLAT_ORION
|
||||
+ select CRYPTO_ALGAPI
|
||||
+ select CRYPTO_AES
|
||||
+ select CRYPTO_BLKCIPHER2
|
||||
+ help
|
||||
+ This driver allows you to utilize the Cryptographic Engines and
|
||||
+ Security Accelerator (CESA) which can be found on the Marvell Orion
|
||||
+ and Kirkwood SoCs, such as QNAP's TS-209.
|
||||
+
|
||||
+ Currently the driver supports AES in ECB and CBC mode without DMA.
|
||||
+
|
||||
config CRYPTO_DEV_HIFN_795X
|
||||
tristate "Driver HIFN 795x crypto accelerator chips"
|
||||
select CRYPTO_DES
|
||||
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
|
||||
index 9bf4a2b..6ffcb3f 100644
|
||||
--- a/drivers/crypto/Makefile
|
||||
+++ b/drivers/crypto/Makefile
|
||||
@@ -2,6 +2,7 @@ obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o
|
||||
obj-$(CONFIG_CRYPTO_DEV_PADLOCK_SHA) += padlock-sha.o
|
||||
obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
|
||||
obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
|
||||
+obj-$(CONFIG_CRYPTO_DEV_MV_CESA) += mv_cesa.o
|
||||
obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o
|
||||
obj-$(CONFIG_CRYPTO_DEV_IXP4XX) += ixp4xx_crypto.o
|
||||
obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += amcc/
|
||||
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
|
||||
new file mode 100644
|
||||
index 0000000..b21ef63
|
||||
--- /dev/null
|
||||
+++ b/drivers/crypto/mv_cesa.c
|
||||
@@ -0,0 +1,606 @@
|
||||
+/*
|
||||
+ * Support for Marvell's crypto engine which can be found on some Orion5X
|
||||
+ * boards.
|
||||
+ *
|
||||
+ * Author: Sebastian Andrzej Siewior < sebastian at breakpoint dot cc >
|
||||
+ * License: GPLv2
|
||||
+ *
|
||||
+ */
|
||||
+#include <crypto/aes.h>
|
||||
+#include <crypto/algapi.h>
|
||||
+#include <linux/crypto.h>
|
||||
+#include <linux/interrupt.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/kthread.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/scatterlist.h>
|
||||
+
|
||||
+#include "mv_cesa.h"
|
||||
+/*
|
||||
+ * STM:
|
||||
+ * /---------------------------------------\
|
||||
+ * | | request complete
|
||||
+ * \./ |
|
||||
+ * IDLE -> new request -> BUSY -> done -> DEQUEUE
|
||||
+ * /°\ |
|
||||
+ * | | more scatter entries
|
||||
+ * \________________/
|
||||
+ */
|
||||
+enum engine_status {
|
||||
+ ENGINE_IDLE,
|
||||
+ ENGINE_BUSY,
|
||||
+ ENGINE_W_DEQUEUE,
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * struct req_progress - used for every crypt request
|
||||
+ * @src_sg_it: sg iterator for src
|
||||
+ * @dst_sg_it: sg iterator for dst
|
||||
+ * @sg_src_left: bytes left in src to process (scatter list)
|
||||
+ * @src_start: offset to add to src start position (scatter list)
|
||||
+ * @crypt_len: length of current crypt process
|
||||
+ * @sg_dst_left: bytes left dst to process in this scatter list
|
||||
+ * @dst_start: offset to add to dst start position (scatter list)
|
||||
+ * @total_req_bytes: total number of bytes processed (request).
|
||||
+ *
|
||||
+ * sg helper are used to iterate over the scatterlist. Since the size of the
|
||||
+ * SRAM may be less than the scatter size, this struct struct is used to keep
|
||||
+ * track of progress within current scatterlist.
|
||||
+ */
|
||||
+struct req_progress {
|
||||
+ struct sg_mapping_iter src_sg_it;
|
||||
+ struct sg_mapping_iter dst_sg_it;
|
||||
+
|
||||
+ /* src mostly */
|
||||
+ int sg_src_left;
|
||||
+ int src_start;
|
||||
+ int crypt_len;
|
||||
+ /* dst mostly */
|
||||
+ int sg_dst_left;
|
||||
+ int dst_start;
|
||||
+ int total_req_bytes;
|
||||
+};
|
||||
+
|
||||
+struct crypto_priv {
|
||||
+ void __iomem *reg;
|
||||
+ void __iomem *sram;
|
||||
+ int irq;
|
||||
+ struct task_struct *queue_th;
|
||||
+
|
||||
+ /* the lock protects queue and eng_st */
|
||||
+ spinlock_t lock;
|
||||
+ struct crypto_queue queue;
|
||||
+ enum engine_status eng_st;
|
||||
+ struct ablkcipher_request *cur_req;
|
||||
+ struct req_progress p;
|
||||
+ int max_req_size;
|
||||
+ int sram_size;
|
||||
+};
|
||||
+
|
||||
+static struct crypto_priv *cpg;
|
||||
+
|
||||
+struct mv_ctx {
|
||||
+ u8 aes_enc_key[AES_KEY_LEN];
|
||||
+ u32 aes_dec_key[8];
|
||||
+ int key_len;
|
||||
+ u32 need_calc_aes_dkey;
|
||||
+};
|
||||
+
|
||||
+enum crypto_op {
|
||||
+ COP_AES_ECB,
|
||||
+ COP_AES_CBC,
|
||||
+};
|
||||
+
|
||||
+struct mv_req_ctx {
|
||||
+ enum crypto_op op;
|
||||
+ int decrypt;
|
||||
+};
|
||||
+
|
||||
+static void compute_aes_dec_key(struct mv_ctx *ctx)
|
||||
+{
|
||||
+ struct crypto_aes_ctx gen_aes_key;
|
||||
+ int key_pos;
|
||||
+
|
||||
+ if (!ctx->need_calc_aes_dkey)
|
||||
+ return;
|
||||
+
|
||||
+ crypto_aes_expand_key(&gen_aes_key, ctx->aes_enc_key, ctx->key_len);
|
||||
+
|
||||
+ key_pos = ctx->key_len + 24;
|
||||
+ memcpy(ctx->aes_dec_key, &gen_aes_key.key_enc[key_pos], 4 * 4);
|
||||
+ switch (ctx->key_len) {
|
||||
+ case AES_KEYSIZE_256:
|
||||
+ key_pos -= 2;
|
||||
+ /* fall */
|
||||
+ case AES_KEYSIZE_192:
|
||||
+ key_pos -= 2;
|
||||
+ memcpy(&ctx->aes_dec_key[4], &gen_aes_key.key_enc[key_pos],
|
||||
+ 4 * 4);
|
||||
+ break;
|
||||
+ }
|
||||
+ ctx->need_calc_aes_dkey = 0;
|
||||
+}
|
||||
+
|
||||
+static int mv_setkey_aes(struct crypto_ablkcipher *cipher, const u8 *key,
|
||||
+ unsigned int len)
|
||||
+{
|
||||
+ struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
|
||||
+ struct mv_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
+
|
||||
+ switch (len) {
|
||||
+ case AES_KEYSIZE_128:
|
||||
+ case AES_KEYSIZE_192:
|
||||
+ case AES_KEYSIZE_256:
|
||||
+ break;
|
||||
+ default:
|
||||
+ crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ ctx->key_len = len;
|
||||
+ ctx->need_calc_aes_dkey = 1;
|
||||
+
|
||||
+ memcpy(ctx->aes_enc_key, key, AES_KEY_LEN);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void setup_data_in(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ int ret;
|
||||
+ void *buf;
|
||||
+
|
||||
+ if (!cpg->p.sg_src_left) {
|
||||
+ ret = sg_miter_next(&cpg->p.src_sg_it);
|
||||
+ BUG_ON(!ret);
|
||||
+ cpg->p.sg_src_left = cpg->p.src_sg_it.length;
|
||||
+ cpg->p.src_start = 0;
|
||||
+ }
|
||||
+
|
||||
+ cpg->p.crypt_len = min(cpg->p.sg_src_left, cpg->max_req_size);
|
||||
+
|
||||
+ buf = cpg->p.src_sg_it.addr;
|
||||
+ buf += cpg->p.src_start;
|
||||
+
|
||||
+ memcpy(cpg->sram + SRAM_DATA_IN_START, buf, cpg->p.crypt_len);
|
||||
+
|
||||
+ cpg->p.sg_src_left -= cpg->p.crypt_len;
|
||||
+ cpg->p.src_start += cpg->p.crypt_len;
|
||||
+}
|
||||
+
|
||||
+static void mv_process_current_q(int first_block)
|
||||
+{
|
||||
+ struct ablkcipher_request *req = cpg->cur_req;
|
||||
+ struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
|
||||
+ struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
|
||||
+ struct sec_accel_config op;
|
||||
+
|
||||
+ switch (req_ctx->op) {
|
||||
+ case COP_AES_ECB:
|
||||
+ op.config = CFG_OP_CRYPT_ONLY | CFG_ENCM_AES | CFG_ENC_MODE_ECB;
|
||||
+ break;
|
||||
+ case COP_AES_CBC:
|
||||
+ op.config = CFG_OP_CRYPT_ONLY | CFG_ENCM_AES | CFG_ENC_MODE_CBC;
|
||||
+ op.enc_iv = ENC_IV_POINT(SRAM_DATA_IV) |
|
||||
+ ENC_IV_BUF_POINT(SRAM_DATA_IV_BUF);
|
||||
+ if (first_block)
|
||||
+ memcpy(cpg->sram + SRAM_DATA_IV, req->info, 16);
|
||||
+ break;
|
||||
+ }
|
||||
+ if (req_ctx->decrypt) {
|
||||
+ op.config |= CFG_DIR_DEC;
|
||||
+ memcpy(cpg->sram + SRAM_DATA_KEY_P, ctx->aes_dec_key,
|
||||
+ AES_KEY_LEN);
|
||||
+ } else {
|
||||
+ op.config |= CFG_DIR_ENC;
|
||||
+ memcpy(cpg->sram + SRAM_DATA_KEY_P, ctx->aes_enc_key,
|
||||
+ AES_KEY_LEN);
|
||||
+ }
|
||||
+
|
||||
+ switch (ctx->key_len) {
|
||||
+ case AES_KEYSIZE_128:
|
||||
+ op.config |= CFG_AES_LEN_128;
|
||||
+ break;
|
||||
+ case AES_KEYSIZE_192:
|
||||
+ op.config |= CFG_AES_LEN_192;
|
||||
+ break;
|
||||
+ case AES_KEYSIZE_256:
|
||||
+ op.config |= CFG_AES_LEN_256;
|
||||
+ break;
|
||||
+ }
|
||||
+ op.enc_p = ENC_P_SRC(SRAM_DATA_IN_START) |
|
||||
+ ENC_P_DST(SRAM_DATA_OUT_START);
|
||||
+ op.enc_key_p = SRAM_DATA_KEY_P;
|
||||
+
|
||||
+ setup_data_in(req);
|
||||
+ op.enc_len = cpg->p.crypt_len;
|
||||
+ memcpy(cpg->sram + SRAM_CONFIG, &op,
|
||||
+ sizeof(struct sec_accel_config));
|
||||
+
|
||||
+ writel(SRAM_CONFIG, cpg->reg + SEC_ACCEL_DESC_P0);
|
||||
+ /* GO */
|
||||
+ writel(SEC_CMD_EN_SEC_ACCL0, cpg->reg + SEC_ACCEL_CMD);
|
||||
+
|
||||
+ /*
|
||||
+ * XXX: add timer if the interrupt does not occur for some mystery
|
||||
+ * reason
|
||||
+ */
|
||||
+}
|
||||
+
|
||||
+static void mv_crypto_algo_completion(void)
|
||||
+{
|
||||
+ struct ablkcipher_request *req = cpg->cur_req;
|
||||
+ struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
|
||||
+
|
||||
+ if (req_ctx->op != COP_AES_CBC)
|
||||
+ return ;
|
||||
+
|
||||
+ memcpy(req->info, cpg->sram + SRAM_DATA_IV_BUF, 16);
|
||||
+}
|
||||
+
|
||||
+static void dequeue_complete_req(void)
|
||||
+{
|
||||
+ struct ablkcipher_request *req = cpg->cur_req;
|
||||
+ void *buf;
|
||||
+ int ret;
|
||||
+
|
||||
+ cpg->p.total_req_bytes += cpg->p.crypt_len;
|
||||
+ do {
|
||||
+ int dst_copy;
|
||||
+
|
||||
+ if (!cpg->p.sg_dst_left) {
|
||||
+ ret = sg_miter_next(&cpg->p.dst_sg_it);
|
||||
+ BUG_ON(!ret);
|
||||
+ cpg->p.sg_dst_left = cpg->p.dst_sg_it.length;
|
||||
+ cpg->p.dst_start = 0;
|
||||
+ }
|
||||
+
|
||||
+ buf = cpg->p.dst_sg_it.addr;
|
||||
+ buf += cpg->p.dst_start;
|
||||
+
|
||||
+ dst_copy = min(cpg->p.crypt_len, cpg->p.sg_dst_left);
|
||||
+
|
||||
+ memcpy(buf, cpg->sram + SRAM_DATA_OUT_START, dst_copy);
|
||||
+
|
||||
+ cpg->p.sg_dst_left -= dst_copy;
|
||||
+ cpg->p.crypt_len -= dst_copy;
|
||||
+ cpg->p.dst_start += dst_copy;
|
||||
+ } while (cpg->p.crypt_len > 0);
|
||||
+
|
||||
+ BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
|
||||
+ if (cpg->p.total_req_bytes < req->nbytes) {
|
||||
+ /* process next scatter list entry */
|
||||
+ cpg->eng_st = ENGINE_BUSY;
|
||||
+ mv_process_current_q(0);
|
||||
+ } else {
|
||||
+ sg_miter_stop(&cpg->p.src_sg_it);
|
||||
+ sg_miter_stop(&cpg->p.dst_sg_it);
|
||||
+ mv_crypto_algo_completion();
|
||||
+ cpg->eng_st = ENGINE_IDLE;
|
||||
+ req->base.complete(&req->base, 0);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int count_sgs(struct scatterlist *sl, unsigned int total_bytes)
|
||||
+{
|
||||
+ int i = 0;
|
||||
+
|
||||
+ do {
|
||||
+ total_bytes -= sl[i].length;
|
||||
+ i++;
|
||||
+
|
||||
+ } while (total_bytes > 0);
|
||||
+
|
||||
+ return i;
|
||||
+}
|
||||
+
|
||||
+static void mv_enqueue_new_req(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ int num_sgs;
|
||||
+
|
||||
+ cpg->cur_req = req;
|
||||
+ memset(&cpg->p, 0, sizeof(struct req_progress));
|
||||
+
|
||||
+ num_sgs = count_sgs(req->src, req->nbytes);
|
||||
+ sg_miter_start(&cpg->p.src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
|
||||
+
|
||||
+ num_sgs = count_sgs(req->dst, req->nbytes);
|
||||
+ sg_miter_start(&cpg->p.dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG);
|
||||
+ mv_process_current_q(1);
|
||||
+}
|
||||
+
|
||||
+static int queue_manag(void *data)
|
||||
+{
|
||||
+ cpg->eng_st = ENGINE_IDLE;
|
||||
+ do {
|
||||
+ struct ablkcipher_request *req;
|
||||
+ struct crypto_async_request *async_req = NULL;
|
||||
+ struct crypto_async_request *backlog;
|
||||
+
|
||||
+ __set_current_state(TASK_INTERRUPTIBLE);
|
||||
+
|
||||
+ if (cpg->eng_st == ENGINE_W_DEQUEUE)
|
||||
+ dequeue_complete_req();
|
||||
+
|
||||
+ spin_lock_irq(&cpg->lock);
|
||||
+ if (cpg->eng_st == ENGINE_IDLE) {
|
||||
+ backlog = crypto_get_backlog(&cpg->queue);
|
||||
+ async_req = crypto_dequeue_request(&cpg->queue);
|
||||
+ if (async_req) {
|
||||
+ BUG_ON(cpg->eng_st != ENGINE_IDLE);
|
||||
+ cpg->eng_st = ENGINE_BUSY;
|
||||
+ }
|
||||
+ }
|
||||
+ spin_unlock_irq(&cpg->lock);
|
||||
+
|
||||
+ if (backlog) {
|
||||
+ backlog->complete(backlog, -EINPROGRESS);
|
||||
+ backlog = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (async_req) {
|
||||
+ req = container_of(async_req,
|
||||
+ struct ablkcipher_request, base);
|
||||
+ mv_enqueue_new_req(req);
|
||||
+ async_req = NULL;
|
||||
+ }
|
||||
+
|
||||
+ schedule();
|
||||
+
|
||||
+ } while (!kthread_should_stop());
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mv_handle_req(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ unsigned long flags;
|
||||
+ int ret;
|
||||
+
|
||||
+ spin_lock_irqsave(&cpg->lock, flags);
|
||||
+ ret = ablkcipher_enqueue_request(&cpg->queue, req);
|
||||
+ spin_unlock_irqrestore(&cpg->lock, flags);
|
||||
+ wake_up_process(cpg->queue_th);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int mv_enc_aes_ecb(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
|
||||
+
|
||||
+ req_ctx->op = COP_AES_ECB;
|
||||
+ req_ctx->decrypt = 0;
|
||||
+
|
||||
+ return mv_handle_req(req);
|
||||
+}
|
||||
+
|
||||
+static int mv_dec_aes_ecb(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
|
||||
+ struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
|
||||
+
|
||||
+ req_ctx->op = COP_AES_ECB;
|
||||
+ req_ctx->decrypt = 1;
|
||||
+
|
||||
+ compute_aes_dec_key(ctx);
|
||||
+ return mv_handle_req(req);
|
||||
+}
|
||||
+
|
||||
+static int mv_enc_aes_cbc(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
|
||||
+
|
||||
+ req_ctx->op = COP_AES_CBC;
|
||||
+ req_ctx->decrypt = 0;
|
||||
+
|
||||
+ return mv_handle_req(req);
|
||||
+}
|
||||
+
|
||||
+static int mv_dec_aes_cbc(struct ablkcipher_request *req)
|
||||
+{
|
||||
+ struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
|
||||
+ struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
|
||||
+
|
||||
+ req_ctx->op = COP_AES_CBC;
|
||||
+ req_ctx->decrypt = 1;
|
||||
+
|
||||
+ compute_aes_dec_key(ctx);
|
||||
+ return mv_handle_req(req);
|
||||
+}
|
||||
+
|
||||
+static int mv_cra_init(struct crypto_tfm *tfm)
|
||||
+{
|
||||
+ tfm->crt_ablkcipher.reqsize = sizeof(struct mv_req_ctx);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+irqreturn_t crypto_int(int irq, void *priv)
|
||||
+{
|
||||
+ u32 val;
|
||||
+
|
||||
+ val = readl(cpg->reg + SEC_ACCEL_INT_STATUS);
|
||||
+ if (!(val & SEC_INT_ACCEL0_DONE))
|
||||
+ return IRQ_NONE;
|
||||
+
|
||||
+ val &= ~SEC_INT_ACCEL0_DONE;
|
||||
+ writel(val, cpg->reg + FPGA_INT_STATUS);
|
||||
+ writel(val, cpg->reg + SEC_ACCEL_INT_STATUS);
|
||||
+ BUG_ON(cpg->eng_st != ENGINE_BUSY);
|
||||
+ cpg->eng_st = ENGINE_W_DEQUEUE;
|
||||
+ wake_up_process(cpg->queue_th);
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+struct crypto_alg mv_aes_alg_ecb = {
|
||||
+ .cra_name = "ecb(aes)",
|
||||
+ .cra_driver_name = "mv-ecb-aes",
|
||||
+ .cra_priority = 300,
|
||||
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
|
||||
+ .cra_blocksize = 16,
|
||||
+ .cra_ctxsize = sizeof(struct mv_ctx),
|
||||
+ .cra_alignmask = 0,
|
||||
+ .cra_type = &crypto_ablkcipher_type,
|
||||
+ .cra_module = THIS_MODULE,
|
||||
+ .cra_init = mv_cra_init,
|
||||
+ .cra_u = {
|
||||
+ .ablkcipher = {
|
||||
+ .min_keysize = AES_MIN_KEY_SIZE,
|
||||
+ .max_keysize = AES_MAX_KEY_SIZE,
|
||||
+ .setkey = mv_setkey_aes,
|
||||
+ .encrypt = mv_enc_aes_ecb,
|
||||
+ .decrypt = mv_dec_aes_ecb,
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+struct crypto_alg mv_aes_alg_cbc = {
|
||||
+ .cra_name = "cbc(aes)",
|
||||
+ .cra_driver_name = "mv-cbc-aes",
|
||||
+ .cra_priority = 300,
|
||||
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
|
||||
+ .cra_blocksize = AES_BLOCK_SIZE,
|
||||
+ .cra_ctxsize = sizeof(struct mv_ctx),
|
||||
+ .cra_alignmask = 0,
|
||||
+ .cra_type = &crypto_ablkcipher_type,
|
||||
+ .cra_module = THIS_MODULE,
|
||||
+ .cra_init = mv_cra_init,
|
||||
+ .cra_u = {
|
||||
+ .ablkcipher = {
|
||||
+ .ivsize = AES_BLOCK_SIZE,
|
||||
+ .min_keysize = AES_MIN_KEY_SIZE,
|
||||
+ .max_keysize = AES_MAX_KEY_SIZE,
|
||||
+ .setkey = mv_setkey_aes,
|
||||
+ .encrypt = mv_enc_aes_cbc,
|
||||
+ .decrypt = mv_dec_aes_cbc,
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static int mv_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct crypto_priv *cp;
|
||||
+ struct resource *res;
|
||||
+ int irq;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (cpg) {
|
||||
+ printk(KERN_ERR "Second crypto dev?\n");
|
||||
+ return -EEXIST;
|
||||
+ }
|
||||
+
|
||||
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
|
||||
+ if (!res)
|
||||
+ return -ENXIO;
|
||||
+
|
||||
+ cp = kzalloc(sizeof(*cp), GFP_KERNEL);
|
||||
+ if (!cp)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ spin_lock_init(&cp->lock);
|
||||
+ crypto_init_queue(&cp->queue, 50);
|
||||
+ cp->reg = ioremap(res->start, res->end - res->start + 1);
|
||||
+ if (!cp->reg) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram");
|
||||
+ if (!res) {
|
||||
+ ret = -ENXIO;
|
||||
+ goto err_unmap_reg;
|
||||
+ }
|
||||
+ cp->sram_size = res->end - res->start + 1;
|
||||
+ cp->max_req_size = cp->sram_size - SRAM_CFG_SPACE;
|
||||
+ cp->sram = ioremap(res->start, cp->sram_size);
|
||||
+ if (!cp->sram) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err_unmap_reg;
|
||||
+ }
|
||||
+
|
||||
+ irq = platform_get_irq(pdev, 0);
|
||||
+ if (irq < 0 || irq == NO_IRQ) {
|
||||
+ ret = irq;
|
||||
+ goto err_unmap_sram;
|
||||
+ }
|
||||
+ cp->irq = irq;
|
||||
+
|
||||
+ platform_set_drvdata(pdev, cp);
|
||||
+ cpg = cp;
|
||||
+
|
||||
+ cp->queue_th = kthread_run(queue_manag, cp, "mv_crypto");
|
||||
+ if (IS_ERR(cp->queue_th)) {
|
||||
+ ret = PTR_ERR(cp->queue_th);
|
||||
+ goto err_thread;
|
||||
+ }
|
||||
+
|
||||
+ ret = request_irq(irq, crypto_int, IRQF_DISABLED, dev_name(&pdev->dev),
|
||||
+ cp);
|
||||
+ if (ret)
|
||||
+ goto err_unmap_sram;
|
||||
+
|
||||
+ writel(SEC_INT_ACCEL0_DONE, cpg->reg + SEC_ACCEL_INT_MASK);
|
||||
+ writel(SEC_CFG_STOP_DIG_ERR, cpg->reg + SEC_ACCEL_CFG);
|
||||
+
|
||||
+ ret = crypto_register_alg(&mv_aes_alg_ecb);
|
||||
+ if (ret)
|
||||
+ goto err_reg;
|
||||
+
|
||||
+ ret = crypto_register_alg(&mv_aes_alg_cbc);
|
||||
+ if (ret)
|
||||
+ goto err_unreg_ecb;
|
||||
+ return 0;
|
||||
+err_unreg_ecb:
|
||||
+ crypto_unregister_alg(&mv_aes_alg_ecb);
|
||||
+err_thread:
|
||||
+ free_irq(irq, cp);
|
||||
+err_reg:
|
||||
+ kthread_stop(cp->queue_th);
|
||||
+err_unmap_sram:
|
||||
+ iounmap(cp->sram);
|
||||
+err_unmap_reg:
|
||||
+ iounmap(cp->reg);
|
||||
+err:
|
||||
+ kfree(cp);
|
||||
+ cpg = NULL;
|
||||
+ platform_set_drvdata(pdev, NULL);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int mv_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct crypto_priv *cp = platform_get_drvdata(pdev);
|
||||
+
|
||||
+ crypto_unregister_alg(&mv_aes_alg_ecb);
|
||||
+ crypto_unregister_alg(&mv_aes_alg_cbc);
|
||||
+ kthread_stop(cp->queue_th);
|
||||
+ free_irq(cp->irq, cp);
|
||||
+ memset(cp->sram, 0, cp->sram_size);
|
||||
+ iounmap(cp->sram);
|
||||
+ iounmap(cp->reg);
|
||||
+ kfree(cp);
|
||||
+ cpg = NULL;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver marvell_crypto = {
|
||||
+ .probe = mv_probe,
|
||||
+ .remove = mv_remove,
|
||||
+ .driver = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .name = "mv_crypto",
|
||||
+ },
|
||||
+};
|
||||
+MODULE_ALIAS("platform:mv_crypto");
|
||||
+
|
||||
+static int __init mv_crypto_init(void)
|
||||
+{
|
||||
+ return platform_driver_register(&marvell_crypto);
|
||||
+}
|
||||
+module_init(mv_crypto_init);
|
||||
+
|
||||
+static void __exit mv_crypto_exit(void)
|
||||
+{
|
||||
+ platform_driver_unregister(&marvell_crypto);
|
||||
+}
|
||||
+module_exit(mv_crypto_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Sebastian Andrzej Siewior <sebastian@breakpoint.cc>");
|
||||
+MODULE_DESCRIPTION("Support for Marvell's cryptographic engine");
|
||||
+MODULE_LICENSE("GPL");
|
||||
diff --git a/drivers/crypto/mv_cesa.h b/drivers/crypto/mv_cesa.h
|
||||
new file mode 100644
|
||||
index 0000000..c3e25d3
|
||||
--- /dev/null
|
||||
+++ b/drivers/crypto/mv_cesa.h
|
||||
@@ -0,0 +1,119 @@
|
||||
+#ifndef __MV_CRYPTO_H__
|
||||
+
|
||||
+#define DIGEST_INITIAL_VAL_A 0xdd00
|
||||
+#define DES_CMD_REG 0xdd58
|
||||
+
|
||||
+#define SEC_ACCEL_CMD 0xde00
|
||||
+#define SEC_CMD_EN_SEC_ACCL0 (1 << 0)
|
||||
+#define SEC_CMD_EN_SEC_ACCL1 (1 << 1)
|
||||
+#define SEC_CMD_DISABLE_SEC (1 << 2)
|
||||
+
|
||||
+#define SEC_ACCEL_DESC_P0 0xde04
|
||||
+#define SEC_DESC_P0_PTR(x) (x)
|
||||
+
|
||||
+#define SEC_ACCEL_DESC_P1 0xde14
|
||||
+#define SEC_DESC_P1_PTR(x) (x)
|
||||
+
|
||||
+#define SEC_ACCEL_CFG 0xde08
|
||||
+#define SEC_CFG_STOP_DIG_ERR (1 << 0)
|
||||
+#define SEC_CFG_CH0_W_IDMA (1 << 7)
|
||||
+#define SEC_CFG_CH1_W_IDMA (1 << 8)
|
||||
+#define SEC_CFG_ACT_CH0_IDMA (1 << 9)
|
||||
+#define SEC_CFG_ACT_CH1_IDMA (1 << 10)
|
||||
+
|
||||
+#define SEC_ACCEL_STATUS 0xde0c
|
||||
+#define SEC_ST_ACT_0 (1 << 0)
|
||||
+#define SEC_ST_ACT_1 (1 << 1)
|
||||
+
|
||||
+/*
|
||||
+ * FPGA_INT_STATUS looks like a FPGA leftover and is documented only in Errata
|
||||
+ * 4.12. It looks like that it was part of an IRQ-controller in FPGA and
|
||||
+ * someone forgot to remove it while switching to the core and moving to
|
||||
+ * SEC_ACCEL_INT_STATUS.
|
||||
+ */
|
||||
+#define FPGA_INT_STATUS 0xdd68
|
||||
+#define SEC_ACCEL_INT_STATUS 0xde20
|
||||
+#define SEC_INT_AUTH_DONE (1 << 0)
|
||||
+#define SEC_INT_DES_E_DONE (1 << 1)
|
||||
+#define SEC_INT_AES_E_DONE (1 << 2)
|
||||
+#define SEC_INT_AES_D_DONE (1 << 3)
|
||||
+#define SEC_INT_ENC_DONE (1 << 4)
|
||||
+#define SEC_INT_ACCEL0_DONE (1 << 5)
|
||||
+#define SEC_INT_ACCEL1_DONE (1 << 6)
|
||||
+#define SEC_INT_ACC0_IDMA_DONE (1 << 7)
|
||||
+#define SEC_INT_ACC1_IDMA_DONE (1 << 8)
|
||||
+
|
||||
+#define SEC_ACCEL_INT_MASK 0xde24
|
||||
+
|
||||
+#define AES_KEY_LEN (8 * 4)
|
||||
+
|
||||
+struct sec_accel_config {
|
||||
+
|
||||
+ u32 config;
|
||||
+#define CFG_OP_MAC_ONLY 0
|
||||
+#define CFG_OP_CRYPT_ONLY 1
|
||||
+#define CFG_OP_MAC_CRYPT 2
|
||||
+#define CFG_OP_CRYPT_MAC 3
|
||||
+#define CFG_MACM_MD5 (4 << 4)
|
||||
+#define CFG_MACM_SHA1 (5 << 4)
|
||||
+#define CFG_MACM_HMAC_MD5 (6 << 4)
|
||||
+#define CFG_MACM_HMAC_SHA1 (7 << 4)
|
||||
+#define CFG_ENCM_DES (1 << 8)
|
||||
+#define CFG_ENCM_3DES (2 << 8)
|
||||
+#define CFG_ENCM_AES (3 << 8)
|
||||
+#define CFG_DIR_ENC (0 << 12)
|
||||
+#define CFG_DIR_DEC (1 << 12)
|
||||
+#define CFG_ENC_MODE_ECB (0 << 16)
|
||||
+#define CFG_ENC_MODE_CBC (1 << 16)
|
||||
+#define CFG_3DES_EEE (0 << 20)
|
||||
+#define CFG_3DES_EDE (1 << 20)
|
||||
+#define CFG_AES_LEN_128 (0 << 24)
|
||||
+#define CFG_AES_LEN_192 (1 << 24)
|
||||
+#define CFG_AES_LEN_256 (2 << 24)
|
||||
+
|
||||
+ u32 enc_p;
|
||||
+#define ENC_P_SRC(x) (x)
|
||||
+#define ENC_P_DST(x) ((x) << 16)
|
||||
+
|
||||
+ u32 enc_len;
|
||||
+#define ENC_LEN(x) (x)
|
||||
+
|
||||
+ u32 enc_key_p;
|
||||
+#define ENC_KEY_P(x) (x)
|
||||
+
|
||||
+ u32 enc_iv;
|
||||
+#define ENC_IV_POINT(x) ((x) << 0)
|
||||
+#define ENC_IV_BUF_POINT(x) ((x) << 16)
|
||||
+
|
||||
+ u32 mac_src_p;
|
||||
+#define MAC_SRC_DATA_P(x) (x)
|
||||
+#define MAC_SRC_TOTAL_LEN(x) ((x) << 16)
|
||||
+
|
||||
+ u32 mac_digest;
|
||||
+ u32 mac_iv;
|
||||
+}__attribute__ ((packed));
|
||||
+ /*
|
||||
+ * /-----------\ 0
|
||||
+ * | ACCEL CFG | 4 * 8
|
||||
+ * |-----------| 0x20
|
||||
+ * | CRYPT KEY | 8 * 4
|
||||
+ * |-----------| 0x40
|
||||
+ * | IV IN | 4 * 4
|
||||
+ * |-----------| 0x40 (inplace)
|
||||
+ * | IV BUF | 4 * 4
|
||||
+ * |-----------| 0x50
|
||||
+ * | DATA IN | 16 * x (max ->max_req_size)
|
||||
+ * |-----------| 0x50 (inplace operation)
|
||||
+ * | DATA OUT | 16 * x (max ->max_req_size)
|
||||
+ * \-----------/ SRAM size
|
||||
+ */
|
||||
+#define SRAM_CONFIG 0x00
|
||||
+#define SRAM_DATA_KEY_P 0x20
|
||||
+#define SRAM_DATA_IV 0x40
|
||||
+#define SRAM_DATA_IV_BUF 0x40
|
||||
+#define SRAM_DATA_IN_START 0x50
|
||||
+#define SRAM_DATA_OUT_START 0x50
|
||||
+
|
||||
+#define SRAM_CFG_SPACE 0x50
|
||||
+
|
||||
+#endif
|
|
@ -1,7 +0,0 @@
|
|||
--- a/arch/arm/tools/mach-types~ 2009-08-23 14:44:45.000000000 +0000
|
||||
+++ b/arch/arm/tools/mach-types 2009-08-23 14:44:52.000000000 +0000
|
||||
@@ -2280,3 +2280,4 @@
|
||||
htctopaz MACH_HTCTOPAZ HTCTOPAZ 2293
|
||||
matrix504 MACH_MATRIX504 MATRIX504 2294
|
||||
mrfsa MACH_MRFSA MRFSA 2295
|
||||
+openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325
|
|
@ -1,43 +0,0 @@
|
|||
From: Ron Lee <ron@debian.org>
|
||||
Date: Mon, 10 Aug 2009 12:53:48 +0000 (+0530)
|
||||
Subject: [ARM] Kirkwood: Initialise SATA for OpenRD-Base
|
||||
X-Git-Url: http://git.marvell.com/?p=orion.git;a=commitdiff_plain;h=decf77079511fc5ef832ead074bb45e4e0b099c0
|
||||
|
||||
[ARM] Kirkwood: Initialise SATA for OpenRD-Base
|
||||
|
||||
Signed-off-by: Ron Lee <ron@debian.org>
|
||||
Signed-off-by: Dhaval Vasa <dhaval.vasa@einfochips.com>
|
||||
Signed-off-by: Nicolas Pitre <nico@marvell.com>
|
||||
---
|
||||
|
||||
diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
|
||||
index 3144bb8..947dfb8 100644
|
||||
--- a/arch/arm/mach-kirkwood/openrd_base-setup.c
|
||||
+++ b/arch/arm/mach-kirkwood/openrd_base-setup.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
+#include <linux/ata_platform.h>
|
||||
#include <linux/mv643xx_eth.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
@@ -40,6 +41,10 @@ static struct mv643xx_eth_platform_data openrd_base_ge00_data = {
|
||||
.phy_addr = MV643XX_ETH_PHY_ADDR(8),
|
||||
};
|
||||
|
||||
+static struct mv_sata_platform_data openrd_base_sata_data = {
|
||||
+ .n_ports = 2,
|
||||
+};
|
||||
+
|
||||
static struct mvsdio_platform_data openrd_base_mvsdio_data = {
|
||||
.gpio_card_detect = 29, /* MPP29 used as SD card detect */
|
||||
};
|
||||
@@ -63,6 +68,7 @@ static void __init openrd_base_init(void)
|
||||
kirkwood_ehci_init();
|
||||
|
||||
kirkwood_ge00_init(&openrd_base_ge00_data);
|
||||
+ kirkwood_sata_init(&openrd_base_sata_data);
|
||||
kirkwood_sdio_init(&openrd_base_mvsdio_data);
|
||||
}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
From: Dhaval Vasa <dhaval.vasa@einfochips.com>
|
||||
Date: Mon, 10 Aug 2009 12:07:34 +0000 (+0530)
|
||||
Subject: [ARM] Kirkwood: Marvell OpenRD-Base board support
|
||||
X-Git-Url: http://git.marvell.com/?p=orion.git;a=commitdiff_plain;h=7eeae54c68e91c46ec170e764d1cceac81f35969
|
||||
|
||||
[ARM] Kirkwood: Marvell OpenRD-Base board support
|
||||
|
||||
reference:
|
||||
http://open-rd.org
|
||||
http://code.google.com/p/openrd
|
||||
|
||||
This patch is tested for:
|
||||
1. Boot from DRAM/NAND flash
|
||||
2. NAND read/write/erase
|
||||
3. GbE0
|
||||
4. USB read/write
|
||||
|
||||
FIXME:
|
||||
1. SD/UART1 selection
|
||||
2. MPP configuration (currently, default)
|
||||
3. PEX
|
||||
|
||||
Signed-off-by: Dhaval Vasa <dhaval.vasa@einfochips.com>
|
||||
Signed-off-by: Nicolas Pitre <nico@marvell.com>
|
||||
---
|
||||
|
||||
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
|
||||
index 25100f7..0aca451 100644
|
||||
--- a/arch/arm/mach-kirkwood/Kconfig
|
||||
+++ b/arch/arm/mach-kirkwood/Kconfig
|
||||
@@ -38,6 +38,12 @@ config MACH_TS219
|
||||
Say 'Y' here if you want your kernel to support the
|
||||
QNAP TS-119 and TS-219 Turbo NAS devices.
|
||||
|
||||
+config MACH_OPENRD_BASE
|
||||
+ bool "Marvell OpenRD Base Board"
|
||||
+ help
|
||||
+ Say 'Y' here if you want your kernel to support the
|
||||
+ Marvell OpenRD Base Board.
|
||||
+
|
||||
endmenu
|
||||
|
||||
endif
|
||||
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
|
||||
index 9dd680e..80ab0ec 100644
|
||||
--- a/arch/arm/mach-kirkwood/Makefile
|
||||
+++ b/arch/arm/mach-kirkwood/Makefile
|
||||
@@ -6,5 +6,6 @@ obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
|
||||
obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
|
||||
obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
|
||||
obj-$(CONFIG_MACH_TS219) += ts219-setup.o
|
||||
+obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o
|
||||
|
||||
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
|
||||
diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
|
||||
new file mode 100644
|
||||
index 0000000..3144bb8
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/mach-kirkwood/openrd_base-setup.c
|
||||
@@ -0,0 +1,78 @@
|
||||
+/*
|
||||
+ * arch/arm/mach-kirkwood/openrd_base-setup.c
|
||||
+ *
|
||||
+ * Marvell OpenRD Base Board Setup
|
||||
+ *
|
||||
+ * This file is licensed under the terms of the GNU General Public
|
||||
+ * License version 2. This program is licensed "as is" without any
|
||||
+ * warranty of any kind, whether express or implied.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/mtd/partitions.h>
|
||||
+#include <linux/mv643xx_eth.h>
|
||||
+#include <asm/mach-types.h>
|
||||
+#include <asm/mach/arch.h>
|
||||
+#include <mach/kirkwood.h>
|
||||
+#include <plat/mvsdio.h>
|
||||
+#include "common.h"
|
||||
+#include "mpp.h"
|
||||
+
|
||||
+static struct mtd_partition openrd_base_nand_parts[] = {
|
||||
+ {
|
||||
+ .name = "u-boot",
|
||||
+ .offset = 0,
|
||||
+ .size = SZ_1M
|
||||
+ }, {
|
||||
+ .name = "uImage",
|
||||
+ .offset = MTDPART_OFS_NXTBLK,
|
||||
+ .size = SZ_4M
|
||||
+ }, {
|
||||
+ .name = "root",
|
||||
+ .offset = MTDPART_OFS_NXTBLK,
|
||||
+ .size = MTDPART_SIZ_FULL
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct mv643xx_eth_platform_data openrd_base_ge00_data = {
|
||||
+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
|
||||
+};
|
||||
+
|
||||
+static struct mvsdio_platform_data openrd_base_mvsdio_data = {
|
||||
+ .gpio_card_detect = 29, /* MPP29 used as SD card detect */
|
||||
+};
|
||||
+
|
||||
+static unsigned int openrd_base_mpp_config[] __initdata = {
|
||||
+ MPP29_GPIO,
|
||||
+ 0
|
||||
+};
|
||||
+
|
||||
+static void __init openrd_base_init(void)
|
||||
+{
|
||||
+ /*
|
||||
+ * Basic setup. Needs to be called early.
|
||||
+ */
|
||||
+ kirkwood_init();
|
||||
+ kirkwood_mpp_conf(openrd_base_mpp_config);
|
||||
+
|
||||
+ kirkwood_uart0_init();
|
||||
+ kirkwood_nand_init(ARRAY_AND_SIZE(openrd_base_nand_parts), 25);
|
||||
+
|
||||
+ kirkwood_ehci_init();
|
||||
+
|
||||
+ kirkwood_ge00_init(&openrd_base_ge00_data);
|
||||
+ kirkwood_sdio_init(&openrd_base_mvsdio_data);
|
||||
+}
|
||||
+
|
||||
+MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
|
||||
+ /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
|
||||
+ .phys_io = KIRKWOOD_REGS_PHYS_BASE,
|
||||
+ .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
|
||||
+ .boot_params = 0x00000100,
|
||||
+ .init_machine = openrd_base_init,
|
||||
+ .map_io = kirkwood_map_io,
|
||||
+ .init_irq = kirkwood_init_irq,
|
||||
+ .timer = &kirkwood_timer,
|
||||
+MACHINE_END
|
|
@ -6,12 +6,8 @@
|
|||
+ debian/drivers-ata-ata_piix-postpone-pata.patch
|
||||
+ debian/drivers-ata-pata_sis-postpone-pata.patch
|
||||
|
||||
+ features/all/drivers-gpu-drm-mga-request_firmware.patch
|
||||
+ features/all/drivers-gpu-drm-r128-request_firmware.patch
|
||||
+ features/all/drivers-gpu-drm-radeon-request_firmware.patch
|
||||
+ features/all/drivers-infiniband-hw-ipath-iba7220-use-request_firmware.patch
|
||||
+ features/all/drivers-media-dvb-usb-af9005-request_firmware.patch
|
||||
+ features/all/drivers-net-cxgb3-request_firmware.patch
|
||||
+ features/all/drivers-staging-rt28x0sta-request_firmware.patch
|
||||
+ features/all/export-unionfs-symbols.patch
|
||||
+ features/all/sound-pci-cs46xx-request_firmware.patch
|
||||
|
@ -41,22 +37,6 @@
|
|||
+ bugfix/powerpc/lpar-console.patch
|
||||
#+ bugfix/all/wireless-regulatory-default-EU.patch
|
||||
#+ features/sparc/video-sunxvr500-intergraph.patch
|
||||
+ bugfix/sparc/arch-zimage-target.patch
|
||||
+ features/arm/openrd-machtype.patch
|
||||
+ features/arm/openrd.patch
|
||||
+ features/arm/openrd-sata.patch
|
||||
+ features/arm/mv_cesa.patch
|
||||
+ bugfix/all/drivers-scsi-qla1280-request-firmware-unlocked.patch
|
||||
+ bugfix/all/drivers-gpu-drm-r128-ioctl-add-init-test.patch
|
||||
+ bugfix/x86/fix-alternatives-on-486.patch
|
||||
+ bugfix/x86/fix-i8xx-agp-flush.patch
|
||||
+ bugfix/all/stable/2.6.31.1.patch
|
||||
+ bugfix/all/fs-nfs-avoid-overrun-copying-client-ip.patch
|
||||
- bugfix/x86/fix-i8xx-agp-flush.patch
|
||||
+ bugfix/all/stable/2.6.31.2.patch
|
||||
+ bugfix/all/drivers-net-sfc-fix-initial-link-state.patch
|
||||
+ bugfix/all/stable/2.6.31.3.patch
|
||||
+ bugfix/all/hfsplus-limit-to-2tb.patch
|
||||
+ bugfix/all/stable/2.6.31.4.patch
|
||||
+ bugfix/all/cpuidle-return-with-irq-enabled.patch
|
||||
+ bugfix/all/stable/2.6.31.5.patch
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
+ debian/dfsg/arch-powerpc-platforms-8xx-ucode-disable.patch
|
||||
+ debian/dfsg/drivers-media-dvb-dvb-usb-af9005-disable.patch
|
||||
+ debian/dfsg/drivers-gpu-drm-mga-disable.patch
|
||||
+ debian/dfsg/drivers-gpu-drm-r128-disable.patch
|
||||
+ debian/dfsg/drivers-gpu-drm-radeon-disable.patch
|
||||
+ debian/dfsg/drivers-infiniband-hw-ipath-iba7220-disable.patch
|
||||
+ debian/dfsg/drivers-net-appletalk-cops.patch
|
||||
+ debian/dfsg/drivers-net-cxgb3-disable.patch
|
||||
+ debian/dfsg/drivers-staging-me4000-disable.patch
|
||||
+ debian/dfsg/drivers-staging-otus-disable.patch
|
||||
+ debian/dfsg/drivers-staging-rt2860-disable.patch
|
||||
+ debian/dfsg/drivers-staging-rt2870-disable.patch
|
||||
+ debian/dfsg/drivers-staging-rt3070-disable.patch
|
||||
+ debian/dfsg/drivers-staging-rt3090-disable.patch
|
||||
+ debian/dfsg/drivers-staging-rtl8192su-disable.patch
|
||||
+ debian/dfsg/firmware-cleanup.patch
|
||||
+ debian/dfsg/sound-pci.patch
|
||||
X debian/dfsg/files-1
|
||||
|
||||
# TODO for 2.6.32:
|
||||
# drivers/gpu/drm/radeon/r600_blit_shaders.c: r{6,7}xx_default_state
|
||||
# drivers/media/dvb/frontends/lgs8gxx.c: lgs8g75_initdat
|
||||
# drivers/net/r8169.c: phy_reg_init_2 in rtl8168d_{1,2}_hw_phy_config()
|
||||
|
|
Loading…
Reference in New Issue