0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ComcertoでFreeBSD その弐

Last updated at Posted at 2019-10-07

arm.armarm.armv7をビルドしてみて、arm.armv6なターゲットも試してみたくなり、久しぶりにビルドしてみました。

おうちのarm箱にはHardOffで入手したcns11xxやxilinxもありますが、消されてしまったのでCURRENTは試せません。armv6(arm11)はまだあるので試せます。

clangでのクロスビルドは8時間くらいかかるので、ビルドで一日つぶれます。microserverの消費電力はだいたい0.1kWhくらいなので8時間で0.8kWhで1kWhが20円とすると16円になります。

前回ビルドしたのは

FreeBSD 12.0-CURRENT #0 7db3774(zrouter)-dirty: Sun Dec  4 20:12:57 JST 2016
    hiroki@microserver:/storage/home/hiroki/obj/storage/home/hiroki/zrouter/tmp/arm.armv6/storage/home/hiroki/freebsd/sys/Softbank_E-WMTA22 arm
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)

でした。

arm.armやarm.armv7を通した最近のCURRENTでビルドは通りましたが、起動しません。:(

いつものようにデバッグライトをもりもり入れて確認します。

まずinitarm()のfdt_get_mem_regions()でdtsからmemoryが拾えていません。

これはdtsに以下が無いためでした。

 / {
        compatible = "E-WMTA22", "mindspeed,m831xx-soc";
        model = "E-WMTA22";
+       #address-cells = <1>;
+       #size-cells = <1>;

前回ビルドした時とdtsのパスが変わっていて、includeしているものが古いパスで、ビルドしているdtsが新しいパスにありました。

なんとdtsでincludeしているファイルがなくてもビルドが通っています。調べて直さないとダメですね。

これを直したら、fdt_get_mem_regions()より前のOF_init()がエラーになります。これは

                intc: intc@A0000 {
-                       compatible = "comcerto,intc";
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
                        reg = <0xa0000 0x10000>;
+                       compatible = "comcerto,intc";
                };

が原因でした。

とりあえずブートしましたがハングします。

---<<BOOT>>---
ARM Debug Architecture not supported
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2019 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-CURRENT #57 c8e8262a047-c263685(zrouter)-dirty: Mon Oct  7 10:46:35 JST 2019
    hiroki@zrouter:/usr/home/hiroki/zobj/usr/home/hiroki/ZRouter/tmp/usr/home/hiroki/freebsd/arm.armv6/sys/Softbank_E-WMTA22 arm
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
unknown CPU (ID = 0x4117b365)
CPU Features: 
Optional instructions: 
  64KB/32B 4-way instruction cache
  64KB/32B 4-way WB data cache
real memory  = 134217728 (128 MB)
avail memory = 126062592 (120 MB)
arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.
random: entropy device external interface
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
simplebus1: <Flattened device tree simple bus> on ofwbus0
pic0: <Comcerto Interrupt Controller> mem 0xa0000-0xaffff on simplebus1
timer0: <Comcerto Timer> mem 0x50000-0x5ffff irq 2,3,4,5,6,7 on simplebus1
Event timer "Comcerto Timer0" frequency 125000000 Hz quality 1000
Timecounter "Comcerto Timer1" frequency 125000000 Hz quality 1000
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpu1: <Open Firmware CPU> on cpulist0
uart0: <16550 or compatible> mem 0x90000-0x93fff irq 8 on simplebus1
uart0: console (115200,n,8,1)
cfi0: <AMD/Fujitsu - 32MB> mem 0x20000000-0x21ffffff on ofwbus0
cfi0: Manufacturer ID:c2 Device ID:227e
cfid0 on cfi0
Timecounters tick every 10.000 msec
Trying to mount root from cd9660:/dev/cfid0s.rootfs.uzip []...
Warning: no time-of-day clock registered, system time will not be set accurately
Enter full pathname of shell or RETURN for /bin/sh: 
pid 16 (sh), jid 0, uid 0: exited on signal 4
random: unblocking device.

cninit()より前のデバッグは結構骨がおれます。

今から考えればFreescaleのMindspeedの買収は、そもそもFreescaleはarmなショリューション(i.MX31)を持っていて、買収して潰して競合を減らすための施策だったように思われます。半導体ビジネスは厳しいですね。

最初あんまり興味がなかったのですが、やることもなくなってきたので、ちょっと手をつけてみようかとも思っています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?