ReactOS  0.4.15-dev-1070-ge1a01de
omap3.h File Reference

Go to the source code of this file.

Functions

VOID NTAPI LlbHwOmap3UartInitialize (VOID)
 
VOID NTAPI LlbHwOmap3LcdInitialize (VOID)
 
UCHAR NTAPI LlbHwOmap3TwlRead1 (IN UCHAR ChipAddress, IN UCHAR RegisterAddress)
 
VOID NTAPI LlbHwOmap3TwlWrite (IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Length, IN PUCHAR Values)
 
VOID NTAPI LlbHwOmap3TwlWrite1 (IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Value)
 
VOID NTAPI LlbHwOmap3SynKpdInitialize (VOID)
 

Function Documentation

◆ LlbHwOmap3LcdInitialize()

VOID NTAPI LlbHwOmap3LcdInitialize ( VOID  )

Definition at line 15 of file hwlcd.c.

16 {
17  /*
18  * N.B. The following initialization sequence took about 12 months to figure
19  * out.
20  * This means if you are glancing at it and have no idea what on Earth
21  * could possibly be going on, this is *normal*.
22  * Just trust that this turns on the LCD.
23  * And be thankful all you ever have to worry about is Java and HTML.
24  */
25 
26  /* Turn on the functional and interface clocks in the entire PER domain */
27  WRITE_REGISTER_ULONG(0x48005000, 0x3ffff); /* Functional clocks */
28  WRITE_REGISTER_ULONG(0x48005010, 0x3ffff); /* Interface clocks */
29 
30  /* Now that GPIO Module 3 is on, send a reset to the LCD panel on GPIO 96 */
31  WRITE_REGISTER_ULONG(0x49054034, 0); /* FIXME: Enable all as output */
32  WRITE_REGISTER_ULONG(0x49054094, 0xffffffff); /* FIXME: Output on all gpios */
33 
34  /* Now turn on the functional and interface clocks in the CORE domain */
35  WRITE_REGISTER_ULONG(0x48004a00, 0x03fffe29); /* Functional clocks */
36  WRITE_REGISTER_ULONG(0x48004a10, 0x3ffffffb); /* Interface clocks */
37 
38  /* The HS I2C interface is now on, configure it */
39  WRITE_REGISTER_USHORT(0x48070024, 0x0); /* Disable I2c */
40  WRITE_REGISTER_USHORT(0x48070030, 0x17); /* Configure clock divider */
41  WRITE_REGISTER_USHORT(0x48070034, 0xd); /* Configure clock scaler */
42  WRITE_REGISTER_USHORT(0x48070038, 0xf); /* Configure clock scaler */
43  WRITE_REGISTER_USHORT(0x48070020, 0x215); /* Configure clocks and idle */
44  WRITE_REGISTER_USHORT(0x4807000c, 0x636f); /* Select wakeup bits */
45  WRITE_REGISTER_USHORT(0x48070014, 0x4343); /* Disable DMA */
46  WRITE_REGISTER_USHORT(0x48070024, 0x8000); /* Enable I2C */
47 
48  /*
49  * Set the VPLL2 to cover all device groups instead of just P3.
50  * This essentially enables the VRRTC to power up the LCD panel.
51  */
52  LlbHwOmap3TwlWrite1(0x4B, 0x8E, 0xE0);
53 
54  /* VPLL2 runs at 1.2V by default, so we need to reprogram to 1.8V for DVI */
55  LlbHwOmap3TwlWrite1(0x4B, 0x91, 0x05);
56 
57  /* Set GPIO pin 7 on the TWL4030 as an output pin */
58  LlbHwOmap3TwlWrite1(0x49, 0x9B, 0x80);
59 
60  /* Set GPIO pin 7 signal on the TWL4030 ON. This powers the LCD backlight */
61  LlbHwOmap3TwlWrite1(0x49, 0xA4, 0x80);
62 
63  /* Now go on the McSPI interface and program it on for the channel */
64  WRITE_REGISTER_ULONG(0x48098010, 0x15);
65  WRITE_REGISTER_ULONG(0x48098020, 0x1);
66  WRITE_REGISTER_ULONG(0x48098028, 0x1);
67  WRITE_REGISTER_ULONG(0x4809802c, 0x112fdc);
68 
69  /* Send the reset signal (R2 = 00h) to the NEC WVGA LCD Panel */
70  WRITE_REGISTER_ULONG(0x48098034, 0x1);
71  WRITE_REGISTER_ULONG(0x48098038, 0x20100);
72  WRITE_REGISTER_ULONG(0x48098034, 0x0);
73 
74  /* Turn on the functional and interface clocks in the DSS domain */
75  WRITE_REGISTER_ULONG(0x48004e00, 0x5);
76  WRITE_REGISTER_ULONG(0x48004e10, 0x1);
77 
78  /* Reset the Display Controller (DISPC) */
79  WRITE_REGISTER_ULONG(0x48050410, 0x00000005); // DISPC_SYSCONFIG
80 
81  /* Set the frame buffer address */
82  WRITE_REGISTER_ULONG(0x48050480, 0x800A0000); // DISPC_GFX_BA0
83 
84  /* Set resolution and RGB16 color mode */
85  WRITE_REGISTER_ULONG(0x4805048c, 0x01df031f); // DISPC_GFX_SIZE
86  WRITE_REGISTER_ULONG(0x480504a0, 0x0000000d); // DISPC_GFX_ATTRIBUTES
87 
88  /* Set LCD timings (VSync and HSync), pixel clock, and LCD size */
89  WRITE_REGISTER_ULONG(0x4805046c, 0x00003000); // DISPC_POL_FREQ
90  WRITE_REGISTER_ULONG(0x48050470, 0x00010004); // DISPC_DIVISOR
91  WRITE_REGISTER_ULONG(0x48050464, 0x00300500); // DISPC_TIMING_H
92  WRITE_REGISTER_ULONG(0x48050468, 0x00400300); // DISPC_TIMING_V
93  WRITE_REGISTER_ULONG(0x4805047c, 0x01df031f); // DISPC_SIZE_LCD
94 
95  /* Turn the LCD on */
96  WRITE_REGISTER_ULONG(0x48050440, 0x00018309); // DISPC_CONTROL
97 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
GLint x0
Definition: linetemp.h:95
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
NTKERNELAPI VOID NTAPI WRITE_REGISTER_USHORT(IN PUSHORT Register, IN USHORT Value)
VOID NTAPI LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Value)
Definition: hwtwl40x.c:61

