From: tanner Date: Thu, 15 Apr 2010 09:53:49 +0000 (+0200) Subject: old version maemo20 X-Git-Tag: kernel-power-settings-0.3~5 X-Git-Url: http://git.maemo.org/git/?p=kernel-power;a=commitdiff_plain;h=c65ca1106fd77a05315fb98368ffead2f5ff1d9b old version maemo20 --- diff --git a/kernel-maemo-2.6.28/debian/changelog b/kernel-maemo-2.6.28/debian/changelog index 7e9f727..617f754 100644 --- a/kernel-maemo-2.6.28/debian/changelog +++ b/kernel-maemo-2.6.28/debian/changelog @@ -1,3 +1,12 @@ +kernel-maemo (2.6.28-maemo20) fremantle; urgency=low + + * added underclocking (125MHz) support, set default min. to 250MHz + * workaround: ignore min=125MHz and max=600MHz requests form default pmconfig and telephone app + (accepted replacement values would be, e.g., 124999 and 599000) + * add Matan's bq27200 patch enable the module + + -- Thomas Tanner Fri, 09 Apr 2010 00:00:00 +0100 + kernel-maemo (2.6.28-maemo19) fremantle; urgency=low * added overclocking (up to 1.2GHz) support, set default max to 600MHz diff --git a/kernel-maemo-2.6.28/debian/control b/kernel-maemo-2.6.28/debian/control index 7b71e03..47910d8 100644 --- a/kernel-maemo-2.6.28/debian/control +++ b/kernel-maemo-2.6.28/debian/control @@ -31,7 +31,7 @@ Description: Linux kernel updater for an enhanced Maemo 5 kernel 2.6.28.10 NTFS read support, ISO9660, UDF, CIFS, automounter, UNIONFS, device mapper and dm-loop, cryptography, cryptoloop, EFI partitions, UTF8 codepages, mouse+joystick input, PPP, - serial support, USB/IP and generic USB device drivers, + serial support, USB/IP and generic USB device drivers, battery info, overclocking and kexec support. . Warning: Overclocking may damage your device and is at your own risk! @@ -127,6 +127,6 @@ Provides: kernel-feature-netfilter, kernel-feature-ipv6, kernel-feature-ext4, ke kernel-feature-ntfs-read, kernel-feature-udf, kernel-feature-cifs, kernel-feature-automounter, kernel-feature-unionfs, kernel-feature-crypto, kernel-feature-dmloop, kernel-feature-utf8, kernel-feature-mousejoy, kernel-feature-usbip, kernel-feature-ppp, kernel-feature-qos, kernel-feature-block2mtd, kernel-feature-kexec, - kernel-feature-overclock, kernel-feature-joikuspot, kernel-feature-slip + kernel-feature-overclock, kernel-feature-joikuspot, kernel-feature-slip, kernel-feature-battery Description: Linux kernel modules This package provides kernel modules for the enhanced Maemo 5 kernel 2.6.28.10 diff --git a/kernel-maemo-2.6.28/debian/patches/bq_matan.diff b/kernel-maemo-2.6.28/debian/patches/bq_matan.diff new file mode 100644 index 0000000..4374438 --- /dev/null +++ b/kernel-maemo-2.6.28/debian/patches/bq_matan.diff @@ -0,0 +1,33 @@ +--- kernel-maemo-2.6.28.orig/drivers/power/bq27x00_battery.c ++++ kernel-maemo-2.6.28/drivers/power/bq27x00_battery.c +@@ -358,6 +358,22 @@ + .id_table = bq27200_id, + }; + ++struct bq27200_platform_data { ++ int dummy; ++}; ++ ++static struct bq27200_platform_data bq27200_config = { ++ .dummy = 0, ++}; ++ ++static struct i2c_board_info rx51_camera_board_info_2 = ++ { ++ I2C_BOARD_INFO("bq27200", 0x55), ++ .platform_data = &bq27200_config, ++ }; ++ ++static struct i2c_client *client; ++ + static int __init bq27x00_battery_init(void) + { + int ret; +@@ -365,6 +381,7 @@ + ret = i2c_add_driver(&bq27200_battery_driver); + if (ret) + printk(KERN_ERR "Unable to register BQ27200 driver\n"); ++ client = i2c_new_device(i2c_get_adapter(2), &rx51_camera_board_info_2); + + return ret; + } diff --git a/kernel-maemo-2.6.28/debian/patches/overclock.diff b/kernel-maemo-2.6.28/debian/patches/overclock.diff index f399c29..e0841d6 100644 --- a/kernel-maemo-2.6.28/debian/patches/overclock.diff +++ b/kernel-maemo-2.6.28/debian/patches/overclock.diff @@ -1,6 +1,6 @@ --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/omap3-opp.h +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/omap3-opp.h -@@ -4,6 +4,15 @@ +@@ -4,11 +4,20 @@ #include /* MPU speeds */ @@ -16,37 +16,77 @@ #define S600M 600000000 #define S550M 550000000 #define S500M 500000000 -@@ -33,6 +42,16 @@ - {S550M, VDD1_OPP4, 0x36}, - /*OPP5*/ - {S600M, VDD1_OPP5, 0x3C}, + #define S250M 250000000 +-#define S125M 125000000 ++#define S125M 124999000 + + /* DSP speeds */ + #define S430M 430000000 +@@ -23,16 +32,24 @@ + + static struct omap_opp omap3_mpu_rate_table[] = { + {0, 0, 0}, +- /*OPP1*/ + {0, VDD1_OPP1, 0x1E}, +- /*OPP2*/ +- {S250M, VDD1_OPP2, 0x26}, +- /*OPP3*/ +- {S500M, VDD1_OPP3, 0x30}, +- /*OPP4*/ +- {S550M, VDD1_OPP4, 0x36}, +- /*OPP5*/ +- {S600M, VDD1_OPP5, 0x3C}, ++ /*underclocking*/ ++ {S125M, VDD1_OPP2, 0x1E}, ++ /*default*/ ++ {S250M, VDD1_OPP3, 0x26}, ++ {S500M, VDD1_OPP4, 0x30}, ++ {S550M, VDD1_OPP5, 0x36}, ++ {S600M, 6, 0x3C}, + /*overclocking*/ -+ {S700M, 6, 0x3C}, -+ {S750M, 7, 0x3C}, -+ {S800M, 8, 0x3C}, -+ {S850M, 9, 0x3C}, -+ {S900M, 10, 0x3C}, -+ {S950M, 11, 0x3C}, -+ {S1000M, 12, 0x3C}, -+ {S1100M, 13, 0x3C}, -+ {S1200M, 14, 0x3C}, ++ {S700M, 7, 0x3C}, ++ {S750M, 8, 0x3C}, ++ {S800M, 9, 0x3C}, ++ {S850M, 10, 0x3C}, ++ {S900M, 11, 0x3C}, ++ {S950M, 12, 0x3C}, ++ {S1000M, 13, 0x3C}, ++ {S1100M, 14, 0x3C}, ++ {S1200M, 15, 0x3C}, }; static struct omap_opp omap3_l3_rate_table[] = { -@@ -57,6 +76,16 @@ - {S400M, VDD1_OPP4, 0x36}, - /*OPP5*/ - {S430M, VDD1_OPP5, 0x3C}, -+ /*overclocking*/ +@@ -47,16 +64,24 @@ + + static struct omap_opp omap3_dsp_rate_table[] = { + {0, 0, 0}, +- /*OPP1*/ ++ /*underclocking*/ + {S90M, VDD1_OPP1, 0x1E}, +- /*OPP2*/ +- {S180M, VDD1_OPP2, 0x26}, +- /*OPP3*/ +- {S360M, VDD1_OPP3, 0x30}, +- /*OPP4*/ +- {S400M, VDD1_OPP4, 0x36}, +- /*OPP5*/ +- {S430M, VDD1_OPP5, 0x3C}, ++ /*default*/ ++ {S90M, VDD1_OPP2, 0x1E}, ++ {S180M, VDD1_OPP3, 0x26}, ++ {S360M, VDD1_OPP4, 0x30}, ++ {S400M, VDD1_OPP5, 0x36}, + {S430M, 6, 0x3C}, ++ /*overclocking*/ + {S430M, 7, 0x3C}, -+ {S430M, 8, 0x3C},/*800MHz*/ -+ {S500M, 9, 0x3C}, ++ {S430M, 8, 0x3C}, ++ {S430M, 9, 0x3C},/*800MHz*/ + {S500M, 10, 0x3C}, + {S500M, 11, 0x3C}, + {S500M, 12, 0x3C}, + {S500M, 13, 0x3C}, + {S500M, 14, 0x3C}, ++ {S500M, 15, 0x3C}, }; #endif @@ -58,22 +98,10 @@ #define MIN_VDD1_OPP VDD1_OPP1 -#define MAX_VDD1_OPP VDD1_OPP5 +/*#define MAX_VDD1_OPP VDD1_OPP5*/ -+#define MAX_VDD1_OPP 14 ++#define MAX_VDD1_OPP 15 #define MIN_VDD2_OPP VDD2_OPP1 #define MAX_VDD2_OPP VDD2_OPP3 ---- kernel-maemo-2.6.28.orig/drivers/cpufreq/cpufreq.c -+++ kernel-maemo-2.6.28/drivers/cpufreq/cpufreq.c -@@ -823,7 +823,8 @@ - goto err_out; - } - policy->user_policy.min = policy->cpuinfo.min_freq; -- policy->user_policy.max = policy->cpuinfo.max_freq; -+ /*policy->user_policy.max = policy->cpuinfo.max_freq;*/ -+ policy->user_policy.max = 600000; /*N900 hack: set default max to 600MHz */ - - blocking_notifier_call_chain(&cpufreq_policy_notifier_list, - CPUFREQ_START, policy); --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.c +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.c @@ -513,7 +513,7 @@ @@ -81,13 +109,21 @@ if (sr->srid == SR1) { - switch (target_opp_no) { -+ switch (min(target_opp_no,5)) { ++ switch (min(target_opp_no-1,5)) { case 5: nvalue_reciprocal = sr->opp5_nvalue; break; +@@ -527,6 +527,7 @@ + nvalue_reciprocal = sr->opp2_nvalue; + break; + case 1: ++ case 0: + nvalue_reciprocal = sr->opp1_nvalue; + break; + default: --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/cpu-omap.c +++ kernel-maemo-2.6.28/arch/arm/plat-omap/cpu-omap.c -@@ -148,10 +148,12 @@ +@@ -148,10 +148,13 @@ VERY_HI_RATE) / 1000; } @@ -95,10 +131,55 @@ + /*clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);*/ + clk_set_rate(mpu_clk, 600000 * 1000); /*N900 hack: set default max to 600MHz */ - policy->min = policy->cpuinfo.min_freq; +- policy->min = policy->cpuinfo.min_freq; - policy->max = policy->cpuinfo.max_freq; ++ /*policy->min = policy->cpuinfo.min_freq;*/ + /*policy->max = policy->cpuinfo.max_freq;*/ -+ policy->max = 600000; /*N900 hack: set default max to 600MHz */ ++ policy->min = 250000; ++ policy->max = 600000; /*N900 hack: set default to 250-600MHz */ policy->cur = omap_getspeed(0); policy->cpuinfo.transition_latency = 300 * 1000; +--- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.h ++++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.h +@@ -254,7 +254,7 @@ + /* XXX: end remove/move */ + + /* SR_MAX_LOW_OPP: the highest of the "low OPPs", 1 and 2. */ +-#define SR_MAX_LOW_OPP 2 ++#define SR_MAX_LOW_OPP 3 + + /* XXX: find more appropriate place for these once DVFS is in place */ + extern u32 current_vdd1_opp; +--- kernel-maemo-2.6.28.orig/drivers/cpufreq/cpufreq.c ++++ kernel-maemo-2.6.28/drivers/cpufreq/cpufreq.c +@@ -465,7 +465,7 @@ + /** + * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access + */ +-#define store_one(file_name, object) \ ++#define store_one(file_name, object,ignore) \ + static ssize_t store_##file_name \ + (struct cpufreq_policy *policy, const char *buf, size_t count) \ + { \ +@@ -479,15 +479,16 @@ + ret = sscanf (buf, "%u", &new_policy.object); \ + if (ret != 1) \ + return -EINVAL; \ +- \ +- ret = __cpufreq_set_policy(policy, &new_policy); \ ++ printk(KERN_DEBUG "cpufreq: request %u -> %u\n",policy->object,new_policy.object); \ ++ if (new_policy.object != ignore && new_policy.object >= 100000) \ ++ ret = __cpufreq_set_policy(policy, &new_policy); \ + policy->user_policy.object = policy->object; \ + \ + return ret ? ret : count; \ + } + +-store_one(scaling_min_freq,min); +-store_one(scaling_max_freq,max); ++store_one(scaling_min_freq,min,600000); ++store_one(scaling_max_freq,max,600000); + + /** + * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware diff --git a/kernel-maemo-2.6.28/debian/patches/overclock_uvolt.diff b/kernel-maemo-2.6.28/debian/patches/overclock_uvolt.diff new file mode 100644 index 0000000..634aa3e --- /dev/null +++ b/kernel-maemo-2.6.28/debian/patches/overclock_uvolt.diff @@ -0,0 +1,145 @@ +--- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/omap3-opp.h ++++ kernel-maemo-2.6.28/arch/arm/mach-omap2/omap3-opp.h +@@ -4,6 +4,15 @@ + #include + + /* MPU speeds */ ++#define S1200M 1200000000 ++#define S1100M 1100000000 ++#define S1000M 1000000000 ++#define S950M 950000000 ++#define S900M 900000000 ++#define S850M 850000000 ++#define S800M 800000000 ++#define S750M 750000000 ++#define S700M 700000000 + #define S600M 600000000 + #define S550M 550000000 + #define S500M 500000000 +@@ -23,16 +32,23 @@ + + static struct omap_opp omap3_mpu_rate_table[] = { + {0, 0, 0}, +- /*OPP1*/ + {0, VDD1_OPP1, 0x1E}, +- /*OPP2*/ +- {S250M, VDD1_OPP2, 0x26}, +- /*OPP3*/ +- {S500M, VDD1_OPP3, 0x30}, +- /*OPP4*/ +- {S550M, VDD1_OPP4, 0x36}, +- /*OPP5*/ +- {S600M, VDD1_OPP5, 0x3C}, ++ /*underclocking*/ ++ {S125M, VDD1_OPP2, 0x1E}, ++ /*default*/ ++ {S250M, VDD1_OPP3, 0x26}, ++ {S500M, VDD1_OPP4, 0x30}, ++ {S550M, VDD1_OPP5, 0x30}, ++ {S600M, 6, 0x30}, ++ /*overclocking*/ ++ {S700M, 7, 0x36}, ++ {S750M, 8, 0x36}, ++ {S800M, 9, 0x36}, ++ {S850M, 10, 0x36}, ++ {S900M, 11, 0x36}, ++ {S950M, 12, 0x36}, ++ {S1000M, 13, 0x36}, ++ {S1100M, 14, 0x36}, + }; + + static struct omap_opp omap3_l3_rate_table[] = { +@@ -47,16 +63,23 @@ + + static struct omap_opp omap3_dsp_rate_table[] = { + {0, 0, 0}, +- /*OPP1*/ ++ /*underclocking*/ + {S90M, VDD1_OPP1, 0x1E}, +- /*OPP2*/ +- {S180M, VDD1_OPP2, 0x26}, +- /*OPP3*/ +- {S360M, VDD1_OPP3, 0x30}, +- /*OPP4*/ +- {S400M, VDD1_OPP4, 0x36}, +- /*OPP5*/ +- {S430M, VDD1_OPP5, 0x3C}, ++ /*default*/ ++ {S90M, VDD1_OPP2, 0x1E}, ++ {S180M, VDD1_OPP3, 0x26}, ++ {S360M, VDD1_OPP4, 0x30}, ++ {S400M, VDD1_OPP5, 0x36}, ++ {S430M, 6, 0x3C}, ++ /*overclocking*/ ++ {S430M, 7, 0x3C}, ++ {S430M, 8, 0x3C}, ++ {S430M, 9, 0x3C},/*800MHz*/ ++ {S500M, 10, 0x3C}, ++ {S500M, 11, 0x3C}, ++ {S500M, 12, 0x3C}, ++ {S500M, 13, 0x3C}, ++ {S500M, 14, 0x3C}, + }; + + #endif +--- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/include/mach/omap34xx.h ++++ kernel-maemo-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h +@@ -114,7 +114,8 @@ + #define VDD2_OPP3 0x3 + + #define MIN_VDD1_OPP VDD1_OPP1 +-#define MAX_VDD1_OPP VDD1_OPP5 ++/*#define MAX_VDD1_OPP VDD1_OPP5*/ ++#define MAX_VDD1_OPP 14 + #define MIN_VDD2_OPP VDD2_OPP1 + #define MAX_VDD2_OPP VDD2_OPP3 + +--- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.c ++++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.c +@@ -513,7 +513,7 @@ + sr->req_opp_no = target_opp_no; + + if (sr->srid == SR1) { +- switch (target_opp_no) { ++ switch (min(target_opp_no-1,5)) { + case 5: + nvalue_reciprocal = sr->opp5_nvalue; + break; +@@ -527,6 +527,7 @@ + nvalue_reciprocal = sr->opp2_nvalue; + break; + case 1: ++ case 0: + nvalue_reciprocal = sr->opp1_nvalue; + break; + default: +--- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/cpu-omap.c ++++ kernel-maemo-2.6.28/arch/arm/plat-omap/cpu-omap.c +@@ -148,10 +148,13 @@ + VERY_HI_RATE) / 1000; + } + +- clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000); ++ /*clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);*/ ++ clk_set_rate(mpu_clk, 600000 * 1000); /*N900 hack: set default max to 600MHz */ + +- policy->min = policy->cpuinfo.min_freq; +- policy->max = policy->cpuinfo.max_freq; ++ /*policy->min = policy->cpuinfo.min_freq;*/ ++ /*policy->max = policy->cpuinfo.max_freq;*/ ++ policy->min = 250000; ++ policy->max = 600000; /*N900 hack: set default to 250-600MHz */ + policy->cur = omap_getspeed(0); + + policy->cpuinfo.transition_latency = 300 * 1000; +--- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.h ++++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.h +@@ -254,7 +254,7 @@ + /* XXX: end remove/move */ + + /* SR_MAX_LOW_OPP: the highest of the "low OPPs", 1 and 2. */ +-#define SR_MAX_LOW_OPP 2 ++#define SR_MAX_LOW_OPP 3 + + /* XXX: find more appropriate place for these once DVFS is in place */ + extern u32 current_vdd1_opp; diff --git a/kernel-maemo-2.6.28/debian/patches/series b/kernel-maemo-2.6.28/debian/patches/series index 98dca90..db0d40a 100644 --- a/kernel-maemo-2.6.28/debian/patches/series +++ b/kernel-maemo-2.6.28/debian/patches/series @@ -13,3 +13,4 @@ block2mtd-yoush.diff gentoo-fsfixes.diff kexec.diff overclock.diff +bq_matan.diff diff --git a/kernel-maemo-2.6.28/debian/rx51maemo_defconfig b/kernel-maemo-2.6.28/debian/rx51maemo_defconfig index ae2191f..599a560 100644 --- a/kernel-maemo-2.6.28/debian/rx51maemo_defconfig +++ b/kernel-maemo-2.6.28/debian/rx51maemo_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.28.10maemo-omap1 -# Mon Apr 5 13:00:41 2010 +# Fri Apr 9 14:08:19 2010 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -1174,7 +1174,12 @@ CONFIG_GPIO_TWL4030=y # CONFIG_GPIO_MAX7301 is not set # CONFIG_GPIO_MCP23S08 is not set # CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set +CONFIG_POWER_SUPPLY=m +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PDA_POWER is not set +# CONFIG_BATTERY_DS2760 is not set +# CONFIG_TWL4030_BCI_BATTERY is not set +CONFIG_BATTERY_BQ27x00=m CONFIG_HWMON=y # CONFIG_HWMON_VID is not set # CONFIG_SENSORS_AD7414 is not set