大樹底下好乘涼 ︰ 《歷史觀》

220px-TheHandmaidsTale(1stEd)
有名萬物之母

使女的故事》 The handmaid’s tale 是加拿大女性作家瑪格麗特‧愛特伍 Margaret Atwood 所寫的小說,受歐美文學界推崇不已的作品,已被列入重要經典作品中。

□︰數位的發展導致了一種疑慮,未來未必能『解碼』過去,那麼今天的存在,或許就成了『未知』的世紀??

○︰假使不必為『古人』擔憂!那又何必為『來者』遺憾?

即使將有『計算歷史學家』,或許也會遇到『可計算性問題』,可能不免『量子不確定性原理』,所謂的『當下』只在『前後』之『』的吧!!

每一台 PC 主機板上都有一個『BIOS 』 Basic Input Output System 掌管開機動作。這個『第一啟動』韌體一直隱藏在『保密合約』 NDA  non-disclosure agreement 幕後。曾經 Linux Bios 計畫努力於打開黑箱,直到今天稱之為 coreboot 。在那個應許的年代,已走入歷史的『 SUN Microsystems 』之『 Open Bios 』計畫裡的『 open firmware 』架構,就是『設備樹』的原點︰

IEEE Std 1275-1994
IEEE Standard for Boot (Initialization Configuration) Firmware: Core Requirements and Practices
……
3.2 Device tree
The device tree is a hierarchical data structure that describes the system hardware, describes user configuration choices, contains firmware device drivers for hardware devices, and contains support routines for use by those drivers.

The device tree’s structure mimics the organization of the system hardware, viewed as a hierarchy of interconnected buses and their attached devices. The device tree consists of a set of device nodes that are interconnected to form a tree. An individual device node
represents either a hardware bus, a hardware device, or a set of interrelated software procedures. ……

二零零八年起 Power.org^{TM} Standard for Embedded Power Architecture^{TM} Platform Requirements (ePAPR) 開始推廣 open firmware 架構︰
……
1.2 Relationship to IEEETM 1275

The ePAPR is loosely related to the IEEE 1275 Open Firmware standard—IEEE Standard for Boot (Initialization Configuration) Firmware: Core Requirements and Practices [2].
The original IEEE 1275 specification and its derivatives such as CHRP [10] and PAPR [16] address problems of general purpose computers, such as how a single version of an operating system can work on several different computers within the same family and the problem of loading an operating system from user-installed I/O devices. ……

晏子春秋‧內篇雜下第六

晏子將至楚,楚聞之,謂左右曰:晏嬰,齊之習辭者也,今方來,吾欲辱之,何以也?

左右對曰:為其來也,臣請縛一人,過王而行,王曰:『何為者也?』對曰:『齊人也.』王曰:『何坐?』曰:『坐盜.』

晏子至,楚王賜晏子酒,酒酣,吏二縛一人詣王,王曰:縛者曷為者也?對曰:齊人也,坐盜.

王視晏子曰:齊人固善盜乎?

晏子避席對曰:嬰聞之,橘生淮南則為橘,生于淮北則為枳,葉徒相似,其實味不同.所以然者何?水土異也.今民生長于齊不盜,入楚則盜,得無楚之水土使民善盜耶?

王笑曰:聖人非所與熙也,寡人反取病焉.

200px-Madarines_white_bg

南橘

200px-Poncirus_trifoliata_Prague_2011_1

北枳

果真一方水土,一方人物,這個『設備樹』到了『樹莓派』手上,又有一番風情;別樣『架構』  skeleton.dtsi ︰

# Linux/arch/arm/boot/dts/skeleton.dtsi

/*
 * Skeleton device tree; the bare minimum needed to boot; just include and
 * add a compatible value.  The bootloader will typically populate the memory
 * node.
*/
 
/ {
        #address-cells = <1>;
        #size-cells = <1>;
        chosen { };
        aliases { };
        memory { device_type = "memory"; reg = <0 0>; };
};

就讓我們比較 bcm2709-rpi-2-b.dts + bcm2709.dtsi + skeleton.dtsi 之原始檔和解碼過的 bcm2709-rpi-2-b.dtb 看看異同︰

# 解碼 dtb
dtc -I dtb -O dts -o bcm2709-rpi-2-b.dts.decode /boot/bcm2709-rpi-2-b.dtb

/dts-v1/;

/ {
	#address-cells = <0x1>;
	#size-cells = <0x1>;
	compatible = "brcm,bcm2709";
	model = "Raspberry Pi 2 Model B";
	interrupt-parent = <0x1>;

	chosen {
		bootargs = [00];
	};

	aliases {
		soc = "/soc";
		spi0 = "/soc/spi@7e204000";
		i2c0 = "/soc/i2c@7e205000";
		i2c1 = "/soc/i2c@7e804000";
		i2s = "/soc/i2s@7e203000";
		gpio = "/soc/gpio";
		intc = "/soc/interrupt-controller";
		leds = "/soc/leds";
		sound = "/sound";
	};

	memory {
		device_type = "memory";
		reg = <0x0 0x0>;
	};

	soc {
		compatible = "simple-bus";
		#address-cells = <0x1>;
		#size-cells = <0x1>;
		ranges = <0x7e000000 0x3f000000 0x1000000>;
		linux,phandle = <0x13>;
		phandle = <0x13>;

		interrupt-controller {
			compatible = "brcm,bcm2708-armctrl-ic";
			reg = <0x7e00b200 0x200>;
			interrupt-controller;
			#interrupt-cells = <0x2>;
			linux,phandle = <0x1>;
			phandle = <0x1>;
		};

		gpio {
			compatible = "brcm,bcm2835-gpio";
			reg = <0x7e200000 0xb4>;
			interrupts = <0x2 0x11 0x2 0x12>;
			gpio-controller;
			#gpio-cells = <0x2>;
			interrupt-controller;
			#interrupt-cells = <0x2>;
			linux,phandle = <0x8>;
			phandle = <0x8>;

			spi0_pins {
				brcm,pins = <0x7 0x8 0x9 0xa 0xb>;
				brcm,function = <0x4>;
				linux,phandle = <0x4>;
				phandle = <0x4>;
			};

			i2c0 {
				brcm,pins = <0x0 0x1>;
				brcm,function = <0x4>;
				linux,phandle = <0x6>;
				phandle = <0x6>;
			};

			i2c1 {
				brcm,pins = <0x2 0x3>;
				brcm,function = <0x4>;
				linux,phandle = <0x7>;
				phandle = <0x7>;
			};

			i2s {
				brcm,pins = <0x12 0x13 0x14 0x15>;
				brcm,function = <0x4>;
				linux,phandle = <0x2>;
				phandle = <0x2>;
			};
		};

		i2s@7e203000 {
			compatible = "brcm,bcm2708-i2s";
			reg = <0x7e203000 0x20 0x7e101098 0x2>;
			dma-names = "tx", "rx";
			status = "disabled";
			#sound-dai-cells = <0x0>;
			pinctrl-names = "default";
			pinctrl-0 = <0x2>;
			linux,phandle = <0xd>;
			phandle = <0xd>;
		};

		spi@7e204000 {
			compatible = "brcm,bcm2708-spi";
			reg = <0x7e204000 0x1000>;
			interrupts = <0x2 0x16>;
			clocks = <0x3>;
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			status = "disabled";
			pinctrl-names = "default";
			pinctrl-0 = <0x4>;
			linux,phandle = <0xe>;
			phandle = <0xe>;

			spidev@0 {
				compatible = "spidev";
				reg = <0x0>;
				#address-cells = <0x1>;
				#size-cells = <0x0>;
				spi-max-frequency = <0x7a120>;
			};

			spidev@1 {
				compatible = "spidev";
				reg = <0x1>;
				#address-cells = <0x1>;
				#size-cells = <0x0>;
				spi-max-frequency = <0x7a120>;
			};
		};

		i2c@7e205000 {
			compatible = "brcm,bcm2708-i2c";
			reg = <0x7e205000 0x1000>;
			interrupts = <0x2 0x15>;
			clocks = <0x5>;
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			status = "disabled";
			pinctrl-names = "default";
			pinctrl-0 = <0x6>;
			clock-frequency = <0x186a0>;
			linux,phandle = <0xf>;
			phandle = <0xf>;
		};

		i2c@7e804000 {
			compatible = "brcm,bcm2708-i2c";
			reg = <0x7e804000 0x1000>;
			interrupts = <0x2 0x15>;
			clocks = <0x5>;
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			status = "disabled";
			pinctrl-names = "default";
			pinctrl-0 = <0x7>;
			clock-frequency = <0x186a0>;
			linux,phandle = <0x10>;
			phandle = <0x10>;
		};

		leds {
			compatible = "gpio-leds";
			linux,phandle = <0x14>;
			phandle = <0x14>;

			act {
				label = "led0";
				linux,default-trigger = "mmc0";
				gpios = <0x8 0x2f 0x0>;
				linux,phandle = <0x11>;
				phandle = <0x11>;
			};

			pwr {
				label = "led1";
				linux,default-trigger = "input";
				gpios = <0x8 0x23 0x0>;
				linux,phandle = <0x12>;
				phandle = <0x12>;
			};
		};
	};

	clocks {
		compatible = "simple-bus";
		#address-cells = <0x1>;
		#size-cells = <0x0>;

		i2c {
			compatible = "fixed-clock";
			reg = <0x1>;
			#clock-cells = <0x0>;
			clock-frequency = <0xee6b280>;
			linux,phandle = <0x5>;
			phandle = <0x5>;
		};

		clock@2 {
			compatible = "fixed-clock";
			reg = <0x2>;
			#clock-cells = <0x0>;
			clock-output-names = "spi";
			clock-frequency = <0xee6b280>;
			linux,phandle = <0x3>;
			phandle = <0x3>;
		};
	};

	timer {
		compatible = "arm,armv7-timer";
		clock-frequency = <0x124f800>;
		interrupts = <0x3 0x0 0x3 0x1 0x3 0x3 0x3 0x2>;
		always-on;
	};

	cpus {
		#address-cells = <0x1>;
		#size-cells = <0x0>;
		linux,phandle = <0x15>;
		phandle = <0x15>;

		cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf00>;
			clock-frequency = <0x2faf0800>;
			linux,phandle = <0x9>;
			phandle = <0x9>;
		};

		cpu@1 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf01>;
			clock-frequency = <0x2faf0800>;
			linux,phandle = <0xa>;
			phandle = <0xa>;
		};

		cpu@2 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf02>;
			clock-frequency = <0x2faf0800>;
			linux,phandle = <0xb>;
			phandle = <0xb>;
		};

		cpu@3 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf03>;
			clock-frequency = <0x2faf0800>;
			linux,phandle = <0xc>;
			phandle = <0xc>;
		};
	};

	__overrides__ {
		arm_freq = "", "", "", "\tclock-frequency:0", "", "", "", "\nclo
ck-frequency:0", "", "", "", "\vclock-frequency:0", "", "", "", "\fclock-frequen
cy:0";
		i2s = "", "", "", "\rstatus";
		spi = [00 00 00 0e 73 74 61 74 75 73 00];
		i2c0 = [00 00 00 0f 73 74 61 74 75 73 00];
		i2c1 = [00 00 00 10 73 74 61 74 75 73 00];
		i2c0_baudrate = [00 00 00 0f 63 6c 6f 63 6b 2d 66 72 65 71 75 65
	};

	__symbols__ {
		soc = "/soc";
		intc = "/soc/interrupt-controller";
		gpio = "/soc/gpio";
		spi0_pins = "/soc/gpio/spi0_pins";
		i2c0_pins = "/soc/gpio/i2c0";
		i2c1_pins = "/soc/gpio/i2c1";
		i2s_pins = "/soc/gpio/i2s";
		i2s = "/soc/i2s@7e203000";
		spi0 = "/soc/spi@7e204000";
		i2c0 = "/soc/i2c@7e205000";
		i2c1 = "/soc/i2c@7e804000";
		leds = "/soc/leds";
		act_led = "/soc/leds/act";
		pwr_led = "/soc/leds/pwr";
		clk_i2c = "/clocks/i2c";
		clk_spi = "/clocks/clock@2";
		cpus = "/cpus";
		v7_cpu0 = "/cpus/cpu@0";
		v7_cpu1 = "/cpus/cpu@1";
		v7_cpu2 = "/cpus/cpu@2";
		v7_cpu3 = "/cpus/cpu@3";
		sound = "/sound";
	};
};

 

 

 

