!

rem initialization file for X-Hyper255B
rem support linux

rem Mask All interrupt 
long 0x40d00004 0x0
long 0x40d00008 0x0

rem initialize GPIO, base address 0x40E00000
rem GAFRn_L, GAFRn_U write/read 
rem GAFR0_L  
long 0x40e00054 0x80000000
rem GAFR0_U
long 0x40e00058 0xa5000010
rem GAFR1_L
long 0x40e0005c 0x60008018
rem GAFR1_U
long 0x40e00060 0xaaa5aaaa
rem GAFR2_L
long 0x40e00064 0xaaa0000a
rem GAFR2_U
long 0x40e00068 0x2

rem GPSRn, GPCRn write only
rem GPSR0 
long 0x40e00018 0x408030
rem GPSR1
long 0x40e0001c 0xbfa882
rem GPSR2
long 0x40e00020 0x1c000
rem GPCR0
long 0x40e00024 0xc0031100
rem GPCR1
long 0x40e00028 0xfc400300
rem GPCR2
long 0x40e0002c 0x00003fff

rem GPDRn
rem GPDR0
long 0x40e0000c 0xc0439330
rem GPDR1
long 0x40e00010 0xfcffab82
rem GPDR2
long 0x40e00014 0x0001ffff

rem PSSR - RDH|PH
long 0x40f00004 0x30


rem Initialize SDRAM
rem Initialize CLOCK, base addr 0x41300000
rem CKEN
long 41300004 0x00000040
rem OSCC
long 41300008 0x00000002
rem CCCR
long 41300000 0x00000161

rem PWRMODE Register
Register CCLKCFG 0x3


rem ostimer register
rem OSCR
long 0x40A00010 0x0

rem Memory Control Registers, base address 0x48000000
rem MSC0
long 0x48000008 0x7ff87ff0

rem MSC1
long 0x4800000c 0x12bc5554
rem Intel's code reads it back to make sure it works
memory 0x4800000c length 4 -W

rem MSC2
long 0x48000010 0x7ff87ff1
rem Intel's code reads it back to make sure it works
memory 0x48000010 length 4 -W

rem MECR
long 0x48000014 0x00000000

rem MCMEM0
long 0x48000028 0x00010504

rem MCMEM1
long 0x4800002c 0x00010504

rem MCATT0
long 0x48000030 0x00010504

rem MCATT1
long 0x48000034 0x00010504

rem MCIO0
long 0x48000038 0x00004715

rem MCIO1
long 0x4800003c 0x00004715

rem MDREFR
rem Intel's code
memory 0x48000004 length 4 -W
long 0x48000004 0xdf016
long 0x48000004 0xdf016
memory 0x48000004 length 4 -W
long 0x48000004 0xdf016
long 0x48000004 0x20df016

rem MDCNFG
long 0x48000000 0x1ac8
Register CONTROL 0x78
long 0xa0000000 0xa0000000
memory 0x48000000 length 4 -W
long 0x48000000 0x1ac9

rem MDMRS
long 48000040 0x0
rem long 48000040 0x220032

rem MDREFR
memory 0x48000004 length 4 -W
long 0x48000004 0x20df016


rem GAFR1_L
rem memory 0x40e0005c length 4 -W
long 0x40e0005c 0x600a8018

rem GPDR1  
rem memory 0x40e00010 length 4 -W
long 0x40e00010 0xfcffab82

rem FFLCR 8-bit, 1 stop, no parity
long 0x4010000c 0x3

rem FFFCR Reset tx, rx FIFO. clear. FIFO enable
long 0x40100008 0x7

rem FFIER
long 0x40100004 0x40

rem FFLCR
memory 0x4010000c length 4 -W
long 0x4010000c 0x83

rem FFDLL 115200
long 0x40100000 0x8

rem FFLCR
memory 0x4010000c length 4 -W
long 0x4010000c 0x3


rem initialize eth0
rem CS8900A chip
rem test code
Byte 0x4000000 0x0
Byte 0x4000001 0x0

rem check CS8900A Chip ID 
Word 0x400030a 0x0

rem Kernel parameter
Register R0 0x0
Register R1 0xc8

rem svc mode
Register CPSR 0x600000d3

!