mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-18 09:32:40 -05:00
* Use proper definitions for the PP (mono) LCD bridge. * Clean up pp5002.h a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15018 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1dd9febe0e
commit
1f0d06f085
4 changed files with 34 additions and 45 deletions
|
|
@ -22,16 +22,14 @@
|
||||||
/* Much info gleaned and/or copied from the iPodLinux project. */
|
/* Much info gleaned and/or copied from the iPodLinux project. */
|
||||||
#define DRAM_START 0x28000000
|
#define DRAM_START 0x28000000
|
||||||
|
|
||||||
#define PROCESSOR_ID (*(volatile unsigned long *)(0xc4000000))
|
/* LCD bridge */
|
||||||
|
#define LCD1_BASE (*(volatile unsigned long *)(0xc0001000))
|
||||||
|
#define LCD1_CMD (*(volatile unsigned long *)(0xc0001008))
|
||||||
|
#define LCD1_DATA (*(volatile unsigned long *)(0xc0001010))
|
||||||
|
|
||||||
#define IPOD_LCD_BASE 0xc0001000
|
#define LCD1_BUSY_MASK 0x8000
|
||||||
|
|
||||||
/* Processor ID */
|
|
||||||
#define PROCESSOR_ID (*(volatile unsigned long *)(0xc4000000))
|
|
||||||
|
|
||||||
#define PROC_ID_CPU 0x55
|
|
||||||
#define PROC_ID_COP 0xaa
|
|
||||||
|
|
||||||
|
/* I2S controller */
|
||||||
#define IISCONFIG (*(volatile unsigned long *)(0xc0002500))
|
#define IISCONFIG (*(volatile unsigned long *)(0xc0002500))
|
||||||
#define IISFIFO_CFG (*(volatile unsigned long *)(0xc000251c))
|
#define IISFIFO_CFG (*(volatile unsigned long *)(0xc000251c))
|
||||||
#define IISFIFO_WR (*(volatile unsigned long *)(0xc0002540))
|
#define IISFIFO_WR (*(volatile unsigned long *)(0xc0002540))
|
||||||
|
|
@ -46,8 +44,6 @@
|
||||||
#define IIS_IRQTX_REG IISFIFO_CFG
|
#define IIS_IRQTX_REG IISFIFO_CFG
|
||||||
#define IIS_IRQTX (1 << 9)
|
#define IIS_IRQTX (1 << 9)
|
||||||
|
|
||||||
#define I2C_BASE 0xc0008000
|
|
||||||
|
|
||||||
#define IDE_BASE 0xc0003000
|
#define IDE_BASE 0xc0003000
|
||||||
|
|
||||||
#define IDE_CFG_STATUS (*(volatile unsigned long *)(0xc0003024))
|
#define IDE_CFG_STATUS (*(volatile unsigned long *)(0xc0003024))
|
||||||
|
|
@ -56,6 +52,12 @@
|
||||||
|
|
||||||
#define I2C_BASE 0xc0008000
|
#define I2C_BASE 0xc0008000
|
||||||
|
|
||||||
|
/* Processor ID */
|
||||||
|
#define PROCESSOR_ID (*(volatile unsigned long *)(0xc4000000))
|
||||||
|
|
||||||
|
#define PROC_ID_CPU 0x55
|
||||||
|
#define PROC_ID_COP 0xaa
|
||||||
|
|
||||||
#define GPIOA_ENABLE (*(volatile unsigned char *)(0xcf000000))
|
#define GPIOA_ENABLE (*(volatile unsigned char *)(0xcf000000))
|
||||||
#define GPIOB_ENABLE (*(volatile unsigned char *)(0xcf000004))
|
#define GPIOB_ENABLE (*(volatile unsigned char *)(0xcf000004))
|
||||||
#define GPIOC_ENABLE (*(volatile unsigned char *)(0xcf000008))
|
#define GPIOC_ENABLE (*(volatile unsigned char *)(0xcf000008))
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,13 @@
|
||||||
|
|
||||||
/* Note: didn't bother to see of levels 0 and 16 actually work */
|
/* Note: didn't bother to see of levels 0 and 16 actually work */
|
||||||
|
|
||||||
|
/* First ("mono") LCD bridge */
|
||||||
|
#define LCD1_BASE (*(volatile unsigned long *)(0x70003000))
|
||||||
|
#define LCD1_CMD (*(volatile unsigned long *)(0x70003008))
|
||||||
|
#define LCD1_DATA (*(volatile unsigned long *)(0x70003010))
|
||||||
|
|
||||||
|
#define LCD1_BUSY_MASK 0x8000
|
||||||
|
|
||||||
/* Serial Controller */
|
/* Serial Controller */
|
||||||
#define SERIAL0 (*(volatile unsigned long*)(0x70006000))
|
#define SERIAL0 (*(volatile unsigned long*)(0x70006000))
|
||||||
#define SERIAL1 (*(volatile unsigned long*)(0x70006040))
|
#define SERIAL1 (*(volatile unsigned long*)(0x70006040))
|
||||||
|
|
|
||||||
|
|
@ -30,19 +30,6 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "hwcompat.h"
|
#include "hwcompat.h"
|
||||||
|
|
||||||
|
|
||||||
/*** hardware configuration ***/
|
|
||||||
|
|
||||||
#if CONFIG_CPU == PP5002
|
|
||||||
#define IPOD_LCD_BASE 0xc0001000
|
|
||||||
#else /* PP502x */
|
|
||||||
#define IPOD_LCD_BASE 0x70003000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LCD_BUSY_MASK 0x00008000
|
|
||||||
#define LCD_CMD 0x08
|
|
||||||
#define LCD_DATA 0x10
|
|
||||||
|
|
||||||
/* LCD command codes for HD66753 */
|
/* LCD command codes for HD66753 */
|
||||||
|
|
||||||
#define R_START_OSC 0x00
|
#define R_START_OSC 0x00
|
||||||
|
|
@ -97,7 +84,7 @@ static const unsigned char dibits[16] ICONST_ATTR = {
|
||||||
/* wait for LCD with timeout */
|
/* wait for LCD with timeout */
|
||||||
static inline void lcd_wait_write(void)
|
static inline void lcd_wait_write(void)
|
||||||
{
|
{
|
||||||
while (inl(IPOD_LCD_BASE) & LCD_BUSY_MASK);
|
while (LCD1_BASE & LCD1_BUSY_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send LCD data */
|
/* send LCD data */
|
||||||
|
|
@ -109,11 +96,11 @@ static void lcd_send_data(unsigned data)
|
||||||
{
|
{
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
#ifdef IPOD_MINI2G
|
#ifdef IPOD_MINI2G
|
||||||
outl(data | 0x760000, IPOD_LCD_BASE+8);
|
LCD1_CMD = data | 0x760000;
|
||||||
#else
|
#else
|
||||||
outl(data >> 8, IPOD_LCD_BASE + LCD_DATA);
|
LCD1_DATA = data >> 8;
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
outl(data & 0xff, IPOD_LCD_BASE + LCD_DATA);
|
LCD1_DATA = data & 0xff;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,11 +109,11 @@ static void lcd_prepare_cmd(unsigned cmd)
|
||||||
{
|
{
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
#ifdef IPOD_MINI2G
|
#ifdef IPOD_MINI2G
|
||||||
outl(cmd | 0x740000, IPOD_LCD_BASE+8);
|
LCD1_CMD = cmd | 0x740000;
|
||||||
#else
|
#else
|
||||||
outl(0x0, IPOD_LCD_BASE + LCD_CMD);
|
LCD1_CMD = 0;
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
outl(cmd, IPOD_LCD_BASE + LCD_CMD);
|
LCD1_CMD = cmd;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,7 +155,7 @@ void lcd_init_device(void)
|
||||||
power_reg_h = 0x1100;
|
power_reg_h = 0x1100;
|
||||||
#elif defined IPOD_MINI2G
|
#elif defined IPOD_MINI2G
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
outl((inl(IPOD_LCD_BASE) & ~0x1f00000) | 0x1700000, IPOD_LCD_BASE);
|
LCD1_BASE = (LCD1_BASE & ~0x1f00000) | 0x1700000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcd_cmd_and_data(R_POWER_CONTROL, POWER_REG_H | 0xc);
|
lcd_cmd_and_data(R_POWER_CONTROL, POWER_REG_H | 0xc);
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,6 @@
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#define LCD_BASE (*(volatile unsigned long *)(0x70003000))
|
|
||||||
#define LCD_CMD (*(volatile unsigned long *)(0x70003008))
|
|
||||||
#define LCD_DATA (*(volatile unsigned long *)(0x70003010))
|
|
||||||
|
|
||||||
#define LCD_BUSY 0x8000
|
|
||||||
|
|
||||||
/* LCD command set for Samsung S6B33B2 */
|
/* LCD command set for Samsung S6B33B2 */
|
||||||
|
|
||||||
#define R_OSCILLATION_MODE 0x02
|
#define R_OSCILLATION_MODE 0x02
|
||||||
|
|
@ -68,24 +62,23 @@
|
||||||
/* wait for LCD */
|
/* wait for LCD */
|
||||||
static inline void lcd_wait_write(void)
|
static inline void lcd_wait_write(void)
|
||||||
{
|
{
|
||||||
while (LCD_BASE & LCD_BUSY);
|
while (LCD1_BASE & LCD1_BUSY_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send LCD data */
|
/* send LCD data */
|
||||||
static void lcd_send_data(unsigned data)
|
static void lcd_send_data(unsigned data)
|
||||||
{
|
{
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
LCD_DATA = data >> 8;
|
LCD1_DATA = data >> 8;
|
||||||
|
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
LCD_DATA = data & 0xff;
|
LCD1_DATA = data & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send LCD command */
|
/* send LCD command */
|
||||||
static void lcd_send_command(unsigned cmd)
|
static void lcd_send_command(unsigned cmd)
|
||||||
{
|
{
|
||||||
lcd_wait_write();
|
lcd_wait_write();
|
||||||
LCD_CMD = cmd;
|
LCD1_CMD = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LCD init */
|
/* LCD init */
|
||||||
|
|
@ -98,13 +91,13 @@ void lcd_init_device(void)
|
||||||
DEV_INIT &= ~0x400;
|
DEV_INIT &= ~0x400;
|
||||||
udelay(10000);
|
udelay(10000);
|
||||||
|
|
||||||
LCD_BASE &= ~0x4;
|
LCD1_BASE &= ~0x4;
|
||||||
udelay(15);
|
udelay(15);
|
||||||
|
|
||||||
LCD_BASE |= 0x4;
|
LCD1_BASE |= 0x4;
|
||||||
udelay(10);
|
udelay(10);
|
||||||
|
|
||||||
LCD_BASE = 0x4687;
|
LCD1_BASE = 0x4687;
|
||||||
udelay(10000);
|
udelay(10000);
|
||||||
|
|
||||||
lcd_send_command(R_STANDBY_OFF);
|
lcd_send_command(R_STANDBY_OFF);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue