yakko.me

メモメモ

2020/02/10

D-Link DBA-1510Pのハードウェアまわりメモ

11acが使える、はんぺん型のAPがリサイクルショップで電源なし300円で売ってたから買った。 それの中身とかのメモ。

ハードウェア

  • Cortina CS7542
  • RAM 256MB
  • ROM 512MiB

ブートローダ

U-Bootが利用されている。 とりあえずキーを入力して自動起動を止めるところまでのログ。

Copyright 2011 Cortina Systems - Golden Gate
JTAG ID: 0x101083e5
CPU Speed : 750 MHz
CPU PLL(0): Locked
Core PLL(1): Locked
Peripheral PLL(2): Locked
DDR PLL(3): Locked
Flash Type : F:5 S:0 Width : 0 Size : 2 Pin: 0
BOOT: NAND
BOOT: Jumping to boot loader...
2nd CPU Switch to RRAM1 successfully

Cortina Systems Power-On Self-Test 0.99
 Build Info: Mar 16 2015 14:26:44
Hit key [m] before reset/power_on to enter DDR memory config and POST prompt
Setup DDR, do memory check, and then go to UBOOT
Started Denali SDRAM Controller Configuration...
DONE Denali SDRAM Controller Configuration...
Started SDRAM PHY Configuration...
DONE SDRAM PHY Configuration...
Initiate Denali SDRAM Controller initialization
Waiting for SDRAM initialization to complete
SDRAM initialization DONE.............
Performing train RD strobe
byte lane#0:
        Right hand margin is 48
        Left hand margin is 31
byte lane#1:
        Right hand margin is 50
        Left hand margin is 35
byte lane#2:
        Right hand margin is 51
        Left hand margin is 38
byte lane#3:
        Right hand margin is 53
        Left hand margin is 40
ADDR: 0xf0500220  VAL: 0x06060708

Performing train RD latency
Read delay adjusted at rdlat_adj=10 dram_class=6
ADDR: 0xf0500080  VAL: 0x00000000
ADDR: 0xf0500160  VAL: 0x050b0c2d

Performing train gating
Right hand margin is 63 for GATEO
Left hand margin is 63 for GATEO
ADDR: 0xf0500218  VAL: 0x00000600
ADDR: 0xf0500080  VAL: 0x01000000

Performing train write data
byte lane#0:
Right hand margin is 41
Left hand margin is 40
byte lane#1:
Right hand margin is 42
Left hand margin is 63
byte lane#2:
Right hand margin is 42
Left hand margin is 63
byte lane#3:
Right hand margin is 44
Left hand margin is 63
ADDR: 0xf0500224  VAL: 0x494a4a00
ADDR: 0xf0500080  VAL: 0x01000000
SDRAM_DENALI_CTL_161: 0x30002001

Memory size detected as 256 Mbyte
Denali SDRAM Controller initialization Done

Memory Test St Address 0x00800000 Len 0x00400000: Passed
Copy flash code from 0xf6a07cf0 to 0x04000000 length = 0x00027640

POST: execution transfer to u-boot 0x04000000



U-Boot 2009.11 (Mar 16 2015 - 14:29:42) GoldenGate SoC ASIC

DRAM:  256 MB
NAND:  512 MiB
In:    serial
Out:   serial
Err:   serial
Net:   Connect GMAC1 to CPU
Goldengate

CAMEO BOOTCODE:
bootcode ver       = 1.00B09
bootcode model     = DBA-1510P
bootcode board ver = A1

Hit any key to stop autoboot:  0
U-BOOT #

環境変数 ※ 一部固有の情報は書き換え済

