From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Date: Fri, 12 Jun 2009 21:28:29 -0500 Subject: [U-Boot] [PATCH 4/4] ZOOM1 Add power reset button In-Reply-To: <7A436F7769CA33409C6B44B358BFFF0C0115D44BF6@dlee02.ent.ti.com> References: <1244638432-30893-1-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-2-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-3-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-4-git-send-email-Tom.Rix@windriver.com> <1244638432-30893-5-git-send-email-Tom.Rix@windriver.com> <20090612214630.GE1802@game.jcrosoft.org> <4A32CF32.9080701@windriver.com> <7A436F7769CA33409C6B44B358BFFF0C0115D44BF6@dlee02.ent.ti.com> Message-ID: <4A330ECD.9040901@windriver.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Menon, Nishanth wrote: >> -----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 button >> >> >>>> */ >>>> 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. >> >>>> + 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 > Regards, > Nishanth Menon >