Skip to content

duo 256m system dma no IRQ #9

@stavinsky

Description

@stavinsky

I'm trying to implement i2s driver by my own.
Ive described regmap for most of registers. And I was able to start tdm2. I see expected lrclk and bclk on oscilloscope.
clocks are fine.
Ive also hardcoded for now recommendations for i2s2 from some vendor file

0x03009804[0] = 1'b1 (rg_ephy_apb_rw_sel=1, use apb interface)
0x03009808[4:0] = 5'b00001 (rg_ephy_pll_stable_cnt[4:0] = 5'd1 (10us)
0x03009800[2] = 0x0905 (rg_ephy_dig_rst_n=1, reset release, other keep default)
wait 10us
0x0300907C[12:8]= 5'b00101 (page_sel_mode0 = page 5)
0x03009078[11:0] = 0xF00 (set to gpio from top)
0x03009074[10:9 2:1]= 0x606 (set ephy rxp&rxm input&output enable)
0x03009070[10:9 2:1]= 0x606 (set ephy rxp&rxm input&output enable)

so I2s starts
I'm not sure about dma channels. I chose 4 and 5 according to trm document.
the problem is that I don't see any interrupts in /proc/interrupts
but I see unhandled interrupt from DMAC_INTSTATUSREG

devmem 0x04330030 32

0x00000001

So I'm missing something connected to System DMA and interrupts.

# cat /proc/interrupts  | grep dw_axi_dmac_platform
 12:          0 SiFive PLIC  29 Level     dw_axi_dmac_platform

dmesg shows me that on aplay -D hw:0,0 -f S24_LE -c 2 -r 48000 /dev/zero

[   36.055940] dw_axi_dmac_platform 4330000.dma-controller: apb_regs not initialized                    
[   36.063718] sg2002-i2s 4120000.i2s: tx start                                                         
[   36.642941] sg2002-i2s 4120000.i2s: tx stop                                                          
[   36.647323] dw_axi_dmac_platform 4330000.dma-controller: apb_regs not initialized  
# devmem 0x04330030 32 
0x00000001

here is my device tree.

&i2s2 {
	pinctrl-0 = <&i2s2_cfg>;
	pinctrl-names = "default";
	#sound-dai-cells = <0>;
	dmas = <&dmamux 4 0>,
	<&dmamux 5 0>;
	dma-names = "rx", "tx";
	capability = "txrx";
	mclk_out = "false";// todo: ignored for the moment
	clocks = <&clk CLK_APB_I2S2>,  <&clk CLK_SDMA_AUD2>;
	clock-names = "i2s", "mclk";
	status = "okay";
	aiao = <&aiao>;
	aiao,tdm-id = <2>;
	assigned-clocks = <&clk CLK_SDMA_AUD2>;
	assigned-clock-rates = <49152000>;   /* 12.288 MHz requested */
	
	#sound-dai-cells = <0>;
};
/ {
	codec0: dummy-codec {
		compatible = "sg2002,dummy-codec";
		#sound-dai-cells = <0>;
	};
	sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "sg2002-i2s";
		simple-audio-card,format = "i2s";
		simple-audio-card,bitclock-master = <&sound_cpu>;
		simple-audio-card,frame-master = <&sound_cpu>;
		sound_cpu: simple-audio-card,cpu {
			sound-dai = <&i2s2>;
		};
		simple-audio-card,codec {
			sound-dai = <&codec0>;// real codec node, or whatever you have
		};
	};
};



Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions