User:Lth/BPIR2 OTG

From Stm32World Wiki
< User:Lth
Revision as of 07:33, 15 June 2022 by Lth (talk | contribs)
Jump to navigation Jump to search

Debian System

Working with this kernel.

The default config contains:

#OTG
CONFIG_USB_OTG=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_MEDIATEK=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_CONFIGFS=y
#CONFIG_USB_CONFIGFS_MASS_STORAGE=y
#CONFIG_PHY_MTK_TPHY=y
CONFIG_USB_GADGET=y
CONFIG_USB_MUSB_DUAL_ROLE=y
CONFIG_USB_INVENTRA_DMA=y
#some gadget-drivers
#CONFIG_USB_G_SERIAL=y
#CONFIG_USB_MASS_STORAGE=y
#CONFIG_USB_ETH=y

CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_U_SERIAL=y
CONFIG_USB_U_ETHER=y
CONFIG_USB_F_SERIAL=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_HID=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
# CONFIG_USB_CONFIGFS_ACM is not set
# CONFIG_USB_CONFIGFS_OBEX is not set
# CONFIG_USB_CONFIGFS_NCM is not set
CONFIG_USB_CONFIGFS_ECM=y
# CONFIG_USB_CONFIGFS_ECM_SUBSET is not set
# CONFIG_USB_CONFIGFS_RNDIS is not set
# CONFIG_USB_CONFIGFS_EEM is not set
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
# CONFIG_USB_CONFIGFS_F_LB_SS is not set
# CONFIG_USB_CONFIGFS_F_FS is not set
# CONFIG_USB_CONFIGFS_F_UAC1 is not set
# CONFIG_USB_CONFIGFS_F_UAC1_LEGACY is not set
# CONFIG_USB_CONFIGFS_F_UAC2 is not set
# CONFIG_USB_CONFIGFS_F_MIDI is not set
CONFIG_USB_CONFIGFS_F_HID=y
# CONFIG_USB_CONFIGFS_F_UVC is not set
# CONFIG_USB_CONFIGFS_F_PRINTER is not set
root@bpi-r2:/sys/devices/platform# ls -ls
total 0
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10001000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10003000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10005000.syscfg
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10006000.power-controller
0 drwxr-xr-x 5 root root    0 Mar 20 19:55  10007000.watchdog
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10008000.timer
0 drwxr-xr-x 5 root root    0 Mar 20 19:55  1000b000.pinctrl
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1000c000.smi
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1000d000.pwrap
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  10010000.dsi-phy
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10012000.cec
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  10013000.cir
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  10205000.mmsys_iommu
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  10206000.efuse
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  10209000.syscon
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  10209100.hdmi-phy
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1020f000.rng
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  11000780.btif_tx
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  11000800.btif_rx
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11001000.adc
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11002000.serial
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11003000.serial
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11004000.serial
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11006000.pwm
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11007000.i2c
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11008000.i2c
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1100a000.spi
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1100b000.thermal
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1100c000.serial
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11013000.i2c
0 drwxr-xr-x 6 root root    0 Mar 20 19:55  11200000.usb
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11210000.t-phy
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  11220000.clock-controller
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11230000.mmc
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  11240000.mmc
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  13000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  13040000.gpu
0 drwxr-xr-x 5 root root    0 Mar 20 19:55  14000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  14007000.ovl
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  14008000.rdma
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  14009000.wdma
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1400a000.pwm
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1400b000.color
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1400e000.mutex
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  14010000.larb
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  14012000.rdma
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  14014000.dpi
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  14015000.hdmi
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  15000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  15001000.larb
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  15004000.jpegdec
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  16000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  16010000.larb
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  18070000.consys
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  180f0000.wifi
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1a000000.syscon
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1a140000.pcie
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1a149000.t-phy
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1a14a000.t-phy
0 drwxr-xr-x 6 root root    0 Mar 20 19:55  1a1c0000.usb
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1a1c4000.t-phy
0 drwxr-xr-x 6 root root    0 Mar 20 19:55  1a240000.usb
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  1a244000.t-phy
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1b000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1b007000.dma-controller
0 drwxr-xr-x 5 root root    0 Mar 20 19:55  1b100000.ethernet
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1b240000.crypto
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  1c000000.syscon
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  connector
0 drwxr-xr-x 4 root root    0 Mar 20 19:55 'Fixed MDIO bus.0'
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  fixedregulator@0
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  gpio-keys
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  leds
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  mtk-cpufreq
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  pmu
0 drwxr-xr-x 2 root root    0 Jun  9 06:33  power
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  reg-dummy
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  regulator-1p8v
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  regulator-3p3v
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  regulator-5v
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  regulatory.0
0 drwxr-xr-x 4 root root    0 Mar 20 19:55  serial8250
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  snd-soc-dummy
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  timer
0 -rw-r--r-- 1 root root 4096 Mar 20 19:55  uevent
0 drwxr-xr-x 3 root root    0 Mar 20 19:55  usb_phy_generic.3.auto

