From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew E. Mileski Date: Tue, 29 May 2012 15:13:43 -0400 Subject: [U-Boot] Detecting board revision that needs to be done after relocation In-Reply-To: References: Message-ID: <4FC51FE7.4040408@isoar.ca> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/28/2012 11:25 PM, Fabio Estevam wrote: > > I need to provide a get_board_rev() function that depends on I2C probe > of a PMIC to decide between the board revision. > > I2C is only available after relocation, so what is the correct way to > "delay" get_board_rev, so that it gets called only at a time when I2C > is ready? I2C is usually available earlier, as it is used to read the SPD on memory modules. When I last did it, I had to change U-Boot slightly to support a second I2C bus, as the bus selection variable was located in flash before relocation (very old version of U-Boot, so may not apply still). I've only had a problem using I2C very early in the boot sequence, like before the system clocks have been setup, then the solution to that was to just use a GPIO strapping instead for clock selection. -- Andrew E. Mileski