大樹底下好乘涼 ︰ 《大哉問》

Albrecht_Dürer_-_Adam_and_Eve_(Prado)_2
夏娃的蘋果

Golden_Apple_of_Discord_by_Jacob_Jordaens
金蘋果事件

640px-Newton's_tree,_Botanic_Gardens,_Cambridge
牛頓的蘋果

青蘋果
圖靈的蘋果

根據《聖經‧創世記》記載︰

亞當和夏娃二人住在伊甸園中,後來夏娃受『』的哄誘,偷食了『知善惡樹』所結的『禁果』,也讓亞當食用,二人遂被上帝逐出伊甸園。

□︰禁果是蘋果嗎?
○︰莫宰羊!
□︰那蘋果是禁果嗎?
○︰煩惱即菩提!!

也許希臘神話中關鍵之因緣生法的一顆『金蘋果』── 獻給最美女神 ──,引發 → 帕里斯的評判,導致 → 特洛伊戰爭。明示了『蘋果』與『誘惑』的關係,至於說怎麼聯繫上了『知識』,那只能問『牛頓』的了?

雖說『牛頓』並沒有創造『機械的宇宙』,如果仔細考察『運動定律』,假使再加上『物質組構』的『構造方程式』與『初始條件』── 位置和動量 ──,那麼該物之『運動軌跡』就被『確定』了。這演示了一種『軟體設計』之方法學,它以『資料驅動』為中心。或許艾倫‧圖靈非常了解那個『抽象機械』,所以創想發明了『萬有圖靈機』。只不過人類的知識還很難駕馭那樣的『仙女計算機』,然而隨著一九六零年代以來『硬體描述語言』 HDL hardware description language 的發展,也許我們終將受邀進入『計算機械的世界』,一探『軟硬體的真諦』!『圖靈的蘋果』正述說著『尊重』與『寬容』,如今想來他早已『知道』這些『演算法』了的吧!!

一顆 Broadcom BCM2835 SoC 可以用來設計樹莓派 B, A, B+, A+ 與 Computer Module 等主版,那麼它們之間的軟硬體差異,從 kernel OS 的角度來看,差異到底有多大呢?假使每種不同的板子,都需要特定的 kernel ,不但非常麻煩,該說是不智之舉的吧!再說因於 GPIO 上的 SPI, I2C, I2S 等等介面所產生的各類擴充板,難到不能有更好的規劃,使得驅動程式的安裝、設定和管理更加簡易的嗎??如此總總實務上的考量,促使著應用『 Device Tree 』、『 Overlay 』與『 Parameter 』來描述『系統硬體』,達成化繁為簡的目的。這個『樹狀結構』的『硬體裝置描述』 .dts 方式類似於 C 語言的 struct 資料結構,也有 C 語言相仿的 /include/ 子樹 .dtsi 引用,再加上部份『 Fragment 』 零碎資料構成的『 Overlay 』 .dts 組成了整體硬體的『設備樹』。經由 dtc 編譯程式編成二進制的『 device tree blob 』 dtb ,系統啟動時由 start.elf 程式傳給 kernel

在此讓我們先安裝那個 dtc 編譯工具︰

# 不支援 overlay
pi@raspberrypi ~ $ apt-cache search device-tree
device-tree-compiler - Device Tree Compiler for Flat Device Trees

# 安裝新版 dtc 及 fdt** 工具
wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh
chmod +x dtc.sh
./dtc.sh

# 版本檢查
pi@raspberrypi ~ $ dtc -v
Version: DTC 1.4.0-gf345d9e4

