Hello KevinFFF,
thanks for your response.
As the location suggests, we are using the SPI2 interface on the AGX Orin’s camera connector.
/sys/kernel/debug/bpmp/debug/clk/spi2# cat possible_parents
pllp_out0 pll_c pll_aon clk_32k osc
The min_rates with these parents are as follows:
pllp_out0: 3187500
pll_c : 1562499
pll_aon : 3125000
clk_32k : 256
osc : 300000
So there are enough possibilities to reach the desired clock rate, the driver just does not do this selection in JP6 (as described above).
Furthermore, I probably also found the source of the inverted byte order when sending:
The TRM for the AGX Orin, in the SPI section, it states that there is a config field called En_LE_Byte (page 8709 and 8725) that is used to control the byte endianness of transfers. The driver of kernel 5.10 (JP5) sets this bit, but the driver of the jammy kernel (JP6) does not set it.
It seems that there were big changes to the driver, coming from JP5 to JP6, that will break a lot of systems (especially the hard coded endianness).
I tried setting the En_LE_Byte manually via devmem2 and /dev/mem, but it seems I cannot access the registers of SPI2 (base address: 0x0C260000) since it always returns 0xFFFFFFFF (when reading it) and I get an error in dmesg:
~/Documents$ sudo devmem2 0x0C260000
/dev/mem opened.
Memory mapped at address 0xffff9e157000.
Value at address 0xC260000 (0xffff9e157000): 0xFFFFFFFF
[ 3647.958270] CPU:0, Error: cbb-fabric@0x13a00000, irq=192
[ 3647.958282] **************************************
[ 3647.958284] CPU:0, Error:cbb-fabric, Errmon:2
[ 3647.958291] Error Code : TIMEOUT_ERR
[ 3647.958299]
[ 3647.958300] Error Code : TIMEOUT_ERR
[ 3647.958301] MASTER_ID : CCPLEX
[ 3647.958303] Address : 0xc260000
[ 3647.958304] Cache : 0x0 -- Device Non-Bufferable
[ 3647.958306] Protection : 0x2 -- Unprivileged, Non-Secure, Data Access
[ 3647.958308] Access_Type : Read
[ 3647.958309] Access_ID : 0x15
[ 3647.958311] Fabric : cbb-fabric
[ 3647.958312] Slave_Id : 0x0
[ 3647.958313] Burst_length : 0x0
[ 3647.958314] Burst_type : 0x1
[ 3647.958315] Beat_size : 0x3
[ 3647.958315] VQC : 0x0
[ 3647.958316] GRPSEC : 0x7e
[ 3647.958317] FALCONSEC : 0x0
[ 3647.958320] AON_SLV_TIMEOUT_STATUS : 0xffffffff
[ 3647.958323] **************************************
[ 3647.958346] WARNING: CPU: 0 PID: 0 at drivers/soc/tegra/cbb/tegra234-cbb.c:608 tegra234_cbb_isr+0x14c/0x180
[ 3647.958619] ---[ end trace e6f36f163923c8de ]---