diff options
| author | Koen Kooi <koen@dominion.thruhere.net> | 2011-07-23 10:41:13 +0200 |
|---|---|---|
| committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-07-23 10:41:13 +0200 |
| commit | 410d3fe6acdaa928c980b302955053c8f6de98fd (patch) | |
| tree | 0c2f3539bfcc26a08ca32acd9f206229bf2273ef /recipes-kernel | |
| parent | 81b48e41d82f850d303686123028d3602e11c740 (diff) | |
| download | meta-ti-410d3fe6acdaa928c980b302955053c8f6de98fd.tar.gz | |
linux 3.0: add support for OMAP3 720MHz devices
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-kernel')
| -rw-r--r-- | recipes-kernel/linux/linux-3.0/beagle/0005-omap3-Add-basic-support-for-720MHz-part.patch | 202 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux_3.0.bb | 3 |
2 files changed, 204 insertions, 1 deletions
diff --git a/recipes-kernel/linux/linux-3.0/beagle/0005-omap3-Add-basic-support-for-720MHz-part.patch b/recipes-kernel/linux/linux-3.0/beagle/0005-omap3-Add-basic-support-for-720MHz-part.patch new file mode 100644 index 00000000..79fffa09 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/beagle/0005-omap3-Add-basic-support-for-720MHz-part.patch | |||
| @@ -0,0 +1,202 @@ | |||
| 1 | From ec1da82b1bd9446e75e6d176bbe4b75f03d4da18 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Sanjeev Premi <premi@ti.com> | ||
| 3 | Date: Tue, 18 Jan 2011 13:19:55 +0530 | ||
| 4 | Subject: [PATCH 5/5] omap3: Add basic support for 720MHz part | ||
| 5 | |||
| 6 | This patch adds support for new speed enhanced parts with ARM | ||
| 7 | and IVA running at 720MHz and 520MHz respectively. These parts | ||
| 8 | can be probed at run-time by reading PRODID.SKUID[3:0] at | ||
| 9 | 0x4830A20C [1]. | ||
| 10 | |||
| 11 | This patch specifically does following: | ||
| 12 | * Detect devices capable of 720MHz. | ||
| 13 | * Add new OPP | ||
| 14 | * Ensure that OPP is conditionally enabled. | ||
| 15 | * Check for presence of IVA before attempting to enable | ||
| 16 | the corresponding OPP. | ||
| 17 | |||
| 18 | [1] http://focus.ti.com/lit/ug/spruff1d/spruff1d.pdf | ||
| 19 | |||
| 20 | Signed-off-by: Sanjeev Premi <premi@ti.com> | ||
| 21 | --- | ||
| 22 | arch/arm/mach-omap2/control.h | 7 ++++ | ||
| 23 | arch/arm/mach-omap2/id.c | 10 +++++ | ||
| 24 | arch/arm/mach-omap2/opp3xxx_data.c | 63 ++++++++++++++++++++++++++++++++- | ||
| 25 | arch/arm/plat-omap/include/plat/cpu.h | 2 + | ||
| 26 | 4 files changed, 81 insertions(+), 1 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h | ||
| 29 | index a016c8b..69d0b9c 100644 | ||
| 30 | --- a/arch/arm/mach-omap2/control.h | ||
| 31 | +++ b/arch/arm/mach-omap2/control.h | ||
| 32 | @@ -371,6 +371,13 @@ | ||
| 33 | #define FEAT_NEON 0 | ||
| 34 | #define FEAT_NEON_NONE 1 | ||
| 35 | |||
| 36 | +/* | ||
| 37 | + * Product ID register | ||
| 38 | + */ | ||
| 39 | +#define OMAP3_PRODID 0x020C | ||
| 40 | + | ||
| 41 | +#define OMAP3_SKUID_MASK 0x0f | ||
| 42 | +#define OMAP3_SKUID_720MHZ 0x08 | ||
| 43 | |||
| 44 | #ifndef __ASSEMBLY__ | ||
| 45 | #ifdef CONFIG_ARCH_OMAP2PLUS | ||
| 46 | diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c | ||
| 47 | index 2537090..b6ed78a 100644 | ||
| 48 | --- a/arch/arm/mach-omap2/id.c | ||
| 49 | +++ b/arch/arm/mach-omap2/id.c | ||
| 50 | @@ -210,6 +210,15 @@ static void __init omap3_check_features(void) | ||
| 51 | * TODO: Get additional info (where applicable) | ||
| 52 | * e.g. Size of L2 cache. | ||
| 53 | */ | ||
| 54 | + | ||
| 55 | + /* | ||
| 56 | + * Does it support 720MHz? | ||
| 57 | + */ | ||
| 58 | + status = (OMAP3_SKUID_MASK & read_tap_reg(OMAP3_PRODID)); | ||
| 59 | + | ||
| 60 | + if (status & OMAP3_SKUID_720MHZ) { | ||
| 61 | + omap3_features |= OMAP3_HAS_720MHZ; | ||
| 62 | + } | ||
| 63 | } | ||
| 64 | |||
| 65 | static void __init ti816x_check_features(void) | ||
| 66 | @@ -490,6 +499,7 @@ static void __init omap3_cpuinfo(void) | ||
| 67 | OMAP3_SHOW_FEATURE(neon); | ||
| 68 | OMAP3_SHOW_FEATURE(isp); | ||
| 69 | OMAP3_SHOW_FEATURE(192mhz_clk); | ||
| 70 | + OMAP3_SHOW_FEATURE(720mhz); | ||
| 71 | |||
| 72 | printk(")\n"); | ||
| 73 | } | ||
| 74 | diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c | ||
| 75 | index 12fc2da..6906992 100644 | ||
| 76 | --- a/arch/arm/mach-omap2/opp3xxx_data.c | ||
| 77 | +++ b/arch/arm/mach-omap2/opp3xxx_data.c | ||
| 78 | @@ -18,8 +18,10 @@ | ||
| 79 | * GNU General Public License for more details. | ||
| 80 | */ | ||
| 81 | #include <linux/module.h> | ||
| 82 | +#include <linux/opp.h> | ||
| 83 | |||
| 84 | #include <plat/cpu.h> | ||
| 85 | +#include <plat/omap_device.h> | ||
| 86 | |||
| 87 | #include "control.h" | ||
| 88 | #include "omap_opp_data.h" | ||
| 89 | @@ -99,6 +101,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { | ||
| 90 | OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV), | ||
| 91 | /* MPU OPP5 */ | ||
| 92 | OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV), | ||
| 93 | + /* MPU OPP6 */ | ||
| 94 | + OPP_INITIALIZER("mpu", false, 720000000, 1350000), | ||
| 95 | |||
| 96 | /* | ||
| 97 | * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is | ||
| 98 | @@ -124,6 +128,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { | ||
| 99 | OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV), | ||
| 100 | /* DSP OPP5 */ | ||
| 101 | OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV), | ||
| 102 | + /* DSP OPP6 */ | ||
| 103 | + OPP_INITIALIZER("iva", false, 520000000, 1350000), | ||
| 104 | }; | ||
| 105 | |||
| 106 | static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { | ||
| 107 | @@ -151,6 +157,57 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { | ||
| 108 | OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV), | ||
| 109 | }; | ||
| 110 | |||
| 111 | + | ||
| 112 | +/** | ||
| 113 | + * omap3_opp_enable_720Mhz() - Enable the OPP corresponding to 720MHz | ||
| 114 | + * | ||
| 115 | + * This function would be executed only if the silicon is capable of | ||
| 116 | + * running at the 720MHz. | ||
| 117 | + */ | ||
| 118 | +static int __init omap3_opp_enable_720Mhz(void) | ||
| 119 | +{ | ||
| 120 | + int r = -ENODEV; | ||
| 121 | + struct omap_hwmod *oh_mpu = omap_hwmod_lookup("mpu"); | ||
| 122 | + struct omap_hwmod *oh_iva; | ||
| 123 | + struct platform_device *pdev; | ||
| 124 | + | ||
| 125 | + if (!oh_mpu || !oh_mpu->od) { | ||
| 126 | + goto err; | ||
| 127 | + } else { | ||
| 128 | + pdev = &oh_mpu->od->pdev; | ||
| 129 | + | ||
| 130 | + r = opp_enable(&pdev->dev, 720000000); | ||
| 131 | + if (r < 0) { | ||
| 132 | + dev_err(&pdev->dev, | ||
| 133 | + "opp_enable() failed for mpu@720MHz"); | ||
| 134 | + goto err; | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + if (omap3_has_iva()) { | ||
| 139 | + oh_iva = omap_hwmod_lookup("iva"); | ||
| 140 | + | ||
| 141 | + if (!oh_iva || !oh_iva->od) { | ||
| 142 | + r = -ENODEV; | ||
| 143 | + goto err; | ||
| 144 | + } else { | ||
| 145 | + pdev = &oh_iva->od->pdev; | ||
| 146 | + | ||
| 147 | + r = opp_enable(&pdev->dev, 520000000); | ||
| 148 | + if (r < 0) { | ||
| 149 | + dev_err(&pdev->dev, | ||
| 150 | + "opp_enable() failed for iva@520MHz"); | ||
| 151 | + goto err; | ||
| 152 | + } | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + dev_info(&pdev->dev, "Enabled OPP corresponding to 720MHz\n"); | ||
| 157 | + | ||
| 158 | +err: | ||
| 159 | + return r; | ||
| 160 | +} | ||
| 161 | + | ||
| 162 | /** | ||
| 163 | * omap3_opp_init() - initialize omap3 opp table | ||
| 164 | */ | ||
| 165 | @@ -164,10 +221,14 @@ int __init omap3_opp_init(void) | ||
| 166 | if (cpu_is_omap3630()) | ||
| 167 | r = omap_init_opp_table(omap36xx_opp_def_list, | ||
| 168 | ARRAY_SIZE(omap36xx_opp_def_list)); | ||
| 169 | - else | ||
| 170 | + else { | ||
| 171 | r = omap_init_opp_table(omap34xx_opp_def_list, | ||
| 172 | ARRAY_SIZE(omap34xx_opp_def_list)); | ||
| 173 | |||
| 174 | + if (omap3_has_720mhz()) | ||
| 175 | + r = omap3_opp_enable_720Mhz(); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | return r; | ||
| 179 | } | ||
| 180 | device_initcall(omap3_opp_init); | ||
| 181 | diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h | ||
| 182 | index 8198bb6..5204c1e 100644 | ||
| 183 | --- a/arch/arm/plat-omap/include/plat/cpu.h | ||
| 184 | +++ b/arch/arm/plat-omap/include/plat/cpu.h | ||
| 185 | @@ -478,6 +478,7 @@ extern u32 omap3_features; | ||
| 186 | #define OMAP3_HAS_192MHZ_CLK BIT(5) | ||
| 187 | #define OMAP3_HAS_IO_WAKEUP BIT(6) | ||
| 188 | #define OMAP3_HAS_SDRC BIT(7) | ||
| 189 | +#define OMAP3_HAS_720MHZ BIT(8) | ||
| 190 | |||
| 191 | #define OMAP3_HAS_FEATURE(feat,flag) \ | ||
| 192 | static inline unsigned int omap3_has_ ##feat(void) \ | ||
| 193 | @@ -493,5 +494,6 @@ OMAP3_HAS_FEATURE(isp, ISP) | ||
| 194 | OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) | ||
| 195 | OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) | ||
| 196 | OMAP3_HAS_FEATURE(sdrc, SDRC) | ||
| 197 | +OMAP3_HAS_FEATURE(720mhz, 720MHZ) | ||
| 198 | |||
| 199 | #endif | ||
| 200 | -- | ||
| 201 | 1.6.6.1 | ||
| 202 | |||
diff --git a/recipes-kernel/linux/linux_3.0.bb b/recipes-kernel/linux/linux_3.0.bb index dea468e5..eb823c75 100644 --- a/recipes-kernel/linux/linux_3.0.bb +++ b/recipes-kernel/linux/linux_3.0.bb | |||
| @@ -9,7 +9,7 @@ COMPATIBLE_MACHINE = "(beagleboard)" | |||
| 9 | SRCREV_pn-${PN} = "02f8c6aee8df3cdc935e9bdd4f2d020306035dbe" | 9 | SRCREV_pn-${PN} = "02f8c6aee8df3cdc935e9bdd4f2d020306035dbe" |
| 10 | 10 | ||
| 11 | # The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc | 11 | # The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc |
| 12 | MACHINE_KERNEL_PR_append = "e" | 12 | MACHINE_KERNEL_PR_append = "f" |
| 13 | 13 | ||
| 14 | FILESPATHPKG_prepend = "linux-3.0:" | 14 | FILESPATHPKG_prepend = "linux-3.0:" |
| 15 | 15 | ||
| @@ -194,6 +194,7 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;pro | |||
| 194 | file://beagle/0002-UNFINISHED-OMAP3-beagle-add-support-for-expansionboa.patch \ | 194 | file://beagle/0002-UNFINISHED-OMAP3-beagle-add-support-for-expansionboa.patch \ |
| 195 | file://beagle/0003-HACK-OMAP3-beagle-switch-to-GPTIMER1.patch \ | 195 | file://beagle/0003-HACK-OMAP3-beagle-switch-to-GPTIMER1.patch \ |
| 196 | file://beagle/0004-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch \ | 196 | file://beagle/0004-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch \ |
| 197 | file://beagle/0005-omap3-Add-basic-support-for-720MHz-part.patch \ | ||
| 197 | file://madc/0001-Enabling-Hwmon-driver-for-twl4030-madc.patch \ | 198 | file://madc/0001-Enabling-Hwmon-driver-for-twl4030-madc.patch \ |
| 198 | file://madc/0002-mfd-twl-core-enable-madc-clock.patch \ | 199 | file://madc/0002-mfd-twl-core-enable-madc-clock.patch \ |
| 199 | file://defconfig" | 200 | file://defconfig" |