這個『設備樹』的啟動,放在『 /boot/config.txt 』裡,此處僅列出官方文件所說的範例︰

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment one of these lines to enable an audio interface
#dtoverlay=hifiberry-amp
#dtoverlay=hifiberry-dac
#dtoverlay=hifiberry-dacplus
#dtoverlay=hifiberry-digi
#dtoverlay=iqaudio-dac
#dtoverlay=iqaudio-dacplus

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Uncomment this to override the defaults for the lirc-rpi module
#dtparam=gpio_out_pin=16
#dtparam=gpio_in_pin=17
#dtparam=gpio_in_pull=down

如果你實在不需要『設備樹』機制︰

device_tree=

 

─── dt ⊕ iot ⊕ hat = !!!明天會更好??? ───

 

 

 

大樹底下好乘涼 ︰ 《本根變》

□︰打開電燈,需要知道電路學嗎?

○︰不需要;

□︰那為什麼要學…

○︰燈不亮時可能需要。

假使你閱讀《 Raspberry Pi 2 ; GPIO not working 》論壇,請注意

【一】 by FTrevorGowen » Sat Feb 14, 2015 3:36 pm
This may be a “red herring” (esp. as I don’t know exactly how the Python code/wrappers work) but if, as on the new Pi 2 B, the 3.18 kernel is in use and the mechanism uses (wiring Pi’s) “gpio export” and “gpio unexport” methods or similar, then the “unexport” behaviour has changed with the new kernel** – all unexported pins now revert to being inputs ~1 second after being unexported since they’re regarded “as no longer in use“.

這事雖在《春雷早發︰樹莓派 2 Model B ︰早鳥篇》一文中談及,那時作者卻也不知 kernel 內部已將『 unexport 』意義改為

by notro » Sun Feb 08, 2015 1:01 am
With Device Tree a new gpio driver is used: pinctrl-bcm2835.
When you unexport, the pin is set back as input. If you want to keep it, don’t unexport it. Unexporting tells Linux that you don’t use the pin anymore.

Call cain:
unexport_store() => gpiod_free() => __gpiod_free() => chip->free():bcm2835_gpio_free() => pinctrl_free_gpio() => pinmux_free_gpio() => pin_free() => ops->gpio_disable_free():bcm2835_pmx_gpio_disable_free()

【二】by croston » Fri Feb 13, 2015 8:09 pm
There is a problem recognising pins > 26 when using BOARD numbers. It is fixed in the development version and I am looking to release 0.5.11 later tonight.

作者曾見網路上很多議論『該不該』作 GPIO 軟體『 upgrade 』的問題,事實上到目前為止,有關『樹莓派 2B 』官方公佈的軟硬體『資訊』都還很少,『嚐鮮者』最好的辦法就是閱讀『原始碼』,就目前所知, 0.5.11 版的 GPIO 軟體已經如期發行,請用︰

 

# 安裝 GPIO 最新版
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

pi@raspberrypi ~ $ apt-cache show RPI.GPIO
Package: python-rpi.gpio
Source: rpi.gpio
Version: 0.5.11-1
Architecture: armhf
Maintainer: Ben Croston <ben@croston.org>
Installed-Size: 174
Depends: libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), python (>= 2.6.6-7~), python (<< 2.8)
Homepage: http://sourceforge.net/projects/raspberry-gpio-python/
Priority: optional
Section: python
Filename: pool/main/r/rpi.gpio/python-rpi.gpio_0.5.11-1_armhf.deb
Size: 45508
SHA256: b8e69b7eead05797378628b814f36e2af788a1abfaf32f1a175233766d3bea20
SHA1: fea86e3a5aebde912066c9d42039ff11a4b42a62
MD5sum: 074cbe6da329fec1f4a4993319987285
Description: Python GPIO module for Raspberry Pi
 This is the RPi.GPIO Python module, for supporting GPIO on a
 Raspberry Pi

Package: python3-rpi.gpio
Source: rpi.gpio
Version: 0.5.11-1
Architecture: armhf
Maintainer: Ben Croston <ben@croston.org>
Installed-Size: 95
Depends: libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), python3 (>= 3.2.3-3~), python3 (<< 3.3)
Homepage: http://sourceforge.net/projects/raspberry-gpio-python/
Priority: optional
Section: python
Filename: pool/main/r/rpi.gpio/python3-rpi.gpio_0.5.11-1_armhf.deb
Size: 26714
SHA256: 615fe7ce819e991e0f202b901b23c9839f2a19095374e8e289a804bc37e8ae0f
SHA1: 8a336971a040408546d89028241eee6fcf83fc19
MD5sum: 2d8dfaaa3b32ec3e0b1c6cec863e9562
Description: Python 3 GPIO module for Raspberry Pi
 This is the RPi.GPIO Python 3 module, for supporting GPIO on a
 Raspberry Pi

 

如果依據《 Device Trees, Overlays and Parameters 》官方說法︰

Raspberry Pi’s latest kernels and firmware, including Raspbian and NOOBS releases, now by default use Device Tree (DT) to manage some resource allocation and module loading. This change is to alleviate the problem of multiple drivers contending for system resources, and to allow HAT modules to be auto-configured.

The current implementation is not a pure Device Tree system — there is still board support code that creates some platform devices — but the external interfaces (i2c, i2s, spi) and the audio devices that use them must now be instantiated using a Device Tree Blob (DTB) passed to the kernel by the loader (start.elf).

The main impact of using Device Tree is to change from everything on, relying on module blacklisting to manage contention, to everything off unless requested by the DTB. In order to continue to use external interfaces and the peripherals that attach to them, you will need to add some new settings to your config.txt.

看來想要更好的掌握樹莓派,對於『設備樹』 Device Tree 這一個『資料結構』── 描述 SoC 以及所構成主板上的各種硬體裝置 ── 之理解也就不可或缺的了!!

讓我們先瞧瞧『樹莓派 2B 』的『骨幹』bcm2709.dtsi︰

/include/ "skeleton.dtsi"

/ {
	compatible = "brcm,bcm2709";
	model = "BCM2709";

	interrupt-parent = <&intc>;

	chosen {
		/* No padding required - the boot loader can do that. */
		bootargs = "";
	};

	soc: soc {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <1>;
		ranges = <0x7e000000 0x3f000000 0x01000000>;

		intc: interrupt-controller {
			compatible = "brcm,bcm2708-armctrl-ic";
			reg = <0x7e00b200 0x200>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio: gpio {
			compatible = "brcm,bcm2835-gpio";
			reg = <0x7e200000 0xb4>;
			interrupts = <2 17>, <2 18>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		i2s: i2s@7e203000 {
			compatible = "brcm,bcm2708-i2s";
			reg = <0x7e203000 0x20>,
			      <0x7e101098 0x02>;

			//dmas = <&dma 2>,
			//       <&dma 3>;
			dma-names = "tx", "rx";
			status = "disabled";
		};

		spi0: spi@7e204000 {
			compatible = "brcm,bcm2708-spi";
			reg = <0x7e204000 0x1000>;
			interrupts = <2 22>;
			clocks = <&clk_spi>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";
		};

		i2c0: i2c@7e205000 {
			compatible = "brcm,bcm2708-i2c";
			reg = <0x7e205000 0x1000>;
			interrupts = <2 21>;
			clocks = <&clk_i2c>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";
		};

		i2c1: i2c@7e804000 {
			compatible = "brcm,bcm2708-i2c";
			reg = <0x7e804000 0x1000>;
			interrupts = <2 21>;
			clocks = <&clk_i2c>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";
		};

		leds: leds {
			compatible = "gpio-leds";
		};
	};

	clocks {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <0>;

		clk_i2c: i2c {
			compatible = "fixed-clock";
			reg = <1>;
			#clock-cells = <0>;
			clock-frequency = <250000000>;
		};

		clk_spi: clock@2 {
			compatible = "fixed-clock";
			reg = <2>;
			#clock-cells = <0>;
			clock-output-names = "spi";
			clock-frequency = <250000000>;
		};
	};

	timer {
		compatible = "arm,armv7-timer";
		clock-frequency = <19200000>;
		interrupts = <3 0>, // PHYS_SECURE_PPI
			     <3 1>, // PHYS_NONSECURE_PPI
			     <3 3>, // VIRT_PPI
			     <3 2>; // HYP_PPI
		always-on;
	};

	cpus: cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		v7_cpu0: cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf00>;
			clock-frequency = <800000000>;
		};

		v7_cpu1: cpu@1 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf01>;
			clock-frequency = <800000000>;
		};

		v7_cpu2: cpu@2 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf02>;
			clock-frequency = <800000000>;
		};

		v7_cpu3: cpu@3 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0xf03>;
			clock-frequency = <800000000>;
		};
	};

	__overrides__ {
		arm_freq = <&v7_cpu0>, "clock-frequency:0",
		       <&v7_cpu1>, "clock-frequency:0",
		       <&v7_cpu2>, "clock-frequency:0",
		       <&v7_cpu3>, "clock-frequency:0";
	};
};

 

 

