NetBSD-Bugs archive

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

port-evbarm/52503: non-DIAGNOSTIC BEAGLEBONE kernel fails



>Number:         52503
>Category:       port-evbarm
>Synopsis:       non-DIAGNOSTIC BEAGLEBONE kernel fails
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 23 15:05:00 +0000 2017
>Originator:     John D. Baker
>Release:        NetBSD/evbarm-8.0_BETA NetBSD/evbarm-8.99.1 (earmv7hf-el)
>Organization:
>Environment:
NetBSD 8.99.1 (BEAGLEBONE) #4: Mon Aug 21 22:05:42 CDT 2017
	sysop%x3650.technoskunk.fur@localhost:/r1/build/current/obj/evbearmv7hf-el/sys/arch/evbarm/compile/BEAGLEBONE

>Description:
As described in the thread starting here:

  http://mail-index.netbsd.org/port-arm/2017/07/27/msg004323.html

BEAGLEBONE* kernels built without "options DIAGNOSTIC" fail as follows:

[...]
omapdmtimer0 at obio1 addr 0x48040000-0x48040fff intr 68: DMTIMER2
omapdmtimer2 at obio1 addr 0x48044000-0x48044fff intr 92: DMTIMER4
trng0 at obio1 addr 0x48310000-0x48311fff intr 111
cpsw0 at obio2 addr 0x4a100000-0x4a107fff intrbase 40: TI Layer 2 3-Port Switch
cpsw0: Ethernet address 78:a5:04:ef:14:1a
ukphy0 at cpsw0 phy 0: OUI 0x00800f, model 0x000f, rev. 1
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
Fatal kernel mode data abort: 'External Non-Linefetch Abort (S)'
trapframe: 0x80a7de20
FSR=00001808, FAR=e0044010, spsr=20000113
r0 =00000000, r1 =e0044000, r2 =00000010, r3 =00000001
r4 =000003e8, r5 =9ff96210, r6 =80310dd4, r7 =00000001
r8 =807317dc, r9 =9ef40ed8, r10=87ffc01b, r11=80a7de8c
r12=80a7de90, ssp=80a7de70, slr=8030580c, pc =80310dd4

Stopped in pid 0.1 (system) at  netbsd:generic_bs_w_4:  str     r3, [r1, r2]
db> bt
0x80a7de8c: netbsd:dmt_reset+0x10
0x80a7deb4: netbsd:dmt_start_periodic_intr+0x24
0x80a7dedc: netbsd:cpu_initclocks+0x98
0x80a7df44: netbsd:initclocks+0x48
0x80a7df9c: netbsd:main+0x248
0x80a7dfac: netbsd:kernel_text+0x50


Additional output from "options VERBOSE_INIT_ARM" (8.0_BETA kernel):

## Transferring control to NetBSD stage-2 loader (at address 80300000) ...
@BCCDFG01H1IJKLMZ                                                         
defgam335x_cpu_clk: 1000000000: sys_clk=24000000 m=1000 n=23 (24) m2=1
h
uboot arg = 0x9ef40fb0, 0, 0x9ffa21eb, 0x9ef442f0

NetBSD/evbarm (beagle) booting ...
initarm: Configuring system ...
sdram_config = 0x61c05332, memsize = 512MB
arm32_bootmem_init: memstart=0x80000000, memsize=0x20000000, kernelstart=0x80300000
arm32_bootmem_init: kernelend=0x80a2a000
arm32_bootmem_init: adding 64235 free pages: [0x80a2a000..0x9fffffff] (VA 0x80a2a000)
arm32_bootmem_init: adding 384 free pages: [0x80000000..0x802fffff] (VA 0x80000000)
arm32_kernel_vm_init: 2 L2 pages are needed to map 0xa5c000 kernel bytes
arm32_kernel_vm_init: allocating page tables for kerneladd_pages: adding pv 0x806fe058 (pa 0x80a2a000, va 0x80a2a000, 1 pages) at tail
add_pages: appending pv 0x806ff15c (0x80a2c000..0x80a2ffff) to 0x80a2a000..0x80a2bfff
add_pages: appending pv 0x806fe1e4 (0x80a30000..0x80a31fff) to 0x80a2a000..0x80a2ffff
 vmadd_pages: appending pv 0x806fe1f8 (0x80a32000..0x80a33fff) to 0x80a2a000..0x80a31fff
