]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: zynq: Enable the Neon instructions
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Tue, 1 Oct 2013 07:29:50 +0000 (12:59 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 2 Oct 2013 09:26:54 +0000 (11:26 +0200)
Added the lowlevel_init to enable the Neon instructions.

Initially the u-boot was causing undefined instruction
exception if loaded through tcl, and working fine if loaded
through FSBL. The exception was causing in convertion formula
of given time to ticks. It was because, the Neon instructions
were disabled and hence causing the undefined exception. In
FSBL case, the FSBL was enabling the Neon instructions. Hence,
added the lowlevel_init to enable the Neon instructions.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Acked-by: Radhey Shyam Pandey <radheys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv7/zynq/Makefile
arch/arm/cpu/armv7/zynq/cpu.c
arch/arm/cpu/armv7/zynq/lowlevel_init.S [new file with mode: 0644]

index f38b3b720d5925c8dd89644fcd4fb0b0946350ab..a7fb4fb29294f80e40a369e5fb378a7f7daf05a9 100644 (file)
@@ -33,10 +33,14 @@ COBJS-y     += cpu.o
 COBJS-y        += ddrc.o
 COBJS-y        += slcr.o
 
+SOBJS-y        += lowlevel_init.o
+
 COBJS  := $(COBJS-y)
 
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(SOBJS-y)
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
 all:   $(obj).depend $(LIB)
 
index 318125d29887dd8bd1d47cc1eb0913b36c20eafa..8df312650e5c1b8ff7d9cfafd8c337d2a85d83d6 100644 (file)
@@ -25,9 +25,6 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/hardware.h>
 
-void lowlevel_init(void)
-{
-}
 
 int arch_cpu_init(void)
 {
diff --git a/arch/arm/cpu/armv7/zynq/lowlevel_init.S b/arch/arm/cpu/armv7/zynq/lowlevel_init.S
new file mode 100644 (file)
index 0000000..d490eb5
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Xilinx, Inc. All rights reserved.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <asm-offsets.h>
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(lowlevel_init)
+
+       /* Enable the the VFP */
+       mrc     p15, 0, r1, c1, c0, 2
+       orr     r1, r1, #(0x3 << 20)
+       orr     r1, r1, #(0x3 << 20)
+       mcr     p15, 0, r1, c1, c0, 2
+       isb
+       fmrx    r1, FPEXC
+       orr     r1,r1, #(1<<30)
+       fmxr    FPEXC, r1
+
+       /* Move back to caller */
+       mov     pc, lr
+
+ENDPROC(lowlevel_init)