start.S 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687
  1. /*
  2. * Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
  3. * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
  4. * Copyright (C) 2000,2001,2002 Wolfgang Denk <wd@denx.de>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. /*------------------------------------------------------------------------------+ */
  25. /* */
  26. /* This source code has been made available to you by IBM on an AS-IS */
  27. /* basis. Anyone receiving this source is licensed under IBM */
  28. /* copyrights to use it in any way he or she deems fit, including */
  29. /* copying it, modifying it, compiling it, and redistributing it either */
  30. /* with or without modifications. No license under IBM patents or */
  31. /* patent applications is to be implied by the copyright license. */
  32. /* */
  33. /* Any user of this software should understand that IBM cannot provide */
  34. /* technical support for this software and will not be responsible for */
  35. /* any consequences resulting from the use of this software. */
  36. /* */
  37. /* Any person who transfers this source code or any derivative work */
  38. /* must include the IBM copyright notice, this paragraph, and the */
  39. /* preceding two paragraphs in the transferred software. */
  40. /* */
  41. /* COPYRIGHT I B M CORPORATION 1995 */
  42. /* LICENSED MATERIAL - PROGRAM PROPERTY OF I B M */
  43. /*------------------------------------------------------------------------------- */
  44. /* U-Boot - Startup Code for AMCC 4xx PowerPC based Embedded Boards
  45. *
  46. *
  47. * The processor starts at 0xfffffffc and the code is executed
  48. * from flash/rom.
  49. * in memory, but as long we don't jump around before relocating.
  50. * board_init lies at a quite high address and when the cpu has
  51. * jumped there, everything is ok.
  52. * This works because the cpu gives the FLASH (CS0) the whole
  53. * address space at startup, and board_init lies as a echo of
  54. * the flash somewhere up there in the memorymap.
  55. *
  56. * board_init will change CS0 to be positioned at the correct
  57. * address and (s)dram will be positioned at address 0
  58. */
  59. #include <config.h>
  60. #include <mpc8xx.h>
  61. #include <ppc4xx.h>
  62. #include <version.h>
  63. #define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
  64. #include <ppc_asm.tmpl>
  65. #include <ppc_defs.h>
  66. #include <asm/cache.h>
  67. #include <asm/mmu.h>
  68. #ifndef CONFIG_IDENT_STRING
  69. #define CONFIG_IDENT_STRING ""
  70. #endif
  71. #ifdef CFG_INIT_DCACHE_CS
  72. # if (CFG_INIT_DCACHE_CS == 0)
  73. # define PBxAP pb0ap
  74. # define PBxCR pb0cr
  75. # endif
  76. # if (CFG_INIT_DCACHE_CS == 1)
  77. # define PBxAP pb1ap
  78. # define PBxCR pb1cr
  79. # endif
  80. # if (CFG_INIT_DCACHE_CS == 2)
  81. # define PBxAP pb2ap
  82. # define PBxCR pb2cr
  83. # endif
  84. # if (CFG_INIT_DCACHE_CS == 3)
  85. # define PBxAP pb3ap
  86. # define PBxCR pb3cr
  87. # endif
  88. # if (CFG_INIT_DCACHE_CS == 4)
  89. # define PBxAP pb4ap
  90. # define PBxCR pb4cr
  91. # endif
  92. # if (CFG_INIT_DCACHE_CS == 5)
  93. # define PBxAP pb5ap
  94. # define PBxCR pb5cr
  95. # endif
  96. # if (CFG_INIT_DCACHE_CS == 6)
  97. # define PBxAP pb6ap
  98. # define PBxCR pb6cr
  99. # endif
  100. # if (CFG_INIT_DCACHE_CS == 7)
  101. # define PBxAP pb7ap
  102. # define PBxCR pb7cr
  103. # endif
  104. #endif /* CFG_INIT_DCACHE_CS */
  105. /* We don't want the MMU yet.
  106. */
  107. #undef MSR_KERNEL
  108. #define MSR_KERNEL ( MSR_ME ) /* Machine Check */
  109. .extern ext_bus_cntlr_init
  110. .extern sdram_init
  111. /*
  112. * Set up GOT: Global Offset Table
  113. *
  114. * Use r14 to access the GOT
  115. */
  116. START_GOT
  117. GOT_ENTRY(_GOT2_TABLE_)
  118. GOT_ENTRY(_FIXUP_TABLE_)
  119. GOT_ENTRY(_start)
  120. GOT_ENTRY(_start_of_vectors)
  121. GOT_ENTRY(_end_of_vectors)
  122. GOT_ENTRY(transfer_to_handler)
  123. GOT_ENTRY(__init_end)
  124. GOT_ENTRY(_end)
  125. GOT_ENTRY(__bss_start)
  126. END_GOT
  127. /*
  128. * 440 Startup -- on reset only the top 4k of the effective
  129. * address space is mapped in by an entry in the instruction
  130. * and data shadow TLB. The .bootpg section is located in the
  131. * top 4k & does only what's necessary to map in the the rest
  132. * of the boot rom. Once the boot rom is mapped in we can
  133. * proceed with normal startup.
  134. *
  135. * NOTE: CS0 only covers the top 2MB of the effective address
  136. * space after reset.
  137. */
  138. #if defined(CONFIG_440)
  139. .section .bootpg,"ax"
  140. .globl _start_440
  141. /**************************************************************************/
  142. _start_440:
  143. /*----------------------------------------------------------------*/
  144. /* Clear and set up some registers. */
  145. /*----------------------------------------------------------------*/
  146. iccci r0,r0 /* NOTE: operands not used for 440 */
  147. dccci r0,r0 /* NOTE: operands not used for 440 */
  148. sync
  149. li r0,0
  150. mtspr srr0,r0
  151. mtspr srr1,r0
  152. mtspr csrr0,r0
  153. mtspr csrr1,r0
  154. #if defined(CONFIG_440GX) || defined(CONFIG_440SP) /* NOTE: 440GX adds machine check status regs */
  155. mtspr mcsrr0,r0
  156. mtspr mcsrr1,r0
  157. mfspr r1, mcsr
  158. mtspr mcsr,r1
  159. #endif
  160. /*----------------------------------------------------------------*/
  161. /* Initialize debug */
  162. /*----------------------------------------------------------------*/
  163. mtspr dbcr0,r0
  164. mtspr dbcr1,r0
  165. mtspr dbcr2,r0
  166. mtspr iac1,r0
  167. mtspr iac2,r0
  168. mtspr iac3,r0
  169. mtspr dac1,r0
  170. mtspr dac2,r0
  171. mtspr dvc1,r0
  172. mtspr dvc2,r0
  173. mfspr r1,dbsr
  174. mtspr dbsr,r1 /* Clear all valid bits */
  175. /*----------------------------------------------------------------*/
  176. /* CCR0 init */
  177. /*----------------------------------------------------------------*/
  178. /* Disable store gathering & broadcast, guarantee inst/data
  179. * cache block touch, force load/store alignment
  180. * (see errata 1.12: 440_33)
  181. */
  182. lis r1,0x0030 /* store gathering & broadcast disable */
  183. ori r1,r1,0x6000 /* cache touch */
  184. mtspr ccr0,r1
  185. /*----------------------------------------------------------------*/
  186. /* Setup interrupt vectors */
  187. /*----------------------------------------------------------------*/
  188. mtspr ivpr,r0 /* Vectors start at 0x0000_0000 */
  189. li r1,0x0100
  190. mtspr ivor0,r1 /* Critical input */
  191. li r1,0x0200
  192. mtspr ivor1,r1 /* Machine check */
  193. li r1,0x0300
  194. mtspr ivor2,r1 /* Data storage */
  195. li r1,0x0400
  196. mtspr ivor3,r1 /* Instruction storage */
  197. li r1,0x0500
  198. mtspr ivor4,r1 /* External interrupt */
  199. li r1,0x0600
  200. mtspr ivor5,r1 /* Alignment */
  201. li r1,0x0700
  202. mtspr ivor6,r1 /* Program check */
  203. li r1,0x0800
  204. mtspr ivor7,r1 /* Floating point unavailable */
  205. li r1,0x0c00
  206. mtspr ivor8,r1 /* System call */
  207. li r1,0x1000
  208. mtspr ivor10,r1 /* Decrementer (PIT for 440) */
  209. li r1,0x1400
  210. mtspr ivor13,r1 /* Data TLB error */
  211. li r1,0x1300
  212. mtspr ivor14,r1 /* Instr TLB error */
  213. li r1,0x2000
  214. mtspr ivor15,r1 /* Debug */
  215. /*----------------------------------------------------------------*/
  216. /* Configure cache regions */
  217. /*----------------------------------------------------------------*/
  218. mtspr inv0,r0
  219. mtspr inv1,r0
  220. mtspr inv2,r0
  221. mtspr inv3,r0
  222. mtspr dnv0,r0
  223. mtspr dnv1,r0
  224. mtspr dnv2,r0
  225. mtspr dnv3,r0
  226. mtspr itv0,r0
  227. mtspr itv1,r0
  228. mtspr itv2,r0
  229. mtspr itv3,r0
  230. mtspr dtv0,r0
  231. mtspr dtv1,r0
  232. mtspr dtv2,r0
  233. mtspr dtv3,r0
  234. /*----------------------------------------------------------------*/
  235. /* Cache victim limits */
  236. /*----------------------------------------------------------------*/
  237. /* floors 0, ceiling max to use the entire cache -- nothing locked
  238. */
  239. lis r1,0x0001
  240. ori r1,r1,0xf800
  241. mtspr ivlim,r1
  242. mtspr dvlim,r1
  243. /*----------------------------------------------------------------*/
  244. /* Clear all TLB entries -- TID = 0, TS = 0 */
  245. /*----------------------------------------------------------------*/
  246. mtspr mmucr,r0
  247. li r1,0x003f /* 64 TLB entries */
  248. mtctr r1
  249. 0: tlbwe r0,r1,0x0000 /* Invalidate all entries (V=0)*/
  250. subi r1,r1,0x0001
  251. bdnz 0b
  252. /*----------------------------------------------------------------*/
  253. /* TLB entry setup -- step thru tlbtab */
  254. /*----------------------------------------------------------------*/
  255. bl tlbtab /* Get tlbtab pointer */
  256. mr r5,r0
  257. li r1,0x003f /* 64 TLB entries max */
  258. mtctr r1
  259. li r4,0 /* TLB # */
  260. addi r5,r5,-4
  261. 1: lwzu r0,4(r5)
  262. cmpwi r0,0
  263. beq 2f /* 0 marks end */
  264. lwzu r1,4(r5)
  265. lwzu r2,4(r5)
  266. tlbwe r0,r4,0 /* TLB Word 0 */
  267. tlbwe r1,r4,1 /* TLB Word 1 */
  268. tlbwe r2,r4,2 /* TLB Word 2 */
  269. addi r4,r4,1 /* Next TLB */
  270. bdnz 1b
  271. /*----------------------------------------------------------------*/
  272. /* Continue from 'normal' start */
  273. /*----------------------------------------------------------------*/
  274. 2: bl 3f
  275. b _start
  276. 3: li r0,0
  277. mtspr srr1,r0 /* Keep things disabled for now */
  278. mflr r1
  279. mtspr srr0,r1
  280. rfi
  281. #endif /* CONFIG_440 */
  282. /*
  283. * r3 - 1st arg to board_init(): IMMP pointer
  284. * r4 - 2nd arg to board_init(): boot flag
  285. */
  286. .text
  287. .long 0x27051956 /* U-Boot Magic Number */
  288. .globl version_string
  289. version_string:
  290. .ascii U_BOOT_VERSION
  291. .ascii " (", __DATE__, " - ", __TIME__, ")"
  292. .ascii CONFIG_IDENT_STRING, "\0"
  293. /*
  294. * Maybe this should be moved somewhere else because the current
  295. * location (0x100) is where the CriticalInput Execption should be.
  296. */
  297. . = EXC_OFF_SYS_RESET
  298. .globl _start
  299. _start:
  300. /*****************************************************************************/
  301. #if defined(CONFIG_440)
  302. /*----------------------------------------------------------------*/
  303. /* Clear and set up some registers. */
  304. /*----------------------------------------------------------------*/
  305. li r0,0x0000
  306. lis r1,0xffff
  307. mtspr dec,r0 /* prevent dec exceptions */
  308. mtspr tbl,r0 /* prevent fit & wdt exceptions */
  309. mtspr tbu,r0
  310. mtspr tsr,r1 /* clear all timer exception status */
  311. mtspr tcr,r0 /* disable all */
  312. mtspr esr,r0 /* clear exception syndrome register */
  313. mtxer r0 /* clear integer exception register */
  314. #if !defined(CONFIG_440GX)
  315. lis r1,0x0002 /* set CE bit (Critical Exceptions) */
  316. ori r1,r1,0x1000 /* set ME bit (Machine Exceptions) */
  317. mtmsr r1 /* change MSR */
  318. #elif !defined(CONFIG_440EP) && !defined(CONFIG_440GR)
  319. bl __440gx_msr_set
  320. b __440gx_msr_continue
  321. __440gx_msr_set:
  322. lis r1, 0x0002 /* set CE bit (Critical Exceptions) */
  323. ori r1,r1,0x1000 /* set ME bit (Machine Exceptions) */
  324. mtspr srr1,r1
  325. mflr r1
  326. mtspr srr0,r1
  327. rfi
  328. __440gx_msr_continue:
  329. #endif
  330. /*----------------------------------------------------------------*/
  331. /* Debug setup -- some (not very good) ice's need an event*/
  332. /* to establish control :-( Define CFG_INIT_DBCR to the dbsr */
  333. /* value you need in this case 0x8cff 0000 should do the trick */
  334. /*----------------------------------------------------------------*/
  335. #if defined(CFG_INIT_DBCR)
  336. lis r1,0xffff
  337. ori r1,r1,0xffff
  338. mtspr dbsr,r1 /* Clear all status bits */
  339. lis r0,CFG_INIT_DBCR@h
  340. ori r0,r0,CFG_INIT_DBCR@l
  341. mtspr dbcr0,r0
  342. isync
  343. #endif
  344. /*----------------------------------------------------------------*/
  345. /* Setup the internal SRAM */
  346. /*----------------------------------------------------------------*/
  347. li r0,0
  348. #if defined(CONFIG_440EP) || defined(CONFIG_440GR)
  349. /* Clear Dcache to use as RAM */
  350. addis r3,r0,CFG_INIT_RAM_ADDR@h
  351. ori r3,r3,CFG_INIT_RAM_ADDR@l
  352. addis r4,r0,CFG_INIT_RAM_END@h
  353. ori r4,r4,CFG_INIT_RAM_END@l
  354. rlwinm. r5,r4,0,27,31
  355. rlwinm r5,r4,27,5,31
  356. beq ..d_ran
  357. addi r5,r5,0x0001
  358. ..d_ran:
  359. mtctr r5
  360. ..d_ag:
  361. dcbz r0,r3
  362. addi r3,r3,32
  363. bdnz ..d_ag
  364. #else
  365. #if defined (CONFIG_440GX) || defined(CONFIG_440SP)
  366. mtdcr l2_cache_cfg,r0 /* Ensure L2 Cache is off */
  367. #endif
  368. mtdcr isram0_sb1cr,r0 /* Disable bank 1 */
  369. li r2,0x7fff
  370. ori r2,r2,0xffff
  371. mfdcr r1,isram0_dpc
  372. and r1,r1,r2 /* Disable parity check */
  373. mtdcr isram0_dpc,r1
  374. mfdcr r1,isram0_pmeg
  375. andis. r1,r1,r2 /* Disable pwr mgmt */
  376. mtdcr isram0_pmeg,r1
  377. lis r1,0x8000 /* BAS = 8000_0000 */
  378. #if defined(CONFIG_440GX) || defined(CONFIG_440SP)
  379. ori r1,r1,0x0980 /* first 64k */
  380. mtdcr isram0_sb0cr,r1
  381. lis r1,0x8001
  382. ori r1,r1,0x0980 /* second 64k */
  383. mtdcr isram0_sb1cr,r1
  384. lis r1, 0x8002
  385. ori r1,r1, 0x0980 /* third 64k */
  386. mtdcr isram0_sb2cr,r1
  387. lis r1, 0x8003
  388. ori r1,r1, 0x0980 /* fourth 64k */
  389. mtdcr isram0_sb3cr,r1
  390. #else
  391. ori r1,r1,0x0380 /* 8k rw */
  392. mtdcr isram0_sb0cr,r1
  393. #endif
  394. #endif
  395. /*----------------------------------------------------------------*/
  396. /* Setup the stack in internal SRAM */
  397. /*----------------------------------------------------------------*/
  398. lis r1,CFG_INIT_RAM_ADDR@h
  399. ori r1,r1,CFG_INIT_SP_OFFSET@l
  400. li r0,0
  401. stwu r0,-4(r1)
  402. stwu r0,-4(r1) /* Terminate call chain */
  403. stwu r1,-8(r1) /* Save back chain and move SP */
  404. lis r0,RESET_VECTOR@h /* Address of reset vector */
  405. ori r0,r0, RESET_VECTOR@l
  406. stwu r1,-8(r1) /* Save back chain and move SP */
  407. stw r0,+12(r1) /* Save return addr (underflow vect) */
  408. GET_GOT
  409. bl cpu_init_f /* run low-level CPU init code (from Flash) */
  410. bl board_init_f
  411. #endif /* CONFIG_440 */
  412. /*****************************************************************************/
  413. #ifdef CONFIG_IOP480
  414. /*----------------------------------------------------------------------- */
  415. /* Set up some machine state registers. */
  416. /*----------------------------------------------------------------------- */
  417. addi r0,r0,0x0000 /* initialize r0 to zero */
  418. mtspr esr,r0 /* clear Exception Syndrome Reg */
  419. mttcr r0 /* timer control register */
  420. mtexier r0 /* disable all interrupts */
  421. addi r4,r0,0x1000 /* set ME bit (Machine Exceptions) */
  422. oris r4,r4,0x2 /* set CE bit (Critical Exceptions) */
  423. mtmsr r4 /* change MSR */
  424. addis r4,r0,0xFFFF /* set r4 to 0xFFFFFFFF (status in the */
  425. ori r4,r4,0xFFFF /* dbsr is cleared by setting bits to 1) */
  426. mtdbsr r4 /* clear/reset the dbsr */
  427. mtexisr r4 /* clear all pending interrupts */
  428. addis r4,r0,0x8000
  429. mtexier r4 /* enable critical exceptions */
  430. addis r4,r0,0x0000 /* assume 403GCX - enable core clk */
  431. ori r4,r4,0x4020 /* dbling (no harm done on GA and GC */
  432. mtiocr r4 /* since bit not used) & DRC to latch */
  433. /* data bus on rising edge of CAS */
  434. /*----------------------------------------------------------------------- */
  435. /* Clear XER. */
  436. /*----------------------------------------------------------------------- */
  437. mtxer r0
  438. /*----------------------------------------------------------------------- */
  439. /* Invalidate i-cache and d-cache TAG arrays. */
  440. /*----------------------------------------------------------------------- */
  441. addi r3,0,1024 /* 1/4 of I-cache size, half of D-cache */
  442. addi r4,0,1024 /* 1/4 of I-cache */
  443. ..cloop:
  444. iccci 0,r3
  445. iccci r4,r3
  446. dccci 0,r3
  447. addic. r3,r3,-16 /* move back one cache line */
  448. bne ..cloop /* loop back to do rest until r3 = 0 */
  449. /* */
  450. /* initialize IOP480 so it can read 1 MB code area for SRAM spaces */
  451. /* this requires enabling MA[17..0], by default only MA[12..0] are enabled. */
  452. /* */
  453. /* first copy IOP480 register base address into r3 */
  454. addis r3,0,0x5000 /* IOP480 register base address hi */
  455. /* ori r3,r3,0x0000 / IOP480 register base address lo */
  456. #ifdef CONFIG_ADCIOP
  457. /* use r4 as the working variable */
  458. /* turn on CS3 (LOCCTL.7) */
  459. lwz r4,0x84(r3) /* LOCTL is at offset 0x84 */
  460. andi. r4,r4,0xff7f /* make bit 7 = 0 -- CS3 mode */
  461. stw r4,0x84(r3) /* LOCTL is at offset 0x84 */
  462. #endif
  463. #ifdef CONFIG_DASA_SIM
  464. /* use r4 as the working variable */
  465. /* turn on MA17 (LOCCTL.7) */
  466. lwz r4,0x84(r3) /* LOCTL is at offset 0x84 */
  467. ori r4,r4,0x80 /* make bit 7 = 1 -- MA17 mode */
  468. stw r4,0x84(r3) /* LOCTL is at offset 0x84 */
  469. #endif
  470. /* turn on MA16..13 (LCS0BRD.12 = 0) */
  471. lwz r4,0x100(r3) /* LCS0BRD is at offset 0x100 */
  472. andi. r4,r4,0xefff /* make bit 12 = 0 */
  473. stw r4,0x100(r3) /* LCS0BRD is at offset 0x100 */
  474. /* make sure above stores all comlete before going on */
  475. sync
  476. /* last thing, set local init status done bit (DEVINIT.31) */
  477. lwz r4,0x80(r3) /* DEVINIT is at offset 0x80 */
  478. oris r4,r4,0x8000 /* make bit 31 = 1 */
  479. stw r4,0x80(r3) /* DEVINIT is at offset 0x80 */
  480. /* clear all pending interrupts and disable all interrupts */
  481. li r4,-1 /* set p1 to 0xffffffff */
  482. stw r4,0x1b0(r3) /* clear all pending interrupts */
  483. stw r4,0x1b8(r3) /* clear all pending interrupts */
  484. li r4,0 /* set r4 to 0 */
  485. stw r4,0x1b4(r3) /* disable all interrupts */
  486. stw r4,0x1bc(r3) /* disable all interrupts */
  487. /* make sure above stores all comlete before going on */
  488. sync
  489. /*----------------------------------------------------------------------- */
  490. /* Enable two 128MB cachable regions. */
  491. /*----------------------------------------------------------------------- */
  492. addis r1,r0,0x8000
  493. addi r1,r1,0x0001
  494. mticcr r1 /* instruction cache */
  495. addis r1,r0,0x0000
  496. addi r1,r1,0x0000
  497. mtdccr r1 /* data cache */
  498. addis r1,r0,CFG_INIT_RAM_ADDR@h
  499. ori r1,r1,CFG_INIT_SP_OFFSET /* set up the stack to SDRAM */
  500. li r0, 0 /* Make room for stack frame header and */
  501. stwu r0, -4(r1) /* clear final stack frame so that */
  502. stwu r0, -4(r1) /* stack backtraces terminate cleanly */
  503. GET_GOT /* initialize GOT access */
  504. bl board_init_f /* run first part of init code (from Flash) */
  505. #endif /* CONFIG_IOP480 */
  506. /*****************************************************************************/
  507. #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_405) || defined(CONFIG_405EP)
  508. /*----------------------------------------------------------------------- */
  509. /* Clear and set up some registers. */
  510. /*----------------------------------------------------------------------- */
  511. addi r4,r0,0x0000
  512. mtspr sgr,r4
  513. mtspr dcwr,r4
  514. mtesr r4 /* clear Exception Syndrome Reg */
  515. mttcr r4 /* clear Timer Control Reg */
  516. mtxer r4 /* clear Fixed-Point Exception Reg */
  517. mtevpr r4 /* clear Exception Vector Prefix Reg */
  518. addi r4,r0,0x1000 /* set ME bit (Machine Exceptions) */
  519. oris r4,r4,0x0002 /* set CE bit (Critical Exceptions) */
  520. mtmsr r4 /* change MSR */
  521. addi r4,r0,(0xFFFF-0x10000) /* set r4 to 0xFFFFFFFF (status in the */
  522. /* dbsr is cleared by setting bits to 1) */
  523. mtdbsr r4 /* clear/reset the dbsr */
  524. /*----------------------------------------------------------------------- */
  525. /* Invalidate I and D caches. Enable I cache for defined memory regions */
  526. /* to speed things up. Leave the D cache disabled for now. It will be */
  527. /* enabled/left disabled later based on user selected menu options. */
  528. /* Be aware that the I cache may be disabled later based on the menu */
  529. /* options as well. See miscLib/main.c. */
  530. /*----------------------------------------------------------------------- */
  531. bl invalidate_icache
  532. bl invalidate_dcache
  533. /*----------------------------------------------------------------------- */
  534. /* Enable two 128MB cachable regions. */
  535. /*----------------------------------------------------------------------- */
  536. addis r4,r0,0x8000
  537. addi r4,r4,0x0001
  538. mticcr r4 /* instruction cache */
  539. isync
  540. addis r4,r0,0x0000
  541. addi r4,r4,0x0000
  542. mtdccr r4 /* data cache */
  543. #if !(defined(CFG_EBC_PB0AP) && defined(CFG_EBC_PB0CR))
  544. /*----------------------------------------------------------------------- */
  545. /* Tune the speed and size for flash CS0 */
  546. /*----------------------------------------------------------------------- */
  547. bl ext_bus_cntlr_init
  548. #endif
  549. #if defined(CONFIG_405EP)
  550. /*----------------------------------------------------------------------- */
  551. /* DMA Status, clear to come up clean */
  552. /*----------------------------------------------------------------------- */
  553. addis r3,r0, 0xFFFF /* Clear all existing DMA status */
  554. ori r3,r3, 0xFFFF
  555. mtdcr dmasr, r3
  556. bl ppc405ep_init /* do ppc405ep specific init */
  557. #endif /* CONFIG_405EP */
  558. #if defined(CFG_OCM_DATA_ADDR) && defined(CFG_OCM_DATA_SIZE)
  559. /********************************************************************
  560. * Setup OCM - On Chip Memory
  561. *******************************************************************/
  562. /* Setup OCM */
  563. lis r0, 0x7FFF
  564. ori r0, r0, 0xFFFF
  565. mfdcr r3, ocmiscntl /* get instr-side IRAM config */
  566. mfdcr r4, ocmdscntl /* get data-side IRAM config */
  567. and r3, r3, r0 /* disable data-side IRAM */
  568. and r4, r4, r0 /* disable data-side IRAM */
  569. mtdcr ocmiscntl, r3 /* set instr-side IRAM config */
  570. mtdcr ocmdscntl, r4 /* set data-side IRAM config */
  571. isync
  572. addis r3, 0, CFG_OCM_DATA_ADDR@h /* OCM location */
  573. mtdcr ocmdsarc, r3
  574. addis r4, 0, 0xC000 /* OCM data area enabled */
  575. mtdcr ocmdscntl, r4
  576. isync
  577. #endif
  578. /*----------------------------------------------------------------------- */
  579. /* Setup temporary stack in DCACHE or OCM if needed for SDRAM SPD. */
  580. /*----------------------------------------------------------------------- */
  581. #ifdef CFG_INIT_DCACHE_CS
  582. /*----------------------------------------------------------------------- */
  583. /* Memory Bank x (nothingness) initialization 1GB+64MEG */
  584. /* used as temporary stack pointer for stage0 */
  585. /*----------------------------------------------------------------------- */
  586. li r4,PBxAP
  587. mtdcr ebccfga,r4
  588. lis r4,0x0380
  589. ori r4,r4,0x0480
  590. mtdcr ebccfgd,r4
  591. addi r4,0,PBxCR
  592. mtdcr ebccfga,r4
  593. lis r4,0x400D
  594. ori r4,r4,0xa000
  595. mtdcr ebccfgd,r4
  596. /* turn on data chache for this region */
  597. lis r4,0x0080
  598. mtdccr r4
  599. /* set stack pointer and clear stack to known value */
  600. lis r1,CFG_INIT_RAM_ADDR@h
  601. ori r1,r1,CFG_INIT_SP_OFFSET@l
  602. li r4,2048 /* we store 2048 words to stack */
  603. mtctr r4
  604. lis r2,CFG_INIT_RAM_ADDR@h /* we also clear data area */
  605. ori r2,r2,CFG_INIT_RAM_END@l /* so cant copy value from r1 */
  606. lis r4,0xdead /* we store 0xdeaddead in the stack */
  607. ori r4,r4,0xdead
  608. ..stackloop:
  609. stwu r4,-4(r2)
  610. bdnz ..stackloop
  611. li r0, 0 /* Make room for stack frame header and */
  612. stwu r0, -4(r1) /* clear final stack frame so that */
  613. stwu r0, -4(r1) /* stack backtraces terminate cleanly */
  614. /*
  615. * Set up a dummy frame to store reset vector as return address.
  616. * this causes stack underflow to reset board.
  617. */
  618. stwu r1, -8(r1) /* Save back chain and move SP */
  619. addis r0, 0, RESET_VECTOR@h /* Address of reset vector */
  620. ori r0, r0, RESET_VECTOR@l
  621. stwu r1, -8(r1) /* Save back chain and move SP */
  622. stw r0, +12(r1) /* Save return addr (underflow vect) */
  623. #elif defined(CFG_TEMP_STACK_OCM) && \
  624. (defined(CFG_OCM_DATA_ADDR) && defined(CFG_OCM_DATA_SIZE))
  625. /*
  626. * Stack in OCM.
  627. */
  628. /* Set up Stack at top of OCM */
  629. lis r1, (CFG_INIT_RAM_ADDR + CFG_INIT_SP_OFFSET)@h
  630. ori r1, r1, (CFG_INIT_RAM_ADDR + CFG_INIT_SP_OFFSET)@l
  631. /* Set up a zeroized stack frame so that backtrace works right */
  632. li r0, 0
  633. stwu r0, -4(r1)
  634. stwu r0, -4(r1)
  635. /*
  636. * Set up a dummy frame to store reset vector as return address.
  637. * this causes stack underflow to reset board.
  638. */
  639. stwu r1, -8(r1) /* Save back chain and move SP */
  640. lis r0, RESET_VECTOR@h /* Address of reset vector */
  641. ori r0, r0, RESET_VECTOR@l
  642. stwu r1, -8(r1) /* Save back chain and move SP */
  643. stw r0, +12(r1) /* Save return addr (underflow vect) */
  644. #endif /* CFG_INIT_DCACHE_CS */
  645. /*----------------------------------------------------------------------- */
  646. /* Initialize SDRAM Controller */
  647. /*----------------------------------------------------------------------- */
  648. bl sdram_init
  649. /*
  650. * Setup temporary stack pointer only for boards
  651. * that do not use SDRAM SPD I2C stuff since it
  652. * is already initialized to use DCACHE or OCM
  653. * stacks.
  654. */
  655. #if !(defined(CFG_INIT_DCACHE_CS) || defined(CFG_TEMP_STACK_OCM))
  656. lis r1, CFG_INIT_RAM_ADDR@h
  657. ori r1,r1,CFG_INIT_SP_OFFSET /* set up the stack in SDRAM */
  658. li r0, 0 /* Make room for stack frame header and */
  659. stwu r0, -4(r1) /* clear final stack frame so that */
  660. stwu r0, -4(r1) /* stack backtraces terminate cleanly */
  661. /*
  662. * Set up a dummy frame to store reset vector as return address.
  663. * this causes stack underflow to reset board.
  664. */
  665. stwu r1, -8(r1) /* Save back chain and move SP */
  666. lis r0, RESET_VECTOR@h /* Address of reset vector */
  667. ori r0, r0, RESET_VECTOR@l
  668. stwu r1, -8(r1) /* Save back chain and move SP */
  669. stw r0, +12(r1) /* Save return addr (underflow vect) */
  670. #endif /* !(CFG_INIT_DCACHE_CS || !CFG_TEM_STACK_OCM) */
  671. GET_GOT /* initialize GOT access */
  672. bl cpu_init_f /* run low-level CPU init code (from Flash) */
  673. /* NEVER RETURNS! */
  674. bl board_init_f /* run first part of init code (from Flash) */
  675. #endif /* CONFIG_405GP || CONFIG_405CR || CONFIG_405 || CONFIG_405EP */
  676. /*----------------------------------------------------------------------- */
  677. /*****************************************************************************/
  678. .globl _start_of_vectors
  679. _start_of_vectors:
  680. #if 0
  681. /*TODO Fixup _start above so we can do this*/
  682. /* Critical input. */
  683. CRIT_EXCEPTION(0x100, CritcalInput, CritcalInputException)
  684. #endif
  685. /* Machine check */
  686. CRIT_EXCEPTION(0x200, MachineCheck, MachineCheckException)
  687. /* Data Storage exception. */
  688. STD_EXCEPTION(0x300, DataStorage, UnknownException)
  689. /* Instruction Storage exception. */
  690. STD_EXCEPTION(0x400, InstStorage, UnknownException)
  691. /* External Interrupt exception. */
  692. STD_EXCEPTION(0x500, ExtInterrupt, external_interrupt)
  693. /* Alignment exception. */
  694. . = 0x600
  695. Alignment:
  696. EXCEPTION_PROLOG
  697. mfspr r4,DAR
  698. stw r4,_DAR(r21)
  699. mfspr r5,DSISR
  700. stw r5,_DSISR(r21)
  701. addi r3,r1,STACK_FRAME_OVERHEAD
  702. li r20,MSR_KERNEL
  703. rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */
  704. lwz r6,GOT(transfer_to_handler)
  705. mtlr r6
  706. blrl
  707. .L_Alignment:
  708. .long AlignmentException - _start + EXC_OFF_SYS_RESET
  709. .long int_return - _start + EXC_OFF_SYS_RESET
  710. /* Program check exception */
  711. . = 0x700
  712. ProgramCheck:
  713. EXCEPTION_PROLOG
  714. addi r3,r1,STACK_FRAME_OVERHEAD
  715. li r20,MSR_KERNEL
  716. rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */
  717. lwz r6,GOT(transfer_to_handler)
  718. mtlr r6
  719. blrl
  720. .L_ProgramCheck:
  721. .long ProgramCheckException - _start + EXC_OFF_SYS_RESET
  722. .long int_return - _start + EXC_OFF_SYS_RESET
  723. /* No FPU on MPC8xx. This exception is not supposed to happen.
  724. */
  725. STD_EXCEPTION(0x800, FPUnavailable, UnknownException)
  726. /* I guess we could implement decrementer, and may have
  727. * to someday for timekeeping.
  728. */
  729. STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
  730. STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
  731. STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
  732. STD_EXCEPTION(0xc00, SystemCall, UnknownException)
  733. STD_EXCEPTION(0xd00, SingleStep, UnknownException)
  734. STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
  735. STD_EXCEPTION(0xf00, Trap_0f, UnknownException)
  736. /* On the MPC8xx, this is a software emulation interrupt. It occurs
  737. * for all unimplemented and illegal instructions.
  738. */
  739. STD_EXCEPTION(0x1000, PIT, PITException)
  740. STD_EXCEPTION(0x1100, InstructionTLBMiss, UnknownException)
  741. STD_EXCEPTION(0x1200, DataTLBMiss, UnknownException)
  742. STD_EXCEPTION(0x1300, InstructionTLBError, UnknownException)
  743. STD_EXCEPTION(0x1400, DataTLBError, UnknownException)
  744. STD_EXCEPTION(0x1500, Reserved5, UnknownException)
  745. STD_EXCEPTION(0x1600, Reserved6, UnknownException)
  746. STD_EXCEPTION(0x1700, Reserved7, UnknownException)
  747. STD_EXCEPTION(0x1800, Reserved8, UnknownException)
  748. STD_EXCEPTION(0x1900, Reserved9, UnknownException)
  749. STD_EXCEPTION(0x1a00, ReservedA, UnknownException)
  750. STD_EXCEPTION(0x1b00, ReservedB, UnknownException)
  751. STD_EXCEPTION(0x1c00, DataBreakpoint, UnknownException)
  752. STD_EXCEPTION(0x1d00, InstructionBreakpoint, UnknownException)
  753. STD_EXCEPTION(0x1e00, PeripheralBreakpoint, UnknownException)
  754. STD_EXCEPTION(0x1f00, DevPortBreakpoint, UnknownException)
  755. CRIT_EXCEPTION(0x2000, DebugBreakpoint, DebugException )
  756. .globl _end_of_vectors
  757. _end_of_vectors:
  758. . = 0x2100
  759. /*
  760. * This code finishes saving the registers to the exception frame
  761. * and jumps to the appropriate handler for the exception.
  762. * Register r21 is pointer into trap frame, r1 has new stack pointer.
  763. */
  764. .globl transfer_to_handler
  765. transfer_to_handler:
  766. stw r22,_NIP(r21)
  767. lis r22,MSR_POW@h
  768. andc r23,r23,r22
  769. stw r23,_MSR(r21)
  770. SAVE_GPR(7, r21)
  771. SAVE_4GPRS(8, r21)
  772. SAVE_8GPRS(12, r21)
  773. SAVE_8GPRS(24, r21)
  774. #if 0
  775. andi. r23,r23,MSR_PR
  776. mfspr r23,SPRG3 /* if from user, fix up tss.regs */
  777. beq 2f
  778. addi r24,r1,STACK_FRAME_OVERHEAD
  779. stw r24,PT_REGS(r23)
  780. 2: addi r2,r23,-TSS /* set r2 to current */
  781. tovirt(r2,r2,r23)
  782. #endif
  783. mflr r23
  784. andi. r24,r23,0x3f00 /* get vector offset */
  785. stw r24,TRAP(r21)
  786. li r22,0
  787. stw r22,RESULT(r21)
  788. mtspr SPRG2,r22 /* r1 is now kernel sp */
  789. #if 0
  790. addi r24,r2,TASK_STRUCT_SIZE /* check for kernel stack overflow */
  791. cmplw 0,r1,r2
  792. cmplw 1,r1,r24
  793. crand 1,1,4
  794. bgt stack_ovf /* if r2 < r1 < r2+TASK_STRUCT_SIZE */
  795. #endif
  796. lwz r24,0(r23) /* virtual address of handler */
  797. lwz r23,4(r23) /* where to go when done */
  798. mtspr SRR0,r24
  799. mtspr SRR1,r20
  800. mtlr r23
  801. SYNC
  802. rfi /* jump to handler, enable MMU */
  803. int_return:
  804. mfmsr r28 /* Disable interrupts */
  805. li r4,0
  806. ori r4,r4,MSR_EE
  807. andc r28,r28,r4
  808. SYNC /* Some chip revs need this... */
  809. mtmsr r28
  810. SYNC
  811. lwz r2,_CTR(r1)
  812. lwz r0,_LINK(r1)
  813. mtctr r2
  814. mtlr r0
  815. lwz r2,_XER(r1)
  816. lwz r0,_CCR(r1)
  817. mtspr XER,r2
  818. mtcrf 0xFF,r0
  819. REST_10GPRS(3, r1)
  820. REST_10GPRS(13, r1)
  821. REST_8GPRS(23, r1)
  822. REST_GPR(31, r1)
  823. lwz r2,_NIP(r1) /* Restore environment */
  824. lwz r0,_MSR(r1)
  825. mtspr SRR0,r2
  826. mtspr SRR1,r0
  827. lwz r0,GPR0(r1)
  828. lwz r2,GPR2(r1)
  829. lwz r1,GPR1(r1)
  830. SYNC
  831. rfi
  832. crit_return:
  833. mfmsr r28 /* Disable interrupts */
  834. li r4,0
  835. ori r4,r4,MSR_EE
  836. andc r28,r28,r4
  837. SYNC /* Some chip revs need this... */
  838. mtmsr r28
  839. SYNC
  840. lwz r2,_CTR(r1)
  841. lwz r0,_LINK(r1)
  842. mtctr r2
  843. mtlr r0
  844. lwz r2,_XER(r1)
  845. lwz r0,_CCR(r1)
  846. mtspr XER,r2
  847. mtcrf 0xFF,r0
  848. REST_10GPRS(3, r1)
  849. REST_10GPRS(13, r1)
  850. REST_8GPRS(23, r1)
  851. REST_GPR(31, r1)
  852. lwz r2,_NIP(r1) /* Restore environment */
  853. lwz r0,_MSR(r1)
  854. mtspr 990,r2 /* SRR2 */
  855. mtspr 991,r0 /* SRR3 */
  856. lwz r0,GPR0(r1)
  857. lwz r2,GPR2(r1)
  858. lwz r1,GPR1(r1)
  859. SYNC
  860. rfci
  861. /* Cache functions.
  862. */
  863. invalidate_icache:
  864. iccci r0,r0 /* for 405, iccci invalidates the */
  865. blr /* entire I cache */
  866. invalidate_dcache:
  867. addi r6,0,0x0000 /* clear GPR 6 */
  868. /* Do loop for # of dcache congruence classes. */
  869. lis r7, (CFG_DCACHE_SIZE / CFG_CACHELINE_SIZE / 2)@ha /* TBS for large sized cache */
  870. ori r7, r7, (CFG_DCACHE_SIZE / CFG_CACHELINE_SIZE / 2)@l
  871. /* NOTE: dccci invalidates both */
  872. mtctr r7 /* ways in the D cache */
  873. ..dcloop:
  874. dccci 0,r6 /* invalidate line */
  875. addi r6,r6, CFG_CACHELINE_SIZE /* bump to next line */
  876. bdnz ..dcloop
  877. blr
  878. flush_dcache:
  879. addis r9,r0,0x0002 /* set mask for EE and CE msr bits */
  880. ori r9,r9,0x8000
  881. mfmsr r12 /* save msr */
  882. andc r9,r12,r9
  883. mtmsr r9 /* disable EE and CE */
  884. addi r10,r0,0x0001 /* enable data cache for unused memory */
  885. mfdccr r9 /* region 0xF8000000-0xFFFFFFFF via */
  886. or r10,r10,r9 /* bit 31 in dccr */
  887. mtdccr r10
  888. /* do loop for # of congruence classes. */
  889. lis r10,(CFG_DCACHE_SIZE / CFG_CACHELINE_SIZE / 2)@ha /* TBS: for large cache sizes */
  890. ori r10,r10,(CFG_DCACHE_SIZE / CFG_CACHELINE_SIZE / 2)@l
  891. lis r11,(CFG_DCACHE_SIZE / 2)@ha /* D cache set size - 2 way sets */
  892. ori r11,r11,(CFG_DCACHE_SIZE / 2)@l /* D cache set size - 2 way sets */
  893. mtctr r10
  894. addi r10,r0,(0xE000-0x10000) /* start at 0xFFFFE000 */
  895. add r11,r10,r11 /* add to get to other side of cache line */
  896. ..flush_dcache_loop:
  897. lwz r3,0(r10) /* least recently used side */
  898. lwz r3,0(r11) /* the other side */
  899. dccci r0,r11 /* invalidate both sides */
  900. addi r10,r10,CFG_CACHELINE_SIZE /* bump to next line */
  901. addi r11,r11,CFG_CACHELINE_SIZE /* bump to next line */
  902. bdnz ..flush_dcache_loop
  903. sync /* allow memory access to complete */
  904. mtdccr r9 /* restore dccr */
  905. mtmsr r12 /* restore msr */
  906. blr
  907. .globl icache_enable
  908. icache_enable:
  909. mflr r8
  910. bl invalidate_icache
  911. mtlr r8
  912. isync
  913. addis r3,r0, 0x8000 /* set bit 0 */
  914. mticcr r3
  915. blr
  916. .globl icache_disable
  917. icache_disable:
  918. addis r3,r0, 0x0000 /* clear bit 0 */
  919. mticcr r3
  920. isync
  921. blr
  922. .globl icache_status
  923. icache_status:
  924. mficcr r3
  925. srwi r3, r3, 31 /* >>31 => select bit 0 */
  926. blr
  927. .globl dcache_enable
  928. dcache_enable:
  929. mflr r8
  930. bl invalidate_dcache
  931. mtlr r8
  932. isync
  933. addis r3,r0, 0x8000 /* set bit 0 */
  934. mtdccr r3
  935. blr
  936. .globl dcache_disable
  937. dcache_disable:
  938. mflr r8
  939. bl flush_dcache
  940. mtlr r8
  941. addis r3,r0, 0x0000 /* clear bit 0 */
  942. mtdccr r3
  943. blr
  944. .globl dcache_status
  945. dcache_status:
  946. mfdccr r3
  947. srwi r3, r3, 31 /* >>31 => select bit 0 */
  948. blr
  949. .globl get_pvr
  950. get_pvr:
  951. mfspr r3, PVR
  952. blr
  953. #if !defined(CONFIG_440)
  954. .globl wr_pit
  955. wr_pit:
  956. mtspr pit, r3
  957. blr
  958. #endif
  959. .globl wr_tcr
  960. wr_tcr:
  961. mtspr tcr, r3
  962. blr
  963. /*------------------------------------------------------------------------------- */
  964. /* Function: in8 */
  965. /* Description: Input 8 bits */
  966. /*------------------------------------------------------------------------------- */
  967. .globl in8
  968. in8:
  969. lbz r3,0x0000(r3)
  970. blr
  971. /*------------------------------------------------------------------------------- */
  972. /* Function: out8 */
  973. /* Description: Output 8 bits */
  974. /*------------------------------------------------------------------------------- */
  975. .globl out8
  976. out8:
  977. stb r4,0x0000(r3)
  978. blr
  979. /*------------------------------------------------------------------------------- */
  980. /* Function: out16 */
  981. /* Description: Output 16 bits */
  982. /*------------------------------------------------------------------------------- */
  983. .globl out16
  984. out16:
  985. sth r4,0x0000(r3)
  986. blr
  987. /*------------------------------------------------------------------------------- */
  988. /* Function: out16r */
  989. /* Description: Byte reverse and output 16 bits */
  990. /*------------------------------------------------------------------------------- */
  991. .globl out16r
  992. out16r:
  993. sthbrx r4,r0,r3
  994. blr
  995. /*------------------------------------------------------------------------------- */
  996. /* Function: out32 */
  997. /* Description: Output 32 bits */
  998. /*------------------------------------------------------------------------------- */
  999. .globl out32
  1000. out32:
  1001. stw r4,0x0000(r3)
  1002. blr
  1003. /*------------------------------------------------------------------------------- */
  1004. /* Function: out32r */
  1005. /* Description: Byte reverse and output 32 bits */
  1006. /*------------------------------------------------------------------------------- */
  1007. .globl out32r
  1008. out32r:
  1009. stwbrx r4,r0,r3
  1010. blr
  1011. /*------------------------------------------------------------------------------- */
  1012. /* Function: in16 */
  1013. /* Description: Input 16 bits */
  1014. /*------------------------------------------------------------------------------- */
  1015. .globl in16
  1016. in16:
  1017. lhz r3,0x0000(r3)
  1018. blr
  1019. /*------------------------------------------------------------------------------- */
  1020. /* Function: in16r */
  1021. /* Description: Input 16 bits and byte reverse */
  1022. /*------------------------------------------------------------------------------- */
  1023. .globl in16r
  1024. in16r:
  1025. lhbrx r3,r0,r3
  1026. blr
  1027. /*------------------------------------------------------------------------------- */
  1028. /* Function: in32 */
  1029. /* Description: Input 32 bits */
  1030. /*------------------------------------------------------------------------------- */
  1031. .globl in32
  1032. in32:
  1033. lwz 3,0x0000(3)
  1034. blr
  1035. /*------------------------------------------------------------------------------- */
  1036. /* Function: in32r */
  1037. /* Description: Input 32 bits and byte reverse */
  1038. /*------------------------------------------------------------------------------- */
  1039. .globl in32r
  1040. in32r:
  1041. lwbrx r3,r0,r3
  1042. blr
  1043. /*------------------------------------------------------------------------------- */
  1044. /* Function: ppcDcbf */
  1045. /* Description: Data Cache block flush */
  1046. /* Input: r3 = effective address */
  1047. /* Output: none. */
  1048. /*------------------------------------------------------------------------------- */
  1049. .globl ppcDcbf
  1050. ppcDcbf:
  1051. dcbf r0,r3
  1052. blr
  1053. /*------------------------------------------------------------------------------- */
  1054. /* Function: ppcDcbi */
  1055. /* Description: Data Cache block Invalidate */
  1056. /* Input: r3 = effective address */
  1057. /* Output: none. */
  1058. /*------------------------------------------------------------------------------- */
  1059. .globl ppcDcbi
  1060. ppcDcbi:
  1061. dcbi r0,r3
  1062. blr
  1063. /*------------------------------------------------------------------------------- */
  1064. /* Function: ppcSync */
  1065. /* Description: Processor Synchronize */
  1066. /* Input: none. */
  1067. /* Output: none. */
  1068. /*------------------------------------------------------------------------------- */
  1069. .globl ppcSync
  1070. ppcSync:
  1071. sync
  1072. blr
  1073. /*------------------------------------------------------------------------------*/
  1074. /*
  1075. * void relocate_code (addr_sp, gd, addr_moni)
  1076. *
  1077. * This "function" does not return, instead it continues in RAM
  1078. * after relocating the monitor code.
  1079. *
  1080. * r3 = dest
  1081. * r4 = src
  1082. * r5 = length in bytes
  1083. * r6 = cachelinesize
  1084. */
  1085. .globl relocate_code
  1086. relocate_code:
  1087. #if defined(CONFIG_440EP) || defined(CONFIG_440GR)
  1088. dccci 0,0 /* Invalidate data cache, now no longer our stack */
  1089. sync
  1090. addi r1,r0,0x0000 /* TLB entry #0 */
  1091. tlbre r0,r1,0x0002 /* Read contents */
  1092. ori r0,r0,0x0c00 /* Or in the inhibit, write through bit */
  1093. tlbwe r0,r1,0x0002 /* Save it out */
  1094. isync
  1095. #endif
  1096. mr r1, r3 /* Set new stack pointer */
  1097. mr r9, r4 /* Save copy of Init Data pointer */
  1098. mr r10, r5 /* Save copy of Destination Address */
  1099. mr r3, r5 /* Destination Address */
  1100. lis r4, CFG_MONITOR_BASE@h /* Source Address */
  1101. ori r4, r4, CFG_MONITOR_BASE@l
  1102. lwz r5, GOT(__init_end)
  1103. sub r5, r5, r4
  1104. li r6, CFG_CACHELINE_SIZE /* Cache Line Size */
  1105. /*
  1106. * Fix GOT pointer:
  1107. *
  1108. * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) + Destination Address
  1109. *
  1110. * Offset:
  1111. */
  1112. sub r15, r10, r4
  1113. /* First our own GOT */
  1114. add r14, r14, r15
  1115. /* the the one used by the C code */
  1116. add r30, r30, r15
  1117. /*
  1118. * Now relocate code
  1119. */
  1120. cmplw cr1,r3,r4
  1121. addi r0,r5,3
  1122. srwi. r0,r0,2
  1123. beq cr1,4f /* In place copy is not necessary */
  1124. beq 7f /* Protect against 0 count */
  1125. mtctr r0
  1126. bge cr1,2f
  1127. la r8,-4(r4)
  1128. la r7,-4(r3)
  1129. 1: lwzu r0,4(r8)
  1130. stwu r0,4(r7)
  1131. bdnz 1b
  1132. b 4f
  1133. 2: slwi r0,r0,2
  1134. add r8,r4,r0
  1135. add r7,r3,r0
  1136. 3: lwzu r0,-4(r8)
  1137. stwu r0,-4(r7)
  1138. bdnz 3b
  1139. /*
  1140. * Now flush the cache: note that we must start from a cache aligned
  1141. * address. Otherwise we might miss one cache line.
  1142. */
  1143. 4: cmpwi r6,0
  1144. add r5,r3,r5
  1145. beq 7f /* Always flush prefetch queue in any case */
  1146. subi r0,r6,1
  1147. andc r3,r3,r0
  1148. mr r4,r3
  1149. 5: dcbst 0,r4
  1150. add r4,r4,r6
  1151. cmplw r4,r5
  1152. blt 5b
  1153. sync /* Wait for all dcbst to complete on bus */
  1154. mr r4,r3
  1155. 6: icbi 0,r4
  1156. add r4,r4,r6
  1157. cmplw r4,r5
  1158. blt 6b
  1159. 7: sync /* Wait for all icbi to complete on bus */
  1160. isync
  1161. /*
  1162. * We are done. Do not return, instead branch to second part of board
  1163. * initialization, now running from RAM.
  1164. */
  1165. addi r0, r10, in_ram - _start + EXC_OFF_SYS_RESET
  1166. mtlr r0
  1167. blr /* NEVER RETURNS! */
  1168. in_ram:
  1169. /*
  1170. * Relocation Function, r14 point to got2+0x8000
  1171. *
  1172. * Adjust got2 pointers, no need to check for 0, this code
  1173. * already puts a few entries in the table.
  1174. */
  1175. li r0,__got2_entries@sectoff@l
  1176. la r3,GOT(_GOT2_TABLE_)
  1177. lwz r11,GOT(_GOT2_TABLE_)
  1178. mtctr r0
  1179. sub r11,r3,r11
  1180. addi r3,r3,-4
  1181. 1: lwzu r0,4(r3)
  1182. add r0,r0,r11
  1183. stw r0,0(r3)
  1184. bdnz 1b
  1185. /*
  1186. * Now adjust the fixups and the pointers to the fixups
  1187. * in case we need to move ourselves again.
  1188. */
  1189. 2: li r0,__fixup_entries@sectoff@l
  1190. lwz r3,GOT(_FIXUP_TABLE_)
  1191. cmpwi r0,0
  1192. mtctr r0
  1193. addi r3,r3,-4
  1194. beq 4f
  1195. 3: lwzu r4,4(r3)
  1196. lwzux r0,r4,r11
  1197. add r0,r0,r11
  1198. stw r10,0(r3)
  1199. stw r0,0(r4)
  1200. bdnz 3b
  1201. 4:
  1202. clear_bss:
  1203. /*
  1204. * Now clear BSS segment
  1205. */
  1206. lwz r3,GOT(__bss_start)
  1207. lwz r4,GOT(_end)
  1208. cmplw 0, r3, r4
  1209. beq 6f
  1210. li r0, 0
  1211. 5:
  1212. stw r0, 0(r3)
  1213. addi r3, r3, 4
  1214. cmplw 0, r3, r4
  1215. bne 5b
  1216. 6:
  1217. mr r3, r9 /* Init Data pointer */
  1218. mr r4, r10 /* Destination Address */
  1219. bl board_init_r
  1220. /*
  1221. * Copy exception vector code to low memory
  1222. *
  1223. * r3: dest_addr
  1224. * r7: source address, r8: end address, r9: target address
  1225. */
  1226. .globl trap_init
  1227. trap_init:
  1228. lwz r7, GOT(_start)
  1229. lwz r8, GOT(_end_of_vectors)
  1230. li r9, 0x100 /* reset vector always at 0x100 */
  1231. cmplw 0, r7, r8
  1232. bgelr /* return if r7>=r8 - just in case */
  1233. mflr r4 /* save link register */
  1234. 1:
  1235. lwz r0, 0(r7)
  1236. stw r0, 0(r9)
  1237. addi r7, r7, 4
  1238. addi r9, r9, 4
  1239. cmplw 0, r7, r8
  1240. bne 1b
  1241. /*
  1242. * relocate `hdlr' and `int_return' entries
  1243. */
  1244. li r7, .L_MachineCheck - _start + EXC_OFF_SYS_RESET
  1245. li r8, Alignment - _start + EXC_OFF_SYS_RESET
  1246. 2:
  1247. bl trap_reloc
  1248. addi r7, r7, 0x100 /* next exception vector */
  1249. cmplw 0, r7, r8
  1250. blt 2b
  1251. li r7, .L_Alignment - _start + EXC_OFF_SYS_RESET
  1252. bl trap_reloc
  1253. li r7, .L_ProgramCheck - _start + EXC_OFF_SYS_RESET
  1254. bl trap_reloc
  1255. li r7, .L_FPUnavailable - _start + EXC_OFF_SYS_RESET
  1256. li r8, SystemCall - _start + EXC_OFF_SYS_RESET
  1257. 3:
  1258. bl trap_reloc
  1259. addi r7, r7, 0x100 /* next exception vector */
  1260. cmplw 0, r7, r8
  1261. blt 3b
  1262. li r7, .L_SingleStep - _start + EXC_OFF_SYS_RESET
  1263. li r8, _end_of_vectors - _start + EXC_OFF_SYS_RESET
  1264. 4:
  1265. bl trap_reloc
  1266. addi r7, r7, 0x100 /* next exception vector */
  1267. cmplw 0, r7, r8
  1268. blt 4b
  1269. mtlr r4 /* restore link register */
  1270. blr
  1271. /*
  1272. * Function: relocate entries for one exception vector
  1273. */
  1274. trap_reloc:
  1275. lwz r0, 0(r7) /* hdlr ... */
  1276. add r0, r0, r3 /* ... += dest_addr */
  1277. stw r0, 0(r7)
  1278. lwz r0, 4(r7) /* int_return ... */
  1279. add r0, r0, r3 /* ... += dest_addr */
  1280. stw r0, 4(r7)
  1281. blr
  1282. /**************************************************************************/
  1283. /* PPC405EP specific stuff */
  1284. /**************************************************************************/
  1285. #ifdef CONFIG_405EP
  1286. ppc405ep_init:
  1287. #ifdef CONFIG_BUBINGA
  1288. /*
  1289. * Initialize EBC chip selects 1 & 4 and GPIO pins (for alternate
  1290. * function) to support FPGA and NVRAM accesses below.
  1291. */
  1292. lis r3,GPIO0_OSRH@h /* config GPIO output select */
  1293. ori r3,r3,GPIO0_OSRH@l
  1294. lis r4,CFG_GPIO0_OSRH@h
  1295. ori r4,r4,CFG_GPIO0_OSRH@l
  1296. stw r4,0(r3)
  1297. lis r3,GPIO0_OSRL@h
  1298. ori r3,r3,GPIO0_OSRL@l
  1299. lis r4,CFG_GPIO0_OSRL@h
  1300. ori r4,r4,CFG_GPIO0_OSRL@l
  1301. stw r4,0(r3)
  1302. lis r3,GPIO0_ISR1H@h /* config GPIO input select */
  1303. ori r3,r3,GPIO0_ISR1H@l
  1304. lis r4,CFG_GPIO0_ISR1H@h
  1305. ori r4,r4,CFG_GPIO0_ISR1H@l
  1306. stw r4,0(r3)
  1307. lis r3,GPIO0_ISR1L@h
  1308. ori r3,r3,GPIO0_ISR1L@l
  1309. lis r4,CFG_GPIO0_ISR1L@h
  1310. ori r4,r4,CFG_GPIO0_ISR1L@l
  1311. stw r4,0(r3)
  1312. lis r3,GPIO0_TSRH@h /* config GPIO three-state select */
  1313. ori r3,r3,GPIO0_TSRH@l
  1314. lis r4,CFG_GPIO0_TSRH@h
  1315. ori r4,r4,CFG_GPIO0_TSRH@l
  1316. stw r4,0(r3)
  1317. lis r3,GPIO0_TSRL@h
  1318. ori r3,r3,GPIO0_TSRL@l
  1319. lis r4,CFG_GPIO0_TSRL@h
  1320. ori r4,r4,CFG_GPIO0_TSRL@l
  1321. stw r4,0(r3)
  1322. lis r3,GPIO0_TCR@h /* config GPIO driver output enables */
  1323. ori r3,r3,GPIO0_TCR@l
  1324. lis r4,CFG_GPIO0_TCR@h
  1325. ori r4,r4,CFG_GPIO0_TCR@l
  1326. stw r4,0(r3)
  1327. li r3,pb1ap /* program EBC bank 1 for RTC access */
  1328. mtdcr ebccfga,r3
  1329. lis r3,CFG_EBC_PB1AP@h
  1330. ori r3,r3,CFG_EBC_PB1AP@l
  1331. mtdcr ebccfgd,r3
  1332. li r3,pb1cr
  1333. mtdcr ebccfga,r3
  1334. lis r3,CFG_EBC_PB1CR@h
  1335. ori r3,r3,CFG_EBC_PB1CR@l
  1336. mtdcr ebccfgd,r3
  1337. li r3,pb1ap /* program EBC bank 1 for RTC access */
  1338. mtdcr ebccfga,r3
  1339. lis r3,CFG_EBC_PB1AP@h
  1340. ori r3,r3,CFG_EBC_PB1AP@l
  1341. mtdcr ebccfgd,r3
  1342. li r3,pb1cr
  1343. mtdcr ebccfga,r3
  1344. lis r3,CFG_EBC_PB1CR@h
  1345. ori r3,r3,CFG_EBC_PB1CR@l
  1346. mtdcr ebccfgd,r3
  1347. li r3,pb4ap /* program EBC bank 4 for FPGA access */
  1348. mtdcr ebccfga,r3
  1349. lis r3,CFG_EBC_PB4AP@h
  1350. ori r3,r3,CFG_EBC_PB4AP@l
  1351. mtdcr ebccfgd,r3
  1352. li r3,pb4cr
  1353. mtdcr ebccfga,r3
  1354. lis r3,CFG_EBC_PB4CR@h
  1355. ori r3,r3,CFG_EBC_PB4CR@l
  1356. mtdcr ebccfgd,r3
  1357. #endif
  1358. addi r3,0,CPC0_PCI_HOST_CFG_EN
  1359. #ifdef CONFIG_BUBINGA
  1360. /*
  1361. !-----------------------------------------------------------------------
  1362. ! Check FPGA for PCI internal/external arbitration
  1363. ! If board is set to internal arbitration, update cpc0_pci
  1364. !-----------------------------------------------------------------------
  1365. */
  1366. addis r5,r0,FPGA_REG1@h /* set offset for FPGA_REG1 */
  1367. ori r5,r5,FPGA_REG1@l
  1368. lbz r5,0x0(r5) /* read to get PCI arb selection */
  1369. andi. r6,r5,FPGA_REG1_PCI_INT_ARB /* using internal arbiter ?*/
  1370. beq ..pci_cfg_set /* if not set, then bypass reg write*/
  1371. #endif
  1372. ori r3,r3,CPC0_PCI_ARBIT_EN
  1373. ..pci_cfg_set:
  1374. mtdcr CPC0_PCI, r3 /* Enable internal arbiter*/
  1375. /*
  1376. !-----------------------------------------------------------------------
  1377. ! Check to see if chip is in bypass mode.
  1378. ! If so, write stored CPC0_PLLMR0 and CPC0_PLLMR1 values and perform a
  1379. ! CPU reset Otherwise, skip this step and keep going.
  1380. ! Note: Running BIOS in bypass mode is not supported since PLB speed
  1381. ! will not be fast enough for the SDRAM (min 66MHz)
  1382. !-----------------------------------------------------------------------
  1383. */
  1384. mfdcr r5, CPC0_PLLMR1
  1385. rlwinm r4,r5,1,0x1 /* get system clock source (SSCS) */
  1386. cmpi cr0,0,r4,0x1
  1387. beq pll_done /* if SSCS =b'1' then PLL has */
  1388. /* already been set */
  1389. /* and CPU has been reset */
  1390. /* so skip to next section */
  1391. #ifdef CONFIG_BUBINGA
  1392. /*
  1393. !-----------------------------------------------------------------------
  1394. ! Read NVRAM to get value to write in PLLMR.
  1395. ! If value has not been correctly saved, write default value
  1396. ! Default config values (assuming on-board 33MHz SYS_CLK) are above.
  1397. ! See CPU_DEFAULT_200 and CPU_DEFAULT_266 above.
  1398. !
  1399. ! WARNING: This code assumes the first three words in the nvram_t
  1400. ! structure in openbios.h. Changing the beginning of
  1401. ! the structure will break this code.
  1402. !
  1403. !-----------------------------------------------------------------------
  1404. */
  1405. addis r3,0,NVRAM_BASE@h
  1406. addi r3,r3,NVRAM_BASE@l
  1407. lwz r4, 0(r3)
  1408. addis r5,0,NVRVFY1@h
  1409. addi r5,r5,NVRVFY1@l
  1410. cmp cr0,0,r4,r5 /* Compare 1st NVRAM Magic number*/
  1411. bne ..no_pllset
  1412. addi r3,r3,4
  1413. lwz r4, 0(r3)
  1414. addis r5,0,NVRVFY2@h
  1415. addi r5,r5,NVRVFY2@l
  1416. cmp cr0,0,r4,r5 /* Compare 2 NVRAM Magic number */
  1417. bne ..no_pllset
  1418. addi r3,r3,8 /* Skip over conf_size */
  1419. lwz r4, 4(r3) /* Load PLLMR1 value from NVRAM */
  1420. lwz r3, 0(r3) /* Load PLLMR0 value from NVRAM */
  1421. rlwinm r5,r4,1,0x1 /* get system clock source (SSCS) */
  1422. cmpi cr0,0,r5,1 /* See if PLL is locked */
  1423. beq pll_write
  1424. ..no_pllset:
  1425. #endif /* CONFIG_BUBINGA */
  1426. addis r3,0,PLLMR0_DEFAULT@h /* PLLMR0 default value */
  1427. ori r3,r3,PLLMR0_DEFAULT@l /* */
  1428. addis r4,0,PLLMR1_DEFAULT@h /* PLLMR1 default value */
  1429. ori r4,r4,PLLMR1_DEFAULT@l /* */
  1430. b pll_write /* Write the CPC0_PLLMR with new value */
  1431. pll_done:
  1432. /*
  1433. !-----------------------------------------------------------------------
  1434. ! Clear Soft Reset Register
  1435. ! This is needed to enable PCI if not booting from serial EPROM
  1436. !-----------------------------------------------------------------------
  1437. */
  1438. addi r3, 0, 0x0
  1439. mtdcr CPC0_SRR, r3
  1440. addis r3,0,0x0010
  1441. mtctr r3
  1442. pci_wait:
  1443. bdnz pci_wait
  1444. blr /* return to main code */
  1445. /*
  1446. !-----------------------------------------------------------------------------
  1447. ! Function: pll_write
  1448. ! Description: Updates the value of the CPC0_PLLMR according to CMOS27E documentation
  1449. ! That is:
  1450. ! 1. Pll is first disabled (de-activated by putting in bypass mode)
  1451. ! 2. PLL is reset
  1452. ! 3. Clock dividers are set while PLL is held in reset and bypassed
  1453. ! 4. PLL Reset is cleared
  1454. ! 5. Wait 100us for PLL to lock
  1455. ! 6. A core reset is performed
  1456. ! Input: r3 = Value to write to CPC0_PLLMR0
  1457. ! Input: r4 = Value to write to CPC0_PLLMR1
  1458. ! Output r3 = none
  1459. !-----------------------------------------------------------------------------
  1460. */
  1461. pll_write:
  1462. mfdcr r5, CPC0_UCR
  1463. andis. r5,r5,0xFFFF
  1464. ori r5,r5,0x0101 /* Stop the UART clocks */
  1465. mtdcr CPC0_UCR,r5 /* Before changing PLL */
  1466. mfdcr r5, CPC0_PLLMR1
  1467. rlwinm r5,r5,0,0x7FFFFFFF /* Disable PLL */
  1468. mtdcr CPC0_PLLMR1,r5
  1469. oris r5,r5,0x4000 /* Set PLL Reset */
  1470. mtdcr CPC0_PLLMR1,r5
  1471. mtdcr CPC0_PLLMR0,r3 /* Set clock dividers */
  1472. rlwinm r5,r4,0,0x3FFFFFFF /* Reset & Bypass new PLL dividers */
  1473. oris r5,r5,0x4000 /* Set PLL Reset */
  1474. mtdcr CPC0_PLLMR1,r5 /* Set clock dividers */
  1475. rlwinm r5,r5,0,0xBFFFFFFF /* Clear PLL Reset */
  1476. mtdcr CPC0_PLLMR1,r5
  1477. /*
  1478. ! Wait min of 100us for PLL to lock.
  1479. ! See CMOS 27E databook for more info.
  1480. ! At 200MHz, that means waiting 20,000 instructions
  1481. */
  1482. addi r3,0,20000 /* 2000 = 0x4e20 */
  1483. mtctr r3
  1484. pll_wait:
  1485. bdnz pll_wait
  1486. oris r5,r5,0x8000 /* Enable PLL */
  1487. mtdcr CPC0_PLLMR1,r5 /* Engage */
  1488. /*
  1489. * Reset CPU to guarantee timings are OK
  1490. * Not sure if this is needed...
  1491. */
  1492. addis r3,0,0x1000
  1493. mtspr dbcr0,r3 /* This will cause a CPU core reset, and */
  1494. /* execution will continue from the poweron */
  1495. /* vector of 0xfffffffc */
  1496. #endif /* CONFIG_405EP */