add_pages: appending pv 0x806fe20c (0x80a34000..0x80a35fff) to 0x80a2a000..0x80a33fff
add_pages: appending pv 0x806fe220 (0x80a36000..0x80a37fff) to 0x80a2a000..0x80a35fff
add_pages: appending pv 0x806fe234 (0x80a38000..0x80a39fff) to 0x80a2a000..0x80a37fff
add_pages: appending pv 0x806fe248 (0x80a3a000..0x80a3bfff) to 0x80a2a000..0x80a39fff
add_pages: appending pv 0x806fe25c (0x80a3c000..0x80a3dfff) to 0x80a2a000..0x80a3bfff
add_pages: appending pv 0x806fe270 (0x80a3e000..0x80a3ffff) to 0x80a2a000..0x80a3dfff
add_pages: appending pv 0x806fe284 (0x80a40000..0x80a41fff) to 0x80a2a000..0x80a3ffff
arm32_kernel_vm_init: allocating stacks
add_pages: appending pv 0x806fe898 (0x80a42000..0x80a43fff) to 0x80a2a000..0x80a41fff
add_pages: appending pv 0x806fe884 (0x80a44000..0x80a45fff) to 0x80a2a000..0x80a43fff
add_pages: appending pv 0x806fe870 (0x80a46000..0x80a47fff) to 0x80a2a000..0x80a45fff
add_pages: appending pv 0x806fe85c (0x80a48000..0x80a49fff) to 0x80a2a000..0x80a47fff
add_pages: appending pv 0x806fe848 (0x80a4a000..0x80a4bfff) to 0x80a2a000..0x80a49fff
add_pages: appending pv 0x806fe8ac (0x80a4c000..0x80a4dfff) to 0x80a2a000..0x80a4bfff
add_pages: appending pv 0x806fe090 (0x80a4e000..0x80a51fff) to 0x80a2a000..0x80a4dfff
Creating L1 page table at 0x80a2c000
arm32_kernel_vm_init: adding L2 pt (VA 0x80a2a000, PA 0x80a2a000) for VA 0x80000000 (kernel)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a30000, PA 0x80a30000) for VA 0x80800000 (kernel)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a32000, PA 0x80a32000) for VA 0xc0000000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a34000, PA 0x80a34000) for VA 0xc0800000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a36000, PA 0x80a36000) for VA 0xc1000000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a38000, PA 0x80a38000) for VA 0xc1800000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a3a000, PA 0x80a3a000) for VA 0xc2000000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a3c000, PA 0x80a3c000) for VA 0xc2800000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a3e000, PA 0x80a3e000) for VA 0xc3000000 (vm)
arm32_kernel_vm_init: adding L2 pt (VA 0x80a40000, PA 0x80a40000) for VA 0xc3800000 (vm)
Mapping kernel
arm32_kernel_vm_init: adding chunk for kernel text 0x80300000..0x80605fff (VA 0x80300000)
add_pages: adding pv 0x806fe044 (pa 0x80300000, va 0x80300000, 387 pages) before pa 0x80a2a000
arm32_kernel_vm_init: adding chunk for kernel data/bss 0x80606000..0x80a29fff (VA 0x80606000)
add_pages: adding pv 0x806fe030 (pa 0x80606000, va 0x80606000, 530 pages) before pa 0x80a2a000
Listing Chunks
arm32_kernel_vm_init: pv 0x806fe044: chunk VA 0x80300000..0x80605fff (PA 0x80300000, prot 7, cache 1)
arm32_kernel_vm_init: pv 0x806fe030: chunk VA 0x80606000..0x80a29fff (PA 0x80606000, prot 3, cache 1)
arm32_kernel_vm_init: pv 0x806fe058: chunk VA 0x80a2a000..0x80a51fff (PA 0x80a2a000, prot 3, cache 1)

