Skip to contentSkip to conversation

part2 of arm64. This patch provide u-boot with arm64 support. Currently, it works on Foundation Model for armv8 or Fast Model for armv8.

PATCH New fenghua at phytium.com.cn 2 participants 2 messages Aug 11, 2013 – Aug 13, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 part2 of arm64. This patch provide u-boot with arm64 support. Currently, it works on Foundation Model for armv8 or Fast Model for armv8.

From: fenghua <fenghua@ligen-virtual-machine.(none)>

This patch provide u-boot with arm64 support. Currently, it works on Foundation Model for armv8 or Fast Model for armv8.

---
 arch/arm64/cpu/armv8/Makefile           |   51 +++++++
 arch/arm64/cpu/armv8/cache.S            |  115 +++++++++++++++
 arch/arm64/cpu/armv8/config.mk          |   29 ++++
 arch/arm64/cpu/armv8/cpu.c              |  105 ++++++++++++++
 arch/arm64/cpu/armv8/exceptions.S       |  210 +++++++++++++++++++++++++++
 arch/arm64/cpu/armv8/start.S            |  198 ++++++++++++++++++++++++++
 arch/arm64/cpu/armv8/tlb.S              |   38 +++++
 arch/arm64/cpu/u-boot.lds               |   73 ++++++++++
 arch/arm64/dts/aemv8a.dtsi              |  234 +++++++++++++++++++++++++++++++
 arch/arm64/include/asm/arch-armv8/mmu.h |  117 ++++++++++++++++
 arch/arm64/include/asm/atomic.h         |  115 +++++++++++++++
 arch/arm64/include/asm/bitops.h         |  153 ++++++++++++++++++++
 arch/arm64/include/asm/byteorder.h      |   31 ++++
 arch/arm64/include/asm/cache.h          |   37 +++++
 arch/arm64/include/asm/config.h         |   39 ++++++
 arch/arm64/include/asm/errno.h          |    1 +
 arch/arm64/include/asm/global_data.h    |   38 +++++
 arch/arm64/include/asm/gpio.h           |    1 +
 arch/arm64/include/asm/io.h             |  193 +++++++++++++++++++++++++
 arch/arm64/include/asm/linkage.h        |   49 +++++++
 arch/arm64/include/asm/posix_types.h    |   61 ++++++++
 arch/arm64/include/asm/processor.h      |   59 ++++++++
 arch/arm64/include/asm/ptrace.h         |   58 ++++++++
 arch/arm64/include/asm/sections.h       |   27 ++++
 arch/arm64/include/asm/string.h         |   49 +++++++
 arch/arm64/include/asm/system.h         |  113 +++++++++++++++
 arch/arm64/include/asm/types.h          |   67 +++++++++
 arch/arm64/include/asm/u-boot.h         |   38 +++++
 arch/arm64/include/asm/unaligned.h      |   28 ++++
 arch/arm64/include/asm/utils.h          |   56 ++++++++
 30 files changed, 2383 insertions(+)
 create mode 100644 arch/arm64/cpu/armv8/Makefile
 create mode 100644 arch/arm64/cpu/armv8/cache.S
 create mode 100644 arch/arm64/cpu/armv8/config.mk
 create mode 100644 arch/arm64/cpu/armv8/cpu.c
 create mode 100644 arch/arm64/cpu/armv8/exceptions.S
 create mode 100644 arch/arm64/cpu/armv8/start.S
 create mode 100644 arch/arm64/cpu/armv8/tlb.S
 create mode 100644 arch/arm64/cpu/u-boot.lds
 create mode 100644 arch/arm64/dts/aemv8a.dtsi
 create mode 100644 arch/arm64/include/asm/arch-armv8/mmu.h
 create mode 100644 arch/arm64/include/asm/atomic.h
 create mode 100644 arch/arm64/include/asm/bitops.h
 create mode 100644 arch/arm64/include/asm/byteorder.h
 create mode 100644 arch/arm64/include/asm/cache.h
 create mode 100644 arch/arm64/include/asm/config.h
 create mode 100644 arch/arm64/include/asm/errno.h
 create mode 100644 arch/arm64/include/asm/global_data.h
 create mode 100644 arch/arm64/include/asm/gpio.h
 create mode 100644 arch/arm64/include/asm/io.h
 create mode 100644 arch/arm64/include/asm/linkage.h
 create mode 100644 arch/arm64/include/asm/posix_types.h
 create mode 100644 arch/arm64/include/asm/processor.h
 create mode 100644 arch/arm64/include/asm/ptrace.h
 create mode 100644 arch/arm64/include/asm/sections.h
 create mode 100644 arch/arm64/include/asm/string.h
 create mode 100644 arch/arm64/include/asm/system.h
 create mode 100644 arch/arm64/include/asm/types.h
 create mode 100644 arch/arm64/include/asm/u-boot.h
 create mode 100644 arch/arm64/include/asm/unaligned.h
 create mode 100644 arch/arm64/include/asm/utils.h