U-BOOT # printenv
baudrate=115200
ethaddr2=00:50:c2:00:00:00
ipaddr=192.168.0.1
netmask=255.255.255.0
serverip=192.168.0.2
gatewayip=192.168.0.3
basicargs=console=ttyS0,115200 SB_PHY=PPPS
setbootargs=setenv bootargs ${basicargs} ${ramargs} ni_napi_budget=${NI_NAPI_BUDGET} qm_acp_enable=${QM_ACP_ENABLE} ni_rx_noncache=${NI_RX_NONCACHE} qm_int_buff=${QM_INT_BUFF} ethaddr0=${ethaddr} ethaddr}
kernel_address=0x2100000
sb0_address=0xe0400000
sb1_address=0xe0500000
process=sb_process ${kernel_address} ${rootfs_address} ${sb0_address} ${sb1_address}
bootcmd=run process setbootargs b
bootdelay=3
flashfiles=nand/
reflash=run rf_info rf_loader rf_env rf_sb0 rf_sb1 rf_uimage rf_rootfs rf_overlay
rf_info=tftpboot 0x5000000 ${flashfiles}nand-info.bin; nand erase 0x00000000 0x00020000; nand write 0x5000000 0x00000000 0x00020000
rf_loader=tftpboot 0x5000000 ${flashfiles}bootloader.bin; nand erase 0x00020000 0x000e0000; nand write 0x5000000 0x00020000 0x00040000; nand erase 0x00200000 0x00100000; nand write 0x5000000 0x00200000 00
rf_env=tftpboot 0x5000000 ${flashfiles}uboot-env.bin; nand erase 0x00100000 0x100000; nand write 0x5000000 0x00100000 0x00020000 ; nand erase 0x00300000 0x100000; nand write 0x5000000 0x00300000 0x0002000
rf_sb0=tftpboot 0x5000000 ${flashfiles}sb0.bin; nand erase 0x00400000 0x100000; nand write 0x5000000 0x00400000 0x00020000
rf_sb1=tftpboot 0x5000000 ${flashfiles}sb1.bin; nand erase 0x00500000 0x100000; nand write 0x5000000 0x00500000 0x00020000
rf_uimage=tftpboot 0x5000000 ${flashfiles}uImage; nand erase 0x00600000 0x00600000 ; nand write 0x5000000 0x00600000 0x00500000; nand erase 0x03A00000 0x00600000; nand write 0x5000000 0x03A00000 0x0050000
rf_rootfs=tftpboot 0x5000000 ${flashfiles}rootfs.img; nand erase 0x00C00000 0x02E00000 ; nand write 0x5000000 0x00C00000 0x02D00000 ; nand erase 0x04000000 0x02E00000; nand write 0x5000000 0x04000000 0x00
rf_overlay=nand erase 0x6E00000 0x01000000
QM_INT_BUFF=256
NI_NAPI_BUDGET=16
QM_ACP_ENABLE=0
NI_RX_NONCACHE=0
cameo_bootcode_ver=1.00B09
HW_BOARD_VER=1
HW_BOARD_REV=A1
HW_BOARD_MODEL=DBA-1510P
HW_BOARD_MAGIC0=12345678
HW_BOARD_MAGIC1=12345678
HW_BOARD_MAGIC2=12345678
HW_BOARD_MAGIC3=12345678
FUN_RESET=0
b=bootm ${kernel_address}
rootfs_address=-
HW_BOARD_ID=201690203057
Image_B_FWver=1.20b07
ethaddr=A0:AB:1B:00:00:00
wifiaddr0=A0:AB:1B:00:00:00
wifiaddr1=a0:ab:1b:00:00:00
ethaddr1=A0:AB:1B:00:00:00
HW_BOARD_SN=0000000000000
HW_BOARD_UID=0000000000000
HW_BOARD_WIFI_DOMAIN=JP
Image_A_FWver=1.20b07
HW_BOARD_NORMAL_REBOOT=0
stdin=serial
stdout=serial
stderr=serial
verify=n
ethact=Goldengate

Environment size: 2703/131068 bytes

シングルユーザモードで起動

U-Boot上で

U-BOOT # setenv basicargs console=ttyS0,115200 SB_PHY=PPPS single
U-BOOT # run process setbootargs b
Kernel: Copy 3279164 bytes from flash address 0xe3a00000 to RAM address 0x02100000 ...
Checking MD5 at address 0x02100000 for 3279164 bytes ...
Rootfs: Copy 10223620 bytes from flash address 0xe4000000 to RAM address 0x00000000 ...
Checking MD5 at address 0x00000000 for 10223620 bytes ...
Booting from SB at 0xe0500000
## Booting kernel from Legacy Image at 02100000 ...
   Image Name:   Linux-2.6.36
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3279100 Bytes =  3.1 MB
   Load Address: 00008000
   Entry Point:  00008000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.36 (root@DlinkCloud) (gcc version 4.5.2 20101126 (Linaro) [release 4.5-2010.12-0] (GCC) ) #5 SMP PREEMPT Wed May 6 17:40:31 CST 2015
