add new fb for 400x240 & 800x480 & buffers
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Linux kernel version: 2.6.33
|
# Linux kernel version: 2.6.33
|
||||||
# Fri Oct 15 21:48:21 2010
|
# Mon Oct 25 23:05:28 2010
|
||||||
#
|
#
|
||||||
CONFIG_ARM=y
|
CONFIG_ARM=y
|
||||||
CONFIG_HAVE_PWM=y
|
CONFIG_HAVE_PWM=y
|
||||||
@@ -86,7 +86,7 @@ CONFIG_USER_NS=y
|
|||||||
CONFIG_PID_NS=y
|
CONFIG_PID_NS=y
|
||||||
CONFIG_NET_NS=y
|
CONFIG_NET_NS=y
|
||||||
CONFIG_BLK_DEV_INITRD=y
|
CONFIG_BLK_DEV_INITRD=y
|
||||||
CONFIG_INITRAMFS_SOURCE="../ramfs-android"
|
CONFIG_INITRAMFS_SOURCE="../ramfs-linux"
|
||||||
CONFIG_INITRAMFS_ROOT_UID=0
|
CONFIG_INITRAMFS_ROOT_UID=0
|
||||||
CONFIG_INITRAMFS_ROOT_GID=0
|
CONFIG_INITRAMFS_ROOT_GID=0
|
||||||
CONFIG_RD_GZIP=y
|
CONFIG_RD_GZIP=y
|
||||||
@@ -309,7 +309,8 @@ CONFIG_G900_LEDS=y
|
|||||||
CONFIG_G900_PHONE=y
|
CONFIG_G900_PHONE=y
|
||||||
CONFIG_G900_POWER_BUTTON=y
|
CONFIG_G900_POWER_BUTTON=y
|
||||||
CONFIG_G900_UDC=y
|
CONFIG_G900_UDC=y
|
||||||
# CONFIG_G900_FLASH is not set
|
CONFIG_G900_FLASH=m
|
||||||
|
# CONFIG_G900_GF5500 is not set
|
||||||
CONFIG_PXA27x=y
|
CONFIG_PXA27x=y
|
||||||
CONFIG_PXA_SSP=y
|
CONFIG_PXA_SSP=y
|
||||||
CONFIG_PLAT_PXA=y
|
CONFIG_PLAT_PXA=y
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ config G900_POWER_BUTTON
|
|||||||
|
|
||||||
|
|
||||||
config G900_UDC
|
config G900_UDC
|
||||||
bool "USB Device Controller support"
|
bool "G900 USB Client Device Controller support"
|
||||||
depends on MACH_G900 && USB_PXA27X
|
depends on MACH_G900 && USB_PXA27X
|
||||||
help
|
help
|
||||||
Enables Tohiba G900 specific USB detection
|
Enables Tohiba G900 specific USB detection
|
||||||
@@ -62,3 +62,10 @@ config G900_FLASH
|
|||||||
depends on MACH_G900
|
depends on MACH_G900
|
||||||
---help---
|
---help---
|
||||||
This is a mDOC flash driver for G900
|
This is a mDOC flash driver for G900
|
||||||
|
|
||||||
|
config G900_GF5500
|
||||||
|
tristate "G900 Goforce 5500 Experemental"
|
||||||
|
depends on MACH_G900
|
||||||
|
---help---
|
||||||
|
This is a Goforce 5500 driver for G900
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,7 @@ obj-$(CONFIG_G900_POWER_BUTTON) += g900_pwr_btn.o
|
|||||||
obj-$(CONFIG_G900_LEDS) += g900_leds.o
|
obj-$(CONFIG_G900_LEDS) += g900_leds.o
|
||||||
obj-$(CONFIG_G900_UDC) += g900_udc.o
|
obj-$(CONFIG_G900_UDC) += g900_udc.o
|
||||||
obj-$(CONFIG_G900_PHONE) += g900_msm6280.o
|
obj-$(CONFIG_G900_PHONE) += g900_msm6280.o
|
||||||
#obj-$(CONFIG_G900_FLASH) += ttfs/
|
#obj-$(CONFIG_G900_GF5500) += gf5500/
|
||||||
|
|
||||||
|
obj-$(CONFIG_G900_FLASH) += docg4.o
|
||||||
obj-m += ttfs/
|
obj-m += ttfs/
|
||||||
|
|||||||
374
kernel-2.6.33/arch/arm/mach-pxa/g900/docg4.c
Executable file
374
kernel-2.6.33/arch/arm/mach-pxa/g900/docg4.c
Executable file
@@ -0,0 +1,374 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/rslib.h>
|
||||||
|
#include <linux/moduleparam.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
#include <linux/semaphore.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/cdev.h>
|
||||||
|
#include <asm/uaccess.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define DoC_G4_IO 0x0800
|
||||||
|
|
||||||
|
#define DoC_G4_ChipID 0x1000
|
||||||
|
#define DoC_G4_DeviceIdSelect 0x100a
|
||||||
|
#define DoC_G4_Ctrl 0x100c
|
||||||
|
|
||||||
|
#define DoC_G4_CtrlConfirm 0x1072
|
||||||
|
#define DoC_G4_ReadAddress 0x101a
|
||||||
|
#define DoC_G4_FlashSelect 0x1032
|
||||||
|
#define DoC_G4_FlashCmd 0x1034
|
||||||
|
#define DoC_G4_FlashAddr 0x1036
|
||||||
|
#define DoC_G4_FlashCtrl 0x1038
|
||||||
|
#define DoC_G4_Nop 0x103e
|
||||||
|
|
||||||
|
#define DOC_MODE_RESET 0x0
|
||||||
|
#define DOC_MODE_NORMAL 0x1
|
||||||
|
#define DOC_MODE_MDWREN 0x4
|
||||||
|
|
||||||
|
|
||||||
|
#define DoC_G4_ID 0x400
|
||||||
|
|
||||||
|
#define CMD_FLASH_RESET 0xff
|
||||||
|
#define DoC_G4_IOREMAP_LEN 0x8000
|
||||||
|
|
||||||
|
static unsigned long doc_config_location = 0x00000000;
|
||||||
|
|
||||||
|
|
||||||
|
#define DOCG4_MAJOR 254
|
||||||
|
#define DOCG4_MINOR 0
|
||||||
|
|
||||||
|
int major,minor;
|
||||||
|
#define SECTOR_SIZE 0x200
|
||||||
|
#define NUM_SECTOR 0xffff
|
||||||
|
#define CHIP_SIZE (0xffff*0x100)
|
||||||
|
|
||||||
|
module_param(doc_config_location, ulong, 0);
|
||||||
|
MODULE_PARM_DESC(doc_config_location, "Physical memory address at which to probe for DiskOnChipg4");
|
||||||
|
|
||||||
|
#define ReadDOC(adr,reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
|
||||||
|
#define ReadDOC_16(adr,reg) ((__u16)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
|
||||||
|
#define ReadDOC_32(adr,reg) ((__u32)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
|
||||||
|
#define WriteDOC(d, adr, reg) do{ \
|
||||||
|
printk("DoC_G4: old = %x WriteDOC(%x,%x,%x)\n", *(volatile __u16 *)(((unsigned long)adr)+((reg))) , d, adr, reg); \
|
||||||
|
*(volatile __u16 *)(((unsigned long)adr)+((reg))) = (__u16)d; wmb();} while(0)
|
||||||
|
|
||||||
|
#define WriteDOC_8(d, adr, reg) do{ \
|
||||||
|
printk("DoC_G4: old = %x WriteDOC_8(%x,%x,%x)\n", *(volatile unsigned char *)(((unsigned long)adr)+((reg))) , d, adr, reg); \
|
||||||
|
*(volatile unsigned char *)(((unsigned long)adr)+((reg))) = (unsigned char)d; wmb();} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
struct DoC_G4_dev {
|
||||||
|
void __iomem *virtaddr;
|
||||||
|
unsigned long physaddr;
|
||||||
|
|
||||||
|
struct cdev cdev;
|
||||||
|
};
|
||||||
|
struct DoC_G4_dev *g4;
|
||||||
|
static void DOCG4_nop(struct DoC_G4_dev *g4) {
|
||||||
|
WriteDOC(0xff,g4->virtaddr,DoC_G4_Nop);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void DOCG4_wait_flash_completion(struct DoC_G4_dev *g4) {
|
||||||
|
__u32 c;
|
||||||
|
int i=0;
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
/* Prepare read */
|
||||||
|
WriteDOC(g4->physaddr+DoC_G4_FlashCtrl,g4->virtaddr,DoC_G4_ReadAddress);
|
||||||
|
c =ReadDOC(g4->virtaddr,DoC_G4_FlashCtrl);
|
||||||
|
while(((c & 0x01) != 0x01) && (i++<300)) {
|
||||||
|
//printk("%x(%x) ",c,c<<31);
|
||||||
|
c =ReadDOC(g4->virtaddr,DoC_G4_FlashCtrl);
|
||||||
|
}
|
||||||
|
// printk("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DOCG4_flash_select(struct DoC_G4_dev *g4,unsigned char f) {
|
||||||
|
WriteDOC(f,g4->virtaddr,DoC_G4_FlashSelect);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DOCG4_flash_cmd(struct DoC_G4_dev *g4,unsigned char c) {
|
||||||
|
WriteDOC(c,g4->virtaddr,DoC_G4_FlashCmd);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DOCG4_reset(struct DoC_G4_dev *g4) {
|
||||||
|
WriteDOC( DOC_MODE_RESET|DOC_MODE_MDWREN,g4->virtaddr,DoC_G4_Ctrl);
|
||||||
|
WriteDOC(~( DOC_MODE_RESET|DOC_MODE_MDWREN),g4->virtaddr, DoC_G4_CtrlConfirm);
|
||||||
|
|
||||||
|
|
||||||
|
WriteDOC( DOC_MODE_NORMAL|DOC_MODE_MDWREN,g4->virtaddr,DoC_G4_Ctrl);
|
||||||
|
WriteDOC( ~(DOC_MODE_NORMAL|DOC_MODE_MDWREN),g4->virtaddr, DoC_G4_CtrlConfirm);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DOCG4_set_read_offset(struct DoC_G4_dev *g4,unsigned char offset) {
|
||||||
|
WriteDOC_8(offset,g4->virtaddr,DoC_G4_FlashAddr);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
}
|
||||||
|
static void DOCG4_set_read_addr(struct DoC_G4_dev *g4, unsigned int addr) {
|
||||||
|
unsigned char tmp;
|
||||||
|
|
||||||
|
tmp = (unsigned char) (addr & 0xFF);
|
||||||
|
//printk("%s: (%x,%x) %x ",__FUNCTION__,addr,offset,tmp);
|
||||||
|
WriteDOC_8(tmp,g4->virtaddr,DoC_G4_FlashAddr);
|
||||||
|
|
||||||
|
tmp = (unsigned char) ((addr>>8) & 0xFF);
|
||||||
|
//printk("%x ",tmp);
|
||||||
|
WriteDOC_8(tmp,g4->virtaddr,DoC_G4_FlashAddr);
|
||||||
|
|
||||||
|
tmp = (unsigned char) ((addr>>16) & 0xFF);
|
||||||
|
//printk("%x ",tmp);
|
||||||
|
WriteDOC_8(tmp,g4->virtaddr,DoC_G4_FlashAddr);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
//DOCG4_set_read_offset(g4,offset);
|
||||||
|
//printk("%x\n",offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DOCG4_enable_stuff(struct DoC_G4_dev *g4) {
|
||||||
|
WriteDOC(0x8a0f,g4->virtaddr,0x1040);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the num the 512 bytes block of the chip flash
|
||||||
|
static void DOCG4_read_sector(struct DoC_G4_dev *g4,int chip,int num,unsigned int *buf) {
|
||||||
|
unsigned int tmp,i,addr;
|
||||||
|
addr= num%0x40 + 0x80*(num/0x40);
|
||||||
|
//printk("DOCG4_read_sector: %x %x %x\n",chip, num, addr);
|
||||||
|
do {
|
||||||
|
DOCG4_flash_select(g4,0x00);
|
||||||
|
DOCG4_flash_cmd(g4,CMD_FLASH_RESET);
|
||||||
|
DOCG4_wait_flash_completion(g4);
|
||||||
|
|
||||||
|
DOCG4_nop(g4);
|
||||||
|
|
||||||
|
DOCG4_flash_select(g4,0x09);
|
||||||
|
DOCG4_flash_cmd(g4,0xa2);
|
||||||
|
DOCG4_flash_cmd(g4,0x22);
|
||||||
|
|
||||||
|
|
||||||
|
DOCG4_flash_select(g4,0xe);
|
||||||
|
DOCG4_flash_cmd(g4,0);
|
||||||
|
DOCG4_flash_select(g4,0x12);
|
||||||
|
if((0x0|addr)==(0x40|addr)) printk("loop for %x\n",addr);
|
||||||
|
|
||||||
|
DOCG4_flash_cmd(g4,0x60);
|
||||||
|
DOCG4_set_read_addr(g4,0x0|addr);
|
||||||
|
|
||||||
|
|
||||||
|
DOCG4_flash_cmd(g4,0x60);
|
||||||
|
DOCG4_set_read_addr(g4,0x40|addr);
|
||||||
|
|
||||||
|
|
||||||
|
//DOCG4_set_read_addr(g4,0x80,0x80);
|
||||||
|
WriteDOC_8(g4->physaddr+DoC_G4_FlashCtrl,g4->virtaddr,DoC_G4_ReadAddress);
|
||||||
|
tmp = ReadDOC(g4->virtaddr,DoC_G4_FlashCtrl);
|
||||||
|
//printk("%x %x\n",tmp,tmp & 0x06);
|
||||||
|
} while(tmp & 0x06); //TODO: timeout
|
||||||
|
|
||||||
|
DOCG4_flash_cmd(g4,0x30);
|
||||||
|
DOCG4_wait_flash_completion(g4);
|
||||||
|
DOCG4_flash_cmd(g4,0x05);
|
||||||
|
if(addr & 1)
|
||||||
|
DOCG4_set_read_offset(g4,0x84); // second block ?
|
||||||
|
else
|
||||||
|
DOCG4_set_read_offset(g4,0x00); // second block ?
|
||||||
|
|
||||||
|
DOCG4_flash_cmd(g4,0xe0);
|
||||||
|
DOCG4_enable_stuff(g4);
|
||||||
|
|
||||||
|
WriteDOC(g4->physaddr+DoC_G4_IO,g4->virtaddr,DoC_G4_ReadAddress);
|
||||||
|
|
||||||
|
for(i=0;i<128;i++) {
|
||||||
|
tmp = ReadDOC_32(g4->virtaddr, DoC_G4_IO+4);
|
||||||
|
buf[i] = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int DOCG4_open(struct inode *inode, struct file *filp)
|
||||||
|
{
|
||||||
|
printk("DOCG4_open\n");
|
||||||
|
//dev = container_of(inode->i_cdev, struct DoC_G4_dev, cdev);
|
||||||
|
filp->private_data = g4; /* for other methods */
|
||||||
|
|
||||||
|
return 0; /* success */
|
||||||
|
}
|
||||||
|
|
||||||
|
int DOCG4_release(struct inode *inode, struct file *filp)
|
||||||
|
{
|
||||||
|
printk("DOCG4_release\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int DOCG4_ioctl(struct inode *inode, struct file *filp,
|
||||||
|
unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
return -ENOTTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
ssize_t DOCG4_read(struct file *filp, char __user *buf, size_t count,
|
||||||
|
loff_t *f_pos)
|
||||||
|
{
|
||||||
|
struct DoC_G4_dev *dev = filp->private_data;
|
||||||
|
int block=0;
|
||||||
|
int chip=0;
|
||||||
|
int n=SECTOR_SIZE;
|
||||||
|
unsigned int buffer[128];
|
||||||
|
loff_t cur = filp->f_pos;
|
||||||
|
//printk("DOCG4_read: %d offset: %llx\n",count,filp->f_pos);
|
||||||
|
|
||||||
|
//chip = ((unsigned int)filp->f_pos) / CHIP_SIZE; //todo
|
||||||
|
if(cur >= 0x4000000) {
|
||||||
|
printk("Failed for %llx %x\n",filp->f_pos,count);
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
if((cur + count) > 0x4000000 ) {
|
||||||
|
printk("truncating %llx %x",cur,count);
|
||||||
|
count = 0x4000000 - cur;
|
||||||
|
printk(" to %x\n",count);
|
||||||
|
}
|
||||||
|
// TODO:
|
||||||
|
// separate reques if over a chip change.
|
||||||
|
do {
|
||||||
|
block = (cur - chip * CHIP_SIZE) / SECTOR_SIZE;
|
||||||
|
//printk("DOCG4_read: %x %x %x\n",chip,block,(( int)filp->f_pos));
|
||||||
|
|
||||||
|
//if(block> NUM_SECTOR) return -EFAULT;
|
||||||
|
|
||||||
|
DOCG4_read_sector(dev,chip,block,buffer);
|
||||||
|
|
||||||
|
if(count < SECTOR_SIZE) n = count;
|
||||||
|
if (copy_to_user(buf,buffer,n))
|
||||||
|
return -EFAULT;
|
||||||
|
//printk("return %d (requested %d)\n",n,count);
|
||||||
|
*f_pos+=n;
|
||||||
|
count-=n;
|
||||||
|
buf +=n;
|
||||||
|
cur +=n;
|
||||||
|
|
||||||
|
}while (count >= SECTOR_SIZE );
|
||||||
|
|
||||||
|
return cur - filp->f_pos;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
loff_t DOCG4_llseek(struct file *filp, loff_t off, int whence)
|
||||||
|
{
|
||||||
|
loff_t newpos;
|
||||||
|
printk("DOCG4_seek\n");
|
||||||
|
switch(whence) {
|
||||||
|
case 0: /* SEEK_SET */
|
||||||
|
newpos = off;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: /* SEEK_CUR */
|
||||||
|
newpos = filp->f_pos + off;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
if (newpos < 0) return -EINVAL;
|
||||||
|
filp->f_pos = newpos;
|
||||||
|
return newpos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct file_operations DOCG4_fops = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.llseek = DOCG4_llseek,
|
||||||
|
.read = DOCG4_read,
|
||||||
|
.ioctl = DOCG4_ioctl,
|
||||||
|
.open = DOCG4_open,
|
||||||
|
.release = DOCG4_release,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static int __init init_DOCG4(void)
|
||||||
|
{
|
||||||
|
static struct DoC_G4_dev s_g4;
|
||||||
|
unsigned int chipId;
|
||||||
|
int i;
|
||||||
|
dev_t dev=0;
|
||||||
|
|
||||||
|
printk("\n----------\nDoC_G4: start\n");
|
||||||
|
|
||||||
|
|
||||||
|
register_chrdev(DOCG4_MAJOR,"DOCG4",&DOCG4_fops);
|
||||||
|
dev = MKDEV(DOCG4_MAJOR,DOCG4_MINOR);
|
||||||
|
|
||||||
|
g4=&s_g4;
|
||||||
|
|
||||||
|
doc_config_location = 0x00000000;
|
||||||
|
|
||||||
|
g4->physaddr = doc_config_location;
|
||||||
|
g4->virtaddr = ioremap(g4->physaddr, DoC_G4_IOREMAP_LEN);
|
||||||
|
if(!g4->virtaddr ) {
|
||||||
|
printk(KERN_ERR "DoC_G4 ioremap failed\n");
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
//devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,"DOCG4");
|
||||||
|
cdev_init(&g4->cdev,&DOCG4_fops);
|
||||||
|
g4->cdev.owner= THIS_MODULE;
|
||||||
|
g4->cdev.ops = &DOCG4_fops;
|
||||||
|
i = cdev_add(&g4->cdev,MKDEV(DOCG4_MAJOR,DOCG4_MINOR),1);
|
||||||
|
if(i)
|
||||||
|
printk("cdev_add failed\n");
|
||||||
|
|
||||||
|
|
||||||
|
//DOCG4_reset(g4);
|
||||||
|
|
||||||
|
|
||||||
|
printk(KERN_ERR "DoC_G4 physaddr = 0x%08x\n",g4->physaddr);
|
||||||
|
|
||||||
|
WriteDOC(g4->physaddr+DoC_G4_ChipID,g4->virtaddr,DoC_G4_ReadAddress);
|
||||||
|
chipId = ReadDOC_16(g4->virtaddr, DoC_G4_ChipID);
|
||||||
|
printk("DoC_G4: chip id=%x\n",chipId);
|
||||||
|
|
||||||
|
|
||||||
|
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,(g4->virtaddr + 0x1000), 0x200);
|
||||||
|
|
||||||
|
if(chipId != DoC_G4_ID) return -1;
|
||||||
|
|
||||||
|
|
||||||
|
printk("Starting flash stuff\n");
|
||||||
|
|
||||||
|
WriteDOC(g4->physaddr+DoC_G4_ChipID,g4->virtaddr,DoC_G4_DeviceIdSelect);
|
||||||
|
WriteDOC(0x39,g4->virtaddr,DoC_G4_FlashCtrl);
|
||||||
|
|
||||||
|
printk("end\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __exit cleanup_DOCG4(void)
|
||||||
|
{
|
||||||
|
cdev_del(&g4->cdev);
|
||||||
|
unregister_chrdev_region(MKDEV(DOCG4_MAJOR,DOCG4_MINOR),1);
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(init_DOCG4);
|
||||||
|
module_exit(cleanup_DOCG4);
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_AUTHOR("Angell Fear");
|
||||||
|
MODULE_DESCRIPTION("Test modules for Diskonchip g4 device description\n");
|
||||||
@@ -587,16 +587,20 @@ static struct platform_device wm9713_codec =
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Core Hardware Functions */
|
|
||||||
|
|
||||||
struct platform_device g900_core = {
|
struct platform_device g900_core = {
|
||||||
.name = "g900-core",
|
.name = "g900-core",
|
||||||
.id = 0,
|
|
||||||
.dev = {
|
.dev = {
|
||||||
.platform_data = NULL,
|
.platform_data = NULL,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct platform_device g900_gf5500 = {
|
||||||
|
.name = "goforce5500",
|
||||||
|
.dev = {
|
||||||
|
.platform_data = PXA_CS5_PHYS,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_device *g900_devices[] __initdata = {
|
static struct platform_device *g900_devices[] __initdata = {
|
||||||
&g900_keyboard,
|
&g900_keyboard,
|
||||||
&g900_button,
|
&g900_button,
|
||||||
@@ -606,6 +610,7 @@ static struct platform_device *g900_devices[] __initdata = {
|
|||||||
&g900_sound,
|
&g900_sound,
|
||||||
&g900_core,
|
&g900_core,
|
||||||
&g900_udc,
|
&g900_udc,
|
||||||
|
&g900_gf5500,
|
||||||
//&g900_flash,
|
//&g900_flash,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -680,31 +685,34 @@ static void __init g900_init(void)
|
|||||||
//g900_reset_bluetooth();
|
//g900_reset_bluetooth();
|
||||||
//wifi_power();
|
//wifi_power();
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
void __init g900_fixup(struct machine_desc *desc,
|
|
||||||
struct tag *tags, char **cmdline, struct meminfo *mi)
|
|
||||||
{
|
|
||||||
//sharpsl_save_param();
|
|
||||||
mi->nr_banks=2;
|
|
||||||
mi->bank[0].start = 0xa0000000;
|
|
||||||
mi->bank[0].node = 0;
|
|
||||||
mi->bank[0].size = (64*1024*1024);
|
|
||||||
mi->bank[1].start = 0xb0000000;
|
|
||||||
mi->bank[1].node = 1;
|
|
||||||
mi->bank[1].size = (64*1024*1024);
|
|
||||||
|
|
||||||
|
void __init g900_fixup(struct machine_desc *mdesc, struct tag *tags,
|
||||||
|
char **cmdline, struct meminfo *mi)
|
||||||
|
{
|
||||||
|
mi->nr_banks = 2;
|
||||||
|
mi->bank[0].start = 0xa0000000;
|
||||||
|
mi->bank[0].node = 0;
|
||||||
|
mi->bank[0].size = (64*1024*1024);
|
||||||
|
mi->bank[1].start = 0xb0000000;
|
||||||
|
mi->bank[1].node = 1;
|
||||||
|
mi->bank[1].size = (64*1024*1024);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
MACHINE_START(G900, "Toshiba G900")
|
MACHINE_START(G900, "Toshiba G900")
|
||||||
|
|
||||||
.phys_io = 0x40000000,
|
.phys_io = 0x40000000,
|
||||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
|
||||||
.boot_params = 0xa0000100,
|
.boot_params = 0xa0000100,
|
||||||
// .fixup = g900_fixup,
|
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||||
.map_io = g900_map_io,
|
.map_io = g900_map_io,
|
||||||
.init_irq = g900_init_irq,
|
.init_irq = g900_init_irq,
|
||||||
.timer = &pxa_timer,
|
.timer = &pxa_timer,
|
||||||
.init_machine = g900_init,
|
.init_machine = g900_init,
|
||||||
|
.fixup = g900_fixup,
|
||||||
MACHINE_END
|
MACHINE_END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
|
|
||||||
#define BTN_POWER GPIO3_BTN_nPower
|
#define BTN_POWER GPIO3_BTN_nPower
|
||||||
|
|
||||||
|
static unsigned int noreset;
|
||||||
|
module_param(noreset, uint, 0);
|
||||||
|
MODULE_PARM_DESC(noreset, "Set 0 = reset, any = no action)"); /* TODO add pm suspend action */
|
||||||
|
|
||||||
static void cpu_hw_reset(void)
|
static void cpu_hw_reset(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -43,7 +47,11 @@ static irqreturn_t pwr_btn_irq(int irq, void *dev_id)
|
|||||||
if(state){
|
if(state){
|
||||||
printk("g900-power-button: unpress");
|
printk("g900-power-button: unpress");
|
||||||
}else{
|
}else{
|
||||||
cpu_hw_reset();
|
if(noreset == 0 )
|
||||||
|
{
|
||||||
|
cpu_hw_reset();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
printk("g900-power-button: state=%d\n", state);
|
printk("g900-power-button: state=%d\n", state);
|
||||||
|
|
||||||
|
|||||||
2
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/Makefile
Executable file
2
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/Makefile
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#obj-y += goforce5500.o
|
||||||
|
#obj-y += libgfsdk.o
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
#define TS_POLL_PERIOD 1000 /* us delay between samples */
|
#define TS_POLL_PERIOD 1000 /* us delay between samples */
|
||||||
#define AK4183_12BIT 1 /*12 bit resolution*/
|
#define AK4183_12BIT 1 /*12 bit resolution*/
|
||||||
|
|
||||||
#define devdbg(x...) printk(x)
|
#define devdbg(x...)
|
||||||
|
//printk(x)
|
||||||
|
|
||||||
|
|
||||||
#define AK4183_BIT_S (0x1 << 7)
|
#define AK4183_BIT_S (0x1 << 7)
|
||||||
|
|||||||
@@ -38,20 +38,37 @@
|
|||||||
#include <asm/fb.h>
|
#include <asm/fb.h>
|
||||||
|
|
||||||
|
|
||||||
#define FB_WIDTH 480
|
#define FB_WIDTH 480
|
||||||
#define FB_HEIGHT 800
|
#define FB_HEIGHT 800
|
||||||
#define VIDEOMEMSTART 0x0a000000 /* vram variable value from HaRET */
|
|
||||||
#define FB_NUMBER_OF_BUFFERS 1
|
|
||||||
|
#define VIDEOMEMSTART 0x0a000000
|
||||||
#define FB_BYTES_PER_PIXEL 2
|
#define FB_BYTES_PER_PIXEL 2
|
||||||
#define VIDEOMEMBUFSIZE FB_WIDTH * FB_HEIGHT * FB_BYTES_PER_PIXEL
|
|
||||||
#define VIDEOMEMSIZE VIDEOMEMBUFSIZE * FB_NUMBER_OF_BUFFERS
|
#define VIDEOMEMSIZE FB_WIDTH * FB_HEIGHT * FB_BYTES_PER_PIXEL * 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void *videomemory;
|
static void *videomemory;
|
||||||
static u_long videomemorysize = VIDEOMEMSIZE * FB_NUMBER_OF_BUFFERS;
|
static u_long videomemorysize = VIDEOMEMSIZE ;
|
||||||
module_param(videomemorysize, ulong, 0);
|
module_param(videomemorysize, ulong, 0);
|
||||||
|
|
||||||
|
static int g900fb_enable __initdata = 1; /* disabled by default */
|
||||||
|
module_param(g900fb_enable, bool, 0);
|
||||||
|
|
||||||
|
|
||||||
|
static unsigned int lowres;
|
||||||
|
module_param(lowres, uint, 0);
|
||||||
|
MODULE_PARM_DESC(lowres, "Set 0 = 800/480, 1 = 400x240)");
|
||||||
|
|
||||||
|
static unsigned int buffers;
|
||||||
|
module_param(buffers, uint, 0);
|
||||||
|
MODULE_PARM_DESC(buffers, "Set num buffers (min 1, max 2)");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct g900_fb {
|
struct g900_fb {
|
||||||
int rotation;
|
int rotation;
|
||||||
struct fb_info fb;
|
struct fb_info fb;
|
||||||
@@ -60,16 +77,10 @@ struct g900_fb {
|
|||||||
|
|
||||||
static struct fb_var_screeninfo g900fb_default __initdata = {
|
static struct fb_var_screeninfo g900fb_default __initdata = {
|
||||||
|
|
||||||
.xres = FB_WIDTH,
|
|
||||||
.yres = FB_HEIGHT,
|
|
||||||
.xres_virtual = FB_WIDTH,
|
|
||||||
.yres_virtual = FB_HEIGHT,
|
|
||||||
.bits_per_pixel = 16,
|
.bits_per_pixel = 16,
|
||||||
.red = { 11, 5, 0 },
|
.red = { 11, 5, 0 },
|
||||||
.green = { 5, 6, 0 },
|
.green = { 5, 6, 0 },
|
||||||
.blue = { 0, 5, 0 },
|
.blue = { 0, 5, 0 },
|
||||||
.height = FB_HEIGHT,
|
|
||||||
.width = FB_WIDTH,
|
|
||||||
.accel_flags = FB_ACCEL_NONE,
|
.accel_flags = FB_ACCEL_NONE,
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -79,16 +90,15 @@ static struct fb_fix_screeninfo g900fb_fix __initdata = {
|
|||||||
.type = FB_TYPE_PACKED_PIXELS,
|
.type = FB_TYPE_PACKED_PIXELS,
|
||||||
.visual = FB_VISUAL_TRUECOLOR,
|
.visual = FB_VISUAL_TRUECOLOR,
|
||||||
.accel = FB_ACCEL_NONE,
|
.accel = FB_ACCEL_NONE,
|
||||||
.xpanstep = 1,
|
.xpanstep = 1, /* 1 */
|
||||||
.ypanstep = 1,
|
.ypanstep = 1, /* 1 */
|
||||||
.ywrapstep = 0,
|
.ywrapstep = 0,
|
||||||
.smem_start = VIDEOMEMSTART,
|
.smem_start = VIDEOMEMSTART,
|
||||||
.smem_len = VIDEOMEMSIZE,
|
.smem_len = VIDEOMEMSIZE,
|
||||||
.line_length = FB_WIDTH * FB_BYTES_PER_PIXEL,
|
.line_length = (FB_WIDTH * FB_BYTES_PER_PIXEL),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int g900fb_enable __initdata = 1; /* disabled by default */
|
|
||||||
module_param(g900fb_enable, bool, 0);
|
|
||||||
|
|
||||||
static int g900fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info);
|
static int g900fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info);
|
||||||
//static int g900fb_set_par(struct fb_info *info);
|
//static int g900fb_set_par(struct fb_info *info);
|
||||||
@@ -121,8 +131,7 @@ static void g900fb_imageblit(struct fb_info *info, const struct fb_image *image)
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static int g900fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
|
//static int g900fb_mmap(struct fb_info *info, struct vm_area_struct *vma);
|
||||||
{};
|
|
||||||
|
|
||||||
|
|
||||||
static struct fb_ops g900fb_ops = {
|
static struct fb_ops g900fb_ops = {
|
||||||
@@ -152,13 +161,13 @@ static inline u32 convert_bitfield(int val, struct fb_bitfield *bf)
|
|||||||
static int g900fb_check_var(struct fb_var_screeninfo *var,
|
static int g900fb_check_var(struct fb_var_screeninfo *var,
|
||||||
struct fb_info *info)
|
struct fb_info *info)
|
||||||
{
|
{
|
||||||
|
//return 0;
|
||||||
if((var->rotate & 1) != (info->var.rotate & 1)) {
|
if((var->rotate & 1) != (info->var.rotate & 1)) {
|
||||||
if((var->xres != info->var.yres) ||
|
if((var->xres != info->var.yres) ||
|
||||||
(var->yres != info->var.xres) ||
|
(var->yres != info->var.xres) ||
|
||||||
(var->xres_virtual != info->var.yres) ||
|
(var->xres_virtual != info->var.yres) ||
|
||||||
(var->yres_virtual >
|
(var->yres_virtual >
|
||||||
info->var.xres * FB_NUMBER_OF_BUFFERS) ||
|
info->var.xres * buffers) ||
|
||||||
(var->yres_virtual < info->var.xres )) {
|
(var->yres_virtual < info->var.xres )) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -167,7 +176,7 @@ static int g900fb_check_var(struct fb_var_screeninfo *var,
|
|||||||
(var->yres != info->var.yres) ||
|
(var->yres != info->var.yres) ||
|
||||||
(var->xres_virtual != info->var.xres) ||
|
(var->xres_virtual != info->var.xres) ||
|
||||||
(var->yres_virtual >
|
(var->yres_virtual >
|
||||||
info->var.yres * FB_NUMBER_OF_BUFFERS) ||
|
info->var.yres * buffers) ||
|
||||||
(var->yres_virtual < info->var.yres )) {
|
(var->yres_virtual < info->var.yres )) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -223,8 +232,28 @@ static int g900fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
|
|||||||
static int g900fb_pan_display(struct fb_var_screeninfo *var,
|
static int g900fb_pan_display(struct fb_var_screeninfo *var,
|
||||||
struct fb_info *info)
|
struct fb_info *info)
|
||||||
{
|
{
|
||||||
|
/* TODO find hardware flip page or copyarea*/
|
||||||
|
u32 len;
|
||||||
|
if(buffers != 2 ) return 0;
|
||||||
|
if(info->var.yoffset < var->yres) return 0;
|
||||||
|
|
||||||
|
len = var->yoffset * info->fix.line_length;
|
||||||
|
memcpy(info->screen_base, (info->screen_base + len), len);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
#if 0
|
||||||
struct fb_copyarea fbca;
|
struct fb_copyarea fbca;
|
||||||
return 0;
|
memset(&fbca, 0, sizeof(fbca));
|
||||||
|
fbca.sx = 0;
|
||||||
|
fbca.sy = info->var->yres;
|
||||||
|
fbca.dx = 0;
|
||||||
|
fbca.dy = 0;
|
||||||
|
fbca.width = info->var.yres*(lowres+1);
|
||||||
|
fbca.height = info->var.xres;
|
||||||
|
cfb_copyarea(info,&fbca);
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -246,12 +275,28 @@ static int __init g900fb_probe(struct platform_device *dev)
|
|||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(lowres != 1 ) lowres = 0;
|
||||||
|
if(buffers != 2 ) buffers = 1;
|
||||||
|
|
||||||
fb->fb.flags = FBINFO_FLAG_DEFAULT;
|
fb->fb.flags = FBINFO_FLAG_DEFAULT;
|
||||||
fb->fb.fbops = &g900fb_ops;
|
fb->fb.fbops = &g900fb_ops;
|
||||||
fb->fb.pseudo_palette = fb->cmap;
|
fb->fb.pseudo_palette = fb->cmap;
|
||||||
fb->fb.fix = g900fb_fix;
|
fb->fb.fix = g900fb_fix;
|
||||||
fb->fb.var = g900fb_default;
|
fb->fb.var = g900fb_default;
|
||||||
|
|
||||||
|
if(lowres == 1)
|
||||||
|
{
|
||||||
|
fb->fb.var.xres = FB_WIDTH / 2;
|
||||||
|
fb->fb.var.yres = FB_HEIGHT / 2;
|
||||||
|
}else{
|
||||||
|
fb->fb.var.xres = FB_WIDTH;
|
||||||
|
fb->fb.var.yres = FB_HEIGHT;
|
||||||
|
}
|
||||||
|
fb->fb.var.xres_virtual = fb->fb.var.xres;
|
||||||
|
fb->fb.var.yres_virtual = fb->fb.var.yres*buffers;
|
||||||
|
fb->fb.var.height = fb->fb.var.xres;
|
||||||
|
fb->fb.var.width = fb->fb.var.yres;
|
||||||
|
|
||||||
fb->fb.screen_base = ioremap(VIDEOMEMSTART, videomemorysize);
|
fb->fb.screen_base = ioremap(VIDEOMEMSTART, videomemorysize);
|
||||||
|
|
||||||
retval = fb_set_var(&fb->fb, &fb->fb.var);
|
retval = fb_set_var(&fb->fb, &fb->fb.var);
|
||||||
|
|||||||
6
ramfs-android/default.prop
Normal file → Executable file
6
ramfs-android/default.prop
Normal file → Executable file
@@ -5,6 +5,10 @@ ro.secure=0
|
|||||||
ro.allow.mock.location=1
|
ro.allow.mock.location=1
|
||||||
ro.debuggable=1
|
ro.debuggable=1
|
||||||
persist.service.adb.enable=1
|
persist.service.adb.enable=1
|
||||||
ro.sf.lcd_density=210
|
# for 800x480
|
||||||
|
#ro.sf.lcd_density=210
|
||||||
|
# for 400x240
|
||||||
|
ro.sf.lcd_density=105
|
||||||
|
|
||||||
#dalvik.vm.heapsize=10m
|
#dalvik.vm.heapsize=10m
|
||||||
|
|
||||||
|
|||||||
@@ -122,15 +122,30 @@ fi
|
|||||||
|
|
||||||
dmesg > /sdcard/ANDROID/kernel.log
|
dmesg > /sdcard/ANDROID/kernel.log
|
||||||
|
|
||||||
#export LD_PRELOAD=/system/lib/libts.so:/system/lib/ts/pthres.so
|
default.prop
|
||||||
#if [ -f /sdcard/ts ] ; then
|
|
||||||
# echo "EXECUTE CALIBRATE TOUCHSCREEN!!!"
|
#
|
||||||
# /bin/mkdir -m 0777 /data/system/tslib
|
# ADDITIONAL_DEFAULT_PROPERTIES
|
||||||
# /system/bin/ts_calibrate
|
#
|
||||||
# /bin/rm /sdcard/ts
|
|
||||||
#fi
|
echo "ro.secure=0" > /default.prop
|
||||||
|
echo "ro.allow.mock.location=1" >> /default.prop
|
||||||
|
echo "ro.debuggable=1" >> /default.prop
|
||||||
|
echo "persist.service.adb.enable=1" >> /default.prop
|
||||||
|
|
||||||
|
LOWRES=`/bin/grep -o "g900fb.lowres=1" /proc/cmdline`
|
||||||
|
if [ "$LOWRES" != "" ] ; then
|
||||||
|
# for 400x240
|
||||||
|
echo "ro.sf.lcd_density=105" >> /default.prop
|
||||||
|
else
|
||||||
|
# for 800x480
|
||||||
|
echo "ro.sf.lcd_density=210" >> /default.prop
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#echo "dalvik.vm.heapsize=10m" >> /default.prop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#exec /bin/sh
|
|
||||||
exec /init_1
|
exec /init_1
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user