xref: /rk3399_ARM-atf/drivers/marvell/mochi/ap807_setup.c (revision 11e6ed094d742d66f2b37ea2c44faf903cbca945)
1031542fcSKonstantin Porotchkin /*
2031542fcSKonstantin Porotchkin  * Copyright (C) 2018 Marvell International Ltd.
3031542fcSKonstantin Porotchkin  *
4031542fcSKonstantin Porotchkin  * SPDX-License-Identifier:	BSD-3-Clause
5031542fcSKonstantin Porotchkin  * https://spdx.org/licenses
6031542fcSKonstantin Porotchkin  */
7031542fcSKonstantin Porotchkin 
8031542fcSKonstantin Porotchkin /* AP807 Marvell SoC driver */
9031542fcSKonstantin Porotchkin 
1009d40e0eSAntonio Nino Diaz #include <common/debug.h>
1109d40e0eSAntonio Nino Diaz #include <drivers/marvell/cache_llc.h>
1209d40e0eSAntonio Nino Diaz #include <drivers/marvell/ccu.h>
1309d40e0eSAntonio Nino Diaz #include <drivers/marvell/io_win.h>
14c3c51b32SGrzegorz Jaszczyk #include <drivers/marvell/iob.h>
1509d40e0eSAntonio Nino Diaz #include <drivers/marvell/mci.h>
1609d40e0eSAntonio Nino Diaz #include <drivers/marvell/mochi/ap_setup.h>
1709d40e0eSAntonio Nino Diaz #include <lib/mmio.h>
1809d40e0eSAntonio Nino Diaz 
19031542fcSKonstantin Porotchkin #include <mvebu_def.h>
20031542fcSKonstantin Porotchkin 
21031542fcSKonstantin Porotchkin #define SMMU_sACR				(MVEBU_SMMU_BASE + 0x10)
22031542fcSKonstantin Porotchkin #define SMMU_sACR_PG_64K			(1 << 16)
23031542fcSKonstantin Porotchkin 
24031542fcSKonstantin Porotchkin #define CCU_GSPMU_CR				(MVEBU_CCU_BASE(MVEBU_AP0) \
25031542fcSKonstantin Porotchkin 								+ 0x3F0)
26031542fcSKonstantin Porotchkin #define GSPMU_CPU_CONTROL			(0x1 << 0)
27031542fcSKonstantin Porotchkin 
28031542fcSKonstantin Porotchkin #define CCU_HTC_CR				(MVEBU_CCU_BASE(MVEBU_AP0) \
29031542fcSKonstantin Porotchkin 								+ 0x200)
30031542fcSKonstantin Porotchkin #define CCU_SET_POC_OFFSET			5
31031542fcSKonstantin Porotchkin 
32031542fcSKonstantin Porotchkin #define DSS_CR0					(MVEBU_RFU_BASE + 0x100)
33031542fcSKonstantin Porotchkin #define DVM_48BIT_VA_ENABLE			(1 << 21)
34031542fcSKonstantin Porotchkin 
352da75ae1SGrzegorz Jaszczyk 
362da75ae1SGrzegorz Jaszczyk /* SoC RFU / IHBx4 Control */
372da75ae1SGrzegorz Jaszczyk #define MCIX4_807_REG_START_ADDR_REG(unit_id)	(MVEBU_RFU_BASE + \
382da75ae1SGrzegorz Jaszczyk 						0x4258 + (unit_id * 0x4))
392da75ae1SGrzegorz Jaszczyk 
40031542fcSKonstantin Porotchkin /* Secure MoChi incoming access */
41031542fcSKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_REG			(MVEBU_RFU_BASE + 0x4738)
42031542fcSKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_IHB0_EN		(1)
43031542fcSKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_IHB1_EN		(1 << 3)
44031542fcSKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_IHB2_EN		(1 << 6)
45031542fcSKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_PIDI_EN		(1 << 9)
46031542fcSKonstantin Porotchkin #define SEC_IN_ACCESS_ENA_ALL_MASTERS		(SEC_MOCHI_IN_ACC_IHB0_EN | \
47031542fcSKonstantin Porotchkin 						 SEC_MOCHI_IN_ACC_IHB1_EN | \
48031542fcSKonstantin Porotchkin 						 SEC_MOCHI_IN_ACC_IHB2_EN | \
49031542fcSKonstantin Porotchkin 						 SEC_MOCHI_IN_ACC_PIDI_EN)
50*11e6ed09SKonstantin Porotchkin #define MOCHI_IN_ACC_LEVEL_FORCE_NONSEC		(0)
51*11e6ed09SKonstantin Porotchkin #define MOCHI_IN_ACC_LEVEL_FORCE_SEC		(1)
52*11e6ed09SKonstantin Porotchkin #define MOCHI_IN_ACC_LEVEL_LEAVE_ORIG		(2)
53*11e6ed09SKonstantin Porotchkin #define MOCHI_IN_ACC_LEVEL_MASK_ALL		(3)
54*11e6ed09SKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_IHB0_LEVEL(l)		((l) << 1)
55*11e6ed09SKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_IHB1_LEVEL(l)		((l) << 4)
56*11e6ed09SKonstantin Porotchkin #define SEC_MOCHI_IN_ACC_PIDI_LEVEL(l)		((l) << 10)
57*11e6ed09SKonstantin Porotchkin 
58031542fcSKonstantin Porotchkin 
59031542fcSKonstantin Porotchkin /* SYSRST_OUTn Config definitions */
60031542fcSKonstantin Porotchkin #define MVEBU_SYSRST_OUT_CONFIG_REG		(MVEBU_MISC_SOC_BASE + 0x4)
61031542fcSKonstantin Porotchkin #define WD_MASK_SYS_RST_OUT			(1 << 2)
62031542fcSKonstantin Porotchkin 
63031542fcSKonstantin Porotchkin /* DSS PHY for DRAM */
64031542fcSKonstantin Porotchkin #define DSS_SCR_REG				(MVEBU_RFU_BASE + 0x208)
65031542fcSKonstantin Porotchkin #define DSS_PPROT_OFFS				4
66031542fcSKonstantin Porotchkin #define DSS_PPROT_MASK				0x7
67031542fcSKonstantin Porotchkin #define DSS_PPROT_PRIV_SECURE_DATA		0x1
68031542fcSKonstantin Porotchkin 
69031542fcSKonstantin Porotchkin /* Used for Units of AP-807 (e.g. SDIO and etc) */
70031542fcSKonstantin Porotchkin #define MVEBU_AXI_ATTR_BASE			(MVEBU_REGS_BASE + 0x6F4580)
71031542fcSKonstantin Porotchkin #define MVEBU_AXI_ATTR_REG(index)		(MVEBU_AXI_ATTR_BASE + \
72031542fcSKonstantin Porotchkin 							0x4 * index)
73031542fcSKonstantin Porotchkin 
74031542fcSKonstantin Porotchkin enum axi_attr {
75031542fcSKonstantin Porotchkin 	AXI_SDIO_ATTR = 0,
76031542fcSKonstantin Porotchkin 	AXI_DFX_ATTR,
77031542fcSKonstantin Porotchkin 	AXI_MAX_ATTR,
78031542fcSKonstantin Porotchkin };
79031542fcSKonstantin Porotchkin 
80031542fcSKonstantin Porotchkin static void ap_sec_masters_access_en(uint32_t enable)
81031542fcSKonstantin Porotchkin {
82031542fcSKonstantin Porotchkin 	/* Open/Close incoming access for all masters.
83031542fcSKonstantin Porotchkin 	 * The access is disabled in trusted boot mode
84031542fcSKonstantin Porotchkin 	 * Could only be done in EL3
85031542fcSKonstantin Porotchkin 	 */
86*11e6ed09SKonstantin Porotchkin 	if (enable != 0) {
87*11e6ed09SKonstantin Porotchkin 		mmio_clrsetbits_32(SEC_MOCHI_IN_ACC_REG, 0x0U, /* no clear */
88031542fcSKonstantin Porotchkin 				   SEC_IN_ACCESS_ENA_ALL_MASTERS);
89*11e6ed09SKonstantin Porotchkin #if LLC_SRAM
90*11e6ed09SKonstantin Porotchkin 		/* Do not change access security level
91*11e6ed09SKonstantin Porotchkin 		 * for PIDI masters
92*11e6ed09SKonstantin Porotchkin 		 */
93*11e6ed09SKonstantin Porotchkin 		mmio_clrsetbits_32(SEC_MOCHI_IN_ACC_REG,
94*11e6ed09SKonstantin Porotchkin 				   SEC_MOCHI_IN_ACC_PIDI_LEVEL(
95*11e6ed09SKonstantin Porotchkin 					  MOCHI_IN_ACC_LEVEL_MASK_ALL),
96*11e6ed09SKonstantin Porotchkin 				   SEC_MOCHI_IN_ACC_PIDI_LEVEL(
97*11e6ed09SKonstantin Porotchkin 					  MOCHI_IN_ACC_LEVEL_LEAVE_ORIG));
98*11e6ed09SKonstantin Porotchkin #endif
99*11e6ed09SKonstantin Porotchkin 	} else {
100*11e6ed09SKonstantin Porotchkin 		mmio_clrsetbits_32(SEC_MOCHI_IN_ACC_REG,
101*11e6ed09SKonstantin Porotchkin 				   SEC_IN_ACCESS_ENA_ALL_MASTERS,
102*11e6ed09SKonstantin Porotchkin 				   0x0U /* no set */);
103*11e6ed09SKonstantin Porotchkin #if LLC_SRAM
104*11e6ed09SKonstantin Porotchkin 		/* Return PIDI access level to the default */
105*11e6ed09SKonstantin Porotchkin 		mmio_clrsetbits_32(SEC_MOCHI_IN_ACC_REG,
106*11e6ed09SKonstantin Porotchkin 				   SEC_MOCHI_IN_ACC_PIDI_LEVEL(
107*11e6ed09SKonstantin Porotchkin 					  MOCHI_IN_ACC_LEVEL_MASK_ALL),
108*11e6ed09SKonstantin Porotchkin 				   SEC_MOCHI_IN_ACC_PIDI_LEVEL(
109*11e6ed09SKonstantin Porotchkin 					  MOCHI_IN_ACC_LEVEL_FORCE_NONSEC));
110*11e6ed09SKonstantin Porotchkin #endif
111*11e6ed09SKonstantin Porotchkin 	}
112031542fcSKonstantin Porotchkin }
113031542fcSKonstantin Porotchkin 
114031542fcSKonstantin Porotchkin static void setup_smmu(void)
115031542fcSKonstantin Porotchkin {
116031542fcSKonstantin Porotchkin 	uint32_t reg;
117031542fcSKonstantin Porotchkin 
118031542fcSKonstantin Porotchkin 	/* Set the SMMU page size to 64 KB */
119031542fcSKonstantin Porotchkin 	reg = mmio_read_32(SMMU_sACR);
120031542fcSKonstantin Porotchkin 	reg |= SMMU_sACR_PG_64K;
121031542fcSKonstantin Porotchkin 	mmio_write_32(SMMU_sACR, reg);
122031542fcSKonstantin Porotchkin }
123031542fcSKonstantin Porotchkin 
124031542fcSKonstantin Porotchkin static void init_aurora2(void)
125031542fcSKonstantin Porotchkin {
126031542fcSKonstantin Porotchkin 	uint32_t reg;
127031542fcSKonstantin Porotchkin 
128031542fcSKonstantin Porotchkin 	/* Enable GSPMU control by CPU */
129031542fcSKonstantin Porotchkin 	reg = mmio_read_32(CCU_GSPMU_CR);
130031542fcSKonstantin Porotchkin 	reg |= GSPMU_CPU_CONTROL;
131031542fcSKonstantin Porotchkin 	mmio_write_32(CCU_GSPMU_CR, reg);
132031542fcSKonstantin Porotchkin 
133031542fcSKonstantin Porotchkin #if LLC_ENABLE
134031542fcSKonstantin Porotchkin 	/* Enable LLC for AP807 in exclusive mode */
135031542fcSKonstantin Porotchkin 	llc_enable(0, 1);
136031542fcSKonstantin Porotchkin 
137031542fcSKonstantin Porotchkin 	/* Set point of coherency to DDR.
138031542fcSKonstantin Porotchkin 	 * This is required by units which have
139031542fcSKonstantin Porotchkin 	 * SW cache coherency
140031542fcSKonstantin Porotchkin 	 */
141031542fcSKonstantin Porotchkin 	reg = mmio_read_32(CCU_HTC_CR);
142031542fcSKonstantin Porotchkin 	reg |= (0x1 << CCU_SET_POC_OFFSET);
143031542fcSKonstantin Porotchkin 	mmio_write_32(CCU_HTC_CR, reg);
144031542fcSKonstantin Porotchkin #endif /* LLC_ENABLE */
1455e4c97d0SStefan Chulski 
1465e4c97d0SStefan Chulski 	errata_wa_init();
147031542fcSKonstantin Porotchkin }
148031542fcSKonstantin Porotchkin 
149031542fcSKonstantin Porotchkin 
150031542fcSKonstantin Porotchkin /* MCIx indirect access register are based by default at 0xf4000000/0xf6000000
151031542fcSKonstantin Porotchkin  * to avoid conflict of internal registers of units connected via MCIx, which
152031542fcSKonstantin Porotchkin  * can be based on the same address (i.e CP1 base is also 0xf4000000),
153031542fcSKonstantin Porotchkin  * the following routines remaps the MCIx indirect bases to another domain
154031542fcSKonstantin Porotchkin  */
155031542fcSKonstantin Porotchkin static void mci_remap_indirect_access_base(void)
156031542fcSKonstantin Porotchkin {
157031542fcSKonstantin Porotchkin 	uint32_t mci;
158031542fcSKonstantin Porotchkin 
159031542fcSKonstantin Porotchkin 	for (mci = 0; mci < MCI_MAX_UNIT_ID; mci++)
1602da75ae1SGrzegorz Jaszczyk 		mmio_write_32(MCIX4_807_REG_START_ADDR_REG(mci),
161031542fcSKonstantin Porotchkin 				  MVEBU_MCI_REG_BASE_REMAP(mci) >>
162031542fcSKonstantin Porotchkin 				  MCI_REMAP_OFF_SHIFT);
163031542fcSKonstantin Porotchkin }
164031542fcSKonstantin Porotchkin 
165031542fcSKonstantin Porotchkin static void ap807_axi_attr_init(void)
166031542fcSKonstantin Porotchkin {
167031542fcSKonstantin Porotchkin 	uint32_t index, data;
168031542fcSKonstantin Porotchkin 
169031542fcSKonstantin Porotchkin 	/* Initialize AXI attributes for AP807 */
170031542fcSKonstantin Porotchkin 	/* Go over the AXI attributes and set Ax-Cache and Ax-Domain */
171031542fcSKonstantin Porotchkin 	for (index = 0; index < AXI_MAX_ATTR; index++) {
172031542fcSKonstantin Porotchkin 		switch (index) {
173031542fcSKonstantin Porotchkin 		/* DFX works with no coherent only -
174031542fcSKonstantin Porotchkin 		 * there's no option to configure the Ax-Cache and Ax-Domain
175031542fcSKonstantin Porotchkin 		 */
176031542fcSKonstantin Porotchkin 		case AXI_DFX_ATTR:
177031542fcSKonstantin Porotchkin 			continue;
178031542fcSKonstantin Porotchkin 		default:
179031542fcSKonstantin Porotchkin 			/* Set Ax-Cache as cacheable, no allocate, modifiable,
180031542fcSKonstantin Porotchkin 			 * bufferable.
181031542fcSKonstantin Porotchkin 			 * The values are different because Read & Write
182031542fcSKonstantin Porotchkin 			 * definition is different in Ax-Cache
183031542fcSKonstantin Porotchkin 			 */
184031542fcSKonstantin Porotchkin 			data = mmio_read_32(MVEBU_AXI_ATTR_REG(index));
185031542fcSKonstantin Porotchkin 			data &= ~MVEBU_AXI_ATTR_ARCACHE_MASK;
186031542fcSKonstantin Porotchkin 			data |= (CACHE_ATTR_WRITE_ALLOC |
187031542fcSKonstantin Porotchkin 				 CACHE_ATTR_CACHEABLE   |
188031542fcSKonstantin Porotchkin 				 CACHE_ATTR_BUFFERABLE) <<
189031542fcSKonstantin Porotchkin 				 MVEBU_AXI_ATTR_ARCACHE_OFFSET;
190031542fcSKonstantin Porotchkin 			data &= ~MVEBU_AXI_ATTR_AWCACHE_MASK;
191031542fcSKonstantin Porotchkin 			data |= (CACHE_ATTR_READ_ALLOC |
192031542fcSKonstantin Porotchkin 				 CACHE_ATTR_CACHEABLE  |
193031542fcSKonstantin Porotchkin 				 CACHE_ATTR_BUFFERABLE) <<
194031542fcSKonstantin Porotchkin 				 MVEBU_AXI_ATTR_AWCACHE_OFFSET;
195031542fcSKonstantin Porotchkin 			/* Set Ax-Domain as Outer domain */
196031542fcSKonstantin Porotchkin 			data &= ~MVEBU_AXI_ATTR_ARDOMAIN_MASK;
197031542fcSKonstantin Porotchkin 			data |= DOMAIN_OUTER_SHAREABLE <<
198031542fcSKonstantin Porotchkin 				MVEBU_AXI_ATTR_ARDOMAIN_OFFSET;
199031542fcSKonstantin Porotchkin 			data &= ~MVEBU_AXI_ATTR_AWDOMAIN_MASK;
200031542fcSKonstantin Porotchkin 			data |= DOMAIN_OUTER_SHAREABLE <<
201031542fcSKonstantin Porotchkin 				MVEBU_AXI_ATTR_AWDOMAIN_OFFSET;
202031542fcSKonstantin Porotchkin 			mmio_write_32(MVEBU_AXI_ATTR_REG(index), data);
203031542fcSKonstantin Porotchkin 		}
204031542fcSKonstantin Porotchkin 	}
205031542fcSKonstantin Porotchkin }
206031542fcSKonstantin Porotchkin 
207031542fcSKonstantin Porotchkin static void misc_soc_configurations(void)
208031542fcSKonstantin Porotchkin {
209031542fcSKonstantin Porotchkin 	uint32_t reg;
210031542fcSKonstantin Porotchkin 
211031542fcSKonstantin Porotchkin 	/* Enable 48-bit VA */
212031542fcSKonstantin Porotchkin 	mmio_setbits_32(DSS_CR0, DVM_48BIT_VA_ENABLE);
213031542fcSKonstantin Porotchkin 
214031542fcSKonstantin Porotchkin 	/* Un-mask Watchdog reset from influencing the SYSRST_OUTn.
215031542fcSKonstantin Porotchkin 	 * Otherwise, upon WD timeout, the WD reset signal won't trigger reset
216031542fcSKonstantin Porotchkin 	 */
217031542fcSKonstantin Porotchkin 	reg = mmio_read_32(MVEBU_SYSRST_OUT_CONFIG_REG);
218031542fcSKonstantin Porotchkin 	reg &= ~(WD_MASK_SYS_RST_OUT);
219031542fcSKonstantin Porotchkin 	mmio_write_32(MVEBU_SYSRST_OUT_CONFIG_REG, reg);
220031542fcSKonstantin Porotchkin }
221031542fcSKonstantin Porotchkin 
222c3c51b32SGrzegorz Jaszczyk /*
223c3c51b32SGrzegorz Jaszczyk  * By default all external CPs start with configuration address space set to
224c3c51b32SGrzegorz Jaszczyk  * 0xf200_0000. To overcome this issue, go in the loop and initialize the
225c3c51b32SGrzegorz Jaszczyk  * CP one by one, using temporary window configuration which allows to access
226c3c51b32SGrzegorz Jaszczyk  * each CP and update its configuration space according to decoding
227c3c51b32SGrzegorz Jaszczyk  * windows scheme defined for each platform.
228c3c51b32SGrzegorz Jaszczyk  */
229c3c51b32SGrzegorz Jaszczyk void update_cp110_default_win(int cp_id)
230c3c51b32SGrzegorz Jaszczyk {
231c3c51b32SGrzegorz Jaszczyk 	int mci_id = cp_id - 1;
232c3c51b32SGrzegorz Jaszczyk 	uintptr_t cp110_base, cp110_temp_base;
233c3c51b32SGrzegorz Jaszczyk 
234c3c51b32SGrzegorz Jaszczyk 	/* CP110 default configuration address space */
235c3c51b32SGrzegorz Jaszczyk 	cp110_temp_base = MVEBU_AP_IO_BASE(MVEBU_AP0);
236c3c51b32SGrzegorz Jaszczyk 
237c3c51b32SGrzegorz Jaszczyk 	struct addr_map_win iowin_temp_win = {
238c3c51b32SGrzegorz Jaszczyk 		.base_addr = cp110_temp_base,
239c3c51b32SGrzegorz Jaszczyk 		.win_size = MVEBU_CP_OFFSET,
240c3c51b32SGrzegorz Jaszczyk 	};
241c3c51b32SGrzegorz Jaszczyk 
242c3c51b32SGrzegorz Jaszczyk 	iowin_temp_win.target_id = mci_id;
243c3c51b32SGrzegorz Jaszczyk 	iow_temp_win_insert(0, &iowin_temp_win, 1);
244c3c51b32SGrzegorz Jaszczyk 
245c3c51b32SGrzegorz Jaszczyk 	/* Calculate the new CP110 - base address */
246c3c51b32SGrzegorz Jaszczyk 	cp110_base = MVEBU_CP_REGS_BASE(cp_id);
247c3c51b32SGrzegorz Jaszczyk 	/* Go and update the CP110 configuration address space */
248c3c51b32SGrzegorz Jaszczyk 	iob_cfg_space_update(0, cp_id, cp110_temp_base, cp110_base);
249c3c51b32SGrzegorz Jaszczyk 
250c3c51b32SGrzegorz Jaszczyk 	/* Remove the temporary IO-WIN window */
251c3c51b32SGrzegorz Jaszczyk 	iow_temp_win_remove(0, &iowin_temp_win, 1);
252c3c51b32SGrzegorz Jaszczyk }
253c3c51b32SGrzegorz Jaszczyk 
254031542fcSKonstantin Porotchkin void ap_init(void)
255031542fcSKonstantin Porotchkin {
256031542fcSKonstantin Porotchkin 	/* Setup Aurora2. */
257031542fcSKonstantin Porotchkin 	init_aurora2();
258031542fcSKonstantin Porotchkin 
259031542fcSKonstantin Porotchkin 	/* configure MCI mapping */
260031542fcSKonstantin Porotchkin 	mci_remap_indirect_access_base();
261031542fcSKonstantin Porotchkin 
262031542fcSKonstantin Porotchkin 	/* configure IO_WIN windows */
263031542fcSKonstantin Porotchkin 	init_io_win(MVEBU_AP0);
264031542fcSKonstantin Porotchkin 
265031542fcSKonstantin Porotchkin 	/* configure CCU windows */
266031542fcSKonstantin Porotchkin 	init_ccu(MVEBU_AP0);
267031542fcSKonstantin Porotchkin 
268031542fcSKonstantin Porotchkin 	/* configure the SMMU */
269031542fcSKonstantin Porotchkin 	setup_smmu();
270031542fcSKonstantin Porotchkin 
271031542fcSKonstantin Porotchkin 	/* Open AP incoming access for all masters */
272031542fcSKonstantin Porotchkin 	ap_sec_masters_access_en(1);
273031542fcSKonstantin Porotchkin 
274031542fcSKonstantin Porotchkin 	/* configure axi for AP */
275031542fcSKonstantin Porotchkin 	ap807_axi_attr_init();
276031542fcSKonstantin Porotchkin 
277031542fcSKonstantin Porotchkin 	/* misc configuration of the SoC */
278031542fcSKonstantin Porotchkin 	misc_soc_configurations();
279031542fcSKonstantin Porotchkin }
280031542fcSKonstantin Porotchkin 
281031542fcSKonstantin Porotchkin static void ap807_dram_phy_access_config(void)
282031542fcSKonstantin Porotchkin {
283031542fcSKonstantin Porotchkin 	uint32_t reg_val;
284031542fcSKonstantin Porotchkin 	/* Update DSS port access permission to DSS_PHY */
285031542fcSKonstantin Porotchkin 	reg_val = mmio_read_32(DSS_SCR_REG);
286031542fcSKonstantin Porotchkin 	reg_val &= ~(DSS_PPROT_MASK << DSS_PPROT_OFFS);
287031542fcSKonstantin Porotchkin 	reg_val |= ((DSS_PPROT_PRIV_SECURE_DATA & DSS_PPROT_MASK) <<
288031542fcSKonstantin Porotchkin 		    DSS_PPROT_OFFS);
289031542fcSKonstantin Porotchkin 	mmio_write_32(DSS_SCR_REG, reg_val);
290031542fcSKonstantin Porotchkin }
291031542fcSKonstantin Porotchkin 
292031542fcSKonstantin Porotchkin void ap_ble_init(void)
293031542fcSKonstantin Porotchkin {
294031542fcSKonstantin Porotchkin 	/* Enable DSS port */
295031542fcSKonstantin Porotchkin 	ap807_dram_phy_access_config();
296031542fcSKonstantin Porotchkin }
297031542fcSKonstantin Porotchkin 
298031542fcSKonstantin Porotchkin int ap_get_count(void)
299031542fcSKonstantin Porotchkin {
300031542fcSKonstantin Porotchkin 	return 1;
301031542fcSKonstantin Porotchkin }
302031542fcSKonstantin Porotchkin 
303031542fcSKonstantin Porotchkin 
304