大破雑記帳

個人用メモな雑記ブログ いろんなことをざっくりと。

ApresiaLightGS120GT-SS

例によってRTL83xx系SoCを搭載するスイッチングハブを様々なメーカーで調べた際に見つけたもの。APRESIA SystemsのApresiaLightGSシリーズは全モデル通してファームウェアが共通である為、この記事の120以外も全て同様にRealtek SoCを搭載していると思われる。
弄っていくのでメモ。

U-Boot

  • help

      APLGS120GTSS # help
      ?       - alias for 'help'
      base    - print or set address offset
      bootm   - boot application image from memory
      bootp   - boot image via network using BOOTP/TFTP protocol
      cmp     - memory compare
      cp      - memory copy
      crc32   - checksum calculation
      dhcp    - boot image via network using DHCP/TFTP protocol
      env     - environment handling commands
      erase   - erase FLASH memory
      flinfo  - print FLASH memory information
      go      - start application at address 'addr'
      help    - print command description/usage
      iminfo  - print header information for application image
      loadb   - load binary file over serial line (kermit mode)
      loady   - load binary file over serial line (ymodem mode)
      loop    - infinite loop on address range
      md      - memory display
      mdram_test- mdram_test   - do DRAM test.
      mflash_test- mflash_test   - do flash test.
      mm      - memory modify (auto-incrementing address)
      mtest   - simple RAM read/write test
      mw      - memory write (fill)
      nm      - memory modify (constant address)
      ping    - send ICMP ECHO_REQUEST to network host
      printenv- print environment variables
      printenv2- print environment variables
      protect - enable or disable FLASH write protection
      reset   - Perform RESET of the CPU
      rtk     - rtk     - Realtek commands
    
      run     - run commands in an environment variable
      saveenv - save environment variables to persistent storage
      saveenv2- save environment variables to persistent storage
      setenv  - set environment variables
      setenv2 - set environment variables
      sf      - SPI flash sub-system
      sleep   - delay execution for some time
      tftpboot- boot image via network using TFTP protocol
      version - print monitor, compiler and linker version
    
  • version

      APLGS120GTSS # version
    
      U-Boot 2011.12.(2.1.5.67086)-Candidate1 (Apr 21 2020 - 16:39:05)
      1.00.013
      mips-linux-gcc (GCC) 3.4.4 mipssde-6.03.00-20051020
      GNU ld (Linux/GNU Binutils) 2.18.50.0.1.20070908
    
  • printenv

      APLGS120GTSS # printenv
      Board_Id=602131615488
      Board_Version=4
      Boot_Version=1.00.013
      Serial_Number=************
      addargs=setenv bootargs console=$(console_device),$(baudrate) mem=$(memsize) noinitrd root=$(image) rw rootfstype=squashfs
      baudrate=115200
      boardmodel=RTL8382M_8218B_INTPHY_8214FC_DEMO
      boardversion=V1.0R
      bootcmd=bootm 0xb4100000
      bootdelay=2
      console_device=ttyS0
      ethact=rtl8380#0
      ethaddr=FC:6D:D1:xx:xx:EA
      gatewayip=192.168.10.254
      hw_version=A1
      image=/dev/mtdblock4
      ipaddr=192.168.10.200
      memsize=254M
      netmask=255.255.255.0
      serverip=192.168.10.20
      stderr=serial
      stdin=serial
      stdout=serial
    
      Environment size: 619/262140 bytes
    
  • printenv2

      APLGS120GTSS # printenv2
      Image_Id=1
    
      Environment size: 14/262140 bytes
    
  • help rtk

      APLGS120GTSS # help rtk
      rtk - rtk     - Realtek commands
    
      Usage:
      rtk object action
      - SOC commands.
      rtk network on
      - Enable the networking function
      rtk netowkr off
      - Disable the networking function
      rtk testmode [mode] [port]
      - Set default value for specific testing
      rtk ext-pinGet [pinNum]
      - get external 8231 GPIO pin status
      rtk ext-pinSet [pinNum] [status]
      - set external 8231 GPIO pin status
      rtk smi list
      - list all smi group
      rtk smi init [group_id] [sck_pin] [sda_pin] [8/16 access type] [chipid] [delay] [name]
      - create a smi group and init
      rtk smi read [group_id] [reg]
      rtk smi write [group_id] [reg] [data]
      rtk pinGet [pinNum]
      - get internal GPIO pin status
      rtk pinSet [pinNum] [status]
      - set internal GPIO pin status
      rtk ledtest [port] [led_index]
      - led test
      rtk ledtest-bank [round]
      - led back on/off test
      rtk loopback ext [port-start] [port-end] [round]
      - port traffic external loopback test
      rtk loopback int [port-start] [port-end] [round]
      - port traffic internal loopback test
      rtk txportpkt [port-id] [round]
      - tx packet from CPU to specific port test
      rtk ldps [port] [ on | off ]
      - Enable/Disable link-down power saving (LDPS) of PHY
      rtk green [port] [ on | off ]
      - Enable/Disable green feature of PHY
      rtk cross-over [port] [ auto | mdi | mdix ]
      - Configure cross-over mode as Auto, Force-MDI, or Force-MDIX of PHY.
    
  • rtk smi list

      APLGS120GTSS # rtk smi list
    
      Index SCK_DEV SCK_PIN SDA_DEV SDA_PIN TYPE   ID   Delay Name
      =================================================================
    
  • tftpboot

      APLGS120GTSS # tftpboot
      *** Warning: no boot file name; using 'C80AA8C0.img'
      Using rtl8380#0 device
      TFTP from server 192.168.10.20; our IP address is 192.168.10.200
      Filename 'C80AA8C0.img'.
      Load address: 0xb4100000
      Loading: *
    

