From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 22 Jan 2015 09:30:33 -0600 Subject: [U-Boot] [PATCH v3 1/2] Errata/ARM57: Add basic constructs to handle and apply A57 specific erratas In-Reply-To: <1421939562-28607-1-git-send-email-bhupesh.sharma@freescale.com> References: <1421939562-28607-1-git-send-email-bhupesh.sharma@freescale.com> Message-ID: <1421940633.4961.243.camel@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2015-01-22 at 20:42 +0530, Bhupesh Sharma wrote: > +WEAK(apply_core_errata) > + > + mov x29, lr /* Save LR */ > + /* For now, we support Cortex-A57 specific errata only */ > + > + /* Check if we are running on a Cortex-A57 core */ > + branch_if_a57_core x0, apply_a57_core_errata > + b 0f Instead of branching forward here, have the a57 code branch back at the end. > /* > + * Branch if current processor is a Cortex-A57 core. > + */ > +.macro branch_if_a57_core, xreg, a57_label > + mrs \xreg, midr_el1 > + lsr \xreg, \xreg, #4 > + and \xreg, \xreg, #0x00000FFF > + cmp \xreg, #0xD07 /* Cortex-A57 MPCore processor. */ > + b.eq \a57_label > +.endm > + > +/* > + * Branch if current processor is a Cortex-A53 core. > + */ > +.macro branch_if_a53_core, xreg, a53_label > + mrs \xreg, midr_el1 > + lsr \xreg, \xreg, #4 > + cmp \xreg, #0xD03 /* Cortex-A53 MPCore processor. */ > + b.eq \a53_label > +.endm Why do you AND with 0xfff for a57 but not a53? Where else do you expect to use these macros? -Scott