aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Cameron <quozl@laptop.org>2019-05-09 10:56:58 +1000
committerGitHub <noreply@github.com>2019-05-09 10:56:58 +1000
commit3642927b5812c54c7956344d119c7898e9bf8ed1 (patch)
tree6ee244770a1f1593a5dd40f66cc37c3eb715731f
parent4392fde31c3271b9ff6caedd15293cb68b6389e8 (diff)
parent5e32beeab6621735e2fd384cdc311ed72db1fb48 (diff)
downloadopenfirmware-3642927b5812c54c7956344d119c7898e9bf8ed1.tar.gz
Merge pull request #2 from lkundrak/lr/vivante
WIP: Make the GPU work
-rw-r--r--cpu/arm/mmp2/clk.fth10
-rw-r--r--cpu/arm/mmp2/galcore.fth28
-rw-r--r--cpu/arm/olpc/build-fw.fth3
3 files changed, 29 insertions, 12 deletions
diff --git a/cpu/arm/mmp2/clk.fth b/cpu/arm/mmp2/clk.fth
index eb208e5d..118ba9b4 100644
--- a/cpu/arm/mmp2/clk.fth
+++ b/cpu/arm/mmp2/clk.fth
@@ -2,6 +2,7 @@
purpose: MMP2 clock management
\ From include/dt-bindings/clock/marvell,mmp2.h
+d# 27 constant mmp2-usb-pll-clk#
d# 60 constant mmp2-twsi0-clk#
d# 61 constant mmp2-twsi1-clk#
d# 63 constant mmp2-twsi3-clk#
@@ -24,11 +25,17 @@ d# 104 constant mmp2-sdh3-clk#
d# 105 constant mmp2-usb-clk#
d# 112 constant mmp2-ccic0-clk#
d# 120 constant mmp2-disp0-lcdc-clk#
+d# 121 constant mmp2-gpu-gc-mux-clk#
+d# 122 constant mmp2-gpu-gc-clk#
+d# 123 constant mmp2-gpu-bus-mux-clk#
+d# 124 constant mmp2-gpu-bus-clk#
+
+\ From include/dt-bindings/power/marvell,mmp2.h
+d# 0 constant mmp2-gpu-power-domain#
\ FIXME: Not official clock numbers!
d# 10000 constant mmp2-audio-clk#
d# 10001 constant mmp2-vmeta-clk#
-d# 10002 constant mmp2-gc-clk#
0 0 " " " /" begin-package
" clocks" name
@@ -46,6 +53,7 @@ h# d401.5000 encode-int encode+ h# 1000 encode-int encode+
1 " #clock-cells" integer-property
1 " #reset-cells" integer-property
+1 " #power-domain-cells" integer-property
\ value clr-mask reg
: twsi0-clk h# 3 h# 77 h# 04 +apbc ;
diff --git a/cpu/arm/mmp2/galcore.fth b/cpu/arm/mmp2/galcore.fth
index faefeaf3..cbf1eabf 100644
--- a/cpu/arm/mmp2/galcore.fth
+++ b/cpu/arm/mmp2/galcore.fth
@@ -6,22 +6,28 @@ h# 1000 constant /gpu
dev /
new-device
" gpu" device-name
- " mrvl,galcore" +compatible
+ " vivante,gc" +compatible
gpu-pa /gpu reg
-[ifdef] mmp2
8 encode-int " interrupts" property
" /interrupt-controller" encode-phandle " interrupt-parent" property
- " galcore 2D" encode-string encode+ " interrupt-names" property
-[then]
-[ifdef] mmp3
- d# 0 encode-int 2 encode-int encode+ " interrupts" property
- " /interrupt-controller/interrupt-controller@1c0" encode-phandle " interrupt-parent" property
- " galcore 3D" encode-string " galcore 2D" encode-string encode+ " interrupt-names" property
-[then]
+ " /clocks" encode-phandle mmp2-gpu-gc-clk# encode-int encode+
+ " /clocks" encode-phandle encode+ mmp2-gpu-bus-clk# encode-int encode+
+ " clocks" property
+ " core" encode-string
+ " bus" encode-string encode+
+ " clock-names" property
- " /clocks" encode-phandle mmp2-gc-clk# encode-int encode+ " clocks" property
- " GCCLK" " clock-names" string-property
+ " /clocks" encode-phandle mmp2-gpu-power-domain# encode-int encode+
+ " power-domains" property
+
+ " /clocks" encode-phandle mmp2-gpu-gc-mux-clk# encode-int encode+
+ " /clocks" encode-phandle encode+ mmp2-gpu-bus-mux-clk# encode-int encode+
+ " assigned-clocks" property
+
+ " /clocks" encode-phandle mmp2-usb-pll-clk# encode-int encode+
+ " /clocks" encode-phandle encode+ mmp2-usb-pll-clk# encode-int encode+
+ " assigned-clock-parents" property
finish-device
device-end
diff --git a/cpu/arm/olpc/build-fw.fth b/cpu/arm/olpc/build-fw.fth
index 41d1b393..66466dbe 100644
--- a/cpu/arm/olpc/build-fw.fth
+++ b/cpu/arm/olpc/build-fw.fth
@@ -265,6 +265,9 @@ fload ${BP}/cpu/x86/pc/olpc/setwp.fth
end-package
fload ${BP}/cpu/arm/olpc/lcd.fth
+[ifdef] mmp2
+fload ${BP}/cpu/arm/mmp2/galcore.fth
+[then]
[ifdef] mmp3
fload ${BP}/cpu/arm/mmp3/galcore.fth
[then]