IRC logs for #openrisc Friday, 2016-04-08

--- Log opened Fri Apr 08 00:00:11 2016
shorneHello, anyone ever written any part of an ac97 codec? (not controller like in opencores)05:27
wallentoshorne: you are going the full path? :-)06:34
shornewallento: front to back, dac/adc(chips) - ac97 codec(verilog) - ac97 controller(opencores) - linux(dma api)08:20
shorneI have the dac/adc chips and have written some verilog for them to read/write via their spi interface08:21
shornenow I need a ac97 link to spi codec layer08:22
shorneI guess I need to write myself, did some quick searching, it seems most people buy $3 ac97 codec chips...08:22
shorneI rather just do from scratch08:22
wallentostupid people ;)08:26
stekernwhy do you need to add ac97 into the path though?08:35
wallentono, I am just curious08:42
shornewallento: ac97 just because there is already good driver support for that.10:16
shorneand I dont think there is intel HDA controller core avaiable10:17
shornestekern: meant to write to you that comment, I want to test the dma code in the kernel10:38
shornethe ac97 controller in opencores and I think existing drivers support dma pretty well10:38
shorneso it would be a good test for the kernel10:38
stekernshorne: there is no dma support for the opencores ac97 kernel driver15:08
stekernwe have tested using together with a plain i2s chip though15:11
stekernand there's a driver for that in the kernel tree15:11
stekernolofk: oh ;)15:27
olofkwallento: I think it's good that you point the build instructions on the opencores wiki to, but it's damn hard to find the actual instructions now16:39
olofkTook me about five minutes of following circular links before I found the way to
shornestekern: alright, i did see an ac97_dma_if.v file there. Ill see if I can get it working.16:56
stekernyeah, it is supposed to be used together baroque dma core that I wouldn't recommend wasting time on16:58
stekernI did look into it at some point16:58
stekern*together with some17:00
shorneI see, does the wb_streamer work with another dma controller? or its doing it itself?17:02
olofkshorne: wb_streamer is a half DMA :)17:02
olofkThere are two versions, each with a stream port and a wishbone port17:03
olofkSo you either read from a stream and write to memory, or vice versa17:03
olofkThe idea was that it should be possible to connect the stream ports as well to have a memory<->memory DMA17:04
olofkBut for most peripheral cores you need stream<->memory17:04
olofkBut stekern knows more about the Linux side of things. I only did the RTL17:04
shorneyeah, which is pretty much true for sound too17:05
olofkIt should be dead simple to use. Just set up a base address, a length and start it. You'll get an interrupt (or can poll a register) to check when it's done17:06
shorneIs 'stream' a special protocol? or it just read/write the bus per clock cycle?17:07
olofkshorne: It's pretty much AXI stream17:07
olofkMaster outputs valid whenever it has something. slave outputs ready when it's ready to receive. When both valid and ready are asserted, the word is transferred17:08
olofkhmm.. the extended verilog output that I asked for in binutils objcopy works, but I get reversed endianness for OpenRISC elfs17:09
olofkIt's trivial to swap this back in RTL of course, but it would be nice to have it correct from the beginning17:10
shorneyeah, that would confuse people who dont know the background17:12
olofkThe source code is pretty simple, but I still can't figure out how to do this correctly17:14
olofkAhh now I see17:14
olofkJust need to figure out how to get the endianness from the arch17:15
shorneI see something called "sys-sr-lee" little endian enabled in opcodes/or1k-desc.c17:18
olofkThere's a struct called 'bfd' that is passed in to the function, but I can't find the definition of it17:19
shornethose looks like registers though...17:19
shornenot one of these? bfd/cpu-or1k.c17:21
shornethat doesnt have endianness17:23
shorneconst bfd_arch_info_type * bfd_get_arch_info(bfd *abfd)17:24
olofkshorne: If you look at verilog_write_record in bfd/verilog.c, it gets passed a pointer (struct?) called bfd. I suspect that this contains the info I need17:25
shorneyeah, I am gussing its in bfd_arch_info_type17:28
shornedefined in bfd/cpu-or1k.c17:28
shornewhich you can get by bassing the bfd *abfd to bfd_get_arch_info(bfd *abfd)17:29
shornenot 100% sure endian is in bfd_arch_info_type though17:29
shornesorry... need to go17:29
olofkaahh!! This is driving me crazy. Where is the damn struct defined?17:36
olofk(Assuming it's a struct)17:36
--- Log closed Sat Apr 09 00:00:13 2016

Generated by 2.15.2 by Marius Gedminas - find it at!