CPU: ARMv7 Processor [412fc091] revision 1 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: CORTINA-G2 EB

以下略

待ってるとプロンプトが表示される。

BusyBox v1.17.3 (2015-04-10 10:05:45 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

-/bin/sh: can't access tty; job control turned off
_________     ______________           _________      _____
__  ____/________  /_____  /_____________  ____/_____ __  /_____
_  / __ _  __ \_  /_  __  /_  _ \_  __ \  / __ _  __ `/  __/  _ \
/ /_/ / / /_/ /  / / /_/ / /  __/  / / / /_/ / / /_/ // /_ /  __/
\____/  \____//_/  \__,_/  \___//_/ /_/\____/  \__,_/ \__/ \___/
C O R T I N A  S Y S T E M S  Network Processor

grep: /etc/passwd: No such file or directory
@(none):/# echo $SHELL
/bin/sh
@(none):/#

この地点ではprocとかもマウントされてないから動ける範囲が狭い。

雑に動かす

@(none):/# /etc/init.d/rcS
Mounting proc filesystem...
UBI: attaching mtd16 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: max. sequence number:       3901206
UBI: attached mtd16 to ubi0
UBI: MTD device name:            "ubi0"
UBI: MTD device size:            32 MiB
UBI: number of good PEBs:        255
UBI: number of bad PEBs:         1
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             116
UBI: total number of reserved PEBs: 139
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 15385/15298
UBI: image sequence number:  0
UBI: backgUBI device numberr 0, total 255 LEBos (32378880 bytesu, 30.9 MiB), avainlable 116 LEBs (1d4729216 bytes, 14 .0 MiB), LEB sizet 126976 bytes (12h4.0 KiB)
read "ubi_bgt0d" started, PID 936
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "fs0"
UBIFS: file system size:   15745024 bytes (15376 KiB, 15 MiB, 124 LEBs)
UBIFS: journal size:       1015809 bytes (992 KiB, 0 MiB, 6 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  743676 bytes (726 KiB)
Tue Oct  1 00:00:00 UTC 2013
mount flash ok
mount log ok
mount flash2 ok
mount flash3 ok
root@(none):/# killall: crond: no process killed
Oct  1 00:00:03 crond[1204]: crond: crond (busybox 1.17.3) started, log level 8
Changing password for admin
Password for admin changed by root
Oct  1 00:00:10 crond[1438]: crond: crond (busybox 1.17.3) started, log level 8
language pack exists...
do language merge...
/tmp/wlan_conf_wlan1: line 32: can't create /sys/class/net/br0/brif/wlan1/bonjour: nonexistent directory
/tmp/wlan_conf_wlan9: line 32: can't create /sys/class/net/br0/brif/wlan9/bonjour: nonexistent directory

一回Enterを押すとプロンプトが表示される。

知ってる範囲の知識で情報をとりあえず取ってみる。

root@DBA-1510P:/# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 9984      9984         0 100% /
/dev/mtdblock8           16384       728     15656   4% /flash
/dev/mtdblock9            2048       472      1576  23% /var/log
/dev/mtdblock15           1024       472       552  46% /flash2
ubi0:fs0                 13532        28     12780   0% /flash3

busyboxのpsコマンドはオプションはwしか受け取らないらしい

root@DBA-1510P:/# ps aux ww
ps: invalid option -- a
BusyBox v1.17.3 (2015-04-10 10:05:45 CST) multi-call binary.

Usage: ps

Show list of processes

Options:
        w       Wide output

root@DBA-1510P:/# ps w
  PID USER       VSZ STAT COMMAND
    1 root      1320 S    init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW   [kworker/u:0]
    6 root         0 SW   [migration/0]
    7 root         0 SW   [migration/1]
    8 root         0 SW   [kworker/1:0]
    9 root         0 SW   [ksoftirqd/1]
   10 root         0 SW<  [khelper]
   11 root         0 SW   [kworker/u:1]
  163 root         0 SW   [sync_supers]
  165 root         0 SW   [bdi-default]
  167 root         0 SW<  [kblockd]
  180 root         0 SW   [khubd]
  269 root         0 SW<  [rpciod]
  270 root         0 SW   [kworker/0:1]
  288 root         0 SW   [kswapd0]
  289 root         0 SW   [fsnotify_mark]
  290 root         0 SW<  [aio]
  291 root         0 SW<  [nfsiod]
  293 root         0 SW<  [crypto]
  333 root         0 SW   [ocf_0]
  334 root         0 SW   [ocf_ret_0]
  335 root         0 SW   [ocf_1]
  336 root         0 SW   [ocf_ret_1]
  345 root         0 SW<  [cs75xx-spi]
  423 root         0 SW   [mtdblock0]
  428 root         0 SW   [mtdblock1]
  433 root         0 SW   [mtdblock2]
  438 root         0 SW   [mtdblock3]
  443 root         0 SW   [mtdblock4]
  448 root         0 SW   [mtdblock5]
  453 root         0 SW   [mtdblock6]
  458 root         0 SW   [mtdblock7]
  463 root         0 SW   [mtdblock8]
  468 root         0 SW   [mtdblock9]
  473 root         0 SW   [mtdblock10]
  478 root         0 SW   [mtdblock11]
  483 root         0 SW   [mtdblock12]
  488 root         0 SW   [mtdblock13]
  493 root         0 SW   [mtdblock14]
  498 root         0 SW   [mtdblock15]
  503 root         0 SW   [mtdblock16]
  546 root         0 SW   [kworker/1:1]
  691 root      1420 S    -/bin/sh
  936 root         0 SW   [ubi_bgt0d]
  945 root         0 SWN  [jffs2_gcd_mtd8]
  947 root         0 SWN  [jffs2_gcd_mtd9]
  949 root         0 SWN  [jffs2_gcd_mtd15]
  952 root         0 SW   [ubifs_bgt0_0]
 1035 root       564 S    resetd
 1038 root      2768 S    /sbin/wd -t 5 -T 60 -C 2 /dev/watchdog
 1041 root         0 SW   [wdt_thread0]
 1042 root         0 SW   [wdt_thread1]
 1044 root       556 S    wdfeeder -c 1 -t 5
 1046 root       556 S    wdfeeder -c 2 -t 5
 1053 root     21336 S    ncc2
 1054 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_1.pid -p 63001 -d /tmp/cap_www_1 -s SP_CAPTIVE
 1058 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_11.pid -p 63017 -E /tmp/key_file.pem -d /tmp/cap_www_1 -s SP_CAPTIVE
 1062 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_2.pid -p 63002 -d /tmp/cap_www_2 -s SP_CAPTIVE
 1064 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_22.pid -p 63018 -E /tmp/key_file.pem -d /tmp/cap_www_2 -s SP_CAPTIVE
 1068 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_3.pid -p 63003 -d /tmp/cap_www_3 -s SP_CAPTIVE
 1070 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_33.pid -p 63019 -E /tmp/key_file.pem -d /tmp/cap_www_3 -s SP_CAPTIVE
 1075 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_4.pid -p 63004 -d /tmp/cap_www_4 -s SP_CAPTIVE
 1078 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_44.pid -p 63020 -E /tmp/key_file.pem -d /tmp/cap_www_4 -s SP_CAPTIVE
 1082 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_5.pid -p 63005 -d /tmp/cap_www_5 -s SP_CAPTIVE
 1084 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_55.pid -p 63021 -E /tmp/key_file.pem -d /tmp/cap_www_5 -s SP_CAPTIVE
 1088 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_6.pid -p 63006 -d /tmp/cap_www_6 -s SP_CAPTIVE
 1091 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_66.pid -p 63022 -E /tmp/key_file.pem -d /tmp/cap_www_6 -s SP_CAPTIVE
 1096 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_7.pid -p 63007 -d /tmp/cap_www_7 -s SP_CAPTIVE
 1098 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_77.pid -p 63023 -E /tmp/key_file.pem -d /tmp/cap_www_7 -s SP_CAPTIVE
 1104 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_8.pid -p 63008 -d /tmp/cap_www_8 -s SP_CAPTIVE
 1106 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_88.pid -p 63024 -E /tmp/k
ey_file.pem -d /tmp/cap_www_8 -s SP_CAPTIVE
 1112 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_9.pid -p 63009 -d /tmp/cap_www_9 -s SP_CAPTIVE
 1114 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_99.pid -p 63025 -E /tmp/key_file.pem -d /tmp/cap_www_9 -s SP_CAPTIVE
 1120 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_10.pid -p 63010 -d /tmp/cap_www_10 -s SP_CAPTIVE
 1122 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1010.pid -p 63026 -E /tmp/key_file.pem -d /tmp/cap_www_10 -s SP_CAPT
 1128 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_11.pid -p 63011 -d /tmp/cap_www_11 -s SP_CAPTIVE
 1130 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1111.pid -p 63027 -E /tmp/key_file.pem -d /tmp/cap_www_11 -s SP_CAPT
 1134 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_12.pid -p 63012 -d /tmp/cap_www_12 -s SP_CAPTIVE
 1136 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1212.pid -p 63028 -E /tmp/key_file.pem -d /tmp/cap_www_12 -s SP_CAPT
 1142 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_13.pid -p 63013 -d /tmp/cap_www_13 -s SP_CAPTIVE
 1144 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1313.pid -p 63029 -E /tmp/key_file.pem -d /tmp/cap_www_13 -s SP_CAPT
 1150 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_14.pid -p 63014 -d /tmp/cap_www_14 -s SP_CAPTIVE
 1152 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1414.pid -p 63030 -E /tmp/key_file.pem -d /tmp/cap_www_14 -s SP_CAPT
 1158 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_15.pid -p 63015 -d /tmp/cap_www_15 -s SP_CAPTIVE
 1160 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1515.pid -p 63031 -E /tmp/key_file.pem -d /tmp/cap_www_15 -s SP_CAPT
 1164 root      2644 S    jjhttpd -m RUN_HTTP -P /var/run/cap_16.pid -p 63016 -d /tmp/cap_www_16 -s SP_CAPTIVE
 1166 root      2764 S    jjhttpd -m RUN_HTTPS -P /var/run/cap_1616.pid -p 63032 -E /tmp/key_file.pem -d /tmp/cap_www_16 -s SP_CAPT
 1199 root      1320 S    klogd
 1206 root      7008 S    acs
 1571 root         0 SW   [flush-mtd-unmap]
 1574 root         0 SW   [flush-ubifs_0_0]
 1581 root      1324 S    syslogd -L -s 16
 1873 root      1040 S    hostapd /tmp/wlan_conf_hostapd_wlan0 -B -P /var/hostapd_wlan0.pid
 1882 root      1040 S    hostapd /tmp/wlan_conf_hostapd_wlan1 -B -P /var/hostapd_wlan1.pid
 2128 root      1348 S    crond
 2168 root      1040 S    hostapd /tmp/wlan_conf_hostapd_wlan8 -B -P /var/hostapd_wlan8.pid
 2182 root      1040 S    hostapd /tmp/wlan_conf_hostapd_wlan9 -B -P /var/hostapd_wlan9.pid
 2200 root      1084 S    lanmapd2 br0 0
 2203 root       876 S    mDNSResponderPosix -f /var/tmp/mdns_br0.conf -b -P /var/run/mDNSResponder_br0.pid -v 2 -i br0 lo ipv6
 2206 root      2644 S    jjhttpd -m RUN_HTTP -d /www -P /var/run/jjhttpd_0.pid -p 80 -w /var/tmp/wa_www
 2209 root      2764 S    jjhttpd -m RUN_HTTPS -d /www -P /var/run/jjhttpd_1.pid -p 443 -E /var/tmp/key_file.pem -w /var/tmp/wa_www
 2257 root      1320 S    telnetd
 2262 root       820 S    dropbear -r /etc/rsa_key -w
 2346 root      1832 S    udhcpd /var/tmp/udhcpd-wlan1.conf
 2347 root      1832 S    udhcpd /var/tmp/udhcpd-wlan9.conf
 2351 root       636 S    dnsmasq -i wlan1,wlan9 -x /var/run/dnsmasq_wlan.pid --strict-order --all-server
 2377 root      4076 S    snmpd -c /var/tmp/snmpd.conf -p /var/run/snmpd.pid
 2883 root      1324 R    ps w
root@DBA-1510P:/# ls -la /dev | grep mtdblock
brw-r--r--    1 root     root       31,   0 Feb 10  2034 mtdblock0
brw-r--r--    1 root     root       31,   1 Feb 10  2034 mtdblock1
brw-r--r--    1 root     root       31,  10 Feb 10  2034 mtdblock10
brw-r--r--    1 root     root       31,  11 Feb 10  2034 mtdblock11
brw-r--r--    1 root     root       31,  12 Feb 10  2034 mtdblock12
brw-r--r--    1 root     root       31,  13 Feb 10  2034 mtdblock13
brw-r--r--    1 root     root       31,  14 Feb 10  2034 mtdblock14
brw-r--r--    1 root     root       31,  15 Feb 10  2034 mtdblock15
brw-r--r--    1 root     root       31,  16 Feb 10  2034 mtdblock16
brw-r--r--    1 root     root       31,   2 Feb 10  2034 mtdblock2
brw-r--r--    1 root     root       31,   3 Feb 10  2034 mtdblock3
brw-r--r--    1 root     root       31,   4 Feb 10  2034 mtdblock4
brw-r--r--    1 root     root       31,   5 Feb 10  2034 mtdblock5
brw-r--r--    1 root     root       31,   6 Feb 10  2034 mtdblock6
brw-r--r--    1 root     root       31,   7 Feb 10  2034 mtdblock7
brw-r--r--    1 root     root       31,   8 Feb 10  2034 mtdblock8
brw-r--r--    1 root     root       31,   9 Feb 10  2034 mtdblock9

ソフトまわり

OpenWrtがベースになってそう?

root@DBA-1510P:/etc# cat diag.sh
#!/bin/sh
# Copyright (C) 2006-2009 OpenWrt.org

set_state() { :; }
root@DBA-1510P:/etc# uname -a
Linux DBA-1510P 2.6.36 #5 SMP PREEMPT Wed May 6 17:40:31 CST 2015 armv7l GNU/Linux

ハードウェアアクセラレーションまわりをいい感じにできそうなスクリプトが入ってそう。活用できれば...

root@DBA-1510P:/etc/cs75xx/hw_accel/demo# ls
check_cs_wfo_mode.sh         set_ipsec_network.sh
cs_dp_mode_save              set_openswan_application.sh
cs_dp_mode_set               set_pppoe_client.sh
get_pci_dev.sh               set_wifi_network.sh
mode_id                      setup_cs_wfo_csme.sh
network.reset                setup_cs_wfo_mode.sh
network_pppoe.reset          start.sh
set_default_network.sh
root@DBA-1510P:/etc/cs75xx/hw_accel/demo# cat start.sh
#!/bin/sh
# Copyright (C) 2008-2010 OpenWrt.org
SCRIPT_DIR=/etc/cs75xx/hw_accel/demo

if [ ! -e $SCRIPT_DIR/mode_id ]; then
        echo "mode_id not exist, use default (-1)."
        echo -1 > $SCRIPT_DIR/mode_id
        chmod +x $SCRIPT_DIR/mode_id
fi

cnt=0
while read line
do
if [ "$line" != "" ]; then
value=$line
fi
cnt=$(($cnt+1))
done < $SCRIPT_DIR/mode_id

$SCRIPT_DIR/check_cs_wfo_mode.sh $value
SCRIPT_RET=$?
if [ "$SCRIPT_RET" == "1" ]; then
    echo "================================================================================"
    echo "ERROR: There is a mismatch between the mode id and the QM_INT_BUFF."
    fw_setenv QM_INT_BUFF 0
    echo "PKT_BUFF has been disabled for QM, please reboot."
    echo "If it still has problem after system reboot, please upgrade uboot and uboot_env."
    echo "================================================================================"
    exit 1
elif [ "$SCRIPT_RET" == "2" ]; then
    echo "================================================================================"
    echo "ERROR: There is a mismatch between the mode id and the QM_INT_BUFF."
    fw_setenv QM_INT_BUFF 256
    echo "PKT_BUFF has been enabled for QM, please reboot."
    echo "If it still has problem after system reboot, please upgrade uboot and uboot_env."
    echo "================================================================================"
    exit 1
fi

$SCRIPT_DIR/setup_cs_wfo_mode.sh $value

同じ階層に存在するsetup_cs_wfo_mode.shを覗くと、proc経由で何かを投げてるのは確認できる。

        echo 3 > /proc/driver/cs752x/ne/accel_manager/ipsec_offload_mode
        echo 0xf1ff > /proc/driver/cs752x/ne/accel_manager/hw_accel_enable

(一部抜粋)

hw_accel_enableへechoで投げてる値が条件によって変えられてるので、ビットごとになにか意味がありそう?