summaryrefslogtreecommitdiff
path: root/arch/sparc32/tree.fs
blob: e9d033323af06175c0299629843b162d3bfe5ed2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
include config.fs

\ ---------
\ DMA words
\ ---------

: sparc32-dma-free  ( virt size -- )
  2drop
;

: sparc32-dma-map-out  ( virt devaddr size -- )
  (dma-sync)
;

['] sparc32-dma-free to (dma-free)
['] sparc32-dma-map-out to (dma-map-out)


" /" find-device
  2 encode-int " #address-cells" property
  1 encode-int " #size-cells" property

  " sun4m" encode-string " compatible" property
  h# 0a21fe80 encode-int " clock-frequency" property

  : encode-unit encode-unit-sbus ;
  : decode-unit decode-unit-sbus ;

  : dma-sync
    (dma-sync)
  ;

  : dma-alloc
    (dma-alloc)
  ;

  : dma-free
    (dma-free)
  ;

  : dma-map-in
    (dma-map-in)
  ;

  : dma-map-out
    (dma-map-out)
  ;

new-device
  " memory" device-name
  external
  : open true ;
  : close ;
  \ claim ( phys size align -- base )
  \ release ( phys size -- )
finish-device

new-device
  " virtual-memory" device-name
  external
  : open true ;
  : close ;
  \ claim ( phys size align -- base )
  \ release ( phys size -- )
finish-device

new-device
  " iommu" device-name
  2 encode-int " #address-cells" property
  1 encode-int " #size-cells" property
  h# 1000 encode-int " page-size" property
  0 encode-int " cache-coherence?" property
  external
  : open ( cr ." opening iommu" cr) true ;
  : close ;
  : encode-unit encode-unit-sbus ;
  : decode-unit decode-unit-sbus ;
finish-device

" /iommu" find-device
new-device
  " sbus" device-name
  " hierarchical" device-type
  2 encode-int " #address-cells" property
  1 encode-int " #size-cells" property
  h# 01443fd0 encode-int " clock-frequency" property
  h# 1c encode-int " slot-address-bits" property
  h# 3f encode-int " burst-sizes" property
  external
  : open ( cr ." opening SBus" cr) true ;
  : close ;
  : encode-unit encode-unit-sbus ;
  : decode-unit decode-unit-sbus ;
  : map-in map-in-sbus ;
  : map-out map-out-sbus ;
  : dma-alloc " dma-alloc" $call-parent ;
  : dma-free " dma-free" $call-parent ;
  : dma-map-in " dma-map-in" $call-parent ;
  : dma-map-out " dma-map-out" $call-parent ;
  : dma-sync " dma-sync" $call-parent ;
finish-device

[IFDEF] CONFIG_BPP
" /iommu/sbus" find-device
new-device
  " SUNW,bpp" device-name
  h# 4 encode-int h# 0c800000 encode-int encode+ h# 0000001c encode-int encode+ " reg" property
  h# 33 encode-int 0 encode-int encode+ " intr" property
finish-device
[THEN]

" /iommu/sbus" find-device
new-device
  " espdma" device-name
  external
  : encode-unit encode-unit-sbus ;
  : decode-unit decode-unit-sbus ;
  : dma-alloc " dma-alloc" $call-parent ;
  : dma-free " dma-free" $call-parent ;
  : dma-map-in " dma-map-in" $call-parent ;
  : dma-map-out " dma-map-out" $call-parent ;
  : dma-sync " dma-sync" $call-parent ;
finish-device

" /iommu/sbus" find-device
new-device
  " ledma" device-name
  h# 3f encode-int " burst-sizes" property
  external
  : encode-unit encode-unit-sbus ;
  : decode-unit decode-unit-sbus ;
  : dma-alloc " dma-alloc" $call-parent ;
  : dma-free " dma-free" $call-parent ;
  : dma-map-in " dma-map-in" $call-parent ;
  : dma-map-out " dma-map-out" $call-parent ;
  : dma-sync " dma-sync" $call-parent ;
finish-device

" /iommu/sbus/ledma" find-device
new-device
  " le" device-name
  " network" device-type
  h# 7 encode-int " busmaster-regval" property
  h# 26 encode-int 0 encode-int encode+ " intr" property
  : dma-alloc " dma-alloc" $call-parent ;
  : dma-free " dma-free" $call-parent ;
  : dma-map-in " dma-map-in" $call-parent ;
  : dma-map-out " dma-map-out" $call-parent ;
  : dma-sync " dma-sync" $call-parent ;
finish-device

\ obio (on-board IO)
" /" find-device
new-device
  " obio" device-name
  " hierarchical" device-type
  2 encode-int " #address-cells" property
  1 encode-int " #size-cells" property
  external
  : open ( cr ." opening obio" cr) true ;
  : close ;
  : encode-unit encode-unit-sbus ;
  : decode-unit decode-unit-sbus ;
finish-device

" /options" find-device
  " disk" encode-string " boot-from" property

" /openprom" find-device
  0 0 " aligned-allocator" property