Skip to contentSkip to conversation

ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC

PATCH New York Sun 1 participant 1 message Feb 10, 2014

Subsystems (4)
lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC

Freescale LayerScape with Chassis Generation 3 is a set of SoCs with ARMv8 cores and 3rd generation of Chassis. We use different MMU setup to support memory map and cache attribute for these SoCs. MMU and cache are enabled very early to bootst performance, especially for early development on emulators.

---
 arch/arm/cpu/armv8/fsl-lsch3/Makefile             |   10 +
 arch/arm/cpu/armv8/fsl-lsch3/README               |   10 +
 arch/arm/cpu/armv8/fsl-lsch3/cpu.c                |  285 +++++++++++++++++++++
 arch/arm/cpu/armv8/fsl-lsch3/cpu.h                |    7 +
 arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S           |   40 +++
 arch/arm/cpu/armv8/fsl-lsch3/speed.c              |  170 ++++++++++++
 arch/arm/cpu/armv8/fsl-lsch3/timer.c              |   63 +++++
 arch/arm/include/asm/arch-fsl-lsch3/clock.h       |   23 ++
 arch/arm/include/asm/arch-fsl-lsch3/config.h      |   56 ++++
 arch/arm/include/asm/arch-fsl-lsch3/gpio.h        |    9 +
 arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h |  116 +++++++++
 arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h    |   13 +
 arch/arm/include/asm/arch-fsl-lsch3/mmu.h         |   10 +
 arch/arm/include/asm/config.h                     |    4 +
 drivers/i2c/mxc_i2c.c                             |    5 +
 include/common.h                                  |    5 +-
 16 files changed, 823 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/Makefile
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/README
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/cpu.c
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/cpu.h
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/speed.c
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/timer.c
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/clock.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/config.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/gpio.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/mmu.h
arch/arm/cpu/armv8/fsl-lsch3/Makefile new file +10 -0
new file mode 100644
index 0000000..4b859cf
@@ -0,0 +1,10 @@
+#
+# Copyright 2014, Freescale Semiconductor
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += cpu.o
+obj-y += timer.o
+obj-y += lowlevel.o
+obj-y += speed.o
arch/arm/cpu/armv8/fsl-lsch3/README new file +10 -0
new file mode 100644
index 0000000..de34a91
@@ -0,0 +1,10 @@
+#
+# Copyright 2014 Freescale Semiconductor
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+Freescale LayerScape with Chassis Generation 3
+
+This architecture supports Freescale ARMv8 SoCs with Chassis generation 3,
+for example LS2100A.
arch/arm/cpu/armv8/fsl-lsch3/cpu.c new file +285 -0

285 lines not on this page · raw message

arch/arm/cpu/armv8/fsl-lsch3/cpu.h new file +7 -0
new file mode 100644
index 0000000..28544d7
@@ -0,0 +1,7 @@
+/*
+ * Copyright 2014, Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+int fsl_qoriq_core_to_cluster(unsigned int core);
arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S new file +40 -0
new file mode 100644
index 0000000..beac299
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2014 Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ * Extracted from armv8/start.S
+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+#include <asm/macro.h>
+
+ENTRY(lowlevel_init)
+	/* Initialize GIC Secure Bank Status */
+	mov	x29, lr			/* Save LR */
+	bl	gic_init
+
+	branch_if_master x0, x1, 1f
+
+	/*
+	 * Slave should wait for master clearing spin table.
+	 * This sync prevent salves observing incorrect
+	 * value of spin table and jumping to wrong place.
+	 */
+	bl	wait_for_wakeup
+
+	/*
+	 * All processors will enter EL2 and optionally EL1.
+	 */
+	bl	armv8_switch_to_el2
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+	bl	armv8_switch_to_el1
+#endif
+	b	2f
+
+1:
+2:
+	mov	lr, x29			/* Restore LR */
+	ret
+ENDPROC(lowlevel_init)
arch/arm/cpu/armv8/fsl-lsch3/speed.c new file +170 -0

170 lines not on this page · raw message

arch/arm/cpu/armv8/fsl-lsch3/timer.c new file +63 -0

63 lines not on this page · raw message

arch/arm/include/asm/arch-fsl-lsch3/clock.h new file +23 -0
new file mode 100644
index 0000000..831af0b
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ */
+
+#ifndef __ASM_ARCH_FSL_LSCH3_CLOCK_H_
+#define __ASM_ARCH_FSL_LSCH3_CLOCK_H_
+
+#include <common.h>
+
+enum mxc_clock {
+	MXC_ARM_CLK = 0,
+	MXC_BUS_CLK,
+	MXC_UART_CLK,
+	MXC_ESDHC_CLK,
+	MXC_I2C_CLK,
+};
+
+unsigned int mxc_get_clock(enum mxc_clock clk);
+
+#endif /* __ASM_ARCH_FSL_LSCH3_CLOCK_H_ */
arch/arm/include/asm/arch-fsl-lsch3/config.h new file +56 -0

56 lines not on this page · raw message

arch/arm/include/asm/arch-fsl-lsch3/gpio.h new file +9 -0
new file mode 100644
index 0000000..f23a78c
@@ -0,0 +1,9 @@
+/*
+ * Copyright 2014, Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARMV8_FSL_LSCH3_GPIO_H_
+#define _ASM_ARMV8_FSL_LSCH3_GPIO_H_
+#endif	/* _ASM_ARMV8_FSL_LSCH3_GPIO_H_ */
arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h new file +116 -0

116 lines not on this page · raw message

arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h new file +13 -0
new file mode 100644
index 0000000..8f00535
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ */
+
+#ifndef __ASM_ARCH_FSL_LSCH3_IMX_REGS_H_
+#define __ASM_ARCH_FSL_LSCH3_IMX_REGS_H_
+
+#define I2C_QUIRK_REG	/* enable 8-bit driver */
+
+#endif /* __ASM_ARCH_FSL_LSCH3_IMX_REGS_H_ */
arch/arm/include/asm/arch-fsl-lsch3/mmu.h new file +10 -0
new file mode 100644
index 0000000..edbed47
@@ -0,0 +1,10 @@
+/*
+ * Copyright 2014, Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARMV8_FSL_LSCH3_MMU_H_
+#define _ASM_ARMV8_FSL_LSCH3_MMU_H_
+#include <asm/arch-armv8/mmu.h>
+#endif /* _ASM_ARMV8_FSL_LSCH3_MMU_H_ */
arch/arm/include/asm/config.h +4 -0
index abf79e5..369da26 100644
@@ -15,4 +15,8 @@
 #define CONFIG_STATIC_RELA
 #endif
 
+#ifdef CONFIG_FSL_LSCH3
+#include <asm/arch-fsl-lsch3/config.h>
+#endif
+
 #endif
drivers/i2c/mxc_i2c.c +5 -0
index 48468d7..c14797c 100644
@@ -429,6 +429,11 @@ static void * const i2c_bases[] = {
 	(void *)I2C3_BASE_ADDR
 #elif defined(CONFIG_VF610)
 	(void *)I2C0_BASE_ADDR
+#elif defined(CONFIG_FSL_LSCH3)
+	(void *)I2C1_BASE_ADDR,
+	(void *)I2C2_BASE_ADDR,
+	(void *)I2C3_BASE_ADDR,
+	(void *)I2C4_BASE_ADDR
 #else
 #error "architecture not supported"
 #endif
include/common.h +2 -3
index 221b776..10dce65 100644
@@ -692,9 +692,6 @@ ulong get_PERCLK3(void);
 ulong	get_bus_freq  (ulong);
 int get_serial_clock(void);
 
-#if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx)
-ulong get_ddr_freq(ulong);
-#endif
 #if defined(CONFIG_MPC85xx)
 typedef MPC85xx_SYS_INFO sys_info_t;
 void	get_sys_info  ( sys_info_t * );
@@ -710,6 +707,8 @@ static inline ulong get_ddr_freq(ulong dummy)
 {
 	return get_bus_freq(dummy);
 }
+#else
+ulong get_ddr_freq(ulong);
 #endif
 
 #if defined(CONFIG_4xx)
Signature · 1 line
1.7.9.5