ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/docs/marvell/hardware/pxa1826_dkb_a.pdf b/docs/marvell/hardware/pxa1826_dkb_a.pdf
new file mode 100644
index 0000000..7d58ea5
--- /dev/null
+++ b/docs/marvell/hardware/pxa1826_dkb_a.pdf
Binary files differ
diff --git a/docs/marvell/hardware/pxa1826_dkb_b.pdf b/docs/marvell/hardware/pxa1826_dkb_b.pdf
new file mode 100644
index 0000000..278ce71
--- /dev/null
+++ b/docs/marvell/hardware/pxa1826_dkb_b.pdf
Binary files differ
diff --git a/docs/marvell/hardware/pxa1826_saar_n.pdf b/docs/marvell/hardware/pxa1826_saar_n.pdf
new file mode 100644
index 0000000..6b9e64a
--- /dev/null
+++ b/docs/marvell/hardware/pxa1826_saar_n.pdf
Binary files differ
diff --git a/docs/marvell/howto/add_new_profile.txt b/docs/marvell/howto/add_new_profile.txt
new file mode 100644
index 0000000..dff67fe
--- /dev/null
+++ b/docs/marvell/howto/add_new_profile.txt
@@ -0,0 +1,97 @@
+How to add new profile for a subtarget
+========================================
+There are serveral subtargets in the target/linux/mmp (pxa1826, asr1802s, asr1803...).
+Here we take 1826 (i.e. Nezha3) as a sample, others are similar.
+
+Basically a new profile is created for a new hardware board or a new product model.
+
+Steps needed:
+----------------------------------------------------------------------------
+1. Add a new profile entry in: "target/linux/mmp/pxa1826/profiles/marvell.mk"
+ For example:
+
+ "define Profile/NEZHA305
+ NAME:=NEZHA3-DKB Type A with Nand Flash
+ endef
+ $(eval $(call Profile,NEZHA305))
+ $(eval $(call Model,NEZHA305,pxa1826p305))
+ "
+
+ where NEZHA305 is your <profile_name>
+
+2. Create a defconfig file in "config/" with desired configuration.
+ Meanwhile, create specific obm and uboot codes.
+
+ The typical steps are
+ ~$ make distclean
+ ~$ ./scripts/feeds update -a
+ ~$ ./scripts/feeds install -a
+ ~$ vi package/boot/obm-mmp/Makefile //need to add profile specific obm
+ ~$ <add specific obm code and build instruction in Loader/Platforms/NZA3/DKB/make_loader_NZA3_LINUX.sh when necessary>
+ ~$ vi package/boot/uboot-mmp/Makefile //need to add profile specific board type in uboot if a new one used here
+ ~$ <add specific uboot code in uboot/board/Marvell/ and uboot/include/configs, also update board config in marvell/uboot/boards.cfg>
+ ~$ cp config/defconfig_pxa1826 .config
+ ~$ make menuconfig // choose the proper profile, bootloaders, pakcages,etc. then exit and save
+ ~$ cp .config config/defconfig_<ARCH_PROFILE>
+
+
+3. In "target/linux/mmp/image/Makefile":
+ Add new line: Image/BuildKernel/Profile/<profile_name>=$(call Image/Build/DTB,<dts_filename>)
+
+ and put it in:
+ "ifeq ($(CONFIG_TARGET_mmp_pxa1826),y)
+ Image/BuildKernel/Profile/NEZHA301=$(call Image/Build/DTB,pxa1826-dkb)
+ ... ...
+ Image/BuildKernel/Profile/NEZHA305=$(call Image/Build/DTB,pxa1826-p305)
+ Image/BuildKernel/Profile/<profile_name>=$(call Image/Build/DTB,<dts_filename>)
+ endif"
+
+4. In "rules.mk"
+ Add:
+ "ifeq ($(CONFIG_TARGET_mmp_pxa1826_<profile_name>),y)
+ export ARCH_PROFILE:=<profile_bin_dir_name>
+ export KERNEL_CONFIG_FILE_NAME_APPENDIX:=
+ #you can insert here any profile specific variables and use it in the openwrt makefiles
+ endif"
+
+5. Add dts file for the board.
+
+ Create <dts_filename>.dts and put in /marvell/linux/arch/arm/boot/dts.
+
+ Next, in arch/arm/boot/dts/Makefile, add "<dts_filename>.dtb" to create dtb file:
+
+ "dtb-$(CONFIG_CPU_PXA1826) += pxa1826-dkb.dtb \
+ <dts_filename>.dtb"
+
+6. Create the BLF files for under swd/NZA3/ for software download and OTA upgrade
+
+
+7. Create profile sepcific setting files and telephony images at locations below,
+
+ ~$ package/network/services/lte-telephony/files/nvm/<ARCH_PROFILE> //add fixed NV setting files, can't upgrade via OTA
+ ~$ package/network/services/lte-telephony/files/tel-<if>.config //add telephony config file and update its Makefile
+ ~$ <target/linux/mmp/files/mrd/> //add changeable NV setting files, which can be upgraded via OTA
+ ~$ <target/linux/mmp/pxa1826/oem_fs/> //OEM can also put upgradeable NV settings files here if there is OEM partition
+ ~$ <marvell/lte-telephony/cp/> //add new CP images if required
+
+8. build the profile images and fix any error during the building process
+
+==============================================================================================
+Additonal steps (optional):
+
+1. If you want to be able to identify your board from the console (e.g. TeraTerm),
+ Then, in file: "target/linux/mmp/base-files/lib/mmp.sh"
+ Function: mmp_board_detect()
+ You need to add a case for your board (profile).
+==============================================================================================
+Note:
+ On v2102 branch, the proman.sh script can help on
+ the step 1 to 4 above(i.e. only cover top repo changes) use existing profile as template,
+
+ Syntax: ./scripts/proman.sh add <template_profile> <chip> <name> <code>
+
+ e.g., ./scripts/proman.sh add asr1803p401 asr1828 KAGU 801
+
+ Affected files: rules.mk target/linux/mmp/Makefile target/linux/mmp/$CHIP config/defconfig_${CHIP}p$CODE
+
+ Limitations: obm-mmp, uboot-mmp and telephony packages need manual update.
diff --git a/docs/marvell/howto/asr1803_selinux_policy.pdf b/docs/marvell/howto/asr1803_selinux_policy.pdf
new file mode 100755
index 0000000..de353c3
--- /dev/null
+++ b/docs/marvell/howto/asr1803_selinux_policy.pdf
Binary files differ
diff --git a/docs/marvell/howto/creating_packages.pdf b/docs/marvell/howto/creating_packages.pdf
new file mode 100644
index 0000000..644c2c4
--- /dev/null
+++ b/docs/marvell/howto/creating_packages.pdf
Binary files differ
diff --git a/docs/marvell/howto/data_path_nat46.txt b/docs/marvell/howto/data_path_nat46.txt
new file mode 100644
index 0000000..9053beb
--- /dev/null
+++ b/docs/marvell/howto/data_path_nat46.txt
@@ -0,0 +1,141 @@
+How to config the NAT46 in datapath to use the XLAT(CLAT)
+========================================
+Here we take 1802s (i.e. NezhaS) as example, 1826 (i.e. Nezha3) is similar.
+The host PC system tested in this paper is Ubuntu 5.4.0-6Ubuntu 1~16.04.12.
+
+1, PIPE mode
+1) make kernel_menuconfig and select "DATA_PATH_NAT46" and save your new configuration.
+And then rebuild:make -j8 V=99
+
+2) Disable IPv6 in Ubuntu
+ "echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf"
+ "sysctl -p"
+
+3) Redial using IPv6
+ "serial_client"
+ "AT+ZGDCONT=1,IPV6,GPRS"
+ "AT+ZGACT=1,1"
+ After this operation, you will not be able to access the IPv4 service and ping IPv4 will fail on the host side.
+
+4) NAT46 Configuration
+ First query the IPv6 global address and local IPv4 address of ccinet, use "cat /sys/kernel/mpipe/devices/all"
+ you will get some information like this:
+ device state type refcnt IP IPv6
+ lo Down pipe 2 0.0.0.0 ::/0
+ embms0 Down pipe 2 0.0.0.0 ::/0
+ ccinet0 Up4/6 pipe 2 10.180.250.252 240e:9a:83e:4a98::/64
+ ccinet1 Down pipe 2 0.0.0.0 ::/0
+ ccinet2 Down pipe 2 0.0.0.0 ::/0
+ ccinet3 Down pipe 2 0.0.0.0 ::/0
+ ccinet4 Down pipe 2 0.0.0.0 ::/0
+ ccinet5 Down pipe 2 0.0.0.0 ::/0
+ ccinet6 Down pipe 2 0.0.0.0 ::/0
+ ccinet7 Down pipe 2 0.0.0.0 ::/0
+ ip6tnl0 Down pipe 2 0.0.0.0 ::/0
+ tunl0 Down pipe 2 0.0.0.0 ::/0
+ usbnet0 Up4/6 lan 3 192.168.1.1 ::/0
+
+ "10.180.250.252" will serve as the IPv4 address of host and the local IPv4 address in NAT46,
+ and "240e:9a:83e:4a98::" will serve as the local IPv6 address in NAT46.
+ The detailed configuration is as follows:
+ "echo add nat46 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 local.v4 10.180.250.252/32 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 local.v6 240e:9a:83e:4a98::1/64 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 local.style RFC6052 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ 32 indicates the mask length of the local IPv4 address, 64 indicates the prefix length of an IPv6 address.
+
+ if the remote IPv6 server(PLAT) is "240e:eb:8001:e05::/96",
+ "echo config nat46 remote.v6 240e:eb:8001:e05::/96 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 remote.style RFC6052 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+
+ the command "echo 1 > /sys/kernel/debug/tel/psd/data-pathv1/bypass_nat46" can be used to terminate the NAT46 translate.
+
+5) Host Configuration
+ "ifconfig enp0s26u1u1 10.180.250.252 netmask 255.255.255.0 up"
+ "route add default gw 10.180.250.3"
+
+6) Test
+ When use "echo 1 > /sys/kernel/debug/tel/psd/data-pathv1/bypass_nat46" to terminate the NAT46 translate,
+ ping the IPv4 server on the host side will fails.
+ When use "echo 0 > /sys/kernel/debug/tel/psd/data-pathv1/bypass_nat46" to enable the NAT46 translate,
+ ping the IPv4 server on the host side will success.
+
+----------------------------------------
+
+2, MIFI mode
+1) make kernel_menuconfig and select "DATA_PATH_NAT46" and save your new configuration.
+And then rebuild:make -j8 V=99
+
+2) Disable IPv6 in Ubuntu
+ "echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf"
+ "sysctl -p"
+
+3) Redial using IPv6
+ "serial_client"
+ "AT+ZGDCONT=1,IPV6,GPRS"
+ "AT+ZGACT=1,1"
+ After this operation, you will not be able to access the IPv4 service and failed to ping IPv4 on the host or 1802s,
+ but you can successfully ping the IPv6 server on 1802s.
+
+4) NAT46 Configuration
+ Use "ifconfig" to query the IPv6 global address and local IPv4 address of ccinet,
+ you will get some information like this:
+ br-lan Link encap:Ethernet HWaddr 02:C0:84:B0:2A:99
+ inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
+ inet6 addr: 240e:9a:8c9:f13d::1/64 Scope:Global
+ inet6 addr: fe80::c0:84ff:feb0:2a99/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:29 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:0
+ RX bytes:3296 (3.2 KiB) TX bytes:6411 (6.2 KiB)
+
+ ccinet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
+ inet addr:10.164.56.133 Mask:255.255.255.255
+ inet6 addr: fe80::1/64 Scope:Link
+ inet6 addr: 240e:9a:8c9:f13d::1/64 Scope:Global
+ UP RUNNING NOARP MTU:1500 Metric:1
+ RX packets:28 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:2848 (2.7 KiB) TX bytes:3136 (3.0 KiB)
+
+ lo Link encap:Local Loopback
+ inet addr:127.0.0.1 Mask:255.0.0.0
+ inet6 addr: ::1/128 Scope:Host
+ UP LOOPBACK RUNNING MTU:65536 Metric:1
+ RX packets:142 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:0
+ RX bytes:7480 (7.3 KiB) TX bytes:7480 (7.3 KiB)
+
+ usbnet0 Link encap:Ethernet HWaddr 02:C0:84:B0:2A:99
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:34 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:3436 (3.3 KiB) TX bytes:12027 (11.7 KiB)
+
+ "10.164.56.133" will serve as the local IPv4 address in NAT46, and "240e:9a:8c9:f13d::1" will serve as the local IPv6 address in NAT46.
+ The detailed configuration is as follows:
+ "echo add nat46 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 local.v4 10.164.56.133/32 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 local.v6 240e:9a:8c9:f13d::1/64 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 local.style RFC6052 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ 32 indicates the mask length of the local IPv4 address, 64 indicates the prefix length of an IPv6 address.
+
+ if the remote IPv6 server is "240e:eb:8001:e05::/96",
+ "echo config nat46 remote.v6 240e:eb:8001:e05::/96 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+ "echo config nat46 remote.style RFC6052 | tee /sys/kernel/debug/tel/psd/data-pathv1/nat46_control"
+
+ the command "echo 1 > /sys/kernel/debug/tel/psd/data-pathv1/bypass_nat46" can be used to terminate the NAT46 translate.
+
+5) Host Configuration
+ "dhclient enp0s26u1u1"
+ "route add default gw 192.168.1.1"
+
+6) Test
+ When we use "echo 1 > /sys/kernel/debug/tel/psd/data-pathv1/bypass_nat46" to terminate the NAT46 translate,
+ ping the IPv4 server on the host side will fails.
+ When we use "echo 0 > /sys/kernel/debug/tel/psd/data-pathv1/bypass_nat46" to enable the NAT46 translate,
+ ping the IPv4 server on the host side will success.
diff --git a/docs/marvell/howto/dual_apn.txt b/docs/marvell/howto/dual_apn.txt
new file mode 100644
index 0000000..161cb00
--- /dev/null
+++ b/docs/marvell/howto/dual_apn.txt
@@ -0,0 +1,92 @@
+How to create a dual APN and use the second APN to access the outer network
+========================================
+Here we take 1802s (i.e. NezhaS) as example, 1826 (i.e. Nezha3) is similar.
+
+1, Create a dual APN
+
+In the openwrt top dir,
+1) Modify the following contents in “target/Linux/MMP/asr1802s/config-3.10”
+ CONFIG_USB_ETH_RNDIS_ECM=y
+
+2) Modify the following contents in “target/linux/mmp/asr1802s/NEZAS201/base-files/etc/init.d/usb_init”
+ echo rndis,acm,marvell_diag,adb,ecm > /sys/class/android_usb/android0/functions
+ echo rndis,acm,marvell_diag,adb,ecm > /sys/class/android_usb/android0/win7
+ echo rndis,acm,marvell_diag,adb,ecm > /sys/class/android_usb/android0/win8
+ echo rndis,acm,marvell_diag,adb,ecm > /sys/class/android_usb/android0/olinux
+
+3) Modify the following contents in “package/network/config/firewall/Makefile”
+ DUAL_APN_FLAG=1
+
+4) Choose the profile config
+ make defconfig_asr1802sp201
+and build
+ make -j8 V=99
+
+5) Use SWDownloader to burn all bin files into the board
+
+6) Switch to pipe mode by AT command and reboot
+ AT+ACONFIG="PIPE=1"
+
+7) Use the AT command to dial-up Internet
+ AT+CGDCONT=2,"IP","cmwap"
+ AT+CGACT=1,2
+and query the IP of CMWAP
+ AT+CGDCONT?
+for example, you might get something like this:
++CGDCONT: 1,"IP","cmnet.mnc007.mcc460.gprs","10.36.148.238",0,0,,,,
+
++CGDCONT: 2,"IP","cmwap.mnc007.mcc460.gprs","100.74.21.147",0,0,0,2,0,0
+
+8) Configure the network
+ ifconfig ccinet1 100.74.21.147 netmask 255.255.255.0 up
+
+9) Test whether ccinet1 can ping the external network
+ ping -I ccinet1 8.8.8.8
+
+
+2, Access the external network through the lan
+
+1) Configure the Intranet network
+Connect the usb to your PC, You can see two new network adapters by "ifconfig" command,
+which corresponding to the virtual network cards usbnet0 and usbnet1 on 1802s. For example:
+
+ enp0s26u1u1 Link encap:Ethernet HWaddr 06:83:32:53:f7:0b
+ inet addr:10.36.148.238 Bcast:10.36.148.255 Mask:255.255.255.0
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:16 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:1823 (1.8 KB) TX bytes:8933 (8.9 KB)
+
+ enp0s26u1u1i6 Link encap:Ethernet HWaddr 26:b9:7a:b6:be:4a
+ UP BROADCAST MULTICAST MTU:1500 Metric:1
+ RX packets:0 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
+
+We need to configure the adapters enp0s26u1u1i6 and usbnet1 in the same small segment.
+OpenWrt:
+ ifconfig usbnet1 192.168.20.1 netmask 255.255.255.0 up
+Linux PC:
+ ifconfig enp0s26u1u1i6 192.168.20.100 netmask 255.255.255.0 up
+
+2) Configure the Router
+OpenWrt:
+ route add default gw 100.74.21.147 (the IP address of ccinet1)
+Linux PC:
+ route add default gw 192.168.20.1
+
+3) Configure the firewall
+Linux PC:
+ iptables -F
+ iptables -X
+ iptables -Z
+ iptables -A INPUT -j ACCEPT
+ iptables -A FORWARD -j ACCEPT
+ iptables -A OUTPUT -j ACCEPT
+
+4) Test whether enp0s26u1u1i6 can ping the external network
+Linux PC:
+ ping -I enp0s26u1u1i6 8.8.8.8
+
diff --git a/docs/marvell/howto/kagu-dual-pcie.txt b/docs/marvell/howto/kagu-dual-pcie.txt
new file mode 100644
index 0000000..f925860
--- /dev/null
+++ b/docs/marvell/howto/kagu-dual-pcie.txt
@@ -0,0 +1,22 @@
+How to use dual PCIe on ASR1826S(Kagu)
+========================================
+Dual PCIE wifi use RTL8812FR and RTL8192FR
+RTL8812FR and RTL8192FR share the same driver code. package/kernel/realtek-wl/rtl8192fr/src/rtl8192cd_driver/
+
+ASR1826s dual pcie use drivers/pci/host/pcie-kagu.c as pcie driver, and drivers/misc/pcie_dual_rfkill.c as pcie rfkill driver.
+And dual Pcie couldn't support suspend/resume. need to disable "echo mem > /sys/power/state"
+
+ASR1826s single PCIE share driver/pci/host/pcie-falcon.c with ASR1803/ASR1803E, and share drivers/misc/pcie8x_rfkill.c with ASR1803
+RTL8812FR and RTL8192FR only support wext mode.
+
+1. prepare kernel
+ copy marvell/linux/arch/arm/boot/dts/asr1826s-2pcie.dtsi to replease asr1826s.dtsi
+ copy asr1826s-p801-2pcie.dts to replease asr1826s-p801.dts
+2. prepare kernel config
+ copy target/linux/mmp/asr1826s/config-3.10-2pcie to replease target/linux/mmp/asr1826s/config-3.10
+
+3. menuconfig.
+ make defconfig_asr1826sp801_2pcie
+
+
+
diff --git a/docs/marvell/howto/repo_layout.png b/docs/marvell/howto/repo_layout.png
new file mode 100644
index 0000000..0efcffd
--- /dev/null
+++ b/docs/marvell/howto/repo_layout.png
Binary files differ
diff --git a/docs/marvell/howto/save_build_log.txt b/docs/marvell/howto/save_build_log.txt
new file mode 100644
index 0000000..bd542a1
--- /dev/null
+++ b/docs/marvell/howto/save_build_log.txt
@@ -0,0 +1,44 @@
+Logging Everything of make process
+
+The console's scrollback buffer will often prove to be too small to keep the full output of the package build process.
+
+There are moments you want to enable logging of the build process so that you can comfortably search(grep) through the logfiles
+when there appears to be a problem with building process
+
+The command looks like this:
+
+ make -j2 V=99 2>&1 | tee build.log
+
+0 is stdin. 1 is stdout. 2 is stderr
+
+There's one way to remember this construct (maybe it is not entirely accurate):
+ -------------
+ First of all, 2>1 looks like a very good way to redirect stderr to stdout. but remember,
+it has a very harmful disadvantage: it may actually be interpreted as "redirect stderr to a file named 1".
+ -------------
+ & indicates that what follows is a file descriptor and not a filename. So the construct becomes: 2>&1.
+ -------------
+ >& is shell syntax for "fold a file descriptor into another", you can also interprete it as
+"it is the syntax to redirect a stream to another file descriptor"
+
+The part " | tee build.log" causes a file build.log to be created (if it does not yet exist) and a copy of the text that
+your script displays on the console is going to be written to it.
+Any previous content of that logfile will be overwritten.
+
+The part "2>&1" means that you will also catch the ERROR output of failed commands. You would normally not notice,
+but programs can write their output to "standard output" as well as "error output".
+These are two separate "channels" if you like, and since the tee command will only catch "standard output" and
+duplicate it into the target file, you will have to explicitly add "error output" as well.
+Remember, the error output will often be the stuff you're most interested in!
+
+
+By using this command, you are still able to watch the proceedings of the package build process on your console,
+and afterwards you can open the log file in an editor at your leisure.
+
+look for the info:
+
+ •Compilation errors ( grep -iE "(error|failed)" )
+ •Header/include/library files missing ( grep -iE "(not found|unavailable)" )
+
+ref: http://tldp.org/LDP/abs/html/io-redirection.html
+
diff --git a/docs/marvell/howto/share_network_in_pipe_mode.txt b/docs/marvell/howto/share_network_in_pipe_mode.txt
new file mode 100644
index 0000000..b329c30
--- /dev/null
+++ b/docs/marvell/howto/share_network_in_pipe_mode.txt
@@ -0,0 +1,88 @@
+How to access the Internet inside the module in pipe mode
+========================================
+Problem Statement
+1826 PIPE mode works as follows: The IP address obtained by dial will be directly assigned to DAP.
+DAP sends the packet to 1826 via usb, the mrvlpipe driver intercepts and parses the IP header of
+the packet to determine whether to forward it to the slowpath or CCINETX and it also determine
+whether to forward to the slowpath or usb driver for downlink packets.
+Since there was no IP address configured for the local ccinetX, you cannot use the local ccinetX
+to send packets to the internet in 1826. For VoIP services, if the VoIP stack is placed inside 1826,
+the SIP packets cannot be sent to the sever.
+
+Share network in pipe mode is a technique meant to address this limitation. It will configures the
+IP address for the local CCINETX automatically and uses the tuple info to distinguish between internal
+and external access to the Internet.
+
+Notice:
+ 1) Before use this function, you need to understand a constraint that only certain items that are
+ accessed to the net internally can add their tuple information.
+ 2) Not support large packets, i.e. fragment packet, you need to control the packet length to be less
+ than MTU(default 1500).
+
+Here we take the VoIP as an example. Other services are similar.
+----------------------------------------------------------------------------
+Steps needed:
+1. make menuconfig, selects "Global build settings"->"Config support internal access to the internet in pipe mode"
+ and save to .config
+and build
+ make -j8 V=99
+
+2. Use SWDownloader to burn all bin files into the board
+
+3. Switch to pipe mode by AT command and reboot
+ AT+ACONFIG="PIPE=1"
+
+4. After reboot, you can see that there is also an IPv4 address on the local ccinetX, which is same with the IPv4
+address obtained by DAP. If you still need an IPv6 address, you can do that:
+ AT+CGDCONT=1,"IPV4V6","gprs"
+ AT+CGACT=1,1
+If dialed successful, you can see two IPv6 addresses on your local ccinetX, one is a link address and the other is
+a global address, looks like this:
+ ccinet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
+ inet addr:10.211.1.161 Mask:255.255.255.0
+ inet6 addr: fe80::1fb6:d1ac:88a1:e2c6/64 Scope:Link
+ inet6 addr: 2409:8930:2a3:1582:1fb6:d1ac:88a1:e2c6/64 Scope:Global
+ UP RUNNING NOARP MTU:1500 Metric:1
+
+5. Test
+ Before test whether the link from the local CCINETX to the SIP server is working, you need to add a tuple info
+to the "/sys/kernel/mpipe/database/tuple" to support ping the SIP server on 1826. For example,
+ echo 1 4 10.211.1.161 10.21.10.145 1 2048 1 > /sys/kernel/mpipe/database/tuple
+and then
+ ping 10.21.10.145 -I 10.211.1.161
+The usage for add the tuple info is as follows:
+echo [option] [version] [src_ip] [dst_ip] [sport] [dport] [protocol] > /sys/kernel/mpipe/database/tuple
+option:
+ 0------del all tuple info;
+ 1------add a specified tuple info;
+ 2------del a specified tuple info.
+
+6. In order to notify the mrvlpipe driver to forward the downlink packets locally, you need add the following sample
+code to the VoIP stack and get the IP version, source IP, destination IP, source port, destination port, protocol,
+and call this function before sends packets.
+
+ static int handle_tuple(TUPLE_CMD cmd, int version, char *src_ip,
+ char *dst_ip, int sport, int dport, int proto)
+ {
+ FILE *fp;
+ char write_buf[100] = {0};
+ int ret = 0;
+
+ fp = fopen("/sys/kernel/mpipe/database/tuple", "a+");
+ if(fp == NULL)
+ {
+ printf("handle_tuple: /sys/kernel/mpipe/database/tuple is not exit\n");
+ return -1;
+ }
+ snprintf(write_buf, sizeof(write_buf), "%u %u %s %s %u %u %u\r\n", cmd, version, src_ip, dst_ip, sport, dport, proto);
+ if(fwrite(write_buf, 1, strlen(write_buf), fp ) != strlen(write_buf))
+ {
+ printf("handle_tuple: file write error (size=%d)\n", strlen(write_buf));
+ ret = -1;
+ }
+
+ fclose(fp);
+
+ return ret;
+ }
+
diff --git a/docs/marvell/howto/start_and_build.txt b/docs/marvell/howto/start_and_build.txt
new file mode 100644
index 0000000..634206d
--- /dev/null
+++ b/docs/marvell/howto/start_and_build.txt
@@ -0,0 +1,125 @@
+0, Setup a workstation with 64-bit Linux OS installed (Ubuntu 14.04 and newer recommended)
+
+Make sure the workstation has the ssh key authorized by ASR.
+Make sure the ASR openwrt repositories are already cloned and updated
+
+Works below are all based on above two prerequisites.
+
+1, update the repos
+
+$ cd openwrt
+$ ./ugit.sh pull
+
+2, install the host prerequisites by openwrt
+
+$ apt-get install build-essential bison flex zlib1g-dev libncurses5-dev subversion quilt intltool ruby fastjar zip unzip gawk git-core
+
+3, update the feeds
+
+this is required at the first build, and the build after running 'make distclean'
+
+$ ./scripts/feeds update -a
+$ ./scripts/feeds install -a
+
+4, build the image
+
+First of first, let OpenWrt Buildroot check for missing packages on your build-system using
+
+$ make prereq
+
+Now, choose the proper defconfig files from the config directory according to the product profile.
+There are many profiles supported by default based on ASR DKB/EVB designs, i.e.
+ - pxa1826, for type A DKB, called nand profile in documents as well
+ - pxa1826spinand, for type A DKB with SPI flash, called spinand profile in documents as well
+ - pxa1826spinor, for data module, called spinor profile in documents as well
+ - pxa1826p601, for new designed EVB board, called p601 profile in documents as well
+
+Other profiles are not based on ASR DKB/EVB.
+
+Take pxa1826 nand profile for example,
+
+$make defconfig_pxa1826
+
+Then start the build
+$ make -j2 V=99
+
+After build finished, you can find the images at folder bin/pxa1826
+
+In the following development, just a simple build is enough if profile and config file are not changed.
+$ make -j2 V=99
+
+5, distclean uasge
+
+After the first build it will generate the toolchain and host tools, creating openwrt/host, openwrt/owtoolchain.
+In case you want to refresh those toolchains when some toolchain related configuration changed.
+
+$ make distclean
+$ ./scripts/feeds update -a
+$ ./scripts/feeds install -a
+$ make defconfig_pxa1826
+$ make -j2 V=99
+
+6, dirclean usage
+
+If you want to change the profile, for example, to pxa1826p601
+
+$make dirclean //make preclean is similar to dirclean but keeps the bin folder.
+$make defconfig_pxa1826p601
+$make -j2 V=99
+
+7, collect and check the build logs
+
+To save the build logs,
+
+$ make -j2 V=99 2>&1 | tee build.log
+
+To check error when build fails,
+
+$ make -j2 V=99 2>&1 | tee build.log | grep -i Error
+or
+$ grep -i Error build.log
+
+8, How to clean?
+
+- To clean the bin folder:
+ $ make clean
+
+- To clean the folders generated during build process:
+ $ make dirclean
+
+- To clean the folders generated during build process except the images:
+ $ make preclean
+
+- To clean everything, downloads, **configurations**, feeds,etc.
+ $ make distclean
+
+Only use distclean when necessary to save build time.
+
+9, How to build a specific package?
+
+It depends on where the package is located, following examples,
+
+ $ make package/obm-mmp/clean V=99
+ $ make package/obm-mmp/compile V=99
+ $ make package/obm-mmp/install V=99
+ or
+ $ make package/obm-mmp/{clean,compile,install} V=99
+
+ $ make package/feeds/packages/nginx/{clean, compile, install} V=99
+
+ $ make tools/automake/compile
+
+ $ make toolchain/{clean, compile, install}
+
+You can recompile only the kernel modules by issuing:
+
+ $ make target/linux/compile
+
+To recompile the static part of the kernel, issuing:
+
+ $ make target/linux/install
+
+Usually, you can do this for a complete kernel build,
+
+ $ make target/linux/{clean, compile, install}
+
diff --git a/docs/marvell/howto/update_defconfig.txt b/docs/marvell/howto/update_defconfig.txt
new file mode 100644
index 0000000..93b0d1d
--- /dev/null
+++ b/docs/marvell/howto/update_defconfig.txt
@@ -0,0 +1,25 @@
+How to update the defconfig for openwrt in the config direcotry
+
+In the openwrt top dir,
+
+1) need to choose the profile config, take defconfig_pxa1826 profile for example,
+$ make defconfig_pxa1826
+
+2) Above is Marvell defined defconfig per profile, it already set proper target and profile.
+Only if you want to add a new profile, need to change target or profile here
+$ make menuconfig //(it can be skipped in most times if not to change profile)
+(choose, save and exit)
+
+3) Next, only if want to update the kernel config in target/linux/mmp/pxa1826/,
+$ make kernel_menuconfig
+choose, save and exit
+
+4) Next again, when you want to update the openwrt settings or you have just updated the kernel config
+$ make menuconfig
+(choose), save and exit
+
+5) Last, save the new config file with configurations updated
+$ cp .config config/defconfig_pxa1826
+and build
+$ make -j2 V=99
+
diff --git a/docs/marvell/howto/use_vlan.txt b/docs/marvell/howto/use_vlan.txt
new file mode 100644
index 0000000..d4cb5af
--- /dev/null
+++ b/docs/marvell/howto/use_vlan.txt
@@ -0,0 +1,595 @@
+How to use VLAN to separate multiple PDN
+========================================
+Here we take 1802s (i.e. NezhaS) as example, 1826 (i.e. Nezha3) is similar.
+The host PC system tested in this paper is Ubuntu 5.4.0-6Ubuntu 1~16.04.12.
+Here we explains both the IPv4 and IPv6, you can ignore the IPv6 part if deploy the IPv4 only.
+
+1, PIPE mode
+1) Diag
+ default PDN:
+ "serial_client"
+ "AT+ZGDCONT=1,IPV4V6,CMNET"
+ "AT+ZGACT=1,1"
+ PDN2:
+ "AT*ZGDCONT=2,IPV4V6,CMWAP,1"
+ "AT+ZGACT=1,2"
+ PDN3:
+ "AT*ZGDCONT=3,IPV4V6,GPRS,1"
+ "AT+ZGACT=1,3"
+
+ Query the dial results with command "AT+CGDCONT?", you will get some information like this:
+
+ +CGDCONT: 1,"IPV4V6","cmnet","10.171.20.111 254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1",0,0,0,2,0,0
+
+ +CGDCONT: 2,"IPV4V6","CMWAP","10.184.75.11 254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1",0,0,0,2,0,0
+
+ +CGDCONT: 3,"IPV4V6","GPRS","10.185.130.179 254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1",0,0,0,2,0,0
+
+ As listed above , "10.171.20.111" is the IPv4 address of PDN1 and same for the others.
+
+2) Configure /etc/config/network
+ Add the following configuration to "/etc/config/network":
+
+ config switch
+ option name 'switch0'
+ option reset '1'
+ option enable_vlan '1'
+
+ config interface 'lan2'
+ option ifname 'usbnet0.100'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '10.184.75.244'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ config interface 'lan3'
+ option ifname 'usbnet0.200'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '10.185.130.76'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ usbnet0.100 and usbnet0.200 represent VLAN100 and VLAN200, "option ipaddr" is the ip address of PDN,
+ but the last bit requires an xor operation.
+ Then execute "/etc/init.d/network reload" to apply the configuration.
+
+3) Configure /etc/config/dhcp
+ Add the following configuration to "/etc/config/dhcp":
+
+ config dhcp 'lan2'
+ option interface 'lan2'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+ option start '11'
+ option limit '0'
+ list dhcp_option '3,10.184.75.244'
+ list dhcp_option '1,255.255.255.0'
+ list dhcp_option '6,61.132.163.68,202.102.213.68'
+ list dns '240e:46:4088::4088'
+ list dns '240e:46:4888::4888'
+
+ config dhcp 'lan3'
+ option interface 'lan3'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+ option start '179'
+ option limit '0'
+ list dhcp_option '3,10.185.130.76'
+ list dhcp_option '1,255.255.255.0'
+ list dhcp_option '6,202.102.213.68,61.132.163.68'
+ list dns '240e:46:4088::4088'
+ list dns '240e:46:4888::4888'
+
+ "option start" is the offset from the PDN address of the underlying interface to calculate the minimum address that may be leased to clients.
+ Then execute "/etc/init.d/dnsmasq reload" to apply the configuration.
+
+4) Bind the virtual LAN to PDN
+ Query the local IPv6 address for usbnet0:
+ "cd /sys/kernel/mpipe/devices"
+ "cat usbnet0/ll6addr", you will get the local IPv6 address:
+ "fe80::e8c9:89ff:fe4a:3455"
+
+ Configure virtual LAN:
+ "echo 192.168.100.1 > usbnet0.100/ipaddr"
+ "echo fe80::e8c9:89ff:fe4a:3455 > usbnet0.100/ll6addr"
+ "echo 1 > usbnet0.100/up"
+ "echo 1 > usbnet0.100/up6"
+
+ "echo 192.168.200.1 > usbnet0.200/ipaddr"
+ "echo fe80::e8c9:89ff:fe4a:3455 > usbnet0.200/ll6addr"
+ "echo 1 > usbnet0.200/up"
+ "echo 1 > usbnet0.200/up6"
+
+ Bind the virtual LAN to PDN
+ "echo usbnet0.100 > ccinet1/combineif"
+ "echo usbnet0.200 > ccinet2/combineif"
+ Now the ccinet1 serves as VLAN100, and ccinet2 as VLAN200.
+
+5) Configuration in Ubuntu16.04
+ Add virtual network card:
+ "vconfig add enp0s26u1u1 100"
+ "vconfig add enp0s26u1u1 200"
+
+ Get IP address through DHCP:
+ "dhcpcd enp0s26u1u1"
+ "dhcpcd enp0s26u1u1.100"
+ "dhcpcd enp0s26u1u1.200"
+
+ # ifconfig
+ enp0s26u1u1 Link encap:Ethernet HWaddr a2:ca:7e:71:c8:e3
+ inet addr:10.171.20.111 Bcast:10.171.20.255 Mask:255.255.255.0
+ inet6 addr: 240e:9a:875:27a8:9094:7d7b:6bc9:904a/64 Scope:Global
+ inet6 addr: 240e:9a:875:27a8:ae42:2167:938a:268/64 Scope:Global
+ inet6 addr: fe80::a0ca:7eff:fe71:c8e3/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:709 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:574 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:69649 (69.6 KB) TX bytes:118056 (118.0 KB)
+
+ enp0s26u1u1.100 Link encap:Ethernet HWaddr a2:ca:7e:71:c8:e3
+ inet addr:10.184.75.11 Bcast:10.184.75.255 Mask:255.255.255.0
+ inet6 addr: 240e:9a:868:af6d:693a:c829:7dbe:c2d5/64 Scope:Global
+ inet6 addr: fe80::a0ca:7eff:fe71:c8e3/64 Scope:Link
+ inet6 addr: 240e:9a:868:af6d:fcf6:78f5:3ef3:d159/64 Scope:Global
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:9 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:1019 (1.0 KB) TX bytes:18273 (18.2 KB)
+
+ enp0s26u1u1.200 Link encap:Ethernet HWaddr a2:ca:7e:71:c8:e3
+ inet addr:10.185.130.179 Bcast:10.185.130.255 Mask:255.255.255.0
+ inet6 addr: fe80::52c1:fbe:ad29:61c9/64 Scope:Link
+ inet6 addr: 240e:9a:874:b759:61f5:109:a46c:fe33/64 Scope:Global
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:8 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:923 (923.0 B) TX bytes:13673 (13.6 KB)
+
+ Add the IPv4 routing:
+ "route add -net 1.1.1.0/24 dev enp0s26u1u1"
+ "route add -net 8.8.8.0/24 dev enp0s26u1u1.100"
+ "route add -net 114.114.114.0/24 dev enp0s26u1u1.200"
+
+6) Test in Ubuntu16.04
+ # ping 1.1.1.1
+ PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
+ 64 bytes from 1.1.1.1: icmp_seq=1 ttl=53 time=257 ms
+ 64 bytes from 1.1.1.1: icmp_seq=2 ttl=53 time=171 ms
+
+ # ping 8.8.8.8
+ PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
+ 64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=130 ms
+ 64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=73.0 ms
+
+ # ping 114.114.114.114
+ PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
+ 64 bytes from 114.114.114.114: icmp_seq=2 ttl=78 time=103 ms
+ 64 bytes from 114.114.114.114: icmp_seq=3 ttl=92 time=20.9 ms
+
+ # ping6 www.sohu.com -I enp0s26u1u1
+ PING www.sohu.com(2408:80f0:4100:4007::4) from 240e:9a:875:27a8:9094:7d7b:6bc9:904a enp0s26u1u1: 56 data bytes
+ 64 bytes from 2408:80f0:4100:4007::4: icmp_seq=1 ttl=53 time=47.6 ms
+ 64 bytes from 2408:80f0:4100:4007::4: icmp_seq=2 ttl=53 time=46.7 ms
+ 64 bytes from 2408:80f0:4100:4007::4: icmp_seq=3 ttl=53 time=49.8 ms
+
+ # ping6 www.sohu.com -I enp0s26u1u1.100
+ PING www.sohu.com(2408:80f0:4100:4007::4) from 240e:9a:868:af6d:693a:c829:7dbe:c2d5 enp0s26u1u1.100: 56 data bytes
+ 64 bytes from 2408:80f0:4100:4007::4: icmp_seq=1 ttl=53 time=72.3 ms
+ 64 bytes from 2408:80f0:4100:4007::4: icmp_seq=2 ttl=53 time=63.8 ms
+ 64 bytes from 2408:80f0:4100:4007::4: icmp_seq=3 ttl=53 time=50.8 ms
+
+ # ping6 www.sohu.com -I enp0s26u1u1.200
+ PING www.sohu.com(2408:80f0:4100:4007::5) from 240e:9a:874:b759:61f5:109:a46c:fe33 enp0s26u1u1.200: 56 data bytes
+ 64 bytes from 2408:80f0:4100:4007::5: icmp_seq=1 ttl=53 time=73.7 ms
+ 64 bytes from 2408:80f0:4100:4007::5: icmp_seq=2 ttl=53 time=54.8 ms
+ 64 bytes from 2408:80f0:4100:4007::5: icmp_seq=3 ttl=53 time=45.6 ms
+
+7) VLAN for the default PDN
+ Since the default PDN is bound to the br-lan, you need to re-bind it to the desired VLAN and re-specify the br-lan address.
+ For example, bind to the VLAN 10:
+ First, modify the /etc/config/network configure file:
+
+ config interface 'lan'
+ option ifname 'usbnet0 hsicnet0 eth0'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ip6assign '60'
+ option netmask '255.255.255.0'
+ list ipaddr '192.168.1.1'
+
+ config switch
+ option name 'switch0'
+ option reset '1'
+ option enable_vlan '1'
+
+ config interface 'lan1'
+ option ifname 'usbnet0.10'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '10.171.20.144'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ Second, modify the /etc/config/dhcp configure file, then execute "/etc/init.d/network reload" to apply the configuration:
+ config dhcp 'lan'
+ option interface 'lan'
+ option start '100'
+ option limit '150'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+
+ config dhcp 'lan1'
+ option interface 'lan1'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+ option start '111'
+ option limit '0'
+ list dhcp_option '3,10.171.20.144'
+ list dhcp_option '1,255.255.255.0'
+ list dhcp_option '6,202.102.213.68,61.132.163.68'
+ list dns '240e:46:4088::4088'
+ list dns '240e:46:4888::4888'
+
+ Last, bind the virtual LAN to the default PDN:
+ "echo 192.168.10.1 > /sys/kernel/mpipe/devices/usbnet0.10/ipaddr"
+ "echo fe80::e8c9:89ff:fe4a:3455 > /sys/kernel/mpipe/devices/usbnet0.10/ll6addr"
+ "echo 1 > /sys/kernel/mpipe/devices/usbnet0.10/up"
+ "echo 1 > /sys/kernel/mpipe/devices/usbnet0.10/up6"
+ "echo usbnet0.10 > /sys/kernel/mpipe/devices/ccinet0/combineif"
+
+ The routing configuration in ubuntu is similar to the above step (5).
+
+8) Note
+ If you disconnect the usb, you may need to follow the above steps to reconfigure after reconnect.
+ If the default PDN is also bound to the VLAN, the ubutun PC can only access the internet via the virtual VLAN network card, while the enumerated real network card will not be able to access the internet.
+
+----------------------------------------
+
+2, MIFI mode
+1) Diag
+ default PDN:
+ "serial_client"
+ "AT+ZGDCONT=1,IPV4V6,CMNET"
+ "AT+ZGACT=1,1"
+ PDN2:
+ "AT*ZGDCONT=2,IPV4V6,CMWAP,1"
+ "AT+ZGACT=1,2"
+ PDN3:
+ "AT*ZGDCONT=3,IPV4V6,GPRS,1"
+ "AT+ZGACT=1,3"
+ Query the dial results with command "AT+CGDCONT?", you will get some information like this:
+
+ +CGDCONT: 1,"IP","ctnet.mnc011.mcc460.gprs","10.159.180.217",0,0,,,,
+
+ +CGDCONT: 2,"IP","cmwap","10.156.82.62",0,0,0,2,0,0
+
+ +CGDCONT: 3,"IP","cmwap","10.146.8.82",0,0,0,2,0,0
+
+ As listed above , "10.159.180.217" is the IPv4 address of PDN1 and same for the others.
+
+ Modify the route configuration, such as:
+ "route add -net 114.114.114.0/24 gw 10.146.8.82"
+ "route add -net 8.8.8.0/24 gw 10.156.82.62"
+ "route add -net 1.1.1.0/24 gw 10.159.180.217"
+
+ # route
+ Kernel IP routing table
+ Destination Gateway Genmask Flags Metric Ref Use Iface
+ 1.1.1.0 10.159.180.217 255.255.255.0 UG 0 0 0 ccinet0
+ 8.8.8.0 10.156.82.62 255.255.255.0 UG 0 0 0 ccinet1
+ 114.114.114.0 10.146.8.82 255.255.255.0 UG 0 0 0 ccinet2
+ 192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
+ 192.168.100.0 * 255.255.255.0 U 0 0 0 br-lan2
+ 192.168.200.0 * 255.255.255.0 U 0 0 0 br-lan3
+
+2) Configure /etc/config/network
+ Add the following configuration to "/etc/config/network":
+
+ config switch
+ option name 'switch0'
+ option reset '1'
+ option enable_vlan '1'
+
+ config interface 'lan2'
+ option ifname 'usbnet0.100'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '192.168.100.1'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ config interface 'lan3'
+ option ifname 'usbnet0.200'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '192.168.200.1'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ usbnet0.100 and usbnet0.200 represent VLAN100 and VLAN200.
+ Then execute "/etc/init.d/network reload" to apply the configuration.
+
+3) Modify /etc/config/firewall
+ The forwarding rules are set as follows:
+
+ config zone
+ option name lan
+ list network 'lan'
+ option input ACCEPT
+ option output ACCEPT
+ option forward ACCEPT
+
+ config zone
+ option name wan
+ list network 'wan0'
+ list network 'wan3'
+ list network 'wan4'
+ list network 'wan5'
+ list network 'wan6'
+ list network 'wan7'
+ list network 'wan60'
+ list network 'wan63'
+ list network 'wan64'
+ list network 'wan65'
+ list network 'wan66'
+ list network 'wan67'
+ list network 'wlan'
+ list network 'wlan6'
+ option input REJECT
+ option output ACCEPT
+ option forward REJECT
+ option masq 1
+ option mtu_fix 1
+
+ config forwarding
+ option src lan
+ option dest wan
+
+ config zone
+ option name lan2
+ list network 'lan2'
+ option input ACCEPT
+ option output ACCEPT
+ option forward ACCEPT
+
+ config zone
+ option name wan_100
+ list network 'wan1'
+ list network 'wan61'
+ option input REJECT
+ option output ACCEPT
+ option forward REJECT
+ option masq 1
+ option mtu_fix 1
+
+ config forwarding
+ option src lan2
+ option dest wan_100
+
+ config zone
+ option name lan3
+ list network 'lan3'
+ option input ACCEPT
+ option output ACCEPT
+ option forward ACCEPT
+
+ config zone
+ option name wan_200
+ list network 'wan2'
+ list network 'wan62'
+ option input REJECT
+ option output ACCEPT
+ option forward REJECT
+ option masq 1
+ option mtu_fix 1
+
+ config forwarding
+ option src lan3
+ option dest wan_200
+
+ Then execute "/etc/init.d/firewall reload" to apply the configuration.
+
+4) Configure /etc/config/dhcp
+ Add the following configuration to "/etc/config/dhcp":
+
+ config dhcp 'lan2'
+ option interface 'lan2'
+ option start '100'
+ option limit '150'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+
+ config dhcp 'lan3'
+ option interface 'lan3'
+ option start '100'
+ option limit '150'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+
+ Then execute "/etc/init.d/dnsmasq reload" to apply the configuration.
+
+5) Configuration in Ubuntu16.04
+ Add virtual network card:
+ "vconfig add enp0s26u1u1 100"
+ "vconfig add enp0s26u1u1 200"
+
+ Get IP address through DHCP:
+ "dhcpcd enp0s26u1u1"
+ "dhcpcd enp0s26u1u1.100"
+ "dhcpcd enp0s26u1u1.200"
+
+ # ifconfig
+ enp0s26u1u1 Link encap:Ethernet HWaddr 02:29:f2:b7:fa:81
+ inet addr:192.168.1.134 Bcast:192.168.1.255 Mask:255.255.255.0
+ inet6 addr: 240e:9a:428:44c9:acae:1690:47d3:710c/64 Scope:Global
+ inet6 addr: 240e:9a:428:44c9:29:f2ff:feb7:fa81/64 Scope:Global
+ inet6 addr: fe80::29:f2ff:feb7:fa81/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:13141 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:2393 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:1284895 (1.2 MB) TX bytes:570332 (570.3 KB)
+
+ enp0s26u1u1.100 Link encap:Ethernet HWaddr 02:29:f2:b7:fa:81
+ inet addr:192.168.100.203 Bcast:192.168.100.255 Mask:255.255.255.0
+ inet6 addr: 240e:9a:417:66b8:29:f2ff:feb7:fa81/64 Scope:Global
+ inet6 addr: 240e:9a:428:44c9:f6e7:c272:3fba:6a7d/64 Scope:Global
+ inet6 addr: fe80::29:f2ff:feb7:fa81/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:3969 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:898 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:398354 (398.3 KB) TX bytes:131123 (131.1 KB)
+
+ enp0s26u1u1.200 Link encap:Ethernet HWaddr 02:29:f2:b7:fa:81
+ inet addr:192.168.200.203 Bcast:192.168.200.255 Mask:255.255.255.0
+ inet6 addr: 240e:9a:419:2597:29:f2ff:feb7:fa81/64 Scope:Global
+ inet6 addr: 240e:9a:419:2597:6433:4697:bff4:45c9/64 Scope:Global
+ inet6 addr: 240e:9a:428:44c9:29:f2ff:feb7:fa81/64 Scope:Global
+ inet6 addr: fe80::29:f2ff:feb7:fa81/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:3898 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:629 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:404558 (404.5 KB) TX bytes:118583 (118.5 KB)
+
+ Add the IPv4 routing:
+ "route add -net 1.1.1.0/24 gw 192.168.1.1"
+ "route add -net 8.8.8.0/24 gw 192.168.100.1"
+ "route add -net 114.114.114.0/24 gw 192.168.200.1"
+
+ # route
+ Kernel IP routing table
+ Destination Gateway Genmask Flags Metric Ref Use Iface
+ 1.1.1.0 192.168.1.1 255.255.255.0 UG 0 0 0 enp0s26u1u1
+ 8.8.8.0 192.168.100.1 255.255.255.0 UG 0 0 0 enp0s26u1u1.100
+ 114.114.114.0 192.168.200.1 255.255.255.0 UG 0 0 0 enp0s26u1u1.200
+ 192.168.1.0 * 255.255.255.0 U 0 0 0 enp0s26u1u1
+ 192.168.100.0 * 255.255.255.0 U 0 0 0 enp0s26u1u1.100
+ 192.168.200.0 * 255.255.255.0 U 0 0 0 enp0s26u1u1.200
+
+6) Test in Ubuntu16.04
+ # ping 1.1.1.1
+ PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
+ 64 bytes from 1.1.1.1: icmp_seq=1 ttl=52 time=223 ms
+ 64 bytes from 1.1.1.1: icmp_seq=2 ttl=52 time=173 ms
+ 64 bytes from 1.1.1.1: icmp_seq=3 ttl=52 time=169 ms
+
+ # ping 8.8.8.8
+ PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
+ 64 bytes from 8.8.8.8: icmp_seq=2 ttl=113 time=54.7 ms
+ 64 bytes from 8.8.8.8: icmp_seq=3 ttl=113 time=52.3 ms
+ 64 bytes from 8.8.8.8: icmp_seq=4 ttl=113 time=53.0 ms
+
+ # ping 114.114.114.114
+ PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
+ 64 bytes from 114.114.114.114: icmp_seq=1 ttl=65 time=201 ms
+ 64 bytes from 114.114.114.114: icmp_seq=2 ttl=86 time=25.0 ms
+ 64 bytes from 114.114.114.114: icmp_seq=3 ttl=90 time=25.0 ms
+
+ # ping6 240e:83:201:3700::4 -I enp0s26u1u1
+ PING 240e:83:201:3700::4(240e:83:201:3700::4) from 240e:9a:428:44c9:acae:1690:47d3:710c enp0s26u1u1: 56 data bytes
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=1 ttl=57 time=45.2 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=2 ttl=57 time=32.8 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=3 ttl=57 time=32.0 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=4 ttl=57 time=31.2 ms
+
+ # ping6 240e:83:201:3700::4 -I enp0s26u1u1.100
+ PING 240e:83:201:3700::4(240e:83:201:3700::4) from 240e:9a:417:66b8:29:f2ff:feb7:fa81 enp0s26u1u1.100: 56 data bytes
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=1 ttl=57 time=42.0 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=2 ttl=57 time=33.8 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=3 ttl=57 time=33.8 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=4 ttl=57 time=30.7 ms
+
+ # ping6 240e:83:201:3700::4 -I enp0s26u1u1.200
+ PING 240e:83:201:3700::4(240e:83:201:3700::4) from 240e:9a:419:2597:6433:4697:bff4:45c9 enp0s26u1u1.200: 56 data bytes
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=1 ttl=57 time=31.9 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=2 ttl=57 time=33.0 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=3 ttl=57 time=35.1 ms
+ 64 bytes from 240e:83:201:3700::4: icmp_seq=4 ttl=57 time=33.7 ms
+
+7) VLAN for the default PDN
+ In MIFI mode, you just need to modify the /etc/config/firewall configure file.
+ For example, bind to the VLAN 10:
+ Modify the /etc/config/firewall configure file, then execute "/etc/init.d/firewall reload" to apply the configuration.:
+
+ config zone
+ option name lan
+ list network 'lan'
+ option input ACCEPT
+ option output ACCEPT
+ option forward ACCEPT
+
+ config zone
+ option name wan
+ list network 'wan3'
+ list network 'wan4'
+ list network 'wan5'
+ list network 'wan6'
+ list network 'wan7'
+ list network 'wan63'
+ list network 'wan64'
+ list network 'wan65'
+ list network 'wan66'
+ list network 'wan67'
+ list network 'wlan'
+ list network 'wlan6'
+ option input REJECT
+ option output ACCEPT
+ option forward REJECT
+ option masq 1
+ option mtu_fix 1
+
+ config forwarding
+ option src lan
+ option dest wan
+
+ config zone
+ option name lan1
+ list network 'lan1'
+ option input ACCEPT
+ option output ACCEPT
+ option forward ACCEPT
+
+ config zone
+ option name wan_10
+ list network 'wan0'
+ list network 'wan60'
+ option input REJECT
+ option output ACCEPT
+ option forward REJECT
+ option masq 1
+ option mtu_fix 1
+
+ config forwarding
+ option src lan1
+ option dest wan_10
+
+ The routing configuration in ubuntu is similar to the above step (5) and module is similar to the above step (1).
+
+8) Note
+ If you disconnect the usb, you may need to follow the above steps to reconfigure after reconnect.
+ If the default PDN is also bound to the VLAN, the ubutun PC can only access the internet via the virtual VLAN network card, while the enumerated real network card will not be able to access the internet.
diff --git a/docs/marvell/howto/use_vlan_base_eth.txt b/docs/marvell/howto/use_vlan_base_eth.txt
new file mode 100644
index 0000000..fdae5d4
--- /dev/null
+++ b/docs/marvell/howto/use_vlan_base_eth.txt
@@ -0,0 +1,255 @@
+How to use VLAN base on ETH to separate multiple PDN
+========================================
+Here we take 1803 as example, the host PC system tested in this paper is Ubuntu 5.4.0-6Ubuntu 1~16.04.12.
+Here we explains both the IPv4 and IPv6, you can ignore the IPv6 part if deploy the IPv4 only.
+
+1, PIPE mode
+1) Diag
+ default PDN:
+ "serial_client"
+ AT+ZGDCONT=1,IPV4V6,CMNET
+ AT+ZGACT=1,1
+ PDN2:
+ AT*ZGDCONT=2,IPV4V6,CMWAP,1
+ AT+ZGACT=1,2
+ PDN3:
+ AT*ZGDCONT=3,IPV4V6,GPRS,1
+ AT+ZGACT=1,3
+
+ Query the dial results with command "AT+CGCONTRDP", you will get some information like this:
+
+ +CGCONTRDP: 1,5,"cmnet.mnc002.mcc460.gprs","10.83.56.210","","211.138.180.2","211.138.180.3","","",0,0
+
+ +CGCONTRDP: 1,5,"cmnet.mnc002.mcc460.gprs","254.128.0.0.0.0.0.0.64.146.26.57.99.145.79.134","","36.9.128.48.32.0.0.0.0.0.0.0.0.0.0.1","36.9.128.48.32.0.0.0.0.0.0.0.0.0.0.2","","",0,0
+
+ +CGCONTRDP: 2,6,"cmnet.mnc002.mcc460.gprs","10.83.152.65","","211.138.180.2","211.138.180.3","","",0,0
+
+ +CGCONTRDP: 2,6,"cmnet.mnc002.mcc460.gprs","254.128.0.0.0.0.0.0.147.189.59.114.229.84.73.203","","36.9.128.48.32.0.0.0.0.0.0.0.0.0.0.1","36.9.128.48.32.0.0.0.0.0.0.0.0.0.0.2","","",0,0
+
+ +CGCONTRDP: 3,7,"cmnet.mnc002.mcc460.gprs","10.83.223.9","","211.138.180.2","211.138.180.3","","",0,0
+
+ +CGCONTRDP: 3,7,"cmnet.mnc002.mcc460.gprs","254.128.0.0.0.0.0.0.119.145.137.164.221.238.176.216","","36.9.128.48.32.0.0.0.0.0.0.0.0.0.0.1","36.9.128.48.32.0.0.0.0.0.0.0.0.0.0.2","","",0,0
+
+ As listed above , "10.83.56.210" is the IPv4 address of PDN1 and same for the others.
+
+2) Configure /etc/config/network
+ Add the following configuration to "/etc/config/network":
+ LAN4 is used to login to WebUI or connect module with fixed IP addresses.
+
+ config switch
+ option name 'switch0'
+ option reset '1'
+ option enable_vlan '1'
+
+ config interface 'lan2'
+ option ifname 'eth0.100'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '10.83.152.190'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ config interface 'lan3'
+ option ifname 'eth0.200'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '10.83.223.246'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ config interface 'lan4'
+ option ifname 'eth0.300'
+ option type 'bridge'
+ option bridge_empty '1'
+ option proto 'static'
+ option ipaddr '192.168.1.1'
+ option netmask '255.255.255.0'
+ option ip6assign '60'
+
+ eth0.100 and eth0.200 represent VLAN100 and VLAN200, "option ipaddr" is the ip address of PDN,
+ but the last bit requires an xor operation.
+ Then execute "/etc/init.d/network reload" to apply the configuration.
+
+3) Configure /etc/config/dhcp
+ Add the following configuration to "/etc/config/dhcp":
+
+ config dhcp 'lan2'
+ option interface 'lan2'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+ option start '65'
+ option limit '0'
+ list dhcp_option '3,10.83.152.190'
+ list dhcp_option '1,255.255.255.0'
+ list dhcp_option '6,211.138.180.3,211.138.180.2'
+ list dns '2409:8030:2000::1'
+ list dns '2409:8030:2000::2'
+
+ config dhcp 'lan3'
+ option interface 'lan3'
+ option leasetime '2h'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+ option start '9'
+ option limit '0'
+ list dhcp_option '3,10.83.223.246'
+ list dhcp_option '1,255.255.255.0'
+ list dhcp_option '6,211.138.180.3,211.138.180.2'
+ list dns '2409:8030:2000::1'
+ list dns '2409:8030:2000::2'
+
+ config dhcp 'lan4'
+ option interface 'lan4'
+ option start '192.168.1.100'
+ option end '192.168.1.249'
+ option limit '150'
+ option leasetime '43200'
+ option dhcpv6 'server'
+ option ra 'relay'
+ option ndp 'relay'
+
+ "option start" is the offset from the PDN address of the underlying interface to calculate the minimum address that may be leased to clients.
+ Then execute "/etc/init.d/dnsmasq reload" to apply the configuration.
+
+4) Bind the virtual LAN to PDN
+ Query the local IPv6 address for eth0:
+ Query the local IPv6 address for eth0:
+ ifconfig br-lan(*) | grep "inet6 addr" | awk '{print $3}'
+ For example, you will get the local IPv6 address for br-lan,
+ "fe80::30e1:7fff:febc:a4e1/64"
+
+ Configure virtual LAN:
+ "echo 192.168.0.1 > eth0/ipaddr"
+ "echo fe80::30e1:7fff:febc:a4e1 > eth0/ll6addr"
+ "echo 1 > eth0/up"
+ "echo 1 > eth0/up6"
+
+ "echo 192.168.100.1 > eth0.100/ipaddr"
+ "echo <br-lan2 local ipv6 addr> > eth0.100/ll6addr"
+ "echo 1 > eth0.100/up"
+ "echo 1 > eth0.100/up6"
+
+ "echo 192.168.200.1 > eth0.200/ipaddr"
+ "echo <br-lan3 local ipv6 addr> > eth0.200/ll6addr"
+ "echo 1 > eth0.200/up"
+ "echo 1 > eth0.200/up6"
+
+ "echo 192.168.1.1 > eth0.300/ipaddr"
+ "echo 1 > eth0.300/up"
+
+ Bind the virtual LAN to PDN
+ "echo eth0 > ccinet0/combineif"
+ "echo eth0.100 > ccinet1/combineif"
+ "echo eth0.200 > ccinet2/combineif"
+ Now the ccinet1 serves as VLAN100 and ccinet2 as VLAN200, ccinet0 has no vlan.
+
+5) Configuration in Ubuntu16.04
+ Add virtual network card:
+ "vconfig add eno1 100"
+ "vconfig add eno1 200"
+ "vconfig add eno1 300"
+
+ Get IP address through DHCP:
+ "dhcpcd eno1"
+ "dhcpcd eno1.100"
+ "dhcpcd eno1.200"
+ "dhcpcd eno1.200 -4"
+
+ # ifconfig
+ eno1 Link encap:Ethernet HWaddr fc:4d:d4:47:76:7c
+ inet addr:10.83.56.210 Bcast:10.83.56.255 Mask:255.255.255.0
+ inet6 addr: 2409:8930:265:340e:eaad:ceec:7eee:30ca/64 Scope:Global
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:8382 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:7057 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:2229048 (2.2 MB) TX bytes:941209 (941.2 KB)
+ Interrupt:20 Memory:f7c00000-f7c20000
+
+ eno1.100 Link encap:Ethernet HWaddr fc:4d:d4:47:76:7c
+ inet addr:10.83.152.65 Bcast:10.83.152.255 Mask:255.255.255.0
+ inet6 addr: 2409:8930:265:3582:9561:16:150:31fc/64 Scope:Global
+ inet6 addr: 2409:8930:265:3582:884b:4cd7:ec22:1a8a/64 Scope:Global
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:321 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:982 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:42395 (42.3 KB) TX bytes:136625 (136.6 KB)
+
+ eno1.200 Link encap:Ethernet HWaddr fc:4d:d4:47:76:7c
+ inet addr:10.83.223.9 Bcast:10.83.223.255 Mask:255.255.255.0
+ inet6 addr: 2409:8930:265:372a:3d07:6ef3:72e1:fb32/64 Scope:Global
+ inet6 addr: fe80::9e83:97a5:fce9:f67b/64 Scope:Link
+ inet6 addr: 2409:8930:265:372a:e040:801d:d009:6860/64 Scope:Global
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:291 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:662 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:37415 (37.4 KB) TX bytes:94854 (94.8 KB)
+
+ eno1.300 Link encap:Ethernet HWaddr fc:4d:d4:47:76:7c
+ inet addr:192.168.1.244 Bcast:192.168.1.255 Mask:255.255.255.0
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:2336 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:2453 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:277235 (277.2 KB) TX bytes:313953 (313.9 KB)
+
+ # route
+ Kernel IP routing table
+ Destination Gateway Genmask Flags Metric Ref Use Iface
+ default 10.83.56.45 0.0.0.0 UG 202 0 0 eno1
+ default 10.83.152.190 0.0.0.0 UG 203 0 0 eno1.100
+ default 10.83.223.246 0.0.0.0 UG 204 0 0 eno1.200
+ default 192.168.1.1 0.0.0.0 UG 205 0 0 eno1.300
+ 10.83.56.0 * 255.255.255.0 U 202 0 0 eno1
+ 10.83.152.0 * 255.255.255.0 U 203 0 0 eno1.100
+ 10.83.223.0 * 255.255.255.0 U 204 0 0 eno1.200
+ 192.168.1.0 * 255.255.255.0 U 205 0 0 eno1.300
+
+6) Test in Ubuntu16.04
+
+ # ping www.sohu.com -I eno1
+ PING fshyd.a.sohu.com (162.14.132.217) from 10.83.56.210 eno1: 56(84) bytes of data.
+ 64 bytes from 162.14.132.217: icmp_seq=1 ttl=247 time=44.4 ms
+ 64 bytes from 162.14.132.217: icmp_seq=2 ttl=247 time=44.9 ms
+
+ # route del default gw 10.83.56.45
+ # ping www.sohu.com -I eno1.100
+ PING fshyd.a.sohu.com (162.14.132.217) from 10.83.152.65 eno1.100: 56(84) bytes of data.
+ 64 bytes from 162.14.132.217: icmp_seq=1 ttl=247 time=29.4 ms
+ 64 bytes from 162.14.132.217: icmp_seq=2 ttl=247 time=27.1 ms
+
+ # route del default gw 10.83.152.190
+ # ping www.sohu.com -I eno1.200
+ PING fshyd.a.sohu.com (162.14.132.217) from 10.83.223.9 eno1.200: 56(84) bytes of data.
+ 64 bytes from 162.14.132.217: icmp_seq=1 ttl=54 time=54.6 ms
+ 64 bytes from 162.14.132.217: icmp_seq=2 ttl=54 time=43.0 ms
+
+ # ping 192.168.1.1
+ PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
+ 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.93 ms
+ 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.11 ms
+
+ # ping6 www.sohu.com -I eno1
+ PING www.sohu.com(2402:4e00:4010:1::20) from 2409:8930:265:340e:eaad:ceec:7eee:30ca eno1: 56 data bytes
+ 64 bytes from 2402:4e00:4010:1::20: icmp_seq=2 ttl=50 time=63.9 ms
+ 64 bytes from 2402:4e00:4010:1::20: icmp_seq=3 ttl=50 time=42.7 ms
+
+ # ping6 www.sohu.com -I eno1.100
+ PING www.sohu.com(2402:4e00:4010:1::21) from 2409:8930:265:3582:9561:16:150:31fc eno1.100: 56 data bytes
+ 64 bytes from 2402:4e00:4010:1::21: icmp_seq=1 ttl=50 time=29.7 ms
+ 64 bytes from 2402:4e00:4010:1::21: icmp_seq=2 ttl=50 time=38.3 ms
+
+ # ping6 www.sohu.com -I eno1.200
+ PING www.sohu.com(2402:4e00:4010:1::25) from 2409:8930:265:372a:e040:801d:d009:6860 eno1.200: 56 data bytes
+ 64 bytes from 2402:4e00:4010:1::25: icmp_seq=1 ttl=50 time=52.9 ms
+ 64 bytes from 2402:4e00:4010:1::25: icmp_seq=2 ttl=50 time=47.1 ms
+
+7) Note
+ If you disconnect the eth, you may need to follow the above steps to reconfigure after reconnect.
diff --git a/docs/marvell/howto/vpn_configuration.txt b/docs/marvell/howto/vpn_configuration.txt
new file mode 100644
index 0000000..1a849a6
--- /dev/null
+++ b/docs/marvell/howto/vpn_configuration.txt
@@ -0,0 +1,82 @@
+How to configure VPN
+========================================
+Here we provide some example of the tunneling protocol configurations usable in /etc/config/network.
+We will also provide the opkg packages that need to be installed for protocol support below.
+
+1, GRE
+The PACKAGE_gre must be installed to use this protocol. Additionally, you need PACKAGE_grev4 and/or PACKAGE_grev6.
+example for create a GRE tunnel:
+
+ # /etc/config/network
+ config interface 'vpn'
+ option proto 'gre'
+ option peeraddr 'peeraddr'
+
+ config interface 'gre_tunnel'
+ option ifname '@vpn'
+ option proto 'static'
+ option netmask 'netmask'
+ option ipaddr 'ipaddress'
+ #If you need to configure IPv6.
+ option ip6addr 'ipaddress'
+
+2, PPTP
+The following packages must be installed to use this protocol.
+ PACKAGE_kmod-nf-nathelper-extra
+ PACKAGE_kmod-gre
+ PACKAGE_kmod-pptp
+ PACKAGE_ppp
+ PACKAGE_kmod-ppp
+ PACKAGE_ppp-mod-pptp
+
+example for create PPTP:
+ # /etc/config/network
+ config interface 'vpn'
+ option ifname 'pptp-vpn'
+ option proto 'pptp'
+ option username 'vpnusername'
+ option password 'vpnpassword'
+ option server 'ipaddress'
+
+3, XL2TP:
+The following packages must be installed to use this protocol.
+ PACKAGE_ppp-multilink
+ PACKAGE_kmod-ppp
+ PACKAGE_xl2tpd
+
+example for create XL2TP:
+ # /etc/config/network
+ config interface 'vpn'
+ option ifname 'xl2tp-vpn'
+ option proto 'l2tp'
+ option username 'vpnusername'
+ option password 'vpnpassword'
+ option server 'ipaddress'
+
+4, Note that, for the above protocol, you also need to configure the rules in /etc/config/firewall.
+ # /etc/config/firewall
+ config zone
+ option name vpn
+ list network 'vpn'
+ option input ACCEPT
+ option output ACCEPT
+ option forward ACCEPT
+ option masq 1
+
+ config forwarding
+ option src lan
+ option dest vpn
+
+ config forwarding
+ option src vpn
+ option dest lan
+
+Additionally, the following rule should be configured for GRE tunnel.
+ config rule
+ option name Allow-GRE
+ option src wan
+ option proto gre
+ option target ACCEPT
+ option family ipv4
+
+
diff --git a/docs/marvell/howto/wireguad_client.txt b/docs/marvell/howto/wireguad_client.txt
new file mode 100644
index 0000000..13ba650
--- /dev/null
+++ b/docs/marvell/howto/wireguad_client.txt
@@ -0,0 +1,65 @@
+This how-to describes the method for setting up WireGuard client.
+========================================
+Here we take 1803 (i.e. Falcon) as example.
+The WireGuard server tested in this paper was created on Ubuntu 16.04.7 LTS.
+
+1) make menuconfig and select "CONFIG_PACKAGE_wireguard-tools" and save your new configuration.
+ make kernel_menuconfig and select "CONFIG_WIREGUARD" and save your new kernel configuration.
+And then rebuild:make -j8 V=99
+
+2) Key management
+ Generate and exchange keys between server and client.
+
+ # Generate keys
+ wg genkey | tee /tmp/wgserver.key | wg pubkey > /tmp/wgserver.pub
+ wg genkey | tee /tmp/wgclient.key | wg pubkey > /tmp/wgclient.pub
+
+ WG_KEY="$(cat /tmp/wgclient.key)" # Client private key
+ WG_PUB="$(cat /tmp/wgserver.pub)" # Server public key
+
+3) Firewall
+ Consider VPN network as public. Assign VPN interface to WAN zone to minimize firewall setup.
+
+ # Configure firewall
+ uci rename firewall.@zone[0]="lan"
+ uci rename firewall.@zone[1]="wan"
+ uci del_list firewall.wan.network="vpn"
+ uci add_list firewall.wan.network="vpn"
+ uci commit firewall
+ /etc/init.d/firewall restart
+
+
+4) Network
+ Configure VPN interface and peers.
+
+ # Configure network, WG_ADDR is the address of the WireGuard client,
+ # WG_KEY is the private key of the WireGuard client generated in 2)
+ uci -q delete network.vpn
+ uci set network.vpn="interface"
+ uci set network.vpn.proto="wireguard"
+ uci set network.vpn.private_key="${WG_KEY}"
+ uci add_list network.vpn.addresses="${WG_ADDR}"
+
+ # Add VPN peers, WG_PUB is the public key of the WireGuard server generated in Ubuntu 16.04.7 LTS.
+ # WG_SERV is the public IP address of the WireGuard server.
+ # WG_PORT is the wireguard udp port you use.
+ uci -q delete network.wgserver
+ uci set network.wgserver="wireguard_vpn
+ uci set network.wgserver.public_key="${WG_PUB}"
+ uci set network.wgserver.endpoint_host="${WG_SERV}"
+ uci set network.wgserver.endpoint_port="${WG_PORT}"
+ uci set network.wgserver.route_allowed_ips="1"
+ uci set network.wgserver.persistent_keepalive="25"
+ uci add_list network.wgserver.allowed_ips="0.0.0.0/0"
+ uci commit network
+ /etc/init.d/network restart
+
+
+
+5) Testing
+ Add the public key and IP address of the WireGuard client to server to establish the VPN connection.
+ # WG_ADDR is the address of the WireGuard client
+ # CLIENT_PUBLIC_KEY is the public key of the WireGuard client generated in 2), you can query it by "cat /tmp/wgclient.pub".
+ sudo wg set wg0 peer "${CLIENT_PUBLIC_KEY}" allowed-ips "${WG_ADDR}"
+
+ Use ping or traceroute to verify your WireGuard client can be accessed to server.
\ No newline at end of file
diff --git a/docs/marvell/howto/working_patches.pdf b/docs/marvell/howto/working_patches.pdf
new file mode 100644
index 0000000..114c8c5
--- /dev/null
+++ b/docs/marvell/howto/working_patches.pdf
Binary files differ
diff --git a/docs/marvell/howto/xlat464.txt b/docs/marvell/howto/xlat464.txt
new file mode 100644
index 0000000..98306d2
--- /dev/null
+++ b/docs/marvell/howto/xlat464.txt
@@ -0,0 +1,62 @@
+How to use the upstream XLAT464 function
+========================================
+For xlat464, we offer two solutions: one is the upstream xlat464 described in this document,
+and the other is based on datapath provided by ASR (see howto: data_path_nat46.txt).
+In contrast, the former converts nat46 and nat64 in the kernel, which will lose some throughput and cpu,
+while the latter can achieve zero copy, which can improve throughput.
+
+Here we take 1803 (i.e. Falcon) as example.
+The host PC system tested in this paper is Ubuntu 16.04.7 LTS.
+
+
+1) make menuconfig and select "PACKAGE_464xlat" and save your new configuration.
+And then rebuild:make -j8 V=99
+
+2) Redial using IPv6
+ "serial_client"
+ "AT+ZGDCONT=1,IPV6,GPRS"
+ "AT+ZGACT=1,1"
+ After this operation, you will not be able to access the IPv4 service and failed to ping IPv4 on the host or 1803,
+ but you can successfully ping the IPv6 server on 1803.
+
+3) Configure CLAT interface
+ # Configure network
+ uci set network.clat="interface"
+ uci set network.clat.proto="464xlat"
+ uci set network.clat.ip6prefix="64:ff9b::/96"
+ uci commit network
+ /etc/init.d/network reload
+
+ 64:ff9b::/96 is the v6 prefix of PLAT, which may not be accessible in china but is available overseas.
+
+4) Firewall
+ Consider CLAT network as public. Assign CLAT interface to WAN zone to minimize firewall setup.
+ # Configure firewall
+ uci rename firewall.@zone[1]="wan"
+ uci del_list firewall.wan.network="clat"
+ uci add_list firewall.wan.network="clat"
+ uci set firewall.wan.forward="ACCEPT"
+ uci commit firewall
+ /etc/init.d/firewall reload
+
+5) DHCP
+ If you need to resolve IPv6 domain names on Ubuntu, you need to configure IPv6 dns information in dhcp.
+ # Configure dhcp
+ list dns '2409:8030:2000::1'
+ list dns '2409:8030:2000::2'
+ uci add_list dhcp.lan.dns="2409:8030:2000::1"
+ uci add_list dhcp.lan.dns="2409:8030:2000::2"
+ uci commit dhcp
+ /etc/init.d/odhcpd restart
+
+ 2409:8030:2000::1 is the IPv6 dns you obtained by dialing, you can also set others, such as the gateway address of br-lan or Google dns.
+
+6) Host Configuration
+ "dhclient enp0s26u1u1"
+ "route add default gw 192.168.1.1"
+
+ enp0s26u1u1 is the enumerated rndis NIC on Ubuntu.
+
+7) Testing
+ Establish the XLAT connection. Use ping to verify your client can be accessed using IPv4.
+ ping www.baidu.com
diff --git a/docs/marvell/training/charger_fuelgauge.pdf b/docs/marvell/training/charger_fuelgauge.pdf
new file mode 100644
index 0000000..b6da146
--- /dev/null
+++ b/docs/marvell/training/charger_fuelgauge.pdf
Binary files differ
diff --git a/docs/marvell/training/display.pdf b/docs/marvell/training/display.pdf
new file mode 100644
index 0000000..229045f
--- /dev/null
+++ b/docs/marvell/training/display.pdf
Binary files differ
diff --git a/docs/marvell/training/linux_bsp.pdf b/docs/marvell/training/linux_bsp.pdf
new file mode 100644
index 0000000..45d7408
--- /dev/null
+++ b/docs/marvell/training/linux_bsp.pdf
Binary files differ
diff --git a/docs/marvell/training/network_mode_xml_tags_definition.pdf b/docs/marvell/training/network_mode_xml_tags_definition.pdf
new file mode 100644
index 0000000..2304d7a
--- /dev/null
+++ b/docs/marvell/training/network_mode_xml_tags_definition.pdf
Binary files differ
diff --git a/docs/marvell/training/ota.pdf b/docs/marvell/training/ota.pdf
new file mode 100644
index 0000000..fbaa2fb
--- /dev/null
+++ b/docs/marvell/training/ota.pdf
Binary files differ
diff --git a/docs/marvell/training/phonebook_xml_definition.pdf b/docs/marvell/training/phonebook_xml_definition.pdf
new file mode 100644
index 0000000..e9de725
--- /dev/null
+++ b/docs/marvell/training/phonebook_xml_definition.pdf
Binary files differ
diff --git a/docs/marvell/training/pin_mep_xml_tags_definition.pdf b/docs/marvell/training/pin_mep_xml_tags_definition.pdf
new file mode 100644
index 0000000..09acc1e
--- /dev/null
+++ b/docs/marvell/training/pin_mep_xml_tags_definition.pdf
Binary files differ
diff --git a/docs/marvell/training/pmu_guide.pdf b/docs/marvell/training/pmu_guide.pdf
new file mode 100644
index 0000000..232f615
--- /dev/null
+++ b/docs/marvell/training/pmu_guide.pdf
Binary files differ
diff --git a/docs/marvell/training/pxa1826_solution_long_overview.pdf b/docs/marvell/training/pxa1826_solution_long_overview.pdf
new file mode 100644
index 0000000..aca1d10
--- /dev/null
+++ b/docs/marvell/training/pxa1826_solution_long_overview.pdf
Binary files differ
diff --git a/docs/marvell/training/pxa1826_solution_overview.pdf b/docs/marvell/training/pxa1826_solution_overview.pdf
new file mode 100644
index 0000000..ce5f934
--- /dev/null
+++ b/docs/marvell/training/pxa1826_solution_overview.pdf
Binary files differ
diff --git a/docs/marvell/training/ril.pdf b/docs/marvell/training/ril.pdf
new file mode 100644
index 0000000..008a996
--- /dev/null
+++ b/docs/marvell/training/ril.pdf
Binary files differ
diff --git a/docs/marvell/training/sms_xml_tags.pdf b/docs/marvell/training/sms_xml_tags.pdf
new file mode 100644
index 0000000..85f836b
--- /dev/null
+++ b/docs/marvell/training/sms_xml_tags.pdf
Binary files differ
diff --git a/docs/marvell/training/telephony_modules.pdf b/docs/marvell/training/telephony_modules.pdf
new file mode 100644
index 0000000..2ea1771
--- /dev/null
+++ b/docs/marvell/training/telephony_modules.pdf
Binary files differ
diff --git a/docs/marvell/training/traffic_monitor.pdf b/docs/marvell/training/traffic_monitor.pdf
new file mode 100644
index 0000000..750b99b
--- /dev/null
+++ b/docs/marvell/training/traffic_monitor.pdf
Binary files differ
diff --git a/docs/marvell/training/usb.pdf b/docs/marvell/training/usb.pdf
new file mode 100644
index 0000000..3a1e56c
--- /dev/null
+++ b/docs/marvell/training/usb.pdf
Binary files differ
diff --git a/docs/marvell/training/web_services.pdf b/docs/marvell/training/web_services.pdf
new file mode 100644
index 0000000..047abb2
--- /dev/null
+++ b/docs/marvell/training/web_services.pdf
Binary files differ
diff --git a/docs/marvell/training/webui_flow.pdf b/docs/marvell/training/webui_flow.pdf
new file mode 100644
index 0000000..e8eae2b
--- /dev/null
+++ b/docs/marvell/training/webui_flow.pdf
Binary files differ
diff --git a/docs/marvell/training/webui_guide.pdf b/docs/marvell/training/webui_guide.pdf
new file mode 100644
index 0000000..08a0068
--- /dev/null
+++ b/docs/marvell/training/webui_guide.pdf
Binary files differ
diff --git a/docs/marvell/training/wifi.pdf b/docs/marvell/training/wifi.pdf
new file mode 100644
index 0000000..c828729
--- /dev/null
+++ b/docs/marvell/training/wifi.pdf
Binary files differ