Commit latest Qisda version and Bookeen's modification

This commit is contained in:
mlt
2010-04-23 11:27:04 +00:00
committed by Godzil
parent 2c907884d1
commit f2fd2aec61
75 changed files with 182708 additions and 51781 deletions

View File

@@ -25,6 +25,7 @@
#include <asm/hardware.h>
#include <asm/arch/usb-control.h>
#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-udc-hs.h>
#include <linux/major.h> //Qisda, Leo SJ Yang, 2009/08/31, for 3G power
#if defined(CONFIG_CPU_S3C6400)
@@ -32,6 +33,7 @@
#elif defined(CONFIG_CPU_S3C6410)
#include <asm/arch/regs-s3c6410-clock.h>
#endif
#include <asm/arch/regs-s3c2416-clock.h>
#define USB_HOST_PORT2_EN 0
/*Qisda,Leo SJ Yang,2009/09/09{*/
@@ -46,6 +48,10 @@ extern char g_EMUSBTestIsOK;
#include <asm/arch/regs-usb-otg-hs.h>
#endif
/*Qisda , wenny cheng , 20091224 , board id info {*/
#include <../include/asm-arm/plat-s3c24xx/common-smdk.h>
extern int board_id;
/*Qisda , wenny cheng , 20091224 , board id info }*/
#define valid_port(idx) ((idx) == 1 || (idx) == 2)
@@ -408,6 +414,106 @@ static int s3c_3G_open(struct inode *inode, struct file *file)
{
return 0;
}
/*Qisda Leo SJ Yang,2009/12/10*/
/*Fix the issue, the 3G can not work after playing audio{*/
static int usb20_phy_init(void)
{
long reg=0;
#if 0
s3c2410_gpio_pullup(S3C2443_GPH14, 2); /* usb power pull-up enable */
s3c2410_gpio_pullup(S3C2410_GPF2, 0); /* vbus detect pull-up/down disable */
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
s3c2410_gpio_setpin(S3C2443_GPH14, 1); /* usb power enbale */
#endif
writel(((readl(S3C2410_GPHCON) & ~(1<<29)) | 1<<28), S3C2410_GPHCON);
writel(readl(S3C2410_GPHDAT) |(1<<14), S3C2410_GPHDAT);
writel(((readl(S3C2410_GPHCON) & ~(1<<17)) | 1<<16), S3C2410_GPHCON);
writel(readl(S3C2410_GPHDAT) &~(1<<8), S3C2410_GPHDAT);
writel(((readl(S3C2410_GPHCON) & ~(1<<23)) | 1<<22), S3C2410_GPHCON);
writel(readl(S3C2410_GPHDAT) &~(1<<11), S3C2410_GPHDAT);
writel(((readl(S3C2410_GPGCON) & ~(1<<7)) | 1<<6), S3C2410_GPGCON);
/*Qisda , wenny cheng , 20091224 , board id info {*/
if(board_id==QD090B00_S02)
writel(readl(S3C2410_GPGDAT) |(1<<3), S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info }*/
//s3c2410_gpio_pullup(S3C2410_GPG3, 2); /* usb power enbale */
//mdelay(100);
/*2009/10/21 ,Qisda,Leo SJ Yang*/
/*3G will voltage over 3.6V if charging capcity for 100 msec*/
/*change the time of charging from 100 msec to 65 msec{*/
mdelay(65);
/*}2009/10/21 ,Qisda,Leo SJ Yang*/
writel(readl(S3C2410_GPHDAT) |(1<<11), S3C2410_GPHDAT);
s3c2410_gpio_pullup(S3C2410_GPH11, 2); /* usb power enbale */
mdelay(1);
/*Qisda , wenny cheng , 20091224 , board id info {*/
if(board_id==QD090B00_S02)
writel(readl(S3C2410_GPGDAT) &~(1<<3), S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info }*/
//s3c2410_gpio_pullup(S3C2410_GPG3, 1); /* usb power enbale */
mdelay(1);
writel(((readl(S3C2410_GPHCON) & ~(1<<17)) | 1<<16), S3C2410_GPHCON);
writel(readl(S3C2410_GPHDAT) |(1<<8), S3C2410_GPHDAT);
s3c2410_gpio_pullup(S3C2410_GPH8, 2); /* usb power enbale */
s3c2410_gpio_pullup(S3C2410_GPH9, 2); /* usb power enbale */
#if 0
/* if reset by sleep wakeup, control the retention I/O cell */
if (readl(S3C_RSTSTAT) & 0x8)
writel(readl(S3C_RSTCON)|(1<<16), S3C_RSTCON);
/* USB Port is Normal mode */
writel(readl(S3C2410_MISCCR)&~(1<<12), S3C2410_MISCCR);
/* PHY power enable */
writel(readl(S3C_PWRCFG)|(1<<4), S3C_PWRCFG);
/* USB device 2.0 must reset like bellow,
* 1st phy reset and after at least 10us, func_reset & host reset
* phy reset can reset bellow registers.
*/
/* PHY 2.0 S/W reset */
writel((1<<1)|(0<<0), S3C_URSTCON);
mdelay(1); /* phy reset must be asserted for at 10us */
/*Function 2.0, Host 1.1 S/W reset*/
writel((0<<1)|(1<<0), S3C_URSTCON);
writel((0<<1)|(0<<0), S3C_URSTCON);
/* 48Mhz,Oscillator,External X-tal,device */
writel((0<<3)|(1<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
/* 48Mhz clock on ,PHY2.0 analog block power on
* XO block power on,XO block power in suspend mode,
* PHY 2.0 Pll power on ,suspend signal for save mode disable
*/
writel((1<<31)|(0<<4)|(0<<3)|(0<<2)|(0<<1)|(0<<0), S3C_PHYPWR);
/* D+ pull up disable(VBUS detect), USB2.0 Function clock Disable,
* USB1.1 HOST Enable, USB2.0 PHY test enable
*/
//__raw_writel((0<<31)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
//__raw_writel((1<<31)|(1<<4)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
#endif
//writel((0<<3)|(1<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
reg=readl(S3C_PHYCTRL);
reg|=(1<<1);
writel(reg, S3C_PHYCTRL);
reg=readl(S3C_UCLKCON);
reg|=(1<<4);
writel(reg, S3C_UCLKCON);
return 0;
}
/*}Qisda Leo SJ Yang 2009/12/10 2009/12/10*/
/*Fix the issue, the 3G can not work after playing audio*/
static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
int retval;
@@ -425,8 +531,10 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
writel(readl(S3C2410_GPHDAT) |(1<<8), S3C2410_GPHDAT);
USB_3G_POWER_SAVING = 0;
return 0;
}
}
/*Qisda Leo SJ Yang, 2009/12/10*/
/*Fix the issue, the 3G can not work after playing audio{*/
#if 0
#ifdef CONFIG_QISDA_E600_EVT2
writel(((readl(S3C2410_GPHCON) & ~(1<<29)) | 1<<28), S3C2410_GPHCON);
writel(readl(S3C2410_GPHDAT) |(1<<14), S3C2410_GPHDAT);
@@ -469,7 +577,10 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
writel(readl(S3C2410_GPHDAT) &~(1<<11), S3C2410_GPHDAT);
writel(((readl(S3C2410_GPGCON) & ~(1<<7)) | 1<<6), S3C2410_GPGCON);
/*Qisda , wenny cheng , 20091224 , board id info {*/
if(board_id==QD090B00_S02)
writel(readl(S3C2410_GPGDAT) |(1<<3), S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info }*/
//s3c2410_gpio_pullup(S3C2410_GPG3, 2); /* usb power enbale */
//mdelay(100);
@@ -483,16 +594,23 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
mdelay(1);
writel(readl(S3C2410_GPGDAT) &~(1<<3), S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info {*/
if(board_id==QD090B00_S02)
writel(readl(S3C2410_GPGDAT) &~(1<<3), S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info }*/
//s3c2410_gpio_pullup(S3C2410_GPG3, 1); /* usb power enbale */
mdelay(1);
writel(((readl(S3C2410_GPHCON) & ~(1<<17)) | 1<<16), S3C2410_GPHCON);
writel(readl(S3C2410_GPHDAT) |(1<<8), S3C2410_GPHDAT);
s3c2410_gpio_pullup(S3C2410_GPH8, 2); /* usb power enbale */
s3c2410_gpio_pullup(S3C2410_GPH9, 2); /* usb power enbale */
#endif //CONFIG_QISDA_AS090B00_EVT1_1
#endif
usb20_phy_init();
/*}Qisda Leo SJ Yang 2009/12/10*/
/*Fix the issue,the 3G can not work after playing audio*/
s3c_3Gpower_off = 0;
if(g_phcd==NULL)
{
@@ -594,7 +712,12 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
#if defined(CONFIG_QISDA_AS090B00_EVT1_1)|| defined(CONFIG_QISDA_QD090B00_EVT1)
writel((readl(S3C2410_GPHDAT)&~(1<<11)),S3C2410_GPHDAT);
writel(readl(S3C2410_GPHDAT)&~(1<<8), S3C2410_GPHDAT);
writel((readl(S3C2410_GPGDAT)&~(1<<3)),S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info {*/
if(board_id==QD090B00_S02)
writel((readl(S3C2410_GPGDAT)&~(1<<3)),S3C2410_GPGDAT);
/*Qisda , wenny cheng , 20091224 , board id info }*/
s3c2410_gpio_pullup(S3C2410_GPH11, 1); /* usb power enbale */
s3c2410_gpio_pullup(S3C2410_GPH8, 1); /* usb power enbale */
#endif
@@ -745,7 +868,11 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
writel((readl(S3C2410_GPHDAT)&~(1<<11)),S3C2410_GPHDAT); //on/off
writel(readl(S3C2410_GPHDAT)&~(1<<8), S3C2410_GPHDAT);//disable
writel(readl(S3C2410_GPGDAT)&~(1<<3), S3C2410_GPGDAT);//audio reset
/*Qisda , wenny cheng , 20091224 , board id info {*/
if(board_id==QD090B00_S02)
writel(readl(S3C2410_GPGDAT)&~(1<<3), S3C2410_GPGDAT);//audio reset
/*Qisda , wenny cheng , 20091224 , board id info }*/
#endif
if (register_chrdev (S3C_3G_MAJOR, "s3c_3G_cmd", &s3c_3G_fops)) {