Port-arm archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Zynq FDTisation [was Re: Cortex-A9 boot problems with d-cache on Zynq]
On 08/06/2019 13:17, Alexander Nasonov wrote:
> Nick Hudson wrote:
>> On 02/06/2019 00:07, Robert Swindells wrote:
>>> ...
>>> Someone still needs to write a clock driver for it.
>>>
>>
>> I'll commit something to sys/arch/arm/xilinx so the FDTisation can
>> happen without breaking existing kernels
>
> FYI, Robert sent me his patch:
>
>> https://ftp.netbsd.org/pub/NetBSD/misc/rjs/zynq20181121.tar.gz
>
> and after a small makefile change, I was able to boot it but it
> failed early on KASSERT as you can see in the attached console log.
To get the ball rolling I've added early Zynq-7000 support to GENERIC
http://mail-index.netbsd.org/source-changes/2019/06/11/msg106540.html
A clock driver is the next step.
Nick
$ qemu-system-arm -m 512 -M xilinx-zynq-a9 -dtb zynq-zed.dtb -kernel netbsd.ub -serial /dev/null -serial stdio
pc : 0x02000080
off : 0x7e000000
sp : 0x02a6d000
fdt : 0x08000000
midr : 0x413fc090
revidr: 0x413fc090
mpidr : 0x80000000
ttb0 : 0x00000000
ttb1 : 0x00000000
ttcr : 0x00000000
v7 : AB sctlr:0x00c50078/0x00c50078 C
uboot : @0x02701124
fdt : 0x08000000
0x02a70000 va:0x02000000 pa:0x02000000 nsec:0x0000000b attr:0x00000402
0x02a70000[0x00000020]=0x02000402
0x02a70000[0x00000021]=0x02100402
0x02a70000[0x00000022]=0x02200402
0x02a70000[0x00000023]=0x02300402
0x02a70000[0x00000024]=0x02400402
0x02a70000[0x00000025]=0x02500402
0x02a70000[0x00000026]=0x02600402
0x02a70000[0x00000027]=0x02700402
0x02a70000[0x00000028]=0x02800402
0x02a70000[0x00000029]=0x02900402
0x02a70000[0x0000002a]=0x02a00402
0x02a70000 va:0x80000000 pa:0x02000000 nsec:0x0000000c attr:0x00000402
0x02a70000[0x00000800]=0x02000402
0x02a70000[0x00000801]=0x02100402
0x02a70000[0x00000802]=0x02200402
0x02a70000[0x00000803]=0x02300402
0x02a70000[0x00000804]=0x02400402
0x02a70000[0x00000805]=0x02500402
0x02a70000[0x00000806]=0x02600402
0x02a70000[0x00000807]=0x02700402
0x02a70000[0x00000808]=0x02800402
0x02a70000[0x00000809]=0x02900402
0x02a70000[0x0000080a]=0x02a00402
0x02a70000[0x0000080b]=0x02b00402
DTB
0x02a70000 va:0x08000000 pa:0x08000000 nsec:0x00000001 attr:0x00000402
0x02a70000[0x00000080]=0x08000402
CONSADDR
0x02a70000 va:0xe0000000 pa:0xe0000000 nsec:0x00000001 attr:0x00000412
0x02a70000[0x00000e00]=0xe0000412
MFG01H1JKIL
MMU
go
[ 1.0000000] FDT<0x8000000>
[ 1.0000000] cpufunc
[ 1.0000000] devmap
[ 1.0000000] devmap: e0000000 -> e01fffff @ f0000000
[ 1.0000000] SS
[ 1.0000000] devmap: f8900000 -> f89fffff @ f0200000
[ 1.0000000] S
[ 1.0000000] devmap: f8f00000 -> f8ffffff @ f0300000
[ 1.0000000] S
[ 1.0000000] bootstrap
[ 1.0000000] stdout
[ 1.0000000] consinit ok
[ 1.0000000] uboot: args 0, 0xd32, 0x8000000, 0
[ 1.0000000] NetBSD/evbarm (fdt) booting ...
[ 1.0000000] FDT /memory [0] @ 0x0 size 0x20000000
[ 1.0000000] initarm: memory start 0 end 20000000 (len 20000000)
[ 1.0000000] initarm: fdt_build_bootconfig
[ 1.0000000] Usable memory:
[ 1.0000000] 0 - 1fffffff
[ 1.0000000] cpu_kernel_vm_init: kernel phys start 0 end 20000000
[ 1.0000000] arm32_bootmem_init: kern_vtopdiff=0x7e000000
[ 1.0000000] arm32_bootmem_init: kstartva=0x80000000, kernelstart=0x2000000
[ 1.0000000] arm32_bootmem_init: memstart=0, memsize=0x20000000
[ 1.0000000] arm32_bootmem_init: kernelstart=0x2000000, kernelend=0x2a74000
[ 1.0000000] arm32_bootmem_init: kernel phys start 0x2000000 end 0x2a74000
[ 1.0000000] arm32_bootmem_init: adding 60102 free pages: [0x2a74000..0x1fffffff] (VA 0x80a74000)
[ 1.0000000] arm32_bootmem_init: adding 4096 free pages: [0..0x1ffffff] (VA 0x7e000000)
[ 1.0000000] arm32_kernel_vm_init: 2 L2 pages are needed to map 0xab4000 kernel bytes
[ 1.0000000] arm32_kernel_vm_init: allocating page tables for kernel l1ptadd_pages: adding pv 0x808e2ff8 (pa 0x2a74000, va 0x80a74000, 2 pages) at tail
[ 1.0000000] add_pages: appending pv 0x808e3214 (0x2a78000..0x2a79fff) to 0x2a74000..0x2a77fff
[ 1.0000000] add_pages: appending pv 0x808e3228 (0x2a7a000..0x2a7bfff) to 0x2a74000..0x2a79fff
[ 1.0000000] vmadd_pages: appending pv 0x808e323c (0x2a7c000..0x2a7dfff) to 0x2a74000..0x2a7bfff
[ 1.0000000] add_pages: appending pv 0x808e3250 (0x2a7e000..0x2a7ffff) to 0x2a74000..0x2a7dfff
[ 1.0000000] add_pages: appending pv 0x808e3264 (0x2a80000..0x2a81fff) to 0x2a74000..0x2a7ffff
[ 1.0000000] add_pages: appending pv 0x808e3278 (0x2a82000..0x2a83fff) to 0x2a74000..0x2a81fff
[ 1.0000000] add_pages: appending pv 0x808e328c (0x2a84000..0x2a85fff) to 0x2a74000..0x2a83fff
[ 1.0000000] add_pages: appending pv 0x808e32a0 (0x2a86000..0x2a87fff) to 0x2a74000..0x2a85fff
[ 1.0000000] add_pages: appending pv 0x808e32b4 (0x2a88000..0x2a89fff) to 0x2a74000..0x2a87fff
[ 1.0000000] add_pages: appending pv 0x808e32c8 (0x2a8a000..0x2a8bfff) to 0x2a74000..0x2a89fff
[ 1.0000000] arm32_kernel_vm_init: allocating stacks
[ 1.0000000] add_pages: appending pv 0x809ee088 (0x2a8c000..0x2a8ffff) to 0x2a74000..0x2a8bfff
[ 1.0000000] add_pages: appending pv 0x809ee074 (0x2a90000..0x2a93fff) to 0x2a74000..0x2a8ffff
[ 1.0000000] add_pages: appending pv 0x809ee060 (0x2a94000..0x2a97fff) to 0x2a74000..0x2a93fff
[ 1.0000000] add_pages: appending pv 0x809ee04c (0x2a98000..0x2a9bfff) to 0x2a74000..0x2a97fff
[ 1.0000000] add_pages: appending pv 0x809ee034 (0x2a9c000..0x2a9ffff) to 0x2a74000..0x2a9bfff
[ 1.0000000] add_pages: appending pv 0x809ee09c (0x2aa0000..0x2aa1fff) to 0x2a74000..0x2a9ffff
[ 1.0000000] add_pages: appending pv 0x808e3038 (0x2aa2000..0x2aa5fff) to 0x2a74000..0x2aa1fff
[ 1.0000000] Creating L1 page table at 0x80a74000/0x02a74000
[ 1.0000000] arm32_kernel_vm_init: kernel_base 80000000 KERNEL_L2PT_KERNEL_NUM 2
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a78000, PA 0x2a78000) for VA 0x80000000 (kernel)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a7a000, PA 0x2a7a000) for VA 0x80800000 (kernel)
[ 1.0000000] arm32_kernel_vm_init: kernel_vm_base 90000000 KERNEL_L2PT_VMDATA_NUM 8
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a7c000, PA 0x2a7c000) for VA 0x90000000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a7e000, PA 0x2a7e000) for VA 0x90800000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a80000, PA 0x2a80000) for VA 0x91000000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a82000, PA 0x2a82000) for VA 0x91800000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a84000, PA 0x2a84000) for VA 0x92000000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a86000, PA 0x2a86000) for VA 0x92800000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a88000, PA 0x2a88000) for VA 0x93000000 (vm)
[ 1.0000000] arm32_kernel_vm_init: adding L2 pt (VA 0x80a8a000, PA 0x2a8a000) for VA 0x93800000 (vm)
[ 1.0000000] Mapping kernel
[ 1.0000000] arm32_kernel_vm_init: adding chunk for kernel text 0x2000000..0x2641fff (VA 0x80000000)
[ 1.0000000] add_pages: adding pv 0x808e2fe4 (pa 0x2000000, va 0x80000000, 801 pages) before pa 0x2a74000
[ 1.0000000] arm32_kernel_vm_init: adding chunk for kernel data/bss 0x2642000..0x2a73fff (VA 0x80642000)
[ 1.0000000] add_pages: adding pv 0x808e2fd0 (pa 0x2642000, va 0x80642000, 537 pages) before pa 0x2a74000
[ 1.0000000] Listing Chunks
[ 1.0000000] arm32_kernel_vm_init: pv 0x808e2fe4: chunk VA 0x80000000..0x80641fff (PA 0x2000000, prot 5, cache 1)
[ 1.0000000] arm32_kernel_vm_init: pv 0x808e2fd0: chunk VA 0x80642000..0x80a73fff (PA 0x2642000, prot 3, cache 1)
[ 1.0000000] arm32_kernel_vm_init: pv 0x808e2ff8: chunk VA 0x80a74000..0x80aa5fff (PA 0x2a74000, prot 3, cache 1)
[ 1.0000000] Mapping Chunks
[ 1.0000000] arm32_kernel_vm_init: mapping chunk VA 0x80000000..0x80641fff (PA 0x2000000, prot 5, cache 1)
[ 1.0000000] SSSSSSLLLLP
[ 1.0000000] arm32_kernel_vm_init: mapping chunk VA 0x80642000..0x80a73fff (PA 0x2642000, prot 3, cache 1)
[ 1.0000000] PPPPPPPLLLLLLLLLLLSSSLLLLLLLPP
[ 1.0000000] arm32_kernel_vm_init: mapping last chunk VA 0x80a74000..0x80aa5fff (PA 0x2a74000, prot 3, cache 1)
[ 1.0000000] PPPPPPLLPPP
[ 1.0000000] devmap: e0000000 -> e01fffff @ f0000000
[ 1.0000000] SS
[ 1.0000000] devmap: f8900000 -> f89fffff @ f0200000
[ 1.0000000] S
[ 1.0000000] devmap: f8f00000 -> f8ffffff @ f0300000
[ 1.0000000] S
[ 1.0000000] Physical Virtual Num
[ 1.0000000] Starting Ending Starting Ending Pages
[ 1.0000000] text section: 0x02000000 0x02641fff 0x80000000 0x80641fff 801
[ 1.0000000] data section: 0x02700000 0x028e2958 0x80700000 0x808e2958 242
[ 1.0000000] bss section: 0x028e2958 0x02a6bc60 0x808e2958 0x80a6bc60 197
[ 1.0000000] L1 page directory: 0x02a74000 0x02a77fff 0x80a74000 0x80a77fff 2
[ 1.0000000] ABT stack (CPU 0): 0x02a8c000 0x02a8dfff 0x80a8c000 0x80a8dfff 1
[ 1.0000000] FIQ stack (CPU 0): 0x02a90000 0x02a91fff 0x80a90000 0x80a91fff 1
[ 1.0000000] IRQ stack (CPU 0): 0x02a94000 0x02a95fff 0x80a94000 0x80a95fff 1
[ 1.0000000] UND stack (CPU 0): 0x02a98000 0x02a99fff 0x80a98000 0x80a99fff 1
[ 1.0000000] IDLE stack (CPU 0): 0x02a9c000 0x02a9dfff 0x80a9c000 0x80a9dfff 1
[ 1.0000000] SVC stack: 0x02aa0000 0x02aa1fff 0x80aa0000 0x80aa1fff 1
[ 1.0000000] Message Buffer: 0x02aa2000 0x02aa5fff 0x80aa2000 0x80aa5fff 2
[ 1.0000000] Free Memory: 0x02aa6000 0x1fffffff 60077
[ 1.0000000] Free Memory: 0x00000000 0x01ffffff 4096
[ 1.0000000] TTBR0=0x2a7005b TTBR1=0x2a7005b TTBCR=0x1 CONTEXTIDR=0
[ 1.0000000] switching to new L1 page table @0x2a74000...
[ 1.0000000] ttb
[ 1.0000000] sctlr=0xc5187d actlr=0
[ 1.0000000] OK
[ 1.0000000] bootargs:
[ 1.0000000] Memory regions:
[ 1.0000000] 0 - 1ffffff
[ 1.0000000] 2aa6000 - 1fffffff
[ 1.0000000] nfreeblocks = 2, free_pages = 64173 (0xfaad)
[ 1.0000000] bootstrap done.
[ 1.0000000] vectors vbar=0x8007a660 0x8007a660
[ 1.0000000] init subsystems: stacks vectors undefined page pmap_physload
[ 1.0000000] block 0 start 02aa6000 end 20000000
[ 1.0000000] bp 0 start 00000000 end 02000000
[ 1.0000000] bp 1 start 02aa6000 end 20000000
[ 1.0000000] start 02aa6000 end 20000000... loading in freelist 0
[ 1.0000000] block 1 start 00000000 end 02000000
[ 1.0000000] bp 0 start 00000000 end 02000000
[ 1.0000000] start 00000000 end 02000000... loading in freelist 0
[ 1.0000000] bp 1 start 02aa6000 end 20000000
[ 1.0000000] pmap kpm tlb0 kcpusets locks l1pt cache(l1pt) specials pools [ Kernel symbol table missing! ]
[ 1.0000000] done.
[ 1.0000000] mpstart
[ 1.0000000] start d8000000 end e8000000Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[ 1.0000000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[ 1.0000000] 2018, 2019 The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.
[ 1.0000000] NetBSD 8.99.42 (GENERIC) #23: Tue Jun 11 14:26:06 BST 2019
[ 1.0000000] nick@zoom:/home/nick/netbsd/zynq/obj.evbearmv7hf-el/sys/arch/evbarm/compile/GENERIC
[ 1.0000000] total memory = 512 MB
[ 1.0000000] avail memory = 496 MB
[ 1.0000000] armfdt0 (root)
[ 1.0000000] simplebus0 at armfdt0: Avnet ZedBoard board
[ 1.0000000] simplebus1 at simplebus0
[ 1.0000000] cpus0 at simplebus0
[ 1.0000000] simplebus2 at simplebus0
[ 1.0000000] cpu0 at cpus0: Cortex-A9 r3p0 (Cortex V7A core)
[ 1.0000000] cpu0: DC enabled IC enabled WB enabled LABT branch prediction enabled
[ 1.0000000] cpu0: 16KB/32B 4-way L1 VIPT Instruction cache
[ 1.0000000] cpu0: 16KB/32B 4-way write-back-locking-C L1 PIPT Data cache
[ 1.0000000] cpu0: 64KB/32B 8-way write-through L2 PIPT Unified cache
[ 1.0000000] vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
[ 1.0000000] cpufreqdt0 at cpu0
[ 1.0000000] cpu1 at cpus0: disabled (unresponsive)
[ 1.0000000] syscon0 at simplebus1: System Controller Registers
[ 1.0000000] gic0 at simplebus1: GIC
[ 1.0000000] armgic0 at gic0: Generic Interrupt Controller, 96 sources (96 valid)
[ 1.0000000] armgic0: 256 Priorities, 64 SPIs, 16 PPIs, 16 SGIs
[ 1.0000000] l2cc0 at simplebus1
[ 1.0000000] arml2cc0 at l2cc0: ARM PL310 r0p0 L2 Cache Controller (disabled)
[ 1.0000000] arml2cc0: cache disabled
[ 1.0000000] a9tmr0 at simplebus1: couldn't get clock
[ 1.0000000] fregulator0 at simplebus0: VCCPINT
[ 1.0000000] /amba/slcr@f8000000/clkc@100 at syscon0 not configured
[ 1.0000000] /amba/devcfg@f8007000 at simplebus1 not configured
[ 1.0000000] cemac0 at simplebus1cemac0: interrupting on GIC irq 54
[ 1.0000000] : Cadence Gigabit Ethernet Controller
[ 1.0000000] makphy0 at cemac0 phy 0: Marvell 88E1111 Gigabit PHY, rev. 2
[ 1.0000000] makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
[ 1.0000000] makphy1 at cemac0 phy 23: Marvell 88E1111 Gigabit PHY, rev. 2
[ 1.0000000] makphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
[ 1.0000000] ifmedia_match: multiple match for 0x20/0xffffeff, selected instance 0
[ 1.0000000] /phy0 at simplebus0 not configured
[ 1.0000000] /fpga-full at simplebus0 not configured
[ 1.0000000] /amba/adc@f8007100 at simplebus1 not configured
[ 1.0000000] /amba/gpio@e000a000 at simplebus1 not configured
[ 1.0000000] /amba/memory-controller@f8006000 at simplebus1 not configured
[ 1.0000000] zynquart0 at simplebus1zynquart0: interrupting on GIC irq 82
[ 1.0000000] zynquart0: console
[ 1.0000000] sdhc0 at simplebus1: SD/MMC host controller
[ 1.0000000] sdhc0: interrupting on GIC irq 56
[ 1.0000000] sdhc0: SDHC 2.0, rev 36, PIO, 33333 kHz, embedded slot, HS 3.3V, 512 byte blocks
[ 1.0000000] sdmmc0 at sdhc0 slot 0
[ 1.0000000] /amba/slcr@f8000000/rstc@200 at syscon0 not configured
[ 1.0000000] /amba/slcr@f8000000/pinctrl@700 at syscon0 not configured
[ 1.0000000] /amba/dmac@f8003000 at simplebus1 not configured
[ 1.0000000] /amba/timer@f8001000 at simplebus1 not configured
[ 1.0000000] /amba/timer@f8002000 at simplebus1 not configured
[ 1.0000000] /amba/timer@f8f00600 at simplebus1 not configured
[ 1.0000000] ehci0 at simplebus1ehci0: interrupting on GIC irq 53
[ 1.0000000] ehci0: Zynq USB Controller id=0 revision=0 version=0
[ 1.0000000] ehci0: HCI revision=0x100
[ 1.0000000] ehci0:
[ 1.0000000] panic: kernel diagnostic assertion "freq != 0" failed: file "/home/nick/netbsd/zynq/src/sys/arch/arm/cortex/a9tmr.c", line 299
[ 1.0000000] cpu0: Begin traceback...
[ 1.0000000] 0x80aa1a7c: netbsd:db_panic+0x14
[ 1.0000000] 0x80aa1a94: netbsd:vpanic+0x194
[ 1.0000000] 0x80aa1aac: netbsd:__aeabi_uldivmod
[ 1.0000000] 0x80aa1aec: netbsd:a9tmr_delay+0x160
[ 1.0000000] 0x80aa1b2c: netbsd:zynqusb_attach_common+0x2c0
[ 1.0000000] 0x80aa1bf4: netbsd:zynqusb_attach+0x100
[ 1.0000000] 0x80aa1c2c: netbsd:config_attach_loc+0x1b4
[ 1.0000000] 0x80aa1c5c: netbsd:config_found_sm_loc+0x54
[ 1.0000000] 0x80aa1dc4: netbsd:fdt_scan+0x130
[ 1.0000000] 0x80aa1de4: netbsd:fdt_rescan+0x5c
[ 1.0000000] 0x80aa1e1c: netbsd:config_attach_loc+0x1b4
[ 1.0000000] 0x80aa1e4c: netbsd:config_found_sm_loc+0x54
[ 1.0000000] 0x80aa1e64: netbsd:config_found+0x2c
[ 1.0000000] 0x80aa1e9c: netbsd:arm_fdt_attach+0x68
[ 1.0000000] 0x80aa1ed4: netbsd:config_attach_loc+0x1b4
[ 1.0000000] 0x80aa1efc: netbsd:config_rootfound+0x48
[ 1.0000000] 0x80aa1f1c: netbsd:cpu_configure+0x58
[ 1.0000000] 0x80aa1f9c: netbsd:main+0x2e0
[ 1.0000000] 0x80aa1fac: netbsd:kernel_text+0x50
[ 1.0000000] cpu0: End traceback...
Stopped in pid 0.1 (system) at netbsd:cpu_Debugger+0x4: bx r14
db{0}>
Home |
Main Index |
Thread Index |
Old Index