Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PocketCHIP can't boot.



The attached patch should fix this panic, please test.


On Tue, 16 Oct 2018, Gmail TM wrote:

Hi everyone!!

Now I try to boot PocketCHIP for upcoming event KOF2018 https://www.k-of.jp/2018/ at 2018/11/9,10.

But it halt at below:

[   1.0000000] tcakp0 at iic1 addr 0x34: TCA8418
[   1.0000000] panic: kernel diagnostic assertion "sc->sc_inuse" failed: file "/usr/src/sys/dev/i2c/gttwsi_core.c", line 284
[   1.0000000] cpu0: Begin traceback...
[   1.0000000] 0x8081b7ec: netbsd:db_panic+0x14
[   1.0000000] 0x8081b804: netbsd:vpanic+0x194
[   1.0000000] 0x8081b81c: netbsd:__aeabi_uldivmod
[   1.0000000] 0x8081b864: netbsd:gttwsi_initiate_xfer+0x120
[   1.0000000] 0x8081b8dc: netbsd:iic_exec+0x450
[   1.0000000] 0x8081b944: netbsd:tcakp_attach+0x240
[   1.0000000] 0x8081b97c: netbsd:config_attach_loc+0x1b4
[   1.0000000] 0x8081b9ac: netbsd:config_found_sm_loc+0x54
[   1.0000000] 0x8081ba44: netbsd:iic_attach+0x468
[   1.0000000] 0x8081ba7c: netbsd:config_attach_loc+0x1b4
[   1.0000000] 0x8081baac: netbsd:config_found_sm_loc+0x54
[   1.0000000] 0x8081bac4: netbsd:config_found_ia+0x24
[   1.0000000] 0x8081bafc: netbsd:fdtbus_attach_i2cbus+0xb4
[   1.0000000] 0x8081bbd4: netbsd:sunxi_twi_attach+0x280
[   1.0000000] 0x8081bc0c: netbsd:config_attach_loc+0x1b4
[   1.0000000] 0x8081bc3c: netbsd:config_found_sm_loc+0x54
[   1.0000000] 0x8081bdc4: netbsd:fdt_scan+0x188
[   1.0000000] 0x8081bdf4: netbsd:fdt_attach+0xdc
[   1.0000000] 0x8081be2c: netbsd:config_attach_loc+0x1b4
[   1.0000000] 0x8081be5c: netbsd:config_found_sm_loc+0x54
[   1.0000000] 0x8081be74: netbsd:config_found+0x2c
[   1.0000000] 0x8081beac: netbsd:arm_fdt_attach+0x68
[   1.0000000] 0x8081bee4: netbsd:config_attach_loc+0x1b4
[   1.0000000] 0x8081bf0c: netbsd:config_rootfound+0x48
[   1.0000000] 0x8081bf2c: netbsd:cpu_configure+0x58
[   1.0000000] 0x8081bf9c: netbsd:main+0x2e8
[   1.0000000] 0x8081bfac: netbsd:kernel_text+0x50
[   1.0000000] cpu0: End traceback...
Stopped in pid 0.1 (system) at  netbsd:cpu_Debugger+0x4:        bx      r14

Full dmesg is at https://sacraya.610t.org/NetBSD/dmesg/dmesg.pocketchip.20181016.txt

Can this kernel panic fix easily?

Thanks in advance.
—
Takeshi MUTOH @610t

[Additional information]

* FEL command
#!/bin/sh
SUNXIFEL=../../sunxi-tools/sunxi-fel
UBOOT=u-boot-sunxi-with-spl.bin
KERNEL=netbsd-SUNXI.ub
DTB=sun5i-r8-pocketchip.dtb
BOOT=boot.scr

${SUNXIFEL} -v -p \
      uboot ${UBOOT} \
      write 0x42000000 ${KERNEL} \
      write 0x43000000 ${DTB} \
      write 0x43100000 ${BOOT}

* boot.cmd
setenv bootargs 'root=sd0a'
setenv bootcmd 'fdt addr ${fdt_addr_r}; bootm ${kernel_addr_r} - ${fdt_addr_r}'
boot

* FEL message
Enabling the L2 cache
Stack pointers: sp_irq=0x00002000, sp=0x00005DF8
Reading the MMU translation table from 0x00008000
Disabling I-cache, MMU and branch prediction... done.
=> Executing the SPL... done.
Setting write-combine mapping for DRAM.
Setting cached mapping for BROM.
Writing back the MMU translation table.
Enabling I-cache, MMU and branch prediction... done.
Writing image "U-Boot 2017.11 for sunxi board", 374891 bytes @ 0x4A000000.
100% [================================================]  7520 kB,  468.9 kB/s
100% [================================================]    28 kB,  470.0 kB/s
100% [================================================]     0 kB,   37.3 kB/s
Passing boot info via sunxi SPL: script address = 0x43100000, uEnv length = 0
Starting U-Boot (0x4A000000).


Index: tcakp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/i2c/tcakp.c,v
retrieving revision 1.9
diff -u -p -r1.9 tcakp.c
--- tcakp.c	26 Jun 2018 06:03:57 -0000	1.9
+++ tcakp.c	16 Oct 2018 23:53:20 -0000
@@ -364,14 +364,26 @@ tcakp_attach(device_t parent, device_t s
 static int
 tcakp_read(struct tcakp_softc *sc, uint8_t reg, uint8_t *val)
 {
-	return iic_exec(sc->sc_i2c, I2C_OP_READ_WITH_STOP, sc->sc_addr,
+	int error;
+
+	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	error = iic_exec(sc->sc_i2c, I2C_OP_READ_WITH_STOP, sc->sc_addr,
 	    &reg, 1, val, 1, I2C_F_POLL);
+	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+
+	return error;
 }
 
 static int
 tcakp_write(struct tcakp_softc *sc, uint8_t reg, uint8_t val)
 {
 	uint8_t buf[2] = { reg, val };
-	return iic_exec(sc->sc_i2c, I2C_OP_WRITE_WITH_STOP, sc->sc_addr,
+	int error;
+
+	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	error = iic_exec(sc->sc_i2c, I2C_OP_WRITE_WITH_STOP, sc->sc_addr,
 	    NULL, 0, buf, 2, I2C_F_POLL);
+	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+
+	return error;
 }


Home | Main Index | Thread Index | Old Index