00:00
<
clever >
its sort of like vtables
00:02
<
clever >
and then hdmi_get_func_table, as expected
00:05
<
clever >
ok, i can see a device_open(), that calls hdmi_open()
00:06
<
clever >
and i can see it rigging up some dma irq's, for iec61937 (hdmi audio i believe)
00:06
<
clever >
and thats related to hdmi_num_dma_blocks= in config.txt
00:06
<
clever >
along with hdmi_dma_waits=
00:07
<
clever >
hdcp_initialize() can also call hdmi_open()
00:08
<
clever >
oh, hdmi_boot() !
00:09
<
clever >
it copies a pair of 0x14 byte arrays of nuls, onto some stack variables
00:09
<
clever >
then copies them into a global variable
00:09
<
clever >
then calls a bunch more functions....
00:10
<
clever >
hdmi_control_gpio function table....
00:10
<
Guest92 >
sounds important
00:11
<
clever >
ah, all it does is rig up the hotplug pin
00:13
<
clever >
an entire class, with 6 functions, to do just 1 task
00:13
<
clever >
read a pin, and adjust for active-low vs active-high
00:14
<
clever >
its not even a thread, its something you call
00:15
<
clever >
complete with a constructor, destructor, and info function, as is typical
00:15
<
Guest92 >
for speedy boot-up
00:19
<
Ad0 >
I mean why are the other ones active out hi ?
00:19
<
Ad0 >
what does lo mean anyway
00:20
<
clever >
the actual state, when treating the pin as an input
00:20
<
Ad0 >
well it's a CS , is there something messing with GPIO30?
00:20
<
Ad0 >
should I care about it ?
00:20
<
clever >
the debug says the spi0 driver is managng that pin
00:20
<
clever >
so normally, linux shouldnt let anything else mess with it
00:21
<
Ad0 >
why is it lo when the others are hi ? they are all managed by SPI
00:21
<
clever >
try adding print statements to the spi driver, around its chip-select code?
00:21
<
Ad0 >
that will take me 100 years hehe
00:22
<
clever >
what is the compatible= for spi0?
00:22
<
Ad0 >
I am not sure how to just replace the kernel driver
00:22
<
Ad0 >
there is no compatible for spi0 itself
00:22
<
Ad0 >
do you mean the devices on spi0 ?
00:22
<
clever >
there must be
00:22
<
clever >
spi0 cant work without a compatible
00:22
<
clever >
your looking at an overlay, you want to look at the base dts, or the final dts
00:23
<
clever >
run `dtc /proc/device-tree | less`, and scroll down to that area, to see the final dts
00:24
<
Ad0 >
you mean &spi0 root ? or the sub nodes
00:24
<
clever >
for the spi0 node
00:25
<
Ad0 >
there's nothing in the working one , it doesn't render like that either
00:25
<
Ad0 >
no compatible on the spi0 itself
00:25
<
clever >
thats still an overlay
00:25
<
clever >
run `dtc /proc/device-tree > foo.dts` and gist that
00:26
<
Ad0 >
I don't use overlay myself though. I use my own bcm2710-rpi-cm3.dts
00:27
<
clever >
Ad0: just run that command, and pastebin the output file
00:27
<
Ad0 >
I will do it from the working dts on the working kernel from the producer
00:28
<
clever >
that wont make a difference
00:28
<
clever >
the compatible will be the same in either case
00:28
<
Ad0 >
ok this is the result
00:28
<
clever >
and look at line 844
00:28
<
clever >
there is the answer
00:29
<
clever >
that is the final dts, after all overlays have been applied to the base dts
00:29
<
clever >
that final dts, is what linux is acting on
00:29
<
clever >
drivers/spi/spi-bcm2835.c: { .compatible = "brcm,bcm2835-spi", },
00:29
<
Ad0 >
I will see what my dts looks like
00:29
<
clever >
so that tells linux to load this driver, to manage the spi controller
00:29
<
clever >
drivers/spi/Makefile:obj-$(CONFIG_SPI_BCM2835) += spi-bcm2835.o
00:30
<
clever >
what is that .config flag set to?
00:31
<
Ad0 >
CONFIG_SPI_BCM2835=y
00:31
<
Ad0 >
CONFIG_SPI_BCM2835AUX=y
00:32
<
clever >
then its baked into the kernel, and you cant just replace the driver
00:32
<
clever >
youll need to build the entire kernel whenever you make changes for debug
00:32
<
Ad0 >
do you think the compatible will work
00:32
<
clever >
i see no reason why it wouldnt
00:32
<
clever >
i think the spi driver is using spi_get_csgpiod to handle chip-selects
00:33
<
Ad0 >
I know it uses gpio to set cs or else it wouldn't show up right
00:33
<
Ad0 >
in the debug gpio
00:33
<
clever >
the old way of chip-select, was to use the native cs for the controller
00:33
<
clever >
but that limited you to certain pins
00:34
<
clever >
the new way, just uses regular gpio to set the cs lines
00:34
<
Ad0 >
yeah the driver checks
00:34
<
Ad0 >
I saw the source
00:34
<
Ad0 >
so it should work
00:34
<
Ad0 >
[ 4.991536] spi_dac7512: loading out-of-tree module taints kernel.
00:34
<
Ad0 >
so that SPI driver works
00:34
<
Ad0 >
but that is reg 0
00:36
<
Ad0 >
if it didn't use cs_gpiod it would say "setup: only two native chip-selects are supported"
00:37
<
Ad0 >
I removed the gpio handle and it said that so that works
00:37
<
clever >
so now cs_gpiod, will be a reference to the pins the dts pointed to
00:38
<
clever >
and what about BCM2835_SPI_NUM_CS on line 1291?
00:39
<
Ad0 >
way over the 4 I use
00:39
<
Ad0 >
that was a problem in kernel 5.4
00:39
<
Ad0 >
it was 3 there...
00:40
<
clever >
static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
00:40
<
clever >
that looks like a relevant function!
00:40
<
Ad0 >
yeah but like the other driver in the tree works though
00:40
<
clever >
add some printk statements to that, rebuild the kernel, and see what happens
00:41
<
Ad0 >
yeah maybe I should try, I just have a feeling something is wrong with that CS since it's not a user GPIO
00:41
<
Ad0 >
so I think something should be disabled that is screwing around with that
00:42
<
Ad0 >
bluetooth messes with it
00:42
<
clever >
where does bt mess with it?
00:42
<
clever >
are you sure that gpio is exposed on a header?
00:43
<
Ad0 >
not on the pi3 but on the CM3
00:44
<
clever >
where does bt mess with it?
00:46
<
Ad0 >
uart1 bluetooth I think hold on
00:46
<
Ad0 >
hm maybe that was PI4
00:47
<
clever >
on the pi3, gpio 32/33 are the bt uart
00:47
<
Ad0 >
yeah correct, sorry
00:47
<
clever >
on the pi4, gpio 30-33 are bt uart, with hw flow control
00:48
<
clever >
but if you dont have bt in the device-tree, that wont matter
00:49
<
Ad0 >
cam0_reg might have 30
00:49
<
Ad0 >
but I don't have that either I think
00:49
<
clever >
its disabled, so linux will ignore that
00:51
<
Ad0 >
yeah it's disabled in the functioning dts
00:51
<
clever >
and in the broken dts?
00:52
<
Ad0 >
arch/arm/boot/dts/bcm270x.dtsi: cam0_regulator: cam0_regulator {
00:52
<
clever >
you want to look at the final dts
00:52
<
clever >
there are many overlays, and it can be very confusing to figure it out manually
00:52
<
Ad0 >
yeah I don't have DTC on my own device :/
00:52
<
clever >
you can do it with cp as well
00:52
<
Ad0 >
I have 0 overlays because I use a base dts with everything in it
00:52
<
clever >
what does `find /sys -name fdt` report?
00:52
<
Ad0 >
but it includes the dtsi
00:53
<
Ad0 >
it reports /sys/firmware/fdt
00:53
<
clever >
now copy that file to a machine that does have dtc
00:53
<
clever >
and run dtc on it
00:53
<
clever >
it can even be an x86 machine
00:58
Guest92 has quit [Quit: Client closed]
01:02
<
Ad0 >
the pins declaration is not used unless it's used by something right
01:03
<
Ad0 >
pcm_gpio28 and uart0_ctsrts_gpio30
01:03
<
clever >
yep, thats unused
01:04
<
Ad0 >
the working config.txt on the working device has dtparam=audio=on
01:05
<
Ad0 >
but there is no audio, maybe it's to activate something related to that GPIO ? I dunno
01:06
<
clever >
audio is pwm based
01:06
<
clever >
gotta run, somethings come up
01:06
<
Ad0 >
ok thank you so far and good night!
01:07
<
Ad0 >
I will run cat /sys/kernel/debug/gpio on the working image
01:31
Guest92 has joined ##raspberrypi-internals
01:31
HerculeP has joined ##raspberrypi-internals
01:35
srk_ has joined ##raspberrypi-internals
01:38
snuck has joined ##raspberrypi-internals
01:40
sneak has quit [Ping timeout: 264 seconds]
01:40
Herc has quit [Ping timeout: 264 seconds]
01:40
srk has quit [Ping timeout: 264 seconds]
01:40
srk_ is now known as srk
01:41
HerculeP is now known as Herc
01:53
<
Guest92 >
Update on 700+ns GPIO stall. It was caused by an interrupt handler. Not sure which handler yet, or exactly what it is doing to stall the GPIO bus, but disabling IRQs gave me reliable sub-200ns GPIO read latency.
01:54
<
Guest92 >
ie, not bus-hogging by VC4 VPU as I had originally thought
01:57
<
clever >
Guest92: try to find the irq handler, and add some printfs to it, so you can see when it fires, and what its doing
02:08
<
clever >
Guest92: oh!, i found an hdmi_power_on and hdmi_power_off!
02:14
<
clever >
but not much in them
02:22
f_ has quit [Read error: Connection reset by peer]
02:24
f_ has joined ##raspberrypi-internals
02:36
Guest92 has quit [Quit: Client closed]
04:10
jcea has quit [Ping timeout: 246 seconds]
04:31
HerculeP has joined ##raspberrypi-internals
04:32
snuck has quit [Ping timeout: 255 seconds]
04:34
Herc has quit [Ping timeout: 255 seconds]
04:34
sneak has joined ##raspberrypi-internals
06:07
angerisagift has quit [Ping timeout: 268 seconds]
06:08
angerisagift has joined ##raspberrypi-internals
12:48
jcea has joined ##raspberrypi-internals
14:12
jcea has quit [Ping timeout: 268 seconds]
16:01
<
Ad0 >
clever, the issue with "lo" was that probing failed. so it is in that state
17:31
HerculeP is now known as Herc
17:54
jcea has joined ##raspberrypi-internals
21:58
angerisagift has quit [Ping timeout: 264 seconds]
21:59
angerisagift has joined ##raspberrypi-internals
22:08
angerisagift has quit [Ping timeout: 255 seconds]
22:15
angerisagift has joined ##raspberrypi-internals
23:30
f_[xmpp] has quit [Ping timeout: 264 seconds]
23:41
angerisagift has quit [Read error: Connection reset by peer]
23:45
angerisagift has joined ##raspberrypi-internals