Skip to contentSkip to conversation

omap2plus: Remove auto selection on PMICs

PATCH In review Sanjeev Premi 2 participants 6 messages Feb 23, 2011 – Mar 7, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap2plus: Remove auto selection on PMICs

The current implementation almost assumes that only TWL4030/TWL5030/TWl6030 are (or can be) used with the OMAP processors. This is, however, not true.

This patch removes the automatic selection of the PMIC from Kconfig. Current defaults are chosen in default configuration omap2plus_defconfig and can easily be added to configuration for any board, there should be no compile/run-time impact.

---
Compiled omap2plus-defconfig and boot tested on OMAP3EVM Rev G.

 arch/arm/mach-omap2/Kconfig |    3 ---
 drivers/mfd/Kconfig         |    4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/Kconfig +0 -3
index ae7f47d..9c4f903 100644
@@ -16,9 +16,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	select I2C
 	select I2C_OMAP
 	select MFD_SUPPORT
-	select MENELAUS if ARCH_OMAP2
-	select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
-	select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
 	help
 	  Compile a kernel suitable for booting most boards
 
drivers/mfd/Kconfig +2 -2
index fd01836..67dcee4 100644
@@ -155,7 +155,7 @@ config MENELAUS
 
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-	depends on I2C=y && GENERIC_HARDIRQS
+	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
@@ -169,7 +169,7 @@ config TWL4030_CORE
 
 config TWL4030_POWER
 	bool "Support power resources on TWL4030 family chips"
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you want to use the power resources on the
 	  TWL4030 family chips.  Most of these resources are regulators,
Signature · 1 line
1.7.2.2
maintainer
#1 lore raw
Quoted 3 lines · Sanjeev Premi

The current implementation almost assumes that only TWL4030/TWL5030/TWl6030 are (or can be) used with the OMAP processors. This is, however, not true.

If selecting these on platforms that don't have twl causes problems the problem should be fixed.

You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and then these don't get selected.

Quoted 5 lines

This patch removes the automatic selection of the PMIC from Kconfig. Current defaults are chosen in default configuration omap2plus_defconfig and can easily be added to configuration for any board, there should be no compile/run-time impact.

The reason for CONFIG_ARCH_OMAP2PLUS_TYPICAL is to produce a booting kernel if you do the following:

$ echo CONFIG_ARCH_OMAP=y > .config
$ yes "" | ARCH=arm make oldconfig
$ ARCH=arm CROSS_COMPILE=mycompiler uImage

So I'd rather keep it around for now. In the long run omap2plus_defconfig should build a working kernel with everything as modules though..

BTW, looks like small patch is needed with the patches queued in omap-for-linus to make the above compile. Will post as a reply to this mail.

Regards,

Tony

maintainer
#2 lore raw

PATCH 1/1 omap: Fix compile if MTD_NAND_OMAP2 is not selected

Fix compile if MTD_NAND_OMAP2 is not selected

arch/arm/mach-omap2/board-flash.c +1 -1
@@ -154,7 +154,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,
 }
 #else
 void
-__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
+__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type)
 {
 }
 #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
#3 lore raw
In reply to Tony Lindgren
Quoted 12 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, February 25, 2011 11:47 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs

Quoted 3 lines · Sanjeev Premi

The current implementation almost assumes that only TWL4030/TWL5030/TWl6030 are (or can be) used with the OMAP processors. This is, however, not true.

Quoted 5 lines

If selecting these on platforms that don't have twl causes problems the problem should be fixed.

You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and then these don't get selected.

[sp] But this means MUTLI_OMAP breaks. And same uImage
won't run on the AM3517 EVM.

If I remember, the problem is caused due to twl specific functions called even if it isn't present. And there is implicit assumption on TWL in most of code.

Quoted 10 lines
Quoted 6 lines

This patch removes the automatic selection of the PMIC from Kconfig. Current defaults are chosen in default configuration omap2plus_defconfig and can easily be added to configuration for any board, there should be no compile/run-time impact.

The reason for CONFIG_ARCH_OMAP2PLUS_TYPICAL is to produce a booting kernel if you do the following:

Quoted 7 lines
$ echo CONFIG_ARCH_OMAP=y > .config
$ yes "" | ARCH=arm make oldconfig
$ ARCH=arm CROSS_COMPILE=mycompiler uImage

So I'd rather keep it around for now. In the long run omap2plus_defconfig should build a working kernel with everything as modules though..

[sp] I will be away from work for next week; may not
be able to try this; but don't you think dependency on ARM is too generic? And this should still be fixed..

- depends on TWL4030_CORE && ARM
+ depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)

~sanjeev

Quoted 8 lines