Referenced by LlbHwInitialize().

◆ LlbHwOmap3SynKpdInitialize()

VOID NTAPI LlbHwOmap3SynKpdInitialize ( VOID  )

Definition at line 15 of file hwsynkp.c.

16 {
17  /* Set GPIO pin 8 on the TWL4030 as an output pin */
18  LlbHwOmap3TwlWrite1(0x49, 0x9B, 0xC0);
19 
20  /* Set GPIO pin 8 signal on the TWL4030 ON. This powers the keypad backlight */
21  LlbHwOmap3TwlWrite1(0x49, 0xA4, 0xC0);
22 
23  /* Set PENDDIS and COR on the the keypad interrupt controller */
24  LlbHwOmap3TwlWrite1(0x4A, 0xE9, 0x06);
25 
26  /* Only falling edge detection for key pressed */
27  LlbHwOmap3TwlWrite1(0x4A, 0xE8, 0x01);
28 
29  /* Unmask key-pressed events */
30  LlbHwOmap3TwlWrite1(0x4A, 0xE4, 0x0E);
31 
32  /* Set the keypad control register to turn hardware sequencing and turn it on */
33  LlbHwOmap3TwlWrite1(0x4A, 0xD2, 0x0);
34  LlbHwOmap3TwlRead1(0x4A, 0xE3);
35  LlbHwOmap3TwlWrite1(0x4A, 0xD2, 0x43);
36 }
GLint x0
Definition: linetemp.h:95
VOID NTAPI LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Value)
Definition: hwtwl40x.c:61
UCHAR NTAPI LlbHwOmap3TwlRead1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress)
Definition: hwtwl40x.c:15

