openwrt-realtekをとりあえず使う(RTL8196C)
2016年5月 7日(土) 23:17 JST
閲覧数 42,393
OpenWrt本家へのマージはされる事はほぼ無いだろうと思われるRTL8196CでのOpenWrt実装です。(Lexraコア廻りはいろいろと問題もあるので。。。)
僕がopenwrt-realtekを見つけた頃(数年前)はwww.nprove.netが存在したのですが、今は無くなって、archive.main.lvに情報が残されています。
RTL8196Cは、小型のルータで多く使われたチップである事からも、OpenWrt化を試行された方も多いと思います。
また、OpenWrt化できずに落胆された方も多いと思います。
openwrt-realtekを見つけた人は、残されている「Building OpenWRT for RTL8196C」という情報を元に試した方も居るかと思います。
ビルドが通らないじゃないかと止めた人も居ると思います。
既に古いチップなので、今更感もありますが、とりあえずビルドして起動する処までの方法を残しておきます。
archive.main.lvのサイトに残っている情報の手順そのままではビルドを通す事もできないので、数か所修正が必要になります。
修正箇所はパッチにしておきましたので、必要な方はどうぞ。
openwrt-realtek_r36713.patch
では、とりあえずビルドを通すだけの手順だけ(機種毎のGPIO廻りの修正とかは無しで)
(Ubuntu 14.04.4 LTS環境で確認取った手順になります。)
1. 開発環境追加
$ sudo apt-get install gcc binutils2. ソース一式取得
$ git clone git://git.advem.lv/openwrt-realtek.git $ cd ./openwrt-realtek/ $ git checkout remotes/origin/realtek3. コンフィグ
チップ構成とかは適宜合わせて下さい。
$ make menuconfig4. いろいろ修正
ダウンロードできないものとかが発生しているので、修正を入れます。
修正内容は以下に纏めています。
openwrt-realtek_r36713.patch
5. ビルド
V=sを付けてください。configで抜け落ちている箇所や、configがおかしい箇所がぽろぽろ存在し、オプション指定を聞かれてしまいます。(直すの面倒なので放置)
$ make V=s6. 焼き
焼くのに必要なのは、以下の2種類になります。
openwrt-realtek-~-kernel.bin
openwrt-realtek-~-squashfs.bin
焼く際のシリアル接続は、38400bpsがデフォルトで、tftpでファイルを転送できる様に準備しておきます。
ブートローダのコマンドモードへの移行は、ESCキーです。
端末は192.168.1.6以外の192.168.1.0/24のIPを振って下さい。
RTL8196Cのブートローダのコマンドモードに入った際、RTL8196C板が192.168.1.6でtftpを受け付ける状態で起動します。
tftpでsquashfs.bin、kernel.binの順に送り込めば勝手に書き込み再起動までしてくれます。
端末側からtftpで送り込んで下さい。
送り込んだ際のシリアル出力を張り付けておきます。
---RealTek(RTL8196C)at 2010.08.19-10:51+0800 version v1.1c [16bit](390MHz) sys checksum error at 00010000! no sys signature at 00020000! ---Escape booting by user Set 8196C PHY Patch OKnknown command ! **TFTP Client Upload, File Name: openwrt-realtek-rtl8196c-nprove-squashfs.bin - **TFTP Client Upload File Size = 301012 Bytes at 80500000 Success! Root filesystem upgrade. checksum Ok ! burn Addr =0x1b0000! srcAddr=0x80500010 len =0x301002 ............................................................................... ............................................................................... ............................................................................... Flash Write Successed! **TFTP Client Upload, File Name: openwrt-realtek-rtl8196c-nprove-kernel.bin \ **TFTP Client Upload File Size = 10E982 Bytes at 80500000 Success! Linux kernel upgrade. checksum Ok ! burn Addr =0x30000! srcAddr=0x80500000 len =0x10e982 ............................................................................... ............................................................................... ............................................................................... Flash Write Successed! reboot....... ---RealTek(RTL8196C)at 2010.08.19-10:51+0800 version v1.1c [16bit](390MHz) sys checksum error at 00010000! no sys signature at 00020000! Jump to image start=0x80500000... OpenWrt kernel loader for Realtek rtl819xx Copyright (C) 2011 Gabor Juhos Copyright (C) 2013 Roman Yeryomin Decompressing kernel to 80000000... done! Seems kernel_entry address is different from load address, so... Starting kernel from 80003530... [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.010000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.030000] Memory: 26212k/32768k available (2829k kernel code, 6556k reserved, 723k data, 100k init, 0k highmem) [ 0.040000] Calibrating delay loop... 389.12 BogoMIPS (lpj=1945600) [ 0.260000] Mount-cache hash table entries: 512 [ 1.270000] USB 2.0 PHY Patch Done. [ 1.310000] reg e0=99 [ 1.350000] reg e1=a8 [ 1.380000] reg e2=98 [ 1.420000] reg e3=c1 [ 1.460000] reg e4=1 [ 1.500000] reg e5=91 [ 1.530000] reg e6=98 [ 1.570000] reg e7=34 [ 1.610000] reg f0=fc [ 1.650000] reg f1=8c [ 1.680000] reg f2=0 [ 1.720000] reg f3=11 [ 1.760000] reg f4=e3 [ 1.800000] reg f5=d2 [ 1.830000] reg f6=0 [ 1.840000] net_namespace: 780 bytes [ 1.860000] NET: Registered protocol family 16 [ 1.910000] bio: create slab at 0 [ 1.920000] usbcore: registered new interface driver usbfs [ 1.930000] usbcore: registered new interface driver hub [ 1.940000] usbcore: registered new device driver usb [ 1.960000] NET: Registered protocol family 2 [ 1.970000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 1.980000] TCP established hash table entries: 1024 (order: 1, 8192 bytes) [ 1.990000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 2.000000] TCP: Hash tables configured (established 1024 bind 1024) [ 2.010000] TCP reno registered [ 2.020000] NET: Registered protocol family 1 [ 2.040000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 2.050000] Registering mini_fo version $Id$ [ 2.060000] JFFS2 version 2.2. (NAND) c 2001-2006 Red Hat, Inc. [ 2.070000] msgmni has been set to 51 [ 2.090000] io scheduler noop registered [ 2.100000] io scheduler cfq registered (default) [ 2.110000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled [ 2.120000] serial8250: ttyS0 at MMIO 0x18002000 (irq = 23) is a 16550A [ 2.140000] PPP generic driver version 2.4.2 [ 2.150000] PPP Deflate Compression module registered [ 2.160000] PPP BSD Compression module registered [ 2.170000] MPPE/MPPC encryption/compression module registered [ 2.190000] NET: Registered protocol family 24 [ 2.200000] tun: Universal TUN/TAP device driver, 1.6 [ 2.210000] tun: (C) 1999-2004 Max Krasnyansky [ 2.220000] Realtek WLAN driver - version 1.6 (2013-02-21) [ 2.230000] wlan_index:0 0, 134,0xb9000000,0xb8b10000,11 [ 2.240000] =====>>INSIDE rtl8192cd_init_one <<===== [ 2.250000] sizeof(struct rtl8192cd_priv) = 161152 [ 2.560000] 96C - 40MHz Clock Source [ 3.290000] vendor_deivce_id=819110ec [ 3.320000] =====>>EXIT rtl8192cd_init_one <<===== [ 3.330000] =====>>INSIDE rtl8192cd_init_one <<===== [ 3.340000] sizeof(struct rtl8192cd_priv) = 161152 [ 3.350000] =====>>EXIT rtl8192cd_init_one <<===== [ 3.360000] =====>>INSIDE rtl8192cd_init_one <<===== [ 3.370000] sizeof(struct rtl8192cd_priv) = 161152 [ 3.390000] =====>>EXIT rtl8192cd_init_one <<===== [ 3.400000] [ 3.400000] [ 3.400000] [ 3.400000] Probing RTL8186 10/100 NIC-kenel stack size order[3]... [ 3.410000] chip name: 8196C, chip revid: 0 [ 3.430000] Set 8196C PHY Patch OK [ 3.440000] NOT YET [ 3.460000] Set threshould idx 0 [ 3.480000] eth0 added. vid=9 Member port 0x1... [ 3.490000] eth1 added. vid=8 Member port 0x10... [ 3.500000] eth2 added. vid=9 Member port 0x2... [ 3.510000] eth3 added. vid=9 Member port 0x4... [ 3.530000] eth4 added. vid=9 Member port 0x8... [ 3.540000] eth5 added. vid=9 Member port 0x0... [ 3.560000] [peth0] added, mapping to [eth1]... [ 3.580000] SPI INIT [ 3.580000] ========================= Registed SPI Flash Model ========================= [ 3.590000] |No chipID Sft chipSize blkSize secSize pageSize sdCk opCk chipName | [ 3.600000] | 0 c22017h 0h 800000h 10000h 1000h 100h 50 0 MX6405D/05E/45E| [ 3.610000] ============================================================================ [ 3.620000] SPI flash(MX6405D/05E/45E) was found at CS0, size 0x800000 [ 3.630000] Creating 4 MTD partitions on "flash_bank_1": [ 3.640000] 0x000000000000-0x000000030000 : "boot+cfg" [ 3.650000] 0x000000030000-0x0000001b0000 : "kernel" [ 3.660000] 0x0000001b0000-0x000000800000 : "rootfs" [ 3.680000] mtd: partition "rootfs" set to be root filesystem [ 3.690000] mtd: partition "rootfs_data" created automatically, ofs=489000, len=377000 [ 3.700000] 0x000000489000-0x000000800000 : "rootfs_data" [ 3.710000] 0x000000030000-0x000000800000 : "firmware" [ 3.720000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 3.730000] rtl819x-ehci rtl819x-ehci: Realtek rtl819x On-Chip EHCI Host Controller [ 3.740000] rtl819x-ehci rtl819x-ehci: new USB bus registered, assigned bus number 1 [ 3.790000] rtl819x-ehci rtl819x-ehci: irq 10, io mem 0x18021000 [ 3.830000] rtl819x-ehci rtl819x-ehci: USB 2.0 started, EHCI 1.00 [ 3.840000] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 3.850000] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 3.860000] usb usb1: Product: Realtek rtl819x On-Chip EHCI Host Controller [ 3.870000] usb usb1: Manufacturer: Linux 2.6.30.9 ehci_hcd [ 3.880000] usb usb1: SerialNumber: rtl819x-ehci [ 3.890000] usb usb1: configuration #1 chosen from 1 choice [ 3.900000] hub 1-0:1.0: USB hub found [ 3.910000] hub 1-0:1.0: 1 port detected [ 3.920000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 3.930000] rtl819x-ohci rtl819x-ohci: Realtek rtl819x built-in OHCI controller [ 3.940000] rtl819x-ohci rtl819x-ohci: new USB bus registered, assigned bus number 2 [ 3.950000] rtl819x-ohci rtl819x-ohci: irq 10, io mem 0x18020000 [ 4.030000] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001 [ 4.040000] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 4.050000] usb usb2: Product: Realtek rtl819x built-in OHCI controller [ 4.060000] usb usb2: Manufacturer: Linux 2.6.30.9 ohci_hcd [ 4.070000] usb usb2: SerialNumber: rtl819x-ohci [ 4.080000] usb usb2: configuration #1 chosen from 1 choice [ 4.090000] hub 2-0:1.0: USB hub found [ 4.100000] hub 2-0:1.0: 1 port detected [ 4.110000] nf_conntrack version 0.5.0 (512 buckets, 2048 max) [ 4.120000] CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use [ 4.130000] nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or [ 4.140000] sysctl net.netfilter.nf_conntrack_acct=1 to enable it. [ 4.150000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 4.160000] TCP cubic registered [ 4.180000] NET: Registered protocol family 17 [ 4.190000] Netlink[Kernel] create socket for igmp ok. [ 4.200000] Realtek FastPath:v1.03 [ 4.230000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2. [ 4.240000] Freeing unused kernel memory: 100k freed [ 4.270000] Warning: unable to open an initial console. - preinit - Press the [f] key and hit [enter] to enter failsafe mode - regular preinit - jffs2 not ready yet; using ramdisk [ 11.790000] mini_fo: using base directory: / [ 11.800000] mini_fo: using storage directory: /tmp/root - init - Please press Enter to activate this console. [ 14.640000] NET: Registered protocol family 10 [ 14.650000] lo: Disabled Privacy Extensions [ 15.530000] SCSI subsystem initialized [ 16.640000] xt_time: kernel timezone is -0000 [ 16.900000] Driver 'sd' needs updating - please use bus_type methods [ 18.190000] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 19.230000] usbcore: registered new interface driver usblp [ 19.340000] usbcore: registered new interface driver usbserial [ 19.350000] usbserial: USB Serial Driver core [ 19.480000] Initializing USB Mass Storage driver... [ 19.490000] usbcore: registered new interface driver usb-storage [ 19.500000] USB Mass Storage support registered. [ 19.590000] USB Serial support registered for GSM modem (1-port) [ 19.600000] usbcore: registered new interface driver option [ 19.610000] option: v0.7.2:USB Driver for GSM modems [ 19.950000] u32 classifier [ 19.950000] Actions configured [ 20.050000] Mirror/redirect action on [ 33.480000] set_mode = IW_MODE_MASTER net_cfg=lan bridge name bridge id STP enabled interfaces vif=cfg033579 bridge=br-lan tree config_set cfg033579 bridge br-lan house start_net wlan0 lan CONFIG_APPEND='' CONFIG_LIST_STATE='' CONFIG_NUM_SECTIONS='2' CONFIG_SECTION='cfg033579' CONFIG_SECTIONS='wlan0 cfg033579' CONFIG_cfg02e48a_TYPE='system' CONFIG_cfg02e48a_hostname='OpenWrt' CONFIG_cfg02e48a_timezone='UTC' CONFIG_cfg033579_TYPE='wifi-iface' CONFIG_cfg033579_bridge='br-lan' CONFIG_cfg033579_device='wlan0' CONFIG_cfg033579_encryption='none' CONFIG_cfg033579_ifname='wlan0' CONFIG_cfg033579_mode='ap' CONFIG_cfg033579_network='lan' CONFIG_cfg033579_ssid='OpenWrt' CONFIG_ntp_TYPE='timeserver' CONFIG_ntp_enable_server='0' CONFIG_ntp_server='' CONFIG_ntp_server_ITEM1='0.openwrt.pool.ntp.org' CONFIG_ntp_server_ITEM2='1.openwrt.pool.ntp.org' CONFIG_ntp_server_ITEM3='2.openwrt.pool.ntp.org' CONFIG_ntp_server_ITEM4='3.openwrt.pool.ntp.org' CONFIG_ntp_server_LENGTH='' CONFIG_wlan0_TYPE='wifi-device' CONFIG_wlan0_channel='11' CONFIG_wlan0_ht_capab='' CONFIG_wlan0_htmode='HT40-' CONFIG_wlan0_macaddr='00:22:cf:a5:af:a5' CONFIG_wlan0_phy='wlan0' CONFIG_wlan0_type='realtek' CONFIG_wlan0_vifs='cfg033579 ' [ 38.620000] device eth0 entered promiscuous mode [ 38.640000] br-lan: port 1(eth0) entering learning state [ 38.720000] device eth2 entered promiscuous mode [ 38.730000] br-lan: port 2(eth2) entering learning state [ 38.830000] device eth3 entered promiscuous mode [ 38.840000] br-lan: port 3(eth3) entering learning state [ 38.870000] device eth4 entered promiscuous mode [ 38.880000] br-lan: port 4(eth4) entering learning state bridge name bridge id STP enabled interfaces br-lan 7fff.0022cfa5afa5 no eth0 eth2 eth3 eth4 [ 40.650000] br-lan: port 1(eth0) entering forwarding state [ 40.740000] br-lan: port 2(eth2) entering forwarding state [ 40.850000] br-lan: port 3(eth3) entering forwarding state [ 40.890000] br-lan: port 4(eth4) entering forwarding state [ 43.700000] rtl_net80211_setparam +++ [ 43.700000] rtl8192cd_net80211_ioctl, param = 13, value =0 [ 43.700000] rtl_net80211_setparam --- [ 43.720000] rtl_hapd_config +++ [ 43.720000] rtl_hapd_config --- [ 43.740000] rtl_net80211_setparam +++ [ 43.740000] rtl8192cd_net80211_ioctl, param = 9, value =0 [ 43.740000] rtl_net80211_setparam --- [ 43.760000] rtl_net80211_setparam +++ [ 43.760000] rtl8192cd_net80211_ioctl, param = 3, value =1 [ 43.760000] rtl_net80311_authmode +++ [ 43.760000] authtype=0, encmode=0, pskenable=0, dot11802_1x=0 [ 43.760000] rtl_net80211_setparam --- [ 43.780000] rtl_net80211_setparam +++ [ 43.780000] rtl8192cd_net80211_ioctl, param = 13, value =0 [ 43.780000] rtl_net80211_setparam --- [ 43.800000] [ 43.800000] Fail: interface not opened [ 43.820000] [ 43.820000] Fail: interface not opened [ 43.840000] [ 43.840000] Fail: interface not opened [ 43.860000] [ 43.860000] Fail: interface not opened [ 43.880000] rtl_net80211_setappiebuf +++ [ 43.880000] frametype =0, iebuflen=0 [ 43.880000] WSC: set beacon IE [ 43.880000] rtl_net80211_setappiebuf --- [ 43.910000] rtl_net80211_setappiebuf +++ [ 43.910000] frametype =2, iebuflen=0 [ 43.910000] WSC: set probe response IE [ 43.910000] rtl_net80211_setappiebuf --- [ 43.930000] Undefined state... using AP mode as default [ 43.950000] [PHY_ConfigMACWithParaFile][MACPHY_REG_92C] [ 43.950000] ===> Load_92C_Firmware [ 43.950000] <=== Load_92C_Firmware [ 43.950000] 0x55d = 0xff BusyBox v1.19.4 (2016-04-17 21:35:43 JST) built-in shell (ash) Enter 'help' for a list of built-in commands. _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- BARRIER BREAKER (Bleeding Edge, r36713) ----------------------------------------------------- * 1/2 oz Galliano Pour all ingredients into * 4 oz cold Coffee an irish coffee mug filled * 1 1/2 oz Dark Rum with crushed ice. Stir. * 2 tsp. Creme de Cacao ----------------------------------------------------- root@OpenWrt:/#