Skip to contentSkip to conversation

hw/arm/pxa2xx: Set value default values for CCCR and CKEN on PXA255

PATCH Applied Guenter Roeck 3 participants 3 messages Oct 25, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/pxa2xx: Set value default values for CCCR and CKEN on PXA255

The code used default values for PXA270 to configure CCCR. For PXA255, the resulting register value is invalid (unsupported) and resulted in a division by zero in the Linux kernel. Use default values from datasheet instead.

---
 hw/arm/pxa2xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/arm/pxa2xx.c +3 -1
index 2a2a821..4d9aed4 100644
@@ -2274,7 +2274,9 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
                     qdev_get_gpio_in(s->pic, PXA2XX_PIC_LCD));
 
     s->cm_base = 0x41300000;
-    s->cm_regs[CCCR >> 2] = 0x02000210;	/* 416.0 MHz */
+    s->cm_regs[CCCR >> 2] = 0x00000121;	/* from datasheet */
+    s->cm_regs[CKEN >> 2] = 0x00017def;	/* from datasheet */
+
     s->clkcfg = 0x00000009;		/* Turbo mode active */
     memory_region_init_io(&s->cm_iomem, NULL, &pxa2xx_cm_ops, s, "pxa2xx-cm", 0x1000);
     memory_region_add_subregion(address_space, s->cm_base, &s->cm_iomem);
Signature · 1 line
2.5.0
#1 lore raw
Your series seems to have some coding style problems. See output below for more information:

Hi,

Your series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH] hw/arm/pxa2xx: Set value default values for CCCR and CKEN on PXA255

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git show --no-patch --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
0140108 hw/arm/pxa2xx: Set value default values for CCCR and CKEN on PXA255

=== OUTPUT BEGIN ===
Checking PATCH 1/1: hw/arm/pxa2xx: Set value default values for CCCR and CKEN on PXA255...
ERROR: code indent should never use tabs
#24: FILE: hw/arm/pxa2xx.c:2270:
+ s->cm_regs[CCCR >> 2] = 0x00000121;^I/* from datasheet */$

ERROR: code indent should never use tabs
#25: FILE: hw/arm/pxa2xx.c:2271:
+ s->cm_regs[CKEN >> 2] = 0x00017def;^I/* from datasheet */$

total: 2 errors, 0 warnings, 10 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

#2 lore raw
In reply to Guenter Roeck
Quoted 15 lines · Guenter Roeck

The code used default values for PXA270 to configure CCCR. For PXA255, the resulting register value is invalid (unsupported) and resulted in a division by zero in the Linux kernel. Use default values from datasheet instead.

---
 hw/arm/pxa2xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/arm/pxa2xx.c +0 -0
index 2a2a821..4d9aed4 100644

hw/arm/pxa2xx.c PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) · line 2282

Quoted 10 lines
hw/arm/pxa2xx.c +3 -1
@@ -2274,7 +2274,9 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
                     qdev_get_gpio_in(s->pic, PXA2XX_PIC_LCD));
 
     s->cm_base = 0x41300000;
-    s->cm_regs[CCCR >> 2] = 0x02000210;        /* 416.0 MHz */
+    s->cm_regs[CCCR >> 2] = 0x00000121;        /* from datasheet */
+    s->cm_regs[CKEN >> 2] = 0x00017def;        /* from datasheet */
+
     s->clkcfg = 0x00000009;            /* Turbo mode active */
     memory_region_init_io(&s->cm_iomem, NULL, &pxa2xx_cm_ops, s, "pxa2xx-cm", 0x1000);
     memory_region_add_subregion(address_space, s->cm_base, &s->cm_iomem);

Applied to target-arm.next, thanks (I've fixed the tabs-vs-spaces style nit that checkpatch gripes about).

-- PMM