Skip to contentSkip to conversation

ARMv8/FSL_LSCH3: SoC and board support

U-Boot Superseded York Sun 2 participants 10 messages Mar 19, 2014 – May 25, 2014

Subsystems (5)

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

York Sun

author
#0 lore raw

[Patch v2 1/5] Added 64-bit MMIO accessors for ARMv8 [Patch v2 2/5] ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC
[Patch v2 3/5] ARMv8/ls2100a_emu: Add LS2100A emulator board support [Patch v2 4/5] armv8/fsl-lsch3: Add support to load and start MC [Patch v2 5/5] fsl-lsch3/ls2100a_emu: Enabled MC

I have sent 2/5 as individual patch before. To avoid confusion, let's start with v2.

Change since v1:
2/5 ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC
Add L3 cache flushing
Revised MMU table
Re-create MMU in DDR after relocation
Fix topology and clock registers

This set should be applied in order. I will create a bundle in patchwor to include floating patches to show the dependency.

York

author
#1 lore raw

PATCH v2 1/5 Added 64-bit MMIO accessors for ARMv8

From: "J. German Rivera" <[email protected]>

This is needed for accessing peripherals with 64-bit MMIO registers, from ARMv8 processors.

---
 arch/arm/include/asm/io.h |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/include/asm/io.h +8 -0
index 6a1f05a..95528dd 100644
@@ -70,10 +70,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 #define __arch_getb(a)			(*(volatile unsigned char *)(a))
 #define __arch_getw(a)			(*(volatile unsigned short *)(a))
 #define __arch_getl(a)			(*(volatile unsigned int *)(a))
+#define __arch_getq(a)			(*(volatile unsigned long long *)(a))
 
 #define __arch_putb(v,a)		(*(volatile unsigned char *)(a) = (v))
 #define __arch_putw(v,a)		(*(volatile unsigned short *)(a) = (v))
 #define __arch_putl(v,a)		(*(volatile unsigned int *)(a) = (v))
+#define __arch_putq(v,a)		(*(volatile unsigned long long *)(a) = (v))
 
 extern inline void __raw_writesb(unsigned long addr, const void *data,
 				 int bytelen)
@@ -123,10 +125,12 @@ extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
 #define __raw_writeb(v,a)	__arch_putb(v,a)
 #define __raw_writew(v,a)	__arch_putw(v,a)
 #define __raw_writel(v,a)	__arch_putl(v,a)
+#define __raw_writeq(v,a)	__arch_putq(v,a)
 
 #define __raw_readb(a)		__arch_getb(a)
 #define __raw_readw(a)		__arch_getw(a)
 #define __raw_readl(a)		__arch_getl(a)
