mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
x1000: fix broken OST2 timer prescaler
It turns out the prescaler fields in OST_CTRL are 2 bits wide, not 3. The programming manual (as usual) is ambiguous and its diagram shows 2-bit wide fields, but the bit positions in the text give a 3-bit wide field. Ingenic's Linux code and my own testing shows that they are, in fact, 2 bits wide. This caused the OST2 divisor to be 16 instead of 4; the OST1 divisor was correct. This means that all udelay/mdelay calls took 4x longer than they should've. After this change the OST2 prescaler will be 4, as intended, and udelay/mdelay calls will wait for the intended duration. Change-Id: I2ac0a9190f49b59a840c649bf586131f5f9fde82
This commit is contained in:
parent
bf54002bc1
commit
7a5130a277
3 changed files with 9 additions and 9 deletions
|
|
@ -31,21 +31,21 @@
|
|||
#define JT_OST_CTRL JIO_32_RW
|
||||
#define JN_OST_CTRL OST_CTRL
|
||||
#define JI_OST_CTRL
|
||||
#define BP_OST_CTRL_PRESCALE2 3
|
||||
#define BM_OST_CTRL_PRESCALE2 0x38
|
||||
#define BP_OST_CTRL_PRESCALE2 2
|
||||
#define BM_OST_CTRL_PRESCALE2 0xc
|
||||
#define BV_OST_CTRL_PRESCALE2__BY_1 0x0
|
||||
#define BV_OST_CTRL_PRESCALE2__BY_4 0x1
|
||||
#define BV_OST_CTRL_PRESCALE2__BY_16 0x2
|
||||
#define BF_OST_CTRL_PRESCALE2(v) (((v) & 0x7) << 3)
|
||||
#define BF_OST_CTRL_PRESCALE2(v) (((v) & 0x3) << 2)
|
||||
#define BFM_OST_CTRL_PRESCALE2(v) BM_OST_CTRL_PRESCALE2
|
||||
#define BF_OST_CTRL_PRESCALE2_V(e) BF_OST_CTRL_PRESCALE2(BV_OST_CTRL_PRESCALE2__##e)
|
||||
#define BFM_OST_CTRL_PRESCALE2_V(v) BM_OST_CTRL_PRESCALE2
|
||||
#define BP_OST_CTRL_PRESCALE1 0
|
||||
#define BM_OST_CTRL_PRESCALE1 0x7
|
||||
#define BM_OST_CTRL_PRESCALE1 0x3
|
||||
#define BV_OST_CTRL_PRESCALE1__BY_1 0x0
|
||||
#define BV_OST_CTRL_PRESCALE1__BY_4 0x1
|
||||
#define BV_OST_CTRL_PRESCALE1__BY_16 0x2
|
||||
#define BF_OST_CTRL_PRESCALE1(v) (((v) & 0x7) << 0)
|
||||
#define BF_OST_CTRL_PRESCALE1(v) (((v) & 0x3) << 0)
|
||||
#define BFM_OST_CTRL_PRESCALE1(v) BM_OST_CTRL_PRESCALE1
|
||||
#define BF_OST_CTRL_PRESCALE1_V(e) BF_OST_CTRL_PRESCALE1(BV_OST_CTRL_PRESCALE1__##e)
|
||||
#define BFM_OST_CTRL_PRESCALE1_V(v) BM_OST_CTRL_PRESCALE1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue