aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2020-05-13 18:47:34 +0200
committerLubomir Rintel <lkundrak@v3.sk>2020-08-14 01:54:33 +0200
commitccef03b4de7e5f1dd8c325e172c4171e13dfeb76 (patch)
tree911a7420c4723e4f4a575cbb7d26e333bb63ec60
parent105adc4806f688a30a41dd0fc395ad2af339723f (diff)
downloadopenfirmware-ccef03b4de7e5f1dd8c325e172c4171e13dfeb76.tar.gz
arm/mmp2: add /audio-clocks
This is the clock controller that creates the I2S master and bit clocks for the codec from the PMUA or VCXO via Audio PLL.
-rw-r--r--cpu/arm/mmp2/audio-clk.fth55
-rw-r--r--cpu/arm/mmp2/clk.fth6
-rw-r--r--cpu/arm/olpc/prefw.fth1
3 files changed, 61 insertions, 1 deletions
diff --git a/cpu/arm/mmp2/audio-clk.fth b/cpu/arm/mmp2/audio-clk.fth
new file mode 100644
index 00000000..35b60f93
--- /dev/null
+++ b/cpu/arm/mmp2/audio-clk.fth
@@ -0,0 +1,55 @@
+\ See license at end of file
+purpose: MMP2 audio clock management
+
+\ From include/dt-bindings/clock/marvell,mmp2-audio.h
+d# 0 constant mmp2-audio-sys-clk#
+d# 1 constant mmp2-audio-sspa0-clk#
+d# 2 constant mmp2-audio-sspa1-clk#
+
+0 0 " " " /" begin-package
+" audio-clocks" name
+
+h# c30 +audio h# 10 reg
+[ifdef] mmp2 " marvell,mmp2-audio-clock" +compatible [then]
+[ifdef] mmp3 " marvell,mmp3-audio-clock" +compatible [then]
+
+0 0 encode-bytes
+ " /clocks" encode-phandle encode+ mmp2-audio-clk# encode-int encode+
+ " /clocks" encode-phandle encode+ mmp2-vctcxo-clk# encode-int encode+
+ " /clocks" encode-phandle encode+ mmp2-i2s0-clk# encode-int encode+
+ " /clocks" encode-phandle encode+ mmp2-i2s1-clk# encode-int encode+
+ " clocks" property
+0 0 encode-bytes
+ " audio" encode-string encode+
+ " vctcxo" encode-string encode+
+ " i2s0" encode-string encode+
+ " i2s1" encode-string encode+
+ " clock-names" property
+" /clocks" encode-phandle mmp2-audio-pd# encode-int encode+
+ " power-domains" property
+1 " #clock-cells" integer-property
+end-package
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2020 Lubomir Rintel <lkundrak@v3.sk>
+\
+\ Permission is hereby granted, free of charge, to any person obtaining
+\ a copy of this software and associated documentation files (the
+\ "Software"), to deal in the Software without restriction, including
+\ without limitation the rights to use, copy, modify, merge, publish,
+\ distribute, sublicense, and/or sell copies of the Software, and to
+\ permit persons to whom the Software is furnished to do so, subject to
+\ the following conditions:
+\
+\ The above copyright notice and this permission notice shall be
+\ included in all copies or substantial portions of the Software.
+\
+\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+\
+\ LICENSE_END
diff --git a/cpu/arm/mmp2/clk.fth b/cpu/arm/mmp2/clk.fth
index e8d623db..96158d09 100644
--- a/cpu/arm/mmp2/clk.fth
+++ b/cpu/arm/mmp2/clk.fth
@@ -2,7 +2,10 @@
purpose: MMP2 clock management
\ From include/dt-bindings/clock/marvell,mmp2.h
+d# 2 constant mmp2-vctcxo-clk#
d# 27 constant mmp2-usb-pll-clk#
+d# 31 constant mmp2-i2s0-clk#
+d# 32 constant mmp2-i2s1-clk#
d# 60 constant mmp2-twsi0-clk#
d# 61 constant mmp2-twsi1-clk#
d# 62 constant mmp2-twsi2-clk#
@@ -38,13 +41,14 @@ d# 123 constant mmp2-gpu-bus-clk#
d# 124 constant mmp2-gpu-3d-clk#
d# 125 constant mmp3-gpu-2d-clk#
d# 126 constant mmp3-sdh4-clk#
+d# 127 constant mmp2-audio-clk#
\ From include/dt-bindings/power/marvell,mmp2.h
d# 0 constant mmp2-gpu-pd#
+d# 1 constant mmp2-audio-pd#
d# 2 constant mmp3-camera-pd#
\ FIXME: Not official clock numbers!
-d# 10000 constant mmp2-audio-clk#
d# 10001 constant mmp2-vmeta-clk#
0 0 " " " /" begin-package
diff --git a/cpu/arm/olpc/prefw.fth b/cpu/arm/olpc/prefw.fth
index e201a34a..412eac53 100644
--- a/cpu/arm/olpc/prefw.fth
+++ b/cpu/arm/olpc/prefw.fth
@@ -224,6 +224,7 @@ fload ${BP}/ofw/gui/loadmenu.fth
\ Marvell MMP low-level stuff
fload ${BP}/cpu/arm/mmp2/clk.fth
+fload ${BP}/cpu/arm/mmp2/audio-clk.fth
fload ${BP}/cpu/arm/mmp2/irq.fth
fload ${BP}/cpu/arm/mmp2/timer.fth
fload ${BP}/cpu/arm/mmp2/gpio.fth