Skip to contentSkip to conversation

ARM: OMAP: SmartReflex driver

PATCH In review Kalle Jokiniemi 4 participants 8 messages Jun 2, 2008 – Jun 6, 2008

lore
Share & tools
lore
#0 lore raw

cover ARM: OMAP: SmartReflex driver

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Regards,
Kalle Jokiniemi

---

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 11 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----

#2 lore raw

Koen,

You need to use NTargets from E-fuse for the correct operation. If E-fuse reads zero, then you are using a device without SmartReflex support or not guaranteed at least.

#define CONTROL_FUSE_OPP1_VDD1           0x48002380
#define CONTROL_FUSE_OPP2_VDD1           0x48002384
#define CONTROL_FUSE_OPP3_VDD1           0x48002388
#define CONTROL_FUSE_OPP4_VDD1           0x4800238C
#define CONTROL_FUSE_OPP5_VDD1           0x48002390
#define CONTROL_FUSE_OPP1_VDD2           0x48002394
#define CONTROL_FUSE_OPP2_VDD2           0x48002398
#define CONTROL_FUSE_OPP3_VDD2           0x4800239C

#define CONTROL_FUSE_SR 0x480023A0

Those values present in the driver are meant for testing purposes only. Ideally in sr_enable, if current_nvalue reads zero we should return without enabling SmartReflex module.

        current_nvalue = sr_read_reg(sr, NVALUERECIPROCAL);

        if (nvalue_reciprocal == 0) {
                DPRINTK("OPP doesn't support SmartReflex\n");
                return;
        }

        if (current_nvalue == nvalue_reciprocal) {
                DPRINTK("System is already at the desired voltage level\n");
                return;
        }

This driver needs modification to read NTargets from E-fuse rather than using hard coded values.

Regards,
Pratheesh

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Koen Kooi
Sent: Monday, June 02, 2008 6:02 PM
To: Kalle Jokiniemi
Cc: linux-omap
Subject: Re: [PATCH 0/3] ARM: OMAP: SmartReflex driver

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 11 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Hi Pratheesh,

Quoted 19 lines · Pratheesh Gangadhar

Koen,

You need to use NTargets from E-fuse for the correct operation. If E-fuse reads zero, then you are using a device without SmartReflex support or not guaranteed at least.

#define CONTROL_FUSE_OPP1_VDD1           0x48002380
#define CONTROL_FUSE_OPP2_VDD1           0x48002384
#define CONTROL_FUSE_OPP3_VDD1           0x48002388
#define CONTROL_FUSE_OPP4_VDD1           0x4800238C
#define CONTROL_FUSE_OPP5_VDD1           0x48002390
#define CONTROL_FUSE_OPP1_VDD2           0x48002394
#define CONTROL_FUSE_OPP2_VDD2           0x48002398
#define CONTROL_FUSE_OPP3_VDD2           0x4800239C

#define CONTROL_FUSE_SR 0x480023A0

Those values present in the driver are meant for testing purposes only. Ideally in sr_enable, if current_nvalue reads zero we should return without enabling SmartReflex module.

Quoted 11 lines
        current_nvalue = sr_read_reg(sr, NVALUERECIPROCAL);

        if (nvalue_reciprocal == 0) {
                DPRINTK("OPP doesn't support SmartReflex\n");
                return;
        }

        if (current_nvalue == nvalue_reciprocal) {
                DPRINTK("System is already at the desired voltage level\n");
                return;
        }

This last if-statement is something that puzzled me while I was doing this patch-set. Shouldn't the SmartReflex be enabled even though we are at the desired voltage level at a given time. I mean, the operating conditions (temperature for one) could change over time and smartreflex will need to do it's magic in order to keep the device at a proper voltage level, right?

Quoted 2 lines

This driver needs modification to read NTargets from E-fuse rather than using hard coded values.

Tony, I can update this patch set, or send an additional patch that adds the efuse support. Which will you prefer?

Regards,
Kalle

Quoted 46 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Koen Kooi
Sent: Monday, June 02, 2008 6:02 PM
To: Kalle Jokiniemi
Cc: linux-omap
Subject: Re: [PATCH 0/3] ARM: OMAP: SmartReflex driver

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 11 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Kalle,

Yes, you are right. You can remove the second if statement.

Regards,
Pratheesh

-----Original Message-----
From: Kalle Jokiniemi [mailto:[email protected]]
Sent: Tuesday, June 03, 2008 11:32 AM
To: TK, Pratheesh Gangadhar
Cc: Koen Kooi; linux-omap
Subject: RE: [PATCH 0/3] ARM: OMAP: SmartReflex driver