Kernel

  • bootlog

    
      U-Boot 2011.12.(2.1.5.67086)-Candidate1 (Apr 21 2020 - 16:39:05)
      1.00.013
    
      Board: RTL838x CPU:500MHz LXB:200MHz MEM:300MHz
      DRAM:  256 MB
      SPI-F: 1x32 MB
      Loading 262144B env. variables from offset 0x80000
      Magic ID = 00004001 Board ID = 00000001
      Switch Model: RTL8382M_8218B_INTPHY_8214FC_DEMO (Port Count: 20)
      Switch Chip: RTL8382
      **************************************************
      #### RTL8218B config - MAC ID = 0 ####
      Now External 8218B
      **************************************************
      #### RTL8218B config - MAC ID = 8 ####
      Now Internal PHY
      **************************************************
      **** RTL8214FC config - MAC ID = 24 ****
      Now External 8214FC
      Net:   Net Initialization Skipped
      rtl8380#0
      Hit Esc key to stop autoboot:  0
      Verifying Checksum for Image 1 ...
      BOOT:...OK
      OS:...OK
      FS:...OK
    
      Loading Runtime Image ...
      ## Booting kernel from Legacy Image at b4100000 ...
      Image Name:
      Created:      2020-04-21  16:38:46 UTC
      Image Type:   MIPS Linux Kernel Image (gzip compressed)
      Data Size:    936172 Bytes = 914.2 KB
      Load Address: 80000000
      Entry Point:  80224000
      Verifying Checksum ... OK
      Force port28 link down
    
      Uncompressing Kernel Image ... OK
    
      Starting kernel ...
    
      Linux version 2.6.19 (lemon@SW3) (gcc version 3.4.4 mipssde-6.03.00-20051020) #6 PREEMPT Tue Apr 21 16:38:45 CST 2020
      CPU revision is: 00019070
      Determined physical RAM map:
      memory: 07e00000 @ 00000000 (usable)
      User-defined physical RAM map:
      memory: 0fe00000 @ 00000000 (usable)
      Built 1 zonelists.  Total pages: 64516
      Kernel command line: console=ttyS0,115200 mem=254M noinitrd root=/dev/mtdblock4 rw rootfstype=squashfs imgid=1 failover=0 csb=0x014EDB69 cso=0x0795D885
      csf=0x5A4A8562 ethaddr=FC:6D:D1:08:56:EA magicid=0x00004001
      Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
      Primary data cache 16kB, 2-way, linesize 16 bytes.
      Synthesized TLB refill handler (20 instructions).
      Synthesized TLB load handler fastpath (32 instructions).
      Synthesized TLB store handler fastpath (32 instructions).
      Synthesized TLB modify handler fastpath (31 instructions).
      PID hash table entries: 1024 (order: 10, 4096 bytes)
      Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
      Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
      Memory: 255360k/260096k available (1793k kernel code, 4628k reserved, 394k data, 104k init, 0k highmem)
      Mount-cache hash table entries: 512
      Checking for 'wait' instruction...  available.
      NET: Registered protocol family 16
      NET: Registered protocol family 2
      IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
      TCP established hash table entries: 8192 (order: 3, 32768 bytes)
      TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
      TCP: Hash tables configured (established 8192 bind 4096)
      TCP reno registered
      squashfs: version 3.3 (2007/10/31) Phillip Lougher
      JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
      io scheduler noop registered
      io scheduler anticipatory registered
      io scheduler deadline registered
      io scheduler cfq registered (default)
      Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled
      serial8250: ttyS0 at MMIO 0x0 (irq = 31) is a 16550A
      Probe: SPI CS1 Flash Type MX25L25635F
      Creating 8 MTD partitions on "Total SPI FLASH":
      0x00000000-0x00080000 : "BOOT"
      0x00080000-0x000c0000 : "BDINFO"
      0x000c0000-0x00100000 : "BDINFO2"
      0x00100000-0x00280000 : "KERNEL1"
      0x00280000-0x00f80000 : "ROOTFS1"
      0x00f80000-0x01100000 : "KERNEL2"
      0x01100000-0x01e00000 : "ROOTFS2"
      0x01e00000-0x02000000 : "JFFS2"
      cdd_crash load
      memmap_pid load
      Init CAMEO Debug Trace Driver Module....OK
      TCP cubic registered
      NET: Registered protocol family 1
      NET: Registered protocol family 17
      VFS: Mounted root (squashfs filesystem) readonly.
      Freeing unused kernel memory: 104k freed
      init started:  BusyBox v1.00 (2020.04.09-03:38+0000) multi-call binary
      Starting pid 14, console : '/etc/rc'
      Init RTCORE Driver Module....OK
      route: not found
      SIOCSIFADDR: No such device
      Magic ID: 0x00004001
      ------------------------------------------------------------
      Dynamic data initialization:
      Model id: 1 Model Name: APLGS120GTSS
      MaxDevicePort: 20 MaxTrunk: 8
      Combo Port Layout dynamic data: u2PortNum: 4 u2PortStart: 17
      Fiber Port Layout dynamic data: u2PortNum: 0 u2PortStart: 128
      ------------------------------------------------------------
    
      MAC Address : FC-6D-D1-xx-xx-EA
      RTK.0> H/W Version : A1
    
      Smart Management Switch
    
      APLGS120GTSS login: