Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Aaro Koskinen wrote, on 01/07/2011 07:04 AM: On Wed, 5 Jan 2011, Nishanth Menon wrote: +static void __init beagle_opp_init(void) +{ + int r = 0; + + /* Initialize the omap3 opp table */ + if (omap3_opp_init()) { + pr_err(%s: opp default init failed\n, __func__); + return; + } + + /* Custom OPP enabled for XM */ + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { + struct omap_hwmod *mh = omap_hwmod_lookup(mpu); + struct omap_hwmod *dh = omap_hwmod_lookup(iva); + struct device *dev; + + if (!mh || !dh) { + pr_err(%s: Aiee.. no mpu/dsp devices? %p %p\n, + __func__, mh, dh); + r = -EINVAL; + } else { + /* Enable MPU 1GHz and lower opps */ + dev = mh-od-pdev.dev; + r = opp_enable(dev, 8); + /* TODO: MPU 1GHz needs SR and ABB */ + + /* Enable IVA 800MHz and lower opps */ + dev = dh-od-pdev.dev; + r |= opp_enable(dev, 66000); + /* TODO: DSP 800MHz needs SR and ABB */ + } + if (r) { + pr_err(%s: failed to enable higher opp %d\n, + __func__, r); + /* + * Cleanup - disable the higher freqs - we dont care + * about the results + */ + dev = mh-od-pdev.dev; + opp_disable(dev, 8); + dev = dh-od-pdev.dev; This branch will be reached also when !mh || !dh, so it won't work. arrgh.. thanks for catching it - will fix and repost. -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Kevin Hilman wrote, on 01/05/2011 05:28 PM: Nishanth Menonn...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this. IOW, what is Beagle specific about this? beagle is one of the boards capable of higher frequencies. Kevin Reported-by: Koen Kooik...@beagleboard.org Tested-by: Koen Kooik...@beagleboard.org Signed-off-by: Nishanth Menonn...@ti.com --- arch/arm/mach-omap2/board-omap3beagle.c | 50 +++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6c12760..0b99b80 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -23,6 +23,7 @@ #includelinux/gpio.h #includelinux/input.h #includelinux/gpio_keys.h +#includelinux/opp.h #includelinux/mtd/mtd.h #includelinux/mtd/partitions.h @@ -44,10 +45,12 @@ #includeplat/gpmc.h #includeplat/nand.h #includeplat/usb.h +#includeplat/omap_device.h #include mux.h #include hsmmc.h #include timer-gp.h +#include pm.h #define NAND_BLOCK_SIZE SZ_128K @@ -556,6 +559,52 @@ static struct omap_musb_board_data musb_board_data = { .power = 100, }; +static void __init beagle_opp_init(void) +{ + int r = 0; + + /* Initialize the omap3 opp table */ + if (omap3_opp_init()) { + pr_err(%s: opp default init failed\n, __func__); + return; + } + + /* Custom OPP enabled for XM */ + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { + struct omap_hwmod *mh = omap_hwmod_lookup(mpu); + struct omap_hwmod *dh = omap_hwmod_lookup(iva); + struct device *dev; + + if (!mh || !dh) { + pr_err(%s: Aiee.. no mpu/dsp devices? %p %p\n, + __func__, mh, dh); + r = -EINVAL; + } else { + /* Enable MPU 1GHz and lower opps */ + dev =mh-od-pdev.dev; + r = opp_enable(dev, 8); + /* TODO: MPU 1GHz needs SR and ABB */ + + /* Enable IVA 800MHz and lower opps */ + dev =dh-od-pdev.dev; + r |= opp_enable(dev, 66000); + /* TODO: DSP 800MHz needs SR and ABB */ + } + if (r) { + pr_err(%s: failed to enable higher opp %d\n, + __func__, r); + /* +* Cleanup - disable the higher freqs - we dont care +* about the results +*/ + dev =mh-od-pdev.dev; + opp_disable(dev, 8); + dev =dh-od-pdev.dev; + opp_disable(dev, 66000); + } + } +} + static void __init omap3_beagle_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); @@ -579,6 +628,7 @@ static void __init omap3_beagle_init(void) omap_mux_init_signal(sdrc_cke1, OMAP_PIN_OUTPUT); beagle_display_init(); + beagle_opp_init(); } MACHINE_START(OMAP3_BEAGLE, OMAP3 Beagle Board) -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven: Kevin Hilman wrote, on 01/05/2011 05:28 PM: Nishanth Menonn...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this. What about the new 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work: r...@usrp-e1xx:~# cpufreq-set -f 72 [ 104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 [ 104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 But: r...@usrp-e1xx:~# dmesg | grep 720 [0.00] OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp 720mhz ) [0.00] Kernel command line: console=ttyO2,115200n8 mpurate=720 vram=16M mem=...@0x8000 mem=3...@0x8800 omapfb.mode=dvi:1024x768mr...@60 omapfb.vram=0:8M,1:4M,2:4M omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait [0.00] overo_opp_init: 720MHz MPU OPPs enabled! [0.00] Switched to new clocking rate (Crystal/Core/MPU): 26.0/224/720 MHz r...@usrp-e1xx:~# cpufreq-info cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to cpuf...@vger.kernel.org, please. analyzing CPU 0: driver: omap CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 300 us. hardware limits: 125 MHz - 720 MHz available frequency steps: 125 MHz, 250 MHz, 500 MHz, 550 MHz, 600 MHz, 720 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 125 MHz and 720 MHz. The governor userspace may decide which speed to use within this range. current CPU frequency is 600 MHz (asserted by call to hardware). cpufreq stats: 125 MHz:0.00%, 250 MHz:0.00%, 500 MHz:0.00%, 550 MHz:0.00%, 600 MHz:100.00%, 720 MHz:0.00% (1) So how do I properly get 720MHz on those parts? regards, Koen 0001-omap3-add-support-for-720MHz-MPU-OPP.patch Description: Binary data 0002-OMAP35x-Add-support-for-720MHz-part.patch Description: Binary data 0003-OMAP3-beagle-C4-enable-upto-720MHz-OPP.patch Description: Binary data 0004-OMAP3-Overo-Tide-enable-upto-720MHz-OPP.patch Description: Binary data
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Koen Kooi had written, on 01/06/2011 07:00 AM, the following: Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven: Kevin Hilman wrote, on 01/05/2011 05:28 PM: Nishanth Menonn...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this. What about the new 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work: for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430). since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table and enable it: a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev) b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!) r...@usrp-e1xx:~# cpufreq-set -f 72 [ 104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 [ 104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 This is coz we dont have 720MHz and max enabled freq is 600MHz so it falls back to that freq. But: r...@usrp-e1xx:~# dmesg | grep 720 [0.00] OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp 720mhz ) [0.00] Kernel command line: console=ttyO2,115200n8 mpurate=720 vram=16M mem=...@0x8000 mem=3...@0x8800 omapfb.mode=dvi:1024x768mr...@60 omapfb.vram=0:8M,1:4M,2:4M omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait [0.00] overo_opp_init: 720MHz MPU OPPs enabled! [0.00] Switched to new clocking rate (Crystal/Core/MPU): 26.0/224/720 MHz r...@usrp-e1xx:~# cpufreq-info cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to cpuf...@vger.kernel.org, please. analyzing CPU 0: driver: omap CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 300 us. hardware limits: 125 MHz - 720 MHz available frequency steps: 125 MHz, 250 MHz, 500 MHz, 550 MHz, 600 MHz, 720 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 125 MHz and 720 MHz. The governor userspace may decide which speed to use within this range. current CPU frequency is 600 MHz (asserted by call to hardware). cpufreq stats: 125 MHz:0.00%, 250 MHz:0.00%, 500 MHz:0.00%, 550 MHz:0.00%, 600 MHz:100.00%, 720 MHz:0.00% (1) So how do I properly get 720MHz on those parts? as discussed above. -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
-Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Menon, Nishanth Sent: Thursday, January 06, 2011 7:15 PM To: Koen Kooi Cc: Hilman, Kevin; l-o; l-a; Tony Subject: Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP Koen Kooi had written, on 01/06/2011 07:00 AM, the following: Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven: Kevin Hilman wrote, on 01/05/2011 05:28 PM: Nishanth Menonn...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this. What about the new 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=ko en/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work: for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430). since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table and enable it: a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev) b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!) Nishanth, Some of the patches generic that Koen attached are based on my submissions. As part of migration to 2.6.37, I am in process of validating them on internal integration tree. Will post them soon... may be end of tomorrow. I will be testing them on OMAP3EVM. ~sanjeev [snip]...[snip] -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Premi, Sanjeev had written, on 01/06/2011 07:58 AM, the following: [..] Some of the patches generic that Koen attached are based on my submissions. As part of migration to 2.6.37, I am in process of validating them on internal integration tree. Will post them soon... may be end of tomorrow. I will be testing them on OMAP3EVM. Sure. please do post them to l-o and cc l-a - I suppose until then, they are unofficial if they are lying around in some private tree(even if viewable over internet ;) ). -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Op 6 jan 2011, om 14:44 heeft Nishanth Menon het volgende geschreven: Koen Kooi had written, on 01/06/2011 07:00 AM, the following: Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven: Kevin Hilman wrote, on 01/05/2011 05:28 PM: Nishanth Menonn...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this. What about the new 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work: for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430). Right, that's why it's a different SKU and we can probe for it, see the 0002 patch I attached. since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table That's what 0001 does :) and enable it: a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev) That's what 0003 and 0004 are doing for overo and beagle b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!) See 0002, it does it as an omap feature. r...@usrp-e1xx:~# cpufreq-set -f 72 [ 104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 [ 104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 This is coz we dont have 720MHz and max enabled freq is 600MHz so it falls back to that freq. Even after 0001 adds it to the table and 0004 enables it? regards, Koen-- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Koen Kooi had written, on 01/06/2011 08:01 AM, the following: Op 6 jan 2011, om 14:44 heeft Nishanth Menon het volgende geschreven: Koen Kooi had written, on 01/06/2011 07:00 AM, the following: Op 6 jan 2011, om 13:24 heeft Nishanth Menon het volgende geschreven: Kevin Hilman wrote, on 01/05/2011 05:28 PM: Nishanth Menonn...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) no it is not. only certain boards are capable of higher frequencies - there is a procedure called PDN analysis and vmin search that needs to be performed to guarentee this. What about the new 3530s that can run at 720MHz? Those have been speed binned and given a different SKU. I'm using the attached 4 patches (Tony master + beagle patches _+ dvfs: http://dominion.thruhere.net/git/cgit.cgi/linux-omap/log/?h=koen/beagle-next) on my beagle C4 and overo tide to get 720MHz. They don't really work: for 3530, keep in mind that not *all* boards can support 720MHz (esp the old 3430 boards, like my poor SDP3430). Right, that's why it's a different SKU and we can probe for it, see the 0002 patch I attached. please discuss with Sanjeev on patch ownership and post required series using git send-email :) since we consider 3530 as 3430 as well, add a default disabled 720MHz OPP in the 3430 table That's what 0001 does :) and enable it: a) if this has anything to do with board behavior (which, unlike 36xx, I dont think is the case for 35xx), enable similar to this patch on the required boards on a need basis (e.g. based on board rev) That's what 0003 and 0004 are doing for overo and beagle then it is wrong. see below b) if this is a silicon behavior, then, you should modify the omap3_opp_init to ensure that for the right silicon this is enabled (e.g. only for 3530 rev X onwards or something similar) - but you will need some way to detect it in s/w (not through bootargs please!) See 0002, it does it as an omap feature. if it is OMAP feature, you should be doing this in omap3_opp_init instead of each and every board file! (basically patches 3 and 4 are wrong!). r...@usrp-e1xx:~# cpufreq-set -f 72 [ 104.976318] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 104.986236] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 [ 104.996032] platform iva.0: omap_voltage_scale: Already at the requestedrate 43000 [ 105.006408] platform mpu.0: omap_voltage_scale: Already at the requestedrate 6 This is coz we dont have 720MHz and max enabled freq is 600MHz so it falls back to that freq. Even after 0001 adds it to the table and 0004 enables it? a) have you checked if the clock framework has the required bits? b) voltage layer maintains it's own voltage table as well (surprise :D).. so you need to add to that as well! see the secret table in arch/arm/mach-omap2/voltage.c - I prefer all voltage and frequency information to be in a centralized location to prevent mess like this from happening, but sorry we gotta merge these two tables at some point ahead IMHO, we are not there yet. -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
-Original Message- From: Menon, Nishanth Sent: Thursday, January 06, 2011 7:31 PM To: Premi, Sanjeev Cc: Koen Kooi; Hilman, Kevin; l-o; l-a; Tony Subject: Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP Premi, Sanjeev had written, on 01/06/2011 07:58 AM, the following: [..] Some of the patches generic that Koen attached are based on my submissions. As part of migration to 2.6.37, I am in process of validating them on internal integration tree. Will post them soon... may be end of tomorrow. I will be testing them on OMAP3EVM. Sure. please do post them to l-o and cc l-a - I suppose until then, they are unofficial if they are lying around in some private tree(even if viewable over internet ;) ). That's what I meant by submitting :) My plans were tomorrow/MON - wasn't expecting this thread to happen!! ~sanjeev -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Reported-by: Koen Kooi k...@beagleboard.org Tested-by: Koen Kooi k...@beagleboard.org Signed-off-by: Nishanth Menon n...@ti.com --- arch/arm/mach-omap2/board-omap3beagle.c | 50 +++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6c12760..0b99b80 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -23,6 +23,7 @@ #include linux/gpio.h #include linux/input.h #include linux/gpio_keys.h +#include linux/opp.h #include linux/mtd/mtd.h #include linux/mtd/partitions.h @@ -44,10 +45,12 @@ #include plat/gpmc.h #include plat/nand.h #include plat/usb.h +#include plat/omap_device.h #include mux.h #include hsmmc.h #include timer-gp.h +#include pm.h #define NAND_BLOCK_SIZESZ_128K @@ -556,6 +559,52 @@ static struct omap_musb_board_data musb_board_data = { .power = 100, }; +static void __init beagle_opp_init(void) +{ + int r = 0; + + /* Initialize the omap3 opp table */ + if (omap3_opp_init()) { + pr_err(%s: opp default init failed\n, __func__); + return; + } + + /* Custom OPP enabled for XM */ + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { + struct omap_hwmod *mh = omap_hwmod_lookup(mpu); + struct omap_hwmod *dh = omap_hwmod_lookup(iva); + struct device *dev; + + if (!mh || !dh) { + pr_err(%s: Aiee.. no mpu/dsp devices? %p %p\n, + __func__, mh, dh); + r = -EINVAL; + } else { + /* Enable MPU 1GHz and lower opps */ + dev = mh-od-pdev.dev; + r = opp_enable(dev, 8); + /* TODO: MPU 1GHz needs SR and ABB */ + + /* Enable IVA 800MHz and lower opps */ + dev = dh-od-pdev.dev; + r |= opp_enable(dev, 66000); + /* TODO: DSP 800MHz needs SR and ABB */ + } + if (r) { + pr_err(%s: failed to enable higher opp %d\n, + __func__, r); + /* +* Cleanup - disable the higher freqs - we dont care +* about the results +*/ + dev = mh-od-pdev.dev; + opp_disable(dev, 8); + dev = dh-od-pdev.dev; + opp_disable(dev, 66000); + } + } +} + static void __init omap3_beagle_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); @@ -579,6 +628,7 @@ static void __init omap3_beagle_init(void) omap_mux_init_signal(sdrc_cke1, OMAP_PIN_OUTPUT); beagle_display_init(); + beagle_opp_init(); } MACHINE_START(OMAP3_BEAGLE, OMAP3 Beagle Board) -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP3: beagle xm: enable upto 800MHz OPP
Nishanth Menon n...@ti.com writes: Beagle XM uses 3730 and the board design allows enabling 800MHz and 1GHz OPPs. However, We need Smart reflex class 1.5 and ABB to enable 1GHz safely. For the moment, we tweak the default table to allow for 800Mhz OPP usage. Isn't this common to any board using 3730 (or 3630?) IOW, what is Beagle specific about this? Kevin Reported-by: Koen Kooi k...@beagleboard.org Tested-by: Koen Kooi k...@beagleboard.org Signed-off-by: Nishanth Menon n...@ti.com --- arch/arm/mach-omap2/board-omap3beagle.c | 50 +++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6c12760..0b99b80 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -23,6 +23,7 @@ #include linux/gpio.h #include linux/input.h #include linux/gpio_keys.h +#include linux/opp.h #include linux/mtd/mtd.h #include linux/mtd/partitions.h @@ -44,10 +45,12 @@ #include plat/gpmc.h #include plat/nand.h #include plat/usb.h +#include plat/omap_device.h #include mux.h #include hsmmc.h #include timer-gp.h +#include pm.h #define NAND_BLOCK_SIZE SZ_128K @@ -556,6 +559,52 @@ static struct omap_musb_board_data musb_board_data = { .power = 100, }; +static void __init beagle_opp_init(void) +{ + int r = 0; + + /* Initialize the omap3 opp table */ + if (omap3_opp_init()) { + pr_err(%s: opp default init failed\n, __func__); + return; + } + + /* Custom OPP enabled for XM */ + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { + struct omap_hwmod *mh = omap_hwmod_lookup(mpu); + struct omap_hwmod *dh = omap_hwmod_lookup(iva); + struct device *dev; + + if (!mh || !dh) { + pr_err(%s: Aiee.. no mpu/dsp devices? %p %p\n, + __func__, mh, dh); + r = -EINVAL; + } else { + /* Enable MPU 1GHz and lower opps */ + dev = mh-od-pdev.dev; + r = opp_enable(dev, 8); + /* TODO: MPU 1GHz needs SR and ABB */ + + /* Enable IVA 800MHz and lower opps */ + dev = dh-od-pdev.dev; + r |= opp_enable(dev, 66000); + /* TODO: DSP 800MHz needs SR and ABB */ + } + if (r) { + pr_err(%s: failed to enable higher opp %d\n, + __func__, r); + /* + * Cleanup - disable the higher freqs - we dont care + * about the results + */ + dev = mh-od-pdev.dev; + opp_disable(dev, 8); + dev = dh-od-pdev.dev; + opp_disable(dev, 66000); + } + } +} + static void __init omap3_beagle_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); @@ -579,6 +628,7 @@ static void __init omap3_beagle_init(void) omap_mux_init_signal(sdrc_cke1, OMAP_PIN_OUTPUT); beagle_display_init(); + beagle_opp_init(); } MACHINE_START(OMAP3_BEAGLE, OMAP3 Beagle Board) -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html