#
…

2021-12-09

00:27yuyichao_ has quit [Ping timeout: 480 seconds]
02:54yuyichao_ has joined #asahi-dev
03:13PhilippvK has joined #asahi-dev
03:16phiologe has quit [Ping timeout: 480 seconds]
05:19squags has joined #asahi-dev
05:30yrlf5 has quit []
05:30yrlf has joined #asahi-dev
05:55Dcow_ has joined #asahi-dev
06:00Dcow has quit [Ping timeout: 480 seconds]
08:05aleasto has joined #asahi-dev
08:13aleasto has quit [Remote host closed the connection]
09:45aleasto has joined #asahi-dev
09:58kettenis_ is now known as kettenis
10:16gruetzkopf has joined #asahi-dev
10:19gruetze_ has quit [Ping timeout: 480 seconds]
10:35kettenis_ has joined #asahi-dev
10:35kettenis has quit [Read error: Connection reset by peer]
10:49kettenis_ is now known as kettenis
11:00Dcow has joined #asahi-dev
11:05Dcow_ has quit [Ping timeout: 480 seconds]
11:07Dcow_ has joined #asahi-dev
11:10Dcow has quit [Ping timeout: 480 seconds]
11:55minecrell has quit [Read error: Connection reset by peer]
11:57minecrell has joined #asahi-dev
12:19N3ros[m] has joined #asahi-dev
13:02marcanthere's your SPI driver :)
13:03marcancc jannau, j_ey_, sven
13:03marcanHope it works with the keyboard. We aren't implementing any of the delays yet, but the spi core might take care of that? Turns out we can't use hardware CS anyway so...
13:03marcanI tested it with the NOR flash
13:08marcanoh, I didn't even notice, but the genpd stuff works fine too, it's clockgating it properly
13:14kettenisso one interesting thing is that all previous drivers explicitly control CS# through pinctrl
13:14ketteniswhereas your driver controls it through the SPI controller itself isn't it?
13:15FireFox317marcan, apparantly the flash@0 node also dont need the #address-cells and #size-cells properties, but i guess we would also find that when we would upstream these bindings
13:16marcankettenis: indeed
13:16marcanboth should work ~identically
13:16marcanapple uses pinctrl
13:16marcanfirefox317: that's probably for defining flash partitions, which we will want to later
13:17kettenismarcan: does that mean that pinctrl should configure the pin appropriately?
13:17marcanpinctrl needs to set the pin to peripheral 1 for the internal controller CS to work
13:17marcanwhich I do now in the DT
13:17marcanalternatively you can drive it as a GPIO
13:17marcanboth work
13:19aleasto has quit [Remote host closed the connection]
13:20kettenisso we could explicitly list the gpio in the DT and your driver would simply ignore that?
13:25marcanI'm not sure how the spi core handles that; I need to check to see if that needs to be explicitly implemented
13:25marcanbut I imagine it's just a change to the probe function if so
13:25marcansince the spi core definitely has gpio CS handling code already
13:25FireFox317marcan, ah yep, you are correct. Indeed that can be used for defining partitions
13:25marcanyou need to pick one since you need to do pinctrl anyway; either internal CS or gpio CS
13:25marcankettenis: btw, since I ended up not looking at the openbsd driver... how does it compare with what you had? :)
13:26marcan(CS stuff aside)
13:26kettenisI can probably switch the OpenBSD driver to use the internal CS# control pretty quickly
13:26ar/42/42
13:29kettenismarcan: I think the fundamentals are quite close, but I don't bother with interrupts yet in the openbsd driver
13:29marcanah, I see
13:29marcanI assume you don't have the 1~32 bit per word, cpha/cpol/bitreverse features though
13:30marcandid you find the FIFO reset bits?
13:31kettenisindeed, I don't have any of those features
13:32kettenisdidn't find the FIFO reset bits (but didn't really need them)
13:32kettenisI obviously need to go in and replace some of the magic numbers now ;)
13:33kettenisI'll probably only implement the features that are really needed
13:34kettenisI like keeping my drivers minimal ;)
13:35marcanwell, it was easy to implement that stuff :p
13:36kettenisyup, yours is nice and concise as well
13:36kettenisgreat work!
13:36marcanalright, time for dinner :)
13:37kettenis* Based on spi-apple.c, Copyright 2018 SiFive, Inc.
13:37conected has joined #asahi-dev
13:37kettenisshould have skipped that on the global search and replace ;)
13:38j_ey_marcan: use_gpio_descriptors will let the spi core know about the gpios-cs from the DT
13:38marcankettenis: ahaha, thanks for catching that :)
13:39kettenisj_ey_ but you have to pick one or the other
13:41kettenisletting the controller control CS# is nicer, but if Apple ever decides to use an arbitrary GPIO to control CS# we'll have to use a gpio descriptor
13:46j_ey_marcan: Ill try it out later with the keyboard!
13:53povikpushed new version of the audio driver, on top of the asahi branch
13:54povikit has all kinds of improvements, but user-visible it supports the jack on Mac mini now
13:54povikalso can do various bit depths and sample rates
13:54povikshould detect jack insertion
13:56povikon the M1 laptops, jack support may be just a matter of appropriate DT nodes
13:57povikand the speakers there may need some code changes also in addition to DT nodes, don't know
13:57poviki only have an M1X laptop to test on, and there it's a little bit more complicated
13:58povikhm, but maybe i should bring up audio on an M1X laptop, ignoring the fancy extra speakers
13:58povikof course i should do that
13:59povikand that may be pretty similar to how the speakers are wired on the M1 laptops
14:00FireFox317povik, I can test it on a M1 air
14:02povikwe need to figure out the DT nodes first
14:05povikfeel free to review ^^ if you are in the mood
14:06povikespecially the NCO and ADMAC driver could be send out soon
14:06povikin first version
14:28FireFox317povik, added some general comments. Feel free to ignore them :)
14:37kgarrington has joined #asahi-dev
14:37kgarrington has quit [Remote host closed the connection]
14:47kgarrington has joined #asahi-dev
14:48kgarrington has quit [Remote host closed the connection]
14:48akemin_dayo has quit [Ping timeout: 480 seconds]
14:56akemin_dayo has joined #asahi-dev
14:58yuyichao_ has quit [Ping timeout: 480 seconds]
15:08marcanpovik: awesome!
15:08marcanI can test on an M1Pro if you have some baseline
15:33conected has quit []
15:48yuyichao_ has joined #asahi-dev
15:59sirn has quit [Quit: ZNC 1.8.2 - https://znc.in]
16:00sirn has joined #asahi-dev
16:16svenmarcan: nice!
16:18sveni think you want to get rid of the "retries++;"
16:19sventhere's also devm_spi_alloc_master
16:19j_ey_also you might want a timeout. in the transfer_one. sifive didnt, but I saw some other drivers that did. and the core will set one up for you (if you structure the code differently)
16:19j_ey_ is now known as j`ey
16:20svenand this doesn't matter here because the refclock is constant but i think you should use devm_add_action_or_reset to clk_disable_unprepare the clock.
16:20svenotherwise you could in theory disable the clock before the spi controller is removed
16:21bps has quit [Ping timeout: 480 seconds]
16:21sven(guenter roeck pointed that out in my watchdog v1)
16:21marcansven: yeah, someone emailed (!) me about retries++, lol
16:21svenhah :D
16:22j`eyleave the retries++ in. it's nice, ying and yang. equlibrium
16:26svenit also looks like this nvme controller just doesn't support the abort command :/
16:53yuyichao has joined #asahi-dev
16:54akemin_dayo has quit [Ping timeout: 480 seconds]
16:57yuyichao_ has quit [Ping timeout: 480 seconds]
17:19svenpovik: i briefly looked at it and left some general comments. i don't know anything about those subsystems but it mostly already looks good to me
17:19sven(except for all those HACKs ofc ;))
17:41poviksven, firefox317: thanks for the comments! good there have been some eyes on it
17:44povikmarcan: M1Pro laptop i do have, it's just that i prefer calling it M1X
17:44akemin_dayo has joined #asahi-dev
17:44bps has joined #asahi-dev
17:55j`eymarcan: what are the 4 spi1_pins?
17:55j`eyI guess CS, mosi, miso, ???
18:00_jannau_j`ey: see https://github.com/AsahiLinux/m1n1/commit/e8b30c93257b4d9d882463b573815f5c4d89681d line 173 for reference of the pin layout for m1 pro/max spi3
18:02j`ey_jannau_: thanks, I have to figure out the m1 air ones then
18:04_jannau_I would guess the layout is the same so the other pins are adjacent from cs
18:04kettenisthe clk, mosi and miso pins should already be set correctly
18:05kettenisotherwise the corellium spi driver wouldn't work
18:06_jannau_oh, I missed that spi1 doesn't use consecutive
18:07j`eyhow do I run the adt.py command? I always get some python module errors
18:08j`eyI think it generates a better/readable format now, so want to regenerate my copy
18:09jannauj`ey: python3.9 -m m1n1.adt j314c_dev.bin
18:10j`eyjannau: how do I get the .bin?
18:11_jannau_the module has '-r' to retrieve and save the adt from the device
18:12j`eythanks!
18:15j`eyI don't see any obvious dmesg errors, but keyboard doesn't work currently
18:16_jannau_j`ey: try to comment the delay hacks in applespi. I think those are only comaptible with the corellium spi driver
18:17j`eythink my mac just ran out of battery, woops, will charge for a bit and try later
18:22Gaspare has joined #asahi-dev
18:29Glanzmann has joined #asahi-dev
18:30Glanzmannj`ey: Do you use the macbook air as workstation under Linux? If so, how long does the battery last?
18:31j`eyGlanzmann: I dont use it yet
18:31j`eyjust for testing patches
19:04jannauI see "Command 1 timed out" with corellium's applespi on top of AsahiLinux/linux/asahi
19:05j`eyjannau: after removing the delays?
19:06j`eyor just as-is
19:09roxfan has joined #asahi-dev
19:10roxfan2 has quit [Ping timeout: 480 seconds]
19:45jannauj`ey: both, haven't looked into it beyond that
19:46j`eyjannau: ok, I'm not going to look tonight e9ther
19:48Gaspare has quit [Ping timeout: 480 seconds]
19:49Glanzmannjannau: Tried your patchset on the mini, works great.
19:54mipmeb has joined #asahi-dev
19:59mipmeb???? c / e r t a i n l y , z a m e r i c a n s n e e d e d s o m e t h i n g l i k e 9 / 11 t o J u s t i f y i n v a d i n g - i r - a q w h i c h h a s b e e n a l r e a d y p la n n e d a s a p a r t o f c r e a t i v e c -h a o s D i d u s a t r a i n & s u p p l y i s i s w i t h
19:59mipmeb w e a p o n s l i k e i t d i d w i t h a l - q a- e d a t o j u s t i f y c r e a t i n g w a r .s C R E - A T - I V E C H A - O S d i d c i a - d i d 9 / 11 o r i t j u s t l e t i t h a p p e n p l a n f o r m i d d l e -e a s t i f a l q a e d a d i d i t
19:59mipmeb W H Y t o k - i - l - l 9 m i l l i o n i r -a q i - s a b o u t 9 m i l l i o n i r a q i - d i -e d E i t h e r - b e c a u s e - o f d i r e c t a m e r ic a n v i o l e n c e a n d b e c a u s e o f s i e g e u s a m a d e a g a i n s t i r - a q t h a t p r e v e n t e d i -r a -q i f r o m e s s e n
19:59mipmebt i a l l i v i n g m a t e r i a l s , f o o d , m e d i c i n e a n d e v e n p e n c i l s f o r z c h i l d e r n - i s i s a n d a l q- a e d a - o n l y a p p e a r e d i n i r - a q a f t e r u s a i n v a s i o n , D i d u s a p a v e t h e w a y for i s- i s t o i r a -q ? s a d -d -a m
20:00mipmeb h u s- s i n who l o s t m o s t of his p o -w e r in 1 st , 2 nd g u l f w a r s a n d d u r i n g 1 0 y e a r s of s i e g e , d i d n o t a l l o w i s ` i s or a l , q a , e d e a t o e n t e r i r -a q , e v e n t o ` h e l p h i m a g a i n s t u s a
20:03Ganneff has joined #asahi-dev
20:03mipmeb has quit [Remote host closed the connection]
20:07___nick___ has joined #asahi-dev
20:07___nick___ has quit []
20:09___nick___ has joined #asahi-dev
20:31os has quit [Ping timeout: 480 seconds]
20:36os has joined #asahi-dev
20:43DarkShadow44 has quit [Quit: ZNC - https://znc.in]
20:43DarkShadow44 has joined #asahi-dev
20:44TheLink has quit [Quit: ZNC 1.8.2 - https://znc.in]
20:44TheLink has joined #asahi-dev
20:51ar has quit [Ping timeout: 480 seconds]
20:52ar has joined #asahi-dev
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:29Ganneff has left #asahi-dev [#asahi-dev]
21:55j`eyjannau: oh, if you want to try again, theres that retries++ line you could try delete
22:07jannauj`ey: works now with printks and not fully priming the tx fifo
22:09j`eygreat!
22:09j`eyjannau: put the diff somewhere i can try the air tomorrow
22:10jannauwill do, currently reverting hopefully unrelated changes to have a minimal diff
22:12j`eyseems like we had different issues anyway, but worth trying
22:12jannauincreased delays in applespi were required
22:16j`eyit seems like thats a property of the device connected via SPI then, and not the controller itself
22:16j`ey(delays after CS assertion)
22:18kettenisprobably should set the cs_delay member of struct spi_device appropriately
22:20kettenisthat seems to be a relatively recent addition though
22:24j`eyI dont see a cs_delay, but theres a bunch of other ones here https://www.kernel.org/doc/html/latest/driver-api/spi.html
22:24jannauno, existing delays are fine, I should not have increased the amount of fifo priming
22:25kettenissorry, cs_setup
22:26jannaualso not just priming but maximal write size
22:27kettenisah, yes, the fifo size is only 16
22:27j`eywait.. im confused by APPLE_SPI_FIFOSTAT_LEVEL_TX - inuse
22:28j`eywas thta meant to be FIFOSIZE - inuse?
22:28kettenisI think so
22:28kettenisor at least it should have the min_t that jannau suggests
22:29kettenisAPPLE_SPI_FIFO_DEPTH instead of 16 of course
22:29jannauAPPLE_SPI_FIFO_DEPTH
22:29j`eyAPPLE_SPI_FIFOSTAT_LEVEL_TX GENMASK(15, 8)
22:30ketteniswonder if there is a register that indicates the actual fifo size
22:30j`eyjannau: so does that fix it too? min_t(u32, *left, APPLE_SPI_FIFO_DEPTH - inuse);
22:34jannaucaps lock led toggling works now and doesn't break the touchpad
22:34j`eyjannau: woot
22:36jannauI suppose discarding input data on a write broke it with the corellium driver
22:37j`eyjannau: how is the trackpad in general?
22:40j`eymarcan: pinging marcan on the FIFO_DEPTH to make surehe sees it
22:41kettenisit feels like an apple trackpad
22:41kettenisso quite good
22:42j`eynice nice
22:43j`eyI got very frustrated with my thinkpad's one
22:45kettenishad to get used to the one on my x395
22:45kettenisbut having three proper mouse buttons is nice
22:45jannauit's not smooth when tracing spi in the hypervisor
22:46j`eyjannau: :D
22:52jannaudelays are still too short or missing. it is still broken on baremetal
23:11Dcow_ has quit [Read error: Connection reset by peer]
23:11Dcow has joined #asahi-dev
23:31StupidYui has joined #asahi-dev
23:57jannauj`ey: https://github.com/jannau/linux/tree/exp/spi-keyboard is my current state, the touchpad still can be wedged easily
23:58jannausetting cs_setup from the applespi probe function doesn't seem to have an effect
…