1 ;--------------------------------------------------------
2 ; Hand tweaked minimal eeprom boot code
3 ;--------------------------------------------------------
5 .optsdcc -mmcs51 --model-small
7 ;--------------------------------------------------------
8 ; Public variables in this module
9 ;--------------------------------------------------------
28 .globl _GPIFHOLDAMOUNT
29 .globl _FLOWSTBHPERIOD
40 .globl _XGPIFSGLDATLNOX
155 .globl _EP8AUTOINLENL
156 .globl _EP8AUTOINLENH
157 .globl _EP6AUTOINLENL
158 .globl _EP6AUTOINLENH
159 .globl _EP4AUTOINLENL
160 .globl _EP4AUTOINLENH
161 .globl _EP2AUTOINLENL
162 .globl _EP2AUTOINLENH
185 .globl _RES_WAVEDATA_END
186 .globl _GPIF_WAVE_DATA
187 ;--------------------------------------------------------
188 ; special function registers
189 ;--------------------------------------------------------
221 _EP24FIFOFLGS = 0x00ab
222 _EP68FIFOFLGS = 0x00ac
223 _AUTOPTRSETUP = 0x00af
234 _GPIFSGLDATH = 0x00bd
235 _GPIFSGLDATLX = 0x00be
236 _GPIFSGLDATLNOX = 0x00bf
250 ;--------------------------------------------------------
251 ; special function bits
252 ;--------------------------------------------------------
326 _bitALTERA_DATA0 = 0x00a1
327 _bitALTERA_DCLK = 0x00a3
328 ;--------------------------------------------------------
329 ; overlayable register banks
330 ;--------------------------------------------------------
331 .area REG_BANK_0 (REL,OVR,DATA)
333 ;--------------------------------------------------------
335 ;--------------------------------------------------------
337 ;--------------------------------------------------------
338 ; overlayable items in internal ram
339 ;--------------------------------------------------------
340 .area OSEG (OVR,DATA)
341 ;--------------------------------------------------------
342 ; Stack segment in internal ram
343 ;--------------------------------------------------------
348 ;--------------------------------------------------------
349 ; indirectly addressable internal ram data
350 ;--------------------------------------------------------
352 ;--------------------------------------------------------
354 ;--------------------------------------------------------
356 ;--------------------------------------------------------
358 ;--------------------------------------------------------
360 _GPIF_WAVE_DATA = 0xe400
361 _RES_WAVEDATA_END = 0xe480
371 _FIFOPINPOLAR = 0xe609
384 _EP2AUTOINLENH = 0xe620
385 _EP2AUTOINLENL = 0xe621
386 _EP4AUTOINLENH = 0xe622
387 _EP4AUTOINLENL = 0xe623
388 _EP6AUTOINLENH = 0xe624
389 _EP6AUTOINLENL = 0xe625
390 _EP8AUTOINLENH = 0xe626
391 _EP8AUTOINLENL = 0xe627
400 _EP2ISOINPKTS = 0xe640
401 _EP4ISOINPKTS = 0xe641
402 _EP6ISOINPKTS = 0xe642
403 _EP8ISOINPKTS = 0xe643
466 _EP2FIFOFLGS = 0xe6a7
467 _EP4FIFOFLGS = 0xe6a8
468 _EP6FIFOFLGS = 0xe6a9
469 _EP8FIFOFLGS = 0xe6aa
482 _GPIFWFSELECT = 0xe6c0
484 _GPIFIDLECTL = 0xe6c2
492 _EP2GPIFFLGSEL = 0xe6d2
493 _EP2GPIFPFSTOP = 0xe6d3
494 _EP2GPIFTRIG = 0xe6d4
495 _EP4GPIFFLGSEL = 0xe6da
496 _EP4GPIFPFSTOP = 0xe6db
497 _EP4GPIFTRIG = 0xe6dc
498 _EP6GPIFFLGSEL = 0xe6e2
499 _EP6GPIFPFSTOP = 0xe6e3
500 _EP6GPIFTRIG = 0xe6e4
501 _EP8GPIFFLGSEL = 0xe6ea
502 _EP8GPIFPFSTOP = 0xe6eb
503 _EP8GPIFTRIG = 0xe6ec
504 _XGPIFSGLDATH = 0xe6f0
505 _XGPIFSGLDATLX = 0xe6f1
506 _XGPIFSGLDATLNOX = 0xe6f2
507 _GPIFREADYCFG = 0xe6f3
508 _GPIFREADYSTAT = 0xe6f4
514 _FLOWHOLDOFF = 0xe6ca
516 _FLOWSTBEDGE = 0xe6cc
517 _FLOWSTBHPERIOD = 0xe6cd
518 _GPIFHOLDAMOUNT = 0xe60c
521 _UDMACRCQUAL = 0xe67f
536 ;--------------------------------------------------------
537 ; external initialized ram data
538 ;--------------------------------------------------------
539 ;--------------------------------------------------------
541 ;--------------------------------------------------------
544 ljmp __sdcc_gsinit_startup
545 ;--------------------------------------------------------
546 ; global & static initialisations
547 ;--------------------------------------------------------
551 __sdcc_gsinit_startup:
552 mov sp,#__start__stack - 1
553 lcall __sdcc_external_startup
556 ljmp __sdcc_program_startup
559 ljmp __sdcc_program_startup
560 ;--------------------------------------------------------
562 ;--------------------------------------------------------
565 ;--------------------------------------------------------
567 ;--------------------------------------------------------
569 __sdcc_program_startup:
571 ; return from _eeprom_init will spin here