BTW, looks like small patch is needed with the patches queued in omap-for-linus to make the above compile. Will post as a reply to this mail.

Regards,

Tony

maintainer
#4 lore raw
Quoted 18 lines · Premi, Sanjeev
Quoted 12 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, February 25, 2011 11:47 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs

Quoted 3 lines · Sanjeev Premi

The current implementation almost assumes that only TWL4030/TWL5030/TWl6030 are (or can be) used with the OMAP processors. This is, however, not true.

Quoted 5 lines

If selecting these on platforms that don't have twl causes problems the problem should be fixed.

You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and then these don't get selected.

Quoted 6 lines

[sp] But this means MUTLI_OMAP breaks. And same uImage
won't run on the AM3517 EVM.

If I remember, the problem is caused due to twl specific functions called even if it isn't present. And there is implicit assumption on TWL in most of code.

Then let's fix that problem instead. The TWL functions should not get called (or at least they should not do anything) unless the TWL chip is there.

drivers/mfd/Kconfig config TWL4030_CORE · line 172

Quoted 6 lines

[sp] I will be away from work for next week; may not
be able to try this; but don't you think dependency on ARM is too generic? And this should still be fixed..

drivers/mfd/Kconfig +1 -1
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)

Well in theory all the drivers should just build on whatever platform. I don't know if changing that really improves things, we should improve the driver instead.

Note for example how the tps65010.c driver also builds on x86. That allows people doing Linux generic changes to build test those changes:

$git log --pretty=oneline drivers/mfd/tps65010.c 77b22897da093e80c40f03e8d83bf23e756b9fba mfd: Include <linux/gpio.h> instead of afdb32f2e463a195c104555ac9a8cdd39a2b6561 mfd: update workqueue usages fbae3fb1546e199ab0cd185348f8124411a1ca9d i2c: Remove all i2c_set_clientdata(clie f322d5f0097333343bfd92b47258ee997c889263 mfd: Fix dangling pointersRegards,
...

So instead of breakage for the tps65010 driver we instead got the above changes compile tested as an extra bonus.

Regards,

Tony

#5 lore raw
Quoted 29 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Wednesday, March 02, 2011 11:34 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs

Quoted 21 lines · Premi, Sanjeev
Quoted 12 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, February 25, 2011 11:47 PM
To: Premi, Sanjeev
Cc: [email protected]
Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs

Quoted 3 lines · Sanjeev Premi

The current implementation almost assumes that only TWL4030/TWL5030/TWl6030 are (or can be) used with the OMAP processors. This is, however, not true.

Quoted 5 lines

If selecting these on platforms that don't have twl causes problems the problem should be fixed.

You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and then these don't get selected.

[sp] But this means MUTLI_OMAP breaks. And same uImage
won't run on the AM3517 EVM.

Quoted 7 lines
Quoted 3 lines

If I remember, the problem is caused due to twl specific functions called even if it isn't present. And there is implicit assumption on TWL in most of code.

Then let's fix that problem instead. The TWL functions should not get called (or at least they should not do anything) unless the TWL chip is there.

[sp] Agree. Driver needs to be fixed. But, will take longer and
AM35x will continue to suffer. Will start on this...

Quoted 4 lines
Quoted 4 lines

[sp] I will be away from work for next week; may not
be able to try this; but don't you think dependency on ARM is too generic? And this should still be fixed..

[sp] I haven't yet tried it myself. Need to clear lot of regular
backlog before I can try this later this week.

Quoted 11 lines

drivers/mfd/Kconfig config TWL4030_CORE · line 172

Quoted 3 lines
drivers/mfd/Kconfig +1 -1
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)

Well in theory all the drivers should just build on whatever platform. I don't know if changing that really improves things, we should improve the driver instead.

Note for example how the tps65010.c driver also builds on x86. That allows people doing Linux generic changes to build test those changes:

[sp] Agree. But TPS6510 is far more generic PMIC than TWL4030 or
others in the same family.

Going by the argument, we should then be removing processor dependency altogether, i.e:
- depends on TWL4030_CORE && ARM
+ depends on TWL4030_CORE

Quoted 17 lines

$git log --pretty=oneline drivers/mfd/tps65010.c 77b22897da093e80c40f03e8d83bf23e756b9fba mfd: Include <linux/gpio.h> instead of
afdb32f2e463a195c104555ac9a8cdd39a2b6561 mfd: update workqueue usages fbae3fb1546e199ab0cd185348f8124411a1ca9d i2c: Remove all i2c_set_clientdata(clie f322d5f0097333343bfd92b47258ee997c889263 mfd: Fix dangling pointersRegards,
...

So instead of breakage for the tps65010 driver we instead got the above changes compile tested as an extra bonus.

Regards,

Tony