From: Mike Rapoport <mike@compulab.co.il>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org, mike.rapoport@gmail.com
Subject: Re: [PATCH 3/5] omap: mux: Add new style pin multiplexing data for 34xx
Date: Sun, 01 Nov 2009 12:30:08 +0200 [thread overview]
Message-ID: <4AED6330.8020007@compulab.co.il> (raw)
In-Reply-To: <20091029203631.11843.1364.stgit@localhost>
Tony Lindgren wrote:
> Add new style mux data for 34xx. This should also
> work with 3630 easily by adding the processor subset
> and ball data.
>
> Note that this data is __initdata, and gets optimized
> out if CONFIG_OMAP_MUX is not set. Also, the debug data
> gets optimized out if CONFIG_DEBUG_FS is not set.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> arch/arm/mach-omap2/Makefile | 4
> arch/arm/mach-omap2/mux.h | 2
> arch/arm/mach-omap2/mux34xx.c | 1552 +++++++++++++++++++++++++++++++++++++++++
> arch/arm/mach-omap2/mux34xx.h | 352 +++++++++
> 4 files changed, 1910 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-omap2/mux34xx.c
> create mode 100644 arch/arm/mach-omap2/mux34xx.h
>
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 03cb4fc..4b6d7b9 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -23,6 +23,10 @@ obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o
> obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o
> obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o
>
> +ifeq ($(CONFIG_OMAP_MUX),y)
> +obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o
> +endif
> +
> # SMS/SDRC
> obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
> # obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o
> diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
> index a8453f5..0d52318 100644
> --- a/arch/arm/mach-omap2/mux.h
> +++ b/arch/arm/mach-omap2/mux.h
> @@ -7,6 +7,8 @@
> * published by the Free Software Foundation.
> */
>
> +#include "mux34xx.h"
> +
> #define OMAP_MUX_TERMINATOR 0xffff
>
> /* 34xx mux mode options for each pin. See TRM for options */
> diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c
> new file mode 100644
> index 0000000..62c2b6a
> --- /dev/null
> +++ b/arch/arm/mach-omap2/mux34xx.c
> @@ -0,0 +1,1552 @@
> +/*
> + * Copyright (C) 2009 Nokia
> + * Copyright (C) 2009 Texas Instruments
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/init.h>
> +
> +#include "mux.h"
> +
> +#ifdef CONFIG_DEBUG_FS
> +
> +#define _OMAP3_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
> +{ \
> + .reg_offset = (OMAP3_CONTROL_PADCONF_##M0##_OFFSET), \
> + .gpio = (g), \
> + .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \
> +}
> +
> +#else
> +
> +#define _OMAP3_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
> +{ \
> + .reg_offset = (OMAP3_CONTROL_PADCONF_##M0##_OFFSET), \
> + .gpio = (g), \
> +}
> +
> +#endif
> +
> +#define _OMAP3_BALLENTRY(M0, bb, bt) \
> +{ \
> + .reg_offset = (OMAP3_CONTROL_PADCONF_##M0##_OFFSET), \
> + .balls = { bb, bt }, \
> +}
> +
> +/*
> + * Superset of all mux modes, same as the CBC package
> + */
> +static struct omap_mux __initdata omap3_muxmodes[] = {
Is the CBS package for sure will be superset of all possible OMAP3
variants/packages?
> + _OMAP3_MUXENTRY(CAM_D0, 99,
> + "cam_d0", NULL, NULL, NULL,
> + "gpio_99", NULL, NULL, "safe_mode"),
[ snip ]
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +
> +/*
> + * Pins different on CBC package comapared to CBC package
> + */
> +struct omap_mux __initdata omap3_cbc_subset[] = {
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +
> +/*
> + * Balls for CBC package
> + * 515-pin s-PBGA Package, 0.65mm Ball Pitch (Top), 0.50mm Ball Pitch (Bottom)
> + *
> + * FIXME: What's up with the outdated TI documentation? See:
> + *
> + * http://wiki.davincidsp.com/index.php/Datasheet_Errata_for_OMAP35x_CBC_Package
> + * http://community.ti.com/forums/t/10982.aspx
> + */
> +#ifdef CONFIG_DEBUG_FS
> +struct omap_ball __initdata omap3_cbc_ball[] = {
> + _OMAP3_BALLENTRY(CAM_D0, "ae16", NULL),
[ snip ]
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +#else
> +#define omap3_cbc_ball NULL
> +#endif
> +
> +/*
> + * Pins different on CUS package comapared to CBC package
> + */
Maybe we'll just add the entire package rather than its difference to the CBC
package?
> +struct omap_mux __initdata omap3_cus_subset[] = {
> + _OMAP3_MUXENTRY(CAM_D10, 109,
> + "cam_d10", NULL, NULL, NULL,
> + "gpio_109", NULL, NULL, "safe_mode"),
[ snip ]
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +
> +/*
> + * Balls for CUS package
> + * 423-pin s-PBGA Package, 0.65mm Ball Pitch (Bottom)
> + */
> +#ifdef CONFIG_DEBUG_FS
> +struct omap_ball __initdata omap3_cus_ball[] = {
> + _OMAP3_BALLENTRY(CAM_D0, "ab18", NULL),
[ snip ]
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +#else
> +#define omap3_cus_ball NULL
> +#endif
> +
> +/*
> + * Pins different on CBB package comapared to CBC package
> + */
ditto
> +struct omap_mux __initdata omap3_cbb_subset[] = {
> + _OMAP3_MUXENTRY(CAM_D10, 109,
> + "cam_d10", NULL, NULL, NULL,
> + "gpio_109", NULL, NULL, "safe_mode"),
[ snip ]
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +
> +/*
> + * Balls for CBB package
> + * 515-pin s-PBGA Package, 0.50mm Ball Pitch (Top), 0.40mm Ball Pitch (Bottom)
> + */
> +#ifdef CONFIG_DEBUG_FS
> +struct omap_ball __initdata omap3_cbb_ball[] = {
> + _OMAP3_BALLENTRY(CAM_D0, "ag17", NULL),
[ snip ]
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +#else
> +#define omap3_cbb_ball NULL
> +#endif
> +
> +int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)
> +{
> + struct omap_mux *package_subset;
> + struct omap_ball *package_balls;
> +
> + switch (flags & OMAP_PACKAGE_MASK) {
> + case (OMAP_PACKAGE_CBC):
> + package_subset = omap3_cbc_subset;
> + package_balls = omap3_cbc_ball;
> + break;
> + case (OMAP_PACKAGE_CBB):
> + package_subset = omap3_cbb_subset;
> + package_balls = omap3_cbb_ball;
> + break;
> + case (OMAP_PACKAGE_CUS):
> + package_subset = omap3_cus_subset;
> + package_balls = omap3_cus_ball;
> + break;
> + default:
> + printk(KERN_ERR "mux: Unknown omap package, mux disabled\n");
> + return -EINVAL;
> + }
> +
> + return omap_mux_init(OMAP3_CONTROL_PADCONF_MUX_PBASE,
> + OMAP3_CONTROL_PADCONF_MUX_SIZE,
> + omap3_muxmodes, package_subset, board_subset,
> + package_balls, flags);
> +}
> diff --git a/arch/arm/mach-omap2/mux34xx.h b/arch/arm/mach-omap2/mux34xx.h
> new file mode 100644
> index 0000000..8c5f261
> --- /dev/null
> +++ b/arch/arm/mach-omap2/mux34xx.h
> @@ -0,0 +1,352 @@
> +/*
> + * Copyright (C) 2009 Nokia
> + * Copyright (C) 2009 Texas Instruments
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
[ snip ]
> +
> +#define OMAP3_CONTROL_PADCONF_MUX_SIZE \
> + (OMAP3_CONTROL_PADCONF_JTAG_TDO_OFFSET + 0x2)
What about adding defines for each possible mode configuration, except, perhaps,
GPIO?
#define OMAP3_PIN_CAM_D0 OMAP3_MUX(CAM_D0, OMAP_PIN_MODE0 | OMAP_PIN_INPUT, 0)
#define OMAP3_PIN_CAM_D0_CSI2_DX2 OMAP3_MUX(CAM_D0, OMAP_PIN_MODE2 | \
OMAP_PIN_INPUT, 0)
And, I'm for adding OMAP_MUX_GPIO_{OUT,IN,IN_PU,IN_PD}(x) as well.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2009-11-01 10:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-29 20:35 [PATCH 0/5] New mux code for 34xx Tony Lindgren
2009-10-29 20:36 ` [PATCH 1/5] omap2: mux: intoduce omap_mux_{read,write} Tony Lindgren
2009-10-29 20:36 ` [PATCH 2/5] omap: mux: Add new style pin multiplexing code for omap3 Tony Lindgren
2009-11-01 10:30 ` Mike Rapoport
2009-11-02 18:54 ` Tony Lindgren
2009-11-03 6:56 ` Mike Rapoport
2009-10-29 20:36 ` [PATCH 3/5] omap: mux: Add new style pin multiplexing data for 34xx Tony Lindgren
2009-11-01 10:30 ` Mike Rapoport [this message]
2009-11-02 19:10 ` Tony Lindgren
2009-11-03 7:10 ` Mike Rapoport
2009-11-03 16:43 ` Tony Lindgren
2009-11-03 22:55 ` [PATCH] omap: mux: Replace omap_cfg_reg() with new style signal or gpio functions (Re: [PATCH 3/5] omap: mux: Add new style pin multiplexing data for 34xx) Tony Lindgren
2009-11-04 7:14 ` [PATCH 3/5] omap: mux: Add new style pin multiplexing data for 34xx Mike Rapoport
2009-11-10 22:37 ` Tony Lindgren
2009-11-11 8:23 ` Mike Rapoport
2009-10-29 20:36 ` [PATCH 4/5] omap: mux: Add new style init functions to omap3 board-*.c files Tony Lindgren
2009-10-29 20:36 ` [PATCH 5/5] omap: mux: Add debugfs support for new mux code Tony Lindgren
2009-10-29 21:19 ` [PATCH 0/5] New mux code for 34xx Mike Rapoport
2009-10-29 21:59 ` Tony Lindgren
2009-11-01 10:29 ` Mike Rapoport
2009-11-02 18:56 ` Tony Lindgren
2009-11-03 6:42 ` Mike Rapoport
2009-11-03 16:46 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AED6330.8020007@compulab.co.il \
--to=mike@compulab.co.il \
--cc=linux-omap@vger.kernel.org \
--cc=mike.rapoport@gmail.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox