1 diff -Nur c3000_pre/linux/arch/arm/config.in c3000_work/linux/arch/arm/config.in
2 --- c3000_pre/linux/arch/arm/config.in 2005-02-21 21:41:40.000000000 +0900
3 +++ c3000_work/linux/arch/arm/config.in 2005-02-21 22:25:37.000000000 +0900
5 if [ "$CONFIG_ARCH_PXA_SPITZ" = "y" ]; then
6 bool 'Use clock change(cccr_change) enable (EXPERIMENTAL)' CONFIG_SL_CCCR_CHANGE
8 + if [ "$CONFIG_SL_CCCR_CHANGE" = "y" ]; then
9 + bool 'Core voltage change enable (EXPERIMENTAL)' CONFIG_CHANGE_CORE_VOLT
11 if [ "$CONFIG_ARCH_SHARP_SL" = "y" ]; then
12 define_bool CONFIG_BATT y
14 diff -Nur c3000_pre/linux/arch/arm/mach-pxa/pxa27x_power.c c3000_work/linux/arch/arm/mach-pxa/pxa27x_power.c
15 --- c3000_pre/linux/arch/arm/mach-pxa/pxa27x_power.c 2004-11-04 14:13:54.000000000 +0900
16 +++ c3000_work/linux/arch/arm/mach-pxa/pxa27x_power.c 2005-02-21 22:25:37.000000000 +0900
18 extern int sharpsl_main_bk_flag;
19 int sharpsl_request_off = 0;
21 +#if defined(CONFIG_CHANGE_CORE_VOLT)
22 +static unsigned char current_core_voltage = 0x1a;
25 void PrintParamTable(void);
27 int sharpsl_restart(void)
33 +#if defined(DEBUG) || defined(CONFIG_CHANGE_CORE_VOLT)
34 int pwr_i2c_read( unsigned char device, unsigned char *value )
38 static void cpu_xscale_voltage_high(void)
41 +#if defined(CONFIG_CHANGE_CORE_VOLT)
42 + pwr_i2c_write( 0x0c, current_core_voltage );
44 + printk("current voltage %x\n", current_core_voltage );
46 pwr_i2c_write( 0x0c, 0x1a ); // 1.35V - SlewRate 1
51 +#if defined(CONFIG_CHANGE_CORE_VOLT)
52 +void cpu_xscale_voltage_write(unsigned char value)
58 + pwr_i2c_write( 0x0c, value );
60 + current_core_voltage = value;
61 + printk("current voltage %x\n", current_core_voltage );
67 -static unsigned char cpu_xscale_voltage_read(void)
68 +#if defined(DEBUG) || defined(CONFIG_CHANGE_CORE_VOLT)
69 +unsigned char cpu_xscale_voltage_read(void)
71 unsigned char value=0xff;
80 #define CLKCFG(a) asm("mrc p14, 0, %0, C6, C0, 0" : "=r"(a))
81 static void __debug_printk(void)
83 diff -Nur c3000_pre/linux/arch/arm/mach-pxa/sharpsl_apm.c c3000_work/linux/arch/arm/mach-pxa/sharpsl_apm.c
84 --- c3000_pre/linux/arch/arm/mach-pxa/sharpsl_apm.c 2005-02-21 21:44:13.000000000 +0900
85 +++ c3000_work/linux/arch/arm/mach-pxa/sharpsl_apm.c 2005-02-21 22:29:17.000000000 +0900
87 struct proc_dir_entry *proc_zaurus;
90 +#if defined(CONFIG_CHANGE_CORE_VOLT)
91 +extern unsigned char cpu_xscale_voltage_read(void);
92 +extern void cpu_xscale_voltage_write(unsigned char);
95 #if defined(CONFIG_SABINAL_DISCOVERY)
96 #define SHARPSL_AC_LINE_STATUS (( ASIC3_GPIO_PSTS_D & AC_IN )? APM_AC_OFFLINE : APM_AC_ONLINE)
97 #define BACKPACK_IN_DETECT() ( ASIC3_GPIO_PSTS_D & BACKPACK_DETECT ) /* 0: exist , 1: not in */
98 @@ -1036,6 +1041,58 @@
99 EXPORT_SYMBOL(write_cccr);
102 +#if defined(CONFIG_CHANGE_CORE_VOLT)
104 +void write_vcore(int vcore)
106 + printk("Change Core voltage = %x.\n", vcore);
107 + cpu_xscale_voltage_write(vcore);
111 +int read_vcore(void)
113 + return cpu_xscale_voltage_read();
116 +static ssize_t core_volt_read_params(struct file *file, char *buf,
117 + size_t nbytes, loff_t *ppos)
119 + char outputbuf[32];
122 + if (*ppos>0) /* Assume reading completed in previous read*/
124 + count = sprintf(outputbuf, "0x%02X\n", (unsigned int) cpu_xscale_voltage_read() );
127 + if (count>nbytes)/* Assume output can be read at one time */
129 + if (copy_to_user(buf, outputbuf, count+1))
134 +static ssize_t core_volt_write_params(struct file *file, const char *buf,
135 + size_t nbytes, loff_t *ppos)
137 + unsigned int param=0;
139 + sscanf(buf,"%x",¶m);
141 + write_vcore(param);
146 +static struct file_operations proc_core_volt_params_operations = {
147 + read:core_volt_read_params,
148 + write:core_volt_write_params,
150 +EXPORT_SYMBOL(read_vcore);
151 +EXPORT_SYMBOL(write_vcore);
154 #ifdef CONFIG_APM_CPU_IDLE
155 #ifdef SHARPSL_NEW_IDLE
156 static int save_icmr;
157 @@ -2849,6 +2906,7 @@
158 struct proc_dir_entry *lock_fcs_proc;
159 struct proc_dir_entry *power_mode_proc;
160 struct proc_dir_entry *cccr_change_proc;
161 + struct proc_dir_entry *core_volt_proc;
163 apm_info.bios = apm_bios_info;
164 if (apm_info.bios.version == 0) {
165 @@ -2981,6 +3039,14 @@
166 cccr_change_proc->proc_fops = &proc_cccr_change_params_operations;
170 +#if defined(CONFIG_CHANGE_CORE_VOLT)
171 + core_volt_proc = create_proc_entry("zaurus/VCORE", 0, NULL);
172 + if (core_volt_proc) {
173 + core_volt_proc->proc_fops = &proc_core_volt_params_operations;
177 kernel_thread(apm_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);
179 #if defined(CONFIG_SABINAL_DISCOVERY) || defined(CONFIG_ARCH_PXA_TOSA)