─── 果真是不一樣的『裝置異樹』,□!學學學 \\\ ────

 

 

 

大樹底下好乘涼 ︰ 《開場白》

1_180504_2

清代‧居廉‧ 扶桑

山海經‧海外東經

帝命豎亥步,自東極至於西極,五億十選九千八百步。豎亥右手把筭,左手指青丘北。…

黑齒國在其北,為人黑,食稻啖蛇,一赤一青,在其旁。…

下有湯谷。湯谷上有扶桑,十日所浴,在黑齒北。居水中,有大木,九日居下枝,一日居上枝。

參天大木,始於生,終至成。如是遂有日居焉?而後才能水木榮諸??此方謂『扶桑』── 意在春蠶吐絲哉 ── !!

如果用錯了鑰匙,再簡單的鎖也打不開;就算撬開了鎖,難到事物必然一樣的嗎??

曾經人們希望『○』,然後冀盼『□』,接續期待『☆』,祇不濄人類的『科學』也許也僅能專著於『眼見』,那個『精神』卻日漸地虛無飄渺了吧!

現象顯示『意義的消逝』和『快樂之伏藏』是『相同的一面』,那麼所謂『背面』又到底有些什麼的呢?宛如『天下是天下人的天下』,任誰都無法管之天下吧!怎就不該即時行樂的呢?麻煩在於『無所得故』,言及社會未來,世代傳承……。千百萬年之歷史總歸一詞 ── 終究人性 ──!?

無有』沒法整理,『眾集』不耐其繁,『 Know-How 』多了,或許必將會產生『物以類聚』── 物件描述法 ── 的『 What’s What 』之群分的事!!這當真就是『 Device Tree 』自將之興起的道理嗎??

 

/dts-v1/;

/include/ "bcm2709.dtsi"

/ {
        compatible = "brcm,bcm2709";
        model = "Raspberry Pi 2 Model B";

        aliases {
                soc = &soc;
                spi0 = &spi0;
                i2c0 = &i2c0;
                i2c1 = &i2c1;
                i2s  = &i2s;
                gpio = &gpio;
                intc = &intc;
                leds = &leds;
                sound = &sound;
        };

        sound: sound {
        };
};

&gpio {
        spi0_pins: spi0_pins {
                brcm,pins = ;
                brcm,function = ; /* alt0 */
        };

        i2c0_pins: i2c0 {
                brcm,pins = ;
                brcm,function = ;
        };

        i2c1_pins: i2c1 {
                brcm,pins = ;
                brcm,function = ;
        };

        i2s_pins: i2s {
               brcm,pins = ;
               brcm,function = ; /* alt0 */
        };
};

&spi0 {
        pinctrl-names = "default";
        pinctrl-0 = <&spi0_pins>;;

        spidev@0{
                compatible = "spidev";
                reg = ; /* CE0 */
                #address-cells = ;
                #size-cells = ;
                spi-max-frequency = ;
        };

        spidev@1{
                compatible = "spidev";
                reg = ; /* CE1 */
                #address-cells = ;
                #size-cells = ;
                spi-max-frequency = ;
        };
};

&i2c0 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c0_pins>;
        clock-frequency = ;
};

&i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins>;
        clock-frequency = ;
};

&i2s {
        #sound-dai-cells = ;
        pinctrl-names = "default";
        pinctrl-0 = <&i2s_pins>;
};

&leds {
        act_led: act {
                label = "led0";
                linux,default-trigger = "mmc0";
                gpios = <&gpio 47 0>;
        };

        pwr_led: pwr {
                label = "led1";
                linux,default-trigger = "input";
                gpios = <&gpio 35 0>;
        };
};

