From: Wolfgang Denk Date: Sun, 04 Mar 2012 21:22:23 +0100 Subject: [U-Boot] [PATCH] integrator: remove fragile delay loop from PCI code In-Reply-To: <1330806073-32317-1-git-send-email-linus.walleij@linaro.org> References: <1330806073-32317-1-git-send-email-linus.walleij@linaro.org> Message-ID: <20120304202223.C6F72202D60@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear "Linus Walleij", In message <1330806073-32317-1-git-send-email-linus.walleij@linaro.org> you wrote: > The reference implementation of the PCI initialization code almost > everywhere contain this fragile loop of "a few usecs", and its > use of volatile variables to delay a number of bus cycles is indeed > uncertain. > > Reading the manual "Integrator/AP Users Guide", page 5-15 it is > clearly stated: > > "Wait until 230ms after the end of the reset period before > accessing V360EPC internal registers. The V360EPC supports the > use of a serial configuration PROM and the software must wait for > the device to detect the absence of this PROM before accessing any > registers. The required delay is a function of the PCI Clock, but > at the lower frequency (25MHz) is 230ms". > > So let's simply wait 230ms per the spec. > > This solves the compilation error that looked like this: > pci.c: In function ?pci_init_board?: > pci.c:286:18: warning: variable ?j? set but not used > > Reported-by: Wolfgang Denk > Signed-off-by: Linus Walleij > --- > board/armltd/integrator/pci.c | 7 ++----- > 1 files changed, 2 insertions(+), 5 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- 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 It may be bad manners to talk with your mouth full, but it isn't too good either if you speak when your head is empty.