Skip to content

Commit de49019

Browse files
committed
arm: mm: Add support for PJ4B cpu and init routines
PJ4B is an implementation of the ARMv7 (such as the Cortex A9 for example) released by Marvell. This CPU is currently found in Armada 370 and Armada XP SoCs. This patch provides a support for the specific initialization of this CPU. Signed-off-by: Yehuda Yitschak <yehuday@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Reviewed-by: Will Deacon <will.deacon@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 344e873 commit de49019

3 files changed

Lines changed: 72 additions & 1 deletion

File tree

‎arch/arm/mach-mvebu/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ menu "Marvell SOC with device tree"
2121
config MACH_ARMADA_370_XP
2222
bool
2323
select ARMADA_370_XP_TIMER
24-
select CPU_V7
24+
select CPU_PJ4B
2525

2626
config MACH_ARMADA_370
2727
bool "Marvell Armada 370 boards"

‎arch/arm/mm/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ config CPU_PJ4
352352
select ARM_THUMBEE
353353
select CPU_V7
354354

355+
config CPU_PJ4B
356+
bool
357+
select CPU_V7
358+
355359
# ARMv6
356360
config CPU_V6
357361
bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX

‎arch/arm/mm/proc-v7.S‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,63 @@ __v7_ca15mp_setup:
169169
orreq r0, r0, r10 @ Enable CPU-specific SMP bits
170170
mcreq p15, 0, r0, c1, c0, 1
171171
#endif
172+
173+
__v7_pj4b_setup:
174+
#ifdef CONFIG_CPU_PJ4B
175+
176+
/* Auxiliary Debug Modes Control 1 Register */
177+
#define PJ4B_STATIC_BP (1 << 2) /* Enable Static BP */
178+
#define PJ4B_INTER_PARITY (1 << 8) /* Disable Internal Parity Handling */
179+
#define PJ4B_BCK_OFF_STREX (1 << 5) /* Enable the back off of STREX instr */
180+
#define PJ4B_CLEAN_LINE (1 << 16) /* Disable data transfer for clean line */
181+
182+
/* Auxiliary Debug Modes Control 2 Register */
183+
#define PJ4B_FAST_LDR (1 << 23) /* Disable fast LDR */
184+
#define PJ4B_SNOOP_DATA (1 << 25) /* Do not interleave write and snoop data */
185+
#define PJ4B_CWF (1 << 27) /* Disable Critical Word First feature */
186+
#define PJ4B_OUTSDNG_NC (1 << 29) /* Disable outstanding non cacheable rqst */
187+
#define PJ4B_L1_REP_RR (1 << 30) /* L1 replacement - Strict round robin */
188+
#define PJ4B_AUX_DBG_CTRL2 (PJ4B_SNOOP_DATA | PJ4B_CWF |\
189+
PJ4B_OUTSDNG_NC | PJ4B_L1_REP_RR)
190+
191+
/* Auxiliary Functional Modes Control Register 0 */
192+
#define PJ4B_SMP_CFB (1 << 1) /* Set SMP mode. Join the coherency fabric */
193+
#define PJ4B_L1_PAR_CHK (1 << 2) /* Support L1 parity checking */
194+
#define PJ4B_BROADCAST_CACHE (1 << 8) /* Broadcast Cache and TLB maintenance */
195+
196+
/* Auxiliary Debug Modes Control 0 Register */
197+
#define PJ4B_WFI_WFE (1 << 22) /* WFI/WFE - serve the DVM and back to idle */
198+
199+
/* Auxiliary Debug Modes Control 1 Register */
200+
mrc p15, 1, r0, c15, c1, 1
201+
orr r0, r0, #PJ4B_CLEAN_LINE
202+
orr r0, r0, #PJ4B_BCK_OFF_STREX
203+
orr r0, r0, #PJ4B_INTER_PARITY
204+
bic r0, r0, #PJ4B_STATIC_BP
205+
mcr p15, 1, r0, c15, c1, 1
206+
207+
/* Auxiliary Debug Modes Control 2 Register */
208+
mrc p15, 1, r0, c15, c1, 2
209+
bic r0, r0, #PJ4B_FAST_LDR
210+
orr r0, r0, #PJ4B_AUX_DBG_CTRL2
211+
mcr p15, 1, r0, c15, c1, 2
212+
213+
/* Auxiliary Functional Modes Control Register 0 */
214+
mrc p15, 1, r0, c15, c2, 0
215+
#ifdef CONFIG_SMP
216+
orr r0, r0, #PJ4B_SMP_CFB
217+
#endif
218+
orr r0, r0, #PJ4B_L1_PAR_CHK
219+
orr r0, r0, #PJ4B_BROADCAST_CACHE
220+
mcr p15, 1, r0, c15, c2, 0
221+
222+
/* Auxiliary Debug Modes Control 0 Register */
223+
mrc p15, 1, r0, c15, c1, 0
224+
orr r0, r0, #PJ4B_WFI_WFE
225+
mcr p15, 1, r0, c15, c1, 0
226+
227+
#endif /* CONFIG_CPU_PJ4B */
228+
172229
__v7_setup:
173230
adr r12, __v7_setup_stack @ the local stack
174231
stmia r12, {r0-r5, r7, r9, r11, lr}
@@ -342,6 +399,16 @@ __v7_ca9mp_proc_info:
342399
.long 0xff0ffff0
343400
__v7_proc __v7_ca9mp_setup
344401
.size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info
402+
403+
/*
404+
* Marvell PJ4B processor.
405+
*/
406+
.type __v7_pj4b_proc_info, #object
407+
__v7_pj4b_proc_info:
408+
.long 0x562f5840
409+
.long 0xfffffff0
410+
__v7_proc __v7_pj4b_setup
411+
.size __v7_pj4b_proc_info, . - __v7_pj4b_proc_info
345412
#endif /* CONFIG_ARM_LPAE */
346413

347414
/*

0 commit comments

Comments
 (0)