arch/arm64/cpu/armv8/Makefile new file +51 -0
new file mode 100644
index 0000000..1a8cdd7
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2013	FengHua <[email protected]>
+#
+# 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 Foundatio; 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 $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(CPU).o
+
+START	:= start.o
+
+COBJS	+= cpu.o
+
+SOBJS	+= exceptions.o
+SOBJS	+= cache.o
+SOBJS	+= tlb.o
+
+SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+START	:= $(addprefix $(obj),$(START))
+
+all:	$(obj).depend $(START) $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm64/cpu/armv8/cache.S new file +115 -0

115 lines not on this page · raw message

arch/arm64/cpu/armv8/config.mk new file +29 -0
new file mode 100644
index 0000000..113075c
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2013	FengHua <[email protected]>
+#
+# 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
+#
+PLATFORM_RELFLAGS += -fno-common -ffixed-x18
+
+PF_CPPFLAGS_ARMV8 := $(call cc-option, -march=armv8-a)
+PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV8)
+
+# SEE README.arm-unaligned-accesses
+PF_NO_UNALIGNED := $(call cc-option, -mstrict-align)
+PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)
arch/arm64/cpu/armv8/cpu.c new file +105 -0

105 lines not on this page · raw message

arch/arm64/cpu/armv8/exceptions.S new file +210 -0

210 lines not on this page · raw message

arch/arm64/cpu/armv8/start.S new file +198 -0

198 lines not on this page · raw message

arch/arm64/cpu/armv8/tlb.S new file +38 -0
new file mode 100644
index 0000000..e28ee9d
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013	David Feng <[email protected]>
+ *
+ * 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 <version.h>
+#include <linux/linkage.h>
+
+/*
+ * void __invalidate_tlb_all(void)
+ *
+ * This "function" invalidate all tlb entries.
+ */
+ENTRY(__invalidate_tlb_all)
+	tlbi	alle2
+	dsb		sy
+	isb
+	ret
+ENDPROC(__invalidate_tlb_all)
arch/arm64/cpu/u-boot.lds new file +73 -0

73 lines not on this page · raw message

arch/arm64/dts/aemv8a.dtsi new file +234 -0

234 lines not on this page · raw message

arch/arm64/include/asm/arch-armv8/mmu.h new file +117 -0

117 lines not on this page · raw message

arch/arm64/include/asm/atomic.h new file +115 -0

115 lines not on this page · raw message

arch/arm64/include/asm/bitops.h new file +153 -0

153 lines not on this page · raw message

arch/arm64/include/asm/byteorder.h new file +31 -0
new file mode 100644
index 0000000..d5edfe8
@@ -0,0 +1,31 @@
+/*
+ *  linux/include/asm-arm/byteorder.h
+ *
+ * ARM Endian-ness.  In little endian mode, the data bus is connected such
+ * that byte accesses appear as:
+ *  0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ *
+ * When in big endian mode, byte accesses appear as:
+ *  0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ */
+#ifndef __ASM_ARM64_BYTEORDER_H
+#define __ASM_ARM64_BYTEORDER_H
+
+#include <asm/types.h>
+
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#  define __BYTEORDER_HAS_U64__
+#  define __SWAB_64_THRU_32__
+#endif
+
+#ifdef __BIG_ENDIAN__
+#include <linux/byteorder/big_endian.h>
+#else
+#include <linux/byteorder/little_endian.h>
+#endif
+
+#endif /* __ASM_ARM64_BYTEORDER_H */
arch/arm64/include/asm/cache.h new file +37 -0
new file mode 100644
index 0000000..d409b0e
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013	David Feng <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef _ASM_ARM64_CACHE_H
+#define _ASM_ARM64_CACHE_H
+
+/*
+ * The current upper bound for ARM L1 data cache line sizes is 64 bytes.  We
+ * use that value for aligning DMA buffers unless the board config has specified
+ * an alternate cache line size.
+ */
+#ifdef CONFIG_SYS_CACHELINE_SIZE
+#define ARCH_DMA_MINALIGN	CONFIG_SYS_CACHELINE_SIZE
+#else
+#define ARCH_DMA_MINALIGN	64
+#endif
+
+#endif /* _ASM_ARM64_CACHE_H */
arch/arm64/include/asm/config.h new file +39 -0
new file mode 100644
index 0000000..5e79aab
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013	David Feng <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef _ASM_ARM64_CONFIG_H_
+#define _ASM_ARM64_CONFIG_H_
+
+#define CONFIG_LMB
+
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
+
+/*
+ * Currently, gcc-aarch64 produce error when compiling with
+ * -pie and rel_dyn. So, GOT is used to relocate u-boot and
+ * configuration CONFIG_NEEDS_MANUAL_RELOC is needed.
+ */
+#define CONFIG_NEEDS_MANUAL_RELOC
+
+#define CONFIG_SYS_HZ		1000
+
+#endif /* _ASM_ARM64_CONFIG_H_ */
arch/arm64/include/asm/errno.h new file +1 -0
new file mode 100644
index 0000000..4c82b50
@@ -0,0 +1 @@
+#include <asm-generic/errno.h>
arch/arm64/include/asm/global_data.h new file +38 -0
new file mode 100644
index 0000000..13b66d4
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013	David Feng <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef	__ASM_ARM64_GBL_DATA_H
+#define __ASM_ARM64_GBL_DATA_H
+
+/* Architecture-specific global data */
+struct arch_global_data {
+#ifndef CONFIG_SYS_DCACHE_OFF
+	unsigned long tlb_addr;
+	unsigned long tlb_size;
+#endif
+};
+
+#include <asm-generic/global_data.h>
+
+#define DECLARE_GLOBAL_DATA_PTR		register volatile gd_t *gd asm ("x18")
+
+#endif /* __ASM_ARM64_GBL_DATA_H */
arch/arm64/include/asm/gpio.h new file +1 -0
new file mode 100644
index 0000000..306ab4c
@@ -0,0 +1 @@
+#include <asm-generic/gpio.h>
arch/arm64/include/asm/io.h new file +193 -0

193 lines not on this page · raw message

arch/arm64/include/asm/linkage.h new file +49 -0

49 lines not on this page · raw message

arch/arm64/include/asm/posix_types.h new file +61 -0

61 lines not on this page · raw message

arch/arm64/include/asm/processor.h new file +59 -0

59 lines not on this page · raw message

arch/arm64/include/asm/ptrace.h new file +58 -0

58 lines not on this page · raw message

arch/arm64/include/asm/sections.h new file +27 -0
new file mode 100644
index 0000000..c042cb6
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * 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
+ */
+
+#ifndef __ASM_ARM_SECTIONS_H
+#define __ASM_ARM_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif
arch/arm64/include/asm/string.h new file +49 -0

49 lines not on this page · raw message

arch/arm64/include/asm/system.h new file +113 -0

113 lines not on this page · raw message

arch/arm64/include/asm/types.h new file +67 -0

67 lines not on this page · raw message

arch/arm64/include/asm/u-boot.h new file +38 -0
new file mode 100644
index 0000000..c0cf855
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013	David Feng <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef _U_BOOT_ARM64_H_
+#define _U_BOOT_ARM64_H_
+
+typedef struct bd_info {
+	unsigned long bi_baudrate;	/* serial console baudrate */
+	struct				/* RAM configuration */
+	{
+		unsigned long start;
+		unsigned long size;
+	} bi_dram[CONFIG_NR_DRAM_BANKS];
+} bd_t;
+
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT	IH_ARCH_ARM64
+
+#endif	/* _U_BOOT_ARM64_H_ */
arch/arm64/include/asm/unaligned.h new file +28 -0
new file mode 100644
index 0000000..39b509a
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013	David Feng <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef _ASM_ARM64_UNALIGNED_H
+#define _ASM_ARM64_UNALIGNED_H
+
+#include <asm-generic/unaligned.h>
+
+#endif /* _ASM_ARM64_UNALIGNED_H */
arch/arm64/include/asm/utils.h new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 part2 of arm64. This patch provide u-boot with arm64 support. Currently, it works on Foundation Model for armv8 or Fast Model for armv8.

Quoted 10 lines · fenghua at phytium.com.cn
arch/arm64/cpu/armv8/exceptions.S new file +4 -0
new file mode 100644
index 0000000..376df49
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2013	FengHua <[email protected]>
+ *
+ * Based on entry.S of linux kernel by

arch/arm64/cpu/armv8/exceptions.S line 14

Quoted 10 lines
arch/arm64/cpu/armv8/exceptions.S new file +10 -0
+ *     Catalin Marinas <[email protected]> and
+ *     Will Deacon <[email protected]>
+ *
+ * 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.

Do you have permission to relicense this as "v2 or later"? arch/arm64/kernel/entry.S in Linux is licensed v2-only.

I doubt you got permission to strip out the "ARM Ltd." copyright...

-Scott