• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; SPDX-License-Identifier: GPL-2.0-only
2;
3;  Port on Texas Instruments TMS320C6x architecture
4;
5;  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
6;  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7;
8#include <linux/linkage.h>
9#include <linux/of_fdt.h>
10#include <asm/asm-offsets.h>
11
12	__HEAD
13ENTRY(_c_int00)
14	;; Save magic and pointer
15	MV	.S1	A4,A10
16	MV	.S2	B4,B10
17	MVKL	.S2	__bss_start,B5
18	MVKH	.S2	__bss_start,B5
19	MVKL	.S2	__bss_stop,B6
20	MVKH	.S2	__bss_stop,B6
21	SUB	.L2	B6,B5,B6 ; bss size
22
23	;; Set the stack pointer
24	MVKL	.S2	current_ksp,B0
25	MVKH	.S2	current_ksp,B0
26	LDW	.D2T2	*B0,B15
27
28	;; clear bss
29	SHR	.S2	B6,3,B0	  ; number of dwords to clear
30	ZERO	.L2	B13
31	ZERO	.L2	B12
32bss_loop:
33	BDEC	.S2	bss_loop,B0
34	NOP	3
35	CMPLT	.L2	B0,0,B1
36 [!B1]	STDW	.D2T2	B13:B12,*B5++[1]
37
38	NOP	4
39	AND	.D2	~7,B15,B15
40
41	;; Clear GIE and PGIE
42	MVC	.S2	CSR,B2
43	CLR	.S2	B2,0,1,B2
44	MVC	.S2	B2,CSR
45	MVC	.S2	TSR,B2
46	CLR	.S2	B2,0,1,B2
47	MVC	.S2	B2,TSR
48	MVC	.S2	ITSR,B2
49	CLR	.S2	B2,0,1,B2
50	MVC	.S2	B2,ITSR
51	MVC	.S2	NTSR,B2
52	CLR	.S2	B2,0,1,B2
53	MVC	.S2	B2,NTSR
54
55	;; pass DTB pointer to machine_init (or zero if none)
56	MVKL	.S1	OF_DT_HEADER,A0
57	MVKH	.S1	OF_DT_HEADER,A0
58	CMPEQ	.L1	A10,A0,A0
59  [A0]	MV	.S1X	B10,A4
60  [!A0] MVK	.S1	0,A4
61
62#ifdef CONFIG_C6X_BIG_KERNEL
63	MVKL	.S1	machine_init,A0
64	MVKH	.S1	machine_init,A0
65	B	.S2X	A0
66	ADDKPC  .S2     0f,B3,4
670:
68#else
69	CALLP	.S2	machine_init,B3
70#endif
71
72	;; Jump to Linux init
73#ifdef CONFIG_C6X_BIG_KERNEL
74	MVKL	.S1	start_kernel,A0
75	MVKH	.S1	start_kernel,A0
76	B	.S2X	A0
77#else
78	B	.S2	start_kernel
79#endif
80	NOP	5
81L1:	BNOP	.S2	L1,5
82