]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8040/1: pj4: properly detect existence of iWMMXt coprocessor
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Thu, 24 Apr 2014 21:57:25 +0000 (22:57 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 25 Apr 2014 11:07:34 +0000 (12:07 +0100)
commitd92092a71bcb5d214bd1e013a31b69a35e778add
treec43e0fcc04db4e7cab75de84f7ddf10c217fadb8
parent25e7e6f8b28aa649ba5397096270aca4fe11c4ce
ARM: 8040/1: pj4: properly detect existence of iWMMXt coprocessor

commit 1d4f00d6c284937842d79581bdf2d3b13c4271b3
  ("ARM: 8015/1: Add cpu_is_pj4 to distinguish PJ4 because it
    has some differences with V7")
introduced a fix for checking PJ4 cpuid to not use PJ4 specific
coprocessor access on non-PJ4 platforms.

Unfortunately, this in turn broke Marvell Armada 370/XP, both
comprising Marvell PJ4B CPUs without iWMMXt extension. Instead
of only checking for cpuid, which may not be sufficient to
determine iWMMXt support, the presence of iWMMXt coprocessors
can be checked by enabling and reading the Coprocessor ID
register (wCID, register 0 of CP1).

Therefore this adds an explicit check for the presence and correct
wCID value, before enabling iWMMXt capabilities. As a bonus, also
print the iWMMXt version of a detected coprocessor.

This has been tested to properly detect iWMMXt presence/absence on:
- PJ4,  CPUID 0x560f5815, wCID 0x56052001: Marvell Dove, iWMMXt v2
- PJ4B, CPUID 0x561f5811: Marvell Armada 370, no iWMMXt
- PJ4B, CPUID 0x562f5841, wCID 0x56052001: Marvell Armada 1500, iWMMXt v2
- PJ4B, CPUID 0x562f5842: Marvell Armada XP, no iWMMXt

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/pj4-cp0.c