+#define __raw_readq(a)		__arch_getq(a)
 
 /*
  * TODO: The kernel offers some more advanced versions of barriers, it might
@@ -139,10 +143,12 @@ extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
 #define writeb(v,c)	({ u8  __v = v; __iowmb(); __arch_putb(__v,c); __v; })
 #define writew(v,c)	({ u16 __v = v; __iowmb(); __arch_putw(__v,c); __v; })
 #define writel(v,c)	({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
+#define writeq(v,c)	({ u64 __v = v; __iowmb(); __arch_putq(__v,c); __v; })
 
 #define readb(c)	({ u8  __v = __arch_getb(c); __iormb(); __v; })
 #define readw(c)	({ u16 __v = __arch_getw(c); __iormb(); __v; })
 #define readl(c)	({ u32 __v = __arch_getl(c); __iormb(); __v; })
+#define readq(c)	({ u64 __v = __arch_getq(c); __iormb(); __v; })
 
 /*
  * The compiler seems to be incapable of optimising constants
@@ -168,9 +174,11 @@ extern inline void __raw_readsl(unsigned long addr, void *data, int longlen)
 #define out_arch(type,endian,a,v)	__raw_write##type(cpu_to_##endian(v),a)
 #define in_arch(type,endian,a)		endian##_to_cpu(__raw_read##type(a))
 
+#define out_le64(a,v)	out_arch(q,le64,a,v)
 #define out_le32(a,v)	out_arch(l,le32,a,v)
 #define out_le16(a,v)	out_arch(w,le16,a,v)
 
+#define in_le64(a)	in_arch(q,le64,a)
 #define in_le32(a)	in_arch(l,le32,a)
 #define in_le16(a)	in_arch(w,le16,a)
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 1/5 Added 64-bit MMIO accessors for ARMv8

Hi York,

Quoted 7 lines · York Sun

From: "J. German Rivera" <[email protected]>

This is needed for accessing peripherals with 64-bit MMIO registers, from ARMv8 processors.

---

There is a warning when applying this patch, due to a blank line at the end of arch/arm/cpu/armv8/fsl-lsch3/timer.c. Please fix alongside the rebase needed by 3/5.

Amicalement,

Signature · 1 line
Albert.
author
#3 lore raw

PATCH v2 2/5 ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC

In reply to York Sun

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. After u-boot relocates to DDR, a new MMU table is created in DDR.

---
 arch/arm/cpu/armv8/cache_v8.c                     |    7 +-
 arch/arm/cpu/armv8/fsl-lsch3/Makefile             |   10 +
 arch/arm/cpu/armv8/fsl-lsch3/README               |   10 +
 arch/arm/cpu/armv8/fsl-lsch3/cpu.c                |  465 +++++++++++++++++++++
 arch/arm/cpu/armv8/fsl-lsch3/cpu.h                |    7 +
 arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S           |   59 +++
 arch/arm/cpu/armv8/fsl-lsch3/speed.c              |  176 ++++++++
 arch/arm/cpu/armv8/fsl-lsch3/speed.h              |    7 +
 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 +
 arch/arm/include/asm/system.h                     |    2 +
 drivers/i2c/mxc_i2c.c                             |    5 +
 include/common.h                                  |    5 +-
 19 files changed, 1043 insertions(+), 4 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/speed.h
 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/cache_v8.c +6 -1
index a96ecda..c47acba 100644
@@ -83,12 +83,17 @@ void invalidate_dcache_all(void)
 	__asm_invalidate_dcache_all();
 }
 
+void __weak flush_l3_cache(void)
+{
+}
+
 /*
  * Performs a clean & invalidation of the entire data cache at all levels
  */
 void flush_dcache_all(void)
 {
 	__asm_flush_dcache_all();
+	flush_l3_cache();
 }
 
 /*
@@ -221,7 +226,7 @@ void invalidate_icache_all(void)
  * Enable dCache & iCache, whether cache is actually enabled
  * depend on CONFIG_SYS_DCACHE_OFF and CONFIG_SYS_ICACHE_OFF
  */
-void enable_caches(void)
+void __weak enable_caches(void)
 {
 	icache_enable();
 	dcache_enable();
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 +465 -0

465 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 +59 -0

59 lines not on this page · raw message

arch/arm/cpu/armv8/fsl-lsch3/speed.c new file +176 -0

176 lines not on this page · raw message

arch/arm/cpu/armv8/fsl-lsch3/speed.h new file +7 -0
new file mode 100644
index 0000000..15af5b9
@@ -0,0 +1,7 @@
+/*
+ * Copyright 2014, Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+void get_sys_info(struct sys_info *sys_info);
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
arch/arm/include/asm/system.h +2 -0
index 74ee9a4..d51ba66 100644
@@ -78,6 +78,8 @@ void gic_send_sgi(unsigned long sgino);
 void wait_for_wakeup(void);
 void smp_kick_all_cpus(void);
 
+void flush_l3_cache(void);
+
 #endif	/* __ASSEMBLY__ */
 
 #else /* CONFIG_ARM64 */
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 090fcde..bad8014 100644
@@ -701,9 +701,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 * );
@@ -719,6 +716,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
author
#4 lore raw

PATCH v2 3/5 ARMv8/ls2100a_emu: Add LS2100A emulator board support

In reply to York Sun

LS2100A is an ARMv8 implementation. This adds board support for emulator:
Two DDR controllers
UART2 is used as the console
IFC timing is tightened for speedy booting

