OMAP4: mux: Add the OMAP4430 ES1.0 & ES2.x support
Subsystems (3)
cover OMAP4: mux: Add the OMAP4430 ES1.0 & ES2.x support
Hi Tony,
Here is the version updated with your fixes.
This is the first non RFC version to make Nishant M. happy;-)
Thanks to you, the RX-51 is now handled properly and the low level API is still public like before for dynamic mux use.
The pandaboard is now supported thanks to Sricharan, and a couple of bugs are fixed, thanks to Dan who reported them.
The series is based on mainline (2.6.37-rc1) and is available here:git://gitorious.org/omap-pm/linux.git ctrl-wip/mux-omap4-v3
Tested on SDP4430 ES1.0, ES2.0 and ES2.1 with omap2plus_defconfig. Still require some test on OMAP3 and OMAP2.
Thanks,
Benoit
RFC v2:
http://www.spinics.net/lists/linux-omap/msg38995.html
- Take into account Tony's proposal to store partition information in a partition structure instead of inside every pad entries.
- Remove some cpu_is_xxx calls from the core code by adding a couple of flags during partition init.
RFC v1:
http://www.spinics.net/lists/linux-omap/msg37158.html
Benoit Cousson (6):
OMAP: mux: Replace printk with pr_xxx macros
OMAP: mux: Add support for control module split in several partitions
OMAP4: mux: Add CBL package data for OMAP4430 ES1
OMAP4: sdp4430: Select CBL package for ES1 and initialize mux
OMAP4: mux: Add CBS package data for OMAP4430 ES2
OMAP4: sdp4430: Select CBS package for ES2
sricharan (1):
OMAP4: pandaboard: Select CBL & CBS package and initialize mux
arch/arm/mach-omap2/Kconfig | 10 + arch/arm/mach-omap2/Makefile | 1 + arch/arm/mach-omap2/board-4430sdp.c | 14 + arch/arm/mach-omap2/board-omap4panda.c | 16 + arch/arm/mach-omap2/board-rx51-peripherals.c | 12 +- arch/arm/mach-omap2/mux.c | 342 ++++-- arch/arm/mach-omap2/mux.h | 84 ++- arch/arm/mach-omap2/mux2420.c | 7 +- arch/arm/mach-omap2/mux2430.c | 7 +- arch/arm/mach-omap2/mux34xx.c | 7 +- arch/arm/mach-omap2/mux44xx.c | 1625 ++++++++++++++++++++++++++ arch/arm/mach-omap2/mux44xx.h | 298 +++++ 12 files changed, 2279 insertions(+), 144 deletions(-) create mode 100644 arch/arm/mach-omap2/mux44xx.c create mode 100644 arch/arm/mach-omap2/mux44xx.h
PATCH 1/7 OMAP: mux: Replace printk with pr_xxx macros
Replace all the printk(KERN_XXX... with pr_xxx macros.
--- arch/arm/mach-omap2/mux.c | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-)
arch/arm/mach-omap2/mux.c +19 -19
@@ -102,13 +102,13 @@ int __init omap_mux_init_gpio(int gpio, int val) }if (found ==0 ) { -printk (KERN_ERR "mux: Could not set gpio%i\n" , gpio); +pr_err ("mux: Could not set gpio%i\n" , gpio);return -ENODEV ; }if (found >1 ) { -printk (KERN_INFO "mux: Multiple gpio paths (%d) for gpio%i\n" , - found, gpio); +pr_info ("mux: Multiple gpio paths (%d) for gpio%i\n" , + found, gpio);return -EINVAL ; }
@@ -118,8 +118,8 @@ int __init omap_mux_init_gpio(int gpio, int val) mux_mode |=OMAP_MUX_MODE3 ; else mux_mode |= OMAP_MUX_MODE4; -printk (KERN_DEBUG "mux: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n" , - gpio_mux->muxnames[0 ], gpio, old_mode, mux_mode); +pr_debug ("mux: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n" , + gpio_mux->muxnames[0 ], gpio, old_mode, mux_mode);omap_mux_write (mux_mode, gpio_mux->reg_offset);return 0 ;
@@ -161,9 +161,9 @@ int __init omap_mux_init_signal(const char *muxname, int val) old_mode =omap_mux_read (m->reg_offset); mux_mode = val | i; -printk (KERN_DEBUG "mux: Setting signal " -"%s.%s 0x%04x -> 0x%04x\n" , - m0_entry, muxname, old_mode, mux_mode); +pr_debug ("mux: Setting signal " +"%s.%s 0x%04x -> 0x%04x\n" , + m0_entry, muxname, old_mode, mux_mode);omap_mux_write (mux_mode, m->reg_offset); found++; }
@@ -174,12 +174,12 @@ int __init omap_mux_init_signal(const char *muxname, int val)return 0 ;if (found >1 ) { -printk (KERN_ERR "mux: Multiple signal paths (%i) for %s\n" , - found, muxname); +pr_err ("mux: Multiple signal paths (%i) for %s\n" , + found, muxname);return -EINVAL ; } -printk (KERN_ERR "mux: Could not set signal %s\n" , muxname); +pr_err ("mux: Could not set signal %s\n" , muxname);return -ENODEV ; }
@@ -462,8 +462,8 @@ static void __init omap_mux_package_fixup(struct omap_mux *p, s++; }if (!found) -printk (KERN_ERR "mux: Unknown entry offset 0x%x\n" , - p->reg_offset); +pr_err ("mux: Unknown entry offset 0x%x\n" , + p->reg_offset); p++; } }
@@ -487,8 +487,8 @@ static void __init omap_mux_package_init_balls(struct omap_ball *b, s++; }if (!found) -printk (KERN_ERR "mux: Unknown ball offset 0x%x\n" , - b->reg_offset); +pr_err ("mux: Unknown ball offset 0x%x\n" , + b->reg_offset); b++; } }
@@ -615,7 +615,7 @@ u16 omap_mux_get_gpio(int gpio) offset =omap_mux_get_by_gpio (gpio);if (offset ==OMAP_MUX_TERMINATOR ) { -printk (KERN_ERR "mux: Could not get gpio%i\n" , gpio); +pr_err ("mux: Could not get gpio%i\n" , gpio);return offset; }
@@ -629,7 +629,7 @@ void omap_mux_set_gpio(u16 val, int gpio) offset =omap_mux_get_by_gpio (gpio);if (offset ==OMAP_MUX_TERMINATOR ) { -printk (KERN_ERR "mux: Could not set gpio%i\n" , gpio); +pr_err ("mux: Could not set gpio%i\n" , gpio);return ; }
@@ -687,7 +687,7 @@ static void __init omap_mux_init_list(struct omap_mux *superset) entry =omap_mux_list_add (superset);if (!entry) { -printk (KERN_ERR "mux: Could not add entry\n" ); +pr_err ("mux: Could not add entry\n" );return ; } superset++;
@@ -738,7 +738,7 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size, mux_phys = mux_pbase; mux_base =ioremap (mux_pbase, mux_size);if (!mux_base) { -printk (KERN_ERR "mux: Could not ioremap\n" ); +pr_err ("mux: Could not ioremap\n" );return -ENODEV ; }
Signature · 1 line
1.7.0.4
PATCH 2/7 OMAP: mux: Add support for control module split in several partitions
In reply to Benoit CoussonStarting on OMAP4, the pin mux configuration is located in two different partitions of the control module (CODE_PAD and WKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.
Thanks to Tony Lindgren <[email protected]> for the following improvements:
- Add omap_mux_get for getting the partition data so platform level device code can use it.
- Fix the rx51 board code to use the new API.
Thanks to Dan Murphy <[email protected]> for testing on OMAP4 and reporting a couple of bugs.
--- arch/arm/mach-omap2/board-rx51-peripherals.c | 12 +- arch/arm/mach-omap2/mux.c | 310 +++++++++++++++++--------- arch/arm/mach-omap2/mux.h | 71 +++++- arch/arm/mach-omap2/mux2420.c | 7 +- arch/arm/mach-omap2/mux2430.c | 7 +- arch/arm/mach-omap2/mux34xx.c | 7 +- 6 files changed, 286 insertions(+), 128 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +9 -3
@@ -293,6 +293,8 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = { { .reg_offset = OMAP_MUX_TERMINATOR }, }; +static struct omap_mux_partition *partition; +/* * Current flows to eMMC when eMMC is off and the data lines are pulled up, * so pull them down. N.B. we pull 8 lines because we are using 8 lines.
@@ -300,9 +302,9 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = {static void rx51_mmc2_remux (struct device *dev,int slot,int power_on) {if (power_on) -omap_mux_write_array (rx51_mmc2_on_mux); +omap_mux_write_array (partition, rx51_mmc2_on_mux);else -omap_mux_write_array (rx51_mmc2_off_mux); +omap_mux_write_array (partition, rx51_mmc2_off_mux); }static struct omap2_hsmmc_info mmc[]__initdata = {
@@ -922,7 +924,11 @@ void __init rx51_peripherals_init(void)rx51_init_wl1251 ();spi_register_board_info (rx51_peripherals_spi_board_info,ARRAY_SIZE (rx51_peripherals_spi_board_info)); -omap2_hsmmc_init (mmc); + + partition =omap_mux_get ("core" ); +if (partition) +omap2_hsmmc_init (mmc); +platform_device_register (&rx51_charger_device); }
arch/arm/mach-omap2/mux.c +206 -104
560 lines not on this page · raw message
arch/arm/mach-omap2/mux.h +59 -12
128 lines not on this page · raw message
arch/arm/mach-omap2/mux2420.c +4 -3
@@ -681,8 +681,9 @@ int __init omap2420_mux_init(struct omap_board_mux *board_subset, int flags)pr_warning ("mux: No ball data available for omap2420 package\n" ); } -return omap_mux_init (OMAP2420_CONTROL_PADCONF_MUX_PBASE , +return omap_mux_init ("core" ,OMAP_MUX_REG_8BIT |OMAP_MUX_GPIO_IN_MODE3 , +OMAP2420_CONTROL_PADCONF_MUX_PBASE ,OMAP2420_CONTROL_PADCONF_MUX_SIZE , - omap2420_muxmodes,NULL , board_subset, - package_balls); + omap2420_muxmodes,NULL , board_subset, + package_balls); }
arch/arm/mach-omap2/mux2430.c +4 -3
@@ -784,8 +784,9 @@ int __init omap2430_mux_init(struct omap_board_mux *board_subset, int flags)pr_warning ("mux: No ball data available for omap2420 package\n" ); } -return omap_mux_init (OMAP2430_CONTROL_PADCONF_MUX_PBASE , +return omap_mux_init ("core" ,OMAP_MUX_REG_8BIT |OMAP_MUX_GPIO_IN_MODE3 , +OMAP2430_CONTROL_PADCONF_MUX_PBASE ,OMAP2430_CONTROL_PADCONF_MUX_SIZE , - omap2430_muxmodes,NULL , board_subset, - package_balls); + omap2430_muxmodes,NULL , board_subset, + package_balls); }
arch/arm/mach-omap2/mux34xx.c +4 -3
@@ -2053,8 +2053,9 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)return -EINVAL ; } -return omap_mux_init (OMAP3_CONTROL_PADCONF_MUX_PBASE , +return omap_mux_init ("core" ,0 , +OMAP3_CONTROL_PADCONF_MUX_PBASE ,OMAP3_CONTROL_PADCONF_MUX_SIZE , - omap3_muxmodes, package_subset, board_subset, - package_balls); + omap3_muxmodes, package_subset, board_subset, + package_balls); }
Signature · 1 line
1.7.0.4
Tony Lindgren
maintainerRe: [PATCH 2/7] OMAP: mux: Add support for control module split in several partitions
Quoted 10 lines · Benoit Cousson
Starting on OMAP4, the pin mux configuration is located in two different partitions of the control module (
CODE_PADandWKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.
Here's one more patch that I'd like to merge into this patch to avoid repeating the partition for each mux entry.
Assuming no more comments, I'll queue these for 2.6.38 merge window.
Regards,
Tony
From: Tony Lindgren <[email protected]>
Date: Mon, 15 Nov 2010 11:52:20 -0800
Subject: [PATCH] omap: mux: Save memory for struct omap_mux
There's no need to repeat the partition for each mux entry. We can look up the partition for debugfs.
arch/arm/mach-omap2/mux.c +30 -3
@@ -348,14 +348,37 @@ static const struct file_operations omap_mux_dbg_board_fops = { .release = single_release, }; +static struct omap_mux_partition *omap_mux_get_partition (struct omap_mux *mux) +{ +struct omap_mux_partition *partition; + +list_for_each_entry (partition, &mux_partitions, node) { +struct list_head *muxmodes = &partition->muxmodes; +struct omap_mux_entry *e; + +list_for_each_entry (e, muxmodes, node) { +struct omap_mux *m = &e->mux; + +if (m == mux) +return partition; + } + } + +return NULL ; +} +static int omap_mux_dbg_signal_show (struct seq_file *s,void *unused) {struct omap_mux *m = s->private; -struct omap_mux_partition *partition = m->partition; +struct omap_mux_partition *partition;const char *none ="NA" ;u16 val;int mode; + partition =omap_mux_get_partition (m); +if (!partition) +return 0 ; + val =omap_mux_read (partition, m->reg_offset); mode = val &OMAP_MUX_MODE7 ;
@@ -391,6 +414,7 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file,struct omap_mux *m;unsigned long val;int buf_size, ret; +struct omap_mux_partition *partition;if (count >OMAP_MUX_MAX_ARG_CHAR )return -EINVAL ;
@@ -411,7 +435,11 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file, seqf = file->private_data; m = seqf->private; -omap_mux_write (m->partition, (u16 )val, m->reg_offset); + partition =omap_mux_get_partition (m); +if (!partition) +return -ENODEV ; + +omap_mux_write (partition, (u16 )val, m->reg_offset); *ppos += count;return count;
@@ -440,7 +468,6 @@ static void __init omap_mux_dbg_create_entry(list_for_each_entry (e, &partition->muxmodes, node) {struct omap_mux *m = &e->mux; - m->partition = partition; (void )debugfs_create_file (m->muxnames[0 ],S_IWUGO , mux_dbg_dir, m, &omap_mux_dbg_signal_fops);
arch/arm/mach-omap2/mux.h +0 -1
@@ -121,7 +121,6 @@ struct omap_mux {char *muxnames[OMAP_MUX_NR_MODES ];#ifdef CONFIG_DEBUG_FS char *balls[OMAP_MUX_NR_SIDES ]; -struct omap_mux_partition *partition;#endif #endif };
Re: [PATCH 2/7] OMAP: mux: Add support for control module split in several partitions
Hi Tony,
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Benoit Cousson
Starting on OMAP4, the pin mux configuration is located in two different partitions of the control module (
CODE_PADandWKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.
Quoted 2 lines
Here's one more patch that I'd like to merge into this patch to avoid repeating the partition for each mux entry.
The memory vendors will not like you ;-)
Quoted 1 line
Assuming no more comments, I'll queue these for 2.6.38 merge window.
I'll update the series and re-post tomorrow.
Thanks,
Benoit
Quoted 96 lines
Regards,
Tony
From: Tony Lindgren<[email protected]>
Date: Mon, 15 Nov 2010 11:52:20 -0800
Subject: [PATCH] omap: mux: Save memory for structomap_muxThere's no need to repeat the partition for each mux entry. We can look up the partition for debugfs.
Signed-off-by Tony Lindgren<[email protected]>arch/arm/mach-omap2/mux.c +30
-3@@ -348,14 +348,37 @@ static const struct file_operations omap_mux_dbg_board_fops = { .release = single_release, }; +static struct omap_mux_partition *omap_mux_get_partition (struct omap_mux *mux) +{ +struct omap_mux_partition *partition; + +list_for_each_entry (partition,&mux_partitions, node) { +struct list_head *muxmodes =&partition->muxmodes; +struct omap_mux_entry *e; + +list_for_each_entry (e, muxmodes, node) { +struct omap_mux *m =&e->mux; + +if (m == mux) +return partition; + } + } + +return NULL ; +} +static int omap_mux_dbg_signal_show (struct seq_file *s,void *unused) {struct omap_mux *m = s->private; -struct omap_mux_partition *partition = m->partition; +struct omap_mux_partition *partition;const char *none ="NA" ;u16 val;int mode; + partition =omap_mux_get_partition (m); +if (!partition) +return 0 ; + val =omap_mux_read (partition, m->reg_offset); mode = val&OMAP_MUX_MODE7 ;@@ -391,6 +414,7 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file,struct omap_mux *m;unsigned long val;int buf_size, ret; +struct omap_mux_partition *partition;if (count>OMAP_MUX_MAX_ARG_CHAR )return -EINVAL ;@@ -411,7 +435,11 @@ static ssize_t omap_mux_dbg_signal_write(struct file *file, seqf = file->private_data; m = seqf->private; -omap_mux_write (m->partition, (u16 )val, m->reg_offset); + partition =omap_mux_get_partition (m); +if (!partition) +return -ENODEV ; + +omap_mux_write (partition, (u16 )val, m->reg_offset); *ppos += count;return count;@@ -440,7 +468,6 @@ static void __init omap_mux_dbg_create_entry(list_for_each_entry (e,&partition->muxmodes, node) {struct omap_mux *m =&e->mux; - m->partition = partition; (void )debugfs_create_file (m->muxnames[0 ],S_IWUGO , mux_dbg_dir, m,&omap_mux_dbg_signal_fops);arch/arm/mach-omap2/mux.h +0
-1@@ -121,7 +121,6 @@ struct omap_mux {char *muxnames[OMAP_MUX_NR_MODES ];#ifdef CONFIG_DEBUG_FS char *balls[OMAP_MUX_NR_SIDES ]; -struct omap_mux_partition *partition;#endif #endif };
Tony Lindgren
maintainerRe: [PATCH 2/7] OMAP: mux: Add support for control module split in several partitions
Quoted 15 lines · Cousson, Benoit
Hi Tony,
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Benoit Cousson
Starting on OMAP4, the pin mux configuration is located in two different partitions of the control module (
CODE_PADandWKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.
Quoted 8 lines
Quoted 2 lines
Here's one more patch that I'd like to merge into this patch to avoid repeating the partition for each mux entry.
The memory vendors will not like you ;-)
Quoted 1 line
Assuming no more comments, I'll queue these for 2.6.38 merge window.
I'll update the series and re-post tomorrow.
Thanks, no need to post them again, I already have them queued locally, they will hit for-next and linux-omap master today.
BTW, next time you do a git branch, please base it on Linus recent -rc tag instead of linux-omap master branch. We don't want the history of linux-omap master branch merged to the mainline tree..
Only if there are conflicts, then the git branches should be based on some other static commit that needs to be agreed separately.
Regards,
Tony
Re: [PATCH 2/7] OMAP: mux: Add support for control module split in several partitions
Hi Tony,
Quoted 19 lines · Tony Lindgren
Quoted 18 lines · Cousson, Benoit
Hi Tony,
Quoted 14 lines · Tony Lindgren
Quoted 10 lines · Benoit Cousson
Starting on OMAP4, the pin mux configuration is located in two different partitions of the control module (
CODE_PADandWKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.Here's one more patch that I'd like to merge into this patch to avoid repeating the partition for each mux entry.
Quoted 8 lines
Quoted 5 lines
The memory vendors will not like you ;-)
Quoted 1 line
Assuming no more comments, I'll queue these for 2.6.38 merge window.
I'll update the series and re-post tomorrow.
Thanks, no need to post them again, I already have them queued locally, they will hit for-next and linux-omap master today.
OK, but I already did it because there is a checkpatch issue in your first patch and I received another patch from Dan to add __func__ in the pr_xxx macros. I can repost, or you can get the update in my GIT (ctrl-wip/mux-omap4-v4).
Quoted 3 lines
BTW, next time you do a git branch, please base it on Linus recent -rc tag instead of linux-omap master branch. We don't want the history of linux-omap master branch merged to the mainline tree..
Euh, this is what I already did for this series. Quoting myself:
"The series is based on mainline (2.6.37-rc1) and is available here:git://gitorious.org/omap-pm/linux.git ctrl-wip/mux-omap4-v3"
Did I messed up something?
Regards,
Benoit
Tony Lindgren
maintainerRe: [PATCH 2/7] OMAP: mux: Add support for control module split in several partitions
Quoted 28 lines · Cousson, Benoit
Hi Tony,
Quoted 25 lines · Tony Lindgren
Quoted 23 lines · Cousson, Benoit
Hi Tony,
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Benoit Cousson
Starting on OMAP4, the pin mux configuration is located in two different partitions of the control module (
CODE_PADandWKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.Quoted 2 lines
Here's one more patch that I'd like to merge into this patch to avoid repeating the partition for each mux entry.
The memory vendors will not like you ;-)
Quoted 1 line
Assuming no more comments, I'll queue these for 2.6.38 merge window.
I'll update the series and re-post tomorrow.
Quoted 7 lines
Quoted 2 lines
Thanks, no need to post them again, I already have them queued locally, they will hit for-next and linux-omap master today.
OK, but I already did it because there is a checkpatch issue in your first patch and I received another patch from Dan to add
__func__in thepr_xxxmacros.
I can repost, or you can get the update in my GIT (ctrl-wip/mux-omap4-v4).
OK, if they're changed maybe repost the whole series one more time, and then I'll merge in your branch assuming no more comments.
Quoted 10 lines
Quoted 3 lines
BTW, next time you do a git branch, please base it on Linus recent -rc tag instead of linux-omap master branch. We don't want the history of linux-omap master branch merged to the mainline tree..
Euh, this is what I already did for this series. Quoting myself:
"The series is based on mainline (2.6.37-rc1) and is available here:
git://gitorious.org/omap-pm/linux.gitctrl-wip/mux-omap4-v3"Did I messed up something?
No, mux-omap4-v4 branch looks OK. I guess what I tried pulling was something older.
Regards,
Tony
Re: [PATCH 2/7] OMAP: mux: Add support for control module split in several partitions
Quoted 46 lines · Tony Lindgren
Quoted 28 lines · Cousson, Benoit
Hi Tony,
Quoted 25 lines · Tony Lindgren
Quoted 23 lines · Cousson, Benoit
Hi Tony,
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Benoit Cousson
Starting on OMAP4, the pin mux configuration is located in two different partitions of the control module (
CODE_PADandWKUP_PAD). The first one is inside the core power domain whereas the second one is inside the wakeup.
- Add the capability to add any number of partition during board init time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition> if the current mux mode is not the default one.Quoted 2 lines
Here's one more patch that I'd like to merge into this patch to avoid repeating the partition for each mux entry.
The memory vendors will not like you ;-)
Quoted 1 line
Assuming no more comments, I'll queue these for 2.6.38 merge window.
I'll update the series and re-post tomorrow.
Quoted 7 lines
Quoted 2 lines
Thanks, no need to post them again, I already have them queued locally, they will hit for-next and linux-omap master today.
OK, but I already did it because there is a checkpatch issue in your first patch and I received another patch from Dan to add
__func__in thepr_xxxmacros.
I can repost, or you can get the update in my GIT (ctrl-wip/mux-omap4-v4).OK, if they're changed maybe repost the whole series one more time, and then I'll merge in your branch assuming no more comments.
Quoted 6 lines
Quoted 3 lines
BTW, next time you do a git branch, please base it on Linus recent -rc tag instead of linux-omap master branch. We don't want the history of linux-omap master branch merged to the mainline tree..
Euh, this is what I already did for this series. Quoting myself:
Quoted 7 lines
Quoted 4 lines
"The series is based on mainline (2.6.37-rc1) and is available here:
git://gitorious.org/omap-pm/linux.gitctrl-wip/mux-omap4-v3"Did I messed up something?
No, mux-omap4-v4 branch looks OK. I guess what I tried pulling was something older.
The v2 was done before the 2.6.37-rc1 and was dependent of the ES2 support that's why it was based on l-o/master. Starting on v3, I rebased everything on mainline.
I'll post the v4 revision.
Benoit
PATCH 3/7 OMAP4: mux: Add CBL package data for OMAP4430 ES1
In reply to Benoit CoussonAdd data for OMAP4430 generated from HW pinout & register database. The data set is split in two partitions for both core and wkup.
--- arch/arm/mach-omap2/Kconfig | 3 + arch/arm/mach-omap2/Makefile | 1 + arch/arm/mach-omap2/mux.h | 12 + arch/arm/mach-omap2/mux44xx.c | 900 +++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/mux44xx.h | 277 +++++++++++++ 5 files changed, 1193 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/mux44xx.c create mode 100644 arch/arm/mach-omap2/mux44xx.h
arch/arm/mach-omap2/Kconfig +3 -0
@@ -85,6 +85,9 @@ config OMAP_PACKAGE_CUS config OMAP_PACKAGE_CBP bool +config OMAP_PACKAGE_CBL + bool + comment "OMAP Board Type" depends on ARCH_OMAP2PLUS
arch/arm/mach-omap2/Makefile +1 -0
@@ -42,6 +42,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o +obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o # SMS/SDRC obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
arch/arm/mach-omap2/mux.h +12 -0
@@ -10,6 +10,7 @@#include "mux2420.h" #include "mux2430.h" #include "mux34xx.h" +#include "mux44xx.h" #define OMAP_MUX_TERMINATOR 0xffff
@@ -37,6 +38,9 @@#define OMAP_OFF_PULL_UP (1 << 13)#define OMAP_WAKEUP_EN (1 << 14) +/* 44xx specific mux bit defines */ +#define OMAP_WAKEUP_EVENT (1 << 15) +/* Active pin states */ #define OMAP_PIN_OUTPUT 0#define OMAP_PIN_INPUT OMAP_INPUT_EN
@@ -58,6 +62,7 @@/* Flags for omapX_mux_init */ #define OMAP_PACKAGE_MASK 0xffff +#define OMAP_PACKAGE_CBL 7/* 547-pin 0.40 0.40 */ #define OMAP_PACKAGE_CBP 6/* 515-pin 0.40 0.50 */ #define OMAP_PACKAGE_CUS 5/* 423-pin 0.65 */ #define OMAP_PACKAGE_CBB 4/* 515-pin 0.40 0.50 */
@@ -241,6 +246,13 @@ int omap2430_mux_init(struct omap_board_mux *board_mux, int flags);int omap3_mux_init (struct omap_board_mux *board_mux,int flags);/** +* omap4_mux_init() - initialize mux system with board specific set +* @board_mux: Board specific mux table +* @flags: OMAP package type used for the board +*/ +int omap4_mux_init (struct omap_board_mux *board_mux,int flags); + +/** * omap_mux_init - private mux init function, do not call */ int omap_mux_init(const char *name, u32 flags,
arch/arm/mach-omap2/mux44xx.c new file +900 -0
900 lines not on this page · raw message
arch/arm/mach-omap2/mux44xx.h new file +277 -0
277 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 4/7 OMAP4: sdp4430: Select CBL package for ES1 and initialize mux
In reply to Benoit CoussonSelect the CBL package if SDP4430 is enabled during config. Initialize the mux framework during the board init.
--- arch/arm/mach-omap2/Kconfig | 1 + arch/arm/mach-omap2/board-4430sdp.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Kconfig +1 -0
@@ -280,6 +280,7 @@ config MACH_OMAP_4430SDP bool "OMAP 4430 SDP board" default y depends on ARCH_OMAP4 + select OMAP_PACKAGE_CBL config MACH_OMAP4_PANDA bool "OMAP4 Panda Board"
arch/arm/mach-omap2/board-4430sdp.c +10 -0
@@ -35,6 +35,7 @@#include <plat/usb.h> #include <plat/mmc.h> +#include "mux.h" #include "hsmmc.h" #include "timer-gp.h" #include "control.h"
@@ -505,10 +506,19 @@ static void __init omap_sfh7741prox_init(void) } } +#ifdef CONFIG_OMAP_MUX +static struct omap_board_mux board_mux[]__initdata = { + { .reg_offset =OMAP_MUX_TERMINATOR }, +}; +#else +#define board_mux NULL +#endif +static void __init omap_4430sdp_init (void ) {int status; +omap4_mux_init (board_mux,OMAP_PACKAGE_CBL );omap4_i2c_init ();omap_sfh7741prox_init ();platform_add_devices (sdp4430_devices,ARRAY_SIZE (sdp4430_devices));
Signature · 1 line
1.7.0.4
PATCH 5/7 OMAP4: mux: Add CBS package data for OMAP4430 ES2
In reply to Benoit CoussonPlease note that the full muxmodes are re-defined for ES2 instead of using the subset. There are 81 differences among 204 pins. The subset fixup will have to iterate over the whole list for each subset entry, which can lead to an important number of iteration. On the other hand, it will take much more memory at boot time.
--- arch/arm/mach-omap2/Kconfig | 3 + arch/arm/mach-omap2/mux.h | 1 + arch/arm/mach-omap2/mux44xx.c | 741 ++++++++++++++++++++++++++++++++++++++++- arch/arm/mach-omap2/mux44xx.h | 21 ++ 4 files changed, 758 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Kconfig +3 -0
@@ -88,6 +88,9 @@ config OMAP_PACKAGE_CBP config OMAP_PACKAGE_CBL bool +config OMAP_PACKAGE_CBS + bool + comment "OMAP Board Type" depends on ARCH_OMAP2PLUS
arch/arm/mach-omap2/mux.h +1 -0
@@ -62,6 +62,7 @@/* Flags for omapX_mux_init */ #define OMAP_PACKAGE_MASK 0xffff +#define OMAP_PACKAGE_CBS 8/* 547-pin 0.40 0.40 */ #define OMAP_PACKAGE_CBL 7/* 547-pin 0.40 0.40 */ #define OMAP_PACKAGE_CBP 6/* 515-pin 0.40 0.50 */ #define OMAP_PACKAGE_CUS 5/* 423-pin 0.65 */
arch/arm/mach-omap2/mux44xx.c +733 -8
785 lines not on this page · raw message
arch/arm/mach-omap2/mux44xx.h +21 -0
@@ -233,6 +233,27 @@#define OMAP4_CTRL_MODULE_PAD_DPM_EMU18_OFFSET 0x01d2#define OMAP4_CTRL_MODULE_PAD_DPM_EMU19_OFFSET 0x01d4 +/* ES2.0 only */ +#define OMAP4_CTRL_MODULE_PAD_GPMC_WAIT2_OFFSET 0x008e +#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS4_OFFSET 0x0090 +#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS5_OFFSET 0x0092 +#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS6_OFFSET 0x0094 +#define OMAP4_CTRL_MODULE_PAD_GPMC_NCS7_OFFSET 0x0096 + +#define OMAP4_CTRL_MODULE_PAD_KPD_COL3_OFFSET 0x017c +#define OMAP4_CTRL_MODULE_PAD_KPD_COL4_OFFSET 0x017e +#define OMAP4_CTRL_MODULE_PAD_KPD_COL5_OFFSET 0x0180 +#define OMAP4_CTRL_MODULE_PAD_KPD_COL0_OFFSET 0x0182 +#define OMAP4_CTRL_MODULE_PAD_KPD_COL1_OFFSET 0x0184 +#define OMAP4_CTRL_MODULE_PAD_KPD_COL2_OFFSET 0x0186 +#define OMAP4_CTRL_MODULE_PAD_KPD_ROW3_OFFSET 0x0188 +#define OMAP4_CTRL_MODULE_PAD_KPD_ROW4_OFFSET 0x018a +#define OMAP4_CTRL_MODULE_PAD_KPD_ROW5_OFFSET 0x018c +#define OMAP4_CTRL_MODULE_PAD_KPD_ROW0_OFFSET 0x018e +#define OMAP4_CTRL_MODULE_PAD_KPD_ROW1_OFFSET 0x0190 +#define OMAP4_CTRL_MODULE_PAD_KPD_ROW2_OFFSET 0x0192 + +#define OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE \ (OMAP4_CTRL_MODULE_PAD_DPM_EMU19_OFFSET \ - OMAP4_CTRL_MODULE_PAD_GPMC_AD0_OFFSET + 2)
Signature · 1 line
1.7.0.4
PATCH 6/7 OMAP4: sdp4430: Select CBS package for ES2
In reply to Benoit CoussonSelect the CBS package if SDP4430 is enabled during config. Use the proper package (CBL or CBS) based on chip revision.
--- arch/arm/mach-omap2/Kconfig | 1 + arch/arm/mach-omap2/board-4430sdp.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/Kconfig +1 -0
@@ -284,6 +284,7 @@ config MACH_OMAP_4430SDP default y depends on ARCH_OMAP4 select OMAP_PACKAGE_CBL + select OMAP_PACKAGE_CBS config MACH_OMAP4_PANDA bool "OMAP4 Panda Board"
arch/arm/mach-omap2/board-4430sdp.c +5 -1
@@ -517,8 +517,12 @@ static struct omap_board_mux board_mux[] __initdata = {static void __init omap_4430sdp_init (void ) {int status; +int package =OMAP_PACKAGE_CBS ; + +if (omap_rev () ==OMAP4430_REV_ES1_0 ) + package =OMAP_PACKAGE_CBL ; +omap4_mux_init (board_mux, package); -omap4_mux_init (board_mux,OMAP_PACKAGE_CBL );omap4_i2c_init ();omap_sfh7741prox_init ();platform_add_devices (sdp4430_devices,ARRAY_SIZE (sdp4430_devices));
Signature · 1 line
1.7.0.4
PATCH 7/7 OMAP4: pandaboard: Select CBL & CBS package and initialize mux
In reply to Benoit CoussonFrom: sricharan <[email protected]>
The mux framework allows the change of pad configuration by drivers when needed. Prior to this the mux framework has to be initialised with all the mux parameters specific to the board. The mux init is already present in the board file for SDP. Adding the mux init for panda boards.
--- arch/arm/mach-omap2/Kconfig | 2 ++ arch/arm/mach-omap2/board-omap4panda.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Kconfig +2 -0
@@ -290,6 +290,8 @@ config MACH_OMAP4_PANDA bool "OMAP4 Panda Board" default y depends on ARCH_OMAP4 + select OMAP_PACKAGE_CBL + select OMAP_PACKAGE_CBS config OMAP3_EMU bool "OMAP3 debugging peripherals"
arch/arm/mach-omap2/board-omap4panda.c +16 -0
@@ -40,6 +40,7 @@#include "hsmmc.h" #include "control.h" +#include "mux.h" #define GPIO_HUB_POWER 1#define GPIO_HUB_NRESET 62
@@ -368,8 +369,23 @@ static int __init omap4_panda_i2c_init(void)omap_register_i2c_bus (4 ,400 ,NULL ,0 );return 0 ; } + +#ifdef CONFIG_OMAP_MUX +static struct omap_board_mux board_mux[]__initdata = { + { .reg_offset =OMAP_MUX_TERMINATOR }, +}; +#else +#define board_mux NULL +#endif +static void __init omap4_panda_init (void ) { +int package =OMAP_PACKAGE_CBS ; + +if (omap_rev () ==OMAP4430_REV_ES1_0 ) + package =OMAP_PACKAGE_CBL ; +omap4_mux_init (board_mux, package); +omap4_panda_i2c_init ();platform_add_devices (panda_devices,ARRAY_SIZE (panda_devices));omap_serial_init ();
Signature · 1 line
1.7.0.4