Hi Pratheesh,

Quoted 19 lines · Pratheesh Gangadhar

Koen,

You need to use NTargets from E-fuse for the correct operation. If E-fuse reads zero, then you are using a device without SmartReflex support or not guaranteed at least.

#define CONTROL_FUSE_OPP1_VDD1           0x48002380
#define CONTROL_FUSE_OPP2_VDD1           0x48002384
#define CONTROL_FUSE_OPP3_VDD1           0x48002388
#define CONTROL_FUSE_OPP4_VDD1           0x4800238C
#define CONTROL_FUSE_OPP5_VDD1           0x48002390
#define CONTROL_FUSE_OPP1_VDD2           0x48002394
#define CONTROL_FUSE_OPP2_VDD2           0x48002398
#define CONTROL_FUSE_OPP3_VDD2           0x4800239C

#define CONTROL_FUSE_SR 0x480023A0

Those values present in the driver are meant for testing purposes only. Ideally in sr_enable, if current_nvalue reads zero we should return without enabling SmartReflex module.

Quoted 11 lines
        current_nvalue = sr_read_reg(sr, NVALUERECIPROCAL);

        if (nvalue_reciprocal == 0) {
                DPRINTK("OPP doesn't support SmartReflex\n");
                return;
        }

        if (current_nvalue == nvalue_reciprocal) {
                DPRINTK("System is already at the desired voltage level\n");
                return;
        }

This last if-statement is something that puzzled me while I was doing this patch-set. Shouldn't the SmartReflex be enabled even though we are at the desired voltage level at a given time. I mean, the operating conditions (temperature for one) could change over time and smartreflex will need to do it's magic in order to keep the device at a proper voltage level, right?

Quoted 2 lines

This driver needs modification to read NTargets from E-fuse rather than using hard coded values.

Tony, I can update this patch set, or send an additional patch that adds the efuse support. Which will you prefer?

Regards,
Kalle

Quoted 46 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Koen Kooi
Sent: Monday, June 02, 2008 6:02 PM
To: Kalle Jokiniemi
Cc: linux-omap
Subject: Re: [PATCH 0/3] ARM: OMAP: SmartReflex driver

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 11 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 57 lines · TK, Pratheesh Gangadhar

Kalle,

Yes, you are right. You can remove the second if statement.

Regards,
Pratheesh

-----Original Message-----
From: Kalle Jokiniemi [mailto:[email protected]]
Sent: Tuesday, June 03, 2008 11:32 AM
To: TK, Pratheesh Gangadhar
Cc: Koen Kooi; linux-omap
Subject: RE: [PATCH 0/3] ARM: OMAP: SmartReflex driver

Hi Pratheesh,

Quoted 19 lines · Pratheesh Gangadhar

Koen,

You need to use NTargets from E-fuse for the correct operation. If E-fuse reads zero, then you are using a device without SmartReflex support or not guaranteed at least.

#define CONTROL_FUSE_OPP1_VDD1           0x48002380
#define CONTROL_FUSE_OPP2_VDD1           0x48002384
#define CONTROL_FUSE_OPP3_VDD1           0x48002388
#define CONTROL_FUSE_OPP4_VDD1           0x4800238C
#define CONTROL_FUSE_OPP5_VDD1           0x48002390
#define CONTROL_FUSE_OPP1_VDD2           0x48002394
#define CONTROL_FUSE_OPP2_VDD2           0x48002398
#define CONTROL_FUSE_OPP3_VDD2           0x4800239C

#define CONTROL_FUSE_SR 0x480023A0

Those values present in the driver are meant for testing purposes only. Ideally in sr_enable, if current_nvalue reads zero we should return without enabling SmartReflex module.

Quoted 11 lines
        current_nvalue = sr_read_reg(sr, NVALUERECIPROCAL);

        if (nvalue_reciprocal == 0) {
                DPRINTK("OPP doesn't support SmartReflex\n");
                return;
        }

        if (current_nvalue == nvalue_reciprocal) {
                DPRINTK("System is already at the desired voltage level\n");
                return;
        }

This last if-statement is something that puzzled me while I was doing this patch-set. Shouldn't the SmartReflex be enabled even though we are at the desired voltage level at a given time. I mean, the operating conditions (temperature for one) could change over time and smartreflex will need to do it's magic in order to keep the device at a proper voltage level, right?

Quoted 1 line
Quoted 4 lines
Quoted 1 line