/ {
        __overrides__ {
                i2s = <&i2s>,"status";
                spi = <&spi0>,"status";
                i2c0 = <&i2c0>,"status";
                i2c1 = <&i2c1>,"status";
                i2c0_baudrate = <&i2c0>,"clock-frequency:0";
                i2c1_baudrate = <&i2c1>,"clock-frequency:0";

                act_led_gpio = <&act_led>,"gpios:4";
                act_led_activelow = <&act_led>,"gpios:8";
                act_led_trigger = <&act_led>,"linux,default-trigger";

                pwr_led_gpio = <&pwr_led>,"gpios:4";
                pwr_led_activelow = <&pwr_led>,"gpios:8";
                pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
        };
};

 

 

 

 

萬事亨通!!

金文豫

豫,象之大者。
賈侍中說:不害於物。从象予聲。

易經》第十六卦‧雷地豫

豫:利建侯行師。

彖曰:豫,剛應而志行,順以動,豫。豫,順以動,故天地如之,而況建侯行師乎?天地以順動,故日月不過,而四時不忒﹔聖人以順動,則刑罰清而民服。 豫之時義大矣哉!

象曰:雷出地奮,豫。 先王以作樂崇德,殷荐之上帝,以配祖考。

初六:鳴豫,凶。
象曰:初六鳴豫,志窮凶也。

六二:介于石,不終日,貞吉。
象曰:不終日,貞吉﹔以中正也。

六三:盱豫,悔。 遲有悔。
象曰:盱豫有悔,位不當也。

九四:由豫,大有得。勿疑。 朋盍簪。
象曰:由豫,大有得﹔志大行也。

六五:貞疾,恆不死。
象曰:六五貞疾,乘剛也。 恆不死,中未亡也。

上六:冥豫,成有渝,無咎。
象曰:冥豫在上,何可長也。

樹莓派 2B 』看來是樹莓派之『』者,並非不期而遇之事,那將如何認識這個『』的呢??也許

禮記‧中庸

子曰好學近乎知。力行近乎仁。知恥近乎勇。知斯三者,則知所以修身。知所以修身,則知所以治人。知所以治人,則知所以治天下國家矣。凡為天下國家有九經,曰:修身也、尊賢也、親親也、敬大臣也、體群臣也、子庶民也、來百工也、柔遠人也、懷諸侯也。修身,則道立。尊賢,則不惑。親親,則諸父昆弟不怨。敬大臣,則不眩。體群臣,則士之報體重。子庶民,則百姓勸。來百工,則財用足。柔遠人,則四方歸之。懷諸侯,則天下畏之。齊明盛服,非體不動:所以修身也。去讒遠色,賤貨而貴德,所以勸賢也。尊其位,重其祿,同其好惡,所以勸親親也。官盛任使,所以勸大臣也。忠信重祿,所以勸士也。時使薄斂,所以勸百姓也。日省月試,既稟稱事,所以勸百工也。送往迎來,嘉善而矜不能所以柔遠人也。繼絕世,舉廢國,治亂持危,朝聘以時,厚往而薄來,所以懷諸侯也。凡為天下國家有九經,所以行之者一也。凡事,豫則立,不豫則廢。言前定,則不跲。事前定,則不困。行前定,則不疚。道前定,則不窮。在下位不獲乎上,民不可得而治矣。獲乎上有道:不信乎朋友,不獲乎上矣。信乎朋友有道:不順乎親,不信乎朋友矣。順乎親有道:反者身不誠,不順乎親矣。誠身有道:不明乎善,不誠乎身矣。誠者,天之道也。誠之者,人之道也。誠者,不勉而中不思而得:從容中道,聖人也。誠之者,擇善而固執之者也。博學之,審問之,慎思之,明辨之,篤行之。有弗學,學之弗能,弗措也。有弗問,問之弗知,弗措也。有弗思,思之弗得,弗措也。有弗辨,辨之弗明,弗措也。有弗行,行之弗篤,弗措也。人一能之,己百之。人十能之,己千之。果能此道矣,雖愚必明,雖柔必強。