Changeset 2302
- Timestamp:
- 06/19/07 13:20:16 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/u-boot/patches/uboot-gta02.patch
r2238 r2302 89 89 --- /dev/null 90 90 +++ u-boot/board/neo1973/gta02/gta02.c 91 @@ -0,0 +1,3 13 @@91 @@ -0,0 +1,323 @@ 92 92 +/* 93 93 + * (C) 2006-2007 by OpenMoko, Inc. … … 136 136 +#define POWER_KEY_SECONDS 2 137 137 + 138 +#define M_MDIV 0x7f /* Fout = 405.00MHz */ 138 +//#define M_MDIV 0x7f /* Fout = 405.00MHz */ 139 +#define M_MDIV 0x7d /* Fout = 399.00MHz */ 139 140 +#define M_PDIV 0x2 140 141 +#define M_SDIV 0x1 … … 223 224 +int board_late_init(void) 224 225 +{ 226 + S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 225 227 + extern unsigned char booted_from_nand; 226 228 + unsigned char tmp; … … 231 233 + /* Initialize the Power Management Unit with a safe register set */ 232 234 + pcf50633_init(); 235 + 236 + /* Glamo3362 reset and power cycle */ 237 + gpio->GPJDAT &= ~0x000000001; 238 + pcf50633_reg_write(PCF50633_REG_DOWN2ENA, 0); 239 + udelay(50*1000); 240 + pcf50633_reg_write(PCF50633_REG_DOWN2ENA, 0x2); 241 + gpio->GPJDAT |= 0x000000001; 242 + 233 243 +#if 0 234 244 + /* if there's no other reason, must be regular reset */ … … 470 480 --- /dev/null 471 481 +++ u-boot/include/configs/neo1973_gta02.h 472 @@ -0,0 +1,27 6@@482 @@ -0,0 +1,272 @@ 473 483 +/* 474 484 + * (C) Copyright 2007 OpenMoko, Inc. … … 536 546 + */ 537 547 +#define CONFIG_SERIAL3 1 /* we use SERIAL 1 on GTA01 */ 538 +539 +/************************************************************540 + * RTC541 + ************************************************************/542 +#define CONFIG_RTC_S3C24X0 1543 548 + 544 549 +/* allow to overwrite serial and ethaddr */ … … 720 725 +#if 0 721 726 +#define CONFIG_VIDEO 722 +#define CONFIG_VIDEO_ S3C2410727 +#define CONFIG_VIDEO_GLAMO3362 723 728 +#define CONFIG_CFB_CONSOLE 724 729 +#define CONFIG_VIDEO_LOGO … … 733 738 +#define VIDEO_GETC_FCT serial_getc 734 739 + 735 +#define LCD_VIDEO_ADDR 0x33d00000740 +#define CONFIG_GLAMO_BASE 0x08000000 736 741 +#endif 737 742 + … … 740 745 + 741 746 +#define CONFIG_DRIVER_PCF50633 1 747 +#define CONFIG_RTC_PCF50633 1 742 748 + 743 749 +#define MTDIDS_DEFAULT "nand0=neo1973-nand" … … 1033 1039 --- /dev/null 1034 1040 +++ u-boot/drivers/pcf50633.c 1035 @@ -0,0 +1,1 42 @@1041 @@ -0,0 +1,192 @@ 1036 1042 +#include <common.h> 1037 1043 + … … 1174 1180 + return pcf50633_reg_set_bit_mask(PCF50633_REG_MBCC7, 0x03, val); 1175 1181 +} 1182 + 1183 +#if defined(CONFIG_RTC_PCF50633) && (CONFIG_COMMANDS & CFG_CMD_DATE) 1184 + 1185 +#include <rtc.h> 1186 + 1187 +static unsigned bcd2bin (uchar n) 1188 +{ 1189 + return ((((n >> 4) & 0x0F) * 10) + (n & 0x0F)); 1190 +} 1191 + 1192 +static unsigned char bin2bcd (unsigned int n) 1193 +{ 1194 + return (((n / 10) << 4) | (n % 10)); 1195 +} 1196 + 1197 + 1198 +void rtc_get(struct rtc_time *tmp) 1199 +{ 1200 + tmp->tm_sec = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCSC)); 1201 + tmp->tm_min = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCMN)); 1202 + tmp->tm_hour = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCHR)); 1203 + tmp->tm_wday = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCWD)); 1204 + tmp->tm_mday = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCDT)); 1205 + tmp->tm_mon = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCMT)); 1206 + tmp->tm_year = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCYR)); 1207 + if (tmp->tm_year < 70) 1208 + tmp->tm_year += 2000; 1209 + else 1210 + tmp->tm_year += 1900; 1211 + tmp->tm_yday = 0; 1212 + tmp->tm_isdst = 0; 1213 +} 1214 + 1215 +void rtc_set(struct rtc_time *tmp) 1216 +{ 1217 + pcf50633_reg_write(PCF50633_REG_RTCSC, bin2bcd(tmp->tm_sec)); 1218 + pcf50633_reg_write(PCF50633_REG_RTCMN, bin2bcd(tmp->tm_min)); 1219 + pcf50633_reg_write(PCF50633_REG_RTCHR, bin2bcd(tmp->tm_hour)); 1220 + pcf50633_reg_write(PCF50633_REG_RTCWD, bin2bcd(tmp->tm_wday)); 1221 + pcf50633_reg_write(PCF50633_REG_RTCDT, bin2bcd(tmp->tm_mday)); 1222 + pcf50633_reg_write(PCF50633_REG_RTCMN, bin2bcd(tmp->tm_mon)); 1223 + pcf50633_reg_write(PCF50633_REG_RTCYR, bin2bcd(tmp->tm_year % 100)); 1224 +} 1225 + 1226 +void rtc_reset(void) 1227 +{ 1228 + /* FIXME */ 1229 +} 1230 +#endif /* CONFIG_RTC_PCF50633 && CFG_CMD_DATE */ 1231 + 1176 1232 + 1177 1233 +#endif /* CONFIG DRIVER_PCF50633 */ … … 1367 1423 --- /dev/null 1368 1424 +++ u-boot/drivers/smedia3362.c 1369 @@ -0,0 +1,1 25@@1425 @@ -0,0 +1,188 @@ 1370 1426 +/* 1371 1427 + * (C) Copyright 2007 by OpenMoko, Inc. … … 1397 1453 +#include "smedia3362.h" 1398 1454 + 1399 + /*1400 + * Export Graphic Device1401 + */1455 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 1456 + 1457 +/* Export Graphic Device */ 1402 1458 +GraphicDevice smi; 1403 1459 + 1460 +#define GLAMO_REG(x) (*(volatile unsigned short *)(CONFIG_GLAMO_BASE + x)) 1461 + 1462 +static inline void glamo_reg_write(u_int16_t reg, u_int16_t val) 1463 +{ 1464 + GLAMO_REG(reg) = val; 1465 +} 1466 + 1467 +static inline u_int16_t glamo_reg_read(u_int16_t reg) 1468 +{ 1469 + return GLAMO_REG(reg); 1470 +} 1404 1471 + 1405 1472 +struct glamo_script { 1406 1473 + u_int16_t reg; 1407 1474 + u_int16_t val; 1408 +} __attribute__((packed));1475 +}; // __attribute__((packed)); 1409 1476 + 1410 1477 +/* from 'initial glamo 3365 script' */ … … 1424 1491 + { 0xfffe, 5 }, 1425 1492 + { GLAMO_REG_CLOCK_HOST, 0x000d }, 1426 + { GLAMO_REG_CLOCK_MEMORY, 0x000a } I,1493 + { GLAMO_REG_CLOCK_MEMORY, 0x000a }, 1427 1494 + { GLAMO_REG_CLOCK_LCD, 0x00ee }, 1428 1495 + { GLAMO_REG_CLOCK_MMC, 0x000a }, … … 1470 1537 + { GLAMO_REG_MEM_TIMING(11), 0x0001 }, 1471 1538 + { GLAMO_REG_MEM_POWER1, 0x0020 }, 1472 + { GLAMO_REG_MEM_POW RE2, 0x0000 },1539 + { GLAMO_REG_MEM_POWER2, 0x0000 }, 1473 1540 + { GLAMO_REG_MEM_DRAM1, 0x0000 }, 1474 1541 + { 0xfffe, 1 }, … … 1477 1544 +}; 1478 1545 + 1479 +static int glamo3362_init(void) 1546 +#if 0 1547 +static struct glamo_script gl3362_init_script[] = { 1548 + /* clock */ 1549 + { GLAMO_REG_CLOCK_MEMORY, 0x300a }, 1550 +}; 1551 +#endif 1552 + 1553 +static void glamo_run_script(struct glamo_script *script, int num) 1480 1554 +{ 1481 1555 + int i; 1482 +1483 1556 + for (i = 0; i < ARRAY_SIZE(gl3362_init_script); i++) { 1484 + struct glamo_reg *reg = gl3362_init_script[i]; 1557 + struct glamo_script *reg = script + i; 1558 + printf("reg=0x%04x, val=0x%04x\n", reg->reg, reg->val); 1485 1559 + 1486 1560 + if (reg->reg == 0xfffe) 1487 + delay(reg->val);1561 + udelay(reg->val*1000); 1488 1562 + else 1489 + gl 3362_reg_write(reg->reg, reg->val);1563 + glamo_reg_write(reg->reg, reg->val); 1490 1564 + } 1491 + /* FIXME */ 1565 + 1566 +} 1567 + 1568 +static void glamo_core_init(void) 1569 +{ 1570 + printf("Glamo core device ID: 0x%04x, Revision 0x%04x\n", 1571 + glamo_reg_read(GLAMO_REG_DEVICE_ID), 1572 + glamo_reg_read(GLAMO_REG_REVISION_ID)); 1573 + 1574 + glamo_run_script(gl3362_init_script, ARRAY_SIZE(gl3362_init_script)); 1575 +} 1576 + 1577 +void *video_hw_init(void) 1578 +{ 1579 + u_int16_t reg; 1580 + GraphicDevice *pGD = (GraphicDevice *)&smi; 1581 + 1582 + glamo_core_init(); 1583 + 1584 + printf("Video: "); 1585 + 1586 + /* FIXME: returning since vram access still locks up system */ 1587 + return NULL; 1588 + 1589 + /* FIXME: this is static */ 1590 + pGD->winSizeX = pGD->plnSizeX = 480; 1591 + pGD->winSizeY = pGD->plnSizeY = 640; 1592 + pGD->gdfBytesPP = 2; 1593 + pGD->gdfIndex = GDF_16BIT_565RGB; 1594 + 1595 + pGD->frameAdrs = CONFIG_GLAMO_BASE + 0x00800000; 1596 + pGD->memSize = 0x200000; /* 480x640x16bit = 614400 bytes */ 1597 + 1598 + //printf("memset "); 1599 + //memset(pGD->frameAdrs, 0, pGD->memSize); 1600 + 1601 + printf("END\n"); 1602 + 1603 + return &smi; 1604 +} 1605 + 1606 +void 1607 +video_set_lut(unsigned int index, unsigned char r, 1608 + unsigned char g, unsigned char b) 1609 +{ 1610 + /* FIXME: we don't support any palletized formats */ 1492 1611 +} 1493 1612 + … … 1497 1616 --- u-boot.orig/drivers/Makefile 1498 1617 +++ u-boot/drivers/Makefile 1499 @@ -50, 7 +50,7@@1618 @@ -50,10 +50,10 @@ 1500 1619 usbdcore.o usbdfu.o usbdcore_ep0.o usbdcore_omap1510.o usbdcore_s3c2410.o usbtty.o \ 1501 1620 videomodes.o w83c553f.o \ … … 1505 1624 pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \ 1506 1625 rpx_pcmcia.o \ 1507 fsl_i2c.o s3c2410_fb.o 1626 - fsl_i2c.o s3c2410_fb.o 1627 + fsl_i2c.o s3c2410_fb.o smedia3362.o 1628 1629 SRCS := $(COBJS:.o=.c) 1630 OBJS := $(addprefix $(obj),$(COBJS)) 1508 1631 Index: u-boot/common/cmd_nand.c 1509 1632 =================================================================== … … 1547 1670 void udc_ctrl(enum usbd_event event, int param) 1548 1671 { 1549 @@ -23,6 +24,11 @@ 1672 @@ -11,7 +12,8 @@ 1673 switch (event) { 1674 case UDC_CTRL_PULLUP_ENABLE: 1675 #if defined(CONFIG_ARCH_GTA01_v4) || defined(CONFIG_ARCH_GTA01B_v2) || \ 1676 - defined(CONFIG_ARCH_GTA01B_v3) || defined(CONFIG_ARCH_GTA01B_v4) 1677 + defined(CONFIG_ARCH_GTA01B_v3) || defined(CONFIG_ARCH_GTA01B_v4) || \ 1678 + defined(CONFIG_ARCH_GTA02_v1) 1679 if (param) 1680 gpio->GPBDAT |= (1 << 9); 1681 else 1682 @@ -23,6 +25,11 @@ 1550 1683 defined(CONFIG_ARCH_GTA01B_v2) || defined(CONFIG_ARCH_GTA01B_v3) || \ 1551 1684 defined(CONFIG_ARCH_GTA01B_v4) … … 1559 1692 break; 1560 1693 default: 1694 Index: u-boot/drivers/smedia3362.h 1695 =================================================================== 1696 --- /dev/null 1697 +++ u-boot/drivers/smedia3362.h 1698 @@ -0,0 +1,385 @@ 1699 +#ifndef _GLAMO_REGS_H 1700 +#define _GLAMO_REGS_H 1701 + 1702 +/* Smedia Glamo 336x/337x driver 1703 + * 1704 + * (C) 2007 by OpenMoko, Inc. 1705 + * Author: Harald Welte <laforge@openmoko.org> 1706 + * All rights reserved. 1707 + * 1708 + * This program is free software; you can redistribute it and/or 1709 + * modify it under the terms of the GNU General Public License as 1710 + * published by the Free Software Foundation; either version 2 of 1711 + * the License, or (at your option) any later version. 1712 + * 1713 + * This program is distributed in the hope that it will be useful, 1714 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 1715 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1716 + * GNU General Public License for more details. 1717 + * 1718 + * You should have received a copy of the GNU General Public License 1719 + * along with this program; if not, write to the Free Software 1720 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 1721 + * MA 02111-1307 USA 1722 + */ 1723 + 1724 +enum glamo_regster_offsets { 1725 + GLAMO_REGOFS_GENERIC = 0x0000, 1726 + GLAMO_REGOFS_HOSTBUS = 0x0200, 1727 + GLAMO_REGOFS_MEMORY = 0x0300, 1728 + GLAMO_REGOFS_VIDCAP = 0x0400, 1729 + GLAMO_REGOFS_ISP = 0x0500, 1730 + GLAMO_REGOFS_JPEG = 0x0800, 1731 + GLAMO_REGOFS_MPEG = 0x0c00, 1732 + GLAMO_REGOFS_LCD = 0x1100, 1733 + GLAMO_REGOFS_MMC = 0x1400, 1734 + GLAMO_REGOFS_MPROC0 = 0x1500, 1735 + GLAMO_REGOFS_MPROC1 = 0x1580, 1736 + GLAMO_REGOFS_CMDQUEUE = 0x1600, 1737 + GLAMO_REGOFS_RISC = 0x1680, 1738 + GLAMO_REGOFS_2D = 0x1700, 1739 + GLAMO_REGOFS_3D = 0x1b00, 1740 +}; 1741 + 1742 + 1743 +enum glamo_register_generic { 1744 + GLAMO_REG_GCONF1 = 0x0000, 1745 + GLAMO_REG_GCONF2 = 0x0002, 1746 +#define GLAMO_REG_DEVICE_ID GLAMO_REG_GCONF2 1747 + GLAMO_REG_GCONF3 = 0x0004, 1748 +#define GLAMO_REG_REVISION_ID GLAMO_REG_GCONF3 1749 + GLAMO_REG_IRQ_GEN1 = 0x0006, 1750 +#define GLAMO_REG_IRQ_ENABLE GLAMO_REG_IRQ_GEN1 1751 + GLAMO_REG_IRQ_GEN2 = 0x0008, 1752 +#define GLAMO_REG_IRQ_SET GLAMO_REG_IRQ_GEN2 1753 + GLAMO_REG_IRQ_GEN3 = 0x000a, 1754 +#define GLAMO_REG_IRQ_CLEAR GLAMO_REG_IRQ_GEN3 1755 + GLAMO_REG_IRQ_GEN4 = 0x000c, 1756 +#define GLAMO_REG_IRQ_STATUS GLAMO_REG_IRQ_GEN4 1757 + GLAMO_REG_CLOCK_HOST = 0x0010, 1758 + GLAMO_REG_CLOCK_MEMORY = 0x0012, 1759 + GLAMO_REG_CLOCK_LCD = 0x0014, 1760 + GLAMO_REG_CLOCK_MMC = 0x0016, 1761 + GLAMO_REG_CLOCK_ISP = 0x0018, 1762 + GLAMO_REG_CLOCK_JPEG = 0x001a, 1763 + GLAMO_REG_CLOCK_3D = 0x001c, 1764 + GLAMO_REG_CLOCK_2D = 0x001e, 1765 + GLAMO_REG_CLOCK_RISC1 = 0x0020, /* 3365 only? */ 1766 + GLAMO_REG_CLOCK_RISC2 = 0x0022, /* 3365 only? */ 1767 + GLAMO_REG_CLOCK_MPEG = 0x0024, 1768 + GLAMO_REG_CLOCK_MPROC = 0x0026, 1769 + 1770 + GLAMO_REG_CLOCK_GEN5_1 = 0x0030, 1771 + GLAMO_REG_CLOCK_GEN5_2 = 0x0032, 1772 + GLAMO_REG_CLOCK_GEN6 = 0x0034, 1773 + GLAMO_REG_CLOCK_GEN7 = 0x0036, 1774 + GLAMO_REG_CLOCK_GEN8 = 0x0038, 1775 + GLAMO_REG_CLOCK_GEN9 = 0x003a, 1776 + GLAMO_REG_CLOCK_GEN10 = 0x003c, 1777 + GLAMO_REG_CLOCK_GEN11 = 0x003e, 1778 + GLAMO_REG_PLL_GEN1 = 0x0040, 1779 + GLAMO_REG_PLL_GEN2 = 0x0042, 1780 + GLAMO_REG_PLL_GEN3 = 0x0044, 1781 + GLAMO_REG_PLL_GEN4 = 0x0046, 1782 + GLAMO_REG_PLL_GEN5 = 0x0048, 1783 + GLAMO_REG_GPIO_GEN1 = 0x0050, 1784 + GLAMO_REG_GPIO_GEN2 = 0x0052, 1785 + GLAMO_REG_GPIO_GEN3 = 0x0054, 1786 + GLAMO_REG_GPIO_GEN4 = 0x0056, 1787 + GLAMO_REG_GPIO_GEN5 = 0x0058, 1788 + GLAMO_REG_GPIO_GEN6 = 0x005a, 1789 + GLAMO_REG_GPIO_GEN7 = 0x005c, 1790 + GLAMO_REG_GPIO_GEN8 = 0x005e, 1791 + GLAMO_REG_GPIO_GEN9 = 0x0060, 1792 + GLAMO_REG_GPIO_GEN10 = 0x0062, 1793 + GLAMO_REG_DFT_GEN1 = 0x0070, 1794 + GLAMO_REG_DFT_GEN2 = 0x0072, 1795 + GLAMO_REG_DFT_GEN3 = 0x0074, 1796 + GLAMO_REG_DFT_GEN4 = 0x0076, 1797 + 1798 + GLAMO_REG_PLL_GEN6 = 0x01e0, 1799 + GLAMO_REG_PLL_GEN7 = 0x01f0, 1800 +}; 1801 + 1802 +#define GLAMO_REG_HOSTBUS(x) (GLAMO_REGOFS_HOSTBUS-2+(x*2)) 1803 + 1804 +#define REG_MEM(x) (GLAMO_REGOFS_MEMORY+(x)) 1805 +#define GLAMO_REG_MEM_TIMING(x) (GLAMO_REG_MEM_TIMING1-2+(x*2)) 1806 + 1807 +enum glamo_register_mem { 1808 + GLAMO_REG_MEM_TYPE = REG_MEM(0x00), 1809 + GLAMO_REG_MEM_GEN = REG_MEM(0x02), 1810 + GLAMO_REG_MEM_TIMING1 = REG_MEM(0x04), 1811 + GLAMO_REG_MEM_TIMING2 = REG_MEM(0x06), 1812 + GLAMO_REG_MEM_TIMING3 = REG_MEM(0x08), 1813 + GLAMO_REG_MEM_TIMING4 = REG_MEM(0x0a), 1814 + GLAMO_REG_MEM_TIMING5 = REG_MEM(0x0c), 1815 + GLAMO_REG_MEM_TIMING6 = REG_MEM(0x0e), 1816 + GLAMO_REG_MEM_TIMING7 = REG_MEM(0x10), 1817 + GLAMO_REG_MEM_TIMING8 = REG_MEM(0x12), 1818 + GLAMO_REG_MEM_TIMING9 = REG_MEM(0x14), 1819 + GLAMO_REG_MEM_TIMING10 = REG_MEM(0x16), 1820 + GLAMO_REG_MEM_TIMING11 = REG_MEM(0x18), 1821 + GLAMO_REG_MEM_POWER1 = REG_MEM(0x1a), 1822 + GLAMO_REG_MEM_POWER2 = REG_MEM(0x1c), 1823 + GLAMO_REG_MEM_LCD_BUF1 = REG_MEM(0x1e), 1824 + GLAMO_REG_MEM_LCD_BUF2 = REG_MEM(0x20), 1825 + GLAMO_REG_MEM_LCD_BUF3 = REG_MEM(0x22), 1826 + GLAMO_REG_MEM_LCD_BUF4 = REG_MEM(0x24), 1827 + GLAMO_REG_MEM_BIST1 = REG_MEM(0x26), 1828 + GLAMO_REG_MEM_BIST2 = REG_MEM(0x28), 1829 + GLAMO_REG_MEM_BIST3 = REG_MEM(0x2a), 1830 + GLAMO_REG_MEM_BIST4 = REG_MEM(0x2c), 1831 + GLAMO_REG_MEM_BIST5 = REG_MEM(0x2e), 1832 + GLAMO_REG_MEM_MAH1 = REG_MEM(0x30), 1833 + GLAMO_REG_MEM_MAH2 = REG_MEM(0x32), 1834 + GLAMO_REG_MEM_DRAM1 = REG_MEM(0x34), 1835 + GLAMO_REG_MEM_DRAM2 = REG_MEM(0x36), 1836 + GLAMO_REG_MEM_CRC = REG_MEM(0x38), 1837 +}; 1838 + 1839 +enum glamo_irq { 1840 + GLAMO_IRQ_HOSTBUS = 0x0001, 1841 + GLAMO_IRQ_JPEG = 0x0002, 1842 + GLAMO_IRQ_MPEG = 0x0004, 1843 + GLAMO_IRQ_MPROC1 = 0x0008, 1844 + GLAMO_IRQ_MPROC0 = 0x0010, 1845 + GLAMO_IRQ_CMDQUEUE = 0x0020, 1846 + GLAMO_IRQ_2D = 0x0040, 1847 + GLAMO_IRQ_MMC = 0x0080, 1848 + GLAMO_IRQ_RISC = 0x0100, 1849 +}; 1850 + 1851 +enum glamo_reg_clock_host { 1852 + GLAMO_CLOCK_HOST_DG_BCLK = 0x0001, 1853 + GLAMO_CLOCK_HOST_DG_M0CLK = 0x0004, 1854 + GLAMO_CLOCK_HOST_RESET = 0x1000, 1855 +}; 1856 + 1857 +enum glamo_reg_clock_mem { 1858 + GLAMO_CLOCK_MEM_DG_M1CLK = 0x0001, 1859 + GLAMO_CLOCK_MEM_EN_M1CLK = 0x0002, 1860 + GLAMO_CLOCK_MEM_DG_MOCACLK = 0x0004, 1861 + GLAMO_CLOCK_MEM_EN_MOCACLK = 0x0008, 1862 + GLAMO_CLOCK_MEM_RESET = 0x1000, 1863 + GLAMO_CLOCK_MOCA_RESET = 0x2000, 1864 +}; 1865 + 1866 +enum glamo_reg_clock_lcd { 1867 + GLAMO_CLOCK_LCD_DG_DCLK = 0x0001, 1868 + GLAMO_CLOCK_LCD_EN_DCLK = 0x0002, 1869 + GLAMO_CLOCK_LCD_DG_DMCLK = 0x0004, 1870 + GLAMO_CLOCK_LCD_EN_DMCLK = 0x0008, 1871 + // 1872 + GLAMO_CLOCK_LCD_EN_DHCLK = 0x0020, 1873 + GLAMO_CLOCK_LCD_DG_M5CLK = 0x0040, 1874 + GLAMO_CLOCK_LCD_EN_M5CLK = 0x0080, 1875 + GLAMO_CLOCK_LCD_RESET = 0x1000, 1876 +}; 1877 + 1878 +enum glamo_reg_clock_mmc { 1879 + GLAMO_CLOCK_MMC_DG_TCLK = 0x0001, 1880 + GLAMO_CLOCK_MMC_EN_TCLK = 0x0002, 1881 + GLAMO_CLOCK_MMC_DG_M9CLK = 0x0004, 1882 + GLAMO_CLOCK_MMC_EN_M9CLK = 0x0008, 1883 + GLAMO_CLOCK_MMC_RESET = 0x1000, 1884 +}; 1885 + 1886 +enum glamo_reg_clock_isp { 1887 + GLAMO_CLOCK_ISP_DG_I1CLK = 0x0001, 1888 + GLAMO_CLOCK_ISP_EN_I1CLK = 0x0002, 1889 + GLAMO_CLOCK_ISP_DG_CCLK = 0x0004, 1890 + GLAMO_CLOCK_ISP_EN_CCLK = 0x0008, 1891 + // 1892 + GLAMO_CLOCK_ISP_EN_SCLK = 0x0020, 1893 + GLAMO_CLOCK_ISP_DG_M2CLK = 0x0040, 1894 + GLAMO_CLOCK_ISP_EN_M2CLK = 0x0080, 1895 + GLAMO_CLOCK_ISP_DG_M15CLK = 0x0100, 1896 + GLAMO_CLOCK_ISP_EN_M15CLK = 0x0200, 1897 + GLAMO_CLOCK_ISP1_RESET = 0x1000, 1898 + GLAMO_CLOCK_ISP2_RESET = 0x2000, 1899 +}; 1900 + 1901 +enum glamo_reg_clock_jpeg { 1902 + GLAMO_CLOCK_JPEG_DG_JCLK = 0x0001, 1903 + GLAMO_CLOCK_JPEG_EN_JCLK = 0x0002, 1904 + GLAMO_CLOCK_JPEG_DG_M3CLK = 0x0004, 1905 + GLAMO_CLOCK_JPEG_EN_M3CLK = 0x0008, 1906 + GLAMO_CLOCK_JPEG_RESET = 0x1000, 1907 +}; 1908 + 1909 +enum glamo_reg_clock_3d { 1910 + GLAMO_CLOCK_3D_DG_GCLK = 0x0001, 1911 + GLAMO_CLOCK_3D_EN_GCLK = 0x0002, 1912 + GLAMO_CLOCK_3D_DG_M7CLK = 0x0004, 1913 + GLAMO_CLOCK_3D_EN_M7CLK = 0x0008, 1914 + GLAMO_CLOCK_3D_DG_M6CLK = 0x0010, 1915 + GLAMO_CLOCK_3D_EN_M6CLK = 0x0020, 1916 + GLAMO_CLOCK_3D_2D_RESET = 0x1000, 1917 + GLAMO_CLOCK_3D_CQ_RESET = 0x2000, 1918 +}; 1919 + 1920 +enum glamo_reg_clock_mpeg { 1921 + GLAMO_CLOCK_MPEG_DG_X0CLK = 0x0001, 1922 + GLAMO_CLOCK_MPEG_EN_X0CLK = 0x0002, 1923 + GLAMO_CLOCK_MPEG_DG_X1CLK = 0x0004, 1924 + GLAMO_CLOCK_MPEG_EN_X1CLK = 0x0008, 1925 + GLAMO_CLOCK_MPEG_DG_X2CLK = 0x0010, 1926 + GLAMO_CLOCK_MPEG_EN_X2CLK = 0x0020, 1927 + GLAMO_CLOCK_MPEG_DG_X3CLK = 0x0040, 1928 + GLAMO_CLOCK_MPEG_EN_X3CLK = 0x0080, 1929 + GLAMO_CLOCK_MPEG_DG_X4CLK = 0x0100, 1930 + GLAMO_CLOCK_MPEG_EN_X4CLK = 0x0200, 1931 + GLAMO_CLOCK_MPEG_DG_X6CLK = 0x0400, 1932 + GLAMO_CLOCK_MPEG_EN_X6CLK = 0x0800, 1933 + GLAMO_CLOCK_MPEG_ENC_RESET = 0x1000, 1934 + GLAMO_CLOCK_MPEG_DEC_RESET = 0x2000, 1935 +}; 1936 + 1937 +/* LCD Controller */ 1938 + 1939 +#define REG_LCD(x) (x) 1940 +enum glamo_reg_lcd { 1941 + GLAMO_REG_LCD_MODE1 = REG_LCD(0x00), 1942 + GLAMO_REG_LCD_MODE2 = REG_LCD(0x02), 1943 + GLAMO_REG_LCD_MODE3 = REG_LCD(0x04), 1944 + GLAMO_REG_LCD_WIDTH = REG_LCD(0x06), 1945 + GLAMO_REG_LCD_HEIGHT = REG_LCD(0x08), 1946 + GLAMO_REG_LCD_POLARITY = REG_LCD(0x0a), 1947 + GLAMO_REG_LCD_A_BASE1 = REG_LCD(0x0c), 1948 + GLAMO_REG_LCD_A_BASE2 = REG_LCD(0x0e), 1949 + GLAMO_REG_LCD_B_BASE1 = REG_LCD(0x10), 1950 + GLAMO_REG_LCD_B_BASE2 = REG_LCD(0x12), 1951 + GLAMO_REG_LCD_C_BASE1 = REG_LCD(0x14), 1952 + GLAMO_REG_LCD_C_BASE2 = REG_LCD(0x16), 1953 + GLAMO_REG_LCD_PITCH = REG_LCD(0x18), 1954 + /* RES */ 1955 + GLAMO_REG_LCD_HORIZ_TOTAL = REG_LCD(0x1c), 1956 + /* RES */ 1957 + GLAMO_REG_LCD_HORIZ_RETR_START = REG_LCD(0x20), 1958 + /* RES */ 1959 + GLAMO_REG_LCD_HORIZ_RETR_END = REG_LCD(0x24), 1960 + /* RES */ 1961 + GLAMO_REG_LCD_HORIZ_DISP_START = REG_LCD(0x28), 1962 + /* RES */ 1963 + GLAMO_REG_LCD_HORIZ_DISP_END = REG_LCD(0x2c), 1964 + /* RES */ 1965 + GLAMO_REG_LCD_VERT_TOTAL = REG_LCD(0x30), 1966 + /* RES */ 1967 + GLAMO_REG_LCD_VERT_RETR_START = REG_LCD(0x34), 1968 + /* RES */ 1969 + GLAMO_REG_LCD_VERT_RETR_END = REG_LCD(0x38), 1970 + /* RES */ 1971 + GLAMO_REG_LCD_VERT_DISP_START = REG_LCD(0x3c), 1972 + /* RES */ 1973 + GLAMO_REG_LCD_VERT_DISP_END = REG_LCD(0x40), 1974 + /* RES */ 1975 + GLAMO_REG_LCD_POL = REG_LCD(0x44), 1976 + GLAMO_REG_LCD_DATA_START = REG_LCD(0x46), 1977 + GLAMO_REG_LCD_FRATE_CONTRO = REG_LCD(0x48), 1978 + GLAMO_REG_LCD_DATA_CMD_HDR = REG_LCD(0x4a), 1979 + GLAMO_REG_LCD_SP_START = REG_LCD(0x4c), 1980 + GLAMO_REG_LCD_SP_END = REG_LCD(0x4e), 1981 + GLAMO_REG_LCD_CURSOR_BASE1 = REG_LCD(0x50), 1982 + GLAMO_REG_LCD_CURSOR_BASE2 = REG_LCD(0x52), 1983 + GLAMO_REG_LCD_CURSOR_PITCH = REG_LCD(0x54), 1984 + GLAMO_REG_LCD_CURSOR_X_SIZE = REG_LCD(0x56), 1985 + GLAMO_REG_LCD_CURSOR_Y_SIZE = REG_LCD(0x58), 1986 + GLAMO_REG_LCD_CURSOR_X_POS = REG_LCD(0x5a), 1987 + GLAMO_REG_LCD_CURSOR_Y_POS = REG_LCD(0x5c), 1988 + GLAMO_REG_LCD_CURSOR_PRESET = REG_LCD(0x5e), 1989 + GLAMO_REG_LCD_CURSOR_FG_COLOR = REG_LCD(0x60), 1990 + /* RES */ 1991 + GLAMO_REG_LCD_CURSOR_BG_COLOR = REG_LCD(0x64), 1992 + /* RES */ 1993 + GLAMO_REG_LCD_CURSOR_DST_COLOR = REG_LCD(0x68), 1994 + /* RES */ 1995 + GLAMO_REG_LCD_STATUS1 = REG_LCD(0x80), 1996 + GLAMO_REG_LCD_STATUS2 = REG_LCD(0x82), 1997 + GLAMO_REG_LCD_STATUS3 = REG_LCD(0x84), 1998 + GLAMO_REG_LCD_STATUS4 = REG_LCD(0x86), 1999 + /* RES */ 2000 + GLAMO_REG_LCD_COMMAND1 = REG_LCD(0xa0), 2001 + GLAMO_REG_LCD_COMMAND2 = REG_LCD(0xa2), 2002 + /* RES */ 2003 + GLAMO_REG_LCD_WFORM_DELAY1 = REG_LCD(0xb0), 2004 + GLAMO_REG_LCD_WFORM_DELAY2 = REG_LCD(0xb2), 2005 + /* RES */ 2006 + GLAMO_REG_LCD_GAMMA_CORR = REG_LCD(0x100), 2007 + /* RES */ 2008 + GLAMO_REG_LCD_GAMMA_R_ENTRY01 = REG_LCD(0x110), 2009 + GLAMO_REG_LCD_GAMMA_R_ENTRY23 = REG_LCD(0x112), 2010 + GLAMO_REG_LCD_GAMMA_R_ENTRY45 = REG_LCD(0x114), 2011 + GLAMO_REG_LCD_GAMMA_R_ENTRY67 = REG_LCD(0x116), 2012 + GLAMO_REG_LCD_GAMMA_R_ENTRY8 = REG_LCD(0x118), 2013 + /* RES */ 2014 + GLAMO_REG_LCD_GAMMA_G_ENTRY01 = REG_LCD(0x130), 2015 + GLAMO_REG_LCD_GAMMA_G_ENTRY23 = REG_LCD(0x132), 2016 + GLAMO_REG_LCD_GAMMA_G_ENTRY45 = REG_LCD(0x134), 2017 + GLAMO_REG_LCD_GAMMA_G_ENTRY67 = REG_LCD(0x136), 2018 + GLAMO_REG_LCD_GAMMA_G_ENTRY8 = REG_LCD(0x138), 2019 + /* RES */ 2020 + GLAMO_REG_LCD_GAMMA_B_ENTRY01 = REG_LCD(0x150), 2021 + GLAMO_REG_LCD_GAMMA_B_ENTRY23 = REG_LCD(0x152), 2022 + GLAMO_REG_LCD_GAMMA_B_ENTRY45 = REG_LCD(0x154), 2023 + GLAMO_REG_LCD_GAMMA_B_ENTRY67 = REG_LCD(0x156), 2024 + GLAMO_REG_LCD_GAMMA_B_ENTRY8 = REG_LCD(0x158), 2025 + /* RES */ 2026 + GLAMO_REG_LCD_SRAM_DRIVING1 = REG_LCD(0x160), 2027 + GLAMO_REG_LCD_SRAM_DRIVING2 = REG_LCD(0x162), 2028 + GLAMO_REG_LCD_SRAM_DRIVING3 = REG_LCD(0x164), 2029 +}; 2030 + 2031 +enum glamo_reg_lcd_mode1 { 2032 + GLAMO_LCD_MODE1_PWRSAVE = 0x0001, 2033 + GLAMO_LCD_MODE1_PARTIAL_PRT = 0x0002, 2034 + GLAMO_LCD_MODE1_HWFLIP = 0x0004, 2035 + GLAMO_LCD_MODE1_LCD2 = 0x0008, 2036 + /* RES */ 2037 + GLAMO_LCD_MODE1_PARTIAL_MODE = 0x0020, 2038 + GLAMO_LCD_MODE1_CURSOR_DSTCOLOR = 0x0040, 2039 + GLAMO_LCD_MODE1_PARTIAL_ENABLE = 0x0080, 2040 + GLAMO_LCD_MODE1_TVCLK_IN_ENABLE = 0x0100, 2041 + GLAMO_LCD_MODE1_HSYNC_HIGH_ACT = 0x0200, 2042 + GLAMO_LCD_MODE1_VSYNC_HIGH_ACT = 0x0400, 2043 + GLAMO_LCD_MODE1_HSYNC_FLIP = 0x0800, 2044 + GLAMO_LCD_MODE1_GAMMA_COR_EN = 0x1000, 2045 + GLAMO_LCD_MODE1_DITHER_EN = 0x2000, 2046 + GLAMO_LCD_MODE1_CURSOR_EN = 0x4000, 2047 + GLAMO_LCD_MODE1_ROTATE_EN = 0x8000, 2048 +}; 2049 + 2050 +enum glamo_reg_lcd_mode2 { 2051 + GLAMO_LCD_MODE2_CRC_CHECK_EN = 0x0001, 2052 + GLAMO_LCD_MODE2_DCMD_PER_LINE = 0x0002, 2053 + GLAMO_LCD_MODE2_NOUSE_BDEF = 0x0004, 2054 + GLAMO_LCD_MODE2_OUT_POS_MODE = 0x0008, 2055 + GLAMO_LCD_MODE2_FRATE_CTRL_EN = 0x0010, 2056 + GLAMO_LCD_MODE2_SINGLE_BUFFER = 0x0020, 2057 + GLAMO_LCD_MODE2_SER_LSB_TO_MSB = 0x0040, 2058 + /* FIXME */ 2059 +}; 2060 + 2061 +enum glamo_reg_lcd_mode3 { 2062 + /* LCD color source data format */ 2063 + GLAMO_LCD_SRC_RGB565 = 0x0000, 2064 + GLAMO_LCD_SRC_ARGB1555 = 0x4000, 2065 + GLAMO_LCD_SRC_ARGB4444 = 0x8000, 2066 + /* interface type */ 2067 + GLAMO_LCD_MODE3_LCD = 0x1000, 2068 + GLAMO_LCD_MODE3_RGB = 0x0800, 2069 + GLAMO_LCD_MODE3_CPU = 0x0000, 2070 + /* mode */ 2071 + GLAMO_LCD_MODE3_RGB332 = 0x0000, 2072 + GLAMO_LCD_MODE3_RGB444 = 0x0100, 2073 + GLAMO_LCD_MODE3_RGB565 = 0x0200, 2074 + GLAMO_LCD_MODE3_RGB666 = 0x0300, 2075 + /* depth */ 2076 + GLAMO_LCD_MODE3_6BITS = 0x0000, 2077 + GLAMO_LCD_MODE3_8BITS = 0x0010, 2078 + GLAMO_LCD_MODE3_9BITS = 0x0020, 2079 + GLAMO_LCD_MODE3_16BITS = 0x0030, 2080 + GLAMO_LCD_MODE3_18BITS = 0x0040, 2081 +}; 2082 + 2083 +#endif /* _GLAMO_REGS_H */
Note: See TracChangeset
for help on using the changeset viewer.
