• Sebastian Hesselbarth's avatar
    ARM: 8040/1: pj4: properly detect existence of iWMMXt coprocessor · e89f443b
    Sebastian Hesselbarth authored
    commit fdb487f5
      ("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: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
    Tested-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Tested-by: default avatarKevin Hilman <khilman@linaro.org>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    e89f443b
pj4-cp0.c 2.79 KB