From: Paul Burton Date: Wed, 21 Sep 2016 14:30:38 +0100 Subject: [U-Boot] [PATCH] MIPS: Hang if run on a secondary CPU In-Reply-To: <0DAF21CFE1B20740AE23D6AF6E54843F1E5DCCA1@IRSMSX101.ger.corp.intel.com> References: <20160921100846.26432-1-paul.burton@imgtec.com> <0DAF21CFE1B20740AE23D6AF6E54843F1E5DCCA1@IRSMSX101.ger.corp.intel.com> Message-ID: <4653463.MA6e6ph9eO@np-p-burton> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday, 21 September 2016 12:59:39 BST Langer, Thomas wrote: > Hello Paul, > > > diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S > > index fc6dd66..dd37ac3 100644 > > --- a/arch/mips/cpu/start.S > > +++ b/arch/mips/cpu/start.S > > @@ -112,6 +112,31 @@ ENTRY(_start) > > > > .align 4 > > > > reset: > > +#if __mips_isa_rev >= 6 > > + .set push > > + .set reorder > > + mfc0 t0, CP0_CONFIG, 1 > > + bgez t0, 1f > > + mfc0 t0, CP0_CONFIG, 2 > > + bgez t0, 1f > > + mfc0 t0, CP0_CONFIG, 3 > > + bgez t0, 1f > > + mfc0 t0, CP0_CONFIG, 4 > > + bgez t0, 1f > > + mfc0 t0, CP0_CONFIG, 5 > > + and t0, t0, MIPS_CONF5_VP > > + beqz t0, 1f > > + > > + mfc0 t0, CP0_GLOBALNUMBER > > + b 2f > > + .set pop > > +#endif > > + > > +1: mfc0 t0, CP0_EBASE > > + and t0, t0, EBASE_CPUNUM > > + > > + /* Hang if this isn't the first CPU in the system */ > > +2: bnez t0, . > > This loop should include a "wait" instruction. > Otherwise the CPU will burn power for doing nothing. > > Thomas Hi Thomas, True, it would spin until (typically) it gets reset by Linux or whatever OS is booted. I'll add a wait. Thanks, Paul