aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2020-04-13 08:27:36 +0200
committerLubomir Rintel <lkundrak@v3.sk>2020-08-14 01:55:15 +0200
commitf07e9d1baaf8e5941356f8f1dd460c231dfae1e0 (patch)
treee150a50a95f1e3d7228b53721baafcb9d9f04e37
parentccef03b4de7e5f1dd8c325e172c4171e13dfeb76 (diff)
downloadopenfirmware-f07e9d1baaf8e5941356f8f1dd460c231dfae1e0.tar.gz
olpc/sound: make /audio compatible with marvell,mmp-sspa
Aside from adding the compatible string, this adds the bit clock and sets the DAI cell count.
-rw-r--r--cpu/arm/mmp2/clk.fth5
-rw-r--r--cpu/arm/olpc/sound.fth30
2 files changed, 26 insertions, 9 deletions
diff --git a/cpu/arm/mmp2/clk.fth b/cpu/arm/mmp2/clk.fth
index 96158d09..6b7523c0 100644
--- a/cpu/arm/mmp2/clk.fth
+++ b/cpu/arm/mmp2/clk.fth
@@ -153,10 +153,6 @@ h# 240 constant audio-sram-pwr
[then]
0 audio-clk pmua!
;
-: audio-on/off ( on? -- )
- if audio-island-on else audio-island-off then
-;
-
[ifdef] mmp3
: ccic0-isp-island-off ( -- )
h# 600 h# 1fc pmua! \ Isolation enabled
@@ -235,7 +231,6 @@ h# 240 constant audio-sram-pwr
dup mmp2-sdh2-clk# = if drop sdh2-clk generic-on/off exit then
dup mmp2-sdh3-clk# = if drop sdh3-clk generic-on/off exit then
dup mmp2-ccic0-clk# = if drop ccic0-on/off exit then
- dup mmp2-audio-clk# = if drop audio-on/off exit then
" clock=" type .d " on=" type .d cr
abort " Unimplemented clock"
diff --git a/cpu/arm/olpc/sound.fth b/cpu/arm/olpc/sound.fth
index daf831f0..56d629fd 100644
--- a/cpu/arm/olpc/sound.fth
+++ b/cpu/arm/olpc/sound.fth
@@ -139,8 +139,18 @@ new-device
" unused" " status" string-property
- " /clocks" encode-phandle mmp2-audio-clk# encode-int encode+ " clocks" property
d# 3 " interrupts" integer-property
+ 0 0 encode-bytes
+ " /clocks" encode-phandle encode+ mmp2-audio-clk# encode-int encode+
+ " /audio-clocks" encode-phandle encode+ mmp2-audio-sspa1-clk# encode-int encode+
+ " clocks" property
+ 0 0 encode-bytes
+ " audio" encode-string encode+
+ " bitclk" encode-string encode+
+ " clock-names" property
+ " /clocks" encode-phandle mmp2-audio-pd# encode-int encode+
+ " power-domains" property
+ 0 " #sound-dai-cells" integer-property
finish-device
new-device
@@ -153,11 +163,23 @@ h# c00 +audio encode-int h# 30 encode-int encode+
" marvell,mmp-sspa-dai" +compatible
[ifdef] mmp2 " marvell,mmp2-sspa-dai" +compatible [then]
[ifdef] mmp3 " marvell,mmp3-sspa-dai" +compatible [then]
+" marvell,mmp-sspa" +compatible
-" /clocks" encode-phandle mmp2-audio-clk# encode-int encode+ " clocks" property
d# 2 " interrupts" integer-property
0 0 encode-bytes
+ " /clocks" encode-phandle encode+ mmp2-audio-clk# encode-int encode+
+ " /audio-clocks" encode-phandle encode+ mmp2-audio-sspa0-clk# encode-int encode+
+ " clocks" property
+0 0 encode-bytes
+ " audio" encode-string encode+
+ " bitclk" encode-string encode+
+ " clock-names" property
+" /clocks" encode-phandle mmp2-audio-pd# encode-int encode+
+ " power-domains" property
+0 " #sound-dai-cells" integer-property
+
+0 0 encode-bytes
" /adma" encode-phandle encode+ 0 encode-int encode+
" /adma" encode-phandle encode+ 1 encode-int encode+
" dmas" property
@@ -172,7 +194,7 @@ d# 2 " interrupts" integer-property
: audio-clock-off ( -- )
0 h# 38 sspa!
- my-clock-off
+ " /clocks" " audio-island-off" execute-device-method drop
;
: start-audio-pll ( -- error? )
\ For VCXO=26 MHz, OCLK=12.2880 MHz
@@ -194,7 +216,7 @@ d# 2 " interrupts" integer-property
true value use-audio-pll?
: audio-clock-on ( -- error? )
- my-clock-on
+ " /clocks" " audio-island-on" execute-device-method drop
use-audio-pll? if
start-audio-pll if true exit then