omap4 i2c board support and fixes
cover omap4 i2c board support and fixes
This series mainly adds I2C board data for OMAP4430 SDP and few needed fixes. I have made this into one series just for simplcity otherwise couple patches are independent. The intent is to get it merged in linux-omap master for testing. The needed I2C driver support is already merged in l-o master
It's generated against latest linux-omap master and tested with omap4430 and omap3430 sdps with regular and multi-omap defconfig
Balaji T K (2):
omap4: add i2c1 peripherals data
omap4: Enable RTC and regulator support
Richard Woodruff (1):
omap4: Fix build break when used with gcc-4.4.1 (2009-q3)
Santosh Shilimkar (3):
omap4: Fix WDT Kconfig
omap4: Fix McBSP4 base address
omap4: Add i2c board support on omap4430 sdp platform
arch/arm/configs/omap_4430sdp_defconfig | 39 ++++++- arch/arm/mach-omap2/board-4430sdp.c | 187 +++++++++++++++++++++++++++++++ arch/arm/mach-omap2/omap-headsmp.S | 6 +- arch/arm/mach-omap2/omap44xx-smc.S | 2 +- arch/arm/plat-omap/i2c.c | 21 +++- arch/arm/plat-omap/include/plat/mcbsp.h | 2 +- drivers/watchdog/Kconfig | 6 +- 7 files changed, 249 insertions(+), 14 deletions(-)
PATCH 1/6 omap4: Fix build break when used with gcc-4.4.1 (2009-q3)
From: Richard Woodruff <[email protected]>
This patch adds argument to smc calls as gcc-4.4.1 requires it otherwise the build breaks with 2009-q3 toolchanin.
arch/arm/mach-omap2/omap-headsmp.S: Assembler messages:arch/arm/mach-omap2/omap-headsmp.S:36: Error: missing expression -- smc' arch/arm/mach-omap2/omap-headsmp.S:55: Error: missing expression -- smc' arch/arm/mach-omap2/omap-headsmp.S:63: Error: missing expression -- `smc' make[1]: *** [arch/arm/mach-omap2/omap-headsmp.o] Error 1
--- arch/arm/mach-omap2/omap-headsmp.S | 6 +++--- arch/arm/mach-omap2/omap44xx-smc.S | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap-headsmp.S +3 -3
@@ -33,7 +33,7 @@ ENTRY(omap_secondary_startup) hold: ldr r12,=0x103 dsb - smc @ read from AuxCoreBoot0 + smc #0 @ read from AuxCoreBoot0 mov r0, r0, lsr #9 mrc p15, 0, r4, c0, c0, 5 and r4, r4, #0x0f
@@ -52,7 +52,7 @@ ENTRY(omap_modify_auxcoreboot0) stmfd sp!, {r1-r12, lr} ldr r12, =0x104 dsb - smc + smc #0 ldmfd sp!, {r1-r12, pc} END(omap_modify_auxcoreboot0)
@@ -60,6 +60,6 @@ ENTRY(omap_auxcoreboot_addr) stmfd sp!, {r2-r12, lr} ldr r12, =0x105 dsb - smc + smc #0 ldmfd sp!, {r2-r12, pc} END(omap_auxcoreboot_addr)
arch/arm/mach-omap2/omap44xx-smc.S +1 -1
@@ -27,6 +27,6 @@ ENTRY(omap_smc1) mov r12, r0 mov r0, r1 dsb - smc + smc #0 ldmfd sp!, {r2-r12, pc} END(omap_smc1)
Signature · 1 line
1.6.0.4
PATCH 2/6 omap4: Fix WDT Kconfig
This patch allows Watchdog timer to be selected for OMAP4 by fixing Kconfig entry
--- drivers/watchdog/Kconfig | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/watchdog/Kconfig +3 -3
@@ -199,10 +199,10 @@ config EP93XX_WATCHDOG config OMAP_WATCHDOG tristate "OMAP Watchdog" - depends on ARCH_OMAP16XX || ARCH_OMAP2 || ARCH_OMAP3 + depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS help - Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog. Say 'Y' - here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog timer. + Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog. Say 'Y' + here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. config PNX4008_WATCHDOG tristate "PNX4008 Watchdog"
Signature · 1 line
1.6.0.4
PATCH 3/6 omap4: Fix McBSP4 base address
This patch fixes the McBSP4 base address for OMAP4
--- arch/arm/plat-omap/include/plat/mcbsp.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-omap/include/plat/mcbsp.h +1 -1
@@ -59,7 +59,7 @@#define OMAP44XX_MCBSP1_BASE 0x49022000#define OMAP44XX_MCBSP2_BASE 0x49024000#define OMAP44XX_MCBSP3_BASE 0x49026000 -#define OMAP44XX_MCBSP4_BASE 0x48074000 +#define OMAP44XX_MCBSP4_BASE 0x48096000#if defined(CONFIG_ARCH_OMAP15XX ) || defined(CONFIG_ARCH_OMAP16XX ) || defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP850 )
Signature · 1 line
1.6.0.4
PATCH 4/6 omap4: Add i2c board support on omap4430 sdp platform
This patch adds the i2c board support for OMAP4430 SDP platform. The necessary drivers support patch is posted earlier.
https://patchwork.kernel.org/patch/80659/
--- arch/arm/configs/omap_4430sdp_defconfig | 19 +++++++++++++++++-- arch/arm/mach-omap2/board-4430sdp.c | 10 ++++++++++ arch/arm/plat-omap/i2c.c | 21 +++++++++++++++++++-- 3 files changed, 46 insertions(+), 4 deletions(-)
arch/arm/configs/omap_4430sdp_defconfig +17 -2
@@ -456,8 +456,23 @@ CONFIG_HW_RANDOM=y # CONFIG_R3964 is not set # CONFIG_RAW_DRIVER is not set # CONFIG_TCG_TPM is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE is not set +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_OCORES is not set +CONFIG_I2C_OMAP=y +# CONFIG_I2C_SIMTEC is not set # # PPS support
arch/arm/mach-omap2/board-4430sdp.c +10 -0
@@ -111,8 +111,18 @@ static struct omap_musb_board_data musb_board_data = { .power = 100, }; +static int __init omap4_i2c_init (void ) +{ +/* Phoenix Audio IC needs I2C1 to start with 400 KHz and less */ +omap_register_i2c_bus (1 ,400 ,NULL ,0 ); +omap_register_i2c_bus (2 ,400 ,NULL ,0 ); +omap_register_i2c_bus (3 ,400 ,NULL ,0 ); +omap_register_i2c_bus (4 ,400 ,NULL ,0 ); +return 0 ; +}static void __init omap_4430sdp_init (void ) { +omap4_i2c_init ();platform_add_devices (sdp4430_devices,ARRAY_SIZE (sdp4430_devices));omap_serial_init ();/* OMAP4 SDP uses internal transceiver so register nop transceiver */
arch/arm/plat-omap/i2c.c +19 -2
@@ -35,6 +35,7 @@#define OMAP2_I2C_BASE1 0x48070000#define OMAP2_I2C_BASE2 0x48072000#define OMAP2_I2C_BASE3 0x48060000 +#define OMAP2_I2C_BASE4 0x48350000static const char name[] ="i2c_omap" ;
@@ -54,9 +55,16 @@ static struct resource i2c_resources[][2] = { #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE2, INT_24XX_I2C2_IRQ) }, #endif +#if defined(CONFIG_ARCH_OMAP4) + { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE2, OMAP44XX_IRQ_I2C2) }, +#endif #if defined(CONFIG_ARCH_OMAP3) { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE3, INT_34XX_I2C3_IRQ) }, #endif +#if defined(CONFIG_ARCH_OMAP4) + { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE3, OMAP44XX_IRQ_I2C3) }, + { I2C_RESOURCE_BUILDER(OMAP2_I2C_BASE4, OMAP44XX_IRQ_I2C4) }, +#endif }; #define I2C_DEV_BUILDER(bus_id, res, data) \
@@ -73,12 +81,15 @@ static struct resource i2c_resources[][2] = {static u32 i2c_rate[ARRAY_SIZE (i2c_resources)];static struct platform_device omap_i2c_devices[] = {I2C_DEV_BUILDER (1 , i2c_resources[0 ], &i2c_rate[0 ]), -#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) +#if defined(CONFIG_ARCH_OMAP2PLUS)I2C_DEV_BUILDER (2 , i2c_resources[1 ], &i2c_rate[1 ]), #endif -#if defined(CONFIG_ARCH_OMAP3) +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)I2C_DEV_BUILDER (3 , i2c_resources[2 ], &i2c_rate[2 ]), #endif +#if defined(CONFIG_ARCH_OMAP4) +I2C_DEV_BUILDER (4 , i2c_resources[3 ], &i2c_rate[3 ]), +#endif };#define OMAP_I2C_CMDLINE_SETUP (BIT(31))
@@ -93,6 +104,8 @@ static int __init omap_i2c_nr_ports(void) ports =2 ; else if (cpu_is_omap34xx()) ports =3 ; + else if (cpu_is_omap44xx()) + ports =4 ;return ports; }
@@ -113,6 +126,10 @@ static int __init omap_i2c_add_bus(int bus_id) base =OMAP2_I2C_BASE1 ; irq =INT_24XX_I2C1_IRQ ; } +if (cpu_is_omap44xx ()) { + base =OMAP2_I2C_BASE1 ; + irq =OMAP44XX_IRQ_I2C1 ; + } res[0 ].start = base; res[0 ].end = base +OMAP_I2C_SIZE ; res[1 ].start = irq;
Signature · 1 line
1.6.0.4
PATCH 5/6 omap4: add i2c1 peripherals data
From: Balaji T K <[email protected]>
This patch adds i2c1 peripherals data to
omap4430 sdp board file.
--- arch/arm/mach-omap2/board-4430sdp.c | 179 ++++++++++++++++++++++++++++++++++- 1 files changed, 178 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +178 -1
@@ -18,6 +18,8 @@#include <linux/io.h> #include <linux/gpio.h> #include <linux/usb/otg.h> +#include <linux/i2c/twl.h> +#include <linux/regulator/machine.h> #include <mach/hardware.h> #include <asm/mach-types.h>
@@ -78,6 +80,25 @@ static int __init omap_l2_cache_init(void)early_initcall (omap_l2_cache_init);#endif + +static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { + { + .supply ="vmmc" , + }, + { + .supply ="vmmc" , + }, + { + .supply ="vmmc" , + }, + { + .supply ="vmmc" , + }, + { + .supply ="vmmc" , + }, +}; +static void __init gic_init_irq (void ) {void __iomem *base;
@@ -111,10 +132,166 @@ static struct omap_musb_board_data musb_board_data = { .power = 100, }; +static struct regulator_init_data sdp4430_vaux1 = { + .constraints = { + .min_uV =1000000 , + .max_uV =3000000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vaux2 = { + .constraints = { + .min_uV =1200000 , + .max_uV =2800000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vaux3 = { + .constraints = { + .min_uV =1000000 , + .max_uV =3000000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +/* VMMC1 for MMC1 card */ +static struct regulator_init_data sdp4430_vmmc = { + .constraints = { + .min_uV =1200000 , + .max_uV =3000000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =5 , + .consumer_supplies = sdp4430_vmmc_supply, +}; + +static struct regulator_init_data sdp4430_vpp = { + .constraints = { + .min_uV =1800000 , + .max_uV =2500000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vusim = { + .constraints = { + .min_uV =1200000 , + .max_uV =2900000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vana = { + .constraints = { + .min_uV =2100000 , + .max_uV =2100000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vcxio = { + .constraints = { + .min_uV =1800000 , + .max_uV =1800000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vdac = { + .constraints = { + .min_uV =1800000 , + .max_uV =1800000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct regulator_init_data sdp4430_vusb = { + .constraints = { + .min_uV =3300000 , + .max_uV =3300000 , + .apply_uV = true, + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, +}; + +static struct twl4030_platform_data sdp4430_twldata = { + .irq_base =TWL6030_IRQ_BASE , + .irq_end =TWL6030_IRQ_END , + +/* Regulators */ + .vmmc = &sdp4430_vmmc, + .vpp = &sdp4430_vpp, + .vusim = &sdp4430_vusim, + .vana = &sdp4430_vana, + .vcxio = &sdp4430_vcxio, + .vdac = &sdp4430_vdac, + .vusb = &sdp4430_vusb, + .vaux1 = &sdp4430_vaux1, + .vaux2 = &sdp4430_vaux2, + .vaux3 = &sdp4430_vaux3, +}; + +static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { + { +I2C_BOARD_INFO ("twl6030" ,0x48 ), + .flags =I2C_CLIENT_WAKE , + .irq =OMAP44XX_IRQ_SYS_1N , + .platform_data = &sdp4430_twldata, + }, +}; +static int __init omap4_i2c_init (void ) {/* Phoenix Audio IC needs I2C1 to start with 400 KHz and less */ -omap_register_i2c_bus (1 ,400 ,NULL ,0 ); +omap_register_i2c_bus (1 ,400 , sdp4430_i2c_boardinfo, +ARRAY_SIZE (sdp4430_i2c_boardinfo));omap_register_i2c_bus (2 ,400 ,NULL ,0 );omap_register_i2c_bus (3 ,400 ,NULL ,0 );omap_register_i2c_bus (4 ,400 ,NULL ,0 );
Signature · 1 line
1.6.0.4
PATCH 6/6 omap4: Enable RTC and regulator support
From: Balaji T K <[email protected]>
This patch enables RTC and regulator support on omap4430 sdp platform.
--- arch/arm/configs/omap_4430sdp_defconfig | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-)
arch/arm/configs/omap_4430sdp_defconfig +18 -2
@@ -523,11 +523,12 @@ CONFIG_SSB_POSSIBLE=y # CONFIG_MFD_ASIC3 is not set # CONFIG_HTC_EGPIO is not set # CONFIG_HTC_PASIC3 is not set +CONFIG_TWL4030_CORE=y # CONFIG_MFD_TMIO is not set # CONFIG_MFD_T7L66XB is not set # CONFIG_MFD_TC6387XB is not set # CONFIG_MFD_TC6393XB is not set -# CONFIG_REGULATOR is not set +CONFIG_REGULATOR=y # CONFIG_MEDIA_SUPPORT is not set #
@@ -556,12 +557,27 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_NEW_LEDS is not set # CONFIG_ACCESSIBILITY is not set CONFIG_RTC_LIB=y -# CONFIG_RTC_CLASS is not set +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" # CONFIG_DMADEVICES is not set # CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set # +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y + +# +# I2C TWL drivers +# +CONFIG_RTC_DRV_TWL4030=y +CONFIG_REGULATOR_TWL4030=y + +# # TI VLYNQ # # CONFIG_STAGING is not set
Signature · 1 line
1.6.0.4
Tony Lindgren
maintainerPATCH 3/6 omap4: Fix McBSP4 base address
In reply to Santosh ShilimkarThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: omap-fixes
Initial commit ID (Likely to change): 9d4ef5ebed8a94aaaa9d96fb0aa587873b95695f
PatchWorks
http://patchwork.kernel.org/patch/90960/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=9d4ef5ebed8a94aaaa9d96fb0aa587873b95695f
Tony Lindgren
maintainerPATCH 1/6 omap4: Fix build break when used with gcc-4.4.1
In reply to Santosh ShilimkarThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: omap-fixes
Initial commit ID (Likely to change): e6680749bbb3905c7707163e095403542126b147
PatchWorks
http://patchwork.kernel.org/patch/90964/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=e6680749bbb3905c7707163e095403542126b147
Tony Lindgren
maintainerQuoted 8 lines · Santosh Shilimkar
This series mainly adds I2C board data for OMAP4430 SDP and few needed fixes. I have made this into one series just for simplcity otherwise couple patches are independent. The intent is to get it merged in linux-omap master for testing. The needed I2C driver support is already merged in l-o master
It's generated against latest linux-omap master and tested with omap4430 and omap3430 sdps with regular and multi-omap defconfig
Santosh, can you please repost one more time the remaining patches refreshed against the current omap for-next branch? Patches 4 - 6 need to be refreshed to apply.
Thanks,
Tony
Quoted 14 lines
-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Wednesday, May 12, 2010 5:48 AM
To: Shilimkar, Santosh
Cc: [email protected]
Subject: Re: [PATCH 0/6] omap4 i2c board support and fixesQuoted 6 lines · Santosh Shilimkar
This series mainly adds I2C board data for OMAP4430 SDP and few needed fixes. I have made this into one series just for simplcity otherwise couple patches are independent. The intent is to get it merged in linux-omap master for testing. The needed I2C driver support is already merged in l-o master
Quoted 6 lines
Quoted 2 lines
It's generated against latest linux-omap master and tested with omap4430 and omap3430 sdps with regular and multi-omap defconfig
Santosh, can you please repost one more time the remaining patches refreshed against the current omap for-next branch? Patches 4 - 6 need to be refreshed to apply.
Sure Tony!!
Regards,
Santosh