Skip to content
Snippets Groups Projects
Commit b217c89e authored by Tom Rini's avatar Tom Rini
Browse files

Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq

parents 73e1e795 db14f11d
No related branches found
No related tags found
No related merge requests found
Showing
with 698 additions and 71 deletions
...@@ -5063,6 +5063,21 @@ within that device. ...@@ -5063,6 +5063,21 @@ within that device.
normal addressable memory via the LBC. CONFIG_SYS_LS_MC_FW_ADDR is the normal addressable memory via the LBC. CONFIG_SYS_LS_MC_FW_ADDR is the
virtual address in NOR flash. virtual address in NOR flash.
Freescale Layerscape Debug Server Support:
-------------------------------------------
The Freescale Layerscape Debug Server Support supports the loading of
"Debug Server firmware" and triggering SP boot-rom.
This firmware often needs to be loaded during U-Boot booting.
- CONFIG_FSL_DEBUG_SERVER
Enable the Debug Server for Layerscape SoCs.
- CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE
Define minimum DDR size required for debug server image
- CONFIG_SYS_MEM_TOP_HIDE_MIN
Define minimum DDR size to be hided from top of the DDR memory
Building the Software: Building the Software:
====================== ======================
......
...@@ -12,3 +12,7 @@ obj-y += fsl_epu.o ...@@ -12,3 +12,7 @@ obj-y += fsl_epu.o
obj-$(CONFIG_OF_LIBFDT) += fdt.o obj-$(CONFIG_OF_LIBFDT) += fdt.o
obj-$(CONFIG_SYS_HAS_SERDES) += fsl_ls1_serdes.o ls102xa_serdes.o obj-$(CONFIG_SYS_HAS_SERDES) += fsl_ls1_serdes.o ls102xa_serdes.o
obj-$(CONFIG_SPL) += spl.o obj-$(CONFIG_SPL) += spl.o
ifdef CONFIG_ARMV7_PSCI
obj-y += psci.o
endif
...@@ -29,29 +29,30 @@ void ft_fixup_enet_phy_connect_type(void *fdt) ...@@ -29,29 +29,30 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
char phy[16]; char phy[16];
int phy_node; int phy_node;
int i = 0; int i = 0;
int enet_id = 0;
uint32_t ph; uint32_t ph;
while ((dev = eth_get_dev_by_index(i++)) != NULL) { while ((dev = eth_get_dev_by_index(i++)) != NULL) {
if (strstr(dev->name, "eTSEC1")) if (strstr(dev->name, "eTSEC1")) {
enet_id = 0; strcpy(enet, "ethernet0");
else if (strstr(dev->name, "eTSEC2")) strcpy(phy, "enet0_rgmii_phy");
enet_id = 1; } else if (strstr(dev->name, "eTSEC2")) {
else if (strstr(dev->name, "eTSEC3")) strcpy(enet, "ethernet1");
enet_id = 2; strcpy(phy, "enet1_rgmii_phy");
else } else if (strstr(dev->name, "eTSEC3")) {
strcpy(enet, "ethernet2");
strcpy(phy, "enet2_rgmii_phy");
} else {
continue; continue;
}
priv = dev->priv; priv = dev->priv;
if (priv->flags & TSEC_SGMII) if (priv->flags & TSEC_SGMII)
continue; continue;
sprintf(enet, "ethernet%d", enet_id);
enet_path = fdt_get_alias(fdt, enet); enet_path = fdt_get_alias(fdt, enet);
if (!enet_path) if (!enet_path)
continue; continue;
sprintf(phy, "enet%d_rgmii_phy", enet_id);
phy_path = fdt_get_alias(fdt, phy); phy_path = fdt_get_alias(fdt, phy);
if (!phy_path) if (!phy_path)
continue; continue;
......
/*
* Copyright 2015 Freescale Semiconductor, Inc.
* Author: Wang Dongsheng <dongsheng.wang@freescale.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <config.h>
#include <linux/linkage.h>
#include <asm/armv7.h>
#include <asm/arch-armv7/generictimer.h>
#include <asm/psci.h>
#define SCFG_CORE0_SFT_RST 0x130
#define SCFG_CORESRENCR 0x204
#define DCFG_CCSR_BRR 0x0E4
#define DCFG_CCSR_SCRATCHRW1 0x200
.pushsection ._secure.text, "ax"
.arch_extension sec
#define ONE_MS (GENERIC_TIMER_CLK / 1000)
#define RESET_WAIT (30 * ONE_MS)
@ r1 = target CPU
@ r2 = target PC
.globl psci_cpu_on
psci_cpu_on:
push {lr}
@ Clear and Get the correct CPU number
@ r1 = 0xf01
and r1, r1, #0xff
mov r0, r1
bl psci_get_cpu_stack_top
str r2, [r0]
dsb
@ Get DCFG base address
movw r4, #(CONFIG_SYS_FSL_GUTS_ADDR & 0xffff)
movt r4, #(CONFIG_SYS_FSL_GUTS_ADDR >> 16)
@ Detect target CPU state
ldr r2, [r4, #DCFG_CCSR_BRR]
rev r2, r2
lsr r2, r2, r1
ands r2, r2, #1
beq holdoff_release
@ Reset target CPU
@ Get SCFG base address
movw r0, #(CONFIG_SYS_FSL_SCFG_ADDR & 0xffff)
movt r0, #(CONFIG_SYS_FSL_SCFG_ADDR >> 16)
@ Enable CORE Soft Reset
movw r5, #0
movt r5, #(1 << 15)
rev r5, r5
str r5, [r0, #SCFG_CORESRENCR]
@ Get CPUx offset register
mov r6, #0x4
mul r6, r6, r1
add r2, r0, r6
@ Do reset on target CPU
movw r5, #0
movt r5, #(1 << 15)
rev r5, r5
str r5, [r2, #SCFG_CORE0_SFT_RST]
@ Wait target CPU up
timer_wait r2, RESET_WAIT
@ Disable CORE soft reset
mov r5, #0
str r5, [r0, #SCFG_CORESRENCR]
holdoff_release:
@ Release on target CPU
ldr r2, [r4, #DCFG_CCSR_BRR]
mov r6, #1
lsl r6, r6, r1 @ 32 bytes per CPU
rev r6, r6
orr r2, r2, r6
str r2, [r4, #DCFG_CCSR_BRR]
@ Set secondary boot entry
ldr r6, =psci_cpu_entry
rev r6, r6
str r6, [r4, #DCFG_CCSR_SCRATCHRW1]
isb
dsb
@ Return
mov r0, #ARM_PSCI_RET_SUCCESS
pop {lr}
bx lr
.globl psci_cpu_off
psci_cpu_off:
bl psci_cpu_off_common
1: wfi
b 1b
.globl psci_arch_init
psci_arch_init:
mov r6, lr
bl psci_get_cpu_id
bl psci_get_cpu_stack_top
mov sp, r0
bx r6
.globl psci_text_end
psci_text_end:
.popsection
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
#include <config.h> #include <config.h>
#include <asm/arch-armv7/generictimer.h>
#include <asm/gic.h> #include <asm/gic.h>
#include <asm/macro.h> #include <asm/macro.h>
#include <asm/psci.h> #include <asm/psci.h>
...@@ -43,26 +45,6 @@ ...@@ -43,26 +45,6 @@
#define GICD_BASE 0x1c81000 #define GICD_BASE 0x1c81000
#define GICC_BASE 0x1c82000 #define GICC_BASE 0x1c82000
.macro timer_wait reg, ticks
@ Program CNTP_TVAL
movw \reg, #(\ticks & 0xffff)
movt \reg, #(\ticks >> 16)
mcr p15, 0, \reg, c14, c2, 0
isb
@ Enable physical timer, mask interrupt
mov \reg, #3
mcr p15, 0, \reg, c14, c2, 1
@ Poll physical timer until ISTATUS is on
1: isb
mrc p15, 0, \reg, c14, c2, 1
ands \reg, \reg, #4
bne 1b
@ Disable timer
mov \reg, #0
mcr p15, 0, \reg, c14, c2, 1
isb
.endm
.globl psci_fiq_enter .globl psci_fiq_enter
psci_fiq_enter: psci_fiq_enter:
push {r0-r12} push {r0-r12}
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
#include <config.h> #include <config.h>
#include <asm/arch-armv7/generictimer.h>
#include <asm/gic.h> #include <asm/gic.h>
#include <asm/macro.h> #include <asm/macro.h>
#include <asm/psci.h> #include <asm/psci.h>
...@@ -43,26 +45,6 @@ ...@@ -43,26 +45,6 @@
#define GICD_BASE 0x1c81000 #define GICD_BASE 0x1c81000
#define GICC_BASE 0x1c82000 #define GICC_BASE 0x1c82000
.macro timer_wait reg, ticks
@ Program CNTP_TVAL
movw \reg, #(\ticks & 0xffff)
movt \reg, #(\ticks >> 16)
mcr p15, 0, \reg, c14, c2, 0
isb
@ Enable physical timer, mask interrupt
mov \reg, #3
mcr p15, 0, \reg, c14, c2, 1
@ Poll physical timer until ISTATUS is on
1: isb
mrc p15, 0, \reg, c14, c2, 1
ands \reg, \reg, #4
bne 1b
@ Disable timer
mov \reg, #0
mcr p15, 0, \reg, c14, c2, 1
isb
.endm
.globl psci_fiq_enter .globl psci_fiq_enter
psci_fiq_enter: psci_fiq_enter:
push {r0-r12} push {r0-r12}
......
...@@ -9,6 +9,31 @@ Freescale LayerScape with Chassis Generation 3 ...@@ -9,6 +9,31 @@ Freescale LayerScape with Chassis Generation 3
This architecture supports Freescale ARMv8 SoCs with Chassis generation 3, This architecture supports Freescale ARMv8 SoCs with Chassis generation 3,
for example LS2085A. for example LS2085A.
DDR Layout
============
Entire DDR region splits into two regions.
- Region 1 is at address 0x8000_0000 to 0xffff_ffff.
- Region 2 is at 0x80_8000_0000 to the top of total memory,
for example 16GB, 0x83_ffff_ffff.
All DDR memory is marked as cache-enabled.
When MC and Debug server is enabled, they carve 512MB away from the high
end of DDR. For example, if the total DDR is 16GB, it shrinks to 15.5GB
with MC and Debug server enabled. Linux only sees 15.5GB.
The reserved 512MB layout looks like
+---------------+ <-- top/end of memory
| 256MB | debug server
+---------------+
| 256MB | MC
+---------------+
| ... |
MC requires the memory to be aligned with 512MB, so even debug server is
not enabled, 512MB is reserved, not 256MB.
Flash Layout Flash Layout
============ ============
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/armv8/mmu.h> #include <asm/armv8/mmu.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/arch-fsl-lsch3/soc.h>
#include <asm/arch-fsl-lsch3/immap_lsch3.h> #include <asm/arch-fsl-lsch3/immap_lsch3.h>
#include <fsl_debug_server.h> #include <fsl_debug_server.h>
#include <fsl-mc/fsl_mc.h> #include <fsl-mc/fsl_mc.h>
...@@ -22,6 +23,35 @@ ...@@ -22,6 +23,35 @@
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
static struct cpu_type cpu_type_list[] = {
#ifdef CONFIG_LS2085A
CPU_TYPE_ENTRY(LS2085, LS2085, 8),
CPU_TYPE_ENTRY(LS2080, LS2080, 8),
CPU_TYPE_ENTRY(LS2045, LS2045, 4),
#endif
};
void cpu_name(char *name)
{
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
unsigned int i, svr, ver;
svr = in_le32(&gur->svr);
ver = SVR_SOC_VER(svr);
for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++)
if ((cpu_type_list[i].soc_ver & SVR_WO_E) == ver) {
strcpy(name, cpu_type_list[i].name);
if (IS_E_PROCESSOR(svr))
strcat(name, "E");
break;
}
if (i == ARRAY_SIZE(cpu_type_list))
strcpy(name, "unknown");
}
#ifndef CONFIG_SYS_DCACHE_OFF #ifndef CONFIG_SYS_DCACHE_OFF
/* /*
* To start MMU before DDR is available, we create MMU table in SRAM. * To start MMU before DDR is available, we create MMU table in SRAM.
...@@ -52,6 +82,12 @@ DECLARE_GLOBAL_DATA_PTR; ...@@ -52,6 +82,12 @@ DECLARE_GLOBAL_DATA_PTR;
TCR_ORGN_NC | \ TCR_ORGN_NC | \
TCR_IRGN_NC | \ TCR_IRGN_NC | \
TCR_T0SZ(LSCH3_VA_BITS)) TCR_T0SZ(LSCH3_VA_BITS))
#define LSCH3_TCR_FINAL (TCR_TG0_4K | \
TCR_EL2_PS_40BIT | \
TCR_SHARED_OUTER | \
TCR_ORGN_WBWA | \
TCR_IRGN_WBWA | \
TCR_T0SZ(LSCH3_VA_BITS))
/* /*
* Final MMU * Final MMU
...@@ -236,21 +272,8 @@ static inline void final_mmu_setup(void) ...@@ -236,21 +272,8 @@ static inline void final_mmu_setup(void)
/* point TTBR to the new table */ /* point TTBR to the new table */
el = current_el(); el = current_el();
asm volatile("dsb sy"); set_ttbr_tcr_mair(el, (u64)level0_table, LSCH3_TCR_FINAL,
if (el == 1) { MEMORY_ATTRIBUTES);
asm volatile("msr ttbr0_el1, %0"
: : "r" ((u64)level0_table) : "memory");
} else if (el == 2) {
asm volatile("msr ttbr0_el2, %0"
: : "r" ((u64)level0_table) : "memory");
} else if (el == 3) {
asm volatile("msr ttbr0_el3, %0"
: : "r" ((u64)level0_table) : "memory");
} else {
hang();
}
asm volatile("isb");
/* /*
* MMU is already enabled, just need to invalidate TLB to load the * MMU is already enabled, just need to invalidate TLB to load the
* new table. The new table is compatible with the current table, if * new table. The new table is compatible with the current table, if
...@@ -380,6 +403,13 @@ int print_cpuinfo(void) ...@@ -380,6 +403,13 @@ int print_cpuinfo(void)
unsigned int i, core; unsigned int i, core;
u32 type; u32 type;
puts("SoC: ");
cpu_name(buf);
printf(" %s (0x%x)\n", buf, in_le32(&gur->svr));
memset((u8 *)buf, 0x00, ARRAY_SIZE(buf));
get_sys_info(&sysinfo); get_sys_info(&sysinfo);
puts("Clock Configuration:"); puts("Clock Configuration:");
for_each_cpu(i, core, cpu_numcores(), cpu_mask()) { for_each_cpu(i, core, cpu_numcores(), cpu_mask()) {
...@@ -394,8 +424,8 @@ int print_cpuinfo(void) ...@@ -394,8 +424,8 @@ int print_cpuinfo(void)
} }
printf("\n Bus: %-4s MHz ", printf("\n Bus: %-4s MHz ",
strmhz(buf, sysinfo.freq_systembus)); strmhz(buf, sysinfo.freq_systembus));
printf("DDR: %-4s MHz", strmhz(buf, sysinfo.freq_ddrbus)); printf("DDR: %-4s MT/s", strmhz(buf, sysinfo.freq_ddrbus));
printf(" DP-DDR: %-4s MHz", strmhz(buf, sysinfo.freq_ddrbus2)); printf(" DP-DDR: %-4s MT/s", strmhz(buf, sysinfo.freq_ddrbus2));
puts("\n"); puts("\n");
/* Display the RCW, so that no one gets confused as to what RCW /* Display the RCW, so that no one gets confused as to what RCW
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <common.h> #include <common.h>
#include <libfdt.h> #include <libfdt.h>
#include <fdt_support.h> #include <fdt_support.h>
#include <asm/arch-fsl-lsch3/fdt.h>
#ifdef CONFIG_FSL_ESDHC #ifdef CONFIG_FSL_ESDHC
#include <fsl_esdhc.h> #include <fsl_esdhc.h>
#endif #endif
...@@ -58,6 +59,113 @@ void ft_fixup_cpu(void *blob) ...@@ -58,6 +59,113 @@ void ft_fixup_cpu(void *blob)
} }
#endif #endif
/*
* the burden is on the the caller to not request a count
* exceeding the bounds of the stream_ids[] array
*/
void alloc_stream_ids(int start_id, int count, u32 *stream_ids, int max_cnt)
{
int i;
if (count > max_cnt) {
printf("\n%s: ERROR: max per-device stream ID count exceed\n",
__func__);
return;
}
for (i = 0; i < count; i++)
stream_ids[i] = start_id++;
}
/*
* This function updates the mmu-masters property on the SMMU
* node as per the SMMU binding-- phandle and list of stream IDs
* for each MMU master.
*/
void append_mmu_masters(void *blob, const char *smmu_path,
const char *master_name, u32 *stream_ids, int count)
{
u32 phandle;
int smmu_nodeoffset;
int master_nodeoffset;
int i;
/* get phandle of mmu master device */
master_nodeoffset = fdt_path_offset(blob, master_name);
if (master_nodeoffset < 0) {
printf("\n%s: ERROR: master not found\n", __func__);
return;
}
phandle = fdt_get_phandle(blob, master_nodeoffset);
if (!phandle) { /* if master has no phandle, create one */
phandle = fdt_create_phandle(blob, master_nodeoffset);
if (!phandle) {
printf("\n%s: ERROR: unable to create phandle\n",
__func__);
return;
}
}
/* append it to mmu-masters */
smmu_nodeoffset = fdt_path_offset(blob, smmu_path);
if (fdt_appendprop_u32(blob, smmu_nodeoffset, "mmu-masters",
phandle) < 0) {
printf("\n%s: ERROR: unable to update SMMU node\n", __func__);
return;
}
/* for each stream ID, append to mmu-masters */
for (i = 0; i < count; i++) {
fdt_appendprop_u32(blob, smmu_nodeoffset, "mmu-masters",
stream_ids[i]);
}
/* fix up #stream-id-cells with stream ID count */
if (fdt_setprop_u32(blob, master_nodeoffset, "#stream-id-cells",
count) < 0)
printf("\n%s: ERROR: unable to update #stream-id-cells\n",
__func__);
}
/*
* The info below summarizes how streamID partitioning works
* for ls2085a and how it is conveyed to the OS via the device tree.
*
* -non-PCI legacy, platform devices (USB, SD/MMC, SATA, DMA)
* -all legacy devices get a unique ICID assigned and programmed in
* their AMQR registers by u-boot
* -u-boot updates the hardware device tree with streamID properties
* for each platform/legacy device (smmu-masters property)
*
* -PCIe
* -for each PCI controller that is active (as per RCW settings),
* u-boot will allocate a range of ICID and convey that to Linux via
* the device tree (smmu-masters property)
*
* -DPAA2
* -u-boot will allocate a range of ICIDs to be used by the Management
* Complex for containers and will set these values in the MC DPC image.
* -the MC is responsible for allocating and setting up ICIDs
* for all DPAA2 devices.
*
*/
static void fdt_fixup_smmu(void *blob)
{
int nodeoffset;
nodeoffset = fdt_path_offset(blob, "/iommu@5000000");
if (nodeoffset < 0) {
printf("\n%s: WARNING: no SMMU node found\n", __func__);
return;
}
/* fixup for all PCI controllers */
#ifdef CONFIG_PCI
fdt_fixup_smmu_pcie(blob);
#endif
}
void ft_cpu_setup(void *blob, bd_t *bd) void ft_cpu_setup(void *blob, bd_t *bd)
{ {
#ifdef CONFIG_MP #ifdef CONFIG_MP
...@@ -69,7 +177,13 @@ void ft_cpu_setup(void *blob, bd_t *bd) ...@@ -69,7 +177,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
"clock-frequency", CONFIG_SYS_NS16550_CLK, 1); "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
#endif #endif
#ifdef CONFIG_PCI
ft_pci_setup(blob, bd);
#endif
#if defined(CONFIG_FSL_ESDHC) #if defined(CONFIG_FSL_ESDHC)
fdt_fixup_esdhc(blob, bd); fdt_fixup_esdhc(blob, bd);
#endif #endif
fdt_fixup_smmu(blob);
} }
...@@ -180,6 +180,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk) ...@@ -180,6 +180,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
switch (clk) { switch (clk) {
case MXC_I2C_CLK: case MXC_I2C_CLK:
return get_bus_freq(0) / 2; return get_bus_freq(0) / 2;
case MXC_DSPI_CLK:
return get_bus_freq(0) / 2;
default: default:
printf("Unsupported clock\n"); printf("Unsupported clock\n");
} }
......
...@@ -115,18 +115,18 @@ apply_a57_core_errata: ...@@ -115,18 +115,18 @@ apply_a57_core_errata:
#ifdef CONFIG_ARM_ERRATA_828024 #ifdef CONFIG_ARM_ERRATA_828024
mrs x0, S3_1_c15_c2_0 /* cpuactlr_el1 */ mrs x0, S3_1_c15_c2_0 /* cpuactlr_el1 */
/* Disable non-allocate hint of w-b-n-a memory type */ /* Disable non-allocate hint of w-b-n-a memory type */
mov x0, #0x1 << 49 orr x0, x0, #1 << 49
/* Disable write streaming no L1-allocate threshold */ /* Disable write streaming no L1-allocate threshold */
mov x0, #0x3 << 25 orr x0, x0, #3 << 25
/* Disable write streaming no-allocate threshold */ /* Disable write streaming no-allocate threshold */
mov x0, #0x3 << 27 orr x0, x0, #3 << 27
msr S3_1_c15_c2_0, x0 /* cpuactlr_el1 */ msr S3_1_c15_c2_0, x0 /* cpuactlr_el1 */
#endif #endif
#ifdef CONFIG_ARM_ERRATA_826974 #ifdef CONFIG_ARM_ERRATA_826974
mrs x0, S3_1_c15_c2_0 /* cpuactlr_el1 */ mrs x0, S3_1_c15_c2_0 /* cpuactlr_el1 */
/* Disable speculative load execution ahead of a DMB */ /* Disable speculative load execution ahead of a DMB */
mov x0, #0x1 << 59 orr x0, x0, #1 << 59
msr S3_1_c15_c2_0, x0 /* cpuactlr_el1 */ msr S3_1_c15_c2_0, x0 /* cpuactlr_el1 */
#endif #endif
......
...@@ -57,6 +57,8 @@ dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb ...@@ -57,6 +57,8 @@ dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
ls1021a-twr.dtb ls1021a-twr.dtb
dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2085a-qds.dtb \
fsl-ls2085a-rdb.dtb
dtb-$(CONFIG_MACH_SUN4I) += \ dtb-$(CONFIG_MACH_SUN4I) += \
sun4i-a10-a1000.dtb \ sun4i-a10-a1000.dtb \
......
/*
* Freescale ls2085a QDS board device tree source
*
* Copyright 2013-2015 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
/dts-v1/;
#include "fsl-ls2085a.dtsi"
/ {
model = "Freescale Layerscape 2085a QDS Board";
compatible = "fsl,ls2085a-qds", "fsl,ls2085a";
aliases {
spi1 = &dspi;
};
};
&dspi {
bus-num = <0>;
status = "okay";
dflash0: n25q128a {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-flash";
spi-max-frequency = <3000000>;
spi-cpol;
spi-cpha;
reg = <0>;
};
dflash1: sst25wf040b {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-flash";
spi-max-frequency = <3000000>;
spi-cpol;
spi-cpha;
reg = <1>;
};
dflash2: en25s64 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-flash";
spi-max-frequency = <3000000>;
spi-cpol;
spi-cpha;
reg = <2>;
};
};
/*
* Freescale ls2085a RDB board device tree source
*
* Copyright 2013-2015 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
/dts-v1/;
#include "fsl-ls2085a.dtsi"
/ {
model = "Freescale Layerscape 2085a RDB Board";
compatible = "fsl,ls2085a-rdb", "fsl,ls2085a";
aliases {
spi1 = &dspi;
};
};
&dspi {
bus-num = <0>;
status = "okay";
dflash0: n25q512a {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-flash";
spi-max-frequency = <3000000>;
spi-cpol;
spi-cpha;
reg = <0>;
};
};
/*
* Freescale ls2085a SOC common device tree source
*
* Copyright 2013-2015 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
/ {
compatible = "fsl,ls2085a";
interrupt-parent = <&gic>;
#address-cells = <2>;
#size-cells = <2>;
cpus {
#address-cells = <2>;
#size-cells = <0>;
/*
* We expect the enable-method for cpu's to be "psci", but this
* is dependent on the SoC FW, which will fill this in.
*
* Currently supported enable-method is psci v0.2
*/
/* We have 4 clusters having 2 Cortex-A57 cores each */
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x1>;
};
cpu@100 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x100>;
};
cpu@101 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x101>;
};
cpu@200 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x200>;
};
cpu@201 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x201>;
};
cpu@300 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x300>;
};
cpu@301 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0 0x301>;
};
};
memory@80000000 {
device_type = "memory";
reg = <0x00000000 0x80000000 0 0x80000000>;
/* DRAM space - 1, size : 2 GB DRAM */
};
gic: interrupt-controller@6000000 {
compatible = "arm,gic-v3";
reg = <0x0 0x06000000 0 0x10000>, /* GIC Dist */
<0x0 0x06100000 0 0x100000>; /* GICR (RD_base + SGI_base) */
#interrupt-cells = <3>;
interrupt-controller;
interrupts = <1 9 0x4>;
};
timer {
compatible = "arm,armv8-timer";
interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */
<1 14 0x8>, /* Physical Non-Secure PPI, active-low */
<1 11 0x8>, /* Virtual PPI, active-low */
<1 10 0x8>; /* Hypervisor PPI, active-low */
};
serial0: serial@21c0500 {
device_type = "serial";
compatible = "fsl,ns16550", "ns16550a";
reg = <0x0 0x21c0500 0x0 0x100>;
clock-frequency = <0>; /* Updated by bootloader */
interrupts = <0 32 0x1>; /* edge triggered */
};
serial1: serial@21c0600 {
device_type = "serial";
compatible = "fsl,ns16550", "ns16550a";
reg = <0x0 0x21c0600 0x0 0x100>;
clock-frequency = <0>; /* Updated by bootloader */
interrupts = <0 32 0x1>; /* edge triggered */
};
fsl_mc: fsl-mc@80c000000 {
compatible = "fsl,qoriq-mc";
reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */
<0x00000000 0x08340000 0 0x40000>; /* MC control reg */
};
dspi: dspi@2100000 {
compatible = "fsl,vf610-dspi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x0 0x2100000 0x0 0x10000>;
interrupts = <0 26 0x4>; /* Level high type */
num-cs = <6>;
};
};
/*
* Copyright (C) 2013 - ARM Ltd
* Author: Marc Zyngier <marc.zyngier@arm.com>
*
* Based on code by Carl van Schaik <carl@ok-labs.com>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GENERICTIMER_H_
#define _GENERICTIMER_H_
#ifdef __ASSEMBLY__
/*
* This macro provide a physical timer that can be used for delay in the code.
* The macro is moved from sunxi/psci_sun7i.S
*
* reg: is used in this macro.
* ticks: The freq is based on generic timer.
*/
.macro timer_wait reg, ticks
movw \reg, #(\ticks & 0xffff)
movt \reg, #(\ticks >> 16)
mcr p15, 0, \reg, c14, c2, 0
isb
mov \reg, #3
mcr p15, 0, \reg, c14, c2, 1
1 : isb
mrc p15, 0, \reg, c14, c2, 1
ands \reg, \reg, #4
bne 1b
mov \reg, #0
mcr p15, 0, \reg, c14, c2, 1
isb
.endm
#endif /* __ASSEMBLY__ */
#endif /* _GENERICTIMER_H_ */
...@@ -16,6 +16,7 @@ enum mxc_clock { ...@@ -16,6 +16,7 @@ enum mxc_clock {
MXC_UART_CLK, MXC_UART_CLK,
MXC_ESDHC_CLK, MXC_ESDHC_CLK,
MXC_I2C_CLK, MXC_I2C_CLK,
MXC_DSPI_CLK,
}; };
unsigned int mxc_get_clock(enum mxc_clock clk); unsigned int mxc_get_clock(enum mxc_clock clk);
......
...@@ -137,6 +137,8 @@ ...@@ -137,6 +137,8 @@
#define DCFG_PORSR1 0x000 #define DCFG_PORSR1 0x000
#define DCFG_PORSR1_RCW_SRC 0xff800000 #define DCFG_PORSR1_RCW_SRC 0xff800000
#define DCFG_PORSR1_RCW_SRC_NOR 0x12f00000 #define DCFG_PORSR1_RCW_SRC_NOR 0x12f00000
#define DCFG_RCWSR13 0x130
#define DCFG_RCWSR13_DSPI (0 << 8)
#define DCFG_DCSR_BASE 0X700100000ULL #define DCFG_DCSR_BASE 0X700100000ULL
#define DCFG_DCSR_PORCR1 0x000 #define DCFG_DCSR_PORCR1 0x000
......
/*
* Copyright 2015 Freescale Semiconductor
*
* SPDX-License-Identifier: GPL-2.0+
*/
void alloc_stream_ids(int start_id, int count, u32 *stream_ids, int max_cnt);
void append_mmu_masters(void *blob, const char *smmu_path,
const char *master_name, u32 *stream_ids, int count);
void fdt_fixup_smmu_pcie(void *blob);
/*
* Copyright 2014 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*
*/
#ifndef __FSL_STREAM_ID_H
#define __FSL_STREAM_ID_H
/* Stream IDs on ls2085a devices are not hardwired and are
* programmed by sw. There are a limited number of stream IDs
* available, and the partitioning of them is scenario dependent.
* This header defines the partitioning between legacy, PCI,
* and DPAA2 devices.
*
* This partitiong can be customized in this file depending
* on the specific hardware config-- e.g. perhaps not all
* PEX controllers are in use.
*
* On LS2085 stream IDs are programmed in AMQ registers (32-bits) for
* each of the different bus masters. The relationship between
* the AMQ registers and stream IDs is defined in the table below:
* AMQ bit streamID bit
* ---------------------------
* PL[18] 9
* BMT[17] 8
* VA[16] 7
* [15] -
* ICID[14:7] -
* ICID[6:0] 6-0
* ----------------------------
*/
#define AMQ_PL_MASK (0x1 << 18) /* priviledge bit */
#define AMQ_BMT_MASK (0x1 << 17) /* bypass bit */
#define FSL_INVALID_STREAM_ID 0
#define FSL_BYPASS_AMQ (AMQ_PL_MASK | AMQ_BMT_MASK)
/* legacy devices */
#define FSL_USB1_STREAM_ID 1
#define FSL_USB2_STREAM_ID 2
#define FSL_SDMMC_STREAM_ID 3
#define FSL_SATA1_STREAM_ID 4
#define FSL_SATA2_STREAM_ID 5
#define FSL_DMA_STREAM_ID 6
/* PCI - programmed in PEXn_LUT by OS */
/* 4 IDs per controller */
#define FSL_PEX1_STREAM_ID_START 7
#define FSL_PEX1_STREAM_ID_END 10
#define FSL_PEX2_STREAM_ID_START 11
#define FSL_PEX2_STREAM_ID_END 14
#define FSL_PEX3_STREAM_ID_START 15
#define FSL_PEX3_STREAM_ID_END 18
#define FSL_PEX4_STREAM_ID_START 19
#define FSL_PEX4_STREAM_ID_END 22
/* DPAA2 - set in MC DPC and alloced by MC */
#define FSL_DPAA2_STREAM_ID_START 23
#define FSL_DPAA2_STREAM_ID_END 63
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment