å€èŠ³ïŒ
ãã®ç¹æ§ã«ãããšããã®ããŒãã¯ããã»ã©æªããããŸããïŒ
ããã»ããµãŒïŒAPM82181ã€ã³ã¿ãŒãã§ã€ã¹ã«ã¯ãSATAã100 Mbpsãããã¯ãŒã¯ãã·ãªã¢ã«ããŒãïŒUARTãã¯ãã ä»ããããŠããªãïŒãJTAGãããã°ã³ãã¯ã¿çšã®å ŽæããããŸãã ããŒãã«ã¯ã4061-705086-003 REVãšããçªå·ã®ã©ãã«ããããŸããã ãã çªå·4060-705086ã¯å察åŽã«ãšããã³ã°ãããŠããŸãã
åšæ³¢æ°ïŒ800 MHz
ãã©ãããã©ãŒã ïŒPowerPC 44x
RAMïŒ256 MB
ROMïŒ512 KV
èšäºã®å 容ïŒ
1.ã³ã³ãœãŒã«ã®æ¥ç¶
2.ãã£ã¹ã¯ãªãã§ããŠã³ããŒã
3. LEDEã§ã®ã³ã³ãã€ã«
4.ããŒã管çïŒLuCIããã³ã³ã³ãœãŒã«çµç±ïŒ
5. I2Cãã¹ãžã®æ¥ç¶
6. PCF8574ããŒããšã¯ã¹ãã³ããŒã®æ¥ç¶
æ®ãã¯æ¬¡ã®éšåã«ãããŸã...
è¿œå ãã³ã¡ã³ããæè¿ããŸãã è¡ããïŒ
1.ã³ã³ãœãŒã«ã®æ¥ç¶
ããŒããæäœããã«ã¯ãã³ã³ãœãŒã«ãããŒã«ã«ã«æ¥ç¶ããå¿ èŠããããŸãïŒãã ããããŒãåŸã®ã»ãšãã©ã®æäœã¯SSHã§ãå®è¡ã§ããŸãïŒã ããã¯åçŽã«è¡ãããŸããã€ã³ã¿ãŒãããã«ã¯ååãªæ å ±ããããŸããããšãã°ã WD MyBook Live UART Portã¯ããã«ãããŸãã
ãã³é
åïŒ
RS232-UARTã¢ããã¿ãŒãä»ããŠã³ã³ãã¥ãŒã¿ãŒã®RS232ããŒãã«æ¥ç¶ãããŸãã 3.3V以å ã®ããŒãäžã®ããžãã¯ã¬ãã«ã ããã©ã«ãã®ããŒã¬ãŒãã¯115200ã§ãã
æ¥ç¶ããŠé»æºãå
¥ãããšãã³ã³ãœãŒã«ã«u-bootããŒãããŒããŒã衚瀺ãããŸãã
U-Boot 2009.08-svn65645 (Oct 08 2012 - 14:36:50), Build: 0.2.5 CPU: AMCC PowerPC UNKNOWN (PVR=12c41c83) at 800 MHz (PLB=200, OPB=100, EBC=100 MHz) Bootstrap Option E - Boot ROM Location NOR/SRAM (8 bits) 32 kB I-Cache 32 kB D-Cache Board: Apollo-3G - APM82181 Board, 2*SATA, 1*USB I2C: ready DRAM: Auto calibration 256 MB FLASH: 512 kB DTT: 1 FAILED INIT Net: PHY EC1 Register: 0x2c8c ppc_4xx_eth0 Type run flash_nfs to mount root filesystem over NFS Hit any key to stop autoboot: 0
ãApollo-3G-APM82181ããŒãã2 * SATAã1 * USBããšããã¡ãã»ãŒãžã¯ãUSBããªããSATAã1ã€ãããªããããå°ãééã£ãŠããŸãã ããã¯ãããŒãããŒããŒãMyBook Liveãš2ã€ã®ãã£ã¹ã¯ãæèŒããDUOã¢ãã«ã«å ±éããŠããããã§ãã
ã³ã³ãœãŒã«ã§äœãã¯ãªãã¯ããªããšãããŒããã©ã€ãããã®èµ·åãè©Šè¡ãããŸãã ç§ãã¡ã®å Žåãããã«ã¯ãªãã®ã§ãããããã®ãã¿ã³ãæŒããšããŠã³ããŒããåæ¢ããŸãã
2.ãã£ã¹ã¯ãªãã§ããŠã³ããŒã
u-bootããŒãããŒããŒã«ã¯ãæ©åšãæäœããããã®å€ãã®æ©èœããããŸãã
ããšãã°ã3è²LEDã®ãã¹ãŠã®è²ãèŠãããšãã§ããŸãã
LEDããªãã«ããïŒããŒãããŒããŒã®éè²ã«ç¹ç¯ïŒïŒ
LEDã®3è²ã亀äºã«ãã¹ãããŸãã
ledtestoff
LEDã®3è²ã亀äºã«ãã¹ãããŸãã
ledtest
ã³ãã³ãã®ãªã¹ãã衚瀺ããã«ã¯ãhelpãšå ¥åããŸãã ããŒãããŒããŒã®è©³çŽ°ã«ã€ããŠã¯ã ãã¡ããã芧ãã ããã ã³ã³ãœãŒã«ã§ã¯ãããŒãæã«ãu-bootãnfsãã¡ã€ã«ã·ã¹ãã ãããŠã³ããããªãã·ã§ã³ãæäŸããããšãããããŸãããrun flash_nfsãšå ¥åããŠãNFSãä»ããŠã«ãŒããã¡ã€ã«ã·ã¹ãã ãããŠã³ãããŸããã ãã®å Žåãå¥ã®ãªãã·ã§ã³ã䜿çšããŸã-TFTPãµãŒããŒããRAMã€ã¡ãŒãžãããŒãããŸãã
TFTPD32ïŒ å ¬åŒãµã€ã ïŒãªã©ã®ãµãŒããŒããµãŒããŒäžã«ç«ã¡äžãããããŒããæ§æããŸãã ããŒã«ã«IPã¢ãã¬ã¹ãšTFTPãµãŒããŒïŒã³ã³ãã¥ãŒã¿ãŒïŒã®ã¢ãã¬ã¹ãèšå®ããŸãã ãããã¯åããµããããããã®ãã®ã§ãªããã°ãªããŸããïŒ
setenv ipaddr '192.168.1.1' setenv serverip '192.168.1.10'
TFTPãµãŒããŒããèŠæ±ããããã¡ã€ã«ã®ååã衚瀺ããŸãã
=> printenv fdt_file bootfile fdt_file=apollo3g.dtb bootfile=uImage
å€æ°fdt_fileã«ã¯ããã€ã¹ããªãŒãã¡ã€ã«ã®ååãå«ãŸããããŒããã¡ã€ã«ã«ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®RAMãã£ã¹ã¯ã€ã¡ãŒãžãã¡ã€ã«ã®ååãå«ãŸããŠããããšã«æ³šæããŠãã ããã
setenvã³ãã³ãã§ã®ã¢ãã¬ã¹ãšåæ§ã«ãååã¯ãã䟿å©ãªååã«å€æŽã§ããŸãã 調æŽåŸãå€æ°ã®æ°ããå€ãROMã«ä¿åããããšããå§ãããŸãã
=> saveenv Saving Environment to Flash... Un-Protected 1 sectors Un-Protected 1 sectors Erasing Flash... . done Erased 1 sectors Writing to Flash... done Protected 1 sectors Protected 1 sectors
ãããã£ãŠãåèµ·åãŸãã¯é»æºããªãã«ããåŸãèšå®ã¯ä¿åãããŸãã ãã®åŸãTFTPãµãŒããŒã«å¿ èŠãª2ã€ã®ãã¡ã€ã«ãé 眮ãïŒãã¡ã€ã«ããªãå Žåã¯ã次ã®ã»ã¯ã·ã§ã³ãåç §ïŒãrun net_nfsã³ãã³ããå ¥åããŸãã
=> net_nfsãå®è¡
Waiting for PHY auto negotiation to complete.. done ENET Speed is 100 Mbps - FULL duplex connection (EMAC0) Using ppc_4xx_eth0 device TFTP from server 192.168.1.10; our IP address is 192.168.1.1 Filename 'uImage'. Load address: 0x1000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# # done Bytes transferred = 6680079 (65ee0f hex) Using ppc_4xx_eth0 device TFTP from server 192.168.1.10; our IP address is 192.168.1.1 Filename 'apollo3g.dtb'. Load address: 0x1800000 Loading: ## done Bytes transferred = 16384 (4000 hex) ## Booting kernel from Legacy Image at 01000000 ... Image Name: POWERPC LEDE Linux-4.4.21 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6680015 Bytes = 6.4 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 01800000 Booting using the fdt blob at 0x1800000 Uncompressing Kernel Image ... OK Loading Device Tree to 00ff9000, end 00ffffff ... OK
ã芧ã®ãšãããçµæãšããŠ2ã€ã®ãã¡ã€ã«ãããŒããããŸãã ãããã¯RAMã®æå®ãããå Žæã«ãããã«ãŒãã«ã解åãããŠããŒããããŸãã ãã®çµæã皌åäžã®ã·ã¹ãã ããã®å Žåã¯LEDEããããŸãã
root@lede: uname -a Linux lede 4.4.21 #0 Fri Nov 18 03:27:44 UTC 2016 ppc GNU/Linux
3. LEDEã§ã®ã³ã³ãã€ã«
ããŒãã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ãœãŒã¹ãšããŠLEDEã䜿çšããŸãã ããã¯OpenWRTã®ãã©ãŒã¯ã§ãããMyBook LiveããŒãããµããŒãããŠããŸãã ããããããŠã³ããŒãïŒ apm82181-lede æé ã«æžãããŠãããšããã«ããã±ãŒãžãããŠã³ããŒãããŸãã
./scripts/feeds update -a ./scripts/feeds install -a
ã³ã³ãã£ã®ã¥ã¬ãŒã¿ãŒãèµ·åããŸãã
make menuconfig
ã·ã¹ãã ïŒãã¿ãŒã²ããã·ã¹ãã ãïŒãšããŠãAppliedMicro APM821xxãããµãã·ã¹ãã ïŒããµãã¿ãŒã²ãããïŒãšããŠãSATAïŒNASïŒããèµ·åããããã€ã¹ãããããã¡ã€ã«ïŒãã¿ãŒã²ããã·ã¹ãã ãïŒãšããŠãWestern Digital My Book LiveããéžæããŸãã æçµã€ã¡ãŒãžïŒãã¿ãŒã²ããã€ã¡ãŒãžãïŒã§ãramdiskãããŒã¯ããå¿ èŠããããŸãã
ç§ãã¡ã®è£éã§ããã±ãŒãžãéžæããŸãã ã³ã³ãã£ã®ã¥ã¬ãŒã¿ãŒã§èšå®ãä¿åããŠçµäºããããmakeã³ãã³ãã§ã³ã³ãã€ã«ãéå§ã§ããŸãã
ããã»ã¹ã®çµäºåŸããšã©ãŒãçºçããªãã£ãå Žåãå¿ èŠãªãã¡ã€ã«ãããã¯ã¢ããããŠTFTPãµãŒããŒã«é 眮ã§ããŸãã
- ãã¡ã€ã«bin / targets / apm821xx / sata / lede-apm821xx-sata-MyBookLiveSingle-initramfs-kernel.binã®ååãuImageã«å€æŽããŸã
- ãã¡ã€ã«ã®ååãbuild_dir / target-powerpc_464fp_musl-1.1.15 / linux-apm821xx_sata / tmp / lede-apm821xx-sata-MyBookLiveSingle-initramfs-kernel.bin.dtbããapollo3g.dtbã«å€æŽããŸã
ãããã£ãŠããã£ã¹ã¯ãªãã§ã·ã¹ãã ãããŒããã段éãçµãŸããã
4.ããŒã管çïŒLuCIããã³ã³ã³ãœãŒã«çµç±ïŒ
ãã®ããŒãã®åè·¯ãšãäžè¬çã«ã€ã³ã¿ãŒãããäžã®APM82181ããã»ããµã«åºã¥ãããã€ã¹ã®åè·¯ã¯èŠã€ãããŸããã§ããã ãããã£ãŠãéšåçã«ãªããŒã¹ãšã³ãžãã¢ãªã³ã°ïŒãªããŒã¹ãšã³ãžãã¢ïŒããŸããã€ãŸããããŒãäžã®æ¥ç¶ãæšæž¬ãããããæ€èšŒããŸãã æ¥ç¶ãããããŒãã¯ããã€ã¹ããªãŒã§ç¢ºèªããããã«ãŒãã«ããã®æ å ±ã確èªãããã§ãããããLEDEéçºè ã¯ãããéšåçã«è¡ã£ãããã§ãã
å
¥åºåããŒã
root@lede: cat /sys/kernel/debug/gpio GPIOs 496-503, platform/4e0100000.gpio1, 4e0100000.gpio1: gpio-498 ( |Reset button ) in hi GPIOs 504-511, platform/4e0000000.gpio0, 4e0000000.gpio0: gpio-504 ( |enable EMAC PHY ) out hi gpio-505 ( |Enable Reset Button,) out lo gpio-506 ( |Power USB Core ) out hi gpio-507 ( |Power Drive Port 1 ) out hi gpio-508 ( |? ) out lo gpio-509 ( |? ) out hi gpio-510 ( |? ) out lo gpio-511 ( |Power Drive Port 0 ) out hi
ã芧ã®ããã«ã1ã€ã®ããŒãã¯ãã¿ã³ãæŒãããã«äœ¿çšãããæ®ãã¯å¶åŸ¡ã®ããã®åºåã«äœ¿çšãããŸãã ããã€ã¹ããªãŒãã¡ã€ã«ïŒæ¡åŒµåã.dtsã®ãã¡ã€ã«ïŒãç·šéãããšããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ããŒããæ©èœãã解æŸã§ããããšã¯æããã§ãããããŒãã®æ©èœãããã¯ã®æ©èœã«åœ±é¿ããå¯èœæ§ããããŸãã LEDãé€ãã ãã®ã€ã³ãžã±ãŒã¿ã«æ¥ç¶ãããŠããããŒãã¯ãç¬èªã®ç®çã«äœ¿çšã§ããŸãã çå笊ã§ç€ºãããããŒãã¯ããã«æ¥ç¶ãããŠããŸãã ãŸããLEDå¶åŸ¡ã¯ãããšãã°ã³ã³ãœãŒã«ããå©çšã§ããŸãã
ããã©ã«ãã§ã¯ãããŒãåŸãLEDEã€ã³ãžã±ãŒã¿ãç·è²ã«ç¹ç¯ããŸãã ã ããããªãã¯ããããªãã«ããããšãã§ããŸãïŒ
echo 0 > /sys/class/leds/mbl\:green\:power/brightness
ãããŠãéããªã³ã«ããŸãã
echo 1 > /sys/class/leds/mbl\:blue\:power/brightness
LEDEãLuCI Webã·ã§ã«ã§æ§ç¯ãããŠããå ŽåãLEDã¯ãã©ãŠã¶ãŒããå¶åŸ¡ã§ããŸãã
ãããã¯ãŒã¯ã«ãŒãã®IPã¢ãã¬ã¹ã«ç§»åããŸã
[ã·ã¹ãã ]ã¡ãã¥ãŒã§ã[LEDæ§æ]ã«ç§»åããç¹å®ã®åLEDè²ãããªã¬ãŒããã€ãã³ããæ§æããŸãã ããšãã°ãããã¯çä¿¡ããã³çºä¿¡ãããã¯ãŒã¯ãã±ããã§ç·è²ã®LEDãç¹æ» ããæ¹æ³ã§ãã
ãããã¯ãŒã¯æŽ»å
ããŒãºã«å¿ããŠLEDããŒãã䜿çšããå ŽåãLEDãå¶åŸ¡ãããµãŒãã¹ïŒ/etc/init.d/ledïŒããã©ã€ããŒãå¿ èŠãšããªãããšã¯æããã§ãã ãããŠã次ã®ãããªã¹ã¯ãªããããå¶åŸ¡ãè¡ãããšãã§ããŸãã
echo 1 > /sys/class/gpio/gpio508/value
5. I2Cãã¹ãžã®æ¥ç¶
ãããã£ãŠãå°ãªããšã3ã€ã®ããŒãã䜿çšã§ããŸãã ãã¡ããããã£ãšãªãœãŒã¹ã欲ããã§ãã ãããã®ããŒãã«ããŒããšã¯ã¹ãã³ããŒãé 眮ããI2CãœãããŠã§ã¢ããŒãã«æ¥ç¶ã§ããŸãã ãã®åŸãäœéã§ãããªãããã»ãŒç¡å¶éã®æ°ã®ããŒãã«ãã€ã€ã«ã§ããŸãã
ããŒãã«ã¯ããããã®ç©ºããŠããåžããããäœãã圌ãããé¢å©ããŠãããã©ããã確èªããããšããé¡æããããŸããã
ããšãã°ãããã»ããµã®è¿ãã«ããã8æ¬ã®èãæã€ãããã®U12ãšããŒã¯ãããã·ãŒãïŒ
ã¯ãã ä»ãã±ãŒãã«
ãã¹ãŠã®æ¥ç¹ã3.3Vãè¶ ããªãããšã確èªããåŸãããžã¿ã«ã¢ãã©ã€ã¶ãŒãæ¥ç¶ããŸããã
ããŒãããã»ã¹äžã«ãä¿¡å·ã¯æ€åºãããŸããã§ããã 次ã«ãI2Cãã¹ã®èª¬æãæåã¯ååšããªãã£ããããããã€ã¹ããªãŒã«è¿œå ãããŸããã
IIC0: i2c@ef600700 { compatible = "ibm,iic"; reg = <0xef600700 0x00000014>; interrupt-parent = <&UIC0>; interrupts = <0x2 0x4>; fast-mode; #address-cells = <1>; #size-cells = <0>; };
LEDEæ§æã§ã¯ãã³ã¢ïŒkmod-i2c-coreïŒã§I2CãµããŒããæå¹ã«ããå¿ èŠãããããšã¯æããã§ãã
ã³ã³ãã€ã«ããTFTPãµãŒããŒäžã®ãã¡ã€ã«ãæŽæ°ããŠåèµ·åãããšãããã€ã¹/ dev / i2c-0ã衚瀺ãããŸãã
root@lede: dmesg | grep i2c [ 4.816060] i2c /dev entries driver [ 4.819878] ibm-iic 4ef600700.i2c: using standard (100 kHz) mode
echoã³ãã³ãã§æåãéä¿¡ããããšã«ããïŒ
root@lede: echo 11 > /dev/i2c-0 ash: write error: Remote I/O error
ããžã¿ã«ã¢ãã©ã€ã¶ãŒã«ãã£ãŠä¿¡å·ãæ€åºãããŸããã
ãããã£ãŠããã®ããŒãã®I / Oæ©èœãå€§å¹ ã«æ¡åŒµããI2CããŒããŠã§ã¢ãã¹ãèŠã€ãããŸããã
U12ã®ä¿¡å·ã®äœçœ®ïŒ5-GNDã7-SDAã8-SCLïŒããå€æãããšãããã¯ããããADM1032ARMZ-枩床ã»ã³ãµãŒãšèŠãªãããŸãã
6. PCF8574ããŒããšã¯ã¹ãã³ããŒã®æ¥ç¶
I2Cãã¹ã«äœããæ¥ç¶ããŸãã åšåº«ã«ã¯ã2x16ã®èŠªãã¿ãããã枬å®ãã液æ¶ã€ã³ãžã±ãŒã¿ãããããããã8x5ãã¯ã»ã«ã§ããã HD44780ã³ã³ãããŒã©ãŒã¯ããŒã³ãšPCF8574ããŒããšã¯ã¹ãã³ããŒã«åºã¥ããŠäžåœè£œã
LCD HD44780 16x2 I2C
説æã«ããã°ã5Vãš3.3Vã®äž¡æ¹ã®é»åãšä¿¡å·ã¬ãã«ãå¯èœã§ããã確èªãããšã3.3Vã®é»åã§ã¯ç»åã®ã³ã³ãã©ã¹ããéåžžã«äœãããšãããããŸããã 5Vã®é»åã¯0ã5 Vã®ä¿¡å·ã¬ãã«ã«ãã€ãªãããããŒãã¯3.3åãã«èšèšãããŠãããããããªããã£ããªä¿¡å·ã¬ãã«ã³ã³ããŒã¿ãäœæããå¿ èŠããããŸããã I2Cãã¹ã¯åæ¹åã§ãããããããã€ã¹ãã確èªä¿¡å·ãåä¿¡ããå¿ èŠããããŸãããããã£ãŠãå°ãªããšãSDAã©ã€ã³ã«åæ¹åã³ã³ããŒã¿ãŒãå¿ èŠã§ãã éåžžã«é©åãªåè·¯ãªãã·ã§ã³ã«ã€ããŠã¯ã5Vããã³3.3Vããã€ã¹ã®ããžãã¯ã¬ãã«ã®äžèŽã§èª¬æããŸã ã ç§ãã¡ã®å Žåãããã䜿çšãããŸãã
絶çžã²ãŒãé»çå¹æãã©ã³ãžã¹ã¿åè·¯ã
確ãã«ããã©ã³ãžã¹ã¿ã¯äŒŒããããªãã®ããéžæãããŠããŸã-BSS123ã
ãã¬ããããŒãã«çµã¿ç«ãŠãïŒ
ãããã£ãŠã5Vã®é»åãLCDã€ã³ãžã±ãŒã¿ã«äŸçµŠããïŒSATAé»æºã³ãã¯ã¿ããããŒãäžã§ååŸïŒãäž¡æ¹ã®é»æºãã¬ãã«ã³ã³ããŒã¿ã«äŸçµŠãããŸã-3.3ããã³5Vã
次ã«ãããŒããšã¯ã¹ãã³ããŒãLEDEã«è¿œå ããŸãã ã«ãŒãã«ãµããŒãïŒã«ãŒãã«ã¢ãžã¥ãŒã«-ãã®ä»ã®ã¢ãžã¥ãŒã«-kmod-gpio-pcf857x ... PCX857xãPCA967xããã³MAX732X I2C GPIOãšã¯ã¹ãã³ããŒïŒãåã³ã³ãã€ã«ããµãŒããŒãžã®ã¢ããããŒããããã³åèµ·åãæå¹ã«ããŸãã
ãã©ã€ããŒã®ååšãæ¢ããŸãã
root@lede: lsmod |grep pcf gpio_pcf857x 6128 0
æ¥ç¶ããŸãïŒ0x27-I2Cãã¹äžã®ãšãã¹ãã³ããŒã®ã¢ãã¬ã¹ïŒïŒ
root@lede: echo pcf8574 0x27 > /sys/bus/i2c/devices/i2c-0/new_device [ 218.957888] pcf857x 0-0027: probed [ 218.961321] i2c i2c-0: new_device: Instantiated device pcf8574 at 0x27
ããŒãã®å€èŠ³ã確èªããŸãã
root@lede: ls -l /sys/class/gpio/ --w------- 1 root root 4096 Jan 1 1970 export lrwxrwxrwx 1 root root 0 Nov 25 04:04 gpiochip488 -> ../../devices/platform/plb/plb:opb/4ef600700.i2c/i2c-0/0-0027/gpio/gpiochip488 lrwxrwxrwx 1 root root 0 Jan 1 1970 gpiochip496 -> ../../devices_platform/plb/plb:opb/4e0100000.gpio1/gpio/gpiochip496 lrwxrwxrwx 1 root root 0 Jan 1 1970 gpiochip504 -> ../../devices/platform/plb/plb:opb/4e0000000.gpio0/gpio/gpiochip504 --w------- 1 root root 4096 Jan 1 1970 unexport
ã芧ã®ãšãããã¢ãã¬ã¹0x27ã®gpiochip488ããŒãã®ã°ã«ãŒããI2Cãã¹ã«çŸããŸããã ããã§ãããŒããšã¯ã¹ãã³ããŒãä»ããŠæ©èœãããšããäºå®ã«ãããããããã·ã¹ãã ã«è¡šç€ºãããããŒããšãããã»ããµã«ããããŒããè¿œå ã§ããŸãã
root@lede: echo 488 > /sys/class/gpio/export root@lede: echo 489 > /sys/class/gpio/export root@lede: echo 490 > /sys/class/gpio/export root@lede: echo 491 > /sys/class/gpio/export
... 495ã«ç¶ããŸãã8ããŒãã®ãšãã¹ãã³ããŒã䜿çšã§ããããã§ãã ãããã®å¯çšæ§ã確èªããŸãã
root@lede: ls -l /sys/class/gpio/gpio??? lrwxrwxrwx 1 root root 0 Nov 25 04:17 /sys/class/gpio/gpio488 -> ../../devices/platform/plb/plb:opb/4ef600700.i2c/i2c-0/0-0027/gpio/gpio488 lrwxrwxrwx 1 root root 0 Nov 25 04:17 /sys/class/gpio/gpio489 -> ../../devices/platform/plb/plb:opb/4ef600700.i2c/i2c-0/0-0027/gpio/gpio489 lrwxrwxrwx 1 root root 0 Nov 25 04:17 /sys/class/gpio/gpio490 -> ../../devices/platform/plb/plb:opb/4ef600700.i2c/i2c-0/0-0027/gpio/gpio490 lrwxrwxrwx 1 root root 0 Nov 25 04:17 /sys/class/gpio/gpio491 -> ../../devices/platform/plb/plb:opb/4ef600700.i2c/i2c-0/0-0027/gpio/gpio491
äœæ¥ã®æ¹åãçµè«ã«èšå®ããŸãã
root@lede: echo out > /sys/class/gpio/gpio488/direction root@lede: echo out > /sys/class/gpio/gpio489/direction root@lede: echo out > /sys/class/gpio/gpio490/direction root@lede: echo out > /sys/class/gpio/gpio491/direction
å ¥åããå¿ èŠãããå Žåã¯ãã³ãã³ããinããæå®ããå¿ èŠããããŸãã ããšãã°ããã¹ã¿ãŒãŸãã¯ããžã¿ã«ã¢ãã©ã€ã¶ãŒã§åºåç¶æ ã枬å®ãããªã©ããŠãåºåã®åäœã確èªããŸãã HD447880 LCDããšãã¹ãã³ããŒã«æ¥ç¶ãããŠããå Žåããšãã¹ãã³ããŒã®3çªç®ã®ããããã€ã³ãžã±ãŒã¿ãŒã®ããã¯ã©ã€ããå¶åŸ¡ãããšããäºå®ã掻çšã§ããŸãã
root@lede: echo 1 > /sys/class/gpio/gpio491/value root@lede: echo 0 > /sys/class/gpio/gpio491/value
æåã®ã³ãã³ãã¯ããã¯ã©ã€ãããªã³ã«ãã2çªç®ã®ã³ãã³ãã¯ããã¯ã©ã€ãããªãã«ããŸãã èµ·åããã»ã¹äžã«ããã€ã¹ãè¿œå ããã«ã¯ãããã€ã¹ããªãŒã«è¿œå ã§ããŸãã
IIC0: i2c@ef600700 { compatible = "ibm,iic"; reg = <0xef600700 0x00000014>; interrupt-parent = <&UIC0>; interrupts = <0x2 0x4>; fast-mode; #address-cells = <1>; #size-cells = <0>; /* Boot ROM is at 0x52-0x53, do not touch */ /* Unknown chip at 0x6e, not sure what it is */ i2cled: led@27{ #gpio-cells = <2>; compatible = "nxp,pcf8574"; reg = <0x27>; gpio-controller; }; };
i2cledã©ãã«ã®åŸã®è¡ã¯ãã³ãã³ããecho pcf8574 0x27> / sys / bus / i2c / devices / i2c-0 / new_deviceãã眮ãæããŸãã
ãã®ããããšãã¹ãã³ããŒãä»ããŠI2Cãã¹ã«æ¥ç¶ãããI / OããŒããééçã«äœ¿çšããæ©äŒãçŸããå®éã«å®è£ ãããŠããŸãã
æåã®éšåã«ã€ããŠã¯ãããããååã§ãããã 2çªç®ã®éšåã§ã¯ãåœç¶ã®ããšãªãããã³ã¡ã³ãã«æãããªå¯Ÿç«ããªãéããã€ã³ãžã±ãŒã¿ãŒã䜿çšããŠã·ã¹ãã ã®ç¶æ ã衚瀺ããŸãã
ãã®ããã«ãHD44780ãã©ã€ããŒã䜿çšããããã¡ã€ãã©ã€ãºãããŸããã LCD4Linuxããã±ãŒãžãæ¥ç¶ãããæ¢åã®ãã©ã€ããŒãé©åããªãã£ããããVT100ã¿ãŒããã«ã³ãã³ãã®è¡šç€ºãå¶åŸ¡ããæ°ãããã£ã¹ãã¬ã€ãã©ã€ããŒãæžã蟌ãŸããŸããã