Referenced by LlbHwInitialize().

◆ LlbHwOmap3TwlRead1()

UCHAR NTAPI LlbHwOmap3TwlRead1 ( IN UCHAR  ChipAddress,
IN UCHAR  RegisterAddress 
)

Definition at line 15 of file hwtwl40x.c.

17 {
18  volatile int i = 1000;
19 
20  /* Select the register */
21  LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 0, NULL);
22 
23  /* Now read it */
24  WRITE_REGISTER_USHORT(0x48070024, 0x8401);
25  for (i = 1000; i > 0; i--);
26  return READ_REGISTER_USHORT(0x4807001c);
27 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_USHORT(IN PUSHORT Register, IN USHORT Value)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
NTKERNELAPI USHORT NTAPI READ_REGISTER_USHORT(IN PUSHORT Register)
VOID NTAPI LlbHwOmap3TwlWrite(IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Length, IN PUCHAR Values)
Definition: hwtwl40x.c:31

Referenced by LlbHwKbdRead(), LlbHwKbdReady(), LlbHwOmap3SynKpdInitialize(), and LlbHwRtcRead().

◆ LlbHwOmap3TwlWrite()

VOID NTAPI LlbHwOmap3TwlWrite ( IN UCHAR  ChipAddress,
IN UCHAR  RegisterAddress,
IN UCHAR  Length,
IN PUCHAR  Values 
)

Definition at line 31 of file hwtwl40x.c.

35 {
36  volatile int i = 1000;
37  ULONG j;
38 
39  /* Select chip address */
40  WRITE_REGISTER_USHORT(0x4807002c, ChipAddress);
41  WRITE_REGISTER_USHORT(0x48070018, Length + 1);
42 
43  /* Enable master transmit mode */
44  WRITE_REGISTER_USHORT(0x48070024, 0x8601);
45  WRITE_REGISTER_USHORT(0x4807001c, RegisterAddress);
46 
47  /* Loop each byte */
48  for (j = 0; j < Length; j++)
49  {
50  /* Write the data */
51  WRITE_REGISTER_USHORT(0x4807001c, Values[j]);
52  }
53 
54  /* Issue stop command */
55  WRITE_REGISTER_USHORT(0x48070024, 0x8602);
56  for (i = 1000; i > 0; i--);
57 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_USHORT(IN PUSHORT Register, IN USHORT Value)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
unsigned int ULONG
Definition: retypes.h:1

Referenced by LlbHwOmap3TwlRead1(), and LlbHwOmap3TwlWrite1().

◆ LlbHwOmap3TwlWrite1()

VOID NTAPI LlbHwOmap3TwlWrite1 ( IN UCHAR  ChipAddress,
IN UCHAR  RegisterAddress,
IN UCHAR  Value 
)

Definition at line 61 of file hwtwl40x.c.

64 {
65  /* Do the actual write */
66  LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 1, &Value);
67 }
IN UCHAR Value
Definition: halp.h:394
VOID NTAPI LlbHwOmap3TwlWrite(IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Length, IN PUCHAR Values)
Definition: hwtwl40x.c:31

Referenced by LlbHwOmap3LcdInitialize(), LlbHwOmap3SynKpdInitialize(), and LlbHwRtcRead().

◆ LlbHwOmap3UartInitialize()

VOID NTAPI LlbHwOmap3UartInitialize ( VOID  )

Definition at line 15 of file hwuart.c.

16 {
17 
18 }

Referenced by LlbHwInitialize().