#asahi · 2021-02-12 10:45
arndok#asahi · 2021-02-12 10:44
arndmaz: ardb suggested that efifb earlycon should work as well#asahi · 2021-02-12 10:43
arndmaz: there are two options at the moment: using a second mac with macvdmtool to turn the type-c port on both ends into a uart into a uart, or building a custom cable to drive the usb-pd pins, see https://github.com/AsahiLinux/docs/wiki/HW%3AUSB-PD#asahi · 2021-02-12 10:38
arndkettenis: ok, makes sense#asahi · 2021-02-12 10:32
arndnot sure how efifb interacts with simplefb when both are built into the kernel#asahi · 2021-02-12 10:31
arndkettenis: have you managed to boot with "earlycon=efifb console=efifb"?#asahi · 2021-02-12 10:29
arndah nice, I'm starting to run out of excuses for not trying it on my hardware now#asahi · 2021-02-12 10:19
arndit would be nice to get efifb earlycon working to hand over console from uboot to the kernel in place of simplefb#asahi · 2021-02-12 10:17
arndkettenis: does it already work with framebuffer and keyboard instead of the uart cable?#asahi · 2021-02-11 14:37
arndyes, just add "Suggested-by: Arnd Bergmann <arnd@arndb.de>"#asahi · 2021-02-11 14:37
arndmodwizcode: do you want to have it permanently writable, or just write something to it and then return it to read-only?#asahi · 2021-02-11 14:35
arndmodwizcode: maybe look at aarch64_insn_patch_text()#asahi · 2021-02-11 14:33
arndmodwizcode: we had some discussions about conflicting page attributes in Linux years ago, those proably resulted in the current language in the reference manual. I much preferred the powerpc behavior of causing a checkstop to be honest#asahi · 2021-02-11 14:32
arndyes#asahi · 2021-02-11 14:31
arndhttps://www.irccloud.com/pastebin/m5QuJgkG/#asahi · 2021-02-11 14:31
arndmodwizcode: maybe earlycon can be a simple hack like#asahi · 2021-02-11 14:05
arndI wonder if you can just hardcode it to ioremap_np() in apple_m1_early_console_setup()#asahi · 2021-02-11 14:04
arndok, then I can stop looking for that#asahi · 2021-02-11 14:04
arndmarcan: how is the mapping done for earlycon?#asahi · 2021-02-11 14:03
arndmarcan: the ioremap stuff all looks good to me, just needs a DT binding description for the new properties, and a confirmation from robher that these are the semantics he wants#asahi · 2021-02-11 13:59
arndyep, just found that commit as well#asahi · 2021-02-11 13:58
arndotherwise looks good to me#asahi · 2021-02-11 13:57
arndmarcan: fairly sure you can just remove the two now-empty callbacks completely#asahi · 2021-02-11 13:57
arndsure#asahi · 2021-02-11 13:55
arndok, got it#asahi · 2021-02-11 13:54
arnds/registration/request_resource/#asahi · 2021-02-11 13:54
arndmarcan: I don't see the code that actually does the registration you mention in the comment, where is that?#asahi · 2021-02-11 13:47
arndand both of these are slightly ugly as well, but are local to this driver#asahi · 2021-02-11 13:47
arndyes, I understand about the flag, it would then either have to call of_mmio_is_nonposted() or decide based on the compatible string#asahi · 2021-02-11 13:46
arndI need to check what it would take to use devm_ioremap_resource()#asahi · 2021-02-11 13:46
arndThe only part I don't like in the series is the new devm_ioremap_resource_noreq() interface. I'd rather see the driver converted to either use devm_ioremap_resource(), or an open-coded devm_ioremap()#asahi · 2021-02-11 13:44
arndI thought he only wanted to walk up the tree when there is an empty ranges property, but I may have misunderstood that#asahi · 2021-02-11 13:43
arndI'm still trying to form an opinion on the of_mmio_is_nonposted() semantics. My earlier thoughts were that it should only have an effect on direct children of the bus, but it seems that robher has some other ideas (not sure if your implementation matches those)#asahi · 2021-02-11 13:41
arndyes, I think that would help me.#asahi · 2021-02-11 13:39
arndmarcan: I would find it slightly easier to review if you combine the patches into slightly larger chunks, but that's not important. I assume that I'll just end up merging the lot through the soc tree in the end#asahi · 2021-02-11 13:35
arndah, I see you just split it up more fine-grained, and the generic fallback is already there#asahi · 2021-02-11 13:35
arndmarcan: when you add the ioremap_np(), I'd suggest also adding a fallback implementation in asm-generic/io.h and a devm_ioremap_np() wrapper in include/linux/io.h+lib/devres.c#asahi · 2021-02-10 15:09
arndFor endianess, we have a tristate 'big-endian;', 'little-endian;' or no property meaning it is whatever the default for that compatible string is. We could do the same in bus nodes here, with one value meaning 'all children use nGnRnE', one for 'all children use 'nGnRE' registers, and no property meaning either that its inherited from grandparent, or not to do anything special#asahi · 2021-02-10 14:31
arnd(those that have a reg property)#asahi · 2021-02-10 14:31
arndif it only affects the device itself, it would make the PCI case work nicely, but it would be required in every single device node#asahi · 2021-02-10 14:30
arndOn the question how to determine whether that flag should be set, an empty property similar to 'dma-coherent' and 'big-endian' sounds reasonable, but I'm unsure whether it should affect only that device or the children#asahi · 2021-02-10 14:29
arndmarcan: in case you end up converting drivers from ioremap() to devm_ioremap_resource(), watch out for the implied 'request_mem_region' that prevents an address from being mapped more than once, but is not implied by the normal ioremap#asahi · 2021-02-10 14:27
arndwe might want to introduce a non-devm_ version of ioremap_resource() if some driver wants it, but that should be easy enough to do, and most drivers benefit of using the dev_ioremap_resource() over the many other variants anyway#asahi · 2021-02-10 14:25
arndso there just needs to be a sane DT representation to make it work not just by accident by also on other implementations#asahi · 2021-02-10 14:25
arndI'd like to see of_address_resource to set a flag in 'struct resource' for any device that needs it, which would nicely happen to work because PCI devices create their resources differently#asahi · 2021-02-10 14:23
arndrobher: specifically it's the PCI memory space, so the PCI device node itself has a mix of the two, because its own registers are like the rest of MMIO#asahi · 2021-02-10 11:17
arndthere are probably other ways to have that flag set, as well as other ways to hack the ioremap() internals function to not require that flag#asahi · 2021-02-10 11:14
arndthe approach discussed above would have the purpose of encoding it in 'struct resource' in order to have the ioremap_resource() family of functions do the right thing based on an architecture specific change#asahi · 2021-02-10 11:14
arndRight, I think haivng a regular __iomem pointer with readl/writel but a special way to map it is the right abstraction for Linux, the question is just where to hand the special logic for creating the page tables#asahi · 2021-02-10 11:01
arndin this case, the Linux implementation would presumably require all drivers to use regmap_write()/regmap_read() for accessing any of the internal registers, rather than our normal writel()/readl(). It could still work with drivers that are shared with other machines, but regmap does have a noticeable overhead because it requires an indirect function call instead of a fancy pointer dereference