Please remember to add a category to the bottom of each page that you create.
See categories help for further details, but most will probably be [[Category:HTC ModelName]].

MagicianCPLD

From XDA-Developers
Jump to: navigation, search

This is a list of egpio settings observed with HaRET.

There appear to be three output registers at PXA_CS3_PHYS* 0x0, 0x4 and 0x8 followed by an irq demuxer at 0xc and an input register 0x10.

Only 8 bits of the u32 registers are in use (7 bits of 0x10).

Some of those bits should correspond to AC/USBc status. I couldn't test this because I connect to HaRET over USB.

phys. Addr bit mask description
0x0c000000 0 0x01 off
0x0c000000 1 0x02 off
0x0c000000 2 0x04 on
0x0c000000 3 0x08 off
0x0c000000 4 0x10 off
0x0c000000 5 0x20 LED power
0x0c000000 6 0x40 on (GSM reset?)
0x0c000000 7 0x80 LCD power
0x0c000004 0 0x01 on when playing sound over speaker
0x0c000004 1 0x02 on when playing sound over EP
0x0c000004 2 0x04 off (IN_SEL0, whatever that means)
0x0c000004 3 0x08 off (IN_SEL1)
0x0c000004 4 0x10 on when recording sound (EXT-MIC)
0x0c000004 5 0x20 off (CODEC RESET)
0x0c000004 6 0x40 on (CODEC)
0x0c000004 7 0x80 backlight power

Extra LCD power is usually activated by the camera driver (for visibility reasons probably). Under WinCE this has to correspond to 0xB0001311 (exact copy of the entire byte), otherwise it's being reset after a few seconds.

phys. Addr bit mask description
0x0c000008 0 0x01 on when SD card present
0x0c000008 1 0x02 off (CarKit Mic)
0x0c000008 2 0x04 off
0x0c000008 3 0x08 off (GSMHandFreeMode)
0x0c000008 4 0x10 extra backlight power
0x0c000008 5 0x20 on
0x0c000008 6 0x40 on
0x0c000008 7 0x80 on when radio on (GSM power)

The CPLD irq is multiplexed into the PXA's GPIO 13. It seems reads from 0xc must be acknowledged.

phys. Addr bit description
0x0c00000c 0 SD interrupt
0x0c00000c 1 EP interrupt
0x0c00000c 2 USBc? (never observed)
0x0c00000c 4 AC interrupt

The cable_state input register is supposed to have 7 interesting bits, but I've only ever seen it contain 0x0 or 0x2:

phys. Addr bit description
0x0c000010 1 AC is plugged in

Settings used in HaRET:

set traceignore 0x9058cfd8      # ignore odd stores
set trace 0xa9200000            # CPLD I/O memory
set tracemask 0x000fffff
set tracetype 1                 # only watch stores
set ii(3) 1                     # USBh1 (CSR bluetooth)
set ii(10) 1                    # GPIOx
set ii(11) 1                    # TMR0
set ii(21) 1                    # BTUART (GSM)
set ii(25) 1                    # DMA (sound in/out, camera)
set ii(26) 1                    # USBc
set ii(30) 1                    # RTC0 (1Hz clock)
set ii(33) 1                    # QCap (camera)
set ii(47) 1                    # GPIO 13 (CPLD IRQ)
set ii(141) 1                   # GPIO 107 (OWM_INT)
set ii(149) 1                   # GPIO 115 (PEN_DOWN)
wi 5
Personal tools