Mapping Chunks
arm32_kernel_vm_init: mapping chunk VA 0x80000000..0x802fffff (PA 0x80000000, prot 3, cache 1)
pmap_map_chunk: pa=0x80000000 va=0x80000000 size=0x300000 resid=0x300000 prot=0x3 cache=1
SSS
arm32_kernel_vm_init: mapping chunk VA 0x80300000..0x80605fff (PA 0x80300000, prot 7, cache 1)
pmap_map_chunk: pa=0x80300000 va=0x80300000 size=0x306000 resid=0x306000 prot=0x7 cache=1
SSSPPP
arm32_kernel_vm_init: mapping last chunk VA 0x80606000..0x9fffffff (PA 0x80606000, prot 3, cache 1)
pmap_map_chunk: pa=0x80606000 va=0x80606000 size=0x1f9fa000 resid=0x1f9fa000 prot=0x3 cache=1
PPPPPLLLLLLLLLLLLLLLSSSSSSSSSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS
devmap: 44c00000 -> 44ffffff @ e2100000
pmap_map_chunk: pa=0x44c00000 va=0xe2100000 size=0x400000 resid=0x400000 prot=0x3 cache=0
SSSS
devmap: 48000000 -> 48ffffff @ e0000000
pmap_map_chunk: pa=0x48000000 va=0xe0000000 size=0x1000000 resid=0x1000000 prot=0x3 cache=0
sS
devmap: 4a000000 -> 4affffff @ e1000000
pmap_map_chunk: pa=0x4a000000 va=0xe1000000 size=0x1000000 resid=0x1000000 prot=0x3 cache=0
sS
devmap: 4c000000 -> 4c0fffff @ e2000000
pmap_map_chunk: pa=0x4c000000 va=0xe2000000 size=0x100000 resid=0x100000 prot=0x3 cache=0
S
                             Physical              Virtual        Num
                       Starting    Ending    Starting    Ending   Pages
               SDRAM: 0x80000000 0x9fffffff 0x80000000 0x9fffffff 65536
        text section: 0x80300000 0x80605fff 0x80300000 0x80605fff 387
        data section: 0x80670000 0x806fd918 0x80670000 0x806fd918 71
         bss section: 0x806fd918 0x80a28ac8 0x806fd918 0x80a28ac8 407
   L1 page directory: 0x80a2c000 0x80a2ffff 0x80a2c000 0x80a2ffff 2
   ABT stack (CPU 0): 0x80a42000 0x80a43fff 0x80a42000 0x80a43fff 1
   FIQ stack (CPU 0): 0x80a44000 0x80a45fff 0x80a44000 0x80a45fff 1
   IRQ stack (CPU 0): 0x80a46000 0x80a47fff 0x80a46000 0x80a47fff 1
   UND stack (CPU 0): 0x80a48000 0x80a49fff 0x80a48000 0x80a49fff 1
  IDLE stack (CPU 0): 0x80a4a000 0x80a4bfff 0x80a4a000 0x80a4bfff 1
           SVC stack: 0x80a4c000 0x80a4dfff 0x80a4c000 0x80a4dfff 1
      Message Buffer: 0x80a4e000 0x80a51fff 0x80a4e000 0x80a51fff 2
         Free Memory: 0x80a52000 0x9fffffff                       64215
         Free Memory: 0x80000000 0x802fffff                       384
TTBR0=0x87ffc01b TTBR1=0x87ffc01b TTBCR=0x1 CONTEXTIDR=0
switching to new L1 page table @0x80a2c000... ttb (TTBCR=0x11 TTBR0=0x80a2c01b TTBR1=0x80a2c01b) OK
nfreeblocks = 2, free_pages = 64599 (0xfc57)
bootstrap done.
vectors vbar=0x80315c00 0x80315c00
init subsystems: stacks vectors undefined page pmap_physload pmap kpm tlb0 locks l1pt cache(l1pt) specials pools [ Kernel symbol table missing! ]
done.

>How-To-Repeat:
Boot BEAGLEBONE or BEAGLEBONE_INSTALL kernel (others with am335x CPU?)
from netbsd-8 branch after 20170705135849Z or build a -current BEAGLEBONE
or BEAGLEBONE_INSTALL kernel with  "no options DIAGNOSTIC" in
"BEAGLEBONE.local"
>Fix:
Quick hack workaround from skrll@:

Index: sys/arch/arm/omap/am335x_prcm.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/omap/am335x_prcm.c,v
retrieving revision 1.9
diff -u -p -r1.9 am335x_prcm.c
--- sys/arch/arm/omap/am335x_prcm.c     18 Oct 2016 15:10:35 -0000      1.9
+++ sys/arch/arm/omap/am335x_prcm.c     23 Aug 2017 14:30:18 -0000
@@ -61,7 +61,7 @@ static void
 am335x_prcm_check_clkctrl(bus_size_t cm_module,
     bus_size_t clkctrl_reg, uint32_t v)
 {
-#ifdef DIAGNOSTIC
+#if 1
        uint32_t u = prcm_read_4(cm_module, clkctrl_reg);
 
        if (__SHIFTOUT(u, AM335X_CLKCTRL_MODULEMODE_MASK) !=


is enough to make it work.  A more tidy patch is attached to:

  http://mail-index.netbsd.org/port-arm/2017/08/23/msg004378.html

As stated there, someone(tm) with a datasheet or more clue should
look at this to see if there is a more proper solution.



Home | Main Index | Thread Index | Old Index