2 * Copyright 2014 Freescale Semiconductor
4 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/ns_access.h>
11 #include <asm/arch/fsl_serdes.h>
13 void set_devices_ns_access(unsigned long index, u16 val)
15 u32 *base = (u32 *)CONFIG_SYS_FSL_CSU_ADDR;
19 reg = base + index / 2;
32 static void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num)
36 for (i = 0; i < num; i++)
37 set_devices_ns_access(ns_dev[i].ind, ns_dev[i].val);
40 void enable_layerscape_ns_access(void)
43 if (current_el() == 3)
45 enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev));
48 void set_pcie_ns_access(int pcie, u16 val)
53 set_devices_ns_access(CSU_CSLX_PCIE1, val);
54 set_devices_ns_access(CSU_CSLX_PCIE1_IO, val);
59 set_devices_ns_access(CSU_CSLX_PCIE2, val);
60 set_devices_ns_access(CSU_CSLX_PCIE2_IO, val);
65 set_devices_ns_access(CSU_CSLX_PCIE3, val);
66 set_devices_ns_access(CSU_CSLX_PCIE3_IO, val);
70 debug("The PCIE%d doesn't exist!\n", pcie);