---
 board/freescale/ls2100a_emu/Makefile         |    8 +
 board/freescale/ls2100a_emu/README           |   16 ++
 board/freescale/{t4qds => ls2100a_emu}/ddr.c |   90 ++++++++---
 board/freescale/ls2100a_emu/ddr.h            |   57 +++++++
 board/freescale/ls2100a_emu/ls2100a_emu.c    |   56 +++++++
 boards.cfg                                   |    1 +
 include/configs/ls2100a_emu.h                |  205 ++++++++++++++++++++++++++
 7 files changed, 409 insertions(+), 24 deletions(-)
 create mode 100644 board/freescale/ls2100a_emu/Makefile
 create mode 100644 board/freescale/ls2100a_emu/README
 copy board/freescale/{t4qds => ls2100a_emu}/ddr.c (58%)
 create mode 100644 board/freescale/ls2100a_emu/ddr.h
 create mode 100644 board/freescale/ls2100a_emu/ls2100a_emu.c
 create mode 100644 include/configs/ls2100a_emu.h
board/freescale/ls2100a_emu/Makefile new file +8 -0
new file mode 100644
index 0000000..3fee04b
@@ -0,0 +1,8 @@
+#
+# Copyright 2014 Freescale Semiconductor
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += ls2100a_emu.o
+obj-y += ddr.o
board/freescale/ls2100a_emu/README new file +16 -0
new file mode 100644
index 0000000..9a8a618
@@ -0,0 +1,16 @@
+Freescale ls2100a_emu
+
+This is a emulator target with limited peripherals.
+
+Memory map from core's view
+
+0x00_0000_0000 .. 0x00_000F_FFFF	Boot Rom
+0x00_0100_0000 .. 0x00_0FFF_FFFF	CCSR
+0x00_1800_0000 .. 0x00_181F_FFFF	OCRAM
+0x00_3000_0000 .. 0x00_3FFF_FFFF	IFC region #1
+0x00_8000_0000 .. 0x00_FFFF_FFFF	DDR region #1
+0x05_1000_0000 .. 0x05_FFFF_FFFF	IFC region #2
+0x80_8000_0000 .. 0xFF_FFFF_FFFF	DDR region #2
+
+Other addresses are either reserved, or not used directly by u-boot.
+This list should be updated when more addresses are used.
board/freescale/ls2100a_emu/ddr.c renamed from board/freescale/t4qds/ddr.c +66 -24

146 lines not on this page · raw message

board/freescale/ls2100a_emu/ddr.h new file +57 -0

57 lines not on this page · raw message

board/freescale/ls2100a_emu/ls2100a_emu.c new file +56 -0

56 lines not on this page · raw message

boards.cfg +1 -0
index 69c8936..c2defb4 100644
@@ -44,6 +44,7 @@
 ###########################################################################################################
 
 Active  aarch64     armv8          -           armltd          vexpress64          vexpress_aemv8a                      vexpress_aemv8a:ARM64                                                                                                             David Feng <[email protected]>
+Active  aarch64     armv8          fsl-lsch3   freescale       ls2100a_emu         ls2100a_emu                          ls2100a_emu:ARM64,EMU                                                                                                             York Sun <[email protected]>
 Active  arc         arc700         -           synopsys        -                   axs101                               -                                                                                                                                 Alexey Brodkin <[email protected]>
 Active  arc         arc700         -           synopsys        <none>              arcangel4                            -                                                                                                                                 Alexey Brodkin <[email protected]>
 Active  arc         arc700         -           synopsys        <none>              arcangel4-be                         -                                                                                                                                 Alexey Brodkin <[email protected]>
include/configs/ls2100a_emu.h new file +205 -0

205 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v2 3/5 ARMv8/ls2100a_emu: Add LS2100A emulator board support

Hi York,

Quoted 8 lines · York Sun

LS2100A is an ARMv8 implementation. This adds board support for emulator:
Two DDR controllers
UART2 is used as the console
IFC timing is tightened for speedy booting

---

This patch does not apply properly any more on u-boot-arm/master. Canyou please rebase and fix? Also, see patch 2/5 warning about blank line at EOF.

Amicalement,

Signature · 1 line
Albert.
author
#6 lore raw

PATCH v2 3/5 ARMv8/ls2100a_emu: Add LS2100A emulator board support

Will update.

York

-------- Original Message --------
From: Albert ARIBAUD
Sent: Sun, 25/05/2014 06:01
To: Sun York-R58495
CC: u-boot at lists.denx.de
Subject: Re: [Patch v2 3/5] ARMv8/ls2100a_emu: Add LS2100A emulator board support

Hi York,

Quoted 8 lines · York Sun

LS2100A is an ARMv8 implementation. This adds board support for emulator:
Two DDR controllers
UART2 is used as the console
IFC timing is tightened for speedy booting

---

This patch does not apply properly any more on u-boot-arm/master. Canyou please rebase and fix? Also, see patch 2/5 warning about blank line at EOF.

Amicalement,
--
Albert.

author
#7 lore raw

PATCH v2 4/5 armv8/fsl-lsch3: Add support to load and start MC Firmware

In reply to York Sun

From: "J. German Rivera" <[email protected]>

Adding supoort to load and start the Layerscape Management Complex (MC) firmware. First, the MC GCR register is set to 0 to reset all cores. MC firmware and DPL images are copied from their location in NOR flash to DDR. MC registers are updated with the location of these images. Deasserting the reset bit of MC GCR register releases core 0 to run. Core 1 will be released by MC firmware. Stop bits are not touched for this step. U-boot waits for MC until it boots up.

---
 README                             |   27 ++++++++
 arch/arm/cpu/armv8/fsl-lsch3/cpu.c |   11 +++
 drivers/net/Makefile               |    1 +
 drivers/net/fsl_mc/Makefile        |    9 +++
 drivers/net/fsl_mc/mc.c            |  132 ++++++++++++++++++++++++++++++++++++
 include/fsl_mc.h                   |   59 ++++++++++++++++
 6 files changed, 239 insertions(+)
 create mode 100644 drivers/net/fsl_mc/Makefile
 create mode 100644 drivers/net/fsl_mc/mc.c
 create mode 100644 include/fsl_mc.h
README +27 -0
index 216f0c7..2f6532e 100644
@@ -4520,6 +4520,33 @@ within that device.
 	window->master inbound window->master LAW->the ucode address in
 	master's memory space.
 
+Freescale Layerscape Management Complex Firmware Support:
+---------------------------------------------------------
+The Freescale Layerscape Management Complex (MC) supports the loading of
+"firmware".
+This firmware often needs to be loaded during U-Boot booting, so macros
+are used to identify the storage device (NOR flash, SPI, etc) and the address
+within that device.
+
+- CONFIG_FSL_MC_ENET
+	Enable the MC driver for Layerscape SoCs.
+
+- CONFIG_SYS_LS_MC_FW_ADDR
+	The address in the storage device where the firmware is located.  The
+	meaning of this address depends on which CONFIG_SYS_LS_MC_FW_IN_xxx macro
+	is also specified.
+
+- CONFIG_SYS_LS_MC_FW_LENGTH
+	The maximum possible size of the firmware.  The firmware binary format
+	has a field that specifies the actual size of the firmware, but it
+	might not be possible to read any part of the firmware unless some
+	local storage is allocated to hold the entire firmware first.
+
+- CONFIG_SYS_LS_MC_FW_IN_NOR
+	Specifies that MC firmware is located in NOR flash, mapped as
+	normal addressable memory via the LBC. CONFIG_SYS_LS_MC_FW_ADDR is the
+	virtual address in NOR flash.
+
 Building the Software:
 ======================
 
arch/arm/cpu/armv8/fsl-lsch3/cpu.c +11 -0
index 69c78a9..f976235 100644
@@ -12,6 +12,7 @@
 #include <asm/arch-fsl-lsch3/immap_lsch3.h>
 #include "cpu.h"
 #include "speed.h"
+#include <fsl_mc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -463,3 +464,13 @@ int print_cpuinfo(void)
 	return 0;
 }
 #endif
