From: Wolfgang Denk Date: Mon, 24 Aug 2009 13:11:21 +0200 Subject: [U-Boot] [PATCH v2 15/17] Move eNET low-level initialisation into asm In-Reply-To: <1251111477-15561-1-git-send-email-graeme.russ@gmail.com> References: <1250996401-13642-16-git-send-email-graeme.russ@gmail.com> <1251111477-15561-1-git-send-email-graeme.russ@gmail.com> Message-ID: <20090824111121.EF2D4833DBD2@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 Graeme Russ, In message <1251111477-15561-1-git-send-email-graeme.russ@gmail.com> you wrote: > Allows earlier indication of boot progress by initialising the LEDs and > Serial Port while the CPU is still in 16-bit (Real) mode I have to admit that I am not a friend of moving C code to assembler. This contradicts pretty basic principles of U-Boot design. I can understand that you want diagnosis as early as possible, but 162 insertions versus 26 deletions is a clear indocation that something is awfully wrong. Are you absolutely sure this is a good idea? > Version 2 > - Fixed comments corrupted by accidental middle-mouse button press while > scrolling through code with mouse wheel > - Fixed mangled umlaut > - Fixed space before tab highlighted by Wolfgang Denk You did not catch all of these, see below. > diff --git a/board/eNET/eNET_start16.S b/board/eNET/eNET_start16.S > index 48e4d83..31b33ec 100644 > --- a/board/eNET/eNET_start16.S > +++ b/board/eNET/eNET_start16.S ... > @@ -45,6 +44,65 @@ board_init16: > movw $0xdf00, %ax > movw %ax, %ds > > + /* Disable Watchdog */ > + movl $SC520_WDTMRCTL, %edi > + movw $0x3333, %ax > + movw %ax, (%di) > + movw $0xcccc, %ax > + movw %ax, (%di) > + movw $0x3333, %ax > + movw %ax, (%di) > + > + /* Set CPU to 100MHz Speed */ > + movb $0x01, %al > + movl $SC520_CPUCTL, %edi > + movb %al, (%di) > + > + /* wait at least one millisecond */ > + movl $0x1000,%ecx > +cpuspddelay: > + loop cpuspddelay SPACE + TAB ... ... > + /* wait for the UART clock to settle */ > + movl $0x10000,%ecx > +uartdelay: > + loop uartdelay SPACE + TAB ... 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 The so-called "desktop metaphor" of today's workstations is instead an "airplane-seat" metaphor. Anyone who has shuffled a lap full of papers while seated between two portly passengers will recognize the difference -- one can see only a very few things at once. - Fred Brooks, Jr.