diff compal/j100-fw-disasm @ 286:dd8a9ebcd8b1

compal/j100-fw-disasm: GPIO init analysis
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 14 Mar 2019 22:40:18 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compal/j100-fw-disasm	Thu Mar 14 22:40:18 2019 +0000
@@ -0,0 +1,672 @@
+; This analysis corresponds to SE J100 fw version R1C004, published in
+; R1C004-se.bin inside the j100-flashimg-r1.zip FTP release.
+
+       0:	ea000225	b	0x89c
+       4:	ea000825	b	0x20a0
+       8:	ea000825	b	0x20a4
+       c:	ea000825	b	0x20a8
+      10:	ea000825	b	0x20ac
+      14:	ea000825	b	0x20b0
+      18:	ea000825	b	0x20b4
+      1c:	ea000825	b	0x20b8
+
+_INT_Bootloader_Start:
+; same as the Mot C139 version
+     89c:	e51f1020	ldr	r1, =0xfffffd00	; via 0x884
+     8a0:	e1d120b2	ldrh	r2, [r1, #2]
+     8a4:	e51f002c	ldr	r0, =0x40	; via 0x880
+     8a8:	e1800002	orr	r0, r0, r2
+     8ac:	e1c100b2	strh	r0, [r1, #2]
+     8b0:	e51f1030	ldr	r1, =0xffff9800	; via 0x888
+     8b4:	e15f22b6	ldrh	r2, =0x2006	; via 0x896
+     8b8:	e1c120b0	strh	r2, [r1]
+     8bc:	e5912000	ldr	r2, [r1]
+     8c0:	e2022001	and	r2, r2, #1
+     8c4:	e3520001	cmp	r2, #1
+     8c8:	0afffffb	beq	0x8bc
+     8cc:	e51f1050	ldr	r1, =0xfffffd00	; via 0x884
+     8d0:	e15f24b4	ldrh	r2, =0x1081	; via 0x894
+     8d4:	e1c120b0	strh	r2, [r1]
+     8d8:	e51f1054	ldr	r1, =0xfffffb10	; via 0x88c
+     8dc:	e15f24bc	ldrh	r2, =0x800	; via 0x898
+     8e0:	e1d100b0	ldrh	r0, [r1]
+     8e4:	e1800002	orr	r0, r0, r2
+     8e8:	e1c100b0	strh	r0, [r1]
+     8ec:	e51f1064	ldr	r1, =0xffffff08	; via 0x890
+     8f0:	e15f25be	ldrh	r2, =0x0	; via 0x89a
+     8f4:	e1c120b0	strh	r2, [r1]
+     8f8:	e51f1094	ldr	r1, =0xfffffb00	; via 0x86c
+     8fc:	e15f29b4	ldrh	r2, =0x2a1	; via 0x870
+     900:	e1c120b0	strh	r2, [r1]
+     904:	e15f29ba	ldrh	r2, =0x2a1	; via 0x872
+     908:	e1c120b2	strh	r2, [r1, #2]
+     90c:	e15f2ab0	ldrh	r2, =0x2a1	; via 0x874
+     910:	e1c120b4	strh	r2, [r1, #4]
+     914:	e15f2ab6	ldrh	r2, =0x283	; via 0x876
+     918:	e1c120b6	strh	r2, [r1, #6]
+     91c:	e15f2abc	ldrh	r2, =0x281	; via 0x878
+     920:	e1c120ba	strh	r2, [r1, #10]	; 0xa
+     924:	e15f2bb2	ldrh	r2, =0xc0	; via 0x87a
+     928:	e1c120bc	strh	r2, [r1, #12]	; 0xc
+     92c:	e15f2bb8	ldrh	r2, =0x40	; via 0x87c
+     930:	e1c120b8	strh	r2, [r1, #8]
+     934:	e15f2bbe	ldrh	r2, =0x2a	; via 0x87e
+     938:	e1c120be	strh	r2, [r1, #14]	; 0xe
+     93c:	e59f0020	ldr	r0, =0x83aca4	; via 0x964
+     940:	e3a01b01	mov	r1, #1024	; 0x400
+     944:	e2411004	sub	r1, r1, #4
+     948:	e0802001	add	r2, r0, r1
+     94c:	e3c22003	bic	r2, r2, #3
+     950:	e1a0d002	mov	sp, r2
+     954:	e92d100f	stmdb	sp!, {r0, r1, r2, r3, r12}
+     958:	eb000534	bl	0x1e30	; _sta_select_application
+     95c:	e8bd100f	ldmia	sp!, {r0, r1, r2, r3, r12}
+     960:	ea0005e4	b	0x20f8	; _sta_select_application
+
+_INT_Initialize:
+; exactly the same as the Mot C139 version
+    20f8:	e51f1024	ldr	r1, =0xffff9800	; via 0x20dc
+    20fc:	e15f21ba	ldrh	r2, =0x2002	; via 0x20ea
+    2100:	e1c120b0	strh	r2, [r1]
+    2104:	e5912000	ldr	r2, [r1]
+    2108:	e2022001	and	r2, r2, #1
+    210c:	e3520001	cmp	r2, #1
+    2110:	0afffffb	beq	0x2104
+    2114:	e51f1044	ldr	r1, =0xfffffd00	; via 0x20d8
+    2118:	e15f23b8	ldrh	r2, =0x1081	; via 0x20e8
+    211c:	e1c120b0	strh	r2, [r1]
+    2120:	e51f1048	ldr	r1, =0xfffffb10	; via 0x20e0
+    2124:	e15f23be	ldrh	r2, =0xf7ff	; via 0x20ee
+    2128:	e1d100b0	ldrh	r0, [r1]
+    212c:	e0000002	and	r0, r0, r2
+    2130:	e1c100b0	strh	r0, [r1]
+    2134:	e51f1058	ldr	r1, =0xffffff08	; via 0x20e4
+    2138:	e15f25b0	ldrh	r2, =0x0	; via 0x20f0
+    213c:	e1c120b0	strh	r2, [r1]
+    2140:	e51f107c	ldr	r1, =0xfffffb00	; via 0x20cc
+    2144:	e15f29b0	ldrh	r2, =0x2a1	; via 0x20bc
+    2148:	e1c120b0	strh	r2, [r1]
+    214c:	e15f29b6	ldrh	r2, =0x2a1	; via 0x20be
+    2150:	e1c120b2	strh	r2, [r1, #2]
+    2154:	e15f29bc	ldrh	r2, =0x2a1	; via 0x20c0
+    2158:	e1c120b4	strh	r2, [r1, #4]
+    215c:	e15f2ab2	ldrh	r2, =0x283	; via 0x20c2
+    2160:	e1c120b6	strh	r2, [r1, #6]
+    2164:	e15f2ab8	ldrh	r2, =0xe85	; via 0x20c4
+    2168:	e1c120ba	strh	r2, [r1, #10]	; 0xa
+    216c:	e15f2abe	ldrh	r2, =0x2c0	; via 0x20c6
+    2170:	e1c120bc	strh	r2, [r1, #12]	; 0xc
+    2174:	e15f2bb4	ldrh	r2, =0x40	; via 0x20c8
+    2178:	e1c120b8	strh	r2, [r1, #8]
+    217c:	e15f2bba	ldrh	r2, =0x2a	; via 0x20ca
+    2180:	e1c120be	strh	r2, [r1, #14]	; 0xe
+    2184:	e51f10bc	ldr	r1, =0xfffef006	; via 0x20d0
+    2188:	e1d120b0	ldrh	r2, [r1]
+    218c:	e51f00c0	ldr	r0, =0x8	; via 0x20d4
+    2190:	e1800002	orr	r0, r0, r2
+    2194:	e1c100b0	strh	r0, [r1]
+    2198:	e10f0000	mrs	r0, CPSR
+    219c:	e3c0001f	bic	r0, r0, #31	; 0x1f
+    21a0:	e3800013	orr	r0, r0, #19	; 0x13
+    21a4:	e38000c0	orr	r0, r0, #192	; 0xc0
+    21a8:	e129f000	msr	CPSR_fc, r0
+    21ac:	e3a00502	mov	r0, #8388608	; 0x800000
+    21b0:	e3a02000	mov	r2, #0
+    21b4:	e3a01721	mov	r1, #8650752	; 0x840000
+    21b8:	e2411080	sub	r1, r1, #128	; 0x80
+    21bc:	e4802004	str	r2, [r0], #4
+    21c0:	e1500001	cmp	r0, r1
+    21c4:	1afffffc	bne	0x21bc
+    21c8:	e3a00401	mov	r0, #16777216	; 0x1000000
+    21cc:	e3a02000	mov	r2, #0
+    21d0:	e3a01742	mov	r1, #17301504	; 0x1080000
+    21d4:	e2411080	sub	r1, r1, #128	; 0x80
+    21d8:	e4802004	str	r2, [r0], #4
+    21dc:	e1500001	cmp	r0, r1
+    21e0:	1afffffc	bne	0x21d8
+    21e4:	e3a00001	mov	r0, #1
+    21e8:	e59f12c8	ldr	r1, =0x83ac7c	; via 0x24b8
+    21ec:	e5810000	str	r0, [r1]
+    21f0:	e59f02bc	ldr	r0, =0x83ad90	; via 0x24b4
+    21f4:	e3a01b01	mov	r1, #1024	; 0x400
+    21f8:	e2411004	sub	r1, r1, #4
+    21fc:	e0802001	add	r2, r0, r1
+    2200:	e1a0a000	mov	r10, r0
+    2204:	e59f32b0	ldr	r3, =0x80a9f4	; via 0x24bc
+    2208:	e583a000	str	r10, [r3]
+    220c:	e1a0d002	mov	sp, r2
+    2210:	e59f32a8	ldr	r3, =0x80a55c	; via 0x24c0
+    2214:	e583d000	str	sp, [r3]
+    2218:	e3a01080	mov	r1, #128	; 0x80
+    221c:	e0822001	add	r2, r2, r1
+    2220:	e10f0000	mrs	r0, CPSR
+    2224:	e3c0001f	bic	r0, r0, #31	; 0x1f
+    2228:	e3800012	orr	r0, r0, #18	; 0x12
+    222c:	e129f000	msr	CPSR_fc, r0
+    2230:	e1a0d002	mov	sp, r2
+    2234:	e3a01c02	mov	r1, #512	; 0x200
+    2238:	e0822001	add	r2, r2, r1
+    223c:	e10f0000	mrs	r0, CPSR
+    2240:	e3c0001f	bic	r0, r0, #31	; 0x1f
+    2244:	e3800011	orr	r0, r0, #17	; 0x11
+    2248:	e129f000	msr	CPSR_fc, r0
+    224c:	e1a0d002	mov	sp, r2
+    2250:	e10f0000	mrs	r0, CPSR
+    2254:	e3c0001f	bic	r0, r0, #31	; 0x1f
+    2258:	e3800017	orr	r0, r0, #23	; 0x17
+    225c:	e129f000	msr	CPSR_fc, r0
+    2260:	e59fd268	ldr	sp, =0x83acf8	; via 0x24d0
+    2264:	e10f0000	mrs	r0, CPSR
+    2268:	e3c0001f	bic	r0, r0, #31	; 0x1f
+    226c:	e380001b	orr	r0, r0, #27	; 0x1b
+    2270:	e129f000	msr	CPSR_fc, r0
+    2274:	e59fd254	ldr	sp, =0x83acf8	; via 0x24d0
+    2278:	e10f0000	mrs	r0, CPSR
+    227c:	e3c0001f	bic	r0, r0, #31	; 0x1f
+    2280:	e3800013	orr	r0, r0, #19	; 0x13
+    2284:	e129f000	msr	CPSR_fc, r0
+    2288:	e59f3234	ldr	r3, =0x80aa08	; via 0x24c4
+    228c:	e2822004	add	r2, r2, #4
+    2290:	e5832000	str	r2, [r3]
+    2294:	e3a01b01	mov	r1, #1024	; 0x400
+    2298:	e3c11003	bic	r1, r1, #3
+    229c:	e0822001	add	r2, r2, r1
+    22a0:	e59f3220	ldr	r3, =0x80aa8c	; via 0x24c8
+    22a4:	e5831000	str	r1, [r3]
+    22a8:	e3a01002	mov	r1, #2
+    22ac:	e59f3218	ldr	r3, =0x80aa9c	; via 0x24cc
+    22b0:	e5831000	str	r1, [r3]
+    22b4:	e1a04002	mov	r4, r2
+    22b8:	eb084361	bl	0x213044	; _f_load_int_mem
+    22bc:	e1a02004	mov	r2, r4
+    22c0:	e59f11f4	ldr	r1, =0x80a9f4	; via 0x24bc
+    22c4:	e5910000	ldr	r0, [r1]
+    22c8:	e3a030fe	mov	r3, #254	; 0xfe
+    22cc:	e5c03000	strb	r3, [r0]
+    22d0:	e5c03001	strb	r3, [r0, #1]
+    22d4:	e5c03002	strb	r3, [r0, #2]
+    22d8:	e5c03003	strb	r3, [r0, #3]
+    22dc:	e4903004	ldr	r3, [r0], #4
+    22e0:	e4803004	str	r3, [r0], #4
+    22e4:	e1500002	cmp	r0, r2
+    22e8:	bafffffc	blt	0x22e0
+    22ec:	e51f0200	ldr	r0, =0x2810	; via 0x20f4
+    22f0:	e3700001	cmn	r0, #1
+    22f4:	1b000077	blne	0x24d8		; _auto_init
+    22f8:	e1a00002	mov	r0, r2
+    22fc:	ea084362	b	0x21308c	; _INC_Initialize
+
+$Init_Target:
+  200890:	b530		push	{r4, r5, lr}
+  200892:	b081		sub	sp, #4
+  200894:	497c		ldr	r1, =0xfffef008	; via 0x200a88
+  200896:	2003		mov	r0, #3
+  200898:	0340		lsl	r0, r0, #13
+  20089a:	8008		strh	r0, [r1, #0]
+  20089c:	f009 fee0	bl	0x20a660	; $TM_DisableWatchdog
+  2008a0:	487a		ldr	r0, =0xfffffd02	; via 0x200a8c
+  2008a2:	2105		mov	r1, #5
+  2008a4:	8001		strh	r1, [r0, #0]
+  2008a6:	2180		mov	r1, #128	; 0x80
+  2008a8:	8802		ldrh	r2, [r0, #0]
+  2008aa:	4311		orr	r1, r2
+  2008ac:	8001		strh	r1, [r0, #0]
+  2008ae:	4978		ldr	r1, =0xffdf	; via 0x200a90
+  2008b0:	8802		ldrh	r2, [r0, #0]
+  2008b2:	4011		and	r1, r2
+  2008b4:	8001		strh	r1, [r0, #0]
+  2008b6:	4d77		ldr	r5, =0xfffff900	; via 0x200a94
+  2008b8:	20ff		mov	r0, #255	; 0xff
+  2008ba:	0200		lsl	r0, r0, #8
+  2008bc:	8028		strh	r0, [r5, #0]
+  2008be:	4c76		ldr	r4, =0xffff9800	; via 0x200a98
+  2008c0:	4876		ldr	r0, =0xfff3	; via 0x200a9c
+  2008c2:	8821		ldrh	r1, [r4, #0]
+  2008c4:	4008		and	r0, r1
+  2008c6:	8020		strh	r0, [r4, #0]
+  2008c8:	8820		ldrh	r0, [r4, #0]
+  2008ca:	8020		strh	r0, [r4, #0]
+  2008cc:	4874		ldr	r0, =0xf01f	; via 0x200aa0
+  2008ce:	8821		ldrh	r1, [r4, #0]
+  2008d0:	4008		and	r0, r1
+  2008d2:	8020		strh	r0, [r4, #0]
+  2008d4:	2001		mov	r0, #1
+  2008d6:	0280		lsl	r0, r0, #10
+  2008d8:	8821		ldrh	r1, [r4, #0]
+  2008da:	4308		orr	r0, r1
+  2008dc:	8020		strh	r0, [r4, #0]
+  2008de:	2000		mov	r0, #0
+  2008e0:	2102		mov	r1, #2
+  2008e2:	2200		mov	r2, #0
+  2008e4:	f00a fd04	bl	0x20b2f0	; $CLKM_InitARMClock
+  2008e8:	486e		ldr	r0, =0xfffffb00	; via 0x200aa4
+  2008ea:	21a3		mov	r1, #163	; 0xa3
+  2008ec:	8001		strh	r1, [r0, #0]
+  2008ee:	8041		strh	r1, [r0, #2]
+; nCS2 setup is different: 0xA6 instead of TI/C11x/C139 0xA5
+  2008f0:	22a6		mov	r2, #166	; 0xa6
+  2008f2:	8082		strh	r2, [r0, #4]
+  2008f4:	80c1		strh	r1, [r0, #6]
+  2008f6:	2180		mov	r1, #128	; 0x80
+  2008f8:	8141		strh	r1, [r0, #10]	; 0xa
+  2008fa:	21c0		mov	r1, #192	; 0xc0
+  2008fc:	8181		strh	r1, [r0, #12]	; 0xc
+  2008fe:	2140		mov	r1, #64	; 0x40
+  200900:	8101		strh	r1, [r0, #8]
+  200902:	2020		mov	r0, #32	; 0x20
+  200904:	8068		strh	r0, [r5, #2]
+  200906:	2000		mov	r0, #0
+  200908:	80a8		strh	r0, [r5, #4]
+  20090a:	2010		mov	r0, #16	; 0x10
+  20090c:	8821		ldrh	r1, [r4, #0]
+  20090e:	4308		orr	r0, r1
+  200910:	8020		strh	r0, [r4, #0]
+  200912:	4865		ldr	r0, =0xfffffa08	; via 0x200aa8
+  200914:	4965		ldr	r1, =0xffff	; via 0x200aac
+  200916:	8001		strh	r1, [r0, #0]
+  200918:	8041		strh	r1, [r0, #2]
+  20091a:	2103		mov	r1, #3
+  20091c:	8181		strh	r1, [r0, #12]	; 0xc
+  20091e:	f008 fe39	bl	0x209594	; $IQ_SetupInterrupts
+  200922:	4863		ldr	r0, =0xfffffc00	; via 0x200ab0
+  200924:	2124		mov	r1, #36	; 0x24
+  200926:	8001		strh	r1, [r0, #0]
+  200928:	210d		mov	r1, #13	; 0xd
+  20092a:	8041		strh	r1, [r0, #2]
+  20092c:	2500		mov	r5, #0
+  20092e:	4861		ldr	r0, =0xfffe2016	; via 0x200ab4
+  200930:	8005		strh	r5, [r0, #0]
+  200932:	4961		ldr	r1, =0xfffe2014	; via 0x200ab8
+  200934:	2002		mov	r0, #2
+  200936:	8008		strh	r0, [r1, #0]
+  200938:	4960		ldr	r1, =0xfffe2002	; via 0x200abc
+  20093a:	2084		mov	r0, #132	; 0x84
+  20093c:	8008		strh	r0, [r1, #0]
+  20093e:	4860		ldr	r0, =0xfffe2000	; via 0x200ac0
+  200940:	4960		ldr	r1, =0x3de0	; via 0x200ac4
+  200942:	8001		strh	r1, [r0, #0]
+  200944:	4960		ldr	r1, =0xfffe2022	; via 0x200ac8
+  200946:	220a		mov	r2, #10	; 0xa
+  200948:	800a		strh	r2, [r1, #0]
+  20094a:	4960		ldr	r1, =0xfffe2020	; via 0x200acc
+  20094c:	4a60		ldr	r2, =0x45a	; via 0x200ad0
+  20094e:	800a		strh	r2, [r1, #0]
+  200950:	4a60		ldr	r2, =0xfffe201e	; via 0x200ad4
+  200952:	21ff		mov	r1, #255	; 0xff
+  200954:	314b		add	r1, #75	; 0x4b
+  200956:	8011		strh	r1, [r2, #0]
+  200958:	495f		ldr	r1, =0xfffe201c	; via 0x200ad8
+  20095a:	221f		mov	r2, #31	; 0x1f
+  20095c:	800a		strh	r2, [r1, #0]
+  20095e:	495f		ldr	r1, =0xfffe2024	; via 0x200adc
+  200960:	800d		strh	r5, [r1, #0]
+  200962:	495f		ldr	r1, =0xfffe2010	; via 0x200ae0
+  200964:	2202		mov	r2, #2
+  200966:	880b		ldrh	r3, [r1, #0]
+  200968:	431a		orr	r2, r3
+  20096a:	800a		strh	r2, [r1, #0]
+  20096c:	4b5c		ldr	r3, =0xfffe2010	; via 0x200ae0
+  20096e:	2104		mov	r1, #4
+  200970:	881a		ldrh	r2, [r3, #0]
+  200972:	4311		orr	r1, r2
+  200974:	8019		strh	r1, [r3, #0]
+  200976:	4c5b		ldr	r4, =0xfffef006	; via 0x200ae4
+  200978:	2127		mov	r1, #39	; 0x27
+  20097a:	80e1		strh	r1, [r4, #6]
+  20097c:	8a01		ldrh	r1, [r0, #16]	; 0x10
+  20097e:	0849		lsr	r1, r1, #1
+  200980:	d30f		bcc	0x2009a2
+  200982:	8a01		ldrh	r1, [r0, #16]	; 0x10
+  200984:	0409		lsl	r1, r1, #16
+  200986:	0c49		lsr	r1, r1, #17
+  200988:	0049		lsl	r1, r1, #1
+  20098a:	8201		strh	r1, [r0, #16]	; 0x10
+  20098c:	2101		mov	r1, #1
+  20098e:	e001		b	0x200994
+  200990:	9900		ldr	r1, [sp, #0]
+  200992:	3101		add	r1, #1
+  200994:	9100		str	r1, [sp, #0]
+  200996:	9900		ldr	r1, [sp, #0]
+  200998:	2932		cmp	r1, #50	; 0x32
+  20099a:	d3f9		bcc	0x200990
+  20099c:	8a41		ldrh	r1, [r0, #18]	; 0x12
+  20099e:	2900		cmp	r1, #0
+  2009a0:	d0fc		beq	0x20099c
+  2009a2:	f007 fb46	bl	0x208032	; $AI_ClockEnable
+  2009a6:	f007 fb4a	bl	0x20803e	; $AI_InitIOConfig
+  2009aa:	2027		mov	r0, #39	; 0x27
+  2009ac:	0500		lsl	r0, r0, #20
+  2009ae:	8005		strh	r5, [r0, #0]
+; extra code not in TI's version, beginning like C11x and C139
+  2009b0:	484d		ldr	r0, =0xffbf	; via 0x200ae8
+  2009b2:	8821		ldrh	r1, [r4, #0]
+  2009b4:	4008		and	r0, r1
+  2009b6:	8020		strh	r0, [r4, #0]
+; beginning of diff from C11x and C139
+; GPIO 2 is set low instead of high here
+  2009b8:	2002		mov	r0, #2
+  2009ba:	f007 fb10	bl	0x207fde	; $AI_ResetBit
+; setting bits 5 and 9 in FFFE:F00A just like C11x and C139 versions
+  2009be:	2001		mov	r0, #1
+  2009c0:	0240		lsl	r0, r0, #9
+  2009c2:	88a1		ldrh	r1, [r4, #4]
+  2009c4:	4308		orr	r0, r1
+  2009c6:	80a0		strh	r0, [r4, #4]
+  2009c8:	2020		mov	r0, #32	; 0x20
+  2009ca:	88a1		ldrh	r1, [r4, #4]
+  2009cc:	4308		orr	r0, r1
+  2009ce:	80a0		strh	r0, [r4, #4]
+; also setting bits 8, 7 and 0 (IO_CONF_REG |= 0x181)
+  2009d0:	20ff		mov	r0, #255	; 0xff
+  2009d2:	3082		add	r0, #130	; 0x82
+  2009d4:	88a1		ldrh	r1, [r4, #4]
+  2009d6:	4308		orr	r0, r1
+  2009d8:	80a0		strh	r0, [r4, #4]
+; GPIO directions
+  2009da:	2004		mov	r0, #4
+  2009dc:	f007 fb0d	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2009e0:	2006		mov	r0, #6
+  2009e2:	f007 fb0a	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2009e6:	2008		mov	r0, #8
+  2009e8:	f007 fb00	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2009ec:	200a		mov	r0, #10	; 0xa
+  2009ee:	f007 fafd	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2009f2:	200b		mov	r0, #11	; 0xb
+  2009f4:	f007 fb01	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2009f8:	200c		mov	r0, #12	; 0xc
+  2009fa:	f007 faf7	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2009fe:	2008		mov	r0, #8
+  200a00:	f007 faed	bl	0x207fde	; $AI_ResetBit
+  200a04:	200a		mov	r0, #10	; 0xa
+  200a06:	f007 faea	bl	0x207fde	; $AI_ResetBit
+  200a0a:	200c		mov	r0, #12	; 0xc
+  200a0c:	f007 fae7	bl	0x207fde	; $AI_ResetBit
+; tail end of TI's original code
+  200a10:	2001		mov	r0, #1
+  200a12:	f009 fe2d	bl	0x20a670
+  200a16:	2002		mov	r0, #2
+  200a18:	f009 fe2a	bl	0x20a670
+  200a1c:	b001		add	sp, #4
+  200a1e:	bd30		pop	{r4, r5, pc}
+
+$Init_Drivers:
+  200a20:	b500		push	{lr}
+  200a22:	f7c5 fdfd	bl	0x1c6620
+  200a26:	f7c6 fd8d	bl	0x1c7544
+  200a2a:	f780 fe7e	bl	0x18172a
+  200a2e:	f797 ffef	bl	0x198a10
+  200a32:	f7eb f8d9	bl	0x1ebbe8
+  200a36:	f00c fbb5	bl	0x20d1a4
+  200a3a:	f7a5 fc81	bl	0x1a6340
+  200a3e:	f754 f8a1	bl	0x154b84
+  200a42:	f7d3 f89e	bl	0x1d3b82
+  200a46:	bd00		pop	{pc}
+
+$Init_Serial_Flows:
+  200a48:	b500		push	{lr}
+  200a4a:	4828		ldr	r0, =0x83a728	; via 0x200aec
+  200a4c:	f7c4 fe7e	bl	0x1c574c
+  200a50:	2000		mov	r0, #0
+  200a52:	2102		mov	r1, #2
+  200a54:	2200		mov	r2, #0
+  200a56:	f7c4 fef2	bl	0x1c583e
+  200a5a:	f7c4 ff4c	bl	0x1c58f6
+  200a5e:	bd00		pop	{pc}
+
+$Init_Unmask_IT:
+  200a60:	b500		push	{lr}
+  200a62:	2004		mov	r0, #4
+  200a64:	f008 fdf7	bl	0x209656
+  200a68:	2012		mov	r0, #18	; 0x12
+  200a6a:	f008 fdf4	bl	0x209656
+  200a6e:	2007		mov	r0, #7
+  200a70:	f008 fdf1	bl	0x209656
+  200a74:	2008		mov	r0, #8
+  200a76:	f008 fdee	bl	0x209656
+  200a7a:	bd00		pop	{pc}
+
+$GpUnmaskRTCAlarmInterrupts:
+  200a7c:	b500		push	{lr}
+  200a7e:	200a		mov	r0, #10	; 0xa
+  200a80:	f008 fde9	bl	0x209656
+  200a84:	bd00		pop	{pc}
+  200a86:	46c0		nop			(mov r8, r8)
+
+$AI_EnableBit:
+  207fb4:	4a5a		ldr	r2, =0xfffef00a	; via 0x208120
+  207fb6:	2101		mov	r1, #1
+  207fb8:	4081		lsl	r1, r0
+  207fba:	8810		ldrh	r0, [r2, #0]
+  207fbc:	4301		orr	r1, r0
+  207fbe:	8011		strh	r1, [r2, #0]
+  207fc0:	4770		bx	lr
+
+$AI_DisableBit:
+  207fc2:	4a57		ldr	r2, =0xfffef00a	; via 0x208120
+  207fc4:	2101		mov	r1, #1
+  207fc6:	4081		lsl	r1, r0
+  207fc8:	8810		ldrh	r0, [r2, #0]
+  207fca:	4388		bic	r0, r1
+  207fcc:	8010		strh	r0, [r2, #0]
+  207fce:	4770		bx	lr
+
+$AI_SetBit:
+  207fd0:	4a54		ldr	r2, =0xfffe4802	; via 0x208124
+  207fd2:	2101		mov	r1, #1
+  207fd4:	4081		lsl	r1, r0
+  207fd6:	8810		ldrh	r0, [r2, #0]
+  207fd8:	4301		orr	r1, r0
+  207fda:	8011		strh	r1, [r2, #0]
+  207fdc:	4770		bx	lr
+
+$AI_ResetBit:
+  207fde:	4a51		ldr	r2, =0xfffe4802	; via 0x208124
+  207fe0:	2101		mov	r1, #1
+  207fe2:	4081		lsl	r1, r0
+  207fe4:	8810		ldrh	r0, [r2, #0]
+  207fe6:	4388		bic	r0, r1
+  207fe8:	8010		strh	r0, [r2, #0]
+  207fea:	4770		bx	lr
+
+$AI_ConfigBitAsOutput:
+  207fec:	4a4e		ldr	r2, =0xfffe4804	; via 0x208128
+  207fee:	2101		mov	r1, #1
+  207ff0:	4081		lsl	r1, r0
+  207ff2:	8810		ldrh	r0, [r2, #0]
+  207ff4:	4388		bic	r0, r1
+  207ff6:	8010		strh	r0, [r2, #0]
+  207ff8:	4770		bx	lr
+
+$AI_ConfigBitAsInput:
+  207ffa:	4a4b		ldr	r2, =0xfffe4804	; via 0x208128
+  207ffc:	2101		mov	r1, #1
+  207ffe:	4081		lsl	r1, r0
+  208000:	8810		ldrh	r0, [r2, #0]
+  208002:	4301		orr	r1, r0
+  208004:	8011		strh	r1, [r2, #0]
+  208006:	4770		bx	lr
+
+$AI_ReadBit:
+  208008:	4948		ldr	r1, =0xfffe4800	; via 0x20812c
+  20800a:	8809		ldrh	r1, [r1, #0]
+  20800c:	4101		asr	r1, r0
+  20800e:	07c8		lsl	r0, r1, #31
+  208010:	0fc0		lsr	r0, r0, #31
+  208012:	0600		lsl	r0, r0, #24
+  208014:	0e00		lsr	r0, r0, #24
+  208016:	4770		bx	lr
+
+$AI_Power:
+  208018:	b500		push	{lr}
+  20801a:	2800		cmp	r0, #0
+  20801c:	d101		bne	0x208022
+  20801e:	f7be fe3d	bl	0x1c6c9c
+  208022:	bd00		pop	{pc}
+
+$AI_ResetIoConfig:
+  208024:	4940		ldr	r1, =0xfffe4804	; via 0x208128
+  208026:	4842		ldr	r0, =0xffff	; via 0x208130
+  208028:	8008		strh	r0, [r1, #0]
+  20802a:	483d		ldr	r0, =0xfffef00a	; via 0x208120
+  20802c:	2100		mov	r1, #0
+  20802e:	8001		strh	r1, [r0, #0]
+  208030:	4770		bx	lr
+
+$AI_ClockEnable:
+  208032:	4940		ldr	r1, =0xfffe4806	; via 0x208134
+  208034:	2020		mov	r0, #32	; 0x20
+  208036:	880a		ldrh	r2, [r1, #0]
+  208038:	4310		orr	r0, r2
+  20803a:	8008		strh	r0, [r1, #0]
+  20803c:	4770		bx	lr
+
+$AI_InitIOConfig:
+  20803e:	b500		push	{lr}
+  208040:	f7ff fff0	bl	0x208024	; $AI_ResetIoConfig
+; insert new to this J100 version (not from TI, not in C11x, not in C139)
+; clears bit 10 in FFFE:F008 to ensure that I/O 3 is a GPIO
+  208044:	493c		ldr	r1, =0xfffef008	; via 0x208138
+  208046:	483d		ldr	r0, =0xfbff	; via 0x20813c
+  208048:	880a		ldrh	r2, [r1, #0]
+  20804a:	4010		and	r0, r2
+  20804c:	8008		strh	r0, [r1, #0]
+  20804e:	2000		mov	r0, #0
+  208050:	f7ff ffb0	bl	0x207fb4	; $AI_EnableBit
+  208054:	2002		mov	r0, #2
+  208056:	f7ff ffad	bl	0x207fb4	; $AI_EnableBit
+  20805a:	2003		mov	r0, #3
+  20805c:	f7ff ffaa	bl	0x207fb4	; $AI_EnableBit
+  208060:	2004		mov	r0, #4
+  208062:	f7ff ffa7	bl	0x207fb4	; $AI_EnableBit
+  208066:	2005		mov	r0, #5
+  208068:	f7ff ffa4	bl	0x207fb4	; $AI_EnableBit
+  20806c:	2006		mov	r0, #6
+  20806e:	f7ff ffa1	bl	0x207fb4	; $AI_EnableBit
+  208072:	2007		mov	r0, #7
+  208074:	f7ff ff9e	bl	0x207fb4	; $AI_EnableBit
+  208078:	2008		mov	r0, #8
+  20807a:	f7ff ff9b	bl	0x207fb4	; $AI_EnableBit
+  20807e:	2009		mov	r0, #9
+  208080:	f7ff ff98	bl	0x207fb4	; $AI_EnableBit
+  208084:	4927		ldr	r1, =0xfffe4802	; via 0x208124
+  208086:	203f		mov	r0, #63	; 0x3f
+  208088:	0200		lsl	r0, r0, #8
+  20808a:	8008		strh	r0, [r1, #0]
+  20808c:	2001		mov	r0, #1
+  20808e:	f7ff ffad	bl	0x207fec	; $AI_ConfigBitAsOutput
+  208092:	2002		mov	r0, #2
+  208094:	f7ff ffaa	bl	0x207fec	; $AI_ConfigBitAsOutput
+  208098:	2005		mov	r0, #5
+  20809a:	f7ff ffa7	bl	0x207fec	; $AI_ConfigBitAsOutput
+  20809e:	2003		mov	r0, #3
+  2080a0:	f7ff ffab	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2080a4:	2004		mov	r0, #4
+  2080a6:	f7ff ffa8	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2080aa:	2007		mov	r0, #7
+  2080ac:	f7ff ff9e	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2080b0:	2008		mov	r0, #8
+  2080b2:	f7ff ff9b	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2080b6:	200c		mov	r0, #12	; 0xc
+  2080b8:	f7ff ff98	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2080bc:	2008		mov	r0, #8
+  2080be:	f7ff ff8e	bl	0x207fde	; $AI_ResetBit
+  2080c2:	200c		mov	r0, #12	; 0xc
+  2080c4:	f7ff ff8b	bl	0x207fde	; $AI_ResetBit
+  2080c8:	2009		mov	r0, #9
+  2080ca:	f7ff ff96	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2080ce:	200b		mov	r0, #11	; 0xb
+  2080d0:	f7ff ff93	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2080d4:	200d		mov	r0, #13	; 0xd
+  2080d6:	f7ff ff90	bl	0x207ffa	; $AI_ConfigBitAsInput
+  2080da:	200e		mov	r0, #14	; 0xe
+  2080dc:	f7ff ff86	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2080e0:	200f		mov	r0, #15	; 0xf
+  2080e2:	f7ff ff83	bl	0x207fec	; $AI_ConfigBitAsOutput
+  2080e6:	bd00		pop	{pc}
+
+$AI_SelectIOForIT:
+  2080e8:	0109		lsl	r1, r1, #4
+  2080ea:	1840		add	r0, r0, r1
+  2080ec:	0040		lsl	r0, r0, #1
+  2080ee:	3001		add	r0, #1
+  2080f0:	4913		ldr	r1, =0xfffe4814	; via 0x208140
+  2080f2:	8008		strh	r0, [r1, #0]
+  2080f4:	4770		bx	lr
+
+; new function added in this J100 version
+  2080f6:	4913		ldr	r1, =0xfffe481a	; via 0x208144
+  2080f8:	8008		strh	r0, [r1, #0]
+  2080fa:	4770		bx	lr
+
+$AI_CheckITSource:
+  2080fc:	2100		mov	r1, #0
+  2080fe:	4a12		ldr	r2, =0xfffe4816	; via 0x208148
+  208100:	8812		ldrh	r2, [r2, #0]
+  208102:	4210		tst	r0, r2
+  208104:	d000		beq	0x208108
+  208106:	2101		mov	r1, #1
+  208108:	1c08		add	r0, r1, #0
+  20810a:	4770		bx	lr
+
+$AI_UnmaskIT:
+  20810c:	4a0f		ldr	r2, =0xfffe4818	; via 0x20814c
+  20810e:	8811		ldrh	r1, [r2, #0]
+  208110:	4381		bic	r1, r0
+  208112:	8011		strh	r1, [r2, #0]
+  208114:	4770		bx	lr
+
+$AI_MaskIT:
+  208116:	4a0d		ldr	r2, =0xfffe4818	; via 0x20814c
+  208118:	8811		ldrh	r1, [r2, #0]
+  20811a:	4301		orr	r1, r0
+  20811c:	8011		strh	r1, [r2, #0]
+  20811e:	4770		bx	lr
+
+$INC_Initialize:
+  212190:	b510		push	{r4, lr}
+  212192:	1c04		add	r4, r0, #0
+  212194:	4813		ldr	r0, =0x83ac94	; via 0x2121e4
+  212196:	2101		mov	r1, #1
+  212198:	6001		str	r1, [r0, #0]
+  21219a:	f001 f877	bl	0x21328c
+  21219e:	f001 f879	bl	0x213294
+  2121a2:	f001 f839	bl	0x213218
+  2121a6:	f000 fba7	bl	0x2128f8
+  2121aa:	f7fb f8a9	bl	0x20d300
+  2121ae:	f000 fd77	bl	0x212ca0
+  2121b2:	f000 fdd5	bl	0x212d60
+  2121b6:	f000 fdc3	bl	0x212d40
+  2121ba:	f000 fdf1	bl	0x212da0
+  2121be:	f000 fdaf	bl	0x212d20
+  2121c2:	f000 fdfd	bl	0x212dc0
+  2121c6:	f000 fd8b	bl	0x212ce0
+  2121ca:	f7fd ff93	bl	0x2100f4
+  2121ce:	f000 fdd7	bl	0x212d80
+  2121d2:	1c20		add	r0, r4, #0
+  2121d4:	f000 fc6c	bl	0x212ab0	; $Application_Initialize
+  2121d8:	4902		ldr	r1, =0x83ac94	; via 0x2121e4
+  2121da:	2002		mov	r0, #2
+  2121dc:	6008		str	r0, [r1, #0]
+  2121de:	f79e fc77	bl	0x1b0ad0
+  2121e2:	bd10		pop	{r4, pc}
+
+$Application_Initialize:
+  212ab0:	b500		push	{lr}
+  212ab2:	f7ed feed	bl	0x200890	; $Init_Target
+  212ab6:	f7ed ffb3	bl	0x200a20	; $Init_Drivers
+  212aba:	f7bb fd7c	bl	0x1ce5b6
+  212abe:	f72d f931	bl	0x13fd24
+  212ac2:	f7bb fd78	bl	0x1ce5b6
+  212ac6:	f7ed ffbf	bl	0x200a48	; $Init_Serial_Flows
+  212aca:	f7a3 fbb2	bl	0x1b6232
+  212ace:	f7ed ffc7	bl	0x200a60	; $Init_Unmask_IT
+  212ad2:	bd00		pop	{pc}
+
+_INC_Initialize:	; call veneer
+  21308c:	e92d4000	stmdb	sp!, {lr}
+  213090:	e28fe001	add	lr, pc, #1
+  213094:	e12fff1e	bx	lr
+  213098:	f7ff f87a	bl	0x212190	; $INC_Initialize
+  21309c:	4778		bx	pc
+  21309e:	46c0		nop			(mov r8, r8)
+  2130a0:	e8bd8000	ldmia	sp!, {pc}