mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 05:19:17 +02:00
* indention fixed
git-svn-id: trunk@18150 -
This commit is contained in:
parent
7b5196a4bc
commit
144e59a1a7
@ -4,96 +4,98 @@ Preliminary startup code
|
|||||||
Geoffrey Barton 2010 08 01 gjb@periphon.net
|
Geoffrey Barton 2010 08 01 gjb@periphon.net
|
||||||
based on stm32f103 created by Jeppe Johansen 2009 - jepjoh2@kom.aau.dk
|
based on stm32f103 created by Jeppe Johansen 2009 - jepjoh2@kom.aau.dk
|
||||||
}
|
}
|
||||||
|
{$goto on}
|
||||||
unit stellaris;
|
unit stellaris;
|
||||||
|
|
||||||
{$goto on}
|
interface
|
||||||
|
|
||||||
interface
|
type
|
||||||
|
TBitvector32 = bitpacked array[0..31] of 0..1;
|
||||||
|
|
||||||
type
|
{$PACKRECORDS 4}
|
||||||
TBitvector32 = bitpacked array[0..31] of 0..1;
|
const
|
||||||
|
PeripheralBase = $40000000;
|
||||||
{$PACKRECORDS 4}
|
PPBbase = $E0000fff;
|
||||||
const
|
APBbase = PeripheralBase;
|
||||||
PeripheralBase = $40000000;
|
AHBbase = PeripheralBase+$54000;
|
||||||
PPBbase = $E0000fff;
|
portAoffset=APBbase+$4000;
|
||||||
APBbase = PeripheralBase;
|
portBoffset=APBbase+$5000;
|
||||||
AHBbase = PeripheralBase+$54000;
|
portCoffset=APBbase+$6000;
|
||||||
portAoffset=APBbase+$4000;
|
portDoffset=APBbase+$7000;
|
||||||
portBoffset=APBbase+$5000;
|
portEoffset=APBbase+$24000;
|
||||||
portCoffset=APBbase+$6000;
|
portFoffset=APBbase+$25000;
|
||||||
portDoffset=APBbase+$7000;
|
portGoffset=APBbase+$26000;
|
||||||
portEoffset=APBbase+$24000;
|
portHoffset=APBbase+$27000;
|
||||||
portFoffset=APBbase+$25000;
|
portJoffset=APBbase+$3d000;
|
||||||
portGoffset=APBbase+$26000;
|
sysconoffset=APBbase+$fe000;
|
||||||
portHoffset=APBbase+$27000;
|
|
||||||
portJoffset=APBbase+$3d000;
|
|
||||||
sysconoffset=APBbase+$fe000;
|
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TgpioPort=record
|
TgpioPort=record
|
||||||
data:array[0..255] of dword;dir,is,ibe,iev,im,ris,mis,icr,
|
data:array[0..255] of dword;dir,_is,ibe,iev,im,ris,mis,icr,
|
||||||
afsel:dword;dummy1:array[0..54] of dword;dr2r,dr4r,dr8r,odr,pur,pdr,slr,den,lock,cr,amsel,pctl:dword;
|
afsel:dword;dummy1:array[0..54] of dword;dr2r,dr4r,dr8r,odr,pur,pdr,slr,den,lock,cr,amsel,pctl:dword;
|
||||||
end;
|
end;
|
||||||
Tsyscon=record
|
|
||||||
did0,did1,dc0,res0c,dc1,dc2,dc3,dc4,dc5,dc6,dc7,dc8,borc,res34,res38,res3c,
|
|
||||||
src0,src1,src2,res4c,ris,imc,misc,resc,rcc,pllcfg,res68,gpiohbctl,rcc2,res74,res78,moscctl:dword;res80:array[0..31] of dword;rcgc0,
|
|
||||||
rcgc1,rcgc2,res10,scgc0,scgc1,scgc2,
|
|
||||||
res11,dcgc0,dcgc1,dcgc2,res12c,res130,res134,res138,res13c,res140,dsplpclk,res13,res14,res15,piosccal,
|
|
||||||
i2smclk,res174,res178,res17c,res180,res184,res188,res18c,dc9,res194,res198,res19c,nvmstat:dword;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$ALIGN 4}
|
Tsyscon=record
|
||||||
var
|
did0,did1,dc0,res0c,dc1,dc2,dc3,dc4,dc5,dc6,dc7,dc8,borc,res34,res38,res3c,
|
||||||
|
src0,src1,src2,res4c,ris,imc,misc,resc,rcc,pllcfg,res68,gpiohbctl,rcc2,res74,res78,moscctl:dword;res80:array[0..31] of dword;
|
||||||
|
rcgc0,rcgc1,rcgc2,res10,scgc0,scgc1,scgc2,
|
||||||
|
res11,dcgc0,dcgc1,dcgc2,res12c,res130,res134,res138,res13c,res140,dsplpclk,res13,res14,res15,piosccal,
|
||||||
|
i2smclk,res174,res178,res17c,res180,res184,res188,res18c,dc9,res194,res198,res19c,nvmstat:dword;
|
||||||
|
end;
|
||||||
|
|
||||||
PortA :Tgpioport absolute portAoffset;
|
{$ALIGN 4}
|
||||||
PortB :Tgpioport absolute portBoffset;
|
var
|
||||||
PortC :Tgpioport absolute portCoffset;
|
PortA :Tgpioport absolute portAoffset;
|
||||||
PortD :Tgpioport absolute portDoffset;
|
PortB :Tgpioport absolute portBoffset;
|
||||||
PortE :Tgpioport absolute portEoffset;
|
PortC :Tgpioport absolute portCoffset;
|
||||||
PortF :Tgpioport absolute portFoffset;
|
PortD :Tgpioport absolute portDoffset;
|
||||||
PortG :Tgpioport absolute portGoffset;
|
PortE :Tgpioport absolute portEoffset;
|
||||||
PortH :Tgpioport absolute portHoffset;
|
PortF :Tgpioport absolute portFoffset;
|
||||||
PortJ :Tgpioport absolute portJoffset;
|
PortG :Tgpioport absolute portGoffset;
|
||||||
|
PortH :Tgpioport absolute portHoffset;
|
||||||
|
PortJ :Tgpioport absolute portJoffset;
|
||||||
|
|
||||||
syscon :Tsyscon absolute sysconoffset;
|
syscon :Tsyscon absolute sysconoffset;
|
||||||
rcgc0 :dword absolute (sysconoffset+$100);
|
rcgc0 :dword absolute (sysconoffset+$100);
|
||||||
rcgc1 :dword absolute (sysconoffset+$104);
|
rcgc1 :dword absolute (sysconoffset+$104);
|
||||||
rcgc2 :dword absolute (sysconoffset+$108);
|
rcgc2 :dword absolute (sysconoffset+$108);
|
||||||
|
|
||||||
var
|
|
||||||
NMI_Handler,
|
|
||||||
HardFault_Handler,
|
|
||||||
MemManage_Handler,
|
|
||||||
BusFault_Handler,
|
|
||||||
UsageFault_Handler,
|
|
||||||
SWI_Handler,
|
|
||||||
DebugMonitor_Handler,
|
|
||||||
PendingSV_Handler,
|
|
||||||
Systick_Handler,UART0intvector: pointer;
|
|
||||||
|
|
||||||
implementation
|
var
|
||||||
|
NMI_Handler,
|
||||||
|
HardFault_Handler,
|
||||||
|
MemManage_Handler,
|
||||||
|
BusFault_Handler,
|
||||||
|
UsageFault_Handler,
|
||||||
|
SWI_Handler,
|
||||||
|
DebugMonitor_Handler,
|
||||||
|
PendingSV_Handler,
|
||||||
|
Systick_Handler,UART0intvector: pointer;
|
||||||
|
|
||||||
var
|
implementation
|
||||||
_data: record end; external name '_data';
|
|
||||||
_edata: record end; external name '_edata';
|
|
||||||
_etext: record end; external name '_etext';
|
|
||||||
_bss_start: record end; external name '_bss_start';
|
|
||||||
_bss_end: record end; external name '_bss_end';
|
|
||||||
_stack_top: record end; external name '_stack_top';
|
|
||||||
|
|
||||||
procedure PASCALMAIN; external name 'PASCALMAIN';
|
var
|
||||||
|
_data: record end; external name '_data';
|
||||||
|
_edata: record end; external name '_edata';
|
||||||
|
_etext: record end; external name '_etext';
|
||||||
|
_bss_start: record end; external name '_bss_start';
|
||||||
|
_bss_end: record end; external name '_bss_end';
|
||||||
|
_stack_top: record end; external name '_stack_top';
|
||||||
|
|
||||||
procedure _FPC_haltproc; assembler; nostackframe; public name '_haltproc';
|
procedure PASCALMAIN; external name 'PASCALMAIN';
|
||||||
asm
|
|
||||||
.Lhalt:
|
|
||||||
b .Lhalt
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure _FPC_start; assembler; nostackframe;
|
procedure _FPC_haltproc; assembler; nostackframe; public name '_haltproc';
|
||||||
label _start;
|
asm
|
||||||
asm
|
.Lhalt:
|
||||||
|
b .Lhalt
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure _FPC_start; assembler; nostackframe;
|
||||||
|
label
|
||||||
|
_start;
|
||||||
|
asm
|
||||||
.init
|
.init
|
||||||
.align 16
|
.align 16
|
||||||
|
|
||||||
@ -286,7 +288,7 @@ _start:
|
|||||||
// default irq handler just returns
|
// default irq handler just returns
|
||||||
.LDefaultHandler:
|
.LDefaultHandler:
|
||||||
mov pc,r14
|
mov pc,r14
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user