This driver needs modification to read NTargets from E-fuse rather than using hard coded values.

Tony, I can update this patch set, or send an additional patch that adds the efuse support. Which will you prefer?

Well I guess updating it would be better if it's just defining them so we have a working patch rather than patch and fix cycle.

Regards,

Tony

Quoted 56 lines

Regards,
Kalle

Quoted 38 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Koen Kooi
Sent: Monday, June 02, 2008 6:02 PM
To: Kalle Jokiniemi
Cc: linux-omap
Subject: Re: [PATCH 0/3] ARM: OMAP: SmartReflex driver

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 11 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

Quoted 8 lines

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Hi,

Quoted 5 lines
Quoted 2 lines

Tony, I can update this patch set, or send an additional patch that adds the efuse support. Which will you prefer?

Well I guess updating it would be better if it's just defining them so we have a working patch rather than patch and fix cycle.

It took a bit longer than I expected, but here's the updated smartreflex driver that uses the E-fuse values. Thanks to Pratheesh for helping out with the details of the implementation.

First patch remains as it was. Some new register and regbit defs have been added to the second patch and the last patch now implements the E-fuse parameters.

I also left in the software hard coded values under a "Smartreflex testing support" entry in the Kconfig. For testing purposes only.

Again, tested on 3430SDP.

Regards,
Kalle

Quoted 64 lines

Regards,

Tony

Quoted 56 lines

Regards,
Kalle

Quoted 38 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Koen Kooi
Sent: Monday, June 02, 2008 6:02 PM
To: Kalle Jokiniemi
Cc: linux-omap
Subject: Re: [PATCH 0/3] ARM: OMAP: SmartReflex driver

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 11 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

- Changed the register accessing to use the prm_xxx_mod_reg{_bits}() functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

Quoted 8 lines

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 6 jun 2008, om 11:49 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 8 lines

Hi,

Quoted 5 lines
Quoted 2 lines

Tony, I can update this patch set, or send an additional patch that adds the efuse support. Which will you prefer?

Well I guess updating it would be better if it's just defining them so we have a working patch rather than patch and fix cycle.

Quoted 7 lines

It took a bit longer than I expected, but here's the updated smartreflex driver that uses the E-fuse values. Thanks to Pratheesh for helping out with the details of the implementation.

First patch remains as it was. Some new register and regbit defs have been added to the second patch and the last patch now implements the E-fuse parameters.

On my beagleboard:

root@beagleboard:/sys/power# echo -n 1 > /sys/power/sr_vdd1_autocomp
OPP3 doesn't support SmartReflex
SR1: VDD autocomp not activated
root@beagleboard:/sys/power#
root@beagleboard:/sys/power# echo -n 1 > /sys/power/sr_vdd2_autocomp
OPP3 doesn't support SmartReflex
SR2: VDD autocomp not activated
root@beagleboard:/sys/power#

The board doesn't crash anymore :)

regards,

Koen

Quoted 76 lines

I also left in the software hard coded values under a "Smartreflex testing support" entry in the Kconfig. For testing purposes only.

Again, tested on 3430SDP.

Regards,
Kalle

Quoted 65 lines

Regards,

Tony

Quoted 57 lines

Regards,
Kalle

Quoted 39 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Koen Kooi
Sent: Monday, June 02, 2008 6:02 PM
To: Kalle Jokiniemi
Cc: linux-omap
Subject: Re: [PATCH 0/3] ARM: OMAP: SmartReflex driver

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 2 jun 2008, om 13:29 heeft Kalle Jokiniemi het volgende geschreven:

Quoted 4 lines

Here is an updated version of the SmartReflex driver.

Patches 1 and 2 are same as before, but patch 3 has some new things:

Quoted 8 lines

- Changed the register accessing to use the
prm_xxx_mod_reg{_bits}()
functions.

- Created a Kconfig entry for SmartReflex in "System type->TI OMAP Implementations" menu.

Tested on 3430SDP.

Compiles for beagleboard, but the board hangs after:

echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

But that's likely to be a beagleboard specific problem.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

Quoted 8 lines

iD8DBQFIQ+g/MkyGM64RGpERAqwgAJ97AE4z0bIBZJs7nZcO1Npa8YkIcgCfY6KM 3Hhr4AIdmzNiozdqs1uQUgg=
=rcQP
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFISRkJMkyGM64RGpERAqdKAJ9FPOr/tYcEO17LkM8Ku8fdsD1AuwCgjDwa L3YD0guaALhLrntQ05vXwKc=
=vkoy
-----END PGP SIGNATURE-----