OpenWrt Attempt

Extracing dtb

dumpimage -T flat_dt -p 1 -o /tmp/bpir2.dtb /home/lth/openwrt-bpir2/bin/targets/
mediatek/mt7623/lifeline-0.0.67-dev-mediatek-mt7623-bananapi_bpi-r2-squashfs-sys
upgrade.itb
dtc -I dtb -O dts bpir2.dtb -o bpir2.dts

Devices

root@llcon:/sys/devices/platform# ls -l
drwxr-xr-x    3 root     root             0 Jan  1  1970 10000000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 10001000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 10003000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 10005000.syscfg
drwxr-xr-x    3 root     root             0 Jan  1  1970 10006000.power-controller
drwxr-xr-x    5 root     root             0 Jan  1  1970 10007000.watchdog
drwxr-xr-x    3 root     root             0 Jan  1  1970 10008000.timer
drwxr-xr-x    5 root     root             0 Jan  1  1970 1000b000.pinctrl
drwxr-xr-x    3 root     root             0 Jan  1  1970 1000c000.smi
drwxr-xr-x    4 root     root             0 Jan  1  1970 1000d000.pwrap
drwxr-xr-x    4 root     root             0 Jan  1  1970 10010000.dsi-phy
drwxr-xr-x    3 root     root             0 Jan  1  1970 10012000.cec
drwxr-xr-x    3 root     root             0 Jan  1  1970 10013000.cir
drwxr-xr-x    4 root     root             0 Jan  1  1970 10205000.mmsys_iommu
drwxr-xr-x    4 root     root             0 Jan  1  1970 10206000.efuse
drwxr-xr-x    3 root     root             0 Jan  1  1970 10209000.syscon
drwxr-xr-x    4 root     root             0 Jan  1  1970 10209100.hdmi-phy
drwxr-xr-x    3 root     root             0 Jan  1  1970 1020f000.rng
drwxr-xr-x    4 root     root             0 Jan  1  1970 11001000.adc
drwxr-xr-x    4 root     root             0 Jan  1  1970 11002000.serial
drwxr-xr-x    4 root     root             0 Jan  1  1970 11003000.serial
drwxr-xr-x    4 root     root             0 Jan  1  1970 11004000.serial
drwxr-xr-x    4 root     root             0 Jan  1  1970 11006000.pwm
drwxr-xr-x    4 root     root             0 Jan  1  1970 11007000.i2c
drwxr-xr-x    4 root     root             0 Jan  1  1970 11008000.i2c
drwxr-xr-x    4 root     root             0 Jan  1  1970 1100a000.spi
drwxr-xr-x    3 root     root             0 Jan  1  1970 1100b000.thermal
drwxr-xr-x    3 root     root             0 Jan  1  1970 1100c000.serial
drwxr-xr-x    4 root     root             0 Jan  1  1970 11013000.i2c
drwxr-xr-x    4 root     root             0 Jan  1  1970 11220000.clock-controller
drwxr-xr-x    4 root     root             0 Jan  1  1970 11230000.mmc
drwxr-xr-x    4 root     root             0 Jan  1  1970 11240000.mmc
drwxr-xr-x    3 root     root             0 Jan  1  1970 13000000.syscon
drwxr-xr-x    4 root     root             0 Jan  1  1970 13040000.gpu
drwxr-xr-x    5 root     root             0 Jan  1  1970 14000000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 14007000.ovl
drwxr-xr-x    3 root     root             0 Jan  1  1970 14008000.rdma
drwxr-xr-x    3 root     root             0 Jan  1  1970 14009000.wdma
drwxr-xr-x    3 root     root             0 Jan  1  1970 1400a000.pwm
drwxr-xr-x    3 root     root             0 Jan  1  1970 1400b000.color
drwxr-xr-x    3 root     root             0 Jan  1  1970 1400e000.mutex
drwxr-xr-x    3 root     root             0 Jan  1  1970 14010000.larb
drwxr-xr-x    3 root     root             0 Jan  1  1970 14012000.rdma
drwxr-xr-x    3 root     root             0 Jan  1  1970 14014000.dpi
drwxr-xr-x    4 root     root             0 Jan  1  1970 14015000.hdmi
drwxr-xr-x    3 root     root             0 Jan  1  1970 15000000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 15001000.larb
drwxr-xr-x    3 root     root             0 Jan  1  1970 15004000.jpegdec
drwxr-xr-x    3 root     root             0 Jan  1  1970 16000000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 16010000.larb
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a000000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a140000.pcie
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a149000.t-phy
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a14a000.t-phy
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a1c0000.usb
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a1c4000.t-phy
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a240000.usb
drwxr-xr-x    3 root     root             0 Jan  1  1970 1a244000.t-phy
drwxr-xr-x    3 root     root             0 Jan  1  1970 1b000000.syscon
drwxr-xr-x    3 root     root             0 Jan  1  1970 1b007000.dma-controller
drwxr-xr-x    5 root     root             0 Jan  1  1970 1b100000.ethernet
drwxr-xr-x    3 root     root             0 Jan  1  1970 1b240000.crypto
drwxr-xr-x    3 root     root             0 Jan  1  1970 1c000000.syscon
drwxr-xr-x    4 root     root             0 Jan  1  1970 Fixed MDIO bus.0
drwxr-xr-x    3 root     root             0 Jan  1  1970 connector
drwxr-xr-x    4 root     root             0 Jan  1  1970 fixedregulator@0
drwxr-xr-x    3 root     root             0 Jan  1  1970 gpio-keys
drwxr-xr-x    4 root     root             0 Jan  1  1970 leds
drwxr-xr-x    3 root     root             0 Jan  1  1970 mtk-cpufreq
drwxr-xr-x    3 root     root             0 Jan  1  1970 pmu
drwxr-xr-x    2 root     root             0 Jun  9 14:35 power
drwxr-xr-x    4 root     root             0 Jan  1  1970 reg-dummy
drwxr-xr-x    4 root     root             0 Jan  1  1970 regulator-1p8v
drwxr-xr-x    4 root     root             0 Jan  1  1970 regulator-3p3v
drwxr-xr-x    4 root     root             0 Jan  1  1970 regulator-5v
drwxr-xr-x    3 root     root             0 Jun  9 14:35 regulatory.0
drwxr-xr-x    4 root     root             0 Jan  1  1970 serial8250
drwxr-xr-x    3 root     root             0 Jan  1  1970 timer
-rw-r--r--    1 root     root          4096 Jun  9 14:35 uevent

