Zoom hw reset
For arm/next
This patch enables hw resetting of zoom1 and zoom2.
This is done through the twl4030 part. Since this part is not currently supported, start an twl4030_i2c device. In testing it was found that I2C was broken on Zoom1 and Zoom2. I2C was fixed by improving the initialization of its sampling clock.
The reset changes were run tested on zoom1 and zoom2.
The I2C changes were run tested on zoom1, zoom2, beagle and overo. The 400kHz case was run tested on a variant of the zoom1 configuration.
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
This problem is seen on Zoom1 and Zoom2 in the startup and when i2c probe is used
Before :
In: serial Out: serial Err: serial timed out in wait_for_bb: I2C_STAT=1000 timed out in wait_for_bb: I2C_STAT=1000 timed out in wait_for_bb: I2C_STAT=1000 timed out in wait_for_pin: I2C_STAT=1000 I2C read: I/O error timed out in wait_for_bb: I2C_STAT=1000 timed out in wait_for_bb: I2C_STAT=1000
Die ID #327c00020000000004013ddd05026013
Hit any key to stop autoboot: 0
OMAP3 Zoom1# i2c probe
Valid chip addresses:timed out in wait_for_bb: I2C_STAT=1000
02 03 04 05 06 07 08 09 0A 0B 0C 0D <snip>
After :
In: serial Out: serial Err: serial
Die ID #327c00020000000004013ddd05026013
Hit any key to stop autoboot: 0
OMAP3 Zoom1# i2c probe
Valid chip addresses: 48 49 4A 4B
The addresses are for the twl4030.
The prescalar that converts the function clock to the sampling clock is hardcoded to 0. The reference manual recommends 7 if the function clock is 96MHz.
Instead of just changing the hardcoded values, the prescalar is calculated from the value I2C_IP_CLK.
The i2c #defines are in kHz. The speed passed into the i2c init routine is in Hz. To be consistent, change the defines to be in Hz.
This was runtime verified on Zoom1, Zoom2, Beagle and Overo. The 400kHz case was verifed on a test Zoom2 configuration.
--- drivers/i2c/omap24xx_i2c.c | 54 +++++++++++++++++++++++++++++++++----- include/asm-arm/arch-omap3/i2c.h | 16 +++++----- 2 files changed, 55 insertions(+), 15 deletions(-)
drivers/i2c/omap24xx_i2c.c +47 -7
@@ -31,7 +31,49 @@ static void flush_fifo(void);void i2c_init (int speed,int slaveadd) { -u16 scl; +int psc, iclk, scll, sclh; + +/* Only handle standard and fast speeds */ +if ((speed !=OMAP_I2C_STANDARD ) && + (speed !=OMAP_I2C_FAST_MODE )) { +printf ("Error : I2C unsupported speed %d\n" , speed); +return ; + } + +/* +* Calculate the prescalar to go from from the function clock +* to the internal sampling clock, 12MHz. +*/ + psc =I2C_PSC_MAX ; +while (psc >=I2C_PSC_MIN ) { + iclk =I2C_IP_CLK / (psc +1 ); +if (12000000 <= iclk) +break ; + psc--; + } +if (psc <I2C_PSC_MIN ) { +printf ("Error : I2C unsupported prescalar %d\n" , psc); +return ; + } + +/* +* How the low and high time periods are calculated +* See the OMAP3xxx Reference Manual for more details +* +* tlow + thigh = 1 / speed +* thigh = tlow, nice square wave.. +* +* tlow = 1 / (2 * speed) = (scll + 7) / iclk; +* scll + 7 = iclk / 2 * speed +* sclh + 5 = iclk / 2 * speed +*/ + scll = sclh = iclk / (2 * speed); + scll -=7 ; + sclh -=5 ; +if ((scll <0 ) || (sclh <0 )) { +printf ("Error : I2C initializing clock\n" ); +return ; + }writew (0x2 ,I2C_SYSC );/* for ES2 after soft reset */ udelay (1000 );
@@ -42,12 +84,10 @@ void i2c_init (int speed, int slaveadd)udelay (50000 ); } -/* 12MHz I2C module clock */ -writew (0 ,I2C_PSC ); - speed = speed/1000 ;/* 100 or 400 */ - scl = ((12000 /(speed*2 )) -7 );/* use 7 when PSC = 0 */ -writew (scl,I2C_SCLL ); -writew (scl,I2C_SCLH ); +writew (psc,I2C_PSC ); +writew (scll,I2C_SCLL ); +writew (sclh,I2C_SCLH ); +/* own address */ writew (slaveadd,I2C_OA );writew (I2C_CON_EN ,I2C_CON );
include/asm-arm/arch-omap3/i2c.h +8 -8
@@ -112,14 +112,14 @@#define I2C_SCLH_HSSCLH 8#define I2C_SCLH_HSSCLH_M 0xFF -#define OMAP_I2C_STANDARD 100 -#define OMAP_I2C_FAST_MODE 400 -#define OMAP_I2C_HIGH_SPEED 3400 - -#define SYSTEM_CLOCK_12 12000 -#define SYSTEM_CLOCK_13 13000 -#define SYSTEM_CLOCK_192 19200 -#define SYSTEM_CLOCK_96 96000 +#define OMAP_I2C_STANDARD 100000 +#define OMAP_I2C_FAST_MODE 400000 +#define OMAP_I2C_HIGH_SPEED 3400000 + +#define SYSTEM_CLOCK_12 12000000 +#define SYSTEM_CLOCK_13 13000000 +#define SYSTEM_CLOCK_192 19200000 +#define SYSTEM_CLOCK_96 96000000#define I2C_IP_CLK SYSTEM_CLOCK_96#define I2C_PSC_MAX 0x0f
Signature · 1 line
1.6.0.5
PATCH 2/4 I2C Add initial support for TWL4030
The TWL4030 supplies many peripheral for OMAP3 boards. These include power management, usb and, keyboard.
The product description is found here:
http://focus.ti.com/docs/prod/folders/print/tps65950.html
Product reference document, tps65950.pdf, is found here:
http://www.ti.com/lit/gpn/tps65950
--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/twl4030_i2c.c create mode 100644 include/twl4030.h
drivers/i2c/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o +COBJS-$(CONFIG_DRIVER_TWL4030_I2C) += twl4030_i2c.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
drivers/i2c/twl4030_i2c.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Wind River Systems, Inc. +* Tom Rix <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +* Derived from code on omapzoom, git://git.omapzoom.com/repo/u-boot.git +* +* Copyright (C) 2007-2009 Texas Instruments, Inc. +*/ + +#include <twl4030.h> + +/* Functions to read and write from TWL4030 */ +static inline int twl4030_i2c_write_u8 (u8 chip_no,u8 val,u8 reg) +{ +return i2c_write (chip_no, reg,1 , &val,1 ); +} + +static inline int twl4030_i2c_read_u8 (u8 chip_no,u8 *val,u8 reg) +{ +return i2c_read (chip_no, reg,1 , val,1 ); +} +
include/twl4030.h new file +221 -0
221 lines not on this page · raw message
Signature · 1 line
1.6.0.5
PATCH 3/4 ZOOM2 Add power reset button
The power reset button is on the top right side of the main board. Press and hold for about to 8 seconds to completely reset the board.
Some of the beta boards have a hardware problem that prevents using this feature. If is difficult to further characterize the boards that fail. So disable resetting for all beta boards.
--- board/omap3/zoom2/zoom2.c | 13 +++++++++++++ drivers/i2c/twl4030_i2c.c | 22 ++++++++++++++++++++++ include/configs/omap3_zoom2.h | 1 + include/twl4030.h | 10 ++++++++++ 4 files changed, 46 insertions(+), 0 deletions(-)
board/omap3/zoom2/zoom2.c +13 -0
@@ -32,6 +32,7 @@#ifdef CONFIG_STATUS_LED #include <status_led.h> #endif +#include <twl4030.h> #include <asm/io.h> #include <asm/arch/gpio.h> #include <asm/arch/mem.h>
@@ -141,6 +142,18 @@ int board_init (void)/* boot param addr */ gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 +0x100 ); +/* +* Board Reset +* The board is reset by holding the the large button +* on the top right side of the main board for +* eight seconds. +* +* There are reported problems of some beta boards +* continously resetting. For those boards, disable resetting. +*/ +if (ZOOM2_REVISION_PRODUCTION <=zoom2_get_revision ()) +twl4030_power_reset_init (); +#if defined(CONFIG_STATUS_LED ) && defined(STATUS_LED_BOOT )status_led_set (STATUS_LED_BOOT ,STATUS_LED_ON );#endif
drivers/i2c/twl4030_i2c.c +22 -0
@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{ +#ifdef CONFIG_OMAP3_ZOOM2 +u8 val =0 ; +if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to read the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + }else { + val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON ; +if (twl4030_i2c_write_u8 (TWL4030_CHIP_PM_MASTER , val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to write the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + } + } +#endif +} +
include/configs/omap3_zoom2.h +1 -0
@@ -145,6 +145,7 @@#define CONFIG_SYS_I2C_BUS 0#define CONFIG_SYS_I2C_BUS_SELECT 1#define CONFIG_DRIVER_OMAP34XX_I2C 1 +#define CONFIG_DRIVER_TWL4030_I2C 1/* * Board NAND Info.
include/twl4030.h +10 -0
@@ -218,4 +218,14 @@#define TWL4030_USB_PHY_CLK_CTRL_STS (0xFF)#define TWL4030_USB_PHY_DPLL_CLK (1 << 0) +#ifdef CONFIG_DRIVER_TWL4030_I2C + +/* Power Reset, use to initialize system wide resetting */ +void twl4030_power_reset_init (void ); + +#else +/* stubs */ +#define twl4030_power_reset_init () + +#endif /* CONFIG_DRIVER_TWL4030_I2C */ #endif /* TWL4030_H */
Signature · 1 line
1.6.0.5
PATCH 4/4 ZOOM1 Add power reset button
The reset button is the red circle on the top right, front of the board. Press and hold the button for 8 seconds to completely reset the board.
--- board/omap3/zoom1/zoom1.c | 8 ++++++++ drivers/i2c/twl4030_i2c.c | 2 +- include/configs/omap3_zoom1.h | 1 + 3 files changed, 10 insertions(+), 1 deletions(-)
board/omap3/zoom1/zoom1.c +8 -0
@@ -31,6 +31,7 @@* MA 02111-1307 USA */ #include <common.h> +#include <twl4030.h> #include <asm/io.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h>
@@ -51,6 +52,13 @@ int board_init(void)/* boot param addr */ gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 +0x100 ); +/* +* Board Reset +* The board is reset by holding the red button on the +* top right front face for eight seconds. +*/ +twl4030_power_reset_init (); +return 0 ; }
drivers/i2c/twl4030_i2c.c +1 -1
@@ -40,7 +40,7 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)*/ void twl4030_power_reset_init (void ) { -#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )u8 val =0 ;if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val,TWL4030_PM_MASTER_P1_SW_EVENTS )) {
include/configs/omap3_zoom1.h +1 -0
@@ -124,6 +124,7 @@#define CONFIG_SYS_I2C_BUS 0#define CONFIG_SYS_I2C_BUS_SELECT 1#define CONFIG_DRIVER_OMAP34XX_I2C 1 +#define CONFIG_DRIVER_TWL4030_I2C 1/* * Board NAND Info.
Signature · 1 line
1.6.0.5
PATCH 4/4 ZOOM1 Add power reset button
Quoted 42 lines · Tom Rix
The reset button is the red circle on the top right, front of the board. Press and hold the button for 8 seconds to completely reset the board.
Signed-off-by Tom Rix <[email protected]>--- board/omap3/zoom1/zoom1.c | 8 ++++++++ drivers/i2c/twl4030_i2c.c | 2 +- include/configs/omap3_zoom1.h | 1 + 3 files changed, 10 insertions(+), 1 deletions(-)board/omap3/zoom1/zoom1.c +8
-0@@ -31,6 +31,7 @@* MA 02111-1307 USA */ #include <common.h> +#include <twl4030.h> #include <asm/io.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h> @@ -51,6 +52,13 @@ int board_init(void)/* boot param addr */ gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 +0x100 ); +/* +* Board Reset +* The board is reset by holding the red button on the +* top right front face for eight seconds. +*/ +twl4030_power_reset_init (); +return 0 ; }drivers/i2c/twl4030_i2c.c +0
-0
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 43
Quoted 5 lines
drivers/i2c/twl4030_i2c.c +1
-1@@ -40,7 +40,7 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)*/ void twl4030_power_reset_init (void ) { -#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )
I think it will be better to avoid board specifc code in the driver unless it's the only solution
Best Regards,
J.
PATCH 4/4 ZOOM1 Add power reset button
Quoted 39 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 37 lines · Tom Rix
The reset button is the red circle on the top right, front of the board. Press and hold the button for 8 seconds to completely reset the board.
Signed-off-by Tom Rix <[email protected]>--- board/omap3/zoom1/zoom1.c | 8 ++++++++ drivers/i2c/twl4030_i2c.c | 2 +- include/configs/omap3_zoom1.h | 1 + 3 files changed, 10 insertions(+), 1 deletions(-)board/omap3/zoom1/zoom1.c +8
-0@@ -31,6 +31,7 @@* MA 02111-1307 USA */ #include <common.h> +#include <twl4030.h> #include <asm/io.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h> @@ -51,6 +52,13 @@ int board_init(void)/* boot param addr */ gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 +0x100 ); +/* +* Board Reset +* The board is reset by holding the red button on the +* top right front face for eight seconds. +*/ +twl4030_power_reset_init (); +return 0 ; }
Quoted 15 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 44
Quoted 11 lines
drivers/i2c/twl4030_i2c.c +1
-1@@ -40,7 +40,7 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)*/ void twl4030_power_reset_init (void ) { -#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )I think it will be better to avoid board specifc code in the driver unless it's the only solution
I think this is zoom1 and zoom2 specific.
I could add this function to each of their board files. I was trying to avoid that.
Tom
Quoted 3 lines
Best Regards,
J.
Menon
PATCH 4/4 ZOOM1 Add power reset button
Quoted 20 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Friday, June 12, 2009 4:57 PM
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: u-boot at lists.denx.de; Menon, Nishanth
Subject: Re: [U-Boot] [PATCH 4/4] ZOOM1 Add power reset buttonQuoted 10 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 43
Quoted 6 lines
*/
voidtwl4030_power_reset_init(void)
{drivers/i2c/twl4030_i2c.c +1
-1-#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )I think it will be better to avoid board specifc code in the driver unless it's the only solution
I think this is zoom1 and zoom2 specific.
I could add this function to each of their board files. I was trying to avoid that.
Quoted 8 lines
Quoted 8 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ if (twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, &val, + TWL4030_PM_MASTER_P1_SW_EVENTS)) { + printf("Error:TWL4030: failed to read the power register\n"); + printf("Could not initialize hardware reset\n"); + } else { + val |= TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON; + if (twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, val, + TWL4030_PM_MASTER_P1_SW_EVENTS)) {
Why is this zoom1 and zoom2 specific? You are playing with PM Master registers causing a board reset right? It should in theory work for beagleboard also.. am I wrong?
Regards,
Nishanth Menon
PATCH 4/4 ZOOM1 Add power reset button
Quoted 24 lines · Nishanth
Quoted 24 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Friday, June 12, 2009 4:57 PM
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: u-boot at lists.denx.de; Menon, Nishanth
Subject: Re: [U-Boot] [PATCH 4/4] ZOOM1 Add power reset buttonQuoted 12 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 43
Quoted 7 lines
*/
voidtwl4030_power_reset_init(void)
{drivers/i2c/twl4030_i2c.c +1
-1-#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )I think it will be better to avoid board specifc code in the driver unless it's the only solution
I think this is zoom1 and zoom2 specific.
I could add this function to each of their board files. I was trying to avoid that.
Quoted 13 lines
Quoted 9 lines
Quoted 9 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+ if (twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, &val, + TWL4030_PM_MASTER_P1_SW_EVENTS)) { + printf("Error:TWL4030: failed to read the power register\n"); + printf("Could not initialize hardware reset\n"); + } else { + val |= TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON; + if (twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, val, + TWL4030_PM_MASTER_P1_SW_EVENTS)) {Why is this zoom1 and zoom2 specific? You are playing with PM Master registers causing a board reset right? It should in theory work for beagleboard also.. am I wrong?
Half right I think.
The beagle, from the schematics, has a 'Reset' - 'S2' switch. This is tied to them omap's sys_nRespwon and to the t2_nRespwon. I think when the switch is pressed only the omap gets reset. I could try verifing this but it would take a while. Looking at theTWL4030_PM_MASTER_P1_SW_EVENTS using 'i2c md 4b 46' it is clear in both the factory and the current versions of u-boot.
I think that setting this bit in beagle will reset just the twl4030. Which I think is the right thing to do.
I will try removing the #if-defs and see what happens :|
Tom
Quoted 3 lines
Regards,
Nishanth Menon
PATCH 4/4 ZOOM1 Add power reset button
Quoted 41 lines · Tom
Quoted 29 lines · Nishanth
Quoted 17 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Friday, June 12, 2009 4:57 PM
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: u-boot at lists.denx.de; Menon, Nishanth
Subject: Re: [U-Boot] [PATCH 4/4] ZOOM1 Add power reset buttonQuoted 10 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 43
Quoted 6 lines
*/
voidtwl4030_power_reset_init(void)
{drivers/i2c/twl4030_i2c.c +1
-1-#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )I think it will be better to avoid board specifc code in the driver unless it's the only solution
Quoted 11 lines
I think this is zoom1 and zoom2 specific.
I could add this function to each of their board files. I was trying to avoid that.Quoted 8 lines
Quoted 8 lines
+ if (twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, &val,
+TWL4030_PM_MASTER_P1_SW_EVENTS)) {
+printf("Error:TWL4030: failed to read the power register\n");
+printf("Could not initialize hardware reset\n");
+ } else {
+ val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON;
+ if (twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, val,
+TWL4030_PM_MASTER_P1_SW_EVENTS)) {Quoted 3 lines
Why is this zoom1 and zoom2 specific? You are playing with PM Master registers causing a board reset right? It should in theory work for beagleboard also.. am I wrong?
Half right I think.
The beagle, from the schematics, has a 'Reset' - 'S2' switch. This is tied to them omap'ssys_nRespwonand to thet2_nRespwon. I think when the switch is pressed only the omap gets reset. I could try verifing this but it would take a while. Looking attheTWL4030_PM_MASTER_P1_SW_EVENTSusing 'i2c md 4b 46' it is clear in both the factory and the current versions of u-boot.
Quoted 4 lines
I think that setting this bit in beagle will reset just the twl4030. Which I think is the right thing to do.
I will try removing the #if-defs and see what happens :|
I have taken a closer look.
I think the 'Cold Reset' label for switch 2 should be relabeled 'Warm Reset'
twl4030 registers are persistent on beagle and zoom1 when both the sw reset cmd is given and when the beagle reset or the zoom1 reset (pin hole in back + handy paperclip) is used. The easiest way to test this is to set the sw_events manually using
inm 4b 46
then set to
40
Verify with imd 4b 46.
When the hw reset button is used on the zoom1, front face red button, the board resets and this is clear. On beagle you need to cycle power by unplugging / replugging power. Otherwise it does not get reset.
Looking at beagle schematics, the ic SN74LVC2G07 has nRESPWRON as an input. So the resetting of the omap is an or-ing of nRESPWRON and the switch. The switch has no effect on nRESPWRON. If the input & output of ic were reversed, you _may_ get the behaviour of resetting omap with a touch and resetting omap+twl4030 when held for 8+ seconds.
The moral of the story is do not depend on twl4030 to be reset.
For this patch for resetting, the reset logic is generic and should be in the driver layer and not in the board layer.
Tom
PATCH 4/4 ZOOM1 Add power reset button
looping in beagleboard for comments.
Tom said the following on 06/13/2009 09:16 AM:
Quoted 91 lines
Quoted 47 lines · Tom
Quoted 33 lines · Nishanth
Quoted 20 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Friday, June 12, 2009 4:57 PM
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: u-boot at lists.denx.de; Menon, Nishanth
Subject: Re: [U-Boot] [PATCH 4/4] ZOOM1 Add power reset buttonQuoted 12 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 43
Quoted 7 lines
*/
voidtwl4030_power_reset_init(void)
{drivers/i2c/twl4030_i2c.c +1
-1-#ifdef CONFIG_OMAP3_ZOOM2 +#if defined(CONFIG_OMAP3_ZOOM2 ) || defined(CONFIG_OMAP3_ZOOM1 )I think it will be better to avoid board specifc code in the driver unless it's the only solution
Quoted 13 lines
I think this is zoom1 and zoom2 specific.
I could add this function to each of their board files. I was trying to avoid that.Quoted 9 lines
Quoted 9 lines
+ if (twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, &val,
+TWL4030_PM_MASTER_P1_SW_EVENTS)) {
+printf("Error:TWL4030: failed to read the power register\n");
+printf("Could not initialize hardware reset\n");
+ } else {
+ val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON;
+ if (twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, val,
+TWL4030_PM_MASTER_P1_SW_EVENTS)) {Quoted 4 lines
Why is this zoom1 and zoom2 specific? You are playing with PM Master registers causing a board reset right? It should in theory work for beagleboard also.. am I wrong?
Half right I think.
The beagle, from the schematics, has a 'Reset' - 'S2' switch. This is tied to them omap'ssys_nRespwonand to thet2_nRespwon. I think when the switch is pressed only the omap gets reset. I could try verifing this but it would take a while. Looking attheTWL4030_PM_MASTER_P1_SW_EVENTSusing 'i2c md 4b 46' it is clear in both the factory and the current versions of u-boot.Quoted 5 lines
I think that setting this bit in beagle will reset just the twl4030. Which I think is the right thing to do.
I will try removing the #if-defs and see what happens :|
I have taken a closer look.
I think the 'Cold Reset' label for switch 2 should be relabeled 'Warm Reset'
twl4030 registers are persistent on beagle and zoom1 when both the sw reset cmd is given and when the beagle reset or the zoom1 reset (pin hole in back + handy paperclip) is used. The easiest way to test this is to set thesw_eventsmanually using
inm 4b 46
then set to
40
Verify with imd 4b 46.When the hw reset button is used on the zoom1, front face red button, the board resets and this is clear. On beagle you need to cycle power by unplugging / replugging power. Otherwise it does not get reset.
Looking at beagle schematics, the ic SN74LVC2G07 has nRESPWRON as an input. So the resetting of the omap is an or-ing of nRESPWRON and the switch. The switch has no effect on nRESPWRON. If the input & output of ic were reversed, you _may_ get the behaviour of resetting omap with a touch and resetting omap+twl4030 when held for 8+ seconds.
The moral of the story is do not depend on twl4030 to be reset.
For this patch for resetting, the reset logic is generic and should be in the driver layer and not in the board layer.
Tom
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 3/4 ZOOM2 Add power reset button
In reply to Tom RixHi Tom,
Quoted 20 lines
drivers/i2c/twl4030_i2c.c +12
-0@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{ +#ifdef CONFIG_OMAP3_ZOOM2 +u8 val =0 ; +if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to read the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + }else {
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 59
Quoted 10 lines
drivers/i2c/twl4030_i2c.c +10
-0+ val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON ; +if (twl4030_i2c_write_u8 (TWL4030_CHIP_PM_MASTER , val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to write the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + } + } +#endif +} +
All other drivers in drivers/i2c are host adapter drivers. Ie they implement i2c_read(), i2c_write(), i2c_probe(), and i2c_init(). The twl4030_i2c.c driver doesn't seem to fit this mold. Perhaps it would be better placed in drivers/misc or a new drivers/power directory similar to Linux?
FWIW I had the same dilemma with the ds4510 i2c device which has support for GPIO, EEEPROM, etc and ended up putting it in drivers/misc.
Best,
Peter
Menon
PATCH 3/4 ZOOM2 Add power reset button
Quoted 29 lines
-----Original Message-----
From: Peter Tyser [mailto:ptyser at xes-inc.com]
Sent: Wednesday, June 10, 2009 9:27 AMdrivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8
Quoted 5 lines
drivers/i2c/twl4030_i2c.c +0
-0@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8*val, u8 reg)
Quoted 9 lines
drivers/i2c/twl4030_i2c.c +6
-0return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{ +#ifdef CONFIG_OMAP3_ZOOM2 drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
Quoted 10 lines
drivers/i2c/twl4030_i2c.c +10
-0+u8 val =0 ; +if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to read the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + }else { + val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON ; +if (twl4030_i2c_write_u8 (TWL4030_CHIP_PM_MASTER , val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { + printf("Error:TWL4030: failed to write the powerregister\n");
Quoted 12 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 59
Quoted 6 lines
drivers/i2c/twl4030_i2c.c +6
-0+ printf("Could not initialize hardware reset\n"); + } + } +#endif +} +All other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it would be better placed indrivers/miscor a newdrivers/powerdirectory similar to Linux?
This function probably belongs to board/omap3/common/power.c -> or even better to the board file itself? Regards,
Nishanth Menon
PATCH 3/4 ZOOM2 Add power reset button
Quoted 41 lines · Nishanth
Quoted 29 lines
-----Original Message-----
From: Peter Tyser [mailto:ptyser at xes-inc.com]
Sent: Wednesday, June 10, 2009 9:27 AMdrivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8
Quoted 5 lines
drivers/i2c/twl4030_i2c.c +0
-0@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8*val, u8 reg)
Quoted 9 lines
drivers/i2c/twl4030_i2c.c +6
-0return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{ +#ifdef CONFIG_OMAP3_ZOOM2 drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
Quoted 10 lines
drivers/i2c/twl4030_i2c.c +10
-0+u8 val =0 ; +if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to read the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + }else { + val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON ; +if (twl4030_i2c_write_u8 (TWL4030_CHIP_PM_MASTER , val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { + printf("Error:TWL4030: failed to write the powerregister\n");
Quoted 11 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 59
Quoted 6 lines
drivers/i2c/twl4030_i2c.c +6
-0+ printf("Could not initialize hardware reset\n"); + } + } +#endif +} +All other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it would be better placed indrivers/miscor a newdrivers/powerdirectory similar to Linux?
Quoted 1 line
This function probably belongs to
board/omap3/common/power.c-> or even better to the board file itself?
I was about to mention the opposite ;)
Jean-Christophe asked to move the code from power.c to driver directory
http://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with power.c. If we get now a twl4030_i2c.c, we should merge the code from power.c into it, too (where ever it will be located and named, then).
Best regards
Dirk
Menon
PATCH 3/4 ZOOM2 Add power reset button
Quoted 16 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, June 10, 2009 10:44 AMQuoted 4 lines
Quoted 4 lines
Quoted 1 line
---
a/drivers/i2c/twl4030_i2c.cAll other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it wouldbe
Quoted 4 lines
Quoted 2 lines
better placed in
drivers/miscor a newdrivers/powerdirectory similar to Linux?This function probably belongs to
board/omap3/common/power.c-> or evenbetter to the board file itself?
I was about to mention the opposite ;)
Quoted 8 lines
Jean-Christophe asked to move the code from
power.cto driver directoryhttp://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).
This IMHO is the right approach -> but the real question is where in drivers/ directory? How about drivers/i2c/chips and moving the current drivers/i2c/* to drivers/i2c/busses - following the kernel organization?
Regards,
Nishanth Menon
PATCH 3/4 ZOOM2 Add power reset button
Quoted 18 lines · Nishanth
Quoted 18 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, June 10, 2009 10:44 AMQuoted 4 lines
Quoted 4 lines
Quoted 1 line
---
a/drivers/i2c/twl4030_i2c.cAll other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it wouldbe
Quoted 4 lines
Quoted 2 lines
better placed in
drivers/miscor a newdrivers/powerdirectory similar to Linux?This function probably belongs to
board/omap3/common/power.c-> or evenbetter to the board file itself?
I was about to mention the opposite ;)
Jean-Christophe asked to move the code from
power.cto driver directory
Quoted 7 lines
Quoted 6 lines
http://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).This IMHO is the right approach -> but the real question is where in
drivers/directory? How aboutdrivers/i2c/chipsand moving the currentdrivers/i2c/*todrivers/i2c/busses- following the kernel organization?
I'd vote against creating a drivers/i2c/chips directory. I believe this directory is deprecated in the Linux kernel and they'd prefer drivers be put in the proper driver/<subsystem> directory. I'd vote to follow this convention in U-Boot too.
I'm not familiar with the device or what features you plan on supporting so I can't speak to whether it'd fit better in drivers/power, drivers/misc, somewhere omap3/board specific, etc.
Best.
Peter
PATCH 3/4 ZOOM2 Add power reset button
Hello Peter,
Quoted 20 lines · Peter Tyser
Quoted 19 lines · Nishanth
Quoted 19 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, June 10, 2009 10:44 AMQuoted 4 lines
Quoted 4 lines
Quoted 1 line
---
a/drivers/i2c/twl4030_i2c.cAll other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it wouldbe
Quoted 3 lines
Quoted 2 lines
better placed in
drivers/miscor a newdrivers/powerdirectory similar to Linux?This function probably belongs to
board/omap3/common/power.c-> or evenbetter to the board file itself?
I was about to mention the opposite ;)
Jean-Christophe asked to move the code from
power.cto driver directory
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).This IMHO is the right approach -> but the real question is where in
drivers/directory? How aboutdrivers/i2c/chipsand moving the currentdrivers/i2c/*todrivers/i2c/busses- following the kernel organization?I'd vote against creating a
drivers/i2c/chipsdirectory. I believe this
Full Ack.
Quoted 3 lines
directory is deprecated in the Linux kernel and they'd prefer drivers be put in the proper driver/<subsystem> directory. I'd vote to follow this convention in U-Boot too.
Yep. I vote for this too.
Quoted 3 lines
I'm not familiar with the device or what features you plan on supporting so I can't speak to whether it'd fit better in
drivers/power,drivers/misc, somewhere omap3/board specific, etc.
I think "drivers/power" would be a good place for it.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Menon
PATCH 3/4 ZOOM2 Add power reset button
In reply to Peter TyserQuoted 33 lines
-----Original Message-----
From: Peter Tyser [mailto:ptyser at xes-inc.com]
Sent: Wednesday, June 10, 2009 11:26 AMQuoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
---
a/drivers/i2c/twl4030_i2c.cAll other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init().The
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
twl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps itwould
Quoted 2 lines
Quoted 2 lines
be
Quoted 1 line
Quoted 1 line
better placed in
drivers/miscor a newdrivers/powerdirectorysimilar
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
to Linux?
This function probably belongs to
board/omap3/common/power.c-> oreven
Quoted 5 lines
Quoted 5 lines
better to the board file itself?
I was about to mention the opposite ;)
Jean-Christophe asked to move the code from
power.cto driverdirectory
Quoted 8 lines
Quoted 7 lines
http://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).This IMHO is the right approach -> but the real question is where in
drivers/directory? How aboutdrivers/i2c/chipsand moving the currentdrivers/i2c/*todrivers/i2c/busses- following the kernel organization?
Quoted 9 lines
I'd vote against creating a
drivers/i2c/chipsdirectory. I believe this directory is deprecated in the Linux kernel and they'd prefer drivers be put in the proper driver/<subsystem> directory. I'd vote to follow this convention in U-Boot too.I'm not familiar with the device or what features you plan on supporting so I can't speak to whether it'd fit better in
drivers/power,drivers/misc, somewhere omap3/board specific, etc.
How about this:
Regarding Dirk's and Heiko's comment:
A) How about board/omap3/common/power.c to drivers/power/twl4030.c On patch [PATCH 2/4] I2C Add initial support for TWL4030:
B) introduce a new header in include/twl4030.h from Tom's patch Remove drivers/i2c/twl4030_i2c.c from the patch instead add:
#define TWLL4030_READ_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1) #define TWLL4030_WRITE_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1)
to include/twl4030.h in the patch.
C) on [PATCH 3/4] ZOOM2 Add power reset button
The change should go to corresponding board file -> for zoom1 or zoom2.
Regards,
Nishanth Menon
PATCH 3/4 ZOOM2 Add power reset button
Hello Menon,
Quoted 36 lines · Nishanth
Quoted 36 lines
-----Original Message-----
From: Peter Tyser [mailto:ptyser at xes-inc.com]
Sent: Wednesday, June 10, 2009 11:26 AMQuoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
---
a/drivers/i2c/twl4030_i2c.cAll other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init().The
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
twl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps itwould
Quoted 2 lines
Quoted 2 lines
be
Quoted 1 line
Quoted 1 line
better placed in
drivers/miscor a newdrivers/powerdirectorysimilar
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
to Linux?
This function probably belongs to
board/omap3/common/power.c-> oreven
Quoted 5 lines
Quoted 5 lines
better to the board file itself?
I was about to mention the opposite ;)
Jean-Christophe asked to move the code from
power.cto driverdirectory
Quoted 7 lines
Quoted 6 lines
http://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).This IMHO is the right approach -> but the real question is where in
drivers/directory? How aboutdrivers/i2c/chipsand moving the currentdrivers/i2c/*todrivers/i2c/busses- following the kernel organization?I'd vote against creating a
drivers/i2c/chipsdirectory. I believe this directory is deprecated in the Linux kernel and they'd prefer drivers be put in the proper driver/<subsystem> directory. I'd vote to follow this convention in U-Boot too.
Quoted 8 lines
Quoted 4 lines
I'm not familiar with the device or what features you plan on supporting so I can't speak to whether it'd fit better in
drivers/power,drivers/misc, somewhere omap3/board specific, etc.How about this:
Regarding Dirk's and Heiko's comment:
A) How aboutboard/omap3/common/power.ctodrivers/power/twl4030.c
I don;t know, if this "board/omap3/common/power.c" is identical with twl4030 ... ?
Quoted 8 lines
On patch C:
B) introduce a new header ininclude/twl4030.hfrom Tom's patch Removedrivers/i2c/twl4030_i2c.cfrom the patch instead add:#define TWLL4030_READ_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1) #define TWLL4030_WRITE_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1)to
include/twl4030.hin the patch.
Maybe an option ... thats why I think it is no i2c driver ...
Quoted 2 lines
C) on [PATCH 3/4] ZOOM2 Add power reset button
The change should go to corresponding board file -> for zoom1 or zoom2.
or in "drivers/power/twl4030.c", if it is for all zoom* boards identical.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Menon
PATCH 3/4 ZOOM2 Add power reset button
Quoted 9 lines
-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Wednesday, June 10, 2009 1:22 PMQuoted 3 lines
Regarding Dirk's and Heiko's comment:
A) How aboutboard/omap3/common/power.ctodrivers/power/twl4030.cI don;t know, if this "
board/omap3/common/power.c" is identical with twl4030 ... ?
The objective of power.c was to have only to have power related code for all omap3 platforms -> but currently there is only power_init_r function which is twl4030 compatible chips -> hence makes sense to break it out.
Quoted 10 lines
Quoted 9 lines
On patch C:
B) introduce a new header ininclude/twl4030.hfrom Tom's patch Removedrivers/i2c/twl4030_i2c.cfrom the patch instead add:#define TWLL4030_READ_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1) #define TWLL4030_WRITE_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1)to
include/twl4030.hin the patch.
Quoted 7 lines
Maybe an option ... thats why I think it is no i2c driver ...
Quoted 2 lines
C) on [PATCH 3/4] ZOOM2 Add power reset button
The change should go to corresponding board file -> for zoom1 or zoom2.or in "
drivers/power/twl4030.c", if it is for all zoom* boards identical.
Yes - it can belong there I agree.
Regards,
Nishanth Menon
PATCH 3/4 ZOOM2 Add power reset button
In reply to MenonQuoted 4 lines
How about this:
Regarding Dirk's and Heiko's comment:
A) How aboutboard/omap3/common/power.ctodrivers/power/twl4030.c
Ack
but I've a patch for Dirk in my queued that I need to process about it so we have 2 choice
1) apply Dirk's patch first and the move the code to drivers/power
2) rewrite a patch against the next
I've in mind to do the 1) to mention in the changelog Dirk's work
Quoted 8 lines
On patch [PATCH 2/4] I2C Add initial support for TWL4030:
B) introduce a new header ininclude/twl4030.hfrom Tom's patch Removedrivers/i2c/twl4030_i2c.cfrom the patch instead add:#define TWLL4030_READ_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1) #define TWLL4030_WRITE_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1)to
include/twl4030.hin the patch.
please use inline function for this
Best Regards,
J.
PATCH 3/4 ZOOM2 Add power reset button
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines
How about this:
Regarding Dirk's and Heiko's comment:
A) How aboutboard/omap3/common/power.ctodrivers/power/twl4030.cAck
but I've a patch for Dirk in my queued that I need to process about it so we have 2 choice
1) apply Dirk's patch first and the move the code todrivers/power
2) rewrite a patch against the next
Please forward me the patch,
I will merge it into the drivers/power/twl4030.c I am creating.
Quoted 11 lines
I've in mind to do the 1) to mention in the changelog Dirk's work
Quoted 9 lines
On patch [PATCH 2/4] I2C Add initial support for TWL4030:
B) introduce a new header ininclude/twl4030.hfrom Tom's patch Removedrivers/i2c/twl4030_i2c.cfrom the patch instead add:#define TWLL4030_READ_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1) #define TWLL4030_WRITE_U8(MODULE, VAL,REG)\ i2c_read((MODULE), (REG), 1, (VAL), 1)to
include/twl4030.hin the patch.
Quoted 3 lines
please use inline function for this
Yes.
I am doing adding this to twl4030.h
static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) {}
Quoted 3 lines
Best Regards,
J.
PATCH 3/4 ZOOM2 Add power reset button
Quoted 13 lines · Tom
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines
How about this:
Regarding Dirk's and Heiko's comment:
A) How aboutboard/omap3/common/power.ctodrivers/power/twl4030.cAck
but I've a patch for Dirk in my queued that I need to process about it so we have 2 choice
1) apply Dirk's patch first and the move the code todrivers/power
2) rewrite a patch against the next
Quoted 2 lines
Please forward me the patch,
I will merge it into thedrivers/power/twl4030.cI am creating.
http://www.mail-archive.com/u-boot at lists.denx.de/msg14133.html
Best Regards,
J.
PATCH 3/4 ZOOM2 Add power reset button
In reply to MenonHello Menon,
Quoted 17 lines · Nishanth
Quoted 17 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, June 10, 2009 10:44 AMQuoted 4 lines
Quoted 4 lines
Quoted 1 line
---
a/drivers/i2c/twl4030_i2c.cAll other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it wouldbe
Quoted 3 lines
Quoted 2 lines
better placed in
drivers/miscor a newdrivers/powerdirectory similar to Linux?This function probably belongs to
board/omap3/common/power.c-> or evenbetter to the board file itself?
I was about to mention the opposite ;)
Jean-Christophe asked to move the code from
power.cto driver directory
Quoted 7 lines
Quoted 6 lines
http://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).This IMHO is the right approach -> but the real question is where in
drivers/directory? How aboutdrivers/i2c/chipsand moving the currentdrivers/i2c/*todrivers/i2c/busses- following the kernel organization?
No, I vote for moving this driver in a "drivers/power" directory.
BTW: Can you please use a linelength <80 characters? Thanks.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 3/4 ZOOM2 Add power reset button
In reply to Dirk BehmeHello Dirk,
Quoted 45 lines · Dirk Behme
Quoted 40 lines · Nishanth
Quoted 29 lines
-----Original Message-----
From: Peter Tyser [mailto:ptyser at xes-inc.com]
Sent: Wednesday, June 10, 2009 9:27 AMdrivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8
Quoted 5 lines
drivers/i2c/twl4030_i2c.c +0
-0@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8*val, u8 reg)
Quoted 9 lines
drivers/i2c/twl4030_i2c.c +6
-0return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{ +#ifdef CONFIG_OMAP3_ZOOM2 drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
Quoted 10 lines
drivers/i2c/twl4030_i2c.c +10
-0+u8 val =0 ; +if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to read the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + }else { + val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON ; +if (twl4030_i2c_write_u8 (TWL4030_CHIP_PM_MASTER , val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { + printf("Error:TWL4030: failed to write the powerregister\n");
Quoted 11 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 59
Quoted 6 lines
drivers/i2c/twl4030_i2c.c +6
-0+ printf("Could not initialize hardware reset\n"); + } + } +#endif +} +All other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it would be better placed indrivers/miscor a newdrivers/powerdirectory similar to Linux?Quoted 1 line
This function probably belongs to
board/omap3/common/power.c-> or even better to the board file itself?I was about to mention the opposite ;)
Quoted 7 lines
Jean-Christophe asked to move the code from
power.cto driver directoryhttp://lists.denx.de/pipermail/u-boot/2009-May/052400.html
If you follow above discussion, I was fine with
power.c. If we get now atwl4030_i2c.c, we should merge the code frompower.cinto it, too (where ever it will be located and named, then).
Hmm.. why not in a "drivers/power" directory? This twl4030_i2c.c is no i2c driver in my opinion. And I won;t to avoid creating subdirs in drivers/i2c.
I think an drivers/power directory would be a good solution.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 3/4 ZOOM2 Add power reset button
In reply to Peter TyserHello Peter,
Quoted 28 lines · Peter Tyser
Quoted 28 lines
drivers/i2c/twl4030_i2c.c +20
-0@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{ +#ifdef CONFIG_OMAP3_ZOOM2 +u8 val =0 ; +if (twl4030_i2c_read_u8 (TWL4030_CHIP_PM_MASTER , &val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to read the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + }else { + val |=TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON ; +if (twl4030_i2c_write_u8 (TWL4030_CHIP_PM_MASTER , val, +TWL4030_PM_MASTER_P1_SW_EVENTS )) { +printf ("Error:TWL4030: failed to write the power register\n" ); +printf ("Could not initialize hardware reset\n" ); + } + } +#endif
Quoted 8 lines
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 59
Quoted 2 lines
drivers/i2c/twl4030_i2c.c +2
-0+} +All other drivers in
drivers/i2care host adapter drivers. Ie they implementi2c_read(),i2c_write(),i2c_probe(), andi2c_init(). Thetwl4030_i2c.cdriver doesn't seem to fit this mold. Perhaps it would be better placed indrivers/miscor a newdrivers/powerdirectory similar to Linux?
Ack. Ah, I see, maybe drivers/power would be a better place for it.
Quoted 2 lines
FWIW I had the same dilemma with the ds4510 i2c device which has support for GPIO, EEEPROM, etc and ended up putting it in
drivers/misc.
Yes, I want to see in drivers/i2c only drivers, which implement the i2c_* functions ... This twl4030 and the ds4510 drivers, use an i2c driver from hopefully in "drivers/i2c", and should go in an "drivers/"subsystem"" directory ...
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 3/4 ZOOM2 Add power reset button
In reply to Tom RixHello Tom,
Quoted 19 lines · Tom Rix
The power reset button is on the top right side of the main board. Press and hold for about to 8 seconds to completely reset the board.
Some of the beta boards have a hardware problem that prevents using this feature. If is difficult to further characterize the boards that fail. So disable resetting for all beta boards.
Signed-off-by Tom Rix <[email protected]>--- board/omap3/zoom2/zoom2.c | 13 +++++++++++++ drivers/i2c/twl4030_i2c.c | 22 ++++++++++++++++++++++ include/configs/omap3_zoom2.h | 1 + include/twl4030.h | 10 ++++++++++ 4 files changed, 46 insertions(+), 0 deletions(-)board/omap3/zoom2/zoom2.c +0
-0
[...]
drivers/i2c/twl4030_i2c.c static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) · line 42
Quoted 13 lines
drivers/i2c/twl4030_i2c.c +5
-0@@ -35,3 +35,25 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)return i2c_read (chip_no, reg,1 , val,1 ); } +/* +* Power Reset +*/ +void twl4030_power_reset_init (void ) +{
What has this to do with an i2c driver? No, I don;t want to see such a function in an i2c driver. I tend to put this "driver" in an another dir, like I said in my previous mail maybe in drivers/misc ...
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Menon
PATCH 2/4 I2C Add initial support for TWL4030
In reply to Tom RixQuoted 8 lines
-----Original Message-----
From: Tom Rix [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 7:54 AM
To: u-boot at lists.denx.de
Cc: dirk.behme at googlemail.com; Menon, Nishanth; Tom Rix
Subject: [PATCH 2/4] I2C Add initial support for TWL4030
Quoted 4 lines
--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221
This is an interesting area -> in kernel we used to have i2c/busses and i2c/chips -> u-boot has drivers/i2c which probably is equivalent to i2c/busses -> should we create subdirectories there? In the current form, this driver does not fit into drivers/i2c if I am not wrong..
Regards,
Nishanth Menon
PATCH 2/4 I2C Add initial support for TWL4030
Hello Menon,
Quoted 7 lines · Nishanth
Quoted 7 lines
-----Original Message-----
From: Tom Rix [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 7:54 AM
To: u-boot at lists.denx.de
Cc: dirk.behme at googlemail.com; Menon, Nishanth; Tom Rix
Subject: [PATCH 2/4] I2C Add initial support for TWL4030
Quoted 5 lines
Quoted 4 lines
--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221This is an interesting area -> in kernel we used to have i2c/busses and i2c/chips -> u-boot has
drivers/i2cwhich probably is equivalent to i2c/busses -> should we create subdirectories there? In the current form, this driver does not fit intodrivers/i2cif I am not wrong..
No, I think it is not necessary here to create subdirs in "drivers/i2c". This driver should go in "drivers/power" ...
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 2/4 I2C Add initial support for TWL4030
In reply to Tom RixHello Tom,
Quoted 65 lines · Tom Rix
The TWL4030 supplies many peripheral for OMAP3 boards. These include power management, usb and, keyboard.
The product description is found here:
http://focus.ti.com/docs/prod/folders/print/tps65950.html
Product reference document, tps65950.pdf, is found here:
http://www.ti.com/lit/gpn/tps65950
Signed-off-by Tom Rix <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/twl4030_i2c.c create mode 100644 include/twl4030.hdrivers/i2c/Makefile +1
-0@@ -36,6 +36,7 @@ COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o +COBJS-$(CONFIG_DRIVER_TWL4030_I2C) += twl4030_i2c.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)drivers/i2c/twl4030_i2c.c new file +27
-0@@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Wind River Systems, Inc. +* Tom Rix <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +* Derived from code on omapzoom, git://git.omapzoom.com/repo/u-boot.git +* +* Copyright (C) 2007-2009 Texas Instruments, Inc. +*/ + +#include <twl4030.h> + +/* Functions to read and write from TWL4030 */
drivers/i2c/twl4030_i2c.c line 37
Quoted 10 lines
drivers/i2c/twl4030_i2c.c new file +10
-0+static inline int twl4030_i2c_write_u8 (u8 chip_no,u8 val,u8 reg) +{ +return i2c_write (chip_no, reg,1 , &val,1 ); +} + +static inline int twl4030_i2c_read_u8 (u8 chip_no,u8 *val,u8 reg) +{ +return i2c_read (chip_no, reg,1 , val,1 ); +} +
? Is your patch complete?
Where are i2c_read(), i2c_write(),... functions, like in the other i2c drivers in u-boot? This seems no i2c driver to me, more than some board specific code, which you can add in your board.c ... or something like drivers/misc, if this is code is used in more than one plattform ... ?
include/twl4030.h line 1
Quoted 7 lines
include/twl4030.h new file +1
-0@@ -0,0 +1,221 @@ +/*
[...]
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 2/4 I2C Add initial support for TWL4030
In reply to Tom RixDear Heiko,
Quoted 11 lines · In message <[email protected]> Tom Rix…
The TWL4030 supplies many peripheral for OMAP3 boards. These include power management, usb and, keyboard.
The product description is found here:
http://focus.ti.com/docs/prod/folders/print/tps65950.html
Product reference document, tps65950.pdf, is found here:
Quoted 8 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/twl4030_i2c.c create mode 100644 include/twl4030.h
I think this is supposed to go through the i2c repo, but I haven't seen any comments yet.
Can you please check the state of this patch? Thanks in advance.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Philosophy is a game with objectives and no rules. Mathematics is a game with rules and no objectives.
PATCH 2/4 I2C Add initial support for TWL4030
Hello Wolfgang,
Quoted 21 lines · Wolfgang Denk
Quoted 11 lines · In message <[email protected]> Tom Rix…
The TWL4030 supplies many peripheral for OMAP3 boards. These include power management, usb and, keyboard.
The product description is found here:
http://focus.ti.com/docs/prod/folders/print/tps65950.html
Product reference document, tps65950.pdf, is found here:
Quoted 8 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/twl4030_i2c.c create mode 100644 include/twl4030.h
Quoted 2 lines
I think this is supposed to go through the i2c repo, but I haven't seen any comments yet.
Hmm.. there are responses, see for example:
http://lists.denx.de/pipermail/u-boot/2009-June/054086.html
Quoted 1 line
Can you please check the state of this patch? Thanks in advance.
Hmm.. it is a little long to follow this ... it ended first here:
http://lists.denx.de/pipermail/u-boot/2009-June/054654.html
waiting for an Ack that it works on omap2 ...
(I Acked the resulting 3 patches, see:
http://lists.denx.de/pipermail/u-boot/2009-June/054585.html
)
Ah, found one more answer from Tom:
http://lists.denx.de/pipermail/u-boot/2009-June/054801.html
ended in:
http://lists.denx.de/pipermail/u-boot/2009-June/055071.html
with a new patchset of 6 patches, starting with:
http://lists.denx.de/pipermail/u-boot/2009-June/055072.html
but state of omap2 is still pending ... see:
http://lists.denx.de/pipermail/u-boot/2009-June/055087.html
then Tom wrote, he has setup a git repo, see:
http://lists.denx.de/pipermail/u-boot/2009-July/055328.html
but I think, the state of the omap2 is pending ... so I (and I think Jean-Christophe also) wait for, that this pending state is going away ...
Tom, do you have an update?
(added Jean-Christophe to cc:)
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 2/4 I2C Add initial support for TWL4030
Omap2 is still pending.
I was hoping to help Richard out with this last week but he was on travel.
There is not much more I think I can do wrt omap2.
All my targets are omap3.
The nearest I can find online is the nokia n8xx which uses a another bootloader.
The options as I see them are.
1. Get a pass on omap2 testing
2. Rewrite i2c init to have a omap3 specific init
3. Hack n8xx and try to convience you the results are reasonable
4. Wait for omap2 testing.
I vote for #1.
Tom
Quoted 78 lines · Heiko Schocher
Hello Wolfgang,
Quoted 22 lines · Wolfgang Denk
Quoted 11 lines · In message <[email protected]> Tom Rix…
The TWL4030 supplies many peripheral for OMAP3 boards. These include power management, usb and, keyboard.
The product description is found here:
http://focus.ti.com/docs/prod/folders/print/tps65950.html
Product reference document, tps65950.pdf, is found here:
Quoted 9 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/twl4030_i2c.c create mode 100644 include/twl4030.hQuoted 3 lines
I think this is supposed to go through the i2c repo, but I haven't seen any comments yet.
Hmm.. there are responses, see for example:
http://lists.denx.de/pipermail/u-boot/2009-June/054086.html
Quoted 2 lines
Can you please check the state of this patch? Thanks in advance.
Hmm.. it is a little long to follow this ... it ended first here:
http://lists.denx.de/pipermail/u-boot/2009-June/054654.html
waiting for an Ack that it works on omap2 ...
(I Acked the resulting 3 patches, see:
http://lists.denx.de/pipermail/u-boot/2009-June/054585.html
)Ah, found one more answer from Tom:
http://lists.denx.de/pipermail/u-boot/2009-June/054801.html
ended in:
http://lists.denx.de/pipermail/u-boot/2009-June/055071.html
with a new patchset of 6 patches, starting with:
http://lists.denx.de/pipermail/u-boot/2009-June/055072.htmlbut state of omap2 is still pending ... see:
http://lists.denx.de/pipermail/u-boot/2009-June/055087.html
then Tom wrote, he has setup a git repo, see:
http://lists.denx.de/pipermail/u-boot/2009-July/055328.htmlbut I think, the state of the omap2 is pending ... so I (and I think Jean-Christophe also) wait for, that this pending state is going away ...
Tom, do you have an update?
(added Jean-Christophe to cc:)
bye
Heiko
PATCH 2/4 I2C Add initial support for TWL4030
Hello Tom,
Quoted 8 lines · Tom
Omap2 is still pending.
I was hoping to help Richard out with this last week but he was on travel.There is not much more I think I can do wrt omap2.
All my targets are omap3.
The nearest I can find online is the nokia n8xx which uses a another bootloader.
Quoted 8 lines
The options as I see them are.
1. Get a pass on omap2 testing
2. Rewrite i2c init to have a omap3 specific init
3. Hack n8xx and try to convience you the results are reasonable
4. Wait for omap2 testing.I vote for #1.
Hmm.. because I think this patches go through Jean-Christophe he has to decide if this is acceptable.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 2/4 I2C Add initial support for TWL4030
Quoted 18 lines · Heiko Schocher
Hello Tom,
Quoted 15 lines · Tom
Omap2 is still pending.
I was hoping to help Richard out with this last week but he was on travel.There is not much more I think I can do wrt omap2.
All my targets are omap3.
The nearest I can find online is the nokia n8xx which uses a another bootloader.The options as I see them are.
1. Get a pass on omap2 testing
2. Rewrite i2c init to have a omap3 specific init
3. Hack n8xx and try to convience you the results are reasonable
4. Wait for omap2 testing.
Quoted 4 lines
Quoted 1 line
I vote for #1.
Hmm.. because I think this patches go through Jean-Christophe he has to decide if this is acceptable.
we will not get a pass on the omap2
but we will do this in a second step as agree with Nishanth
Best Regards,
J.
PATCH 2/4 I2C Add initial support for TWL4030
In reply to TomQuoted 8 lines · Tom
Omap2 is still pending.
I was hoping to help Richard out with this last week but he was on travel.There is not much more I think I can do wrt omap2.
All my targets are omap3.
The nearest I can find online is the nokia n8xx which uses a another bootloader.
Quoted 8 lines
The options as I see them are.
1. Get a pass on omap2 testing
2. Rewrite i2c init to have a omap3 specific init
3. Hack n8xx and try to convience you the results are reasonable
4. Wait for omap2 testing.I vote for #1.
Me too.
Dirk
Quoted 83 lines
Quoted 70 lines · Heiko Schocher
Hello Wolfgang,
Quoted 22 lines · Wolfgang Denk
Quoted 11 lines · In message <[email protected]> Tom Rix…
The TWL4030 supplies many peripheral for OMAP3 boards. These include power management, usb and, keyboard.
The product description is found here:
http://focus.ti.com/docs/prod/folders/print/tps65950.html
Product reference document, tps65950.pdf, is found here:
Quoted 9 lines
Signed-off-by Tom Rix <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/twl4030_i2c.c | 37 ++++++++ include/twl4030.h | 221 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/twl4030_i2c.c create mode 100644 include/twl4030.hQuoted 3 lines
I think this is supposed to go through the i2c repo, but I haven't seen any comments yet.
Hmm.. there are responses, see for example:
http://lists.denx.de/pipermail/u-boot/2009-June/054086.html
Quoted 2 lines
Can you please check the state of this patch? Thanks in advance.
Hmm.. it is a little long to follow this ... it ended first here:
http://lists.denx.de/pipermail/u-boot/2009-June/054654.html
waiting for an Ack that it works on omap2 ...
(I Acked the resulting 3 patches, see:
http://lists.denx.de/pipermail/u-boot/2009-June/054585.html
)Ah, found one more answer from Tom:
http://lists.denx.de/pipermail/u-boot/2009-June/054801.html
ended in:
http://lists.denx.de/pipermail/u-boot/2009-June/055071.html
with a new patchset of 6 patches, starting with:
http://lists.denx.de/pipermail/u-boot/2009-June/055072.htmlbut state of omap2 is still pending ... see:
http://lists.denx.de/pipermail/u-boot/2009-June/055087.html
then Tom wrote, he has setup a git repo, see:
http://lists.denx.de/pipermail/u-boot/2009-July/055328.htmlbut I think, the state of the omap2 is pending ... so I (and I think Jean-Christophe also) wait for, that this pending state is going away ...
Quoted 6 lines
Tom, do you have an update?
(added Jean-Christophe to cc:)
bye
Heiko_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Menon
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
In reply to Tom RixQuoted 54 lines
-----Original Message-----
From: Tom Rix [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 7:54 AMvoid
i2c_init(int speed, int slaveadd)
{drivers/i2c/omap24xx_i2c.c +43
-1-u16 scl; +int psc, iclk, scll, sclh; + +/* Only handle standard and fast speeds */ +if ((speed !=OMAP_I2C_STANDARD ) && + (speed !=OMAP_I2C_FAST_MODE )) { +printf ("Error : I2C unsupported speed %d\n" , speed); +return ; + } + +/* +* Calculate the prescalar to go from from the function clock +* to the internal sampling clock, 12MHz. +*/ + psc =I2C_PSC_MAX ; +while (psc >=I2C_PSC_MIN ) { + iclk =I2C_IP_CLK / (psc +1 ); +if (12000000 <= iclk) +break ; + psc--; + } +if (psc <I2C_PSC_MIN ) { +printf ("Error : I2C unsupported prescalar %d\n" , psc); +return ; + } + +/* +* How the low and high time periods are calculated +* See the OMAP3xxx Reference Manual for more details +* +* tlow + thigh = 1 / speed +* thigh = tlow, nice square wave.. +* +* tlow = 1 / (2 * speed) = (scll + 7) / iclk; +* scll + 7 = iclk / 2 * speed +* sclh + 5 = iclk / 2 * speed +*/ + scll = sclh = iclk / (2 * speed); + scll -=7 ; + sclh -=5 ; +if ((scll <0 ) || (sclh <0 )) { +printf ("Error : I2C initializing clock\n" ); +return ; + }writew (0x2 ,I2C_SYSC );/* for ES2 after soft reset */ udelay (1000 );
drivers/i2c/omap24xx_i2c.c void i2c_init (int speed, int slaveadd) · line 84
Quoted 1 line
drivers/i2c/omap24xx_i2c.c +0
-0@@ -42,12 +84,10 @@ void i2c_init (int speed, int slaveadd)udelay (50000 );
This is a repeat story of what happened in linux-omap and kernel. We had a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis.
Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
Quoted 11 lines · Nishanth
Quoted 1 line
This is a repeat story of what happened in linux-omap and kernel. We had a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis.
Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2
Do you think this could be handled with just config files? Or maybe like fsl_i2c does by passing clk data through the global_data ? Tom
Menon
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
Quoted 14 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 9:44 PMQuoted 1 line
This is a repeat story of what happened in linux-omap and kernel. We had
a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
Quoted 8 lines
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis. Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2
Quoted 2 lines
Do you think this could be handled with just config files? Or maybe like
fsl_i2cdoes by passing clk data through theglobal_data?
#defines in config header file might be a viable option.. Though the gd might be cleaner I think..
Regards,
Nishanth Menon
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
Quoted 18 lines · Nishanth
Quoted 18 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 9:44 PMQuoted 2 lines
This is a repeat story of what happened in linux-omap and kernel. We had
a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
Quoted 9 lines
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis. Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2
Quoted 8 lines
Quoted 3 lines
Do you think this could be handled with just config files? Or maybe like
fsl_i2cdoes by passing clk data through theglobal_data?#defines in config header file might be a viable option.. Though the gd might be cleaner I think..
Regards,
Nishanth Menon
How about something like this?
The timing calculation is moved to a separate function that is weakly aliased to a function that the boards can define? This is similar to
led initializing in lib_arm. I have put a stub omap_i2c_timing inzoom1.c to show how the board would do the define.
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-OMAP3-I2C-Fix-the-sampling-clock.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090611/31609f4f/attachment.bin
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
Quoted 25 lines · Tom
Quoted 24 lines · Nishanth
Quoted 18 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 9:44 PMQuoted 2 lines
This is a repeat story of what happened in linux-omap and kernel. We had
a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
Quoted 9 lines
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis. Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2Quoted 3 lines
Do you think this could be handled with just config files? Or maybe like
fsl_i2cdoes by passing clk data through theglobal_data?#defines in config header file might be a viable option.. Though the gd might be cleaner I think..
Quoted 8 lines
Quoted 3 lines
Regards,
Nishanth MenonHow about something like this?
The timing calculation is moved to a separate function that is weakly aliased to a function that the boards can define? This is similar to
led initializing inlib_arm. I have put a stubomap_i2c_timinginzoom1.cto show how the board would do the define.
use weak function will increase the size of u-boot I'll prefer to avoid it when it's possible
if no board mainline need it I'll prefer to avoid it also
Best Regards,
J.
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
Quoted 43 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 35 lines · Tom
Quoted 26 lines · Nishanth
Quoted 22 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 9:44 PMQuoted 3 lines
This is a repeat story of what happened in linux-omap and kernel. We had
a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
Quoted 10 lines
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis. Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2Quoted 4 lines
Do you think this could be handled with just config files? Or maybe like
fsl_i2cdoes by passing clk data through theglobal_data?Quoted 7 lines
#defines in config header file might be a viable option.. Though the gd might be cleaner I think..
Regards,
Nishanth MenonQuoted 6 lines
How about something like this?
The timing calculation is moved to a separate function that is weakly aliased to a function that the boards can define? This is similar to
led initializing inlib_arm. I have put a stubomap_i2c_timinginzoom1.cto show how the board would do the define.
Quoted 5 lines
use weak function will increase the size of u-boot I'll prefer to avoid it when it's possible
if no board mainline need it I'll prefer to avoid it also
I do not know of an example of a board that needs to be handled specially. The current code breaks the Zooms. The original fix works on the Zooms and beagle and overo.
Can the original fix go in and be changed when we know which board needs special handling ?
Tom
Quoted 3 lines
Best Regards,
J.
[U-Boot] RFC Re: [PATCH 1/4] OMAP3 I2C Fix the sampling clock.
In reply to Jean-Christophe PLAGNIOL-VILLARDHow about something like this ?
It is all done in #define's and follows what the kernel does.
The clocks areI2C_IP_CLKI2C_INTERNAL_SAMPLING_CLK
The scll and sclh can be modifed byI2C_SCLL_TRIMI2C_SCLH_TRIM
Tom
Quoted 43 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 35 lines · Tom
Quoted 26 lines · Nishanth
Quoted 22 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 9:44 PMQuoted 3 lines
This is a repeat story of what happened in linux-omap and kernel. We had
a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
Quoted 10 lines
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis. Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2Quoted 4 lines
Do you think this could be handled with just config files? Or maybe like
fsl_i2cdoes by passing clk data through theglobal_data?Quoted 7 lines
#defines in config header file might be a viable option.. Though the gd might be cleaner I think..
Regards,
Nishanth MenonQuoted 6 lines
How about something like this?
The timing calculation is moved to a separate function that is weakly aliased to a function that the boards can define? This is similar to
led initializing inlib_arm. I have put a stubomap_i2c_timinginzoom1.cto show how the board would do the define.
Quoted 7 lines
use weak function will increase the size of u-boot I'll prefer to avoid it when it's possible
if no board mainline need it I'll prefer to avoid it alsoBest Regards,
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-OMAP3-I2C-Fix-the-sampling-clock.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090617/7bab78c9/attachment.bin
PATCH 1/4 OMAP3 I2C Fix the sampling clock.
In reply to MenonQuoted 14 lines · Nishanth
Quoted 14 lines
-----Original Message-----
From: Tom [mailto:Tom.Rix at windriver.com]
Sent: Wednesday, June 10, 2009 9:44 PMQuoted 1 line
This is a repeat story of what happened in linux-omap and kernel. We had
a similar discussion in [1] and related patch [2] to change equations. I have the same reservations with this patch:
Quoted 8 lines
a) using speed as default does not scale for all board combinations.
b) need flexible option to provide scll and sclh on a platform basis. Regards,
Nishanth Menon
Ref:
[1] http://marc.info/?t=123540865900002&r=1&w=2
[2] http://marc.info/?l=linux-omap&m=122770723311340&w=2
Quoted 3 lines
Quoted 2 lines
Do you think this could be handled with just config files? Or maybe like
fsl_i2cdoes by passing clk data through theglobal_data?#defines in config header file might be a viable option.. Though the gd might be cleaner I think..
please a config and then create a inline function like this
Best Regards,
J.