+
+int cpu_eth_init(bd_t *bis)
+{
+	int error = 0;
+
+#ifdef CONFIG_FSL_MC_ENET
+	error = mc_init(bis);
+#endif
+	return error;
+}
drivers/net/Makefile +1 -0
index 7f9ce90..184133a 100644
@@ -63,3 +63,4 @@ obj-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
 obj-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
 		xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o
 obj-$(CONFIG_ZYNQ_GEM) += zynq_gem.o
+obj-$(CONFIG_FSL_MC_ENET) += fsl_mc/
drivers/net/fsl_mc/Makefile new file +9 -0
new file mode 100644
index 0000000..c3e6690
@@ -0,0 +1,9 @@
+#
+# Copyright 2014 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+# Layerscape MC driver
+obj-y += mc.o
+
drivers/net/fsl_mc/mc.c new file +132 -0

132 lines not on this page · raw message

include/fsl_mc.h new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH v2 5/5 fsl-lsch3/ls2100a_emu: Enabled MC

In reply to York Sun

Reserve last 512MB from main memory for MC to use. Specify the location of MC firmware and DPL image in NOR flash.

---
 board/freescale/ls2100a_emu/ls2100a_emu.c |   10 ++++++++++
 include/configs/ls2100a_emu.h             |   14 ++++++++++++++
 2 files changed, 24 insertions(+)
board/freescale/ls2100a_emu/ls2100a_emu.c +10 -0
index 608a88c..bb0bb1e 100644
@@ -54,3 +54,13 @@ int timer_init(void)
 void reset_cpu(ulong addr)
 {
 }
+
+int board_eth_init(bd_t *bis)
+{
+	int error = 0;
+
+#ifdef CONFIG_FSL_MC_ENET
+	error = cpu_eth_init(bis);
+#endif
+	return error;
+}
include/configs/ls2100a_emu.h +14 -0
index dce25bd..8829975 100644
@@ -54,6 +54,9 @@
 #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE
 #define CONFIG_SYS_DDR_BLOCK2_BASE	0x8080000000ULL
 
+/* don't use last 512MB, reserved for MC firmware */
+#define CONFIG_SYS_MEM_TOP_HIDE		(512UL * 1024 * 1024)
+
 /* Generic Timer Definitions */
 #define COUNTER_FREQUENCY		12000000	/* 12MHz */
 
@@ -129,6 +132,17 @@
 #define CONFIG_SYS_CS0_FTIM2		CONFIG_SYS_NOR_FTIM2
 #define CONFIG_SYS_CS0_FTIM3		CONFIG_SYS_NOR_FTIM3
 
+/* MC firmware */
+#define CONFIG_FSL_MC_ENET
+#define CONFIG_SYS_LS_MC_FW_IN_NOR
+#define CONFIG_SYS_LS_MC_FW_ADDR	0x30240000ULL
+/* TODO Actual FW length needs to be determined at runtime from FW header */
+#define CONFIG_SYS_LS_MC_FW_LENGTH	(4U * 1024 * 1024)
+#define CONFIG_SYS_LS_MC_DPL_IN_NOR
+#define CONFIG_SYS_LS_MC_DPL_ADDR	0x30200000ULL
+/* TODO Actual DPL max length needs to be confirmed with the MC FW team */
+#define CONFIG_SYS_LS_MC_DPL_LENGTH	4096
+
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_BDI
Signature · 1 line
1.7.9.5
author
#9 lore raw
In reply to York Sun
Quoted 16 lines · York Sun

[Patch v2 1/5] Added 64-bit MMIO accessors for ARMv8 [Patch v2 2/5] ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC
[Patch v2 3/5] ARMv8/ls2100a_emu: Add LS2100A emulator board support [Patch v2 4/5] armv8/fsl-lsch3: Add support to load and start MC [Patch v2 5/5] fsl-lsch3/ls2100a_emu: Enabled MC

I have sent 2/5 as individual patch before. To avoid confusion, let's start with v2.

Change since v1:
2/5 ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC
Add L3 cache flushing
Revised MMU table
Re-create MMU in DDR after relocation
Fix topology and clock registers

Quoted 3 lines

This set should be applied in order. I will create a bundle in patchwor to include floating patches to show the dependency.

Here is the bundle http://patchwork.ozlabs.org/bundle/yorksun/armv8_fsl-lsch3/

York