Image

lth@ncpws04:/tmp$ dumpimage -l lifeline-0.0.63-dev-mediatek-mt7623-bananapi_bpi-r2-squashfs-sysupgrade.itb 
Image contains unit addresses @, this will break signing
FIT description: ARM OpenWrt FIT (Flattened Image Tree)
Created:         Wed Jun  8 19:06:59 2022
 Image 0 (kernel-1)
  Description:  ARM OpenWrt Linux-5.15.34
  Created:      Wed Jun  8 19:06:59 2022
  Type:         Kernel Image
  Compression:  gzip compressed
  Data Size:    5829231 Bytes = 5692.61 KiB = 5.56 MiB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x80008000
  Entry Point:  0x80008000
  Hash algo:    crc32
  Hash value:   1492c2b5
  Hash algo:    sha1
  Hash value:   d50bca802e8b35ebb6fa998c7e75e42543bc8e82
 Image 1 (fdt-1)
  Description:  ARM OpenWrt bananapi_bpi-r2 device tree blob
  Created:      Wed Jun  8 19:06:59 2022
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    34375 Bytes = 33.57 KiB = 0.03 MiB
  Architecture: ARM
  Hash algo:    crc32
  Hash value:   0d29a71c
  Hash algo:    sha1
  Hash value:   c43349727efd6bfc7c719db7ec2958a74e88121b
 Image 2 (rootfs-1)
  Description:  ARM OpenWrt bananapi_bpi-r2 rootfs
  Created:      Wed Jun  8 19:06:59 2022
  Type:         Filesystem Image
  Compression:  uncompressed
  Data Size:    13963264 Bytes = 13636.00 KiB = 13.32 MiB
  Hash algo:    crc32
  Hash value:   dd16523e
  Hash algo:    sha1
  Hash value:   8a4803fbf84f88ed7228b0ce69a451e1fd590b25
 Default Configuration: 'config-1'
 Configuration 0 (config-1)
  Description:  OpenWrt bananapi_bpi-r2
  Kernel:       kernel-1
  FDT:          fdt-1
  Loadables:    rootfs-1

Miscellaneous Links